1 2014-11-20 Alan Modra <amodra@gmail.com>
3 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
5 2014-10-28 Alan Modra <amodra@gmail.com>
8 2014-10-22 Alan Modra <amodra@gmail.com>
9 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
12 2014-09-30 Cary Coutant <ccoutant@google.com>
15 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
17 2014-09-30 Kito Cheng <kito@0xlab.org>
20 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
21 hash table before sysv-style hash table.
23 2014-09-29 Sriraman Tallam <tmsriram@google.com>
25 * options.h (--pic-executable): Add negative to alias to -no-pie.
27 2014-09-26 Cary Coutant <ccoutant@google.com>
30 * object.cc (Sized_relobj_file): Compute value of section symbols
31 for TLS sections the same as TLS symbols.
33 2014-09-25 Cary Coutant <ccoutant@google.com>
36 * resolve.cc (Symbol_table::resolve): Override common placeholder
37 symbols, but adjust sizes.
38 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
39 symbols to common lists.
41 2014-09-24 Alan Modra <amodra@gmail.com>
43 * po/POTFILES.in: Regenerate.
45 2014-09-23 Taiju Tsuiki <tzik@google.com>
46 Cary Coutant <ccoutant@google.com>
49 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
50 on input_sections_blocker.
51 * layout.cc (Write_sections_task::locks): Unblock
52 input_sections_blocker_.
53 * layout.h (Write_sections_task::Write_sections_task): Add
54 input_sections_blocker.
55 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
57 * testsuite/Makefile.in: Regenerate.
59 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
61 * testsuite/Makefile.am (plugin_test_10): New test.
62 * testsuite/Makefile.in: Regenerate
63 * testsuite/plugin_common_test_2.c (c1): Align to 8.
64 * testsuite/plugin_test_10.sh: New file.
66 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
68 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
69 * resolve.cc (Symbol_table::resolve): Don't override common symbols
70 during the replacement phase.
72 2014-09-17 Han Shen <shenhan@google.com>
73 Jing Yu <jingyu@google.com>
75 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
76 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
77 * aarch64.cc (Target_aarch64): Add data members
78 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
79 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
81 (Target_aarch64::do_reloc_symbol_index): New method.
82 (Target_aarch64::do_reloc_addend): New method.
83 (Target_aarch64::add_tlsdesc_info): New method.
84 (Target_aarch64::do_dynsym_value): New method.
85 (Target_aarch64::do_make_data_plt): Add new parameters: got,
86 got_irelative. Pass them to Output_data_plt_aarch64_standard.
87 (Target_aarch64::make_data_plt): Add new parameters: got,
88 got_irelative. Pass them to do_make_data_plt.
89 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
90 (Target_aarch64::Relocate:tls_gd_to_le): New method.
91 (Target_aarch64::Relocate:tls_ie_to_le): New method.
92 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
93 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
94 (Target_aarch64::got_tlsdesc_section): New method.
95 (Target_aarch64::make_local_ifunc_plt_entry): New method.
96 (Target_aarch64::define_tls_base_symbol): New method.
97 (Target_aarch64::reserve_tlsdesc_entries): New method.
98 (Target_aarch64::got_mod_index_entry): New method.
99 (Target_aarch64::rela_tlsdesc_section): New method.
100 (Target_aarch64::rela_irelative_section): New method.
101 (Target_aarch64::Tlsdesc_info): New struct.
102 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
103 relocations and tlsdesc relocations.
104 (Target_aarch64::optimize_tls_reloc): Implement method.
105 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
106 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
108 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
109 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
110 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
111 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
112 (Output_data_plt_aarch64::rela_tlsdesc): New method.
113 (Output_data_plt_aarch64::rela_irelative): New method.
114 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
115 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
116 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
117 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
118 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
119 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
120 (Output_data_plt_aarch64_standard): New member variables:
121 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
122 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
123 New parameter: got, got_irelative.
124 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
125 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
126 (Output_data_plt_aarch64::do_write): Replace got_address with
127 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
128 (AArch64_relocate_functions::update_movnz): New method.
129 (AArch64_relocate_functions): Correct format.
130 (AArch64_relocate_functions::movnz): New method.
131 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
132 before the switch. Add new cases to switch.
133 Check ie_to_le relaxation on tlsie relocations. Add code handling
135 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
136 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
137 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
138 Call reloc_name_in_error_message to print unsupported reloc.
139 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
141 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
142 relocs. Fill in some more dynamic tags.
143 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
144 Skip call tls_get_addr when tlsgd is relaxed.
145 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
146 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
147 tlsdesc->ie relaxation.
149 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
151 * mips.cc (Target_mips_nacl): New class.
152 (Target_selector_mips_nacl): New class.
153 (target_selector_mips32): Rename from target_selector_mips32be and use
154 Target_selector_mips_nacl instead of Target_selector_mips.
155 (target_selector_mips32el): Rename from target_selector_mips32 and use
156 Target_selector_mips_nacl instead of Target_selector_mips.
157 (target_selector_mips64): Rename from target_selector_mips64be and use
158 Target_selector_mips_nacl instead of Target_selector_mips.
159 (target_selector_mips64el): Rename from target_selector_mips64 and use
160 Target_selector_mips_nacl instead of Target_selector_mips.
161 (Target_mips::mips_info): Add const attribute.
163 2014-09-02 Cary Coutant <ccoutant@google.com>
165 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
166 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
167 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
168 (Sized_incr_dynobj::do_section_name): Likewise.
169 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
170 (Sized_incr_dynobj::do_section_name): Likewise.
171 * object.h (Object::section_name): Likewise.
172 (Object::do_section_name): Likewise.
173 (Sized_relobj_file::do_section_name): Likewise.
174 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
175 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
177 2014-09-02 Cary Coutant <ccoutant@google.com>
180 * ehframe.cc (Fde::write): Add output_offset parameter.
181 (Cie::write): Likewise.
182 (Eh_frame::set_final_data_size): Account for offset within output
184 (Eh_frame::do_sized_write): Likewise.
185 * ehframe.h (Fde::write): Add output_offset parameter.
186 (Cie::write): Likewise.
187 * output.cc (Output_section::Input_section_sort_entry): Remove
188 section_has_name_; add output_section_name parameter. Use
189 output section name for non-input sections.
190 (Output_section::Input_section_sort_entry::section_has_name): Remove.
191 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
192 (Output_section::Input_section_sort_compare): Remove logic for
193 sections without names.
194 (Output_section::Input_section_sort_init_fini_compare): Likewise.
195 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
197 (Output_section::Input_section_sort_section_name_compare): Likewise.
199 2014-08-29 Han Shen <shenhan@google.com>
200 Jing Yu <jingyu@google.com>
202 * aarch64-reloc-property.cc
203 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
204 reference reloc property in the table.
205 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
207 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
208 2 new overloaded methods.
209 (Output_data_got_aarch64::do_write): Add code to write out
211 (class Output_data_got_aarch64::Static_reloc): New class to wrap
213 (Output_data_got_aarch64::static_relocs): New vector to
215 (Target_aarch64::TCB_SIZE): New const static memeber.
216 (Target_aarch64::tcb_size): New method.
217 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
218 (Target_aarch64::Relocate::relocate_tls): New method.
219 (Target_aarch64::Scan::local): Add code handling new reloc types.
220 (Target_aarch64::Scan::global): Add code handling new reloc types.
222 2014-08-13 Sriraman Tallam <tmsriram@google.com>
224 * options.h (-no-pie): Add option.
226 2014-08-08 Jing Yu <jingyu@google.com>
227 Han Shen <shenhan@google.com>
229 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
230 (DEFFILES): add aarch64-reloc.def.
231 (TARGETSOURCES): Add aarch64-reloc-property.cc.
232 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
233 * Makefile.in: Regenerate.
234 * aarch64-reloc-property.cc: New file.
235 * aarch64-reloc-property.h: New file.
236 * aarch64-reloc.def: New file.
237 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
238 with tab to make the format consistent.
239 (Output_data_got_aarch64::symbol_table_): New method.
240 (Target_aarch64::do_plt_address_for_global): New method.
241 (Target_aarch64::do_plt_address_for_local): New method.
242 (Target_aarch64::do_select_as_default_target): New method.
243 (Target_aarch64::do_make_data_plt): New method.
244 (Target_aarch64::make_data_plt): New method.
245 (Output_data_plt_aarch64::has_irelative_section): New method.
246 (Output_data_plt_aarch64::address_for_global): New method.
247 (Output_data_plt_aarch64::address_for_local): New method.
248 (Output_data_plt_aarch64::irelative_rel_): New parameter.
249 (Output_data_plt_aarch64::add_entry): Implement contents.
250 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
251 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
252 the got_pov entry to plt0.
253 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
255 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
256 (AArch64_howto): New struct.
257 (aarch64_howto[]): New static const array.
258 (AArch64_relocate_functions): New class.
259 (Target_aarch64::Scan::get_reference_flags): Remove method.
260 (Target_aarch64::Scan::local): Implement to support a few relocations.
261 (Target_aarch64::Scan::global): Implement to support a few relocations.
262 (Target_aarch64::make_plt_section): Implement contents.
263 (Target_aarch64::make_plt_entry): Implement contents.
264 (Target_aarch64::do_finalize_sections): Implement contents.
265 (Target_aarch64::Relocate::relocate): Implement a few relocations.
266 (Target_aarch64::relocate_section): Implement contents.
268 2014-08-06 Alan Modra <amodra@gmail.com>
270 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
272 2014-08-06 Alan Modra <amodra@gmail.com>
275 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
277 2014-07-21 Sriraman Tallam <tmsriram@google.com>
279 * object.cc (Relobj::is_section_name_included): Add
280 ".rodata.nptl_version" to not garbage collect this section.
282 2014-07-08 Cary Coutant <ccoutant@google.com>
284 * expression.cc (struct Expression::Expression_eval_info): Add
285 new fields type_pointer, vis_pointer, and nonvis_pointer.
286 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
287 nonvis_pointer parameters. Adjust all calls.
288 (Symbol_expression::value): Update type, visibility, and nonvis bits
290 * script.cc (Symbol_assignment::sized_finalize): Update type,
291 visibility, and remaining st_other bits for new symbol.
292 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
293 vis_pointer, and nonvis_pointer parameters.
294 * symtab.h (Symbol::set_type): New method.
296 * testsuite/Makefile.am (defsym_test): New test.
297 * testsuite/Makefile.in: Regenerate.
298 * testsuite/defsym_test.c: New file.
299 * testsuite/defsym_test.sh: New file.
301 2014-07-08 Cary Coutant <ccoutant@google.com>
304 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
305 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
306 (Sized_dynobj::base_read_symbols): ...new method.
307 * object.h (Sized_relobj_file::base_read_symbols): New method.
308 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
309 (Sized_relobj_file::base_read_symbols): ...new method.
310 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
311 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
312 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
314 2014-07-04 Alan Modra <amodra@gmail.com>
316 * po/POTFILES.in: Regenerate.
318 2014-07-02 Jing Yu <jingyu@google.com>
320 * aarch64.cc: New file
321 * Makefile.am (TARGETSOURCES): Add aarch64.cc
322 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
323 * Makefile.in: Regenerate.
324 * configure.tgt: Add entries for aarch64*.
325 * configure.ac: Likewise.
326 * configure: Likewise.
328 2014-06-27 Alan Modra <amodra@gmail.com>
330 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
332 2014-06-24 Cary Coutant <ccoutant@google.com>
334 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
336 (Dwo_file::sized_read_unit_index): Likewise.
338 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
341 * Makefile.am (TARGETSOURCES): Add mips.cc
342 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
343 * configure.tgt: Add entries for mips*.
344 * configure.ac: Likewise.
345 * Makefile.in: Regenerate.
346 * configure: Likewise.
348 2014-06-09 Cary Coutant <ccoutant@google.com>
350 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
351 unit_length is within section bounds.
353 2014-06-09 Cary Coutant <ccoutant@google.com>
356 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
359 2014-06-07 Alan Modra <amodra@gmail.com>
361 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
363 2014-06-06 Cary Coutant <ccoutant@google.com>
365 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
366 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
367 (Dwarf_pubnames_table::read_header): Likewise.
368 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
371 2014-06-05 Joel Brobecker <brobecker@adacore.com>
373 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
374 * Makefile.in, configure: Regenerate.
376 2014-06-03 Alan Modra <amodra@gmail.com>
378 * powerpc.cc (addis_12_2): Define.
379 (Stub_table::do_write): Support fusion on ELFv2 stubs.
381 2014-06-03 Alan Modra <amodra@gmail.com>
383 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
386 2014-06-02 Alan Modra <amodra@gmail.com>
388 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
389 Only ignore relocs on ELFv1.
390 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
392 2014-05-30 Cary Coutant <ccoutant@google.com>
394 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
395 * testsuite/Makefile.in: Regenerate.
396 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
398 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
401 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
402 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
404 2014-05-15 Alan Modra <amodra@gmail.com>
406 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
407 Compare FDE contents with DW_CFA_nop rather than 0.
409 2014-05-13 Sriraman Tallam <tmsriram@google.com>
411 * symtab.h (may_need_copy_reloc): Remove check for position independent
413 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
414 position independence before pc absolute may_need_copy_reloc call.
415 Add check for executable output befor pc relative may_need_copy_reloc
421 * powerpc.cc: Add check for no position independence before
422 may_need_copy_reloc calls.
423 * testsuite/pie_copyrelocs_test.cc: New file.
424 * testsuite/pie_copyrelocs_shared_test.cc: New file.
425 * Makefile.am (pie_copyrelocs_test): New test.
426 * Makefile.in: Regenerate.
428 2014-05-08 Martin Liška <mliska@suse.cz>
430 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
432 2014-05-06 Cary Coutant <ccoutant@google.com>
435 * i386.cc (Output_data_got_plt_i386): New class.
436 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
437 parameter. Change all callers.
438 (Output_data_plt_i386::layout_): Remove.
439 (Output_data_plt_i386::got_plt_): Change type.
440 (Target_i386::got_plt_): Change type. Change all references.
441 (Target_i386::got_section): Create instance of new class.
442 (Output_data_got_plt_i386::do_write): New function.
443 * x86_64.cc (Output_data_got_plt_x86_64): New class.
444 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
445 parameter. Change all callers.
446 (Output_data_plt_x86_64::layout_): Remove.
447 (Output_data_plt_x86_64::got_plt_): Change type.
448 (Target_x86_64::got_plt_): Change type. Change all references.
449 (Target_x86_64::got_section): Create instance of new class.
450 (Output_data_got_plt_x86_64::do_write): New function.
451 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
452 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
455 2014-05-05 Cary Coutant <ccoutant@google.com>
457 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
458 if we have pubnames/pubtypes.
460 2014-05-02 Cary Coutant <ccoutant@google.com>
462 * defstd.cc (in_segment): Define __ehdr_start here...
463 * layout.cc (Layout::finalize): ...Instead of here. Set the
464 output segment when known.
465 * resolve.cc (Symbol::override_base_with_special): Remember
466 the original binding.
467 * symtab.cc (Symbol::set_output_segment): New function.
468 (Symbol::set_undefined): New function.
469 * symtab.h (Symbol::is_weak_undefined): Check original undef
471 (Symbol::is_strong_undefined): New function.
472 (Symbol::set_output_segment): New function.
473 (Symbol::set_undefined): New function.
474 * target-reloc.h (is_strong_undefined): Remove.
475 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
476 Check for hidden undefs.
477 (relocate_section): Call Symbol::is_strong_undefined.
479 * testsuite/Makefile.am (ehdr_start_test_1)
480 (ehdr_start_test_2, ehdr_start_test_3)
481 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
482 * testsuite/Makefile.in: Regenerate.
483 * testsuite/ehdr_start_def.cc: New source file.
484 * testsuite/ehdr_start_test.cc: New source file.
485 * testsuite/ehdr_start_test.t: New linker script.
486 * testsuite/ehdr_start_test_4.sh: New shell script.
488 2014-04-23 Cary Coutant <ccoutant@google.com>
491 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
493 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
495 * layout.cc (Layout::include_section): Allow a target to decide
496 whether to include a section.
497 * target.h (Target::should_include_section): New function.
498 (Target::do_should_include_section): New function.
500 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
502 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
504 (Copy_relocs::emit): ... here.
505 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
506 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
507 (Copy_reloc_entry::entries_): Change from private to protected.
509 2014-04-02 Sriraman Tallam <tmsriram@google.com>
511 * icf.cc (get_section_contents): Replace copies of reloc
512 vectors with const references.
514 2014-04-02 Cary Coutant <ccoutant@google.com>
516 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
517 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
518 * configure: Regenerate.
519 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
520 -fno-use-linker-plugin.
521 (LINK1, CXXLINK1): Add it to the link command.
522 * testsuite/Makefile.in: Regenerate.
524 2014-03-12 Alan Modra <amodra@gmail.com>
526 * Makefile.in: Regenerate.
528 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
530 * symtab.h (Symbol::set_nonvis): New function.
532 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
534 * symtab.cc (Sized_symbol<32>::init_output_data):
535 Instantiate the template.
536 (Sized_symbol<64>::init_output_data): Likewise.
538 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
540 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
541 adjust dynamic symbol value.
542 * target.h (Target::adjust_dyn_symbol): New function.
543 (Target::do_adjust_dyn_symbol): New function.
545 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
547 * output.cc (Output_data_dynamic::Dynamic_entry::write):
548 Get the value of DYNAMIC_CUSTOM dynamic entry.
549 * output.h (Output_data_dynamic::add_custom): New function.
550 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
552 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
553 * target.h (Target::dynamic_tag_custom_value): New function.
554 (Target::do_dynamic_tag_custom_value): New function.
556 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
558 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
560 * target.h (Target::has_custom_set_dynsym_indexes): New function.
561 (Target::do_has_custom_set_dynsym_indexes): New function.
562 (Target::set_dynsym_indexes): New function.
563 (Target::do_set_dynsym_indexes): New function.
565 2014-03-07 Alan Modra <amodra@gmail.com>
567 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
568 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
569 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
570 (Powerpc_relocate_functions::has_overflow_bitfield,
571 overflowed): Use the above.
572 (Target_powerpc::Relocate::relocate): Correct overflow checking
573 for a number of relocations. Modify overflow test for 16-bit
574 fields in instructions to signed/unsigned according to whether
575 the field takes a signed or unsigned value.
577 2014-03-05 Alan Modra <amodra@gmail.com>
579 Update copyright years.
581 2014-03-05 Alan Modra <amodra@gmail.com>
583 * powerpc.cc (Target_powerpc::Scan::local, global): Support
584 R_PPC64_ADDR64_LOCAL.
585 (Target_powerpc::Relocate::relocate): Likewise.
587 2014-03-03 Alan Modra <amodra@gmail.com>
589 * dwp.cc (print_version): Update copyright year to current.
591 2014-02-10 Alan Modra <amodra@gmail.com>
593 * po/gold.pot: Regenerate.
595 2014-02-06 Cary Coutant <ccoutant@google.com>
597 Fix problem where -u is ignored when a weak undef is seen.
599 * archive.cc (Library_base::should_include_member): Reorder
600 code to check for -u option if a weak undef has already been seen.
601 * testsuite/Makefile.am (weak_undef_test_2): New test case.
602 * testsuite/Makefile.in: Regenerate.
603 * testsuite/weak_undef_file3.cc: New file.
604 * testsuite/weak_undef_file4.cc: New file.
605 * testsuite/weak_undef_test_2.cc: New file.
607 2014-02-05 Cary Coutant <ccoutant@google.com>
609 Fix issues with gold undefined symbol diagnostics.
612 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
614 * target-reloc.h (is_strong_undefined): New function.
615 (relocate_section): Move undef vtable symbol check from here.
616 Check for is_strong_undefined.
618 2014-02-05 Cary Coutant <ccoutant@google.com>
620 Fix problems with the --dynamic-list option.
623 * options.cc (General_options::parse_dynamic_list):
624 Set have_dynamic_list_.
625 (General_options::General_options): Initialize have_dynamic_list_.
626 (General_options::finalize): Turn off -Bsymbolic and
627 -Bsymbolic-functions if --dynamic-list provided.
628 * options.h (General_options::have_dynamic_list): New function.
629 (General_options::have_dynamic_list_): New data member.
630 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
634 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
635 in --dynamic-list, mark it.
637 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
638 (dynamic_list_2): New test case.
639 * testsuite/Makefile.in: Regenerate.
640 * testsuite/dynamic_list_2.cc: New file.
641 * testsuite/dynamic_list_2.t: New file.
642 * testsuite/dynamic_list_lib1.cc: New file.
643 * testsuite/dynamic_list_lib2.cc: New file.
644 * testsuite/gc_dynamic_list_test.c: New file.
645 * testsuite/gc_dynamic_list_test.sh: New file.
646 * testsuite/gc_dynamic_list_test.t: New file.
648 2014-01-28 Cary Coutant <ccoutant@google.com>
650 Add .gdb_index version 7 support.
652 * gold/dwarf_reader.cc: include <utility> (for make_pair).
653 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
655 (Dwarf_ranges_table::read_ranges_table): Likewise.
656 (Dwarf_pubnames_table::read_section): Check for GNU-style
657 sections, and for compressed debug sections.
658 (Dwarf_pubnames_table::read_header): Compute end address of table.
659 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
660 for end of list by offset, not by offset == 0.
661 (Dwarf_info_reader::do_read_string_table): Check for compressed
663 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
664 Initialize new data members.
665 (Dwarf_pubnames_table::next_name): return flag_byte.
666 (Dwarf_pubnames_table::end_of_table_): New data member.
667 (Dwarf_pubnames_table::is_gnu_style_): New data member.
668 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
669 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
670 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
671 read skeleton type unit DIEs.
672 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
673 (Gdb_index::do_write): Write flag_byte.
674 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
675 (Gdb_index::Cu_vector): Store flags along with cu indexes.
676 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
677 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
679 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
681 * version.cc (print_version): Update copyright year to 2014.
683 2013-12-19 Dimitry Andric <dimitry@andric.com>
685 * stringpool.cc (Stringpool_template::reserve): Add
686 HAVE_UNORDERED_MAP case.
687 * stringpool.cc (Stringpool_template::print_stats): Likewise.
689 2013-12-18 Cary Coutant <ccoutant@google.com>
691 * configure.ac: Check for <unordered_set> and <unordered_map>.
692 * config.in: Regenerate.
693 * configure: Regenerate.
694 * system.h: Use <unordered_set> and <unordered_map> if available.
696 2013-12-10 Roland McGrath <mcgrathr@google.com>
698 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
699 with $(INSTALL_PROGRAM_ENV).
700 * Makefile.in: Regenerate.
702 2013-11-22 Cary Coutant <ccoutant@google.com>
704 * configure.ac: Add check for which library is needed for
706 * configure: Regenerate.
708 2013-11-22 Cary Coutant <ccoutant@google.com>
710 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
712 * testsuite/Makefile.in: Regenerate.
714 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
716 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
717 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
718 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
719 (Target_x86_64<size>::Scan::local): Likewise.
720 (Target_x86_64<size>::Scan::global): Likewise.
721 (Target_x86_64<size>::Relocate::relocate): Likewise.
722 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
724 (Target_x86_64<size>::Scan::check_non_pic(): Handle
727 * testsuite/Makefile.am (check_PROGRAMS): Add
728 exception_x86_64_bnd_test.
729 (exception_x86_64_bnd_test_SOURCES): New macro.
730 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
731 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
732 (exception_x86_64_bnd_test_LDADD): Likewise.
733 (exception_x86_64_bnd_1.o): New rule.
734 (exception_x86_64_bnd_2.o): Likewise.
735 * testsuite/Makefile.in: Regenerated.
737 2013-11-15 Alan Modra <amodra@gmail.com>
739 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
741 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
742 Only call ppc64_local_entry_offset for 64-bit. Restrict
743 symval_for_branch lookup to ELFv1.
744 (Stub_table::add_plt_call_entry): Use unsigned int off.
745 (Output_data_glink::Address, invalid_address): New.
746 (Output_data_glink::add_eh_frame): Move out of line. Add
748 (Output_data_glink::add_global_entry, find_global_entry,
749 global_entry_address): New functions.
750 (Output_data_glink::global_entry_stubs_, end_branch_table_,
751 ge_size): New variables.
752 (Output_data_glink::set_final_data_size): Add global entry
754 (Output_data_glink::do_write): Write global entry stubs.
755 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
756 parameter. Return true for ELFv2. Adjust callers.
757 (Target_powerpc::Scan::local, global): Restrict opd lookup to
758 ELFv1. Similarly for ifunc and dynamic relocation processing
759 specific to ELFv1. Recognize that symbols are defined on
760 their plt entries for ELFv2.
761 (Target_powerpc::symval_for_branch): Assert if called for
763 (Target_powerpc::Relocate::relocate): Use global entry plt
764 stub for symbol value if such exists on ELFv2.
765 (Target_powerpc::Relocate::relocate): Don't call
766 symval_for_branch when ELFv2. Do adjust for local entry
768 (Target_powerpc::do_dynsym_value): Set symbols to global entry
770 (Target_powerpc::do_plt_address_for_global): Similarly.
772 2013-11-14 Cary Coutant <ccoutant@google.com>
774 Revert patch -- this did not fix the problem, and there is
777 2013-11-14 Cary Coutant <ccoutant@google.com>
780 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
781 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
782 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
783 updating fde_offsets_.
784 (Eh_frame_hdr::lock_): New data member.
786 2013-11-14 Cary Coutant <ccoutant@google.com>
788 * dwp.cc (Dwo_file_entry): New type.
789 (File_list): Use Dwo_file_entry.
790 (Dwo_file::verify): New function.
791 (Dwo_file::verify_dwo_list): New function.
792 (Dwo_file::sized_verify_dwo_list): New function.
793 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
795 (Dwp_options): New enum type.
796 (dwp_options): Add --verify-only.
799 * dwp.h (gold_info): Add declaration.
801 2013-11-14 Cary Coutant <ccoutant@google.com>
804 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
805 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
806 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
807 updating fde_offsets_.
808 (Eh_frame_hdr::lock_): New data member.
810 2013-11-06 Cary Coutant <ccoutant@google.com>
813 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
814 before reloc sections.
816 2013-11-04 Alan Modra <amodra@gmail.com>
818 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
819 (Symbol::needs_dynamic_reloc): Test new flag.
820 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
821 (Target_powerpc::Scan::get_reference_flags): Add target param.
822 Return FUNC_DESC_ABI for 64-bit ELFv1.
823 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
825 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
826 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
828 2013-10-31 Cary Coutant <ccoutant@google.com>
830 Restore support for dwp v2 DWARF package file format.
832 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
833 tu_length parameter. Adjust all callers.
834 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
835 * dwp.cc: Include dwarf.h.
836 (Section_bounds): New struct type.
837 (Unit_set): New struct type.
838 (Dwo_file::Dwo_file): Initialize new data member.
839 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
840 Combine and rename to...
841 (Dwo_file::read_unit_index): ...this.
842 (Dwo_file::sized_read_compunit_index)
843 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
844 (Dwo_file::sized_read_unit_index): ...this.
845 (Dwo_file::copy_section): Remove section_name, is_str_offsets
846 parameters; add section_id parameter.
847 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
848 (Dwo_file::add_unit_set): ...this.
849 (Dwo_file::shndx_map_): Remove.
850 (Dwo_file::sect_offsets_): New data member.
851 (Dwp_output_file::Dwp_output_file): Initialize new data members.
852 (Dwp_output_file::add_section): Rename to...
853 (Dwp_output_file::add_contribution): ...this.
854 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
855 (Dwp_output_file::add_tu_set): Likewise.
856 (Dwp_output_file::Contribution): New type.
857 (Dwp_output_file::Section::contributions): New data member.
858 (Dwp_output_file::Cu_or_tu_set): Remove.
859 (Dwp_output_file::Section::Section): New ctor.
860 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
861 (Dwp_output_file::Dwp_index::Section_table): New type.
862 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
863 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
865 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
866 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
867 (Dwp_output_file::Dwp_index::section_table): New member function.
868 (Dwp_output_file::Dwp_index::section_table_end): New member function.
869 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
870 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
871 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
872 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
873 (Dwp_output_file::Dwp_index::section_table_): New data member.
874 (Dwp_output_file::Dwp_index::section_mask_): New data member.
875 (Dwp_output_file::add_output_section): New member function.
876 (Dwp_output_file::write_new_section): New member function.
877 (Dwp_output_file::write_contributions): New member function.
878 (Dwp_output_file::section_id_map_): New data member.
879 (class Dwo_id_info_reader): Remove.
880 (class Unit_reader): New class.
881 (get_dwarf_section_name): New function.
882 (Dwo_file::read_executable): Adjust initializations of class data.
883 (Dwo_file::read): Add support for v2 package file format.
884 (Dwo_file::read_unit_index): Likewise.
885 (Dwo_file::sized_read_unit_index): Likewise.
886 (Dwo_file::copy_section): Likewise.
887 (Dwo_file::add_unit_set): Likewise.
888 (Dwp_output_file::add_output_section): Likewise.
889 (Dwp_output_file::add_contribution): Likewise.
890 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
892 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
894 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
896 (Dwp_output_file::initialize): Remove unused function.
897 (Dwp_output_file::finalize): Add support for v2 package file format.
898 (Dwp_output_file::write_index): Likewise.
899 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
902 2013-10-31 Cary Coutant <ccoutant@google.com>
904 * configure.ac: Fix check for -fmerge-constants.
905 * configure.ac: Regenerate.
907 2013-10-30 Roland McGrath <mcgrathr@google.com>
909 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
910 Correct 9-byte nop sequence to match what the assembler generates.
912 2013-10-30 Alan Modra <amodra@gmail.com>
914 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
915 ppc64_local_entry_offset, ppc64_local_entry_offset,
916 do_read_symbols): New functions.
917 (Powerpc_relobj::e_flags_, st_other_): New vars.
918 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
919 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
920 (Powerpc_relobj::e_flags_): New var.
921 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
922 and adjust for ELFv2.
923 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
924 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
925 (Powerpc_dynobj::do_find_special_sections): Likewise.
926 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
927 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
928 to ELFv2 local entry.
929 (Target_powerpc::do_relax): No thread safe barriers needed for
931 (Output_data_plt_powerpc::initial_plt_entry_size_,
932 plt_entry_size): Delete. Replace all uses with
933 first_plt_entry_offset() and plt_entry_size().
934 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
935 reserved_size parm. Update callers.
936 (Output_data_plt_powerpc::entry_count): Update.
937 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
938 and use Target_powerpc::first_plt_entry_offset().
939 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
940 rename to plt_entry_size.
941 (Output_data_plt_powerpc::add_ifunc_entry,
942 add_local_ifunc_entry): Adjust reloc for ELFv2.
943 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
944 (glink_eh_frame_fde_64v2): New.
945 (Stub_table::plt_call_size): Support ELFv2 sizing.
946 (Output_data_glink::add_eh_frame): Use the new FDE.
947 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
948 (Stub_table::do_write): Write ELFv2 stubs and glink.
949 (Target_powerpc::Relocate::relocate): Replaces nop after call
950 with ld 2,24(1) and adjust local offset destination for ELFv2.
952 2013-10-30 Alan Modra <amodra@gmail.com>
954 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
955 (Target_powerpc::Scan::global, local): Likewise.
956 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
957 on all ppc64 @h and @ha relocs.
959 2013-10-14 Alan Modra <amodra@gmail.com>
961 * output.h (Output_data_got::add_constant): Tidy.
962 (Output_data_got::add_constant_pair): New function.
963 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
964 methods used so as to first call reserve_ent().
966 2013-10-11 Roland McGrath <mcgrathr@google.com>
968 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
969 add_got_entry and add_got_entry_pair.
971 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
972 (HAVE_PUBNAMES): Likewise.
973 * configure: Regenerate.
975 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
976 * testsuite/Makefile.in: Regenerate.
978 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
979 Remove const from declaration.
980 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
981 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
982 * output.h (Output_file_header): Remove const from member target_
983 and corresponding constructor argument.
984 * output.cc (Output_file_header::Output_file_header): Update prototype.
985 (Output_file_header::do_sized_write): Use this->target_ in place
986 of parameters()->target().
988 * testsuite/undef_symbol.cc (Foo::get_a): New method.
990 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
991 * configure: Regenerate.
992 * Makefile.in: Regenerate.
993 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
994 * testsuite/merge_string_literals_2.c: Likewise.
995 * testsuite/Makefile.am
996 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
997 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
998 literal -fmerge-constants.
999 * testsuite/Makefile.in: Regenerate.
1001 * i386.cc (Target_i386): Remove unused member dynbss_.
1002 * arm.cc (Target_arm): Likewise.
1003 * powerpc.cc (Target_powerpc): Likewise.
1004 * sparc.cc (Target_sparc): Likewise.
1005 * tilegx.cc (Target_tilegx): Likewise.
1006 * x86_64.cc (Target_x86_64): Likewise.
1007 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1008 type_signature_, type_offset_.
1009 * plugin.h (Plugin_hook): Remove unused member layout_.
1010 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1012 (Read_member): Remove unused members input_objects_, symtab_,
1014 (Check_library): Remove unused member symtab_.
1015 * archive.h (Lib_group): Remove unused member lib_.
1016 * archive.cc (Lib_group::Lib_group): Update initializer.
1017 * incremental.h (Incremental_binary): Remove unused member target_.
1018 (Incremental_script_entry): Removed unused member script_.
1019 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1020 * icf.h (Icf): Remove unused member num_tracked_relocs.
1022 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1023 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1025 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1027 * archive.h: Use struct rather than class for forward declaration
1028 of Read_symbols_data.
1030 2013-10-07 Cary Coutant <ccoutant@google.com>
1033 * testsuite/Makefile.am (icf_test): Fix dependencies.
1034 (icf_safe_test): Likewise.
1035 (icf_safe_so_test): Likewise.
1036 (large_symbol_alignment): Add empty _LDADD rule.
1037 * testsuite/Makefile.in: Regenerate.
1039 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1042 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1043 relocation for R_X86_64_32 on x32.
1045 2013-08-27 Roland McGrath <mcgrathr@google.com>
1047 * output.cc (Output_segment::set_section_addresses): Take new
1048 Target* argument. If target->isolate_execinstr() and the segment
1049 is executable and starts at a target->abi_pagesize() boundary,
1050 pad its end out to a target->abi_pagesize() boundary with code fill.
1051 * output.h (Output_segment::set_section_addresses): Update decl.
1052 * layout.h (Layout::check_output_data_for_reset_values): Take new
1053 argument RELAX_OUTPUTS.
1054 (Layout): New member relax_output_list_.
1055 (Layout::add_relax_output): New method.
1056 * layout.cc (Layout::Layout): Update constructor.
1057 (Layout::reset_relax_output): New method.
1058 (Layout::clean_up_after_relaxation): Call it.
1059 (Layout::prepare_for_relaxation): Update caller.
1060 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1061 Call reset_relax_output before re-processing segments for
1062 isolate_execinstr case.
1063 (Layout::write_data): Handle relax_output_list_.
1064 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1065 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1067 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1070 * object.h: Fix typos.
1072 2013-08-16 Roland McGrath <mcgrathr@google.com>
1074 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1075 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1077 2013-08-07 Cary Coutant <ccoutant@google.com>
1079 Revert support for v2 DWP files:
1081 2013-03-01 Cary Coutant <ccoutant@google.com>
1083 Add dwp support for v2 DWARF package file format.
1084 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1085 tu_length parameter. Adjust all callers.
1086 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1087 * dwp.cc: Include dwarf.h.
1088 (Section_bounds): New struct type.
1089 (Unit_set): New struct type.
1090 (Dwo_file::Dwo_file): Initialize new data member.
1091 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1092 Combine and rename to...
1093 (Dwo_file::read_unit_index): ...this.
1094 (Dwo_file::sized_read_compunit_index)
1095 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1096 (Dwo_file::sized_read_unit_index): ...this.
1097 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1098 parameters; add section_id parameter.
1099 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1100 (Dwo_file::add_unit_set): ...this.
1101 (Dwo_file::shndx_map_): Remove.
1102 (Dwo_file::sect_offsets_): New data member.
1103 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1104 (Dwp_output_file::add_section): Rename to...
1105 (Dwp_output_file::add_contribution): ...this.
1106 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1107 (Dwp_output_file::add_tu_set): Likewise.
1108 (Dwp_output_file::Contribution): New type.
1109 (Dwp_output_file::Section::contributions): New data member.
1110 (Dwp_output_file::Cu_or_tu_set): Remove.
1111 (Dwp_output_file::Section::Section): New ctor.
1112 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1113 (Dwp_output_file::Dwp_index::Section_table): New type.
1114 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1115 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1117 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1118 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1119 (Dwp_output_file::Dwp_index::section_table): New member function.
1120 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1121 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1122 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1123 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1124 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1125 (Dwp_output_file::Dwp_index::section_table_): New data member.
1126 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1127 (Dwp_output_file::add_output_section): New member function.
1128 (Dwp_output_file::write_new_section): New member function.
1129 (Dwp_output_file::write_contributions): New member function.
1130 (Dwp_output_file::section_id_map_): New data member.
1131 (class Dwo_id_info_reader): Remove.
1132 (class Unit_reader): New class.
1133 (get_dwarf_section_name): New function.
1134 (Dwo_file::read_executable): Adjust initializations of class data.
1135 (Dwo_file::read): Add support for v2 package file format.
1136 (Dwo_file::read_unit_index): Likewise.
1137 (Dwo_file::sized_read_unit_index): Likewise.
1138 (Dwo_file::copy_section): Likewise.
1139 (Dwo_file::add_unit_set): Likewise.
1140 (Dwp_output_file::add_output_section): Likewise.
1141 (Dwp_output_file::add_contribution): Likewise.
1142 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1144 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1146 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1148 (Dwp_output_file::initialize): Remove unused function.
1149 (Dwp_output_file::finalize): Add support for v2 package file format.
1150 (Dwp_output_file::write_index): Likewise.
1151 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1154 2013-07-31 Cary Coutant <ccoutant@google.com>
1156 * object.cc (Sized_relobj::do_output_section_address): New function.
1157 (Sized_relobj): Instantiate explicitly.
1158 * object.h (Object::output_section_address): New function.
1159 (Object::do_output_section_address): New function.
1160 (Sized_relobj::do_output_section_address): New function.
1161 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1163 2013-07-30 Cary Coutant <ccoutant@google.com>
1164 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1166 * parameters.cc (Parameters::entry): Return target-specific entry
1168 * target.h (Target::entry_symbol_name): New function.
1169 (Target_info::entry_symbol_name): New data member.
1171 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1172 * i386.cc (Target_i386::i386_info): Likewise.
1173 (Target_i386_nacl::i386_nacl_info): Likewise.
1174 * sparc.cc (Target_sparc::sparc_info): Likewise.
1175 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1176 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1177 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1178 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1180 2013-07-22 Sterling Augustine <saugustine@google.com>
1182 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1183 Convert parameter shndx to local variable. Add parameters symtab
1184 and symtab_size. Scan over section names. Find relocation
1185 section corresponding to current section. Create and initialize
1186 reloc_mapper_ and reloc_type_.
1187 (Dwarf_pubnames_table::read_header): Add assertion. Change
1188 unit_length to off_t. Initialize member unit_length_. Fill in field
1190 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1191 Initialize new fields unit_length_ and cu_offset_.
1192 (Dwarf_pubnames_table::read_section): Update prototype.
1193 (Dwarf_pubnames_table::cu_offset): New member function.
1194 (Dwarf_pubnames_table::subsection_size): Likewise.
1195 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1197 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1198 member functions public.
1199 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1200 Update comment. Rework logic. Move repeated parts to...
1201 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1202 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1203 pubtypes_table_, and stmt_list_offset.
1204 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1205 Gdb_index::find_pubtype_offset,
1206 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1207 (Gdb_index::pubnames_read): Update prototype and rework logic.
1208 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1210 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1211 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1212 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1213 Gdb_index::map_pubtable_to_dies):
1215 (Gdb_index::pubnames_read): Update declaration.
1216 (Gdb_index::Pubname_offset_map): New type.
1217 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1218 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1219 Gdb_index::stmt_list_offset): Declare.
1220 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1221 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1222 Gdb_index::pubtypes_offset_): Remove.
1224 2013-07-19 Roland McGrath <mcgrathr@google.com>
1226 * options.h (General_options): Add -Trodata-segment option.
1227 * parameters.cc (Parameters::check_rodata_segment): New function.
1228 (Parameters::set_target_once): Call it.
1229 * parameters.h (Parameters): Declare it (private member function).
1230 * layout.cc (load_seg_unusable_for_headers): New function, broken
1231 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1232 then validate rodata segment rather than text segment.
1233 (relaxation_loop_body): Call that.
1234 (is_text_segment): New function. Don't admit a non-executable
1235 segment if TARGET->isolate_execinstr().
1236 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1238 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1241 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1242 * nacl.h (Sniff_file::View::View): Request aligned view.
1244 2013-07-11 Cary Coutant <ccoutant@google.com>
1246 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1247 correct BRLT entry size.
1249 2013-07-03 Alan Modra <amodra@gmail.com>
1251 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1254 2013-07-01 Cary Coutant <ccoutant@google.com>
1256 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1258 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1259 (Dwarf_ranges_table::lookup_reloc): New function.
1260 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1262 (Dwarf_ranges_table::lookup_reloc): New function.
1263 (Dwarf_ranges_table::reloc_type_): New data member.
1265 2013-06-27 Jing Yu <jingyu@google.com>
1268 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1270 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1271 (Target_powerpc::do_relax): Call the above.
1273 2013-06-27 Cary Coutant <ccoutant@google.com>
1275 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1276 on garbage collected .opd section.
1278 2013-06-27 Alan Modra <amodra@gmail.com>
1280 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1282 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1283 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1285 2013-06-14 Cary Coutant <ccoutant@google.com>
1287 * resolve.cc (Symbol::override_base): Don't override st_type
1288 from plugin placeholder symbols.
1289 (Symbol_table::resolve): Likewise.
1290 (Symbol_table::should_override): Don't complain about TLS mismatch
1291 if the TO symbol is a plugin placeholder.
1292 * testsuite/Makefile.am (plugin_test_tls): New test.
1293 * testsuite/Makefile.in: Regenerate.
1294 * testsuite/plugin_test_tls.sh: New test script.
1295 * testsuite/two_file_test_2_tls.cc: New test source.
1296 * testsuite/two_file_test_tls.cc: New test source.
1298 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1300 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1301 the maximum segment alignment is larger than the page size.
1302 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1303 correctly aligns the symbols with large alignemnt.
1304 * testsuite/Makefile.in: Regenerate.
1305 * testsuite/large_symbol_alignment.cc: New file.
1307 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1308 Sriraman Tallam <tmsriram@google.com>
1310 * options.h (sort_section): New option.
1311 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1312 Rename from Input_section_sort_section_name_special_ordering_compare.
1313 (Input_section_sort_section_name_compare): New struct.
1314 * output.cc (Output_section::Input_section_sort_section_name_compare::
1315 operator()): New function.
1316 (Output_section::sort_attached_input_sections): Use new sort function
1317 for .text if --sort-section=name is specified.
1318 * layout.cc (Layout::make_output_section):
1319 Add sorting by name when --sort-section=name is specified.
1320 * testsuite/Makefile.am (text_section_grouping): Test option
1321 --sort-section=name.
1322 * testsuite/Makefile.in: Regenerate.
1323 * testsuite/section_sorting_name.cc: New file.
1324 * testsuite/section_sorting_name.sh: New file.
1326 2013-05-21 Cary Coutant <ccoutant@google.com>
1328 * symtab.h (Symbol::is_cxx_vtable): New function.
1329 * target-reloc.h (relocate_section): Check for vtable symbol.
1330 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1331 * testsuite/Makefile.in: Regenerate.
1332 * testsuite/missing_key_func.cc: New test source.
1333 * testsuite/missing_key_func.sh: New test script.
1335 2013-05-21 Cary Coutant <ccoutant@google.com>
1337 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1338 type of enclosing symbol.
1339 (Relocate_info::location): Check symbol type when describing symbol.
1340 * object.h (Symbol_location_info): Remove unused line_number;
1341 add enclosing_symbol_type.
1342 * testsuite/debug_msg.sh: Adjust expected output.
1344 2013-05-13 Cary Coutant <ccoutant@google.com>
1346 * configure.ac: Export DEFAULT_TARGET.
1347 * configure: Regenerate.
1348 * Makefile.in: Regenerate.
1349 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1350 * testsuite/Makefile.in: Regenerate.
1351 * testsuite/debug_msg.sh: Delete duplicate tests.
1352 Don't check undef_int error message match for powerpc where the
1353 source file and line number aren't available.
1355 2013-05-10 Roland McGrath <mcgrathr@google.com>
1357 * options.h (General_options): Add --rosegment-gap option.
1358 * options.cc (finalize): --rosegment-gap implies --rosegment.
1359 * layout.cc (set_segment_offsets): Let user option override
1360 target->rosegment_gap().
1362 2013-05-10 Roland McGrath <mcgrathr@google.com>
1364 * options.h (General_options): Remove leading space from help
1365 messages for -nostdlib and --rosegment.
1367 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1370 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1372 2013-05-03 Alan Modra <amodra@gmail.com>
1374 * merge.cc (Output_merge_string::do_add_input_section): Correct
1375 scan for number of strings. Rename vars to avoid shadowing.
1376 Include missing terminator in input_size_.
1378 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1380 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1381 Restore empty string handling.
1383 2013-05-01 Cary Coutant <ccoutant@google.com>
1385 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1386 uninitialized warning.
1388 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1390 * output.cc (Output_section::add_merge_input_section): Allow
1391 to merge sections if the alignment is more than character size.
1392 * merge.h (Output_merge_string::Output_merge_string): Remove
1394 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1395 only not-null strings. Check the alignment of strings.
1397 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1398 alignment as the argument.
1399 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1400 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1401 Align non-zero length strings according to the addralign_.
1402 (Stringpool_template<Stringpool_char>::set_string_offsets):
1403 Updating offsets according to the given alignment.
1404 * testsuite/Makefile.am (text_section_grouping): Test if string
1405 literals are getting merged.
1406 * testsuite/Makefile.in: Regenerate.
1407 * testsuite/merge_string_literals_1.c: New file.
1408 * testsuite/merge_string_literals_2.c: Ditto.
1409 * testsuite/merge_string_literals.sh: Ditto.
1411 2013-04-26 Ian Lance Taylor <iant@google.com>
1413 * target-reloc.h (relocate_section): If the reloc offset is out of
1414 range, pass VIEW as NULL to relocate.relocate.
1415 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1416 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1417 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1418 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1419 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1420 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1422 2013-04-26 Geoff Pike <gpike@chromium.org>
1424 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1425 * layout.cc (Hash_task): New class.
1426 (Layout::queue_build_id_tasks): New function.
1427 (Layout::write_build_id): Handle single-thread portion of build ID
1428 computation. (In some cases, all of it is single-threaded.) Replace
1429 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1430 functionality in fewer lines of code.
1431 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1432 * options.h (General_options): make "--build-id" default to tree
1433 rather than sha1. Add two new options related to --build-id=tree:
1434 --build-id-chunk-size-for-treehash and
1435 --build-id-min-file-size-for-treehash.
1436 * Makefile.am: add testing of --build-id=tree and related new options
1437 (these tests will be invoked by "make check").
1438 * Makefile.in: Regenerate.
1440 2013-04-25 Alan Modra <amodra@gmail.com>
1442 * configure.tgt: Add powerpcle and powerpc64le.
1444 2013-04-22 Alan Modra <amodra@gmail.com>
1447 * layout.cc (Layout::segment_precedes): Allow more than one
1448 segment with the same type and flags.
1450 2013-04-15 Cary Coutant <ccoutant@google.com>
1452 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1453 allocate space in file for BSS sections.
1455 2013-04-15 Cary Coutant <ccoutant@google.com>
1457 * script-sections.cc (Orphan_output_section): Reset address
1458 to zero after each orphaned section for relocatable links.
1460 2013-04-15 Cary Coutant <ccoutant@google.com>
1462 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1463 section starting address for relocatable link.
1464 * testsuite/Makefile.am (script_test_11): New test.
1465 * testsuite/Makefile.in: Regenerate.
1466 * testsuite/script_test_11.c: New source file.
1467 * testsuite/script_test_11.t: New linker script.
1469 2013-04-13 Alan Modra <amodra@gmail.com>
1471 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1472 owner when sections are not adjacent and exceed group size.
1473 (Target_powerpc::group_sections): Handle corner case.
1474 (Target_powerpc::Branch_info::make_stub): Handle case where
1475 stub table doesn't exist due to branches in non-exec sections.
1476 (Target_powerpc::Relocate::relocate): Likewise.
1478 2013-04-11 Alan Modra <amodra@gmail.com>
1481 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1482 .branch_lt to match bfd ld. Adjust comments throughout file.
1484 2013-04-04 Ian Lance Taylor <iant@google.com>
1487 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1488 sections before checking whether they are included in the link.
1490 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1492 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1493 object before calling the plugin claim_file handler. Pass the elf
1494 object of the archive to the plugin. Delete the elf object if the
1495 plugin claims the file.
1497 2013-03-21 Alan Modra <amodra@gmail.com>
1499 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1500 segment when omagic.
1502 2013-03-21 Alan Modra <amodra@gmail.com>
1504 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1506 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1507 uninitialized" warning.
1509 2013-03-20 Alan Modra <amodra@gmail.com>
1511 * symtab.h (Symbol::clear_version): New function.
1512 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1513 is_needed by weak references. Clear version for symbols defined
1514 in as-needed objects that are not needed.
1516 2013-03-15 Alan Modra <amodra@gmail.com>
1518 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1519 static and public. Add report_err param. Return false for data refs.
1520 (Target_powerpc::rela_dyn_section): New overloaded function.
1521 (Target_powerpc::plt_, iplt_): Elucidate.
1522 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1523 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1524 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1525 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1526 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1527 push_branch and make_plt_entry for ifunc syms when
1528 reloc_needs_plt_for_ifunc.
1529 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1530 for ifunc unless reloc_needs_plt_for_ifunc.
1532 2013-03-15 Alan Modra <amodra@gmail.com>
1534 * gc.h (gc_process_relocs): Don't look through function descriptors.
1535 * icf.cc (get_section_contents): Do so here instead.
1537 2013-03-13 Alan Modra <amodra@gmail.com>
1539 * powerpc.cc (is_branch_reloc): Forward declare.
1540 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1541 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1542 false for 64-bit, true for 32-bit non-branch relocs.
1543 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1544 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1546 (icf_safe_test): Generate linker map file as well as nm output.
1547 (icf_safe_so_test): Likewise.
1548 * testsuite/Makefile.in: Regenerate.
1549 * testsuite/icf_test.sh: Parse linker map file to determine
1551 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1552 * testsuite/icf_safe_so_test.sh: Likewise.
1553 (X86_32_or_ARM_specific_safe_fold): Merge into..
1554 (arch_specific_safe_fold): ..this.
1555 (X86_64_specific_safe_fold): Delete unused function.
1557 2013-03-12 Alan Modra <amodra@gmail.com>
1559 * gc.h (gc_process_relocs): Look through function descriptors
1560 to determine shndx, symvalue and addend used by ICF. Tidy
1561 variable duplication.
1563 2013-03-11 Alan Modra <amodra@gmail.com>
1565 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1566 * layout.cc (Layout_task_runner::run): ..to here.
1567 * symtab.h (struct Symbol_location): Extract from..
1568 (class Symbol_table): ..here.
1569 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1570 * target.h (class Target): Add function_location and
1571 do_function_location functions.
1572 (class Sized_target): Add do_function_location.
1573 * object.h (class Sized_relobj_file): Move find_shdr..
1574 (class Object): ..to here.
1575 * object.cc: Likewise. Update to suit. Instantiate.
1576 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1577 * powerpc.cc (class Powerpc_dynobj): New.
1578 (Target_powerpc::do_function_location): New function.
1579 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1580 (Powerpc_dynobj::do_read_symbols): New function.
1581 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1583 2013-03-08 Ian Lance Taylor <iant@google.com>
1585 * options.cc (General_options::string_to_object_format): Accept
1588 2013-03-08 Alan Modra <amodra@gmail.com>
1590 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1591 pointer to Post_fde.
1592 (struct Post_fde): Move definition to here..
1593 * ehframe.cc (struct Post_fde): ..from here.
1594 (Cie::write): Don't alloc Post_fde.
1595 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1597 2013-03-07 Alan Modra <amodra@gmail.com>
1599 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1600 relocation referencing .LC0.
1601 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1603 2013-03-07 Alan Modra <amodra@gmail.com>
1605 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1606 always_inline. Add assembly for powerpc to avoid GOT.
1608 2013-03-07 Alan Modra <amodra@gmail.com>
1610 * testsuite/script_test_10.sh: Don't test .bss section
1613 2013-03-06 Alan Modra <amodra@gmail.com>
1615 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1616 (Target_powerpc::symval_for_branch): Add symtab param. Update
1617 all callers. Handle folded sections.
1618 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1620 (Global_symbol_visitor_opd::operator()): Likewise.
1622 2013-03-04 Alan Modra <amodra@gmail.com>
1624 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1625 * testsuite/Makefile.in: Regenerate.
1627 2013-03-01 Cary Coutant <ccoutant@google.com>
1629 Add dwp support for v2 DWARF package file format.
1630 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1631 tu_length parameter. Adjust all callers.
1632 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1633 * dwp.cc: Include dwarf.h.
1634 (Section_bounds): New struct type.
1635 (Unit_set): New struct type.
1636 (Dwo_file::Dwo_file): Initialize new data member.
1637 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1638 Combine and rename to...
1639 (Dwo_file::read_unit_index): ...this.
1640 (Dwo_file::sized_read_compunit_index)
1641 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1642 (Dwo_file::sized_read_unit_index): ...this.
1643 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1644 parameters; add section_id parameter.
1645 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1646 (Dwo_file::add_unit_set): ...this.
1647 (Dwo_file::shndx_map_): Remove.
1648 (Dwo_file::sect_offsets_): New data member.
1649 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1650 (Dwp_output_file::add_section): Rename to...
1651 (Dwp_output_file::add_contribution): ...this.
1652 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1653 (Dwp_output_file::add_tu_set): Likewise.
1654 (Dwp_output_file::Contribution): New type.
1655 (Dwp_output_file::Section::contributions): New data member.
1656 (Dwp_output_file::Cu_or_tu_set): Remove.
1657 (Dwp_output_file::Section::Section): New ctor.
1658 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1659 (Dwp_output_file::Dwp_index::Section_table): New type.
1660 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1661 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1663 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1664 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1665 (Dwp_output_file::Dwp_index::section_table): New member function.
1666 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1667 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1668 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1669 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1670 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1671 (Dwp_output_file::Dwp_index::section_table_): New data member.
1672 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1673 (Dwp_output_file::add_output_section): New member function.
1674 (Dwp_output_file::write_new_section): New member function.
1675 (Dwp_output_file::write_contributions): New member function.
1676 (Dwp_output_file::section_id_map_): New data member.
1677 (class Dwo_id_info_reader): Remove.
1678 (class Unit_reader): New class.
1679 (get_dwarf_section_name): New function.
1680 (Dwo_file::read_executable): Adjust initializations of class data.
1681 (Dwo_file::read): Add support for v2 package file format.
1682 (Dwo_file::read_unit_index): Likewise.
1683 (Dwo_file::sized_read_unit_index): Likewise.
1684 (Dwo_file::copy_section): Likewise.
1685 (Dwo_file::add_unit_set): Likewise.
1686 (Dwp_output_file::add_output_section): Likewise.
1687 (Dwp_output_file::add_contribution): Likewise.
1688 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1690 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1692 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1694 (Dwp_output_file::initialize): Remove unused function.
1695 (Dwp_output_file::finalize): Add support for v2 package file format.
1696 (Dwp_output_file::write_index): Likewise.
1697 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1700 2013-03-01 Cary Coutant <ccoutant@google.com>
1702 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1703 function into class definition in header file.
1704 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1705 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1707 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1709 2013-02-28 Alan Modra <amodra@gmail.com>
1711 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1712 * target.cc (Target::do_plt_fde_location): New function.
1713 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1714 accessor function, and constructor param.
1715 (struct Post_fde, Post_fdes): Declare.
1716 (Cie::write): Add post_fdes param.
1717 * ehframe.cc (Fde::write): Use plt_fde_location.
1718 (struct Post_fde): Define.
1719 (Cie::write): Stash FDEs added post merge mapping.
1720 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1721 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1722 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1724 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1725 (Target_powerpc::has_glink): New function.
1726 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1727 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1728 glink_eh_frame_fde_32, default_fde): New data.
1729 (Stub_table::eh_frame_added_): New var.
1730 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1732 (Stub_table::add_eh_frame): New function.
1733 (Output_data_glink::add_eh_frame): New function.
1734 (Target_powerpc::make_glink_section): Call add_eh_frame.
1736 2013-02-15 Ian Lance Taylor <iant@google.com>
1738 * options.h (DEFINE_uint64_alias): Define.
1739 (class General_options): Add -Ttext-segment as an alias for
1742 2013-02-15 Alan Modra <amodra@gmail.com>
1744 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1745 (Stub_table::do_write): ..here, two places.
1746 (Stub_table::plt_call_size): Use it here too.
1748 2013-02-11 Ian Lance Taylor <iant@google.com>
1750 * descriptors.cc (Descriptors::close_all): New function.
1751 * descriptors.h (class Descriptors): Declare close_all.
1752 (close_all_descriptors): New inline function.
1753 * plugin.cc: Include "descriptors.h".
1754 (Plugin_manager::cleanup): Call close_all_descriptors.
1756 2013-02-06 Alan Modra <amodra@gmail.com>
1758 * README: Update coding style link.
1760 2013-01-28 Cary Coutant <ccoutant@google.com>
1762 * dwp.cc (File_list): New typedef.
1763 (Dwo_name_info_reader): New class.
1764 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1765 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1766 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1767 (Dwo_file::read_executable): New function.
1768 (Dwo_file::read): Move common setup code to ...
1769 (Dwo_file::make_object): ... here.
1770 (dwp_options): Add --exec/-e.
1774 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1776 * layout.cc (Layout::layout): Check for option text_reorder.
1777 (Layout::make_output_section): Ditto.
1778 * options.h (text_reorder): New option.
1779 * output.cc (Input_section_sort_compare): Remove special ordering
1782 Input_section_sort_section_name_special_ordering_compare::
1783 operator()): New function.
1784 (Output_section::sort_attached_input_sections): Use new sort function
1786 * output.h (Input_section_sort_section_name_special_ordering_compare):
1788 * testsuite/Makefile.am (text_section_grouping): Test option
1790 * testsuite/Makefile.in: Regenerate.
1791 * testsuite/text_section_grouping.sh: Check order of functions without
1792 default text reordering.
1794 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1796 * options.h (General_options): Change default to true for new_dtags.
1798 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1800 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1801 when enable_new_dtags is false. Only add DT_RUNPATH when
1802 enable_new_dtags is true.
1804 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1806 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1807 used in declaration and definition consistent.
1808 (Target_powerpc::symval_for_branch): Ditto.
1810 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1812 * testsuite/plugin_final_layout.cc: Fix comment.
1814 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1816 * layout.cc (Layout::layout): Do not do default sorting for
1817 text sections when section ordering is specified.
1818 (make_output_section): Ditto.
1819 * testsuite/plugin_final_layout.cc: Name the function sections
1820 to catch reordering issues.
1822 2013-01-15 Alan Modra <amodra@gmail.com>
1824 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1827 2013-01-15 Alan Modra <amodra@gmail.com>
1829 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1830 * testsuite/Makefile.in: Regenerate.
1832 2013-01-14 Alan Modra <amodra@gmail.com>
1834 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1835 * testsuite/Makefile.in: Regenerate.
1837 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1840 Fix mingw gold build with plugins enabled
1841 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1842 * configure.ac: Export DLOPEN_LIBS and add headers check.
1843 * plugin.cc: Handle non-dlfcn case.
1844 * Makefile.in: Regenerate.
1845 * config.in: Regenerate.
1846 * configure: Regenerate.
1847 * testsuite/Makefile.in: Regenerate.
1849 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1851 * output.h (sort_attached_input_sections): Change to be public.
1852 * script-sections.cc
1853 (Output_section_definition::set_section_addresses): Sort
1854 attached input sections according to section order before linker
1855 script assigns section addresses.
1856 (Orphan_output_section::set_section_addresses): Sort
1857 attached input sections according to section order before linker
1858 script assigns section addresses.
1859 * Makefile.am (final_layout.sh): Use a simple linker script to
1860 check if section ordering still works.
1861 * Makefile.in: Regenerate.
1863 2013-01-09 Ben Cheng <bccheng@google.com>
1865 * arm.cc (Target_arm::attributes_accept_div): New function.
1866 (Target_arm::attributes_forbid_div): New function.
1867 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1868 attribute using the same new functions as what bfd/elf32_arm.c
1871 2013-01-07 Cary Coutant <ccoutant@google.com>
1874 * output.cc (Output_section::add_input_section): For incremental
1875 updates, don't track input sections that are allocated from patch
1878 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1879 Ian Lance Taylor <iant@google.com>
1882 * configure.ac (--enable-ld): Removed.
1883 (install_as_default): Set to yes only for --enable-gold=default
1885 * configure: Regenerated.
1887 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1889 * options.h (General_options): Add -fuse-ld= for GCC linker
1890 option compatibility.
1892 2013-01-04 Cary Coutant <ccoutant@google.com>
1894 * configure.ac: Fix typo restoring CXXFLAGS.
1895 * configure: Regenerate.
1897 2013-01-04 Cary Coutant <ccoutant@google.com>
1899 * testsuite/Makefile.am (CXXLINK_S): New macro.
1900 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1901 * testsuite/Makefile.in: Regenerate.
1903 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1905 * version.cc (print_version): Update copyright year to 2013.
1907 2012-12-20 Ian Lance Taylor <iant@google.com>
1909 * layout.cc (Layout::special_ordering_of_input_section): New
1911 (Layout::layout): If input section requires special ordering, must
1912 sort input sections.
1913 (Layout::make_output_section): May sort .text input sections.
1914 (Layout::is_section_name_prefix_grouped): Remove.
1915 * layout.h (class Layout): Declare
1916 special_ordering_of_input_section. Don't declare
1917 is_section_name_prefix_grouped.
1918 * output.cc (Output_section::add_input_section): Revert last
1920 (Output_section::Input_section_sort::match_file_name): Don't crash
1921 if called on output section data.
1922 (Output_section::Input_section_sort_compare): Sort based on
1924 (Output_section::Input_section_sort_section_order_index_compare):
1926 (Output_section::sort_attached_input_sections): Likewise.
1928 2012-12-18 Sriraman Tallam <tmsriram@google.com>
1930 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
1931 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1932 * output.cc (Output_section::add_input_section): Check if section
1933 name contains special prefix. Keep input sections to sort such
1935 (Output_section::Input_section_sort_section_order_index_compare
1936 ::operator()): Group sections according to prefixes.
1937 (Output_section::sort_attached_input_sections): Add condition to
1938 Input_section_entry constructor call.
1939 * testsuite/Makefile.am (text_section_grouping): New test.
1940 * testsuite/Makefile.in: Regenerate.
1941 * testsuite/text_section_grouping.cc: New file.
1942 * testsuite/text_section_grouping.sh: New file.
1944 2012-12-17 Nick Clifton <nickc@redhat.com>
1946 * Makefile.am: Add copyright notice.
1949 * configure.ac: Likewise.
1950 * ftruncate.c: Likewise.
1951 * Makefile.in: Regenerate.
1953 2012-12-14 Cary Coutant <ccoutant@google.com>
1955 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1956 --no-as-needed flag.
1957 (exception_separate_shared_12_test): Likewise.
1958 (incremental_copy_test): Likewise.
1959 * testsuite/Makefile.in: Regenerate.
1961 2012-12-14 Cary Coutant <ccoutant@google.com>
1963 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1964 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1966 2012-12-12 Alan Modra <amodra@gmail.com>
1968 * powerpc.cc (class Track_tls): New.
1969 (class Relocate, class Scan): Inherit Track_tls.
1970 (Target_powerpc::Scan::local, global): Track tls optimization
1971 and avoid creating plt entry for __tls_get_addr if all uses
1973 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1975 2012-12-12 Alan Modra <amodra@gmail.com>
1977 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1978 Replace no_toc_optimize with toc_optimize.
1979 * output.h (Output_section::input_sections): Provide non-const variant.
1980 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1981 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1983 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1984 (class Sort_toc_sections): New.
1985 (Target_powerpc::do_finalize_sections): Sort toc sections.
1986 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1988 2012-12-10 Roland McGrath <mcgrathr@google.com>
1990 * testsuite/binary_unittest.cc (read_all): New function.
1991 (Sized_binary_test): Use it instead of ::read.
1992 * fileread.cc (do_read): Don't assume pread always reads the whole
1993 amount in a single call.
1995 2012-12-10 Alan Modra <amodra@gmail.com>
1997 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1998 Set EM_PPC64 or EM_PPC here.
1999 (Target_selector_powerpc::do_recognize): Delete.
2001 2012-12-10 Alan Modra <amodra@gmail.com>
2003 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2005 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2007 2012-12-07 Roland McGrath <mcgrathr@google.com>
2009 * testsuite/binary_unittest.cc (Sized_binary_test):
2010 Use open_descriptor rather than ::open.
2012 2012-12-07 Alan Modra <amodra@gmail.com>
2014 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2015 typedef and invalid_address constant.
2016 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2017 instantiate constants.
2019 2012-12-06 Roland McGrath <mcgrathr@google.com>
2021 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2022 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2023 * aclocal.m4: Regenerate.
2024 * configure: Regenerate.
2025 * Makefile.in: Regenerate.
2026 * testsuite/Makefile.in: Regenerate.
2028 2012-12-07 Alan Modra <amodra@gmail.com>
2030 * options.h (General_options): Add no_toc_optimize.
2031 * powerpc.cc (ok_lo_toc_insn): New function.
2032 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2034 2012-12-06 Alan Modra <amodra@gmail.com>
2036 * options.h (General_options): Add plt_align, plt_static_chain,
2037 plt_thread_safe. Update stub_group_size help text.
2038 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2039 for new plt_thread_safe_ var.
2040 (use_plt_offset): Correct comments.
2041 (Target_powerpc::do_relax): Look for thread creation symbols to
2042 determine default plt_thread_safe value. Clear plt call stubs
2043 as well as branch stubs each iteration.
2044 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2046 (l, hi, ha, write_insn): Move earlier.
2047 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2048 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2050 (Stub_table::update_size): Adjust.
2051 (Stub_table::prev_size, set_prev_size): Delete.
2052 (Stub_table::stub_align): Let --plt-align affect result.
2053 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2054 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2055 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2056 (Stub_table::do_write): Support more stub variants.
2058 2012-12-04 Alan Modra <amodra@gmail.com>
2060 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2061 (Target_powerpc::do_define_standard_symbols): New function.
2063 2012-12-03 Alan Modra <amodra@gmail.com>
2065 * output.h: Formatting, whitespace.
2067 2012-12-03 Alan Modra <amodra@gmail.com>
2069 * layout.h (Layout::get_executable_sections): Declare.
2070 * layout.cc (Layout::get_executable_sections): New function.
2071 * arm.cc (Target_arm::group_sections): Use it.
2072 (Arm_output_section::group_sections): Delete now redundant test.
2073 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2074 param to handle relative relocs.
2075 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2076 (Output_data_reloc::add_absolute): Adjust.
2077 (Output_data_reloc::add_relative): New function.
2078 (Output_data::reset_data_size): New function.
2079 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2080 (Output_section::set_addralign): New function.
2081 (Output_section::checkpoint_set_addralign): New function.
2082 (Output_section::clear_section_offsets_need_adjustment): New function.
2083 (Output_section::input_sections): Make public.
2084 * powerpc.cc (class Output_data_brlt_powerpc): New.
2085 (class Stub_table, class Stub_control): New.
2086 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2087 stub_table_, set_stub_table, stub_table): New vectors and accessor
2089 (Target_powerpc::do_may_relax, do_relax, push_branch,
2090 new_stub_table, stub_tables, brlt_section, group_sections,
2091 add_branch_lookup_table, find_branch_lookup_table,
2092 write_branch_lookup_table, make_brlt_section): New functions.
2093 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2094 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2095 branch_info_): New vars.
2096 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2097 make call stubs here.
2098 (Output_data_glink): Remove all call stub handling from this class.
2099 (Target_powerpc::Scan::local, global): Save interesting branch
2100 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2101 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2102 functions on final link.
2103 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2104 Handle long branch destinations too.
2105 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2106 do_plt_address_for_local): Adjust lookup of plt call stubs.
2108 2012-11-30 Alan Modra <amodra@gmail.com>
2110 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2111 relocs against protected symbols when building 32-bit shared libs.
2113 2012-11-30 Alan Modra <amodra@gmail.com>
2115 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2116 param. Call got_section() to make .got. Update all callers
2117 and their callers and so on.
2119 2012-11-30 Alan Modra <amodra@gmail.com>
2121 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2122 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2123 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2124 value if it already exists.
2126 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2129 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2131 2012-11-14 Roland McGrath <mcgrathr@google.com>
2133 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2134 than bfc instruction for data sandboxing.
2136 2012-11-08 Alan Modra <amodra@gmail.com>
2138 * po/POTFILES.in: Regenerate.
2140 2012-11-05 Alan Modra <amodra@gmail.com>
2142 * configure.ac: Apply 2012-09-10 change to config.in here.
2143 * configure: Regenerate.
2145 2012-11-05 Alan Modra <amodra@gmail.com>
2147 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2148 (struct Opd_ent): Use "Address" rather than "Offset".
2149 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2150 (Target_powerpc::got_section): Make public.
2151 (Target_powerpc::scan_relocs): Move code setting symbols..
2152 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2153 Create _SDA_BASE_ only when referenced.
2155 2012-11-02 Roland McGrath <mcgrathr@google.com>
2157 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2160 2012-11-01 Roland McGrath <mcgrathr@google.com>
2162 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2163 for offset_in_output_section parameter.
2164 (Sized_target::relocate_special_relocatable): Likewise.
2165 * arm.cc (Target_arm::relocate_relocs): Likewise.
2166 (Target_arm::relocate_special_relocatable): Likewise.
2167 * i386.cc (Target_i386::relocate_relocs): Likewise.
2168 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2169 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2170 * target-reloc.h (relocate_relocs): Likewise.
2171 * testsuite/testfile.cc (Target_test): Likewise.
2172 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2173 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2175 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2176 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2178 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2179 parameter, which is unused in the [!F_SETFD] case.
2181 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2182 SYMNDX to off_t before comparing it to this->data_size().
2183 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2184 * incremental.cc (Output_section_incremental_inputs::do_write):
2185 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2187 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2189 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2191 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2192 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2195 2012-10-29 Cary Coutant <ccoutant@google.com>
2197 * dwp.cc (usage): Add file and exit status parameters;
2198 add --help and --version options.
2199 (print_version): New function.
2200 (main): Add --help and --version options.
2202 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2204 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2205 final_layout_sequence.txt.
2206 * testsuite/Makefile.in: Regenerated.
2208 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2210 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2211 COMPILE generated by automake.
2213 (CXXCOMPILE1): Likewise.
2214 (CXXLINK1): Likewise.
2215 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2217 (CXXCOMPILE): Likewise.
2218 (CXXLINK): Likewise.
2219 * testsuite/Makefile.in: Regenerated.
2221 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2223 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2224 on bad fwrite return.
2226 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2228 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2231 2012-10-23 Cary Coutant <ccoutant@google.com>
2233 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2234 * testsuite/Makefile.in: Regenerate.
2235 * testsuite/dwp_test.h: New source file.
2236 * testsuite/dwp_test_1.cc: New source file.
2237 * testsuite/dwp_test_1.s: New source file.
2238 * testsuite/dwp_test_1.sh: New source file.
2239 * testsuite/dwp_test_1b.cc: New source file.
2240 * testsuite/dwp_test_1b.s: New source file.
2241 * testsuite/dwp_test_2.cc: New source file.
2242 * testsuite/dwp_test_2.s: New source file.
2243 * testsuite/dwp_test_2.sh: New source file.
2244 * testsuite/dwp_test_main.cc: New source file.
2245 * testsuite/dwp_test_main.s: New source file.
2247 2012-10-23 Cary Coutant <ccoutant@google.com>
2249 * dwp.h: New header file.
2250 * dwp.cc: New source file.
2251 * gold.h: Move shared declarations to system.h.
2252 * system.h: New header file.
2253 * Makefile.am: Add dwp.
2254 * Makefile.in: Regenerate.
2256 2012-10-23 Cary Coutant <ccoutant@google.com>
2258 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2259 Dwarf_info_reader::read_from_pointer.
2260 (Dwarf_pubnames_table::read_header): Likewise.
2261 (Dwarf_pubnames_table::next_name): Likewise.
2262 (Dwarf_die::read_attributes): Likewise.
2263 (Dwarf_die::skip_attributes): Likewise.
2264 (Dwarf_info_reader::read_from_pointer): New function template.
2265 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2266 (Dwarf_pubnames_table): Likewise.
2267 (Dwarf_info_reader::read_from_pointer): New function template.
2268 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2269 Dwarf_pubnames_table ctor.
2271 2012-10-23 Cary Coutant <ccoutant@google.com>
2273 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2275 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2277 (Dwarf_info_reader::set_abbrev_shndx): New method.
2278 (Dwarf_info_reader::abbrev_shndx_): New data member.
2280 2012-10-23 Cary Coutant <ccoutant@google.com>
2282 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2283 from object, not parameters.
2284 (Dwarf_info_reader::parse): Likewise.
2285 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2286 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2287 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2290 2012-10-23 Cary Coutant <ccoutant@google.com>
2292 * fileread.cc (Input_file::Input_file): New constructor.
2293 * fileread.h (class Input_file): Add new constructor.
2295 2012-10-18 Alan Modra <amodra@gmail.com>
2298 * object.cc (Relobj::is_section_name_included): Also match
2299 .sdata personality section.
2301 2012-10-18 Alan Modra <amodra@gmail.com>
2303 * target-reloc.h (class Default_comdat_behavior): New, package up..
2304 (get_comdat_behaviour): ..this.
2305 (relocate_section): Add Relocate_comdat_behavior template arg,
2306 adjust code to suit.
2307 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2308 (Target_arm::scan_reloc_section): Likewise.
2309 * i386.cc (Target_i386::relocate_section): Likewise.
2310 * sparc.cc (Target_sparc::relocate_section): Likewise.
2311 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2312 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2313 * powerpc.cc (class Relocate_comdat_behavior): New.
2314 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2315 gold::relocate_section with new template arg.
2317 2012-10-18 Alan Modra <amodra@gmail.com>
2319 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2320 dynamic relocs for GOT_TPREL got entries, without symbol if
2322 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2323 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2324 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2326 2012-10-17 Alan Modra <amodra@gmail.com>
2329 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2331 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2333 * layout.cc (Layout::include_section): Keep sections marked
2334 SHF_EXCLUDE when doing relocatable links.
2336 2012-10-16 Alan Modra <amodra@gmail.com>
2338 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2339 (Target_powerpc::do_finalize_sections): Call it.
2340 (Output_data_save_res): New class and supporting functions.
2341 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2342 normal symbols defined in object files.
2344 2012-10-12 Alan Modra <amodra@gmail.com>
2346 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2347 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2348 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2349 section if scan_opd_relocs not yet called.
2350 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2352 2012-10-12 Alan Modra <amodra@gmail.com>
2354 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2355 add_local_ifunc_entry): Revert last change.
2356 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2358 2012-10-05 Alan Modra <amodra@gmail.com>
2360 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2361 do_plt_address_for_global): New functions.
2362 (Output_data_got_powerpc::do_write): Don't segfault when linking
2364 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2365 add_local_ifunc_entry): Return true on adding entry..
2366 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2367 glink->add_entry call. Remove unused symtab param. Adjust calls.
2368 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2369 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2370 set up symbols here.
2371 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2372 syms here. Do so even when no .iplt. Don't segfault when linking
2374 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2375 new variants without reloc param.
2376 (Glink_sym_ent::Glink_sym_ent): Likewise.
2377 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2378 reloc when refs will resolve to plt call stub.
2379 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2380 R_PPC_PLTREL24 to resolve locally.
2381 (Target_powerpc::Scan::global): Correct ifunc handling.
2382 (Target_powerpc::Relocate::relocate): Correct local sym glink
2383 lookup. Don't destroy "value" when we have a plt call stub,
2384 and when checking plt call validity.
2385 (Target_powerpc::do_dynsym_value): Simplify.
2387 2012-10-05 Alan Modra <amodra@gmail.com>
2389 * i386.cc (Output_data_plt_i386::address_for_global,
2390 address_for_local): Add plt offset to returned value. Adjust uses.
2391 * sparc.cc (Output_data_plt_sparc::address_for_global,
2392 address_for_local): Likewise.
2393 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2394 address_for_local): Likewise.
2395 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2396 address_for_local): Likewise.
2397 * target.h (Target::plt_address_for_global, plt_address_for_local):
2399 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2400 (Output_data_got::Got_entry::write): Nor here.
2401 * output.h: Comment fix.
2403 2012-10-02 Jiong Wang <jiwang@tilera.com>
2405 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2406 global_offset_table_ value for larget got.
2407 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2409 2012-09-29 Alan Modra <amodra@gmail.com>
2411 * powerpc.cc (Target_powerpc::iplt_): New output section.
2412 (Target_powerpc::iplt_section, make_iplt_section,
2413 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2414 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2415 Target_powerpc::plt_entry_count): Count iplt entries too.
2416 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2417 reloc section in constructor. New params.
2418 (Target_powerpc::make_plt_section): Create reloc section here instead.
2419 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2421 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2422 (Output_data_glink::add_entry, find_entry): New functions to
2423 deal with local syms.
2424 (Glink_sym_ent): Add support for local syms.
2425 (Output_data_glink::do_write): Handle ifunc plt entries.
2426 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2427 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2428 (Target_powerpc::Relocate::relocate): Likewise.
2429 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2431 2012-09-25 Alan Modra <amodra@gmail.com>
2433 * object.h (Sized_relobj_file::adjust_local_symbol,
2434 do_adjust_local_symbol): New functions.
2435 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2436 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2437 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2438 and irregular opd entry spacing.
2439 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2440 (Global_symbol_visitor_opd): New functor.
2441 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2442 on deleted opd entries.
2444 2012-09-15 Jiong Wang <jiwang@tilera.com>
2446 * tilegx.cc: New file.
2447 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2448 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2449 * configure.tgt: Add entries for tilegx*.
2450 * configure.ac: Likewise.
2451 * Makefile.in: Rebuild.
2452 * configure: Likewise.
2453 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2456 2012-09-13 Alan Modra <amodra@gmail.com>
2458 * target-reloc.h (scan_relocs): Call scan.local for relocs
2459 against symbols in discarded sections. Pass is_discarded
2461 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2462 Add is_discarded param.
2463 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2464 is_discarded to flag opd entry as discarded. Don't emit dyn
2465 relocs on such entries.
2466 (Target_powerpc::Scan::global): Similarly detect and handle
2468 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2469 opd_ent_. Update all uses.
2470 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2471 (Target_powerpc::relocate_section): Zero out discarded opd
2474 2012-09-12 Ian Lance Taylor <iant@google.com>
2477 * output.cc: Rename Output_data_got template parameter from size
2478 to got_size for all functions. Compile all variants of
2480 (Output_data_got::Got_entry::write): Correct use of size for
2481 symbol value. Use local_is_tls rather than casting to
2483 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2484 (class Sized_relobj_file): Add do_local_is_tls.
2485 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2487 2012-09-11 Alan Modra <amodra@gmail.com>
2490 * layout.cc (Layout::set_segment_offsets): When using
2491 common-page-size alignment, ensure we are on a new max-page-size
2493 * output.cc (Output_segment::set_section_addresses): Use
2494 abi_pagesize, not common_pagesize for relro boundary.
2495 (Output_segment::set_offset): Likewise.
2497 2012-09-11 Alan Modra <amodra@gmail.com>
2499 * output.h (Output_data_got::add_global_tls, add_local_tls,
2500 add_local_tls_pair): New functions.
2501 (Output_data_got::add_local_pair_with_rel): Remove second
2502 reloc param. Expand comment.
2503 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2504 use_plt_or_tls_offset_, similarly for constructor param.
2505 (Output_data_got::Got_entry::write): Add got_index param.
2506 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2507 add_local_tls_pair): New functions.
2508 (Output_data_got::Got_entry::write): Handle tls symbols
2509 with use_plt_or_tls_offset_ set specially.
2510 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2511 (Output_data_got::do_write): Replace iterator with index, pass
2512 index to entry write function.
2513 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2514 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2515 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2517 * i386.cc (Target_i386::Scan::local): Likewise.
2518 * sparc.cc (Target_sparc::Scan::local): Likewise.
2519 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2520 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2521 do_tls_offset_for_global): New functions.
2522 (Target_powerpc::Scan::local): Correct TLS relocations and got
2524 (Target_powerpc::Scan::global): Don't emit unnecessary
2525 dynamic relocations on TLS GOT entries.
2527 2012-09-10 Matthias Klose <doko@ubuntu.com>
2529 * config.in: Disable sanity check for kfreebsd.
2531 2012-09-10 Sterling Augustine <saugustine@google.com>
2533 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2534 (Gdb_index::pubtypes_read): New parameter.
2535 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2537 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2540 2012-09-09 Alan Modra <amodra@gmail.com>
2542 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2543 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2544 * gc.h (gc_process_relocs): Call target gc_add_reference.
2545 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2546 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2547 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2549 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2550 to cater for when we don't need code offset. Update use.
2551 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2552 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2553 set_opd_valid): New functions.
2554 (Target_powerpc::do_gc_add_reference): New function.
2555 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2557 (Target_powerpc::do_gc_mark_symbol): New function.
2559 2012-09-06 Cary Coutant <ccoutant@google.com>
2561 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2562 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2563 (Dwarf_die::skip_attributes): Likewise.
2564 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2565 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2567 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2569 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2571 * testsuite/script_test_3.t: Add .got.plt output section
2573 * testsuite/script_test_4.t: Likewise.
2575 2012-09-05 Alan Modra <amodra@gmail.com>
2577 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2578 update all uses and lose "enum" when using type.
2580 2012-09-05 Alan Modra <amodra@gmail.com>
2582 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2583 * configure: Regenerate.
2584 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2585 (plugin_final_layout.stdout): Likewise.
2586 (memory_test): Set page sizes to 0x1000.
2587 * testsuite/Makefile.in: Regenerate.
2588 * testsuite/discard_locals_test.sh: Add FIXME comment.
2589 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2590 * testsuite/pr14265.t: Add .got output section statement.
2591 * testsuite/script_test_2.t: Likewise.
2592 * testsuite/script_test_3.t: Likewise.
2593 * testsuite/script_test_4.t: Likewise.
2594 * testsuite/script_test_5.t: Likewise.
2595 * testsuite/script_test_6.t: Likewise.
2596 * testsuite/script_test_7.t: Likewise.
2597 * testsuite/script_test_9.t: Likewise.
2599 2012-09-05 Alan Modra <amodra@gmail.com>
2601 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2602 (Powerpc_relocate_functions::Status): New typedef.
2603 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2604 (Target_powerpc::Scan::local): Handle REL64.
2605 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2606 for REL32 and REL64.
2607 (Target_powerpc::symval_for_branch): New function, extracted from..
2608 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2609 checks. Report overflow errors.
2611 2012-09-05 Alan Modra <amodra@gmail.com>
2613 * object.h (Sized_relobj_file::emit_relocs): Delete.
2614 (Sized_relobj_file::emit_relocs_reltype): Delete.
2615 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2616 relocate_relocs for --emit-relocs.
2617 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2618 * output.h: Update comment.
2619 (Output_segment::first_section): New function.
2620 (Output_segment::first_section_load_address): Use first_section.
2621 * output.cc (Output_segment::first_section): New function extracted..
2622 (Output_segment::first_section_load_address): ..from here. Delete.
2623 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2624 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2625 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2626 adjust call to target.h function.
2627 * i386.cc (Target_i386): Likewise.
2628 * sparc.cc (Target_sparc): Likewise.
2629 * x86_64.cc (Target_x86_64): Likewise.
2630 * powerpc.cc (Target_powerpc): Likewise.
2631 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2632 first tls section has section symbol for optimised local dynamic
2634 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2635 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2637 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2638 Rename to relocate_relocs. Update error message.
2640 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2642 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2645 2012-08-31 Alan Modra <amodra@gmail.com>
2647 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2648 (Powerpc_relobj::toc_base_offset): New stub function.
2649 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2650 got_mod_index_offset to tlsld_got_offset. Update all refs.
2651 (Target_powerpc::Relocate::enum skip_tls): New.
2652 (Target_powerpc::call_tls_get_addr_): New var.
2653 (Target_powerpc::is_branch_reloc): Move to file scope.
2654 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2655 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2657 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2658 (powerpc_info): Correct common_pagesize for ppc64.
2659 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2660 (Powerpc_relocate_functions): Add overflow check enums and functions.
2661 Add non-shift version of rela, rela_ua. Delete all rel public
2662 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2663 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2664 addr16_ha3, addr14 functions.
2665 (Output_data_got_powerpc::add_constant_pair): New function.
2666 (Output_data_got_powerpc::got_base_offset): Likewise.
2667 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2668 (instruction constants): Sort, add some more.
2669 (Output_data_glink::do_write): Add and use Address typedef. Use
2670 object->toc_base_offset() stub for 64-bit.
2671 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2672 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2673 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2674 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2675 Always treat .opd relocs as against locally defined symbol.
2676 Correct condition for RELATIVE relocs.
2677 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2678 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2679 for 32-bit syms with a plt entry. Correct ppc64 toc base
2680 calculations. Handle TLS relocs, and more. Add overflow
2681 checking and adjust for Powerpc_relocate_functions changes.
2682 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2683 Reinstate --emit-relocs code with FIXME.
2685 2012-08-30 Alan Modra <amodra@gmail.com>
2687 * layout.cc (Layout::set_segment_offsets): Set p_align to
2688 abi_pagesize, not common_pagesize.
2689 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2690 to determine whether file header can go in segment.
2692 2012-08-30 Alan Modra <amodra@gmail.com>
2694 * output.h (Output_reloc::Output_reloc <output section>): Add
2695 is_relative param. Adjust calls.
2696 (Output_reloc::add_output_section_relative): New functions.
2697 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2699 (Output_reloc::symbol_value): Handle SECTION_CODE.
2701 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2703 * gold.cc (queue_middle_tasks): Call layout again when unique
2704 segments for sections is desired.
2705 * layout.cc (Layout::Layout): Initialize new members.
2706 (Layout::get_output_section_flags): New function.
2707 (Layout::choose_output_section): Call get_output_section_flags.
2708 (Layout::layout): Make output section for mapping to a unique segment.
2709 (Layout::insert_section_segment_map): New function.
2710 (Layout::attach_allocated_section_to_segment): Make unique segment for
2711 output sections marked so.
2712 (Layout::segment_precedes): Check for unique segments when sorting.
2713 * layout.h (Layout::Unique_segment_info): New struct.
2714 (Layout::Section_segment_map): New typedef.
2715 (Layout::insert_section_segment_map): New function.
2716 (Layout::get_output_section_flags): New function.
2717 (Layout::is_unique_segment_for_sections_specified): New function.
2718 (Layout::set_unique_segment_for_sections_specified): New function.
2719 (Layout::unique_segment_for_sections_specified_): New member.
2720 (Layout::section_segment_map_): New member.
2721 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2722 Rename is_gc_pass_one to is_pass_one.
2723 Rename is_gc_pass_two to is_pass_two.
2724 Rename is_gc_or_icf to is_two_pass.
2725 Check for which pass based on whether symbols data is present.
2726 Make it two pass when unique segments for sections is desired.
2727 * output.cc (Output_section::Output_section): Initialize new
2729 * output.h (Output_section::is_unique_segment): New function.
2730 (Output_section::set_is_unique_segment): New function.
2731 (Output_section::is_unique_segment_): New member.
2732 (Output_section::extra_segment_flags): New function.
2733 (Output_section::set_extra_segment_flags): New function.
2734 (Output_section::extra_segment_flags_): New member.
2735 (Output_section::segment_alignment): New function.
2736 (Output_section::set_segment_alignment): New function.
2737 (Output_section::segment_alignment_): New member.
2738 (Output_segment::Output_segment): Initialize is_unique_segment_.
2739 (Output_segment::is_unique_segment): New function.
2740 (Output_segment::set_is_unique_segment): New function.
2741 (Output_segment::is_unique_segment_): New member.
2742 * plugin.cc (allow_unique_segment_for_sections): New function.
2743 (unique_segment_for_sections): New function.
2744 (Plugin::load): Add new functions to transfer vector.
2745 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2746 * Makefile.in: Regenerate.
2747 * testsuite/plugin_final_layout.sh: Check if unique segment
2748 functionality works.
2749 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2751 (allow_unique_segment_for_sections): New global.
2752 (unique_segment_for_sections): New global.
2753 (claim_file_hook): Call allow_unique_segment_for_sections.
2754 (all_symbols_read_hook): Call unique_segment_for_sections.
2756 2012-08-22 Cary Coutant <ccoutant@google.com>
2758 * layout.cc (Layout::include_section): Don't assert on GROUP
2759 sections with --emit-relocs.
2761 2012-08-21 Cary Coutant <ccoutant@google.com>
2763 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2764 if --export-dynamic-symbol names an undef symbol.
2766 2012-08-18 Alan Modra <amodra@gmail.com>
2768 * powerpc.cc: Formatting and white space.
2769 (Powerpc_relobj): Rename got2_section_ to special_.
2770 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2771 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2772 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2773 (Target_powerpc): Add Address typedef and invalid_address. Use
2775 (Target_powerpc::is_branch_reloc): New function.
2776 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2777 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2778 for dst_mask, value and addend.
2779 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2780 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2781 (Output_data_glink::do_write): Correct toc base. Don't try to use
2782 uint16_t for 24-bit offset. Use get_output_section_offset and
2784 (Target_powerpc::Scan::local): Handle more relocs.
2785 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2786 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2787 Plug in toc restoring insn after plt calls. Translate branches
2788 to function descriptor symbols to corresponding entry point.
2789 (Target_powerpc::relocate_for_relocatable): Check return from
2790 get_output_section_offset.
2791 * symtab.h: Comment typo.
2793 2012-08-14 Ian Lance Taylor <iant@google.com>
2795 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2796 unsupported_relocal_local to call unsupported_reloc_global.
2798 2012-08-14 Nick Clifton <nickc@redhat.com>
2801 * script-sections.cc (Sections_element::output_section_name): Add
2802 keep return parameter.
2803 (Output_section_element::match_name): Add keep return parameter.
2804 Return the value of the keep_ member.
2805 * script-sections.h (class Output_section): Update
2806 output_section_name prototype.
2807 * layout.cc (Layout::keep_input_section): New public member
2809 (Layout::choose_output_section): Pass keep parameter to
2810 output_section_name.
2811 * layout.h (class Layout): Add keep_input_section.
2812 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2814 * testsuite/Makefile.am: Add a test.
2815 * testsuite/Makefile.in: Regenerate.
2816 * testsuite/pr14265.c: Source file for the test.
2817 * testsuite/pr14265.t: Linker script for the test.
2818 * testsuite/pr14265.sh: Shell script for the test.
2820 2012-08-14 Alan Modra <amodra@gmail.com>
2822 * target.h (Target::output_section_name): New function.
2823 (Target::do_output_section_name): New function.
2824 * layout.cc (Layout::choose_output_section): Call the above.
2825 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2827 2012-08-14 Alan Modra <amodra@gmail.com>
2829 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2830 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2831 for replace_constant call.
2832 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2833 (Output_data_glink::do_print_to_mapfile): New function.
2834 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2835 (Target_powerpc::Relocate::relocate): Likewise.
2837 2012-08-14 Alan Modra <amodra@gmail.com>
2839 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2840 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2841 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2842 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2843 all references to shndx_. Handle special case for R_PPC_PLTREL24
2845 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2846 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2847 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2849 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2850 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2852 2012-08-12 Alan Modra <amodra@gmail.com>
2854 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2855 (glink insn constants): Use uint32_t.
2856 (Output_data_glink::add_entry): Use insert, not [] operator.
2858 2012-08-11 Alan Modra <amodra@gmail.com>
2860 * object.h (Sized_relobj_file::find_shdr): New function.
2861 (Sized_relobj_file::find_special_sections): New function.
2862 * object.cc (Sized_relobj_file::find_shdr): New function.
2863 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2864 (Sized_relobj_file::find_special_sections): New function, split out..
2865 (Sized_relobj_file::do_read_symbols): ..from here.
2866 * output.h (Output_data_got::replace_constant): New function.
2867 (Output_data_got::num_entries): New function.
2868 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2869 (Output_data_got::got_offset): Protected rather than private.
2870 (Output_data_got::replace_got_entry): New function.
2871 * output.cc (Output_data_got::replace_got_entry): New function.
2872 * powerpc.cc (class Powerpc_relobj): New.
2873 (class Powerpc_relocate_functions): Delete all psymval variants or
2874 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2875 Implement _ha functions using corresponding _hi function.
2876 (Powerpc_relobj::find_special_sections): New function.
2877 (Target_powerpc::do_make_elf_object): New function.
2878 (class Output_data_got_powerpc): New.
2879 (class Output_data_glink): New.
2880 (class Powerpc_scan_relocatable_reloc): New.
2881 Many more changes througout file.
2883 2012-08-09 Nick Clifton <nickc@redhat.com>
2885 * po/vi.po: Updated Vietnamese translation.
2887 2012-08-07 Ian Lance Taylor <iant@google.com>
2889 * layout.cc (Layout::add_target_dynamic_tags): If
2890 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2893 2012-07-30 Nick Clifton <nickc@redhat.com>
2895 * po/gold.pot: Updated template.
2896 * po/es.po: Updated Spanish translation.
2898 2012-07-18 Cary Coutant <ccoutant@google.com>
2901 * configure.ac: Add check for -gpubnames support.
2902 * configure: Regenerate.
2903 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2904 support; force -gno-pubnames.
2905 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2907 (gdb_index_test_4): New test.
2908 * testsuite/Makefile.in: Regenerate.
2909 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2910 * testsuite/gdb_index_test_2.sh: Likewise.
2911 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2912 * testsuite/gdb_index_test_4.sh: New script.
2913 * testsuite/gdb_index_test_comm.sh: New script with common code;
2914 don't look for space after colon.
2916 2012-07-16 Sriraman Tallam <tmsriram@google.com>
2918 * gold.cc (queue_middle_tasks): Update function order only after
2919 deferred objects due to plugins are processed.
2921 2012-07-11 Ian Lance Taylor <iant@google.com>
2923 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2924 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2925 (Target_arm::scan_reloc_for_stub): Likewise.
2926 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2927 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2928 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2929 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2930 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2932 2012-07-10 Dodji Seketeli <dodji@redhat.com>
2933 Ian Lance Taylor <iant@google.com>
2936 * configure.ac: Test whether std::tr1::hash<off_t> works.
2937 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2939 * output.h (class Output_fill): Add virtual destructor.
2940 * configure, config.in: Rebuild.
2942 2012-06-22 Roland McGrath <mcgrathr@google.com>
2944 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2946 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2948 * plugin.cc (Plugin::load): Handle position independent executables.
2950 2012-06-06 Cary Coutant <ccoutant@google.com>
2952 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2954 (lines_only_debug_sections): Likewise.
2955 (gdb_fast_lookup_sections): New static array.
2956 (is_gdb_debug_section): Rename formal parameter.
2957 (is_lines_only_debug_section): Likewise.
2958 (is_gdb_fast_lookup_section): New function.
2959 (Layout::include_section): Check for ".zdebug_" prefix; pass
2960 section name suffix to is_gdb_debug_section, et al.; check for
2961 fast-lookup sections when building .gdb_index.
2962 * options.h (--strip-debug-gdb): Update GDB version number.
2964 2012-06-06 Cary Coutant <ccoutant@google.com>
2966 * configure.ac: Add check for fallocate.
2967 * configure: Regenerate.
2968 * config.in: Regenerate.
2970 * options.h (class General_options): Add --mmap-output-file and
2971 --posix-fallocate options.
2972 * output.cc: (posix_fallocate): Remove; replace with...
2973 (gold_fallocate): New function.
2974 (Output_file::map_no_anonymous): Call gold_fallocate.
2975 (Output_file::map): Check --mmap-output-file option.
2977 2012-06-05 Jing Yu <jingyu@google.com>
2979 * gold.h (textdomain): Add do {} to empty while(0).
2980 (bindtextdomain): Likewise.
2982 2012-06-04 Cary Coutant <ccoutant@google.com>
2984 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2987 2012-05-25 Sriraman Tallam <tmsriram@google.com>
2989 * symtab.cc (Symbol_table::define_special_symbol):
2990 Initialize *poldsym to prevent uninitialized variable errors.
2992 2012-05-23 Cary Coutant <ccoutant@google.com>
2994 * layout.cc (Layout::section_name_mapping): Add rules to handle
2995 exact match on .data.rel.ro.local or .data.rel.ro.
2996 (Layout::output_section_name): Check for exact matches.
2998 2012-05-23 Cary Coutant <ccoutant@google.com>
3000 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3003 2012-05-22 Cary Coutant <ccoutant@google.com>
3005 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3006 object before exporting symbol.
3008 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3010 * testsuite/tls_test.cc: Include "config.h" first.
3011 * testsuite/tls_test_c.c: Likewise.
3013 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3014 Nick Clifton <nickc@redhat.com>
3017 * configure.in: Add check that sysdep.h has been included before
3018 any system header files.
3019 * configure: Regenerate.
3020 * config.in: Regenerate.
3022 2012-05-14 Cary Coutant <ccoutant@google.com>
3024 * layout.cc (Layout::make_output_section): Mark .tdata section
3026 * testsuite/relro_test.cc: Add a TLS variable.
3028 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3031 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3032 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3035 2012-05-08 Cary Coutant <ccoutant@google.com>
3037 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3038 (lines_only_debug_sections): Likewise.
3040 2012-05-02 Roland McGrath <mcgrathr@google.com>
3042 * nacl.cc: New file.
3044 * Makefile.am (CCFILES, HFILES): Add them.
3045 * Makefile.in: Regenerate.
3046 * i386.cc (Output_data_plt_i386_nacl): New class.
3047 (Output_data_plt_i386_nacl_exec): New class.
3048 (Output_data_plt_i386_nacl_dyn): New class.
3049 (Target_i386_nacl): New class.
3050 (Target_selector_i386_nacl): New class.
3051 (target_selector_i386): Use it instead of Target_selector_i386.
3052 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3053 (Target_x86_64_nacl): New class.
3054 (Target_selector_x86_64_nacl): New class.
3055 (target_selector_x86_64, target_selector_x32): Use it instead of
3056 Target_selector_x86_64.
3057 * arm.cc (Output_data_plt_arm_nacl): New class.
3058 (Target_arm_nacl): New class.
3059 (Target_selector_arm_nacl): New class.
3060 (target_selector_arm, target_selector_armbe): Use it instead of
3061 Target_selector_arm.
3063 * target-select.cc (select_target): Take new Input_file* and off_t
3064 arguments, pass them on to recognize method of selector.
3065 * object.cc (make_elf_sized_object): Update caller.
3066 * parameters.cc (parameters_force_valid_target): Likewise.
3067 * incremental.cc (make_sized_incremental_binary): Likewise.
3068 * target-select.h: Update decl.
3069 (Target_selector::recognize): Take new Input_file* argument,
3070 pass it on to do_recognize.
3071 (Target_selector::do_recognize): Take new Input_file* argument.
3072 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3073 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3074 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3075 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3077 * target.h (Target::Target_info): New members isolate_execinstr
3079 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3080 * arm.cc (Target_arm::arm_info): Update initializer.
3081 * i386.cc (Target_i386::i386_info): Likewise.
3082 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3083 * sparc.cc (Target_sparc::sparc_info): Likewise.
3084 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3085 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3086 * layout.cc (Layout::attach_allocated_section_to_segment):
3087 Take new const Target* argument. If target->isolate_execinstr(), act
3089 (Layout::find_first_load_seg): Take new const Target* argument;
3090 if target->isolate_execinstr(), reject PF_X segments.
3091 (Layout::relaxation_loop_body): Update caller.
3092 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3093 reset file offset to zero when we hit LOAD_SEG, and then do a second
3094 loop over the segments before LOAD_SEG to reassign offsets after
3095 addresses have been determined. Handle target->rosegment_gap().
3096 (Layout::attach_section_to_segment): Take new const Target* argument;
3097 pass it to attach_allocated_section_to_segment.
3098 (Layout::make_output_section): Update caller.
3099 (Layout::attach_sections_to_segments): Take new const Target* argument;
3100 pass it to attach_section_to_segment.
3101 * gold.cc (queue_middle_tasks): Update caller.
3102 * layout.h (Layout): Update method decls with new arguments.
3104 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3105 Target_info pointer to use.
3106 (Target_arm::do_make_data_plt): New virtual method.
3107 (Target_arm::make_data_plt): New method that calls it.
3108 (Target_arm::make_plt_entry): Use it.
3109 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3110 for the section alignment.
3111 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3113 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3114 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3116 (Output_data_plt_arm::get_plt_entry_size): Call it.
3117 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3118 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3119 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3121 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3122 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3123 method instead of sizeof(plt_entry).
3124 (Output_data_plt_arm::add_entry): Likewise.
3125 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3126 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3128 (Target_arm::plt_entry_size): Likewise.
3129 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3131 (Output_data_plt_arm_standard): ... here, new class.
3132 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3133 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3134 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3136 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3137 Take additional argument for the PLT entry size.
3138 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3139 Use get_plt_entry_size method rather than plt_entry_size variable.
3140 (Output_data_plt_x86_64::reserve_slot): Likewise.
3141 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3142 (Output_data_plt_x86_64::add_entry): Likewise.
3143 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3144 (Output_data_plt_x86_64::address_for_global): Likewise.
3145 (Output_data_plt_x86_64::address_for_local): Likewise.
3146 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3147 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3148 Make method non-static.
3149 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3151 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3152 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3153 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3154 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3156 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3157 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3159 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3160 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3162 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3163 (Output_data_plt_x86_64::plt_entry_size)
3164 (Output_data_plt_x86_64::first_plt_entry)
3165 (Output_data_plt_x86_64::plt_entry)
3166 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3167 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3168 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3169 (Output_data_plt_x86_64_standard): ... here, new class.
3170 (Target_x86_64::Target_x86_64): Take optional argument for the
3171 Target_info pointer to use.
3172 (Target_x86_64::do_make_data_plt): New virtual method.
3173 (Target_x86_64::make_data_plt): New method to call it.
3174 (Target_x86_64::init_got_plt_for_update): Use that.
3175 Call this->plt_->add_eh_frame method here.
3176 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3177 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3178 rather than static method.
3179 (Target_x86_64::plt_entry_size): Likewise.
3180 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3181 rather than plt_entry_size variable. Move guts of PLT filling to...
3182 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3183 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3184 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3186 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3187 additional argument for the section alignment.
3188 Don't do add_eh_frame_for_plt here.
3189 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3190 non-static. Use get_plt_entry_size method rather than plt_entry_size
3192 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3194 (Output_data_plt_i386::get_plt_entry_size): Call it.
3195 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3196 (Output_data_plt_i386::add_eh_frame): New method to call it.
3197 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3199 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3200 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3202 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3203 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3204 method instead of plt_entry_size.
3205 (Output_data_plt_i386::plt_entry_size)
3206 (Output_data_plt_i386::plt_eh_frame_fde_size)
3207 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3208 (Output_data_plt_i386_standard): ... here, new class.
3209 (Output_data_plt_i386_exec): New class.
3210 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3211 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3212 (Output_data_plt_i386::exec_plt_entry): Move to ...
3213 (Output_data_plt_i386_exec::plt_entry): ... here.
3214 (Output_data_plt_i386_dyn): New class.
3215 (Output_data_plt_i386::first_plt_entry): Move to ...
3216 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3217 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3218 (Output_data_plt_i386_dyn::plt_entry): ... here.
3219 (Target_i386::Target_i386): Take optional argument for the Target_info
3221 (Target_i386::do_make_data_plt): New virtual method.
3222 (Target_i386::make_data_plt): New method to call it.
3223 (Target_i386::make_plt_section): Use that.
3224 Call this->plt_->add_eh_frame method here.
3225 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3226 rather than plt_entry_size variable.
3227 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3228 (Output_data_plt_i386::address_for_local): Likewise.
3229 (Output_data_plt_i386::do_write): Likewise.
3230 Move guts of PLT filling to...
3231 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3232 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3233 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3234 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3236 2012-05-01 Cary Coutant <ccoutant@google.com>
3238 * dwarf_reader.cc (Dwarf_die::read_attributes)
3239 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3240 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3241 * reduced_debug_output.cc
3242 (Output_reduced_debug_info_section::get_die_end): Remove
3243 DW_FORM_GNU_ref_index. Add default case.
3245 2012-04-26 Mark Wielaard <mjw@redhat.com>
3247 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3248 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3249 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3250 DW_AT_high_pc as offset from DW_AT_low_pc.
3252 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3253 * testsuite/Makefile.in: Regenerate.
3254 * testsuite/gdb_index_test_3.c: New test source file.
3255 * testsuite/gdb_index_test_3.sh: New test source file.
3257 2012-04-25 Ian Lance Taylor <iant@google.com>
3259 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3261 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3262 as a class, not a struct.
3263 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3264 (Target_arm::apply_cortex_a8_workaround): Likewise.
3265 * gc.h: Declare Reloc_types as a struct, not a class.
3266 * object.h: Declare Symbols_data as a struct.
3267 * reloc.h: Declare Read_relocs_data as a struct.
3268 * target.h: Declare Relocate_info as a struct.
3270 2012-04-24 David S. Miller <davem@davemloft.net>
3272 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3273 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3276 2012-04-24 Cary Coutant <ccoutant@google.com>
3278 * incremental-dump.cc (find_input_containing_global): Replace
3279 magic number with symbolic constant.
3280 (dump_incremental_inputs): Update version number.
3281 * incremental.cc (Output_section_incremental_inputs): Update version
3282 number; import symbolic constants from Incremental_inputs_reader.
3283 (Incremental_inputs::create_data_sections): Align relocations
3284 section correctly for 64-bit targets.
3285 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3286 constants; add padding.
3287 (Output_section_incremental_inputs::write_header): Add assert for
3289 (Output_section_incremental_inputs::write_input_files): Add assert
3290 for input_entry_size.
3291 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3292 add assert for object_info_size, input_section_entry_size,
3293 global_sym_entry_size.
3294 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3295 for data structure sizes; use them.
3296 (Incremental_input_entry_reader): Import symbolic constants from
3297 Incremental_inputs_reader; use them.
3299 2012-04-23 David S. Miller <davem@davemloft.net>
3301 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3303 (Target_sparc::Target_sparc): Initialize new fields.
3304 (Target_sparc::do_make_elf_object): New function.
3305 (Target_sparc::do_adjust_elf_header): New function.
3307 2012-04-23 Cary Coutant <ccoutant@google.com>
3309 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3310 CU range table of gdb index.
3312 2012-04-20 David S. Miller <davem@davemloft.net>
3314 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3317 2012-04-16 David S. Miller <davem@davemloft.net>
3319 * sparc.cc (Target_sparc::got_address): New function.
3320 (Sparc_relocate_functions::gdop_hix22): New function.
3321 (Sparc_relocate_functions::gdop_lox10): New function.
3322 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3324 (Target_sparc::Scan::local): Likewise if the global symbol is not
3325 preemptible and is not IFUNC.
3326 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3327 transformations for local and non-preemptible non-IFUNC global
3330 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3331 writing out 64-bit part of ranges.
3333 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3334 -fpic and -fpie respectively.
3335 * Makefile.in: Regenerate.
3337 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3338 (Target_sparc::Target_sparc): Initialize new field.
3339 (Target_sparc::do_plt_section_for_global): New function.
3340 (Target_sparc::do_plt_section_for_local): New function.
3341 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3342 (Target_sparc::make_plt_section): New function, broken out of
3343 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3344 (Target_sparc::make_plt_entry): Call make_plt_section.
3345 (Target_sparc::make_local_ifunc_plt_entry): New function.
3346 (Target_sparc::rela_ifunc_section): New function.
3347 (Target_sparc::plt_section): Remove const.
3348 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3349 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3350 and ifunc_count_ fields.
3351 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3352 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3353 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3354 (Output_data_plt_sparc::rela_ifunc): New function.
3355 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3356 (Output_data_plt_sparc::has_ifunc_section): New function.
3357 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3358 (Output_data_plt_sparc::address_for_global): New function.
3359 (Output_data_plt_sparc::address_for_local): New function.
3360 (Output_data_plt_sparc::plt_index_to_offset): New function.
3361 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3363 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3365 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3366 R_SPARC_JMP_IREL to switch.
3367 (Target_sparc::Scan::check_non_pic): Likewise.
3368 (Target_sparc::Scan::local): Handle IFUNC symbols.
3369 (Target_sparc::Scan::local): Likewise.
3370 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3371 and plt_address_for_local.
3372 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3373 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3375 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3376 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3377 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3378 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3380 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3381 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3383 * sparc.cc (Target_sparc::Scan::global): Likewise.
3384 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3386 2012-04-16 Cary Coutant <ccoutant@google.com>
3388 * archive.cc (Library_base::should_include_member): Check for
3389 --export-dynamic-symbol.
3390 * options.h (class General_options): Add --export-dynamic-symbol.
3391 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3392 --export-dynamic-symbol.
3393 (Symbol_table::gc_mark_undef_symbols): Likewise.
3394 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3396 2012-04-12 David S. Miller <davem@davemloft.net>
3398 * sparc.cc (Reloc::wdisp10): New relocation method.
3399 (Reloc::h34): Likewise.
3400 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3401 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3403 (Target_sparc::Scan::local): Likewise.
3404 (Target_sparc::Scan::global): Likewise.
3405 (Target_sparc::Relocate::relocate): Likewise.
3407 2012-04-09 Cary Coutant <ccoutant@google.com>
3409 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3412 2012-04-06 Ian Lance Taylor <iant@google.com>
3414 * timer.cc: #include <unistd.h>.
3416 2012-04-06 Roland McGrath <mcgrathr@google.com>
3418 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3419 * config.in: Regenerate.
3420 * configure: Regenerate.
3422 2012-04-05 Nick Clifton <nickc@redhat.com>
3424 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3425 (AM_LC_MESSAGES): Add.
3426 * aclocal.m4: Regenerate.
3427 * config.in: Regenerate.
3428 * configure: Regenerate.
3430 2012-03-21 Cary Coutant <ccoutant@google.com>
3432 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3433 * Makefile.in: Regenerate.
3434 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3435 (Sized_elf_reloc_mapper::symbol_section): New function.
3436 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3437 (make_elf_reloc_mapper): New function.
3438 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3439 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3440 (Dwarf_abbrev_table::do_get_abbrev): New function.
3441 (Dwarf_ranges_table::read_ranges_table): New function.
3442 (Dwarf_ranges_table::read_range_list): New function.
3443 (Dwarf_pubnames_table::read_section): New function.
3444 (Dwarf_pubnames_table::read_header): New function.
3445 (Dwarf_pubnames_table::next_name): New function.
3446 (Dwarf_die::Dwarf_die): New function.
3447 (Dwarf_die::read_attributes): New function.
3448 (Dwarf_die::skip_attributes): New function.
3449 (Dwarf_die::set_name): New function.
3450 (Dwarf_die::set_linkage_name): New function.
3451 (Dwarf_die::attribute): New function.
3452 (Dwarf_die::string_attribute): New function.
3453 (Dwarf_die::int_attribute): New function.
3454 (Dwarf_die::uint_attribute): New function.
3455 (Dwarf_die::ref_attribute): New function.
3456 (Dwarf_die::child_offset): New function.
3457 (Dwarf_die::sibling_offset): New function.
3458 (Dwarf_info_reader::check_buffer): New function.
3459 (Dwarf_info_reader::parse): New function.
3460 (Dwarf_info_reader::do_parse): New function.
3461 (Dwarf_info_reader::do_read_string_table): New function.
3462 (Dwarf_info_reader::lookup_reloc): New function.
3463 (Dwarf_info_reader::get_string): New function.
3464 (Dwarf_info_reader::visit_compilation_unit): New function.
3465 (Dwarf_info_reader::visit_type_unit): New function.
3466 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3467 Sized_elf_reloc_mapper.
3468 (Sized_dwarf_line_info::symbol_section): Remove function.
3469 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3470 (Sized_dwarf_line_info::read_line_mappings): Remove object
3471 parameter, adjust callers.
3472 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3473 * dwarf_reader.h: Include <sys/types.h>.
3474 (class Track_relocs): Remove forward declaration.
3475 (class Elf_reloc_mapper): New class.
3476 (class Sized_elf_reloc_mapper): New class.
3477 (class Dwarf_abbrev_table): New class.
3478 (class Dwarf_range_list): New class.
3479 (class Dwarf_ranges_table): New class.
3480 (class Dwarf_pubnames_table): New class.
3481 (class Dwarf_die): New class.
3482 (class Dwarf_info_reader): New class.
3483 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3484 (Sized_dwarf_line_info::symbol_section): Remove member function.
3485 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3487 * gdb-index.cc: New source file.
3488 * gdb-index.h: New source file.
3489 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3490 and .debug_types sections, call Layout::add_to_gdb_index.
3491 (Sized_relobj_incr::do_section_name): Implement.
3492 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3493 return type; Implement.
3494 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3496 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3497 parameter list and return type.
3498 (Sized_incr_dynobj::do_section_contents): Likewise.
3499 * layout.cc: Include gdb-index.h.
3500 (Layout::Layout): Initialize gdb_index_data_.
3501 (Layout::init_fixed_output_section): Check for .gdb_index section.
3502 (Layout::add_to_gdb_index): New function. Instantiate.
3503 * layout.h: Add forward declaration for class Gdb_index.
3504 (Layout::add_to_gdb_index): New member function.
3505 (Layout::gdb_index_data_): New data member.
3506 * main.cc: Include gdb-index.h.
3507 (main): Print statistics for gdb index.
3508 * object.cc (Object::section_contents): Move code into
3509 do_section_contents.
3510 (need_decompressed_section): Check for sections needed when building
3512 (build_compressed_section_map): Likewise.
3513 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3515 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3516 sections; call Layout::add_to_gdb_index.
3517 (Sized_relobj_file::do_decompressed_section_contents): Call
3518 do_section_contents directly.
3519 * object.h (Object::do_section_contents): Adjust parameter list and
3521 (Object::do_decompressed_section_contents): Call do_section_contents
3523 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3525 * options.h (class General_options): Add --gdb-index option.
3526 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3527 list and return type.
3528 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3529 * reloc.h (Track_relocs::checkpoint): New function.
3530 (Track_relocs::reset): New function.
3532 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3534 * testsuite/Makefile.in: Regenerate.
3535 * testsuite/gdb_index_test.cc: New test source file.
3536 * testsuite/gdb_index_test_1.sh: New test source file.
3537 * testsuite/gdb_index_test_2.sh: New test source file.
3539 2012-03-19 Doug Kwan <dougkwan@google.com>
3541 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3542 (Target_arm::do_finalize_sections): Remove code which defines
3543 __exidx_start and __exidx_end. Make symbol table parameter
3544 anonymous as it is not used.
3545 * gold.cc (queue_middle_tasks): Call target hook to define any
3546 target-specific symbols.
3547 * target.h (Target::define_standard_symbols): New method.
3548 (Target::do_define_standard_symbols): Same.
3549 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3550 * testsuite/Makefile.in: Regenerate.
3551 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3553 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3554 relocations are generated for __exidx_start and __exidx_end.
3556 2012-03-16 Doug Kwan <dougkwan@google.com>
3558 * testsuite/Makefile.am: Disable test initpri3b.
3559 * testsuite/Makefile.in: Regenerate.
3561 2012-03-15 Doug Kwan <dougkwan@google.com>
3563 * arm.cc (Target_arm::got_section): Make .got section read-only
3566 2012-03-15 Ian Lance Taylor <iant@google.com>
3569 * layout.cc (Layout::make_output_section): Correctly mark
3570 SHT_INIT_ARRAY, et. al., as relro.
3572 2012-03-14 Doug Kwan <dougkwan@google.com>
3574 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3575 dynamic relocations for protected symbols in shared objects.
3577 2012-03-13 Ian Lance Taylor <iant@google.com>
3579 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3580 keep the larger alignment.
3582 2012-03-12 Cary Coutant <ccoutant@google.com>
3584 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3585 handling of DW_LNE_define_file.
3587 2012-03-12 Cary Coutant <ccoutant@google.com>
3589 * reduced_debug_output.cc
3590 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3593 2012-02-29 Cary Coutant <ccoutant@google.com>
3595 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3597 2012-02-29 Cary Coutant <ccoutant@google.com>
3599 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3600 Call Object::decompressed_section_contents.
3601 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3603 (Sized_dwarf_line_info::buffer_start_): New data member.
3604 * merge.cc (Output_merge_data::do_add_input_section): Call
3605 Object::decompressed_section_contents.
3606 (Output_merge_string::do_add_input_section): Likewise.
3607 * object.cc (need_decompressed_section): New function.
3608 (build_compressed_section_map): Decompress sections needed later.
3609 (Sized_relobj_file::do_decompressed_section_contents): New function.
3610 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3611 * object.h (Object::decompressed_section_contents): New function.
3612 (Object::discard_decompressed_sections): New function.
3613 (Object::do_decompressed_section_contents): New function.
3614 (Object::do_discard_decompressed_sections): New function.
3615 (Compressed_section_info): New type.
3616 (Compressed_section_map): Include decompressed section contents.
3617 (Sized_relobj_file::do_decompressed_section_contents): New function.
3618 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3620 2012-02-16 Cary Coutant <ccoutant@google.com>
3622 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3623 * testsuite/Makefile.in: Regenerate.
3625 2012-02-14 Cary Coutant <ccoutant@google.com>
3627 * options.cc (General_options::finalize): Disallow -pie and -static.
3629 2012-02-03 Doug Kwan <dougkwan@google.com>
3631 * arm.cc (Arm_relocate_functions::abs8,
3632 Arm_relocate_functions::abs16): Use
3633 Bits::has_signed_unsigned_overflow32.
3634 (Arm_relocate_functions::thm_abs8): Correct range of
3636 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3639 2012-02-02 Doug Kwan <dougkwan@google.com>
3641 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3642 position independent outputs, not just shared objects.
3644 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3646 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3647 * configure: Regenerated.
3649 2012-01-27 Ian Lance Taylor <iant@google.com>
3651 * reloc.h (Bits): New class with static functions, copied from
3652 namespace utils in arm.cc.
3653 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3656 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3658 * incremental.cc (write_info_blocks): Correct relocation offset.
3660 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3662 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3663 (Relocate::tls_gd_to_le): Likewise.
3665 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3667 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3669 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3671 * configure.ac: Check if -mcmodel=medium works.
3672 * configure: Regenerated.
3674 2012-01-24 Cary Coutant <ccoutant@google.com>
3676 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3678 (read_unsigned_LEB_128_x): ... this new function.
3679 (read_signed_LEB_128): Replaced with inline definition and ...
3680 (read_signed_LEB_128_x): ... this new function.
3681 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3682 (read_unsigned_LEB_128): Add inline definition.
3683 (read_signed_LEB_128_x): New function.
3684 (read_signed_LEB_128): Add inline definition.
3685 * testsuite/Makefile.am (leb128_unittest): New unit test.
3686 * testsuite/Makefile.in: Regenerate.
3687 * testsuite/leb128_unittest.cc: New unit test.
3689 2012-01-23 Ian Lance Taylor <iant@google.com>
3692 * i386.cc (Target_i386::do_code_fill): When using a jmp
3693 instruction, pad with nop instructions.
3694 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3696 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3698 * x86_64.cc (gc_process_relocs): Add typename on types used in
3700 (scan_relocs): Likewise.
3701 (relocate_section): Likewise.
3702 (apply_relocation): Likewise.
3704 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3706 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3707 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3710 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3712 * x86_64.cc: Initial support for x32.
3714 2012-01-03 Cary Coutant <ccoutant@google.com>
3716 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3717 Use abstract base class for GOT.
3718 * gold/output.h (class Output_data_got_base): New abstract base class.
3719 (class Output_data_got): Derive from new base class, adjust ctors.
3720 (Output_data_got::reserve_slot): Make virtual; rename to
3721 do_reserve_slot; Adjust callers.
3722 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3723 pointer to abstract base class.
3724 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3726 2011-12-18 Ian Lance Taylor <iant@google.com>
3728 * object.h (Relobj::local_symbol_value): New function.
3729 (Relobj::local_plt_offset): New function.
3730 (Relobj::local_has_got_offset): New function.
3731 (Relobj::local_got_offset): New function.
3732 (Relobj::set_local_got_offset): New function.
3733 (Relobj::do_local_symbol_value): New pure virtual function.
3734 (Relobj::do_local_plt_offset): Likewise.
3735 (Relobj::do_local_has_got_offset): Likewise.
3736 (Relobj::do_local_got_offset): Likewise.
3737 (Relobj::do_set_local_got_offset): Likewise.
3738 (Sized_relobj::do_local_has_got_offset): Rename from
3739 local_has_got_offset.
3740 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3741 (Sized_relobj::do_set_local_got_offset): Rename from
3742 set_local_got_offset.
3743 (Sized_relobj_file::do_local_plt_offset): Rename from
3745 (Sized_relobj_file::do_local_symbol_value): New function.
3746 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3748 * output.cc (Output_data_got::Got_entry::write): Change object to
3749 Relobj. Use local_symbol_value.
3750 (Output_data_got::add_global_with_rel): Change rel_dyn to
3751 Output_data_reloc_generic*. Use add_global_generic.
3752 (Output_data_got::add_global_with_rela): Remove. Change all
3753 callers to use add_global_with_rel.
3754 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3755 Output_data_reloc_generic*. Use add_global_generic.
3756 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3757 callers to use add_global_pair_with_rel.
3758 (Output_data_got::add_local): Change object to Relobj*.
3759 (Output_data_got::add_local_plt): Likewise.
3760 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3761 change rel_dyn to Output_data_reloc_generic*. Use
3763 (Output_data_got::add_local_with_rela): Remove. Change all
3764 callers to use all_local_with_rel.
3765 (Output_data_got::add_local_pair_with_rel): Change object to
3766 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3767 add_output_section_generic.
3768 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3769 callers to use add_local_pair_with_rel.
3770 (Output_data_got::reserve_local): Change object to Relobj*.
3771 * output.h: (class Output_data_reloc_generic): Add pure virtual
3772 declarations for add_global_generic, add_local_generic,
3773 add_output_section_generic.
3774 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3775 functions for Output_data_reloc_generic. Update declarations for
3776 changes listed in output.cc.
3777 (class Output_data_got): Change template parameter to got_size.
3778 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3779 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3781 (Sized_relobj_incr::do_local_plt_offset): New function.
3782 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3785 2011-12-17 Cary Coutant <ccoutant@google.com>
3787 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3788 * resolve.cc (Symbol_table::resolve): Likewise.
3789 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3791 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3793 2011-12-16 Ian Lance Taylor <iant@google.com>
3795 * output.h (Output_data_reloc_generic::add): Only call
3796 add_dynamic_reloc if this is a dynamic reloc section.
3798 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3801 * target-reloc.h (apply_relocation): Replace <64, false> with
3804 2011-11-25 Nick Clifton <nickc@redhat.com>
3806 * po/it.po: New Italian translation.
3808 2011-11-17 Sterling Augustine <saugustine@google.com>
3810 * script.cc (script_include_directive): Implement.
3811 (read_script_file): New local variables name and search_path. Update
3812 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3813 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3814 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3816 2011-11-11 Sterling Augustine <saugustine@google.com>
3818 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3819 (file_or_sections_cmd): Likewise.
3821 2011-11-11 Doug Kwan <dougkwan@google.com>
3823 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3824 if --just-symbols is given.
3826 2011-11-10 Doug Kwan <dougkwan@google.com>
3829 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3830 when processing data relocs.
3831 * reloc.h (Relocate_functions::rel_unaligned): New method.
3832 (Relocate_functions::pcrel_unaligned): Ditto.
3833 (Relocate_functions::rel32_unaligned): Ditto.
3834 (Relocate_functions::pcrel32_unaligned): Ditto.
3836 2011-11-09 Doug Kwan <dougkwan@google.com>
3839 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3840 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3841 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3842 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3843 (Relocate_functions::rel_unaligned): New.
3844 (Relocate_functions::rel32_unaligned): New.
3845 * target-reloc.h (relocate_for_relocatable): Add code to handle
3846 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3847 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3848 arm_unaligned_reloc_r): New targets.
3849 * testsuite/Makefile.in: Regenerate.
3850 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3853 2011-11-02 Ian Lance Taylor <iant@google.com>
3855 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3857 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3858 * options.cc (General_options::finalize): Use library search path
3859 from configure script if specified. If not native and no sysroot,
3860 only search TOOLLIBDIR.
3861 * options.h (Search_directory::Search_directory): Change name to
3863 (General_options::add_to_library_path_with_sysroot): Change arg to
3865 * configure, Makefile.in, config.in: Rebuild.
3867 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3869 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3870 we are working around the ARM1176 Erratum.
3871 * options.h (General_options::fix_arm1176): Add option.
3872 * testsuite/Makefile.am: Add testcases, and keep current ones
3874 * testsuite/Makefile.in: Regenerate.
3875 * testsuite/arm_fix_1176.s: New file.
3876 * testsuite/arm_fix_1176.sh: Likewise.
3878 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3880 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3882 (Target_arm::may_use_blx): Remove method.
3883 (Target_arm::set_may_use_blx): Likewise.
3884 (Target_arm::may_use_v4t_interworking): New method.
3885 (Target_arm::may_use_v5t_interworking): Likewise.
3886 (Target_arm::may_use_blx_): Remove member variable.
3887 (Arm_relocate_functions::arm_branch_common): Check for v5T
3889 (Arm_relocate_functions::thumb_branch_common): Likewise.
3890 (Reloc_stub::stub_type_for_reloc): Likewise.
3891 (Target_arm::do_finalize_sections): Correct interworking checks.
3892 * testsuite/Makefile.am: Add new tests.
3893 * testsuite/Makefile.in: Regenerate.
3894 * testsuite/arm_farcall_arm_arm.s: New test.
3895 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3896 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3897 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3898 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3899 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3900 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3901 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3903 2011-10-31 Cary Coutant <ccoutant@google.com>
3906 * expression.cc (Expression::eval_with_dot): Add
3907 is_section_dot_assignment parameter.
3908 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3909 absolute and assigning to dot within a section.
3910 * script-sections.cc
3911 (Output_section_element_assignment::set_section_addresses): Pass
3912 dot_section to set_if_absolute.
3913 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3914 as is_section_dot_assignment flag to eval_with_dot.
3915 (Output_section_element_dot_assignment::set_section_addresses):
3917 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3918 parameter. Also set value if relative to dot_section; set the
3919 symbol's output_section.
3920 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3921 parameter. Adjust all callers.
3922 (Expression::eval_maybe_dot): Likewise.
3923 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3925 * testsuite/script_test_2.t: Test assignment of an absolute value
3926 to dot within an output section element.
3928 2011-10-31 Cary Coutant <ccoutant@google.com>
3930 * options.h (class General_options): Add --[no-]gnu-unique options.
3931 * symtab.cc (Symbol_table::sized_write_globals): Convert
3932 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3934 2011-10-31 Cary Coutant <ccoutant@google.com>
3937 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3938 unnecessary assertion.
3939 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3941 2011-10-31 Sriraman Tallam <tmsriram@google.com>
3943 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3945 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3947 Change to just keep the section associated with symbol.
3948 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3949 they are externally visible and --export-dynamic is turned on.
3950 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3952 2011-10-19 Ian Lance Taylor <iant@google.com>
3955 * script-sections.cc
3956 (Output_section_element_dot_assignment::needs_output_section): New
3959 2011-10-19 Ian Lance Taylor <iant@google.com>
3962 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3963 --section-start option was seen.
3964 * options.h (General_options::any_section_start): New function.
3966 2011-10-18 David S. Miller <davem@davemloft.net>
3969 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3970 member to track relocation locations that have moved during TLS
3971 reloc optimizations.
3972 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3973 (Target_sparc::Relocate::relocate): Adjust view down by 4
3974 bytes if it matches reloc_adjust_addr_.
3975 (Target_sparc::Relocate::relocate_tls): Always move the
3976 __tls_get_addr call delay slot instruction forward 4 bytes when
3977 performing relaxation.
3979 2011-10-18 Cary Coutant <ccoutant@google.com>
3981 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3982 (Output_file::map_no_anonymous): Check for non-zero
3983 return code from posix_fallocate.
3985 2011-10-17 Cary Coutant <ccoutant@google.com>
3988 * plugin.cc (is_visible_from_outside): Check for symbols
3989 referenced from dynamic objects.
3990 * resolve.cc (Symbol_table::resolve): Don't count references
3991 from dynamic objects as references from real ELF files.
3992 * testsuite/plugin_test_2.sh: Adjust expected result.
3994 2011-10-17 Cary Coutant <ccoutant@google.com>
3996 * gold.cc: Include timer.h.
3997 (queue_middle_tasks): Stamp time.
3998 (queue_final_tasks): Likewise.
3999 * main.cc (main): Store timer in parameters. Print timers
4001 * parameters.cc (Parameters::Parameters): Initialize timer_.
4002 (Parameters::set_timer): New function.
4003 (set_parameters_timer): New function.
4004 * parameters.h (Parameters::set_timer): New function.
4005 (Parameters::timer): New function.
4006 (Parameters::timer_): New data member.
4007 (set_parameters_timer): New function.
4008 * timer.cc (Timer::stamp): New function.
4009 (Timer::get_pass_time): New function.
4010 * timer.h (Timer::stamp): New function.
4011 (Timer::get_pass_time): New function.
4012 (Timer::pass_times_): New data member.
4014 2011-10-17 Cary Coutant <ccoutant@google.com>
4016 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4017 task for members of lib groups.
4019 2011-10-17 Cary Coutant <ccoutant@google.com>
4022 * fileread.cc (File_read::find_view): Add assert.
4023 (File_read::make_view): Move bounds check (replace with assert)...
4024 (File_read::find_or_make_view): ... to here.
4026 2011-10-12 Cary Coutant <ccoutant@google.com>
4028 * output.cc (Output_file::open_base_file): Handle case where
4029 ::read returns less than requested size.
4031 2011-10-10 Cary Coutant <ccoutant@google.com>
4033 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4034 Initialize defined_count_.
4035 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4036 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4037 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4038 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4039 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4040 * incremental.h (Sized_relobj_incr::defined_count_): New data
4042 (Sized_incr_dynobj::defined_count_): New data member.
4043 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4044 Return zeroes instead of internal error.
4046 2011-10-10 Cary Coutant <ccoutant@google.com>
4049 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4050 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4051 * output.h (class Output_reloc): Add use_plt_offset flag.
4052 (Output_reloc::type_): Adjust size of bit field.
4053 (Output_reloc::use_plt_offset_): New bit field.
4054 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4055 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4056 flag. Adjust all callers.
4057 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4058 creating RELATIVE relocations.
4060 2011-10-10 Nick Clifton <nickc@redhat.com>
4062 * po/es.po: Updated Spanish translation.
4063 * po/fi.po: Updated Finnish translation.
4065 2011-10-03 Diego Novillo <dnovillo@google.com>
4067 * options.cc (parse_uint): Fix dereference of RETVAL.
4069 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4071 * layout.h (section_order_map_): New member.
4072 (get_section_order_map): New member function.
4073 * output.cc (Output_section::add_input_section): Check for patterns
4074 only when --section-ordering-file is specified.
4075 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4076 output_sections have been formed.
4077 * layout.cc (Layout_Layout): Initialize section_order_map_.
4078 * plugin.cc (update_section_order): Store order in order_map. Do not
4080 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4081 * testsuite/Makefile.in: Regenerate.
4082 * testsuite/plugin_section_order.c: New file.
4083 * testsuite/plugin_final_layout.cc: New file.
4084 * testsuite/plugin_final_layout.sh: New file.
4086 2011-09-29 Cary Coutant <ccoutant@google.com>
4088 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4090 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4091 symbols during incremental update.
4092 (Symbol_table::add_from_dynobj): Likewise.
4094 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4095 Ian Lance Taylor <iant@google.com>
4097 * symtab.cc (Symbol_table::define_special_symbol): Always
4098 canonicalize version string.
4100 2011-09-26 Cary Coutant <ccoutant@google.com>
4102 * gold.cc (queue_initial_tasks): Move option checks ...
4103 * options.cc (General_options::finalize): ... to here. Disable
4104 some options; make others fatal.
4106 2011-09-26 Cary Coutant <ccoutant@google.com>
4109 * plugin.cc (get_symbols_v2): New function.
4110 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4111 (is_referenced_from_outside): New function.
4112 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4113 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4114 (get_symbols): Pass version parameter.
4115 (get_symbols_v2): New function.
4116 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4118 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4119 (onload): Add LDPT_GET_SYMBOLS_V2.
4120 (all_symbols_read_hook): Use get_symbols_v2; check for
4121 LDPR_PREVAILING_DEF_IRONLY_EXP.
4122 * testsuite/plugin_test_3.sh: Update expected results.
4124 2011-09-23 Simon Baldwin <simonb@google.com>
4126 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4127 configuration options.
4128 * configure: Regenerate.
4129 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4130 * Makefile.in: Regenerate.
4131 * testsuite/Makefile.in: Regenerate.
4133 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4135 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4137 2011-09-19 Cary Coutant <ccoutant@google.com>
4139 * incremental.cc (can_incremental_update): Fix typo in comment.
4140 * incremental.h (can_incremental_update): Likewise.
4142 2011-09-18 Cary Coutant <ccoutant@google.com>
4144 * incremental.cc (can_incremental_update): New function.
4145 * incremental.h (can_incremental_update): New function.
4146 * layout.cc (Layout::init_fixed_output_section): Call it.
4147 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4148 * object.cc (Sized_relobj_file::do_layout): Call
4149 can_incremental_update.
4151 2011-09-13 Cary Coutant <ccoutant@google.com>
4153 * configure.ac: Check for glibc support for gnu_indirect_function
4154 support with static linking, setting automake conditional
4156 * Makefile.in: Regenerate.
4157 * configure: Regenerate.
4159 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4160 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4162 * testsuite/Makefile.in: Regenerate.
4164 2011-09-13 Cary Coutant <ccoutant@google.com>
4166 * incremental.cc (Sized_relobj_incr::do_layout): Call
4167 report_comdat_group for kept comdat sections.
4168 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4169 * testsuite/Makefile.in: Regenerate.
4170 * testsuite/incr_comdat_test_1.cc: New source file.
4171 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4172 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4173 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4175 2011-09-13 Ian Lance Taylor <iant@google.com>
4177 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4178 variable external_symbols_offset.
4180 2011-09-12 Ian Lance Taylor <iant@google.com>
4182 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4183 triggered if object has no symbols.
4185 2011-09-09 David S. Miller <davem@davemloft.net>
4187 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4188 (Output_fill_debug_line::do_write): Likewise.
4190 2011-08-29 Cary Coutant <ccoutant@google.com>
4192 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4193 casts to match formatting specs.
4194 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4196 2011-08-26 Cary Coutant <ccoutant@google.com>
4198 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4199 remaining hole size when allocating.
4200 (Layout::make_output_section): Set fill methods for debug sections.
4201 * layout.h (Free_list::Free_list_node): Move from private to
4203 (Free_list::set_min_hole_size): New function.
4204 (Free_list::begin, Free_list::end): New functions.
4205 (Free_list::min_hole_): New data member.
4206 * output.cc: Include dwarf.h.
4207 (Output_fill_debug_info::do_minimum_hole_size): New function.
4208 (Output_fill_debug_info::do_write): New function.
4209 (Output_fill_debug_line::do_minimum_hole_size): New function.
4210 (Output_fill_debug_line::do_write): New function.
4211 (Output_section::Output_section): Initialize new data member.
4212 (Output_section::set_final_data_size): Ensure patch space is larger
4213 than minimum hole size.
4214 (Output_section::do_write): Fill holes in debug sections.
4215 * output.h (Output_fill): New class.
4216 (Output_fill_debug_info): New class.
4217 (Output_fill_debug_line): New class.
4218 (Output_section::set_free_space_fill): New function.
4219 (Output_section::free_space_fill_): New data member.
4220 * testsuite/Makefile.am (incremental_test_3): Add
4221 --incremental-patch option.
4222 (incremental_test_4): Likewise.
4223 (incremental_test_5): Likewise.
4224 (incremental_test_6): Likewise.
4225 (incremental_copy_test): Likewise.
4226 (incremental_common_test_1): Likewise.
4227 * testsuite/Makefile.in: Regenerate.
4229 2011-08-26 Nick Clifton <nickc@redhat.com>
4231 * po/es.po: Updated Spanish translation.
4233 2011-08-01 Cary Coutant <ccoutant@google.com>
4235 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4236 * gold/testsuite/Makefile.in: Regenerate.
4237 * gold/testsuite/justsyms_exec.c: New source file.
4238 * gold/testsuite/justsyms_lib.c: New source file.
4240 2011-08-01 Cary Coutant <ccoutant@google.com>
4242 * layout.cc (Layout::set_segment_offsets): Don't realign text
4243 segment if -Ttext was specified.
4244 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4246 * object.h (Sized_relobj_file::e_type): New function.
4247 (Sized_relobj_file::e_type_): New data member.
4248 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4249 base address for ET_EXEC files.
4250 * target.cc (Target::do_make_elf_object_implementation): Allow
4251 ET_EXEC files with --just-symbols option.
4253 2011-07-28 Cary Coutant <ccoutant@google.com>
4255 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4256 Add thread_number parameter.
4257 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4258 * workqueue-threads.cc
4259 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4260 current thread if its thread number is greater than desired thread
4262 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4263 Add thread_number parameter.
4264 (Workqueue::should_cancel_thread): Likewise.
4265 (Workqueue::find_runnable_or_wait): Pass thread_number to
4266 should_cancel_thread.
4267 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4270 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4272 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4273 only after checking if it cannot be forced local.
4274 * symtab.h (is_externally_visible): Check if the symbol is not forced
4277 2011-07-15 Ian Lance Taylor <iant@google.com>
4279 * options.h (class General_options): Add --print-output-format.
4280 Move -EL next to -EB, for better --help output.
4281 * target-select.cc: Include <cstdio>, "options.h", and
4283 (Target_selector::do_target_bfd_name): New function.
4284 (print_output_format): New function.
4285 * target-select.h (class Target_selector): Update declarations.
4286 (Target_selector::target_bfd_name): New function.
4287 (print_output_format): Declare.
4288 * main.cc: Include "target-select.h".
4289 (main): Handle --print-output-format.
4290 * gold.cc: Include "target-select.h".
4291 (queue_initial_tasks): Handle --print-output-format when there are
4293 * parameters.cc (parameters_force_valid_target): Give a better
4294 error message if -EB/-EL does not match target.
4295 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4298 2011-07-15 Ian Lance Taylor <iant@google.com>
4300 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4301 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4302 (Output_data_plt_i386::do_write): Write address of .dynamic
4303 section to first entry in .got.plt section.
4304 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4305 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4307 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4308 section to first entry in .got.plt section.
4309 * layout.h (Layout::dynamic_section): New function.
4311 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4313 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4315 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4316 input_section_position_, and input_section_glob_.
4317 (read_layout_from_file): Call function section_ordering_specified.
4318 * layout.h (is_section_ordering_specified): New function.
4319 (section_ordering_specified): New function.
4320 (section_ordering_specified_): New boolean member.
4321 * main.cc(main): Call load_plugins after layout object is defined.
4322 * output.cc (Output_section::add_input_section): Use
4323 function section_ordering_specified to check if section ordering is
4325 * output.cc (Output_section::add_relaxed_input_section): Use
4326 function section_ordering_specified to check if section ordering is
4328 (Output_section::update_section_layout): New function.
4329 (Output_section::sort_attached_input_sections): Check if input section
4331 * output.h (Output_section::update_section_layout): New function.
4332 * plugin.cc (get_section_count): New function.
4333 (get_section_type): New function.
4334 (get_section_name): New function.
4335 (get_section_contents): New function.
4336 (update_section_order): New function.
4337 (allow_section_ordering): New function.
4338 (Plugin::load): Add the new interfaces to the transfer vector.
4339 (Plugin_manager::load_plugins): New parameter.
4340 (Plugin_manager::all_symbols_read): New parameter.
4341 (Plugin_manager::claim_file): New parameter. Save the elf object for
4343 (Plugin_manager::get_elf_object): New function.
4344 (Plugin_manager::get_view): Change to directly use the bool to check
4345 if get_view is called from claim_file_hook.
4346 * plugin.h (input_objects): New function
4347 (Plugin__manager::load_plugins): New parameter.
4348 (Plugin_manager::claim_file): New parameter.
4349 (Plugin_manager::get_elf_object): New function.
4350 (Plugin_manager::in_claim_file_handler): New function.
4351 (Plugin_manager::in_claim_file_handler_): New member.
4352 (layout): New function.
4353 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4354 handler with an extra parameter. Make the elf object before calling
4356 * testsuite/plugin_test.c (get_section_count): New function pointer.
4357 (get_section_type): New function pointer.
4358 (get_section_name): New function pointer.
4359 (get_section_contents): New function pointer.
4360 (update_section_order): New function pointer.
4361 (allow_section_ordering): New function pointer.
4362 (onload): Check if the new interfaces exist.
4364 2011-07-13 Ian Lance Taylor <iant@google.com>
4366 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4368 * x86_64.cc (Target_x86_64::got_section): Likewise.
4369 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4370 (relro_now_test_SOURCES): New variable.
4371 (relro_now_test_DEPENDENCIES): New variable.
4372 (relro_now_test_LDFLAGS): New variable.
4373 (relro_now_test_LDADD): New variable.
4374 (relro_now_test.so): New target.
4375 * testsuite/Makefile.in: Rebuild.
4377 2011-07-12 Ian Lance Taylor <iant@google.com>
4380 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4381 GLOB_DAT relocation rather than a RELATIVE relocation for a
4382 protected symbol when creating a shared library.
4383 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4384 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4385 * testsuite/protected_main_1.cc (main): Test that protected
4386 function has same address.
4388 2011-07-11 Ian Lance Taylor <iant@google.com>
4391 * options.h (class General_options): Add -Bgroup.
4392 * options.cc (General_options::finalize): If -Bgroup is set,
4393 default to --unresolved-symbols=report-all.
4394 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4395 * target-reloc.h (issue_undefined_symbol_error): Handle
4396 --unresolved-symbols=report-all.
4398 2011-07-08 Ian Lance Taylor <iant@google.com>
4401 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4402 if linker script discards key sections.
4403 (Layout::create_dynamic_symtab): Likewise.
4404 (Layout::assign_local_dynsym_offsets): Likewise.
4405 (Layout::sized_create_version_sections): Likewise.
4406 (Layout::create_interp): Likewise.
4407 (Layout::finish_dynamic_section): Likewise.
4408 (Layout::set_dynamic_symbol_size): Likewise.
4410 2011-07-08 Ian Lance Taylor <iant@google.com>
4413 * options.h (class General_options): Add --unresolved-symbols.
4414 * target-reloc.h (issue_undefined_symbol_error): Check
4415 --unresolved-symbols. Add comments.
4417 2011-07-08 Ian Lance Taylor <iant@google.com>
4419 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4420 expression more complex.
4422 2011-07-08 Ian Lance Taylor <iant@google.com>
4425 * target-reloc.h (issue_undefined_symbol_error): New inline
4426 function, broken out of relocate_section.
4427 (relocate_section): Call issue_undefined_symbol_error.
4428 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4429 there is no TLS segment if we are about to issue an undefined
4431 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4433 2011-07-08 Ian Lance Taylor <iant@google.com>
4436 * resolve.cc (Symbol_table::should_override): Add fromtype
4437 parameter. Change all callers. Give error when linking together
4438 TLS and non-TLS symbol.
4439 (Symbol_table::should_override_with_special): Add fromtype
4440 parameter. Change all callers.
4441 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4442 there is no TLS segment if we have reported some errors.
4443 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4445 2011-07-08 Ian Lance Taylor <iant@google.com>
4448 * target.h (Target::plt_address_for_global): New function.
4449 (Target::plt_address_for_local): New function.
4450 (Target::plt_section_for_global): Remove.
4451 (Target::plt_section_for_local): Remove.
4452 (Target::do_plt_address_for_global): New virtual function.
4453 (Target::do_plt_address_for_local): New virtual function.
4454 (Target::do_plt_section_for_global): Remove.
4455 (Target::do_plt_section_for_local): Remove.
4456 (Target::register_global_plt_entry): Add Symbol_table and Layout
4458 * output.cc (Output_data_got::Got_entry::write): Use
4459 plt_address_for_global and plt_address_for_local.
4460 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4461 address of output section.
4462 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4463 got_irelative_, and irelative_count_ fields. Update
4465 (Output_data_plt_i386::has_irelative_section): New function.
4466 (Output_data_plt_i386::entry_count): Add irelative_count_.
4467 (Output_data_plt_i386::set_final_data_size): Likewise.
4468 (class Target_i386): Add got_irelative_ and rel_irelative_
4469 fields. Update declarations.
4470 (Target_i386::Target_i386): Initialize new fields.
4471 (Target_i386::do_plt_address_for_global): New function replacing
4472 do_plt_section_for_global.
4473 (Target_i386::do_plt_address_for_local): New function replacing
4474 do_plt_section_for_local.
4475 (Target_i386::got_section): Create got_irelative_.
4476 (Target_i386::rel_irelative_section): New function.
4477 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4478 fields. Don't define __rel_iplt_{start,end}.
4479 (Output_data_plt_i386::add_entry): Add symtab and layout
4480 parameters. Change all callers. Use different PLT and GOT for
4482 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4483 layout parameters. Change all callers. Use different PLT and
4485 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4486 (Output_data_plt_i386::rel_irelative): New function.
4487 (Output_data_plt_i386::address_for_global): New function.
4488 (Output_data_plt_i386::address_for_local): New function.
4489 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4490 IRELATIVE GOT when changing IFUNC GOT entries.
4491 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4493 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4494 if we didn't create an IRELATIVE GOT.
4495 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4496 plt_address_for_local.
4497 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4498 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4499 got_irelative_, and irelative_count_ fields. Update
4501 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4502 Initialize new fields. Remove symtab parameter. Change all
4504 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4506 (Output_data_plt_x86_64::has_irelative_section): New function.
4507 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4508 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4509 fields. Update declarations.
4510 (Target_x86_64::Target_x86_64): Initialize new fields.
4511 (Target_x86_64::do_plt_address_for_global): New function replacing
4512 do_plt_section_for_global.
4513 (Target_x86_64::do_plt_address_for_local): New function replacing
4514 do_plt_section_for_local.
4515 (Target_x86_64::got_section): Create got_irelative_.
4516 (Target_x86_64::rela_irelative_section): New function.
4517 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4518 all callers. Don't create __rel_iplt_{start,end}.
4519 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4520 parameters. Change all callers. Use different PLT and GOT for
4522 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4523 layout parameters. Change all callers. Use different PLT and
4525 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4526 parameters. Change all callers. Use different PLT and GOT for
4528 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4529 (Output_data_plt_x86_64::rela_irelative): New function.
4530 (Output_data_plt_x86_64::address_for_global): New function.
4531 (Output_data_plt_x86_64::address_for_local): New function.
4532 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4533 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4534 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4535 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4537 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4539 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4540 symbols if we didn't create an IRELATIVE GOT.
4541 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4542 plt_address_for_local.
4543 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4544 * testsuite/ifuncvar1.c: New test file.
4545 * testsuite/ifuncvar2.c: New test file.
4546 * testsuite/ifuncvar3.c: New test file.
4547 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4548 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4549 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4550 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4551 * testsuite/Makefile.in: Rebuild.
4553 2011-07-07 Cary Coutant <ccoutant@google.com>
4555 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4556 (two_file_test_1_ndebug.o): Likewise.
4557 (two_file_test_1b_ndebug.o): Likewise.
4558 (two_file_test_2_ndebug.o): Likewise.
4559 (two_file_test_main_ndebug.o): Likewise.
4560 (incremental_test_2): Link with no-debug versions.
4562 2011-07-06 Cary Coutant <ccoutant@google.com>
4564 * gold/incremental.cc
4565 (Output_section_incremental_inputs::write_info_blocks): Check for
4566 hidden and internal symbols.
4568 2011-07-06 Cary Coutant <ccoutant@google.com>
4570 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4571 Check disposition for startup file.
4572 (Incremental_inputs::report_command_line): Ignore
4573 --incremental-startup-unchanged option.
4574 * options.cc (General_options::parse_incremental_startup_unchanged):
4576 (General_options::General_options): Initialize new data member.
4577 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4578 (General_options): Add --incremental-startup-unchanged option.
4579 (General_options::incremental_startup_disposition): New function.
4580 (General_options::incremental_startup_disposition_): New data member.
4582 2011-07-06 Cary Coutant <ccoutant@google.com>
4584 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4585 input file index to Script_info ctor.
4586 (Sized_incremental_binary::do_file_has_changed): Find the
4587 command-line argument for files named in scripts.
4588 * incremental.h (Script_info::Script_info): New ctor
4589 with input file index.
4590 (Script_info::input_file_index): New function.
4591 (Script_info::input_file_index_): New data member.
4592 (Incremental_binary::get_library): Add const.
4593 (Incremental_binary::get_script_info): Add const.
4594 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4595 * testsuite/Makefile.am (incremental_test_5): New test case.
4596 (incremental_test_6): New test case.
4597 * testsuite/Makefile.in: Regenerate.
4599 2011-07-06 Cary Coutant <ccoutant@google.com>
4601 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4602 debug output when command lines differ.
4604 2011-07-06 Cary Coutant <ccoutant@google.com>
4606 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4607 --incremental-patch option.
4608 * layout.cc (Free_list::allocate): Extend allocation beyond original
4610 (Layout::make_output_section): Mark sections that should get
4612 * options.cc (parse_percent): New function.
4613 * options.h (parse_percent): New function.
4614 (DEFINE_percent): New macro.
4615 (General_options): Add --incremental-patch option.
4616 * output.cc (Output_section::Output_section): Initialize new data
4618 (Output_section::add_input_section): Print section name when out
4620 (Output_section::add_output_section_data): Likewise.
4621 (Output_section::set_final_data_size): Add patch space when
4622 doing --incremental-full.
4623 (Output_section::do_reset_address_and_file_offset): Remove patch
4625 (Output_segment::set_section_list_addresses): Print debug output
4626 only if --incremental-update.
4627 * output.h (Output_section::set_is_patch_space_allowed): New function.
4628 (Output_section::is_patch_space_allowed_): New data member.
4629 (Output_section::patch_space_): New data member.
4630 * parameters.cc (Parameters::incremental_full): New function.
4631 * parameters.h (Parameters::incremental_full): New function
4632 * testsuite/Makefile.am (incremental_test_2): Add test for
4633 --incremental-patch option.
4634 * testsuite/Makefile.in: Regenerate.
4635 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4636 (t18): Remove function body.
4638 2011-07-05 Doug Kwan <dougkwan@google.com>
4641 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4642 Arm_Address type for relocation result.
4643 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4645 (Arm_relocate_functions::abs32): Use unaligned access.
4646 (Arm_relocate_functions::rel32): Ditto.
4647 (Arm_relocate_functions::prel31): Ditto.
4648 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4649 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4650 static data relocations.
4651 * testsuite/Makefile.in: Regnerate.
4652 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4654 2011-07-05 Ian Lance Taylor <iant@google.com>
4657 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4658 symbols if necessary.
4659 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4661 2011-07-05 Ian Lance Taylor <iant@google.com>
4664 * resolve.cc (Symbol::override_base_with_special): Simply override
4665 version with special symbol version, ignoring previous version.
4667 2011-07-05 Ian Lance Taylor <iant@google.com>
4669 * object.cc (Sized_relobj_file::include_section_group): Add
4670 information to comment about signature location.
4672 2011-07-02 Ian Lance Taylor <iant@google.com>
4675 * options.h (class General_options): Add -f and -F.
4676 * options.cc (General_options::finalize): Fatal error if -f/-F
4677 are used without -shared.
4678 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4680 2011-07-02 Ian Lance Taylor <iant@google.com>
4682 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4684 2011-07-01 Ian Lance Taylor <iant@google.com>
4688 * resolve.cc (Symbol::override_base_with_special): Don't override
4689 the version if the overriding symbol has a different name.
4690 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4691 all callers. If we give an error about an undefined version,
4692 define the base version if necessary.
4693 * dynobj.h (class Versions): Update declaration.
4694 * testsuite/weak_alias_test_5.cc: New file.
4695 * testsuite/weak_alias_test.script: New file.
4696 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4697 and versioned_alias have the right value, and call t2.
4698 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4699 weak_alias_test_5.so.
4700 (weak_alias_test_LDADD): Likewise.
4701 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4702 * testsuite/Makefile.in: Rebuild.
4704 2011-07-01 Ian Lance Taylor <iant@google.com>
4707 * options.h (class General_options): Support -z notext.
4708 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4710 (two_file_shared_nonpic.so): Likewise.
4711 (two_file_shared_mixed.so): Likewise.
4712 (two_file_shared_mixed_1.so): Likewise.
4713 (weak_undef_lib_nonpic.so): Likewise.
4714 (alt/weak_undef_lib_nonpic.so): Likewise.
4715 (tls_test_shared_nonpic.so): Likewise.
4716 * testsuite/Makefile.in: Rebuild.
4718 2011-07-01 Ian Lance Taylor <iant@google.com>
4721 * configure.ac: Test whether static linking works, setting
4722 the automake conditional HAVE_STATIC.
4723 * testsuite/Makefile.am: Disable tests using -static if
4724 HAVE_STATIC is not true.
4725 * configure, testsuite/Makefile.in: Rebuild.
4727 2011-07-01 Ian Lance Taylor <iant@google.com>
4730 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4731 Assert if we see DW_EH_PE_indirect.
4732 * target.h (Target::ehframe_datarel_base): New function.
4733 (Target::do_ehframe_datarel_base): New target function.
4734 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4735 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4738 2011-07-01 Ian Lance Taylor <iant@google.com>
4741 * options.h (class General_options): Add
4742 --ld-generated-unwind-info.
4743 * ehframe.cc (Fde::write): Add address parameter. Change all
4744 callers. If associated with PLT, fill in address and size.
4745 (Cie::set_output_offset): Only add merge mapping if there is an
4747 (Cie::write): Add address parameter. Change all callers.
4748 (Eh_frame::add_ehframe_for_plt): New function.
4749 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4750 input_offset_ fields into union u_, with new plt field.
4751 (Fde::Fde): Adjust for new union field.
4752 (Fde::Fde) [Output_data version]: New constructor.
4753 (Fde::add_mapping): Only add merge mapping if there is an object.
4754 (class Cie): Update declarations.
4755 (class Eh_frame): Declare add_ehframe_for_plt.
4756 * layout.cc (Layout::layout_eh_frame): Break out code into
4757 make_eh_frame_section, and call it.
4758 (Layout::make_eh_frame_section): New function.
4759 (Layout::add_eh_frame_for_plt): New function.
4760 * layout.h (class Layout): Update declarations.
4761 * merge.cc (Merge_map::add_mapping): Add assertion.
4762 * i386.cc: Include "dwarf.h".
4763 (class Output_data_plt_i386): Make first_plt_entry,
4764 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4765 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4766 and plt_eh_frame_fde.
4767 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4768 boundary. Call add_eh_frame_for_plt if appropriate.
4769 * x86_64.cc: Include "dwarf.h".
4770 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4771 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4772 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4773 and plt_eh_frame_fde.
4774 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4777 2011-06-29 Ian Lance Taylor <iant@google.com>
4780 * object.cc (Sized_relobj_file::layout_section): Change shdr
4781 parameter to be const.
4782 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4784 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4785 appropriate. Call layout_eh_frame_section.
4786 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4788 * object.h (class Sized_relobj_file): Update declarations.
4790 2011-06-29 Ian Lance Taylor <iant@google.com>
4793 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4795 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4797 2011-06-29 Ian Lance Taylor <iant@google.com>
4800 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4802 * layout.cc (Layout::layout_eh_frame): Likewise.
4804 2011-06-29 Ian Lance Taylor <iant@google.com>
4807 * layout.cc (Layout::symtab_section_shndx): New function.
4808 * layout.h (class Layout): Declare symtab_section_shndx.
4809 * output.cc (Output_section::write_header): Call it.
4811 2011-06-29 Ian Lance Taylor <iant@google.com>
4814 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4815 symbols which are not used in a relocation.
4817 2011-06-28 Ian Lance Taylor <iant@google.com>
4820 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4821 script create indistinguishable segments.
4822 (Layout::set_segment_offsets): Use stable_sort when sorting
4823 segments. Pass this to Compare_segments constructor.
4824 * layout.h (class Layout): Make segment_precedes non-static.
4825 (class Compare_segments): Change from struct to class. Add
4826 layout_ field. Add constructor.
4827 * script-sections.cc
4828 (Script_sections::attach_sections_using_phdrs_clause): Rename
4829 local orphan to is_orphan. Don't report failure to put empty
4830 section in segment. On attachment failure, report name of
4831 section, and attach to first PT_LOAD segment.
4833 2011-06-28 Ian Lance Taylor <iant@google.com>
4836 * target-select.cc (Target_selector::Target_selector): Add
4837 emulation parameter. Change all callers.
4838 (select_target_by_bfd_name): Rename from select_target_by_name.
4840 (select_target_by_emulation): New function.
4841 (supported_emulation_names): New function.
4842 * target-select.h (class Target_selector): Add emulation_ field.
4843 Update declarations.
4844 (Target_selector::recognize_by_bfd_name): Rename from
4845 recognize_by_name. Change all callers.
4846 (Target_selector::supported_bfd_names): Rename from
4847 supported_names. Change all callers.
4848 (Target_selector::recognize_by_emulation): New function.
4849 (Target_selector::supported_emulations): New function.
4850 (Target_selector::emulation): New function.
4851 (Target_selector::do_recognize_by_bfd_name): Rename from
4852 do_recognize_by_name. Change all callers.
4853 (Target_selector::do_supported_bfd_names): Rename from
4854 do_supported_names. Change all callers.
4855 (Target_selector::do_recognize_by_emulation): New function.
4856 (Target_selector::do_supported_emulations): New function.
4857 (select_target_by_bfd_name): Change name in declaration.
4858 (select_target_by_emulation): Declare.
4859 (supported_emulation_names): Declare.
4860 * parameters.cc (parameters_force_valid_target): Try to find
4861 target based on emulation from -m option.
4862 * options.h (class General_options): Change doc string for -m.
4863 * options.cc (help): Print emulations.
4864 (General_options::parse_V): Likewise.
4865 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4866 Add emulation parameter. Change all callers.
4868 2011-06-28 Ian Lance Taylor <iant@google.com>
4870 * target.h (class Target): Add osabi_ field.
4871 (Target::osabi): New function.
4872 (Target::set_osabi): New function.
4873 (Target::Target): Initialize osabi_.
4874 (Target::do_adjust_elf_header): Make pure virtual.
4875 (Sized_target::do_adjust_elf_header): Declare.
4876 * target.cc (Sized_target::do_adjust_elf_header): New function.
4877 (class Sized_target): Instantiate all versions.
4878 * freebsd.h (class Target_freebsd): Remove.
4879 (Target_selector_freebsd::do_recognize): Call set_osabi on
4881 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4882 (Target_selector_freebsd::set_osabi): Remove.
4883 * i386.cc (class Target_i386): Inherit from Sized_target rather
4884 than Target_freebsd.
4885 * x86_64.cc (class Target_x86_64): Likewise.
4887 2011-06-28 Ian Lance Taylor <iant@google.com>
4889 * target.h (Target::can_check_for_function_pointers): Rewrite.
4891 (Target::can_icf_inline_merge_sections): Likewise.
4892 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4893 (Target::Target_info): Add can_icf_inline_merge_sections field.
4894 (Target::do_can_check_for_function_pointers): New virtual
4896 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4897 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4898 from can_check_for_function_pointers, move in file.
4899 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4900 section_may_have_icf_unsafe_poineters, move in file.
4901 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4902 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4903 Rename from can_check_for_function_pointers, move in file.
4904 (Target_i386::can_icf_inline_merge_sections): Remove.
4905 (Target_i386::i386_info): Initialize
4906 can_icf_inline_merge_sections.
4907 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4908 Initialize can_icf_inline_merge_sections.
4909 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4910 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4911 Rename from can_check_for_function_pointers, move in file.
4912 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4913 (Target_x86_64::x86_64_info): Initialize
4914 can_icf_inline_merge_sections.
4915 * testsuite/testfile.cc (Target_test::test_target_info):
4917 * icf.cc (get_section_contents): Correct formatting.
4919 2011-06-27 Ian Lance Taylor <iant@google.com>
4921 * symtab.cc (Symbol::versioned_name): New function.
4922 (Symbol_table::add_to_final_symtab): Use versioned_name when
4924 (Symbol_table::sized_write_symbol): Likewise.
4925 * symtab.h (class Symbol): Declare versioned_name.
4926 * stringpool.h (class Stringpool_template): Add variant of add
4927 which takes a std::basic_string.
4928 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4929 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4930 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4931 (ver_test_12.o): New target.
4932 * testsuite/Makefile.in: Rebuild.
4934 2011-06-27 Doug Kwan <dougkwan@google.com>
4936 * arm.cc (Arm_relocate_functions::thm_jump8,
4937 Arm_relocate_functions::thm_jump11): Use a wider signed
4938 type to compute offset.
4939 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4941 * testsuite/Makefile.in: Regenerate.
4942 * testsuite/arm_branch_in_range.sh: Check test results of
4943 arm_thm_jump11 and arm_thm_jump8.
4944 * testsuite/arm_thm_jump11.s: New test source file.
4945 * testsuite/arm_thm_jump11.t: New linker script.
4946 * testsuite/arm_thm_jump8.s: New test source file.
4947 * testsuite/arm_thm_jump8.t: New linker script.
4949 2011-06-24 Ian Lance Taylor <iant@google.com>
4951 * layout.cc: Include "object.h".
4952 (ctors_sections_in_init_array): New static variable.
4953 (Layout::is_ctors_in_init_array): New function.
4954 (Layout::layout): Add entry to ctors_sections_in_init_array if
4956 * layout.h (class Layout): Declare is_ctors_in_init_array.
4957 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4958 is_ctors_reverse_view is set.
4959 (Sized_relobj_file::write_sections): Add layout parameter. Change
4960 all callers. Set is_ctors_reverse_view field of View_size.
4961 (Sized_relobj_file::reverse_words): New function.
4962 * object.h (Sized_relobj_file::View_size): Add
4963 is_ctors_reverse_view field.
4964 (class Sized_relobj_file): Update declarations.
4965 * testsuite/initpri3.c: New test.
4966 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4968 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4969 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4970 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4971 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4972 * testsuite/Makefile.in: Rebuild.
4974 2011-06-24 Cary Coutant <ccoutant@google.com>
4976 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4977 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4978 (debug_msg_cdebug.err): New targets.
4979 * testsuite/Makefile.in: Regenerate.
4980 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4981 Fix checks for link with shared library.
4983 2011-06-24 Doug Kwan <dougkwan@google.com>
4985 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4986 skip empty text sections.
4987 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4989 2011-06-22 Ian Lance Taylor <iant@google.com>
4992 * options.h (class General_options): Add --ctors-in-init-array.
4993 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4994 friends as SHT_PROGBITS for merging sections.
4995 (Layout::layout): Remove special handling of .init_array and
4996 friends. Don't sort if doing relocatable link. Sort for .ctors
4997 and .dtors if ctors_in_init_array.
4998 (Layout::make_output_section): Force correct section types for
4999 .init_array and friends. Don't sort if doing relocatable link,
5000 Don't sort .ctors and .dtors if ctors_in_init_array.
5001 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5002 (Layout::output_section_name): Add relobj parameter. Change all
5003 callers. Handle .ctors. and .dtors. in code rather than table.
5004 Handle .ctors and .dtors if ctors_in_init_array.
5005 (Layout::match_file_name): New function, moved from output.cc.
5006 * layout.h (class Layout): Update declarations.
5007 * output.cc: Include "layout.h".
5008 (Input_section_sort_entry::get_priority): New function.
5009 (Input_section_sort_entry::match_file_name): Just call
5010 Layout::match_file_name.
5011 (Output_section::Input_section_sort_init_fini_compare::operator()):
5012 Handle .ctors and .dtors. Sort by explicit priority rather than
5014 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5015 * testsuite/initpri2.c: New test.
5016 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5017 (check_PROGRAMS): Add initpri2.
5018 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5019 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5020 * configure, testsuite/Makefile.in: Rebuild.
5022 2011-06-19 Ian Lance Taylor <iant@google.com>
5025 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5026 .interp section to a PT_INTERP segment even if we have seen a
5027 --dynamic-linker option. Don't do it if we have seen a PHDRS
5028 clause in a linker script.
5029 (Layout::finalize): Don't create a .interp section if we've
5030 already create a PT_INTERP segment.
5031 (Layout::create_interp): Always call choose_output_section (revert
5032 patch of 2011-06-17). Don't create PT_INTERP segment.
5033 * script-sections.cc
5034 (Script_sections::create_note_and_tls_segments): Add a .interp
5035 section to a PT_INTERP segment even if we have seen a
5036 --dynamic-linker option.
5038 2011-06-18 Ian Lance Taylor <iant@google.com>
5040 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5041 merely because a non-PT_LOAD segment has a dynamic reloc.
5043 2011-06-18 Ian Lance Taylor <iant@google.com>
5045 * layout.cc (Layout::finish_dynamic_section): Don't create
5046 DT_FLAGS entry if not needed.
5048 2011-06-18 Ian Lance Taylor <iant@google.com>
5051 * layout.cc (Layout::layout_eh_frame): Correct handling of
5052 writable .eh_frame section.
5054 2011-06-17 Ian Lance Taylor <iant@google.com>
5057 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5058 symbol is redefined with the exact same object and value.
5060 2011-06-17 Ian Lance Taylor <iant@google.com>
5063 * layout.h (class Layout): Add interp_segment_ field.
5064 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5065 (Layout::attach_allocated_section_to_segment): If making shared
5066 library, put .interp section in PT_INTERP segment.
5067 (Layout::finalize): Also call create_interp if -dynamic-linker
5069 (Layout::create_interp): Assert that there is no PT_INTERP
5070 segment. If not using a SECTIONS clause, use make_output_section.
5071 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5072 * script-sections.cc
5073 (Script_sections::create_note_and_tls_segments): If making shared
5074 library, put .interp section in PT_INTERP segment.
5076 2011-06-17 Ian Lance Taylor <iant@google.com>
5078 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5079 when making a shared library.
5081 2011-06-17 Ian Lance Taylor <iant@google.com>
5083 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5084 parameter. Change all callers. Don't issue warning about PC32
5085 against locally defined symbol.
5087 2011-06-16 Ian Lance Taylor <iant@google.com>
5089 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5090 occurs in same object.
5092 2011-06-14 Alan Modra <amodra@gmail.com>
5094 * po/POTFILES.in: Regenerate.
5096 2011-06-09 Ian Lance Taylor <iant@google.com>
5098 * script-sections.cc
5099 (Orphan_output_section::set_section_addresses): For a relocatable
5100 link set address to 0.
5102 2011-06-09 Cary Coutant <ccoutant@google.com>
5105 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5106 used with --compress-debug-sections.
5107 * gold/object.cc (Sized_relobj_file::do_layout): Report
5108 uncompressed size of compressed input sections.
5110 2011-06-08 Cary Coutant <ccoutant@google.com>
5113 * testsuite/two_file_test_2_v1.cc: Change initialization of
5114 v2 to keep it in .data.
5116 2011-06-07 Cary Coutant <ccoutant@google.com>
5118 * common.cc (Symbol_table::do_allocate_commons_list): Call
5120 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5121 (Errors::fallback): New function.
5122 (gold_fallback): New function.
5123 * errors.h (Errors::fallback): New function.
5124 * gold.cc (gold_exit): Change status parameter to enum; adjust
5126 (queue_initial_tasks): Call gold_fallback.
5127 * gold.h: Include cstdlib.
5128 (Exit_status): New enum type.
5129 (gold_exit): Change status parameter to enum.
5130 (gold_fallback): New function.
5131 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5132 (Layout::create_symtab_sections): Likewise.
5133 (Layout::create_shdrs): Likewise.
5134 * main.cc (main): Adjust call to gold_exit.
5135 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5136 (Output_data_got::add_got_entry_pair): Likewise.
5137 (Output_section::add_input_section): Likewise.
5138 (Output_section::add_output_section_data): Likewise.
5139 (Output_segment::set_section_list_addresses): Likewise.
5140 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5142 2011-06-07 Cary Coutant <ccoutant@google.com>
5144 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5145 for incremental links.
5146 * output.cc (Output_segment::set_section_list_addresses): Remove
5147 FIXME and test for TLS or BSS.
5149 2011-06-07 Cary Coutant <ccoutant@google.com>
5151 * testsuite/Makefile.am: Add incremental_copy_test,
5152 incremental_common_test_1.
5153 * testsuite/Makefile.in: Regenerate.
5154 * testsuite/common_test_1_v1.c: New source file.
5155 * testsuite/common_test_1_v2.c: New source file.
5156 * testsuite/copy_test_v1.cc: New source file.
5158 2011-06-07 Cary Coutant <ccoutant@google.com>
5160 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5161 update, allocate common from bss section's free list.
5162 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5163 linker-defined symbols.
5164 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5165 Skip GOT and PLT entries that are no longer referenced.
5166 (Output_section_incremental_inputs::write_info_blocks): Mark
5167 linker-defined symbols.
5168 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5169 * output.cc (Output_section::allocate): New function.
5170 * output.h (Output_section::allocate): New function.
5171 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5172 linker-defined symbols.
5173 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5174 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5175 (Symbol::init_base_output_data): Likewise.
5176 (Symbol::init_base_output_segment): Likewise.
5177 (Symbol::init_base_constant): Likewise.
5178 (Sized_symbol::init_output_data): Likewise.
5179 (Sized_symbol::init_output_segment): Likewise.
5180 (Sized_symbol::init_constant): Likewise.
5181 (Symbol_table::do_define_in_output_data): Likewise.
5182 (Symbol_table::do_define_in_output_segment): Likewise.
5183 (Symbol_table::do_define_as_constant): Likewise.
5184 * symtab.h (Symbol::is_predefined): New function.
5185 (Symbol::init_base_output_data): Add is_predefined parameter.
5186 (Symbol::init_base_output_segment): Likewise.
5187 (Symbol::init_base_constant): Likewise.
5188 (Symbol::is_predefined_): New data member.
5189 (Sized_symbol::init_output_data): Add is_predefined parameter.
5190 (Sized_symbol::init_output_segment): Likewise.
5191 (Sized_symbol::init_constant): Likewise.
5192 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5194 2011-06-07 Cary Coutant <ccoutant@google.com>
5196 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5197 instead of emit_copy_reloc.
5198 (Copy_relocs::emit_copy_reloc): Refactor.
5199 (Copy_relocs::make_copy_reloc): New function.
5200 (Copy_relocs::add_copy_reloc): Remove.
5201 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5203 (Copy_relocs::make_copy_reloc): New function.
5204 (Copy_relocs::add_copy_reloc): Remove.
5205 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5206 unchanged input files.
5207 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5208 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5209 Reserve BSS space for COPY relocations.
5210 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5211 (Output_section_incremental_inputs::write_info_blocks): Record
5212 whether a symbol is copied from a shared object.
5213 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5214 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5215 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5216 (Incremental_input_entry_reader::get_output_symbol_index): Add
5218 (Incremental_binary::emit_copy_relocs): New function.
5219 (Incremental_binary::do_emit_copy_relocs): New function.
5220 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5222 (Sized_incremental_binary::add_copy_reloc): New function.
5223 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5224 (Sized_incremental_binary::Copy_reloc): New struct.
5225 (Sized_incremental_binary::Copy_relocs): New typedef.
5226 (Sized_incremental_binary::copy_relocs_): New data member.
5227 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5228 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5229 * target.h (Sized_target::emit_copy_reloc): New function.
5230 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5232 2011-06-02 Cary Coutant <ccoutant@google.com>
5235 * gold/archive.cc (Archive::Archive): Initialize new data member.
5236 (Archive::include_all_members): Return if archive has already been
5238 * gold/archive.h (Archive::include_all_members_): New data member.
5240 2011-06-02 Nick Clifton <nickc@redhat.com>
5242 * dynobj.h: Fix spelling mistake in comment.
5243 * output.cc: Likewise.
5245 2011-05-31 Doug Kwan <dougkwan@google.com>
5249 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5250 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5251 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5252 redundant arm_exidx_test.so.
5253 * testsuite/Makefile.in: Regenerate.
5254 (check_SCRIPTS): Add pr12826.sh
5255 (check_DATA): Add pr12826.stdout
5256 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5257 * testsuite/pr12826.sh: New file.
5258 * testsuite/pr12826_1.s: Ditto.
5259 * testsuite/pr12826_1.s: Ditto.
5261 2011-05-30 Ian Lance Taylor <iant@google.com>
5263 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5266 2011-05-29 Ian Lance Taylor <iant@google.com>
5269 * testsuite/Makefile.am: Use different file name for two_file_test
5270 temporary file for each incremental test.
5271 * testsuite/Makefile.in: Rebuild.
5273 2011-05-29 Ian Lance Taylor <iant@google.com>
5275 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5276 binary input file is empty.
5278 2011-05-27 Ian Lance Taylor <iant@google.com>
5280 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5281 (ver_test_9.so): Likewise.
5282 * testsuite/Makefile.in: Rebuild.
5284 2011-05-26 Cary Coutant <ccoutant@google.com>
5286 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5287 * incremental.cc (Incremental_inputs::report_input_section): Fix
5288 comment, indentation.
5289 (Incremental_inputs::report_comdat_group): New function.
5290 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5291 of data for incremental input file entry.
5292 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5293 group count, COMDAT group signatures.
5294 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5295 an unchanged input file.
5296 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5297 Initialize new data member.
5298 (Incremental_object_entry::add_comdat_group): New function.
5299 (Incremental_object_entry::get_comdat_group_count): New function.
5300 (Incremental_object_entry::get_comdat_signature_key): New function.
5301 (Incremental_object_entry::groups_): New data member.
5302 (Incremental_inputs::report_comdat_group): New function.
5303 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5304 data for incremental input file entry.
5305 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5306 (Incremental_input_entry_reader::get_input_section): Adjust size of
5307 data for incremental input file entry.
5308 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5309 (Incremental_input_entry_reader::get_comdat_group_signature): New
5311 * object.cc (Sized_relobj::include_section_group): Report kept
5312 COMDAT groups for incremental links.
5314 2011-05-24 David Meyer <pdox@google.com>
5316 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5317 with name parameter. Add found_name parameter.
5318 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5319 * dirsearch.h (class Dirsearch): Update declaration.
5321 2011-05-24 Ian Lance Taylor <iant@google.com>
5323 * archive.cc (Library_base::should_include_member): Pull in object
5324 from archive if it defines the entry symbol.
5325 * parameters.cc (Parameters::entry): New function.
5326 * parameters.h (class Parameters): Declare entry.
5327 * output.h (class Output_file_header): Remove entry_ field.
5328 * output.cc (Output_file_header::Output_file_header): Remove entry
5329 parameter. Change all callers.
5330 (Output_file_header::entry): Use parameters->entry.
5331 * gold.cc (queue_middle_tasks): Likewise.
5332 * plugin.cc (Plugin_hook::run): Likewise.
5334 2011-05-24 Cary Coutant <ccoutant@google.com>
5336 * gold.cc (queue_initial_tasks): Pass incremental base filename
5337 to Output_file::open_base_file; don't print error message.
5338 * incremental-dump.cc (main): Adjust call to
5339 Output_file::open_for_modification.
5340 * incremental-dump.cc (main): Likewise.
5341 * incremental.cc (Incremental_inputs::report_command_line):
5342 Ignore --incremental-base option when comparing command lines.
5343 Ignore parameter when given as separate argument.
5344 * options.h (class General_options): Add --incremental-base.
5345 * output.cc (Output_file::Output_file):
5346 (Output_file::open_base_file): Add base_name and writable parameters;
5347 read base file into new file; print error message here.
5348 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5350 * output.h (Output_file::open_for_modification): Rename to...
5351 (Output_file::open_base_file): ...this; add base_name and
5352 writable parameters; adjust all callers.
5353 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5355 * testsuite/Makefile.am (incremental_test_4): Test
5357 * testsuite/Makefile.in: Regenerate.
5359 2011-05-24 Cary Coutant <ccoutant@google.com>
5361 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5363 * testsuite/Makefile.in: Regenerate.
5364 * testsuite/two_file_test_1_v1.cc: New test source file.
5365 * testsuite/two_file_test_1b_v1.cc: New test source file.
5366 * testsuite/two_file_test_2_v1.cc: New test source file.
5368 2011-05-24 Cary Coutant <ccoutant@google.com>
5370 * dynobj.h (Dynobj::do_dynobj): New function.
5371 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5372 flag and soname for shared objects.
5373 * incremental.cc (Incremental_inputs::report_object): Make
5374 either Incremental_object_entry or Incremental_dynobj_entry; add
5375 soname to string table.
5376 (Incremental_inputs::report_input_section): Add assertion.
5377 (Output_section_incremental_inputs::set_final_data_size): Adjust
5378 type of input file entry for shared libraries; adjust size of
5379 shared library info entry.
5380 (Output_section_incremental_inputs::write_input_files): Write
5381 as_needed flag for shared libraries.
5382 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5383 of input file entry for shared libraries; write soname.
5384 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5385 soname from incremental info.
5386 * incremental.h (enum Incremental_input_flags): Add
5387 INCREMENTAL_INPUT_AS_NEEDED.
5388 (Incremental_input_entry::Incremental_input_entry): Initialize new
5390 (Incremental_input_entry::set_as_needed): New function.
5391 (Incremental_input_entry::as_needed): New function.
5392 (Incremental_input_entry::do_dynobj_entry): New function.
5393 (Incremental_input_entry::as_needed_): New data member.
5394 (Incremental_object_entry::Incremental_object_entry): Don't check
5396 (Incremental_object_entry::do_type): Likewise.
5397 (class Incremental_dynobj_entry): New class.
5398 (Incremental_input_entry_reader::as_needed): New function.
5399 (Incremental_input_entry_reader::get_soname): New function.
5400 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5401 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5402 size of shared library info entry.
5403 * layout.cc (Layout::finish_dynamic_section): Don't test for
5404 incremental link when adding DT_NEEDED entries.
5405 * object.h (Object::Object): Initialize new data member.
5406 (Object::dynobj): New function.
5407 (Object::set_as_needed): New function.
5408 (Object::as_needed): New function.
5409 (Object::do_dynobj): New function.
5410 (Object::as_needed_): New data member.
5412 2011-05-24 Cary Coutant <ccoutant@google.com>
5414 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5415 info; adjust display of GOT entries.
5416 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5417 vector of input objects; remove file_status_.
5418 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5419 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5420 got_plt reader; call target hooks to reserve GOT entries.
5421 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5422 of input file info header and GOT info entry.
5423 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5425 (Got_plt_view_info::got_descriptor): Remove.
5426 (Got_plt_view_info::sym_index): New data member.
5427 (Got_plt_view_info::input_index): New data member.
5428 (Local_got_offset_visitor::visit): Write input file index.
5429 (Global_got_offset_visitor::visit): Write 0 for input file index.
5430 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5431 with sym_index and input_index.
5432 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5433 incremental info GOT entry; replace got_descriptor with input_index.
5434 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5435 map from input file index to object.
5436 (Sized_relobj_incr::do_layout): Replace direct data member reference
5437 with accessor function.
5438 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5439 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5440 Adjust size of input file info header.
5441 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5442 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5443 (Incremental_input_entry_reader::get_input_section): Adjust size of
5444 input file info header.
5445 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5446 of incremental info GOT entry.
5447 (Incremental_got_plt_reader::get_got_desc): Remove.
5448 (Incremental_got_plt_reader::get_got_symndx): New function.
5449 (Incremental_got_plt_reader::get_got_input_index): New function.
5450 (Sized_incremental_binary::Sized_incremental_binary): Remove
5451 file_status_; add input_objects_.
5452 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5453 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5454 (Sized_incremental_binary::file_is_unchanged): Remove.
5455 (Sized_incremental_binary::set_input_object): New function.
5456 (Sized_incremental_binary::input_object): New function.
5457 (Sized_incremental_binary::file_status_): Remove.
5458 (Sized_incremental_binary::input_objects_): New data member.
5459 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5461 (Sized_relobj_incr::invalid_address): Move to base class.
5462 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5464 (Sized_relobj_incr::do_output_section_offset): Likewise.
5465 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5466 (Sized_relobj_incr::section_offsets_): Likewise.
5467 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5469 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5470 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5471 with accessor function.
5472 (Sized_relobj_file::do_layout): Likewise.
5473 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5474 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5475 (Sized_relobj_file::compute_final_local_value): Replace refs to
5476 section_offsets_ with accessor function.
5477 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5478 * object.h (Relobj::Relobj): Initialize new data members.
5479 (Relobj::add_dyn_reloc): New function.
5480 (Relobj::first_dyn_reloc): New function.
5481 (Relobj::dyn_reloc_count): New function.
5482 (Relobj::first_dyn_reloc_): New data member.
5483 (Relobj::dyn_reloc_count_): New data member.
5484 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5486 (Sized_relobj::Address): New typedef.
5487 (Sized_relobj::invalid_address): Move here from child class.
5488 (Sized_relobj::Sized_relobj): Initialize new data members.
5489 (Sized_relobj::sized_relobj): New function.
5490 (Sized_relobj::is_output_section_offset_invalid): Move here from
5492 (Sized_relobj::get_output_section_offset): Likewise.
5493 (Sized_relobj::local_has_got_offset): Likewise.
5494 (Sized_relobj::local_got_offset): Likewise.
5495 (Sized_relobj::set_local_got_offset): Likewise.
5496 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5497 (Sized_relobj::clear_got_offsets): New function.
5498 (Sized_relobj::section_offsets): Move here from child class.
5499 (Sized_relobj::do_output_section_offset): Likewise.
5500 (Sized_relobj::do_set_section_offset): Likewise.
5501 (Sized_relobj::Local_got_offsets): Likewise.
5502 (Sized_relobj::local_got_offsets_): Likewise.
5503 (Sized_relobj::section_offsets_): Likewise.
5504 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5506 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5508 (Sized_relobj_file::sized_relobj): New function
5509 (Sized_relobj_file::local_has_got_offset): Move to base class.
5510 (Sized_relobj_file::local_got_offset): Likewise.
5511 (Sized_relobj_file::set_local_got_offset): Likewise.
5512 (Sized_relobj_file::get_output_section_offset): Likewise.
5513 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5514 (Sized_relobj_file::do_output_section_offset): Likewise.
5515 (Sized_relobj_file::do_set_section_offset): Likewise.
5516 (Sized_relobj_file::Local_got_offsets): Likewise.
5517 (Sized_relobj_file::local_got_offsets_): Likewise.
5518 (Sized_relobj_file::section_offsets_): Likewise.
5519 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5521 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5522 (Output_reloc::get_symbol_index): Likewise.
5523 (Output_reloc::local_section_offset): Likewise.
5524 (Output_reloc::get_address): Likewise.
5525 (Output_reloc::symbol_value): Likewise.
5526 (Output_data_got::reserve_slot): Move to class definition.
5527 (Output_data_got::reserve_local): New function.
5528 (Output_data_got::reserve_slot_for_global): Remove.
5529 (Output_data_got::reserve_global): New function.
5530 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5531 (all constructors, two instantiations).
5532 (Output_reloc::get_relobj): New function (two instantiations).
5533 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5534 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5535 (Output_data_reloc::add_global): Adjust type of relobj.
5536 (Output_data_reloc::add_global_relative): Likewise.
5537 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5538 (Output_data_reloc::add_local): Likewise.
5539 (Output_data_reloc::add_local_relative): Likewise.
5540 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5541 (Output_data_reloc::add_local_section): Likewise.
5542 (Output_data_reloc::add_output_section): Likewise.
5543 (Output_data_reloc::add_absolute): Likewise.
5544 (Output_data_reloc::add_target_specific): Likewise.
5545 (Output_data_got::reserve_slot): Move definition here.
5546 (Output_data_got::reserve_local): New function.
5547 (Output_data_got::reserve_global): New function.
5548 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5549 section_offsets_ with accessor function.
5550 (Sized_relobj_file::write_sections): Likewise.
5551 (Sized_relobj_file::do_relocate_sections): Likewise.
5552 * target.h (Sized_target::reserve_local_got_entry): New function.
5553 (Sized_target::reserve_global_got_entry): New function.
5554 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5555 (Target_x86_64::reserve_global_got_entry): New function.
5556 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5558 2011-05-23 Cary Coutant <ccoutant@google.com>
5560 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5561 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5562 bit when checking got_type.
5563 * incremental.cc (Sized_incremental_binary::setup_readers):
5564 Store symbol table and string table locations; initialize bit vector
5565 of file status flags.
5566 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5568 (Sized_incremental_binary::do_process_got_plt): New function.
5569 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5570 (Output_section_incremental_inputs::set_final_data_size): Record
5571 file index for each input file.
5572 (Output_section_incremental_inputs::write_got_plt): Store file index
5573 instead of input entry offset for each GOT entry.
5575 (Incremental_input_entry::Incremental_input_entry): Initialize new
5577 (Incremental_input_entry::set_offset): Store file index.
5578 (Incremental_input_entry::get_file_index): New function.
5579 (Incremental_input_entry::file_index_): New data member.
5580 (Incremental_binary::process_got_plt): New function.
5581 (Incremental_binary::do_process_got_plt): New function.
5582 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5584 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5585 (Sized_incremental_binary::set_file_is_unchanged): New function.
5586 (Sized_incremental_binary::file_is_unchanged): New function.
5587 (Sized_incremental_binary::do_process_got_plt): New function.
5588 (Sized_incremental_binary::file_status_): New data member.
5589 (Sized_incremental_binary::main_symtab_loc_): New data member.
5590 (Sized_incremental_binary::main_strtab_loc_): New data member.
5591 * output.cc (Output_data_got::Got_entry::write): Add case
5593 (Output_data_got::add_global): Call add_got_entry.
5594 (Output_data_got::add_global_plt): Likewise.
5595 (Output_data_got::add_global_with_rel): Likewise.
5596 (Output_data_got::add_global_with_rela): Likewise.
5597 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5598 (Output_data_got::add_global_pair_with_rela): Likewise.
5599 (Output_data_got::add_local): Call add_got_entry.
5600 (Output_data_got::add_local_plt): Likewise.
5601 (Output_data_got::add_local_with_rel): Likewise.
5602 (Output_data_got::add_local_with_rela): Likewise.
5603 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5604 (Output_data_got::add_local_pair_with_rela): Likewise.
5605 (Output_data_got::reserve_slot): New function.
5606 (Output_data_got::reserve_slot_for_global): New function.
5607 (Output_data_got::add_got_entry): New function.
5608 (Output_data_got::add_got_entry_pair): New function.
5609 (Output_section::add_output_section_data): Edit FIXME.
5611 (Output_section_data_build::Output_section_data_build): New
5612 constructor with size parameter.
5613 (Output_data_space::Output_data_space): Likewise.
5614 (Output_data_got::Output_data_got): Initialize new data member; new
5615 constructor with size parameter.
5616 (Output_data_got::add_constant): Call add_got_entry.
5617 (Output_data_got::reserve_slot): New function.
5618 (Output_data_got::reserve_slot_for_global): New function.
5619 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5620 (Output_data_got::add_got_entry): New function.
5621 (Output_data_got::add_got_entry_pair): New function.
5622 (Output_data_got::free_list_): New data member.
5623 * target.h (Sized_target::init_got_plt_for_update): New function.
5624 (Sized_target::register_global_plt_entry): New function.
5625 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5626 Initialize new data member; call init; add constructor with PLT count.
5627 (Output_data_plt_x86_64::init): New function.
5628 (Output_data_plt_x86_64::add_relocation): New function.
5629 (Output_data_plt_x86_64::reserve_slot): New function.
5630 (Output_data_plt_x86_64::free_list_): New data member.
5631 (Target_x86_64::init_got_plt_for_update): New function.
5632 (Target_x86_64::register_global_plt_entry): New function.
5633 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5634 incremental updates.
5635 (Output_data_plt_x86_64::add_relocation): New function.
5636 * testsuite/object_unittest.cc (Object_test): Set default options.
5638 2011-05-16 Ian Lance Taylor <iant@google.com>
5640 * options.h (class General_options): Make -i a synonym for -r.
5642 2011-05-16 Ian Lance Taylor <iant@google.com>
5644 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5646 2011-05-10 Cary Coutant <ccoutant@google.com>
5648 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5651 2011-05-06 Ian Lance Taylor <iant@google.com>
5653 * layout.cc (Layout::layout): If the output section flags change,
5654 update the ordering.
5656 2011-04-25 Cary Coutant <ccoutant@google.com>
5658 * incremental-dump.cc (dump_incremental_inputs): Print local
5659 symbol info for each input file.
5661 (Output_section_incremental_inputs::set_final_data_size): Add local
5662 symbol info to input file entries in incremental info.
5663 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5664 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5665 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5666 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5668 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5669 (Sized_incr_relobj::do_relocate): Write the local symbols.
5670 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5671 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5672 Adjust size of input file header.
5673 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5674 (Incremental_inputs_reader::get_local_symbol_count): New function.
5675 (Incremental_inputs_reader::get_input_section): Adjust size of input
5677 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5678 (Sized_incr_relobj::This): New typedef.
5679 (Sized_incr_relobj::sym_size): New const data member.
5680 (Sized_incr_relobj::Local_symbol): New struct.
5681 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5682 (Sized_incr_relobj::do_local_symbol_offset): New function.
5683 (Sized_incr_relobj::local_symbol_count_): New data member.
5684 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5685 (Sized_incr_relobj::local_symbol_index_): New data member.
5686 (Sized_incr_relobj::local_symbol_offset_): New data member.
5687 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5688 (Sized_incr_relobj::local_symbols_): New data member.
5689 * object.h (Relobj::output_local_symbol_count): New function.
5690 (Relobj::local_symbol_offset): New function.
5691 (Relobj::do_output_local_symbol_count): New function.
5692 (Relobj::do_local_symbol_offset): New function.
5693 (Sized_relobj::do_output_local_symbol_count): New function.
5694 (Sized_relobj::do_local_symbol_offset): New function.
5696 2011-04-22 Vladimir Simonov <sv@sw.ru>
5698 * descriptors.cc (set_close_on_exec): New function.
5699 (Descriptors::open): Use set_close_on_exec.
5700 * output.cc (S_ISLNK): Define if not defined.
5702 2011-04-22 Cary Coutant <ccoutant@google.com>
5704 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5706 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5707 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5708 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5710 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5711 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5712 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5714 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5716 (Incremental_binary::apply_incremental_relocs): New function.
5717 (Incremental_binary::do_apply_incremental_relocs): New function.
5718 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5720 (Sized_incremental_binary::add_global_symbol): New function.
5721 (Sized_incremental_binary::global_symbol): New function.
5722 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5723 (Sized_incremental_binary::symbol_map_): New data member.
5724 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5725 * target.h (Sized_target::apply_relocation): New function.
5726 * target-reloc.h (apply_relocation): New function.
5727 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5729 2011-04-22 Doug Kwan <dougkwan@google.com>
5731 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5732 flag of a SHT_ARM_EXIDX section.
5733 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5734 * testsuite/Makefile.in: Regenerate.
5735 * testsuite/arm_exidx_test.s: New file.
5736 * testsuite/arm_exidx_test.sh: Same.
5738 2011-04-20 Cary Coutant <ccoutant@google.com>
5741 * archive.h (Incremental_archive_entry::Archive_member):
5742 Initialize arg_serial_ (second constructor).
5744 2011-04-17 Ian Lance Taylor <iant@google.com>
5746 * object.cc (Relocate_info::location): Simplify location string.
5747 * errors.cc (Errors::error_at_location): Don't print program
5749 (Errors::warning_at_location): Likewise.
5750 (Errors::undefined_symbol): Likewise.
5751 * testsuite/debug_msg.sh: Update accordingly.
5753 2011-04-14 Cary Coutant <ccoutant@google.com>
5755 * gold/layout.cc (Layout::symtab_section_offset): New function.
5756 * gold/layout.h (Layout::symtab_section_offset): New function.
5757 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5759 2011-04-12 Ian Lance Taylor <iant@google.com>
5761 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5762 with MREMAP_MAYMOVE.
5763 * output.h (class Output_file): Add map_is_allocated_ field.
5764 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5765 not available, provide stubs. If mremap is not available, #define
5767 (MREMAP_MAYMOVE): Define if not defined.
5768 (Output_file::Output_file): Initialize map_is_allocated_.
5769 (Output_file::resize): Check map_is_allocated_.
5770 (Output_file::map_anonymous): If mmap fails, use malloc.
5771 (Output_file::unmap): Don't do anything for an anonymous map.
5772 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5773 is not available, provide stubs.
5774 (File_read::View::~View): Use free rather than delete[].
5775 (File_read::make_view): Use malloc rather than new[]. If mmap
5777 (File_read::find_or_make_view): Use malloc rather than new[].
5778 * gold.h: Remove HAVE_REMAP code.
5779 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5780 exists. Rename mremap to gold_mremap. If mmap is not available
5782 * configure, config.in: Rebuild.
5784 2011-04-11 Ian Lance Taylor <iant@google.com>
5786 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5787 initialize local variable v.
5789 2011-04-11 Cary Coutant <ccoutant@google.com>
5791 * archive.cc (Archive::include_member): Adjust call to
5793 (Add_archive_symbols::run): Track argument serial numbers.
5794 (Lib_group::include_member): Likewise.
5795 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5796 * archive.h (Incremental_archive_entry::Archive_member):
5797 Initialize arg_serial_.
5798 (Archive_member::arg_serial_): New data member.
5799 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5800 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5802 (Sized_dynobj::do_for_all_local_got_entries): New function.
5803 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5805 * fileread.cc (get_mtime): New function.
5806 * fileread.h (get_mtime): New function.
5807 * gold.cc (queue_initial_tasks): Check for incremental update.
5808 (process_incremental_input): New function.
5809 (queue_middle_tasks): Don't force valid target for incremental
5811 * incremental-dump.cc (find_input_containing_global): Adjust
5812 size of symbol info entry.
5813 (dump_incremental_inputs): Dump argument serial number and
5814 in_system_directory flag; bias shndx by 1; print symbol names
5815 when dumping per-file symbol lists; use new symbol info readers.
5817 (Output_section_incremental_inputs:update_data_size): New function.
5818 (Sized_incremental_binary::setup_readers): Setup input readers
5819 for each input file; build maps for files added from libraries
5821 (Sized_incremental_binary::check_input_args): New function.
5822 (Sized_incremental_binary::do_check_inputs): Build map of argument
5823 serial numbers to input arguments.
5824 (Sized_incremental_binary::do_file_has_changed): Rename
5825 do_file_is_unchanged to this; compare file modification times.
5826 (Sized_incremental_binary::do_init_layout): New function.
5827 (Sized_incremental_binary::do_reserve_layout): New function.
5828 (Sized_incremental_binary::do_get_input_reader): Remove.
5829 (Sized_incremental_binary::get_symtab_view): New function.
5830 (Incremental_checker::can_incrementally_link_output_file): Remove.
5831 (Incremental_inputs::report_command_line): Exclude --debug options.
5832 (Incremental_inputs::report_archive_begin): Add parameter; track
5833 argument serial numbers; don't put input file entry for archive
5834 before archive members.
5835 (Incremental_inputs::report_archive_end): Put input file entry
5836 for archive after archive members.
5837 (Incremental_inputs::report_object): Add parameter; track argument
5838 serial numbers and in_system_directory flag.
5839 (Incremental_inputs::report_script): Add parameter; track argument
5841 (Output_section_incremental_inputs::set_final_data_size): Adjust
5842 size of symbol info entry; check for forwarding symbols.
5843 (Output_section_incremental_inputs::write_input_files): Write
5844 in_system_directory flag and argument serial number.
5845 (Output_section_incremental_inputs::write_info_blocks): Map section
5846 indices between incremental info and original input file; store
5847 input section index for each symbol.
5848 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5849 change operator() to visit().
5850 (class Global_got_offset_visitor): Likewise.
5851 (class Global_symbol_visitor_got_plt):
5852 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5854 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5855 (Sized_incr_relobj::do_read_symbols): New function.
5856 (Sized_incr_relobj::do_layout): New function.
5857 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5858 (Sized_incr_relobj::do_add_symbols): New function.
5859 (Sized_incr_relobj::do_should_include_member): New function.
5860 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5861 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5862 (Sized_incr_relobj::do_section_size): New function.
5863 (Sized_incr_relobj::do_section_name): New function.
5864 (Sized_incr_relobj::do_section_contents): New function.
5865 (Sized_incr_relobj::do_section_flags): New function.
5866 (Sized_incr_relobj::do_section_entsize): New function.
5867 (Sized_incr_relobj::do_section_address): New function.
5868 (Sized_incr_relobj::do_section_type): New function.
5869 (Sized_incr_relobj::do_section_link): New function.
5870 (Sized_incr_relobj::do_section_info): New function.
5871 (Sized_incr_relobj::do_section_addralign): New function.
5872 (Sized_incr_relobj::do_initialize_xindex): New function.
5873 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5874 (Sized_incr_relobj::do_read_relocs): New function.
5875 (Sized_incr_relobj::do_gc_process_relocs): New function.
5876 (Sized_incr_relobj::do_scan_relocs): New function.
5877 (Sized_incr_relobj::do_count_local_symbols): New function.
5878 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5879 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5880 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5881 (Sized_incr_relobj::do_relocate): New function.
5882 (Sized_incr_relobj::do_set_section_offset): New function.
5883 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5884 (Sized_incr_dynobj::do_read_symbols): New function.
5885 (Sized_incr_dynobj::do_layout): New function.
5886 (Sized_incr_dynobj::do_add_symbols): New function.
5887 (Sized_incr_dynobj::do_should_include_member): New function.
5888 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5889 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5890 (Sized_incr_dynobj::do_section_size): New function.
5891 (Sized_incr_dynobj::do_section_name): New function.
5892 (Sized_incr_dynobj::do_section_contents): New function.
5893 (Sized_incr_dynobj::do_section_flags): New function.
5894 (Sized_incr_dynobj::do_section_entsize): New function.
5895 (Sized_incr_dynobj::do_section_address): New function.
5896 (Sized_incr_dynobj::do_section_type): New function.
5897 (Sized_incr_dynobj::do_section_link): New function.
5898 (Sized_incr_dynobj::do_section_info): New function.
5899 (Sized_incr_dynobj::do_section_addralign): New function.
5900 (Sized_incr_dynobj::do_initialize_xindex): New function.
5901 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5902 (make_sized_incremental_object): New function.
5903 (Incremental_library::copy_unused_symbols): New function.
5904 (Incremental_library::do_for_all_unused_symbols): New function.
5905 * incremental.h (enum Incremental_input_flags): New type.
5906 (class Incremental_checker): Remove.
5907 (Incremental_input_entry::Incremental_input_entry): Add argument
5909 (Incremental_input_entry::arg_serial): New function.
5910 (Incremental_input_entry::set_is_in_system_directory): New function.
5911 (Incremental_input_entry::is_in_system_directory): New function.
5912 (Incremental_input_entry::arg_serial_): New data member.
5913 (Incremental_input_entry::is_in_system_directory_): New data member.
5914 (class Script_info): Move here from script.h.
5915 (Script_info::Script_info): Add filename parameter.
5916 (Script_info::filename): New function.
5917 (Script_info::filename_): New data member.
5918 (Incremental_script_entry::Incremental_script_entry): Add argument
5920 (Incremental_object_entry::Incremental_object_entry): Likewise.
5921 (Incremental_object_entry::add_input_section): Build list of input
5922 sections with map to original shndx.
5923 (Incremental_object_entry::get_input_section_index): New function.
5924 (Incremental_object_entry::shndx_): New data member.
5925 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5926 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5927 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5929 (Incremental_inputs::report_archive_begin): Likewise.
5930 (Incremental_inputs::report_object): Likewise.
5931 (Incremental_inputs::report_script): Likewise.
5932 (class Incremental_global_symbol_reader): New class.
5933 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5934 and store flags and input file type.
5935 (Incremental_input_entry_reader::arg_serial): New function.
5936 (Incremental_input_entry_reader::type): Extract type from flags.
5937 (Incremental_input_entry_reader::is_in_system_directory): New function.
5938 (Incremental_input_entry_reader::get_input_section_count): Call
5939 accessor function for type.
5940 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5941 function for type; adjust size of global symbol entry.
5942 (Incremental_input_entry_reader::get_global_symbol_count): Call
5943 accessor function for type.
5944 (Incremental_input_entry_reader::get_object_count): Likewise.
5945 (Incremental_input_entry_reader::get_object_offset): Likewise.
5946 (Incremental_input_entry_reader::get_member_count): Likewise.
5947 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5948 (Incremental_input_entry_reader::get_member_offset): Likewise.
5949 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5950 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5951 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5952 (Incremental_input_entry_reader::get_global_symbol_reader): New
5954 (Incremental_input_entry_reader::get_output_symbol_index): New
5956 (Incremental_input_entry_reader::type_): Remove.
5957 (Incremental_input_entry_reader::flags_): New data member.
5958 (Incremental_inputs_reader::input_file_offset): New function.
5959 (Incremental_inputs_reader::input_file_index): New function.
5960 (Incremental_inputs_reader::input_file): Call input_file_offset.
5961 (Incremental_inputs_reader::input_file_at_offset): New function.
5962 (Incremental_relocs_reader::get_r_type): Reformat.
5963 (Incremental_relocs_reader::get_r_shndx): Reformat.
5964 (Incremental_relocs_reader::get_r_offset): Reformat.
5965 (Incremental_relocs_reader::data): New function.
5966 (Incremental_binary::Incremental_binary): Initialize new data members.
5967 (Incremental_binary::check_inputs): Add cmdline parameter.
5968 (Incremental_binary::file_is_unchanged): Remove.
5969 (Input_reader::arg_serial): New function.
5970 (Input_reader::get_unused_symbol_count): New function.
5971 (Input_reader::get_unused_symbol): New function.
5972 (Input_reader::do_arg_serial): New function.
5973 (Input_reader::do_get_unused_symbol_count): New function.
5974 (Input_reader::do_get_unused_symbol): New function.
5975 (Incremental_binary::input_file_count): New function.
5976 (Incremental_binary::get_input_reader): Change signature to use
5977 index instead of filename.
5978 (Incremental_binary::file_has_changed): New function.
5979 (Incremental_binary::get_input_argument): New function.
5980 (Incremental_binary::get_library): New function.
5981 (Incremental_binary::get_script_info): New function.
5982 (Incremental_binary::init_layout): New function.
5983 (Incremental_binary::reserve_layout): New function.
5984 (Incremental_binary::output_file): New function.
5985 (Incremental_binary::do_check_inputs): New function.
5986 (Incremental_binary::do_file_is_unchanged): Remove.
5987 (Incremental_binary::do_file_has_changed): New function.
5988 (Incremental_binary::do_init_layout): New function.
5989 (Incremental_binary::do_reserve_layout): New function.
5990 (Incremental_binary::do_input_file_count): New function.
5991 (Incremental_binary::do_get_input_reader): Change signature.
5992 (Incremental_binary::input_args_map_): New data member.
5993 (Incremental_binary::library_map_): New data member.
5994 (Incremental_binary::script_map_): New data member.
5995 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5997 (Sized_incremental_binary::output_section): New function.
5998 (Sized_incremental_binary::inputs_reader): Add const.
5999 (Sized_incremental_binary::symtab_reader): Add const.
6000 (Sized_incremental_binary::relocs_reader): Add const.
6001 (Sized_incremental_binary::got_plt_reader): Add const.
6002 (Sized_incremental_binary::get_symtab_view): New function.
6003 (Sized_incremental_binary::Inputs_reader): New typedef.
6004 (Sized_incremental_binary::Input_entry_reader): New typedef.
6005 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6006 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6007 (Sized_incremental_binary::do_file_has_changed): New function.
6008 (Sized_incremental_binary::do_init_layout): New function.
6009 (Sized_incremental_binary::do_reserve_layout): New function.
6010 (Sized_input_reader::Inputs_reader): Remove.
6011 (Sized_input_reader::Input_entry_reader): Remove.
6012 (Sized_input_reader::do_arg_serial): New function.
6013 (Sized_input_reader::do_get_unused_symbol_count): New function.
6014 (Sized_input_reader::do_get_unused_symbol): New function.
6015 (Sized_incremental_binary::do_input_file_count): New function.
6016 (Sized_incremental_binary::do_get_input_reader): Change signature;
6017 use index instead of filename.
6018 (Sized_incremental_binary::section_map_): New data member.
6019 (Sized_incremental_binary::input_entry_readers_): New data member.
6020 (class Sized_incr_relobj): New class.
6021 (class Sized_incr_dynobj): New class.
6022 (make_sized_incremental_object): New function.
6023 (class Incremental_library): New class.
6024 * layout.cc (Free_list::num_lists): New static data member.
6025 (Free_list::num_nodes): New static data member.
6026 (Free_list::num_removes): New static data member.
6027 (Free_list::num_remove_visits): New static data member.
6028 (Free_list::num_allocates): New static data member.
6029 (Free_list::num_allocate_visits): New static data member.
6030 (Free_list::init): New function.
6031 (Free_list::remove): New function.
6032 (Free_list::allocate): New function.
6033 (Free_list::dump): New function.
6034 (Free_list::print_stats): New function.
6035 (Layout_task_runner::run): Resize output file for incremental updates.
6036 (Layout::Layout): Initialize new data members.
6037 (Layout::set_incremental_base): New function.
6038 (Layout::init_fixed_output_section): New function.
6039 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6040 incremental updates.
6041 (Layout::create_gold_note): Do not create gold note section for
6042 incremental updates.
6043 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6044 for incremental updates.
6045 (Layout::set_section_offsets): For incremental updates, allocate space
6047 (Layout::create_symtab_sections): Layout with offsets relative to
6048 start of section; for incremental updates, allocate space from free
6050 (Layout::create_shdrs): For incremental updates, allocate space from
6052 (Layout::finish_dynamic_section): For incremental updates, do not
6053 check --as-needed (fixed in subsequent patch).
6054 * layout.h (class Free_list): New class.
6055 (Layout::set_incremental_base): New function.
6056 (Layout::incremental_base): New function.
6057 (Layout::init_fixed_output_section): New function.
6058 (Layout::allocate): New function.
6059 (Layout::incremental_base_): New data member.
6060 (Layout::free_list_): New data member.
6061 * main.cc (main): Print Free_list statistics.
6062 * object.cc (Relobj::finalize_incremental_relocs): Add
6063 clear_counts parameter; clear counts only when clear_counts is set.
6064 (Sized_relobj::Sized_relobj): Initialize new base class.
6065 (Sized_relobj::do_layout): Don't report special sections.
6066 (Sized_relobj::do_for_all_local_got_entries): New function.
6067 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6068 symtab_off to all symbol table offsets.
6069 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6070 * object.h (class Got_offset_list): Move to top of file.
6071 (Object::Object): Allow case where input_file == NULL.
6072 (Object::~Object): Likewise.
6073 (Object::input_file): Assert that input_file != NULL.
6074 (Object::lock): Allow case where input_file == NULL.
6075 (Object::unlock): Likewise.
6076 (Object::is_locked): Likewise.
6077 (Object::token): Likewise.
6078 (Object::release): Likewise.
6079 (Object::is_incremental): New function.
6080 (Object::get_mtime): New function.
6081 (Object::for_all_local_got_entries): New function.
6082 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6083 (Object::set_is_in_system_directory): New function.
6084 (Object::is_in_system_directory): New function.
6085 (Object::do_is_incremental): New function.
6086 (Object::do_get_mtime): New function.
6087 (Object::do_for_all_local_got_entries): New function.
6088 (Object::is_in_system_directory_): New data member.
6089 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6090 (class Sized_relobj_base): New class.
6091 (class Sized_relobj): Derive from Sized_relobj_base.
6092 (class Sized_relobj::Symbols): Redeclare from base class.
6093 (class Sized_relobj::local_got_offset_list): Remove.
6094 (class Sized_relobj::Output_sections): Redeclare from base class.
6095 (class Sized_relobj::do_for_all_local_got_entries): New function.
6096 (class Sized_relobj::write_local_symbols): Add offset parameter.
6097 (class Sized_relobj::local_symbol_offset_): Update comment.
6098 (class Sized_relobj::local_dynsym_offset_): Update comment.
6099 * options.cc (Input_arguments::add_file): Remove const.
6100 * options.h (Input_file_argument::Input_file_argument):
6101 Initialize arg_serial_ (all constructors).
6102 (Input_file_argument::set_arg_serial): New function.
6103 (Input_file_argument::arg_serial): New function.
6104 (Input_file_argument::arg_serial_): New data member.
6105 (Input_arguments::Input_arguments): Initialize file_count_.
6106 (Input_arguments::add_file): Remove const.
6107 (Input_arguments::number_of_input_files): New function.
6108 (Input_arguments::file_count_): New data member.
6109 (Command_line::number_of_input_files): Call
6110 Input_arguments::number_of_input_files.
6111 * output.cc (Output_segment_headers::Output_segment_headers):
6113 (Output_section::Input_section::current_data_size): New function.
6114 (Output_section::Output_section): Initialize new data members.
6115 (Output_section::add_input_section): Don't do merge sections for
6116 an incremental link; allocate space from free list for an
6118 (Output_section::add_output_section_data): Allocate space from
6119 free list for an incremental update.
6120 (Output_section::update_data_size): New function.
6121 (Output_section::set_fixed_layout): New function.
6122 (Output_section::reserve): New function.
6123 (Output_segment::set_section_addresses): Remove const.
6124 (Output_segment::set_section_list_addresses): Remove const; allocate
6125 space from free list for an incremental update.
6126 (Output_segment::set_offset): Adjust size of RELRO segment for an
6128 * output.h (Output_data::current_data_size): Move here from
6130 (Output_data::pre_finalize_data_size): New function.
6131 (Output_data::update_data_size): New function.
6132 (Output_section_headers::update_data_size): new function.
6133 (Output_section_data_build::current_data_size): Move to Output_data.
6134 (Output_data_strtab::update_data_size): New function.
6135 (Output_section::current_data_size): Move to Output_data.
6136 (Output_section::set_fixed_layout): New function.
6137 (Output_section::has_fixed_layout): New function.
6138 (Output_section::reserve): New function.
6139 (Output_section::update_data_size): New function.
6140 (Output_section::has_fixed_layout_): New data member.
6141 (Output_section::free_list_): New data member.
6142 (Output_segment::set_section_addresses): Remove const.
6143 (Output_segment::set_section_list_addresses): Remove const.
6144 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6146 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6148 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6149 parameter when calling Add_symbols constructor; store argument
6150 serial number for members of a lib group.
6151 (Add_symbols::locks): Allow case where token == NULL.
6152 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6153 (Read_member::~Read_member): New function.
6154 (Read_member::is_runnable): New function.
6155 (Read_member::locks): New function.
6156 (Read_member::run): New function.
6157 (Check_script::~Check_script): New function.
6158 (Check_script::is_runnable): New function.
6159 (Check_script::locks): New function.
6160 (Check_script::run): New function.
6161 (Check_library::~Check_library): New function.
6162 (Check_library::is_runnable): New function.
6163 (Check_library::locks): New function.
6164 (Check_library::run): New function.
6165 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6166 (Add_symbols::library_): New data member.
6167 (class Read_member): New class.
6168 (class Check_script): New class.
6169 (class Check_library): New class.
6170 * reloc.cc (Read_relocs::is_runnable): Allow case where
6172 (Read_relocs::locks): Likewise.
6173 (Scan_relocs::locks): Likewise.
6174 (Relocate_task::locks): Likewise.
6175 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6177 (Sized_relobj::incremental_relocs_scan): Fix comment.
6178 (Sized_relobj::do_relocate): Pass output file offset to
6179 write_local_symbols.
6180 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6181 from class declaration.
6182 * script.cc (read_input_script): Allocate Script_info; pass
6183 argument serial number to report_script.
6184 * script.h (class Script_info): Move to incremental.h.
6185 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6186 * symtab.h (Symbol_table::add_from_incrobj): New function.
6187 (Symbol_table::set_file_offset): New function.
6189 2011-04-05 Cary Coutant <ccoutant@google.com>
6191 * incremental-dump.cc (dump_incremental_inputs): Change signature
6192 to take a Sized_incremental_binary; change caller. Use readers
6193 in Sized_incremental_binary.
6195 (Sized_incremental_binary::find_incremental_inputs_sections):
6196 Rename do_find_incremental_inputs_sections to this.
6197 (Sized_incremental_binary::setup_readers): New function.
6198 (Sized_incremental_binary::do_check_inputs): Check
6199 has_incremental_info_ flag; move setup code to setup_readers;
6201 (Sized_incremental_binary::do_file_is_unchanged): New function.
6202 (Sized_incremental_binary::do_get_input_reader): New function.
6203 * incremental.h (class Incremental_binary): Move to end of file.
6204 (Incremental_binary::file_is_unchanged): New function.
6205 (Incremental_binary::do_file_is_unchanged): New function.
6206 (Incremental_binary::Input_reader): New class.
6207 (Incremental_binary::get_input_reader): New function.
6208 (class Sized_incremental_binary): Move to end of file.
6209 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6210 input section reader classes.
6211 (Sized_incremental_binary::has_incremental_info): New function.
6212 (Sized_incremental_binary::inputs_reader): New function.
6213 (Sized_incremental_binary::symtab_reader): New function.
6214 (Sized_incremental_binary::relocs_reader): New function.
6215 (Sized_incremental_binary::got_plt_reader): New function.
6216 (Sized_incremental_binary::do_file_is_unchanged): New function.
6217 (Sized_incremental_binary::Sized_input_reader): New class.
6218 (Sized_incremental_binary::get_input_reader): New function.
6219 (Sized_incremental_binary::find_incremental_inputs_sections):
6220 Rename do_find_incremental_inputs_sections to this.
6221 (Sized_incremental_binary::setup_readers): New function.
6222 (Sized_incremental_binary::has_incremental_info_): New data member.
6223 (Sized_incremental_binary::inputs_reader_): New data member.
6224 (Sized_incremental_binary::symtab_reader_): New data member.
6225 (Sized_incremental_binary::relocs_reader_): New data member.
6226 (Sized_incremental_binary::got_plt_reader_): New data member.
6227 (Sized_incremental_binary::current_input_file_): New data member.
6229 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6232 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6235 2011-03-30 Cary Coutant <ccoutant@google.com>
6237 * archive.cc (Archive::include_member): Adjust call to report_object.
6238 (Add_archive_symbols::run): Add script_info to call to
6239 report_archive_begin.
6240 (Lib_group::include_member): Adjust call to report_object.
6241 (Add_lib_group_symbols::run): Adjust call to report_object.
6242 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6243 blocks. Add object count for script input files.
6244 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6245 script_info parameter; change all callers.
6246 (Incremental_inputs::report_object): Add script_info parameter;
6248 (Incremental_inputs::report_script): Store backpointer to
6249 incremental info entry.
6250 (Output_section_incremental_inputs::set_final_data_size): Record
6251 additional information for scripts.
6252 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6253 * incremental.h (Incremental_script_entry::add_object): New function.
6254 (Incremental_script_entry::get_object_count): New function.
6255 (Incremental_script_entry::get_object): New function.
6256 (Incremental_script_entry::objects_): New data member; adjust
6258 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6259 (Incremental_inputs::report_object): Add script_info parameter.
6260 (Incremental_inputs_reader::get_object_count): New function.
6261 (Incremental_inputs_reader::get_object_offset): New function.
6262 * options.cc (Input_arguments::add_file): Return reference to
6264 * options.h (Input_argument::set_script_info): New function.
6265 (Input_argument::script_info): New function.
6266 (Input_argument::script_info_): New data member; adjust all
6268 (Input_file_group::add_file): Return reference to new input argument.
6269 (Input_file_lib::add_file): Likewise.
6270 (Input_arguments::add_file): Likewise.
6271 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6272 * script.cc (Parser_closure::Parser_closure): Add script_info
6273 parameter; adjust all callers.
6274 (Parser_closure::script_info): New function.
6275 (Parser_closure::script_info_): New data member.
6276 (read_input_script): Report scripts earlier to incremental info.
6277 (script_add_file): Set script_info in Input_argument.
6278 (script_add_library): Likewise.
6279 * script.h (Script_options::Script_info): Rewrite class.
6281 2011-03-29 Cary Coutant <ccoutant@google.com>
6283 * archive.cc (Library_base::should_include_member): Move
6284 method here from class Archive.
6285 (Archive::Archive): Initialize base class.
6286 (Archive::should_include_member): Move to base class.
6287 (Archive::do_for_all_unused_symbols): New function.
6288 (Add_archive_symbols::run): Remove redundant access to
6290 (Lib_group::Lib_group): Initialize base class.
6291 (Lib_group::do_filename): New function.
6292 (Lib_group::include_member): Pass pointer to Lib_group to
6294 (Lib_group::do_for_all_unused_symbols): New function.
6295 (Add_lib_group_symbols::run): Report archive information for
6297 * archive.h (class Library_base): New base class.
6298 (class Archive): Derive from Library_base.
6299 (Archive::filename): Move to base class.
6300 (Archive::set_incremental_info): Likewise.
6301 (Archive::incremental_info): Likewise.
6302 (Archive::Should_include): Likewise.
6303 (Archive::should_include_member): Likewise.
6304 (Archive::Armap_entry): Remove.
6305 (Archive::Unused_symbol_iterator): Remove.
6306 (Archive::unused_symbols_begin): Remove.
6307 (Archive::unused_symbols_end): Remove.
6308 (Archive::do_filename): New function.
6309 (Archive::do_get_mtime): New function.
6310 (Archive::do_for_all_unused_symbols): New function.
6311 (Archive::task_): Move to base class.
6312 (Archive::incremental_info_): Likewise.
6313 (class Lib_group): Derive from Library_base.
6314 (Lib_group::do_filename): New function.
6315 (Lib_group::do_get_mtime): New function.
6316 (Lib_group::do_for_all_unused_symbols): New function.
6317 (Lib_group::task_): Move to base class.
6318 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6320 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6322 * incremental.cc (Incremental_inputs::report_archive_begin):
6323 Use Library_base; call library's get_mtime; add incremental inputs
6324 entry before members.
6325 (class Unused_symbol_visitor): New class.
6326 (Incremental_inputs::report_archive_end): Use Library_base; use
6327 visitor class to record unused symbols; don't add incremental inputs
6328 entry after members.
6329 (Incremental_inputs::report_object): Use Library_base.
6331 (Incremental_archive_entry::Incremental_archive_entry): Remove
6332 unused Archive parameter.
6333 (Incremental_inputs::report_archive_begin): Use Library_base.
6334 (Incremental_inputs::report_archive_end): Likewise.
6335 (Incremental_inputs::report_object): Likewise.
6336 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6338 * object.h (Object::for_all_global_symbols): New function.
6339 (Object::do_for_all_global_symbols): New function.
6340 (Sized_relobj::do_for_all_global_symbols): New function.
6341 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6343 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6346 2011-03-27 Ian Lance Taylor <iant@google.com>
6348 * archive.cc (Archive::interpret_header): Return -1 if something
6349 goes wrong. Change callers accordingly.
6351 2011-03-25 Cary Coutant <ccoutant@google.com>
6353 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6354 * testsuite/Makefile.in: Regenerate.
6356 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6358 * plugin.cc (get_view): New.
6359 (Plugin::load): Pass get_view to the plugin.
6360 (Plugin_manager::get_view): New.
6362 2011-03-21 Ian Lance Taylor <iant@google.com>
6364 * testsuite/final_layout.sh: Rewrite to not use dc.
6365 * testsuite/relro_test.sh: Fail if dc is not present.
6367 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6369 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6371 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6372 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6374 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6375 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6377 2011-03-14 Ian Lance Taylor <iant@google.com>
6379 * script-sections.cc (Sort_output_sections::script_compare):
6380 Rename from is_before, change return type.
6381 (Sort_output_sections::operator()): Adjust accordingly.
6383 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6386 * testsuite/odr_violation2.cc: Add comment to make all error line
6387 numbers double digits.
6388 * testsuite/debug_msg.sh: Adjust expected errors.
6390 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6392 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6393 but mark earlier ones as non-canonical
6394 (offset_to_iterator): Update search target and example
6395 (do_addr2line): Return extra lines in a vector*
6396 (format_file_lineno): Extract from do_addr2line
6397 (one_addr2line): Add vector* out-param
6398 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6399 when a lineno entry appeared last for its instruction
6400 (Dwarf_line_info): Add vector* out-param
6401 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6402 * symtab.cc (Odr_violation_compare): Include the lineno in the
6404 (linenos_from_loc): New. Combine the canonical line for an
6405 address with its other lines.
6406 (True_if_intersect): New. Helper functor to make
6407 std::set_intersection a query.
6408 (detect_odr_violations): Compare sets of lines instead of just
6409 one line for each function. This became less deterministic, but
6410 has fewer false positives.
6411 * symtab.h: Declarations.
6412 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6413 mix an optimized and non-optimized object in the same binary
6414 (odr_violation2.so): Same.
6415 * testsuite/Makefile.in: Regenerate from Makefile.am.
6416 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6417 * testsuite/debug_msg.sh: Update line numbers and add
6419 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6420 non-optimized context.
6421 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6422 isn't inlined, and use OdrDerived in an optimized context.
6423 * testsuite/odr_header1.h: Defines OdrDerived, where
6424 optimization will change the
6425 first-instruction-in-the-destructor's file and line number.
6426 * testsuite/odr_header2.h: Defines OdrBase.
6428 2011-03-09 Ian Lance Taylor <iant@google.com>
6430 * fileread.cc (File_read::clear_views): Don't delete the whole
6433 2011-03-08 Ian Lance Taylor <iant@google.com>
6436 * fileread.cc: #include <climits>.
6437 (GOLD_IOV_MAX): Define.
6438 (File_read::read_multiple): Limit number of entries by iov_max.
6439 * fileread.h (class File_read): Always set max_readv_entries to
6442 2011-03-07 Ian Lance Taylor <iant@google.com>
6445 * options.h (class General_options): Add -dy and -dn.
6447 2011-03-02 Cary Coutant <ccoutant@google.com>
6449 * testsuite/script_test_9.t: Add TLS segment.
6451 2011-03-02 Simon Baldwin <simonb@google.com>
6453 * configure.ac: Add check for gnu_indirect_function support in
6454 the toolchain building binutils.
6455 * configure: Rebuild.
6457 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6459 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6460 plugin only symbols.
6461 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6462 in plugin files as not needed in the symbol table.
6464 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6466 * output.cc (Output_section::add_input_section): Delay fill
6467 generation for section ordering.
6469 2011-02-09 Ian Lance Taylor <iant@google.com>
6472 * object.h (class Sized_relobj): Remove clear_local_symbols.
6473 * reloc.cc (Sized_relobj::do_relocate): Don't call
6474 clear_local_symbols.
6476 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6478 * plugin.cc (is_visible_from_outside): Return true for symbols
6481 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6483 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6486 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6488 * icf.h (is_section_foldable_candidate): Change type of parameter
6490 * icf.cc (Icf::find_identical_sections): Change type of local variable
6491 section_name to be std::string.
6492 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6494 2011-01-25 Ian Lance Taylor <iant@google.com>
6496 * script.cc (script_add_extern): Rewrite to use
6497 add_symbol_reference.
6499 2011-01-25 Doug Kwan <dougkwan@google.com>
6501 * icf.cc (get_section_contents): Always lock section's object.
6503 2011-01-24 Ian Lance Taylor <iant@google.com>
6505 * options.h (class General_options): Accept
6506 --no-detect-odr-violations.
6508 2011-01-24 Ian Lance Taylor <iant@google.com>
6510 * version.cc (version_string): Bump to 1.11.
6512 2011-01-24 Ian Lance Taylor <iant@google.com>
6514 * plugin.cc (class Plugin_rescan): Define new class.
6515 (Plugin_manager::claim_file): Set any_claimed_.
6516 (Plugin_manager::save_archive): New function.
6517 (Plugin_manager::save_input_group): New function.
6518 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6520 (Plugin_manager::new_undefined_symbol): New function.
6521 (Plugin_manager::rescan): New function.
6522 (Plugin_manager::rescannable_defines): New function.
6523 (Plugin_manager::add_input_file): Set any_added_.
6524 * plugin.h (class Plugin_manager): define new fields rescannable_,
6525 undefined_symbols_, any_claimed_, and any_added_. Declare
6526 Plugin_rescan as friend. Declare new functions.
6527 (Plugin_manager::Rescannable): Define type.
6528 (Plugin_manager::Rescannable_list): Define type.
6529 (Plugin_manager::Undefined_symbol_list): Define type.
6530 (Plugin_manager::Plugin_manager): Initialize new fields.
6531 * archive.cc (Archive::defines_symbol): New function.
6532 (Add_archive_symbols::run): Pass archive to plugins if any.
6533 * archive.h (class Archive): Declare defines_symbol.
6534 * readsyms.cc (Input_group::~Input_group): New function.
6535 (Finish_group::run): Pass input_group to plugins if any.
6536 * readsyms.h (class Input_group): Declare destructor.
6537 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6540 2011-01-10 Ian Lance Taylor <iant@google.com>
6542 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6544 (Layout::set_segment_offsets): Reset increase_relro before calling
6545 set_section_addresses a second time.
6547 2011-01-04 Cary Coutant <ccoutant@google.com>
6549 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6550 sections before NOBITS sections.
6552 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6554 * version.cc (print_version): Update copyright to 2011.
6556 2010-12-23 Cary Coutant <ccoutant@google.com>
6558 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6559 of OS to this->add. Add OD parameter to second form of the function.
6561 2010-12-20 Ian Lance Taylor <iant@google.com>
6563 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6564 second of two consecutive entries with same offset.
6566 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6568 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6569 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6570 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6571 to avoid unneeded links against $(LDADD).
6572 * testsuite/Makefile.in: Regenerate.
6574 2010-12-15 Ian Lance Taylor <iant@google.com>
6577 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6578 for R_X86_64_32 and R_X86_64_PC32.
6579 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6580 ver_matching_def_pic.o.
6581 (ver_matching_def_pic.o): New target.
6583 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6585 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6586 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6587 Move definition before File_read::View member definitions.
6588 (File_read::View::~View): Initialize and hold lock before
6589 updating current_mapped_bytes.
6591 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6593 * dwarf_reader.cc: Remove outdated comment.
6594 * gold-threads.cc: Fix typo in error message.
6595 * archive.cc: Fix typos in comments.
6596 * archive.h: Likewise.
6597 * arm-reloc-property.cc: Likewise.
6598 * arm-reloc-property.h: Likewise.
6599 * arm-reloc.def: Likewise.
6601 * attributes.h: Likewise.
6602 * cref.cc: Likewise.
6603 * ehframe.cc: Likewise.
6604 * fileread.h: Likewise.
6606 * i386.cc: Likewise.
6608 * incremental.h: Likewise.
6609 * int_encoding.cc: Likewise.
6610 * layout.h: Likewise.
6611 * main.cc: Likewise.
6612 * merge.h: Likewise.
6613 * object.cc: Likewise.
6614 * object.h: Likewise.
6615 * options.cc: Likewise.
6616 * readsyms.cc: Likewise.
6617 * reduced_debug_output.cc: Likewise.
6618 * reloc.cc: Likewise.
6619 * script-sections.cc: Likewise.
6620 * sparc.cc: Likewise.
6621 * symtab.h: Likewise.
6622 * target-reloc.h: Likewise.
6623 * target.cc: Likewise.
6624 * target.h: Likewise.
6625 * timer.cc: Likewise.
6626 * timer.h: Likewise.
6627 * x86_64.cc: Likewise.
6629 2010-12-09 Cary Coutant <ccoutant@google.com>
6631 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6633 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6634 parameter; change all callers.
6635 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6636 * options.h (warn_execstack): New option.
6638 2010-12-07 Doug Kwan <dougkwan@google.com>
6640 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6641 like function call relocations.
6643 2010-12-07 Ian Lance Taylor <iant@google.com>
6645 * archive.cc (Archive::get_elf_object_for_member): Permit
6646 punconfigured to be NULL.
6647 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6648 (Archive::include_member): Pass NULL to get_elf_object_for_member
6649 if we searched for the archive and this is the first included
6652 2010-12-01 Ian Lance Taylor <iant@google.com>
6654 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6655 track_relocs_type_ field.
6656 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6657 Set track_relocs_type_.
6658 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6659 contents when using RELA relocs.
6660 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6662 * reloc.cc (Track_relocs::next_addend): New function.
6663 * reloc.h (class Track_relocs): Declare next_addend.
6665 2010-12-01 Ian Lance Taylor <iant@google.com>
6667 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6670 2010-12-01 Ian Lance Taylor <iant@google.com>
6672 * README: Update compilers known to work and fail.
6674 2010-11-23 Matthias Klose <doko@ubuntu.com>
6676 * configure.in: For --enable-gold, handle value `default' instead of
6677 `both*'. Always install ld as ld.bfd, install as ld if gold is
6679 * configure: Regenerate.
6681 2010-11-18 Doug Kwan <dougkwan@google.com>
6683 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6684 and right_alignment to be zero. Store result alignment only if it is
6685 greater than existing alignment.
6687 2010-11-16 Cary Coutant <ccoutant@google.com>
6690 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6691 Check for ".zdebug_line".
6693 2010-11-16 Doug Kwan <dougkwan@google.com>
6694 Cary Coutant <ccoutant@google.com>
6696 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6697 by reference; adjust all callers.
6698 * output.cc (Output_segment::set_section_addresses): Adjust references
6699 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6701 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6702 end at page boundary.
6704 2010-11-16 Cary Coutant <ccoutant@google.com>
6707 * layout.cc (Layout::choose_output_section): Transform names of
6708 compressed sections even when using a script with a SECTIONS clause.
6709 (Layout::output_section_name): Remove code to transform
6710 compressed debug section names.
6711 * output.cc (Output_section::add_input_section): Use uncompressed
6712 section size when tracking input sections.
6714 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6716 * symtab.h (Symbol::NON_PIC_REF): Remove.
6717 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6718 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6719 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6720 (Symbol::use_plt_offset): Take a flags argument and pass it
6721 directly to needs_dynamic_reloc. Restrict check for undefined
6722 weak symbols to function calls.
6723 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6724 (Target_arm::Scan::global): Use it.
6725 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6726 (Target_arm::Relocate::relocate): Likewise.
6727 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6728 parameter with an r_type parameter. Use get_reference_flags
6730 (Target_arm::Relocate::relocate): Update accordingly.
6731 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6732 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6733 (Target_i386::Scan::global): Likewise.
6734 (Target_i386::Relocate::relocate): Likewise.
6735 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6736 parameter with an r_type parameter. Use get_reference_flags
6738 (Target_i386::Relocate::relocate): Update accordingly.
6739 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6740 (Target_powerpc::Scan::global): Use it.
6741 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6742 (Target_powerpc::Relocate::relocate): Likewise.
6743 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6744 (Target_sparc::Scan::global): Use it.
6745 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6746 (Target_sparc::Relocate::relocate): Likewise.
6747 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6748 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6749 (Target_x86_64::Scan::global): Likewise.
6750 (Target_x86_64::Relocate::relocate): Likewise.
6752 2010-11-08 Doug Kwan <dougkwan@google.com>
6753 Cary Coutant <ccoutant@google.com>
6755 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6756 (Arm_exidx_merge_section::section_contents_): New data member.
6757 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6758 (Arm_input_section::~Arm_input_section): De-allocate memory.
6759 (Arm_input_section::original_contents_): New data member.
6760 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6761 in parameters instead of calling Object::section_contents without
6763 (Arm_output_section::group_section): New parameter TASK. Pass it
6764 to callees that need locking objects.
6765 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6766 to lock EXIDX input sections. Fix a formatting issue. Call
6767 Arm_exidx_merged_section::build_contents to create merged section
6769 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6770 to lock object of stub table owner.
6771 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6772 TEXT_SIZE to initialize data member TEXT_SIZE_.
6773 (Arm_exidx_input_section::addralign): Fix typo in comment.
6774 (Arm_exidx_input_section::text_size): New method.
6775 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6776 that require locking objects. Lock objects before scanning for stubs
6777 and updating local symbols.
6778 (Arm_input_section<big_endian>::init): Copy contents of original
6780 (Arm_input_section<big_endian>::do_write): Use saved contents of
6781 original input section instead of calling Object::section_contents
6783 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6784 size without calling Object::section_size().
6785 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6786 for size. Allocate a buffer for merged EXIDX entries.
6787 (Arm_exidx_merged_section::build_contents): New method.
6788 (Arm_exidx_merged_section::do_write): Move merge section contents
6789 building code to Arm_exidx_merged_section::build_contetns. Write
6790 out contetns in buffer instead of building it on the fly.
6791 (Arm_relobj::make_exidx_input_section): Also pass text section size
6792 to Arm_exidx_input_section constructor.
6793 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6794 (Arm_dynobj::do_read_symbols): Fix memory leak.
6795 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6796 * target.h: (class Task): Add forward declaration.
6797 (Target::relax): Add new parameter TASK and pass it to
6799 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6801 2010-11-05 Cary Coutant <ccoutant@google.com>
6804 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6805 object when reading from the file.
6806 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6808 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6809 when reading section contents.
6810 (get_section_contents): Likewise.
6811 (icf::find_identical_sections): Likewise.
6812 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6813 object when reading from the file.
6814 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6815 the object when doing deferred section layout.
6817 2010-11-03 Nick Clifton <nickc@redhat.com>
6820 * script.h (class Symbol_assignment: name): New member. Returns
6821 the name of the symbol.
6822 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6823 Returns true if the given symbol name is on the list of
6824 assignments wating to be processed.
6825 * archive.cc (should_incldue_member): If the symbol is undefined,
6826 check to see if it is on the list of symbols pending assignment.
6828 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6830 * script-sections.cc (Script_sections::find_memory_region): Check
6831 for a NULL output section pointer.
6833 2010-10-29 Doug Kwan <dougkwan@google.com>
6835 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6836 Output_section::add_relaxed_input_section.
6837 * output.cc (Output_section::add_relaxed_input_section): Add new
6838 arguments LAYOUT and NAME. Set section order index.
6839 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6840 Copy section order index.
6841 * output.h (Output_section::add_relaxed_input_section): Add new
6842 arguments LAYOUT and NAME.
6844 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6846 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6847 NATIVE_OR_CROSS_LINKER.
6848 * testsuite/Makefile.in: Regenerate.
6850 2010-10-20 Doug Kwan <dougkwan@google.com>
6852 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6853 without SHF_LINK_ORDER flags.
6854 * layout.cc (Layout::choose_output_section): Do not filter
6855 SHF_LINK_ORDER flag in a relocatable link.
6857 2010-10-17 Cary Coutant <ccoutant@google.com>
6859 * output.h (Output_segment::set_section_addresses): Change function
6860 signature. Update all callers.
6861 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6863 (Output_segment::set_section_addresses): Align after last TLS
6864 section. Add padding before last relro section instead of after.
6866 2010-10-17 Doug Kwan <dougkwan@google.com>
6868 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6869 GOT output section to be writable.
6871 2010-10-14 Cary Coutant <ccoutant@google.com>
6873 * debug.h (DEBUG_INCREMENTAL): New flag.
6874 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6875 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6877 * incremental.cc (report_command_line): Ignore all forms of
6879 * layout.cc (Layout::Layout): Check parameters for incremental link
6881 * options.cc (General_options::parse_incremental): New function.
6882 (General_options::parse_no_incremental): New function.
6883 (General_options::parse_incremental_full): New function.
6884 (General_options::parse_incremental_update): New function.
6885 (General_options::incremental_mode_): New data member.
6886 (General_options::finalize): Check incremental_mode_.
6887 * options.h (General_options): Update help text for --incremental.
6888 Add --no-incremental, --incremental-full, --incremental-update.
6889 (General_options::Incremental_mode): New enum type.
6890 (General_options::incremental_mode): New function.
6891 (General_options::incremental_mode_): New data member.
6892 * parameters.cc (Parameters::incremental_mode_): New data member.
6893 (Parameters::set_options): Set incremental_mode_.
6894 (Parameters::set_incremental_full): New function.
6895 (Parameters::incremental): New function.
6896 (Parameters::incremental_update): New function.
6897 (set_parameters_incremental_full): New function.
6898 * parameters.h (Parameters::set_incremental_full): New function.
6899 (Parameters::incremental): New function.
6900 (Parameters::incremental_update): New function.
6901 (Parameters::incremental_mode_): New data member.
6902 (set_parameters_incremental_full): New function.
6903 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6904 incremental link mode.
6905 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6906 (Sized_relobj::do_relocate_sections): Likewise.
6907 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6909 * testsuite/Makefile.in: Regenerate.
6910 * testsuite/incremental_test.sh: Filter all forms of --incremental.
6912 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6914 * script-sections.h (class Script_sections): Make
6915 Sections_elements typedef public.
6916 * script-sections.cc (class Sort_output_sections): Add elements_
6917 field. Add constructor which sets it; change all callers.
6918 (Sort_output_sections::is_before): New function.
6919 (Sort_output_sections::operator()): Call is_before.
6920 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6922 * testsuite/script_test_10.sh: New test. Test script section
6924 * testsuite/script_test_10.t: Likewise.
6925 * testsuite/script_test_10.s: Likewise.
6926 * testsuite/Makefile.am: Wrap the cross linker tests and the
6927 common tests into NATIVE_OR_CROSS_LINKER.
6928 (check_SCRIPTS): Add script_test_10.sh.
6929 (check_DATA): Add script_test_10.stdout.
6930 (script_test_10.o, script_test_10): New targets.
6931 (script_test_10.stdout): New target.
6932 * configure, testsuite/Makefile.in: Regenerate.
6934 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6936 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6937 error for the deprecated relocations.
6938 (Target_arm::Scan::global): Likewise.
6939 (Target_arm::Relocate::relocate): Likewise.
6941 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6943 * fileread.cc (Input_file::find_file): Initialize *found_name
6944 and *namep when using the fallback search for case 4.
6946 2010-10-11 Cary Coutant <ccoutant@google.com>
6948 * options.h (class General_options): Redefine -z lazy as an alias for
6949 the negation of -z now.
6951 2010-10-11 Ian Lance Taylor <iant@google.com>
6953 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6956 2010-10-06 Nick Clifton <nickc@redhat.com>
6958 * script-sections.cc(class Memory_region): Remove
6959 current_lma_offset_ field. Rename current_vma_offset_ to
6960 current_offset_. Add last_section_ field.
6961 (Memory_region::get_current_vma_address): Rename to
6962 get_current_address.
6963 (Memory_region::get_current_lma_address): Delete.
6964 (Memory_region::increment_vma_offset): Rename to
6966 (Memory_region::increment_lma_offset): Delete.
6967 (Memory_region::attributes_compatible): New method. Returns
6968 true if the provided section is compatible with the region.
6969 (Memory_region::get_last_section): New method. Returns the last
6970 section to use the region.
6971 (Memory_region::set_last_section): New method. Stores the last
6972 section to use the region.
6973 (Script_sections::block_in_region): New method. Returns true if
6974 a block of memory is contained within a region.
6975 (Script_sections::find_memory_region): New method. Locates a
6976 memory region to be used to set a VMA or LMA address.
6977 (Output_section_definition::set_section_addresses): Add code to
6978 check for addresses set by memory regions.
6979 (Output_segment::set_section_addresses): Remove memory region
6981 (Script_sections::create_segment): Add a warning if a header
6982 segment is created outside of any region.
6983 * script-sections.h (class Script_sections): Add prototypes for
6984 find_memory_region and block_in_region methods.
6985 * testsuite/memory_test.s: Use .long instead of .word.
6986 * testsuite/memory_test.t: Add some more output sections.
6987 * testsuite/memory_test.sh: Update expected output.
6989 2010-10-02 Doug Kwan <dougkwan@google.com>
6991 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6992 defintion to symtab.h
6993 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6994 declaration to defintion.
6996 2010-10-01 Nick Clifton <nickc@redhat.com>
6998 * expression.cc (eval): Replace dummy argument with NULL.
6999 (eval_maybe_dot): Check for a NULL result section pointer.
7000 (Symbol_expression::value): Likewise.
7001 (Dot_expression::value): Likewise.
7002 (BINARY_EXPRESSION): Likewise.
7003 (Max_expression::value): Likewise.
7004 (Min_expression::value): Likewise.
7005 (Absolute_expression::value): Likewise.
7006 (Addr_expression::value_from_output_section): Likewise.
7007 (Loaddddr_expression::value_from_output_section): Likewise.
7008 (Segment_start_expression::value): Likewise.
7009 * script-sections.cc
7010 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7012 (Sections_elememt_dot_assignment::set_section_addresses):
7014 (Output_data_expression::do_write_to_buffer): Likewise.
7015 (Output_section_definition::finalize_symbols): Likewise.
7016 (Output_section_definition::set_section_addresses): Likewise.
7018 2010-09-30 Doug Kwan <dougkwan@google.com>
7020 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7022 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7024 * target.h (Target::can_icf_inline_merge_sections): New virtual
7026 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7028 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7030 * icf.cc (get_section_contents): Inline merge sections only when
7033 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7035 * configure: Regenerate.
7037 2010-09-17 Ian Lance Taylor <iant@google.com>
7039 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7040 * testsuite/Makefile.am (memory_test.o): New target.
7041 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7043 * testsuite/Makefile.in: Rebuild.
7045 2010-09-17 Doug Kwan <dougkwan@google.com>
7047 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7048 defintion if relocation uses GOT entries of the symbol.
7049 * testsuite/icf_safe_test.sh: Fix test.
7050 * testsuite/icf_safe_so_test.sh: Fix test.
7052 2010-09-16 Cary Coutant <ccoutant@google.com>
7054 * script_sections.cc (class Memory_region): Remove "NULL" from
7055 vector initializations.
7057 2010-09-15 Cary Coutant <ccoutant@google.com>
7059 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7060 Resolve forwarding symbols.
7062 2010-09-15 Doug Kwan <dougkwan@google.com>
7064 * gold/testsuite/script_test_3.t: Add ARM special sections.
7065 * gold/testsuite/script_test_4.t: Same.
7066 * gold/testsuite/script_test_5.t: Same.
7067 * gold/testsuite/script_test_6.t: Same.
7068 * gold/testsuite/script_test_7.t: Same.
7069 * gold/testsuite/script_test_7.t: Same.
7070 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7072 2010-09-14 Cary Coutant <ccoutant@google.com>
7074 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7075 (Target_x86_64::Relocate::relocate_tls): Replace check for
7076 saw_tls_block_reloc_ with test for executable section.
7078 2010-09-12 Cary Coutant <ccoutant@google.com>
7080 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7081 position-independent executables to shared libraries need dynamic
7083 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7084 position-independent executables.
7085 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7086 * testsuite/Makefile.in: Regenerate.
7088 2010-09-10 Nick Clifton <nickc@redhat.com>
7091 * testsuite/memory_test.t: Discard any sections that are not
7094 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7097 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7098 "This::" to work around a bug in gcc 4.2.
7100 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7102 2010-09-09 Rafael Espindola <espindola@google.com>
7104 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7105 sections with different PF_X flags in the same segment.
7106 (Layout::find_first_load_seg): Search all segments to find the first
7108 * options.h (rosegment): New.
7110 2010-09-08 Rafael Espindola <espindola@google.com>
7112 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7114 2010-09-08 Doug Kwan <dougkwan@google.com>
7116 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7117 (Arm_relobj::do_relocate_sections): Add new parameter for output
7118 file to match the parent.
7119 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7120 of local symbols instead of input values. Update code to track
7121 changes in gold::relocate_section.
7122 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7123 (Sized_relobj::compute_final_local_value_internal): New methods.
7124 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7125 body into private version of Sized_relobj::compute_final_local_value.
7126 Call the inline method.
7127 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7128 merged symbol value if there is one.
7129 (Symbol_value::has_output_value): New method defintiion.
7130 (Sized_relobj::Compute_final_local_value_status): New enum type.
7131 (Sized_relobj::compute_final_local_value): New methods.
7132 (Sized_relobj::compute_final_local_value_internal): New methods.
7133 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7134 and arm_cortex_a8.sh.
7135 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7136 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7138 * Makefile.in: Regenerate.
7139 * testsuite/arm_bl_out_of_range.s: Update test.
7140 * testsuite/thumb_bl_out_of_range.s: Ditto.
7141 * testsuite/thumb_blx_out_of_range.s: Ditto.
7142 * testsuite/arm_branch_out_of_range.sh: New file.
7143 * testsuite/arm_cortex_a8.sh: Ditto.
7144 * testsuite/arm_cortex_a8_b.s: Ditto.
7145 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7146 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7147 * testsuite/arm_cortex_a8_bl.s: Ditto.
7148 * testsuite/arm_cortex_a8_blx.s: Ditto.
7149 * testsuite/arm_cortex_a8_local.s: Ditto.
7150 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7151 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7153 2010-09-08 Rafael Espindola <espindola@google.com>
7155 * Makefile.am (memory_test.stdout): Run readelf with -W.
7156 * Makefile.in: Regenerate.
7157 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7160 2010-09-08 Rafael Espindola <espindola@google.com>
7162 * script-sections.cc (Script_sections::add_memory_region): Convert
7163 field precision to int.
7164 * script.cc (script_set_section_region, script_set_section_region):
7165 Convert field precision to int.
7167 2010-09-08 Rafael Espindola <espindola@google.com>
7169 * arm.cc (do_finalize_sections): Create the __exidx_start and
7170 __exdix_end symbols even when the section is missing.
7172 2010-09-08 Nick Clifton <nickc@redhat.com>
7174 * README: Remove claim that MEMORY is not supported.
7175 * expression.cc (script_exp_function_origin)
7176 (script_exp_function_length): Move from here to ...
7177 * script.cc: ... here.
7178 (script_set_section_region, script_add_memory)
7179 (script_parse_memory_attr, script_include_directive): New
7181 * script-sections.cc
7182 (class Memory_region): New class.
7183 (class Output_section_definition): Add set_memory_region,
7184 set_section_vma, set_section_lma and get_section_name methods.
7185 (class Script_Sections): Add add_memory_region,
7186 find_memory_region, find_memory_region_origin,
7187 find_memory_region_length and set_memory_region methods.
7188 Have set_section_addresses method walk the list of set memory
7190 Extend the print methos to display memory regions.
7191 * script-sections.h: Add prototypes for new methods.
7192 Add enum for MEMORY region attributes.
7193 * yyscript.y: Add support for parsing MEMORY regions.
7194 * script-c.h: Add prototypes for new functions.
7195 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7196 * testsuite/Makefile.in: Regenerate.
7197 * testsuite/memory_test.sh: New script.
7198 * testsuite/memory_test.s: New assembler source file.
7199 * testsuite/memory_test.t: New linker script.
7201 2010-08-27 Doug Kwan <dougkwan@google.com>
7203 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7204 reference override an existing dynamic weak reference.
7205 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7206 * testsuite/Makefile.in: Regenerate.
7207 * testsuite/dyn_weak_ref.sh: New file.
7208 * testsuite/dyn_weak_ref_1.c: Ditto.
7209 * testsuite/dyn_weak_ref_2.c: Ditto.
7211 2010-08-27 Ian Lance Taylor <iant@google.com>
7213 * incremental.h (class Incremental_input_entry): Add virtual
7216 2010-08-27 Ian Lance Taylor <iant@google.com>
7218 * testsuite/start_lib_test_3.c: Mark t3 as used.
7220 2010-08-27 Nick Clifton <nickc@redhat.com>
7222 * options.cc (version_script): Fix small typo in previous
7225 2010-08-25 Nick Clifton <nickc@redhat.com>
7227 * archive.cc: Formatting fixes: Remove whitespace between
7228 typename and following asterisk. Remove whitespace between
7229 function name and opening parenthesis.
7230 * archive.h: Likewise.
7232 * attributes.cc: Likewise.
7233 * attributes.h: Likewise.
7234 * common.cc: Likewise.
7235 * copy-relocs.cc: Likewise.
7236 * dirsearch.h: Likewise.
7237 * dynobj.cc: Likewise.
7238 * ehframe.cc: Likewise.
7239 * ehframe.h: Likewise.
7240 * expression.cc: Likewise.
7241 * fileread.cc: Likewise.
7242 * fileread.h: Likewise.
7244 * gold-threads.cc: Likewise.
7245 * gold.cc: Likewise.
7246 * i386.cc: Likewise.
7248 * incremental-dump.cc: Likewise.
7249 * incremental.cc: Likewise.
7250 * layout.cc: Likewise.
7251 * layout.h: Likewise.
7252 * main.cc: Likewise.
7253 * merge.cc: Likewise.
7254 * merge.h: Likewise.
7255 * object.cc: Likewise.
7256 * object.h: Likewise.
7257 * options.cc: Likewise.
7258 * options.h: Likewise.
7259 * output.cc: Likewise.
7260 * output.h: Likewise.
7261 * plugin.cc: Likewise.
7262 * plugin.h: Likewise.
7263 * powerpc.cc: Likewise.
7264 * reloc.cc: Likewise.
7265 * script-c.h: Likewise.
7266 * script-sections.cc: Likewise.
7267 * script.cc: Likewise.
7268 * stringpool.cc: Likewise.
7269 * symtab.cc: Likewise.
7270 * symtab.h: Likewise.
7271 * target.cc: Likewise.
7272 * timer.cc: Likewise.
7273 * timer.h: Likewise.
7274 * version.cc: Likewise.
7275 * x86_64.cc: Likewise.
7277 2010-08-24 Nick Clifton <nickc@redhat.com>
7280 * layout.cc (segment_precedes): Sort segments by their physical
7281 addresses, if they have been set.
7283 2010-08-23 Cary Coutant <ccoutant@google.com>
7285 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7287 (Lib_group::include_member): Unlock object after deleting its
7289 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7292 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7293 Cary Coutant <ccoutant@google.com>
7295 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7296 constructor, and set_blocker.
7297 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7299 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7300 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7301 * testsuite/Makefile.am (start_lib_test): New test case.
7302 * testsuite/Makefile.in: Regenerate.
7303 * testsuite/start_lib_test_main.c: New file.
7304 * testsuite/start_lib_test_1.c: New file.
7305 * testsuite/start_lib_test_2.c: New file.
7306 * testsuite/start_lib_test_3.c: New file.
7308 2010-08-19 Ian Lance Taylor <iant@google.com>
7310 * Makefile.in: Rebuild with automake 1.11.1.
7311 * aclocal.m4: Likewise.
7312 * testsuite/Makefile.in: Likewise.
7314 2010-08-19 Ian Lance Taylor <iant@google.com>
7317 * i386.cc (class Output_data_plt_i386): Update declarations.
7318 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7319 local_ifuncs_ fields.
7320 (Target_i386::do_plt_section_for_global): New function.
7321 (Target_i386::do_plt_section_for_local): New function.
7322 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7323 parameter; change all callers. Initialize global_ifuncs_ and
7324 local_ifuncs_. If doing a static link define __rel_iplt_start and
7326 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7327 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7328 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7330 (Target_i386::make_plt_section): New function, broken out of
7331 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7332 (Target_i386::make_plt_entry): Call make_plt_section.
7333 (Target_i386::make_local_ifunc_plt_entry): New function.
7334 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7335 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7336 R_386_IRELATIVE to switch.
7337 (Target_i386::Scan::global): Likewise.
7338 (Target_i386::Relocate::relocate): Likewise.
7339 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7341 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7342 (Target_x86_64::do_plt_section_for_global): New function.
7343 (Target_x86_64::do_plt_section_for_local): New function.
7344 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7345 parameter; change all callers. If doing a static link define
7346 __rela_iplt_start and __rela_iplt_end.
7347 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7348 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7349 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7351 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7352 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7354 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7355 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7356 R_X86_64_IRELATIVE to switch.
7357 (Target_x86_64::Scan::global): Likewise.
7358 (Target_x86_64::Relocate::relocate): Likewise.
7359 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7361 * target.h (class Target): Add plt_section_for_global and
7362 plt_section_for_local functions. Add do_plt_section_for_global
7363 and do_plt_section_for_local virtual functions.
7364 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7365 clarifying comments.
7366 (Symbol::use_plt_offset): Handle IFUNC symbol.
7367 * object.cc (Sized_relobj::Sized_relobj): Initialize
7369 (Sized_relobj::local_has_plt_offset): New function.
7370 (Sized_relobj::local_plt_offset): New function.
7371 (Sized_relobj::set_local_plt_offset): New function.
7372 (Sized_relobj::do_count): Handle IFUNC symbol.
7373 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7374 a bit away from input_shndx_ field. Add set_is_func_symbol and
7375 is_ifunc_symbol functions.
7376 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7377 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7378 local_plt_offsets_ field.
7379 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7380 * output.h (class Output_section_data): Add non-const
7381 output_section function.
7382 (class Output_data_got): Update declarations.
7383 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7384 Add use_plt_offset parameter to global and local constructors.
7385 Change all callers. Change local_sym_index_ field to 31 bits.
7386 Change GSYM_CODE and CONSTANT_CODE accordingly.
7387 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7388 doing a static link don't set sh_link field.
7389 (Output_data_got::Got_entry::write): Use PLT offset if
7391 (Output_data_got::add_global_plt): New function.
7392 (Output_data_got::add_local_plt): New function.
7393 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7394 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7395 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7396 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7397 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7399 * testsuite/ifunc-sel.h: New file.
7400 * testsuite/ifuncmain1.c: New file.
7401 * testsuite/ifuncmain1vis.c: New file.
7402 * testsuite/ifuncmod1.c: New file.
7403 * testsuite/ifuncdep2.c: New file.
7404 * testsuite/ifuncmain2.c: New file.
7405 * testsuite/ifuncmain3.c: New file.
7406 * testsuite/ifuncmod3.c: New file.
7407 * testsuite/ifuncmain4.c: New file.
7408 * testsuite/ifuncmain5.c: New file.
7409 * testsuite/ifuncmod5.c: New file.
7410 * testsuite/ifuncmain6pie.c: New file.
7411 * testsuite/ifuncmod6.c: New file.
7412 * testsuite/ifuncmain7.c: New file.
7413 * configure, testsuite/Makefile.in: Rebuild.
7415 2010-08-18 Ian Lance Taylor <iant@google.com>
7418 (Output_section_incremental_inputs::write_input_files): Add cast
7419 to avoid signed/unsigned comparison warning.
7420 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7422 2010-08-12 Cary Coutant <ccoutant@google.com>
7424 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7426 2010-08-13 Ian Lance Taylor <iant@google.com>
7428 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7430 2010-08-12 Cary Coutant <ccoutant@google.com>
7431 Doug Kwan <dougkwan@google.com>
7433 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7434 defintion overrides non-weak undef, remember that the original undef
7436 * symtab.cc (Symbol_table::sized_write_global): For undef without
7437 an original weak binding, set binding to global in output.
7438 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7439 * testsuite/Makefile.in: Regenerate.
7440 * testsuite/strong_ref_weak_def.sh: New file.
7441 * testsuite/strong_ref_weak_def_1.c: Ditto.
7442 * testsuite/strong_ref_weak_def_2.c: Ditto.
7444 2010-08-12 Cary Coutant <ccoutant@google.com>
7446 * testsuite/incremental_test.sh: Rewrite.
7447 * testsuite/incremental_test_1.c: Rewrite.
7448 * testsuite/incremental_test_2.c: Rewrite.
7450 2010-08-12 Cary Coutant <ccoutant@google.com>
7452 * arm.cc (Target_arm::got_size): Add const.
7453 (Target_arm::got_entry_count): New function.
7454 (Target_arm::plt_entry_count): New function.
7455 (Target_arm::first_plt_entry_offset): New function.
7456 (Target_arm::plt_entry_size): New function.
7457 (Output_data_plt_arm::entry_count): New function.
7458 (Output_data_plt_arm::first_plt_entry_offset): New function.
7459 (Output_data_plt_arm::get_plt_entry_size): New function.
7460 * i386.cc (Target_i386::got_size): Add const.
7461 (Target_i386::got_entry_count): New function.
7462 (Target_i386::plt_entry_count): New function.
7463 (Target_i386::first_plt_entry_offset): New function.
7464 (Target_i386::plt_entry_size): New function.
7465 (Output_data_plt_i386::entry_count): New function.
7466 (Output_data_plt_i386::first_plt_entry_offset): New function.
7467 (Output_data_plt_i386::get_plt_entry_size): New function.
7468 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7469 find_incremental_inputs_sections. Dump incremental_got_plt section.
7470 * incremental.cc: Include target.h.
7471 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7472 parameter. Adjust all callers. Find incremental_got_plt section.
7473 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7475 (Output_section_incremental_inputs::set_final_data_size): Calculate
7476 size of incremental_got_plt section.
7477 (Output_section_incremental_inputs::do_write): Write the
7478 incremental_got_plt section.
7479 (Got_plt_view_info): New struct.
7480 (Local_got_offset_visitor): New class.
7481 (Global_got_offset_visitor): New class.
7482 (Global_symbol_visitor_got_plt): New class.
7483 (Output_section_incremental_inputs::write_got_plt): New function.
7484 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7485 Add parameter. Adjust all callers.
7486 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7487 (Incremental_inputs::got_plt_section): New function.
7488 (Incremental_inputs::got_plt_section_): New data member.
7489 (Incremental_got_plt_reader): New class.
7490 * layout.cc (Layout::create_incremental_info_sections): Add the
7491 incremental_got_plt section.
7492 * object.h (Got_offset_list::get_list): New function.
7493 (Got offset_list::for_all_got_offsets): New function.
7494 (Sized_relobj::local_got_offset_list): New function.
7495 * powerpc.cc (Target_powerpc::got_size): Add const.
7496 (Target_powerpc::got_entry_count): New function.
7497 (Target_powerpc::plt_entry_count): New function.
7498 (Target_powerpc::first_plt_entry_offset): New function.
7499 (Target_powerpc::plt_entry_size): New function.
7500 (Output_data_plt_powerpc::entry_count): New function.
7501 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7502 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7503 * sparc.cc (Target_sparc::got_size): Add const.
7504 (Target_sparc::got_entry_count): New function.
7505 (Target_sparc::plt_entry_count): New function.
7506 (Target_sparc::first_plt_entry_offset): New function.
7507 (Target_sparc::plt_entry_size): New function.
7508 (Output_data_plt_sparc::entry_count): New function.
7509 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7510 (Output_data_plt_sparc::get_plt_entry_size): New function.
7511 * symtab.h (Symbol::got_offset_list): New function.
7512 (Symbol_table::for_all_symbols): New function.
7513 * target.h (Sized_target::got_entry_count): New function.
7514 (Sized_target::plt_entry_count): New function.
7515 (Sized_target::plt_entry_size): New function.
7516 * x86_64.cc (Target_x86_64::got_size): Add const.
7517 (Target_x86_64::got_entry_count): New function.
7518 (Target_x86_64::plt_entry_count): New function.
7519 (Target_x86_64::first_plt_entry_offset): New function.
7520 (Target_x86_64::plt_entry_size): New function.
7521 (Output_data_plt_x86_64::entry_count): New function.
7522 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7523 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7525 2010-08-12 Cary Coutant <ccoutant@google.com>
7527 * archive.cc: Include incremental.h.
7528 (Archive::Archive): Initialize incremental_info_.
7529 (Archive::include_member): Record archive members in incremental info.
7530 (Add_archive_symbols::run): Record begin and end of an archive in
7532 (Lib_group::include_member): Record objects in incremental info.
7533 * archive.h (Incremental_archive_entry): Forward declaration.
7534 (Archive::set_incremental_info): New member function.
7535 (Archive::incremental_info): New member function.
7536 (Archive::Unused_symbol_iterator): New class.
7537 (Archive::unused_symbols_begin): New member function.
7538 (Archive::unused_symbols_end): New member function.
7539 (Archive::incremental_info_): New data member.
7540 * incremental-dump.cc (find_input_containing_global): New function.
7541 (dump_incremental_inputs): Dump new incremental info sections.
7542 * incremental.cc: Include symtab.h.
7543 (Output_section_incremental_inputs): New class.
7544 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7545 new incremental info sections.
7546 (Sized_incremental_binary::do_check_inputs): Likewise.
7547 (Incremental_inputs::report_archive): Remove.
7548 (Incremental_inputs::report_archive_begin): New function.
7549 (Incremental_inputs::report_archive_end): New function.
7550 (Incremental_inputs::report_object): New function.
7551 (Incremental_inputs::finalize_inputs): Remove.
7552 (Incremental_inputs::report_input_section): New function.
7553 (Incremental_inputs::report_script): Rewrite.
7554 (Incremental_inputs::finalize): Do nothing but finalize string table.
7555 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7556 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7557 (Incremental_inputs::create_data_sections): New function.
7558 (Incremental_inputs::relocs_entsize): New function.
7559 (Output_section_incremental_inputs::set_final_data_size): New function.
7560 (Output_section_incremental_inputs::do_write): New function.
7561 (Output_section_incremental_inputs::write_header): New function.
7562 (Output_section_incremental_inputs::write_input_files): New function.
7563 (Output_section_incremental_inputs::write_info_blocks): New function.
7564 (Output_section_incremental_inputs::write_symtab): New function.
7565 * incremental.h (Incremental_script_entry): Forward declaration.
7566 (Incremental_object_entry): Forward declaration.
7567 (Incremental_archive_entry): Forward declaration.
7568 (Incremental_inputs): Forward declaration.
7569 (Incremental_inputs_header_data): Remove.
7570 (Incremental_inputs_header): Remove.
7571 (Incremental_inputs_header_write): Remove.
7572 (Incremental_inputs_entry_data): Remove.
7573 (Incremental_inputs_entry): Remove.
7574 (Incremental_inputs_entry_write): Remove.
7575 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7576 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7577 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7578 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7580 (Incremental_input_entry): New class.
7581 (Incremental_script_entry): New class.
7582 (Incremental_object_entry): New class.
7583 (Incremental_archive_entry): New class.
7584 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7585 (Incremental_inputs::report_inputs): Remove.
7586 (Incremental_inputs::report_archive): Remove.
7587 (Incremental_inputs::report_archive_begin): New function.
7588 (Incremental_inputs::report_archive_end): New function.
7589 (Incremental_inputs::report_object): Change prototype.
7590 (Incremental_inputs::report_input_section): New function.
7591 (Incremental_inputs::report_script): Change prototype.
7592 (Incremental_inputs::get_reloc_count): New function.
7593 (Incremental_inputs::set_reloc_count): New function.
7594 (Incremental_inputs::create_data_sections): New function.
7595 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7596 (Incremental_inputs::inputs_section): New function.
7597 (Incremental_inputs::symtab_section): New function.
7598 (Incremental_inputs::relocs_section): New function.
7599 (Incremental_inputs::get_stringpool): Add const.
7600 (Incremental_inputs::command_line): Add const.
7601 (Incremental_inputs::inputs): Remove.
7602 (Incremental_inputs::command_line_key): New function.
7603 (Incremental_inputs::input_file_count): New function.
7604 (Incremental_inputs::input_files): New function.
7605 (Incremental_inputs::relocs_entsize): New function.
7606 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7607 (Incremental_inputs::finalize_inputs): Remove.
7608 (Incremental_inputs::Input_info): Remove.
7609 (Incremental_inputs::lock_): Remove.
7610 (Incremental_inputs::inputs_): Change type.
7611 (Incremental_inputs::inputs_map_): Remove.
7612 (Incremental_inputs::current_object_entry_): New data member.
7613 (Incremental_inputs::inputs_section_): New data member.
7614 (Incremental_inputs::symtab_section_): New data member.
7615 (Incremental_inputs::relocs_section_): New data member.
7616 (Incremental_inputs::reloc_count_): New data member.
7617 (Incremental_inputs_reader): New class.
7618 (Incremental_symtab_reader): New class.
7619 (Incremental_relocs_reader): New class.
7620 * layout.cc (Layout::finalize): Move finalization of incremental info
7621 and creation of incremental info sections to follow finalization of
7622 symbol table. Set offsets for postprocessing sections.
7623 (Layout::create_incremental_info_sections): Call
7624 Incremental_inputs::create_data_sections. Add incremental symtab
7625 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7626 sections to layout after input sections.
7627 * layout.h (struct Timespec): Forward declaration.
7628 (Layout::incremental_inputs): Add const.
7629 (Layout::create_incremental_info_sections): Add parameter.
7630 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7631 * object.cc: Include incremental.h.
7632 (Relobj::finalize_incremental_relocs): New function.
7633 (Sized_relobj::do_layout): Record input sections in incremental info.
7634 * object.h (Object::output_section): New function.
7635 (Object::output_section_offset): Moved from Relobj.
7636 (Object::get_incremental_reloc_base): New function.
7637 (Object::get_incremental_reloc_count): New function.
7638 (Object::do_output_section): New function.
7639 (Object::do_output_section_offset): Moved from Relobj.
7640 (Object::do_get_incremental_reloc_base): New function.
7641 (Object::do_get_incremental_reloc_count): New function.
7642 (Object::Object): Initialize new data members.
7643 (Relobj::output_section): Renamed do_output_section and moved to
7645 (Relobj::output_section_offset): Moved to Object.
7646 (Relobj::do_get_incremental_reloc_base): New function.
7647 (Relobj::do_get_incremental_reloc_count): New function.
7648 (Relobj::allocate_incremental_reloc_counts): New function.
7649 (Relobj::count_incremental_reloc): New function.
7650 (Relobj::finalize_incremental_relocs): New function.
7651 (Relobj::next_incremental_reloc_index): New function.
7652 (Relobj::reloc_counts_): New data member.
7653 (Relobj::reloc_bases_): New data member.
7654 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7655 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7656 (Sized_relobj::incremental_relocs_scan): New function.
7657 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7658 (Sized_relobj::incremental_relocs_write): New function.
7659 (Sized_relobj::incremental_relocs_write_reltype): New function.
7660 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7662 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7663 archives and object files elsewhere.
7664 (Add_symbols::run): Report object files here.
7665 (Finish_group::run): Report end of archive at end of group.
7666 * reloc.cc: Include layout.h, incremental.h.
7667 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7668 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7669 (Sized_relobj::incremental_relocs_scan): New function.
7670 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7671 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7672 (Sized_relobj::incremental_relocs_write): New function.
7673 (Sized_relobj::incremental_relocs_write_reltype): New function.
7674 * script.cc (read_input_script): Rewrite test for incremental link.
7675 Change call to Incremental_inputs::report_script.
7676 * symtab.h (Symbol_table::first_global_index): New function.
7677 (Symbol_table::output_count): New function.
7679 2010-08-12 Doug Kwan <dougkwan@google.com>
7681 * arm.cc (Target_arm::merge_object_attributes): Check command line
7682 options --no-wchar-size-warning and --no-enum-size-warning.
7683 * options.h (General_options): Add ld-compatible options
7684 --no-enum-size-warning and --no-wchar-size-warning.
7686 2010-08-04 Ian Lance Taylor <iant@google.com>
7688 * x86_64.cc (Target_x86_64::Scan::local): Use
7689 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7690 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7691 (Target_x86_64::Scan::global): Likewise.
7692 (Target_x86_64::Relocate::relocate): Likewise.
7693 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7696 2010-08-03 Cary Coutant <ccoutant@google.com>
7698 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7699 to reserve space in merged_strings vector. Keep total input size
7701 (Output_merge_string::do_print_merge_stats): Print total input size.
7702 * merge.h (Output_merge_string): Add input_size_ field.
7703 * stringpool.cc (Stringpool_template::string_length): Move
7704 implementations out of Stringpool_template class and place in
7706 * stringpool.h (string_length): Move out of Stringpool_template.
7708 2010-08-03 Ian Lance Taylor <iant@google.com>
7711 * layout.cc (relaxation_loop_body): If address of load segment is
7712 set, adjust address to include headers if possible.
7714 2010-08-03 Ian Lance Taylor <iant@google.com>
7716 * version.cc (version_string): Bump to 1.10.
7718 2010-08-03 Ian Lance Taylor <iant@google.com>
7721 * layout.h (enum Output_section_order): Define.
7722 (class Layout): Update declarations.
7723 * layout.cc (Layout::get_output_section): Add order parameter.
7724 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7725 is_first_non_relro parameters. Change all callers.
7726 (Layout::choose_output_section): Likewise.
7727 (Layout::add_output_section_data): Likewise.
7728 (Layout::make_output_section): Likewise. Set order.
7729 (Layout::default_section_order): New function.
7730 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7731 * output.cc (Output_section::Output_section): Initialize order_.
7732 Don't initialize deleted fields.
7733 (Output_segment::Output_segment): Don't initialize deleted
7735 (Output_segment::add_output_section_to_load): New function
7736 replacing add_output_section. Change all callers to call this or
7737 add_output_section_to_nonload.
7738 (Output_segment::add_output_section_to_nonload): New function.
7739 (Output_segment::remove_output_section): Rewrite.
7740 (Output_segment::add_initial_output_data): Likewise.
7741 (Output_segment::has_any_data_sections): Likewise.
7742 (Output_segment::is_first_section_relro): Likewise.
7743 (Output_segment::maximum_alignment): Likewise.
7744 (Output_segment::has_dynamic_reloc): New function replacing
7745 dynamic_reloc_count. Change all callers.
7746 (Output_segment::has_dynamic_reloc_list): New function replacing
7747 dynamic_reloc_count_list. Change all callers.
7748 (Output_segment::set_section_addresses): Rewrite.
7749 (Output_segment::set_offset): Rewrite.
7750 (Output_segment::find_first_and_last_list): Remove.
7751 (Output_segment::set_tls_offsets): Rewrite.
7752 (Output_segment::first_section_load_address): Likewise.
7753 (Output_segment::output_section_count): Likewise.
7754 (Output_segment::section_with_lowest_load_address): Likewise.
7755 (Output_segment::write_section_headers): Likewise.
7756 (Output_segment::print_sections_to_map): Likewise.
7757 * output.h (class Output_data): Remove dynamic_reloc_count_
7758 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7759 (Output_data::add_dynamic_reloc): Rewrite.
7760 (Output_data::has_dynamic_reloc): New function.
7761 (Output_data::dynamic_reloc_count): Remove.
7762 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7763 is_last_relro_, is_first_non_relro_, is_interp_,
7764 is_dynamic_linker_section_ fields. Add order and set_order
7765 functions. Remove is_relro_local, set_is_relro_local,
7766 is_last_relro, set_is_last_relro, is_first_non_relro,
7767 set_is_first_non_relro functions, is_interp, set_is_interp,
7768 is_dynamic_linker_section, and set_is_dynamic_linker_section
7770 (class Output_segment): Change Output_data_list from std::list to
7771 std:;vector. Add output_lists_ field. Remove output_data_ and
7772 output_bss_ fields. Update declarations.
7774 2010-08-02 Ian Lance Taylor <iant@google.com>
7776 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7777 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7778 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7780 2010-08-02 Ian Lance Taylor <iant@google.com>
7783 * script.cc (Script_options::Script_options): Initialize
7784 symbol_definitions_ and symbol_references_.
7785 (Script_options::add_symbol_assignment): Update
7786 symbol_definitions_ and symbol_references_.
7787 (Script_options::add_symbol_reference): New function.
7788 (script_symbol): New function.
7789 * script.h (class Script_options): Add symbol_definitions_ and
7790 symbol_references_ fields.
7791 (Script_options::referenced_const_iterator): New type.
7792 (Script_options::referenced_begin): New function.
7793 (Script_options::referenced_end): New function.
7794 (Script_options::is_referenced): New function.
7795 (Script_options::any_unreferenced): New function.
7796 * script-c.h (script_symbol): Declare.
7797 * yyscript.y (exp): Call script_symbol.
7798 * symtab.cc: Include "script.h".
7799 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7800 Change all callers. Check symbols referenced by scripts.
7801 (Symbol_table::add_undefined_symbols_from_command_line): Add
7802 layout parameter. Change all callers.
7803 (Symbol_table::do_add_undefined_symbols_from_command_line):
7804 Likewise. Break out loop body. Check symbols referenced by
7806 (Symbol_table::add_undefined_symbol_from_command_line): New
7807 function broken out of
7808 do_add_undefined_symbols_from_command_line.
7809 * symtab.h (class Symbol_table): Update declarations.
7810 * archive.cc: Include "layout.h".
7811 (Archive::should_include_member): Add layout parameter. Change
7812 all callers. Check for symbol mentioned in expression.
7813 * archive.h (class Archive): Update declaration.
7814 * object.cc (Sized_relobj::do_should_include_member): Add layout
7816 * object.h (Object::should_include_member): Add layout parameter.
7818 (Object::do_should_include_member): Add layout parameter.
7819 (class Sized_relobj): Update declaration.
7820 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7822 * dynobj.h (class Sized_dynobj): Update declaration.
7823 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7825 * plugin.h (class Sized_pluginobj): Update declaration.
7827 2010-08-02 Ian Lance Taylor <iant@google.com>
7830 * output.cc (Output_segment::set_offset): Search for the first and
7831 last sections rather than assuming that the list is in order.
7832 (Output_segment::find_first_and_last_list): New function.
7833 * output.h (class Output_segment): Update declarations.
7834 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7835 (relro_strip_test_SOURCES): New variable.
7836 (relro_strip_test_DEPENDENCIES): New variable.
7837 (relro_strip_test_LDFLAGS): New variable.
7838 (relro_strip_test_LDADD): New variable.
7839 (relro_strip_test.so): New target.
7841 2010-08-02 Ian Lance Taylor <iant@google.com>
7843 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7844 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7845 (Target_i386::got_tlsdesc_section): New function.
7846 (Target_i386::got_section): Create space for GOT entries for
7847 TLSDESC relocations.
7848 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7850 (Target_i386::Scan::global): Likewise.
7851 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7853 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7854 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7855 (Target_x86_64::got_tlsdesc_section): New function.
7856 (Target_x86_64::got_section): Create space for GOT entries for
7857 TLSDESC relocations.
7858 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7860 (Target_x86_64::Scan::global): Likewise.
7861 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7864 2010-08-02 Ian Lance Taylor <iant@google.com>
7866 * testsuite/final_layout.sh: Use dc to convert from hex to
7869 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7871 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7872 paramter to the call to gold::gc_process_relocs.
7873 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7874 paramter to the call to gold::gc_process_relocs.
7875 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7876 parameter to the call to gold::gc_process_relocs.
7877 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7878 template parameter to the call to gold::gc_process_relocs.
7879 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7880 paramter to the call to gold::gc_process_relocs.
7881 * gc.h (get_embedded_addend_size): New function.
7882 (gc_process_relocs): Save the size of the reloc for use by ICF.
7883 * icf.cc (get_section_contents): Get the addend from the text section
7884 for SHT_REL relocation sections.
7885 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7886 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7887 * int_encoding.h (read_from_pointer): New overloaded function.
7888 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7889 * testsuite/icf_sht_rel_addend_test.sh: New file.
7890 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7891 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7893 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7895 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7896 * Makefile.in: Regenerate.
7897 * testsuite/Makefile.in: Regenerate.
7899 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7901 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7902 * gold/testsuite/debug_msg.cc: Likewise.
7903 * gold/testsuite/odr_violation1.cc
7904 * gold/testsuite/odr_violation2.cc
7906 2010-07-21 Cary Coutant <ccoutant@google.com>
7908 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7909 string, and length fields.
7910 (Output_merge_string::Merged_strings_list): New type.
7911 (Output_merge_string::Merged_strings_lists): New typedef.
7912 (Output_merge_string): Replace merged_strings_ with
7913 merged_strings_lists_.
7914 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7915 Merged_strings_list per input object and section. Don't store pointer
7916 to the string. Don't store length with each merged string entry.
7917 (Output_merge_string::finalize_merged_data): Loop over list of merged
7918 strings lists. Recompute length of each merged string.
7920 2010-07-15 Cary Coutant <ccoutant@google.com>
7922 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7925 2010-07-14 Ian Lance Taylor <iant@google.com>
7927 * descriptors.cc (Descriptors::open): Report correct name in error
7930 2010-07-13 Doug Kwan <dougkwan@google.com>
7932 * arm.cc (Arm_input_section::Arm_input_section): For a
7933 SHT_ARM_EXIDX section, always keeps the input sections.
7934 (Arm_input_section::set_exidx_section_link): New method.
7935 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7936 has_errors_ to false.
7937 (Arm_exidx_input_section::has_errors,
7938 Arm_exidx_input_section::set_has_errors): New methods.
7939 (Arm_exidx_input_section::has_errors_): New data member.
7940 (Arm_relobj::get_exidx_shndx_list): New method.
7941 (Arm_output_section::append_text_sections_to_list): Do not skip
7942 section without SHF_EXECINSTR.
7943 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7945 (Arm_relobj::make_exidx_input_section): Add new parameter for text
7946 section header. Make error messages more verbose. Check for
7947 a non-executable section linked to an EXIDX section.
7948 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7949 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7950 check that there is no deferred EXIDX section if we exit early.
7951 Instead of not making an EXIDX section in case of an error, make one
7952 and set the has_errors flag of it.
7953 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7954 in a relocatable link.
7955 (Target_arm::do_relax): Look for the EXIDX output section instead of
7956 assuming that it is called .ARM.exidx.
7957 (Target_arm::fix_exidx_coverage): Add a new parameter for input
7958 section list. Do not check for SHF_EXECINSTR section flags but
7959 skip any input section with errors.
7960 * output.cc (Output_section::Output_section): Initialize
7961 always_keeps_input_sections_ to false.
7962 (Output_section::add_input_section): Check for
7963 always_keeps_input_sections_.
7964 * output.h (Output_section::always_keeps_input_sections,
7965 Output_section::set_always_keeps_input_sections): New methods.
7966 (Output_section::always_keeps_input_sections): New data member.
7968 2010-07-13 Rafael Espindola <espindola@google.com>
7970 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7971 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7973 2010-07-13 Philip Herron <herron.philip@googlemail.com>
7974 Ian Lance Taylor <iant@google.com>
7976 * output.h (Output_section_lookup_maps::add_merge_section):
7977 Correct check of whether value was inserted.
7978 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7979 (Output_section_lookup_maps::add_relaxed_input_section):
7981 * arm.cc (Target_arm::got_section): Remove used local os.
7982 * i386.cc (Target_i386::got_section): Likewise.
7983 * x86_64.cc (Target_x86_64::got_section): Likewise.
7984 * sparc.cc (Target_sparc::got_section): Likewise.
7985 (Target_sparc::relocate): Remove unused local have_got_offset.
7986 * powerpc.cc (Target_powerpc::relocate): Likewise.
7988 2010-07-13 Ian Lance Taylor <iant@google.com>
7990 * compressed_output.cc (zlib_decompress): Fix signature in
7993 * archive.cc (Archive::include_member): Unlock an external member
7994 of a thin archive. Don't bother to delete an object we know is
7997 2010-07-12 Cary Coutant <ccoutant@google.com>
7999 * compressed_output.cc (zlib_decompress): New function.
8000 (get_uncompressed_size): New function.
8001 (decompress_input_section): New function.
8002 * compressed_output.h (get_uncompressed_size): New function.
8003 (decompress_input_section): New function.
8004 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8005 Handle compressed debug sections.
8006 * layout.cc (is_compressed_debug_section): New function.
8007 (Layout::output_section_name): Map compressed section names to
8009 * layout.h (is_compressed_debug_section): New function.
8010 (is_debug_info_section): Recognize compressed debug sections.
8011 * merge.cc: Include compressed_output.h.
8012 (Output_merge_data::do_add_input_section): Handle compressed
8014 (Output_merge_string::do_add_input_section): Handle compressed
8016 * object.cc: Include compressed_output.h.
8017 (Sized_relobj::Sized_relobj): Initialize new data members.
8018 (build_compressed_section_map): New function.
8019 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8020 * object.h (Object::section_is_compressed): New method.
8021 (Object::do_section_is_compressed): New method.
8022 (Sized_relobj::Compressed_section_map): New type.
8023 (Sized_relobj::do_section_is_compressed): New method.
8024 (Sized_relobj::compressed_sections_): New data member.
8025 * output.cc (Output_section::add_input_section): Handle compressed
8027 * reloc.cc: Include compressed_output.h.
8028 (Sized_relobj::write_sections): Handle compressed debug sections.
8030 2010-07-08 Cary Coutant <ccoutant@google.com>
8032 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8033 weak when resolving to a dynamic def.
8034 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8035 for weak undef/dynamic def cases. Adjust callers.
8036 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8037 undef_binding_weak_.
8038 (Symbol_table::sized_write_globals): Adjust symbol binding.
8039 (Symbol_table::sized_write_symbol): Add binding parameter.
8040 * symtab.h (Symbol::set_undef_binding): New method.
8041 (Symbol::is_undef_binding_weak): New method.
8042 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8043 (Symbol_table::should_override): Add new parameter.
8044 (Symbol_table::sized_write_symbol): Add new parameter.
8046 * testsuite/weak_undef_file1.cc: Add new test case.
8047 * testsuite/weak_undef_file2.cc: Fix header comment.
8048 * testsuite/weak_undef_test.cc: Add new test case.
8050 2010-06-29 Doug Kwan <dougkwan@google.com>
8052 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8053 Initialize USE_SYMBOL_.
8054 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8056 (Arm_reloc_property::uses_symbol_): New data member declaration.
8057 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8058 uses symbol value and symbol is undefined but not weakly undefined.
8060 2010-06-28 Rafael Espindola <espindola@google.com>
8062 * plugin.cc (Plugin::load): Use dlerror.
8064 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8066 * symtab.cc (detect_odr_violations): When reporting an ODR
8067 violation, report an object where the symbol is defined.
8069 2010-06-25 Doug Kwan <dougkwan@google.com>
8071 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8072 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8074 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8075 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8076 target hook to detect function points.
8077 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8078 * icf.h (Icf::check_section_for_function_pointers): Change type of
8079 parameter SECTION_NAME to const reference to std::string. Use
8080 target hook to determine if section may have unsafe pointers.
8081 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8084 2010-06-21 Rafael Espindola <espindola@google.com>
8086 * fileread.cc (Input_file::find_fie): New
8087 (Input_file::open): Use Input_file::find_fie.
8088 * fileread.h (Input_file::find_fie): New
8089 * plugin.cc (set_extra_library_path): New.
8090 (Plugin::load): Add set_extra_library_path to the transfer vector.
8091 (Plugin_manager::set_extra_library_path): New.
8092 (Plugin_manager::add_input_file): Use the extra search path if set.
8093 (set_extra_library_path(): New.
8094 * plugin.h (Plugin_manager): Add set_extra_library_path and
8097 2010-06-19 Cary Coutant <ccoutant@google.com>
8099 * layout.cc (gdb_sections): Add .debug_types.
8100 (lines_only_debug_sections): Likewise.
8102 2010-06-18 Rafael Espindola <espindola@google.com>
8104 * plugin.cc (add_input_file,add_input_library)
8105 (Plugin_manager::add_input_file): Make filename arguments const.
8106 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8109 2010-06-16 Doug Kwan <dougkwan@google.com>
8111 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8112 .ARM.attributes section if we have not merged any input
8113 attributes sections.
8115 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8117 * arm.cc: Allow combining objects with no EABI version
8120 2010-06-15 Rafael Espindola <espindola@google.com>
8122 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8124 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8126 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8127 (struct iovec): Correct !HAVE_READV definition.
8129 2010-06-10 Cary Coutant <ccoutant@google.com>
8131 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8132 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8134 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8137 * symtab.h (Symbol::is_placeholder): New member function.
8138 * target-reloc.h (relocate_section): Check for placeholder symbols.
8140 * testsuite/Makefile.am (plugin_test_8): New test.
8141 (plugin_test_9): New test.
8142 * testsuite/Makefile.in: Regenerate.
8144 2010-06-09 Nick Clifton <nickc@redhat.com>
8146 * yyscript.y (input_list_element): Allow strings prefixed with
8147 the '-' character. Treat these as libraries.
8148 * script.cc (script_add_library): New function. Adds a library
8149 specified by "-l<name>" found in an input script.
8150 * script-c.h: Add prototype for script_add_library.
8152 2010-06-07 Doug Kwan <dougkwan@google.com>
8154 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8155 Restrict stub-group size to be within long conditional branch
8156 range when working around cortex-A8 erratum.
8158 2010-06-07 Damien Diederen <dd@crosstwine.com>
8160 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8163 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8167 (Output_section::Input_section_sort_entry::compare_section_ordering):
8168 Change to return non-zero correctly.
8169 (Output_section::Input_section_sort_section_order_index_compare
8170 ::operator()): Change to fix ambiguity in comparisons.
8172 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8174 * gold.h (is_wildcard_string): New function.
8175 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8176 (Layout::layout_eh_frame): Ditto.
8177 (Layout::find_section_order_index): New method.
8178 (Layout::read_layout_from_file): New method.
8179 * layout.h (Layout::find_section_order_index): New method.
8180 (Layout::read_layout_from_file): New method.
8181 (Layout::input_section_position_): New private member.
8182 (Layout::input_section_glob_): New private member.
8183 * main.cc (main): Call read_layout_from_file here.
8184 * options.h (--section-ordering-file): New option.
8185 * output.cc (Output_section::input_section_order_specified_): New
8187 (Output_section::Output_section): Initialize new member.
8188 (Output_section::add_input_section): Add new parameter.
8189 Keep input sections when --section-ordering-file is used.
8190 (Output_section::set_final_data_size): Sort input sections when
8191 section ordering file is specified.
8192 (Output_section::Input_section_sort_entry): Add new parameter.
8194 (Output_section::Input_section_sort_entry::compare_section_ordering):
8196 (Output_section::Input_section_sort_compare::operator()): Change to
8197 consider section_order_index.
8198 (Output_section::Input_section_sort_init_fini_compare::operator()):
8199 Change to consider section_order_index.
8200 (Output_section::Input_section_sort_section_order_index_compare
8201 ::operator()): New method.
8202 (Output_section::sort_attached_input_sections): Change to sort
8203 according to section order when specified.
8204 (Output_section::add_input_section<32, true>): Add new parameter.
8205 (Output_section::add_input_section<64, true>): Add new parameter.
8206 (Output_section::add_input_section<32, false>): Add new parameter.
8207 (Output_section::add_input_section<64, false>): Add new parameter.
8208 * output.h (Output_section::add_input_section): Add new parameter.
8209 (Output_section::input_section_order_specified): New
8211 (Output_section::set_input_section_order_specified): New method.
8212 (Input_section::Input_section): Initialize section_order_index_.
8213 (Input_section::section_order_index): New method.
8214 (Input_section::set_section_order_index): New method.
8215 (Input_section::section_order_index_): New member.
8216 (Input_section::Input_section_sort_section_order_index_compare): New
8218 (Output_section::input_section_order_specified_): New member.
8219 * script-sections.cc (is_wildcard_string): Delete and move modified
8221 (Output_section_element_input::Output_section_element_input): Modify
8222 call to is_wildcard_string.
8223 (Output_section_element_input::Input_section_pattern
8224 ::Input_section_pattern): Ditto.
8225 (Output_section_element_input::Output_section_element_input): Ditto.
8226 * testsuite/Makefile.am (final_layout): New test case.
8227 * testsuite/Makefile.in: Regenerate.
8228 * testsuite/final_layout.cc: New file.
8229 * testsuite/final_layout.sh: New file.
8231 2010-06-01 Rafael Espindola <espindola@google.com>
8233 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8235 2010-06-01 Rafael Espindola <espindola@google.com>
8237 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8238 visibility of symbols.
8240 2010-05-27 Doug Kwan <dougkwan@google.com>
8242 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8243 from start of output section instead of address for a local symbol
8244 in a merged or relaxed section when doing a relocatable link.
8246 2010-05-26 Rafael Espindola <espindola@google.com>
8249 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8250 adding sections the garbage collector removed.
8251 * gold/testsuite/Makefile.am: Add test.
8252 * gold/testsuite/Makefile.in: Regenerate.
8253 * gold/testsuite/plugin_test_7.sh: New.
8254 * gold/testsuite/plugin_test_7_1.c: New.
8255 * gold/testsuite/plugin_test_7_2.c: New.
8257 2010-05-26 Rafael Espindola <espindola@google.com>
8259 * script-sections.cc (Output_section_definition::set_section_addresses):
8260 Check for --section-start.
8262 2010-05-26 Doug Kwan <dougkwan@google.com>
8264 * arm.cc (Arm_scan_relocatable_relocs): New class.
8265 (Target_arm::relocate_special_relocatable): New method.
8266 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8267 (Arm_relocate_functions::thumb_branch_common): Same.
8268 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8269 instead of Default_scan_relocatable_relocs.
8270 * target-reloc.h (relocate_for_relocatable): Let target handle
8271 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8272 * target.h (Sized_target::relocate_special_relocatable): New method.
8274 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8276 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8278 2010-05-23 Doug Kwan <dougkwan@google.com>
8280 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8282 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8283 with a direct branch, not a conditional branch, to a stub.
8284 * merge.cc (Output_merge_base::record_input_section): New method
8286 (Output_merge_data::do_add_input_section): Record input section if
8287 keeps-input-sections flag is set.
8288 (Output_merge_string::do_add_input_section): Ditto.
8289 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8290 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8292 (Output_merge_base::keeps_input_sections,
8293 Output_merge_base::set_keeps_input_sections,
8294 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8296 (Output_merge_base::Input_sections): New type declaration.
8297 (Output_merge_base::input_sections_begin,
8298 Output_merge_base::input_sections_end,
8299 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8300 (Output_merge_base::bool keeps_input_sections_,
8301 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8302 Output_merge_base::input_sections_): New data members.
8303 (Output_merge_data::do_set_keeps_input_sections): New method
8305 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8306 * output.cc (Output_section::Input_section::relobj): Move method
8307 defintion from class declaration to here and handle merge sections.
8308 (Output_section::Input_section::shndx): Ditto.
8309 (Output_section::Output_section): Remove initializations of removed
8310 data members and initialize new data member LOOKUP_MAPS_.
8311 (Output_section::add_input_section): Set keeps-input-sections flag
8312 for a newly created merge output section as appropriate. Adjust code
8313 to use Output_section_lookup_maps class.
8314 (Output_section::add_relaxed_input_section): Adjst code for lookup
8315 maps code refactoring.
8316 (Output_section::add_merge_input_section): Add a new parameter
8317 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8318 class. If adding input section to a newly created merge output
8319 section fails, remove the new merge section.
8320 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8321 Adjust code for use of the Output_section_lookup_maps class.
8322 (Output_section::find_merge_section): Ditto.
8323 (Output_section::build_lookup_maps): New method defintion.
8324 (Output_section::find_relaxed_input_section): Adjust code to use
8325 Output_section_lookup_maps class.
8326 (Output_section::get_input_sections): Export merge sections. Adjust
8327 code to use Output_section_lookup_maps class.
8328 (Output_section:::add_script_input_section): Adjust code to use
8329 Output_section_lookup_maps class. Update lookup maps for merge
8331 (Output_section::discard_states): Use Output_section_lookup_maps.
8332 (Output_section::restore_states): Same.
8333 * output.h (Merge_section_properties): Move class defintion out of
8335 (Output_section_lookup_maps): New class.
8336 (Output_section::Input_section::is_merge_section): New method
8338 (Output_section::Input_section::relobj): Move defintion out of class
8339 defintion. Declare method only.
8340 (Output_section::Input_section::shndx): Ditto.
8341 (Output_section::Input_section::output_merge_base): New method defintion.
8342 (Output_section::Input_section::u2_.pomb): New union field.
8343 (Output_section::Merge_section_by_properties_map,
8344 Output_section::Output_section_data_by_input_section_map,
8345 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8347 (Output_section::add_merge_input_section): Add new parameter
8348 KEEPS_INPUT_SECTIONS.
8349 (Output_section::build_lookup_maps): New method declaration.
8350 (Output_section::merge_section_map_,
8351 Output_section::merge_section_by_properties_map_,
8352 Output_section::relaxed_input_section_map_,
8353 Output_section::is_relaxed_input_section_map_valid_): Remove data
8355 (Output_section::lookup_maps_): New data member.
8357 2010-05-21 Doug Kwan <dougkwan@google.com>
8360 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8361 avoid a compilation error.
8363 2010-05-19 Rafael Espindola <espindola@google.com>
8365 * script-sections.cc (Output_section_definition::allocate_to_segment):
8366 Update the phdrs_list even when the output section is NULL.
8367 * testsuite/Makefile.am: Add test.
8368 * testsuite/Makefile.in: Regenerate.
8369 * testsuite/script_test_9.cc: New.
8370 * testsuite/script_test_9.sh: New.
8371 * testsuite/script_test_9.t: New.
8373 2010-05-19 Doug Kwan <dougkwan@google.com>
8375 * arm.cc (Arm_input_section::original_size): New method.
8376 (Arm_input_section::do_addralign): Add a cast.
8377 (Arm_input_section::do_output_offset): Remove static cast.
8378 (Arm_input_section::original_addralign,
8379 Arm_input_section::original_size_): Change type to uint32_t.
8380 (Arm_input_section::init): Add safe casts for section alignment
8382 (Arm_input_section::set_final_data_size): Do not set address and
8383 offset of stub table.
8384 (Arm_output_section::fix_exidx_coverage): Change use of of
8385 Output_section::Simple_input_section to that of
8386 Output_section::Input_section.
8387 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8388 except for the first pass.
8389 * output.cc (Output_section::get_input_sections): Change type of
8390 input_sections to std::list<Input_section>.
8391 (Output_section::add_script_input_section): Rename from
8392 Output_section::add_simple_input_section. Change type of SIS
8393 parameter from Simple_input_section to Input_section.
8394 * output.h (Output_section::Simple_input_section): Remove class.
8395 (Output_section::Input_section): Change class visibility to public.
8396 (Output_section::Input_section::addralign): Use stored alignments
8397 for special input sections if set.
8398 (Output_section::Input_section::set_addralign): New method.
8399 (Output_section::get_input_sections): Change parameter type from
8400 list of Simple_input_section to list of Input_section.
8401 (Output_section::add_script_input_section): Rename from
8402 Output_section::add_simple_input_section. Change first parameter's
8403 type from Simple_input_section to Input_section and remove the
8404 second and third parameters.
8405 * script-sections.cc (Input_section::Input_section_list): Change
8406 type to list of Output_section::Input_section/
8407 (Input_section_info::Input_section_info): Change parameter type of
8408 INPUT_SECTION to Output_section::Input_section.
8409 (Input_section_info::input_section): Change return type.
8410 (Input_section_info::input_section_): Change type to
8411 Output_section::Input_section.
8412 (Output_section_element_input::set_section_addresses): Adjust code
8413 to use Output_section::Input_section instead of
8414 Output_section::Simple_input_section. Adjust code for renaming
8415 of Output_section::add_simple_input_section.
8416 (Orphan_output_section::set_section_addresses): Ditto.
8418 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8420 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8421 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8423 2010-05-18 Rafael Espindola <espindola@google.com>
8425 * options.cc (General_options::finalize): Handle -nostdlib.
8426 * options.h (nostdlib): New option.
8427 * script.cc (script_add_search_dir): Handle -nostdlib.
8429 2010-05-12 Doug Kwan <dougkwan@google.com>
8431 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8432 attributes section only if there no attributes section after merging.
8433 (Target_arm::merge_object_attributes): Move value of
8434 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8435 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8436 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8437 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8438 and arm_attr_merge_7.stdout.
8439 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8440 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8441 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8442 arm_attr_merge_7b.o): New rules.
8443 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8445 * testsuite/Makefile.in: Regenerate.
8446 * testsuite/arm_attr_merge.sh: New file.
8447 * testsuite/arm_attr_merge_[67][ab].s: Same.
8449 2010-05-05 Nick Clifton <nickc@redhat.com>
8451 * po/es.po: Updated Spanish translation.
8453 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8455 * Makefile.am (install-exec-local): Properly install gold as
8456 default cross linker.
8457 * Makefile.in: Regenerated.
8459 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8460 Nick Clifton <nickc@redhat.com>
8462 * configure.ac (install_as_default): Define and set to false
8463 unless --enable-gold or --enable-gold=both/gold has been
8465 * configure: Regenerate.
8467 * Makefile.am (install-exec-local): Install the executable as
8468 'ld.gold'. If install_as_default is true then also install it as
8470 * Makefile.in: Regenerated.
8472 2010-04-24 Ian Lance Taylor <iant@google.com>
8474 * layout.cc (Layout::layout_reloc): In relocatable link don't
8475 combine reloc sections for grouped sections.
8477 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8479 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8480 sections that are not ordinary to icf.
8481 * icf.cc (get_section_contents): Handle relocation pointing to section
8482 with no object or shndx information.
8483 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8484 * testsuite/Makefile.in: Regenerate.
8485 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8486 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8488 2010-04-22 Ian Lance Taylor <iant@google.com>
8490 * expression.cc (Expression::Expression_eval_info): Add
8491 result_alignment_pointer field.
8492 (Expression::eval_with_dot): Add result_alignment_pointer
8493 parameter. Change all callers.
8494 (Expression::eval_maybe_dot): Likewise.
8495 (class Binary_expression): Add alignment_pointer parameter to
8496 left_value and right_value. Change all callers.
8497 (BINARY_EXPRESSION): Set result alignment.
8498 (class Trinary_expression): Add alignment_pointer parameter to
8499 arg2_value and arg3_value. Change all callers.
8500 (Trinary_cond::value): Set result alignment.
8501 (Max_expression::value, Min_expression::value): Likewise.
8502 (Align_expression::value): Likewise.
8503 * script-sections.cc (class Sections_element): Add dot_alignment
8504 parameter to set_section_addresses virtual function. Update
8506 (class Output_section_element): Likewise.
8507 (Script_sections::create_segments): Add dot_alignment parameter.
8509 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8510 (Script_sections::set_phdrs_clause_addresses): Likewise.
8511 * script-sections.h: Update declarations.
8512 * script.h: Update declarations.
8513 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8515 * testsuite/script_test_3.t: Set large alignment.
8516 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8517 segment has expected alignment.
8519 2010-04-22 Nick Clifton <nickc@redhat.com>
8521 * po/gold.pot: Updated by the Translation project.
8522 * po/vi.po: Updated Vietnamese translation.
8524 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8526 * testsuite/Makefile.am (check_PROGRAMS): Add
8527 icf_virtual_function_folding_test.
8528 * testsuite/Makefile.in: Regenerated.
8530 2010-04-15 Andrew Haley <aph@redhat.com>
8532 * options.h (merge_exidx_entries): New option.
8533 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8534 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8535 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8536 (Target_arm::merge_exidx_entries): New function.
8537 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8538 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8539 to Arm_exidx_fixup constructor.
8540 Add new arg, merge_exidx_entries.
8541 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8542 Arm_output_section::fix_exidx_coverage.
8544 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8546 * icf.cc (get_section_contents): Check for preemptible functions.
8547 Ignore addend when appropriate.
8548 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8550 (add_from_relobj): Check for section folded.
8551 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8552 * symtab.h (should_add_dynsym_entry): Add new parameter.
8553 * target-reloc.h (scan_relocs): Check for section folded.
8554 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8555 Check reloc types for function pointers in shared objects.
8556 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8558 (icf_preemptible_functions_test): New test case.
8559 (icf_string_merge_test): New test case.
8560 * testsuite.Makefile.in: Regenerate.
8561 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8562 bar_glob. Refactor code.
8563 * testsuite/icf_preemptible_functions_test.cc: New file.
8564 * testsuite/icf_preemptible_functions_test.sh: New file.
8565 * testsuite/icf_string_merge_test.cc: New file.
8566 * testsuite/icf_string_merge_test.sh: New file.
8567 * testsuite/icf_virtual_function_folding_test.cc: New file.
8568 * testsuite/icf_virtual_function_folding_test.sh: New file.
8570 2010-04-14 Doug Kwan <dougkwan@google.com>
8572 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8573 for local symbol recounting if we remove a section due to ICF.
8574 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8575 there are no regular objects in input.
8577 2010-04-13 Doug Kwan <dougkwan@google.com>
8579 * arm.cc (Arm_input_section::set_final_data_size): Compute
8580 accurate final data size instead of using current data size.
8582 2010-04-09 Doug Kwan <dougkwan@google.com>
8584 * layout.cc (Layout::choose_output_section): Handle script section
8586 (Layout::make_output_section_for_script): Add section type parameter.
8587 Handle script section types.
8588 * layout.h (Layout::make_output_section_for_script): Add section
8590 * output.cc (Output_section::Output_section): Initialize data member
8592 (Output_section::do_reset_address_and_file_offset): Do not set address
8593 to 0 if section is a NOLOAD section.
8594 * output.h (Output_section::is_noload): New method.
8595 (Output_section::set_is_noload): Ditto.
8596 (Output_section::is_noload_): New data member.
8597 * script-c.h (Script_section_type): New enum type.
8598 (struct Parser_output_section_header): Add new file section_type.
8599 * script-sections.cc (Sections_element::output_section_name): Add
8600 parameter for returning script section type.
8601 (Output_section_definition::output_section_name): Ditto.
8602 (Output_section_definition::section_type)P; New method.
8603 (Output_section_definiton::script_section_type_name): Ditto.
8604 (Output_section_definition::script_section_type_): New data member.
8605 (Output_section_definition::Output_section_definition): Initialize
8606 data member Output_section_definition::script_section_type_.
8607 (Output_section_definition::create_sections): Pass script section type
8608 to Layout::make_output_section_for_script.
8609 (Output_section_definition::output_section_name): Return script
8610 section type to caller.
8611 (Output_section_definition::set_section_address): Do not advance
8612 dot value and load address if section type is NOLOAD. Set address
8613 of NOLOAD sections regardless of section flags.
8614 (Output_section_definition::print): Print section type if it is
8615 not SCRIPT_SECTION_TYPE_NONE.
8616 (Output_section_definition::section_type): New method.
8617 (Output_section_definition::script_section_type_name): Ditto.
8618 (Script_sections::output_section_name): Add new parameter
8619 PSECTION_TYPE for returning script section type. Pass it to
8620 section elements. Handle discard sections.
8621 (Sort_output_sections::operator()): Handle NOLOAD sections.
8622 * script-sections.h (Script_sections::Section_type): New enum type.
8623 (Script_sections::output_section_name): Add a new parameter for
8624 returning script section type.
8625 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8627 * yyscript.y (union): Add new field SECTION_TYPE.
8628 (COPY, DSECT, INFO, NOLOAD): New tokens.
8629 (opt_address_and_section_type): Change type to output_section_header.
8630 (section_type): New non-terminal
8631 (section_header): Handle section type.
8632 (opt_address_and_section_type): Return section type value.
8634 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8636 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8637 * testsuite/plugin_common_test_2.c (foo): Likewise.
8639 2010-04-08 Doug Kwan <dougkwan@google.com>
8641 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8643 * output.cc (Output_section::add_merge_input_section): Simplify
8644 code and return status of Output_merge_base::add_input_section.
8645 Update merge section map only if Output_merge_base::add_input_section
8648 2010-04-07 Doug Kwan <dougkwan@google.com>
8650 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8651 if section is marked as containing instructions but has no mapping
8653 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8654 correct section index.
8655 (Arm_relobj::find_linked_text_section): Ditto.
8657 2010-04-07 Cary Coutant <ccoutant@google.com>
8659 * archive.cc (include_member): Destroy Read_symbols_data object before
8661 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8662 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8663 (Read_symbols_data::~Read_symbols_data) New destructor.
8664 (Section_relocs::Section_relocs) New constructor.
8665 (Section_relocs::~Section_relocs) New destructor.
8666 (Read_relocs_data::Read_relocs_data) New constructor.
8667 (Read_relocs_data::~Read_relocs_data) New destructor.
8668 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8669 pointers to NULL after deleting.
8671 2010-04-07 Doug Kwan <dougkwan@google.com>
8673 * arm.cc: Replace "endianity" with "endianness" in comments.
8674 (Arm_exidx_cantunwind): Ditto.
8675 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8676 (Arm_relobj::merge_flags_and_attributes): New method.
8677 (Arm_relobj::merge_flags_and_attributes_): New data member.
8678 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8679 (Arm_relobj::scan_sections_for_stubs): Ditto.
8680 (Arm_relobj::do_read_symbols): Check to see if we really want to
8681 merge processor-specific flags and attributes. Exit early if
8682 an object is empty except for section names and the undefined symbol.
8683 (Target_arm::do_finalize_sections): Move check for ELF format to
8684 Arm_relobj::do_read_symbols. Merge processor specific flags and
8685 attributes from a regular object only when we have determined that
8686 it is aapropriate. Do not create an .ARM.attributes section in
8687 output if there is no regular input object.
8688 (Target_arm::merge_processor_specific_flags): Check
8689 --warn-mismatch before printing any error.
8690 (Target_arm::merge_object_attributes): Ditto.
8691 * gold.cc (queue_middle_tasks): Handle the case in which there is
8692 no regular object in input.
8693 * options.cc (General_options::parse_EB): New method.
8694 (General_options::parse_EL): Same.
8695 (General_options::General_options): Initialize endianness_.
8696 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8698 (General_options::Endianness): New enum.
8699 (General_options::endianness): New method.
8700 (General_options::endianness_): New data member.
8701 * parameters.cc (Parameters::set_options): Check target endianness.
8702 (Parameters::set_target_once): Ditto.
8703 (Parameters::check_target_endianness): New method.
8704 (parameters_force_valid_target): If either -EL or -EB is specified,
8705 use it to define endianness of default target.
8706 * parameters.h (Parameters::check_target_endianness): New method
8708 * target.h (class Target): Change "endianity" to "endianness"
8711 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8713 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8714 * configure: Regenerate.
8715 * Makefile.in: Regenerate.
8716 * testsuite/Makefile.in: Regenerate.
8718 2010-04-06 Cary Coutant <ccoutant@google.com>
8721 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8722 prevailing definitions of common symbols.
8723 * testsuite/plugin_test_6.sh: New test case.
8724 * testsuite/plugin_common_test_1.c: New test case.
8725 * testsuite/plugin_common_test_2.c: New test case.
8726 * testsuite/Makefile.am (plugin_test_6): New test case.
8727 * testsuite/Makefile.in: Regenerate.
8729 2010-04-06 Nick Clifton <nickc@redhat.com>
8731 * po/vi.po: New Vietnamese translation.
8733 2010-03-30 Doug Kwan <dougkwan@google.com>
8735 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8737 2010-03-25 Doug Kwan <dougkwan@google.com>
8739 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8740 to avoid a conversion warning on a 32-bit host.
8742 2010-03-24 Ian Lance Taylor <iant@google.com>
8744 * testsuite/script_test_3.t: Add a TLS segment.
8745 * testsuite/Makefile.am (check_PROGRAMS): Add
8746 tls_phdrs_script_test.
8747 (tls_phdrs_script_test_SOURCES): Define.
8748 (tls_phdrs_script_test_DEPENDENCIES): Define.
8749 (tls_phdrs_script_test_LDFLAGS): Define.
8750 (tls_phdrs_script_test_LDADD): Define.
8751 * testsuite/Makefile.in: Rebuild.
8753 2010-03-23 Cary Coutant <ccoutant@google.com>
8755 * fileread.cc (find_or_make_view): Fix comment.
8757 2010-03-23 Ian Lance Taylor <iant@google.com>
8759 * script-sections.cc (class Orphan_section_placement): Define
8760 PLACE_TLS and PLACE_TLS_BSS.
8761 (Orphan_section_placement::Orphan_section_placement): Initialize
8763 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8764 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8765 (tls_script_test_SOURCES): Define.
8766 (tls_script_test_DEPENDENCIES): Define.
8767 (tls_script_test_LDFLAGS): Define.
8768 (tls_script_test_LDADD): Define.
8769 * testsuite/Makefile.in: Rebuild.
8771 2010-03-22 Doug Kwan <dougkwan@google.com>
8773 * arm.cc (Arm_relocate_functions::abs8,
8774 Arm_relocate_functions::abs16): Use correct check for overflow
8775 specified in the ARM ELF specs.
8776 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8777 target of a BLX instruction specially.
8778 (Reloc_stub::stub_type_for_reloc): Ditto.
8779 (Relocate::relocate): Use symbolic names instead of numeric relocation
8780 codes to report error.
8781 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8783 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8784 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8785 thumb2_blx_out_of_range.stdout
8786 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8787 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8788 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8789 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8790 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8791 thumb2_blx_in_range, thumb2_blx_in_range.o,
8792 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8793 thumb2_blx_out_of_range.o): New rules.
8794 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8795 thumb2_blx_in_range and thumb2_blx_out_of_range.
8796 * testsuite/Makefile.in: Regenerate.
8797 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8798 * testsuite/thumb_blx_in_range.s: New file.
8799 * testsuite/thumb_blx_out_of_range.s: New file.
8801 2010-03-22 Rafael Espindola <espindola@google.com>
8803 * archive.cc (Should_include): Move to archive.h.
8804 (should_include_member): Make it a member of Archive.
8806 (Add_lib_group_symbols): New.
8807 * archive.h: Include options.h.
8808 (Archive_member): Moved from Archive.
8809 (Should_include): Moved from archive.cc.
8811 (Add_lib_group_symbols): New.
8812 * dynobj.cc (do_should_include_member): New.
8813 * dynobj.h (do_should_include_member): New.
8814 * gold.cc (queue_initial_tasks): Update call to queue.
8815 * main.cc (main): Print lib group stats.
8816 * object.cc (do_should_include_member): New.
8817 * object.h: Include archive.h.
8818 (Object::should_include_member): New.
8819 (Object::do_should_include_member): New.
8820 (Sized_relobj::do_should_include_member): New.
8821 * options.cc (General_options::parse_start_lib): New.
8822 (General_options::parse_end_lib): New.
8823 (Input_arguments::add_file): Handle lib groups.
8824 (Input_arguments::start_group): Check we are not in a lib.
8825 (Input_arguments::start_lib): New.
8826 (Input_arguments::end_lib): New.
8827 * options.h (General_options): Add start_lib and end_lib.
8828 (Input_argument::lib_): New.
8829 (Input_argument::lib): New.
8830 (Input_argument::is_lib): New.
8831 (Input_file_lib): New.
8832 (Input_arguments::in_lib_): New.
8833 (Input_arguments::in_lib): New.
8834 (Input_arguments::start_lib): New.
8835 (Input_arguments::end_lib_): New.
8836 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8837 in unused members as preempted.
8838 (Sized_pluginobj::do_should_include_member): New.
8839 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8840 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8842 (Read_symbols::do_whole_lib_group): New.
8843 (Read_symbols::do_lib_group): New.
8844 (Read_symbols::do_read_symbols): Handle lib groups.
8845 (Read_symbols::get_name): Handle lib groups.
8846 * readsyms.h (Read_symbols): Add an archive member pointer.
8847 (Read_symbols::do_whole_lib_group): New.
8848 (Read_symbols::do_lib_group): New.
8849 (Read_symbols::member_): New.
8850 * script.cc (read_input_script): Update call to queue_soon.
8852 2010-03-19 Doug Kwan <dougkwan@google.com>
8854 * arm.cc (Stub_table::Stub_table): Initialize new data members
8855 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8856 (Stub_table::add_reloc_stub): Assign stub offset and update
8857 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8858 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8860 (Stub_table::update_data_size_and_addralign): Use
8861 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8862 instead of going over all reloc stubs.
8863 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8864 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8865 Stringpool_template::offset_ to size of Stringpool_char.
8866 (Stringpool_template::new_key_offset): Remove code to initialize
8867 Stringpool_template::offset_.
8868 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8869 Stringpool_template::offset_ to zero.
8871 2010-03-15 Doug Kwan <dougkwan@google.com>
8873 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8875 (Stringpool_template::new_key_offset): New method.
8876 (Stringpool_template::add_string): Assign offsets when adding new
8878 (Stringpool_template::set_string_offsets): Do not set string offsets
8879 when not optimizing.
8880 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8882 (Chunked_vector::clear): Clear size_.
8883 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8884 (Chunked_vector::size): Return size_.
8885 (Chunked_vector::push_back): Use size_ to find insert position.
8886 (Chunked_vector::size_): New data member.
8887 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8888 (Stringpool_template::new_key_offset): New method declaration.
8889 (Stringpool_template::offset_): New data member.
8891 2010-03-15 Rafael Espindola <espindola@google.com>
8893 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8894 Add_symbols' constructor.
8895 * readsyms.h (Add_symbols): Remove the input_group member.
8897 2010-03-10 Ian Lance Taylor <iant@google.com>
8899 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8900 target to ask whether a reference to a symbol requires a stack
8902 * target.h (Target::is_call_to_non_split): New function.
8903 (Target::do_is_call_to_non_split): Declare virtual function.
8904 * target.cc: Include "symtab.h".
8905 (Target::do_is_call_to_non_split): New function.
8906 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8908 2010-03-10 Cary Coutant <ccoutant@google.com>
8910 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8911 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8912 (File_read::open[2]): Add whole_file_view_ to list of views.
8913 (File_read::make_view): Remove test of whole_file_view_.
8914 (File_read::find_or_make_view): Create whole_file_view_ if
8916 (File_read::clear_views): Replace bool parameter with enum;
8917 adjust all callers. Don't delete views with permanent data;
8918 do delete cached views and views from archives if
8919 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8920 if clearing the corresponding view.
8921 * fileread.h (File_read::Clear_views_mode): New enum.
8922 (File_read::View::is_permanent_view): New method.
8923 (File_read::clear_views): Replace bool parameter
8924 with enum; adjust all callers.
8925 * options.h (General_options): Change keep_files_mapped option;
8926 add map_whole_files.
8927 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8929 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8932 2010-03-10 David S. Miller <davem@davemloft.net>
8934 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8936 2010-03-09 Sriraman Tallam <tmsriram@google.com>
8938 * icf.cc (get_section_contents): Add '@' marker after processing the
8941 2010-03-08 Doug Kwan <dougkwan@google.com>
8943 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8944 due to a conversion warning.
8945 (Arm_relobj::update_output_local_symbol_count): Check for local
8946 symbol with unset output index.
8948 2010-03-05 Ian Lance Taylor <iant@google.com>
8950 * options.h (class General_options): Add --spare-dynamic-tags.
8951 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8952 --spare-dynamic-tags.
8954 2010-03-05 Ian Lance Taylor <iant@google.com>
8956 * incremental.cc: Include "libiberty.h".
8958 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8960 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8961 function, is_info_ member.
8962 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8963 (Versions::Versions): Update caller.
8964 (Versions::define_base_version): Likewise.
8965 (Versions::add_def): Likewise.
8967 2010-03-03 Sriraman Tallam <tmsriram@google.com>
8969 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8970 (Scan::possible_function_pointer_reloc): New function.
8971 (Scan::local_reloc_may_be_function_pointer): Change to call
8972 possible_function_pointer_reloc.
8973 (Scan::global_reloc_may_be_function_pointer): Ditto.
8974 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8975 relocations in ".data.rel.ro._ZTV" section.
8976 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8977 * testsuite/icf_safe_so_test.cc: Ditto.
8978 * testsuite/icf_safe_test.cc: Ditto.
8979 * testsuite/icf_safe_test.sh: Ditto.
8981 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8982 Ian Lance Taylor <iant@google.com>
8984 * target-reloc.h (relocate_section): Check the symbol table index
8985 for -1U before setting the local symbol index.
8986 (scan_relocatable_relocs): If copying the relocation, record that
8987 the local symbol is required.
8988 * object.h (Symbol_value::is_output_symtab_index_set): New
8990 (Symbol_value::may_be_discarded_from_output_symtab): New
8992 (Symbol_value::has_output_symtab_entry): New function.
8993 (Symbol_value::needs_output_symtab_entry): Remove.
8994 (Symbol_value::output_symtab_index): Make sure the symbol index is
8996 (Symbol_value::set_output_symtab_index): Make sure the symbol
8997 index is not set. Make sure the new index is valid.
8998 (Symbol_value::set_must_have_output_symtab_entry): New function.
8999 (Symbol_value::has_output_dynsym_entry): New function.
9000 (Symbol_value::set_output_dynsym_index): Make sure the new index
9002 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9003 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9004 local symbol if permitted.
9005 (Sized_relobj::do_finalize_local_symbols): Call
9006 is_output_symtab_index_set rather than needs_output_symtab_entry.
9007 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9008 rather than needs_output_symtab_entry. Call
9009 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9010 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9011 is_output_symtab_index_set rather than needs_output_symtab_entry.
9012 * testsuite/discard_locals_relocatable_test.c: New file.
9013 * testsuite/discard_locals_test.sh: Test -r.
9014 * testsuite/Makefile.am (check_DATA): Add
9015 discard_locals_relocatable_test1.syms,
9016 discard_local_relocatable_test2.syms.
9017 (MOSTLYCLEANFILES): Likewise. Also add
9018 discard_locals_relocatable_test1.lout and
9019 discard_locals_relocatable_test2.out.
9020 (discard_locals_relocatable_test1.syms): New target.
9021 (discard_locals_relocatable_test.o): New target.
9022 (discard_locals_relocatable_test1.out): New target.
9023 (discard_locals_relocatable_test2.syms): New target.
9024 (discard_locals_relocatable_test2.out): New target.
9025 (various): Add missing ../ld-new dependencies.
9026 * testsuite/Makefile.in: Rebuild.
9028 2010-03-03 Nick Clifton <nickc@redhat.com>
9030 * po/fi.po: New Finnish translation.
9032 2010-03-01 Doug Kwan <dougkwan@google.com>
9034 * layout.cc (Layout::Layout): Force section types of .init_array*,
9035 .preinit_array* and .fini_array* sections.
9036 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9037 Fix check of return value of std::string::find.().
9038 (Output_section::Input_section_sort_compare::operator()): Remove
9039 comment about .init_array.
9040 (Output_section::Input_section_sort_init_fini_compare::operator()):
9042 (Output_section::sort_attached_input_sections): Handle .init_array
9043 and .fini_array specially.
9044 * output.h (Output_section::Inut_section_sort_compare): Update
9046 (Output_section::Input_section_sort_init_fini_compare): New struct.
9048 2010-02-26 Doug Kwan <dougkwan@google.com>
9050 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9051 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9052 * testsuite/debug_msg.sh: Avoid matching source line number for
9053 use of global variable undef_int.
9055 2010-02-26 Doug Kwan <dougkwan@google.com>
9057 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9058 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9059 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9060 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9061 * options.cc (General_options::General_options): Initialize member
9063 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9064 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9065 and rm_no_fix_v4bx.stdout
9066 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9067 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9068 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9069 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9070 and arm_no_fix_v4bx.
9071 * Makefile.in: Regenerate.
9072 * testsuite/arm_fix_v4bx.s: New file.
9073 * testsuite/arm_fix_v4bx.sh: Ditto.
9075 2010-02-24 Doug Kwan <dougkwan@google.com>
9077 * arm.cc (Target_arm::got_section): Make the .got section the first
9078 non RELRO section in the data segment.
9079 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9080 suffixes of section names.
9082 2010-02-24 Doug Kwan <dougkwan@google.com>
9084 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9085 flags and attributes merging if an input file is a binary file.
9086 * fileread.cc (Input_file::open): Record format of original file.
9087 * fileread.h (Input_file::Format): New enum type.
9088 (Input_file::Input_file): Initialize data member format_.
9089 (Input_file::format): New method definition.
9090 (Input_file::format_):: New data member.
9092 2010-02-24 Doug Kwan <dougkwan@google.com>
9094 * arm.cc (Arm_output_data_got): New class.
9095 (ARM_TCB_SIZE): New constant
9096 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9097 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9098 If user uses a script with a SECTIONS clause, issue only a warning
9099 for a misplaced EXIDX input section. Otherwise, issue an error.
9100 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9102 (Target_arm::got_mode_index_entry): Handle static linking.
9103 (Target_arm::Scan::local): Ditto.
9104 (Target_arm::Scan::global): Ditto.
9105 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9106 all incorrectly implemented relocations.
9107 (Target_arm::fix_exidx_coverage): Pass layout to
9108 Arm_output_section::fix_exidx_coverage.
9109 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9110 from ".ARM.exidx." and ".ARM.extab.".
9112 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9114 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9115 section if it does not already exist.
9116 * attributes.cc (Attributes_section_data::Attributes_section_data):
9117 Don't crash if size is zero.
9119 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9120 Ian Lance Taylor <iant@google.com>
9122 * gold.cc (queue_middle_tasks): If no input files were opened,
9124 * workqueue.h (Task_function::Task_function): Assert that there is
9127 2010-02-22 Doug Kwan <dougkwan@google.com>
9129 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9130 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9131 types to avoid warnings due to different uint64_t implementations
9134 2010-02-21 Doug Kwan <dougkwan@google.com>
9136 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9137 handling of the maximum backward branch offset.
9138 (Arm_relocate_functions::thumb_branch_common): Ditto.
9139 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9140 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9141 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9142 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9143 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9144 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9145 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9146 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9147 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9148 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9149 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9150 thumb2_bl_out_of_range.o): New rules.
9151 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9152 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9153 thumb2_bl_out_of_range
9154 * testsuite/Makefile.in: Regenerate.
9155 * testsuite/arm_bl_in_range.s: New file.
9156 * testsuite/arm_bl_out_of_range.s: Ditto.
9157 * testsuite/arm_branch_in_range.sh: Ditto.
9158 * testsuite/arm_branch_range.t: Ditto.
9159 * testsuite/thumb2_branch_range.t: Ditto.
9160 * testsuite/thumb_bl_in_range.s: Ditto.
9161 * testsuite/thumb_bl_out_of_range.s: Ditto.
9162 * testsuite/thumb_branch_range.t: Ditto.
9164 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9166 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9167 Add reloc offset information.
9168 * icf.cc (get_section_contents): Change iterators to point to the new
9169 vectors. Add reloc offset information to the contents.
9170 * icf.h (Icf::Sections_reachable_info): New typedef.
9171 (Icf::Sections_reachable_list): New typedef.
9172 (Icf::Offset_info): New typedef.
9173 (Icf::Reloc_info): New struct typedef.
9174 (Icf::Reloc_info_list): New typedef.
9175 (Icf::symbol_reloc_list): Delete method.
9176 (Icf::addend_reloc_list): Delete method.
9177 (Icf::section_reloc_list): Delete method.
9178 (Icf::reloc_info_list): New method.
9179 (Icf::reloc_info_list_): New member.
9181 2010-02-19 Doug Kwan <dougkwan@google.com>
9183 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9184 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9185 * arm.cc (Arm_relocation_functions): New forward declaration.
9186 (Target_arm::Target_arm): Initialize new data members
9187 got_mod_index_offset_ and tls_base_symbol_defined_.
9188 (Target_arm::Relocate::relocate_tls): New method.
9189 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9190 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9192 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9193 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9194 (Target_arm::got_mod_index_offset_,
9195 Target_arm::tls_base_symbol_defined_): New data members.
9196 (Target_arm::Scan::local, Target::Scan::global,
9197 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9200 2010-02-18 Doug Kwan <dougkwan@google.com>
9202 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9203 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9204 text section as a parameter becuase some broken tools may not set
9205 the link in section header.
9206 (Target_arm::has_got_section): New method.
9207 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9208 without any mapping symbol as data only. Remove warning.
9209 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9210 link in its section header, try to discover the link by inspecting the
9211 REL31 relocation at the beginning of the section.
9212 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9214 (Target_arm::Scan::global): Treat any reference to the symbol
9215 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9217 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9219 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9220 (Scan::global_reloc_may_be_function_pointer): New function.
9221 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9222 (Scan::global_reloc_may_be_function_pointer): New function.
9223 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9224 (Scan::global_reloc_may_be_function_pointer): New function.
9225 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9226 (Scan::global_reloc_may_be_function_pointer): New function.
9227 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9228 (Scan::global_reloc_may_be_function_pointer): New function.
9229 (Scan::possible_function_pointer_reloc): New function.
9230 (Target_x86_64::can_check_for_function_pointers): New function.
9231 * gc.h (gc_process_relocs): Scan relocation types to determine if
9232 function pointers were taken for targets that support it.
9233 * icf.cc (Icf::find_identical_sections): Include functions for
9234 folding in safe ICF whose pointer is not taken.
9235 * icf.h (Secn_fptr_taken_set): New typedef.
9236 (fptr_section_id_): New member.
9237 (section_has_function_pointers): New function.
9238 (set_section_has_function_pointers): New function.
9239 (check_section_for_function_pointers): New function.
9240 * options.h: Fix comment for safe ICF option.
9241 * target.h (can_check_for_function_pointers): New function.
9242 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9243 Modify icf_safe_test for X86-64.
9244 * testsuite/Makefile.in: Regenerate.
9245 * testsuite/icf_safe_so_test.cc: New file.
9246 * testsuite/icf_safe_so_test.sh: New file.
9247 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9248 (main): Change to take pointer to function kept_func_3.
9249 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9250 folding is done correctly for X86-64.
9252 2010-02-12 David S. Miller <davem@davemloft.net>
9254 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9255 is_symbolless parameter.
9256 (Output_reloc<SHT_REL>::is_symbolless): New.
9257 (Output_reloc<SHT_REL>::is_symbolless_): New.
9258 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9259 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9260 (Output_reloc<SHT_RELA>::is_symbolless): New.
9261 (Output_data_reloc::add_global): Handle is_symbolless.
9262 (Output_data_reloc::add_global_relative): Likewise.
9263 (Output_data_reloc::add_local): Likewise.
9264 (Output_data_reloc::add_local_relative): Likewise.
9265 (Output_data_reloc::add_symbolless_global_addend): New.
9266 (Output_data_reloc::add_symbolless_local_addend): New.
9267 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9269 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9270 instead of ->is_relative_
9271 (Output_reloc::write): Likewise.
9272 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9273 (Output_reloc::write_rel): Simplify.
9275 * sparc.cc (Target_sparc::Scan::local): Use
9276 ->add_symbolless_local_addend as needed.
9277 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9278 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9279 based upon relocation offset.
9281 2010-02-11 Doug Kwan <dougkwan@google.com>
9283 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9284 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9285 beginning of function.
9286 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9287 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9288 parameter is_32bit in calls to should_apply_static_reloc.
9289 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9290 (check_DATA): Add arm_abs_global.stdout.
9291 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9292 arm_abs_global.stdout): New rules.
9293 (MOSTLLYCLEANFILES): Add arm_abs_global
9294 * Makefile.in: Regenerate.
9295 * testsuite/arm_abs_global.s: New file.
9296 * testsuite/arm_abs_global.sh: Ditto.
9297 * testsuite/arm_abs_lib.s: Ditto.
9299 2010-02-11 Ian Lance Taylor <iant@google.com>
9301 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9303 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9304 Allocate_commons_task first.
9305 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9306 task, rather than symtab_lock_.
9307 (Gc_process_relocs::~Gc_process_relocs): New function.
9308 (Gc_process_relocs::is_runnable): Check this_blocker_.
9309 (Gc_process_relocs::locks): Use next_blocker_ rather than
9311 (Scan_relocs::~Scan_relocs): New function.
9312 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9314 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9316 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9317 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9318 constructor accordingly.
9319 (class Gc_process_relocs): Likewise.
9320 (class Scan_relocs): Likewise.
9321 * common.h (class Allocate_commons_task): Remove symtab_lock_
9322 field, and corresponding constructor parameter.
9323 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9325 (Allocate_commons_task::locks): Likewise.
9327 2010-02-11 Ian Lance Taylor <iant@google.com>
9329 * gold-threads.h (class Once): Define.
9330 (class Initialize_lock): Rewrite as child of Once.
9331 * gold-threads.cc (class Once_initialize): Define.
9332 (once_pointer_control): New static variable.
9333 (once_pointer, once_arg): New static variables.
9334 (c_run_once): New static function.
9335 (Once::Once, Once::run_once, Once::internal_run): New functions.
9336 (class Initialize_lock_once): Remove.
9337 (initialize_lock_control): Remove.
9338 (initialize_lock_pointer): Remove.
9339 (initialize_lock_once): Remove.
9340 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9341 (Initialize_lock::initialize): Rewrite.
9342 (Initialize_lock::do_run_once): New function.
9343 * archive.cc (Archive::interpret_header): Only clear name if it is
9345 * fileread.cc: Include "gold-threads.h"
9346 (file_counts_lock): New static variable.
9347 (file_counts_initialize_lock): Likewise.
9348 (File_read::release): Only increment counts when using --stats.
9349 Use a lock around the increment.
9350 * parameters.cc (class Set_parameters_target_once): Define.
9351 (set_parameters_target_once): New static variable.
9352 (Parameters::Parameters): Move here from parameters.h.
9353 (Parameters::set_target): Rewrite.
9354 (Parameters::set_target_once): New function.
9355 (Parameters::clear_target): Move here and rewrite.
9356 * parameters.h (class Parameters): Update declarations. Add
9357 set_parameters_target_once_ field.
9358 (Parameters::Parameters): Move to parameters.cc.
9359 (Parameters::clear_target): Likewise.
9360 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9362 (Start_group::~Start_group): New function.
9363 (Start_group::is_runnable): New function.
9364 (Start_group::locks, Start_group::run): New functions.
9365 (Finish_group::run): Change saw_undefined to size_t.
9366 * readsyms.h (class Start_group): Define.
9367 (class Finish_group): Change saw_undefined_ field to size_t.
9368 (Finish_group::Finish_group): Remove saw_undefined and
9369 this_blocker parameters. Change all callers.
9370 (Finish_group::set_saw_undefined): New function.
9371 (Finish_group::set_blocker): New function.
9372 * symtab.h (class Symbol_table): Change saw_undefined to return
9373 size_t. Change saw_undefined_ field to size_t.
9374 * target-select.cc (Set_target_once::do_run_once): New function.
9375 (Target_selector::Target_selector): Initialize set_target_once_
9376 field. Don't initialize lock_ and initialize_lock_ fields.
9377 (Target_selector::instantiate_target): Rewrite.
9378 (Target_selector::set_target): New function.
9379 * target-select.h (class Set_target_once): Define.
9380 (class Target_selector): Update declarations. Make
9381 Set_target_once a friend. Remove lock_ and initialize_lock_
9382 fields. Add set_target_once_ field.
9384 2010-02-10 Ian Lance Taylor <iant@google.com>
9386 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9388 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9389 (queue_middle_tasks): Add all blockers before queueing any tasks.
9390 (queue_final_tasks): Likewise.
9391 * token.h (Task_token::add_blockers): New function.
9392 * object.h (Input_objects::number_of_relobjs): New function.
9394 2010-02-10 Ian Lance Taylor <iant@google.com>
9396 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9397 shared, not if not position independent.
9398 * x86_64.cc (Relocate::relocate_tls): Likewise.
9399 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9400 (tls_pie_pic_test): New target.
9401 * testsuite/Makefile.in: Rebuild.
9403 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9404 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9405 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9406 * testsuite/Makefile.in: Rebuild.
9408 2010-02-09 David S. Miller <davem@davemloft.net>
9410 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9411 R_SPARC_RELATIVE using ->add_local_relative().
9412 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9414 * output.h (Output_data_dynamic::add_section_size): New method
9415 that takes two Output_data objects.
9416 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9417 entry param. Handle it in initializers.
9418 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9419 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9420 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9422 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9423 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9424 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9425 for dynrel_includes_plt.
9426 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9427 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9428 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9430 (Target_sparc::do_finalize_sections): Update to pass true for
9431 dynrel_includes_plt.
9432 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9433 output before .rela.plt
9434 (Target_powerpc::do_finalize_sections): Update to pass true for
9435 dynrel_includes_plt when 32-bit.
9437 2010-02-08 Doug Kwan <dougkwan@google.com>
9439 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9441 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9442 Arm_relobj::scan_section_for_cortex_a8_stubs,
9443 Arm_relobj::do_relocation_section): Instead of calling
9444 Output_section::output_address, use faster
9445 Arm_relobj::simple_input_section_output_address.
9447 2010-02-08 David S. Miller <davem@davemloft.net>
9449 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9450 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9451 relocation helper function.
9453 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9454 just like R_SPARC_GOT{10,13,22}.
9455 (Target_sparc::Scan::local): Likewise.
9456 (Target_sparc::Relocate:relocate): Likewise.
9458 2010-02-06 Ian Lance Taylor <iant@google.com>
9460 * configure.ac: Rewrite targetobjs duplicate removal code to use
9461 only shell constructs.
9462 * configure: Rebuild.
9464 2010-02-05 Doug Kwan <dougkwan@google.com>
9467 * arm.cc (Arm_relobj::section_is_scannable): New method.
9468 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9469 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9471 2010-02-04 Doug Kwan <dougkwan@google.com>
9474 * arm-reloc-property.cc (cstdio): Include.
9475 * configure.ac (targetobjs): Remove duplicates.
9476 * configure: Regenerate.
9477 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9478 big and little endian version for a given address size.
9480 2010-02-03 Doug Kwan <dougkwan@google.com>
9482 * arm-reloc-property.cc
9483 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9485 * arm-reloc-property.h
9486 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9487 New method definition.
9488 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9490 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9492 (GOT_PREL): Change implemented to Y.
9493 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9494 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9495 (Arm_relocate_functions::movw_abs_nc): Remove method.
9496 (Arm_relocate_functions::movt_abs): Ditto.
9497 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9498 (Arm_relocate_functions::thm_movt_abs): Ditto.
9499 (Arm_relocate_functions::movw_rel_nc): Ditto.
9500 (Arm_relocate_functions::movw_rel): Ditto.
9501 (Arm_relocate_functions::movt_rel): Ditto.
9502 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9503 (Arm_relocate_functions:thm_movw_rel): Ditto.
9504 (Arm_relocate_functions:thm_movt_rel): Ditto.
9505 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9506 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9507 New method definitions.
9508 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9509 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9510 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9511 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9512 (Target_arm::Relocate::relocate): Check for non-static or
9513 unimplemented relocation code and exit early. Change calls to
9514 Target_arm::reloc_uses_thumb_bit and
9515 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9516 instead. Refactor code to handle similar relocations to increase
9517 code sharing. Remove check for unsupported relocation code in switch
9519 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9520 relocation property table to find out size. Change error message to
9521 print out the name of a relocation code instead of the numeric value.
9522 (Target_arm::scan_reloc_for_stub): Use relocation property table
9523 instead of calling Target_arm::reloc_uses_thumb_bit().
9525 2010-02-02 Doug Kwan <dougkwan@google.com>
9527 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9528 types of relaxed input section.
9530 2010-02-02 Doug Kwan <dougkwan@google.com>
9532 * Makefile.am (HFILES): Add arm-reloc-property.h.
9534 (TARGETSOURCES): Add arm-reloc-property.cc
9535 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9536 (libgold_a_SOURCES): $(DEFFILES)
9537 * Makefile.in: Regenerate.
9538 * arm-reloc-property.cc: New file.
9539 * arm-reloc-property.h: New file.
9540 * arm-reloc.def: New file.
9541 * arm.cc: Update comments.
9542 (arm-reloc-property.h): New included header.
9543 (arm_reloc_property_table): New global variable.
9544 (Target_arm::do_select_as_default_target): New method definition.
9545 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9546 arm-reloc-property to targ_extra_obj.
9547 * parameters.cc (set_parameters_target): Call
9548 Target::select_as_default_target().
9549 * target.h (Target::select_as_default_target): New method definition.
9550 (Target::do_select_as_default_target): Same.
9552 2010-02-01 Doug Kwan <dougkwan@google.com>
9554 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9555 first_output_text_section_.
9556 (Arm_exidx_fixup::first_output_text_section): New method definition.
9557 (Arm_exidx_fixup::first_output_text_section_): New data member.
9558 (Arm_exidx_fixup::process_exidx_section): Record the first text
9559 output section seen.
9560 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9561 and entsize in output section header.
9563 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9565 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9566 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9567 (Arm_relocate_functions::thm_alu11): New Method.
9568 (Arm_relocate_functions::thm_pc8): New Method.
9569 (Arm_relocate_functions::thm_pc12): New Method.
9570 (Target_arm::Scan::local): Handle the relocations.
9571 (Target_arm::Scan::global): Likewise.
9572 (Target_arm::Relocate::relocate): Likewise.
9573 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9575 2010-01-29 Doug Kwan <dougkwan@google.com>
9577 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9578 of relocation types as ld.
9580 2010-01-29 Doug Kwan <dougkwan@google.com>
9582 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9584 (Arm_relocate_functions::thumb_branch_common): Ditto.
9585 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9586 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9587 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9588 Arm_relocate_functions::jump24): Remove.
9589 (Target_arm::Relocate::relocate): Adjust code to call
9590 Arm_relocation_functions::arm_branch_common and
9591 Arm_relocation_functions::thumb_branch_common instead of their removed
9592 wrappers. Merge switch-cases together to reduce source code size.
9594 2010-01-29 Doug Kwan <dougkwan@google.com>
9596 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9597 output_local_symbol_count_needs_update_.
9598 (Arm_relobj::output_local_symbol_count_needs_update,
9599 Arm_relobj::set_output_local_symbol_count_needs_update,
9600 Arm_relobj::update_output_local_symbol_count): New methods.
9601 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9603 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9604 of pointed function as in a R_ARM_PREL31 relocation.
9605 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9606 for output local symbol count updating.
9607 (Target_arm::do_relax): Update output local symbol counts in objects
9609 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9611 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9613 * arm.cc: Added support for the ARM relocations:
9614 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9615 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9616 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9618 (Arm_relocate_functions::movw_rel): New method.
9619 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9620 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9622 (Arm_relocate_functions::thm_movw_rel): New method.
9623 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9625 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9627 (Target_arm::Scan::global): Likewise.
9628 (Target_arm::Relocate::relocate): Likewise.
9629 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9632 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9634 * arm.cc: Added support for ARM group relocations.
9635 (Target_arm::reloc_needs_sym_origin): New method.
9636 (Arm_relocate_functions::calc_grp_kn): New method.
9637 (Arm_relocate_functions::calc_grp_residual): New method.
9638 (Arm_relocate_functions::calc_grp_gn): New method.
9639 (Arm_relocate_functions::arm_grp_alu): New Method.
9640 (Arm_relocate_functions::arm_grp_ldr): New Method.
9641 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9642 (Arm_relocate_functions::arm_grp_ldc): New Method.
9643 (Target_arm::Scan::local): Handle the ARM group relocations.
9644 (Target_arm::Scan::global): Likewise.
9645 (Target_arm::Relocate::relocate): Likewise.
9646 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9649 2010-01-26 Doug Kwan <dougkwan@google.com>
9651 * arm.cc (set): Include.
9652 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9654 (Arm_output_section::Text_section_list): New type.
9655 (Arm_output_section::append_text_sections_to_list): New method.
9656 (Arm_output_section::fix_exidx_coverage): Ditto.
9657 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
9658 (Arm_relobj::convert_input_section_to_relaxed_section): Use
9659 Relobj::set_section_offset() instead of
9660 Sized_relobj::invalidate_section_offset().
9661 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
9662 parameter for section headers. Ignore relocation sections for
9663 unallocated sections and EXIDX sections.
9664 (Target_arm::fix_exidx_coverage): New method.
9665 (Target_arm::output_section_address_less_than): New type.
9666 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9667 linked text section instead of the EXIDX section.
9668 (Arm_output_section::create_stub_group): Add an assertion to check
9669 that this is not an EXIDX output section.
9670 (Arm_output_section::append_text_sections_to_list): New method.
9671 (Arm_output_section::fix_exidx_coverage): Ditto.
9672 (Arm_relobj::scan_sections_for_stubs): Adjust call to
9673 Arm_relobj::section_needs_reloc_stub_scanning.
9674 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9676 (Target_arm::fix_exidx_coverage): New method.
9677 * object.h (Relobj::set_output_section): New method.
9678 (Sized_relobj::invalidate_section_offset): Remove method.
9679 (Sized_relobj::do_invalidate_section_offset): Remove method.
9680 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9682 2010-01-25 Doug Kwan <dougkwan@google.com>
9684 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9685 Fix warning due to signed and unsigned comparison on a 32-bit host.
9687 2010-01-22 Doug Kwan <dougkwan@google.com>
9689 * arm.cc (Target_arm::do_relax): Record an output section for section
9690 offset adjustment it contains any stub table that has changed.
9691 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9692 offsets in an output section if necessary.
9693 * output.cc (Output_section::Output_section): Initialize
9694 section_offsets_need_adjustments_.
9695 (Output_section::add_input_section_for_script): Renamed to
9696 Output_section::add_simple_input_section.
9697 (Output_section::save_states): Add a comment.
9698 (Output_section::discard_states): New method defintion.
9699 (Output_section::adjust_section_offsets): Same.
9700 * output.h (Output_section::add_input_section_for_script): Renamed to
9701 Output_section::add_simple_input_section.
9702 (Output_section::discard_states): New method declaration.
9703 (Output_section::adjust_section_offsets): Same.
9704 (Output_section::section_offsets_need_adjustment,
9705 Output_section::set_section_offsets_need_adjustment): New method
9707 (Output_section::section_offsets_need_adjustment_): New data member.
9708 * script-sections.cc
9709 (Output_section_element_input::set_section_address): Adjust code for
9710 renaming of Output_section::add_input_section_for_script.
9711 (Orphan_output_section::set_section_address): Same.
9713 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9715 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9716 Fix_v4bx enum values .
9717 * gold/options.h (General_options): New option definitions.
9718 (General_options::fix_v4bx): New method.
9719 (General_options::Fix_v4bx): New enum.
9720 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9721 (General_options::parse_fix_v4bx_interworking): New method.
9723 2010-01-22 Doug Kwan <dougkwan@google.com>
9725 * arm.cc (Arm_exidx_fixup): New class.
9727 2010-01-21 Doug Kwan <dougkwan@google.com>
9729 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9731 (Arm_exidx_section_offset_map): New type.
9733 2010-01-21 Doug Kwan <dougkwan@google.com>
9735 * arm.cc (Arm_exidx_input_section): New class.
9736 (Arm_relobj::exidx_input_section_by_link,
9737 Arm_relobj::exidx_input_section_by_shndx,
9738 Arm_relobj::make_exidx_input_section): New methods.
9739 (read_arm_attributes_section): Remove.
9740 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9741 information about them.
9742 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9745 2010-01-20 Doug Kwan <dougkwan@google.com>
9747 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9748 Input_section_specifier to Section_id.
9749 (Target_arm::new_arm_input_section: Adjust code for change of key
9751 (Target_arm::find_arm_input_section): Ditto.
9752 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9753 (Section_id): Remove.
9754 (Garbage_collection::Section_id_hash): Remove.
9755 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9756 (Section_id): Remove.
9757 (Icf::Section_id_hash): Remove.
9758 * object.h (Section_id, Const_section_id, Section_id_hash,
9759 Const_section_id_hash): New type definitions.
9760 * output.cc (Output_section::add_relaxed_input_section): Change to
9761 use Const_section_id instead of Input_section_specifier as key type.
9762 (Output_section::add_merge_input_section): Ditto.
9763 (Output_section::build_relaxation_map): Change to use Section_id
9764 instead of Input_section_specifier as key type.
9765 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9767 (Output_section::convert_input_sections_to_relaxed_sections): Change
9768 to use Const_section_id instead of Input_section_specifier as key type.
9769 (Output_section::find_merge_section): Ditto.
9770 (Output_section::find_relaxed_input_section): Ditto.
9771 * output.h (Input_section_specifier): Remove class.
9772 (Output_section::Output_section_data_by_input_section_map): Change
9773 key type to Const_section_id.
9774 (Output_section::Output_relaxed_input_section_by_input_section_map):
9776 (Output_section::Relaxation_map): Change key type to Section_id.
9778 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9780 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9781 (class Arm_v4bx_stub): New class.
9782 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9783 (Stub_factory::make_arm_v4bx_stub): New method.
9784 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9785 (Stub_table::empty): Handle v4bx stubs.
9786 (Stub_table::add_arm_v4bx_stub): New method.
9787 (Stub_table::find_arm_v4bx_stub): New method.
9788 (Arm_relocate_functions::v4bx): New method.
9789 (Target_arm::fix_v4bx): New method.
9790 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9791 (Stub_table::relocate_stubs): Likewise.
9792 (Stub_table::do_write): Likewise.
9793 (Stub_table::update_data_size_and_addralign): Likewise.
9794 (Stub_table::finalize_stubs): Likewise.
9795 (Target_arm::Scan::local): Likewise.
9796 (Target_arm::Scan::global): Likewise.
9797 (Target_arm::do_finalize_sections): Likewise.
9798 (Target_arm::Relocate::relocate): Likewise.
9799 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9801 (Target_arm::scan_reloc_for_stub): Likewise.
9802 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9804 2010-01-19 Ian Lance Taylor <iant@google.com>
9806 * output.cc (Output_section_headers::do_sized_write): Write large
9807 segment count to sh_info field.
9808 (Output_file_header::do_sized_write): For large segment count,
9809 write PN_XNUM to e_phnum field.
9811 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9813 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9814 (Arm_relocate_functions::thm_jump8): New function.
9815 (Arm_relocate_functions::thm_jump11): New function.
9816 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9818 (Target_arm::Scan::global): Likewise.
9819 (Target_arm::Relocate::relocate): Likewise.
9820 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9823 2010-01-14 Doug Kwan <dougkwan@google.com>
9825 * arm.cc (map, utility): Include headers.
9826 (Target_arm::apply_cortex_a8_workaround): New method.
9827 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9828 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9829 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9830 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9831 the --[no-]fix-cortex-a8 command line options.
9832 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9833 (Target_arm::relocate_stub): Use addend in instruction template.
9834 * options.h (DEFINE_bool): Set the user-set flag.
9835 (General_options): Add --[no-]-fix-cortex options.
9836 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9837 : Update fast look-up map after conversion.
9839 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9841 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9842 in the first pass of do_layout.
9844 2010-01-13 Doug Kwan <dougkwan@google.com>
9846 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9847 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9848 apparent compiler problem of not folding static constant integral
9849 data members of elfcpp::Elf_sizes<32>.
9851 2010-01-13 Doug Kwan <dougkwan@google.com>
9853 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9854 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9855 Arm_relobj::scan_section_for_cortex_a8_erratum,
9856 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9857 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9858 sections to scan for relocation stubs into a new method
9859 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9860 relocation and Cortex-A8 stub scanning.
9861 (Target_arm::do_relax): Force stubs to be after stubbed sections
9862 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9863 the beginning of a new relaxation pass. Update a comment.
9864 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9866 2010-01-12 Ian Lance Taylor <iant@google.com>
9868 * target-reloc.h (visibility_error): New inline function.
9869 (relocate_section): Call visibility_error.
9870 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9871 (MOSTLYCLEANFILES): Likewise.
9872 (protected_4_pic.o, protected_3.err): New targets.
9873 * testsuite/protected_4.cc: New file.
9875 2010-01-12 Doug Kwan <dougkwan@google.com>
9877 * arm.cc (Cortex_a8_reloc): New class.
9878 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9879 and cortex_a8_relocs_info_.
9880 (Target_arm::fix_cortex_a8): New method definition.
9881 (Target_arm::Cortex_a8_relocs_info): New type.
9882 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9883 New data member declarations.
9884 (Target_arm::scan_reloc_for_stub): Record information about
9885 relocations for THUMB branches that might be exempted from the
9886 Cortex-A8 workaround.
9887 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9888 at the beginning of a relaxation pass.
9890 2010-01-12 Doug Kwan <dougkwan@google.com>
9892 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9893 (Arm_relobj::Mapping_symbol_position,
9894 Arm_reloj::Mapping_symbol_position_less,
9895 Arm_relobj::Mapping_symbols_info): New types.
9896 (Target_arm::is_mapping_symbol_name): New method definition.
9897 (Arm_relobj::do_count_local_symbols): Save information about mapping
9900 2010-01-11 Doug Kwan <dougkwan@google.com>
9902 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9903 Arm_relocate_functions::thumb32_branch_upper,
9904 Arm_relocate_functions::thumb32_branch_lower,
9905 Arm_relocate_functions::thumb32_cond_branch_offset,
9906 Arm_relocate_functions::thumb32_cond_branch_upper,
9907 Arm_relocate_functions::thumb32_cond_branch_lower,
9908 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9909 branch offset encoding.
9910 (Arm_relocate_functions::thumb_branch_common): Use new branch
9911 offset encoding methods to avoid code duplication.
9912 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9913 (Stub_addend_reader::operator()): Use new branch encoding method
9914 to avoid code duplication.
9916 2010-01-11 Doug Kwan <dougkwan@google.com>
9918 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9919 (Target_arm::do_finalize_sections): Define special EXIDX section
9920 symbols only if referenced.
9921 * gc.h (Garbage_collection::add_reference): New method.
9922 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9925 2010-01-11 Ian Lance Taylor <iant@google.com>
9927 * script.cc (Version_script_info::build_expression_list_lookup):
9928 Change complaing about duplicate wildcard match from error to
9931 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9933 (Version_script_info::Version_script_info): Initialize globs_,
9934 default_version_, default_is_global_, and exact_. Don't
9935 initialize globals_ or locals_.
9936 (Version_script_info::build_lookup_tables): Build local symbols
9938 (Version_script_info::unquote): New function.
9939 (Version_script_info::add_exact_match): New function.
9940 (Version_script_info::build_expression_list_lookup): Remove lookup
9941 parameter. Add is_global parameter. Change all callers. Handle
9942 wildcard pattern specially. Unquote pattern. Call
9944 (Version_script_info::get_name_to_match): New function.
9945 (Version_script_info::get_symbol_version): New function.
9946 (Version_script_info::get_symbol_version_helper): Remove.
9947 (Version_script_info::check_unmatched_names): Call unquote.
9948 * script.h (class Version_script_info): Change get_symbol_version
9949 to be non-inline and add is_global parameter; change all callers.
9950 Rewrite symbol_is_local. Update declarations. Define struct
9951 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9952 Remove globals_ and locals_ members. Add exact_, globs_,
9953 default_version_, is_global_.
9954 (Version_script_info::Glob): Remove pattern, add expression and
9955 is_global. Update constructor. Change all callers.
9956 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9958 (Versions::symbol_section_contents): If a symbol is undefined, or
9959 defined in a dynamic object, set the version index to
9961 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9963 (Symbol_table::add_from_pluginobj): Likewise.
9964 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9966 2010-01-11 Doug Kwan <dougkwan@google.com>
9968 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9969 (incremental_dump_LDADD): Add linking option for libintl.
9970 * Makefile.in: Regenerate.
9972 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9975 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9977 * testsuite/Makefile.in: Regenerated.
9979 2010-01-10 Doug Kwan <dougkwan@google.com>
9981 * options.h (DEFINE_var): Use parentheses around argument varname__
9982 in macro body to avoid any unintended subsequent substitutions.
9984 2010-01-10 Ian Lance Taylor <iant@google.com>
9986 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9987 candidates before doing symbol resolution.
9989 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9990 ODR candidates if only one is weak.
9992 2010-01-08 Ian Lance Taylor <iant@google.com>
9994 * script.cc (Version_script_info::build_expression_list_lookup):
9995 Don't warn about ambiguous version, just record the ambiguity.
9996 (Version_script_info::get_symbol_version_helper): Give error if
9997 version is ambiguous.
9999 2010-01-08 Doug Kwan <dougkwan@google.com>
10001 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10002 prev_data_size_ and prev_addralign_. Remove initializer for
10003 deleted data member has_been_changed_.
10004 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10005 to determine if the table is empty.
10006 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10008 (Stub_table::add_reloc_stub): Define method in class definition
10009 instead of just declaring it there.
10010 (Stub_table::add_cortex_a8_stub): New method definition.
10011 (Stub_table::update_data_size_and_addralign): Ditto.
10012 (Stub_table::finalize_stubs): Ditto.
10013 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10014 (Stub_table::do_addralign_): Return address alignment in the
10015 (Stub_table::do_reset_address_and_file_offset): Define method in
10016 class definition instead of declaring it there. Set current data
10017 size to be the data size of the previous pass.
10018 (Stub_table::set_final_data_size): Use current data size as the
10020 (Stub_table::relocate_stub): Change parameter type of stub from
10021 Reloc_stub pointer to Stub pointer.
10022 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10023 (Stub_table::Cortex_a8_stub_list): New typedef.
10024 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10025 Stub_table::prev_addralign_): New data member.
10026 (Arm_relobj::Arm_relobj): Initialize data member
10027 section_has_cortex_a8_workaround_.
10028 (Arm_relobj::section_has_cortex_a8_workaround,
10029 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10031 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10033 (Target_arm::relocate_stub): Change parameter type of stub from
10034 Reloc_stub pointer to Stub pointer.
10035 (Insn_template::size, Insn_template::alignment): Handle
10036 THUMB16_SPECIAL_TYPE.
10037 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10038 Stub_table::update_data_size_and_addralign,
10039 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10041 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10042 (Stub_table::do_write): Ditto.
10043 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10045 2010-01-08 Ian Lance Taylor <iant@google.com>
10048 * symtab.h (class Symbol): Remove fields is_target_special_ and
10049 has_plt_offset_. Add field is_defined_in_discarded_section_.
10050 (Symbol::is_defined_in_discarded_section): New function.
10051 (Symbol::set_is_defined_in_discarded_section): New function.
10052 (Symbol::has_plt_offset): Rewrite.
10053 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10054 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10055 Don't initialize is_target_special_ or has_plt_offset_.
10056 Initialize is_defined_in_discarded_section_.
10057 (Symbol_table::add_from_relobj): If appropriate, set
10058 is_defined_in_discarded_section.
10059 * resolve.cc (Symbol::override_base_with_special): Don't test
10060 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10061 * target-reloc.h (relocate_section): Do special handling for
10062 symbols defined in discarded sections for global symbols as well
10065 2010-01-08 Ian Lance Taylor <iant@google.com>
10067 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10068 the SHT_SYMTAB case.
10070 2010-01-08 Ian Lance Taylor <iant@google.com>
10072 * object.cc (Sized_relobj::do_layout): Don't get confused if
10073 layout_eh_frame returns NULL.
10075 2010-01-08 Ian Lance Taylor <iant@google.com>
10078 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10079 dynamic symbol table, use the normal symbol table.
10080 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10083 2010-01-08 Ian Lance Taylor <iant@google.com>
10086 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10089 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10091 * version.cc (print_version): Change to "Copyright 2010".
10093 2010-01-08 Ian Lance Taylor <iant@google.com>
10097 * i386.cc (class Target_i386): Change return type of plt_section
10099 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10100 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10101 tls_desc_rel_ field.
10102 (Output_data_plt_i386::rel_tls_desc): New function.
10103 (Target_i386::rel_tls_desc_section): New function.
10104 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10105 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10106 R_386_TLS_DESC reloc in rel_tls_desc_section.
10107 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10108 Define struct Tlsdesc_info.
10109 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10110 (Target_x86_64::do_reloc_symbol_index): New function.
10111 (Target_x86_64::add_tlsdesc_info): New function.
10112 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10113 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10114 tlsdesc_rel_ field.
10115 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10117 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10118 (Target_x86_64::rela_tlsdesc_section): New function.
10119 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10121 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10122 (Target_x86_64::do_reloc_addend): New function.
10123 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10124 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10125 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10126 (Output_reloc::type): New function.
10127 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10128 (Output_reloc::is_target_specific): New function.
10129 (Output_reloc::target_arg): New function.
10130 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10131 absolute relocs and target specific relocs.
10132 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10133 add_target_specific.
10134 (class Output_data_reloc) [SHT_RELA]: Likewise.
10135 * output.cc (Output_reloc::Output_reloc): Add four new versions
10136 for absolute relocs and target specific relocs.
10137 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10138 (Output_reloc::get_symbol_index): Likewise.
10139 (Output_reloc::local_section_offset): Check that local_sym_index_
10140 is not TARGET_CODE or 0.
10141 (Output_reloc::symbol_value): Likewise.
10142 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10144 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10145 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10147 * layout.cc (add_target_dynamic_tags): Use output section for
10148 DT_PLTRELSZ and DT_JMPREL.
10150 2010-01-07 Ian Lance Taylor <iant@google.com>
10153 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10155 (class Output_data_reloc_generic): Define.
10156 (class Output_data_reloc_base): Change base class to
10157 Output_data_reloc_generic. Change add() method to call
10158 bump_relative_reloc_count for a relative reloc. Remove
10159 sort_relocs_ field.
10160 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10162 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10163 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10165 * layout.h (class Layout): Update declaration.
10167 2010-01-07 Ian Lance Taylor <iant@google.com>
10169 * output.h (class Output_data): Add const version of
10170 output_section and do_output_section.
10171 (class Output_section_data): Add const version of
10173 (class Output_section): Likewise.
10174 * layout.cc (Layout::add_target_dynamic_tags): New function.
10175 * layout.h (class Layout): Update declarations.
10176 * arm.cc (Target_arm::do_finalize_sections): Use
10177 add_target_dynamic_tags.
10178 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10179 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10180 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10181 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10183 2010-01-07 Ian Lance Taylor <iant@google.com>
10186 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10189 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10190 Ian Lance Taylor <iant@google.com>
10193 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10194 Xindex::read_symtab_xindex.
10196 2010-01-07 Doug Kwan <dougkwan@google.com>
10198 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10199 (Insn_template::thumb16_bcond_insn): New method declaration.
10200 (Insn_template): Fix spelling.
10201 (Stub::thumb16_special): New method declaration.
10202 (Stub::do_write): Define virtual method which was previously pure
10204 (Stub::do_thumb16_special): New method declaration.
10205 (Stub::do_fixed_endian_write): New template member.
10206 (Reloc_stub::do_write): Remove.
10207 (Reloc_stub::do_fixed_endian_write): Remove.
10208 (Cortex_a8_stub): New class definition.
10209 (Stub_factory::make_cortex_a8_stub): New method definition.
10210 (Stub_factory::Stub_factory): Add missing static storage class
10211 qualifier for elf32_arm_stub_a8_veneer_blx.
10213 2010-01-07 Ian Lance Taylor <iant@google.com>
10216 * options.h (class General_options): Add --warn-unresolved-symbols
10217 and --error-unresolved-symbols.
10218 * errors.cc (Errors::undefined_symbol): Implement
10219 --warn-unresolved-symbols.
10221 * options.h (class General_options): Add -z text and -z textoff.
10222 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10224 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10226 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10227 (Garbage_collection::cident_sections): New function.
10228 (Garbage_collection::add_cident_section): New function.
10229 (Garbage_collection::cident_sections_): New member.
10230 (gc_process_relocs): Add references to sections whose names are C
10232 * gold.h (cident_section_start_prefix): New constant.
10233 (cident_section_stop_prefix): New constant.
10234 (is_cident): New function.
10235 * layout.cc (Layout::define_section_symbols): Replace string constants
10236 with the newly defined constants.
10237 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10239 * testsuite/Makefile.am: Add gc_orphan_section_test.
10240 * testsuite/Makefile.in: Regenerate.
10241 * testsuite/gc_orphan_section_test.cc: New file.
10242 * testsuite/gc_orphan_section_test.sh: New file.
10244 2010-01-06 Ian Lance Taylor <iant@google.com>
10247 * options.h (class General_options): Add --warn-shared-textrel.
10248 * layout.cc (Layout::finish_dynamic_section): Implement
10249 --warn-shared-textrel.
10252 * options.h (class General_options): Add --warn-multiple-gp.
10254 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10256 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10257 $(THREADSLIB) and $(LIBDL).
10258 * Makefile.in: Rebuild.
10260 2010-01-06 Ian Lance Taylor <iant@google.com>
10263 * options.cc (General_options::parse_section_start): New function.
10264 (General_options::section_start): New function.
10265 (General_options::General_options): Initialize all members.
10266 * options.h: Include <map>
10267 (class General_options): Add --section-start. Add section_starts_
10269 * layout.cc (Layout::attach_allocated_section_to_segment): If
10270 --section-start was used, set the address of the segment. Remove
10271 local sort_sections.
10272 (Layout::relaxation_loop_body): If the address of the load segment
10273 has been set by --section-start, don't use it.
10274 * output.h (Output_segment::update_flags_for_output_section): New
10276 * output.cc (Output_segment::add_output_section): Call
10277 update_flags_for_output_section.
10279 2010-01-05 Ian Lance Taylor <iant@google.com>
10282 * options.h (class General_options): Add --undefined-version.
10283 * script.cc (struct Version_expression): Add was_matched_by_symbol
10285 (Version_script_info::matched_symbol): New function.
10286 (Version_script_info::get_symbol_version_helper): Call
10288 (Version_script_info::check_unmatched_names): New function.
10289 * script.h (class Version_script_info): Update declarations.
10290 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10292 * options.h (class General_options): Use DEFINE_bool_alias for
10293 allow_multiple_definition.
10294 * resolve.cc (Symbol_table::should_override): Don't test
10295 allow_multiple_definition.
10298 * options.h (class General_options): Add --cref.
10299 * main.cc (main): Print cref table if --cref. Don't close mapfile
10300 until after printing cref table.
10301 * cref.cc: Include "symtab.h".
10302 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10303 (Cref_table_compare::operator()): New function.
10304 (Cref_inputs::gather_cref): New function.
10305 (filecol): New static const.
10306 (Cref_inputs::print_cref): New function.
10307 (Cref::print_cref): New function.
10308 * cref.h: Include <cstdio>.
10309 (class Cref): Update declarations.
10310 * mapfile.h (Mapfile::file): New function.
10311 * object.h (class Object): Define Symbols. Declare virtual
10312 do_get_global_symbols.
10313 (Object::get_global_symbols): New function.
10314 * object.cc (Input_objects::add_object): Pass object to cref_ if
10316 (Input_objects::archive_start): Likewise.
10317 (Input_objects::archive_stop): Likewise.
10318 (Input_objects::print_cref): New function.
10319 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10320 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10322 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10324 * plugin.h (class Sized_pluginobj): Update declarations.
10326 2010-01-05 Ian Lance Taylor <iant@google.com>
10328 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10329 to is_default_version. Rename insdef to insdefault.
10330 (Symbol_table::add_from_relobj): Rename def to is_default_version
10331 and local to is_forced_local.
10332 (Symbol_table::add_from_pluginobj): Likewise.
10333 (Symbol_table::add_from_dynobj): Likewise.
10334 (Symbol_table::define_special_symbol): Rename insdef to
10337 2010-01-04 Ian Lance Taylor <iant@google.com>
10340 * options.h (class General_options): Add
10341 --allow-multiple-definition and -z muldefs.
10342 * resolve.cc (Symbol_table::should_override): Don't warn about a
10343 multiple symbol definition if --allow-multiple-definition or -z
10347 * options.h (class General_options): Add --add-needed and
10348 --copy-dt-needed-entries. Tweak --as-needed help entry.
10349 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10350 error if --copy-dt-needed-entries aka --add-needed is used and
10351 would cause a change in behaviour.
10354 * options.h (class General_options): Add -G as a short version of
10355 --shared. Add no-op options -assert, -g, and -i.
10357 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10359 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10360 check for .text or .gnu.linkonce.t sections.
10361 * icf.cc (Icf::find_identical_sections): Ditto.
10362 Change the detection for mangled function name within the section
10364 * icf.h (is_section_foldable_candidate): New function.
10366 2009-12-30 Ian Lance Taylor <iant@google.com>
10369 * options.h (class General_options): Permit two dashes with
10370 --retain-symbols-file.
10372 2009-12-30 Ian Lance Taylor <iant@google.com>
10375 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10376 don't put the file header and segment headers in the text
10380 * common.cc (Sort_commons::operator()): Stabilize sort when both
10382 (Symbol_table::do_allocate_commons_list): When allocating common
10383 symbols, skip a symbol which is no longer common.
10384 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10385 an object before checking its type.
10386 * testsuite/common_test_2.c: New file.
10387 * testsuite/common_test_3.c: New file.
10388 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10389 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10390 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10391 (common_test_2_pic.o, common_test_2.so): New targets.
10392 (common_test_3_pic.o, common_test_3.so): New targets.
10393 * testsuite/Makefile.in: Rebuild.
10396 * script.cc (read_input_script): If we see a new SECTIONS clause,
10397 and we have added an input section, give an error.
10398 * layout.h (class Layout): Add have_added_input_section function.
10399 Add have_added_input_section_ field.
10400 * layout.cc (Layout::Layout): Initialize
10401 have_added_input_section_.
10402 (Layout::layout): Set have_added_input_section_.
10403 (Layout::layout_eh_frame): Likewise.
10405 2009-12-30 Ian Lance Taylor <iant@google.com>
10408 * options.h (class General_options): Add --sort-common option.
10409 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10410 * common.cc (Sort_common): Add sort_order parameter to
10411 constructor. Add sort_order_ field.
10412 (Sort_commons::operator): Check sort_order_.
10413 (Symbol_table::allocate_commons): Determine the sort order.
10414 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10415 Change all callers.
10416 (Symbol_table::do_allocate_commons_list): Likewise.
10418 2009-12-30 Ian Lance Taylor <iant@google.com>
10421 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10422 symbols from this object, don't change the visibility of an
10424 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10426 2009-12-30 Ian Lance Taylor <iant@google.com>
10429 * script.h (class Version_script_info): Define Language enum.
10430 Update declarations. Define Glob, Exact, and Lookup types. Add
10431 new fields globals_, locals_, and is_finalized_.
10432 * script.cc: Various formatting fixes.
10433 (class Parser_closure): Change language_stack_ from a vector of
10434 std::string to one of Version_script_info::Language. Adjust all
10436 (class Lazy_demangler): Remove.
10437 (struct Version_expression): Change language from std::string to
10438 Version_script_info::Language.
10439 (Version_script_info::Version_script_info): New function.
10440 (Version_script_info::~Version_script_info): Don't call clear.
10441 (Version_script_info::finalize): New function.
10442 (Version_script_info::build_lookup_tables): New function.
10443 (Version_script_info::build_expression_list_lookup): New
10445 (Version_script_info::get_symbol_version_helper): Rewrite to use
10447 (Version_script_info::print_expression_list): Adjust to use
10448 Version_script_info::Language.
10449 (script_push_lex_into_version_mode): Check that the version script
10450 has not been finalized.
10451 (version_script_push_lang): Change language string to
10452 Version_script_info::Language.
10453 * options.cc (Command_line::version_script): New function.
10454 * options.h (class General_options): Add finalize_dynamic_list
10455 function. Change version_script from declaration to definition.
10456 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10457 * testsuite/version_script.map: Remove duplicate def of foo.
10458 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10459 version_script.map.
10460 * testsuite/Makefile.in: Rebuild.
10462 2009-12-30 Ian Lance Taylor <iant@google.com>
10465 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10466 if the input symbol index is 0, make the output symbol index 0.
10468 2009-12-30 Ian Lance Taylor <iant@google.com>
10471 * options.h (class General_options): Add -x/--discard-all.
10472 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10473 --discard-all. If the local symbol needs a dynamic entry, check
10474 that before handling --discard-locals.
10476 2009-12-30 Ian Lance Taylor <iant@google.com>
10479 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10481 (Output_segment::add_output_section): Don't change the flags if
10482 the type is PT_TLS.
10485 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10486 GNU hash table if they need a dynamic value. Otherwise, don't add
10487 them if they are defined in a dynamic object or are forced local.
10489 2009-12-29 Ian Lance Taylor <iant@google.com>
10492 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10493 .gnu.hash table for a 32-bit target.
10496 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10497 regular and a dynamic object only needs a dynamic symbol table
10498 entry if it is externally visible.
10501 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10502 constructor. Add global_offset_table_ field.
10503 (Target_i386::got_section): Set global_offset_table_.
10504 (Target_i386::do_finalize_sections): Set global_offset_table_
10506 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10507 in constructor. Add global_offset_table_ field.
10508 (Target_x86_64::got_section): Set global_offset_table_.
10509 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10512 * layout.cc (Layout::Layout): Initialize increase_relro_.
10513 (Layout::get_output_section): Add is_relro, is_last_relro, and
10514 is_first_non_relro parameters. Change all callers.
10515 (Layout::choose_output_section): Likewise.
10516 (Layout::add_output_section_data): Likewise.
10517 (Layout::make_output_section): Likewise.
10518 (Layout::set_segment_offsets): Clear increase_relro when using a
10520 * layout.h (class Layout): Add increase_relro method. Add
10521 increase_relro_ field. Update declarations.
10522 * output.cc (Output_section::Output_section): Initialize
10523 is_last_relro_ and is_first_non_relro_.
10524 (Output_segment::add_output_section): Group relro sections is
10525 do_sort is true. Handle is_last_relro and is_first_non_relro.
10526 (Output_segment::maximum_alignment): Remove relro handling.
10527 (Output_segment::set_section_addresses): Add increase_relro
10528 parameter. Change all callers. Add initial alignment to align
10529 relro sections on separate page. Remove old relro handling.
10530 (Output_segment::set_section_list_addresses): Remove in_relro
10531 parameter. Change all callers.
10532 (Output_segment::set_offset): Add increase parameter. Change all
10533 callers. Remove old relro handling.
10534 * output.h (class Output_section): Add new methods: is_last_relro,
10535 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10536 Add is_last_relro_ and is_first_non_relro_ fields.
10537 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10538 Create separate .got.plt section. Call increase_relro.
10539 * x86_64.cc (Target_x86_64::got_section): Likewise.
10540 * testsuite/relro_script_test.t: Add .got.plt.
10543 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10544 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10545 (Layout::finalize): Call set_dynamic_symbol_size.
10546 (Layout::set_dynamic_symbol_size): New function.
10547 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10548 set_dynamic_symbol_size.
10551 * output.h (class Output_section): Add is_entsize_zero_ field.
10552 * output.cc (Output_section::Output_section): Initialize
10554 (Output_section::set_entsize): If two different entsizes are
10555 requested, force it to zero.
10556 (Output_section::add_input_section): Set flags for .debug_str
10557 before updating section flags. Set entsize.
10558 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10559 and SHF_STRING if all input sections have those flags.
10561 2009-12-29 Rafael Espindola <espindola@google.com>
10563 * main.cc (main): Fix the sys time reporting.
10564 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10567 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10569 * options.cc (General_options::parse_version): Allow -v to exit
10570 without an error if there is nothing to link.
10572 2009-12-29 Ian Lance Taylor <iant@google.com>
10574 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10575 using a version of gcc before 4.1.
10576 * configure: Rebuild.
10578 2009-12-28 Chris Demetriou <cgd@google.com>
10580 * attributes.cc (Output_attributes_section_data::do_write): Use
10581 std::vector::front rather than std::vector::data.
10583 2009-12-28 Ian Lance Taylor <iant@google.com>
10585 * symtab.h (class Symbol_table): Add enum Defined.
10586 * resolve.cc (Symbol_table::should_override): Add defined
10587 parameter. Change all callers. Test whether object is NULL
10588 before calling a method on it.
10589 (Symbol_table::report_resolve_problem): Add defined parameter.
10590 Change all callers.
10591 (Symbol_table::should_override_with_special): Likewise.
10592 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10593 parameter. Change all callers.
10594 (Symbol_table::do_define_in_output_data): Likewise.
10595 (Symbol_table::define_in_output_segment): Likewise.
10596 (Symbol_table::do_define_in_output_segment): Likewise.
10597 (Symbol_table::define_as_constant): Likewise.
10598 (Symbol_table::do_define_as_constant): Likewise.
10599 * script.h (class Symbol_assignment): Add is_defsym parameter to
10600 constructor; change all callers.
10601 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10602 parameter. Change all callers. Add is_defsym_ field.
10603 (class Parser_closure): Add parsing_defsym parameter to
10604 constructor; change all callers. Add parsing_defsym accessor
10605 function. Add parsing_defsym_ field.
10607 2009-12-28 Ian Lance Taylor <iant@google.com>
10609 * gold.cc (queue_middle_tasks): Fix formatting.
10610 * object.cc (Relobj::is_section_name_included): Likewise.
10612 2009-12-23 Ian Lance Taylor <iant@google.com>
10614 * i386.cc (Target_i386::do_calls_non_split): Recognize
10615 -fsplit-stack prologue for a function with a static chain.
10616 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10617 -fsplit-stack prologue when using %r11.
10619 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10621 * options.cc (General_options::parse_version): Make -v continue and do
10622 the link like GNU ld does.
10624 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10626 * Makefile.am (CCFILES): Add timer.cc.
10627 (HFILES): Add timer.h.
10628 * configure.ac: Check for sysconf and times.
10629 * main.cc: include timer.h.
10630 (main): Use Timer instead of get_run_time.
10633 * workqueue.cc: include timer.h.
10634 (Workqueue::find_and_run_task):
10635 Report user, sys and wall time.
10636 * Makefile.in: Regenerate.
10637 * config.in: Regenerate.
10638 * configure: Regenerate.
10640 2009-12-16 Doug Kwan <dougkwan@google.com>
10642 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10644 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10645 relaxed input sections.
10646 * output.cc (Output_section::find_relaxed_input_section): Change
10647 return type to Output_relaxed_input_section pointer. Adjust code
10648 for new type of relaxed_input_section_map_.
10649 * output.h (Output_section::find_relaxed_input_section): Change
10650 return type to Output_relaxed_input_section pointer.
10651 (Output_section::Output_relaxed_input_section_by_input_section_map):
10653 (Output_section::relaxed_input_section_map_): Change type to
10654 Output_section::Output_relaxed_input_section_by_input_section_map.
10655 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10658 2009-12-15 Ian Lance Taylor <iant@google.com>
10660 * layout.cc (Layout::create_shstrtab): Only write out after input
10661 sections if we are compressing debug sections.
10663 2009-12-15 Ian Lance Taylor <iant@google.com>
10665 * archive.cc (Archive::add_symbols): Only look up a symbol without
10666 a version if there is, in fact, a version.
10668 2009-12-14 Ian Lance Taylor <iant@google.com>
10670 Revert -Wshadow changes, all changes from:
10671 2009-12-11 Doug Kwan <dougkwan@google.com>
10672 2009-12-11 Nick Clifton <nickc@redhat.com>
10673 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10675 2009-12-11 Doug Kwan <dougkwan@google.com>
10677 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10679 * attributes.cc (Object_attribute::size): Ditto.
10680 (Attributes_section_data::size): Ditto.
10681 (Attributes_section_data::Attributes_section_data): Ditto.
10682 (Output_attributes_section_data::do_write): Ditto.
10683 * attributes.h (Object_attribute::set_type): Ditto.
10684 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10686 2009-12-11 Nick Clifton <nickc@redhat.com>
10688 * archive.cc: Fix shadowed variable warnings.
10689 * arm.cc: Likewise.
10690 * compressed_output.cc: Likewise.
10691 * compressed_output.h: Likewise.
10692 * configure: Likewise.
10693 * dwarf_reader.cc: Likewise.
10694 * dynobj.cc: Likewise.
10695 * dynobj.h: Likewise.
10696 * ehframe.cc: Likewise.
10697 * ehframe.h: Likewise.
10698 * errors.cc: Likewise.
10699 * expression.cc: Likewise.
10700 * fileread.cc: Likewise.
10701 * fileread.h: Likewise.
10702 * freebsd.h: Likewise.
10703 * i386.cc: Likewise.
10704 * icf.cc: Likewise.
10705 * incremental.h: Likewise.
10706 * layout.cc: Likewise.
10707 * layout.h: Likewise.
10708 * mapfile.cc: Likewise.
10709 * merge.cc: Likewise.
10710 * merge.h: Likewise.
10711 * object.cc: Likewise.
10712 * object.h: Likewise.
10713 * options.h: Likewise.
10714 * output.cc: Likewise.
10715 * output.h: Likewise.
10716 * parameters.cc: Likewise.
10717 * plugin.cc: Likewise.
10718 * powerpc.cc: Likewise.
10719 * reduced_debug_output.cc: Likewise.
10720 * reduced_debug_output.h: Likewise.
10721 * reloc.cc: Likewise.
10722 * reloc.h: Likewise.
10723 * resolve.cc: Likewise.
10724 * script-sections.cc: Likewise.
10725 * script.cc: Likewise.
10726 * script.h: Likewise.
10727 * sparc.cc: Likewise.
10728 * symtab.cc: Likewise.
10729 * symtab.h: Likewise.
10730 * target-select.cc: Likewise.
10731 * target-select.h: Likewise.
10732 * token.h: Likewise.
10733 * workqueue.cc: Likewise.
10734 * workqueue.h: Likewise.
10735 * x86_64.cc: Likewise.
10737 2009-12-10 Doug Kwan <dougkwan@google.com>
10739 * arm.cc (attributes.h): New include.
10740 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10741 (Arm_relobj::~Arm_relobj): Delete object pointed by
10742 attributes_section_data_.
10743 (Arm_relobj::attributes_section_data): New method definition.
10744 (Arm_relobj::attributes_section_data_): New data member declaration.
10745 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10746 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10747 attributes_section_data_.
10748 (Arm_dynobj::attributes_section_data): New method definition.
10749 (Arm_dynobj::attributes_section_data_): New data member declaration.
10750 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10751 initialization value of may_use_blx_ to false.
10752 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10753 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10754 object attributes to compute results instead of hard-coding.
10755 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10756 Target_arm::get_secondary_compatible_arch,
10757 Target_arm::set_secondary_compatible_arch
10758 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10759 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10760 New method declarations.
10761 (Target_arm::get_aeabi_object_attribute): New method definition.
10762 (Target_arm::attributes_section_data_): New data member declaration.
10763 (read_arm_attributes_section): New template definition.
10764 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10765 (Arm_dynobj::do_read_symbols): Ditto.
10766 (Target_arm::do_finalize_sections): Merge attributes sections from
10767 input. Check for BLX use after attributes section merging.
10768 Fix __exidx_start and __exidx_end visibility. Create an
10769 .ARM.attributes section if necessary.
10770 (Target_arm::get_secondary_compatible_arch,
10771 Target_arm::set_secondary_compatible_arch,
10772 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10773 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10774 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10775 New method definitions.
10777 2009-12-09 Ian Lance Taylor <iant@google.com>
10779 * plugin.cc (Plugin::load): Don't cast from void* to a function
10782 2009-12-09 Ian Lance Taylor <iant@google.com>
10784 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10785 information fields.
10787 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10789 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10790 Replace two_file_shared_1.so with two_file_shared_2.so.
10791 * testsuite/Makefile.in: Regenerated.
10793 2009-12-08 Doug Kwan <dougkwan@google.com>
10795 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10796 (HFILES): Add attributes.h and int_encoding.h.
10797 * Makefile.in: Regenerate.
10798 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10799 function definitions to int_encoding.cc
10800 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10801 prototypes to int_encoding.h
10802 * reduced_debug_output.cc (int_encoding.h): New include.
10803 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10804 function definitions to int_encoding.cc
10805 (insert_into_vector, read_from_pointer): Move template definitions to
10807 * attributes.cc: New file.
10808 * attributes.h: New file.
10809 * int_encoding.cc: New file.
10810 * int_encoding.h: New file.
10812 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
10815 * incremental-dump.cc (dump_incremental_inputs): New.
10816 (main): Use dump_incremental_inputs.
10818 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10821 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10822 checking elfcpp::STT_FUNC.
10823 (Target_i386::Relocate::relocate): Likewise.
10824 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10826 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10827 symbols from shared libraries into normal FUNC symbols.
10829 * symtab.h (Symbol): Add is_func and use it.
10831 2009-12-05 Doug Kwan <dougkwan@google.com>
10833 * arm.cc (Target_arm::arm_info): Initialize new fields
10834 attributes_section and attributes_vendor.
10835 * i386.cc (Target_i386::i386_info): Same.
10836 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10837 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10838 fields attributes_section and attributes_vendor.
10839 * sparc.cc (Target_sparc::sparc_info): Same.
10840 * target.h (Target::attributes_section, Target::attributes_vendor,
10841 Target::is_attributes_section, Target::attribute_arg_type,
10842 Target::attributes_order): New method definitions.
10843 (Target::Target_info::attributes_section,
10844 Target::Target_info::attributes_vendor): New fields.
10845 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10846 virtual method definitions.
10847 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10848 attributes_section and attributes_vendor.
10849 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10851 2009-12-05 Doug Kwan <dougkwan@google.com>
10853 * arm.cc: Update comments about interworking and stub generation.
10854 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10855 considered as non-PIC.
10856 (Arm_relocate_functions::base_abs): Fix formatting.
10857 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10858 of function to use GOT entry address instead of offset.
10859 (Target_arm::Scan::global): Issue an error if a symbol would need a
10860 PLT does not get one because it is untyped. Remove code to create
10861 dynamic symbols for relative branches.
10862 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10863 takes unsigned integer instead of boolean.
10865 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10867 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10868 (two_file_test_LDADD): Likewise.
10869 (common_test_1_LDADD): Likewise.
10870 (exception_test_LDADD) Likewise.
10871 (weak_test_LDADD): Likewise.
10872 (many_sections_test_LDADD): Likewise.
10873 (initpri1_LDADD): Likewise.
10874 (script_test_1_LDADD): Likewise.
10875 (script_test_2_LDADD): Likewise.
10876 (justsyms_LDADD): Likewise.
10877 (binary_test_LDADD): Likewise.
10878 (large_LDADD): Likewise.
10879 * testsuite/Makefile.in: Regenerated.
10881 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10883 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10884 (Symbol_table::override_with_special): Likewise.
10885 (Symbol_table::add_from_object): Likewise.
10887 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10889 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10890 Don't set the data_offset twice.
10892 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10894 * testsuite/Makefile.in: Regenerate.
10896 2009-12-03 Doug Kwan <dougkwan@google.com>
10898 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10899 (Target_arm::do_finalize_sections): Add parameter for symbol table
10900 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10901 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10902 parameter for symbol table pointer.
10903 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10904 an additional parameter for a pointer to symbol table.
10905 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10906 parameter for a symbol table pointer.
10907 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10908 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10910 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10911 parameter for a symbol table pointer.
10913 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
10915 * incremental.cc (Incremental_inputs_header)
10916 (Incremental_inputs_header_write, Incremental_inputs_entry)
10917 (Incremental_inputs_entry_write): Move ...
10918 * incremental.h (Incremental_inputs_header)
10919 (Incremental_inputs_header_write, Incremental_inputs_entry)
10920 (Incremental_inputs_entry_write): here.
10922 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10924 * incremental.cc (make_sized_incremental_binary): Set the target.
10925 Error if it is incompatible.
10926 * output.h (Output_file): Add filename method.
10928 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10930 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10931 from the get_* methods.
10933 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10935 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10936 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10937 Write 0 for the data_offset of scripts.
10939 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
10941 * testsuite/Makefile.am: Add the incremental_test.sh test.
10942 * testsuite/incremental_test.sh: New.
10943 * testsuite/incremental_test_1.c: New.
10944 * testsuite/incremental_test_2.c: New.
10946 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
10948 * incremental-dump.cc (main): Fix typos.
10950 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
10953 * incremental-dump.cc (main): Use llu to print 64 bit values.
10955 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10956 H.J. Lu <hongjiu.lu@intel.com>
10958 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10960 (incremental_dump_LDADD): Likewise.
10961 * Makefile.in: Regenerated.
10963 2009-11-25 Doug Kwan <dougkwan@google.com>
10967 2009-11-25 Doug Kwan <dougkwan@google.com>
10969 * arm.cc (Target_arm::Target_arm): Move method definition
10970 outside of class definition. Add code to handle
10971 --target1-rel, --target1-abs and --target2= options.
10972 (Target_arm::get_reloc_reloc_type): Change method to be
10973 non-static and const.
10974 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10975 New data member declaration.
10976 (Target_arm::Scan::local, Target_arm::Scan::global,
10977 Target_arm::Relocate::relocate,
10978 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10979 Adjust call to Target_arm::get_real_reloc_type.
10980 (Target_arm::get_real_reloc_type): Use command line options
10981 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10982 * options.h (--target1-rel, --target1-abs, --target2): New
10985 2009-11-25 Doug Kwan <dougkwan@google.com>
10987 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10988 class definition. Add code to handle --target1-rel, --target1-abs
10989 and --target2= options.
10990 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10992 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10993 member declaration.
10994 (Target_arm::Scan::local, Target_arm::Scan::global,
10995 Target_arm::Relocate::relocate,
10996 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10997 call to Target_arm::get_real_reloc_type.
10998 (Target_arm::get_real_reloc_type): Use command line options to
10999 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11000 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11003 2009-11-25 Doug Kwan <dougkwan@google.com>
11005 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11006 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11007 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11009 (Arm_relocate_functions::thm_call): Replace body with a call to
11010 Arm_relocate_functions::thumb_branch_common.
11011 (Arm_relocate_functions::thm_jump24,
11012 Arm_relocate_functions::thm_xpc22): New method definitions.
11013 (Arm_relocate_functions::thumb_branch_common): New method definition.
11014 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11016 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11017 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11019 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11021 * Makefile.am: Build incremental-dump
11022 * Makefile.in: Regenerate.
11023 * incremental-dump.cc: New.
11024 * incremental.cc (Incremental_inputs_header_data,
11025 Incremental_inputs_entry_data): Move to incremental.h
11026 * incremental.h: (Incremental_inputs_header_data,
11027 Incremental_inputs_entry_data): Move from incremental.cc
11029 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11031 * incremental.cc (Incremental_inputs_header,
11032 Incremental_inputs_header_write, Incremental_inputs_entry,
11033 Incremental_inputs_entry_write): Add a typedef with the data type.
11035 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11037 * incremental.cc (Incremental_inputs_header,
11038 Incremental_inputs_header_write, Incremental_inputs_entry,
11039 Incremental_inputs_entry_write): Update comment about which
11040 type has the filed descriptions.
11042 2009-11-15 Doug Kwan <dougkwan@google.com>
11044 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11045 (Arm_relocate_functions::arm_branch_common): Change method defintion
11046 in class definition to a method declaration and update list of formal
11048 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11049 Arm_relocation_functions::jump24): Adjust call to
11050 Arm_relocate_functions::arm_branch_common. Update list of formal
11052 (Arm_relocate_functions::xpc25): New method definition.
11053 (Arm_relocate_functions::arm_branch_common): Move method defintion
11054 out from class definition. Use stubs for mode-switching and extending
11056 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11057 specially. Change code to enable use of stubs in ARM branches.
11059 2009-11-10 Doug Kwan <dougkwan@google.com>
11061 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11062 in method declaration.
11063 (Target_arm::relocate_stub): New method declaration.
11064 (Target_arm::default_target): Change to return a pointer instead of
11066 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11067 Target_arm::default_target.
11068 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11070 (Target_arm::relocate_section): Adjust view.
11071 (Target_arm::relocate_stub): New method definition.
11073 2009-11-10 Doug Kwan <dougkwan@google.com>
11075 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11077 * incremental.cc (open_incremental_binary): Initialized local
11078 variables to avoid warnings.
11079 * object.cc (make_elf_object): Ditto.
11080 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11083 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11086 * testsuite/plugin_test.c: Include "config.h".
11088 2009-11-09 Doug Kwan <dougkwan@google.com>
11090 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11091 (arm_symbol_value): Remove.
11092 (Arm_relocate_functions::arm_branch_common,
11093 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11094 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11095 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11096 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11097 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11098 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11099 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11100 Arm_relocate_functions::thm_mobw_abs_nc,
11101 Arm_relocate_functions::thm_mov_abs,
11102 Arm_relocate_functions::movw_prel_nc,
11103 Arm_relocate_functions::thm_movt_abs,
11104 Arm_relocate_functions::movt_prel,
11105 Arm_relocate_functions::thm_movw_prel_nc,
11106 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11107 (Target_arm::Relocate::relocate): Only decompose address into two
11108 parts if relocation type uses the thumb-bit and pass the actual
11109 bit instead of a flag indicating that the thumb-bit is used. Adjust
11110 calls to methods in Arm_relocate_functions for this change.
11112 2009-11-08 Ian Lance Taylor <iant@google.com>
11115 * reloc.cc: Instantiate
11116 Sized_relobj::initialize_input_to_output_maps and
11117 Sized_relobj:free_input_to_output_maps.
11119 2009-11-06 Ian Lance Taylor <iant@google.com>
11122 * defstd.cc (in_segment): Set only_if_ref true for "end".
11124 2009-11-06 Doug Kwan <dougkwan@google.com>
11126 * arm.cc (class Reloc_stub): Correct a comment.
11127 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11128 (Target_arm::scan_section_for_stubs): New method declaration.
11129 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11130 Change methods from private to protected.
11131 (Target_arm::do_may_relax): New method definition.
11132 (Target_arm::do_relax, Target_arm::group_sections,
11133 Target_arm::scan_reloc_for_stub,
11134 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11135 (Target_arm::arm_input_section_map_): New data member declaration.
11136 (Target_arm::scan_reloc_for_stub,
11137 Target_arm::scan_reloc_section_for_stubs,
11138 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11139 Target_arm::do_relax): New method definitions.
11141 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11143 * configure.ac: Check for (struct stat)::st_mtim
11144 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11145 * config.in: Regenerate.
11146 * configure: Regenerate.
11148 2009-11-05 Ian Lance Taylor <iant@google.com>
11151 * output.cc (Output_segment::add_output_section): Add missing
11154 2009-11-04 Ian Lance Taylor <iant@google.com>
11157 * object.h (class Object): Add is_needed and set_is_needed
11158 methods. Add is_needed_ field. Make bool fields into bitfields.
11159 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11160 defined in a dynamic object and referenced by a regular object,
11161 set is_needed for the dynamic object.
11162 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11163 if the file is marked with as_needed and it is not needed.
11165 2009-11-04 Ian Lance Taylor <iant@google.com>
11168 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11169 tags if data is discarded by linker script.
11170 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11171 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11172 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11173 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11175 2009-11-04 Ian Lance Taylor <iant@google.com>
11177 * layout.cc (Layout::get_output_section): Add is_interp and
11178 is_dynamic_linker_section parameters. Change all callers.
11179 (Layout::choose_output_section): Likewise.
11180 (Layout::make_output_section): Likewise.
11181 (Layout::add_output_section_data): Add is_dynamic_linker_section
11182 parameter. Change all callers.
11183 * layout.h (class Layout): Update declarations.
11184 * output.h (class Output_section): Add is_interp, set_is_interp,
11185 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11186 Add is_interp_, is_dynamic_linker_section_ fields. Change
11187 generate_code_fills_at_write_ to a bitfield.
11188 * output.cc (Output_section::Output_sections): Initialize new
11190 (Output_segment::add_output_section): Add do_sort parameter.
11191 Change all callers.
11193 2009-11-03 Ian Lance Taylor <iant@google.com>
11196 * options.h (class General_options): Add --warn-common.
11197 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11198 merging two common symbols.
11199 (Symbol_table::should_override): Handle --warn-common when merging
11200 a common symbol with a defined symbol. Use report_resolve_problem
11201 for multiple definitions.
11202 (Symbol_table::report_resolve_problem): New function.
11203 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11205 2009-11-03 Doug Kwan <dougkwan@google.com>
11207 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11209 (Target_arm::stub_factory): New method definition.
11210 (Target_arm::new_arm_input_section,
11211 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11212 Target_arm::reloc_uses_thumb_bit): New method declarations.
11213 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11214 New type definitions.
11215 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11216 member declarations.
11217 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11218 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11219 New method definitions.
11221 2009-11-03 Ian Lance Taylor <iant@google.com>
11223 * options.h (class General_options): Add --warn_constructors.
11225 2009-11-03 Ian Lance Taylor <iant@google.com>
11228 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11229 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11231 2009-11-03 Ian Lance Taylor <iant@google.com>
11234 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11235 --msgid-bugs-address.
11236 (install-pdf): New target.
11237 (install-data_yes): Look up one directory to find mkinstalldirs.
11239 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11241 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11244 2009-10-30 Doug Kwan <dougkwan@google.com>
11246 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11248 2009-10-30 Doug Kwan <dougkwan@google.com>
11250 * arm.cc (Stub_addend_reader): New struct template definition
11251 and partial specializations.
11252 (Stub_addend_reader::operator()): New method definition for a
11253 partially specialized template.
11255 2009-10-30 Doug Kwan <dougkwan@google.com>
11257 * arm.cc (Arm_relobj::processor_specific_flags): New method
11259 (Arm_relobj::do_read_symbols): New method declaration.
11260 (Arm_relobj::processor_specific_flags_): New data member declaration.
11261 (Arm_dynobj): New class definition.
11262 (Target_arm::do_finalize_sections): Add input_objects parameter.
11263 (Target_arm::do_adjust_elf_header): New method declaration.
11264 (Target_arm::are_eabi_versions_compatible,
11265 (Target_arm::merge_processor_specific_flags): New method declaration.
11266 (Target_arm::do_make_elf_object): New overloaded method definitions
11268 (Arm_relobj::do_read_symbols): New method definition.
11269 (Arm_dynobj::do_read_symbols): Ditto.
11270 (Target_arm::do_finalize_sections): Add input_objects parameters.
11271 Merge processor-specific flags from all input objects.
11272 (Target_arm::are_eabi_versions_compatible,
11273 Target_arm::merge_processor_specific_flags,
11274 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11275 New method definitions.
11276 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11277 Input_objects pointer type parameter.
11278 * layout.cc (Layout::finalize): Pass input objects to target's.
11279 finalize_sections function.
11280 * output.cc (Output_file_header::do_sized_write): Set ELF file
11281 header's processor-specific flags.
11282 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11283 Input_objects pointer type parameter.
11284 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11285 * target.h (Input_objects): New forward class declaration.
11286 (Target::processor_specific_flags,
11287 Target::are_processor_specific_flags_sect): New method definitions.
11288 (Target::finalize_sections): Add input_objects parameter.
11289 (Target::Target): Initialize processor_specific_flags_ and
11290 are_processor_specific_flags_set_.
11291 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11293 (Target::set_processor_specific_flags): New method definition.
11294 (Target::processor_specific_flags_,
11295 Target::are_processor_specific_flags_set_): New data member
11297 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11298 Input_objects pointer type parameter.
11300 2009-10-30 Doug Kwan <dougkwan@google.com>
11302 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11304 2009-10-28 Ian Lance Taylor <iant@google.com>
11306 * object.h (class Relobj): Drop options parameter from
11307 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11308 do_scan_relocs, do_relocate. Change all callers.
11309 (class Sized_relobj): Drop options parameters from
11310 do_gc_process_relocs, do_scan_relocs, do_relocate,
11311 do_relocate_sections, relocate_sections, emit_relocs_scan,
11312 emit_relocs_scan_reltype. Change all callers.
11313 (struct Relocate_info): Remove options field and all references to
11315 * reloc.h (class Read_relocs): Remove options constructor
11316 parameter and options_ field. Change all callers.
11317 (class Gc_process_relocs, class Scan_relocs): Likewise.
11318 (class Relocate_task): Likewise.
11319 * target-reloc.h (scan_relocs): Remove options parameter. Change
11321 (scan_relocatable_relocs): Likewise.
11322 * target.h (class Sized_target): Remove options parameter from
11323 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11325 * gc.h (gc_process_relocs): Remove options parameter. Change all
11327 * arm.cc: Update functions to remove options parameters.
11328 * i386.cc: Likewise.
11329 * powerpc.cc: Likewise.
11330 * sparc.cc: Likewise.
11331 * x86_64.cc: Likewise.
11332 * testsuite/testfile.cc: Likewise.
11334 2009-10-28 Doug Kwan <dougkwan@google.com>
11336 * arm.cc (Arm_relobj): New class definition.
11337 (Arm_relobj::scan_sections_for_stubs,
11338 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11339 New method definitions.
11341 2009-10-28 Cary Coutant <ccoutant@google.com>
11343 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11344 (Plugin::cleanup_done_): New member.
11345 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11346 (Plugin_manager::cleanup_done_): Remove.
11347 (Plugin_manager::add_input_file): Edit error message.
11348 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11349 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11351 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11353 * fileread.cc: (File_read::View::~View): Use the new
11354 data_ownership_ filed.
11355 (File_read::~File_read): Dispose the new whole_file_view_.
11356 (File_read::open): Mmap the whole file if needed.
11357 (File_read::open): Use whole_file_view_ instead of contents_.
11358 (File_read::find_view): Use whole_file_view_ if applicable.
11359 (File_read::do_read): Use whole_file_view_ instead of contents_.
11360 (File_read::make_view): Use whole_file_view_ instead of contents_,
11361 update File_read::View::View call.
11362 (File_read::find_or_make_view): Update File_read::View::View
11364 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11366 (File_read::View::Data_ownership): New enum.
11367 (File_read::View::View): Replace bool mapped_ with Data_ownership
11369 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11370 (File_read::View::data_ownership_): New field.
11371 (File_read::contents_): Remove (replaced by whole_file_view_).
11372 (File_read::whole_file_view_): New field.
11373 * options.h (class General_options): Add --keep-files-mapped.
11375 2009-10-27 Cary Coutant <ccoutant@google.com>
11377 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11378 * testsuite/Makefile.am (plugin_test_5): New test case.
11379 * testsuite/Makefile.in: Regenerate.
11381 2009-10-25 Doug Kwan <dougkwan@google.com>
11383 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11384 from private to protected to allow access by child class.
11385 (Sized_relobj::do_relocate_sections): New method declaration.
11386 (Sized_relobj::relocate_sections): Virtualize.
11387 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11388 Sized_relobj::relocate_sections. Instantiate template explicitly
11389 for different target sizes and endianity.
11391 2009-10-24 Doug Kwan <dougkwan@google.com>
11393 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11394 (Arm_input_section::as_arm_input_section): New method.
11395 (Arm_output_section): New class definition.
11396 (Arm_output_section::create_stub_group,
11397 Arm_output_section::group_sections): New method definitions.
11399 2009-10-22 Doug Kwan <dougkwan@google.com>
11401 * arm.cc (Arm_input_section): New class definition.
11402 (Arm_input_section::init, Arm_input_section:do_write,
11403 Arm_input_section::set_final_data_size,
11404 Arm_input_section::do_reset_address_and_file_offset): New method
11407 2009-10-21 Doug Kwan <dougkwan@google.com>
11409 * arm.cc (Stub_table, Arm_input_section): New forward class
11411 (Stub_table): New class defintion.
11412 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11413 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11414 New method definition.
11416 2009-10-21 Doug Kwan <dougkwan@google.com>
11418 * arm.cc: Update copyright comments.
11419 (Target_arm): New forward class template declaration.
11420 (Arm_address): New type.
11421 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11422 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11423 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11425 (Insn_template): Same.
11426 (DEF_STUBS): New macro.
11427 (Stub_type): New enum type.
11428 (Stub_template): New class definition.
11430 (Reloc_stub): Same.
11431 (Stub_factory): Same.
11432 (Target_arm::Target_arm): Initialize may_use_blx_ and
11433 should_force_pic_veneer_.
11434 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11435 Target_arm::should_force_pic_veneer,
11436 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11437 Target_arm::using_thumb_only, Target_arm:;default_target): New
11439 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11440 New data member declarations.
11441 (Insn_template::size, Insn_template::alignment): New method defintions.
11442 (Stub_template::Stub_template): New method definition.
11443 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11444 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11445 (Stub_factory::Stub_factory): New method definition.
11446 * gold.h (string_hash): New template.
11447 * output.h (Input_section_specifier::hash_value): Use
11449 (Input_section_specifier::string_hash): Remove.
11450 * stringpool.cc (Stringpool_template::string_hash): Use
11453 2009-10-20 Doug Kwan <dougkwan@google.com>
11455 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11456 symbols of relaxed input sections.
11457 * output.h (Output_section::find_relaxed_input_section): Make
11460 2009-10-16 Doug Kwan <dougkwan@google.com>
11462 * dynobj.cc (Versions::Versions): Initialize version_script_.
11463 Only insert base version symbol definition for a shared object
11464 if version script defines any version versions.
11465 (Versions::define_base_version): New method definition.
11466 (Versions::add_def): Check that base version is not needed.
11467 (Versions::add_need): Define base version lazily.
11468 * dynobj.h (Versions::define_base_version): New method declaration.
11469 (Versions::needs_base_version_): New data member declaration.
11470 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11471 (check_DATA): Add no_version_test.stdout.
11472 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11474 * testsuite/Makefile.in: Regenerate.
11475 * testsuite/no_version_test.c: New file.
11476 * testsuite/no_version_test.sh: Ditto.
11478 2009-10-16 Doug Kwan <dougkwan@google.com>
11480 * expression.cc (class Segment_start_expression): New class definition.
11481 (Segment_start_expression::value): New method definition.
11482 (script_exp_function_segment_start): Return a new
11483 Segment_start_expression.
11484 * gold/script-c.h (script_saw_segment_start_expression): New function
11486 * script-sections.cc (Script_sections::Script_sections): Initialize
11487 SAW_SEGMENT_START_EXPRESSION_ to false.
11488 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11489 and -Tbbs options to specify section addresses if given in
11490 command line and no SEGMENT_START expression is seen in a script.
11491 * script-sections.h (Script_sections::saw_segment_start_expression,
11492 Script_sections::set_saw_segment_start_expression): New method
11494 (Script_sections::saw_segment_start_expression_): New data member
11496 * script.cc (script_saw_segment_start_expression): New function.
11497 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11498 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11499 script_test_7.sh and script_test_8.sh.
11500 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11501 script_test_8.stdout.
11502 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11503 (script_test_6, script_test_6.stdout, script_test_7,
11504 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11505 * Makefile.in: Regenerate.
11506 * testsuite/script_test_6.sh: New file.
11507 * testsuite/script_test_6.t: Same.
11508 * testsuite/script_test_7.sh: Same.
11509 * testsuite/script_test_7.t: Same.
11510 * testsuite/script_test_8.sh: Same.
11512 2009-10-16 Doug Kwan <dougkwan@google.com>
11514 * output.cc (Output_segment::set_section_list_address): Cast
11515 expressions to unsigned long long type to avoid format warnings.
11517 2009-10-15 Ian Lance Taylor <iant@google.com>
11519 * script.cc (Script_options::add_symbol_assignment): Always add a
11520 dot assignment to script_sections_.
11521 * script-sections.cc (Script_sections::add_dot_assignment):
11522 Initialize if necessary.
11524 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11525 program headers with no load segment if there is a linker script.
11527 * layout.cc (Layout::set_segment_offsets): Align the file offset
11528 to the segment aligment for -N or -n with no load segment.
11529 * output.cc (Output_segment::add_output_section): Don't crash if
11530 the first section is a TLS section.
11531 (Output_segment::set_section_list_addresses): Print an error
11532 message if the address moves backward in a linker script.
11533 * script-sections.cc
11534 (Output_section_element_input::set_section_addresses): Don't
11535 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11536 (Orphan_output_section::set_section_addresses): Likewise.
11538 2009-10-15 Doug Kwan <dougkwan@google.com>
11540 * layout.cc (Layout::finish_dynamic_section): Generate tags
11541 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11542 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11543 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11545 2009-10-14 Ian Lance Taylor <iant@google.com>
11547 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11549 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11550 data_shdr fields of relinfo.
11551 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11552 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11553 R_386_TLS_LDO_32, adjust based on section flags.
11554 (Target_i386::Relocate::fix_up_ldo): Remove.
11556 2009-10-13 Ian Lance Taylor <iant@google.com>
11558 Add support for -pie.
11559 * options.h (class General_options): Add -pie and
11561 (General_options::output_is_position_independent): Test -pie.
11562 (General_options::output_is_executable): Return true if not shared
11563 and not relocatable.
11564 (General_options::output_is_pie): Remove.
11565 * options.cc (General_options::finalize): Reject incompatible uses
11567 * gold.cc (queue_middle_tasks): A -pie link is not static.
11568 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11569 * symtab.cc (Symbol::final_value_is_known): Return false if
11570 output_is_position_independent.
11571 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11572 output_is_position_independent.
11573 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11574 output_is_position_independent.
11575 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11576 output_is_position_independent.
11577 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11579 (basic_pie_test.o, basic_pie_test): New targets.
11580 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11581 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11582 (two_file_pie_test): New target.
11583 * testsuite/Makefile.in: Rebuild.
11584 * README: Remove note saying that -pie is not supported.
11586 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11588 * options.h (class General_options): Add -init and -fini.
11589 * layout.cc (Layout::finish_dynamic_section): Emit
11590 given init and fini functions.
11592 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11594 * gc.h (gc_process_relocs): Check if icf is enabled using new
11596 * gold.cc (queue_initial_tasks): Likewise.
11597 (queue_middle_tasks): Likewise.
11598 * object.cc (do_layout): Likewise.
11599 * symtab.cc (is_section_folded): Likewise.
11600 * main.cc (main): Likewise.
11601 * reloc.cc (Read_relocs::run): Likewise.
11602 (Sized_relobj::do_scan_relocs): Likewise.
11603 * icf.cc (is_function_ctor_or_dtor): New function.
11604 (Icf::find_identical_sections): Check if function is ctor or dtor when
11605 safe icf is chosen.
11606 * options.h (General_options::icf): Change option to be an enum.
11607 (Icf_status): New enum.
11608 (icf_enabled): New method.
11609 (icf_safe_folding): New method.
11610 (set_icf_status): New method.
11611 (icf_status_): New variable.
11612 * (options.cc) (General_options::finalize): Set icf_status_.
11613 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11614 icf_test and icf_keep_unique_test to use the --icf enum flag.
11615 * testsuite/icf_safe_test.sh: New file.
11616 * testsuite/icf_safe_test.cc: New file.
11618 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11620 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11621 includes to gc.h and icf.h.
11622 * arm.cc: Include gc.h.
11623 * gold.cc: Likewise.
11624 * i386.cc: Likewise.
11625 * powerpc.cc: Likewise.
11626 * sparc.cc: Likewise.
11627 * x86_64.cc: Likewise.
11628 * gc.h: Include icf.h.
11630 2009-10-11 Ian Lance Taylor <iant@google.com>
11632 * plugin.cc: Include "gold.h" before other header files.
11634 2009-10-10 Chris Demetriou <cgd@google.com>
11636 * options.h (Input_file_argument::Input_file_type): New enum.
11637 (Input_file_argument::is_lib_): Replace with...
11638 (Input_file_argument::type_): New member.
11639 (Input_file_argument::Input_file_argument): Take Input_file_type
11640 'type' rather than boolean 'is_lib' as second argument.
11641 (Input_file_argument::is_lib): Use type_.
11642 (Input_file_argument::is_searched_file): New function.
11643 (Input_file_argument::may_need_search): Handle is_searched_file.
11644 * options.cc (General_options::parse_library): Support -l:filename.
11645 (General_options::parse_just_symbols): Update for Input_file_argument
11647 (Command_line::process): Likewise.
11648 * archive.cc (Archive::get_file_and_offset): Likewise.
11649 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11650 * script.cc (read_script_file, script_add_file): Likewise.
11651 * fileread.cc (Input_file::Input_file): Likewise.
11652 (Input_file::will_search_for): Handle is_searched_file.
11653 (Input_file::open): Likewise.
11654 * readsyms.cc (Read_symbols::get_name): Likewise.
11655 * testsuite/Makefile.am (searched_file_test): New test.
11656 * testsuite/Makefile.in: Regenerate.
11657 * testsuite/searched_file_test.cc: New file.
11658 * testsuite/searched_file_test_lib.cc: New file.
11660 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11661 Ian Lance Taylor <iant@google.com>
11663 * descriptor.cc: Include <cstdio> and "binary-io.h".
11664 (Descriptors::open): Open the files in binary mode always.
11665 * script.cc (Lex::get_token): Treat \r as whitespace.
11667 2009-10-09 Ian Lance Taylor <iant@google.com>
11669 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11671 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11672 Ian Lance Taylor <iant@google.com>
11674 * configure.ac: Check for readv function also.
11675 * fileread.cc (readv): Define if not HAVE_READV.
11676 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11678 * config.in: Regenerate.
11679 * configure: Regenerate.
11681 2009-10-09 Doug Kwan <dougkwan@google.com>
11683 * layout.cc (Layout::make_output_section): Call target hook to make
11684 ordinary output section.
11685 (Layout::finalize): Adjust parameter list of call the
11686 Target::may_relax().
11687 * layout.h (class Layout::section_list): New method.
11688 * merge.h (Output_merge_base::entsize): Change visibility to public.
11689 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11691 (Output_merge_string::do_is_string): New method.
11692 * object.cc (Sized_relobj::do_setup): renamed from
11693 Sized_relobj::set_up.
11694 * object.h (Sized_relobj::adjust_shndx,
11695 Sized_relobj::initializ_input_to_output_maps,
11696 Sized_relobj::free_input_to_output_maps): Change visibilities to
11698 (Sized_relobj::setup): Virtualize.
11699 (Sized_relobj::do_setup): New method declaration.
11700 (Sized_relobj::invalidate_section_offset,
11701 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11702 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11703 * options.cc (parse_int): New function.
11704 * options.h (parse_int): New declaration.
11705 (DEFINE_int): New macro.
11706 (stub_group_size): New option.
11707 * output.cc (Output_section::Output_section): Initialize memebers
11708 merge_section_map_, merge_section_by_properties_map_,
11709 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11710 (Output_section::add_input_section): Handled deferred code-fill
11711 generation and remove an old comment.
11712 (Output_section::add_relaxed_input_section): New method definition.
11713 (Output_section::add_merge_input_section): Use merge section by
11714 properties map to speed to search. Update merge section maps
11716 (Output_section::build_relaxation_map): New method definition.
11717 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11719 (Output_section::relax_input_section): Renamed to
11720 Output_section::convert_input_sections_to_relaxed_sections and change
11721 interface to take a vector of pointers to relaxed sections.
11722 (Output_section::find_merge_section,
11723 Output_section::find_relaxed_input_section): New method definitions.
11724 (Output_section::is_input_address_mapped,
11725 Output_section::output_offset, Output_section::output_address):
11726 Use output section data maps to speed up searching.
11727 (Output_section::find_starting_output_address): Add comments.
11728 (Output_section::do_write,
11729 Output_section::write_to_postprocessing_buffer): Do code-fill
11730 generation as appropriate.
11731 (Output_section::get_input_sections): Invalidate relaxed input section
11733 (Output_section::restore_states): Adjust type of checkpoint .
11734 Invalidate relaxed input section map.
11735 * output.h (Output_merge_base): New class declaration.
11736 (Input_section_specifier): New class defintion.
11737 (class Output_relaxed_input_section) Change base class to
11738 Output_section_data_build.
11739 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11740 base class initializer.
11741 (Output_section::add_relaxed_input_section): New method declaration.
11742 (Output_section::Input_section): Change visibility to protected.
11743 (Output_section::Input_section::relobj,
11744 Output_section::Input_section::shndx): Handle relaxed input sections.
11745 Output_section::input_sections) Change visibility to protected. Also
11746 define overload to return a non-const pointer.
11747 (Output_section::Merge_section_properties): New class defintion.
11748 (Output_section::Merge_section_by_properties_map,
11749 Output_section::Output_section_data_by_input_section_map,
11750 Output_section::Relaxation_map): New types.
11751 (Output_section::relax_input_section): Rename method to
11752 Output_section::convert_input_sections_to_relaxed_sections and change
11753 interface to take a vector of relaxed section pointers.
11754 (Output_section::find_merge_section,
11755 Output_section::find_relaxed_input_section,
11756 Output_section::build_relaxation_map,
11757 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11758 New method declarations.
11759 (Output_section::merge_section_map_
11760 Output_section::merge_section_by_properties_map_,
11761 Output_section::relaxed_input_section_map_,
11762 Output_section::is_relaxed_input_section_map_valid_,
11763 Output_section::generate_code_fills_at_write_): New data members.
11764 * script-sections.cc
11765 (Output_section_element_input::set_section_addresses): Call
11766 current_data_size and addralign methods of relaxed input sections.
11767 (Orphan_output_section::set_section_addresses): Call current_data_size
11768 and addralign methods of relaxed input sections.
11769 * symtab.cc (Symbol_table::compute_final_value): Extract template
11770 from the body of Symbol_table::sized_finalize_symbol.
11771 (Symbol_table::sized_finalized_symbol): Call
11772 Symbol_table::compute_final_value.
11773 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11774 (Symbol_table::compute_final_value): New templated method declaration.
11775 * target.cc (Target::do_make_output_section): New method defintion.
11776 * target.h (Target::make_output_section): New method declaration.
11777 (Target::relax): Add more parameters for input objects, symbol table
11778 and layout. Adjust call to do_relax.
11779 (Target::do_make_output_section): New method declaration.
11780 (Target::do_relax): Add parameters for input objects, symbol table
11783 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11785 * pread.c: Include stdio.h.
11787 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11789 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11792 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11794 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11795 Change read_shndx type to unsigned int.
11796 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11798 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11799 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11800 Change read_shndx type to unsigned int.
11801 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11803 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11804 * layout.cc (Layout::create_symtab_sections): Cast the result of
11805 local_symcount * symsize to off_t in the gold_assert.
11807 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11809 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11810 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11812 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11813 (Arm_relocate_functions::thm_abs5): New function.
11814 (Arm_relocate_functions::abs12): New function.
11815 (Arm_relocate_functions::abs16): New function.
11816 (Arm_relocate_functions::base_abs): New function.
11817 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11818 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11819 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11821 (Scan::global): Likewise.
11822 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11823 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11824 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11825 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11828 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11830 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11831 (Arm_relocate_functions::movt_prel): New function.
11832 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11833 (Arm_relocate_functions::thm_movt_prel): New function.
11834 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11835 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11836 (Scan::global, Relocate::relocate): Likewise.
11837 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11839 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11841 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11842 Incremental_checker.
11843 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11845 (class Incremental_inputs_header): New class.
11846 (Incremental_inputs_header_writer): Edit comment.
11847 (Incremental_inputs_entry): New class.
11848 (Incremental_inputs_entry_writer): Edit comment.
11849 (Sized_incremental_binary::do_find_incremental_inputs_section):
11850 Add *strtab_shndx parameter, fill it.
11851 (Sized_incremental_binary::do_check_inputs): New method.
11852 (Incremental_checker::can_incrementally_link_output_file): Use
11853 Sized_incremental_binary::check_inputs.
11854 (Incremental_inputs::report_command_line): Save command line in
11857 (Incremental_binary::find_incremental_inputs_section): New
11859 (Incremental_binary::do_find_incremental_inputs_section): Add
11860 strtab_shndx parameter.
11861 (Incremental_binary::do_check_inputs): New pure virtual method.
11862 (Sized_incremental_binary::do_check_inputs): Declare.
11863 (Incremental_checker::Incremental_checker): Add incremental_inputs
11864 parameter, use it to initialize incremental_inputs_.
11865 (Incremental_checker::incremental_inputs_): New field.
11866 (Incremental_checker::command_line): New method.
11867 (Incremental_checker::inputs): New method.
11868 (Incremental_checker::command_line_): New field.
11870 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11872 * incremental.cc: Include <cstdarg> and "target-select.h".
11873 (vexplain_no_incremental): New function.
11874 (explain_no_incremental): New function.
11875 (Incremental_binary::error): New method.
11876 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11878 (make_sized_incremental_binary): New function.
11879 (open_incremental_binary): New function.
11880 (can_incrementally_link_file): Add checks if output is ELF and has
11882 * incremental.h: Include "elfcpp_file.h" and "output.h".
11883 (Incremental_binary): New class.
11884 (Sized_incremental_binary): New class.
11885 (open_incremental_binary): Declare.
11886 * object.cc (is_elf_object): Use
11887 elfcpp::Elf_recognizer::is_elf_file.
11888 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11889 * output.h (Output_file::filesize): New method.
11891 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11893 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11895 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11896 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11898 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11900 (Arm_relocate_functions::movw_abs_nc): New function.
11901 (Arm_relocate_functions::movt_abs): New function.
11902 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11903 (Arm_relocate_functions::thm_movt_abs): New function.
11904 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11905 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11906 (Scan::global): Likewise.
11907 (Relocate::relocate): Likewise.
11908 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11910 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11912 * arm.cc (Arm_relocate_functions::got_prel) New function.
11913 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11914 (Relocate::relocate): Likewise.
11915 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11917 2009-10-06 Ian Lance Taylor <iant@google.com>
11919 * options.h (class General_options): Define
11920 split_stack_adjust_size parameter.
11921 * object.h (class Object): Add uses_split_stack_ and
11922 has_no_split_stack_ fields. Add uses_split_stack and
11923 has_no_split_stack accessor functions. Declare
11924 handle_split_stack_section.
11925 (class Reloc_symbol_changes): Define.
11926 (class Sized_relobj): Define Function_offsets. Declare
11927 split_stack_adjust, split_stack_adjust_reltype, and
11929 * object.cc (Object::handle_split_stack_section): New function.
11930 (Sized_relobj::do_layout): Call handle_split_stack_section.
11931 * dynobj.cc (Sized_dynobj::do_layout): Call
11932 handle_split_stack_section.
11933 * reloc.cc (Sized_relobj::relocate_sections): Call
11934 split_stack_adjust for executable sections in split_stack
11935 objects. Pass reloc_map to relocate_section.
11936 (Sized_relobj::split_stack_adjust): New function.
11937 (Sized_relobj::split_stack_adjust_reltype): New function.
11938 (Sized_relobj::find_functions): New function.
11939 * target-reloc.h: Include "object.h".
11940 (relocate_section): Add reloc_symbol_changes parameter. Change
11942 * target.h (class Target): Add calls_non_split method. Declare
11943 do_calls_non_split virtual method. Declare match_view and
11945 * target.cc: Include "elfcpp.h".
11946 (Target::do_calls_non_split): New function.
11947 (Target::match_view): New function.
11948 (Target::set_view_to_nop): New function.
11949 * gold.cc (queue_middle_tasks): Give an error if mixing
11950 split-stack and non-split-stack objects with -r.
11951 * i386.cc (Target_i386::relocate_section): Add
11952 reloc_symbol_changes parameter.
11953 (Target_i386::do_calls_non_split): New function.
11954 * x86_64.cc (Target_x86_64::relocate_section): Add
11955 reloc_symbol_changes parameter.
11956 (Target_x86_64::do_calls_non_split): New function.
11957 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11959 * powerpc.cc (Target_powerpc::relocate_section): Add
11960 reloc_symbol_changes parameter.
11961 * sparc.cc (Target_sparc::relocate_section): Add
11962 reloc_symbol_changes parameter.
11963 * configure.ac: Call AM_CONDITIONAL for the default target.
11964 * configure: Rebuild.
11965 * testsuite/Makefile.am (TEST_AS): New variable.
11966 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11967 (check_DATA): Add split_i386 and split_x86_64 files.
11968 (SPLIT_DEFSYMS): Define.
11969 (split_i386_[1234n].o): New targets.
11970 (split_i386_[124]): New targets.
11971 (split_i386_[1234r].stdout): New targets.
11972 (split_x86_64_[1234n].o): New targets.
11973 (split_x86_64_[124]): New targets.
11974 (split_x86_64_[1234r].stdout): New targets.
11975 (MOSTLYCLEANFILES): Add new executables.
11976 * testsuite/split_i386.sh: New file.
11977 * testsuite/split_x86_64.sh: New file.
11978 * testsuite/split_i386_1.s: New file.
11979 * testsuite/split_i386_2.s: New file.
11980 * testsuite/split_i386_3.s: New file.
11981 * testsuite/split_i386_4.s: New file.
11982 * testsuite/split_i386_n.s: New file.
11983 * testsuite/split_x86_64_1.s: New file.
11984 * testsuite/split_x86_64_2.s: New file.
11985 * testsuite/split_x86_64_3.s: New file.
11986 * testsuite/split_x86_64_4.s: New file.
11987 * testsuite/split_x86_64_n.s: New file.
11988 * testsuite/testfile.cc (Target_test): Update relocation_section
11990 * testsuite/Makefile.in: Rebuild.
11992 2009-10-06 Ian Lance Taylor <iant@google.com>
11994 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11995 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11996 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11997 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11998 the address on ldo_addrs_.
11999 (Target_i386::Relocate::fix_up_ldo): New function.
12001 2009-10-06 Rafael Espindola <espindola@google.com>
12003 * plugin.cc (add_input_library): New.
12004 (Plugin::load): Add add_input_library to tv.
12005 (Plugin_manager::add_input_file): Add the is_lib argument.
12006 (add_input_file): Update call to Plugin_manager::add_input_file.
12007 (add_input_library): New.
12008 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12010 2009-09-30 Doug Kwan <dougkwan@google.com>
12012 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12013 symbol and call Symbol::may_need_copy_reloc to determine if
12014 a copy reloc is needed.
12015 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12016 nocopyreloc is given in command line.
12017 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12018 given in command line.
12019 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12020 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12021 of the removed Target_i386::may_need_copy_reloc.
12022 * options.h (copyreloc): New option with default value false.
12023 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12024 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12025 instead of the removed Target_powerpc::may_need_copy_reloc.
12026 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12027 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12028 instead of the removed Target_sparc::may_need_copy_reloc.
12029 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12030 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12031 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12032 instead of the removed Target_x86_64::may_need_copy_reloc.
12034 2009-09-30 Ian Lance Taylor <iant@google.com>
12036 * object.h (class Object): Remove target_ field, and target,
12037 sized_target, and set_target methods.
12038 (Object::sized_target): Remove.
12039 (class Sized_relobj): Update declarations. Remove sized_target.
12040 * object.cc (Sized_relobj::setup): Remove target parameter.
12041 Change all callers.
12042 (Input_objects::add_object): Don't do anything with the target.
12043 (make_elf_sized_object): Add punconfigured parameter. Change all
12044 callers. Set or test parameter target.
12045 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12046 Change all callers.
12047 * parameters.cc (Parameters::set_target): Change parameter type to
12049 (Parameters::default_target): Remove.
12050 (set_parameters_target): Change parameter type to be non-const.
12051 (parameters_force_valid_target): New function.
12052 (parameters_clear_target): New function.
12053 * parameters.h (class Parameters): Update declarations. Remove
12054 default_target method. Add sized_target and clear_target
12055 methods. Change target_ to be non-const.
12056 (set_parameters_target): Update declaration.
12057 (parameters_force_valid_target): Declare.
12058 (parameters_clear_target): Declare.
12059 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12060 as NULL if we aren't searching.
12061 (Add_symbols::run): Don't check for compatible target.
12062 * fileread.cc (Input_file::open_binary): Call
12063 parameters_force_valid_target.
12064 * gold.cc (queue_middle_tasks): Likewise.
12065 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12066 set_target on object.
12067 * dynobj.h (class Sized_dynobj): Update declarations.
12068 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12069 make_elf_object returns NULL.
12070 (Archive::include_member): Don't check whether object target is
12072 * output.cc (Output_section::add_input_section): Get target from
12074 (Output_section::relax_input_section): Likewise.
12075 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12077 (Sized_relobj::do_scan_relocs): Likewise.
12078 (Sized_relobj::relocate_sections): Likewise.
12079 * resolve.cc (Symbol_table::resolve): Likewise.
12080 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12081 parameter. Change all callers.
12082 (Symbol_table::add_from_object): Get target from parameters.
12083 (Symbol_table::add_from_relobj): Don't check object target.
12084 (Symbol_table::add_from_dynobj): Likewise.
12085 (Symbol_table::define_special_symbol): Get target from
12087 * symtab.h (class Symbol_table): Update declaration.
12088 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12089 parameter. Change all callers. Clear parameter target.
12090 (Binary_test): Test target here.
12091 * testsuite/object_unittest.cc (gold_testsuite): Remove
12092 target_test_pointer parameter. Change all callers.
12093 (Object_test): Test target here.
12095 2009-09-26 Ian Lance Taylor <iant@google.com>
12097 * testsuite/initpri1.c: Don't try to use constructor priorities if
12098 compiling with gcc before 4.3.
12100 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12102 * testsuite/retain_symbols_file_test.sh (check_present): Change
12103 output file name to retain_symbols_file_test.stdout.
12104 (check_absent): Likewise.
12106 2009-09-18 Craig Silverstein <csilvers@google.com>
12108 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12109 * options.cc: Include <cerrno> and <fstream>.
12110 (General_options::finalize): Parse -retain-symbols-file tag.
12111 * options.h: New flag.
12112 (General_options): New method should_retain_symbol, new
12113 variable symbols_to_retain.
12114 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12115 should_retain_symbol map.
12116 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12117 * testsuite/Makefile.in: Regenerate.
12118 * testsuite/retain_symbols_file_test.sh: New file.
12120 2009-09-18 Nick Clifton <nickc@redhat.com>
12122 * po/es.po: Updated Spanish translation.
12124 2009-09-17 Doug Kwan <dougkwan@google.com>
12126 * debug.h (DEBUG_RELAXATION): New constant.
12127 (DEBUG_ALL): Add DEBUG_RELAXATION.
12128 (debug_string_to_enum): Add relaxation debug option.
12130 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12131 Layout::Relaxation_debug_check::read_sections,
12132 Layout::Relaxation_debug_check::read_sections): New method definitions.
12133 (Layout::Layout): Initialize data members
12134 record_output_section_data_from_scrips_,
12135 script_output_section_data_list_ and relaxation_debug_check_.
12136 (Layout::save_segments, Layout::restore_segments,
12137 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12138 Layout::relaxation_loop_body): New method definitions.
12139 (Layout::finalize): Support relaxation. Move section layout code to
12140 Layout::relaxation_loop_body.
12141 (Layout::set_asection_address_from_script): Move code for orphan
12142 section placement out.
12143 (Layout::place_orphan_sections_in_script): New method definition.
12144 * layout.h (Output_segment_headers, Output_file_header):
12145 New forward class declarations.
12146 (Layout::~Layout): Define.
12147 (Layout::new_output_section_data_from_script): New method definition.
12148 (Layout::place_orphan_sections_in_script): New method declaration.
12149 (Layout::Segment_states): New type declaration.
12150 (Layout::save_segments, Layout::restore_segments,
12151 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12152 Layout::relaxation_loop_body): New method declarations.
12153 (Layout::Output_section_data_list): New type declaration.
12154 (Layout::Relaxation_debug_check): New class definition.
12155 (Layout::record_output_section_data_from_script_,
12156 Layout::script_output_section_data_list_, Layout::segment_states_,
12157 Layout::relaxation_debug_check_): New data members.
12158 * output.cc: (Output_section_headers::do_size): New method definition.
12159 (Output_section_headers::Output_section_headers): Move size
12160 computation to Output_section_headers::do_size.
12161 (Output_segment_headers::do_size): New method definition.
12162 (Output_file_header::Output_file_header): Move size computation to
12163 Output_file_header::do_size and call it.
12164 (Output_file_header::do_size): New method definition.
12165 (Output_data_group::Output_data_group): Adjust call to
12166 Output_section_data.
12167 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12168 (Output_symtab_xindex::do_write): Add array bound check.
12169 (Output_section::Input_section::print_to_mapfile): Handle
12170 RELAXED_INPUT_SECTION_CODE.
12171 (Output_section::Output_section): Initialize data member checkpoint_.
12172 (Output_section::~Output_section): Delete checkpoint object pointed
12174 (Output_section::add_input_section): Always add an Input_section if
12176 (Output_section::add_merge_input_section): Add assert.
12177 (Output_section::relax_input_section): New method definition.
12178 (Output_section::set_final_data_size): Set load address to zero for
12179 an unallocated section.
12180 (Output_section::do_address_and_file_offset_have_reset_values):
12181 New method definition.
12182 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12183 Handle relaxed input section.
12184 (Output_section::sort_attached_input_sections): Checkpoint input
12185 section list lazily.
12186 (Output_section::get_input_sections): Change type of input_sections to
12187 list of Simple_input_section pointers. Checkpoint input section list
12188 lazily. Also handle relaxed input sections.
12189 (Output_section::add_input_section_for_script): Take a reference to
12190 a Simple_input_section object instead of Relobj pointer and section
12191 index as parameter. Handle relaxed input sections.
12192 (Output_section::save_states, Output_section::restore_states): New
12193 method definitions.
12194 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12195 (Output_data::is_data_size_fixed): New method definition.
12196 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12198 (Output_data::address_and_file_offset_have_reset_values): New method
12200 (Output_data::do_address_and_file_offset_have_reset_values): New method
12202 (Output_data::set_data_size): Check that data size is not fixed.
12203 (Output_data::fix_data_size): New method definition.
12204 (Output_data::is_data_size_fixed_): New data member.
12205 (Output_section_headers::set_final_data_size): New method definition.
12206 (Output_section_headers::do_size): New method declaration.
12207 (Output_segment_headers::set_final_data_size): New method definition.
12208 (Output_segment_headers::do_size): New method declaration.
12209 (Output_file_header::set_final_data_size)::New method definition.
12210 (Output_file_header::do_size)::New method declaration.
12211 (Output_section_data::Output_section_data): Add new parameter
12212 is_data_size_fixed and use it to fix data size.
12213 (Output_data_const::Output_data_const): Adjust call to base class
12214 constructor and fix data size.
12215 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12216 base class constructor and fix data size.
12217 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12218 base class constructor and fix data size.
12219 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12220 class constructor and fix data size.
12221 (Output_data_group::set_final_data_size): New method definition.
12222 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12223 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12224 class constructor and fix data size.
12225 (Output_relaxed_input_section): New class definition.
12226 (Output_section::Simple_input_section): New class definition.
12227 (Output_section::get_input_sections): Adjust parameter list.
12228 (Output_section::add_input_section_for_script): Same.
12229 (Output_section::save_states, Output_section::restore_states,
12230 Output_section::do_address_and_file_offset_have_reset_values,
12231 (Output_section::Input_section::Input_section): Handle
12232 RELAXED_INPUT_SECTION_CODE. Add new overload for
12233 Output_relaxed_input_section.
12234 (Output_section::Input_section::is_input_section,
12235 Output_section::Input_section::set_output_section): Handle relaxed
12237 (Output_section::Input_section::is_relaxed_input_section,
12238 Output_section::Input_section::output_section_data,
12239 Output_section::Input_section::relaxed_input_section): New method
12241 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12243 (Output_section::Input_section::u1_): Update comments.
12244 (Output_section::Input_section::u2_): Add new union member poris.
12245 (Output_section::Checkpoint_output_section): New classs definition.
12246 (Output_section::relax_input_section): New method declaration.
12247 (Output_section::checkpoint_): New data member.
12248 (Output_segment): Update comments.
12249 (Output_segment::Output_segment): Un-privatize copy constructor.
12250 (Output_segment::operator=): Un-privatize.
12251 * script-sections.cc (Output_section_element::Input_section_list):
12252 Change element type to Output_section::Simple_input_section.
12253 (Output_section_element_dot_assignment::set_section_addresses):
12254 Register output section data for relaxation clean up.
12255 (Output_data_exression::Output_data_expression): Adjust call to base
12256 constructor to fix data size.
12257 (Output_section_element_data::set_section_addresses): Register
12258 Output_data_expression object for relaxation clean up.
12259 (struct Input_section_info): Replace Relobj pointer and section index
12260 pair with Output_section::Simple_input_section and Convert struct to a
12262 (Input_section_sorter::operator()): Adjust access to
12263 Input_section_info data member to use accessors.
12264 (Output_section_element_input::set_section_addresses): Use layout
12265 parameter. Adjust code to use Output_section::Simple_input_section
12266 and Input_secction_info classes. Register filler for relaxation
12268 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12269 and section index pair with Output_section::Simple_input_section
12270 class. Adjust code accordingly.
12271 (Phdrs_element::release_segment): New method definition.
12272 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12274 (Script_sections::release_segments): New method definition.
12275 * gold/script-sections.h (Script_sections::release_segments): New
12276 method declaration.
12277 * gold/target.h (Target::may_relax, Target::relax,
12278 Target::do_may_relax, Target::do_relax): New method definitions.
12280 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12282 * arm.cc (has_signed_unsigned_overflow): New function.
12283 (Arm_relocate_functions::abs8): New function.
12284 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12285 (Target_arm::Scan::global): Likewise.
12286 (Target_arm::relocate::relocate): Likewise.
12287 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12290 2009-09-16 Cary Coutant <ccoutant@google.com>
12292 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12293 * testsuite/Makefile.in: Regenerate.
12295 2009-09-11 Nick Clifton <nickc@redhat.com>
12297 * po/gold.pot: Updated by the Translation project.
12299 2009-09-08 Cary Coutant <ccoutant@google.com>
12301 * output.cc (Output_file::open): Add execute permission to empty file.
12302 * testsuite/Makefile.am (permission_test): New test.
12303 * testsuite/Makefile.in: Regenerate.
12305 2009-09-02 Ian Lance Taylor <iant@google.com>
12307 * output.cc (Output_file::resize): Call map_no_anonymous rather
12310 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12312 * gold.cc: Include "incremental.h".
12313 (queue_initial_tasks): Call Incremental_checker methods.
12314 * incremental.cc: Include "output.h".
12315 (Incremental_checker::can_incrementally_link_output_file): New
12317 * incremental.h (Incremental_checker): New class.
12319 * output.cc (Output_file::open_for_modification): New method.
12320 (Output_file::map_anonymous): Changed return type to bool. Record
12321 map in base_ field.
12322 (Output_file::map_no_anonymous): New method, broken out of map.
12323 (Output_file::map): Use map_no_anonymous and map_anonymous.
12324 * output.h (class Output_file): Update declarations.
12326 2009-08-24 Cary Coutant <ccoutant@google.com>
12328 * options.h (Command_line::Pre_options): New class.
12329 (Command_line::pre_options): New member.
12330 * options.cc (gold::options::ready_to_register): New variable.
12331 (One_option::register_option): Do nothing if not registering options.
12332 Assert if same short option registered twice.
12333 (General_options::General_options): Turn off option registration when
12335 (Command_line::Pre_options::Pre_options): New constructor.
12337 2009-08-24 Cary Coutant <ccoutant@google.com>
12339 * options.h (General_options::no_keep_memory): Remove incorrect
12342 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12344 * Makefile.am (am__skiplex, am__skipyacc): New.
12345 * Makefile.in: Regenerate.
12347 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12349 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12350 (INCLUDES): ... this.
12351 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12352 (AM_CPPFLAGS): Renamed from ...
12353 (INCLUDE): ... this.
12354 * Makefile.in, testsuite/Makefile.in: Regenerate.
12356 * Makefile.in: Regenerate.
12357 * aclocal.m4: Likewise.
12358 * config.in: Likewise.
12359 * configure: Likewise.
12360 * testsuite/Makefile.in: Likewise.
12362 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12363 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12364 * Makefile.in: Regenerate.
12365 * testsuite/Makefile.in: Regenerate.
12367 2009-08-19 Cary Coutant <ccoutant@google.com>
12369 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12370 symbols in shared libraries overridden by hidden or internal symbols
12371 in the main program.
12373 2009-08-19 Chris Demetriou <cgd@google.com>
12375 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12376 checking source file names in error messages.
12378 2009-08-18 Doug Kwan <dougkwan@google.com>
12380 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12381 an elcpp::Ehdr as parameter. Adjust call to set_target.
12382 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12383 an elfcpp::Ehdr as parameter.
12384 * object.cc (Object::set_target): Remove the version that looks up
12385 a target and sets it.
12386 (Sized_relobj::setup): Take a Target object instead of
12387 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12388 (make_elf_sized_object): Find target and ask target to
12389 make an ELF object.
12390 * object.h: (Object::set_target): Remove the version that looks up
12391 a target and sets it.
12392 (Sized_relobj::setup): Take a Target object instead of
12393 an elfcpp:Ehdr as parameter.
12394 * target.cc: Include dynobj.h.
12395 (Target::do_make_elf_object_implementation): New.
12396 (Target::do_make_elf_object): New.
12397 * target.h (Target::make_elf_object): New template declaration.
12398 (Target::do_make_elf_object): New method declarations.
12399 (Target::do_make_elf_object_implementation): New template declaration.
12401 2009-08-14 Ian Lance Taylor <iant@google.com>
12403 * gold.h (FUNCTION_NAME): Define.
12404 (gold_unreachable): Use FUNCTION_NAME.
12406 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12408 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12409 symbol in the --keep-unique list is not found.
12411 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12413 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12414 been maked as --keep-unique.
12415 (Icf::unfold_section): New function.
12416 * icf.h (Icf::unfold_section): New function.
12417 * options.h (General_options::keep_unique): New option.
12418 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12419 * testsuite/Makefile.in: Regenerate.
12420 * testsuite/icf_keep_unique_test.sh: New file.
12421 * testsuite/icf_keep_unique_test.cc: New file.
12423 2009-08-12 Cary Coutant <ccoutant@google.com>
12426 * resolve.cc (Symbol_table::resolve): Check for references from
12427 dynamic objects to hidden and internal symbols.
12428 * testsuite/Makefile.am (hidden_test.sh): New test.
12429 * testsuite/Makefile.in: Regenerate.
12430 * testsuite/hidden_test.sh: New script.
12431 * testsuite/hidden_test_1.c: New test source.
12432 * testsuite/hidden_test_main.c: New test source.
12434 2009-08-11 Doug Kwan <dougkwan@google.com>
12436 * arm.cc: Update comments.
12437 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12438 segment to locate the .ARM.exidx section if present.
12440 2009-08-09 Doug Kwan <dougkwan@google.com>
12442 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12445 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12446 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12449 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12451 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12452 valid tls_segment only for non-debug-section relocations.
12453 * testsuite/Makefile.am: Add gc_tls_test.
12454 * testsuite/Makefile.in: Regenerate.
12455 * testsuite/gc_tls_test.cc: New file.
12456 * testsuite/gc_tls_test.sh: New file.
12458 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12460 * icf.cc: New file.
12462 * Makefile.am (CCFILES): Add icf.cc.
12463 (HFILES): Add icf.h
12464 * Makefile.in: Regenerate.
12465 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12466 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12467 section, symbol and addend information for the relocs.
12468 * gold.cc (queue_middle_tasks): Call identical code folding.
12469 * gold.h: Add defines for multimap.
12470 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12471 to the call of finalize_local_symbols.
12472 * main.cc (main): Create object of class Icf.
12473 * object.cc (Sized_relobj::do_layout): Allow this function to be
12474 called twice during icf.
12475 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12476 to sections marked as identical by icf.
12477 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12479 (Sized_relobj::do_section_entsize): New function.
12480 * object.h (Object::section_entsize): New function.
12481 (Object::do_section_entsize): New pure virtual function.
12482 (Relobj::finalize_local_symbols): Add new parameter.
12483 (Relobj::do_section_entsize): New function.
12484 * options.h (General_options::icf): New option.
12485 (General_options::icf_iterations): New option.
12486 (General_options::print_icf_sections): New option.
12487 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12488 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12489 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12491 * symtab.cc (Symbol_table::is_section_folded): New function.
12492 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12493 to sections marked as identical by icf.
12494 * symtab.h (Symbol_table::set_icf): New function.
12495 (Symbol_table::icf): New function.
12496 (Symbol_table::is_section_folded): New function.
12497 (Symbol_table::icf_): New data member.
12498 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12499 * testsuite/Makefile.am: Add commands to build icf_test.
12500 * testsuite/Makefile.in: Regenerate.
12501 * testsuite/icf_test.sh: New file.
12502 * testsuite/icf_test.cc: New file.
12504 2009-07-24 Chris Demetriou <cgd@google.com>
12506 * layout.cc (is_compressible_debug_section): Fix incorrect
12507 comment about compressed section names.
12509 2009-07-20 Ian Lance Taylor <ian@airs.com>
12512 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12514 2009-07-16 Ian Lance Taylor <iant@google.com>
12517 * layout.h: #include <map>.
12518 (class Kept_section): Change from struct to class. Add accessors
12519 and setters. Add section size to Comdat_group mapping. Change
12520 Comdat_group to std::map. Add is_comdat_ field. Add
12521 linkonce_size field in union.
12522 (class Layout): Update declaration of find_or_add_kept_section.
12523 Don't declare find_kept_object.
12524 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12525 parameter. Add object, shndx, is_comdat, and is_group_name
12526 parameters. Change all callers. Adjust for new Kept_section.
12527 (Layout::find_kept_object): Remove.
12528 * object.cc (Sized_relobj::include_section_group): Update use of
12529 Kept_section. Rename secnum to shndx. Only record
12530 Kept_comdat_section if sections are the same size.
12531 (Sized_relobj::include_linkonce_section): Update use of
12532 Kept_section. Only record Kept_comdat_section if sections are the
12533 same size. Set size of linkonce section.
12534 (Sized_relobj::map_to_kept_section): Update call to
12535 get_kept_comdat_section.
12536 * object.h (class Sized_relobj): Rename fields in
12537 Kept_comdat_section to drop trailing underscores; change object
12538 field to Relobj*. Change Kept_comdat_section_table to store
12539 struct rather than pointer.
12540 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12541 Add kept_object and kept_shndx parameters. Change all callers.
12542 (Sized_relobj::get_kept_comdat_section): Change return type to
12543 bool. Add kept_object and kept_shndx parameters. Change all
12545 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12546 Layout::find_or_add_kept_section.
12548 2009-07-09 Ian Lance Taylor <iant@google.com>
12550 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12551 Reserve space in the hash table.
12553 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12555 * fileread.cc (File_read::get_mtime): New method.
12556 * fileread.h (Timespec): New structure.
12557 (File_read::get_mtime): New method.
12558 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12559 Renamed from timestamp_nsec.
12560 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12562 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12564 (Incremental_inputs::report_archive): Save mtime; style fix.
12565 (Incremental_inputs::report_obejct): Save mtime; style fix.
12566 (Incremental_inputs::report_script): Save mtime; style fix.
12567 (Incremental_inputs::finalize_inputs): Style fix.
12568 (Incremental_inputs::finalize): Style fix.
12569 (Incremental_inputs::create_input_section_data): Store inputs
12571 * incremental.h (Incremental_inputs::report_script): Add mtime
12573 (Incremental_inputs::Input_info::Input_info): Intialize only one
12575 (Incremental_inputs::Input_info::archive): Move to nameless
12577 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12578 (Incremental_inputs::Input_info::script): Move to nameless union.
12579 (Incremental_inputs::mtime): New field.
12580 * script.cc (read_input_script): Pass file mtime to
12582 * script.h (Script_info::inputs): Style fix.
12584 2009-07-01 Ian Lance Taylor <ian@airs.com>
12586 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12589 2009-06-24 Ian Lance Taylor <iant@google.com>
12592 * layout.cc (Layout::choose_output_section): If we find an
12593 existing section, update the flags.
12594 (Layout::create_notes): New function, broken out of
12596 (Layout::finalize): Don't create note sections.
12597 (Layout::create_note): Don't crash if linker script discards
12599 (Layout::create_gold_note): Likewise.
12600 (Layout::create_build_id): Likewise. Don't set
12601 after_input_sections on the section.
12602 (Layout::create_executable_stack_info): Remove target parameter.
12604 * layout.h (class Layout): Declare create_notes. Update
12605 declaration of create_executable_stack_info.
12606 * gold.cc (queue_middle_tasks): Call create_notes.
12607 * output.cc (Output_section::update_flags_for_input_section): Move
12608 here from output.h. If SHF_ALLOC flag is newly set, mark address
12610 * output.h (Output_data::mark_address_invalid): New function.
12611 (class Output_section): Only declare, not define,
12612 update_flags_for_input_section. Remove set_flags.
12614 2009-06-24 Ian Lance Taylor <iant@google.com>
12616 * script-sections.cc (Output_section_definition::
12617 set_section_addresses): Rename shadowing local load_address to
12620 2009-06-24 Ian Lance Taylor <iant@google.com>
12623 * reloc.cc (relocate_sections): Skip empty relocation sections.
12625 2009-06-23 Ian Lance Taylor <iant@google.com>
12628 * layout.cc (Layout::create_note): Use choose_output_section
12629 rather than make_output_section.
12631 2009-06-23 Ian Lance Taylor <iant@google.com>
12634 * options.cc (General_options::parse_V): Set printed_version_.
12635 (General_options::General_options): Initialize printed_version_.
12636 * options.h (class General_options): Add printed_version_ field.
12637 * gold.cc (queue_initial_tasks): If there are no input files,
12638 don't give a fatal error if we printed the version information.
12639 (queue_middle_tasks): If using -r with a shared object, give a
12640 fatal error rather than an ordinary error.
12642 2009-06-23 Ian Lance Taylor <iant@google.com>
12645 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12646 (Layout::make_output_section): Set have_stabstr_section_ if we see
12647 a .stab*str section.
12648 (Layout::finalize): Call link_stabs_sections.
12649 (Layout::link_stabs_sections): New file.
12650 * layout.h (class Layout): Add have_stabstr_section_ field.
12651 Declare link_stabs_sections.
12653 2009-06-23 Doug Kwan <dougkwan@google.com>
12655 * Makefile.am (libgold_a_LIBADD): New.
12656 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
12657 * Makefile.in: Regenerate.
12658 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12659 * configure: Regenerate.
12660 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12661 * fileread.cc: Include sys/state.h
12662 * gold.h: Declare memmem and strndup if found missing.
12663 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12665 2009-06-23 Ian Lance Taylor <iant@google.com>
12667 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12668 * configure: Rebuild.
12670 2009-06-23 Ian Lance Taylor <iant@google.com>
12673 * object.cc (Object::section_contents): Don't try to get a view if
12674 the section has length zero.
12675 (Object::handle_gnu_warning_section): If the section is empty, use
12676 the name of the section as the warning.
12678 2009-06-23 Ian Lance Taylor <iant@google.com>
12681 * stringpool.h (class Stringpool_template): Add optimize_ field.
12682 (Stringpool_template::set_optimize): New function.
12683 * stringpool.cc (Stringpool_template::Stringpool_template):
12684 Initialize optimize_ field.
12685 (Stringpool_template::set_string_offsets): Test local optimize
12686 fild rather than parameter.
12687 * layout.cc (Layout::Layout): Call set_optimize on the section
12690 2009-06-22 Ian Lance Taylor <iant@google.com>
12693 * yyscript.y: Parse TARGET.
12694 * script.cc (script_set_target): New function.
12695 * script-c.h (script_set_target): Declare.
12696 * options.cc (General_options::string_to_object_format): Rename
12697 from string_to_object_format in anonymous namespace. Change
12699 * options.h (class General_options): Declare
12700 string_to_object_format.
12702 2009-06-22 Ian Lance Taylor <iant@google.com>
12704 * script-sections.cc (Script_sections::create_segments): Don't put
12705 program headers in a PT_LOAD segment if -n or -N.
12707 2009-06-22 Ian Lance Taylor <iant@google.com>
12710 * options.h (class General_options): Add -z lazy and -z now. Sort
12711 -z options into alphabetical order.
12712 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12714 2009-06-21 Ian Lance Taylor <iant@google.com>
12716 * layout.cc (Layout::make_output_section): Call
12717 Target::new_output_section.
12718 (Layout::attach_allocated_section_to_segment): Put large section
12719 sections in a separate load segment with the large segment flag
12721 (Layout::segment_precedes): Sort large data segments after other
12723 (align_file_offset): New static function.
12724 (Layout::set_segment_offsets): Use align_file_offset.
12725 * output.h (class Output_section): Add is_small_section_ and
12726 is_large_section_ fields.
12727 (Output_section::is_small_section): New function.
12728 (Output_section::set_is_small_section): New function.
12729 (Output_section::is_large_section): New function.
12730 (Output_section::set_is_large_section): New function.
12731 (Output_section::is_large_data_section): New function.
12732 (class Output_segment): Add is_large_data_segment_ field.
12733 (Output_segment::is_large_data_segment): New function.
12734 (Output_segment::set_is_large_data_segment): New function.
12735 * output.cc (Output_section::Output_section): Initialize new
12737 (Output_segment::Output_segment): Likewise.
12738 (Output_segment::add_output_section): Add assertion that large
12739 data sections always go in large data segments. Force small data
12740 sections to the end of the list of data sections. Force small BSS
12741 sections to the start of the list of BSS sections. For large BSS
12742 sections to the end of the list of BSS sections.
12743 * symtab.h (class Symbol): Declare is_common_shndx.
12744 (Symbol::is_defined): Check Symbol::is_common_shndx.
12745 (Symbol::is_common): Likewise.
12746 (class Symbol_table): Define enum Commons_section_type. Update
12747 declarations. Add small_commons_ and large_commons_ fields.
12748 * symtab.cc (Symbol::is_common_shndx): New function.
12749 (Symbol_table::Symbol_table): Initialize new fields.
12750 (Symbol_table::add_from_object): Put small and large common
12751 symbols in the right list.
12752 (Symbol_table::sized_finalized_symbol): Check
12753 Symbol::is_common_shndx.
12754 (Symbol_table::sized_write_globals): Likewise.
12755 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12756 common symbol lists. Don't call do_allocate_commons_list if the
12758 (Symbol_table::do_allocate_commons_list): Remove is_tls
12759 parameter. Add comons_section_type parameter. Change all
12760 callers. Handle small and large common symbols.
12761 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12762 Symbol::is_common_shndx.
12763 * resolve.cc (symbol_to_bits): Likewise.
12764 * target.h (Target::small_common_shndx): New function.
12765 (Target::small_common_section_flags): New function.
12766 (Target::large_common_shndx): New function.
12767 (Target::large_common_section_flags): New function.
12768 (Target::new_output_section): New function.
12769 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12770 small_common_section_flags, and large_common_section_flags
12772 (Target::do_new_output_section): New virtual function.
12773 * arm.cc (Target_arm::arm_info): Initialize new fields.
12774 * i386.cc (Target_i386::i386_info): Likewise.
12775 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12777 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12778 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12779 (Target_x86_64::do_new_output_section): New function.
12780 * configure.ac: Define conditional MCMODEL_MEDIUM.
12781 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12782 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12783 (large_LDFLAGS): Define.
12784 * testsuite/large.c: New file.
12785 * testsuite/testfile.cc (Target_test::test_target_info):
12786 Initialize new fields.
12787 * configure, testsuite/Makefile.in: Rebuild.
12789 2009-06-05 Doug Kwan <dougkwan@google.com>
12791 * Makefile.am (CCFILES): Add target.cc.
12792 * Makefile.in: Regenerate.
12793 * i386.cc (class Target_i386): Define new virtual method to
12794 override do_is_local_label_name in parent.
12795 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12796 local symbols if --discard-locals or -X is given.
12797 * options.h (class General_options): Declare new options
12798 '--discard-locals' and '-X' for discarding locals.
12799 * target.h (class Target): Define new methods is_local_label_name.
12800 Declare new virtual method do_is_local_label_name.
12801 * target.cc: New file.
12802 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12803 (check_SCRIPTS): Add discard_locals_test.sh.
12804 (check_DATA): Add discard_local_tests.syms.
12805 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12806 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12807 * testsuite/Makefile.in: Regenerate.
12808 * testsuite/discard_locals_test.c: New file.
12809 * testsuite/discard_locals_test.sh: Same.
12811 2009-06-05 Doug Kwan <dougkwan@google.com>
12813 * object.cc (Sized_relobj::Sized_relobj): Initialize
12814 discarded_eh_frame_shndx_ to -1U.
12815 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12817 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12818 a discarded .eh_frame section.
12819 (Sized_relobj::do_finalize_local_symbols): Ditto.
12820 * object.h (class Sized_relobj): Declare new member
12821 discarded_eh_frame_shndx_.
12822 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12823 (local_labels_test.o, local_labels_test): New rules.
12824 * testsuite/Makefile.in: Regenerate.
12826 2009-06-04 Doug Kwan <dougkwan@google.com>
12828 * layout.cc (Layout::section_name_mapping): Add mapping for
12829 special ARM sections.
12831 2009-06-03 Doug Kwan <dougkwan@google.com>
12833 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12834 (utils::has_overflow): Same.
12836 2009-06-03 Ian Lance Taylor <iant@google.com>
12838 * layout.cc (Layout::section_name_mapping): New array, replacing
12839 Layout::linkonce_mapping.
12840 (Layout::section_name_mapping_count): New variable, replacing
12841 Layout::linkonce_mapping_count.
12842 (Layout::linkonce_output_name): Remove.
12843 (Layout::output_section_name): Rewrite.
12844 * layout.h (class Layout): Rename Linkonce_mapping to
12845 Section_name_mapping, linkonce_mapping to section_name_mapping,
12846 linkonce_mapping_count to section_name_mapping_count. Don't
12847 declare linkonce_output_name.
12849 2009-06-03 Doug Kwan <dougkwan@google.com>
12851 * gold/arm.cc (namespace utils): New.
12852 (Target_arm::reloc_is_non_pic): Define new method.
12853 (class Arm_relocate_functions): New.
12854 (Target_arm::Relocate::relocate): Handle relocation types used by
12857 2009-06-03 Ian Lance Taylor <iant@google.com>
12859 * arm.cc (Target_arm::scan::global): Use || instead of |.
12861 2009-06-02 Doug Kwan <dougkwan@google.com>
12863 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12864 issued_non_pic_error_.
12865 (class Target_arm::Scan): Declare new method check_non_pic.
12866 Define new method symbol_needs_plt_entry.
12867 Declare new data member issued_non_pic_error_.
12868 (class Target_arm::Relocate): Declare new method
12869 should_apply_static_reloc.
12870 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12871 (Target_arm::Scan::check_non_pic): Define new method.
12872 (Target_arm::Scan::local): Handle a small subset of reloc types used
12874 (Target_arm::Scan::local): Same.
12875 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12877 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12879 * incremental.cc (Incremental_inputs::report_command_line): Filter
12880 out --incremental-* options.
12882 2009-05-29 Doug Kwan <dougkwan@google.com>
12884 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12886 (class Target_arm): Update comment.
12887 (Target_arm::Target_arm): Initialize new data members GOT_,
12888 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12889 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12890 and Target_arm::rel_dyn_section.
12891 Declare new_enum Target_arm::Got_type.
12892 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12894 Update commments for member do_dynsym_value.
12895 (Target_arm::got_size, Target_arm::plt_section,
12896 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12897 new methods inside class defintion.
12898 (Target_arm::got_section): Define new method.
12899 (Target_arm::rel_dyn_section): Same.
12900 (Output_data_plt_arm): New template class.
12901 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12902 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12903 (Output_data_plt_arm::add_entry): Same.
12904 (Output_data_plt_arm::first_plt_entry): Define new
12905 static data member for PLT instruction template.
12906 (Output_data_plt_arm::plt_entry): Same.
12907 (Output_data_plt_arm::do_write): Define new method.
12908 (Target_arm::make_plt_entry): Same.
12909 (Target_arm::do_finalize_sections): Same.
12910 (Target_arm::do_dynsym_value): Same.
12912 2009-05-28 Doug Kwan <dougkwan@google.com>
12914 * Makefile.am (TARGETSOURCES): Add arm.cc.
12915 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12916 * Makefile.in: Regenerate.
12917 * arm.cc: New file.
12918 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12920 2009-05-26 Doug Kwan <dougkwan@google.com>
12922 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12923 (General_options::check_excluded_libs): Strip off directories in
12924 archive name before matching like GNU ld does.
12925 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12926 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12927 (exclude_libs_test_LDFLAGS): Add linker option
12928 -Wl,--exclude-libs,libexclude_libs_test_3
12929 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12930 an explicit archive without using -l.
12931 (alt/libexclude_libs_test_3.a): New make rule.
12932 * testsuite/Makefile.in: Regenerate.
12933 * testsuite/exclude_libs_test.c : Declare lib3_default().
12935 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12936 * exclude_libs_test_3.c: New file.
12938 2009-05-26 Nick Clifton <nickc@redhat.com>
12940 * po/id.po: New Indonesian translation.
12941 * po/gold.pot: Updated template file.
12943 2009-05-22 Sriraman Tallam <tmsriram@google.com>
12945 * testsuite/Makefile.am: Add -ffunction-sections to compile
12946 gc_comdat_test files. Add -Wl,--gc-sections to build
12948 * testsuite/Makefile.in: Regenerate.
12949 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12951 2009-05-21 Sriraman Tallam <tmsriram@google.com>
12953 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12954 kept comdat section was garbage collected.
12955 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12956 * testsuite/Makefile.in: Regenerate.
12957 * testsuite/gc_comdat_test.sh: New file.
12958 * testsuite/gc_comdat_test_1.cc: New file.
12959 * testsuite/gc_comdat_test_2.cc: New file.
12961 2009-05-19 Doug Kwan <dougkwan@google.com>
12963 * archive.cc (Archive::Archive): Move constructor from archive.h
12964 to here. Initialize no_export_.
12965 (Archive::get_elf_object_for_member): Set no_export flag of object.
12966 * archive.h (Archive::Archive): Move constructor body to
12968 (Archive::no_export): New method.
12969 (Archive::no_export_): New field.
12970 * object.h (Object::Object): Initialize no_export_ to false.
12971 (Object::no_export, Object::set_no_export): New methods.
12972 (Object::no_export_): New field.
12973 * options.cc (General_options::parse_exclude_libs): New method.
12974 (General_options::check_excluded_libs) Same.
12975 * options.h (exclude_libs): New option.
12976 (General_options::check_excluded_libs): New method declaration.
12977 (General_options::excluded_libs_): New field.
12978 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12979 default or protected visibility if an object has no-export flag set.
12980 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12981 (check_SCRIPTS): Add exclude_libs_test.sh.
12982 (check_DATA): Add exclude_libs_test.syms.
12983 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12984 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12985 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12986 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12987 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12988 libexclude_libs_test_2.a): New rules.
12989 * testsuite/Makefile.in: Regenerate.
12990 * testsuite/exclude_libs_test.c: New file.
12991 * testsuite/exclude_libs_test.sh: Ditto.
12992 * testsuite/exclude_libs_test_1.c: Ditto.
12993 * testsuite/exclude_libs_test_2.c: Ditto.
12995 2009-05-15 Ian Lance Taylor <iant@google.com>
12997 * configure.ac: Check for declarations for cases where libiberty.h
12998 checks HAVE_DECL_xxx.
12999 * configure, config.in: Rebuild.
13001 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13003 * gold.h (Incremental_argument_list): Remove (invalid) forward
13005 * incremental.cc (Incremental_inputs::report_achive): New method.
13006 (Incremental_inputs::report_object): New method.
13007 (Incremental_inputs::report_script): New method.
13008 (Incremental_inputs::finalize_inputs): New method.
13009 (Incremental_inputs::finalize): Call finalize_inputs().
13010 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13011 Create inputs entries.
13012 * incremental.h (Incremental_input_type): New enum.
13013 (Incremental_inputs::Incremental_input): Initialize new fields.
13014 (Incremental_inputs::report_inputs): New method.
13015 (Incremental_inputs::report_achive): New method.
13016 (Incremental_inputs::report_object): New method.
13017 (Incremental_inputs::report_script): New method.
13018 (Incremental_inputs::finalize_inputs): New method.
13019 (Incremental_inputs::Input_info): New struct.
13020 (Incremental_inputs::Input_info_map): New typedef.
13021 (Incremental_inputs::lock_): New field.
13022 (Incremental_inputs::Inputs_): New field.
13023 (Incremental_inputs::Inputs_map): New field.
13024 * main.cc (main): Call Incremental_input::report_inputs.
13025 * options.h (Input_argument_list): Typedef moved from
13027 (Input_file_group::Files): Remove, use ::Input_argument_list.
13028 (Input_file_group::Input_argument_list): Remove, use
13029 ::Input_argument_list.
13030 * plugin.cc (Plugin_manager::add_input_file): Add error in
13032 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13034 * script.cc (read_input_script): Call
13035 Incremental_input::report_script.
13036 * script.h (Script_info): New class.
13038 2009-04-27 Ian Lance Taylor <iant@google.com>
13040 * x86_64.cc (do_adjust_output_section): Set entsize to
13043 2009-04-23 Elliott Hughes <enh@google.com>
13045 * output.cc (Output_file::close): After short writes, continue
13046 writing from the correct offset in the buffer being written.
13048 2009-04-23 Chris Demetriou <cgd@google.com>
13050 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13051 * configure: Regenerate.
13052 * config.in: Regenerate.
13053 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13054 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13056 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13058 * incremental.cc (Incremental_inputs_header_data): Renamed from
13059 Incremental_input_header_data.
13060 (Incremental_inputs_header_data::data_size): New field.
13061 (Incremental_inputs_header_data::put_input_file_count): Renamed
13062 from input_file_count.
13063 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13064 from command_line_offset.
13065 (Incremental_inputs_header_data::put_reserved): Renamed from
13067 (Incremental_inputs_entry_data): Renamed from
13068 Incremental_input_entry_data.
13069 (Incremental_inputs_entry_data::data_size): New field.
13070 (Incremental_inputs::report_command_line): New method.
13071 (Incremental_inputs::finalize): New method.
13072 (Incremental_inputs::create_incremental_inputs_data): New method.
13073 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13074 * incremental.h: New file.
13075 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13076 (Layout::finalize): Create incremental inputs section in
13077 incremental builds.
13078 (Layout::create_incremental_info_sections): New method.
13079 * layout.h (Layout::incremental_inputs): New method.
13080 (Layout::create_incremental_info_sections): New method.
13081 (Layout::incremental_inputs_): New field.
13082 * main.cc (main): Notify Incremental_input of the command line.
13084 2009-04-01 Ian Lance Taylor <iant@google.com>
13085 Mikolaj Zalewski <mikolajz@google.com>
13087 * gold.h (reserve_unordered_map): Define, three versions, one for
13088 each version of Unordered_map.
13089 * layout.cc (Layout::Layout): Remove options parameter. Add
13090 number_of_input_files parameter. Don't initialize options_.
13091 Initialize number_of_input_files_ and resized_signatures_. Move
13092 sections_are_attached_.
13093 (Layout::layout_group): Reserve space for group_signatures_.
13094 (Layout::find_or_add_kept_section): Change name parameter to be a
13095 reference. Resize signatures_ map when it gets large enough.
13096 (Layout::layout_eh_frame): Use parameters->options() instead of
13098 (Layout::make_output_section): Likewise.
13099 (Layout::attach_allocated_section_to_segment): Likewise.
13100 (Layout::finalize, Layout::create_executable_stack): Likewise.
13101 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13102 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13103 * layout.h (class Layout): Update declarations. Remove options_
13104 field. Add number_of_input_files_ and resized_signatures_
13105 fields. Move sections_are_attached_ field.
13106 * main.cc (main): Pass number of input files to Layout
13107 constructor. Don't pass options.
13109 2009-03-30 Ian Lance Taylor <iant@google.com>
13111 * ffsll.c (ffsll): Correct implementation.
13113 2009-03-27 Ian Lance Taylor <iant@google.com>
13115 * ffsll.c: New file.
13116 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13117 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13118 * ftruncate.c (ftruncate): Declare before definition.
13119 * mremap.c (mremap): Likewise.
13120 * pread.c (pread): Likewise.
13121 * configure, Makefile.in, config.in: Rebuild.
13123 * mremap.c: New file.
13124 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13125 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13126 (mremap): Declare if HAVE_MREMAP is not defined.
13127 * configure, Makefile.in, config.in: Rebuild.
13129 2009-03-27 Cary Coutant <ccoutant@google.com>
13131 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13132 position independent.
13133 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13134 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13136 2009-03-24 Cary Coutant <ccoutant@google.com>
13138 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13140 (needs_dynamic_reloc): Likewise.
13142 2009-03-24 Ian Lance Taylor <iant@google.com>
13144 * yyscript.y (file_cmd): Recognize EXTERN.
13145 (extern_name_list, extern_name_list_body): New nonterminals.
13146 * script.cc (script_add_extern): Define.
13147 * script-c.h (script_add_extern): Declare.
13149 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13151 * object.cc (is_elf_object): Define.
13152 * object.h (is_elf_object): Declare.
13153 * archive.cc (Archive::get_elf_object_for_member): Call
13155 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13157 2009-03-24 Elliott Hughes <enh@google.com>
13159 * output.cc (Output_file::map_anonymous): Define.
13160 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13161 try an anonymous one. Report the size if the mmap fails.
13162 * output.h (class Output_file): Declare map_anonymous.
13164 2009-03-24 Ian Lance Taylor <iant@google.com>
13166 * target-select.cc (instantiate_target): Don't acquire the lock if
13167 the instantiated_target_ field has already been set.
13169 2009-03-23 Ian Lance Taylor <iant@google.com>
13171 * gold-threads.h (class Initialize_lock): Define.
13172 * gold-threads.cc (class Initialize_lock_once): Define.
13173 (initialize_lock_control): New static variable.
13174 (initialize_lock_pointer): New static variable.
13175 (initialize_lock_once): New static function.
13176 (Initialize_lock::Initialize_lock): Define.
13177 (Initialize_lock::initialize): Define.
13178 * target-select.h: Include "gold-threads.h".
13179 (class Target_selector): Add lock_ and initialize_lock_ fields.
13180 Don't define instantiate_target, just declare it.
13181 * target-select.cc (Target_selector::Target_selector): Initialize
13183 (Target_selector::instantiate_target): Define.
13184 * descriptors.h: Include "gold-threads.h".
13185 (class Descriptors): Add initialize_lock_ field.
13186 * descriptors.cc (Descriptors::Descriptors): Initialize new
13188 (Descriptors::open): Use initialize_lock_ field
13189 * errors.h (class Errors): Add initialize_lock_ field.
13190 * errors.cc (Errors::Errors): Initialize new field.
13191 (Errors::initialize_lock): Use initialize_lock_ field.
13192 * powerpc.cc (class Target_selector_powerpc): Remove
13193 instantiated_target_ field. In do_recognize call
13194 instantiate_target rather than do_instantiate_target. In
13195 do_instantiate_target just allocate a new target.
13196 * sparc.cc (class Target_selector_sparc): Likewise.
13198 * freebsd.h: New file.
13199 * i386.cc: Include "freebsd.h".
13200 (Target_i386): Derive from Target_freebsd rather than
13202 (Target_selector_i386): Derive from Target_selector_freebsd rather
13203 than Target_selector.
13204 * x86_64.cc: Include "freebsd.h".
13205 (Target_x86_64): Derive from Target_freebsd rather than
13207 (Target_selector_x86_64): Derive from Target_selector_freebsd
13208 rather than Target_selector.
13209 * target.h (class Target): Add adjust_elf_header and
13210 do_adjust_elf_header.
13211 * output.cc (Output_file_header:: do_sized_write): Call target
13212 adjust_elf_header routine.
13213 * configure.tgt: Set targ_osabi.
13214 * configure.ac: Define GOLD_DEFAULT_OSABI.
13215 * parameters.cc (Parameters::default_target): Pass
13216 GOLD_DEFAULT_OSABI to select_target.
13217 * target-select.h (class Target_selector): Make instantiate_target
13218 protected rather than private.
13219 * Makefile.am (HFILES): Add freebsd.h.
13220 * configure, Makefile.in, config.in: Rebuild.
13222 * merge.cc (do_add_input_section): Correct pend value. Change
13223 message about last entry not being null terminated from error to
13226 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13228 * incremental.cc: New file.
13229 * Makefile.am (CCFILES): Add incremental.cc.
13230 * Makefile.in: Rebuild.
13232 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13234 * layout.cc (Layout::output_section_name): Preserve names
13235 of '.note.' sections.
13237 2009-03-19 Ian Lance Taylor <iant@google.com>
13239 * descriptors.cc (Descriptors::open): Check that the options are
13240 valid before using them.
13242 2009-03-18 Ian Lance Taylor <iant@google.com>
13244 * script-sections.h: Include <list>.
13245 (class Script_sections): Change Sections_elements from std::vector
13246 to std::list. Typedef public Elements_iterator. Add
13247 orphan_section_placement_, data_segment_align_start_, and
13248 saw_data_segment_align_ fields. Remove data_segment_align_index_
13250 * script-sections.cc (class Orphan_section_placement): New class.
13251 (class Sections_element): Add virtual functions is_relro and
13252 orphan_section_init. Remove virtual function place_orphan_here.
13253 (class Output_section_definition): Add is_relro and
13254 orphan_section_init. Remove place_orphan_here.
13255 (class Orphan_output_section): Likewise.
13256 (Script_sections::Script_sections): Update for field changes.
13257 (Script_sections::data_segment_align): Set saw_data_segment_align_
13258 and data_segment_align_start_, not data_segment_align_index.
13259 (Script_sections::data_segment_relro_end): Check
13260 saw_data_segment_align_. Use data_segment_align_start_ rather
13261 than data_segment_align_index_.
13262 (Script_sections::place_orphan): Rewrite to use
13263 Orphan_section_placement.
13265 2009-03-17 Ian Lance Taylor <iant@google.com>
13267 * archive.cc (Archive::add_symbols): Check for a version attached
13268 to the symbol name in the archive map.
13269 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13270 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13271 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13272 (ver_test_11.a): New target.
13273 * testsuite/Makefile.in: Rebuild.
13275 * configure.ac: Check for chsize and posix_fallocate. Replace
13277 * ftruncate.c: New file, from gnulib.
13278 * output.cc (posix_fallocate): Define dummy version if not
13279 HAVE_POSIX_FALLOCATE.
13280 (Output_file::map): Call posix_fallocate rather than lseek and
13282 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13283 * configure, Makefile.in, config.in: Rebuild.
13285 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13287 * layout.h (Layout::create_note): Add section_name parameter.
13288 * layout.cc (Layout::create_note): Likewise.
13289 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13291 2009-03-17 Ian Lance Taylor <iant@google.com>
13293 * descriptors.cc: Include "options.h".
13294 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13295 (Descriptors::open): Always use O_CLOEXEC when opening a new
13296 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13297 then set FD_CLOEXEC.
13299 * sparc.cc (class Target_sparc): Add has_got_section.
13300 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13301 make sure we have a GOT section.
13303 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13304 (Target_sparc::Scan::local): Likewise.
13305 (Target_sparc::Scan::global): Likewise.
13306 (Target_sparc::Relocate::relocate): Likewise.
13307 (Target_sparc::Relocate::relocate_tls): Likewise.
13309 * symtab.cc (Symbol_table::define_default_version): New function,
13310 broken out of add_from_object.
13311 (Symbol_table::add_from_object): Call define_default_version.
13312 (Symbol_table::define_special_symbol): Add resolve_oldsym
13313 parameter. Change all callers. If the version for a symbol comes
13314 from a version script, resolve it with the symbol with the same
13315 name with no version. Also add the symbol without a version if
13317 (do_define_in_output_data): If resolving with oldsym, don't delete
13319 (do_define_in_output_segment): Likewise.
13320 (do_define_as_constant): Likewise.
13321 * symtab.h (class Symbol_table): Update declarations.
13323 2009-03-13 Ian Lance Taylor <iant@google.com>
13325 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13326 (Read_symbols::requeue): New function.
13327 (Read_symbols::do_read_symbols): If make_elf_object fails because
13328 the target type is not configured, and the file was searched for,
13329 issue a warning and retry with the next directory.
13330 (Add_symbols::run): If the file has an incompatible format, and
13331 it was searched for, requeue the Read_symbols task. On error,
13332 release the object.
13333 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13334 dirindex parameter to constructor. Change all callers. Declare
13335 incompatible_warning and requeue.
13336 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13337 input_argument_ and input_group_ fields. Add them to
13338 constructor. Change all callers.
13339 (class Read_script): Add dirindex_ field. Add it to constructor.
13340 Change all callers.
13341 * archive.cc (Archive::setup): Remove input_objects parameter.
13342 Change all callers.
13343 (Archive::get_file_and_offset): Likewise.
13344 (Archive::read_all_symbols): Likewise.
13345 (Archive::read_symbols): Likewise.
13346 (Archive::get_elf_object_for_member): Remove input_objects
13347 parameter. Add punconfigured parameter. Change all callers.
13348 (Archive::add_symbols): Change return type to bool. Check return
13349 value of include_member.
13350 (Archive::include_all_members): Likewise.
13351 (Archive::include_member): Change return type to bool. Return
13352 false if first included object has incompatible target. Set
13353 included_member_ field.
13354 (Add_archive_symbols::run): If add_symbols returns false, requeue
13356 * archive.h (class Archive): Add included_member_ field.
13357 Initialize it in constructor. Add input_file and searched_for
13358 methods. Update declarations.
13359 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13360 input_argument_ fields. Add them to constructor. Change all
13362 * script.cc: Include "target-select.h".
13363 (class Parser_closure): Add skip_on_incompatible_target_ and
13364 found_incompatible_target_ fields. Add
13365 skip_on_incompatible_target parameter to constructor. Change all
13366 callers. Add methods skip_on_incompatible_target,
13367 clear_skip_on_incompatible_target, found_incompatible_target, and
13368 set_found_incompatible_target.
13369 (read_input_script): Add dirindex parameter. Change all callers.
13370 If parser finds an incompatible target, requeue Read_symbols
13372 (script_set_symbol): Clear skip_on_incompatible_target in
13374 (script_add_assertion, script_parse_option): Likewise.
13375 (script_start_sections, script_add_phdr): Likewise.
13376 (script_check_output_format): New function.
13377 * script.h (read_input_script): Update declaration.
13378 * script-c.h (script_check_output_format): Declare.
13379 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13380 (ignore_cmd): Remove OUTPUT_FORMAT.
13381 * fileread.cc (Input_file::Input_file): Add explicit this.
13382 (Input_file::will_search_for): New function.
13383 (Input_file::open): Add pindex parameter. Change all callers.
13384 * fileread.h (class Input_file): Add input_file_argument method.
13385 Declare will_search_for. Update declarations.
13386 * object.cc (make_elf_object): Add punconfigured parameter.
13387 Change all callers.
13388 * object.h (class Object): Make input_file public. Add
13389 searched_for method.
13390 (make_elf_object): Update declaration.
13391 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13393 * dirsearch.h (class Dirsearch): Update declaration.
13394 * options.h (class General_options): Add --warn-search-mismatch.
13395 * parameters.cc (Parameters::is_compatible_target): New function.
13396 * parameters.h (class Parameters): Declare is_compatible_target.
13397 * workqueue.cc (Workqueue::add_blocker): New function.
13398 * workqueue.h (class Workqueue): Declare add_blocker.
13400 * fileread.cc (Input_file::open): Remove options parameter.
13401 Change all callers.
13402 (Input_file::open_binary): Likewise.
13403 * script.cc (read_input_script): Likewise.
13404 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13405 options parameter from constructor. Change all callers.
13406 (class Read_script): Likewise.
13407 * fileread.h (class Input_file): Update declarations.
13408 * script.h (read_input_script): Update declaration.
13410 2009-03-10 Nick Clifton <nickc@redhat.com>
13412 * po/es.po: New Spanish translation.
13414 2009-03-06 Cary Coutant <ccoutant@google.com>
13416 * options.cc (parse_short_option): Keep dash_z from registering itself.
13418 2009-03-03 Ian Lance Taylor <iant@google.com>
13421 * target-reloc.h (relocate_section): Pass output_section to
13423 * i386.cc (Target_i386::should_apply_static_reloc): Add
13424 output_section parameter. Change all callers.
13425 (Target_i386::Relocate::relocate): Add output_section parameter.
13426 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13427 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13428 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13429 * testsuite/two_file_shared.sh: New script.
13430 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13431 (check_DATA): Add two_file_shared.dbg.
13432 (two_file_shared.dbg): New target.
13433 * testsuite/Makefile.in: Rebuild.
13435 2009-03-01 Ian Lance Taylor <iant@google.com>
13437 * configure.ac: Check for byteswap.h.
13438 * configure: Rebuild.
13439 * config.in: Rebuild.
13441 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13443 * layout.cc (Layout::find_or_add_kept_section): New function.
13444 (Layout::add_comdat): Removed.
13445 * layout.h (struct Kept_section): Move out of class Layout.
13446 Remove trailing underscores from field names. Add group_sections
13447 field. Rename group_ field to is_group. Change all uses.
13448 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13449 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13450 comdat_groups_ field.
13451 (Sized_relobj::include_section_group): Use
13452 find_or_add_kept_section and Kept_section::group_sections.
13453 (Sized_relobj::include_linkonce_section): Likewise.
13454 * object.cc (class Sized_relobj): Don't define Comdat_group or
13455 Comdat_group_table. Remove find_comdat_group and
13456 add_comdat_group. Remove comdat_groups_ field.
13457 * plugin.cc (include_comdat_group): Use
13458 Layout::find_or_add_kept_section.
13460 2009-02-28 Ian Lance Taylor <iant@google.com>
13462 * README: --gc-sections and map files are now supported. Document
13463 some build requirements.
13466 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13467 relocatable link set the value of the section symbol to zero.
13468 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13469 relocatable link don't include the section address in the local
13472 2009-02-27 Ian Lance Taylor <iant@google.com>
13475 * options.h (class Search_directory): Add is_system_directory.
13476 (class General_options): Declare is_in_system_directory.
13477 * options.cc (get_relative_sysroot): Make static.
13478 (get_default_sysroot): Make static.
13479 (General_optoins::is_in_system_directory): New function.
13480 * fileread.cc (Input_file::is_in_system_directory): New function.
13481 * fileread.h (class Input_file): Declare is_in_system_directory.
13482 * object.h (class Object): Add is_in_system_directory.
13483 (class Input_objects): Remove system_library_directory_ field.
13484 * object.cc (Input_objects::add_object): Don't set
13485 system_library_directory_.
13486 (input_objects::found_in_system_library_directory): Remove.
13487 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13488 parameter. Change all callers.
13489 (Symbol_table::sized_write_globals): Likewise.
13490 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13491 Call Object::is_in_system_directory.
13492 * symtab.h (class Symbol_table): Update declarations.
13495 * descriptors.h (Open_descriptor): Add is_on_stack field.
13496 * descriptors.cc (Descriptors::open): If the descriptor is on the
13497 top of the stack, remove it. Initialize is_on_stack field.
13498 (Descriptors::release): Only add pod to stack if it is not on the
13500 (Descriptors::close_some_descriptor): Clear stack_next and
13501 is_on_stack fields.
13504 * output.cc (Output_section::find_starting_output_address): Rename
13505 from starting_output_address; add PADDR parameter; change return
13507 * output.h (class Output_section): Declare
13508 find_starting_output_address instead of starting_output_address.
13509 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13510 section symbol for which we can't find a merge section.
13513 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13514 hidden or internal, force the symbol to be local.
13515 * resolve.cc (Symbol::override_visibility): Define.
13516 (Symbol::override_base): Use override_visibility.
13517 (Symbol_table::resolve): Likewise.
13518 (Symbol::override_base_with_special): Likewise.
13519 (Symbol_table::override_with_special): If the visibility is hidden
13520 or internal, force the symbol to be local.
13521 * symtab.h (class Symbol): Add set_visibility and
13522 override_visibility.
13523 * testsuite/ver_test_1.sh: New file.
13524 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13525 (check_DATA): Add ver_test_1.syms.
13526 (ver_test_1.syms): New target.
13527 * testsuite/Makefile.in: Rebuild.
13529 2009-02-25 Cary Coutant <ccoutant@google.com>
13531 * layout.cc (Layout::choose_output_section): Don't rename sections
13532 when using a linker script that has a SECTIONS clause.
13533 * Makefile.in: Regenerate.
13535 * testsuite/Makefile.am (script_test_5.sh): New test case.
13536 * testsuite/Makefile.in: Regenerate.
13537 * testsuite/script_test_5.cc: New file.
13538 * testsuite/script_test_5.sh: New file.
13539 * testsuite/script_test_5.t: New file.
13541 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13543 * archive.cc (Archive::include_member): Update calls to add_symbols.
13544 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13545 the Layout argument.
13546 * dynobj.h (do_add_symbols): Add the Layout argument.
13547 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13549 * object.h (Object::add_symbols): Add the Layout argument.
13550 (Object::do_add_symbols): Add the Layout argument.
13551 (Sized_relobj::do_add_symbols): Add the Layout argument.
13552 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13553 Unify the two versions.
13554 (Add_plugin_symbols): Remove.
13555 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13556 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13557 (Add_plugin_symbols): Remove.
13558 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13559 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13560 (Add_symbols::run): Make it work with Pulginobj.
13562 2009-02-06 Ian Lance Taylor <iant@google.com>
13564 * object.cc (Sized_relobj::do_layout): Make info message start
13565 with lower case letter.
13567 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13569 * binary.cc: Fix file comment.
13571 * options.h (enum Incremental_disposition): Define.
13572 (class General_options): Add new options: --incremental,
13573 --incremental_changed, --incremental_unchanged,
13574 --incremental_unknown. Add incremental_disposition_ and
13575 implicit_incremental_ fields.
13576 (General_options::incremental_disposition): New function.
13577 (class Position_dependent_options): Add incremental_disposition
13579 (Position_dependent_options::copy_from_options): Set incremental
13581 * options.cc (General_options::parse_incremental_changed): New
13583 (General_options::parse_incremental_unchanged): New function.
13584 (General_options::parse_incremental_unknown): New function.
13585 (General_options::General_options): Initialize new fields
13586 incremental_disposition_ and implicit_incremental_.
13587 (General_options::finalize): Check for uasge of --incremental-*
13588 without --incremental.
13590 2009-02-06 Chris Demetriou <cgd@google.com>
13592 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13593 pointer and to report location as the file name associated with
13595 (gold_undefined_symbol_at_location): New function to replace the
13596 old gold_undefined_symbol functionality.
13597 * target-reloc.h (relocate_section): Update to use
13598 gold_undefined_symbol_at_location.
13599 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13600 Call gold_undefined_symbol function rather than gold_error.
13601 * errors.h (Errors::undefined_symbol): Take location as a
13602 string, rather than calculating it from a relocation.
13603 * errors.cc (Errors::fatal): Print "fatal error:" before the
13605 (Errors::error, Errors::error_at_location): Print "error: "
13606 before the formatted message.
13607 (Errors::undefined_symbol): Take location as a string, rather
13608 than calculating it from a relocation.
13609 (gold_undefined_symbol_at_location): New function akin to
13610 old gold_undefined_symbol, calculates location from relocation.
13611 (gold_undefined_symbol): Change to take only a Symbol pointer
13612 and to report location as the file name associated with the symbol.
13613 * testsuite/debug_msg.sh: Update for changed error messages.
13614 * testsuite/undef_symbol.sh: Likewise.
13616 2009-02-04 Duncan Sands <baldrick@free.fr>
13619 * reduced_debug_output.h
13620 (Output_reduced_debug_abbrev_section::failed): Use format for
13622 (Output_reduced_debug_info_section::faild): Likewise.
13624 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13626 * script.cc (Lazy_demangler): New class.
13627 (Version_script_info::get_symbol_version_helper): Demangle a
13630 2009-01-29 Cary Coutant <ccoutant@google.com>
13632 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13634 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13636 2009-01-28 Ian Lance Taylor <iant@google.com>
13638 * version.cc (version_string): Bump to 1.9.
13640 * gold.h: Include <cstring> and <stdint.h>.
13641 * version.cc: Include <cstdio>.
13642 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13644 * reduced_debug_output.cc (insert_into_vector): Rename from
13645 Insert_into_vector; change all callers. Use Swap_unaligned to
13646 avoid aliasing issue; remove union since it is unnecessary.
13648 2009-01-27 Sriraman Tallam <tmsriram@google.com>
13650 * Makefile.am (CCFILES): Add gc.cc.
13651 (HFILES): Add gc.h.
13652 * Makefile.in: Regenerate.
13653 * gold.cc (Gc_runner): New class.
13654 (queue_initial_tasks): Call garbage collection related tasks
13655 when corresponding options are invoked.
13656 (queue_middle_gc_tasks): New function.
13657 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13658 processed early before laying out sections during garbage collection.
13659 * gold.h (queue_middle_gc_tasks): New function.
13660 (is_prefix_of): Move from "layout.cc".
13661 * i386.cc (Target_i386::gc_process_relocs): New function.
13662 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13663 * main.cc (main): Create object of class "Garbage_collection".
13664 * object.cc (Relobj::copy_symbols_data): New function.
13665 (Relobj::is_section_name_included): New function.
13666 (Sized_relobj::do_layout): Allow this function to be called twice
13667 during garbage collection and defer layout of section during the
13669 * object.h (Relobj::get_symbols_data): New function.
13670 (Relobj::is_section_name_included): New function.
13671 (Relobj::copy_symbols_data): New function.
13672 (Relobj::set_symbols_data): New function.
13673 (Relobj::get_relocs_data): New function.
13674 (Relobj::set_relocs_data): New function.
13675 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13676 (Relobj::gc_process_relocs): New function.
13677 (Relobj::do_gc_process_relocs): New pure virtual function.
13678 (Relobj::sd_): New data member.
13679 (Sized_relobj::is_output_section_offset_invalid): New function.
13680 (Sized_relobj::do_gc_process_relocs): New function.
13681 * options.h (General_options::gc_sections): Modify to not be a no-op.
13682 (General_options::print_gc_sections): New option.
13683 * plugin.cc (Plugin_finish::run): Remove function call to
13684 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13685 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13686 * reloc.cc (Read_relocs::run): Add task to process relocs and
13687 determine unreferenced sections when doing garbage collection.
13688 (Gc_process_relocs): New class.
13689 (Sized_relobj::do_gc_process_relocs): New function.
13690 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13691 sections that are garbage collected.
13692 * reloc.h (Gc_process_relocs): New class.
13693 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13694 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13695 symbols whose corresponding sections are garbage collected.
13696 (Symbol_table::Symbol_table): Add new parameter for the garbage
13698 (Symbol_table::gc_mark_undef_symbols): New function.
13699 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13700 (Symbol_table::gc_mark_dyn_syms): New function.
13701 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13703 (Symbol_table::add_from_object): Likewise.
13704 (Symbol_table::add_from_relobj): When building shared objects, do not
13705 treat externally visible symbols as garbage.
13706 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13707 table information for static and relocatable links.
13708 * symtab.h (Symbol_table::set_gc): New function.
13709 (Symbol_table::gc): New function.
13710 (Symbol_table::gc_mark_undef_symbols): New function.
13711 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13712 (Symbol_table::gc_mark_dyn_syms): New function.
13713 (Symbol_table::gc_): New data member.
13714 * target.h (Sized_target::gc_process_relocs): New pure virtual
13716 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13717 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13719 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13721 * options.h (General_options::gc_sections): Define as a no-op for now.
13722 (General_options::no_keep_memory): Ditto.
13723 (General_options::Bshareable): Define.
13724 * options.cc (General_options::finalize): Honor -Bshareable.
13726 2009-01-20 Andreas Schwab <schwab@suse.de>
13728 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13729 read the value in the contents, since we don't use it. Use the
13730 template endianness when writing.
13731 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13733 2009-01-19 Andreas Schwab <schwab@suse.de>
13735 * configure.tgt (powerpc64-*): Fix targ_obj.
13737 2009-01-15 Ian Lance Taylor <iant@google.com>
13739 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13740 local symbols when stripping all symbols.
13742 2009-01-14 Cary Coutant <ccoutant@google.com>
13744 * output.cc (Output_reloc): Add explicit instantiations.
13746 2009-01-14 Cary Coutant <ccoutant@google.com>
13748 * archive.cc (Archive::get_elf_object_for_member): Remove call
13749 to File_read::claim_for_plugin.
13750 * descriptors.cc (Descriptors::open): Remove reference to
13752 (Descriptors::claim_for_plugin): Remove.
13753 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13754 (Descriptors::is_claimed): Remove.
13755 (claim_descriptor_for_plugin): Remove.
13756 * fileread.cc (File_read::claim_for_plugin): Remove.
13757 * fileread.h (File_read::claim_for_plugin): Remove.
13758 (File_read::descriptor): Reopen descriptor if necessary.
13759 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13760 (Plugin_manager::all_symbols_read): Add task parameter. Change
13762 (Plugin_manager::get_input_file): New function.
13763 (Plugin_manager::release_input_file): New function.
13764 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13765 corresponding data member.
13766 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13767 and pass to base constructor. Change all callers.
13768 (get_input_file, release_input_file): New functions.
13769 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13770 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13771 (Plugin_manager::all_symbols_read): Add task parameter.
13772 (Plugin_manager::get_input_file): New function.
13773 (Plugin_manager::release_input_file): New function.
13774 (Plugin_manager::task_): New data member.
13775 (Pluginobj::Pluginobj): Add filesize parameter.
13776 (Pluginobj::filename): New function.
13777 (Pluginobj::descriptor): New function.
13778 (Pluginobj::filesize): New function.
13779 (Pluginobj::filesize_): New data member.
13780 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13781 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13782 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13784 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13785 with archive libraries.
13786 * testsuite/Makefile.in: Regenerate.
13787 * testsuite/plugin_test.c (struct sym_info): New type.
13788 (get_input_file, release_input_file): New static variables.
13789 (onload): Capture new transfer vector entries.
13790 (claim_file_hook): Stop reading at end of file according to filesize.
13791 Factor out parsing of readelf output into separate function.
13792 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13793 APIs and get the source file name from the symbol table. Convert
13794 source file name to corresponding object file name. Print info
13795 message when adding new input files.
13796 (parse_readelf_line): New function.
13797 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13798 * testsuite/plugin_test_2.sh: Likewise.
13799 * testsuite/plugin_test_3.sh: Likewise.
13800 * testsuite/plugin_test_4.sh: New test case.
13802 2009-01-07 Ian Lance Taylor <iant@google.com>
13804 * version.cc (version_string): Bump to 1.8.
13806 2008-12-23 Cary Coutant <ccoutant@google.com>
13808 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13809 * plugin.cc (Plugin_manager::finish): Rename as
13810 layout_deferred_objects. Move cleanup to separate function.
13811 (Plugin_manager::cleanup): New function.
13812 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13814 * plugin.h (Plugin_manager::finish): Rename as
13815 layout_deferred_objects.
13816 (Plugin_manager::cleanup): New function.
13817 (Plugin_manager::cleanup_done): New field.
13819 2008-12-23 Cary Coutant <ccoutant@google.com>
13821 * plugin.cc (is_visible_from_outside): New function.
13822 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13823 so we don't return "IR only" status for exported symbols or -r links.
13825 * testsuite/Makefile.am (plugin_test_3): New test case.
13826 * testsuite/Makefile.in: Regenerate.
13827 * testsuite/plugin_test_3.sh: New file.
13829 2008-12-22 Cary Coutant <ccoutant@google.com>
13831 * object.cc (Sized_relobj::layout_section): New function.
13832 (Sized_relobj::do_layout): Defer layout of input sections until after
13833 plugin has provided replacement files.
13834 (Sized_relobj::do_layout_deferred_sections): New function.
13835 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13836 (Relobj::layout_deferred_sections): New function.
13837 (Relobj::do_layout_deferred_sections): New function.
13838 (Sized_relobj::do_layout_deferred_sections): New function.
13839 (Sized_relobj::layout_section): New function.
13840 (Sized_relobj::Deferred_layout): New structure.
13841 (Sized_relobj::deferred_layout_): New field.
13842 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13843 Change all callers. Layout deferred sections.
13844 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13846 (Plugin_hook::run): Move code from do_plugin_hook inline.
13847 (Plugin_hook::do_plugin_hook): Remove.
13848 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13849 (Plugin_manager::finish): Renamed, was cleanup.
13850 (Plugin_manager::should_defer_layout): New function.
13851 (Plugin_manager::add_deferred_layout_object): New function.
13852 (Plugin_manager::Deferred_layout_list): New type.
13853 (Plugin_manager::deferred_layout_objects_): New field.
13854 (Plugin_hook::do_plugin_hook): Remove.
13856 2008-12-17 Ian Lance Taylor <iant@google.com>
13858 * options.h (class General_options): Add --no case for
13861 2008-12-16 Cary Coutant <ccoutant@google.com>
13863 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13865 (Plugin_manager::claim_file): Create plugin object even if
13866 plugin did not call the add_symbols callback.
13867 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13868 asking for more symbols than were added.
13869 * testsuite/Makefile.am (plugin_test_1): Add test case with
13871 (empty.syms): New target.
13872 * testsuite/Makefile.in: Regenerate.
13873 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13874 message. Don't call add_symbols if no globals.
13875 (all_symbols_read_hook): Don't provide replacement for empty
13878 2008-12-12 Ian Lance Taylor <iant@google.com>
13880 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13881 r_type == 0 for a local symbol with r_sym == 0.
13882 (scan_relocatable_relocs): Pass r_sym to
13883 local_non_section_strategy.
13884 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13887 * configure.ac: Update test for TLS descriptors: they are
13888 supported as of glibc 2.9.
13889 * configure: Rebuild.
13891 2008-12-11 Ian Lance Taylor <iant@google.com>
13894 * target-reloc.h (Default_scan_relocatable_relocs): For each
13895 function, map r_type == 0 to RELOC_DISCARD.
13897 2008-12-10 Cary Coutant <ccoutant@google.com>
13899 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13900 object to override a kept COMDAT group from a plugin object.
13902 2008-12-09 Ian Lance Taylor <iant@google.com>
13905 * yyscript.y (file_cmd): Handle INPUT.
13907 * testsuite/initpri1.c: Change all declarations to be full
13908 prototypes by adding void, to avoid compiler warnings.
13910 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
13912 * options.cc (General_options::parse_plugin_opt): New.
13913 (General_options::add_plugin): The argument now is just the filename.
13914 (General_options::add_plugin_option): New.
13915 * options.h (plugin_opt): New.
13916 (add_plugin): Change argument name.
13917 (add_plugin_option): New.
13918 * plugin.cc (Plugin::load): Don't parse the plugin option.
13919 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13920 (Plugin::add_option): New.
13921 (Plugin::args_): Change type.
13922 (Plugin::filename_): New.
13923 (Plugin_manager::add_plugin_option): New.
13924 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13925 * testsuite/Makefile.in: Regenerate.
13927 2008-12-05 Cary Coutant <ccoutant@google.com>
13929 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13930 Handle --strip-lto-sections option.
13931 * options.h (strip_lto_sections): New option.
13933 2008-12-01 Cary Coutant <ccoutant@google.com>
13935 * plugin.cc (ld_plugin_message): Change format parameter to const.
13936 Fix mismatch between new[] and delete.
13938 2008-11-14 Cary Coutant <ccoutant@google.com>
13940 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13943 2008-11-05 Craig Silverstein <csilvers@google.com>
13945 * options.cc (General_options::parse_dynamic_list): New function.
13946 * options.h (General_options): New flags dynamic_list,
13947 dynamic_list_data, dynamic_list_cpp_new, and
13948 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13949 (General_options::in_dynamic_list): New function.
13950 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13951 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13952 (Lex::can_continue_name): Likewise.
13954 (read_script_file): New parameter script_options.
13955 (read_dynamic_list): New function.
13956 (Script_options::define_dynamic_list): New function.
13957 (dynamic_list_keyword_parsecodes): New variable.
13958 (dynamic_list_keywords): New variable.
13959 * script.h (Script_options::define_dynamic_list): New function
13961 (read_dynamic_list): New function prototype.
13962 * symtab.cc (strprefix): New macro.
13963 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13964 dynamic_list_data, dynamic_list_cpp_new, and
13965 dynamic_list_cpp_typeinfo.
13966 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13967 (dynamic_list_expr): New rule.
13968 (dynamic_list_nodes): Likewise.
13969 (dynamic_list_node): Likewise.
13970 * testsuite/Makefile.am (dynamic_list): New test.
13971 * testsuite/Makefile.in: Regenerated.
13972 * testsuite/dynamic_list.t: New file.
13973 * testsuite/dynamic_list.sh: New file.
13975 2008-11-05 Craig Silverstein <csilvers@google.com>
13977 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13978 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13979 (t11_last): Likewise.
13980 * testsuite/ver_test_6.c (main): Likewise.
13982 2008-10-07 Cary Coutant <ccoutant@google.com>
13984 * options.c (General_options::finalize): Add check for -static and
13986 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13989 2008-10-02 Cary Coutant <ccoutant@google.com>
13991 * plugin.cc (make_sized_plugin_object): Fix conditional
13992 compilation to work when not all targets are enabled.
13994 2008-09-29 Cary Coutant <ccoutant@google.com>
13996 * archive.cc (Archive::get_file_and_offset): Use filename instead
13997 of name to get library path.
13998 (Archive::include_member): Unlock external member of a thin archive.
14000 * testsuite/Makefile.am (TEST_AR): New variable.
14001 (thin_archive_test_1): New test.
14002 (thin_archive_test_2): New test.
14003 * testsuite/Makefile.in: Regenerate.
14004 * testsuite/thin_archive_main.cc: New file.
14005 * testsuite/thin_archive_test_1.cc: New file.
14006 * testsuite/thin_archive_test_2.cc: New file.
14007 * testsuite/thin_archive_test_3.cc: New file.
14008 * testsuite/thin_archive_test_4.cc: New file.
14010 2008-09-29 Cary Coutant <ccoutant@google.com>
14012 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14013 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14015 (Sized_relobj::do_finalize_local_symbols): Likewise.
14016 (Sized_relobj::map_to_kept_section): Likewise.
14017 * object.h (Sized_relobj::invalid_address): New constant.
14018 (Sized_relobj::do_output_section_offset): Check for invalid_address
14020 * output.cc (Output_reloc::local_section_offset): Use constant
14021 invalid_address instead of -1U.
14022 (Output_reloc::get_address): Likewise.
14023 (Output_section::output_address): Change -1U to -1ULL.
14024 * output.h (Output_reloc::invalid_address): New constant.
14025 * reloc.cc (Sized_relobj::write_sections): Use constant
14026 invalid_address instead of -1U.
14027 (Sized_relobj::relocate_sections): Likewise.
14028 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14029 values for merge sections.
14030 * target-reloc.h (relocate_for_relocatable): Use constant
14031 invalid_address instead of -1U.
14033 2008-09-19 Cary Coutant <ccoutant@google.com>
14035 Add plugin functionality for link-time optimization (LTO).
14036 * configure.ac (plugins): Add --enable-plugins option.
14037 * configure: Regenerate.
14038 * config.in: Regenerate.
14039 * Makefile.am (LIBDL): New variable.
14040 (CCFILES): Add plugin.cc.
14041 (HFILES): Add plugin.h.
14042 (ldadd_var): Add LIBDL.
14043 * Makefile.in: Regenerate.
14045 * archive.cc: Include "plugin.h".
14046 (Archive::setup): Don't preread archive symbols when using a plugin.
14047 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14048 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14050 (Archive::include_member): Add symbols from plugin objects.
14051 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14052 * descriptors.cc (Descriptors::open): Check for file descriptors
14053 abandoned by plugins.
14054 (Descriptors::claim_for_plugin): New function.
14055 * descriptors.h (Descriptors::claim_for_plugin): New function.
14056 (Open_descriptor::is_claimed): New field.
14057 (claim_descriptor_for_plugin): New function.
14058 * fileread.cc (File_read::claim_for_plugin): New function.
14059 * fileread.h (File_read::claim_for_plugin): New function.
14060 (File_read::descriptor): New function.
14061 * gold.cc: Include "plugin.h".
14062 (queue_initial_tasks): Add task to call plugin hooks for generating
14064 * main.cc: Include "plugin.h".
14065 (main): Load plugin libraries.
14066 * object.h (Pluginobj): Declare.
14067 (Object::pluginobj): New function.
14068 (Object::do_pluginobj): New function.
14069 (Object::set_target): New function.
14070 * options.cc: Include "plugin.h".
14071 (General_options::parse_plugin): New function.
14072 (General_options::General_options): Initialize plugins_ field.
14073 (General_options::add_plugin): New function.
14074 * options.h (Plugin_manager): Declare.
14075 (General_options): Add --plugin option.
14076 (General_options::has_plugins): New function.
14077 (General_options::plugins): New function.
14078 (General_options::add_plugin): New function.
14079 (General_options::plugins_): New field.
14080 * plugin.cc: New file.
14081 * plugin.h: New file.
14082 * readsyms.cc: Include "plugin.h".
14083 (Read_symbols::do_read_symbols): Check for archive before checking
14084 for ELF file. Call plugin hooks to claim files.
14085 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14086 from a real object file; force override when processing replacement
14088 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14089 (Symbol::init_base_object): Likewise.
14090 (Symbol::init_base_output_data): Likewise.
14091 (Symbol::init_base_output_segment): Likewise.
14092 (Symbol::init_base_constant): Likewise.
14093 (Symbol::init_base_undefined): Likewise.
14094 (Symbol::output_section): Assert that object is not a plugin.
14095 (Symbol_table::add_from_pluginobj): New function.
14096 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14098 (Symbol_table::sized_write_globals): Likewise.
14099 (Symbol_table::add_from_pluginobj): Instantiate template.
14100 * symtab.h (Sized_pluginobj): Declare.
14101 (Symbol::in_real_elf): New function.
14102 (Symbol::set_in_real_elf): New function.
14103 (Symbol::in_real_elf_): New field.
14104 (Symbol_table::add_from_pluginobj): New function.
14106 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14107 (LIBDL): New variable.
14108 (LDADD): Add LIBDL.
14109 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14110 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14111 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14112 (MOSTLYCLEANFILES): Likewise.
14113 * testsuite/Makefile.in: Regenerate.
14114 * testsuite/plugin_test.c: New file.
14115 * testsuite/plugin_test_1.sh: New file.
14116 * testsuite/plugin_test_2.sh: New file.
14118 2008-09-16 Ian Lance Taylor <iant@google.com>
14120 * target-reloc.h (relocate_section): Check whether a symbol is
14121 defined by the ABI before reporting an undefined symbol error.
14122 * target.h (Target::is_defined_by_abi): Make parameter const.
14123 (Target::do_is_defined_by_abi): Likewise.
14124 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14125 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14126 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14127 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14128 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14129 * testsuite/Makefile.in: Rebuild.
14131 * fileread.cc (make_view): Add casts to avoid warning.
14133 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14135 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14136 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14138 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14140 * options.h (General_options::output_is_executable): New.
14141 (General_options::output_is_pie): New.
14142 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14143 for shared libraries.
14144 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14146 2008-09-11 Chris Demetriou <cgd@google.com>
14148 * options.h (origin): New -z option.
14149 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14150 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14153 2008-09-05 Cary Coutant <ccoutant@google.com>
14155 * fileread.cc (File_read::make_view): Add check for attempt to map
14156 beyond end of file.
14158 2008-09-05 Cary Coutant <ccoutant@google.com>
14160 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14161 explicit instantiations.
14163 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14166 * options.cc (General_options::finalize): Allow undefined symbols
14167 in shlibs if linking -shared.
14170 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14171 symbols as not needing a dynsym entry.
14173 2008-08-20 Craig Silverstein <csilvers@google.com>
14175 * fileread.cc (File_read::open): Do not lock the file unless it
14176 was successfully opened.
14178 2008-08-14 Cary Coutant <ccoutant@google.com>
14180 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14181 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14182 * testsuite/tls_test.cc (struct int128): 128-bit struct
14183 for testing TLS relocs with non-zero addend.
14184 (v12): New TLS variable.
14186 (t_last): Add check for v12.
14187 * testsuite/tls_test.h (t12): New function.
14188 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14190 2008-08-13 Ian Lance Taylor <iant@google.com>
14192 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14193 set tls_segment_ or relro_segment_.
14194 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14196 * output.h (Output_section::clear_is_relro): New function.
14197 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14198 sections specially even when output_data_ is empty.
14199 (Output_segment::maximum_alignment): When first section is relro,
14200 only force alignment for PT_LOAD segments.
14201 * script.cc (script_data_segment_align): New function.
14202 (script_data_segment_relro_end): New function.
14203 * script-c.h (script_data_segment_align): Declare.
14204 (script_data_segment_relro_end): Declare.
14205 * script-sections.h (class Script_sections): Declare
14206 data_segment_align and data_segment_relro_end. Add fields
14207 segment_align_index_ and saw_relro_end_.
14208 * script-sections.cc (class Sections_element): Add set_is_relro
14209 virtual function. Add new bool* parameter to place_orphan_here.
14210 Add get_output_section virtual function.
14211 (class Output_section_definition): Add set_is_relro. Add new
14212 bool* parameter to place_orphan_here. Add get_output_section.
14213 Add is_relro_ field.
14214 (Output_section_definition::Output_section_definition): Initialize
14215 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14216 and is_relro_ fields.
14217 (Output_section_definition::place_orphan_here): Add is_relro
14219 (Output_section_definition::set_section_addresses): Set relro for
14221 (Output_section_definition::alternate_constraint): Likewise.
14222 (class Orphan_output_section): Add new bool* parameter to
14223 place_orphan_here. Add get_output_section.
14224 (Orphan_output_section::place_orphan_here): Add is_relro
14226 (Script_sections::Script_sections): Initialize
14227 data_segment_align_index_ and saw_relro_end_.
14228 (Script_sections::data_segment_align): New function.
14229 (Script_sections::data_segment_relro_end): New function.
14230 (Script_sections::place_orphan): Set or clear is_relro.
14231 (Script_sections::set_section_addresses): Force alignment of first
14233 * yyscript.y (exp): Call script_data_segment_align and
14234 script_data_segment_relro_end.
14235 * testsuite/relro_script_test.t: New file.
14236 * testsuite/relro_test.cc (using_script): Declare.
14237 (t1, t2): Test using_script.
14238 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14239 (relro_script_test_SOURCES): Define.
14240 (relro_script_test_DEPENDENCIES): Define.
14241 (relro_script_test_LDFLAGS): Define.
14242 (relro_script_test_LDADD): Define.
14243 (relro_script_test.so): New target.
14244 * testsuite/Makefile.in: Rebuild.
14246 2008-08-06 Cary Coutant <ccoutant@google.com>
14248 * archive.cc (Archive::total_archives, Archive::total_members)
14249 (Archive::total_members_loaded): New variables.
14250 (Archive::setup): Add parameter. Add option to preread
14252 (Archive::read_armap): Add counter.
14253 (Archive::get_file_and_offset): New function.
14254 (Archive::get_elf_object_for_member): New function.
14255 (Archive::read_all_symbols): New function.
14256 (Archive::read_symbols): New function.
14257 (Archive::add_symbols): Add counters.
14258 (Archive::include_all_members): Use armap to find members if it's
14260 (Archive::include_member): Skip reading symbols if already read.
14261 Factored code into Archive::get_file_and_offset and
14262 Archive::get_elf_object_for_member. Changed call to
14263 Mapfile::report_include_archive_member.
14264 (Archive::print_stats): New function.
14265 * archive.h: Declare Object and Read_symbols_data classes.
14266 (Archive::Archive): Add initializers for new members.
14267 (Archive::setup): Add parameter.
14268 (Archive::print_stats): New function.
14269 (Archive::total_archives, Archive::total_members)
14270 (Archive::total_members_loaded): New variables.
14271 (Archive::get_file_and_offset): New function.
14272 (Archive::get_elf_object_for_member): New function.
14273 (Archive::read_all_symbols): New function.
14274 (Archive::read_symbols): New function.
14275 (Archive::Archive_member): New class.
14276 (Archive::members_): New member.
14277 (Archive::num_members_): New member.
14278 * main.cc: Include archive.h.
14279 (main): Call Archive::print_stats.
14280 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14281 archive parameter; member_name is now the fully-decorated name.
14282 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14283 * options.h: (General_options): Add --preread-archive-symbols option.
14284 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14287 2008-08-04 Ian Lance Taylor <iant@google.com>
14289 * symtab.h (Symbol::use_plt_offset): New function.
14290 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14291 * powerpc.cc (Relocate::relocate): Likewise.
14292 * sparc.cc (Relocate::relocate): Likewise.
14293 * x86_64.cc (Relocate::relocate): Likewise.
14294 * testsuite/weak_plt.sh: New test.
14295 * testsuite/weak_plt_main.cc: New test.
14296 * testsuite/weak_plt_shared.cc: New test.
14297 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14298 (check_PROGRAMS): Add weak_plt.
14299 (check_DATA): Add weak_plt_shared.so.
14300 (weak_plt_main_pic.o, weak_plt): New targets.
14301 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14302 * testsuite/Makefile.in: Rebuild.
14304 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14306 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14307 * testsuite/Makefile.in: Rebuild.
14309 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14311 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14312 * Makefile.in: Regenerate.
14313 * po/POTFILES.in: Regenerate.
14315 2008-07-29 Ian Lance Taylor <iant@google.com>
14317 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14318 symbols before other symbols.
14319 * testsuite/script_test_2.cc (test_addr): Declare.
14320 (test_addr_alias): Declare.
14321 (main): Check that test_addr and test_addr_alias have the right
14323 * testsuite/script_test_2.t: Define test_addr_alias and
14326 2008-07-24 Ian Lance Taylor <iant@google.com>
14329 * descriptors.cc: New file.
14330 * descriptors.h: New file.
14331 * gold-threads.h (class Hold_optional_lock): New class.
14332 * fileread.cc: Include "descriptors.h".
14333 (File_read::~File_read): Release descriptor rather than closing
14335 (File_read::open) [file]: Call open_descriptor rather than open.
14336 Set is_descriptor_opened_.
14337 (File_read::open) [memory]: Assert that descriptor is not open.
14338 (File_read::reopen_descriptor): New function.
14339 (File_read::release): Release descriptor.
14340 (File_read::do_read): Make non-const. Reopen descriptor.
14341 (File_read::read): Make non-const.
14342 (File_read::make_view): Reopen descriptor.
14343 (File_read::do_readv): Likewise.
14344 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14345 Update declarations.
14346 * layout.cc: Include "descriptors.h".
14347 (Layout::create_build_id): Use open_descriptor rather than open.
14348 * output.cc: Include "descriptors.h".
14349 (Output_file::open): Use open_descriptor rather than open.
14350 * archive.cc (Archive::const_iterator): Change Archive to be
14352 (Archive::begin, Archive::end): Make non-const.
14353 (Archive::count_members): Likewise.
14354 * archive.h (class Archive): Update declarations.
14355 * object.h (Object::read): Make non-const.
14356 * Makefile.am (CCFILES): Add descriptors.cc.
14357 (HFILES): Add descriptors.h.
14358 * Makefile.in: Rebuild.
14361 * gold.h: Always include <clocale>. Add Solaris workarounds
14362 following code in binutils/sysdep.h.
14365 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14366 this->eh_frame_hdr_ is NULL before using it.
14368 * dynobj.cc (Versions::Versions): Update comment.
14370 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14371 the base version name.
14373 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14374 array size plus one.
14375 (Stringpool_template::set_string_offsets): Subtract one from key
14376 before using it as an array index.
14377 (Stringpool_template::get_offset_with_length): Likewise.
14378 (Stringpool_template::write_to_buffer): Likewise.
14379 * stringpool.h (Stringpool_template::get_offset_from_key):
14382 2008-07-23 Ian Lance Taylor <iant@google.com>
14385 * object.h (Merged_symbol_value::value): Do our best to handle a
14389 * script.cc (Version_script_info::get_versions): Don't add empty
14390 version tag to return value.
14391 (Version_script_info::get_symbol_version_helper): Change return
14392 type to bool. Add pversion parameter. Change all callers.
14393 (script_register_vers_node): Don't require a non-NULL tag.
14394 * script.h (class Version_script_info): Update declarations.
14395 (Version_script_info::get_symbol_version): Change return type to
14396 bool. Add version parameter. Change all callers.
14397 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14398 handling. Handle an empty version from a version script.
14399 (Symbol_table::define_special_symbol): Likewise.
14400 * testsuite/ver_test_10.script: New file.
14401 * testsuite/ver_test_10.sh: New file.
14402 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14403 (check_DATA): Add ver_test_10.syms.
14404 (ver_test_10.syms, ver_test_10.so): New target.
14405 * testsuite/Makefile.in: Rebuild.
14407 2008-07-23 Simon Baldwin <simonb@google.com>
14409 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14410 to zero for undefined symbols from dynamic libraries.
14412 2008-07-23 Ian Lance Taylor <iant@google.com>
14414 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14415 Change all callers.
14416 * symtab.h (class Symbol_table): Update declaration.
14417 * testsuite/ver_test_9.cc: New file.
14418 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14419 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14420 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14421 (ver_test_9.so, ver_test_9.o): New targets.
14422 * testsuite/Makefile.in: Rebuild.
14424 2008-07-22 Ian Lance Taylor <iant@google.com>
14426 * options.h (class General_options): Define --check-sections.
14427 * layout.cc (Layout::set_segment_offsets): Handle
14430 * options.h (class General_options): Define -n/--nmagic and
14432 * options.cc (General_options::finalize): For -n/--nmagic or
14433 -N/--omagic, set -static.
14434 * layout.cc (Layout::attach_allocated_section_to_segment): If
14435 -N/--omagic, don't put read-only and read-write sections in
14436 different segments.
14437 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14438 finding a read-only segment.
14439 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14440 don't set the minimum segment alignment to the common page size,
14441 and don't set the file offset to the address modulo the page size.
14442 * script-sections.cc (Script_sections::create_segments): If
14443 -n/--omagic, don't put read-only and read-write sections in
14444 different segments.
14446 * cref.cc: New file.
14447 * cref.h: New file.
14448 * options.h (class General_options): Add --print-symbol-counts.
14449 * main.cc (main): Issue defined symbol report if requested.
14450 * archive.cc (Archive::interpret_header): Make into a const member
14452 (Archive::add_symbols): Call Input_objects::archive_start and
14454 (Archive::const_iterator): Define new class.
14455 (Archive::begin, Archive::end): New functions.
14456 (Archive::include_all_members): Rewrite to use iterator.
14457 (Archive::count_members): New function.
14458 * archive.h (class Archive): Update declarations.
14459 (Archive::filename): New function.
14460 * object.cc: Include "cref.h".
14461 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14462 (Sized_relobj::do_get_global_symbol_counts): New function.
14463 (Input_objects::add_object): Add object to cross-referencer.
14464 (Input_objects::archive_start): New function.
14465 (Input_objects::archive_stop): New function.
14466 (Input_objects::print_symbol_counts): New function.
14467 * object.h: Declare Cref and Archive.
14468 (Object::get_global_symbol_counts): New function.
14469 (Object::do_get_global_symbol_counts): New pure virtual function.
14470 (class Sized_relobj): Add defined_count_ field. Update
14472 (class Input_objects): Add cref_ field. Update constructor.
14473 Update declarations.
14474 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14476 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14478 (Sized_dynobj::do_get_global_symbol_counts): New function.
14479 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14480 defined_count_. Update declarations. Define Symbols typedef.
14481 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14482 parameter. Change all callers.
14483 (Symbol_table::add_from_dynobj): Add sympointers and defined
14484 parameters. Change all callers.
14485 * symtab.h (class Symbol_table): Update declarations.
14486 * Makefile.am (CCFILES): Add cref.cc.
14487 (HFILES): Add cref.h.
14488 * Makefile.in: Rebuild.
14490 2008-07-22 Simon Baldwin <simonb@google.com>
14492 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14493 to zero when writing undefined symbols.
14495 2008-07-22 Ian Lance Taylor <iant@google.com>
14497 * output.cc (Output_section::add_input_section): Don't try to
14498 merge empty merge sections.
14500 2008-07-21 Craig Silverstein <csilvers@google.com>
14502 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14503 Include symbol version in error message.
14505 2008-07-20 Chris Demetriou <cgd@google.com>
14507 * configure.ac (gold_cv_c_random_seed): New configured variable.
14508 (RANDOM_SEED_CFLAGS): New substituted variable.
14509 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14510 * configure: Rebuild.
14511 * Makefile.in: Likewise.
14512 * testsuite/Makefile.in: Likewise.
14514 2008-07-18 Ian Lance Taylor <iant@google.com>
14516 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14517 where we see NAME/NULL and NAME/VERSION as separate symbols.
14518 * testsuite/ver_test_main.cc (main): Call t4.
14519 (t4, t4_2a): Define.
14520 * testsuite/ver_test_2.cc (t4_2): Define.
14521 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14522 * testsuite/ver_test_4.cc (t4_2a): Define.
14523 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14524 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14526 2008-07-17 Ian Lance Taylor <iant@google.com>
14528 * dynobj.cc (Versions::add_def): If we give an error about a
14529 missing version, go ahead and create the version anyhow.
14531 2008-07-10 Ian Lance Taylor <iant@google.com>
14533 Handle output sections with more than 0x7fffffff bytes.
14534 * object.h (class Relobj): Change map_to_output_ to
14535 output_sections_, and just keep a section pointer. Change all
14536 uses. Move comdat group support to Sized_relobj.
14537 (Relobj::is_section_specially_mapped): Remove.
14538 (Relobj::output_section): Remove poff parameter. Change all
14540 (Relobj::output_section_offset): New function.
14541 (Relobj::set_section_offset): Rewrite.
14542 (Relobj::map_to_output): Remove.
14543 (Relobj::output_sections): New function.
14544 (Relobj::do_output_section_offset): New pure virtual function.
14545 (Relobj::do_set_section_offset): Likewise.
14546 (class Sized_relobj): Add section_offsets_ field. Add comdat
14547 group support from Relobj. Update declarations.
14548 (Sized_relobj::get_output_section_offset): New function.
14549 (Sized_relobj::do_output_section_offset): New function.
14550 (Sized_relobj::do_set_section_offset): New function.
14551 * object.cc (Relobj::output_section_address): Remove.
14552 (Sized_relobj::Sized_relobj): Initialize new fields.
14553 (Sized_relobj::include_section_group): Cast find_kept_object to
14555 (Sized_relobj::include_linkonce_section): Likewise.
14556 (Sized_relobj::do_layout): Use separate arrays for output section
14558 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14560 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14561 output_sections and section_offsets.
14562 (Sized_relobj::write_local_symbols): Likewise.
14563 (map_to_kept_section): Compute output address directly.
14564 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14565 output_sections and section_offsets.
14566 (Sized_relobj::write_sections): Likewise.
14567 (Sized_relobj::relocate_sections): Likewise.
14568 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14569 * output.h (class Output_reloc): Update declarations. Change
14570 u2_.relobj to Sized_relobj*.
14571 (class Output_data_reloc): Change add functions to use
14573 * output.cc (Output_reloc::Output_reloc): Change relobj to
14575 (Output_reloc::local_section_offset): Change return type to
14576 Elf_Addr. Use get_output_section_offset.
14577 (Output_reloc::get_address): Likewise.
14578 (Output_section::is_input_address_mapped): Don't call
14579 is_section_specially_mapped.
14580 (Output_section::output_offset): Likewise.
14581 (Output_section::output_address): Likewise.
14582 (Output_section::starting_output_address): Likewise.
14583 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14584 parameter to Sized_relobj*.
14585 (Copy_relocs::need_copy_reloc): Likewise.
14586 (Copy_relocs::save): Likewise.
14587 * copy-relocs.h (class Copy_relocs): Update declarations.
14588 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14589 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14590 * target-reloc.h (relocate_for_relocatable): Change
14591 offset_in_output_section type to Elf_Addr. Change code that uses
14593 * layout.cc (Layout::layout): Always set *off.
14594 * mapfile.cc (Mapfile::print_input_section): Use
14595 output_section_offset.
14596 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14598 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14599 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14600 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14602 2008-07-03 Ian Lance Taylor <iant@google.com>
14604 * layout.cc (Layout::include_section): Do not discard unrecognized
14605 SHT_STRTAB sections.
14607 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14609 * script.cc (Lex::can_continue_name): Make '?' allowable in
14610 version-script names.
14611 * testsuite/version_script.map: Change glob pattern to use '?'
14613 2008-06-30 Manish Singh <yosh@gimp.org>
14616 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14619 2008-06-30 Ian Lance Taylor <iant@google.com>
14623 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14624 versions]: Don't try to read the value in the contents, since we
14625 don't use it. Use the template endianness when writing.
14627 2008-06-25 Cary Coutant <ccoutant@google.com>
14629 * fileread.cc (File_read::make_view): Assert on zero-length view.
14630 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14631 symbol table when there are no symbols to read.
14633 2008-06-23 Craig Silverstein <csilvers@google.com>
14635 * version.cc (version_string): Bump to 1.7
14637 2008-06-18 Craig Silverstein <csilvers@google.com>
14639 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14640 constant 0xFFFF to type Valtype.
14641 (Powerpc_relocate_functions::rel16_ha): Likewise.
14643 2008-06-17 Ian Lance Taylor <iant@google.com>
14645 * output.h (Output_section::Input_section): Initialize p2align_ to
14646 zero for Output_section_data constructors.
14647 (Output_section::Input_section::addralign): If not an input
14648 section, return the alignment of the Output_section_data.
14649 * testsuite/copy_test.cc: New file.
14650 * testsuite/copy_test_1.cc: New file.
14651 * testsuite/copy_test_2.cc: New file.
14652 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14653 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14654 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14655 (copy_test_1_pic.o, copy_test_1.so): New targets.
14656 (copy_test_2_pic.o, copy_test_2.so): New targets.
14657 * testsuite/Makefile.in: Rebuild.
14659 * script-sections.cc (Script_sections::place_orphan): Initialize
14660 local variable exact.
14662 2008-06-13 David Edelsohn <edelsohn@gnu.org>
14664 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14666 2008-06-12 David Edelsohn <edelsohn@gnu.org>
14667 David S. Miller <davem@davemloft.net>
14669 * powerpc.cc: New file.
14670 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14671 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14672 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14673 * Makefile.in: Rebuild.
14675 2008-06-09 Ian Lance Taylor <iant@google.com>
14677 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14679 (throwing, orig_terminate): New static variables.
14680 (terminate_handler): New static function.
14681 (t2): Set terminate handler.
14683 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14686 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14689 2008-05-30 Cary Coutant <ccoutant@google.com>
14691 * archive.cc (Archive::include_all_members) Correct to step
14692 over symbol table and extended name table in thin archives.
14694 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14697 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14700 2008-05-28 Caleb Howe <cshowe@google.com>
14702 * reduced_debug_output.cc: New file.
14703 * reduced_debug_output.h: New file.
14704 * options.h (class General_options): Add --strip-debug-non-line.
14705 * options.cc (General_options::finalize): Add strip_debug_non_line
14706 to the strip heirarchy.
14707 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14709 * layout.cc: Include "reduced_debug_output.h".
14710 (Layout::Layout): Initialize new fields.
14711 (line_only_debug_sections): New static array.
14712 (is_lines_only_debug_sections): New static inline function.
14713 (Layout::include_section): Handle --strip-debug-non-line.
14714 (Layout::make_output_section): If --strip-debug-non-line, build
14715 new output sections for .debug_abbrev and .debug_info.
14716 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14717 gold. Warn about possible overflow.
14718 (read_signed_LEB_128): Likewise.
14719 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14720 (read_signed_LEB_128): Declare.
14721 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14722 (HFILES): Add reduced_debug_output.h.
14723 * Makefile.in: Rebuild.
14725 2008-05-21 Ian Lance Taylor <iant@google.com>
14727 * mapfile.cc: New file.
14728 * mapfile.h: New file.
14729 * options.h (class General_options): Add -M/--print-map and -Map.
14730 * options.cc (General_options::finalize): Make -M equivalent to
14732 * main.cc: Include <cstdio> and "mapfile.h".
14733 (main): Open mapfile if requested.
14734 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14735 constructor. Change caller.
14736 (queue_initial_tasks): Add mapfile parameter. Change caller.
14737 (queue_middle_tasks): Likewise.
14738 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14740 * archive.cc: Include "mapfile.h".
14741 (Archive::add_symbols): Add mapfile parameter. Change all
14742 callers. Pass mapfile, symbol, and reason to include_member.
14743 (Archive::include_all_members): Add mapfile parameter. Change all
14745 (Archive::include_member): Add mapfile, sym, and why parameters.
14746 Change all callers. Report inclusion to map file.
14747 * archive.h: Include "fileread.h".
14748 (class Archive): Update declarations.
14749 (Archive::file): New const method.
14750 (class Add_archive_symbols): Add mapfile_ field. Update
14751 constructor. Change all callers.
14752 * readsyms.h (class Read_symbols): Likewise.
14753 (class Finish_group): Likewise.
14754 (class Read_script): Likewise.
14755 * common.cc: Include "mapfile.h".
14756 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14758 (Symbol_table::do_allocate_commons): Likewise.
14759 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14760 symbol allocation to mapfile.
14761 * common.h (class Allocate_commons_task): Add mapfile_ field.
14762 Update constructor. Change all callers.
14763 * symtab.h (class Symbol_table): Update declarations.
14764 * layout.cc: Include "mapfile.h".
14765 (Layout_task_runner::run): Print information to mapfile.
14766 (Layout::create_gold_note): Change Output_data_fixed_space to
14767 Output_data_zero_fill.
14768 (Layout::create_build_id): Likewise.
14769 (Layout::print_to_mapfile): New function.
14770 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14771 constructor. Change caller.
14772 (class Layout): Declare print_to_mapfile.
14773 * output.cc (Output_section::Input_section::print_to_mapfile): New
14775 (Output_section::add_input_section): If producing a map, always
14776 add to input_sections_ list.
14777 (Output_section::do_print_to_mapfile): New function.
14778 (Output_segment::print_sections_to_mapfile): New function.
14779 (Output_segment::print_section_list_to_mapfile): New function.
14780 * output.h: Include "mapfile.h".
14781 (Output_data::print_to_mapfile): New function.
14782 (Output_data::do_print_to_mapfile): New virtual function.
14783 (Output_segment_headers::do_print_to_mapfile): New function.
14784 (Output_file_header::do_print_to_mapfile): New function.
14785 (Output_data_const::do_print_to_mapfile): New function.
14786 (class Output_data_const_buffer): Add map_name_ field. Update
14787 constructor. Change all callers. Add do_print_to_mapfile
14789 (class Output_data_fixed_space): Likewise.
14790 (class Output_data_space): Likewise.
14791 (class Output_data_zero_fill): New class.
14792 (Output_data_strtab::do_print_to_mapfile): New function.
14793 (Output_data_reloc_base::do_print_to_mapfile): New function.
14794 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14795 (Output_data_group::do_print_to_mapfile): New function.
14796 (Output_data_got::do_print_to_mapfile): New function.
14797 (Output_data_dynamic::do_print_to_mapfile): New function.
14798 (Output_symtab_xindex::do_print_to_mapfile): New function.
14799 (class Output_section): Declare do_print_to_mapflie. Declare
14800 print_to_mapfile in Input_section.
14801 (class Output_segment): Declare new functions.
14802 * object.h (Sized_relobj::symbol_count): New function.
14803 * script-sections.cc
14804 (Output_section_element_dot_assignment::set_section_addresses):
14805 Change Output_data_fixed_space to Output_data_zero_fill.
14806 (Output_data_expression::do_print_to_mapfile): New function.
14807 * script.cc (read_input_script): Add mapfile parameter. Change
14809 * script.h (read_input_script): Update declaration.
14810 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14811 (Eh_frame::do_print_to_mapfile): New function.
14812 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14813 (Output_merge_string::do_print_to_mapfile): New function.
14814 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14816 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14818 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14820 * Makefile.am (CCFILES): Add mapfile.cc.
14821 (HFILES): Add mapfile.h.
14822 * Makefile.in: Rebuild.
14824 2008-05-19 Ian Lance Taylor <iant@google.com>
14826 * options.h (class General_options): Add -z relro.
14827 * layout.cc (Layout::Layout): Initialize relro_segment_.
14828 (Layout::add_output_section_data): Return the output section.
14829 (Layout::make_output_section): Rcognize relro sections and mark
14830 them appropriately.
14831 (Layout::attach_allocated_section_to_segment): Put relro sections
14832 in a PT_GNU_RELRO segment.
14833 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14835 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14837 (Layout::linkonce_mapping): Map d.rel.ro.local to
14838 .data.rel.ro.local.
14839 (Layout::output_section_name): Us .data.rel.ro.local for any
14840 section which begins with that.
14841 * layout.h (class Layout): Update add_output_section_data
14842 declaration. Add relro_segment_ field.
14843 * output.cc (Output_section::Output_section): Initialize is_relro_
14844 and is_relro_local_ fields.
14845 (Output_segment::add_output_section): Group relro sections.
14846 (Output_segment::is_first_section_relro): New function.
14847 (Output_segment::maximum_alignment): If there is a relro section,
14848 align the segment to the common page size.
14849 (Output_segment::set_section_addresses): Track whether we are
14850 looking at relro sections. If the last section is a relro
14851 section, align to the common page size.
14852 (Output_segment::set_section_list_addresses): Add in_relro
14853 parameter. Change all callers. Align to the page size when
14854 moving from relro to non-relro section.
14855 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14857 * output.h (class Output_section): Add is_relro_ and
14858 is_relro_local_ fields.
14859 (Output_section::is_relro): New function.
14860 (Output_section::set_is_relro): New function.
14861 (Output_section::is_relro_local): New function.
14862 (Output_section::set_is_relro_local): New function.
14863 (class Output_segment): Update declarations.
14864 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14865 * sparc.cc (Target_sparc::got_section): Likewise.
14866 * x86_64.cc (Target_x86_64::got_section): Likewise.
14867 * testsuite/relro_test_main.cc: New file.
14868 * testsuite/relro_test.cc: New file.
14869 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14870 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14871 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14872 (relro_test.so, relro_test_pic.o): New targets.
14873 * testsuite/Makefile.in: Rebuild.
14875 2008-05-16 Ian Lance Taylor <iant@google.com>
14877 * output.cc (Output_segment::add_output_section): Remove front
14879 * output.h (class Output_segment): Remove
14880 add_initial_output_section and overloaded add_output_section.
14881 Update declaration of remaining add_output_section.
14882 * layout.cc (Layout::create_interp): Call add_output_section
14883 rather than add_initial_output_section.
14884 (Layout::finish_dynamic_section): Likewise.
14886 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14887 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14888 know the dynamic type.
14889 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14890 field. Initialize it in constructor.
14891 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14892 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14893 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14896 * output.cc (Output_reloc::get_address): Change return type to
14898 * output.h (class Output_reloc): Update get_address declaration.
14899 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14900 for section addresses.
14902 2008-05-09 Ian Lance Taylor <iant@google.com>
14905 * gold.cc (gold_nomem): Use return value of write.
14907 2008-05-08 Ian Lance Taylor <iant@google.com>
14909 * symtab.c (Symbol::init_base_output_data): Add version
14910 parameter. Change all callers.
14911 (Symbol::init_base_output_segment): Likewise.
14912 (Symbol::init_base_constant): Likewise.
14913 (Symbol::init_base_undefined): Likewise.
14914 (Sized_symbol::init_output_data): Likewise.
14915 (Sized_symbol::init_output_segment): Likewise.
14916 (Sized_symbol::init_constant): Likewise.
14917 (Sized_symbol::init_undefined): Likewise.
14918 (Symbol_table::do_define_in_output_data): If the new symbol has a
14919 version, mark it as the default.
14920 (Symbol_table::do_define_in_output_segment): Likewise.
14921 (Symbol_table::do_define_as_constant): Likewise.
14922 * symtab.h (class Symbol): Update declarations.
14923 (class Sized_symbol): Likewise.
14924 * resolve.cc (Symbol::override_version): New function.
14925 (Symbol::override_base): Call override_version.
14926 (Symbol::override_base_with_special): Likewise.
14927 * testsuite/ver_script_8.script: New file.
14928 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14929 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14930 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14931 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14933 2008-05-06 Ian Lance Taylor <iant@google.com>
14936 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14938 (class General_options): Remove existing --undefined, and add
14939 --no-undefined instead. Add new --undefined as synonym for -u.
14940 * archive.cc (Archive::add_symbols): Check whether symbol was
14942 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14943 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14944 all uses. Add IS_UNDEFINED. Update declarations to split
14945 different versions of init_base. Declare init_base_undefined.
14946 (Symbol::is_defined): Handle IS_UNDEFINED.
14947 (Symbol::is_undefined): Likewise.
14948 (Symbol::is_weak_undefined): Call is_undefined.
14949 (Symbol::is_absolute): Handle IS_CONSTANT.
14950 (class Sized_symbol): Update declarations to split different
14951 versions of init. Declare init_undefined.
14952 (class Symbol_table): Declare new functions.
14953 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14954 Change all callers.
14955 (Symbol::init_base_output_data): Likewise.
14956 (Symbol::init_base_output_segment): Likewise.
14957 (Symbol::init_base_constant): Likewise.
14958 (Symbol::init_base_undefined): New function.
14959 (Sized_symbol::init_object): Rename from init. Change all
14961 (Sized_symbol::init_output_data): Likewise.
14962 (Sized_symbol::init_output_segment): Likewise.
14963 (Sized_symbol::init_constant): Likewise.
14964 (Sized_symbol::init_undefined): New function.
14965 (Symbol_table::add_undefined_symbols_from_command_line): New
14967 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14969 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14970 (Symbol::output_section): Likewise.
14971 (Symbol::set_output_section): Likewise.
14972 (Symbol_table::sized_finalize_symbol): Likewise.
14973 (Symbol_table::sized_write_globals): Likewise.
14974 * resolve.cc (Symbol_table::should_override): Likewise.
14975 (Symbol::override_base_with_special): Likewise.
14977 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14978 symbol, change it to have default visibility.
14979 * testsuite/protected_1.cc: New file.
14980 * testsuite/protected_2.cc: New file.
14981 * testsuite/protected_3.cc: New file.
14982 * testsuite/protected_main_1.cc: New file.
14983 * testsuite/protected_main_2.cc: New file.
14984 * testsuite/protected_main_3.cc: New file.
14985 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14986 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14987 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14988 (protected_1.so): New target.
14989 (protected_1_pic.o, protected_2_pic.o): New targets.
14990 (protected_3_pic.o): New target.
14991 (check_PROGRAMS): Add protected_2.
14992 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14993 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14994 * testsuite/Makefile.in: Rebuild.
14996 * options.h (DEFINE_var): Add set_user_set_##varname__.
14997 (DEFINE_bool_alias): New macro.
14998 (class General_options): Define -Bstatic using DEFINE_bool_alias
14999 rather than DEFINE_special. Add --undefined as an alias for -z
15001 * options.cc (General_options::parse_Bstatic): Remove.
15003 * options.h (class General_options): Add --fatal-warnings.
15004 * main.cc (main): Implement --fatal-warnings.
15005 * errors.h (Errors::warning_count): New function.
15007 * options.h (class General_options): Add -Bsymbolic-functions.
15008 * symtab.h (Symbol::is_preemptible): Check for
15009 -Bsymbolic-functions.
15011 2008-05-05 Ian Lance Taylor <iant@google.com>
15013 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15014 as noVARNAME rather than no-VARNAME.
15015 (class General_options): Add option -z combreloc.
15016 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15018 (Output_reloc::sort_before) [SHT_REL]: New function.
15019 (Output_reloc::sort_before) [SHT_RELA]: New function.
15020 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15021 Sort_relocs_comparison.
15022 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15023 parameter. Change all callers.
15024 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15025 sort_relocs parameter. Change all callers.
15026 * output.cc (Output_reloc::get_address): New function, broken out
15028 (Output_reloc::write_rel): Call it.
15029 (Output_reloc::compare): New function.
15030 (Output_data_reloc_base::do_write): Optionally sort relocs.
15032 * configure.ac: If targ_extra_obj is set, link it in.
15033 * configure.tgt: Initialize all variables.
15034 (x86_64*): Set targ_extra_obj and targ_extra_size.
15035 * configure: Rebuild.
15037 * object.cc (Sized_relobj::include_section_group): Adjust section
15038 indexes read from group data. Build vector to pass to
15040 * layout.cc (Layout::layout_group): Add flags and shndxes
15041 parameters. Remove contents parameter. Change caller. Update
15042 explicit instantiations.
15043 * layout.h (class Layout): Update layout_group declaration.
15044 * output.cc (Output_data_group::Output_data_group): Add flags and
15045 input_shndxes parameters. Remove contents parameter. Change
15047 (Output_data_group::do_write): Change input_sections_ to
15049 * output.h (class Output_data_group): Update constructor
15050 declaration. Rename input_sections_ to input_shndxes_.
15051 * testsuite/many_sections_test.cc: Add template.
15053 2008-04-30 Cary Coutant <ccoutant@google.com>
15055 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15057 * layout.cc (Layout::include_section): Refactored check for debug
15059 (Layout::add_comdat): Add new parameters. Change type
15060 of signature parameter. Add object and shndx to signatures table.
15061 (Layout::find_kept_object): New function.
15062 * layout.h: Include <cstring>.
15063 (Layout::is_debug_info_section): New function.
15064 (Layout::add_comdat): Add new parameters.
15065 (Layout::find_kept_object): New function.
15066 (Layout::Kept_section): New struct.
15067 (Layout::Signatures): Change type of map range.
15068 * object.cc (Relobj::output_section_address): New function.
15069 (Sized_relobj::include_section_group): Add new parameters. Change
15070 calls to Layout::add_comdat. Change to build table of kept comdat
15071 groups and table mapping discarded sections to kept sections.
15072 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15073 (Sized_relobj::do_layout): Change calls to include_section_group and
15074 include_linkonce_section.
15075 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15076 value to zero when section is discarded.
15077 (Sized_relobj::map_to_kept_section): New function.
15078 * object.h (Relobj::output_section_address): New function.
15079 (Relobj::Comdat_group): New type.
15080 (Relobj::find_comdat_group): New function.
15081 (Relobj::Comdat_group_table): New type.
15082 (Relobj::Kept_comdat_section): New type.
15083 (Relobj::Kept_comdat_section_table): New type.
15084 (Relobj::add_comdat_group): New function.
15085 (Relobj::set_kept_comdat_section): New function.
15086 (Relobj::get_kept_comdat_section): New function.
15087 (Relobj::comdat_groups_): New field.
15088 (Relobj::kept_comdat_sections_): New field.
15089 (Symbol_value::input_value): Update comment.
15090 (Sized_relobj::map_to_kept_section) New function.
15091 (Sized_relobj::include_linkonce_section): Add new parameter.
15092 * target-reloc.h (Comdat_behavior): New type.
15093 (get_comdat_behavior): New function.
15094 (relocate_section): Add code to map a discarded section to the
15095 corresponding kept section when applying a relocation.
15097 2008-04-30 Craig Silverstein <csilvers@google.com>
15099 * dwarf_reader.cc (next_generation_count): New static var.
15100 (Addr2line_cache_entry): New struct.
15101 (addr2line_cache): New static var.
15102 (Dwarf_line_info::one_addr2line): Added caching.
15103 (Dwarf_line_info::clear_addr2line_cache): New function.
15104 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15105 cache-size parameter.
15106 (Dwarf_line_info::one_addr2line_cache): New function.
15107 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15108 new cache-size argument to one_addr2line(), and clear cache.
15110 2008-04-28 Cary Coutant <ccoutant@google.com>
15112 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15113 R_386_PC8 relocations.
15115 2008-04-23 Ian Lance Taylor <iant@google.com>
15117 * object.cc (Sized_relobj::include_section_group): Check for
15118 invalid section group.
15120 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15123 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15124 than read for file header.
15125 * archive.cc (Archive::include_member): Likewise.
15127 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15129 * aclocal.m4: Regenerate.
15130 * configure: Regenerate.
15132 2008-04-19 Ian Lance Taylor <iant@google.com>
15134 * version.cc (version_string): Bump to 1.6.
15136 * testsuite/Makefile.am (many_sections_r_test): New target.
15137 (many_sections_r_test_SOURCES): Remove.
15138 (many_sections_r_test_DEPENDENCIES): Remove.
15139 (many_sections_r_test_LDFLAGS): Remove.
15140 (many_sections_r_test_LDADD): Remove.
15142 * object.cc (Sized_relobj::do_add_symbols): Always pass
15143 local_symbol_count_ to add_from_relobj.
15145 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15146 every thousand variables.
15147 * testsuite/Makefile.in: Rebuild.
15149 * object.cc (Xindex::initialize_symtab_xindex): New function.
15150 (Xindex::read_symtab_xindex): New function.
15151 (Xindex::sym_xindex_to_shndx): New function.
15152 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15154 (Sized_relobj::do_initialize_xindex): New function.
15155 (Sized_relobj::do_read_symbols): Adjust section links.
15156 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15157 parameter. Change all callers.
15158 (Sized_relobj::include_section_group): Adjust section links and
15159 symbol section indexes.
15160 (Sized_relobj::do_layout): Adjust section links.
15161 (Sized_relobj::do_count_local_symbols): Adjust section links and
15162 symbol section indexes.
15163 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15164 ordinary and special symbols.
15165 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15166 dynsym_xindex parameters. Change all callers. Adjust section
15167 links. Use SHN_XINDEX when needed.
15168 (Sized_relobj::get_symbol_location_info): Adjust section links.
15169 Don't get fooled by special symbols.
15170 * object.h (class Xindex): Define.
15171 (class Object): Add xindex_ parameter. Declare virtual functoin
15172 do_initialize_xindex.
15173 (Object::adjust_sym_shndx): New function.
15174 (Object::set_xindex): New protected function.
15175 (class Symbol_value): Add is_ordinary_shndx_ field.
15176 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15177 (Symbol_value::value): Assert ordinary section.
15178 (Symbol_value::initialize_input_to_output_map): Likewise.
15179 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15180 Change all callers.
15181 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15183 (class Sized_relobj): Update declarations.
15184 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15185 parameter. Change all callers.
15186 (Sized_relobj::adjust_shndx): New function.
15187 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15189 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15190 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15191 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15192 (Sized_dynobj::read_dynsym_section): Adjust section links.
15193 (Sized_dynobj::read_dynamic): Likewise.
15194 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15196 (Sized_dynobj::do_initialize_xindex): New function.
15197 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15198 do_initialize_xindex.
15199 (Sized_dynobj::adjust_shndx): New function.
15200 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15201 dynsym_xindex_ fields.
15202 (Layout::finalize): Add a call to set_section_indexes before
15203 creating the symtab sections.
15204 (Layout::set_section_indexes): Don't do anything if the section
15205 already has a section index.
15206 (Layout::create_symtab_sections): Add shnum parameter. Change
15207 caller. Create .symtab_shndx section if needed.
15208 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15210 (Layout::allocated_output_section_count): New function.
15211 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15213 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15214 fields. Update declarations.
15215 (Layout::symtab_xindex): New function.
15216 (Layout::dynsym_xindex): New function.
15217 (class Write_symbols_task): Add layout_ field.
15218 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15220 * output.cc (Output_section_headers::Output_section_headers): Add
15221 shstrtab_section parameter. Change all callers.
15222 (Output_section_headers::do_sized_write): Store overflow values
15223 for section count and section string table section index in
15224 section header zero.
15225 (Output_file_header::do_sized_write): Check for overflow of
15226 section count and section string table section index.
15227 (Output_symtab_xindex::do_write): New function.
15228 (Output_symtab_xindex::endian_do_write): New function.
15229 * output.h (class Output_section_headers): Add shstrtab_section_.
15230 Update declarations.
15231 (class Output_symtab_xindex): Define.
15232 (Output_section::has_out_shndx): New function.
15233 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15235 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15236 Change all callers.
15237 (Sized_symbol::init): Likewise.
15238 (Symbol::output_section): Check for ordinary symbol.
15239 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15240 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15242 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15243 Change all callers. Simplify handling of symbols from sections
15244 not included in the link.
15245 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15247 (Weak_alias_sorter::operator()): Assert that symbols are
15249 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15251 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15252 parameters. Change all callers.
15253 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15254 symbol distinction. Use SHN_XINDEX when needed.
15255 (Symbol_table::write_section_symbol): Add symtab_xindex
15256 parameter. Change all callers.
15257 (Symbol_table::sized_write_section_symbol): Likewise. Use
15258 SHN_XINDEX when needed.
15259 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15261 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15262 (Symbol::is_defined): Check is_ordinary.
15263 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15264 (Symbol::is_absolute, Symbol::is_common): Likewise.
15265 (class Sized_symbol): Update declarations.
15266 (class Symbol_table): Update declarations.
15267 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15268 parameters. Change all callers.
15269 (Sized_symbol::override): Likewise.
15270 (Symbol_table::override): Likewise.
15271 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15272 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15273 is_ordinary, and orig_st_shndx parameters. Change all callers.
15274 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15275 to be in an ordinary section.
15276 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15277 object and is_ordinary parameters. Change all callers.
15278 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15279 Change all callers. Don't add undefined or non-ordinary symbols
15281 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15282 Change all callers.
15283 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15285 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15286 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15287 (Sized_relobj::relocate_sections): Likewise.
15288 * target-reloc.h (scan_relocs): Adjust section symbol index.
15289 (scan_relocatable_relocs): Likewise.
15290 * i386.cc (Scan::local): Check for ordinary symbols.
15291 * sparc.cc (Scan::local): Likewise.
15292 * x86_64.cc (Scan::local): Likewise.
15293 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15294 to symbol_section_and_value.
15295 * testsuite/many_sections_test.cc: New file.
15296 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15297 (check_PROGRAMS): Add many_sections_test.
15298 (many_sections_test_SOURCES): Define.
15299 (many_sections_test_DEPENDENCIES): Define.
15300 (many_sections_test_LDFLAGS): Define.
15301 (BUILT_SOURCES): Add many_sections_define.h.
15302 (many_sections_define.h): New target.
15303 (BUILT_SOURCES): Add many_sections_check.h.
15304 (many_sections_check.h): New target.
15305 (check_PROGRAMS): Add many_sections_r_test.
15306 (many_sections_r_test_SOURCES): Define.
15307 (many_sections_r_test_DEPENDENCIES): Define.
15308 (many_sections_r_test_LDFLAGS): Define.
15309 (many_sections_r_test_LDADD): Define.
15310 (many_sections_r_test.o): New target.
15311 * testsuite/Makefile.in: Rebuild.
15313 2008-04-17 Cary Coutant <ccoutant@google.com>
15315 * errors.cc (Errors::info): New function.
15316 (gold_info): New function.
15317 * errors.h (Errors::info): New function.
15318 * gold.h (gold_info): New function.
15319 * object.cc (Input_objects::add_object): Print trace output.
15320 * options.cc (options::parse_set): New function.
15321 (General_options::parse_wrap): Deleted.
15322 (General_options::General_options): Deleted initializer.
15323 * options.h (options::String_set): New typedef.
15324 (options::parse_set): New function.
15325 (DEFINE_set): New macro.
15326 (General_options::wrap): Changed to use DEFINE_set. Changed
15327 callers of any_wrap_symbols and is_wrap_symbol.
15328 (General_options::trace, General_options::trace_symbol):
15330 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15331 (General_options::wrap_symbols_): Deleted.
15332 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15334 2008-04-17 David S. Miller <davem@davemloft.net>
15336 * options.cc (General_options::parse_V): New function.
15337 * options.h: Add entries for -V and -Qy.
15339 2008-04-17 Ian Lance Taylor <iant@google.com>
15341 * common.cc (Symbol_table::allocate_commons): Remove options
15342 parameter. Change caller.
15343 (Symbol_table::do_allocate_commons): Remove options parameter.
15344 Change caller. Just call do_allocate_commons_list twice.
15345 (Symbol_table::do_allocate_commons_list): New function, broken out
15346 of do_allocate_commons.
15347 * common.h (class Allocate_commons_task): Remove options_ field.
15348 Update constructor.
15349 * symtab.cc (Symbol_table::Symbol_table): Initialize
15351 (Symbol_table::add_from_object): Put TLS common symbols on
15353 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15354 which are IN_OUTPUT_DATA.
15355 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15356 allocate_commons and do_allocate_commons declarations. Declare
15357 do_allocate_commons_list.
15358 * gold.cc (queue_middle_tasks): Update creation of
15359 Allocate_commons_task to not pass options.
15360 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15361 (TLS_TEST_C_FLAGS): New variable.
15362 (tls_test_c_pic.o): New target.
15363 (tls_test_shared.so): Link in tls_test_c_pic.o.
15364 (tls_test_c_pic_ie.o): New target.
15365 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15366 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15367 (tls_test_c.o): New target.
15368 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15369 (tls_pic_test_LDADD): Likewise.
15370 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15371 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15372 (tls_test_c_gnu2.o): New target.
15373 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15375 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15376 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15377 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15378 * testsuite/tls_test.cc: Include "config.h".
15379 (t_last): Call t11_last.
15380 * testsuite/tls_test.h (t11, t11_last): Declare.
15381 * testsuite/tls_test_c.c: New file.
15382 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15383 * configure.ac: Check for OpenMP support.
15384 * configure, config.in, Makefile.in: Rebuild.
15385 * testsuite/Makefile.in: Rebuild.
15387 2008-04-16 Cary Coutant <ccoutant@google.com>
15389 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15390 (Target_i386::tls_base_symbol_defined_): New field.
15391 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15392 (Target_i386::Scan::global): Likewise.
15393 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15394 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15395 (Target_x86_64::tls_base_symbol_defined_): New field.
15396 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15397 (Target_x86_64::Scan::global): Likewise.
15399 2008-04-16 Cary Coutant <ccoutant@google.com>
15401 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15402 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15403 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15404 building shared libraries.
15405 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15406 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15407 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15408 * testsuite/Makefile.in: Rebuild.
15409 * testsuite/weak_undef.h: New file.
15410 * testsuite/weak_undef_file1.cc: Add extra test cases.
15411 * testsuite/weak_undef_file2.cc: Likewise.
15412 * testsuite/weak_undef_test.cc: Likewise.
15414 2008-04-16 David S. Miller <davem@davemloft.net>
15416 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15417 Add issued_non_pic_error_ field. Declare check_non_pic.
15418 (Target_sparc::Scan::check_non_pic): New function.
15419 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15420 (Target_sparc::Scan::global): Likewise.
15422 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15423 * configure: Rebuild.
15425 * options.h (DEFINE_enable): New macro.
15426 (new_dtags): New enable option.
15427 (initfirst, interpose, loadfltr, nodefaultlib,
15428 nodelete, nodlopen, nodump): New -z options.
15429 * layout.cc (Layout:finish_dynamic_section): If new
15430 dtags enabled, emit DT_RUNPATH. Also, emit a
15431 DT_FLAGS_1 containing any specified -z flags.
15433 2008-04-16 Ian Lance Taylor <iant@google.com>
15435 * copy-relocs.cc: New file.
15436 * copy-relocs.h: New file.
15437 * reloc.cc: Remove Copy_relocs code.
15438 * reloc.h: Likewise.
15439 * reloc-types.h (struct Reloc_types) [both versions]: Add
15440 get_reloc_addend_noerror.
15441 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15442 variants of add_global which take an addend which must be zero.
15443 * i386.cc: Include "copy-relocs.h".
15444 (class Target_i386): Change type of copy_relocs_ to variable,
15445 update initializer.
15446 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15447 Change all callers.
15448 (Target_i386::do_finalize_sections): Change handling of
15450 * sparc.cc: Include "copy-relocs.h".
15451 (class Target_sparc): Change type of copy_relocs_ to variable,
15452 update initializer.
15453 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15454 Change all callers.
15455 (Target_sparc::do_finalize_sections): Change handling of
15457 * x86_64.cc: Include "copy-relocs.h".
15458 (class Target_x86_64): Change type of copy_relocs_ to variable,
15459 update initializer.
15460 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15461 class. Change all callers.
15462 (Target_x86_64::do_finalize_sections): Change handling of
15464 * Makefile.am (CCFILES): Add copy-relocs.cc.
15465 (HFILES): Add copy-relocs.h.
15467 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15469 * testsuite/script_test_4.sh: Permit leading zeroes.
15471 2008-04-15 Ian Lance Taylor <iant@google.com>
15473 * script-sections.cc (Script_sections::create_segments): Use
15474 header_size_adjustment even when there is enough room for the
15476 * testsuite/script_test_4.sh: New file.
15477 * testsuite/script_test_4.t: New file.
15478 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15479 (check_DATA): Add script_test_4.stdout.
15480 (MOSTLYCLEANFILES): Likewise.
15481 (script_test_4): New target.
15482 (script_test_4.stdout): New target.
15483 * testsuite/Makefile.in: Rebuild.
15485 * sparc.cc: Add definitions for Output_data_plt_sparc class
15488 2008-04-14 David S. Miller <davem@davemloft.net>
15490 * sparc.cc: New file.
15491 * Makefile.am (TARGETSOURCES): Add sparc.cc
15492 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15493 * configure.tgt: Document targ_extra_size and
15494 targ_extra_big_endian. Add entries for sparc-* and
15496 * configure.ac: Handle targ_extra_size and
15497 targ_extra_big_endian.
15498 * Makefile.in: Rebuild.
15499 * configure: Likewise.
15500 * po/POTFILES.in: Likewise.
15501 * po/gold.pot: Likewise.
15503 2008-04-14 Ian Lance Taylor <iant@google.com>
15505 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15506 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15507 in the name/type/flags to section mapping. Don't call
15508 allocate_output_section.
15509 (Layout::choose_output_section): Change parameter from adjust_name
15510 to is_input_section. Don't permit input sections after sections
15511 are attached to segments. Don't call allocate_output_section.
15512 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15513 not write_enable_output_section.
15514 (Layout::make_output_section): Don't push to
15515 unattached_section_list_ nor call attach_to_segment. Call
15516 attach_section_to_segment if sections are attached.
15517 (Layout::attach_sections_to_segments): New function.
15518 (Layout::attach_section_to_segment): New function.
15519 (Layout::attach_allocated_section_to_segment): Rename from
15520 attach_to_segment. Remove flags parameter.
15521 (Layout::allocate_output_section): Remove function.
15522 (Layout::write_enable_output_section): Remove function.
15523 * layout.h (class Layout): Update for above changes. Add new
15524 field sections_are_attached_.
15525 * output.h (Output_section::update_flags_for_input_section): New
15527 * output.cc (Output_section::add_input_section): Call
15528 update_flags_for_input_section.
15529 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15531 2008-04-11 Cary Coutant <ccoutant@google.com>
15533 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15534 thought unnecessary.
15535 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15537 2008-04-11 Ian Lance Taylor <iant@google.com>
15539 * output.h (class Output_section_data): Remove inline definition
15541 * output.cc (Output_section_data::set_addralign): New function.
15543 2008-04-11 Cary Coutant <ccoutant@google.com>
15545 Add support for TLS descriptors for i386 and x86_64.
15546 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15547 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15548 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15550 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15551 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15552 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15554 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15555 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15556 Fix problem with initial-exec relocations.
15557 (Target_i386::Relocate::relocate_tls): Likewise.
15558 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15560 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15561 support for section-plus-offset dynamic table entries.
15562 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15563 (Output_data_dynamic::Dynamic_entry): Add support for
15564 section-plus-offset dynamic table entries.
15565 (Output_data_dynamic::Classification): Likewise.
15566 (Output_data_dynamic::classification_): Renamed offset_.
15567 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15568 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15569 (Target_x86_64::make_plt_section): New function.
15570 (Target_x86_64::reserve_tlsdesc_entries): New function.
15571 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15572 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15573 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15574 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15575 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15576 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15577 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15578 add extra PLT entry for TLS descriptors.
15579 (Output_data_plt_x86_64::got_): New field.
15580 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15581 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15583 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15585 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15586 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15587 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15588 R_386_TLS_DESC_CALL relocations.
15589 (Target_x86_64::Scan::global): Likewise.
15590 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15591 for TLS descriptors.
15592 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15593 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15594 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15595 GD-to-IE relaxation.
15596 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15597 and TLS_DESCRIPTORS.
15598 * Makefile.in: Rebuild.
15599 * configure: Rebuild.
15600 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15601 (tls_test_shared2.so): New target.
15602 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15603 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15604 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15605 (tls_shared_gd_to_ie_test_LDADD): New variable.
15606 (tls_shared_gnu2_gd_to_ie_test): New target.
15607 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15609 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15610 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15611 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15612 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15613 (tls_shared_gnu2_test): New target.
15614 (tls_test_gnu2_shared.so): New target.
15615 (tls_shared_gnu2_test_SOURCES): New variable.
15616 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15617 (tls_shared_gnu2_test_LDFLAGS): New variable.
15618 (tls_shared_gnu2_test_LDADD): New variable.
15619 * testsuite/Makefile.in: Rebuild.
15620 * testsuite/Makefile.
15622 2008-04-11 Ian Lance Taylor <iant@google.com>
15624 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15626 * testsuite/Makefile.in: Rebuild.
15628 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15630 * testsuite/script_test_2.cc (main): Adjust test.
15632 2008-04-11 David S. Miller <davem@davemloft.net>
15633 Ian Lance Taylor <iant@google.com>
15635 * options.h (General_options): Add entries for '-Y' and
15637 * options.cc (General_options:finalize): If -Y was used, add those
15638 entries to the library path instead of the default "/lib" and
15641 2008-04-11 David S. Miller <davem@davemloft.net>
15643 * testsuite/justsyms.t: Start at 0x100.
15644 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15645 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15647 * testsuite/script_test_2.cc: Adjust string and section length
15650 2008-04-09 Ian Lance Taylor <iant@google.com>
15653 * script-sections.cc (Sections_element::allocate_to_segment): Add
15655 (Output_section_definition::allocate_to_segment): Likewise.
15656 (Orphan_output_section::allocate_to_segment): Likewise.
15657 (Script_sections::attach_sections_using_phdrs_clause): Don't
15658 propagate non-PT_LOAD segments to orphan sections.
15659 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15660 readelf rather than objdump.
15661 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15662 .interp section and PT_INTERP segment are the same size.
15663 * testsuite/Makefile.in: Rebuild.
15665 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15666 aliases for symbols defined in the same object.
15667 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15668 (weak_alias_test_SOURCES): New variable.
15669 (weak_alias_test_DEPENDENCIES): New variable.
15670 (weak_alias_test_LDFLAGS): New variable.
15671 (weak_alias_test_LDADD): New variable.
15672 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15673 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15674 (weak_alias_test_3.o): New target.
15675 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15676 * testsuite/weak_alias_test_main.cc: New file.
15677 * testsuite/weak_alias_test_1.cc: New file.
15678 * testsuite/weak_alias_test_2.cc: New file.
15679 * testsuite/weak_alias_test_3.cc: New file.
15681 2008-04-08 Ian Lance Taylor <iant@google.com>
15683 * options.h (class General_options): Add --noinhibit-exec option.
15684 * main.cc (main): Check --noinhibit-exec.
15686 * options.h (class General_options): Define --wrap as a special
15687 option. Add wrap_symbols_ field.
15688 (General_options::any_wrap_symbols): New function.
15689 (General_options::is_wrap_symbol): New function.
15690 * options.cc (General_options::parse_wrap): New function.
15691 (General_options::General_options): Initialize wrap_symbols_.
15692 * symtab.cc (Symbol_table::wrap_symbol): New function.
15693 (Symbol_table::add_from_object): Handle --wrap.
15694 * symtab.h (class Symbol_table): Declare wrap_symbol.
15695 * target.h (Target::wrap_char): New function.
15696 (Target::Target_info): Add wrap_char field.
15697 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15698 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15699 * testsuite/testfile.cc (Target_test::test_target_info):
15702 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15705 * layout.h (class Layout): Add added_eh_frame_data_ field.
15706 * layout.cc (Layout::Layout): Initialize new field.
15707 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15708 output section until we find a section we merged successfully.
15709 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15710 that the size be non-zero.
15712 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15715 2008-04-08 Craig Silverstein <csilvers@google.com>
15717 * configure.ac: Export new conditional variable HAVE_ZLIB.
15718 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15720 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15721 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15723 2008-04-07 Ian Lance Taylor <iant@google.com>
15725 * version.cc (version_string): Set to "1.5".
15727 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15728 Add issued_non_pic_error_ field. Declare check_non_pic.
15729 (Target_x86_64::Scan::check_non_pic): New function.
15730 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15731 (Target_x86_64::Scan::global): Likewise.
15733 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15734 addend parameter. Change caller. Handle merge sections.
15735 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15736 Address to Addend. Don't add in the result of
15737 local_section_offset, pass down the addend and use the returned
15739 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15740 Update declarations of local_section_offset and symbol_value.
15741 * testsuite/two_file_test_1.cc (t18): New function.
15742 * testsuite/two_file_test_2.cc (f18): New function.
15743 * testsuite/two_file_test_main.cc (main): Call t18.
15744 * testsuite/two_file_test.h (t18, f18): Declare.
15746 * configure.ac: Don't test for objdump, c++filt, or readelf.
15747 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15749 (TEST_READELF): New variable.
15750 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15751 (check_PROGRAMS): Add two_file_strip_test.
15752 (two_file_strip_test): New target.
15753 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15754 (two_file_same_shared_strip_test_SOURCES): New variable.
15755 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15756 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15757 (two_file_same_shared_strip_test_LDADD): New variable.
15758 (two_file_shared_strip.so): New target.
15759 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15760 (ver_test_5.syms, ver_test_7.syms): Likewise.
15761 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15762 (strip_test_3.stdout): Use TEST_OBJDUMP.
15763 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15765 2008-04-04 Cary Coutant <ccoutant@google.com>
15767 * symtab.h (Symbol::is_weak_undefined): New function.
15768 (Symbol::is_strong_undefined): New function.
15769 (Symbol::is_absolute): New function.
15770 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15771 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15773 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15774 (weak_undef_test): New target.
15775 * testsuite/Makefile.in: Rebuild.
15776 * testsuite/weak_undef_file1.cc: New file.
15777 * testsuite/weak_undef_file2.cc: New file.
15778 * testsuite/weak_undef_test.cc: New file.
15780 2008-04-03 Craig Silverstein <csilvers@google.com>
15782 * compressed_output.h (class Output_compressed_section): Use
15784 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15786 (zlib_compressed_suffix): Removed.
15787 (Output_compressed_section::set_final_data_size): Use unsigned
15789 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15790 Fix linker invocation.
15791 (flagstest_o_specialfile_and_compress_debug_sections):
15793 * testsuite/Makefile.in: Regenerated.
15795 2008-04-02 David S. Miller <davem@davemloft.net>
15797 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15798 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15800 2008-04-02 Craig Silverstein <csilvers@google.com>
15804 2008-04-02 Ian Lance Taylor <iant@google.com>
15806 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15807 parameters. Update for new key type to views_. Change all
15809 (File_read::read): Adjust for byteshift in returned view.
15810 (File_read::add_view): New function, broken out of
15811 find_and_make_view.
15812 (File_read::make_view): New function, broken out of
15813 find_and_make_view.
15814 (File_read::find_or_make_view): Add offset and aligned
15815 parameters. Rewrite accordingly. Change all callers.
15816 (File_read::get_view): Add offset and aligned parameters. Adjust
15817 for byteshift in return value.
15818 (File_read::get_lasting_view): Likewise.
15819 * fileread.h (class File_read): Update declarations.
15820 (class File_read::View): Add byteshift_ field. Add byteshift to
15821 constructor. Add byteshift method.
15822 * archive.h (Archive::clear_uncached_views): New function.
15823 (Archive::get_view): Add aligned parameter. Change all callers.
15824 * object.h (Object::get_view): Add aligned parameter. Change all
15826 (Object::get_lasting_view): Likewise.
15828 * fileread.cc (File_read::release): Don't call clear_views if
15829 there are multiple objects.
15830 * fileread.h (File_read::clear_uncached_views): New function.
15831 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15834 2008-03-31 Cary Coutant <ccoutant@google.com>
15836 Add thin archive support.
15837 * archive.cc (Archive::armagt): New const.
15838 (Archive::setup): Remove task parameter and calls to unlock.
15839 (Archive::unlock_nested_archives): New function.
15840 (Archive::read_header): Add nested_off parameter. Change
15842 (Archive::interpret_header): Likewise.
15843 (Archive::include_all_members): Change to handle thin
15845 (Archive::include_member): Likewise.
15846 * archive.h (Archive::Archive): Add new parameters and
15848 (Archive::armagt): New const.
15849 (Archive::setup): Remove task parameter.
15850 (Archive::unlock_nested_archives): New function.
15851 (Archive::read_header): Add nested_off parameter.
15852 (Archive::interpret_header): Likewise.
15853 (Archive::Nested_archive_table): New typedef.
15854 (Archive::is_thin_archive_): New field.
15855 (Archive::nested_archives_): New field.
15856 (Archive::options_): New field.
15857 (Archive::dirpath_): New field.
15858 (Archive::task_): New field.
15859 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15860 for thin archives. Pass additional parameters to
15861 Archive::Archive. Unlock the archive file after calling
15864 2008-03-29 Ian Lance Taylor <iant@google.com>
15866 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15867 version symbol to be local.
15868 * testsuite/ver_test_4.sh: New file.
15869 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15870 (check_DATA): Add ver_test_4.syms.
15871 (ver_test_4.syms): New target.
15872 * testsuite/Makefile.in: Rebuild.
15875 (Output_section::Input_section_sort_entry::has_priority): New
15877 (Output_section::Input_section_sort_entry::match_file_name): New
15879 (Output_section::Input_section_sort_entry::match_section_name):
15881 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15883 (Output_section::Input_section_sort_entry::match_section_file):
15885 (Output_section::Input_section_sort_compare::operator()): Rewrite
15886 using new Input_section_sort_entry functions. Sort crtbegin and
15887 crtend first. Sort sections with no priority before sections with
15889 * testsuite/initpri1.c (d3): Check j != 4.
15890 (cd5): New constructor/destructor function.
15891 (main): Check j != 2.
15893 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15894 new symbol when resolving, don't call set_is_default.
15895 * testsuite/ver_test_7.cc: New file.
15896 * testsuite/ver_test_7.sh: New file.
15897 * testsuite/Makefile.am (ver_test_7.so): New target.
15898 (ver_test_7.o): New target.
15899 (check_SCRIPTS): Add ver_test_7.sh.
15900 (check_DATA): Add ver_test_7.syms.
15901 (ver_test_7.syms): New target.
15903 2008-03-28 Ian Lance Taylor <iant@google.com>
15905 * layout.cc (Layout::layout): If we see an input section with a
15906 name that needs sorting, set the must_sort flag for the output
15908 (Layout::make_output_section): If the name of the output section
15909 indicates that it might require sorting, set the may_sort flag.
15910 * output.h (Output_section::may_sort_attached_input_sections): New
15912 (Output_section::set_may_sort_attached_input_sections): New
15914 (Output_section::must_sort_attached_input_sections): New
15916 (Output_section::set_must_sort_attached_input_sections): New
15918 (class Output_section): Declare Input_section_sort_entry. Define
15919 Input_section_sort_compare. Declare
15920 sort_attached_input_sections. Add new fields:
15921 may_sort_attached_input_sections_,
15922 must_sort_attached_input_sections_,
15923 attached_input_sections_are_sorted_.
15924 * output.cc (Output_section::Output_section): Initialize new
15926 (Output_section::add_input_section): Add an entry to
15927 input_sections_ if may_sort or must_sort are true.
15928 (Output_section::set_final_data_size): Call
15929 sort_attached_input_sections if necessary.
15930 (Output_section::Input_section_sort_entry): Define new class.
15931 (Output_section::Input_section_sort_compare::operator()): New
15933 (Output_section::sort_attached_input_sections): New function.
15934 * configure.ac: Check whether the compiler supports constructor
15935 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15936 * testsuite/initpri1.c: New file.
15937 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15938 CONSTRUCTOR_PRIORITY.
15939 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15940 (initpri1_LDFLAGS): New variable.
15941 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15943 2008-03-27 Ian Lance Taylor <iant@google.com>
15945 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15946 * testsuite/common_test_1.c: New file.
15947 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15948 (common_test_1_SOURCES): New variable.
15949 (common_test_1_DEPENDENCIES): New variable.
15950 (common_test_1_LDFLAGS): New variable.
15952 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15953 and commons_ correctly when NAME/VERSION does not override
15955 * testsuite/ver_test_6.c: New file.
15956 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15957 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15958 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15960 2008-03-26 Ian Lance Taylor <iant@google.com>
15962 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15963 of an undefined symbol from a version script.
15964 * testsuite/Makefile.am (ver_test_5.so): New target.
15965 (ver_test_5.o): New target.
15966 (check_SCRIPTS): Add ver_test_5.sh.
15967 (check_DATA): Add ver_test_5.syms.
15968 (ver_test_5.syms): New target.
15969 * testsuite/ver_test_5.cc: New file.
15970 * testsuite/ver_test_5.script: New file.
15971 * testsuite/ver_test_5.sh: New file.
15972 * Makefile.in, testsuite/Makefile.in: Rebuild.
15975 Fix problems building gold with gcc 4.3.0.
15976 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15977 (gold_error_at_location, gold_warning_at_location): Use it.
15978 * configure.ac: Check whether we can compile and use a template
15979 function with a printf attribute.
15980 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15981 when jumping over bytes.
15982 * object.cc: Instantiate Object::read_section_data.
15983 * debug.h: Include <cstring>
15984 * dwarf_reader.cc: Include <algorithm>
15985 * main.cc: Include <cstring>.
15986 * options.cc: Include <cstring>.
15987 * output.cc: Include <cstring>.
15988 * script.cc: Include <cstring>.
15989 * script.h: Include <string>.
15990 * symtab.cc: Include <cstring> and <algorithm>.
15991 * target-select.cc: Include <cstring>.
15992 * version.cc: Include <string>.
15993 * testsuite/testmain.cc: Include <cstdlib>.
15994 * configure, config.in: Rebuild.
15996 2008-03-25 Ian Lance Taylor <iant@google.com>
15998 * options.cc: Include "../bfd/bfdver.h".
15999 (options::help): Print bug reporting address.
16001 * version.cc (print_version): Adjust output for current value of
16002 BFD_VERSION_STRING.
16006 * options.cc (options::help): Print list of supported targets.
16007 * target-select.h: Include <vector>.
16008 (class Target_selector): Make machine_, size_, and is_big_endian_
16009 fields const. Add bfd_name_ and instantiated_target_ fields.
16010 (Target_selector::Target_selector): Add bfd_name parameter.
16011 (Target_selector::recognize): Make non-virtual, call
16013 (Target_selector::recognize_by_name): Make non-virtual, call
16014 do_recognize_by_name.
16015 (Target_selector::supported_names): New function.
16016 (Target_selector::bfd_name): New function.
16017 (Target_selector::do_instantiate_target): New pure virtual
16019 (Target_selector::do_recognize): New virtual function.
16020 (Target_selector::do_recognize_by_name): New virtual function.
16021 (Target_selector::instantiate_target): New private function.
16022 (supported_target_names): Declare.
16023 * target-select.cc (Target_selector::Target_selector): Update for
16024 new parameter and fields.
16025 (select_target_by_name): Check that the name matches before
16026 calling recognize_by_name.
16027 (supported_target_names): New function.
16028 * i386.cc (class Target_selector_i386): Update Target_selector
16029 constructor call. Remove recognize and recognize_by_name. Add
16030 do_instantiate_target.
16031 * x86_64.cc (class Target_selector_x86_64): Likewise.
16032 * testsuite/testfile.cc (class Target_selector_test): Update for
16033 changes to Target_selector.
16035 * README: Rewrite, with some notes on unsupported features.
16037 2008-03-24 Cary Coutant <ccoutant@google.com>
16039 * i386.cc (Target_i386::Got_type): New enum declaration.
16040 (Target_i386::Scan::local): Updated callers of Output_data_got
16042 (Target_i386::Scan::global): Likewise.
16043 (Target_i386::Relocate::relocate): Likewise.
16044 (Target_i386::Relocate::relocate_tls): Likewise.
16045 * object.h (Got_offset_list): New class.
16046 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16047 (Sized_relobj::local_got_offset): Likewise.
16048 (Sized_relobj::set_local_got_offset): Likewise.
16049 (Sized_relobj::local_has_tls_got_offset): Removed.
16050 (Sized_relobj::local_tls_got_offset): Removed.
16051 (Sized_relobj::set_local_tls_got_offset): Removed.
16052 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16053 * output.cc (Output_data_got::add_global): Added got_type parameter.
16054 (Output_data_got::add_global_with_rel): Likewise.
16055 (Output_data_got::add_global_with_rela): Likewise.
16056 (Output_data_got::add_global_pair_with_rel): New function.
16057 (Output_data_got::add_global_pair_with_rela): New function.
16058 (Output_data_got::add_local): Added got_type parameter.
16059 (Output_data_got::add_local_with_rel): Likewise.
16060 (Output_data_got::add_local_with_rela): Likewise.
16061 (Output_data_got::add_local_pair_with_rel): New function.
16062 (Output_data_got::add_local_pair_with_rela): New function.
16063 (Output_data_got::add_global_tls): Removed.
16064 (Output_data_got::add_global_tls_with_rel): Removed.
16065 (Output_data_got::add_global_tls_with_rela): Removed.
16066 (Output_data_got::add_local_tls): Removed.
16067 (Output_data_got::add_local_tls_with_rel): Removed.
16068 (Output_data_got::add_local_tls_with_rela): Removed.
16069 * output.h (Output_data_got::add_global): Added got_type parameter.
16070 (Output_data_got::add_global_with_rel): Likewise.
16071 (Output_data_got::add_global_with_rela): Likewise.
16072 (Output_data_got::add_global_pair_with_rel): New function.
16073 (Output_data_got::add_global_pair_with_rela): New function.
16074 (Output_data_got::add_local): Added got_type parameter.
16075 (Output_data_got::add_local_with_rel): Likewise.
16076 (Output_data_got::add_local_with_rela): Likewise.
16077 (Output_data_got::add_local_pair_with_rel): New function.
16078 (Output_data_got::add_local_pair_with_rela): New function.
16079 (Output_data_got::add_global_tls): Removed.
16080 (Output_data_got::add_global_tls_with_rel): Removed.
16081 (Output_data_got::add_global_tls_with_rela): Removed.
16082 (Output_data_got::add_local_tls): Removed.
16083 (Output_data_got::add_local_tls_with_rel): Removed.
16084 (Output_data_got::add_local_tls_with_rela): Removed.
16085 * resolve.cc (Symbol::override_base_with_special): Removed
16086 reference to has_got_offset_ field.
16087 * symtab.cc (Symbol::init_fields): Replaced initialization
16088 of got_offset_ with got_offsets_. Removed initialization
16090 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16091 (Symbol::got_offset): Likewise.
16092 (Symbol::set_got_offset): Likewise.
16093 (Symbol::has_tls_got_offset): Removed.
16094 (Symbol::tls_got_offset): Removed.
16095 (Symbol::set_tls_got_offset): Removed.
16096 (Symbol::got_offset_): Removed.
16097 (Symbol::tls_mod_got_offset_): Removed.
16098 (Symbol::tls_pair_got_offset_): Removed.
16099 (Symbol::got_offsets_): New field.
16100 (Symbol::has_got_offset): Removed.
16101 (Symbol::has_tls_mod_got_offset): Removed.
16102 (Symbol::has_tls_pair_got_offset): Removed.
16103 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16104 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16106 (Target_x86_64::Scan::global): Likewise.
16107 (Target_x86_64::Relocate::relocate): Likewise.
16108 (Target_x86_64::Relocate::relocate_tls): Likewise.
16110 2008-03-25 Ben Elliston <bje@au.ibm.com>
16112 * yyscript.y: Fix spelling error in comment.
16114 2008-03-24 Ian Lance Taylor <iant@google.com>
16116 * options.h (class General_options): Define build_id option.
16117 * layout.h (class Layout): Declare write_build_id, create_note,
16118 create_build_id. Add build_id_note_ member.
16119 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16120 "libiberty.h", "md5.h", "sha1.h".
16121 (Layout::Layout): Initialize eh_frame_data_,
16122 eh_frame_hdr_section_, and build_id_note_.
16123 (Layout::finalize): Call create_build_id.
16124 (Layout::create_note): New function, broken out of
16125 Layout::create_gold_note.
16126 (Layout::create_gold_note): Call create_note.
16127 (Layout::create_build_id): New function.
16128 (Layout::write_build_id): New function.
16129 (Close_task_runner::run): Call write_build_id.
16131 * x86_64.cc: Correct license to GPLv3.
16133 2008-03-23 Ian Lance Taylor <iant@google.com>
16135 * options.cc: Include "demangle.h".
16136 (parse_optional_string): New function.
16137 (parse_long_option): Handle takes_optional_argument.
16138 (parse_short_option): Update dash_z initializer. Handle
16139 takes_optional_argument.
16140 (General_options::General_options): Initialize do_demangle_.
16141 (General_options::finalize): Set do_demangle_. Handle demangling
16143 * options.h (parse_optional_string): Declare.
16144 (struct One_option): Add optional_arg field. Update constructor.
16145 Update call constructor calls. Add takes_optional_argument
16147 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16148 (DEFINE_optional_string): Define.
16149 (General_options::demangle): Change from DEFINE_bool to
16150 DEFINE_optional_string.
16151 (General_options::no_demangle): New function.
16152 (General_options::do_demangle): New function.
16153 (General_options::set_do_demangle): New function.
16154 (General_options::execstack_status_): Move definition to end of
16156 (General_options::static_): Likewise.
16157 (General_options::do_demangle_): New field.
16158 * object.cc (big_endian>::get_symbol_location_info): Call
16159 Options::do_demangle, not Options::demangle.
16160 * symtab.cc (demangle): Likewise.
16162 2008-03-22 Ian Lance Taylor <iant@google.com>
16164 * gold.h: Include <cstddef> and <sys/types.h>
16165 * options.h: Include <cstring>.
16167 2008-03-21 Ian Lance Taylor <iant@google.com>
16169 * Added source code to GNU binutils.
16171 Copyright (C) 2008-2014 Free Software Foundation, Inc.
16173 Copying and distribution of this file, with or without modification,
16174 are permitted in any medium without royalty provided the copyright
16175 notice and this notice are preserved.
16181 version-control: never