1 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
3 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
4 * plugin.h: add lock definition
6 2014-10-29 Han Shen <shenhan@google.com>
7 Jing Yu <jingyu@google.com>
9 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
10 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
11 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
13 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
15 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
16 (Target_aarch64::tls_ld_to_le): New method.
17 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
19 (Output_data_plt_aarch64::irelative_rel_): New data member.
20 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
21 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
22 (Output_data_plt_aarch64::add_relocation): New method.
23 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
24 offset. Add got_irelative size to got size.
25 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
26 type string with the new typename.
27 (AArch64_relocate_functions::update_adr): Replace parameter x with
29 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
30 (AArch64_relocate_functions::reloc_common): New method.
31 (AArch64_relocate_funcsions::rela_general): Extract common part out
32 into reloc_common method.
33 (AArch64_relocate_functions::rela_general): Likewise.
34 (AArch64_relocate_functions::pcrela_general): Likewise.
35 (AArch64_relocate_functions::adr): New method.
36 (AArch64_relocate_functions::adrp): Calculate immed before calling
38 (AArch64_relocate_functions::adrp): Likewise.
39 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
40 comparing x to 0. Calculate immed from ~x when x < 0.
41 (Target_aarch64::optimize_tls_reloc): Add new cases for
42 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
43 TLSLD_MOVW_DTPREL_G0_NC.
44 (Target_aarch64::possible_function_pointer_reloc): Implement this
46 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
48 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
49 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
50 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
51 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
52 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
53 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
54 (Target_aarch64::make_plt_entry): Call add_entry with two more
56 (Target_aarch64::make_local_ifunc_plt_entry): New method.
57 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
58 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
59 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
60 (Target_aarch64::Relocate::relocate_tls): Add cases for
61 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
62 TLSLD_MOVW_DTPREL_G0_NC.
63 * testsuite/icf_safe_so_test.cc: Correct test comment.
64 * testsuite/icf_safe_test.sh: Add AArch64 arch.
66 2014-10-22 Alan Modra <amodra@gmail.com>
68 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
71 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
73 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
75 2014-10-17 Cary Coutant <ccoutant@google.com>
77 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
78 Add "typename" keyword.
80 2014-09-22 Han Shen <shenhan@google.com>
81 Jing Yu <jingyu@google.com>
83 Patch for gold aarch64 backend to support relaxation.
84 * aarch64-reloc.def: Change format.
85 * aarch64.cc (class Reloc_stub): New class.
86 (class Stub_table): New class.
87 (class AArch64_relobj): New class.
88 (class AArch64_input_section): New class.
89 (class AArch64_output_section): New class.
90 (Target_aarch64::new_stub_table): New method.
91 (Target_aarch64::new_aarch64_input_section): New method.
92 (Target_aarch64::find_aarch64_input_section): New method.
93 (Target_aarch64::scan_section_for_stubs): New method.
94 (Target_aarch64::scan_reloc_section_for_stubs): New method.
95 (Target_aarch64::relocate_stub): New method.
96 (Target_aarch64::current_target): New method.
97 (Target_aarch64::do_make_elf_object): New method.
98 (Target_aarch64::do_may_relax): New method.
99 (Target_aarch64::do_relax): New method.
100 (Target_aarch64::group_sections): New method.
101 (Target_aarch64::scan_reloc_for_stub): New method.
102 (Target_aarch64::do_make_output_section): New method.
103 (Target_aarch64::stub_tables_): New data member.
104 (Target_aarch64::aarch64_input_section_map_): New data member.
105 (AArch64_relocate_functions::maybe_apply_stub): New method.
107 2014-09-30 Cary Coutant <ccoutant@google.com>
110 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
112 2014-09-30 Kito Cheng <kito@0xlab.org>
115 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
116 hash table before sysv-style hash table.
118 2014-09-29 Sriraman Tallam <tmsriram@google.com>
120 * options.h (--pic-executable): Add negative to alias to -no-pie.
122 2014-09-26 Cary Coutant <ccoutant@google.com>
125 * object.cc (Sized_relobj_file): Compute value of section symbols
126 for TLS sections the same as TLS symbols.
128 2014-09-25 Cary Coutant <ccoutant@google.com>
131 * resolve.cc (Symbol_table::resolve): Override common placeholder
132 symbols, but adjust sizes.
133 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
134 symbols to common lists.
136 2014-09-24 Alan Modra <amodra@gmail.com>
138 * po/POTFILES.in: Regenerate.
140 2014-09-23 Taiju Tsuiki <tzik@google.com>
141 Cary Coutant <ccoutant@google.com>
144 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
145 on input_sections_blocker.
146 * layout.cc (Write_sections_task::locks): Unblock
147 input_sections_blocker_.
148 * layout.h (Write_sections_task::Write_sections_task): Add
149 input_sections_blocker.
150 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
152 * testsuite/Makefile.in: Regenerate.
154 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
156 * testsuite/Makefile.am (plugin_test_10): New test.
157 * testsuite/Makefile.in: Regenerate
158 * testsuite/plugin_common_test_2.c (c1): Align to 8.
159 * testsuite/plugin_test_10.sh: New file.
161 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
163 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
164 * resolve.cc (Symbol_table::resolve): Don't override common symbols
165 during the replacement phase.
167 2014-09-17 Han Shen <shenhan@google.com>
168 Jing Yu <jingyu@google.com>
170 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
171 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
172 * aarch64.cc (Target_aarch64): Add data members
173 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
174 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
176 (Target_aarch64::do_reloc_symbol_index): New method.
177 (Target_aarch64::do_reloc_addend): New method.
178 (Target_aarch64::add_tlsdesc_info): New method.
179 (Target_aarch64::do_dynsym_value): New method.
180 (Target_aarch64::do_make_data_plt): Add new parameters: got,
181 got_irelative. Pass them to Output_data_plt_aarch64_standard.
182 (Target_aarch64::make_data_plt): Add new parameters: got,
183 got_irelative. Pass them to do_make_data_plt.
184 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
185 (Target_aarch64::Relocate:tls_gd_to_le): New method.
186 (Target_aarch64::Relocate:tls_ie_to_le): New method.
187 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
188 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
189 (Target_aarch64::got_tlsdesc_section): New method.
190 (Target_aarch64::make_local_ifunc_plt_entry): New method.
191 (Target_aarch64::define_tls_base_symbol): New method.
192 (Target_aarch64::reserve_tlsdesc_entries): New method.
193 (Target_aarch64::got_mod_index_entry): New method.
194 (Target_aarch64::rela_tlsdesc_section): New method.
195 (Target_aarch64::rela_irelative_section): New method.
196 (Target_aarch64::Tlsdesc_info): New struct.
197 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
198 relocations and tlsdesc relocations.
199 (Target_aarch64::optimize_tls_reloc): Implement method.
200 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
201 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
203 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
204 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
205 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
206 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
207 (Output_data_plt_aarch64::rela_tlsdesc): New method.
208 (Output_data_plt_aarch64::rela_irelative): New method.
209 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
210 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
211 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
212 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
213 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
214 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
215 (Output_data_plt_aarch64_standard): New member variables:
216 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
217 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
218 New parameter: got, got_irelative.
219 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
220 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
221 (Output_data_plt_aarch64::do_write): Replace got_address with
222 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
223 (AArch64_relocate_functions::update_movnz): New method.
224 (AArch64_relocate_functions): Correct format.
225 (AArch64_relocate_functions::movnz): New method.
226 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
227 before the switch. Add new cases to switch.
228 Check ie_to_le relaxation on tlsie relocations. Add code handling
230 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
231 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
232 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
233 Call reloc_name_in_error_message to print unsupported reloc.
234 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
236 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
237 relocs. Fill in some more dynamic tags.
238 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
239 Skip call tls_get_addr when tlsgd is relaxed.
240 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
241 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
242 tlsdesc->ie relaxation.
244 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
246 * mips.cc (Target_mips_nacl): New class.
247 (Target_selector_mips_nacl): New class.
248 (target_selector_mips32): Rename from target_selector_mips32be and use
249 Target_selector_mips_nacl instead of Target_selector_mips.
250 (target_selector_mips32el): Rename from target_selector_mips32 and use
251 Target_selector_mips_nacl instead of Target_selector_mips.
252 (target_selector_mips64): Rename from target_selector_mips64be and use
253 Target_selector_mips_nacl instead of Target_selector_mips.
254 (target_selector_mips64el): Rename from target_selector_mips64 and use
255 Target_selector_mips_nacl instead of Target_selector_mips.
256 (Target_mips::mips_info): Add const attribute.
258 2014-09-02 Cary Coutant <ccoutant@google.com>
260 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
261 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
262 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
263 (Sized_incr_dynobj::do_section_name): Likewise.
264 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
265 (Sized_incr_dynobj::do_section_name): Likewise.
266 * object.h (Object::section_name): Likewise.
267 (Object::do_section_name): Likewise.
268 (Sized_relobj_file::do_section_name): Likewise.
269 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
270 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
272 2014-09-02 Cary Coutant <ccoutant@google.com>
275 * ehframe.cc (Fde::write): Add output_offset parameter.
276 (Cie::write): Likewise.
277 (Eh_frame::set_final_data_size): Account for offset within output
279 (Eh_frame::do_sized_write): Likewise.
280 * ehframe.h (Fde::write): Add output_offset parameter.
281 (Cie::write): Likewise.
282 * output.cc (Output_section::Input_section_sort_entry): Remove
283 section_has_name_; add output_section_name parameter. Use
284 output section name for non-input sections.
285 (Output_section::Input_section_sort_entry::section_has_name): Remove.
286 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
287 (Output_section::Input_section_sort_compare): Remove logic for
288 sections without names.
289 (Output_section::Input_section_sort_init_fini_compare): Likewise.
290 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
292 (Output_section::Input_section_sort_section_name_compare): Likewise.
294 2014-08-29 Han Shen <shenhan@google.com>
295 Jing Yu <jingyu@google.com>
297 * aarch64-reloc-property.cc
298 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
299 reference reloc property in the table.
300 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
302 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
303 2 new overloaded methods.
304 (Output_data_got_aarch64::do_write): Add code to write out
306 (class Output_data_got_aarch64::Static_reloc): New class to wrap
308 (Output_data_got_aarch64::static_relocs): New vector to
310 (Target_aarch64::TCB_SIZE): New const static memeber.
311 (Target_aarch64::tcb_size): New method.
312 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
313 (Target_aarch64::Relocate::relocate_tls): New method.
314 (Target_aarch64::Scan::local): Add code handling new reloc types.
315 (Target_aarch64::Scan::global): Add code handling new reloc types.
317 2014-08-13 Sriraman Tallam <tmsriram@google.com>
319 * options.h (-no-pie): Add option.
321 2014-08-08 Jing Yu <jingyu@google.com>
322 Han Shen <shenhan@google.com>
324 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
325 (DEFFILES): add aarch64-reloc.def.
326 (TARGETSOURCES): Add aarch64-reloc-property.cc.
327 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
328 * Makefile.in: Regenerate.
329 * aarch64-reloc-property.cc: New file.
330 * aarch64-reloc-property.h: New file.
331 * aarch64-reloc.def: New file.
332 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
333 with tab to make the format consistent.
334 (Output_data_got_aarch64::symbol_table_): New method.
335 (Target_aarch64::do_plt_address_for_global): New method.
336 (Target_aarch64::do_plt_address_for_local): New method.
337 (Target_aarch64::do_select_as_default_target): New method.
338 (Target_aarch64::do_make_data_plt): New method.
339 (Target_aarch64::make_data_plt): New method.
340 (Output_data_plt_aarch64::has_irelative_section): New method.
341 (Output_data_plt_aarch64::address_for_global): New method.
342 (Output_data_plt_aarch64::address_for_local): New method.
343 (Output_data_plt_aarch64::irelative_rel_): New parameter.
344 (Output_data_plt_aarch64::add_entry): Implement contents.
345 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
346 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
347 the got_pov entry to plt0.
348 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
350 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
351 (AArch64_howto): New struct.
352 (aarch64_howto[]): New static const array.
353 (AArch64_relocate_functions): New class.
354 (Target_aarch64::Scan::get_reference_flags): Remove method.
355 (Target_aarch64::Scan::local): Implement to support a few relocations.
356 (Target_aarch64::Scan::global): Implement to support a few relocations.
357 (Target_aarch64::make_plt_section): Implement contents.
358 (Target_aarch64::make_plt_entry): Implement contents.
359 (Target_aarch64::do_finalize_sections): Implement contents.
360 (Target_aarch64::Relocate::relocate): Implement a few relocations.
361 (Target_aarch64::relocate_section): Implement contents.
363 2014-08-06 Alan Modra <amodra@gmail.com>
365 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
367 2014-08-06 Alan Modra <amodra@gmail.com>
370 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
372 2014-07-21 Sriraman Tallam <tmsriram@google.com>
374 * object.cc (Relobj::is_section_name_included): Add
375 ".rodata.nptl_version" to not garbage collect this section.
377 2014-07-08 Cary Coutant <ccoutant@google.com>
379 * expression.cc (struct Expression::Expression_eval_info): Add
380 new fields type_pointer, vis_pointer, and nonvis_pointer.
381 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
382 nonvis_pointer parameters. Adjust all calls.
383 (Symbol_expression::value): Update type, visibility, and nonvis bits
385 * script.cc (Symbol_assignment::sized_finalize): Update type,
386 visibility, and remaining st_other bits for new symbol.
387 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
388 vis_pointer, and nonvis_pointer parameters.
389 * symtab.h (Symbol::set_type): New method.
391 * testsuite/Makefile.am (defsym_test): New test.
392 * testsuite/Makefile.in: Regenerate.
393 * testsuite/defsym_test.c: New file.
394 * testsuite/defsym_test.sh: New file.
396 2014-07-08 Cary Coutant <ccoutant@google.com>
399 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
400 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
401 (Sized_dynobj::base_read_symbols): ...new method.
402 * object.h (Sized_relobj_file::base_read_symbols): New method.
403 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
404 (Sized_relobj_file::base_read_symbols): ...new method.
405 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
406 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
407 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
409 2014-07-04 Alan Modra <amodra@gmail.com>
411 * po/POTFILES.in: Regenerate.
413 2014-07-02 Jing Yu <jingyu@google.com>
415 * aarch64.cc: New file
416 * Makefile.am (TARGETSOURCES): Add aarch64.cc
417 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
418 * Makefile.in: Regenerate.
419 * configure.tgt: Add entries for aarch64*.
420 * configure.ac: Likewise.
421 * configure: Likewise.
423 2014-06-27 Alan Modra <amodra@gmail.com>
425 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
427 2014-06-24 Cary Coutant <ccoutant@google.com>
429 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
431 (Dwo_file::sized_read_unit_index): Likewise.
433 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
436 * Makefile.am (TARGETSOURCES): Add mips.cc
437 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
438 * configure.tgt: Add entries for mips*.
439 * configure.ac: Likewise.
440 * Makefile.in: Regenerate.
441 * configure: Likewise.
443 2014-06-09 Cary Coutant <ccoutant@google.com>
445 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
446 unit_length is within section bounds.
448 2014-06-09 Cary Coutant <ccoutant@google.com>
451 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
454 2014-06-07 Alan Modra <amodra@gmail.com>
456 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
458 2014-06-06 Cary Coutant <ccoutant@google.com>
460 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
461 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
462 (Dwarf_pubnames_table::read_header): Likewise.
463 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
466 2014-06-05 Joel Brobecker <brobecker@adacore.com>
468 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
469 * Makefile.in, configure: Regenerate.
471 2014-06-03 Alan Modra <amodra@gmail.com>
473 * powerpc.cc (addis_12_2): Define.
474 (Stub_table::do_write): Support fusion on ELFv2 stubs.
476 2014-06-03 Alan Modra <amodra@gmail.com>
478 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
481 2014-06-02 Alan Modra <amodra@gmail.com>
483 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
484 Only ignore relocs on ELFv1.
485 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
487 2014-05-30 Cary Coutant <ccoutant@google.com>
489 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
490 * testsuite/Makefile.in: Regenerate.
491 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
493 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
496 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
497 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
499 2014-05-15 Alan Modra <amodra@gmail.com>
501 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
502 Compare FDE contents with DW_CFA_nop rather than 0.
504 2014-05-13 Sriraman Tallam <tmsriram@google.com>
506 * symtab.h (may_need_copy_reloc): Remove check for position independent
508 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
509 position independence before pc absolute may_need_copy_reloc call.
510 Add check for executable output befor pc relative may_need_copy_reloc
516 * powerpc.cc: Add check for no position independence before
517 may_need_copy_reloc calls.
518 * testsuite/pie_copyrelocs_test.cc: New file.
519 * testsuite/pie_copyrelocs_shared_test.cc: New file.
520 * Makefile.am (pie_copyrelocs_test): New test.
521 * Makefile.in: Regenerate.
523 2014-05-08 Martin Liška <mliska@suse.cz>
525 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
527 2014-05-06 Cary Coutant <ccoutant@google.com>
530 * i386.cc (Output_data_got_plt_i386): New class.
531 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
532 parameter. Change all callers.
533 (Output_data_plt_i386::layout_): Remove.
534 (Output_data_plt_i386::got_plt_): Change type.
535 (Target_i386::got_plt_): Change type. Change all references.
536 (Target_i386::got_section): Create instance of new class.
537 (Output_data_got_plt_i386::do_write): New function.
538 * x86_64.cc (Output_data_got_plt_x86_64): New class.
539 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
540 parameter. Change all callers.
541 (Output_data_plt_x86_64::layout_): Remove.
542 (Output_data_plt_x86_64::got_plt_): Change type.
543 (Target_x86_64::got_plt_): Change type. Change all references.
544 (Target_x86_64::got_section): Create instance of new class.
545 (Output_data_got_plt_x86_64::do_write): New function.
546 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
547 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
550 2014-05-05 Cary Coutant <ccoutant@google.com>
552 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
553 if we have pubnames/pubtypes.
555 2014-05-02 Cary Coutant <ccoutant@google.com>
557 * defstd.cc (in_segment): Define __ehdr_start here...
558 * layout.cc (Layout::finalize): ...Instead of here. Set the
559 output segment when known.
560 * resolve.cc (Symbol::override_base_with_special): Remember
561 the original binding.
562 * symtab.cc (Symbol::set_output_segment): New function.
563 (Symbol::set_undefined): New function.
564 * symtab.h (Symbol::is_weak_undefined): Check original undef
566 (Symbol::is_strong_undefined): New function.
567 (Symbol::set_output_segment): New function.
568 (Symbol::set_undefined): New function.
569 * target-reloc.h (is_strong_undefined): Remove.
570 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
571 Check for hidden undefs.
572 (relocate_section): Call Symbol::is_strong_undefined.
574 * testsuite/Makefile.am (ehdr_start_test_1)
575 (ehdr_start_test_2, ehdr_start_test_3)
576 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
577 * testsuite/Makefile.in: Regenerate.
578 * testsuite/ehdr_start_def.cc: New source file.
579 * testsuite/ehdr_start_test.cc: New source file.
580 * testsuite/ehdr_start_test.t: New linker script.
581 * testsuite/ehdr_start_test_4.sh: New shell script.
583 2014-04-23 Cary Coutant <ccoutant@google.com>
586 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
588 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
590 * layout.cc (Layout::include_section): Allow a target to decide
591 whether to include a section.
592 * target.h (Target::should_include_section): New function.
593 (Target::do_should_include_section): New function.
595 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
597 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
599 (Copy_relocs::emit): ... here.
600 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
601 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
602 (Copy_reloc_entry::entries_): Change from private to protected.
604 2014-04-02 Sriraman Tallam <tmsriram@google.com>
606 * icf.cc (get_section_contents): Replace copies of reloc
607 vectors with const references.
609 2014-04-02 Cary Coutant <ccoutant@google.com>
611 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
612 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
613 * configure: Regenerate.
614 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
615 -fno-use-linker-plugin.
616 (LINK1, CXXLINK1): Add it to the link command.
617 * testsuite/Makefile.in: Regenerate.
619 2014-03-12 Alan Modra <amodra@gmail.com>
621 * Makefile.in: Regenerate.
623 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
625 * symtab.h (Symbol::set_nonvis): New function.
627 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
629 * symtab.cc (Sized_symbol<32>::init_output_data):
630 Instantiate the template.
631 (Sized_symbol<64>::init_output_data): Likewise.
633 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
635 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
636 adjust dynamic symbol value.
637 * target.h (Target::adjust_dyn_symbol): New function.
638 (Target::do_adjust_dyn_symbol): New function.
640 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
642 * output.cc (Output_data_dynamic::Dynamic_entry::write):
643 Get the value of DYNAMIC_CUSTOM dynamic entry.
644 * output.h (Output_data_dynamic::add_custom): New function.
645 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
647 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
648 * target.h (Target::dynamic_tag_custom_value): New function.
649 (Target::do_dynamic_tag_custom_value): New function.
651 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
653 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
655 * target.h (Target::has_custom_set_dynsym_indexes): New function.
656 (Target::do_has_custom_set_dynsym_indexes): New function.
657 (Target::set_dynsym_indexes): New function.
658 (Target::do_set_dynsym_indexes): New function.
660 2014-03-07 Alan Modra <amodra@gmail.com>
662 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
663 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
664 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
665 (Powerpc_relocate_functions::has_overflow_bitfield,
666 overflowed): Use the above.
667 (Target_powerpc::Relocate::relocate): Correct overflow checking
668 for a number of relocations. Modify overflow test for 16-bit
669 fields in instructions to signed/unsigned according to whether
670 the field takes a signed or unsigned value.
672 2014-03-05 Alan Modra <amodra@gmail.com>
674 Update copyright years.
676 2014-03-05 Alan Modra <amodra@gmail.com>
678 * powerpc.cc (Target_powerpc::Scan::local, global): Support
679 R_PPC64_ADDR64_LOCAL.
680 (Target_powerpc::Relocate::relocate): Likewise.
682 2014-03-03 Alan Modra <amodra@gmail.com>
684 * dwp.cc (print_version): Update copyright year to current.
686 2014-02-10 Alan Modra <amodra@gmail.com>
688 * po/gold.pot: Regenerate.
690 2014-02-06 Cary Coutant <ccoutant@google.com>
692 Fix problem where -u is ignored when a weak undef is seen.
694 * archive.cc (Library_base::should_include_member): Reorder
695 code to check for -u option if a weak undef has already been seen.
696 * testsuite/Makefile.am (weak_undef_test_2): New test case.
697 * testsuite/Makefile.in: Regenerate.
698 * testsuite/weak_undef_file3.cc: New file.
699 * testsuite/weak_undef_file4.cc: New file.
700 * testsuite/weak_undef_test_2.cc: New file.
702 2014-02-05 Cary Coutant <ccoutant@google.com>
704 Fix issues with gold undefined symbol diagnostics.
707 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
709 * target-reloc.h (is_strong_undefined): New function.
710 (relocate_section): Move undef vtable symbol check from here.
711 Check for is_strong_undefined.
713 2014-02-05 Cary Coutant <ccoutant@google.com>
715 Fix problems with the --dynamic-list option.
718 * options.cc (General_options::parse_dynamic_list):
719 Set have_dynamic_list_.
720 (General_options::General_options): Initialize have_dynamic_list_.
721 (General_options::finalize): Turn off -Bsymbolic and
722 -Bsymbolic-functions if --dynamic-list provided.
723 * options.h (General_options::have_dynamic_list): New function.
724 (General_options::have_dynamic_list_): New data member.
725 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
729 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
730 in --dynamic-list, mark it.
732 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
733 (dynamic_list_2): New test case.
734 * testsuite/Makefile.in: Regenerate.
735 * testsuite/dynamic_list_2.cc: New file.
736 * testsuite/dynamic_list_2.t: New file.
737 * testsuite/dynamic_list_lib1.cc: New file.
738 * testsuite/dynamic_list_lib2.cc: New file.
739 * testsuite/gc_dynamic_list_test.c: New file.
740 * testsuite/gc_dynamic_list_test.sh: New file.
741 * testsuite/gc_dynamic_list_test.t: New file.
743 2014-01-28 Cary Coutant <ccoutant@google.com>
745 Add .gdb_index version 7 support.
747 * gold/dwarf_reader.cc: include <utility> (for make_pair).
748 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
750 (Dwarf_ranges_table::read_ranges_table): Likewise.
751 (Dwarf_pubnames_table::read_section): Check for GNU-style
752 sections, and for compressed debug sections.
753 (Dwarf_pubnames_table::read_header): Compute end address of table.
754 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
755 for end of list by offset, not by offset == 0.
756 (Dwarf_info_reader::do_read_string_table): Check for compressed
758 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
759 Initialize new data members.
760 (Dwarf_pubnames_table::next_name): return flag_byte.
761 (Dwarf_pubnames_table::end_of_table_): New data member.
762 (Dwarf_pubnames_table::is_gnu_style_): New data member.
763 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
764 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
765 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
766 read skeleton type unit DIEs.
767 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
768 (Gdb_index::do_write): Write flag_byte.
769 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
770 (Gdb_index::Cu_vector): Store flags along with cu indexes.
771 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
772 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
774 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
776 * version.cc (print_version): Update copyright year to 2014.
778 2013-12-19 Dimitry Andric <dimitry@andric.com>
780 * stringpool.cc (Stringpool_template::reserve): Add
781 HAVE_UNORDERED_MAP case.
782 * stringpool.cc (Stringpool_template::print_stats): Likewise.
784 2013-12-18 Cary Coutant <ccoutant@google.com>
786 * configure.ac: Check for <unordered_set> and <unordered_map>.
787 * config.in: Regenerate.
788 * configure: Regenerate.
789 * system.h: Use <unordered_set> and <unordered_map> if available.
791 2013-12-10 Roland McGrath <mcgrathr@google.com>
793 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
794 with $(INSTALL_PROGRAM_ENV).
795 * Makefile.in: Regenerate.
797 2013-11-22 Cary Coutant <ccoutant@google.com>
799 * configure.ac: Add check for which library is needed for
801 * configure: Regenerate.
803 2013-11-22 Cary Coutant <ccoutant@google.com>
805 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
807 * testsuite/Makefile.in: Regenerate.
809 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
811 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
812 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
813 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
814 (Target_x86_64<size>::Scan::local): Likewise.
815 (Target_x86_64<size>::Scan::global): Likewise.
816 (Target_x86_64<size>::Relocate::relocate): Likewise.
817 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
819 (Target_x86_64<size>::Scan::check_non_pic(): Handle
822 * testsuite/Makefile.am (check_PROGRAMS): Add
823 exception_x86_64_bnd_test.
824 (exception_x86_64_bnd_test_SOURCES): New macro.
825 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
826 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
827 (exception_x86_64_bnd_test_LDADD): Likewise.
828 (exception_x86_64_bnd_1.o): New rule.
829 (exception_x86_64_bnd_2.o): Likewise.
830 * testsuite/Makefile.in: Regenerated.
832 2013-11-15 Alan Modra <amodra@gmail.com>
834 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
836 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
837 Only call ppc64_local_entry_offset for 64-bit. Restrict
838 symval_for_branch lookup to ELFv1.
839 (Stub_table::add_plt_call_entry): Use unsigned int off.
840 (Output_data_glink::Address, invalid_address): New.
841 (Output_data_glink::add_eh_frame): Move out of line. Add
843 (Output_data_glink::add_global_entry, find_global_entry,
844 global_entry_address): New functions.
845 (Output_data_glink::global_entry_stubs_, end_branch_table_,
846 ge_size): New variables.
847 (Output_data_glink::set_final_data_size): Add global entry
849 (Output_data_glink::do_write): Write global entry stubs.
850 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
851 parameter. Return true for ELFv2. Adjust callers.
852 (Target_powerpc::Scan::local, global): Restrict opd lookup to
853 ELFv1. Similarly for ifunc and dynamic relocation processing
854 specific to ELFv1. Recognize that symbols are defined on
855 their plt entries for ELFv2.
856 (Target_powerpc::symval_for_branch): Assert if called for
858 (Target_powerpc::Relocate::relocate): Use global entry plt
859 stub for symbol value if such exists on ELFv2.
860 (Target_powerpc::Relocate::relocate): Don't call
861 symval_for_branch when ELFv2. Do adjust for local entry
863 (Target_powerpc::do_dynsym_value): Set symbols to global entry
865 (Target_powerpc::do_plt_address_for_global): Similarly.
867 2013-11-14 Cary Coutant <ccoutant@google.com>
869 Revert patch -- this did not fix the problem, and there is
872 2013-11-14 Cary Coutant <ccoutant@google.com>
875 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
876 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
877 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
878 updating fde_offsets_.
879 (Eh_frame_hdr::lock_): New data member.
881 2013-11-14 Cary Coutant <ccoutant@google.com>
883 * dwp.cc (Dwo_file_entry): New type.
884 (File_list): Use Dwo_file_entry.
885 (Dwo_file::verify): New function.
886 (Dwo_file::verify_dwo_list): New function.
887 (Dwo_file::sized_verify_dwo_list): New function.
888 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
890 (Dwp_options): New enum type.
891 (dwp_options): Add --verify-only.
894 * dwp.h (gold_info): Add declaration.
896 2013-11-14 Cary Coutant <ccoutant@google.com>
899 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
900 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
901 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
902 updating fde_offsets_.
903 (Eh_frame_hdr::lock_): New data member.
905 2013-11-06 Cary Coutant <ccoutant@google.com>
908 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
909 before reloc sections.
911 2013-11-04 Alan Modra <amodra@gmail.com>
913 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
914 (Symbol::needs_dynamic_reloc): Test new flag.
915 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
916 (Target_powerpc::Scan::get_reference_flags): Add target param.
917 Return FUNC_DESC_ABI for 64-bit ELFv1.
918 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
920 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
921 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
923 2013-10-31 Cary Coutant <ccoutant@google.com>
925 Restore support for dwp v2 DWARF package file format.
927 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
928 tu_length parameter. Adjust all callers.
929 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
930 * dwp.cc: Include dwarf.h.
931 (Section_bounds): New struct type.
932 (Unit_set): New struct type.
933 (Dwo_file::Dwo_file): Initialize new data member.
934 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
935 Combine and rename to...
936 (Dwo_file::read_unit_index): ...this.
937 (Dwo_file::sized_read_compunit_index)
938 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
939 (Dwo_file::sized_read_unit_index): ...this.
940 (Dwo_file::copy_section): Remove section_name, is_str_offsets
941 parameters; add section_id parameter.
942 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
943 (Dwo_file::add_unit_set): ...this.
944 (Dwo_file::shndx_map_): Remove.
945 (Dwo_file::sect_offsets_): New data member.
946 (Dwp_output_file::Dwp_output_file): Initialize new data members.
947 (Dwp_output_file::add_section): Rename to...
948 (Dwp_output_file::add_contribution): ...this.
949 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
950 (Dwp_output_file::add_tu_set): Likewise.
951 (Dwp_output_file::Contribution): New type.
952 (Dwp_output_file::Section::contributions): New data member.
953 (Dwp_output_file::Cu_or_tu_set): Remove.
954 (Dwp_output_file::Section::Section): New ctor.
955 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
956 (Dwp_output_file::Dwp_index::Section_table): New type.
957 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
958 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
960 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
961 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
962 (Dwp_output_file::Dwp_index::section_table): New member function.
963 (Dwp_output_file::Dwp_index::section_table_end): New member function.
964 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
965 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
966 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
967 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
968 (Dwp_output_file::Dwp_index::section_table_): New data member.
969 (Dwp_output_file::Dwp_index::section_mask_): New data member.
970 (Dwp_output_file::add_output_section): New member function.
971 (Dwp_output_file::write_new_section): New member function.
972 (Dwp_output_file::write_contributions): New member function.
973 (Dwp_output_file::section_id_map_): New data member.
974 (class Dwo_id_info_reader): Remove.
975 (class Unit_reader): New class.
976 (get_dwarf_section_name): New function.
977 (Dwo_file::read_executable): Adjust initializations of class data.
978 (Dwo_file::read): Add support for v2 package file format.
979 (Dwo_file::read_unit_index): Likewise.
980 (Dwo_file::sized_read_unit_index): Likewise.
981 (Dwo_file::copy_section): Likewise.
982 (Dwo_file::add_unit_set): Likewise.
983 (Dwp_output_file::add_output_section): Likewise.
984 (Dwp_output_file::add_contribution): Likewise.
985 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
987 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
989 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
991 (Dwp_output_file::initialize): Remove unused function.
992 (Dwp_output_file::finalize): Add support for v2 package file format.
993 (Dwp_output_file::write_index): Likewise.
994 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
997 2013-10-31 Cary Coutant <ccoutant@google.com>
999 * configure.ac: Fix check for -fmerge-constants.
1000 * configure.ac: Regenerate.
1002 2013-10-30 Roland McGrath <mcgrathr@google.com>
1004 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1005 Correct 9-byte nop sequence to match what the assembler generates.
1007 2013-10-30 Alan Modra <amodra@gmail.com>
1009 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1010 ppc64_local_entry_offset, ppc64_local_entry_offset,
1011 do_read_symbols): New functions.
1012 (Powerpc_relobj::e_flags_, st_other_): New vars.
1013 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1014 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1015 (Powerpc_relobj::e_flags_): New var.
1016 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1017 and adjust for ELFv2.
1018 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1019 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1020 (Powerpc_dynobj::do_find_special_sections): Likewise.
1021 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1022 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1023 to ELFv2 local entry.
1024 (Target_powerpc::do_relax): No thread safe barriers needed for
1026 (Output_data_plt_powerpc::initial_plt_entry_size_,
1027 plt_entry_size): Delete. Replace all uses with
1028 first_plt_entry_offset() and plt_entry_size().
1029 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1030 reserved_size parm. Update callers.
1031 (Output_data_plt_powerpc::entry_count): Update.
1032 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1033 and use Target_powerpc::first_plt_entry_offset().
1034 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1035 rename to plt_entry_size.
1036 (Output_data_plt_powerpc::add_ifunc_entry,
1037 add_local_ifunc_entry): Adjust reloc for ELFv2.
1038 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1039 (glink_eh_frame_fde_64v2): New.
1040 (Stub_table::plt_call_size): Support ELFv2 sizing.
1041 (Output_data_glink::add_eh_frame): Use the new FDE.
1042 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1043 (Stub_table::do_write): Write ELFv2 stubs and glink.
1044 (Target_powerpc::Relocate::relocate): Replaces nop after call
1045 with ld 2,24(1) and adjust local offset destination for ELFv2.
1047 2013-10-30 Alan Modra <amodra@gmail.com>
1049 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1050 (Target_powerpc::Scan::global, local): Likewise.
1051 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1052 on all ppc64 @h and @ha relocs.
1054 2013-10-14 Alan Modra <amodra@gmail.com>
1056 * output.h (Output_data_got::add_constant): Tidy.
1057 (Output_data_got::add_constant_pair): New function.
1058 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1059 methods used so as to first call reserve_ent().
1061 2013-10-11 Roland McGrath <mcgrathr@google.com>
1063 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1064 add_got_entry and add_got_entry_pair.
1066 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1067 (HAVE_PUBNAMES): Likewise.
1068 * configure: Regenerate.
1070 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1071 * testsuite/Makefile.in: Regenerate.
1073 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1074 Remove const from declaration.
1075 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1076 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1077 * output.h (Output_file_header): Remove const from member target_
1078 and corresponding constructor argument.
1079 * output.cc (Output_file_header::Output_file_header): Update prototype.
1080 (Output_file_header::do_sized_write): Use this->target_ in place
1081 of parameters()->target().
1083 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1085 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1086 * configure: Regenerate.
1087 * Makefile.in: Regenerate.
1088 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1089 * testsuite/merge_string_literals_2.c: Likewise.
1090 * testsuite/Makefile.am
1091 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1092 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1093 literal -fmerge-constants.
1094 * testsuite/Makefile.in: Regenerate.
1096 * i386.cc (Target_i386): Remove unused member dynbss_.
1097 * arm.cc (Target_arm): Likewise.
1098 * powerpc.cc (Target_powerpc): Likewise.
1099 * sparc.cc (Target_sparc): Likewise.
1100 * tilegx.cc (Target_tilegx): Likewise.
1101 * x86_64.cc (Target_x86_64): Likewise.
1102 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1103 type_signature_, type_offset_.
1104 * plugin.h (Plugin_hook): Remove unused member layout_.
1105 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1107 (Read_member): Remove unused members input_objects_, symtab_,
1109 (Check_library): Remove unused member symtab_.
1110 * archive.h (Lib_group): Remove unused member lib_.
1111 * archive.cc (Lib_group::Lib_group): Update initializer.
1112 * incremental.h (Incremental_binary): Remove unused member target_.
1113 (Incremental_script_entry): Removed unused member script_.
1114 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1115 * icf.h (Icf): Remove unused member num_tracked_relocs.
1117 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1118 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1120 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1122 * archive.h: Use struct rather than class for forward declaration
1123 of Read_symbols_data.
1125 2013-10-07 Cary Coutant <ccoutant@google.com>
1128 * testsuite/Makefile.am (icf_test): Fix dependencies.
1129 (icf_safe_test): Likewise.
1130 (icf_safe_so_test): Likewise.
1131 (large_symbol_alignment): Add empty _LDADD rule.
1132 * testsuite/Makefile.in: Regenerate.
1134 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1137 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1138 relocation for R_X86_64_32 on x32.
1140 2013-08-27 Roland McGrath <mcgrathr@google.com>
1142 * output.cc (Output_segment::set_section_addresses): Take new
1143 Target* argument. If target->isolate_execinstr() and the segment
1144 is executable and starts at a target->abi_pagesize() boundary,
1145 pad its end out to a target->abi_pagesize() boundary with code fill.
1146 * output.h (Output_segment::set_section_addresses): Update decl.
1147 * layout.h (Layout::check_output_data_for_reset_values): Take new
1148 argument RELAX_OUTPUTS.
1149 (Layout): New member relax_output_list_.
1150 (Layout::add_relax_output): New method.
1151 * layout.cc (Layout::Layout): Update constructor.
1152 (Layout::reset_relax_output): New method.
1153 (Layout::clean_up_after_relaxation): Call it.
1154 (Layout::prepare_for_relaxation): Update caller.
1155 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1156 Call reset_relax_output before re-processing segments for
1157 isolate_execinstr case.
1158 (Layout::write_data): Handle relax_output_list_.
1159 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1160 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1162 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1165 * object.h: Fix typos.
1167 2013-08-16 Roland McGrath <mcgrathr@google.com>
1169 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1170 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1172 2013-08-07 Cary Coutant <ccoutant@google.com>
1174 Revert support for v2 DWP files:
1176 2013-03-01 Cary Coutant <ccoutant@google.com>
1178 Add dwp support for v2 DWARF package file format.
1179 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1180 tu_length parameter. Adjust all callers.
1181 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1182 * dwp.cc: Include dwarf.h.
1183 (Section_bounds): New struct type.
1184 (Unit_set): New struct type.
1185 (Dwo_file::Dwo_file): Initialize new data member.
1186 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1187 Combine and rename to...
1188 (Dwo_file::read_unit_index): ...this.
1189 (Dwo_file::sized_read_compunit_index)
1190 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1191 (Dwo_file::sized_read_unit_index): ...this.
1192 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1193 parameters; add section_id parameter.
1194 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1195 (Dwo_file::add_unit_set): ...this.
1196 (Dwo_file::shndx_map_): Remove.
1197 (Dwo_file::sect_offsets_): New data member.
1198 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1199 (Dwp_output_file::add_section): Rename to...
1200 (Dwp_output_file::add_contribution): ...this.
1201 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1202 (Dwp_output_file::add_tu_set): Likewise.
1203 (Dwp_output_file::Contribution): New type.
1204 (Dwp_output_file::Section::contributions): New data member.
1205 (Dwp_output_file::Cu_or_tu_set): Remove.
1206 (Dwp_output_file::Section::Section): New ctor.
1207 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1208 (Dwp_output_file::Dwp_index::Section_table): New type.
1209 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1210 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1212 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1213 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1214 (Dwp_output_file::Dwp_index::section_table): New member function.
1215 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1216 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1217 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1218 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1219 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1220 (Dwp_output_file::Dwp_index::section_table_): New data member.
1221 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1222 (Dwp_output_file::add_output_section): New member function.
1223 (Dwp_output_file::write_new_section): New member function.
1224 (Dwp_output_file::write_contributions): New member function.
1225 (Dwp_output_file::section_id_map_): New data member.
1226 (class Dwo_id_info_reader): Remove.
1227 (class Unit_reader): New class.
1228 (get_dwarf_section_name): New function.
1229 (Dwo_file::read_executable): Adjust initializations of class data.
1230 (Dwo_file::read): Add support for v2 package file format.
1231 (Dwo_file::read_unit_index): Likewise.
1232 (Dwo_file::sized_read_unit_index): Likewise.
1233 (Dwo_file::copy_section): Likewise.
1234 (Dwo_file::add_unit_set): Likewise.
1235 (Dwp_output_file::add_output_section): Likewise.
1236 (Dwp_output_file::add_contribution): Likewise.
1237 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1239 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1241 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1243 (Dwp_output_file::initialize): Remove unused function.
1244 (Dwp_output_file::finalize): Add support for v2 package file format.
1245 (Dwp_output_file::write_index): Likewise.
1246 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1249 2013-07-31 Cary Coutant <ccoutant@google.com>
1251 * object.cc (Sized_relobj::do_output_section_address): New function.
1252 (Sized_relobj): Instantiate explicitly.
1253 * object.h (Object::output_section_address): New function.
1254 (Object::do_output_section_address): New function.
1255 (Sized_relobj::do_output_section_address): New function.
1256 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1258 2013-07-30 Cary Coutant <ccoutant@google.com>
1259 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1261 * parameters.cc (Parameters::entry): Return target-specific entry
1263 * target.h (Target::entry_symbol_name): New function.
1264 (Target_info::entry_symbol_name): New data member.
1266 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1267 * i386.cc (Target_i386::i386_info): Likewise.
1268 (Target_i386_nacl::i386_nacl_info): Likewise.
1269 * sparc.cc (Target_sparc::sparc_info): Likewise.
1270 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1271 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1272 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1273 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1275 2013-07-22 Sterling Augustine <saugustine@google.com>
1277 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1278 Convert parameter shndx to local variable. Add parameters symtab
1279 and symtab_size. Scan over section names. Find relocation
1280 section corresponding to current section. Create and initialize
1281 reloc_mapper_ and reloc_type_.
1282 (Dwarf_pubnames_table::read_header): Add assertion. Change
1283 unit_length to off_t. Initialize member unit_length_. Fill in field
1285 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1286 Initialize new fields unit_length_ and cu_offset_.
1287 (Dwarf_pubnames_table::read_section): Update prototype.
1288 (Dwarf_pubnames_table::cu_offset): New member function.
1289 (Dwarf_pubnames_table::subsection_size): Likewise.
1290 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1292 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1293 member functions public.
1294 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1295 Update comment. Rework logic. Move repeated parts to...
1296 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1297 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1298 pubtypes_table_, and stmt_list_offset.
1299 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1300 Gdb_index::find_pubtype_offset,
1301 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1302 (Gdb_index::pubnames_read): Update prototype and rework logic.
1303 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1305 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1306 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1307 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1308 Gdb_index::map_pubtable_to_dies):
1310 (Gdb_index::pubnames_read): Update declaration.
1311 (Gdb_index::Pubname_offset_map): New type.
1312 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1313 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1314 Gdb_index::stmt_list_offset): Declare.
1315 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1316 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1317 Gdb_index::pubtypes_offset_): Remove.
1319 2013-07-19 Roland McGrath <mcgrathr@google.com>
1321 * options.h (General_options): Add -Trodata-segment option.
1322 * parameters.cc (Parameters::check_rodata_segment): New function.
1323 (Parameters::set_target_once): Call it.
1324 * parameters.h (Parameters): Declare it (private member function).
1325 * layout.cc (load_seg_unusable_for_headers): New function, broken
1326 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1327 then validate rodata segment rather than text segment.
1328 (relaxation_loop_body): Call that.
1329 (is_text_segment): New function. Don't admit a non-executable
1330 segment if TARGET->isolate_execinstr().
1331 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1333 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1336 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1337 * nacl.h (Sniff_file::View::View): Request aligned view.
1339 2013-07-11 Cary Coutant <ccoutant@google.com>
1341 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1342 correct BRLT entry size.
1344 2013-07-03 Alan Modra <amodra@gmail.com>
1346 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1349 2013-07-01 Cary Coutant <ccoutant@google.com>
1351 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1353 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1354 (Dwarf_ranges_table::lookup_reloc): New function.
1355 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1357 (Dwarf_ranges_table::lookup_reloc): New function.
1358 (Dwarf_ranges_table::reloc_type_): New data member.
1360 2013-06-27 Jing Yu <jingyu@google.com>
1363 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1365 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1366 (Target_powerpc::do_relax): Call the above.
1368 2013-06-27 Cary Coutant <ccoutant@google.com>
1370 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1371 on garbage collected .opd section.
1373 2013-06-27 Alan Modra <amodra@gmail.com>
1375 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1377 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1378 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1380 2013-06-14 Cary Coutant <ccoutant@google.com>
1382 * resolve.cc (Symbol::override_base): Don't override st_type
1383 from plugin placeholder symbols.
1384 (Symbol_table::resolve): Likewise.
1385 (Symbol_table::should_override): Don't complain about TLS mismatch
1386 if the TO symbol is a plugin placeholder.
1387 * testsuite/Makefile.am (plugin_test_tls): New test.
1388 * testsuite/Makefile.in: Regenerate.
1389 * testsuite/plugin_test_tls.sh: New test script.
1390 * testsuite/two_file_test_2_tls.cc: New test source.
1391 * testsuite/two_file_test_tls.cc: New test source.
1393 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1395 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1396 the maximum segment alignment is larger than the page size.
1397 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1398 correctly aligns the symbols with large alignemnt.
1399 * testsuite/Makefile.in: Regenerate.
1400 * testsuite/large_symbol_alignment.cc: New file.
1402 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1403 Sriraman Tallam <tmsriram@google.com>
1405 * options.h (sort_section): New option.
1406 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1407 Rename from Input_section_sort_section_name_special_ordering_compare.
1408 (Input_section_sort_section_name_compare): New struct.
1409 * output.cc (Output_section::Input_section_sort_section_name_compare::
1410 operator()): New function.
1411 (Output_section::sort_attached_input_sections): Use new sort function
1412 for .text if --sort-section=name is specified.
1413 * layout.cc (Layout::make_output_section):
1414 Add sorting by name when --sort-section=name is specified.
1415 * testsuite/Makefile.am (text_section_grouping): Test option
1416 --sort-section=name.
1417 * testsuite/Makefile.in: Regenerate.
1418 * testsuite/section_sorting_name.cc: New file.
1419 * testsuite/section_sorting_name.sh: New file.
1421 2013-05-21 Cary Coutant <ccoutant@google.com>
1423 * symtab.h (Symbol::is_cxx_vtable): New function.
1424 * target-reloc.h (relocate_section): Check for vtable symbol.
1425 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1426 * testsuite/Makefile.in: Regenerate.
1427 * testsuite/missing_key_func.cc: New test source.
1428 * testsuite/missing_key_func.sh: New test script.
1430 2013-05-21 Cary Coutant <ccoutant@google.com>
1432 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1433 type of enclosing symbol.
1434 (Relocate_info::location): Check symbol type when describing symbol.
1435 * object.h (Symbol_location_info): Remove unused line_number;
1436 add enclosing_symbol_type.
1437 * testsuite/debug_msg.sh: Adjust expected output.
1439 2013-05-13 Cary Coutant <ccoutant@google.com>
1441 * configure.ac: Export DEFAULT_TARGET.
1442 * configure: Regenerate.
1443 * Makefile.in: Regenerate.
1444 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1445 * testsuite/Makefile.in: Regenerate.
1446 * testsuite/debug_msg.sh: Delete duplicate tests.
1447 Don't check undef_int error message match for powerpc where the
1448 source file and line number aren't available.
1450 2013-05-10 Roland McGrath <mcgrathr@google.com>
1452 * options.h (General_options): Add --rosegment-gap option.
1453 * options.cc (finalize): --rosegment-gap implies --rosegment.
1454 * layout.cc (set_segment_offsets): Let user option override
1455 target->rosegment_gap().
1457 2013-05-10 Roland McGrath <mcgrathr@google.com>
1459 * options.h (General_options): Remove leading space from help
1460 messages for -nostdlib and --rosegment.
1462 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1465 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1467 2013-05-03 Alan Modra <amodra@gmail.com>
1469 * merge.cc (Output_merge_string::do_add_input_section): Correct
1470 scan for number of strings. Rename vars to avoid shadowing.
1471 Include missing terminator in input_size_.
1473 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1475 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1476 Restore empty string handling.
1478 2013-05-01 Cary Coutant <ccoutant@google.com>
1480 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1481 uninitialized warning.
1483 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1485 * output.cc (Output_section::add_merge_input_section): Allow
1486 to merge sections if the alignment is more than character size.
1487 * merge.h (Output_merge_string::Output_merge_string): Remove
1489 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1490 only not-null strings. Check the alignment of strings.
1492 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1493 alignment as the argument.
1494 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1495 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1496 Align non-zero length strings according to the addralign_.
1497 (Stringpool_template<Stringpool_char>::set_string_offsets):
1498 Updating offsets according to the given alignment.
1499 * testsuite/Makefile.am (text_section_grouping): Test if string
1500 literals are getting merged.
1501 * testsuite/Makefile.in: Regenerate.
1502 * testsuite/merge_string_literals_1.c: New file.
1503 * testsuite/merge_string_literals_2.c: Ditto.
1504 * testsuite/merge_string_literals.sh: Ditto.
1506 2013-04-26 Ian Lance Taylor <iant@google.com>
1508 * target-reloc.h (relocate_section): If the reloc offset is out of
1509 range, pass VIEW as NULL to relocate.relocate.
1510 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1511 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1512 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1513 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1514 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1515 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1517 2013-04-26 Geoff Pike <gpike@chromium.org>
1519 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1520 * layout.cc (Hash_task): New class.
1521 (Layout::queue_build_id_tasks): New function.
1522 (Layout::write_build_id): Handle single-thread portion of build ID
1523 computation. (In some cases, all of it is single-threaded.) Replace
1524 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1525 functionality in fewer lines of code.
1526 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1527 * options.h (General_options): make "--build-id" default to tree
1528 rather than sha1. Add two new options related to --build-id=tree:
1529 --build-id-chunk-size-for-treehash and
1530 --build-id-min-file-size-for-treehash.
1531 * Makefile.am: add testing of --build-id=tree and related new options
1532 (these tests will be invoked by "make check").
1533 * Makefile.in: Regenerate.
1535 2013-04-25 Alan Modra <amodra@gmail.com>
1537 * configure.tgt: Add powerpcle and powerpc64le.
1539 2013-04-22 Alan Modra <amodra@gmail.com>
1542 * layout.cc (Layout::segment_precedes): Allow more than one
1543 segment with the same type and flags.
1545 2013-04-15 Cary Coutant <ccoutant@google.com>
1547 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1548 allocate space in file for BSS sections.
1550 2013-04-15 Cary Coutant <ccoutant@google.com>
1552 * script-sections.cc (Orphan_output_section): Reset address
1553 to zero after each orphaned section for relocatable links.
1555 2013-04-15 Cary Coutant <ccoutant@google.com>
1557 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1558 section starting address for relocatable link.
1559 * testsuite/Makefile.am (script_test_11): New test.
1560 * testsuite/Makefile.in: Regenerate.
1561 * testsuite/script_test_11.c: New source file.
1562 * testsuite/script_test_11.t: New linker script.
1564 2013-04-13 Alan Modra <amodra@gmail.com>
1566 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1567 owner when sections are not adjacent and exceed group size.
1568 (Target_powerpc::group_sections): Handle corner case.
1569 (Target_powerpc::Branch_info::make_stub): Handle case where
1570 stub table doesn't exist due to branches in non-exec sections.
1571 (Target_powerpc::Relocate::relocate): Likewise.
1573 2013-04-11 Alan Modra <amodra@gmail.com>
1576 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1577 .branch_lt to match bfd ld. Adjust comments throughout file.
1579 2013-04-04 Ian Lance Taylor <iant@google.com>
1582 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1583 sections before checking whether they are included in the link.
1585 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1587 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1588 object before calling the plugin claim_file handler. Pass the elf
1589 object of the archive to the plugin. Delete the elf object if the
1590 plugin claims the file.
1592 2013-03-21 Alan Modra <amodra@gmail.com>
1594 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1595 segment when omagic.
1597 2013-03-21 Alan Modra <amodra@gmail.com>
1599 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1601 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1602 uninitialized" warning.
1604 2013-03-20 Alan Modra <amodra@gmail.com>
1606 * symtab.h (Symbol::clear_version): New function.
1607 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1608 is_needed by weak references. Clear version for symbols defined
1609 in as-needed objects that are not needed.
1611 2013-03-15 Alan Modra <amodra@gmail.com>
1613 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1614 static and public. Add report_err param. Return false for data refs.
1615 (Target_powerpc::rela_dyn_section): New overloaded function.
1616 (Target_powerpc::plt_, iplt_): Elucidate.
1617 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1618 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1619 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1620 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1621 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1622 push_branch and make_plt_entry for ifunc syms when
1623 reloc_needs_plt_for_ifunc.
1624 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1625 for ifunc unless reloc_needs_plt_for_ifunc.
1627 2013-03-15 Alan Modra <amodra@gmail.com>
1629 * gc.h (gc_process_relocs): Don't look through function descriptors.
1630 * icf.cc (get_section_contents): Do so here instead.
1632 2013-03-13 Alan Modra <amodra@gmail.com>
1634 * powerpc.cc (is_branch_reloc): Forward declare.
1635 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1636 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1637 false for 64-bit, true for 32-bit non-branch relocs.
1638 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1639 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1641 (icf_safe_test): Generate linker map file as well as nm output.
1642 (icf_safe_so_test): Likewise.
1643 * testsuite/Makefile.in: Regenerate.
1644 * testsuite/icf_test.sh: Parse linker map file to determine
1646 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1647 * testsuite/icf_safe_so_test.sh: Likewise.
1648 (X86_32_or_ARM_specific_safe_fold): Merge into..
1649 (arch_specific_safe_fold): ..this.
1650 (X86_64_specific_safe_fold): Delete unused function.
1652 2013-03-12 Alan Modra <amodra@gmail.com>
1654 * gc.h (gc_process_relocs): Look through function descriptors
1655 to determine shndx, symvalue and addend used by ICF. Tidy
1656 variable duplication.
1658 2013-03-11 Alan Modra <amodra@gmail.com>
1660 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1661 * layout.cc (Layout_task_runner::run): ..to here.
1662 * symtab.h (struct Symbol_location): Extract from..
1663 (class Symbol_table): ..here.
1664 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1665 * target.h (class Target): Add function_location and
1666 do_function_location functions.
1667 (class Sized_target): Add do_function_location.
1668 * object.h (class Sized_relobj_file): Move find_shdr..
1669 (class Object): ..to here.
1670 * object.cc: Likewise. Update to suit. Instantiate.
1671 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1672 * powerpc.cc (class Powerpc_dynobj): New.
1673 (Target_powerpc::do_function_location): New function.
1674 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1675 (Powerpc_dynobj::do_read_symbols): New function.
1676 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1678 2013-03-08 Ian Lance Taylor <iant@google.com>
1680 * options.cc (General_options::string_to_object_format): Accept
1683 2013-03-08 Alan Modra <amodra@gmail.com>
1685 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1686 pointer to Post_fde.
1687 (struct Post_fde): Move definition to here..
1688 * ehframe.cc (struct Post_fde): ..from here.
1689 (Cie::write): Don't alloc Post_fde.
1690 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1692 2013-03-07 Alan Modra <amodra@gmail.com>
1694 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1695 relocation referencing .LC0.
1696 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1698 2013-03-07 Alan Modra <amodra@gmail.com>
1700 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1701 always_inline. Add assembly for powerpc to avoid GOT.
1703 2013-03-07 Alan Modra <amodra@gmail.com>
1705 * testsuite/script_test_10.sh: Don't test .bss section
1708 2013-03-06 Alan Modra <amodra@gmail.com>
1710 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1711 (Target_powerpc::symval_for_branch): Add symtab param. Update
1712 all callers. Handle folded sections.
1713 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1715 (Global_symbol_visitor_opd::operator()): Likewise.
1717 2013-03-04 Alan Modra <amodra@gmail.com>
1719 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1720 * testsuite/Makefile.in: Regenerate.
1722 2013-03-01 Cary Coutant <ccoutant@google.com>
1724 Add dwp support for v2 DWARF package file format.
1725 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1726 tu_length parameter. Adjust all callers.
1727 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1728 * dwp.cc: Include dwarf.h.
1729 (Section_bounds): New struct type.
1730 (Unit_set): New struct type.
1731 (Dwo_file::Dwo_file): Initialize new data member.
1732 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1733 Combine and rename to...
1734 (Dwo_file::read_unit_index): ...this.
1735 (Dwo_file::sized_read_compunit_index)
1736 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1737 (Dwo_file::sized_read_unit_index): ...this.
1738 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1739 parameters; add section_id parameter.
1740 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1741 (Dwo_file::add_unit_set): ...this.
1742 (Dwo_file::shndx_map_): Remove.
1743 (Dwo_file::sect_offsets_): New data member.
1744 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1745 (Dwp_output_file::add_section): Rename to...
1746 (Dwp_output_file::add_contribution): ...this.
1747 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1748 (Dwp_output_file::add_tu_set): Likewise.
1749 (Dwp_output_file::Contribution): New type.
1750 (Dwp_output_file::Section::contributions): New data member.
1751 (Dwp_output_file::Cu_or_tu_set): Remove.
1752 (Dwp_output_file::Section::Section): New ctor.
1753 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1754 (Dwp_output_file::Dwp_index::Section_table): New type.
1755 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1756 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1758 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1759 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1760 (Dwp_output_file::Dwp_index::section_table): New member function.
1761 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1762 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1763 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1764 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1765 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1766 (Dwp_output_file::Dwp_index::section_table_): New data member.
1767 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1768 (Dwp_output_file::add_output_section): New member function.
1769 (Dwp_output_file::write_new_section): New member function.
1770 (Dwp_output_file::write_contributions): New member function.
1771 (Dwp_output_file::section_id_map_): New data member.
1772 (class Dwo_id_info_reader): Remove.
1773 (class Unit_reader): New class.
1774 (get_dwarf_section_name): New function.
1775 (Dwo_file::read_executable): Adjust initializations of class data.
1776 (Dwo_file::read): Add support for v2 package file format.
1777 (Dwo_file::read_unit_index): Likewise.
1778 (Dwo_file::sized_read_unit_index): Likewise.
1779 (Dwo_file::copy_section): Likewise.
1780 (Dwo_file::add_unit_set): Likewise.
1781 (Dwp_output_file::add_output_section): Likewise.
1782 (Dwp_output_file::add_contribution): Likewise.
1783 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1785 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1787 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1789 (Dwp_output_file::initialize): Remove unused function.
1790 (Dwp_output_file::finalize): Add support for v2 package file format.
1791 (Dwp_output_file::write_index): Likewise.
1792 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1795 2013-03-01 Cary Coutant <ccoutant@google.com>
1797 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1798 function into class definition in header file.
1799 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1800 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1802 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1804 2013-02-28 Alan Modra <amodra@gmail.com>
1806 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1807 * target.cc (Target::do_plt_fde_location): New function.
1808 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1809 accessor function, and constructor param.
1810 (struct Post_fde, Post_fdes): Declare.
1811 (Cie::write): Add post_fdes param.
1812 * ehframe.cc (Fde::write): Use plt_fde_location.
1813 (struct Post_fde): Define.
1814 (Cie::write): Stash FDEs added post merge mapping.
1815 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1816 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1817 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1819 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1820 (Target_powerpc::has_glink): New function.
1821 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1822 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1823 glink_eh_frame_fde_32, default_fde): New data.
1824 (Stub_table::eh_frame_added_): New var.
1825 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1827 (Stub_table::add_eh_frame): New function.
1828 (Output_data_glink::add_eh_frame): New function.
1829 (Target_powerpc::make_glink_section): Call add_eh_frame.
1831 2013-02-15 Ian Lance Taylor <iant@google.com>
1833 * options.h (DEFINE_uint64_alias): Define.
1834 (class General_options): Add -Ttext-segment as an alias for
1837 2013-02-15 Alan Modra <amodra@gmail.com>
1839 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1840 (Stub_table::do_write): ..here, two places.
1841 (Stub_table::plt_call_size): Use it here too.
1843 2013-02-11 Ian Lance Taylor <iant@google.com>
1845 * descriptors.cc (Descriptors::close_all): New function.
1846 * descriptors.h (class Descriptors): Declare close_all.
1847 (close_all_descriptors): New inline function.
1848 * plugin.cc: Include "descriptors.h".
1849 (Plugin_manager::cleanup): Call close_all_descriptors.
1851 2013-02-06 Alan Modra <amodra@gmail.com>
1853 * README: Update coding style link.
1855 2013-01-28 Cary Coutant <ccoutant@google.com>
1857 * dwp.cc (File_list): New typedef.
1858 (Dwo_name_info_reader): New class.
1859 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1860 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1861 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1862 (Dwo_file::read_executable): New function.
1863 (Dwo_file::read): Move common setup code to ...
1864 (Dwo_file::make_object): ... here.
1865 (dwp_options): Add --exec/-e.
1869 2013-01-24 Sriraman Tallam <tmsriram@google.com>
1871 * layout.cc (Layout::layout): Check for option text_reorder.
1872 (Layout::make_output_section): Ditto.
1873 * options.h (text_reorder): New option.
1874 * output.cc (Input_section_sort_compare): Remove special ordering
1877 Input_section_sort_section_name_special_ordering_compare::
1878 operator()): New function.
1879 (Output_section::sort_attached_input_sections): Use new sort function
1881 * output.h (Input_section_sort_section_name_special_ordering_compare):
1883 * testsuite/Makefile.am (text_section_grouping): Test option
1885 * testsuite/Makefile.in: Regenerate.
1886 * testsuite/text_section_grouping.sh: Check order of functions without
1887 default text reordering.
1889 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1891 * options.h (General_options): Change default to true for new_dtags.
1893 2013-01-18 Mike Frysinger <vapier@gentoo.org>
1895 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1896 when enable_new_dtags is false. Only add DT_RUNPATH when
1897 enable_new_dtags is true.
1899 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1901 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1902 used in declaration and definition consistent.
1903 (Target_powerpc::symval_for_branch): Ditto.
1905 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1907 * testsuite/plugin_final_layout.cc: Fix comment.
1909 2013-01-16 Sriraman Tallam <tmsriram@google.com>
1911 * layout.cc (Layout::layout): Do not do default sorting for
1912 text sections when section ordering is specified.
1913 (make_output_section): Ditto.
1914 * testsuite/plugin_final_layout.cc: Name the function sections
1915 to catch reordering issues.
1917 2013-01-15 Alan Modra <amodra@gmail.com>
1919 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1922 2013-01-15 Alan Modra <amodra@gmail.com>
1924 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1925 * testsuite/Makefile.in: Regenerate.
1927 2013-01-14 Alan Modra <amodra@gmail.com>
1929 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1930 * testsuite/Makefile.in: Regenerate.
1932 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1935 Fix mingw gold build with plugins enabled
1936 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1937 * configure.ac: Export DLOPEN_LIBS and add headers check.
1938 * plugin.cc: Handle non-dlfcn case.
1939 * Makefile.in: Regenerate.
1940 * config.in: Regenerate.
1941 * configure: Regenerate.
1942 * testsuite/Makefile.in: Regenerate.
1944 2013-01-09 Sriraman Tallam <tmsriram@google.com>
1946 * output.h (sort_attached_input_sections): Change to be public.
1947 * script-sections.cc
1948 (Output_section_definition::set_section_addresses): Sort
1949 attached input sections according to section order before linker
1950 script assigns section addresses.
1951 (Orphan_output_section::set_section_addresses): Sort
1952 attached input sections according to section order before linker
1953 script assigns section addresses.
1954 * Makefile.am (final_layout.sh): Use a simple linker script to
1955 check if section ordering still works.
1956 * Makefile.in: Regenerate.
1958 2013-01-09 Ben Cheng <bccheng@google.com>
1960 * arm.cc (Target_arm::attributes_accept_div): New function.
1961 (Target_arm::attributes_forbid_div): New function.
1962 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1963 attribute using the same new functions as what bfd/elf32_arm.c
1966 2013-01-07 Cary Coutant <ccoutant@google.com>
1969 * output.cc (Output_section::add_input_section): For incremental
1970 updates, don't track input sections that are allocated from patch
1973 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1974 Ian Lance Taylor <iant@google.com>
1977 * configure.ac (--enable-ld): Removed.
1978 (install_as_default): Set to yes only for --enable-gold=default
1980 * configure: Regenerated.
1982 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1984 * options.h (General_options): Add -fuse-ld= for GCC linker
1985 option compatibility.
1987 2013-01-04 Cary Coutant <ccoutant@google.com>
1989 * configure.ac: Fix typo restoring CXXFLAGS.
1990 * configure: Regenerate.
1992 2013-01-04 Cary Coutant <ccoutant@google.com>
1994 * testsuite/Makefile.am (CXXLINK_S): New macro.
1995 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1996 * testsuite/Makefile.in: Regenerate.
1998 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2000 * version.cc (print_version): Update copyright year to 2013.
2002 2012-12-20 Ian Lance Taylor <iant@google.com>
2004 * layout.cc (Layout::special_ordering_of_input_section): New
2006 (Layout::layout): If input section requires special ordering, must
2007 sort input sections.
2008 (Layout::make_output_section): May sort .text input sections.
2009 (Layout::is_section_name_prefix_grouped): Remove.
2010 * layout.h (class Layout): Declare
2011 special_ordering_of_input_section. Don't declare
2012 is_section_name_prefix_grouped.
2013 * output.cc (Output_section::add_input_section): Revert last
2015 (Output_section::Input_section_sort::match_file_name): Don't crash
2016 if called on output section data.
2017 (Output_section::Input_section_sort_compare): Sort based on
2019 (Output_section::Input_section_sort_section_order_index_compare):
2021 (Output_section::sort_attached_input_sections): Likewise.
2023 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2025 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2026 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2027 * output.cc (Output_section::add_input_section): Check if section
2028 name contains special prefix. Keep input sections to sort such
2030 (Output_section::Input_section_sort_section_order_index_compare
2031 ::operator()): Group sections according to prefixes.
2032 (Output_section::sort_attached_input_sections): Add condition to
2033 Input_section_entry constructor call.
2034 * testsuite/Makefile.am (text_section_grouping): New test.
2035 * testsuite/Makefile.in: Regenerate.
2036 * testsuite/text_section_grouping.cc: New file.
2037 * testsuite/text_section_grouping.sh: New file.
2039 2012-12-17 Nick Clifton <nickc@redhat.com>
2041 * Makefile.am: Add copyright notice.
2044 * configure.ac: Likewise.
2045 * ftruncate.c: Likewise.
2046 * Makefile.in: Regenerate.
2048 2012-12-14 Cary Coutant <ccoutant@google.com>
2050 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2051 --no-as-needed flag.
2052 (exception_separate_shared_12_test): Likewise.
2053 (incremental_copy_test): Likewise.
2054 * testsuite/Makefile.in: Regenerate.
2056 2012-12-14 Cary Coutant <ccoutant@google.com>
2058 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2059 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2061 2012-12-12 Alan Modra <amodra@gmail.com>
2063 * powerpc.cc (class Track_tls): New.
2064 (class Relocate, class Scan): Inherit Track_tls.
2065 (Target_powerpc::Scan::local, global): Track tls optimization
2066 and avoid creating plt entry for __tls_get_addr if all uses
2068 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2070 2012-12-12 Alan Modra <amodra@gmail.com>
2072 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2073 Replace no_toc_optimize with toc_optimize.
2074 * output.h (Output_section::input_sections): Provide non-const variant.
2075 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2076 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2078 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2079 (class Sort_toc_sections): New.
2080 (Target_powerpc::do_finalize_sections): Sort toc sections.
2081 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2083 2012-12-10 Roland McGrath <mcgrathr@google.com>
2085 * testsuite/binary_unittest.cc (read_all): New function.
2086 (Sized_binary_test): Use it instead of ::read.
2087 * fileread.cc (do_read): Don't assume pread always reads the whole
2088 amount in a single call.
2090 2012-12-10 Alan Modra <amodra@gmail.com>
2092 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2093 Set EM_PPC64 or EM_PPC here.
2094 (Target_selector_powerpc::do_recognize): Delete.
2096 2012-12-10 Alan Modra <amodra@gmail.com>
2098 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2100 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2102 2012-12-07 Roland McGrath <mcgrathr@google.com>
2104 * testsuite/binary_unittest.cc (Sized_binary_test):
2105 Use open_descriptor rather than ::open.
2107 2012-12-07 Alan Modra <amodra@gmail.com>
2109 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2110 typedef and invalid_address constant.
2111 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2112 instantiate constants.
2114 2012-12-06 Roland McGrath <mcgrathr@google.com>
2116 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2117 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2118 * aclocal.m4: Regenerate.
2119 * configure: Regenerate.
2120 * Makefile.in: Regenerate.
2121 * testsuite/Makefile.in: Regenerate.
2123 2012-12-07 Alan Modra <amodra@gmail.com>
2125 * options.h (General_options): Add no_toc_optimize.
2126 * powerpc.cc (ok_lo_toc_insn): New function.
2127 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2129 2012-12-06 Alan Modra <amodra@gmail.com>
2131 * options.h (General_options): Add plt_align, plt_static_chain,
2132 plt_thread_safe. Update stub_group_size help text.
2133 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2134 for new plt_thread_safe_ var.
2135 (use_plt_offset): Correct comments.
2136 (Target_powerpc::do_relax): Look for thread creation symbols to
2137 determine default plt_thread_safe value. Clear plt call stubs
2138 as well as branch stubs each iteration.
2139 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2141 (l, hi, ha, write_insn): Move earlier.
2142 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2143 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2145 (Stub_table::update_size): Adjust.
2146 (Stub_table::prev_size, set_prev_size): Delete.
2147 (Stub_table::stub_align): Let --plt-align affect result.
2148 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2149 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2150 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2151 (Stub_table::do_write): Support more stub variants.
2153 2012-12-04 Alan Modra <amodra@gmail.com>
2155 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2156 (Target_powerpc::do_define_standard_symbols): New function.
2158 2012-12-03 Alan Modra <amodra@gmail.com>
2160 * output.h: Formatting, whitespace.
2162 2012-12-03 Alan Modra <amodra@gmail.com>
2164 * layout.h (Layout::get_executable_sections): Declare.
2165 * layout.cc (Layout::get_executable_sections): New function.
2166 * arm.cc (Target_arm::group_sections): Use it.
2167 (Arm_output_section::group_sections): Delete now redundant test.
2168 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2169 param to handle relative relocs.
2170 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2171 (Output_data_reloc::add_absolute): Adjust.
2172 (Output_data_reloc::add_relative): New function.
2173 (Output_data::reset_data_size): New function.
2174 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2175 (Output_section::set_addralign): New function.
2176 (Output_section::checkpoint_set_addralign): New function.
2177 (Output_section::clear_section_offsets_need_adjustment): New function.
2178 (Output_section::input_sections): Make public.
2179 * powerpc.cc (class Output_data_brlt_powerpc): New.
2180 (class Stub_table, class Stub_control): New.
2181 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2182 stub_table_, set_stub_table, stub_table): New vectors and accessor
2184 (Target_powerpc::do_may_relax, do_relax, push_branch,
2185 new_stub_table, stub_tables, brlt_section, group_sections,
2186 add_branch_lookup_table, find_branch_lookup_table,
2187 write_branch_lookup_table, make_brlt_section): New functions.
2188 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2189 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2190 branch_info_): New vars.
2191 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2192 make call stubs here.
2193 (Output_data_glink): Remove all call stub handling from this class.
2194 (Target_powerpc::Scan::local, global): Save interesting branch
2195 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2196 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2197 functions on final link.
2198 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2199 Handle long branch destinations too.
2200 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2201 do_plt_address_for_local): Adjust lookup of plt call stubs.
2203 2012-11-30 Alan Modra <amodra@gmail.com>
2205 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2206 relocs against protected symbols when building 32-bit shared libs.
2208 2012-11-30 Alan Modra <amodra@gmail.com>
2210 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2211 param. Call got_section() to make .got. Update all callers
2212 and their callers and so on.
2214 2012-11-30 Alan Modra <amodra@gmail.com>
2216 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2217 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2218 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2219 value if it already exists.
2221 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2224 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2226 2012-11-14 Roland McGrath <mcgrathr@google.com>
2228 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2229 than bfc instruction for data sandboxing.
2231 2012-11-08 Alan Modra <amodra@gmail.com>
2233 * po/POTFILES.in: Regenerate.
2235 2012-11-05 Alan Modra <amodra@gmail.com>
2237 * configure.ac: Apply 2012-09-10 change to config.in here.
2238 * configure: Regenerate.
2240 2012-11-05 Alan Modra <amodra@gmail.com>
2242 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2243 (struct Opd_ent): Use "Address" rather than "Offset".
2244 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2245 (Target_powerpc::got_section): Make public.
2246 (Target_powerpc::scan_relocs): Move code setting symbols..
2247 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2248 Create _SDA_BASE_ only when referenced.
2250 2012-11-02 Roland McGrath <mcgrathr@google.com>
2252 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2255 2012-11-01 Roland McGrath <mcgrathr@google.com>
2257 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2258 for offset_in_output_section parameter.
2259 (Sized_target::relocate_special_relocatable): Likewise.
2260 * arm.cc (Target_arm::relocate_relocs): Likewise.
2261 (Target_arm::relocate_special_relocatable): Likewise.
2262 * i386.cc (Target_i386::relocate_relocs): Likewise.
2263 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2264 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2265 * target-reloc.h (relocate_relocs): Likewise.
2266 * testsuite/testfile.cc (Target_test): Likewise.
2267 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2268 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2270 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2271 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2273 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2274 parameter, which is unused in the [!F_SETFD] case.
2276 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2277 SYMNDX to off_t before comparing it to this->data_size().
2278 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2279 * incremental.cc (Output_section_incremental_inputs::do_write):
2280 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2282 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2284 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2286 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2287 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2290 2012-10-29 Cary Coutant <ccoutant@google.com>
2292 * dwp.cc (usage): Add file and exit status parameters;
2293 add --help and --version options.
2294 (print_version): New function.
2295 (main): Add --help and --version options.
2297 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2299 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2300 final_layout_sequence.txt.
2301 * testsuite/Makefile.in: Regenerated.
2303 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2305 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2306 COMPILE generated by automake.
2308 (CXXCOMPILE1): Likewise.
2309 (CXXLINK1): Likewise.
2310 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2312 (CXXCOMPILE): Likewise.
2313 (CXXLINK): Likewise.
2314 * testsuite/Makefile.in: Regenerated.
2316 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2318 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2319 on bad fwrite return.
2321 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2323 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2326 2012-10-23 Cary Coutant <ccoutant@google.com>
2328 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2329 * testsuite/Makefile.in: Regenerate.
2330 * testsuite/dwp_test.h: New source file.
2331 * testsuite/dwp_test_1.cc: New source file.
2332 * testsuite/dwp_test_1.s: New source file.
2333 * testsuite/dwp_test_1.sh: New source file.
2334 * testsuite/dwp_test_1b.cc: New source file.
2335 * testsuite/dwp_test_1b.s: New source file.
2336 * testsuite/dwp_test_2.cc: New source file.
2337 * testsuite/dwp_test_2.s: New source file.
2338 * testsuite/dwp_test_2.sh: New source file.
2339 * testsuite/dwp_test_main.cc: New source file.
2340 * testsuite/dwp_test_main.s: New source file.
2342 2012-10-23 Cary Coutant <ccoutant@google.com>
2344 * dwp.h: New header file.
2345 * dwp.cc: New source file.
2346 * gold.h: Move shared declarations to system.h.
2347 * system.h: New header file.
2348 * Makefile.am: Add dwp.
2349 * Makefile.in: Regenerate.
2351 2012-10-23 Cary Coutant <ccoutant@google.com>
2353 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2354 Dwarf_info_reader::read_from_pointer.
2355 (Dwarf_pubnames_table::read_header): Likewise.
2356 (Dwarf_pubnames_table::next_name): Likewise.
2357 (Dwarf_die::read_attributes): Likewise.
2358 (Dwarf_die::skip_attributes): Likewise.
2359 (Dwarf_info_reader::read_from_pointer): New function template.
2360 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2361 (Dwarf_pubnames_table): Likewise.
2362 (Dwarf_info_reader::read_from_pointer): New function template.
2363 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2364 Dwarf_pubnames_table ctor.
2366 2012-10-23 Cary Coutant <ccoutant@google.com>
2368 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2370 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2372 (Dwarf_info_reader::set_abbrev_shndx): New method.
2373 (Dwarf_info_reader::abbrev_shndx_): New data member.
2375 2012-10-23 Cary Coutant <ccoutant@google.com>
2377 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2378 from object, not parameters.
2379 (Dwarf_info_reader::parse): Likewise.
2380 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2381 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2382 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2385 2012-10-23 Cary Coutant <ccoutant@google.com>
2387 * fileread.cc (Input_file::Input_file): New constructor.
2388 * fileread.h (class Input_file): Add new constructor.
2390 2012-10-18 Alan Modra <amodra@gmail.com>
2393 * object.cc (Relobj::is_section_name_included): Also match
2394 .sdata personality section.
2396 2012-10-18 Alan Modra <amodra@gmail.com>
2398 * target-reloc.h (class Default_comdat_behavior): New, package up..
2399 (get_comdat_behaviour): ..this.
2400 (relocate_section): Add Relocate_comdat_behavior template arg,
2401 adjust code to suit.
2402 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2403 (Target_arm::scan_reloc_section): Likewise.
2404 * i386.cc (Target_i386::relocate_section): Likewise.
2405 * sparc.cc (Target_sparc::relocate_section): Likewise.
2406 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2407 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2408 * powerpc.cc (class Relocate_comdat_behavior): New.
2409 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2410 gold::relocate_section with new template arg.
2412 2012-10-18 Alan Modra <amodra@gmail.com>
2414 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2415 dynamic relocs for GOT_TPREL got entries, without symbol if
2417 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2418 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2419 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2421 2012-10-17 Alan Modra <amodra@gmail.com>
2424 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2426 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2428 * layout.cc (Layout::include_section): Keep sections marked
2429 SHF_EXCLUDE when doing relocatable links.
2431 2012-10-16 Alan Modra <amodra@gmail.com>
2433 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2434 (Target_powerpc::do_finalize_sections): Call it.
2435 (Output_data_save_res): New class and supporting functions.
2436 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2437 normal symbols defined in object files.
2439 2012-10-12 Alan Modra <amodra@gmail.com>
2441 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2442 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2443 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2444 section if scan_opd_relocs not yet called.
2445 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2447 2012-10-12 Alan Modra <amodra@gmail.com>
2449 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2450 add_local_ifunc_entry): Revert last change.
2451 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2453 2012-10-05 Alan Modra <amodra@gmail.com>
2455 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2456 do_plt_address_for_global): New functions.
2457 (Output_data_got_powerpc::do_write): Don't segfault when linking
2459 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2460 add_local_ifunc_entry): Return true on adding entry..
2461 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2462 glink->add_entry call. Remove unused symtab param. Adjust calls.
2463 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2464 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2465 set up symbols here.
2466 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2467 syms here. Do so even when no .iplt. Don't segfault when linking
2469 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2470 new variants without reloc param.
2471 (Glink_sym_ent::Glink_sym_ent): Likewise.
2472 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2473 reloc when refs will resolve to plt call stub.
2474 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2475 R_PPC_PLTREL24 to resolve locally.
2476 (Target_powerpc::Scan::global): Correct ifunc handling.
2477 (Target_powerpc::Relocate::relocate): Correct local sym glink
2478 lookup. Don't destroy "value" when we have a plt call stub,
2479 and when checking plt call validity.
2480 (Target_powerpc::do_dynsym_value): Simplify.
2482 2012-10-05 Alan Modra <amodra@gmail.com>
2484 * i386.cc (Output_data_plt_i386::address_for_global,
2485 address_for_local): Add plt offset to returned value. Adjust uses.
2486 * sparc.cc (Output_data_plt_sparc::address_for_global,
2487 address_for_local): Likewise.
2488 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2489 address_for_local): Likewise.
2490 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2491 address_for_local): Likewise.
2492 * target.h (Target::plt_address_for_global, plt_address_for_local):
2494 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2495 (Output_data_got::Got_entry::write): Nor here.
2496 * output.h: Comment fix.
2498 2012-10-02 Jiong Wang <jiwang@tilera.com>
2500 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2501 global_offset_table_ value for larget got.
2502 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2504 2012-09-29 Alan Modra <amodra@gmail.com>
2506 * powerpc.cc (Target_powerpc::iplt_): New output section.
2507 (Target_powerpc::iplt_section, make_iplt_section,
2508 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2509 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2510 Target_powerpc::plt_entry_count): Count iplt entries too.
2511 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2512 reloc section in constructor. New params.
2513 (Target_powerpc::make_plt_section): Create reloc section here instead.
2514 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2516 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2517 (Output_data_glink::add_entry, find_entry): New functions to
2518 deal with local syms.
2519 (Glink_sym_ent): Add support for local syms.
2520 (Output_data_glink::do_write): Handle ifunc plt entries.
2521 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2522 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2523 (Target_powerpc::Relocate::relocate): Likewise.
2524 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2526 2012-09-25 Alan Modra <amodra@gmail.com>
2528 * object.h (Sized_relobj_file::adjust_local_symbol,
2529 do_adjust_local_symbol): New functions.
2530 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2531 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2532 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2533 and irregular opd entry spacing.
2534 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2535 (Global_symbol_visitor_opd): New functor.
2536 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2537 on deleted opd entries.
2539 2012-09-15 Jiong Wang <jiwang@tilera.com>
2541 * tilegx.cc: New file.
2542 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2543 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2544 * configure.tgt: Add entries for tilegx*.
2545 * configure.ac: Likewise.
2546 * Makefile.in: Rebuild.
2547 * configure: Likewise.
2548 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2551 2012-09-13 Alan Modra <amodra@gmail.com>
2553 * target-reloc.h (scan_relocs): Call scan.local for relocs
2554 against symbols in discarded sections. Pass is_discarded
2556 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2557 Add is_discarded param.
2558 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2559 is_discarded to flag opd entry as discarded. Don't emit dyn
2560 relocs on such entries.
2561 (Target_powerpc::Scan::global): Similarly detect and handle
2563 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2564 opd_ent_. Update all uses.
2565 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2566 (Target_powerpc::relocate_section): Zero out discarded opd
2569 2012-09-12 Ian Lance Taylor <iant@google.com>
2572 * output.cc: Rename Output_data_got template parameter from size
2573 to got_size for all functions. Compile all variants of
2575 (Output_data_got::Got_entry::write): Correct use of size for
2576 symbol value. Use local_is_tls rather than casting to
2578 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2579 (class Sized_relobj_file): Add do_local_is_tls.
2580 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2582 2012-09-11 Alan Modra <amodra@gmail.com>
2585 * layout.cc (Layout::set_segment_offsets): When using
2586 common-page-size alignment, ensure we are on a new max-page-size
2588 * output.cc (Output_segment::set_section_addresses): Use
2589 abi_pagesize, not common_pagesize for relro boundary.
2590 (Output_segment::set_offset): Likewise.
2592 2012-09-11 Alan Modra <amodra@gmail.com>
2594 * output.h (Output_data_got::add_global_tls, add_local_tls,
2595 add_local_tls_pair): New functions.
2596 (Output_data_got::add_local_pair_with_rel): Remove second
2597 reloc param. Expand comment.
2598 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2599 use_plt_or_tls_offset_, similarly for constructor param.
2600 (Output_data_got::Got_entry::write): Add got_index param.
2601 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2602 add_local_tls_pair): New functions.
2603 (Output_data_got::Got_entry::write): Handle tls symbols
2604 with use_plt_or_tls_offset_ set specially.
2605 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2606 (Output_data_got::do_write): Replace iterator with index, pass
2607 index to entry write function.
2608 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2609 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2610 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2612 * i386.cc (Target_i386::Scan::local): Likewise.
2613 * sparc.cc (Target_sparc::Scan::local): Likewise.
2614 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2615 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2616 do_tls_offset_for_global): New functions.
2617 (Target_powerpc::Scan::local): Correct TLS relocations and got
2619 (Target_powerpc::Scan::global): Don't emit unnecessary
2620 dynamic relocations on TLS GOT entries.
2622 2012-09-10 Matthias Klose <doko@ubuntu.com>
2624 * config.in: Disable sanity check for kfreebsd.
2626 2012-09-10 Sterling Augustine <saugustine@google.com>
2628 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2629 (Gdb_index::pubtypes_read): New parameter.
2630 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2632 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2635 2012-09-09 Alan Modra <amodra@gmail.com>
2637 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2638 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2639 * gc.h (gc_process_relocs): Call target gc_add_reference.
2640 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2641 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2642 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2644 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2645 to cater for when we don't need code offset. Update use.
2646 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2647 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2648 set_opd_valid): New functions.
2649 (Target_powerpc::do_gc_add_reference): New function.
2650 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2652 (Target_powerpc::do_gc_mark_symbol): New function.
2654 2012-09-06 Cary Coutant <ccoutant@google.com>
2656 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2657 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2658 (Dwarf_die::skip_attributes): Likewise.
2659 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2660 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2662 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2664 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2666 * testsuite/script_test_3.t: Add .got.plt output section
2668 * testsuite/script_test_4.t: Likewise.
2670 2012-09-05 Alan Modra <amodra@gmail.com>
2672 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2673 update all uses and lose "enum" when using type.
2675 2012-09-05 Alan Modra <amodra@gmail.com>
2677 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2678 * configure: Regenerate.
2679 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2680 (plugin_final_layout.stdout): Likewise.
2681 (memory_test): Set page sizes to 0x1000.
2682 * testsuite/Makefile.in: Regenerate.
2683 * testsuite/discard_locals_test.sh: Add FIXME comment.
2684 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2685 * testsuite/pr14265.t: Add .got output section statement.
2686 * testsuite/script_test_2.t: Likewise.
2687 * testsuite/script_test_3.t: Likewise.
2688 * testsuite/script_test_4.t: Likewise.
2689 * testsuite/script_test_5.t: Likewise.
2690 * testsuite/script_test_6.t: Likewise.
2691 * testsuite/script_test_7.t: Likewise.
2692 * testsuite/script_test_9.t: Likewise.
2694 2012-09-05 Alan Modra <amodra@gmail.com>
2696 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2697 (Powerpc_relocate_functions::Status): New typedef.
2698 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2699 (Target_powerpc::Scan::local): Handle REL64.
2700 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2701 for REL32 and REL64.
2702 (Target_powerpc::symval_for_branch): New function, extracted from..
2703 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2704 checks. Report overflow errors.
2706 2012-09-05 Alan Modra <amodra@gmail.com>
2708 * object.h (Sized_relobj_file::emit_relocs): Delete.
2709 (Sized_relobj_file::emit_relocs_reltype): Delete.
2710 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2711 relocate_relocs for --emit-relocs.
2712 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2713 * output.h: Update comment.
2714 (Output_segment::first_section): New function.
2715 (Output_segment::first_section_load_address): Use first_section.
2716 * output.cc (Output_segment::first_section): New function extracted..
2717 (Output_segment::first_section_load_address): ..from here. Delete.
2718 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2719 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2720 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2721 adjust call to target.h function.
2722 * i386.cc (Target_i386): Likewise.
2723 * sparc.cc (Target_sparc): Likewise.
2724 * x86_64.cc (Target_x86_64): Likewise.
2725 * powerpc.cc (Target_powerpc): Likewise.
2726 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2727 first tls section has section symbol for optimised local dynamic
2729 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2730 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2732 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2733 Rename to relocate_relocs. Update error message.
2735 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2737 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2740 2012-08-31 Alan Modra <amodra@gmail.com>
2742 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2743 (Powerpc_relobj::toc_base_offset): New stub function.
2744 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2745 got_mod_index_offset to tlsld_got_offset. Update all refs.
2746 (Target_powerpc::Relocate::enum skip_tls): New.
2747 (Target_powerpc::call_tls_get_addr_): New var.
2748 (Target_powerpc::is_branch_reloc): Move to file scope.
2749 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2750 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2752 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2753 (powerpc_info): Correct common_pagesize for ppc64.
2754 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2755 (Powerpc_relocate_functions): Add overflow check enums and functions.
2756 Add non-shift version of rela, rela_ua. Delete all rel public
2757 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2758 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2759 addr16_ha3, addr14 functions.
2760 (Output_data_got_powerpc::add_constant_pair): New function.
2761 (Output_data_got_powerpc::got_base_offset): Likewise.
2762 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2763 (instruction constants): Sort, add some more.
2764 (Output_data_glink::do_write): Add and use Address typedef. Use
2765 object->toc_base_offset() stub for 64-bit.
2766 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2767 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2768 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2769 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2770 Always treat .opd relocs as against locally defined symbol.
2771 Correct condition for RELATIVE relocs.
2772 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2773 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2774 for 32-bit syms with a plt entry. Correct ppc64 toc base
2775 calculations. Handle TLS relocs, and more. Add overflow
2776 checking and adjust for Powerpc_relocate_functions changes.
2777 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2778 Reinstate --emit-relocs code with FIXME.
2780 2012-08-30 Alan Modra <amodra@gmail.com>
2782 * layout.cc (Layout::set_segment_offsets): Set p_align to
2783 abi_pagesize, not common_pagesize.
2784 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2785 to determine whether file header can go in segment.
2787 2012-08-30 Alan Modra <amodra@gmail.com>
2789 * output.h (Output_reloc::Output_reloc <output section>): Add
2790 is_relative param. Adjust calls.
2791 (Output_reloc::add_output_section_relative): New functions.
2792 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2794 (Output_reloc::symbol_value): Handle SECTION_CODE.
2796 2012-08-24 Sriraman Tallam <tmsriram@google.com>
2798 * gold.cc (queue_middle_tasks): Call layout again when unique
2799 segments for sections is desired.
2800 * layout.cc (Layout::Layout): Initialize new members.
2801 (Layout::get_output_section_flags): New function.
2802 (Layout::choose_output_section): Call get_output_section_flags.
2803 (Layout::layout): Make output section for mapping to a unique segment.
2804 (Layout::insert_section_segment_map): New function.
2805 (Layout::attach_allocated_section_to_segment): Make unique segment for
2806 output sections marked so.
2807 (Layout::segment_precedes): Check for unique segments when sorting.
2808 * layout.h (Layout::Unique_segment_info): New struct.
2809 (Layout::Section_segment_map): New typedef.
2810 (Layout::insert_section_segment_map): New function.
2811 (Layout::get_output_section_flags): New function.
2812 (Layout::is_unique_segment_for_sections_specified): New function.
2813 (Layout::set_unique_segment_for_sections_specified): New function.
2814 (Layout::unique_segment_for_sections_specified_): New member.
2815 (Layout::section_segment_map_): New member.
2816 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2817 Rename is_gc_pass_one to is_pass_one.
2818 Rename is_gc_pass_two to is_pass_two.
2819 Rename is_gc_or_icf to is_two_pass.
2820 Check for which pass based on whether symbols data is present.
2821 Make it two pass when unique segments for sections is desired.
2822 * output.cc (Output_section::Output_section): Initialize new
2824 * output.h (Output_section::is_unique_segment): New function.
2825 (Output_section::set_is_unique_segment): New function.
2826 (Output_section::is_unique_segment_): New member.
2827 (Output_section::extra_segment_flags): New function.
2828 (Output_section::set_extra_segment_flags): New function.
2829 (Output_section::extra_segment_flags_): New member.
2830 (Output_section::segment_alignment): New function.
2831 (Output_section::set_segment_alignment): New function.
2832 (Output_section::segment_alignment_): New member.
2833 (Output_segment::Output_segment): Initialize is_unique_segment_.
2834 (Output_segment::is_unique_segment): New function.
2835 (Output_segment::set_is_unique_segment): New function.
2836 (Output_segment::is_unique_segment_): New member.
2837 * plugin.cc (allow_unique_segment_for_sections): New function.
2838 (unique_segment_for_sections): New function.
2839 (Plugin::load): Add new functions to transfer vector.
2840 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2841 * Makefile.in: Regenerate.
2842 * testsuite/plugin_final_layout.sh: Check if unique segment
2843 functionality works.
2844 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2846 (allow_unique_segment_for_sections): New global.
2847 (unique_segment_for_sections): New global.
2848 (claim_file_hook): Call allow_unique_segment_for_sections.
2849 (all_symbols_read_hook): Call unique_segment_for_sections.
2851 2012-08-22 Cary Coutant <ccoutant@google.com>
2853 * layout.cc (Layout::include_section): Don't assert on GROUP
2854 sections with --emit-relocs.
2856 2012-08-21 Cary Coutant <ccoutant@google.com>
2858 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2859 if --export-dynamic-symbol names an undef symbol.
2861 2012-08-18 Alan Modra <amodra@gmail.com>
2863 * powerpc.cc: Formatting and white space.
2864 (Powerpc_relobj): Rename got2_section_ to special_.
2865 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2866 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2867 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2868 (Target_powerpc): Add Address typedef and invalid_address. Use
2870 (Target_powerpc::is_branch_reloc): New function.
2871 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2872 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2873 for dst_mask, value and addend.
2874 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2875 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2876 (Output_data_glink::do_write): Correct toc base. Don't try to use
2877 uint16_t for 24-bit offset. Use get_output_section_offset and
2879 (Target_powerpc::Scan::local): Handle more relocs.
2880 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2881 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2882 Plug in toc restoring insn after plt calls. Translate branches
2883 to function descriptor symbols to corresponding entry point.
2884 (Target_powerpc::relocate_for_relocatable): Check return from
2885 get_output_section_offset.
2886 * symtab.h: Comment typo.
2888 2012-08-14 Ian Lance Taylor <iant@google.com>
2890 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2891 unsupported_relocal_local to call unsupported_reloc_global.
2893 2012-08-14 Nick Clifton <nickc@redhat.com>
2896 * script-sections.cc (Sections_element::output_section_name): Add
2897 keep return parameter.
2898 (Output_section_element::match_name): Add keep return parameter.
2899 Return the value of the keep_ member.
2900 * script-sections.h (class Output_section): Update
2901 output_section_name prototype.
2902 * layout.cc (Layout::keep_input_section): New public member
2904 (Layout::choose_output_section): Pass keep parameter to
2905 output_section_name.
2906 * layout.h (class Layout): Add keep_input_section.
2907 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2909 * testsuite/Makefile.am: Add a test.
2910 * testsuite/Makefile.in: Regenerate.
2911 * testsuite/pr14265.c: Source file for the test.
2912 * testsuite/pr14265.t: Linker script for the test.
2913 * testsuite/pr14265.sh: Shell script for the test.
2915 2012-08-14 Alan Modra <amodra@gmail.com>
2917 * target.h (Target::output_section_name): New function.
2918 (Target::do_output_section_name): New function.
2919 * layout.cc (Layout::choose_output_section): Call the above.
2920 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2922 2012-08-14 Alan Modra <amodra@gmail.com>
2924 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2925 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2926 for replace_constant call.
2927 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2928 (Output_data_glink::do_print_to_mapfile): New function.
2929 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2930 (Target_powerpc::Relocate::relocate): Likewise.
2932 2012-08-14 Alan Modra <amodra@gmail.com>
2934 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2935 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2936 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2937 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2938 all references to shndx_. Handle special case for R_PPC_PLTREL24
2940 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2941 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2942 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2944 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2945 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2947 2012-08-12 Alan Modra <amodra@gmail.com>
2949 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2950 (glink insn constants): Use uint32_t.
2951 (Output_data_glink::add_entry): Use insert, not [] operator.
2953 2012-08-11 Alan Modra <amodra@gmail.com>
2955 * object.h (Sized_relobj_file::find_shdr): New function.
2956 (Sized_relobj_file::find_special_sections): New function.
2957 * object.cc (Sized_relobj_file::find_shdr): New function.
2958 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2959 (Sized_relobj_file::find_special_sections): New function, split out..
2960 (Sized_relobj_file::do_read_symbols): ..from here.
2961 * output.h (Output_data_got::replace_constant): New function.
2962 (Output_data_got::num_entries): New function.
2963 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2964 (Output_data_got::got_offset): Protected rather than private.
2965 (Output_data_got::replace_got_entry): New function.
2966 * output.cc (Output_data_got::replace_got_entry): New function.
2967 * powerpc.cc (class Powerpc_relobj): New.
2968 (class Powerpc_relocate_functions): Delete all psymval variants or
2969 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2970 Implement _ha functions using corresponding _hi function.
2971 (Powerpc_relobj::find_special_sections): New function.
2972 (Target_powerpc::do_make_elf_object): New function.
2973 (class Output_data_got_powerpc): New.
2974 (class Output_data_glink): New.
2975 (class Powerpc_scan_relocatable_reloc): New.
2976 Many more changes througout file.
2978 2012-08-09 Nick Clifton <nickc@redhat.com>
2980 * po/vi.po: Updated Vietnamese translation.
2982 2012-08-07 Ian Lance Taylor <iant@google.com>
2984 * layout.cc (Layout::add_target_dynamic_tags): If
2985 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2988 2012-07-30 Nick Clifton <nickc@redhat.com>
2990 * po/gold.pot: Updated template.
2991 * po/es.po: Updated Spanish translation.
2993 2012-07-18 Cary Coutant <ccoutant@google.com>
2996 * configure.ac: Add check for -gpubnames support.
2997 * configure: Regenerate.
2998 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2999 support; force -gno-pubnames.
3000 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3002 (gdb_index_test_4): New test.
3003 * testsuite/Makefile.in: Regenerate.
3004 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3005 * testsuite/gdb_index_test_2.sh: Likewise.
3006 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3007 * testsuite/gdb_index_test_4.sh: New script.
3008 * testsuite/gdb_index_test_comm.sh: New script with common code;
3009 don't look for space after colon.
3011 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3013 * gold.cc (queue_middle_tasks): Update function order only after
3014 deferred objects due to plugins are processed.
3016 2012-07-11 Ian Lance Taylor <iant@google.com>
3018 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3019 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3020 (Target_arm::scan_reloc_for_stub): Likewise.
3021 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3022 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3023 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3024 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3025 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3027 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3028 Ian Lance Taylor <iant@google.com>
3031 * configure.ac: Test whether std::tr1::hash<off_t> works.
3032 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3034 * output.h (class Output_fill): Add virtual destructor.
3035 * configure, config.in: Rebuild.
3037 2012-06-22 Roland McGrath <mcgrathr@google.com>
3039 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3041 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3043 * plugin.cc (Plugin::load): Handle position independent executables.
3045 2012-06-06 Cary Coutant <ccoutant@google.com>
3047 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3049 (lines_only_debug_sections): Likewise.
3050 (gdb_fast_lookup_sections): New static array.
3051 (is_gdb_debug_section): Rename formal parameter.
3052 (is_lines_only_debug_section): Likewise.
3053 (is_gdb_fast_lookup_section): New function.
3054 (Layout::include_section): Check for ".zdebug_" prefix; pass
3055 section name suffix to is_gdb_debug_section, et al.; check for
3056 fast-lookup sections when building .gdb_index.
3057 * options.h (--strip-debug-gdb): Update GDB version number.
3059 2012-06-06 Cary Coutant <ccoutant@google.com>
3061 * configure.ac: Add check for fallocate.
3062 * configure: Regenerate.
3063 * config.in: Regenerate.
3065 * options.h (class General_options): Add --mmap-output-file and
3066 --posix-fallocate options.
3067 * output.cc: (posix_fallocate): Remove; replace with...
3068 (gold_fallocate): New function.
3069 (Output_file::map_no_anonymous): Call gold_fallocate.
3070 (Output_file::map): Check --mmap-output-file option.
3072 2012-06-05 Jing Yu <jingyu@google.com>
3074 * gold.h (textdomain): Add do {} to empty while(0).
3075 (bindtextdomain): Likewise.
3077 2012-06-04 Cary Coutant <ccoutant@google.com>
3079 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3082 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3084 * symtab.cc (Symbol_table::define_special_symbol):
3085 Initialize *poldsym to prevent uninitialized variable errors.
3087 2012-05-23 Cary Coutant <ccoutant@google.com>
3089 * layout.cc (Layout::section_name_mapping): Add rules to handle
3090 exact match on .data.rel.ro.local or .data.rel.ro.
3091 (Layout::output_section_name): Check for exact matches.
3093 2012-05-23 Cary Coutant <ccoutant@google.com>
3095 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3098 2012-05-22 Cary Coutant <ccoutant@google.com>
3100 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3101 object before exporting symbol.
3103 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3105 * testsuite/tls_test.cc: Include "config.h" first.
3106 * testsuite/tls_test_c.c: Likewise.
3108 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3109 Nick Clifton <nickc@redhat.com>
3112 * configure.in: Add check that sysdep.h has been included before
3113 any system header files.
3114 * configure: Regenerate.
3115 * config.in: Regenerate.
3117 2012-05-14 Cary Coutant <ccoutant@google.com>
3119 * layout.cc (Layout::make_output_section): Mark .tdata section
3121 * testsuite/relro_test.cc: Add a TLS variable.
3123 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3126 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3127 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3130 2012-05-08 Cary Coutant <ccoutant@google.com>
3132 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3133 (lines_only_debug_sections): Likewise.
3135 2012-05-02 Roland McGrath <mcgrathr@google.com>
3137 * nacl.cc: New file.
3139 * Makefile.am (CCFILES, HFILES): Add them.
3140 * Makefile.in: Regenerate.
3141 * i386.cc (Output_data_plt_i386_nacl): New class.
3142 (Output_data_plt_i386_nacl_exec): New class.
3143 (Output_data_plt_i386_nacl_dyn): New class.
3144 (Target_i386_nacl): New class.
3145 (Target_selector_i386_nacl): New class.
3146 (target_selector_i386): Use it instead of Target_selector_i386.
3147 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3148 (Target_x86_64_nacl): New class.
3149 (Target_selector_x86_64_nacl): New class.
3150 (target_selector_x86_64, target_selector_x32): Use it instead of
3151 Target_selector_x86_64.
3152 * arm.cc (Output_data_plt_arm_nacl): New class.
3153 (Target_arm_nacl): New class.
3154 (Target_selector_arm_nacl): New class.
3155 (target_selector_arm, target_selector_armbe): Use it instead of
3156 Target_selector_arm.
3158 * target-select.cc (select_target): Take new Input_file* and off_t
3159 arguments, pass them on to recognize method of selector.
3160 * object.cc (make_elf_sized_object): Update caller.
3161 * parameters.cc (parameters_force_valid_target): Likewise.
3162 * incremental.cc (make_sized_incremental_binary): Likewise.
3163 * target-select.h: Update decl.
3164 (Target_selector::recognize): Take new Input_file* argument,
3165 pass it on to do_recognize.
3166 (Target_selector::do_recognize): Take new Input_file* argument.
3167 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3168 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3169 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3170 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3172 * target.h (Target::Target_info): New members isolate_execinstr
3174 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3175 * arm.cc (Target_arm::arm_info): Update initializer.
3176 * i386.cc (Target_i386::i386_info): Likewise.
3177 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3178 * sparc.cc (Target_sparc::sparc_info): Likewise.
3179 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3180 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3181 * layout.cc (Layout::attach_allocated_section_to_segment):
3182 Take new const Target* argument. If target->isolate_execinstr(), act
3184 (Layout::find_first_load_seg): Take new const Target* argument;
3185 if target->isolate_execinstr(), reject PF_X segments.
3186 (Layout::relaxation_loop_body): Update caller.
3187 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3188 reset file offset to zero when we hit LOAD_SEG, and then do a second
3189 loop over the segments before LOAD_SEG to reassign offsets after
3190 addresses have been determined. Handle target->rosegment_gap().
3191 (Layout::attach_section_to_segment): Take new const Target* argument;
3192 pass it to attach_allocated_section_to_segment.
3193 (Layout::make_output_section): Update caller.
3194 (Layout::attach_sections_to_segments): Take new const Target* argument;
3195 pass it to attach_section_to_segment.
3196 * gold.cc (queue_middle_tasks): Update caller.
3197 * layout.h (Layout): Update method decls with new arguments.
3199 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3200 Target_info pointer to use.
3201 (Target_arm::do_make_data_plt): New virtual method.
3202 (Target_arm::make_data_plt): New method that calls it.
3203 (Target_arm::make_plt_entry): Use it.
3204 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3205 for the section alignment.
3206 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3208 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3209 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3211 (Output_data_plt_arm::get_plt_entry_size): Call it.
3212 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3213 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3214 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3216 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3217 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3218 method instead of sizeof(plt_entry).
3219 (Output_data_plt_arm::add_entry): Likewise.
3220 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3221 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3223 (Target_arm::plt_entry_size): Likewise.
3224 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3226 (Output_data_plt_arm_standard): ... here, new class.
3227 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3228 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3229 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3231 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3232 Take additional argument for the PLT entry size.
3233 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3234 Use get_plt_entry_size method rather than plt_entry_size variable.
3235 (Output_data_plt_x86_64::reserve_slot): Likewise.
3236 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3237 (Output_data_plt_x86_64::add_entry): Likewise.
3238 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3239 (Output_data_plt_x86_64::address_for_global): Likewise.
3240 (Output_data_plt_x86_64::address_for_local): Likewise.
3241 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3242 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3243 Make method non-static.
3244 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3246 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3247 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3248 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3249 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3251 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3252 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3254 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3255 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3257 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3258 (Output_data_plt_x86_64::plt_entry_size)
3259 (Output_data_plt_x86_64::first_plt_entry)
3260 (Output_data_plt_x86_64::plt_entry)
3261 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3262 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3263 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3264 (Output_data_plt_x86_64_standard): ... here, new class.
3265 (Target_x86_64::Target_x86_64): Take optional argument for the
3266 Target_info pointer to use.
3267 (Target_x86_64::do_make_data_plt): New virtual method.
3268 (Target_x86_64::make_data_plt): New method to call it.
3269 (Target_x86_64::init_got_plt_for_update): Use that.
3270 Call this->plt_->add_eh_frame method here.
3271 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3272 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3273 rather than static method.
3274 (Target_x86_64::plt_entry_size): Likewise.
3275 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3276 rather than plt_entry_size variable. Move guts of PLT filling to...
3277 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3278 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3279 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3281 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3282 additional argument for the section alignment.
3283 Don't do add_eh_frame_for_plt here.
3284 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3285 non-static. Use get_plt_entry_size method rather than plt_entry_size
3287 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3289 (Output_data_plt_i386::get_plt_entry_size): Call it.
3290 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3291 (Output_data_plt_i386::add_eh_frame): New method to call it.
3292 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3294 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3295 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3297 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3298 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3299 method instead of plt_entry_size.
3300 (Output_data_plt_i386::plt_entry_size)
3301 (Output_data_plt_i386::plt_eh_frame_fde_size)
3302 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3303 (Output_data_plt_i386_standard): ... here, new class.
3304 (Output_data_plt_i386_exec): New class.
3305 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3306 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3307 (Output_data_plt_i386::exec_plt_entry): Move to ...
3308 (Output_data_plt_i386_exec::plt_entry): ... here.
3309 (Output_data_plt_i386_dyn): New class.
3310 (Output_data_plt_i386::first_plt_entry): Move to ...
3311 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3312 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3313 (Output_data_plt_i386_dyn::plt_entry): ... here.
3314 (Target_i386::Target_i386): Take optional argument for the Target_info
3316 (Target_i386::do_make_data_plt): New virtual method.
3317 (Target_i386::make_data_plt): New method to call it.
3318 (Target_i386::make_plt_section): Use that.
3319 Call this->plt_->add_eh_frame method here.
3320 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3321 rather than plt_entry_size variable.
3322 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3323 (Output_data_plt_i386::address_for_local): Likewise.
3324 (Output_data_plt_i386::do_write): Likewise.
3325 Move guts of PLT filling to...
3326 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3327 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3328 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3329 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3331 2012-05-01 Cary Coutant <ccoutant@google.com>
3333 * dwarf_reader.cc (Dwarf_die::read_attributes)
3334 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3335 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3336 * reduced_debug_output.cc
3337 (Output_reduced_debug_info_section::get_die_end): Remove
3338 DW_FORM_GNU_ref_index. Add default case.
3340 2012-04-26 Mark Wielaard <mjw@redhat.com>
3342 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3343 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3344 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3345 DW_AT_high_pc as offset from DW_AT_low_pc.
3347 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3348 * testsuite/Makefile.in: Regenerate.
3349 * testsuite/gdb_index_test_3.c: New test source file.
3350 * testsuite/gdb_index_test_3.sh: New test source file.
3352 2012-04-25 Ian Lance Taylor <iant@google.com>
3354 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3356 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3357 as a class, not a struct.
3358 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3359 (Target_arm::apply_cortex_a8_workaround): Likewise.
3360 * gc.h: Declare Reloc_types as a struct, not a class.
3361 * object.h: Declare Symbols_data as a struct.
3362 * reloc.h: Declare Read_relocs_data as a struct.
3363 * target.h: Declare Relocate_info as a struct.
3365 2012-04-24 David S. Miller <davem@davemloft.net>
3367 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3368 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3371 2012-04-24 Cary Coutant <ccoutant@google.com>
3373 * incremental-dump.cc (find_input_containing_global): Replace
3374 magic number with symbolic constant.
3375 (dump_incremental_inputs): Update version number.
3376 * incremental.cc (Output_section_incremental_inputs): Update version
3377 number; import symbolic constants from Incremental_inputs_reader.
3378 (Incremental_inputs::create_data_sections): Align relocations
3379 section correctly for 64-bit targets.
3380 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3381 constants; add padding.
3382 (Output_section_incremental_inputs::write_header): Add assert for
3384 (Output_section_incremental_inputs::write_input_files): Add assert
3385 for input_entry_size.
3386 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3387 add assert for object_info_size, input_section_entry_size,
3388 global_sym_entry_size.
3389 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3390 for data structure sizes; use them.
3391 (Incremental_input_entry_reader): Import symbolic constants from
3392 Incremental_inputs_reader; use them.
3394 2012-04-23 David S. Miller <davem@davemloft.net>
3396 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3398 (Target_sparc::Target_sparc): Initialize new fields.
3399 (Target_sparc::do_make_elf_object): New function.
3400 (Target_sparc::do_adjust_elf_header): New function.
3402 2012-04-23 Cary Coutant <ccoutant@google.com>
3404 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3405 CU range table of gdb index.
3407 2012-04-20 David S. Miller <davem@davemloft.net>
3409 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3412 2012-04-16 David S. Miller <davem@davemloft.net>
3414 * sparc.cc (Target_sparc::got_address): New function.
3415 (Sparc_relocate_functions::gdop_hix22): New function.
3416 (Sparc_relocate_functions::gdop_lox10): New function.
3417 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3419 (Target_sparc::Scan::local): Likewise if the global symbol is not
3420 preemptible and is not IFUNC.
3421 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3422 transformations for local and non-preemptible non-IFUNC global
3425 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3426 writing out 64-bit part of ranges.
3428 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3429 -fpic and -fpie respectively.
3430 * Makefile.in: Regenerate.
3432 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3433 (Target_sparc::Target_sparc): Initialize new field.
3434 (Target_sparc::do_plt_section_for_global): New function.
3435 (Target_sparc::do_plt_section_for_local): New function.
3436 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3437 (Target_sparc::make_plt_section): New function, broken out of
3438 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3439 (Target_sparc::make_plt_entry): Call make_plt_section.
3440 (Target_sparc::make_local_ifunc_plt_entry): New function.
3441 (Target_sparc::rela_ifunc_section): New function.
3442 (Target_sparc::plt_section): Remove const.
3443 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3444 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3445 and ifunc_count_ fields.
3446 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3447 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3448 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3449 (Output_data_plt_sparc::rela_ifunc): New function.
3450 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3451 (Output_data_plt_sparc::has_ifunc_section): New function.
3452 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3453 (Output_data_plt_sparc::address_for_global): New function.
3454 (Output_data_plt_sparc::address_for_local): New function.
3455 (Output_data_plt_sparc::plt_index_to_offset): New function.
3456 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3458 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3460 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3461 R_SPARC_JMP_IREL to switch.
3462 (Target_sparc::Scan::check_non_pic): Likewise.
3463 (Target_sparc::Scan::local): Handle IFUNC symbols.
3464 (Target_sparc::Scan::local): Likewise.
3465 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3466 and plt_address_for_local.
3467 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3468 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3470 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3471 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3472 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3473 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3475 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3476 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3478 * sparc.cc (Target_sparc::Scan::global): Likewise.
3479 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3481 2012-04-16 Cary Coutant <ccoutant@google.com>
3483 * archive.cc (Library_base::should_include_member): Check for
3484 --export-dynamic-symbol.
3485 * options.h (class General_options): Add --export-dynamic-symbol.
3486 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3487 --export-dynamic-symbol.
3488 (Symbol_table::gc_mark_undef_symbols): Likewise.
3489 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3491 2012-04-12 David S. Miller <davem@davemloft.net>
3493 * sparc.cc (Reloc::wdisp10): New relocation method.
3494 (Reloc::h34): Likewise.
3495 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3496 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3498 (Target_sparc::Scan::local): Likewise.
3499 (Target_sparc::Scan::global): Likewise.
3500 (Target_sparc::Relocate::relocate): Likewise.
3502 2012-04-09 Cary Coutant <ccoutant@google.com>
3504 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3507 2012-04-06 Ian Lance Taylor <iant@google.com>
3509 * timer.cc: #include <unistd.h>.
3511 2012-04-06 Roland McGrath <mcgrathr@google.com>
3513 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3514 * config.in: Regenerate.
3515 * configure: Regenerate.
3517 2012-04-05 Nick Clifton <nickc@redhat.com>
3519 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3520 (AM_LC_MESSAGES): Add.
3521 * aclocal.m4: Regenerate.
3522 * config.in: Regenerate.
3523 * configure: Regenerate.
3525 2012-03-21 Cary Coutant <ccoutant@google.com>
3527 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3528 * Makefile.in: Regenerate.
3529 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3530 (Sized_elf_reloc_mapper::symbol_section): New function.
3531 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3532 (make_elf_reloc_mapper): New function.
3533 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3534 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3535 (Dwarf_abbrev_table::do_get_abbrev): New function.
3536 (Dwarf_ranges_table::read_ranges_table): New function.
3537 (Dwarf_ranges_table::read_range_list): New function.
3538 (Dwarf_pubnames_table::read_section): New function.
3539 (Dwarf_pubnames_table::read_header): New function.
3540 (Dwarf_pubnames_table::next_name): New function.
3541 (Dwarf_die::Dwarf_die): New function.
3542 (Dwarf_die::read_attributes): New function.
3543 (Dwarf_die::skip_attributes): New function.
3544 (Dwarf_die::set_name): New function.
3545 (Dwarf_die::set_linkage_name): New function.
3546 (Dwarf_die::attribute): New function.
3547 (Dwarf_die::string_attribute): New function.
3548 (Dwarf_die::int_attribute): New function.
3549 (Dwarf_die::uint_attribute): New function.
3550 (Dwarf_die::ref_attribute): New function.
3551 (Dwarf_die::child_offset): New function.
3552 (Dwarf_die::sibling_offset): New function.
3553 (Dwarf_info_reader::check_buffer): New function.
3554 (Dwarf_info_reader::parse): New function.
3555 (Dwarf_info_reader::do_parse): New function.
3556 (Dwarf_info_reader::do_read_string_table): New function.
3557 (Dwarf_info_reader::lookup_reloc): New function.
3558 (Dwarf_info_reader::get_string): New function.
3559 (Dwarf_info_reader::visit_compilation_unit): New function.
3560 (Dwarf_info_reader::visit_type_unit): New function.
3561 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3562 Sized_elf_reloc_mapper.
3563 (Sized_dwarf_line_info::symbol_section): Remove function.
3564 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3565 (Sized_dwarf_line_info::read_line_mappings): Remove object
3566 parameter, adjust callers.
3567 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3568 * dwarf_reader.h: Include <sys/types.h>.
3569 (class Track_relocs): Remove forward declaration.
3570 (class Elf_reloc_mapper): New class.
3571 (class Sized_elf_reloc_mapper): New class.
3572 (class Dwarf_abbrev_table): New class.
3573 (class Dwarf_range_list): New class.
3574 (class Dwarf_ranges_table): New class.
3575 (class Dwarf_pubnames_table): New class.
3576 (class Dwarf_die): New class.
3577 (class Dwarf_info_reader): New class.
3578 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3579 (Sized_dwarf_line_info::symbol_section): Remove member function.
3580 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3582 * gdb-index.cc: New source file.
3583 * gdb-index.h: New source file.
3584 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3585 and .debug_types sections, call Layout::add_to_gdb_index.
3586 (Sized_relobj_incr::do_section_name): Implement.
3587 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3588 return type; Implement.
3589 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3591 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3592 parameter list and return type.
3593 (Sized_incr_dynobj::do_section_contents): Likewise.
3594 * layout.cc: Include gdb-index.h.
3595 (Layout::Layout): Initialize gdb_index_data_.
3596 (Layout::init_fixed_output_section): Check for .gdb_index section.
3597 (Layout::add_to_gdb_index): New function. Instantiate.
3598 * layout.h: Add forward declaration for class Gdb_index.
3599 (Layout::add_to_gdb_index): New member function.
3600 (Layout::gdb_index_data_): New data member.
3601 * main.cc: Include gdb-index.h.
3602 (main): Print statistics for gdb index.
3603 * object.cc (Object::section_contents): Move code into
3604 do_section_contents.
3605 (need_decompressed_section): Check for sections needed when building
3607 (build_compressed_section_map): Likewise.
3608 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3610 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3611 sections; call Layout::add_to_gdb_index.
3612 (Sized_relobj_file::do_decompressed_section_contents): Call
3613 do_section_contents directly.
3614 * object.h (Object::do_section_contents): Adjust parameter list and
3616 (Object::do_decompressed_section_contents): Call do_section_contents
3618 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3620 * options.h (class General_options): Add --gdb-index option.
3621 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3622 list and return type.
3623 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3624 * reloc.h (Track_relocs::checkpoint): New function.
3625 (Track_relocs::reset): New function.
3627 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3629 * testsuite/Makefile.in: Regenerate.
3630 * testsuite/gdb_index_test.cc: New test source file.
3631 * testsuite/gdb_index_test_1.sh: New test source file.
3632 * testsuite/gdb_index_test_2.sh: New test source file.
3634 2012-03-19 Doug Kwan <dougkwan@google.com>
3636 * arm.cc (Target_arm::do_define_standard_symbols): New method.
3637 (Target_arm::do_finalize_sections): Remove code which defines
3638 __exidx_start and __exidx_end. Make symbol table parameter
3639 anonymous as it is not used.
3640 * gold.cc (queue_middle_tasks): Call target hook to define any
3641 target-specific symbols.
3642 * target.h (Target::define_standard_symbols): New method.
3643 (Target::do_define_standard_symbols): Same.
3644 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3645 * testsuite/Makefile.in: Regenerate.
3646 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3648 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3649 relocations are generated for __exidx_start and __exidx_end.
3651 2012-03-16 Doug Kwan <dougkwan@google.com>
3653 * testsuite/Makefile.am: Disable test initpri3b.
3654 * testsuite/Makefile.in: Regenerate.
3656 2012-03-15 Doug Kwan <dougkwan@google.com>
3658 * arm.cc (Target_arm::got_section): Make .got section read-only
3661 2012-03-15 Ian Lance Taylor <iant@google.com>
3664 * layout.cc (Layout::make_output_section): Correctly mark
3665 SHT_INIT_ARRAY, et. al., as relro.
3667 2012-03-14 Doug Kwan <dougkwan@google.com>
3669 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3670 dynamic relocations for protected symbols in shared objects.
3672 2012-03-13 Ian Lance Taylor <iant@google.com>
3674 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3675 keep the larger alignment.
3677 2012-03-12 Cary Coutant <ccoutant@google.com>
3679 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3680 handling of DW_LNE_define_file.
3682 2012-03-12 Cary Coutant <ccoutant@google.com>
3684 * reduced_debug_output.cc
3685 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3688 2012-02-29 Cary Coutant <ccoutant@google.com>
3690 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3692 2012-02-29 Cary Coutant <ccoutant@google.com>
3694 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3695 Call Object::decompressed_section_contents.
3696 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3698 (Sized_dwarf_line_info::buffer_start_): New data member.
3699 * merge.cc (Output_merge_data::do_add_input_section): Call
3700 Object::decompressed_section_contents.
3701 (Output_merge_string::do_add_input_section): Likewise.
3702 * object.cc (need_decompressed_section): New function.
3703 (build_compressed_section_map): Decompress sections needed later.
3704 (Sized_relobj_file::do_decompressed_section_contents): New function.
3705 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3706 * object.h (Object::decompressed_section_contents): New function.
3707 (Object::discard_decompressed_sections): New function.
3708 (Object::do_decompressed_section_contents): New function.
3709 (Object::do_discard_decompressed_sections): New function.
3710 (Compressed_section_info): New type.
3711 (Compressed_section_map): Include decompressed section contents.
3712 (Sized_relobj_file::do_decompressed_section_contents): New function.
3713 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3715 2012-02-16 Cary Coutant <ccoutant@google.com>
3717 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3718 * testsuite/Makefile.in: Regenerate.
3720 2012-02-14 Cary Coutant <ccoutant@google.com>
3722 * options.cc (General_options::finalize): Disallow -pie and -static.
3724 2012-02-03 Doug Kwan <dougkwan@google.com>
3726 * arm.cc (Arm_relocate_functions::abs8,
3727 Arm_relocate_functions::abs16): Use
3728 Bits::has_signed_unsigned_overflow32.
3729 (Arm_relocate_functions::thm_abs8): Correct range of
3731 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3734 2012-02-02 Doug Kwan <dougkwan@google.com>
3736 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3737 position independent outputs, not just shared objects.
3739 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3741 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3742 * configure: Regenerated.
3744 2012-01-27 Ian Lance Taylor <iant@google.com>
3746 * reloc.h (Bits): New class with static functions, copied from
3747 namespace utils in arm.cc.
3748 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3751 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3753 * incremental.cc (write_info_blocks): Correct relocation offset.
3755 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3757 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3758 (Relocate::tls_gd_to_le): Likewise.
3760 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3762 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3764 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3766 * configure.ac: Check if -mcmodel=medium works.
3767 * configure: Regenerated.
3769 2012-01-24 Cary Coutant <ccoutant@google.com>
3771 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3773 (read_unsigned_LEB_128_x): ... this new function.
3774 (read_signed_LEB_128): Replaced with inline definition and ...
3775 (read_signed_LEB_128_x): ... this new function.
3776 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3777 (read_unsigned_LEB_128): Add inline definition.
3778 (read_signed_LEB_128_x): New function.
3779 (read_signed_LEB_128): Add inline definition.
3780 * testsuite/Makefile.am (leb128_unittest): New unit test.
3781 * testsuite/Makefile.in: Regenerate.
3782 * testsuite/leb128_unittest.cc: New unit test.
3784 2012-01-23 Ian Lance Taylor <iant@google.com>
3787 * i386.cc (Target_i386::do_code_fill): When using a jmp
3788 instruction, pad with nop instructions.
3789 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3791 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3793 * x86_64.cc (gc_process_relocs): Add typename on types used in
3795 (scan_relocs): Likewise.
3796 (relocate_section): Likewise.
3797 (apply_relocation): Likewise.
3799 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3801 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3802 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3805 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3807 * x86_64.cc: Initial support for x32.
3809 2012-01-03 Cary Coutant <ccoutant@google.com>
3811 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3812 Use abstract base class for GOT.
3813 * gold/output.h (class Output_data_got_base): New abstract base class.
3814 (class Output_data_got): Derive from new base class, adjust ctors.
3815 (Output_data_got::reserve_slot): Make virtual; rename to
3816 do_reserve_slot; Adjust callers.
3817 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3818 pointer to abstract base class.
3819 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3821 2011-12-18 Ian Lance Taylor <iant@google.com>
3823 * object.h (Relobj::local_symbol_value): New function.
3824 (Relobj::local_plt_offset): New function.
3825 (Relobj::local_has_got_offset): New function.
3826 (Relobj::local_got_offset): New function.
3827 (Relobj::set_local_got_offset): New function.
3828 (Relobj::do_local_symbol_value): New pure virtual function.
3829 (Relobj::do_local_plt_offset): Likewise.
3830 (Relobj::do_local_has_got_offset): Likewise.
3831 (Relobj::do_local_got_offset): Likewise.
3832 (Relobj::do_set_local_got_offset): Likewise.
3833 (Sized_relobj::do_local_has_got_offset): Rename from
3834 local_has_got_offset.
3835 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3836 (Sized_relobj::do_set_local_got_offset): Rename from
3837 set_local_got_offset.
3838 (Sized_relobj_file::do_local_plt_offset): Rename from
3840 (Sized_relobj_file::do_local_symbol_value): New function.
3841 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3843 * output.cc (Output_data_got::Got_entry::write): Change object to
3844 Relobj. Use local_symbol_value.
3845 (Output_data_got::add_global_with_rel): Change rel_dyn to
3846 Output_data_reloc_generic*. Use add_global_generic.
3847 (Output_data_got::add_global_with_rela): Remove. Change all
3848 callers to use add_global_with_rel.
3849 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3850 Output_data_reloc_generic*. Use add_global_generic.
3851 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3852 callers to use add_global_pair_with_rel.
3853 (Output_data_got::add_local): Change object to Relobj*.
3854 (Output_data_got::add_local_plt): Likewise.
3855 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3856 change rel_dyn to Output_data_reloc_generic*. Use
3858 (Output_data_got::add_local_with_rela): Remove. Change all
3859 callers to use all_local_with_rel.
3860 (Output_data_got::add_local_pair_with_rel): Change object to
3861 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3862 add_output_section_generic.
3863 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3864 callers to use add_local_pair_with_rel.
3865 (Output_data_got::reserve_local): Change object to Relobj*.
3866 * output.h: (class Output_data_reloc_generic): Add pure virtual
3867 declarations for add_global_generic, add_local_generic,
3868 add_output_section_generic.
3869 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3870 functions for Output_data_reloc_generic. Update declarations for
3871 changes listed in output.cc.
3872 (class Output_data_got): Change template parameter to got_size.
3873 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3874 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3876 (Sized_relobj_incr::do_local_plt_offset): New function.
3877 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3880 2011-12-17 Cary Coutant <ccoutant@google.com>
3882 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3883 * resolve.cc (Symbol_table::resolve): Likewise.
3884 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3886 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3888 2011-12-16 Ian Lance Taylor <iant@google.com>
3890 * output.h (Output_data_reloc_generic::add): Only call
3891 add_dynamic_reloc if this is a dynamic reloc section.
3893 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3896 * target-reloc.h (apply_relocation): Replace <64, false> with
3899 2011-11-25 Nick Clifton <nickc@redhat.com>
3901 * po/it.po: New Italian translation.
3903 2011-11-17 Sterling Augustine <saugustine@google.com>
3905 * script.cc (script_include_directive): Implement.
3906 (read_script_file): New local variables name and search_path. Update
3907 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3908 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3909 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3911 2011-11-11 Sterling Augustine <saugustine@google.com>
3913 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3914 (file_or_sections_cmd): Likewise.
3916 2011-11-11 Doug Kwan <dougkwan@google.com>
3918 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3919 if --just-symbols is given.
3921 2011-11-10 Doug Kwan <dougkwan@google.com>
3924 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3925 when processing data relocs.
3926 * reloc.h (Relocate_functions::rel_unaligned): New method.
3927 (Relocate_functions::pcrel_unaligned): Ditto.
3928 (Relocate_functions::rel32_unaligned): Ditto.
3929 (Relocate_functions::pcrel32_unaligned): Ditto.
3931 2011-11-09 Doug Kwan <dougkwan@google.com>
3934 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3935 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3936 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3937 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3938 (Relocate_functions::rel_unaligned): New.
3939 (Relocate_functions::rel32_unaligned): New.
3940 * target-reloc.h (relocate_for_relocatable): Add code to handle
3941 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3942 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3943 arm_unaligned_reloc_r): New targets.
3944 * testsuite/Makefile.in: Regenerate.
3945 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3948 2011-11-02 Ian Lance Taylor <iant@google.com>
3950 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3952 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3953 * options.cc (General_options::finalize): Use library search path
3954 from configure script if specified. If not native and no sysroot,
3955 only search TOOLLIBDIR.
3956 * options.h (Search_directory::Search_directory): Change name to
3958 (General_options::add_to_library_path_with_sysroot): Change arg to
3960 * configure, Makefile.in, config.in: Rebuild.
3962 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3964 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3965 we are working around the ARM1176 Erratum.
3966 * options.h (General_options::fix_arm1176): Add option.
3967 * testsuite/Makefile.am: Add testcases, and keep current ones
3969 * testsuite/Makefile.in: Regenerate.
3970 * testsuite/arm_fix_1176.s: New file.
3971 * testsuite/arm_fix_1176.sh: Likewise.
3973 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3975 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3977 (Target_arm::may_use_blx): Remove method.
3978 (Target_arm::set_may_use_blx): Likewise.
3979 (Target_arm::may_use_v4t_interworking): New method.
3980 (Target_arm::may_use_v5t_interworking): Likewise.
3981 (Target_arm::may_use_blx_): Remove member variable.
3982 (Arm_relocate_functions::arm_branch_common): Check for v5T
3984 (Arm_relocate_functions::thumb_branch_common): Likewise.
3985 (Reloc_stub::stub_type_for_reloc): Likewise.
3986 (Target_arm::do_finalize_sections): Correct interworking checks.
3987 * testsuite/Makefile.am: Add new tests.
3988 * testsuite/Makefile.in: Regenerate.
3989 * testsuite/arm_farcall_arm_arm.s: New test.
3990 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3991 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3992 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3993 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3994 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3995 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3996 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3998 2011-10-31 Cary Coutant <ccoutant@google.com>
4001 * expression.cc (Expression::eval_with_dot): Add
4002 is_section_dot_assignment parameter.
4003 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4004 absolute and assigning to dot within a section.
4005 * script-sections.cc
4006 (Output_section_element_assignment::set_section_addresses): Pass
4007 dot_section to set_if_absolute.
4008 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4009 as is_section_dot_assignment flag to eval_with_dot.
4010 (Output_section_element_dot_assignment::set_section_addresses):
4012 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4013 parameter. Also set value if relative to dot_section; set the
4014 symbol's output_section.
4015 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4016 parameter. Adjust all callers.
4017 (Expression::eval_maybe_dot): Likewise.
4018 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4020 * testsuite/script_test_2.t: Test assignment of an absolute value
4021 to dot within an output section element.
4023 2011-10-31 Cary Coutant <ccoutant@google.com>
4025 * options.h (class General_options): Add --[no-]gnu-unique options.
4026 * symtab.cc (Symbol_table::sized_write_globals): Convert
4027 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4029 2011-10-31 Cary Coutant <ccoutant@google.com>
4032 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4033 unnecessary assertion.
4034 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4036 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4038 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4040 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4042 Change to just keep the section associated with symbol.
4043 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4044 they are externally visible and --export-dynamic is turned on.
4045 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4047 2011-10-19 Ian Lance Taylor <iant@google.com>
4050 * script-sections.cc
4051 (Output_section_element_dot_assignment::needs_output_section): New
4054 2011-10-19 Ian Lance Taylor <iant@google.com>
4057 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4058 --section-start option was seen.
4059 * options.h (General_options::any_section_start): New function.
4061 2011-10-18 David S. Miller <davem@davemloft.net>
4064 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4065 member to track relocation locations that have moved during TLS
4066 reloc optimizations.
4067 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4068 (Target_sparc::Relocate::relocate): Adjust view down by 4
4069 bytes if it matches reloc_adjust_addr_.
4070 (Target_sparc::Relocate::relocate_tls): Always move the
4071 __tls_get_addr call delay slot instruction forward 4 bytes when
4072 performing relaxation.
4074 2011-10-18 Cary Coutant <ccoutant@google.com>
4076 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4077 (Output_file::map_no_anonymous): Check for non-zero
4078 return code from posix_fallocate.
4080 2011-10-17 Cary Coutant <ccoutant@google.com>
4083 * plugin.cc (is_visible_from_outside): Check for symbols
4084 referenced from dynamic objects.
4085 * resolve.cc (Symbol_table::resolve): Don't count references
4086 from dynamic objects as references from real ELF files.
4087 * testsuite/plugin_test_2.sh: Adjust expected result.
4089 2011-10-17 Cary Coutant <ccoutant@google.com>
4091 * gold.cc: Include timer.h.
4092 (queue_middle_tasks): Stamp time.
4093 (queue_final_tasks): Likewise.
4094 * main.cc (main): Store timer in parameters. Print timers
4096 * parameters.cc (Parameters::Parameters): Initialize timer_.
4097 (Parameters::set_timer): New function.
4098 (set_parameters_timer): New function.
4099 * parameters.h (Parameters::set_timer): New function.
4100 (Parameters::timer): New function.
4101 (Parameters::timer_): New data member.
4102 (set_parameters_timer): New function.
4103 * timer.cc (Timer::stamp): New function.
4104 (Timer::get_pass_time): New function.
4105 * timer.h (Timer::stamp): New function.
4106 (Timer::get_pass_time): New function.
4107 (Timer::pass_times_): New data member.
4109 2011-10-17 Cary Coutant <ccoutant@google.com>
4111 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4112 task for members of lib groups.
4114 2011-10-17 Cary Coutant <ccoutant@google.com>
4117 * fileread.cc (File_read::find_view): Add assert.
4118 (File_read::make_view): Move bounds check (replace with assert)...
4119 (File_read::find_or_make_view): ... to here.
4121 2011-10-12 Cary Coutant <ccoutant@google.com>
4123 * output.cc (Output_file::open_base_file): Handle case where
4124 ::read returns less than requested size.
4126 2011-10-10 Cary Coutant <ccoutant@google.com>
4128 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4129 Initialize defined_count_.
4130 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4131 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4132 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4133 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4134 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4135 * incremental.h (Sized_relobj_incr::defined_count_): New data
4137 (Sized_incr_dynobj::defined_count_): New data member.
4138 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4139 Return zeroes instead of internal error.
4141 2011-10-10 Cary Coutant <ccoutant@google.com>
4144 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4145 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4146 * output.h (class Output_reloc): Add use_plt_offset flag.
4147 (Output_reloc::type_): Adjust size of bit field.
4148 (Output_reloc::use_plt_offset_): New bit field.
4149 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4150 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4151 flag. Adjust all callers.
4152 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4153 creating RELATIVE relocations.
4155 2011-10-10 Nick Clifton <nickc@redhat.com>
4157 * po/es.po: Updated Spanish translation.
4158 * po/fi.po: Updated Finnish translation.
4160 2011-10-03 Diego Novillo <dnovillo@google.com>
4162 * options.cc (parse_uint): Fix dereference of RETVAL.
4164 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4166 * layout.h (section_order_map_): New member.
4167 (get_section_order_map): New member function.
4168 * output.cc (Output_section::add_input_section): Check for patterns
4169 only when --section-ordering-file is specified.
4170 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4171 output_sections have been formed.
4172 * layout.cc (Layout_Layout): Initialize section_order_map_.
4173 * plugin.cc (update_section_order): Store order in order_map. Do not
4175 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4176 * testsuite/Makefile.in: Regenerate.
4177 * testsuite/plugin_section_order.c: New file.
4178 * testsuite/plugin_final_layout.cc: New file.
4179 * testsuite/plugin_final_layout.sh: New file.
4181 2011-09-29 Cary Coutant <ccoutant@google.com>
4183 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4185 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4186 symbols during incremental update.
4187 (Symbol_table::add_from_dynobj): Likewise.
4189 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4190 Ian Lance Taylor <iant@google.com>
4192 * symtab.cc (Symbol_table::define_special_symbol): Always
4193 canonicalize version string.
4195 2011-09-26 Cary Coutant <ccoutant@google.com>
4197 * gold.cc (queue_initial_tasks): Move option checks ...
4198 * options.cc (General_options::finalize): ... to here. Disable
4199 some options; make others fatal.
4201 2011-09-26 Cary Coutant <ccoutant@google.com>
4204 * plugin.cc (get_symbols_v2): New function.
4205 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4206 (is_referenced_from_outside): New function.
4207 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4208 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4209 (get_symbols): Pass version parameter.
4210 (get_symbols_v2): New function.
4211 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4213 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4214 (onload): Add LDPT_GET_SYMBOLS_V2.
4215 (all_symbols_read_hook): Use get_symbols_v2; check for
4216 LDPR_PREVAILING_DEF_IRONLY_EXP.
4217 * testsuite/plugin_test_3.sh: Update expected results.
4219 2011-09-23 Simon Baldwin <simonb@google.com>
4221 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4222 configuration options.
4223 * configure: Regenerate.
4224 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4225 * Makefile.in: Regenerate.
4226 * testsuite/Makefile.in: Regenerate.
4228 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4230 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4232 2011-09-19 Cary Coutant <ccoutant@google.com>
4234 * incremental.cc (can_incremental_update): Fix typo in comment.
4235 * incremental.h (can_incremental_update): Likewise.
4237 2011-09-18 Cary Coutant <ccoutant@google.com>
4239 * incremental.cc (can_incremental_update): New function.
4240 * incremental.h (can_incremental_update): New function.
4241 * layout.cc (Layout::init_fixed_output_section): Call it.
4242 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4243 * object.cc (Sized_relobj_file::do_layout): Call
4244 can_incremental_update.
4246 2011-09-13 Cary Coutant <ccoutant@google.com>
4248 * configure.ac: Check for glibc support for gnu_indirect_function
4249 support with static linking, setting automake conditional
4251 * Makefile.in: Regenerate.
4252 * configure: Regenerate.
4254 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4255 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4257 * testsuite/Makefile.in: Regenerate.
4259 2011-09-13 Cary Coutant <ccoutant@google.com>
4261 * incremental.cc (Sized_relobj_incr::do_layout): Call
4262 report_comdat_group for kept comdat sections.
4263 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4264 * testsuite/Makefile.in: Regenerate.
4265 * testsuite/incr_comdat_test_1.cc: New source file.
4266 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4267 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4268 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4270 2011-09-13 Ian Lance Taylor <iant@google.com>
4272 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4273 variable external_symbols_offset.
4275 2011-09-12 Ian Lance Taylor <iant@google.com>
4277 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4278 triggered if object has no symbols.
4280 2011-09-09 David S. Miller <davem@davemloft.net>
4282 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4283 (Output_fill_debug_line::do_write): Likewise.
4285 2011-08-29 Cary Coutant <ccoutant@google.com>
4287 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4288 casts to match formatting specs.
4289 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4291 2011-08-26 Cary Coutant <ccoutant@google.com>
4293 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4294 remaining hole size when allocating.
4295 (Layout::make_output_section): Set fill methods for debug sections.
4296 * layout.h (Free_list::Free_list_node): Move from private to
4298 (Free_list::set_min_hole_size): New function.
4299 (Free_list::begin, Free_list::end): New functions.
4300 (Free_list::min_hole_): New data member.
4301 * output.cc: Include dwarf.h.
4302 (Output_fill_debug_info::do_minimum_hole_size): New function.
4303 (Output_fill_debug_info::do_write): New function.
4304 (Output_fill_debug_line::do_minimum_hole_size): New function.
4305 (Output_fill_debug_line::do_write): New function.
4306 (Output_section::Output_section): Initialize new data member.
4307 (Output_section::set_final_data_size): Ensure patch space is larger
4308 than minimum hole size.
4309 (Output_section::do_write): Fill holes in debug sections.
4310 * output.h (Output_fill): New class.
4311 (Output_fill_debug_info): New class.
4312 (Output_fill_debug_line): New class.
4313 (Output_section::set_free_space_fill): New function.
4314 (Output_section::free_space_fill_): New data member.
4315 * testsuite/Makefile.am (incremental_test_3): Add
4316 --incremental-patch option.
4317 (incremental_test_4): Likewise.
4318 (incremental_test_5): Likewise.
4319 (incremental_test_6): Likewise.
4320 (incremental_copy_test): Likewise.
4321 (incremental_common_test_1): Likewise.
4322 * testsuite/Makefile.in: Regenerate.
4324 2011-08-26 Nick Clifton <nickc@redhat.com>
4326 * po/es.po: Updated Spanish translation.
4328 2011-08-01 Cary Coutant <ccoutant@google.com>
4330 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4331 * gold/testsuite/Makefile.in: Regenerate.
4332 * gold/testsuite/justsyms_exec.c: New source file.
4333 * gold/testsuite/justsyms_lib.c: New source file.
4335 2011-08-01 Cary Coutant <ccoutant@google.com>
4337 * layout.cc (Layout::set_segment_offsets): Don't realign text
4338 segment if -Ttext was specified.
4339 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4341 * object.h (Sized_relobj_file::e_type): New function.
4342 (Sized_relobj_file::e_type_): New data member.
4343 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4344 base address for ET_EXEC files.
4345 * target.cc (Target::do_make_elf_object_implementation): Allow
4346 ET_EXEC files with --just-symbols option.
4348 2011-07-28 Cary Coutant <ccoutant@google.com>
4350 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4351 Add thread_number parameter.
4352 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4353 * workqueue-threads.cc
4354 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4355 current thread if its thread number is greater than desired thread
4357 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4358 Add thread_number parameter.
4359 (Workqueue::should_cancel_thread): Likewise.
4360 (Workqueue::find_runnable_or_wait): Pass thread_number to
4361 should_cancel_thread.
4362 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4365 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4367 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4368 only after checking if it cannot be forced local.
4369 * symtab.h (is_externally_visible): Check if the symbol is not forced
4372 2011-07-15 Ian Lance Taylor <iant@google.com>
4374 * options.h (class General_options): Add --print-output-format.
4375 Move -EL next to -EB, for better --help output.
4376 * target-select.cc: Include <cstdio>, "options.h", and
4378 (Target_selector::do_target_bfd_name): New function.
4379 (print_output_format): New function.
4380 * target-select.h (class Target_selector): Update declarations.
4381 (Target_selector::target_bfd_name): New function.
4382 (print_output_format): Declare.
4383 * main.cc: Include "target-select.h".
4384 (main): Handle --print-output-format.
4385 * gold.cc: Include "target-select.h".
4386 (queue_initial_tasks): Handle --print-output-format when there are
4388 * parameters.cc (parameters_force_valid_target): Give a better
4389 error message if -EB/-EL does not match target.
4390 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4393 2011-07-15 Ian Lance Taylor <iant@google.com>
4395 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4396 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4397 (Output_data_plt_i386::do_write): Write address of .dynamic
4398 section to first entry in .got.plt section.
4399 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4400 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4402 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4403 section to first entry in .got.plt section.
4404 * layout.h (Layout::dynamic_section): New function.
4406 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4408 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4410 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4411 input_section_position_, and input_section_glob_.
4412 (read_layout_from_file): Call function section_ordering_specified.
4413 * layout.h (is_section_ordering_specified): New function.
4414 (section_ordering_specified): New function.
4415 (section_ordering_specified_): New boolean member.
4416 * main.cc(main): Call load_plugins after layout object is defined.
4417 * output.cc (Output_section::add_input_section): Use
4418 function section_ordering_specified to check if section ordering is
4420 * output.cc (Output_section::add_relaxed_input_section): Use
4421 function section_ordering_specified to check if section ordering is
4423 (Output_section::update_section_layout): New function.
4424 (Output_section::sort_attached_input_sections): Check if input section
4426 * output.h (Output_section::update_section_layout): New function.
4427 * plugin.cc (get_section_count): New function.
4428 (get_section_type): New function.
4429 (get_section_name): New function.
4430 (get_section_contents): New function.
4431 (update_section_order): New function.
4432 (allow_section_ordering): New function.
4433 (Plugin::load): Add the new interfaces to the transfer vector.
4434 (Plugin_manager::load_plugins): New parameter.
4435 (Plugin_manager::all_symbols_read): New parameter.
4436 (Plugin_manager::claim_file): New parameter. Save the elf object for
4438 (Plugin_manager::get_elf_object): New function.
4439 (Plugin_manager::get_view): Change to directly use the bool to check
4440 if get_view is called from claim_file_hook.
4441 * plugin.h (input_objects): New function
4442 (Plugin__manager::load_plugins): New parameter.
4443 (Plugin_manager::claim_file): New parameter.
4444 (Plugin_manager::get_elf_object): New function.
4445 (Plugin_manager::in_claim_file_handler): New function.
4446 (Plugin_manager::in_claim_file_handler_): New member.
4447 (layout): New function.
4448 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4449 handler with an extra parameter. Make the elf object before calling
4451 * testsuite/plugin_test.c (get_section_count): New function pointer.
4452 (get_section_type): New function pointer.
4453 (get_section_name): New function pointer.
4454 (get_section_contents): New function pointer.
4455 (update_section_order): New function pointer.
4456 (allow_section_ordering): New function pointer.
4457 (onload): Check if the new interfaces exist.
4459 2011-07-13 Ian Lance Taylor <iant@google.com>
4461 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4463 * x86_64.cc (Target_x86_64::got_section): Likewise.
4464 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4465 (relro_now_test_SOURCES): New variable.
4466 (relro_now_test_DEPENDENCIES): New variable.
4467 (relro_now_test_LDFLAGS): New variable.
4468 (relro_now_test_LDADD): New variable.
4469 (relro_now_test.so): New target.
4470 * testsuite/Makefile.in: Rebuild.
4472 2011-07-12 Ian Lance Taylor <iant@google.com>
4475 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4476 GLOB_DAT relocation rather than a RELATIVE relocation for a
4477 protected symbol when creating a shared library.
4478 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4479 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4480 * testsuite/protected_main_1.cc (main): Test that protected
4481 function has same address.
4483 2011-07-11 Ian Lance Taylor <iant@google.com>
4486 * options.h (class General_options): Add -Bgroup.
4487 * options.cc (General_options::finalize): If -Bgroup is set,
4488 default to --unresolved-symbols=report-all.
4489 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4490 * target-reloc.h (issue_undefined_symbol_error): Handle
4491 --unresolved-symbols=report-all.
4493 2011-07-08 Ian Lance Taylor <iant@google.com>
4496 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4497 if linker script discards key sections.
4498 (Layout::create_dynamic_symtab): Likewise.
4499 (Layout::assign_local_dynsym_offsets): Likewise.
4500 (Layout::sized_create_version_sections): Likewise.
4501 (Layout::create_interp): Likewise.
4502 (Layout::finish_dynamic_section): Likewise.
4503 (Layout::set_dynamic_symbol_size): Likewise.
4505 2011-07-08 Ian Lance Taylor <iant@google.com>
4508 * options.h (class General_options): Add --unresolved-symbols.
4509 * target-reloc.h (issue_undefined_symbol_error): Check
4510 --unresolved-symbols. Add comments.
4512 2011-07-08 Ian Lance Taylor <iant@google.com>
4514 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4515 expression more complex.
4517 2011-07-08 Ian Lance Taylor <iant@google.com>
4520 * target-reloc.h (issue_undefined_symbol_error): New inline
4521 function, broken out of relocate_section.
4522 (relocate_section): Call issue_undefined_symbol_error.
4523 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4524 there is no TLS segment if we are about to issue an undefined
4526 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4528 2011-07-08 Ian Lance Taylor <iant@google.com>
4531 * resolve.cc (Symbol_table::should_override): Add fromtype
4532 parameter. Change all callers. Give error when linking together
4533 TLS and non-TLS symbol.
4534 (Symbol_table::should_override_with_special): Add fromtype
4535 parameter. Change all callers.
4536 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4537 there is no TLS segment if we have reported some errors.
4538 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4540 2011-07-08 Ian Lance Taylor <iant@google.com>
4543 * target.h (Target::plt_address_for_global): New function.
4544 (Target::plt_address_for_local): New function.
4545 (Target::plt_section_for_global): Remove.
4546 (Target::plt_section_for_local): Remove.
4547 (Target::do_plt_address_for_global): New virtual function.
4548 (Target::do_plt_address_for_local): New virtual function.
4549 (Target::do_plt_section_for_global): Remove.
4550 (Target::do_plt_section_for_local): Remove.
4551 (Target::register_global_plt_entry): Add Symbol_table and Layout
4553 * output.cc (Output_data_got::Got_entry::write): Use
4554 plt_address_for_global and plt_address_for_local.
4555 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4556 address of output section.
4557 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4558 got_irelative_, and irelative_count_ fields. Update
4560 (Output_data_plt_i386::has_irelative_section): New function.
4561 (Output_data_plt_i386::entry_count): Add irelative_count_.
4562 (Output_data_plt_i386::set_final_data_size): Likewise.
4563 (class Target_i386): Add got_irelative_ and rel_irelative_
4564 fields. Update declarations.
4565 (Target_i386::Target_i386): Initialize new fields.
4566 (Target_i386::do_plt_address_for_global): New function replacing
4567 do_plt_section_for_global.
4568 (Target_i386::do_plt_address_for_local): New function replacing
4569 do_plt_section_for_local.
4570 (Target_i386::got_section): Create got_irelative_.
4571 (Target_i386::rel_irelative_section): New function.
4572 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4573 fields. Don't define __rel_iplt_{start,end}.
4574 (Output_data_plt_i386::add_entry): Add symtab and layout
4575 parameters. Change all callers. Use different PLT and GOT for
4577 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4578 layout parameters. Change all callers. Use different PLT and
4580 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4581 (Output_data_plt_i386::rel_irelative): New function.
4582 (Output_data_plt_i386::address_for_global): New function.
4583 (Output_data_plt_i386::address_for_local): New function.
4584 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4585 IRELATIVE GOT when changing IFUNC GOT entries.
4586 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4588 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4589 if we didn't create an IRELATIVE GOT.
4590 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4591 plt_address_for_local.
4592 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4593 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4594 got_irelative_, and irelative_count_ fields. Update
4596 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4597 Initialize new fields. Remove symtab parameter. Change all
4599 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4601 (Output_data_plt_x86_64::has_irelative_section): New function.
4602 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4603 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4604 fields. Update declarations.
4605 (Target_x86_64::Target_x86_64): Initialize new fields.
4606 (Target_x86_64::do_plt_address_for_global): New function replacing
4607 do_plt_section_for_global.
4608 (Target_x86_64::do_plt_address_for_local): New function replacing
4609 do_plt_section_for_local.
4610 (Target_x86_64::got_section): Create got_irelative_.
4611 (Target_x86_64::rela_irelative_section): New function.
4612 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4613 all callers. Don't create __rel_iplt_{start,end}.
4614 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4615 parameters. Change all callers. Use different PLT and GOT for
4617 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4618 layout parameters. Change all callers. Use different PLT and
4620 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4621 parameters. Change all callers. Use different PLT and GOT for
4623 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4624 (Output_data_plt_x86_64::rela_irelative): New function.
4625 (Output_data_plt_x86_64::address_for_global): New function.
4626 (Output_data_plt_x86_64::address_for_local): New function.
4627 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4628 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4629 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4630 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4632 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4634 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4635 symbols if we didn't create an IRELATIVE GOT.
4636 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4637 plt_address_for_local.
4638 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4639 * testsuite/ifuncvar1.c: New test file.
4640 * testsuite/ifuncvar2.c: New test file.
4641 * testsuite/ifuncvar3.c: New test file.
4642 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4643 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4644 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4645 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4646 * testsuite/Makefile.in: Rebuild.
4648 2011-07-07 Cary Coutant <ccoutant@google.com>
4650 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4651 (two_file_test_1_ndebug.o): Likewise.
4652 (two_file_test_1b_ndebug.o): Likewise.
4653 (two_file_test_2_ndebug.o): Likewise.
4654 (two_file_test_main_ndebug.o): Likewise.
4655 (incremental_test_2): Link with no-debug versions.
4657 2011-07-06 Cary Coutant <ccoutant@google.com>
4659 * gold/incremental.cc
4660 (Output_section_incremental_inputs::write_info_blocks): Check for
4661 hidden and internal symbols.
4663 2011-07-06 Cary Coutant <ccoutant@google.com>
4665 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4666 Check disposition for startup file.
4667 (Incremental_inputs::report_command_line): Ignore
4668 --incremental-startup-unchanged option.
4669 * options.cc (General_options::parse_incremental_startup_unchanged):
4671 (General_options::General_options): Initialize new data member.
4672 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4673 (General_options): Add --incremental-startup-unchanged option.
4674 (General_options::incremental_startup_disposition): New function.
4675 (General_options::incremental_startup_disposition_): New data member.
4677 2011-07-06 Cary Coutant <ccoutant@google.com>
4679 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4680 input file index to Script_info ctor.
4681 (Sized_incremental_binary::do_file_has_changed): Find the
4682 command-line argument for files named in scripts.
4683 * incremental.h (Script_info::Script_info): New ctor
4684 with input file index.
4685 (Script_info::input_file_index): New function.
4686 (Script_info::input_file_index_): New data member.
4687 (Incremental_binary::get_library): Add const.
4688 (Incremental_binary::get_script_info): Add const.
4689 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4690 * testsuite/Makefile.am (incremental_test_5): New test case.
4691 (incremental_test_6): New test case.
4692 * testsuite/Makefile.in: Regenerate.
4694 2011-07-06 Cary Coutant <ccoutant@google.com>
4696 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4697 debug output when command lines differ.
4699 2011-07-06 Cary Coutant <ccoutant@google.com>
4701 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4702 --incremental-patch option.
4703 * layout.cc (Free_list::allocate): Extend allocation beyond original
4705 (Layout::make_output_section): Mark sections that should get
4707 * options.cc (parse_percent): New function.
4708 * options.h (parse_percent): New function.
4709 (DEFINE_percent): New macro.
4710 (General_options): Add --incremental-patch option.
4711 * output.cc (Output_section::Output_section): Initialize new data
4713 (Output_section::add_input_section): Print section name when out
4715 (Output_section::add_output_section_data): Likewise.
4716 (Output_section::set_final_data_size): Add patch space when
4717 doing --incremental-full.
4718 (Output_section::do_reset_address_and_file_offset): Remove patch
4720 (Output_segment::set_section_list_addresses): Print debug output
4721 only if --incremental-update.
4722 * output.h (Output_section::set_is_patch_space_allowed): New function.
4723 (Output_section::is_patch_space_allowed_): New data member.
4724 (Output_section::patch_space_): New data member.
4725 * parameters.cc (Parameters::incremental_full): New function.
4726 * parameters.h (Parameters::incremental_full): New function
4727 * testsuite/Makefile.am (incremental_test_2): Add test for
4728 --incremental-patch option.
4729 * testsuite/Makefile.in: Regenerate.
4730 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4731 (t18): Remove function body.
4733 2011-07-05 Doug Kwan <dougkwan@google.com>
4736 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4737 Arm_Address type for relocation result.
4738 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4740 (Arm_relocate_functions::abs32): Use unaligned access.
4741 (Arm_relocate_functions::rel32): Ditto.
4742 (Arm_relocate_functions::prel31): Ditto.
4743 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4744 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4745 static data relocations.
4746 * testsuite/Makefile.in: Regnerate.
4747 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4749 2011-07-05 Ian Lance Taylor <iant@google.com>
4752 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4753 symbols if necessary.
4754 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4756 2011-07-05 Ian Lance Taylor <iant@google.com>
4759 * resolve.cc (Symbol::override_base_with_special): Simply override
4760 version with special symbol version, ignoring previous version.
4762 2011-07-05 Ian Lance Taylor <iant@google.com>
4764 * object.cc (Sized_relobj_file::include_section_group): Add
4765 information to comment about signature location.
4767 2011-07-02 Ian Lance Taylor <iant@google.com>
4770 * options.h (class General_options): Add -f and -F.
4771 * options.cc (General_options::finalize): Fatal error if -f/-F
4772 are used without -shared.
4773 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4775 2011-07-02 Ian Lance Taylor <iant@google.com>
4777 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4779 2011-07-01 Ian Lance Taylor <iant@google.com>
4783 * resolve.cc (Symbol::override_base_with_special): Don't override
4784 the version if the overriding symbol has a different name.
4785 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4786 all callers. If we give an error about an undefined version,
4787 define the base version if necessary.
4788 * dynobj.h (class Versions): Update declaration.
4789 * testsuite/weak_alias_test_5.cc: New file.
4790 * testsuite/weak_alias_test.script: New file.
4791 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4792 and versioned_alias have the right value, and call t2.
4793 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4794 weak_alias_test_5.so.
4795 (weak_alias_test_LDADD): Likewise.
4796 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4797 * testsuite/Makefile.in: Rebuild.
4799 2011-07-01 Ian Lance Taylor <iant@google.com>
4802 * options.h (class General_options): Support -z notext.
4803 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4805 (two_file_shared_nonpic.so): Likewise.
4806 (two_file_shared_mixed.so): Likewise.
4807 (two_file_shared_mixed_1.so): Likewise.
4808 (weak_undef_lib_nonpic.so): Likewise.
4809 (alt/weak_undef_lib_nonpic.so): Likewise.
4810 (tls_test_shared_nonpic.so): Likewise.
4811 * testsuite/Makefile.in: Rebuild.
4813 2011-07-01 Ian Lance Taylor <iant@google.com>
4816 * configure.ac: Test whether static linking works, setting
4817 the automake conditional HAVE_STATIC.
4818 * testsuite/Makefile.am: Disable tests using -static if
4819 HAVE_STATIC is not true.
4820 * configure, testsuite/Makefile.in: Rebuild.
4822 2011-07-01 Ian Lance Taylor <iant@google.com>
4825 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4826 Assert if we see DW_EH_PE_indirect.
4827 * target.h (Target::ehframe_datarel_base): New function.
4828 (Target::do_ehframe_datarel_base): New target function.
4829 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4830 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4833 2011-07-01 Ian Lance Taylor <iant@google.com>
4836 * options.h (class General_options): Add
4837 --ld-generated-unwind-info.
4838 * ehframe.cc (Fde::write): Add address parameter. Change all
4839 callers. If associated with PLT, fill in address and size.
4840 (Cie::set_output_offset): Only add merge mapping if there is an
4842 (Cie::write): Add address parameter. Change all callers.
4843 (Eh_frame::add_ehframe_for_plt): New function.
4844 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4845 input_offset_ fields into union u_, with new plt field.
4846 (Fde::Fde): Adjust for new union field.
4847 (Fde::Fde) [Output_data version]: New constructor.
4848 (Fde::add_mapping): Only add merge mapping if there is an object.
4849 (class Cie): Update declarations.
4850 (class Eh_frame): Declare add_ehframe_for_plt.
4851 * layout.cc (Layout::layout_eh_frame): Break out code into
4852 make_eh_frame_section, and call it.
4853 (Layout::make_eh_frame_section): New function.
4854 (Layout::add_eh_frame_for_plt): New function.
4855 * layout.h (class Layout): Update declarations.
4856 * merge.cc (Merge_map::add_mapping): Add assertion.
4857 * i386.cc: Include "dwarf.h".
4858 (class Output_data_plt_i386): Make first_plt_entry,
4859 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4860 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4861 and plt_eh_frame_fde.
4862 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4863 boundary. Call add_eh_frame_for_plt if appropriate.
4864 * x86_64.cc: Include "dwarf.h".
4865 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4866 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4867 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4868 and plt_eh_frame_fde.
4869 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4872 2011-06-29 Ian Lance Taylor <iant@google.com>
4875 * object.cc (Sized_relobj_file::layout_section): Change shdr
4876 parameter to be const.
4877 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4879 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4880 appropriate. Call layout_eh_frame_section.
4881 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4883 * object.h (class Sized_relobj_file): Update declarations.
4885 2011-06-29 Ian Lance Taylor <iant@google.com>
4888 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4890 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4892 2011-06-29 Ian Lance Taylor <iant@google.com>
4895 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4897 * layout.cc (Layout::layout_eh_frame): Likewise.
4899 2011-06-29 Ian Lance Taylor <iant@google.com>
4902 * layout.cc (Layout::symtab_section_shndx): New function.
4903 * layout.h (class Layout): Declare symtab_section_shndx.
4904 * output.cc (Output_section::write_header): Call it.
4906 2011-06-29 Ian Lance Taylor <iant@google.com>
4909 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4910 symbols which are not used in a relocation.
4912 2011-06-28 Ian Lance Taylor <iant@google.com>
4915 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4916 script create indistinguishable segments.
4917 (Layout::set_segment_offsets): Use stable_sort when sorting
4918 segments. Pass this to Compare_segments constructor.
4919 * layout.h (class Layout): Make segment_precedes non-static.
4920 (class Compare_segments): Change from struct to class. Add
4921 layout_ field. Add constructor.
4922 * script-sections.cc
4923 (Script_sections::attach_sections_using_phdrs_clause): Rename
4924 local orphan to is_orphan. Don't report failure to put empty
4925 section in segment. On attachment failure, report name of
4926 section, and attach to first PT_LOAD segment.
4928 2011-06-28 Ian Lance Taylor <iant@google.com>
4931 * target-select.cc (Target_selector::Target_selector): Add
4932 emulation parameter. Change all callers.
4933 (select_target_by_bfd_name): Rename from select_target_by_name.
4935 (select_target_by_emulation): New function.
4936 (supported_emulation_names): New function.
4937 * target-select.h (class Target_selector): Add emulation_ field.
4938 Update declarations.
4939 (Target_selector::recognize_by_bfd_name): Rename from
4940 recognize_by_name. Change all callers.
4941 (Target_selector::supported_bfd_names): Rename from
4942 supported_names. Change all callers.
4943 (Target_selector::recognize_by_emulation): New function.
4944 (Target_selector::supported_emulations): New function.
4945 (Target_selector::emulation): New function.
4946 (Target_selector::do_recognize_by_bfd_name): Rename from
4947 do_recognize_by_name. Change all callers.
4948 (Target_selector::do_supported_bfd_names): Rename from
4949 do_supported_names. Change all callers.
4950 (Target_selector::do_recognize_by_emulation): New function.
4951 (Target_selector::do_supported_emulations): New function.
4952 (select_target_by_bfd_name): Change name in declaration.
4953 (select_target_by_emulation): Declare.
4954 (supported_emulation_names): Declare.
4955 * parameters.cc (parameters_force_valid_target): Try to find
4956 target based on emulation from -m option.
4957 * options.h (class General_options): Change doc string for -m.
4958 * options.cc (help): Print emulations.
4959 (General_options::parse_V): Likewise.
4960 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4961 Add emulation parameter. Change all callers.
4963 2011-06-28 Ian Lance Taylor <iant@google.com>
4965 * target.h (class Target): Add osabi_ field.
4966 (Target::osabi): New function.
4967 (Target::set_osabi): New function.
4968 (Target::Target): Initialize osabi_.
4969 (Target::do_adjust_elf_header): Make pure virtual.
4970 (Sized_target::do_adjust_elf_header): Declare.
4971 * target.cc (Sized_target::do_adjust_elf_header): New function.
4972 (class Sized_target): Instantiate all versions.
4973 * freebsd.h (class Target_freebsd): Remove.
4974 (Target_selector_freebsd::do_recognize): Call set_osabi on
4976 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4977 (Target_selector_freebsd::set_osabi): Remove.
4978 * i386.cc (class Target_i386): Inherit from Sized_target rather
4979 than Target_freebsd.
4980 * x86_64.cc (class Target_x86_64): Likewise.
4982 2011-06-28 Ian Lance Taylor <iant@google.com>
4984 * target.h (Target::can_check_for_function_pointers): Rewrite.
4986 (Target::can_icf_inline_merge_sections): Likewise.
4987 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4988 (Target::Target_info): Add can_icf_inline_merge_sections field.
4989 (Target::do_can_check_for_function_pointers): New virtual
4991 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4992 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4993 from can_check_for_function_pointers, move in file.
4994 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4995 section_may_have_icf_unsafe_poineters, move in file.
4996 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4997 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4998 Rename from can_check_for_function_pointers, move in file.
4999 (Target_i386::can_icf_inline_merge_sections): Remove.
5000 (Target_i386::i386_info): Initialize
5001 can_icf_inline_merge_sections.
5002 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5003 Initialize can_icf_inline_merge_sections.
5004 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5005 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5006 Rename from can_check_for_function_pointers, move in file.
5007 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5008 (Target_x86_64::x86_64_info): Initialize
5009 can_icf_inline_merge_sections.
5010 * testsuite/testfile.cc (Target_test::test_target_info):
5012 * icf.cc (get_section_contents): Correct formatting.
5014 2011-06-27 Ian Lance Taylor <iant@google.com>
5016 * symtab.cc (Symbol::versioned_name): New function.
5017 (Symbol_table::add_to_final_symtab): Use versioned_name when
5019 (Symbol_table::sized_write_symbol): Likewise.
5020 * symtab.h (class Symbol): Declare versioned_name.
5021 * stringpool.h (class Stringpool_template): Add variant of add
5022 which takes a std::basic_string.
5023 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5024 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5025 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5026 (ver_test_12.o): New target.
5027 * testsuite/Makefile.in: Rebuild.
5029 2011-06-27 Doug Kwan <dougkwan@google.com>
5031 * arm.cc (Arm_relocate_functions::thm_jump8,
5032 Arm_relocate_functions::thm_jump11): Use a wider signed
5033 type to compute offset.
5034 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5036 * testsuite/Makefile.in: Regenerate.
5037 * testsuite/arm_branch_in_range.sh: Check test results of
5038 arm_thm_jump11 and arm_thm_jump8.
5039 * testsuite/arm_thm_jump11.s: New test source file.
5040 * testsuite/arm_thm_jump11.t: New linker script.
5041 * testsuite/arm_thm_jump8.s: New test source file.
5042 * testsuite/arm_thm_jump8.t: New linker script.
5044 2011-06-24 Ian Lance Taylor <iant@google.com>
5046 * layout.cc: Include "object.h".
5047 (ctors_sections_in_init_array): New static variable.
5048 (Layout::is_ctors_in_init_array): New function.
5049 (Layout::layout): Add entry to ctors_sections_in_init_array if
5051 * layout.h (class Layout): Declare is_ctors_in_init_array.
5052 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5053 is_ctors_reverse_view is set.
5054 (Sized_relobj_file::write_sections): Add layout parameter. Change
5055 all callers. Set is_ctors_reverse_view field of View_size.
5056 (Sized_relobj_file::reverse_words): New function.
5057 * object.h (Sized_relobj_file::View_size): Add
5058 is_ctors_reverse_view field.
5059 (class Sized_relobj_file): Update declarations.
5060 * testsuite/initpri3.c: New test.
5061 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5063 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5064 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5065 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5066 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5067 * testsuite/Makefile.in: Rebuild.
5069 2011-06-24 Cary Coutant <ccoutant@google.com>
5071 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5072 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5073 (debug_msg_cdebug.err): New targets.
5074 * testsuite/Makefile.in: Regenerate.
5075 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5076 Fix checks for link with shared library.
5078 2011-06-24 Doug Kwan <dougkwan@google.com>
5080 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5081 skip empty text sections.
5082 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5084 2011-06-22 Ian Lance Taylor <iant@google.com>
5087 * options.h (class General_options): Add --ctors-in-init-array.
5088 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5089 friends as SHT_PROGBITS for merging sections.
5090 (Layout::layout): Remove special handling of .init_array and
5091 friends. Don't sort if doing relocatable link. Sort for .ctors
5092 and .dtors if ctors_in_init_array.
5093 (Layout::make_output_section): Force correct section types for
5094 .init_array and friends. Don't sort if doing relocatable link,
5095 Don't sort .ctors and .dtors if ctors_in_init_array.
5096 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5097 (Layout::output_section_name): Add relobj parameter. Change all
5098 callers. Handle .ctors. and .dtors. in code rather than table.
5099 Handle .ctors and .dtors if ctors_in_init_array.
5100 (Layout::match_file_name): New function, moved from output.cc.
5101 * layout.h (class Layout): Update declarations.
5102 * output.cc: Include "layout.h".
5103 (Input_section_sort_entry::get_priority): New function.
5104 (Input_section_sort_entry::match_file_name): Just call
5105 Layout::match_file_name.
5106 (Output_section::Input_section_sort_init_fini_compare::operator()):
5107 Handle .ctors and .dtors. Sort by explicit priority rather than
5109 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5110 * testsuite/initpri2.c: New test.
5111 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5112 (check_PROGRAMS): Add initpri2.
5113 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5114 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5115 * configure, testsuite/Makefile.in: Rebuild.
5117 2011-06-19 Ian Lance Taylor <iant@google.com>
5120 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5121 .interp section to a PT_INTERP segment even if we have seen a
5122 --dynamic-linker option. Don't do it if we have seen a PHDRS
5123 clause in a linker script.
5124 (Layout::finalize): Don't create a .interp section if we've
5125 already create a PT_INTERP segment.
5126 (Layout::create_interp): Always call choose_output_section (revert
5127 patch of 2011-06-17). Don't create PT_INTERP segment.
5128 * script-sections.cc
5129 (Script_sections::create_note_and_tls_segments): Add a .interp
5130 section to a PT_INTERP segment even if we have seen a
5131 --dynamic-linker option.
5133 2011-06-18 Ian Lance Taylor <iant@google.com>
5135 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5136 merely because a non-PT_LOAD segment has a dynamic reloc.
5138 2011-06-18 Ian Lance Taylor <iant@google.com>
5140 * layout.cc (Layout::finish_dynamic_section): Don't create
5141 DT_FLAGS entry if not needed.
5143 2011-06-18 Ian Lance Taylor <iant@google.com>
5146 * layout.cc (Layout::layout_eh_frame): Correct handling of
5147 writable .eh_frame section.
5149 2011-06-17 Ian Lance Taylor <iant@google.com>
5152 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5153 symbol is redefined with the exact same object and value.
5155 2011-06-17 Ian Lance Taylor <iant@google.com>
5158 * layout.h (class Layout): Add interp_segment_ field.
5159 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5160 (Layout::attach_allocated_section_to_segment): If making shared
5161 library, put .interp section in PT_INTERP segment.
5162 (Layout::finalize): Also call create_interp if -dynamic-linker
5164 (Layout::create_interp): Assert that there is no PT_INTERP
5165 segment. If not using a SECTIONS clause, use make_output_section.
5166 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5167 * script-sections.cc
5168 (Script_sections::create_note_and_tls_segments): If making shared
5169 library, put .interp section in PT_INTERP segment.
5171 2011-06-17 Ian Lance Taylor <iant@google.com>
5173 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5174 when making a shared library.
5176 2011-06-17 Ian Lance Taylor <iant@google.com>
5178 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5179 parameter. Change all callers. Don't issue warning about PC32
5180 against locally defined symbol.
5182 2011-06-16 Ian Lance Taylor <iant@google.com>
5184 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5185 occurs in same object.
5187 2011-06-14 Alan Modra <amodra@gmail.com>
5189 * po/POTFILES.in: Regenerate.
5191 2011-06-09 Ian Lance Taylor <iant@google.com>
5193 * script-sections.cc
5194 (Orphan_output_section::set_section_addresses): For a relocatable
5195 link set address to 0.
5197 2011-06-09 Cary Coutant <ccoutant@google.com>
5200 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5201 used with --compress-debug-sections.
5202 * gold/object.cc (Sized_relobj_file::do_layout): Report
5203 uncompressed size of compressed input sections.
5205 2011-06-08 Cary Coutant <ccoutant@google.com>
5208 * testsuite/two_file_test_2_v1.cc: Change initialization of
5209 v2 to keep it in .data.
5211 2011-06-07 Cary Coutant <ccoutant@google.com>
5213 * common.cc (Symbol_table::do_allocate_commons_list): Call
5215 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5216 (Errors::fallback): New function.
5217 (gold_fallback): New function.
5218 * errors.h (Errors::fallback): New function.
5219 * gold.cc (gold_exit): Change status parameter to enum; adjust
5221 (queue_initial_tasks): Call gold_fallback.
5222 * gold.h: Include cstdlib.
5223 (Exit_status): New enum type.
5224 (gold_exit): Change status parameter to enum.
5225 (gold_fallback): New function.
5226 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5227 (Layout::create_symtab_sections): Likewise.
5228 (Layout::create_shdrs): Likewise.
5229 * main.cc (main): Adjust call to gold_exit.
5230 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5231 (Output_data_got::add_got_entry_pair): Likewise.
5232 (Output_section::add_input_section): Likewise.
5233 (Output_section::add_output_section_data): Likewise.
5234 (Output_segment::set_section_list_addresses): Likewise.
5235 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5237 2011-06-07 Cary Coutant <ccoutant@google.com>
5239 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5240 for incremental links.
5241 * output.cc (Output_segment::set_section_list_addresses): Remove
5242 FIXME and test for TLS or BSS.
5244 2011-06-07 Cary Coutant <ccoutant@google.com>
5246 * testsuite/Makefile.am: Add incremental_copy_test,
5247 incremental_common_test_1.
5248 * testsuite/Makefile.in: Regenerate.
5249 * testsuite/common_test_1_v1.c: New source file.
5250 * testsuite/common_test_1_v2.c: New source file.
5251 * testsuite/copy_test_v1.cc: New source file.
5253 2011-06-07 Cary Coutant <ccoutant@google.com>
5255 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5256 update, allocate common from bss section's free list.
5257 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5258 linker-defined symbols.
5259 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5260 Skip GOT and PLT entries that are no longer referenced.
5261 (Output_section_incremental_inputs::write_info_blocks): Mark
5262 linker-defined symbols.
5263 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5264 * output.cc (Output_section::allocate): New function.
5265 * output.h (Output_section::allocate): New function.
5266 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5267 linker-defined symbols.
5268 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5269 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5270 (Symbol::init_base_output_data): Likewise.
5271 (Symbol::init_base_output_segment): Likewise.
5272 (Symbol::init_base_constant): Likewise.
5273 (Sized_symbol::init_output_data): Likewise.
5274 (Sized_symbol::init_output_segment): Likewise.
5275 (Sized_symbol::init_constant): Likewise.
5276 (Symbol_table::do_define_in_output_data): Likewise.
5277 (Symbol_table::do_define_in_output_segment): Likewise.
5278 (Symbol_table::do_define_as_constant): Likewise.
5279 * symtab.h (Symbol::is_predefined): New function.
5280 (Symbol::init_base_output_data): Add is_predefined parameter.
5281 (Symbol::init_base_output_segment): Likewise.
5282 (Symbol::init_base_constant): Likewise.
5283 (Symbol::is_predefined_): New data member.
5284 (Sized_symbol::init_output_data): Add is_predefined parameter.
5285 (Sized_symbol::init_output_segment): Likewise.
5286 (Sized_symbol::init_constant): Likewise.
5287 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5289 2011-06-07 Cary Coutant <ccoutant@google.com>
5291 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5292 instead of emit_copy_reloc.
5293 (Copy_relocs::emit_copy_reloc): Refactor.
5294 (Copy_relocs::make_copy_reloc): New function.
5295 (Copy_relocs::add_copy_reloc): Remove.
5296 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5298 (Copy_relocs::make_copy_reloc): New function.
5299 (Copy_relocs::add_copy_reloc): Remove.
5300 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5301 unchanged input files.
5302 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5303 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5304 Reserve BSS space for COPY relocations.
5305 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5306 (Output_section_incremental_inputs::write_info_blocks): Record
5307 whether a symbol is copied from a shared object.
5308 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5309 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5310 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5311 (Incremental_input_entry_reader::get_output_symbol_index): Add
5313 (Incremental_binary::emit_copy_relocs): New function.
5314 (Incremental_binary::do_emit_copy_relocs): New function.
5315 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5317 (Sized_incremental_binary::add_copy_reloc): New function.
5318 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5319 (Sized_incremental_binary::Copy_reloc): New struct.
5320 (Sized_incremental_binary::Copy_relocs): New typedef.
5321 (Sized_incremental_binary::copy_relocs_): New data member.
5322 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5323 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5324 * target.h (Sized_target::emit_copy_reloc): New function.
5325 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5327 2011-06-02 Cary Coutant <ccoutant@google.com>
5330 * gold/archive.cc (Archive::Archive): Initialize new data member.
5331 (Archive::include_all_members): Return if archive has already been
5333 * gold/archive.h (Archive::include_all_members_): New data member.
5335 2011-06-02 Nick Clifton <nickc@redhat.com>
5337 * dynobj.h: Fix spelling mistake in comment.
5338 * output.cc: Likewise.
5340 2011-05-31 Doug Kwan <dougkwan@google.com>
5344 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5345 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5346 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5347 redundant arm_exidx_test.so.
5348 * testsuite/Makefile.in: Regenerate.
5349 (check_SCRIPTS): Add pr12826.sh
5350 (check_DATA): Add pr12826.stdout
5351 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5352 * testsuite/pr12826.sh: New file.
5353 * testsuite/pr12826_1.s: Ditto.
5354 * testsuite/pr12826_1.s: Ditto.
5356 2011-05-30 Ian Lance Taylor <iant@google.com>
5358 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5361 2011-05-29 Ian Lance Taylor <iant@google.com>
5364 * testsuite/Makefile.am: Use different file name for two_file_test
5365 temporary file for each incremental test.
5366 * testsuite/Makefile.in: Rebuild.
5368 2011-05-29 Ian Lance Taylor <iant@google.com>
5370 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5371 binary input file is empty.
5373 2011-05-27 Ian Lance Taylor <iant@google.com>
5375 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5376 (ver_test_9.so): Likewise.
5377 * testsuite/Makefile.in: Rebuild.
5379 2011-05-26 Cary Coutant <ccoutant@google.com>
5381 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5382 * incremental.cc (Incremental_inputs::report_input_section): Fix
5383 comment, indentation.
5384 (Incremental_inputs::report_comdat_group): New function.
5385 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5386 of data for incremental input file entry.
5387 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5388 group count, COMDAT group signatures.
5389 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5390 an unchanged input file.
5391 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5392 Initialize new data member.
5393 (Incremental_object_entry::add_comdat_group): New function.
5394 (Incremental_object_entry::get_comdat_group_count): New function.
5395 (Incremental_object_entry::get_comdat_signature_key): New function.
5396 (Incremental_object_entry::groups_): New data member.
5397 (Incremental_inputs::report_comdat_group): New function.
5398 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5399 data for incremental input file entry.
5400 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5401 (Incremental_input_entry_reader::get_input_section): Adjust size of
5402 data for incremental input file entry.
5403 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5404 (Incremental_input_entry_reader::get_comdat_group_signature): New
5406 * object.cc (Sized_relobj::include_section_group): Report kept
5407 COMDAT groups for incremental links.
5409 2011-05-24 David Meyer <pdox@google.com>
5411 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5412 with name parameter. Add found_name parameter.
5413 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5414 * dirsearch.h (class Dirsearch): Update declaration.
5416 2011-05-24 Ian Lance Taylor <iant@google.com>
5418 * archive.cc (Library_base::should_include_member): Pull in object
5419 from archive if it defines the entry symbol.
5420 * parameters.cc (Parameters::entry): New function.
5421 * parameters.h (class Parameters): Declare entry.
5422 * output.h (class Output_file_header): Remove entry_ field.
5423 * output.cc (Output_file_header::Output_file_header): Remove entry
5424 parameter. Change all callers.
5425 (Output_file_header::entry): Use parameters->entry.
5426 * gold.cc (queue_middle_tasks): Likewise.
5427 * plugin.cc (Plugin_hook::run): Likewise.
5429 2011-05-24 Cary Coutant <ccoutant@google.com>
5431 * gold.cc (queue_initial_tasks): Pass incremental base filename
5432 to Output_file::open_base_file; don't print error message.
5433 * incremental-dump.cc (main): Adjust call to
5434 Output_file::open_for_modification.
5435 * incremental-dump.cc (main): Likewise.
5436 * incremental.cc (Incremental_inputs::report_command_line):
5437 Ignore --incremental-base option when comparing command lines.
5438 Ignore parameter when given as separate argument.
5439 * options.h (class General_options): Add --incremental-base.
5440 * output.cc (Output_file::Output_file):
5441 (Output_file::open_base_file): Add base_name and writable parameters;
5442 read base file into new file; print error message here.
5443 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5445 * output.h (Output_file::open_for_modification): Rename to...
5446 (Output_file::open_base_file): ...this; add base_name and
5447 writable parameters; adjust all callers.
5448 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5450 * testsuite/Makefile.am (incremental_test_4): Test
5452 * testsuite/Makefile.in: Regenerate.
5454 2011-05-24 Cary Coutant <ccoutant@google.com>
5456 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5458 * testsuite/Makefile.in: Regenerate.
5459 * testsuite/two_file_test_1_v1.cc: New test source file.
5460 * testsuite/two_file_test_1b_v1.cc: New test source file.
5461 * testsuite/two_file_test_2_v1.cc: New test source file.
5463 2011-05-24 Cary Coutant <ccoutant@google.com>
5465 * dynobj.h (Dynobj::do_dynobj): New function.
5466 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5467 flag and soname for shared objects.
5468 * incremental.cc (Incremental_inputs::report_object): Make
5469 either Incremental_object_entry or Incremental_dynobj_entry; add
5470 soname to string table.
5471 (Incremental_inputs::report_input_section): Add assertion.
5472 (Output_section_incremental_inputs::set_final_data_size): Adjust
5473 type of input file entry for shared libraries; adjust size of
5474 shared library info entry.
5475 (Output_section_incremental_inputs::write_input_files): Write
5476 as_needed flag for shared libraries.
5477 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5478 of input file entry for shared libraries; write soname.
5479 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5480 soname from incremental info.
5481 * incremental.h (enum Incremental_input_flags): Add
5482 INCREMENTAL_INPUT_AS_NEEDED.
5483 (Incremental_input_entry::Incremental_input_entry): Initialize new
5485 (Incremental_input_entry::set_as_needed): New function.
5486 (Incremental_input_entry::as_needed): New function.
5487 (Incremental_input_entry::do_dynobj_entry): New function.
5488 (Incremental_input_entry::as_needed_): New data member.
5489 (Incremental_object_entry::Incremental_object_entry): Don't check
5491 (Incremental_object_entry::do_type): Likewise.
5492 (class Incremental_dynobj_entry): New class.
5493 (Incremental_input_entry_reader::as_needed): New function.
5494 (Incremental_input_entry_reader::get_soname): New function.
5495 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5496 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5497 size of shared library info entry.
5498 * layout.cc (Layout::finish_dynamic_section): Don't test for
5499 incremental link when adding DT_NEEDED entries.
5500 * object.h (Object::Object): Initialize new data member.
5501 (Object::dynobj): New function.
5502 (Object::set_as_needed): New function.
5503 (Object::as_needed): New function.
5504 (Object::do_dynobj): New function.
5505 (Object::as_needed_): New data member.
5507 2011-05-24 Cary Coutant <ccoutant@google.com>
5509 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5510 info; adjust display of GOT entries.
5511 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5512 vector of input objects; remove file_status_.
5513 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5514 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5515 got_plt reader; call target hooks to reserve GOT entries.
5516 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5517 of input file info header and GOT info entry.
5518 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5520 (Got_plt_view_info::got_descriptor): Remove.
5521 (Got_plt_view_info::sym_index): New data member.
5522 (Got_plt_view_info::input_index): New data member.
5523 (Local_got_offset_visitor::visit): Write input file index.
5524 (Global_got_offset_visitor::visit): Write 0 for input file index.
5525 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5526 with sym_index and input_index.
5527 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5528 incremental info GOT entry; replace got_descriptor with input_index.
5529 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5530 map from input file index to object.
5531 (Sized_relobj_incr::do_layout): Replace direct data member reference
5532 with accessor function.
5533 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5534 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5535 Adjust size of input file info header.
5536 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5537 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5538 (Incremental_input_entry_reader::get_input_section): Adjust size of
5539 input file info header.
5540 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5541 of incremental info GOT entry.
5542 (Incremental_got_plt_reader::get_got_desc): Remove.
5543 (Incremental_got_plt_reader::get_got_symndx): New function.
5544 (Incremental_got_plt_reader::get_got_input_index): New function.
5545 (Sized_incremental_binary::Sized_incremental_binary): Remove
5546 file_status_; add input_objects_.
5547 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5548 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5549 (Sized_incremental_binary::file_is_unchanged): Remove.
5550 (Sized_incremental_binary::set_input_object): New function.
5551 (Sized_incremental_binary::input_object): New function.
5552 (Sized_incremental_binary::file_status_): Remove.
5553 (Sized_incremental_binary::input_objects_): New data member.
5554 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5556 (Sized_relobj_incr::invalid_address): Move to base class.
5557 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5559 (Sized_relobj_incr::do_output_section_offset): Likewise.
5560 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5561 (Sized_relobj_incr::section_offsets_): Likewise.
5562 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5564 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5565 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5566 with accessor function.
5567 (Sized_relobj_file::do_layout): Likewise.
5568 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5569 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5570 (Sized_relobj_file::compute_final_local_value): Replace refs to
5571 section_offsets_ with accessor function.
5572 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5573 * object.h (Relobj::Relobj): Initialize new data members.
5574 (Relobj::add_dyn_reloc): New function.
5575 (Relobj::first_dyn_reloc): New function.
5576 (Relobj::dyn_reloc_count): New function.
5577 (Relobj::first_dyn_reloc_): New data member.
5578 (Relobj::dyn_reloc_count_): New data member.
5579 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5581 (Sized_relobj::Address): New typedef.
5582 (Sized_relobj::invalid_address): Move here from child class.
5583 (Sized_relobj::Sized_relobj): Initialize new data members.
5584 (Sized_relobj::sized_relobj): New function.
5585 (Sized_relobj::is_output_section_offset_invalid): Move here from
5587 (Sized_relobj::get_output_section_offset): Likewise.
5588 (Sized_relobj::local_has_got_offset): Likewise.
5589 (Sized_relobj::local_got_offset): Likewise.
5590 (Sized_relobj::set_local_got_offset): Likewise.
5591 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5592 (Sized_relobj::clear_got_offsets): New function.
5593 (Sized_relobj::section_offsets): Move here from child class.
5594 (Sized_relobj::do_output_section_offset): Likewise.
5595 (Sized_relobj::do_set_section_offset): Likewise.
5596 (Sized_relobj::Local_got_offsets): Likewise.
5597 (Sized_relobj::local_got_offsets_): Likewise.
5598 (Sized_relobj::section_offsets_): Likewise.
5599 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5601 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5603 (Sized_relobj_file::sized_relobj): New function
5604 (Sized_relobj_file::local_has_got_offset): Move to base class.
5605 (Sized_relobj_file::local_got_offset): Likewise.
5606 (Sized_relobj_file::set_local_got_offset): Likewise.
5607 (Sized_relobj_file::get_output_section_offset): Likewise.
5608 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5609 (Sized_relobj_file::do_output_section_offset): Likewise.
5610 (Sized_relobj_file::do_set_section_offset): Likewise.
5611 (Sized_relobj_file::Local_got_offsets): Likewise.
5612 (Sized_relobj_file::local_got_offsets_): Likewise.
5613 (Sized_relobj_file::section_offsets_): Likewise.
5614 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5616 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5617 (Output_reloc::get_symbol_index): Likewise.
5618 (Output_reloc::local_section_offset): Likewise.
5619 (Output_reloc::get_address): Likewise.
5620 (Output_reloc::symbol_value): Likewise.
5621 (Output_data_got::reserve_slot): Move to class definition.
5622 (Output_data_got::reserve_local): New function.
5623 (Output_data_got::reserve_slot_for_global): Remove.
5624 (Output_data_got::reserve_global): New function.
5625 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5626 (all constructors, two instantiations).
5627 (Output_reloc::get_relobj): New function (two instantiations).
5628 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5629 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5630 (Output_data_reloc::add_global): Adjust type of relobj.
5631 (Output_data_reloc::add_global_relative): Likewise.
5632 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5633 (Output_data_reloc::add_local): Likewise.
5634 (Output_data_reloc::add_local_relative): Likewise.
5635 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5636 (Output_data_reloc::add_local_section): Likewise.
5637 (Output_data_reloc::add_output_section): Likewise.
5638 (Output_data_reloc::add_absolute): Likewise.
5639 (Output_data_reloc::add_target_specific): Likewise.
5640 (Output_data_got::reserve_slot): Move definition here.
5641 (Output_data_got::reserve_local): New function.
5642 (Output_data_got::reserve_global): New function.
5643 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5644 section_offsets_ with accessor function.
5645 (Sized_relobj_file::write_sections): Likewise.
5646 (Sized_relobj_file::do_relocate_sections): Likewise.
5647 * target.h (Sized_target::reserve_local_got_entry): New function.
5648 (Sized_target::reserve_global_got_entry): New function.
5649 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5650 (Target_x86_64::reserve_global_got_entry): New function.
5651 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5653 2011-05-23 Cary Coutant <ccoutant@google.com>
5655 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5656 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5657 bit when checking got_type.
5658 * incremental.cc (Sized_incremental_binary::setup_readers):
5659 Store symbol table and string table locations; initialize bit vector
5660 of file status flags.
5661 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5663 (Sized_incremental_binary::do_process_got_plt): New function.
5664 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5665 (Output_section_incremental_inputs::set_final_data_size): Record
5666 file index for each input file.
5667 (Output_section_incremental_inputs::write_got_plt): Store file index
5668 instead of input entry offset for each GOT entry.
5670 (Incremental_input_entry::Incremental_input_entry): Initialize new
5672 (Incremental_input_entry::set_offset): Store file index.
5673 (Incremental_input_entry::get_file_index): New function.
5674 (Incremental_input_entry::file_index_): New data member.
5675 (Incremental_binary::process_got_plt): New function.
5676 (Incremental_binary::do_process_got_plt): New function.
5677 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5679 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5680 (Sized_incremental_binary::set_file_is_unchanged): New function.
5681 (Sized_incremental_binary::file_is_unchanged): New function.
5682 (Sized_incremental_binary::do_process_got_plt): New function.
5683 (Sized_incremental_binary::file_status_): New data member.
5684 (Sized_incremental_binary::main_symtab_loc_): New data member.
5685 (Sized_incremental_binary::main_strtab_loc_): New data member.
5686 * output.cc (Output_data_got::Got_entry::write): Add case
5688 (Output_data_got::add_global): Call add_got_entry.
5689 (Output_data_got::add_global_plt): Likewise.
5690 (Output_data_got::add_global_with_rel): Likewise.
5691 (Output_data_got::add_global_with_rela): Likewise.
5692 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5693 (Output_data_got::add_global_pair_with_rela): Likewise.
5694 (Output_data_got::add_local): Call add_got_entry.
5695 (Output_data_got::add_local_plt): Likewise.
5696 (Output_data_got::add_local_with_rel): Likewise.
5697 (Output_data_got::add_local_with_rela): Likewise.
5698 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5699 (Output_data_got::add_local_pair_with_rela): Likewise.
5700 (Output_data_got::reserve_slot): New function.
5701 (Output_data_got::reserve_slot_for_global): New function.
5702 (Output_data_got::add_got_entry): New function.
5703 (Output_data_got::add_got_entry_pair): New function.
5704 (Output_section::add_output_section_data): Edit FIXME.
5706 (Output_section_data_build::Output_section_data_build): New
5707 constructor with size parameter.
5708 (Output_data_space::Output_data_space): Likewise.
5709 (Output_data_got::Output_data_got): Initialize new data member; new
5710 constructor with size parameter.
5711 (Output_data_got::add_constant): Call add_got_entry.
5712 (Output_data_got::reserve_slot): New function.
5713 (Output_data_got::reserve_slot_for_global): New function.
5714 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5715 (Output_data_got::add_got_entry): New function.
5716 (Output_data_got::add_got_entry_pair): New function.
5717 (Output_data_got::free_list_): New data member.
5718 * target.h (Sized_target::init_got_plt_for_update): New function.
5719 (Sized_target::register_global_plt_entry): New function.
5720 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5721 Initialize new data member; call init; add constructor with PLT count.
5722 (Output_data_plt_x86_64::init): New function.
5723 (Output_data_plt_x86_64::add_relocation): New function.
5724 (Output_data_plt_x86_64::reserve_slot): New function.
5725 (Output_data_plt_x86_64::free_list_): New data member.
5726 (Target_x86_64::init_got_plt_for_update): New function.
5727 (Target_x86_64::register_global_plt_entry): New function.
5728 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5729 incremental updates.
5730 (Output_data_plt_x86_64::add_relocation): New function.
5731 * testsuite/object_unittest.cc (Object_test): Set default options.
5733 2011-05-16 Ian Lance Taylor <iant@google.com>
5735 * options.h (class General_options): Make -i a synonym for -r.
5737 2011-05-16 Ian Lance Taylor <iant@google.com>
5739 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5741 2011-05-10 Cary Coutant <ccoutant@google.com>
5743 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5746 2011-05-06 Ian Lance Taylor <iant@google.com>
5748 * layout.cc (Layout::layout): If the output section flags change,
5749 update the ordering.
5751 2011-04-25 Cary Coutant <ccoutant@google.com>
5753 * incremental-dump.cc (dump_incremental_inputs): Print local
5754 symbol info for each input file.
5756 (Output_section_incremental_inputs::set_final_data_size): Add local
5757 symbol info to input file entries in incremental info.
5758 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5759 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5760 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5761 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5763 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5764 (Sized_incr_relobj::do_relocate): Write the local symbols.
5765 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5766 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5767 Adjust size of input file header.
5768 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5769 (Incremental_inputs_reader::get_local_symbol_count): New function.
5770 (Incremental_inputs_reader::get_input_section): Adjust size of input
5772 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5773 (Sized_incr_relobj::This): New typedef.
5774 (Sized_incr_relobj::sym_size): New const data member.
5775 (Sized_incr_relobj::Local_symbol): New struct.
5776 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5777 (Sized_incr_relobj::do_local_symbol_offset): New function.
5778 (Sized_incr_relobj::local_symbol_count_): New data member.
5779 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5780 (Sized_incr_relobj::local_symbol_index_): New data member.
5781 (Sized_incr_relobj::local_symbol_offset_): New data member.
5782 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5783 (Sized_incr_relobj::local_symbols_): New data member.
5784 * object.h (Relobj::output_local_symbol_count): New function.
5785 (Relobj::local_symbol_offset): New function.
5786 (Relobj::do_output_local_symbol_count): New function.
5787 (Relobj::do_local_symbol_offset): New function.
5788 (Sized_relobj::do_output_local_symbol_count): New function.
5789 (Sized_relobj::do_local_symbol_offset): New function.
5791 2011-04-22 Vladimir Simonov <sv@sw.ru>
5793 * descriptors.cc (set_close_on_exec): New function.
5794 (Descriptors::open): Use set_close_on_exec.
5795 * output.cc (S_ISLNK): Define if not defined.
5797 2011-04-22 Cary Coutant <ccoutant@google.com>
5799 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5801 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5802 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5803 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5805 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5806 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5807 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5809 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5811 (Incremental_binary::apply_incremental_relocs): New function.
5812 (Incremental_binary::do_apply_incremental_relocs): New function.
5813 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5815 (Sized_incremental_binary::add_global_symbol): New function.
5816 (Sized_incremental_binary::global_symbol): New function.
5817 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5818 (Sized_incremental_binary::symbol_map_): New data member.
5819 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5820 * target.h (Sized_target::apply_relocation): New function.
5821 * target-reloc.h (apply_relocation): New function.
5822 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5824 2011-04-22 Doug Kwan <dougkwan@google.com>
5826 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5827 flag of a SHT_ARM_EXIDX section.
5828 * testsuite/Makefile.am (arm_exidx_test): New test rules.
5829 * testsuite/Makefile.in: Regenerate.
5830 * testsuite/arm_exidx_test.s: New file.
5831 * testsuite/arm_exidx_test.sh: Same.
5833 2011-04-20 Cary Coutant <ccoutant@google.com>
5836 * archive.h (Incremental_archive_entry::Archive_member):
5837 Initialize arg_serial_ (second constructor).
5839 2011-04-17 Ian Lance Taylor <iant@google.com>
5841 * object.cc (Relocate_info::location): Simplify location string.
5842 * errors.cc (Errors::error_at_location): Don't print program
5844 (Errors::warning_at_location): Likewise.
5845 (Errors::undefined_symbol): Likewise.
5846 * testsuite/debug_msg.sh: Update accordingly.
5848 2011-04-14 Cary Coutant <ccoutant@google.com>
5850 * gold/layout.cc (Layout::symtab_section_offset): New function.
5851 * gold/layout.h (Layout::symtab_section_offset): New function.
5852 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5854 2011-04-12 Ian Lance Taylor <iant@google.com>
5856 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5857 with MREMAP_MAYMOVE.
5858 * output.h (class Output_file): Add map_is_allocated_ field.
5859 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5860 not available, provide stubs. If mremap is not available, #define
5862 (MREMAP_MAYMOVE): Define if not defined.
5863 (Output_file::Output_file): Initialize map_is_allocated_.
5864 (Output_file::resize): Check map_is_allocated_.
5865 (Output_file::map_anonymous): If mmap fails, use malloc.
5866 (Output_file::unmap): Don't do anything for an anonymous map.
5867 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5868 is not available, provide stubs.
5869 (File_read::View::~View): Use free rather than delete[].
5870 (File_read::make_view): Use malloc rather than new[]. If mmap
5872 (File_read::find_or_make_view): Use malloc rather than new[].
5873 * gold.h: Remove HAVE_REMAP code.
5874 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5875 exists. Rename mremap to gold_mremap. If mmap is not available
5877 * configure, config.in: Rebuild.
5879 2011-04-11 Ian Lance Taylor <iant@google.com>
5881 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5882 initialize local variable v.
5884 2011-04-11 Cary Coutant <ccoutant@google.com>
5886 * archive.cc (Archive::include_member): Adjust call to
5888 (Add_archive_symbols::run): Track argument serial numbers.
5889 (Lib_group::include_member): Likewise.
5890 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5891 * archive.h (Incremental_archive_entry::Archive_member):
5892 Initialize arg_serial_.
5893 (Archive_member::arg_serial_): New data member.
5894 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5895 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5897 (Sized_dynobj::do_for_all_local_got_entries): New function.
5898 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5900 * fileread.cc (get_mtime): New function.
5901 * fileread.h (get_mtime): New function.
5902 * gold.cc (queue_initial_tasks): Check for incremental update.
5903 (process_incremental_input): New function.
5904 (queue_middle_tasks): Don't force valid target for incremental
5906 * incremental-dump.cc (find_input_containing_global): Adjust
5907 size of symbol info entry.
5908 (dump_incremental_inputs): Dump argument serial number and
5909 in_system_directory flag; bias shndx by 1; print symbol names
5910 when dumping per-file symbol lists; use new symbol info readers.
5912 (Output_section_incremental_inputs:update_data_size): New function.
5913 (Sized_incremental_binary::setup_readers): Setup input readers
5914 for each input file; build maps for files added from libraries
5916 (Sized_incremental_binary::check_input_args): New function.
5917 (Sized_incremental_binary::do_check_inputs): Build map of argument
5918 serial numbers to input arguments.
5919 (Sized_incremental_binary::do_file_has_changed): Rename
5920 do_file_is_unchanged to this; compare file modification times.
5921 (Sized_incremental_binary::do_init_layout): New function.
5922 (Sized_incremental_binary::do_reserve_layout): New function.
5923 (Sized_incremental_binary::do_get_input_reader): Remove.
5924 (Sized_incremental_binary::get_symtab_view): New function.
5925 (Incremental_checker::can_incrementally_link_output_file): Remove.
5926 (Incremental_inputs::report_command_line): Exclude --debug options.
5927 (Incremental_inputs::report_archive_begin): Add parameter; track
5928 argument serial numbers; don't put input file entry for archive
5929 before archive members.
5930 (Incremental_inputs::report_archive_end): Put input file entry
5931 for archive after archive members.
5932 (Incremental_inputs::report_object): Add parameter; track argument
5933 serial numbers and in_system_directory flag.
5934 (Incremental_inputs::report_script): Add parameter; track argument
5936 (Output_section_incremental_inputs::set_final_data_size): Adjust
5937 size of symbol info entry; check for forwarding symbols.
5938 (Output_section_incremental_inputs::write_input_files): Write
5939 in_system_directory flag and argument serial number.
5940 (Output_section_incremental_inputs::write_info_blocks): Map section
5941 indices between incremental info and original input file; store
5942 input section index for each symbol.
5943 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5944 change operator() to visit().
5945 (class Global_got_offset_visitor): Likewise.
5946 (class Global_symbol_visitor_got_plt):
5947 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5949 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5950 (Sized_incr_relobj::do_read_symbols): New function.
5951 (Sized_incr_relobj::do_layout): New function.
5952 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5953 (Sized_incr_relobj::do_add_symbols): New function.
5954 (Sized_incr_relobj::do_should_include_member): New function.
5955 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5956 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5957 (Sized_incr_relobj::do_section_size): New function.
5958 (Sized_incr_relobj::do_section_name): New function.
5959 (Sized_incr_relobj::do_section_contents): New function.
5960 (Sized_incr_relobj::do_section_flags): New function.
5961 (Sized_incr_relobj::do_section_entsize): New function.
5962 (Sized_incr_relobj::do_section_address): New function.
5963 (Sized_incr_relobj::do_section_type): New function.
5964 (Sized_incr_relobj::do_section_link): New function.
5965 (Sized_incr_relobj::do_section_info): New function.
5966 (Sized_incr_relobj::do_section_addralign): New function.
5967 (Sized_incr_relobj::do_initialize_xindex): New function.
5968 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5969 (Sized_incr_relobj::do_read_relocs): New function.
5970 (Sized_incr_relobj::do_gc_process_relocs): New function.
5971 (Sized_incr_relobj::do_scan_relocs): New function.
5972 (Sized_incr_relobj::do_count_local_symbols): New function.
5973 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5974 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5975 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5976 (Sized_incr_relobj::do_relocate): New function.
5977 (Sized_incr_relobj::do_set_section_offset): New function.
5978 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5979 (Sized_incr_dynobj::do_read_symbols): New function.
5980 (Sized_incr_dynobj::do_layout): New function.
5981 (Sized_incr_dynobj::do_add_symbols): New function.
5982 (Sized_incr_dynobj::do_should_include_member): New function.
5983 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5984 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5985 (Sized_incr_dynobj::do_section_size): New function.
5986 (Sized_incr_dynobj::do_section_name): New function.
5987 (Sized_incr_dynobj::do_section_contents): New function.
5988 (Sized_incr_dynobj::do_section_flags): New function.
5989 (Sized_incr_dynobj::do_section_entsize): New function.
5990 (Sized_incr_dynobj::do_section_address): New function.
5991 (Sized_incr_dynobj::do_section_type): New function.
5992 (Sized_incr_dynobj::do_section_link): New function.
5993 (Sized_incr_dynobj::do_section_info): New function.
5994 (Sized_incr_dynobj::do_section_addralign): New function.
5995 (Sized_incr_dynobj::do_initialize_xindex): New function.
5996 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5997 (make_sized_incremental_object): New function.
5998 (Incremental_library::copy_unused_symbols): New function.
5999 (Incremental_library::do_for_all_unused_symbols): New function.
6000 * incremental.h (enum Incremental_input_flags): New type.
6001 (class Incremental_checker): Remove.
6002 (Incremental_input_entry::Incremental_input_entry): Add argument
6004 (Incremental_input_entry::arg_serial): New function.
6005 (Incremental_input_entry::set_is_in_system_directory): New function.
6006 (Incremental_input_entry::is_in_system_directory): New function.
6007 (Incremental_input_entry::arg_serial_): New data member.
6008 (Incremental_input_entry::is_in_system_directory_): New data member.
6009 (class Script_info): Move here from script.h.
6010 (Script_info::Script_info): Add filename parameter.
6011 (Script_info::filename): New function.
6012 (Script_info::filename_): New data member.
6013 (Incremental_script_entry::Incremental_script_entry): Add argument
6015 (Incremental_object_entry::Incremental_object_entry): Likewise.
6016 (Incremental_object_entry::add_input_section): Build list of input
6017 sections with map to original shndx.
6018 (Incremental_object_entry::get_input_section_index): New function.
6019 (Incremental_object_entry::shndx_): New data member.
6020 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6021 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6022 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6024 (Incremental_inputs::report_archive_begin): Likewise.
6025 (Incremental_inputs::report_object): Likewise.
6026 (Incremental_inputs::report_script): Likewise.
6027 (class Incremental_global_symbol_reader): New class.
6028 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6029 and store flags and input file type.
6030 (Incremental_input_entry_reader::arg_serial): New function.
6031 (Incremental_input_entry_reader::type): Extract type from flags.
6032 (Incremental_input_entry_reader::is_in_system_directory): New function.
6033 (Incremental_input_entry_reader::get_input_section_count): Call
6034 accessor function for type.
6035 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6036 function for type; adjust size of global symbol entry.
6037 (Incremental_input_entry_reader::get_global_symbol_count): Call
6038 accessor function for type.
6039 (Incremental_input_entry_reader::get_object_count): Likewise.
6040 (Incremental_input_entry_reader::get_object_offset): Likewise.
6041 (Incremental_input_entry_reader::get_member_count): Likewise.
6042 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6043 (Incremental_input_entry_reader::get_member_offset): Likewise.
6044 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6045 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6046 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6047 (Incremental_input_entry_reader::get_global_symbol_reader): New
6049 (Incremental_input_entry_reader::get_output_symbol_index): New
6051 (Incremental_input_entry_reader::type_): Remove.
6052 (Incremental_input_entry_reader::flags_): New data member.
6053 (Incremental_inputs_reader::input_file_offset): New function.
6054 (Incremental_inputs_reader::input_file_index): New function.
6055 (Incremental_inputs_reader::input_file): Call input_file_offset.
6056 (Incremental_inputs_reader::input_file_at_offset): New function.
6057 (Incremental_relocs_reader::get_r_type): Reformat.
6058 (Incremental_relocs_reader::get_r_shndx): Reformat.
6059 (Incremental_relocs_reader::get_r_offset): Reformat.
6060 (Incremental_relocs_reader::data): New function.
6061 (Incremental_binary::Incremental_binary): Initialize new data members.
6062 (Incremental_binary::check_inputs): Add cmdline parameter.
6063 (Incremental_binary::file_is_unchanged): Remove.
6064 (Input_reader::arg_serial): New function.
6065 (Input_reader::get_unused_symbol_count): New function.
6066 (Input_reader::get_unused_symbol): New function.
6067 (Input_reader::do_arg_serial): New function.
6068 (Input_reader::do_get_unused_symbol_count): New function.
6069 (Input_reader::do_get_unused_symbol): New function.
6070 (Incremental_binary::input_file_count): New function.
6071 (Incremental_binary::get_input_reader): Change signature to use
6072 index instead of filename.
6073 (Incremental_binary::file_has_changed): New function.
6074 (Incremental_binary::get_input_argument): New function.
6075 (Incremental_binary::get_library): New function.
6076 (Incremental_binary::get_script_info): New function.
6077 (Incremental_binary::init_layout): New function.
6078 (Incremental_binary::reserve_layout): New function.
6079 (Incremental_binary::output_file): New function.
6080 (Incremental_binary::do_check_inputs): New function.
6081 (Incremental_binary::do_file_is_unchanged): Remove.
6082 (Incremental_binary::do_file_has_changed): New function.
6083 (Incremental_binary::do_init_layout): New function.
6084 (Incremental_binary::do_reserve_layout): New function.
6085 (Incremental_binary::do_input_file_count): New function.
6086 (Incremental_binary::do_get_input_reader): Change signature.
6087 (Incremental_binary::input_args_map_): New data member.
6088 (Incremental_binary::library_map_): New data member.
6089 (Incremental_binary::script_map_): New data member.
6090 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6092 (Sized_incremental_binary::output_section): New function.
6093 (Sized_incremental_binary::inputs_reader): Add const.
6094 (Sized_incremental_binary::symtab_reader): Add const.
6095 (Sized_incremental_binary::relocs_reader): Add const.
6096 (Sized_incremental_binary::got_plt_reader): Add const.
6097 (Sized_incremental_binary::get_symtab_view): New function.
6098 (Sized_incremental_binary::Inputs_reader): New typedef.
6099 (Sized_incremental_binary::Input_entry_reader): New typedef.
6100 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6101 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6102 (Sized_incremental_binary::do_file_has_changed): New function.
6103 (Sized_incremental_binary::do_init_layout): New function.
6104 (Sized_incremental_binary::do_reserve_layout): New function.
6105 (Sized_input_reader::Inputs_reader): Remove.
6106 (Sized_input_reader::Input_entry_reader): Remove.
6107 (Sized_input_reader::do_arg_serial): New function.
6108 (Sized_input_reader::do_get_unused_symbol_count): New function.
6109 (Sized_input_reader::do_get_unused_symbol): New function.
6110 (Sized_incremental_binary::do_input_file_count): New function.
6111 (Sized_incremental_binary::do_get_input_reader): Change signature;
6112 use index instead of filename.
6113 (Sized_incremental_binary::section_map_): New data member.
6114 (Sized_incremental_binary::input_entry_readers_): New data member.
6115 (class Sized_incr_relobj): New class.
6116 (class Sized_incr_dynobj): New class.
6117 (make_sized_incremental_object): New function.
6118 (class Incremental_library): New class.
6119 * layout.cc (Free_list::num_lists): New static data member.
6120 (Free_list::num_nodes): New static data member.
6121 (Free_list::num_removes): New static data member.
6122 (Free_list::num_remove_visits): New static data member.
6123 (Free_list::num_allocates): New static data member.
6124 (Free_list::num_allocate_visits): New static data member.
6125 (Free_list::init): New function.
6126 (Free_list::remove): New function.
6127 (Free_list::allocate): New function.
6128 (Free_list::dump): New function.
6129 (Free_list::print_stats): New function.
6130 (Layout_task_runner::run): Resize output file for incremental updates.
6131 (Layout::Layout): Initialize new data members.
6132 (Layout::set_incremental_base): New function.
6133 (Layout::init_fixed_output_section): New function.
6134 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6135 incremental updates.
6136 (Layout::create_gold_note): Do not create gold note section for
6137 incremental updates.
6138 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6139 for incremental updates.
6140 (Layout::set_section_offsets): For incremental updates, allocate space
6142 (Layout::create_symtab_sections): Layout with offsets relative to
6143 start of section; for incremental updates, allocate space from free
6145 (Layout::create_shdrs): For incremental updates, allocate space from
6147 (Layout::finish_dynamic_section): For incremental updates, do not
6148 check --as-needed (fixed in subsequent patch).
6149 * layout.h (class Free_list): New class.
6150 (Layout::set_incremental_base): New function.
6151 (Layout::incremental_base): New function.
6152 (Layout::init_fixed_output_section): New function.
6153 (Layout::allocate): New function.
6154 (Layout::incremental_base_): New data member.
6155 (Layout::free_list_): New data member.
6156 * main.cc (main): Print Free_list statistics.
6157 * object.cc (Relobj::finalize_incremental_relocs): Add
6158 clear_counts parameter; clear counts only when clear_counts is set.
6159 (Sized_relobj::Sized_relobj): Initialize new base class.
6160 (Sized_relobj::do_layout): Don't report special sections.
6161 (Sized_relobj::do_for_all_local_got_entries): New function.
6162 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6163 symtab_off to all symbol table offsets.
6164 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6165 * object.h (class Got_offset_list): Move to top of file.
6166 (Object::Object): Allow case where input_file == NULL.
6167 (Object::~Object): Likewise.
6168 (Object::input_file): Assert that input_file != NULL.
6169 (Object::lock): Allow case where input_file == NULL.
6170 (Object::unlock): Likewise.
6171 (Object::is_locked): Likewise.
6172 (Object::token): Likewise.
6173 (Object::release): Likewise.
6174 (Object::is_incremental): New function.
6175 (Object::get_mtime): New function.
6176 (Object::for_all_local_got_entries): New function.
6177 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6178 (Object::set_is_in_system_directory): New function.
6179 (Object::is_in_system_directory): New function.
6180 (Object::do_is_incremental): New function.
6181 (Object::do_get_mtime): New function.
6182 (Object::do_for_all_local_got_entries): New function.
6183 (Object::is_in_system_directory_): New data member.
6184 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6185 (class Sized_relobj_base): New class.
6186 (class Sized_relobj): Derive from Sized_relobj_base.
6187 (class Sized_relobj::Symbols): Redeclare from base class.
6188 (class Sized_relobj::local_got_offset_list): Remove.
6189 (class Sized_relobj::Output_sections): Redeclare from base class.
6190 (class Sized_relobj::do_for_all_local_got_entries): New function.
6191 (class Sized_relobj::write_local_symbols): Add offset parameter.
6192 (class Sized_relobj::local_symbol_offset_): Update comment.
6193 (class Sized_relobj::local_dynsym_offset_): Update comment.
6194 * options.cc (Input_arguments::add_file): Remove const.
6195 * options.h (Input_file_argument::Input_file_argument):
6196 Initialize arg_serial_ (all constructors).
6197 (Input_file_argument::set_arg_serial): New function.
6198 (Input_file_argument::arg_serial): New function.
6199 (Input_file_argument::arg_serial_): New data member.
6200 (Input_arguments::Input_arguments): Initialize file_count_.
6201 (Input_arguments::add_file): Remove const.
6202 (Input_arguments::number_of_input_files): New function.
6203 (Input_arguments::file_count_): New data member.
6204 (Command_line::number_of_input_files): Call
6205 Input_arguments::number_of_input_files.
6206 * output.cc (Output_segment_headers::Output_segment_headers):
6208 (Output_section::Input_section::current_data_size): New function.
6209 (Output_section::Output_section): Initialize new data members.
6210 (Output_section::add_input_section): Don't do merge sections for
6211 an incremental link; allocate space from free list for an
6213 (Output_section::add_output_section_data): Allocate space from
6214 free list for an incremental update.
6215 (Output_section::update_data_size): New function.
6216 (Output_section::set_fixed_layout): New function.
6217 (Output_section::reserve): New function.
6218 (Output_segment::set_section_addresses): Remove const.
6219 (Output_segment::set_section_list_addresses): Remove const; allocate
6220 space from free list for an incremental update.
6221 (Output_segment::set_offset): Adjust size of RELRO segment for an
6223 * output.h (Output_data::current_data_size): Move here from
6225 (Output_data::pre_finalize_data_size): New function.
6226 (Output_data::update_data_size): New function.
6227 (Output_section_headers::update_data_size): new function.
6228 (Output_section_data_build::current_data_size): Move to Output_data.
6229 (Output_data_strtab::update_data_size): New function.
6230 (Output_section::current_data_size): Move to Output_data.
6231 (Output_section::set_fixed_layout): New function.
6232 (Output_section::has_fixed_layout): New function.
6233 (Output_section::reserve): New function.
6234 (Output_section::update_data_size): New function.
6235 (Output_section::has_fixed_layout_): New data member.
6236 (Output_section::free_list_): New data member.
6237 (Output_segment::set_section_addresses): Remove const.
6238 (Output_segment::set_section_list_addresses): Remove const.
6239 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6241 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6243 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6244 parameter when calling Add_symbols constructor; store argument
6245 serial number for members of a lib group.
6246 (Add_symbols::locks): Allow case where token == NULL.
6247 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6248 (Read_member::~Read_member): New function.
6249 (Read_member::is_runnable): New function.
6250 (Read_member::locks): New function.
6251 (Read_member::run): New function.
6252 (Check_script::~Check_script): New function.
6253 (Check_script::is_runnable): New function.
6254 (Check_script::locks): New function.
6255 (Check_script::run): New function.
6256 (Check_library::~Check_library): New function.
6257 (Check_library::is_runnable): New function.
6258 (Check_library::locks): New function.
6259 (Check_library::run): New function.
6260 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6261 (Add_symbols::library_): New data member.
6262 (class Read_member): New class.
6263 (class Check_script): New class.
6264 (class Check_library): New class.
6265 * reloc.cc (Read_relocs::is_runnable): Allow case where
6267 (Read_relocs::locks): Likewise.
6268 (Scan_relocs::locks): Likewise.
6269 (Relocate_task::locks): Likewise.
6270 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6272 (Sized_relobj::incremental_relocs_scan): Fix comment.
6273 (Sized_relobj::do_relocate): Pass output file offset to
6274 write_local_symbols.
6275 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6276 from class declaration.
6277 * script.cc (read_input_script): Allocate Script_info; pass
6278 argument serial number to report_script.
6279 * script.h (class Script_info): Move to incremental.h.
6280 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6281 * symtab.h (Symbol_table::add_from_incrobj): New function.
6282 (Symbol_table::set_file_offset): New function.
6284 2011-04-05 Cary Coutant <ccoutant@google.com>
6286 * incremental-dump.cc (dump_incremental_inputs): Change signature
6287 to take a Sized_incremental_binary; change caller. Use readers
6288 in Sized_incremental_binary.
6290 (Sized_incremental_binary::find_incremental_inputs_sections):
6291 Rename do_find_incremental_inputs_sections to this.
6292 (Sized_incremental_binary::setup_readers): New function.
6293 (Sized_incremental_binary::do_check_inputs): Check
6294 has_incremental_info_ flag; move setup code to setup_readers;
6296 (Sized_incremental_binary::do_file_is_unchanged): New function.
6297 (Sized_incremental_binary::do_get_input_reader): New function.
6298 * incremental.h (class Incremental_binary): Move to end of file.
6299 (Incremental_binary::file_is_unchanged): New function.
6300 (Incremental_binary::do_file_is_unchanged): New function.
6301 (Incremental_binary::Input_reader): New class.
6302 (Incremental_binary::get_input_reader): New function.
6303 (class Sized_incremental_binary): Move to end of file.
6304 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6305 input section reader classes.
6306 (Sized_incremental_binary::has_incremental_info): New function.
6307 (Sized_incremental_binary::inputs_reader): New function.
6308 (Sized_incremental_binary::symtab_reader): New function.
6309 (Sized_incremental_binary::relocs_reader): New function.
6310 (Sized_incremental_binary::got_plt_reader): New function.
6311 (Sized_incremental_binary::do_file_is_unchanged): New function.
6312 (Sized_incremental_binary::Sized_input_reader): New class.
6313 (Sized_incremental_binary::get_input_reader): New function.
6314 (Sized_incremental_binary::find_incremental_inputs_sections):
6315 Rename do_find_incremental_inputs_sections to this.
6316 (Sized_incremental_binary::setup_readers): New function.
6317 (Sized_incremental_binary::has_incremental_info_): New data member.
6318 (Sized_incremental_binary::inputs_reader_): New data member.
6319 (Sized_incremental_binary::symtab_reader_): New data member.
6320 (Sized_incremental_binary::relocs_reader_): New data member.
6321 (Sized_incremental_binary::got_plt_reader_): New data member.
6322 (Sized_incremental_binary::current_input_file_): New data member.
6324 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6327 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6330 2011-03-30 Cary Coutant <ccoutant@google.com>
6332 * archive.cc (Archive::include_member): Adjust call to report_object.
6333 (Add_archive_symbols::run): Add script_info to call to
6334 report_archive_begin.
6335 (Lib_group::include_member): Adjust call to report_object.
6336 (Add_lib_group_symbols::run): Adjust call to report_object.
6337 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6338 blocks. Add object count for script input files.
6339 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6340 script_info parameter; change all callers.
6341 (Incremental_inputs::report_object): Add script_info parameter;
6343 (Incremental_inputs::report_script): Store backpointer to
6344 incremental info entry.
6345 (Output_section_incremental_inputs::set_final_data_size): Record
6346 additional information for scripts.
6347 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6348 * incremental.h (Incremental_script_entry::add_object): New function.
6349 (Incremental_script_entry::get_object_count): New function.
6350 (Incremental_script_entry::get_object): New function.
6351 (Incremental_script_entry::objects_): New data member; adjust
6353 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6354 (Incremental_inputs::report_object): Add script_info parameter.
6355 (Incremental_inputs_reader::get_object_count): New function.
6356 (Incremental_inputs_reader::get_object_offset): New function.
6357 * options.cc (Input_arguments::add_file): Return reference to
6359 * options.h (Input_argument::set_script_info): New function.
6360 (Input_argument::script_info): New function.
6361 (Input_argument::script_info_): New data member; adjust all
6363 (Input_file_group::add_file): Return reference to new input argument.
6364 (Input_file_lib::add_file): Likewise.
6365 (Input_arguments::add_file): Likewise.
6366 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6367 * script.cc (Parser_closure::Parser_closure): Add script_info
6368 parameter; adjust all callers.
6369 (Parser_closure::script_info): New function.
6370 (Parser_closure::script_info_): New data member.
6371 (read_input_script): Report scripts earlier to incremental info.
6372 (script_add_file): Set script_info in Input_argument.
6373 (script_add_library): Likewise.
6374 * script.h (Script_options::Script_info): Rewrite class.
6376 2011-03-29 Cary Coutant <ccoutant@google.com>
6378 * archive.cc (Library_base::should_include_member): Move
6379 method here from class Archive.
6380 (Archive::Archive): Initialize base class.
6381 (Archive::should_include_member): Move to base class.
6382 (Archive::do_for_all_unused_symbols): New function.
6383 (Add_archive_symbols::run): Remove redundant access to
6385 (Lib_group::Lib_group): Initialize base class.
6386 (Lib_group::do_filename): New function.
6387 (Lib_group::include_member): Pass pointer to Lib_group to
6389 (Lib_group::do_for_all_unused_symbols): New function.
6390 (Add_lib_group_symbols::run): Report archive information for
6392 * archive.h (class Library_base): New base class.
6393 (class Archive): Derive from Library_base.
6394 (Archive::filename): Move to base class.
6395 (Archive::set_incremental_info): Likewise.
6396 (Archive::incremental_info): Likewise.
6397 (Archive::Should_include): Likewise.
6398 (Archive::should_include_member): Likewise.
6399 (Archive::Armap_entry): Remove.
6400 (Archive::Unused_symbol_iterator): Remove.
6401 (Archive::unused_symbols_begin): Remove.
6402 (Archive::unused_symbols_end): Remove.
6403 (Archive::do_filename): New function.
6404 (Archive::do_get_mtime): New function.
6405 (Archive::do_for_all_unused_symbols): New function.
6406 (Archive::task_): Move to base class.
6407 (Archive::incremental_info_): Likewise.
6408 (class Lib_group): Derive from Library_base.
6409 (Lib_group::do_filename): New function.
6410 (Lib_group::do_get_mtime): New function.
6411 (Lib_group::do_for_all_unused_symbols): New function.
6412 (Lib_group::task_): Move to base class.
6413 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6415 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6417 * incremental.cc (Incremental_inputs::report_archive_begin):
6418 Use Library_base; call library's get_mtime; add incremental inputs
6419 entry before members.
6420 (class Unused_symbol_visitor): New class.
6421 (Incremental_inputs::report_archive_end): Use Library_base; use
6422 visitor class to record unused symbols; don't add incremental inputs
6423 entry after members.
6424 (Incremental_inputs::report_object): Use Library_base.
6426 (Incremental_archive_entry::Incremental_archive_entry): Remove
6427 unused Archive parameter.
6428 (Incremental_inputs::report_archive_begin): Use Library_base.
6429 (Incremental_inputs::report_archive_end): Likewise.
6430 (Incremental_inputs::report_object): Likewise.
6431 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6433 * object.h (Object::for_all_global_symbols): New function.
6434 (Object::do_for_all_global_symbols): New function.
6435 (Sized_relobj::do_for_all_global_symbols): New function.
6436 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6438 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6441 2011-03-27 Ian Lance Taylor <iant@google.com>
6443 * archive.cc (Archive::interpret_header): Return -1 if something
6444 goes wrong. Change callers accordingly.
6446 2011-03-25 Cary Coutant <ccoutant@google.com>
6448 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6449 * testsuite/Makefile.in: Regenerate.
6451 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6453 * plugin.cc (get_view): New.
6454 (Plugin::load): Pass get_view to the plugin.
6455 (Plugin_manager::get_view): New.
6457 2011-03-21 Ian Lance Taylor <iant@google.com>
6459 * testsuite/final_layout.sh: Rewrite to not use dc.
6460 * testsuite/relro_test.sh: Fail if dc is not present.
6462 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6464 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6466 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6467 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6469 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6470 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6472 2011-03-14 Ian Lance Taylor <iant@google.com>
6474 * script-sections.cc (Sort_output_sections::script_compare):
6475 Rename from is_before, change return type.
6476 (Sort_output_sections::operator()): Adjust accordingly.
6478 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6481 * testsuite/odr_violation2.cc: Add comment to make all error line
6482 numbers double digits.
6483 * testsuite/debug_msg.sh: Adjust expected errors.
6485 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6487 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6488 but mark earlier ones as non-canonical
6489 (offset_to_iterator): Update search target and example
6490 (do_addr2line): Return extra lines in a vector*
6491 (format_file_lineno): Extract from do_addr2line
6492 (one_addr2line): Add vector* out-param
6493 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6494 when a lineno entry appeared last for its instruction
6495 (Dwarf_line_info): Add vector* out-param
6496 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6497 * symtab.cc (Odr_violation_compare): Include the lineno in the
6499 (linenos_from_loc): New. Combine the canonical line for an
6500 address with its other lines.
6501 (True_if_intersect): New. Helper functor to make
6502 std::set_intersection a query.
6503 (detect_odr_violations): Compare sets of lines instead of just
6504 one line for each function. This became less deterministic, but
6505 has fewer false positives.
6506 * symtab.h: Declarations.
6507 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6508 mix an optimized and non-optimized object in the same binary
6509 (odr_violation2.so): Same.
6510 * testsuite/Makefile.in: Regenerate from Makefile.am.
6511 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6512 * testsuite/debug_msg.sh: Update line numbers and add
6514 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6515 non-optimized context.
6516 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6517 isn't inlined, and use OdrDerived in an optimized context.
6518 * testsuite/odr_header1.h: Defines OdrDerived, where
6519 optimization will change the
6520 first-instruction-in-the-destructor's file and line number.
6521 * testsuite/odr_header2.h: Defines OdrBase.
6523 2011-03-09 Ian Lance Taylor <iant@google.com>
6525 * fileread.cc (File_read::clear_views): Don't delete the whole
6528 2011-03-08 Ian Lance Taylor <iant@google.com>
6531 * fileread.cc: #include <climits>.
6532 (GOLD_IOV_MAX): Define.
6533 (File_read::read_multiple): Limit number of entries by iov_max.
6534 * fileread.h (class File_read): Always set max_readv_entries to
6537 2011-03-07 Ian Lance Taylor <iant@google.com>
6540 * options.h (class General_options): Add -dy and -dn.
6542 2011-03-02 Cary Coutant <ccoutant@google.com>
6544 * testsuite/script_test_9.t: Add TLS segment.
6546 2011-03-02 Simon Baldwin <simonb@google.com>
6548 * configure.ac: Add check for gnu_indirect_function support in
6549 the toolchain building binutils.
6550 * configure: Rebuild.
6552 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6554 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6555 plugin only symbols.
6556 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6557 in plugin files as not needed in the symbol table.
6559 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6561 * output.cc (Output_section::add_input_section): Delay fill
6562 generation for section ordering.
6564 2011-02-09 Ian Lance Taylor <iant@google.com>
6567 * object.h (class Sized_relobj): Remove clear_local_symbols.
6568 * reloc.cc (Sized_relobj::do_relocate): Don't call
6569 clear_local_symbols.
6571 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6573 * plugin.cc (is_visible_from_outside): Return true for symbols
6576 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6578 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6581 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6583 * icf.h (is_section_foldable_candidate): Change type of parameter
6585 * icf.cc (Icf::find_identical_sections): Change type of local variable
6586 section_name to be std::string.
6587 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6589 2011-01-25 Ian Lance Taylor <iant@google.com>
6591 * script.cc (script_add_extern): Rewrite to use
6592 add_symbol_reference.
6594 2011-01-25 Doug Kwan <dougkwan@google.com>
6596 * icf.cc (get_section_contents): Always lock section's object.
6598 2011-01-24 Ian Lance Taylor <iant@google.com>
6600 * options.h (class General_options): Accept
6601 --no-detect-odr-violations.
6603 2011-01-24 Ian Lance Taylor <iant@google.com>
6605 * version.cc (version_string): Bump to 1.11.
6607 2011-01-24 Ian Lance Taylor <iant@google.com>
6609 * plugin.cc (class Plugin_rescan): Define new class.
6610 (Plugin_manager::claim_file): Set any_claimed_.
6611 (Plugin_manager::save_archive): New function.
6612 (Plugin_manager::save_input_group): New function.
6613 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6615 (Plugin_manager::new_undefined_symbol): New function.
6616 (Plugin_manager::rescan): New function.
6617 (Plugin_manager::rescannable_defines): New function.
6618 (Plugin_manager::add_input_file): Set any_added_.
6619 * plugin.h (class Plugin_manager): define new fields rescannable_,
6620 undefined_symbols_, any_claimed_, and any_added_. Declare
6621 Plugin_rescan as friend. Declare new functions.
6622 (Plugin_manager::Rescannable): Define type.
6623 (Plugin_manager::Rescannable_list): Define type.
6624 (Plugin_manager::Undefined_symbol_list): Define type.
6625 (Plugin_manager::Plugin_manager): Initialize new fields.
6626 * archive.cc (Archive::defines_symbol): New function.
6627 (Add_archive_symbols::run): Pass archive to plugins if any.
6628 * archive.h (class Archive): Declare defines_symbol.
6629 * readsyms.cc (Input_group::~Input_group): New function.
6630 (Finish_group::run): Pass input_group to plugins if any.
6631 * readsyms.h (class Input_group): Declare destructor.
6632 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6635 2011-01-10 Ian Lance Taylor <iant@google.com>
6637 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6639 (Layout::set_segment_offsets): Reset increase_relro before calling
6640 set_section_addresses a second time.
6642 2011-01-04 Cary Coutant <ccoutant@google.com>
6644 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6645 sections before NOBITS sections.
6647 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6649 * version.cc (print_version): Update copyright to 2011.
6651 2010-12-23 Cary Coutant <ccoutant@google.com>
6653 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6654 of OS to this->add. Add OD parameter to second form of the function.
6656 2010-12-20 Ian Lance Taylor <iant@google.com>
6658 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6659 second of two consecutive entries with same offset.
6661 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6663 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6664 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6665 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6666 to avoid unneeded links against $(LDADD).
6667 * testsuite/Makefile.in: Regenerate.
6669 2010-12-15 Ian Lance Taylor <iant@google.com>
6672 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6673 for R_X86_64_32 and R_X86_64_PC32.
6674 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6675 ver_matching_def_pic.o.
6676 (ver_matching_def_pic.o): New target.
6678 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6680 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6681 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6682 Move definition before File_read::View member definitions.
6683 (File_read::View::~View): Initialize and hold lock before
6684 updating current_mapped_bytes.
6686 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6688 * dwarf_reader.cc: Remove outdated comment.
6689 * gold-threads.cc: Fix typo in error message.
6690 * archive.cc: Fix typos in comments.
6691 * archive.h: Likewise.
6692 * arm-reloc-property.cc: Likewise.
6693 * arm-reloc-property.h: Likewise.
6694 * arm-reloc.def: Likewise.
6696 * attributes.h: Likewise.
6697 * cref.cc: Likewise.
6698 * ehframe.cc: Likewise.
6699 * fileread.h: Likewise.
6701 * i386.cc: Likewise.
6703 * incremental.h: Likewise.
6704 * int_encoding.cc: Likewise.
6705 * layout.h: Likewise.
6706 * main.cc: Likewise.
6707 * merge.h: Likewise.
6708 * object.cc: Likewise.
6709 * object.h: Likewise.
6710 * options.cc: Likewise.
6711 * readsyms.cc: Likewise.
6712 * reduced_debug_output.cc: Likewise.
6713 * reloc.cc: Likewise.
6714 * script-sections.cc: Likewise.
6715 * sparc.cc: Likewise.
6716 * symtab.h: Likewise.
6717 * target-reloc.h: Likewise.
6718 * target.cc: Likewise.
6719 * target.h: Likewise.
6720 * timer.cc: Likewise.
6721 * timer.h: Likewise.
6722 * x86_64.cc: Likewise.
6724 2010-12-09 Cary Coutant <ccoutant@google.com>
6726 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6728 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6729 parameter; change all callers.
6730 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6731 * options.h (warn_execstack): New option.
6733 2010-12-07 Doug Kwan <dougkwan@google.com>
6735 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6736 like function call relocations.
6738 2010-12-07 Ian Lance Taylor <iant@google.com>
6740 * archive.cc (Archive::get_elf_object_for_member): Permit
6741 punconfigured to be NULL.
6742 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6743 (Archive::include_member): Pass NULL to get_elf_object_for_member
6744 if we searched for the archive and this is the first included
6747 2010-12-01 Ian Lance Taylor <iant@google.com>
6749 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6750 track_relocs_type_ field.
6751 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6752 Set track_relocs_type_.
6753 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6754 contents when using RELA relocs.
6755 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6757 * reloc.cc (Track_relocs::next_addend): New function.
6758 * reloc.h (class Track_relocs): Declare next_addend.
6760 2010-12-01 Ian Lance Taylor <iant@google.com>
6762 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6765 2010-12-01 Ian Lance Taylor <iant@google.com>
6767 * README: Update compilers known to work and fail.
6769 2010-11-23 Matthias Klose <doko@ubuntu.com>
6771 * configure.in: For --enable-gold, handle value `default' instead of
6772 `both*'. Always install ld as ld.bfd, install as ld if gold is
6774 * configure: Regenerate.
6776 2010-11-18 Doug Kwan <dougkwan@google.com>
6778 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6779 and right_alignment to be zero. Store result alignment only if it is
6780 greater than existing alignment.
6782 2010-11-16 Cary Coutant <ccoutant@google.com>
6785 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6786 Check for ".zdebug_line".
6788 2010-11-16 Doug Kwan <dougkwan@google.com>
6789 Cary Coutant <ccoutant@google.com>
6791 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6792 by reference; adjust all callers.
6793 * output.cc (Output_segment::set_section_addresses): Adjust references
6794 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6796 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6797 end at page boundary.
6799 2010-11-16 Cary Coutant <ccoutant@google.com>
6802 * layout.cc (Layout::choose_output_section): Transform names of
6803 compressed sections even when using a script with a SECTIONS clause.
6804 (Layout::output_section_name): Remove code to transform
6805 compressed debug section names.
6806 * output.cc (Output_section::add_input_section): Use uncompressed
6807 section size when tracking input sections.
6809 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6811 * symtab.h (Symbol::NON_PIC_REF): Remove.
6812 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6813 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6814 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6815 (Symbol::use_plt_offset): Take a flags argument and pass it
6816 directly to needs_dynamic_reloc. Restrict check for undefined
6817 weak symbols to function calls.
6818 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6819 (Target_arm::Scan::global): Use it.
6820 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6821 (Target_arm::Relocate::relocate): Likewise.
6822 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6823 parameter with an r_type parameter. Use get_reference_flags
6825 (Target_arm::Relocate::relocate): Update accordingly.
6826 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6827 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6828 (Target_i386::Scan::global): Likewise.
6829 (Target_i386::Relocate::relocate): Likewise.
6830 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6831 parameter with an r_type parameter. Use get_reference_flags
6833 (Target_i386::Relocate::relocate): Update accordingly.
6834 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6835 (Target_powerpc::Scan::global): Use it.
6836 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6837 (Target_powerpc::Relocate::relocate): Likewise.
6838 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6839 (Target_sparc::Scan::global): Use it.
6840 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6841 (Target_sparc::Relocate::relocate): Likewise.
6842 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6843 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6844 (Target_x86_64::Scan::global): Likewise.
6845 (Target_x86_64::Relocate::relocate): Likewise.
6847 2010-11-08 Doug Kwan <dougkwan@google.com>
6848 Cary Coutant <ccoutant@google.com>
6850 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6851 (Arm_exidx_merge_section::section_contents_): New data member.
6852 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6853 (Arm_input_section::~Arm_input_section): De-allocate memory.
6854 (Arm_input_section::original_contents_): New data member.
6855 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6856 in parameters instead of calling Object::section_contents without
6858 (Arm_output_section::group_section): New parameter TASK. Pass it
6859 to callees that need locking objects.
6860 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6861 to lock EXIDX input sections. Fix a formatting issue. Call
6862 Arm_exidx_merged_section::build_contents to create merged section
6864 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6865 to lock object of stub table owner.
6866 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6867 TEXT_SIZE to initialize data member TEXT_SIZE_.
6868 (Arm_exidx_input_section::addralign): Fix typo in comment.
6869 (Arm_exidx_input_section::text_size): New method.
6870 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6871 that require locking objects. Lock objects before scanning for stubs
6872 and updating local symbols.
6873 (Arm_input_section<big_endian>::init): Copy contents of original
6875 (Arm_input_section<big_endian>::do_write): Use saved contents of
6876 original input section instead of calling Object::section_contents
6878 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6879 size without calling Object::section_size().
6880 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6881 for size. Allocate a buffer for merged EXIDX entries.
6882 (Arm_exidx_merged_section::build_contents): New method.
6883 (Arm_exidx_merged_section::do_write): Move merge section contents
6884 building code to Arm_exidx_merged_section::build_contetns. Write
6885 out contetns in buffer instead of building it on the fly.
6886 (Arm_relobj::make_exidx_input_section): Also pass text section size
6887 to Arm_exidx_input_section constructor.
6888 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6889 (Arm_dynobj::do_read_symbols): Fix memory leak.
6890 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6891 * target.h: (class Task): Add forward declaration.
6892 (Target::relax): Add new parameter TASK and pass it to
6894 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6896 2010-11-05 Cary Coutant <ccoutant@google.com>
6899 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6900 object when reading from the file.
6901 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6903 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6904 when reading section contents.
6905 (get_section_contents): Likewise.
6906 (icf::find_identical_sections): Likewise.
6907 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6908 object when reading from the file.
6909 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6910 the object when doing deferred section layout.
6912 2010-11-03 Nick Clifton <nickc@redhat.com>
6915 * script.h (class Symbol_assignment: name): New member. Returns
6916 the name of the symbol.
6917 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6918 Returns true if the given symbol name is on the list of
6919 assignments wating to be processed.
6920 * archive.cc (should_incldue_member): If the symbol is undefined,
6921 check to see if it is on the list of symbols pending assignment.
6923 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6925 * script-sections.cc (Script_sections::find_memory_region): Check
6926 for a NULL output section pointer.
6928 2010-10-29 Doug Kwan <dougkwan@google.com>
6930 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6931 Output_section::add_relaxed_input_section.
6932 * output.cc (Output_section::add_relaxed_input_section): Add new
6933 arguments LAYOUT and NAME. Set section order index.
6934 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6935 Copy section order index.
6936 * output.h (Output_section::add_relaxed_input_section): Add new
6937 arguments LAYOUT and NAME.
6939 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6941 * testsuite/Makefile.am: Move gcctestdir/ld rule to
6942 NATIVE_OR_CROSS_LINKER.
6943 * testsuite/Makefile.in: Regenerate.
6945 2010-10-20 Doug Kwan <dougkwan@google.com>
6947 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6948 without SHF_LINK_ORDER flags.
6949 * layout.cc (Layout::choose_output_section): Do not filter
6950 SHF_LINK_ORDER flag in a relocatable link.
6952 2010-10-17 Cary Coutant <ccoutant@google.com>
6954 * output.h (Output_segment::set_section_addresses): Change function
6955 signature. Update all callers.
6956 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6958 (Output_segment::set_section_addresses): Align after last TLS
6959 section. Add padding before last relro section instead of after.
6961 2010-10-17 Doug Kwan <dougkwan@google.com>
6963 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6964 GOT output section to be writable.
6966 2010-10-14 Cary Coutant <ccoutant@google.com>
6968 * debug.h (DEBUG_INCREMENTAL): New flag.
6969 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6970 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6972 * incremental.cc (report_command_line): Ignore all forms of
6974 * layout.cc (Layout::Layout): Check parameters for incremental link
6976 * options.cc (General_options::parse_incremental): New function.
6977 (General_options::parse_no_incremental): New function.
6978 (General_options::parse_incremental_full): New function.
6979 (General_options::parse_incremental_update): New function.
6980 (General_options::incremental_mode_): New data member.
6981 (General_options::finalize): Check incremental_mode_.
6982 * options.h (General_options): Update help text for --incremental.
6983 Add --no-incremental, --incremental-full, --incremental-update.
6984 (General_options::Incremental_mode): New enum type.
6985 (General_options::incremental_mode): New function.
6986 (General_options::incremental_mode_): New data member.
6987 * parameters.cc (Parameters::incremental_mode_): New data member.
6988 (Parameters::set_options): Set incremental_mode_.
6989 (Parameters::set_incremental_full): New function.
6990 (Parameters::incremental): New function.
6991 (Parameters::incremental_update): New function.
6992 (set_parameters_incremental_full): New function.
6993 * parameters.h (Parameters::set_incremental_full): New function.
6994 (Parameters::incremental): New function.
6995 (Parameters::incremental_update): New function.
6996 (Parameters::incremental_mode_): New data member.
6997 (set_parameters_incremental_full): New function.
6998 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6999 incremental link mode.
7000 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7001 (Sized_relobj::do_relocate_sections): Likewise.
7002 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7004 * testsuite/Makefile.in: Regenerate.
7005 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7007 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7009 * script-sections.h (class Script_sections): Make
7010 Sections_elements typedef public.
7011 * script-sections.cc (class Sort_output_sections): Add elements_
7012 field. Add constructor which sets it; change all callers.
7013 (Sort_output_sections::is_before): New function.
7014 (Sort_output_sections::operator()): Call is_before.
7015 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7017 * testsuite/script_test_10.sh: New test. Test script section
7019 * testsuite/script_test_10.t: Likewise.
7020 * testsuite/script_test_10.s: Likewise.
7021 * testsuite/Makefile.am: Wrap the cross linker tests and the
7022 common tests into NATIVE_OR_CROSS_LINKER.
7023 (check_SCRIPTS): Add script_test_10.sh.
7024 (check_DATA): Add script_test_10.stdout.
7025 (script_test_10.o, script_test_10): New targets.
7026 (script_test_10.stdout): New target.
7027 * configure, testsuite/Makefile.in: Regenerate.
7029 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7031 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7032 error for the deprecated relocations.
7033 (Target_arm::Scan::global): Likewise.
7034 (Target_arm::Relocate::relocate): Likewise.
7036 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7038 * fileread.cc (Input_file::find_file): Initialize *found_name
7039 and *namep when using the fallback search for case 4.
7041 2010-10-11 Cary Coutant <ccoutant@google.com>
7043 * options.h (class General_options): Redefine -z lazy as an alias for
7044 the negation of -z now.
7046 2010-10-11 Ian Lance Taylor <iant@google.com>
7048 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7051 2010-10-06 Nick Clifton <nickc@redhat.com>
7053 * script-sections.cc(class Memory_region): Remove
7054 current_lma_offset_ field. Rename current_vma_offset_ to
7055 current_offset_. Add last_section_ field.
7056 (Memory_region::get_current_vma_address): Rename to
7057 get_current_address.
7058 (Memory_region::get_current_lma_address): Delete.
7059 (Memory_region::increment_vma_offset): Rename to
7061 (Memory_region::increment_lma_offset): Delete.
7062 (Memory_region::attributes_compatible): New method. Returns
7063 true if the provided section is compatible with the region.
7064 (Memory_region::get_last_section): New method. Returns the last
7065 section to use the region.
7066 (Memory_region::set_last_section): New method. Stores the last
7067 section to use the region.
7068 (Script_sections::block_in_region): New method. Returns true if
7069 a block of memory is contained within a region.
7070 (Script_sections::find_memory_region): New method. Locates a
7071 memory region to be used to set a VMA or LMA address.
7072 (Output_section_definition::set_section_addresses): Add code to
7073 check for addresses set by memory regions.
7074 (Output_segment::set_section_addresses): Remove memory region
7076 (Script_sections::create_segment): Add a warning if a header
7077 segment is created outside of any region.
7078 * script-sections.h (class Script_sections): Add prototypes for
7079 find_memory_region and block_in_region methods.
7080 * testsuite/memory_test.s: Use .long instead of .word.
7081 * testsuite/memory_test.t: Add some more output sections.
7082 * testsuite/memory_test.sh: Update expected output.
7084 2010-10-02 Doug Kwan <dougkwan@google.com>
7086 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7087 defintion to symtab.h
7088 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7089 declaration to defintion.
7091 2010-10-01 Nick Clifton <nickc@redhat.com>
7093 * expression.cc (eval): Replace dummy argument with NULL.
7094 (eval_maybe_dot): Check for a NULL result section pointer.
7095 (Symbol_expression::value): Likewise.
7096 (Dot_expression::value): Likewise.
7097 (BINARY_EXPRESSION): Likewise.
7098 (Max_expression::value): Likewise.
7099 (Min_expression::value): Likewise.
7100 (Absolute_expression::value): Likewise.
7101 (Addr_expression::value_from_output_section): Likewise.
7102 (Loaddddr_expression::value_from_output_section): Likewise.
7103 (Segment_start_expression::value): Likewise.
7104 * script-sections.cc
7105 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7107 (Sections_elememt_dot_assignment::set_section_addresses):
7109 (Output_data_expression::do_write_to_buffer): Likewise.
7110 (Output_section_definition::finalize_symbols): Likewise.
7111 (Output_section_definition::set_section_addresses): Likewise.
7113 2010-09-30 Doug Kwan <dougkwan@google.com>
7115 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7117 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7119 * target.h (Target::can_icf_inline_merge_sections): New virtual
7121 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7123 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7125 * icf.cc (get_section_contents): Inline merge sections only when
7128 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7130 * configure: Regenerate.
7132 2010-09-17 Ian Lance Taylor <iant@google.com>
7134 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7135 * testsuite/Makefile.am (memory_test.o): New target.
7136 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7138 * testsuite/Makefile.in: Rebuild.
7140 2010-09-17 Doug Kwan <dougkwan@google.com>
7142 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7143 defintion if relocation uses GOT entries of the symbol.
7144 * testsuite/icf_safe_test.sh: Fix test.
7145 * testsuite/icf_safe_so_test.sh: Fix test.
7147 2010-09-16 Cary Coutant <ccoutant@google.com>
7149 * script_sections.cc (class Memory_region): Remove "NULL" from
7150 vector initializations.
7152 2010-09-15 Cary Coutant <ccoutant@google.com>
7154 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7155 Resolve forwarding symbols.
7157 2010-09-15 Doug Kwan <dougkwan@google.com>
7159 * gold/testsuite/script_test_3.t: Add ARM special sections.
7160 * gold/testsuite/script_test_4.t: Same.
7161 * gold/testsuite/script_test_5.t: Same.
7162 * gold/testsuite/script_test_6.t: Same.
7163 * gold/testsuite/script_test_7.t: Same.
7164 * gold/testsuite/script_test_7.t: Same.
7165 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7167 2010-09-14 Cary Coutant <ccoutant@google.com>
7169 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7170 (Target_x86_64::Relocate::relocate_tls): Replace check for
7171 saw_tls_block_reloc_ with test for executable section.
7173 2010-09-12 Cary Coutant <ccoutant@google.com>
7175 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7176 position-independent executables to shared libraries need dynamic
7178 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7179 position-independent executables.
7180 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7181 * testsuite/Makefile.in: Regenerate.
7183 2010-09-10 Nick Clifton <nickc@redhat.com>
7186 * testsuite/memory_test.t: Discard any sections that are not
7189 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7192 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7193 "This::" to work around a bug in gcc 4.2.
7195 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7197 2010-09-09 Rafael Espindola <espindola@google.com>
7199 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7200 sections with different PF_X flags in the same segment.
7201 (Layout::find_first_load_seg): Search all segments to find the first
7203 * options.h (rosegment): New.
7205 2010-09-08 Rafael Espindola <espindola@google.com>
7207 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7209 2010-09-08 Doug Kwan <dougkwan@google.com>
7211 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7212 (Arm_relobj::do_relocate_sections): Add new parameter for output
7213 file to match the parent.
7214 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7215 of local symbols instead of input values. Update code to track
7216 changes in gold::relocate_section.
7217 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7218 (Sized_relobj::compute_final_local_value_internal): New methods.
7219 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7220 body into private version of Sized_relobj::compute_final_local_value.
7221 Call the inline method.
7222 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7223 merged symbol value if there is one.
7224 (Symbol_value::has_output_value): New method defintiion.
7225 (Sized_relobj::Compute_final_local_value_status): New enum type.
7226 (Sized_relobj::compute_final_local_value): New methods.
7227 (Sized_relobj::compute_final_local_value_internal): New methods.
7228 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7229 and arm_cortex_a8.sh.
7230 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7231 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7233 * Makefile.in: Regenerate.
7234 * testsuite/arm_bl_out_of_range.s: Update test.
7235 * testsuite/thumb_bl_out_of_range.s: Ditto.
7236 * testsuite/thumb_blx_out_of_range.s: Ditto.
7237 * testsuite/arm_branch_out_of_range.sh: New file.
7238 * testsuite/arm_cortex_a8.sh: Ditto.
7239 * testsuite/arm_cortex_a8_b.s: Ditto.
7240 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7241 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7242 * testsuite/arm_cortex_a8_bl.s: Ditto.
7243 * testsuite/arm_cortex_a8_blx.s: Ditto.
7244 * testsuite/arm_cortex_a8_local.s: Ditto.
7245 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7246 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7248 2010-09-08 Rafael Espindola <espindola@google.com>
7250 * Makefile.am (memory_test.stdout): Run readelf with -W.
7251 * Makefile.in: Regenerate.
7252 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7255 2010-09-08 Rafael Espindola <espindola@google.com>
7257 * script-sections.cc (Script_sections::add_memory_region): Convert
7258 field precision to int.
7259 * script.cc (script_set_section_region, script_set_section_region):
7260 Convert field precision to int.
7262 2010-09-08 Rafael Espindola <espindola@google.com>
7264 * arm.cc (do_finalize_sections): Create the __exidx_start and
7265 __exdix_end symbols even when the section is missing.
7267 2010-09-08 Nick Clifton <nickc@redhat.com>
7269 * README: Remove claim that MEMORY is not supported.
7270 * expression.cc (script_exp_function_origin)
7271 (script_exp_function_length): Move from here to ...
7272 * script.cc: ... here.
7273 (script_set_section_region, script_add_memory)
7274 (script_parse_memory_attr, script_include_directive): New
7276 * script-sections.cc
7277 (class Memory_region): New class.
7278 (class Output_section_definition): Add set_memory_region,
7279 set_section_vma, set_section_lma and get_section_name methods.
7280 (class Script_Sections): Add add_memory_region,
7281 find_memory_region, find_memory_region_origin,
7282 find_memory_region_length and set_memory_region methods.
7283 Have set_section_addresses method walk the list of set memory
7285 Extend the print methos to display memory regions.
7286 * script-sections.h: Add prototypes for new methods.
7287 Add enum for MEMORY region attributes.
7288 * yyscript.y: Add support for parsing MEMORY regions.
7289 * script-c.h: Add prototypes for new functions.
7290 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7291 * testsuite/Makefile.in: Regenerate.
7292 * testsuite/memory_test.sh: New script.
7293 * testsuite/memory_test.s: New assembler source file.
7294 * testsuite/memory_test.t: New linker script.
7296 2010-08-27 Doug Kwan <dougkwan@google.com>
7298 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7299 reference override an existing dynamic weak reference.
7300 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7301 * testsuite/Makefile.in: Regenerate.
7302 * testsuite/dyn_weak_ref.sh: New file.
7303 * testsuite/dyn_weak_ref_1.c: Ditto.
7304 * testsuite/dyn_weak_ref_2.c: Ditto.
7306 2010-08-27 Ian Lance Taylor <iant@google.com>
7308 * incremental.h (class Incremental_input_entry): Add virtual
7311 2010-08-27 Ian Lance Taylor <iant@google.com>
7313 * testsuite/start_lib_test_3.c: Mark t3 as used.
7315 2010-08-27 Nick Clifton <nickc@redhat.com>
7317 * options.cc (version_script): Fix small typo in previous
7320 2010-08-25 Nick Clifton <nickc@redhat.com>
7322 * archive.cc: Formatting fixes: Remove whitespace between
7323 typename and following asterisk. Remove whitespace between
7324 function name and opening parenthesis.
7325 * archive.h: Likewise.
7327 * attributes.cc: Likewise.
7328 * attributes.h: Likewise.
7329 * common.cc: Likewise.
7330 * copy-relocs.cc: Likewise.
7331 * dirsearch.h: Likewise.
7332 * dynobj.cc: Likewise.
7333 * ehframe.cc: Likewise.
7334 * ehframe.h: Likewise.
7335 * expression.cc: Likewise.
7336 * fileread.cc: Likewise.
7337 * fileread.h: Likewise.
7339 * gold-threads.cc: Likewise.
7340 * gold.cc: Likewise.
7341 * i386.cc: Likewise.
7343 * incremental-dump.cc: Likewise.
7344 * incremental.cc: Likewise.
7345 * layout.cc: Likewise.
7346 * layout.h: Likewise.
7347 * main.cc: Likewise.
7348 * merge.cc: Likewise.
7349 * merge.h: Likewise.
7350 * object.cc: Likewise.
7351 * object.h: Likewise.
7352 * options.cc: Likewise.
7353 * options.h: Likewise.
7354 * output.cc: Likewise.
7355 * output.h: Likewise.
7356 * plugin.cc: Likewise.
7357 * plugin.h: Likewise.
7358 * powerpc.cc: Likewise.
7359 * reloc.cc: Likewise.
7360 * script-c.h: Likewise.
7361 * script-sections.cc: Likewise.
7362 * script.cc: Likewise.
7363 * stringpool.cc: Likewise.
7364 * symtab.cc: Likewise.
7365 * symtab.h: Likewise.
7366 * target.cc: Likewise.
7367 * timer.cc: Likewise.
7368 * timer.h: Likewise.
7369 * version.cc: Likewise.
7370 * x86_64.cc: Likewise.
7372 2010-08-24 Nick Clifton <nickc@redhat.com>
7375 * layout.cc (segment_precedes): Sort segments by their physical
7376 addresses, if they have been set.
7378 2010-08-23 Cary Coutant <ccoutant@google.com>
7380 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7382 (Lib_group::include_member): Unlock object after deleting its
7384 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7387 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7388 Cary Coutant <ccoutant@google.com>
7390 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7391 constructor, and set_blocker.
7392 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7394 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7395 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7396 * testsuite/Makefile.am (start_lib_test): New test case.
7397 * testsuite/Makefile.in: Regenerate.
7398 * testsuite/start_lib_test_main.c: New file.
7399 * testsuite/start_lib_test_1.c: New file.
7400 * testsuite/start_lib_test_2.c: New file.
7401 * testsuite/start_lib_test_3.c: New file.
7403 2010-08-19 Ian Lance Taylor <iant@google.com>
7405 * Makefile.in: Rebuild with automake 1.11.1.
7406 * aclocal.m4: Likewise.
7407 * testsuite/Makefile.in: Likewise.
7409 2010-08-19 Ian Lance Taylor <iant@google.com>
7412 * i386.cc (class Output_data_plt_i386): Update declarations.
7413 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7414 local_ifuncs_ fields.
7415 (Target_i386::do_plt_section_for_global): New function.
7416 (Target_i386::do_plt_section_for_local): New function.
7417 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7418 parameter; change all callers. Initialize global_ifuncs_ and
7419 local_ifuncs_. If doing a static link define __rel_iplt_start and
7421 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7422 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7423 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7425 (Target_i386::make_plt_section): New function, broken out of
7426 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7427 (Target_i386::make_plt_entry): Call make_plt_section.
7428 (Target_i386::make_local_ifunc_plt_entry): New function.
7429 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7430 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7431 R_386_IRELATIVE to switch.
7432 (Target_i386::Scan::global): Likewise.
7433 (Target_i386::Relocate::relocate): Likewise.
7434 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7436 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7437 (Target_x86_64::do_plt_section_for_global): New function.
7438 (Target_x86_64::do_plt_section_for_local): New function.
7439 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7440 parameter; change all callers. If doing a static link define
7441 __rela_iplt_start and __rela_iplt_end.
7442 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7443 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7444 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7446 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7447 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7449 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7450 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7451 R_X86_64_IRELATIVE to switch.
7452 (Target_x86_64::Scan::global): Likewise.
7453 (Target_x86_64::Relocate::relocate): Likewise.
7454 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7456 * target.h (class Target): Add plt_section_for_global and
7457 plt_section_for_local functions. Add do_plt_section_for_global
7458 and do_plt_section_for_local virtual functions.
7459 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7460 clarifying comments.
7461 (Symbol::use_plt_offset): Handle IFUNC symbol.
7462 * object.cc (Sized_relobj::Sized_relobj): Initialize
7464 (Sized_relobj::local_has_plt_offset): New function.
7465 (Sized_relobj::local_plt_offset): New function.
7466 (Sized_relobj::set_local_plt_offset): New function.
7467 (Sized_relobj::do_count): Handle IFUNC symbol.
7468 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7469 a bit away from input_shndx_ field. Add set_is_func_symbol and
7470 is_ifunc_symbol functions.
7471 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7472 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7473 local_plt_offsets_ field.
7474 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7475 * output.h (class Output_section_data): Add non-const
7476 output_section function.
7477 (class Output_data_got): Update declarations.
7478 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7479 Add use_plt_offset parameter to global and local constructors.
7480 Change all callers. Change local_sym_index_ field to 31 bits.
7481 Change GSYM_CODE and CONSTANT_CODE accordingly.
7482 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7483 doing a static link don't set sh_link field.
7484 (Output_data_got::Got_entry::write): Use PLT offset if
7486 (Output_data_got::add_global_plt): New function.
7487 (Output_data_got::add_local_plt): New function.
7488 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7489 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7490 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7491 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7492 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7494 * testsuite/ifunc-sel.h: New file.
7495 * testsuite/ifuncmain1.c: New file.
7496 * testsuite/ifuncmain1vis.c: New file.
7497 * testsuite/ifuncmod1.c: New file.
7498 * testsuite/ifuncdep2.c: New file.
7499 * testsuite/ifuncmain2.c: New file.
7500 * testsuite/ifuncmain3.c: New file.
7501 * testsuite/ifuncmod3.c: New file.
7502 * testsuite/ifuncmain4.c: New file.
7503 * testsuite/ifuncmain5.c: New file.
7504 * testsuite/ifuncmod5.c: New file.
7505 * testsuite/ifuncmain6pie.c: New file.
7506 * testsuite/ifuncmod6.c: New file.
7507 * testsuite/ifuncmain7.c: New file.
7508 * configure, testsuite/Makefile.in: Rebuild.
7510 2010-08-18 Ian Lance Taylor <iant@google.com>
7513 (Output_section_incremental_inputs::write_input_files): Add cast
7514 to avoid signed/unsigned comparison warning.
7515 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7517 2010-08-12 Cary Coutant <ccoutant@google.com>
7519 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7521 2010-08-13 Ian Lance Taylor <iant@google.com>
7523 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7525 2010-08-12 Cary Coutant <ccoutant@google.com>
7526 Doug Kwan <dougkwan@google.com>
7528 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7529 defintion overrides non-weak undef, remember that the original undef
7531 * symtab.cc (Symbol_table::sized_write_global): For undef without
7532 an original weak binding, set binding to global in output.
7533 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7534 * testsuite/Makefile.in: Regenerate.
7535 * testsuite/strong_ref_weak_def.sh: New file.
7536 * testsuite/strong_ref_weak_def_1.c: Ditto.
7537 * testsuite/strong_ref_weak_def_2.c: Ditto.
7539 2010-08-12 Cary Coutant <ccoutant@google.com>
7541 * testsuite/incremental_test.sh: Rewrite.
7542 * testsuite/incremental_test_1.c: Rewrite.
7543 * testsuite/incremental_test_2.c: Rewrite.
7545 2010-08-12 Cary Coutant <ccoutant@google.com>
7547 * arm.cc (Target_arm::got_size): Add const.
7548 (Target_arm::got_entry_count): New function.
7549 (Target_arm::plt_entry_count): New function.
7550 (Target_arm::first_plt_entry_offset): New function.
7551 (Target_arm::plt_entry_size): New function.
7552 (Output_data_plt_arm::entry_count): New function.
7553 (Output_data_plt_arm::first_plt_entry_offset): New function.
7554 (Output_data_plt_arm::get_plt_entry_size): New function.
7555 * i386.cc (Target_i386::got_size): Add const.
7556 (Target_i386::got_entry_count): New function.
7557 (Target_i386::plt_entry_count): New function.
7558 (Target_i386::first_plt_entry_offset): New function.
7559 (Target_i386::plt_entry_size): New function.
7560 (Output_data_plt_i386::entry_count): New function.
7561 (Output_data_plt_i386::first_plt_entry_offset): New function.
7562 (Output_data_plt_i386::get_plt_entry_size): New function.
7563 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7564 find_incremental_inputs_sections. Dump incremental_got_plt section.
7565 * incremental.cc: Include target.h.
7566 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7567 parameter. Adjust all callers. Find incremental_got_plt section.
7568 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7570 (Output_section_incremental_inputs::set_final_data_size): Calculate
7571 size of incremental_got_plt section.
7572 (Output_section_incremental_inputs::do_write): Write the
7573 incremental_got_plt section.
7574 (Got_plt_view_info): New struct.
7575 (Local_got_offset_visitor): New class.
7576 (Global_got_offset_visitor): New class.
7577 (Global_symbol_visitor_got_plt): New class.
7578 (Output_section_incremental_inputs::write_got_plt): New function.
7579 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7580 Add parameter. Adjust all callers.
7581 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7582 (Incremental_inputs::got_plt_section): New function.
7583 (Incremental_inputs::got_plt_section_): New data member.
7584 (Incremental_got_plt_reader): New class.
7585 * layout.cc (Layout::create_incremental_info_sections): Add the
7586 incremental_got_plt section.
7587 * object.h (Got_offset_list::get_list): New function.
7588 (Got offset_list::for_all_got_offsets): New function.
7589 (Sized_relobj::local_got_offset_list): New function.
7590 * powerpc.cc (Target_powerpc::got_size): Add const.
7591 (Target_powerpc::got_entry_count): New function.
7592 (Target_powerpc::plt_entry_count): New function.
7593 (Target_powerpc::first_plt_entry_offset): New function.
7594 (Target_powerpc::plt_entry_size): New function.
7595 (Output_data_plt_powerpc::entry_count): New function.
7596 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7597 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7598 * sparc.cc (Target_sparc::got_size): Add const.
7599 (Target_sparc::got_entry_count): New function.
7600 (Target_sparc::plt_entry_count): New function.
7601 (Target_sparc::first_plt_entry_offset): New function.
7602 (Target_sparc::plt_entry_size): New function.
7603 (Output_data_plt_sparc::entry_count): New function.
7604 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7605 (Output_data_plt_sparc::get_plt_entry_size): New function.
7606 * symtab.h (Symbol::got_offset_list): New function.
7607 (Symbol_table::for_all_symbols): New function.
7608 * target.h (Sized_target::got_entry_count): New function.
7609 (Sized_target::plt_entry_count): New function.
7610 (Sized_target::plt_entry_size): New function.
7611 * x86_64.cc (Target_x86_64::got_size): Add const.
7612 (Target_x86_64::got_entry_count): New function.
7613 (Target_x86_64::plt_entry_count): New function.
7614 (Target_x86_64::first_plt_entry_offset): New function.
7615 (Target_x86_64::plt_entry_size): New function.
7616 (Output_data_plt_x86_64::entry_count): New function.
7617 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7618 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7620 2010-08-12 Cary Coutant <ccoutant@google.com>
7622 * archive.cc: Include incremental.h.
7623 (Archive::Archive): Initialize incremental_info_.
7624 (Archive::include_member): Record archive members in incremental info.
7625 (Add_archive_symbols::run): Record begin and end of an archive in
7627 (Lib_group::include_member): Record objects in incremental info.
7628 * archive.h (Incremental_archive_entry): Forward declaration.
7629 (Archive::set_incremental_info): New member function.
7630 (Archive::incremental_info): New member function.
7631 (Archive::Unused_symbol_iterator): New class.
7632 (Archive::unused_symbols_begin): New member function.
7633 (Archive::unused_symbols_end): New member function.
7634 (Archive::incremental_info_): New data member.
7635 * incremental-dump.cc (find_input_containing_global): New function.
7636 (dump_incremental_inputs): Dump new incremental info sections.
7637 * incremental.cc: Include symtab.h.
7638 (Output_section_incremental_inputs): New class.
7639 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7640 new incremental info sections.
7641 (Sized_incremental_binary::do_check_inputs): Likewise.
7642 (Incremental_inputs::report_archive): Remove.
7643 (Incremental_inputs::report_archive_begin): New function.
7644 (Incremental_inputs::report_archive_end): New function.
7645 (Incremental_inputs::report_object): New function.
7646 (Incremental_inputs::finalize_inputs): Remove.
7647 (Incremental_inputs::report_input_section): New function.
7648 (Incremental_inputs::report_script): Rewrite.
7649 (Incremental_inputs::finalize): Do nothing but finalize string table.
7650 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7651 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7652 (Incremental_inputs::create_data_sections): New function.
7653 (Incremental_inputs::relocs_entsize): New function.
7654 (Output_section_incremental_inputs::set_final_data_size): New function.
7655 (Output_section_incremental_inputs::do_write): New function.
7656 (Output_section_incremental_inputs::write_header): New function.
7657 (Output_section_incremental_inputs::write_input_files): New function.
7658 (Output_section_incremental_inputs::write_info_blocks): New function.
7659 (Output_section_incremental_inputs::write_symtab): New function.
7660 * incremental.h (Incremental_script_entry): Forward declaration.
7661 (Incremental_object_entry): Forward declaration.
7662 (Incremental_archive_entry): Forward declaration.
7663 (Incremental_inputs): Forward declaration.
7664 (Incremental_inputs_header_data): Remove.
7665 (Incremental_inputs_header): Remove.
7666 (Incremental_inputs_header_write): Remove.
7667 (Incremental_inputs_entry_data): Remove.
7668 (Incremental_inputs_entry): Remove.
7669 (Incremental_inputs_entry_write): Remove.
7670 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7671 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7672 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7673 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7675 (Incremental_input_entry): New class.
7676 (Incremental_script_entry): New class.
7677 (Incremental_object_entry): New class.
7678 (Incremental_archive_entry): New class.
7679 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7680 (Incremental_inputs::report_inputs): Remove.
7681 (Incremental_inputs::report_archive): Remove.
7682 (Incremental_inputs::report_archive_begin): New function.
7683 (Incremental_inputs::report_archive_end): New function.
7684 (Incremental_inputs::report_object): Change prototype.
7685 (Incremental_inputs::report_input_section): New function.
7686 (Incremental_inputs::report_script): Change prototype.
7687 (Incremental_inputs::get_reloc_count): New function.
7688 (Incremental_inputs::set_reloc_count): New function.
7689 (Incremental_inputs::create_data_sections): New function.
7690 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7691 (Incremental_inputs::inputs_section): New function.
7692 (Incremental_inputs::symtab_section): New function.
7693 (Incremental_inputs::relocs_section): New function.
7694 (Incremental_inputs::get_stringpool): Add const.
7695 (Incremental_inputs::command_line): Add const.
7696 (Incremental_inputs::inputs): Remove.
7697 (Incremental_inputs::command_line_key): New function.
7698 (Incremental_inputs::input_file_count): New function.
7699 (Incremental_inputs::input_files): New function.
7700 (Incremental_inputs::relocs_entsize): New function.
7701 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7702 (Incremental_inputs::finalize_inputs): Remove.
7703 (Incremental_inputs::Input_info): Remove.
7704 (Incremental_inputs::lock_): Remove.
7705 (Incremental_inputs::inputs_): Change type.
7706 (Incremental_inputs::inputs_map_): Remove.
7707 (Incremental_inputs::current_object_entry_): New data member.
7708 (Incremental_inputs::inputs_section_): New data member.
7709 (Incremental_inputs::symtab_section_): New data member.
7710 (Incremental_inputs::relocs_section_): New data member.
7711 (Incremental_inputs::reloc_count_): New data member.
7712 (Incremental_inputs_reader): New class.
7713 (Incremental_symtab_reader): New class.
7714 (Incremental_relocs_reader): New class.
7715 * layout.cc (Layout::finalize): Move finalization of incremental info
7716 and creation of incremental info sections to follow finalization of
7717 symbol table. Set offsets for postprocessing sections.
7718 (Layout::create_incremental_info_sections): Call
7719 Incremental_inputs::create_data_sections. Add incremental symtab
7720 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7721 sections to layout after input sections.
7722 * layout.h (struct Timespec): Forward declaration.
7723 (Layout::incremental_inputs): Add const.
7724 (Layout::create_incremental_info_sections): Add parameter.
7725 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7726 * object.cc: Include incremental.h.
7727 (Relobj::finalize_incremental_relocs): New function.
7728 (Sized_relobj::do_layout): Record input sections in incremental info.
7729 * object.h (Object::output_section): New function.
7730 (Object::output_section_offset): Moved from Relobj.
7731 (Object::get_incremental_reloc_base): New function.
7732 (Object::get_incremental_reloc_count): New function.
7733 (Object::do_output_section): New function.
7734 (Object::do_output_section_offset): Moved from Relobj.
7735 (Object::do_get_incremental_reloc_base): New function.
7736 (Object::do_get_incremental_reloc_count): New function.
7737 (Object::Object): Initialize new data members.
7738 (Relobj::output_section): Renamed do_output_section and moved to
7740 (Relobj::output_section_offset): Moved to Object.
7741 (Relobj::do_get_incremental_reloc_base): New function.
7742 (Relobj::do_get_incremental_reloc_count): New function.
7743 (Relobj::allocate_incremental_reloc_counts): New function.
7744 (Relobj::count_incremental_reloc): New function.
7745 (Relobj::finalize_incremental_relocs): New function.
7746 (Relobj::next_incremental_reloc_index): New function.
7747 (Relobj::reloc_counts_): New data member.
7748 (Relobj::reloc_bases_): New data member.
7749 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7750 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7751 (Sized_relobj::incremental_relocs_scan): New function.
7752 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7753 (Sized_relobj::incremental_relocs_write): New function.
7754 (Sized_relobj::incremental_relocs_write_reltype): New function.
7755 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7757 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7758 archives and object files elsewhere.
7759 (Add_symbols::run): Report object files here.
7760 (Finish_group::run): Report end of archive at end of group.
7761 * reloc.cc: Include layout.h, incremental.h.
7762 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7763 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7764 (Sized_relobj::incremental_relocs_scan): New function.
7765 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7766 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7767 (Sized_relobj::incremental_relocs_write): New function.
7768 (Sized_relobj::incremental_relocs_write_reltype): New function.
7769 * script.cc (read_input_script): Rewrite test for incremental link.
7770 Change call to Incremental_inputs::report_script.
7771 * symtab.h (Symbol_table::first_global_index): New function.
7772 (Symbol_table::output_count): New function.
7774 2010-08-12 Doug Kwan <dougkwan@google.com>
7776 * arm.cc (Target_arm::merge_object_attributes): Check command line
7777 options --no-wchar-size-warning and --no-enum-size-warning.
7778 * options.h (General_options): Add ld-compatible options
7779 --no-enum-size-warning and --no-wchar-size-warning.
7781 2010-08-04 Ian Lance Taylor <iant@google.com>
7783 * x86_64.cc (Target_x86_64::Scan::local): Use
7784 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7785 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7786 (Target_x86_64::Scan::global): Likewise.
7787 (Target_x86_64::Relocate::relocate): Likewise.
7788 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7791 2010-08-03 Cary Coutant <ccoutant@google.com>
7793 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7794 to reserve space in merged_strings vector. Keep total input size
7796 (Output_merge_string::do_print_merge_stats): Print total input size.
7797 * merge.h (Output_merge_string): Add input_size_ field.
7798 * stringpool.cc (Stringpool_template::string_length): Move
7799 implementations out of Stringpool_template class and place in
7801 * stringpool.h (string_length): Move out of Stringpool_template.
7803 2010-08-03 Ian Lance Taylor <iant@google.com>
7806 * layout.cc (relaxation_loop_body): If address of load segment is
7807 set, adjust address to include headers if possible.
7809 2010-08-03 Ian Lance Taylor <iant@google.com>
7811 * version.cc (version_string): Bump to 1.10.
7813 2010-08-03 Ian Lance Taylor <iant@google.com>
7816 * layout.h (enum Output_section_order): Define.
7817 (class Layout): Update declarations.
7818 * layout.cc (Layout::get_output_section): Add order parameter.
7819 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7820 is_first_non_relro parameters. Change all callers.
7821 (Layout::choose_output_section): Likewise.
7822 (Layout::add_output_section_data): Likewise.
7823 (Layout::make_output_section): Likewise. Set order.
7824 (Layout::default_section_order): New function.
7825 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7826 * output.cc (Output_section::Output_section): Initialize order_.
7827 Don't initialize deleted fields.
7828 (Output_segment::Output_segment): Don't initialize deleted
7830 (Output_segment::add_output_section_to_load): New function
7831 replacing add_output_section. Change all callers to call this or
7832 add_output_section_to_nonload.
7833 (Output_segment::add_output_section_to_nonload): New function.
7834 (Output_segment::remove_output_section): Rewrite.
7835 (Output_segment::add_initial_output_data): Likewise.
7836 (Output_segment::has_any_data_sections): Likewise.
7837 (Output_segment::is_first_section_relro): Likewise.
7838 (Output_segment::maximum_alignment): Likewise.
7839 (Output_segment::has_dynamic_reloc): New function replacing
7840 dynamic_reloc_count. Change all callers.
7841 (Output_segment::has_dynamic_reloc_list): New function replacing
7842 dynamic_reloc_count_list. Change all callers.
7843 (Output_segment::set_section_addresses): Rewrite.
7844 (Output_segment::set_offset): Rewrite.
7845 (Output_segment::find_first_and_last_list): Remove.
7846 (Output_segment::set_tls_offsets): Rewrite.
7847 (Output_segment::first_section_load_address): Likewise.
7848 (Output_segment::output_section_count): Likewise.
7849 (Output_segment::section_with_lowest_load_address): Likewise.
7850 (Output_segment::write_section_headers): Likewise.
7851 (Output_segment::print_sections_to_map): Likewise.
7852 * output.h (class Output_data): Remove dynamic_reloc_count_
7853 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7854 (Output_data::add_dynamic_reloc): Rewrite.
7855 (Output_data::has_dynamic_reloc): New function.
7856 (Output_data::dynamic_reloc_count): Remove.
7857 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7858 is_last_relro_, is_first_non_relro_, is_interp_,
7859 is_dynamic_linker_section_ fields. Add order and set_order
7860 functions. Remove is_relro_local, set_is_relro_local,
7861 is_last_relro, set_is_last_relro, is_first_non_relro,
7862 set_is_first_non_relro functions, is_interp, set_is_interp,
7863 is_dynamic_linker_section, and set_is_dynamic_linker_section
7865 (class Output_segment): Change Output_data_list from std::list to
7866 std:;vector. Add output_lists_ field. Remove output_data_ and
7867 output_bss_ fields. Update declarations.
7869 2010-08-02 Ian Lance Taylor <iant@google.com>
7871 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7872 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7873 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7875 2010-08-02 Ian Lance Taylor <iant@google.com>
7878 * script.cc (Script_options::Script_options): Initialize
7879 symbol_definitions_ and symbol_references_.
7880 (Script_options::add_symbol_assignment): Update
7881 symbol_definitions_ and symbol_references_.
7882 (Script_options::add_symbol_reference): New function.
7883 (script_symbol): New function.
7884 * script.h (class Script_options): Add symbol_definitions_ and
7885 symbol_references_ fields.
7886 (Script_options::referenced_const_iterator): New type.
7887 (Script_options::referenced_begin): New function.
7888 (Script_options::referenced_end): New function.
7889 (Script_options::is_referenced): New function.
7890 (Script_options::any_unreferenced): New function.
7891 * script-c.h (script_symbol): Declare.
7892 * yyscript.y (exp): Call script_symbol.
7893 * symtab.cc: Include "script.h".
7894 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7895 Change all callers. Check symbols referenced by scripts.
7896 (Symbol_table::add_undefined_symbols_from_command_line): Add
7897 layout parameter. Change all callers.
7898 (Symbol_table::do_add_undefined_symbols_from_command_line):
7899 Likewise. Break out loop body. Check symbols referenced by
7901 (Symbol_table::add_undefined_symbol_from_command_line): New
7902 function broken out of
7903 do_add_undefined_symbols_from_command_line.
7904 * symtab.h (class Symbol_table): Update declarations.
7905 * archive.cc: Include "layout.h".
7906 (Archive::should_include_member): Add layout parameter. Change
7907 all callers. Check for symbol mentioned in expression.
7908 * archive.h (class Archive): Update declaration.
7909 * object.cc (Sized_relobj::do_should_include_member): Add layout
7911 * object.h (Object::should_include_member): Add layout parameter.
7913 (Object::do_should_include_member): Add layout parameter.
7914 (class Sized_relobj): Update declaration.
7915 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7917 * dynobj.h (class Sized_dynobj): Update declaration.
7918 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7920 * plugin.h (class Sized_pluginobj): Update declaration.
7922 2010-08-02 Ian Lance Taylor <iant@google.com>
7925 * output.cc (Output_segment::set_offset): Search for the first and
7926 last sections rather than assuming that the list is in order.
7927 (Output_segment::find_first_and_last_list): New function.
7928 * output.h (class Output_segment): Update declarations.
7929 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7930 (relro_strip_test_SOURCES): New variable.
7931 (relro_strip_test_DEPENDENCIES): New variable.
7932 (relro_strip_test_LDFLAGS): New variable.
7933 (relro_strip_test_LDADD): New variable.
7934 (relro_strip_test.so): New target.
7936 2010-08-02 Ian Lance Taylor <iant@google.com>
7938 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7939 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7940 (Target_i386::got_tlsdesc_section): New function.
7941 (Target_i386::got_section): Create space for GOT entries for
7942 TLSDESC relocations.
7943 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7945 (Target_i386::Scan::global): Likewise.
7946 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7948 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7949 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7950 (Target_x86_64::got_tlsdesc_section): New function.
7951 (Target_x86_64::got_section): Create space for GOT entries for
7952 TLSDESC relocations.
7953 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7955 (Target_x86_64::Scan::global): Likewise.
7956 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7959 2010-08-02 Ian Lance Taylor <iant@google.com>
7961 * testsuite/final_layout.sh: Use dc to convert from hex to
7964 2010-07-29 Sriraman Tallam <tmsriram@google.com>
7966 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7967 paramter to the call to gold::gc_process_relocs.
7968 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7969 paramter to the call to gold::gc_process_relocs.
7970 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7971 parameter to the call to gold::gc_process_relocs.
7972 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7973 template parameter to the call to gold::gc_process_relocs.
7974 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7975 paramter to the call to gold::gc_process_relocs.
7976 * gc.h (get_embedded_addend_size): New function.
7977 (gc_process_relocs): Save the size of the reloc for use by ICF.
7978 * icf.cc (get_section_contents): Get the addend from the text section
7979 for SHT_REL relocation sections.
7980 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7981 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7982 * int_encoding.h (read_from_pointer): New overloaded function.
7983 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7984 * testsuite/icf_sht_rel_addend_test.sh: New file.
7985 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7986 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7988 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7990 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7991 * Makefile.in: Regenerate.
7992 * testsuite/Makefile.in: Regenerate.
7994 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7996 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7997 * gold/testsuite/debug_msg.cc: Likewise.
7998 * gold/testsuite/odr_violation1.cc
7999 * gold/testsuite/odr_violation2.cc
8001 2010-07-21 Cary Coutant <ccoutant@google.com>
8003 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8004 string, and length fields.
8005 (Output_merge_string::Merged_strings_list): New type.
8006 (Output_merge_string::Merged_strings_lists): New typedef.
8007 (Output_merge_string): Replace merged_strings_ with
8008 merged_strings_lists_.
8009 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8010 Merged_strings_list per input object and section. Don't store pointer
8011 to the string. Don't store length with each merged string entry.
8012 (Output_merge_string::finalize_merged_data): Loop over list of merged
8013 strings lists. Recompute length of each merged string.
8015 2010-07-15 Cary Coutant <ccoutant@google.com>
8017 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8020 2010-07-14 Ian Lance Taylor <iant@google.com>
8022 * descriptors.cc (Descriptors::open): Report correct name in error
8025 2010-07-13 Doug Kwan <dougkwan@google.com>
8027 * arm.cc (Arm_input_section::Arm_input_section): For a
8028 SHT_ARM_EXIDX section, always keeps the input sections.
8029 (Arm_input_section::set_exidx_section_link): New method.
8030 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8031 has_errors_ to false.
8032 (Arm_exidx_input_section::has_errors,
8033 Arm_exidx_input_section::set_has_errors): New methods.
8034 (Arm_exidx_input_section::has_errors_): New data member.
8035 (Arm_relobj::get_exidx_shndx_list): New method.
8036 (Arm_output_section::append_text_sections_to_list): Do not skip
8037 section without SHF_EXECINSTR.
8038 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8040 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8041 section header. Make error messages more verbose. Check for
8042 a non-executable section linked to an EXIDX section.
8043 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8044 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8045 check that there is no deferred EXIDX section if we exit early.
8046 Instead of not making an EXIDX section in case of an error, make one
8047 and set the has_errors flag of it.
8048 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8049 in a relocatable link.
8050 (Target_arm::do_relax): Look for the EXIDX output section instead of
8051 assuming that it is called .ARM.exidx.
8052 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8053 section list. Do not check for SHF_EXECINSTR section flags but
8054 skip any input section with errors.
8055 * output.cc (Output_section::Output_section): Initialize
8056 always_keeps_input_sections_ to false.
8057 (Output_section::add_input_section): Check for
8058 always_keeps_input_sections_.
8059 * output.h (Output_section::always_keeps_input_sections,
8060 Output_section::set_always_keeps_input_sections): New methods.
8061 (Output_section::always_keeps_input_sections): New data member.
8063 2010-07-13 Rafael Espindola <espindola@google.com>
8065 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8066 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8068 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8069 Ian Lance Taylor <iant@google.com>
8071 * output.h (Output_section_lookup_maps::add_merge_section):
8072 Correct check of whether value was inserted.
8073 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8074 (Output_section_lookup_maps::add_relaxed_input_section):
8076 * arm.cc (Target_arm::got_section): Remove used local os.
8077 * i386.cc (Target_i386::got_section): Likewise.
8078 * x86_64.cc (Target_x86_64::got_section): Likewise.
8079 * sparc.cc (Target_sparc::got_section): Likewise.
8080 (Target_sparc::relocate): Remove unused local have_got_offset.
8081 * powerpc.cc (Target_powerpc::relocate): Likewise.
8083 2010-07-13 Ian Lance Taylor <iant@google.com>
8085 * compressed_output.cc (zlib_decompress): Fix signature in
8088 * archive.cc (Archive::include_member): Unlock an external member
8089 of a thin archive. Don't bother to delete an object we know is
8092 2010-07-12 Cary Coutant <ccoutant@google.com>
8094 * compressed_output.cc (zlib_decompress): New function.
8095 (get_uncompressed_size): New function.
8096 (decompress_input_section): New function.
8097 * compressed_output.h (get_uncompressed_size): New function.
8098 (decompress_input_section): New function.
8099 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8100 Handle compressed debug sections.
8101 * layout.cc (is_compressed_debug_section): New function.
8102 (Layout::output_section_name): Map compressed section names to
8104 * layout.h (is_compressed_debug_section): New function.
8105 (is_debug_info_section): Recognize compressed debug sections.
8106 * merge.cc: Include compressed_output.h.
8107 (Output_merge_data::do_add_input_section): Handle compressed
8109 (Output_merge_string::do_add_input_section): Handle compressed
8111 * object.cc: Include compressed_output.h.
8112 (Sized_relobj::Sized_relobj): Initialize new data members.
8113 (build_compressed_section_map): New function.
8114 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8115 * object.h (Object::section_is_compressed): New method.
8116 (Object::do_section_is_compressed): New method.
8117 (Sized_relobj::Compressed_section_map): New type.
8118 (Sized_relobj::do_section_is_compressed): New method.
8119 (Sized_relobj::compressed_sections_): New data member.
8120 * output.cc (Output_section::add_input_section): Handle compressed
8122 * reloc.cc: Include compressed_output.h.
8123 (Sized_relobj::write_sections): Handle compressed debug sections.
8125 2010-07-08 Cary Coutant <ccoutant@google.com>
8127 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8128 weak when resolving to a dynamic def.
8129 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8130 for weak undef/dynamic def cases. Adjust callers.
8131 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8132 undef_binding_weak_.
8133 (Symbol_table::sized_write_globals): Adjust symbol binding.
8134 (Symbol_table::sized_write_symbol): Add binding parameter.
8135 * symtab.h (Symbol::set_undef_binding): New method.
8136 (Symbol::is_undef_binding_weak): New method.
8137 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8138 (Symbol_table::should_override): Add new parameter.
8139 (Symbol_table::sized_write_symbol): Add new parameter.
8141 * testsuite/weak_undef_file1.cc: Add new test case.
8142 * testsuite/weak_undef_file2.cc: Fix header comment.
8143 * testsuite/weak_undef_test.cc: Add new test case.
8145 2010-06-29 Doug Kwan <dougkwan@google.com>
8147 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8148 Initialize USE_SYMBOL_.
8149 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8151 (Arm_reloc_property::uses_symbol_): New data member declaration.
8152 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8153 uses symbol value and symbol is undefined but not weakly undefined.
8155 2010-06-28 Rafael Espindola <espindola@google.com>
8157 * plugin.cc (Plugin::load): Use dlerror.
8159 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8161 * symtab.cc (detect_odr_violations): When reporting an ODR
8162 violation, report an object where the symbol is defined.
8164 2010-06-25 Doug Kwan <dougkwan@google.com>
8166 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8167 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8169 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8170 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8171 target hook to detect function points.
8172 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8173 * icf.h (Icf::check_section_for_function_pointers): Change type of
8174 parameter SECTION_NAME to const reference to std::string. Use
8175 target hook to determine if section may have unsafe pointers.
8176 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8179 2010-06-21 Rafael Espindola <espindola@google.com>
8181 * fileread.cc (Input_file::find_fie): New
8182 (Input_file::open): Use Input_file::find_fie.
8183 * fileread.h (Input_file::find_fie): New
8184 * plugin.cc (set_extra_library_path): New.
8185 (Plugin::load): Add set_extra_library_path to the transfer vector.
8186 (Plugin_manager::set_extra_library_path): New.
8187 (Plugin_manager::add_input_file): Use the extra search path if set.
8188 (set_extra_library_path(): New.
8189 * plugin.h (Plugin_manager): Add set_extra_library_path and
8192 2010-06-19 Cary Coutant <ccoutant@google.com>
8194 * layout.cc (gdb_sections): Add .debug_types.
8195 (lines_only_debug_sections): Likewise.
8197 2010-06-18 Rafael Espindola <espindola@google.com>
8199 * plugin.cc (add_input_file,add_input_library)
8200 (Plugin_manager::add_input_file): Make filename arguments const.
8201 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8204 2010-06-16 Doug Kwan <dougkwan@google.com>
8206 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8207 .ARM.attributes section if we have not merged any input
8208 attributes sections.
8210 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8212 * arm.cc: Allow combining objects with no EABI version
8215 2010-06-15 Rafael Espindola <espindola@google.com>
8217 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8219 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8221 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8222 (struct iovec): Correct !HAVE_READV definition.
8224 2010-06-10 Cary Coutant <ccoutant@google.com>
8226 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8227 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8229 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8232 * symtab.h (Symbol::is_placeholder): New member function.
8233 * target-reloc.h (relocate_section): Check for placeholder symbols.
8235 * testsuite/Makefile.am (plugin_test_8): New test.
8236 (plugin_test_9): New test.
8237 * testsuite/Makefile.in: Regenerate.
8239 2010-06-09 Nick Clifton <nickc@redhat.com>
8241 * yyscript.y (input_list_element): Allow strings prefixed with
8242 the '-' character. Treat these as libraries.
8243 * script.cc (script_add_library): New function. Adds a library
8244 specified by "-l<name>" found in an input script.
8245 * script-c.h: Add prototype for script_add_library.
8247 2010-06-07 Doug Kwan <dougkwan@google.com>
8249 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8250 Restrict stub-group size to be within long conditional branch
8251 range when working around cortex-A8 erratum.
8253 2010-06-07 Damien Diederen <dd@crosstwine.com>
8255 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8258 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8262 (Output_section::Input_section_sort_entry::compare_section_ordering):
8263 Change to return non-zero correctly.
8264 (Output_section::Input_section_sort_section_order_index_compare
8265 ::operator()): Change to fix ambiguity in comparisons.
8267 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8269 * gold.h (is_wildcard_string): New function.
8270 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8271 (Layout::layout_eh_frame): Ditto.
8272 (Layout::find_section_order_index): New method.
8273 (Layout::read_layout_from_file): New method.
8274 * layout.h (Layout::find_section_order_index): New method.
8275 (Layout::read_layout_from_file): New method.
8276 (Layout::input_section_position_): New private member.
8277 (Layout::input_section_glob_): New private member.
8278 * main.cc (main): Call read_layout_from_file here.
8279 * options.h (--section-ordering-file): New option.
8280 * output.cc (Output_section::input_section_order_specified_): New
8282 (Output_section::Output_section): Initialize new member.
8283 (Output_section::add_input_section): Add new parameter.
8284 Keep input sections when --section-ordering-file is used.
8285 (Output_section::set_final_data_size): Sort input sections when
8286 section ordering file is specified.
8287 (Output_section::Input_section_sort_entry): Add new parameter.
8289 (Output_section::Input_section_sort_entry::compare_section_ordering):
8291 (Output_section::Input_section_sort_compare::operator()): Change to
8292 consider section_order_index.
8293 (Output_section::Input_section_sort_init_fini_compare::operator()):
8294 Change to consider section_order_index.
8295 (Output_section::Input_section_sort_section_order_index_compare
8296 ::operator()): New method.
8297 (Output_section::sort_attached_input_sections): Change to sort
8298 according to section order when specified.
8299 (Output_section::add_input_section<32, true>): Add new parameter.
8300 (Output_section::add_input_section<64, true>): Add new parameter.
8301 (Output_section::add_input_section<32, false>): Add new parameter.
8302 (Output_section::add_input_section<64, false>): Add new parameter.
8303 * output.h (Output_section::add_input_section): Add new parameter.
8304 (Output_section::input_section_order_specified): New
8306 (Output_section::set_input_section_order_specified): New method.
8307 (Input_section::Input_section): Initialize section_order_index_.
8308 (Input_section::section_order_index): New method.
8309 (Input_section::set_section_order_index): New method.
8310 (Input_section::section_order_index_): New member.
8311 (Input_section::Input_section_sort_section_order_index_compare): New
8313 (Output_section::input_section_order_specified_): New member.
8314 * script-sections.cc (is_wildcard_string): Delete and move modified
8316 (Output_section_element_input::Output_section_element_input): Modify
8317 call to is_wildcard_string.
8318 (Output_section_element_input::Input_section_pattern
8319 ::Input_section_pattern): Ditto.
8320 (Output_section_element_input::Output_section_element_input): Ditto.
8321 * testsuite/Makefile.am (final_layout): New test case.
8322 * testsuite/Makefile.in: Regenerate.
8323 * testsuite/final_layout.cc: New file.
8324 * testsuite/final_layout.sh: New file.
8326 2010-06-01 Rafael Espindola <espindola@google.com>
8328 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8330 2010-06-01 Rafael Espindola <espindola@google.com>
8332 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8333 visibility of symbols.
8335 2010-05-27 Doug Kwan <dougkwan@google.com>
8337 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8338 from start of output section instead of address for a local symbol
8339 in a merged or relaxed section when doing a relocatable link.
8341 2010-05-26 Rafael Espindola <espindola@google.com>
8344 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8345 adding sections the garbage collector removed.
8346 * gold/testsuite/Makefile.am: Add test.
8347 * gold/testsuite/Makefile.in: Regenerate.
8348 * gold/testsuite/plugin_test_7.sh: New.
8349 * gold/testsuite/plugin_test_7_1.c: New.
8350 * gold/testsuite/plugin_test_7_2.c: New.
8352 2010-05-26 Rafael Espindola <espindola@google.com>
8354 * script-sections.cc (Output_section_definition::set_section_addresses):
8355 Check for --section-start.
8357 2010-05-26 Doug Kwan <dougkwan@google.com>
8359 * arm.cc (Arm_scan_relocatable_relocs): New class.
8360 (Target_arm::relocate_special_relocatable): New method.
8361 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8362 (Arm_relocate_functions::thumb_branch_common): Same.
8363 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8364 instead of Default_scan_relocatable_relocs.
8365 * target-reloc.h (relocate_for_relocatable): Let target handle
8366 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8367 * target.h (Sized_target::relocate_special_relocatable): New method.
8369 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8371 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8373 2010-05-23 Doug Kwan <dougkwan@google.com>
8375 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8377 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8378 with a direct branch, not a conditional branch, to a stub.
8379 * merge.cc (Output_merge_base::record_input_section): New method
8381 (Output_merge_data::do_add_input_section): Record input section if
8382 keeps-input-sections flag is set.
8383 (Output_merge_string::do_add_input_section): Ditto.
8384 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8385 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8387 (Output_merge_base::keeps_input_sections,
8388 Output_merge_base::set_keeps_input_sections,
8389 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8391 (Output_merge_base::Input_sections): New type declaration.
8392 (Output_merge_base::input_sections_begin,
8393 Output_merge_base::input_sections_end,
8394 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8395 (Output_merge_base::bool keeps_input_sections_,
8396 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8397 Output_merge_base::input_sections_): New data members.
8398 (Output_merge_data::do_set_keeps_input_sections): New method
8400 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8401 * output.cc (Output_section::Input_section::relobj): Move method
8402 defintion from class declaration to here and handle merge sections.
8403 (Output_section::Input_section::shndx): Ditto.
8404 (Output_section::Output_section): Remove initializations of removed
8405 data members and initialize new data member LOOKUP_MAPS_.
8406 (Output_section::add_input_section): Set keeps-input-sections flag
8407 for a newly created merge output section as appropriate. Adjust code
8408 to use Output_section_lookup_maps class.
8409 (Output_section::add_relaxed_input_section): Adjst code for lookup
8410 maps code refactoring.
8411 (Output_section::add_merge_input_section): Add a new parameter
8412 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8413 class. If adding input section to a newly created merge output
8414 section fails, remove the new merge section.
8415 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8416 Adjust code for use of the Output_section_lookup_maps class.
8417 (Output_section::find_merge_section): Ditto.
8418 (Output_section::build_lookup_maps): New method defintion.
8419 (Output_section::find_relaxed_input_section): Adjust code to use
8420 Output_section_lookup_maps class.
8421 (Output_section::get_input_sections): Export merge sections. Adjust
8422 code to use Output_section_lookup_maps class.
8423 (Output_section:::add_script_input_section): Adjust code to use
8424 Output_section_lookup_maps class. Update lookup maps for merge
8426 (Output_section::discard_states): Use Output_section_lookup_maps.
8427 (Output_section::restore_states): Same.
8428 * output.h (Merge_section_properties): Move class defintion out of
8430 (Output_section_lookup_maps): New class.
8431 (Output_section::Input_section::is_merge_section): New method
8433 (Output_section::Input_section::relobj): Move defintion out of class
8434 defintion. Declare method only.
8435 (Output_section::Input_section::shndx): Ditto.
8436 (Output_section::Input_section::output_merge_base): New method defintion.
8437 (Output_section::Input_section::u2_.pomb): New union field.
8438 (Output_section::Merge_section_by_properties_map,
8439 Output_section::Output_section_data_by_input_section_map,
8440 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8442 (Output_section::add_merge_input_section): Add new parameter
8443 KEEPS_INPUT_SECTIONS.
8444 (Output_section::build_lookup_maps): New method declaration.
8445 (Output_section::merge_section_map_,
8446 Output_section::merge_section_by_properties_map_,
8447 Output_section::relaxed_input_section_map_,
8448 Output_section::is_relaxed_input_section_map_valid_): Remove data
8450 (Output_section::lookup_maps_): New data member.
8452 2010-05-21 Doug Kwan <dougkwan@google.com>
8455 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8456 avoid a compilation error.
8458 2010-05-19 Rafael Espindola <espindola@google.com>
8460 * script-sections.cc (Output_section_definition::allocate_to_segment):
8461 Update the phdrs_list even when the output section is NULL.
8462 * testsuite/Makefile.am: Add test.
8463 * testsuite/Makefile.in: Regenerate.
8464 * testsuite/script_test_9.cc: New.
8465 * testsuite/script_test_9.sh: New.
8466 * testsuite/script_test_9.t: New.
8468 2010-05-19 Doug Kwan <dougkwan@google.com>
8470 * arm.cc (Arm_input_section::original_size): New method.
8471 (Arm_input_section::do_addralign): Add a cast.
8472 (Arm_input_section::do_output_offset): Remove static cast.
8473 (Arm_input_section::original_addralign,
8474 Arm_input_section::original_size_): Change type to uint32_t.
8475 (Arm_input_section::init): Add safe casts for section alignment
8477 (Arm_input_section::set_final_data_size): Do not set address and
8478 offset of stub table.
8479 (Arm_output_section::fix_exidx_coverage): Change use of of
8480 Output_section::Simple_input_section to that of
8481 Output_section::Input_section.
8482 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8483 except for the first pass.
8484 * output.cc (Output_section::get_input_sections): Change type of
8485 input_sections to std::list<Input_section>.
8486 (Output_section::add_script_input_section): Rename from
8487 Output_section::add_simple_input_section. Change type of SIS
8488 parameter from Simple_input_section to Input_section.
8489 * output.h (Output_section::Simple_input_section): Remove class.
8490 (Output_section::Input_section): Change class visibility to public.
8491 (Output_section::Input_section::addralign): Use stored alignments
8492 for special input sections if set.
8493 (Output_section::Input_section::set_addralign): New method.
8494 (Output_section::get_input_sections): Change parameter type from
8495 list of Simple_input_section to list of Input_section.
8496 (Output_section::add_script_input_section): Rename from
8497 Output_section::add_simple_input_section. Change first parameter's
8498 type from Simple_input_section to Input_section and remove the
8499 second and third parameters.
8500 * script-sections.cc (Input_section::Input_section_list): Change
8501 type to list of Output_section::Input_section/
8502 (Input_section_info::Input_section_info): Change parameter type of
8503 INPUT_SECTION to Output_section::Input_section.
8504 (Input_section_info::input_section): Change return type.
8505 (Input_section_info::input_section_): Change type to
8506 Output_section::Input_section.
8507 (Output_section_element_input::set_section_addresses): Adjust code
8508 to use Output_section::Input_section instead of
8509 Output_section::Simple_input_section. Adjust code for renaming
8510 of Output_section::add_simple_input_section.
8511 (Orphan_output_section::set_section_addresses): Ditto.
8513 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8515 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8516 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8518 2010-05-18 Rafael Espindola <espindola@google.com>
8520 * options.cc (General_options::finalize): Handle -nostdlib.
8521 * options.h (nostdlib): New option.
8522 * script.cc (script_add_search_dir): Handle -nostdlib.
8524 2010-05-12 Doug Kwan <dougkwan@google.com>
8526 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8527 attributes section only if there no attributes section after merging.
8528 (Target_arm::merge_object_attributes): Move value of
8529 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8530 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8531 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8532 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8533 and arm_attr_merge_7.stdout.
8534 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8535 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8536 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8537 arm_attr_merge_7b.o): New rules.
8538 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8540 * testsuite/Makefile.in: Regenerate.
8541 * testsuite/arm_attr_merge.sh: New file.
8542 * testsuite/arm_attr_merge_[67][ab].s: Same.
8544 2010-05-05 Nick Clifton <nickc@redhat.com>
8546 * po/es.po: Updated Spanish translation.
8548 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8550 * Makefile.am (install-exec-local): Properly install gold as
8551 default cross linker.
8552 * Makefile.in: Regenerated.
8554 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8555 Nick Clifton <nickc@redhat.com>
8557 * configure.ac (install_as_default): Define and set to false
8558 unless --enable-gold or --enable-gold=both/gold has been
8560 * configure: Regenerate.
8562 * Makefile.am (install-exec-local): Install the executable as
8563 'ld.gold'. If install_as_default is true then also install it as
8565 * Makefile.in: Regenerated.
8567 2010-04-24 Ian Lance Taylor <iant@google.com>
8569 * layout.cc (Layout::layout_reloc): In relocatable link don't
8570 combine reloc sections for grouped sections.
8572 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8574 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8575 sections that are not ordinary to icf.
8576 * icf.cc (get_section_contents): Handle relocation pointing to section
8577 with no object or shndx information.
8578 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8579 * testsuite/Makefile.in: Regenerate.
8580 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8581 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8583 2010-04-22 Ian Lance Taylor <iant@google.com>
8585 * expression.cc (Expression::Expression_eval_info): Add
8586 result_alignment_pointer field.
8587 (Expression::eval_with_dot): Add result_alignment_pointer
8588 parameter. Change all callers.
8589 (Expression::eval_maybe_dot): Likewise.
8590 (class Binary_expression): Add alignment_pointer parameter to
8591 left_value and right_value. Change all callers.
8592 (BINARY_EXPRESSION): Set result alignment.
8593 (class Trinary_expression): Add alignment_pointer parameter to
8594 arg2_value and arg3_value. Change all callers.
8595 (Trinary_cond::value): Set result alignment.
8596 (Max_expression::value, Min_expression::value): Likewise.
8597 (Align_expression::value): Likewise.
8598 * script-sections.cc (class Sections_element): Add dot_alignment
8599 parameter to set_section_addresses virtual function. Update
8601 (class Output_section_element): Likewise.
8602 (Script_sections::create_segments): Add dot_alignment parameter.
8604 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8605 (Script_sections::set_phdrs_clause_addresses): Likewise.
8606 * script-sections.h: Update declarations.
8607 * script.h: Update declarations.
8608 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8610 * testsuite/script_test_3.t: Set large alignment.
8611 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8612 segment has expected alignment.
8614 2010-04-22 Nick Clifton <nickc@redhat.com>
8616 * po/gold.pot: Updated by the Translation project.
8617 * po/vi.po: Updated Vietnamese translation.
8619 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8621 * testsuite/Makefile.am (check_PROGRAMS): Add
8622 icf_virtual_function_folding_test.
8623 * testsuite/Makefile.in: Regenerated.
8625 2010-04-15 Andrew Haley <aph@redhat.com>
8627 * options.h (merge_exidx_entries): New option.
8628 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8629 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8630 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8631 (Target_arm::merge_exidx_entries): New function.
8632 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8633 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8634 to Arm_exidx_fixup constructor.
8635 Add new arg, merge_exidx_entries.
8636 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8637 Arm_output_section::fix_exidx_coverage.
8639 2010-04-18 Sriraman Tallam <tmsriram@google.com>
8641 * icf.cc (get_section_contents): Check for preemptible functions.
8642 Ignore addend when appropriate.
8643 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8645 (add_from_relobj): Check for section folded.
8646 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8647 * symtab.h (should_add_dynsym_entry): Add new parameter.
8648 * target-reloc.h (scan_relocs): Check for section folded.
8649 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8650 Check reloc types for function pointers in shared objects.
8651 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8653 (icf_preemptible_functions_test): New test case.
8654 (icf_string_merge_test): New test case.
8655 * testsuite.Makefile.in: Regenerate.
8656 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8657 bar_glob. Refactor code.
8658 * testsuite/icf_preemptible_functions_test.cc: New file.
8659 * testsuite/icf_preemptible_functions_test.sh: New file.
8660 * testsuite/icf_string_merge_test.cc: New file.
8661 * testsuite/icf_string_merge_test.sh: New file.
8662 * testsuite/icf_virtual_function_folding_test.cc: New file.
8663 * testsuite/icf_virtual_function_folding_test.sh: New file.
8665 2010-04-14 Doug Kwan <dougkwan@google.com>
8667 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8668 for local symbol recounting if we remove a section due to ICF.
8669 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8670 there are no regular objects in input.
8672 2010-04-13 Doug Kwan <dougkwan@google.com>
8674 * arm.cc (Arm_input_section::set_final_data_size): Compute
8675 accurate final data size instead of using current data size.
8677 2010-04-09 Doug Kwan <dougkwan@google.com>
8679 * layout.cc (Layout::choose_output_section): Handle script section
8681 (Layout::make_output_section_for_script): Add section type parameter.
8682 Handle script section types.
8683 * layout.h (Layout::make_output_section_for_script): Add section
8685 * output.cc (Output_section::Output_section): Initialize data member
8687 (Output_section::do_reset_address_and_file_offset): Do not set address
8688 to 0 if section is a NOLOAD section.
8689 * output.h (Output_section::is_noload): New method.
8690 (Output_section::set_is_noload): Ditto.
8691 (Output_section::is_noload_): New data member.
8692 * script-c.h (Script_section_type): New enum type.
8693 (struct Parser_output_section_header): Add new file section_type.
8694 * script-sections.cc (Sections_element::output_section_name): Add
8695 parameter for returning script section type.
8696 (Output_section_definition::output_section_name): Ditto.
8697 (Output_section_definition::section_type)P; New method.
8698 (Output_section_definiton::script_section_type_name): Ditto.
8699 (Output_section_definition::script_section_type_): New data member.
8700 (Output_section_definition::Output_section_definition): Initialize
8701 data member Output_section_definition::script_section_type_.
8702 (Output_section_definition::create_sections): Pass script section type
8703 to Layout::make_output_section_for_script.
8704 (Output_section_definition::output_section_name): Return script
8705 section type to caller.
8706 (Output_section_definition::set_section_address): Do not advance
8707 dot value and load address if section type is NOLOAD. Set address
8708 of NOLOAD sections regardless of section flags.
8709 (Output_section_definition::print): Print section type if it is
8710 not SCRIPT_SECTION_TYPE_NONE.
8711 (Output_section_definition::section_type): New method.
8712 (Output_section_definition::script_section_type_name): Ditto.
8713 (Script_sections::output_section_name): Add new parameter
8714 PSECTION_TYPE for returning script section type. Pass it to
8715 section elements. Handle discard sections.
8716 (Sort_output_sections::operator()): Handle NOLOAD sections.
8717 * script-sections.h (Script_sections::Section_type): New enum type.
8718 (Script_sections::output_section_name): Add a new parameter for
8719 returning script section type.
8720 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8722 * yyscript.y (union): Add new field SECTION_TYPE.
8723 (COPY, DSECT, INFO, NOLOAD): New tokens.
8724 (opt_address_and_section_type): Change type to output_section_header.
8725 (section_type): New non-terminal
8726 (section_header): Handle section type.
8727 (opt_address_and_section_type): Return section type value.
8729 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8731 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8732 * testsuite/plugin_common_test_2.c (foo): Likewise.
8734 2010-04-08 Doug Kwan <dougkwan@google.com>
8736 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8738 * output.cc (Output_section::add_merge_input_section): Simplify
8739 code and return status of Output_merge_base::add_input_section.
8740 Update merge section map only if Output_merge_base::add_input_section
8743 2010-04-07 Doug Kwan <dougkwan@google.com>
8745 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8746 if section is marked as containing instructions but has no mapping
8748 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8749 correct section index.
8750 (Arm_relobj::find_linked_text_section): Ditto.
8752 2010-04-07 Cary Coutant <ccoutant@google.com>
8754 * archive.cc (include_member): Destroy Read_symbols_data object before
8756 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8757 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8758 (Read_symbols_data::~Read_symbols_data) New destructor.
8759 (Section_relocs::Section_relocs) New constructor.
8760 (Section_relocs::~Section_relocs) New destructor.
8761 (Read_relocs_data::Read_relocs_data) New constructor.
8762 (Read_relocs_data::~Read_relocs_data) New destructor.
8763 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8764 pointers to NULL after deleting.
8766 2010-04-07 Doug Kwan <dougkwan@google.com>
8768 * arm.cc: Replace "endianity" with "endianness" in comments.
8769 (Arm_exidx_cantunwind): Ditto.
8770 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8771 (Arm_relobj::merge_flags_and_attributes): New method.
8772 (Arm_relobj::merge_flags_and_attributes_): New data member.
8773 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8774 (Arm_relobj::scan_sections_for_stubs): Ditto.
8775 (Arm_relobj::do_read_symbols): Check to see if we really want to
8776 merge processor-specific flags and attributes. Exit early if
8777 an object is empty except for section names and the undefined symbol.
8778 (Target_arm::do_finalize_sections): Move check for ELF format to
8779 Arm_relobj::do_read_symbols. Merge processor specific flags and
8780 attributes from a regular object only when we have determined that
8781 it is aapropriate. Do not create an .ARM.attributes section in
8782 output if there is no regular input object.
8783 (Target_arm::merge_processor_specific_flags): Check
8784 --warn-mismatch before printing any error.
8785 (Target_arm::merge_object_attributes): Ditto.
8786 * gold.cc (queue_middle_tasks): Handle the case in which there is
8787 no regular object in input.
8788 * options.cc (General_options::parse_EB): New method.
8789 (General_options::parse_EL): Same.
8790 (General_options::General_options): Initialize endianness_.
8791 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8793 (General_options::Endianness): New enum.
8794 (General_options::endianness): New method.
8795 (General_options::endianness_): New data member.
8796 * parameters.cc (Parameters::set_options): Check target endianness.
8797 (Parameters::set_target_once): Ditto.
8798 (Parameters::check_target_endianness): New method.
8799 (parameters_force_valid_target): If either -EL or -EB is specified,
8800 use it to define endianness of default target.
8801 * parameters.h (Parameters::check_target_endianness): New method
8803 * target.h (class Target): Change "endianity" to "endianness"
8806 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8808 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8809 * configure: Regenerate.
8810 * Makefile.in: Regenerate.
8811 * testsuite/Makefile.in: Regenerate.
8813 2010-04-06 Cary Coutant <ccoutant@google.com>
8816 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8817 prevailing definitions of common symbols.
8818 * testsuite/plugin_test_6.sh: New test case.
8819 * testsuite/plugin_common_test_1.c: New test case.
8820 * testsuite/plugin_common_test_2.c: New test case.
8821 * testsuite/Makefile.am (plugin_test_6): New test case.
8822 * testsuite/Makefile.in: Regenerate.
8824 2010-04-06 Nick Clifton <nickc@redhat.com>
8826 * po/vi.po: New Vietnamese translation.
8828 2010-03-30 Doug Kwan <dougkwan@google.com>
8830 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8832 2010-03-25 Doug Kwan <dougkwan@google.com>
8834 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8835 to avoid a conversion warning on a 32-bit host.
8837 2010-03-24 Ian Lance Taylor <iant@google.com>
8839 * testsuite/script_test_3.t: Add a TLS segment.
8840 * testsuite/Makefile.am (check_PROGRAMS): Add
8841 tls_phdrs_script_test.
8842 (tls_phdrs_script_test_SOURCES): Define.
8843 (tls_phdrs_script_test_DEPENDENCIES): Define.
8844 (tls_phdrs_script_test_LDFLAGS): Define.
8845 (tls_phdrs_script_test_LDADD): Define.
8846 * testsuite/Makefile.in: Rebuild.
8848 2010-03-23 Cary Coutant <ccoutant@google.com>
8850 * fileread.cc (find_or_make_view): Fix comment.
8852 2010-03-23 Ian Lance Taylor <iant@google.com>
8854 * script-sections.cc (class Orphan_section_placement): Define
8855 PLACE_TLS and PLACE_TLS_BSS.
8856 (Orphan_section_placement::Orphan_section_placement): Initialize
8858 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8859 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8860 (tls_script_test_SOURCES): Define.
8861 (tls_script_test_DEPENDENCIES): Define.
8862 (tls_script_test_LDFLAGS): Define.
8863 (tls_script_test_LDADD): Define.
8864 * testsuite/Makefile.in: Rebuild.
8866 2010-03-22 Doug Kwan <dougkwan@google.com>
8868 * arm.cc (Arm_relocate_functions::abs8,
8869 Arm_relocate_functions::abs16): Use correct check for overflow
8870 specified in the ARM ELF specs.
8871 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8872 target of a BLX instruction specially.
8873 (Reloc_stub::stub_type_for_reloc): Ditto.
8874 (Relocate::relocate): Use symbolic names instead of numeric relocation
8875 codes to report error.
8876 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8878 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8879 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8880 thumb2_blx_out_of_range.stdout
8881 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8882 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8883 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8884 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8885 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8886 thumb2_blx_in_range, thumb2_blx_in_range.o,
8887 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8888 thumb2_blx_out_of_range.o): New rules.
8889 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
8890 thumb2_blx_in_range and thumb2_blx_out_of_range.
8891 * testsuite/Makefile.in: Regenerate.
8892 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8893 * testsuite/thumb_blx_in_range.s: New file.
8894 * testsuite/thumb_blx_out_of_range.s: New file.
8896 2010-03-22 Rafael Espindola <espindola@google.com>
8898 * archive.cc (Should_include): Move to archive.h.
8899 (should_include_member): Make it a member of Archive.
8901 (Add_lib_group_symbols): New.
8902 * archive.h: Include options.h.
8903 (Archive_member): Moved from Archive.
8904 (Should_include): Moved from archive.cc.
8906 (Add_lib_group_symbols): New.
8907 * dynobj.cc (do_should_include_member): New.
8908 * dynobj.h (do_should_include_member): New.
8909 * gold.cc (queue_initial_tasks): Update call to queue.
8910 * main.cc (main): Print lib group stats.
8911 * object.cc (do_should_include_member): New.
8912 * object.h: Include archive.h.
8913 (Object::should_include_member): New.
8914 (Object::do_should_include_member): New.
8915 (Sized_relobj::do_should_include_member): New.
8916 * options.cc (General_options::parse_start_lib): New.
8917 (General_options::parse_end_lib): New.
8918 (Input_arguments::add_file): Handle lib groups.
8919 (Input_arguments::start_group): Check we are not in a lib.
8920 (Input_arguments::start_lib): New.
8921 (Input_arguments::end_lib): New.
8922 * options.h (General_options): Add start_lib and end_lib.
8923 (Input_argument::lib_): New.
8924 (Input_argument::lib): New.
8925 (Input_argument::is_lib): New.
8926 (Input_file_lib): New.
8927 (Input_arguments::in_lib_): New.
8928 (Input_arguments::in_lib): New.
8929 (Input_arguments::start_lib): New.
8930 (Input_arguments::end_lib_): New.
8931 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8932 in unused members as preempted.
8933 (Sized_pluginobj::do_should_include_member): New.
8934 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8935 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8937 (Read_symbols::do_whole_lib_group): New.
8938 (Read_symbols::do_lib_group): New.
8939 (Read_symbols::do_read_symbols): Handle lib groups.
8940 (Read_symbols::get_name): Handle lib groups.
8941 * readsyms.h (Read_symbols): Add an archive member pointer.
8942 (Read_symbols::do_whole_lib_group): New.
8943 (Read_symbols::do_lib_group): New.
8944 (Read_symbols::member_): New.
8945 * script.cc (read_input_script): Update call to queue_soon.
8947 2010-03-19 Doug Kwan <dougkwan@google.com>
8949 * arm.cc (Stub_table::Stub_table): Initialize new data members
8950 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8951 (Stub_table::add_reloc_stub): Assign stub offset and update
8952 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8953 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8955 (Stub_table::update_data_size_and_addralign): Use
8956 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8957 instead of going over all reloc stubs.
8958 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
8959 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8960 Stringpool_template::offset_ to size of Stringpool_char.
8961 (Stringpool_template::new_key_offset): Remove code to initialize
8962 Stringpool_template::offset_.
8963 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8964 Stringpool_template::offset_ to zero.
8966 2010-03-15 Doug Kwan <dougkwan@google.com>
8968 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8970 (Stringpool_template::new_key_offset): New method.
8971 (Stringpool_template::add_string): Assign offsets when adding new
8973 (Stringpool_template::set_string_offsets): Do not set string offsets
8974 when not optimizing.
8975 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8977 (Chunked_vector::clear): Clear size_.
8978 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8979 (Chunked_vector::size): Return size_.
8980 (Chunked_vector::push_back): Use size_ to find insert position.
8981 (Chunked_vector::size_): New data member.
8982 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8983 (Stringpool_template::new_key_offset): New method declaration.
8984 (Stringpool_template::offset_): New data member.
8986 2010-03-15 Rafael Espindola <espindola@google.com>
8988 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8989 Add_symbols' constructor.
8990 * readsyms.h (Add_symbols): Remove the input_group member.
8992 2010-03-10 Ian Lance Taylor <iant@google.com>
8994 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8995 target to ask whether a reference to a symbol requires a stack
8997 * target.h (Target::is_call_to_non_split): New function.
8998 (Target::do_is_call_to_non_split): Declare virtual function.
8999 * target.cc: Include "symtab.h".
9000 (Target::do_is_call_to_non_split): New function.
9001 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9003 2010-03-10 Cary Coutant <ccoutant@google.com>
9005 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9006 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9007 (File_read::open[2]): Add whole_file_view_ to list of views.
9008 (File_read::make_view): Remove test of whole_file_view_.
9009 (File_read::find_or_make_view): Create whole_file_view_ if
9011 (File_read::clear_views): Replace bool parameter with enum;
9012 adjust all callers. Don't delete views with permanent data;
9013 do delete cached views and views from archives if
9014 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9015 if clearing the corresponding view.
9016 * fileread.h (File_read::Clear_views_mode): New enum.
9017 (File_read::View::is_permanent_view): New method.
9018 (File_read::clear_views): Replace bool parameter
9019 with enum; adjust all callers.
9020 * options.h (General_options): Change keep_files_mapped option;
9021 add map_whole_files.
9022 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9024 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9027 2010-03-10 David S. Miller <davem@davemloft.net>
9029 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9031 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9033 * icf.cc (get_section_contents): Add '@' marker after processing the
9036 2010-03-08 Doug Kwan <dougkwan@google.com>
9038 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9039 due to a conversion warning.
9040 (Arm_relobj::update_output_local_symbol_count): Check for local
9041 symbol with unset output index.
9043 2010-03-05 Ian Lance Taylor <iant@google.com>
9045 * options.h (class General_options): Add --spare-dynamic-tags.
9046 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9047 --spare-dynamic-tags.
9049 2010-03-05 Ian Lance Taylor <iant@google.com>
9051 * incremental.cc: Include "libiberty.h".
9053 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9055 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9056 function, is_info_ member.
9057 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9058 (Versions::Versions): Update caller.
9059 (Versions::define_base_version): Likewise.
9060 (Versions::add_def): Likewise.
9062 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9064 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9065 (Scan::possible_function_pointer_reloc): New function.
9066 (Scan::local_reloc_may_be_function_pointer): Change to call
9067 possible_function_pointer_reloc.
9068 (Scan::global_reloc_may_be_function_pointer): Ditto.
9069 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9070 relocations in ".data.rel.ro._ZTV" section.
9071 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9072 * testsuite/icf_safe_so_test.cc: Ditto.
9073 * testsuite/icf_safe_test.cc: Ditto.
9074 * testsuite/icf_safe_test.sh: Ditto.
9076 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9077 Ian Lance Taylor <iant@google.com>
9079 * target-reloc.h (relocate_section): Check the symbol table index
9080 for -1U before setting the local symbol index.
9081 (scan_relocatable_relocs): If copying the relocation, record that
9082 the local symbol is required.
9083 * object.h (Symbol_value::is_output_symtab_index_set): New
9085 (Symbol_value::may_be_discarded_from_output_symtab): New
9087 (Symbol_value::has_output_symtab_entry): New function.
9088 (Symbol_value::needs_output_symtab_entry): Remove.
9089 (Symbol_value::output_symtab_index): Make sure the symbol index is
9091 (Symbol_value::set_output_symtab_index): Make sure the symbol
9092 index is not set. Make sure the new index is valid.
9093 (Symbol_value::set_must_have_output_symtab_entry): New function.
9094 (Symbol_value::has_output_dynsym_entry): New function.
9095 (Symbol_value::set_output_dynsym_index): Make sure the new index
9097 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9098 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9099 local symbol if permitted.
9100 (Sized_relobj::do_finalize_local_symbols): Call
9101 is_output_symtab_index_set rather than needs_output_symtab_entry.
9102 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9103 rather than needs_output_symtab_entry. Call
9104 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9105 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9106 is_output_symtab_index_set rather than needs_output_symtab_entry.
9107 * testsuite/discard_locals_relocatable_test.c: New file.
9108 * testsuite/discard_locals_test.sh: Test -r.
9109 * testsuite/Makefile.am (check_DATA): Add
9110 discard_locals_relocatable_test1.syms,
9111 discard_local_relocatable_test2.syms.
9112 (MOSTLYCLEANFILES): Likewise. Also add
9113 discard_locals_relocatable_test1.lout and
9114 discard_locals_relocatable_test2.out.
9115 (discard_locals_relocatable_test1.syms): New target.
9116 (discard_locals_relocatable_test.o): New target.
9117 (discard_locals_relocatable_test1.out): New target.
9118 (discard_locals_relocatable_test2.syms): New target.
9119 (discard_locals_relocatable_test2.out): New target.
9120 (various): Add missing ../ld-new dependencies.
9121 * testsuite/Makefile.in: Rebuild.
9123 2010-03-03 Nick Clifton <nickc@redhat.com>
9125 * po/fi.po: New Finnish translation.
9127 2010-03-01 Doug Kwan <dougkwan@google.com>
9129 * layout.cc (Layout::Layout): Force section types of .init_array*,
9130 .preinit_array* and .fini_array* sections.
9131 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9132 Fix check of return value of std::string::find.().
9133 (Output_section::Input_section_sort_compare::operator()): Remove
9134 comment about .init_array.
9135 (Output_section::Input_section_sort_init_fini_compare::operator()):
9137 (Output_section::sort_attached_input_sections): Handle .init_array
9138 and .fini_array specially.
9139 * output.h (Output_section::Inut_section_sort_compare): Update
9141 (Output_section::Input_section_sort_init_fini_compare): New struct.
9143 2010-02-26 Doug Kwan <dougkwan@google.com>
9145 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9146 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9147 * testsuite/debug_msg.sh: Avoid matching source line number for
9148 use of global variable undef_int.
9150 2010-02-26 Doug Kwan <dougkwan@google.com>
9152 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9153 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9154 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9155 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9156 * options.cc (General_options::General_options): Initialize member
9158 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9159 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9160 and rm_no_fix_v4bx.stdout
9161 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9162 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9163 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9164 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9165 and arm_no_fix_v4bx.
9166 * Makefile.in: Regenerate.
9167 * testsuite/arm_fix_v4bx.s: New file.
9168 * testsuite/arm_fix_v4bx.sh: Ditto.
9170 2010-02-24 Doug Kwan <dougkwan@google.com>
9172 * arm.cc (Target_arm::got_section): Make the .got section the first
9173 non RELRO section in the data segment.
9174 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9175 suffixes of section names.
9177 2010-02-24 Doug Kwan <dougkwan@google.com>
9179 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9180 flags and attributes merging if an input file is a binary file.
9181 * fileread.cc (Input_file::open): Record format of original file.
9182 * fileread.h (Input_file::Format): New enum type.
9183 (Input_file::Input_file): Initialize data member format_.
9184 (Input_file::format): New method definition.
9185 (Input_file::format_):: New data member.
9187 2010-02-24 Doug Kwan <dougkwan@google.com>
9189 * arm.cc (Arm_output_data_got): New class.
9190 (ARM_TCB_SIZE): New constant
9191 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9192 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9193 If user uses a script with a SECTIONS clause, issue only a warning
9194 for a misplaced EXIDX input section. Otherwise, issue an error.
9195 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9197 (Target_arm::got_mode_index_entry): Handle static linking.
9198 (Target_arm::Scan::local): Ditto.
9199 (Target_arm::Scan::global): Ditto.
9200 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9201 all incorrectly implemented relocations.
9202 (Target_arm::fix_exidx_coverage): Pass layout to
9203 Arm_output_section::fix_exidx_coverage.
9204 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9205 from ".ARM.exidx." and ".ARM.extab.".
9207 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9209 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9210 section if it does not already exist.
9211 * attributes.cc (Attributes_section_data::Attributes_section_data):
9212 Don't crash if size is zero.
9214 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9215 Ian Lance Taylor <iant@google.com>
9217 * gold.cc (queue_middle_tasks): If no input files were opened,
9219 * workqueue.h (Task_function::Task_function): Assert that there is
9222 2010-02-22 Doug Kwan <dougkwan@google.com>
9224 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9225 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9226 types to avoid warnings due to different uint64_t implementations
9229 2010-02-21 Doug Kwan <dougkwan@google.com>
9231 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9232 handling of the maximum backward branch offset.
9233 (Arm_relocate_functions::thumb_branch_common): Ditto.
9234 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9235 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9236 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9237 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9238 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9239 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9240 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9241 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9242 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9243 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9244 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9245 thumb2_bl_out_of_range.o): New rules.
9246 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9247 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9248 thumb2_bl_out_of_range
9249 * testsuite/Makefile.in: Regenerate.
9250 * testsuite/arm_bl_in_range.s: New file.
9251 * testsuite/arm_bl_out_of_range.s: Ditto.
9252 * testsuite/arm_branch_in_range.sh: Ditto.
9253 * testsuite/arm_branch_range.t: Ditto.
9254 * testsuite/thumb2_branch_range.t: Ditto.
9255 * testsuite/thumb_bl_in_range.s: Ditto.
9256 * testsuite/thumb_bl_out_of_range.s: Ditto.
9257 * testsuite/thumb_branch_range.t: Ditto.
9259 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9261 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9262 Add reloc offset information.
9263 * icf.cc (get_section_contents): Change iterators to point to the new
9264 vectors. Add reloc offset information to the contents.
9265 * icf.h (Icf::Sections_reachable_info): New typedef.
9266 (Icf::Sections_reachable_list): New typedef.
9267 (Icf::Offset_info): New typedef.
9268 (Icf::Reloc_info): New struct typedef.
9269 (Icf::Reloc_info_list): New typedef.
9270 (Icf::symbol_reloc_list): Delete method.
9271 (Icf::addend_reloc_list): Delete method.
9272 (Icf::section_reloc_list): Delete method.
9273 (Icf::reloc_info_list): New method.
9274 (Icf::reloc_info_list_): New member.
9276 2010-02-19 Doug Kwan <dougkwan@google.com>
9278 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9279 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9280 * arm.cc (Arm_relocation_functions): New forward declaration.
9281 (Target_arm::Target_arm): Initialize new data members
9282 got_mod_index_offset_ and tls_base_symbol_defined_.
9283 (Target_arm::Relocate::relocate_tls): New method.
9284 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9285 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9287 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9288 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9289 (Target_arm::got_mod_index_offset_,
9290 Target_arm::tls_base_symbol_defined_): New data members.
9291 (Target_arm::Scan::local, Target::Scan::global,
9292 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9295 2010-02-18 Doug Kwan <dougkwan@google.com>
9297 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9298 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9299 text section as a parameter becuase some broken tools may not set
9300 the link in section header.
9301 (Target_arm::has_got_section): New method.
9302 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9303 without any mapping symbol as data only. Remove warning.
9304 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9305 link in its section header, try to discover the link by inspecting the
9306 REL31 relocation at the beginning of the section.
9307 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9309 (Target_arm::Scan::global): Treat any reference to the symbol
9310 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9312 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9314 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9315 (Scan::global_reloc_may_be_function_pointer): New function.
9316 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9317 (Scan::global_reloc_may_be_function_pointer): New function.
9318 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9319 (Scan::global_reloc_may_be_function_pointer): New function.
9320 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9321 (Scan::global_reloc_may_be_function_pointer): New function.
9322 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9323 (Scan::global_reloc_may_be_function_pointer): New function.
9324 (Scan::possible_function_pointer_reloc): New function.
9325 (Target_x86_64::can_check_for_function_pointers): New function.
9326 * gc.h (gc_process_relocs): Scan relocation types to determine if
9327 function pointers were taken for targets that support it.
9328 * icf.cc (Icf::find_identical_sections): Include functions for
9329 folding in safe ICF whose pointer is not taken.
9330 * icf.h (Secn_fptr_taken_set): New typedef.
9331 (fptr_section_id_): New member.
9332 (section_has_function_pointers): New function.
9333 (set_section_has_function_pointers): New function.
9334 (check_section_for_function_pointers): New function.
9335 * options.h: Fix comment for safe ICF option.
9336 * target.h (can_check_for_function_pointers): New function.
9337 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9338 Modify icf_safe_test for X86-64.
9339 * testsuite/Makefile.in: Regenerate.
9340 * testsuite/icf_safe_so_test.cc: New file.
9341 * testsuite/icf_safe_so_test.sh: New file.
9342 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9343 (main): Change to take pointer to function kept_func_3.
9344 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9345 folding is done correctly for X86-64.
9347 2010-02-12 David S. Miller <davem@davemloft.net>
9349 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9350 is_symbolless parameter.
9351 (Output_reloc<SHT_REL>::is_symbolless): New.
9352 (Output_reloc<SHT_REL>::is_symbolless_): New.
9353 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9354 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9355 (Output_reloc<SHT_RELA>::is_symbolless): New.
9356 (Output_data_reloc::add_global): Handle is_symbolless.
9357 (Output_data_reloc::add_global_relative): Likewise.
9358 (Output_data_reloc::add_local): Likewise.
9359 (Output_data_reloc::add_local_relative): Likewise.
9360 (Output_data_reloc::add_symbolless_global_addend): New.
9361 (Output_data_reloc::add_symbolless_local_addend): New.
9362 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9364 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9365 instead of ->is_relative_
9366 (Output_reloc::write): Likewise.
9367 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9368 (Output_reloc::write_rel): Simplify.
9370 * sparc.cc (Target_sparc::Scan::local): Use
9371 ->add_symbolless_local_addend as needed.
9372 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9373 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9374 based upon relocation offset.
9376 2010-02-11 Doug Kwan <dougkwan@google.com>
9378 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9379 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9380 beginning of function.
9381 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9382 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9383 parameter is_32bit in calls to should_apply_static_reloc.
9384 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9385 (check_DATA): Add arm_abs_global.stdout.
9386 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9387 arm_abs_global.stdout): New rules.
9388 (MOSTLLYCLEANFILES): Add arm_abs_global
9389 * Makefile.in: Regenerate.
9390 * testsuite/arm_abs_global.s: New file.
9391 * testsuite/arm_abs_global.sh: Ditto.
9392 * testsuite/arm_abs_lib.s: Ditto.
9394 2010-02-11 Ian Lance Taylor <iant@google.com>
9396 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9398 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9399 Allocate_commons_task first.
9400 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9401 task, rather than symtab_lock_.
9402 (Gc_process_relocs::~Gc_process_relocs): New function.
9403 (Gc_process_relocs::is_runnable): Check this_blocker_.
9404 (Gc_process_relocs::locks): Use next_blocker_ rather than
9406 (Scan_relocs::~Scan_relocs): New function.
9407 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9409 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9411 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9412 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9413 constructor accordingly.
9414 (class Gc_process_relocs): Likewise.
9415 (class Scan_relocs): Likewise.
9416 * common.h (class Allocate_commons_task): Remove symtab_lock_
9417 field, and corresponding constructor parameter.
9418 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9420 (Allocate_commons_task::locks): Likewise.
9422 2010-02-11 Ian Lance Taylor <iant@google.com>
9424 * gold-threads.h (class Once): Define.
9425 (class Initialize_lock): Rewrite as child of Once.
9426 * gold-threads.cc (class Once_initialize): Define.
9427 (once_pointer_control): New static variable.
9428 (once_pointer, once_arg): New static variables.
9429 (c_run_once): New static function.
9430 (Once::Once, Once::run_once, Once::internal_run): New functions.
9431 (class Initialize_lock_once): Remove.
9432 (initialize_lock_control): Remove.
9433 (initialize_lock_pointer): Remove.
9434 (initialize_lock_once): Remove.
9435 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9436 (Initialize_lock::initialize): Rewrite.
9437 (Initialize_lock::do_run_once): New function.
9438 * archive.cc (Archive::interpret_header): Only clear name if it is
9440 * fileread.cc: Include "gold-threads.h"
9441 (file_counts_lock): New static variable.
9442 (file_counts_initialize_lock): Likewise.
9443 (File_read::release): Only increment counts when using --stats.
9444 Use a lock around the increment.
9445 * parameters.cc (class Set_parameters_target_once): Define.
9446 (set_parameters_target_once): New static variable.
9447 (Parameters::Parameters): Move here from parameters.h.
9448 (Parameters::set_target): Rewrite.
9449 (Parameters::set_target_once): New function.
9450 (Parameters::clear_target): Move here and rewrite.
9451 * parameters.h (class Parameters): Update declarations. Add
9452 set_parameters_target_once_ field.
9453 (Parameters::Parameters): Move to parameters.cc.
9454 (Parameters::clear_target): Likewise.
9455 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9457 (Start_group::~Start_group): New function.
9458 (Start_group::is_runnable): New function.
9459 (Start_group::locks, Start_group::run): New functions.
9460 (Finish_group::run): Change saw_undefined to size_t.
9461 * readsyms.h (class Start_group): Define.
9462 (class Finish_group): Change saw_undefined_ field to size_t.
9463 (Finish_group::Finish_group): Remove saw_undefined and
9464 this_blocker parameters. Change all callers.
9465 (Finish_group::set_saw_undefined): New function.
9466 (Finish_group::set_blocker): New function.
9467 * symtab.h (class Symbol_table): Change saw_undefined to return
9468 size_t. Change saw_undefined_ field to size_t.
9469 * target-select.cc (Set_target_once::do_run_once): New function.
9470 (Target_selector::Target_selector): Initialize set_target_once_
9471 field. Don't initialize lock_ and initialize_lock_ fields.
9472 (Target_selector::instantiate_target): Rewrite.
9473 (Target_selector::set_target): New function.
9474 * target-select.h (class Set_target_once): Define.
9475 (class Target_selector): Update declarations. Make
9476 Set_target_once a friend. Remove lock_ and initialize_lock_
9477 fields. Add set_target_once_ field.
9479 2010-02-10 Ian Lance Taylor <iant@google.com>
9481 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9483 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9484 (queue_middle_tasks): Add all blockers before queueing any tasks.
9485 (queue_final_tasks): Likewise.
9486 * token.h (Task_token::add_blockers): New function.
9487 * object.h (Input_objects::number_of_relobjs): New function.
9489 2010-02-10 Ian Lance Taylor <iant@google.com>
9491 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9492 shared, not if not position independent.
9493 * x86_64.cc (Relocate::relocate_tls): Likewise.
9494 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9495 (tls_pie_pic_test): New target.
9496 * testsuite/Makefile.in: Rebuild.
9498 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9499 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9500 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9501 * testsuite/Makefile.in: Rebuild.
9503 2010-02-09 David S. Miller <davem@davemloft.net>
9505 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9506 R_SPARC_RELATIVE using ->add_local_relative().
9507 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9509 * output.h (Output_data_dynamic::add_section_size): New method
9510 that takes two Output_data objects.
9511 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9512 entry param. Handle it in initializers.
9513 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9514 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9515 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9517 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9518 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9519 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9520 for dynrel_includes_plt.
9521 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9522 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9523 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9525 (Target_sparc::do_finalize_sections): Update to pass true for
9526 dynrel_includes_plt.
9527 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9528 output before .rela.plt
9529 (Target_powerpc::do_finalize_sections): Update to pass true for
9530 dynrel_includes_plt when 32-bit.
9532 2010-02-08 Doug Kwan <dougkwan@google.com>
9534 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9536 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9537 Arm_relobj::scan_section_for_cortex_a8_stubs,
9538 Arm_relobj::do_relocation_section): Instead of calling
9539 Output_section::output_address, use faster
9540 Arm_relobj::simple_input_section_output_address.
9542 2010-02-08 David S. Miller <davem@davemloft.net>
9544 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9545 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9546 relocation helper function.
9548 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9549 just like R_SPARC_GOT{10,13,22}.
9550 (Target_sparc::Scan::local): Likewise.
9551 (Target_sparc::Relocate:relocate): Likewise.
9553 2010-02-06 Ian Lance Taylor <iant@google.com>
9555 * configure.ac: Rewrite targetobjs duplicate removal code to use
9556 only shell constructs.
9557 * configure: Rebuild.
9559 2010-02-05 Doug Kwan <dougkwan@google.com>
9562 * arm.cc (Arm_relobj::section_is_scannable): New method.
9563 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9564 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9566 2010-02-04 Doug Kwan <dougkwan@google.com>
9569 * arm-reloc-property.cc (cstdio): Include.
9570 * configure.ac (targetobjs): Remove duplicates.
9571 * configure: Regenerate.
9572 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9573 big and little endian version for a given address size.
9575 2010-02-03 Doug Kwan <dougkwan@google.com>
9577 * arm-reloc-property.cc
9578 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9580 * arm-reloc-property.h
9581 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9582 New method definition.
9583 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9585 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9587 (GOT_PREL): Change implemented to Y.
9588 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9589 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9590 (Arm_relocate_functions::movw_abs_nc): Remove method.
9591 (Arm_relocate_functions::movt_abs): Ditto.
9592 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9593 (Arm_relocate_functions::thm_movt_abs): Ditto.
9594 (Arm_relocate_functions::movw_rel_nc): Ditto.
9595 (Arm_relocate_functions::movw_rel): Ditto.
9596 (Arm_relocate_functions::movt_rel): Ditto.
9597 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9598 (Arm_relocate_functions:thm_movw_rel): Ditto.
9599 (Arm_relocate_functions:thm_movt_rel): Ditto.
9600 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9601 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9602 New method definitions.
9603 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9604 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9605 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9606 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9607 (Target_arm::Relocate::relocate): Check for non-static or
9608 unimplemented relocation code and exit early. Change calls to
9609 Target_arm::reloc_uses_thumb_bit and
9610 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9611 instead. Refactor code to handle similar relocations to increase
9612 code sharing. Remove check for unsupported relocation code in switch
9614 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9615 relocation property table to find out size. Change error message to
9616 print out the name of a relocation code instead of the numeric value.
9617 (Target_arm::scan_reloc_for_stub): Use relocation property table
9618 instead of calling Target_arm::reloc_uses_thumb_bit().
9620 2010-02-02 Doug Kwan <dougkwan@google.com>
9622 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9623 types of relaxed input section.
9625 2010-02-02 Doug Kwan <dougkwan@google.com>
9627 * Makefile.am (HFILES): Add arm-reloc-property.h.
9629 (TARGETSOURCES): Add arm-reloc-property.cc
9630 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9631 (libgold_a_SOURCES): $(DEFFILES)
9632 * Makefile.in: Regenerate.
9633 * arm-reloc-property.cc: New file.
9634 * arm-reloc-property.h: New file.
9635 * arm-reloc.def: New file.
9636 * arm.cc: Update comments.
9637 (arm-reloc-property.h): New included header.
9638 (arm_reloc_property_table): New global variable.
9639 (Target_arm::do_select_as_default_target): New method definition.
9640 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9641 arm-reloc-property to targ_extra_obj.
9642 * parameters.cc (set_parameters_target): Call
9643 Target::select_as_default_target().
9644 * target.h (Target::select_as_default_target): New method definition.
9645 (Target::do_select_as_default_target): Same.
9647 2010-02-01 Doug Kwan <dougkwan@google.com>
9649 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9650 first_output_text_section_.
9651 (Arm_exidx_fixup::first_output_text_section): New method definition.
9652 (Arm_exidx_fixup::first_output_text_section_): New data member.
9653 (Arm_exidx_fixup::process_exidx_section): Record the first text
9654 output section seen.
9655 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9656 and entsize in output section header.
9658 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9660 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9661 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9662 (Arm_relocate_functions::thm_alu11): New Method.
9663 (Arm_relocate_functions::thm_pc8): New Method.
9664 (Arm_relocate_functions::thm_pc12): New Method.
9665 (Target_arm::Scan::local): Handle the relocations.
9666 (Target_arm::Scan::global): Likewise.
9667 (Target_arm::Relocate::relocate): Likewise.
9668 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9670 2010-01-29 Doug Kwan <dougkwan@google.com>
9672 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9673 of relocation types as ld.
9675 2010-01-29 Doug Kwan <dougkwan@google.com>
9677 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9679 (Arm_relocate_functions::thumb_branch_common): Ditto.
9680 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9681 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9682 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9683 Arm_relocate_functions::jump24): Remove.
9684 (Target_arm::Relocate::relocate): Adjust code to call
9685 Arm_relocation_functions::arm_branch_common and
9686 Arm_relocation_functions::thumb_branch_common instead of their removed
9687 wrappers. Merge switch-cases together to reduce source code size.
9689 2010-01-29 Doug Kwan <dougkwan@google.com>
9691 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9692 output_local_symbol_count_needs_update_.
9693 (Arm_relobj::output_local_symbol_count_needs_update,
9694 Arm_relobj::set_output_local_symbol_count_needs_update,
9695 Arm_relobj::update_output_local_symbol_count): New methods.
9696 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9698 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9699 of pointed function as in a R_ARM_PREL31 relocation.
9700 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9701 for output local symbol count updating.
9702 (Target_arm::do_relax): Update output local symbol counts in objects
9704 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9706 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9708 * arm.cc: Added support for the ARM relocations:
9709 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9710 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9711 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9713 (Arm_relocate_functions::movw_rel): New method.
9714 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9715 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9717 (Arm_relocate_functions::thm_movw_rel): New method.
9718 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9720 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9722 (Target_arm::Scan::global): Likewise.
9723 (Target_arm::Relocate::relocate): Likewise.
9724 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9727 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9729 * arm.cc: Added support for ARM group relocations.
9730 (Target_arm::reloc_needs_sym_origin): New method.
9731 (Arm_relocate_functions::calc_grp_kn): New method.
9732 (Arm_relocate_functions::calc_grp_residual): New method.
9733 (Arm_relocate_functions::calc_grp_gn): New method.
9734 (Arm_relocate_functions::arm_grp_alu): New Method.
9735 (Arm_relocate_functions::arm_grp_ldr): New Method.
9736 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9737 (Arm_relocate_functions::arm_grp_ldc): New Method.
9738 (Target_arm::Scan::local): Handle the ARM group relocations.
9739 (Target_arm::Scan::global): Likewise.
9740 (Target_arm::Relocate::relocate): Likewise.
9741 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9744 2010-01-26 Doug Kwan <dougkwan@google.com>
9746 * arm.cc (set): Include.
9747 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9749 (Arm_output_section::Text_section_list): New type.
9750 (Arm_output_section::append_text_sections_to_list): New method.
9751 (Arm_output_section::fix_exidx_coverage): Ditto.
9752 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
9753 (Arm_relobj::convert_input_section_to_relaxed_section): Use
9754 Relobj::set_section_offset() instead of
9755 Sized_relobj::invalidate_section_offset().
9756 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
9757 parameter for section headers. Ignore relocation sections for
9758 unallocated sections and EXIDX sections.
9759 (Target_arm::fix_exidx_coverage): New method.
9760 (Target_arm::output_section_address_less_than): New type.
9761 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9762 linked text section instead of the EXIDX section.
9763 (Arm_output_section::create_stub_group): Add an assertion to check
9764 that this is not an EXIDX output section.
9765 (Arm_output_section::append_text_sections_to_list): New method.
9766 (Arm_output_section::fix_exidx_coverage): Ditto.
9767 (Arm_relobj::scan_sections_for_stubs): Adjust call to
9768 Arm_relobj::section_needs_reloc_stub_scanning.
9769 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9771 (Target_arm::fix_exidx_coverage): New method.
9772 * object.h (Relobj::set_output_section): New method.
9773 (Sized_relobj::invalidate_section_offset): Remove method.
9774 (Sized_relobj::do_invalidate_section_offset): Remove method.
9775 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9777 2010-01-25 Doug Kwan <dougkwan@google.com>
9779 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9780 Fix warning due to signed and unsigned comparison on a 32-bit host.
9782 2010-01-22 Doug Kwan <dougkwan@google.com>
9784 * arm.cc (Target_arm::do_relax): Record an output section for section
9785 offset adjustment it contains any stub table that has changed.
9786 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9787 offsets in an output section if necessary.
9788 * output.cc (Output_section::Output_section): Initialize
9789 section_offsets_need_adjustments_.
9790 (Output_section::add_input_section_for_script): Renamed to
9791 Output_section::add_simple_input_section.
9792 (Output_section::save_states): Add a comment.
9793 (Output_section::discard_states): New method defintion.
9794 (Output_section::adjust_section_offsets): Same.
9795 * output.h (Output_section::add_input_section_for_script): Renamed to
9796 Output_section::add_simple_input_section.
9797 (Output_section::discard_states): New method declaration.
9798 (Output_section::adjust_section_offsets): Same.
9799 (Output_section::section_offsets_need_adjustment,
9800 Output_section::set_section_offsets_need_adjustment): New method
9802 (Output_section::section_offsets_need_adjustment_): New data member.
9803 * script-sections.cc
9804 (Output_section_element_input::set_section_address): Adjust code for
9805 renaming of Output_section::add_input_section_for_script.
9806 (Orphan_output_section::set_section_address): Same.
9808 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9810 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9811 Fix_v4bx enum values .
9812 * gold/options.h (General_options): New option definitions.
9813 (General_options::fix_v4bx): New method.
9814 (General_options::Fix_v4bx): New enum.
9815 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9816 (General_options::parse_fix_v4bx_interworking): New method.
9818 2010-01-22 Doug Kwan <dougkwan@google.com>
9820 * arm.cc (Arm_exidx_fixup): New class.
9822 2010-01-21 Doug Kwan <dougkwan@google.com>
9824 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9826 (Arm_exidx_section_offset_map): New type.
9828 2010-01-21 Doug Kwan <dougkwan@google.com>
9830 * arm.cc (Arm_exidx_input_section): New class.
9831 (Arm_relobj::exidx_input_section_by_link,
9832 Arm_relobj::exidx_input_section_by_shndx,
9833 Arm_relobj::make_exidx_input_section): New methods.
9834 (read_arm_attributes_section): Remove.
9835 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9836 information about them.
9837 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9840 2010-01-20 Doug Kwan <dougkwan@google.com>
9842 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9843 Input_section_specifier to Section_id.
9844 (Target_arm::new_arm_input_section: Adjust code for change of key
9846 (Target_arm::find_arm_input_section): Ditto.
9847 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9848 (Section_id): Remove.
9849 (Garbage_collection::Section_id_hash): Remove.
9850 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9851 (Section_id): Remove.
9852 (Icf::Section_id_hash): Remove.
9853 * object.h (Section_id, Const_section_id, Section_id_hash,
9854 Const_section_id_hash): New type definitions.
9855 * output.cc (Output_section::add_relaxed_input_section): Change to
9856 use Const_section_id instead of Input_section_specifier as key type.
9857 (Output_section::add_merge_input_section): Ditto.
9858 (Output_section::build_relaxation_map): Change to use Section_id
9859 instead of Input_section_specifier as key type.
9860 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9862 (Output_section::convert_input_sections_to_relaxed_sections): Change
9863 to use Const_section_id instead of Input_section_specifier as key type.
9864 (Output_section::find_merge_section): Ditto.
9865 (Output_section::find_relaxed_input_section): Ditto.
9866 * output.h (Input_section_specifier): Remove class.
9867 (Output_section::Output_section_data_by_input_section_map): Change
9868 key type to Const_section_id.
9869 (Output_section::Output_relaxed_input_section_by_input_section_map):
9871 (Output_section::Relaxation_map): Change key type to Section_id.
9873 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9875 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9876 (class Arm_v4bx_stub): New class.
9877 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9878 (Stub_factory::make_arm_v4bx_stub): New method.
9879 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9880 (Stub_table::empty): Handle v4bx stubs.
9881 (Stub_table::add_arm_v4bx_stub): New method.
9882 (Stub_table::find_arm_v4bx_stub): New method.
9883 (Arm_relocate_functions::v4bx): New method.
9884 (Target_arm::fix_v4bx): New method.
9885 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9886 (Stub_table::relocate_stubs): Likewise.
9887 (Stub_table::do_write): Likewise.
9888 (Stub_table::update_data_size_and_addralign): Likewise.
9889 (Stub_table::finalize_stubs): Likewise.
9890 (Target_arm::Scan::local): Likewise.
9891 (Target_arm::Scan::global): Likewise.
9892 (Target_arm::do_finalize_sections): Likewise.
9893 (Target_arm::Relocate::relocate): Likewise.
9894 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9896 (Target_arm::scan_reloc_for_stub): Likewise.
9897 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9899 2010-01-19 Ian Lance Taylor <iant@google.com>
9901 * output.cc (Output_section_headers::do_sized_write): Write large
9902 segment count to sh_info field.
9903 (Output_file_header::do_sized_write): For large segment count,
9904 write PN_XNUM to e_phnum field.
9906 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9908 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9909 (Arm_relocate_functions::thm_jump8): New function.
9910 (Arm_relocate_functions::thm_jump11): New function.
9911 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9913 (Target_arm::Scan::global): Likewise.
9914 (Target_arm::Relocate::relocate): Likewise.
9915 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9918 2010-01-14 Doug Kwan <dougkwan@google.com>
9920 * arm.cc (map, utility): Include headers.
9921 (Target_arm::apply_cortex_a8_workaround): New method.
9922 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9923 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9924 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9925 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9926 the --[no-]fix-cortex-a8 command line options.
9927 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9928 (Target_arm::relocate_stub): Use addend in instruction template.
9929 * options.h (DEFINE_bool): Set the user-set flag.
9930 (General_options): Add --[no-]-fix-cortex options.
9931 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
9932 : Update fast look-up map after conversion.
9934 2010-01-14 Sriraman Tallam <tmsriram@google.com>
9936 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9937 in the first pass of do_layout.
9939 2010-01-13 Doug Kwan <dougkwan@google.com>
9941 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9942 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9943 apparent compiler problem of not folding static constant integral
9944 data members of elfcpp::Elf_sizes<32>.
9946 2010-01-13 Doug Kwan <dougkwan@google.com>
9948 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9949 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9950 Arm_relobj::scan_section_for_cortex_a8_erratum,
9951 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9952 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9953 sections to scan for relocation stubs into a new method
9954 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9955 relocation and Cortex-A8 stub scanning.
9956 (Target_arm::do_relax): Force stubs to be after stubbed sections
9957 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
9958 the beginning of a new relaxation pass. Update a comment.
9959 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9961 2010-01-12 Ian Lance Taylor <iant@google.com>
9963 * target-reloc.h (visibility_error): New inline function.
9964 (relocate_section): Call visibility_error.
9965 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9966 (MOSTLYCLEANFILES): Likewise.
9967 (protected_4_pic.o, protected_3.err): New targets.
9968 * testsuite/protected_4.cc: New file.
9970 2010-01-12 Doug Kwan <dougkwan@google.com>
9972 * arm.cc (Cortex_a8_reloc): New class.
9973 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9974 and cortex_a8_relocs_info_.
9975 (Target_arm::fix_cortex_a8): New method definition.
9976 (Target_arm::Cortex_a8_relocs_info): New type.
9977 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9978 New data member declarations.
9979 (Target_arm::scan_reloc_for_stub): Record information about
9980 relocations for THUMB branches that might be exempted from the
9981 Cortex-A8 workaround.
9982 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9983 at the beginning of a relaxation pass.
9985 2010-01-12 Doug Kwan <dougkwan@google.com>
9987 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9988 (Arm_relobj::Mapping_symbol_position,
9989 Arm_reloj::Mapping_symbol_position_less,
9990 Arm_relobj::Mapping_symbols_info): New types.
9991 (Target_arm::is_mapping_symbol_name): New method definition.
9992 (Arm_relobj::do_count_local_symbols): Save information about mapping
9995 2010-01-11 Doug Kwan <dougkwan@google.com>
9997 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9998 Arm_relocate_functions::thumb32_branch_upper,
9999 Arm_relocate_functions::thumb32_branch_lower,
10000 Arm_relocate_functions::thumb32_cond_branch_offset,
10001 Arm_relocate_functions::thumb32_cond_branch_upper,
10002 Arm_relocate_functions::thumb32_cond_branch_lower,
10003 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10004 branch offset encoding.
10005 (Arm_relocate_functions::thumb_branch_common): Use new branch
10006 offset encoding methods to avoid code duplication.
10007 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10008 (Stub_addend_reader::operator()): Use new branch encoding method
10009 to avoid code duplication.
10011 2010-01-11 Doug Kwan <dougkwan@google.com>
10013 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10014 (Target_arm::do_finalize_sections): Define special EXIDX section
10015 symbols only if referenced.
10016 * gc.h (Garbage_collection::add_reference): New method.
10017 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10020 2010-01-11 Ian Lance Taylor <iant@google.com>
10022 * script.cc (Version_script_info::build_expression_list_lookup):
10023 Change complaing about duplicate wildcard match from error to
10026 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10028 (Version_script_info::Version_script_info): Initialize globs_,
10029 default_version_, default_is_global_, and exact_. Don't
10030 initialize globals_ or locals_.
10031 (Version_script_info::build_lookup_tables): Build local symbols
10033 (Version_script_info::unquote): New function.
10034 (Version_script_info::add_exact_match): New function.
10035 (Version_script_info::build_expression_list_lookup): Remove lookup
10036 parameter. Add is_global parameter. Change all callers. Handle
10037 wildcard pattern specially. Unquote pattern. Call
10039 (Version_script_info::get_name_to_match): New function.
10040 (Version_script_info::get_symbol_version): New function.
10041 (Version_script_info::get_symbol_version_helper): Remove.
10042 (Version_script_info::check_unmatched_names): Call unquote.
10043 * script.h (class Version_script_info): Change get_symbol_version
10044 to be non-inline and add is_global parameter; change all callers.
10045 Rewrite symbol_is_local. Update declarations. Define struct
10046 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10047 Remove globals_ and locals_ members. Add exact_, globs_,
10048 default_version_, is_global_.
10049 (Version_script_info::Glob): Remove pattern, add expression and
10050 is_global. Update constructor. Change all callers.
10051 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10053 (Versions::symbol_section_contents): If a symbol is undefined, or
10054 defined in a dynamic object, set the version index to
10056 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10058 (Symbol_table::add_from_pluginobj): Likewise.
10059 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10061 2010-01-11 Doug Kwan <dougkwan@google.com>
10063 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10064 (incremental_dump_LDADD): Add linking option for libintl.
10065 * Makefile.in: Regenerate.
10067 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10070 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10072 * testsuite/Makefile.in: Regenerated.
10074 2010-01-10 Doug Kwan <dougkwan@google.com>
10076 * options.h (DEFINE_var): Use parentheses around argument varname__
10077 in macro body to avoid any unintended subsequent substitutions.
10079 2010-01-10 Ian Lance Taylor <iant@google.com>
10081 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10082 candidates before doing symbol resolution.
10084 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10085 ODR candidates if only one is weak.
10087 2010-01-08 Ian Lance Taylor <iant@google.com>
10089 * script.cc (Version_script_info::build_expression_list_lookup):
10090 Don't warn about ambiguous version, just record the ambiguity.
10091 (Version_script_info::get_symbol_version_helper): Give error if
10092 version is ambiguous.
10094 2010-01-08 Doug Kwan <dougkwan@google.com>
10096 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10097 prev_data_size_ and prev_addralign_. Remove initializer for
10098 deleted data member has_been_changed_.
10099 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10100 to determine if the table is empty.
10101 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10103 (Stub_table::add_reloc_stub): Define method in class definition
10104 instead of just declaring it there.
10105 (Stub_table::add_cortex_a8_stub): New method definition.
10106 (Stub_table::update_data_size_and_addralign): Ditto.
10107 (Stub_table::finalize_stubs): Ditto.
10108 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10109 (Stub_table::do_addralign_): Return address alignment in the
10110 (Stub_table::do_reset_address_and_file_offset): Define method in
10111 class definition instead of declaring it there. Set current data
10112 size to be the data size of the previous pass.
10113 (Stub_table::set_final_data_size): Use current data size as the
10115 (Stub_table::relocate_stub): Change parameter type of stub from
10116 Reloc_stub pointer to Stub pointer.
10117 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10118 (Stub_table::Cortex_a8_stub_list): New typedef.
10119 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10120 Stub_table::prev_addralign_): New data member.
10121 (Arm_relobj::Arm_relobj): Initialize data member
10122 section_has_cortex_a8_workaround_.
10123 (Arm_relobj::section_has_cortex_a8_workaround,
10124 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10126 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10128 (Target_arm::relocate_stub): Change parameter type of stub from
10129 Reloc_stub pointer to Stub pointer.
10130 (Insn_template::size, Insn_template::alignment): Handle
10131 THUMB16_SPECIAL_TYPE.
10132 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10133 Stub_table::update_data_size_and_addralign,
10134 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10136 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10137 (Stub_table::do_write): Ditto.
10138 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10140 2010-01-08 Ian Lance Taylor <iant@google.com>
10143 * symtab.h (class Symbol): Remove fields is_target_special_ and
10144 has_plt_offset_. Add field is_defined_in_discarded_section_.
10145 (Symbol::is_defined_in_discarded_section): New function.
10146 (Symbol::set_is_defined_in_discarded_section): New function.
10147 (Symbol::has_plt_offset): Rewrite.
10148 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10149 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10150 Don't initialize is_target_special_ or has_plt_offset_.
10151 Initialize is_defined_in_discarded_section_.
10152 (Symbol_table::add_from_relobj): If appropriate, set
10153 is_defined_in_discarded_section.
10154 * resolve.cc (Symbol::override_base_with_special): Don't test
10155 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10156 * target-reloc.h (relocate_section): Do special handling for
10157 symbols defined in discarded sections for global symbols as well
10160 2010-01-08 Ian Lance Taylor <iant@google.com>
10162 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10163 the SHT_SYMTAB case.
10165 2010-01-08 Ian Lance Taylor <iant@google.com>
10167 * object.cc (Sized_relobj::do_layout): Don't get confused if
10168 layout_eh_frame returns NULL.
10170 2010-01-08 Ian Lance Taylor <iant@google.com>
10173 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10174 dynamic symbol table, use the normal symbol table.
10175 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10178 2010-01-08 Ian Lance Taylor <iant@google.com>
10181 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10184 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10186 * version.cc (print_version): Change to "Copyright 2010".
10188 2010-01-08 Ian Lance Taylor <iant@google.com>
10192 * i386.cc (class Target_i386): Change return type of plt_section
10194 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10195 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10196 tls_desc_rel_ field.
10197 (Output_data_plt_i386::rel_tls_desc): New function.
10198 (Target_i386::rel_tls_desc_section): New function.
10199 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10200 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10201 R_386_TLS_DESC reloc in rel_tls_desc_section.
10202 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10203 Define struct Tlsdesc_info.
10204 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10205 (Target_x86_64::do_reloc_symbol_index): New function.
10206 (Target_x86_64::add_tlsdesc_info): New function.
10207 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10208 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10209 tlsdesc_rel_ field.
10210 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10212 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10213 (Target_x86_64::rela_tlsdesc_section): New function.
10214 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10216 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10217 (Target_x86_64::do_reloc_addend): New function.
10218 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10219 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10220 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10221 (Output_reloc::type): New function.
10222 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10223 (Output_reloc::is_target_specific): New function.
10224 (Output_reloc::target_arg): New function.
10225 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10226 absolute relocs and target specific relocs.
10227 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10228 add_target_specific.
10229 (class Output_data_reloc) [SHT_RELA]: Likewise.
10230 * output.cc (Output_reloc::Output_reloc): Add four new versions
10231 for absolute relocs and target specific relocs.
10232 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10233 (Output_reloc::get_symbol_index): Likewise.
10234 (Output_reloc::local_section_offset): Check that local_sym_index_
10235 is not TARGET_CODE or 0.
10236 (Output_reloc::symbol_value): Likewise.
10237 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10239 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10240 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10242 * layout.cc (add_target_dynamic_tags): Use output section for
10243 DT_PLTRELSZ and DT_JMPREL.
10245 2010-01-07 Ian Lance Taylor <iant@google.com>
10248 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10250 (class Output_data_reloc_generic): Define.
10251 (class Output_data_reloc_base): Change base class to
10252 Output_data_reloc_generic. Change add() method to call
10253 bump_relative_reloc_count for a relative reloc. Remove
10254 sort_relocs_ field.
10255 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10257 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10258 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10260 * layout.h (class Layout): Update declaration.
10262 2010-01-07 Ian Lance Taylor <iant@google.com>
10264 * output.h (class Output_data): Add const version of
10265 output_section and do_output_section.
10266 (class Output_section_data): Add const version of
10268 (class Output_section): Likewise.
10269 * layout.cc (Layout::add_target_dynamic_tags): New function.
10270 * layout.h (class Layout): Update declarations.
10271 * arm.cc (Target_arm::do_finalize_sections): Use
10272 add_target_dynamic_tags.
10273 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10274 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10275 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10276 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10278 2010-01-07 Ian Lance Taylor <iant@google.com>
10281 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10284 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10285 Ian Lance Taylor <iant@google.com>
10288 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10289 Xindex::read_symtab_xindex.
10291 2010-01-07 Doug Kwan <dougkwan@google.com>
10293 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10294 (Insn_template::thumb16_bcond_insn): New method declaration.
10295 (Insn_template): Fix spelling.
10296 (Stub::thumb16_special): New method declaration.
10297 (Stub::do_write): Define virtual method which was previously pure
10299 (Stub::do_thumb16_special): New method declaration.
10300 (Stub::do_fixed_endian_write): New template member.
10301 (Reloc_stub::do_write): Remove.
10302 (Reloc_stub::do_fixed_endian_write): Remove.
10303 (Cortex_a8_stub): New class definition.
10304 (Stub_factory::make_cortex_a8_stub): New method definition.
10305 (Stub_factory::Stub_factory): Add missing static storage class
10306 qualifier for elf32_arm_stub_a8_veneer_blx.
10308 2010-01-07 Ian Lance Taylor <iant@google.com>
10311 * options.h (class General_options): Add --warn-unresolved-symbols
10312 and --error-unresolved-symbols.
10313 * errors.cc (Errors::undefined_symbol): Implement
10314 --warn-unresolved-symbols.
10316 * options.h (class General_options): Add -z text and -z textoff.
10317 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10319 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10321 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10322 (Garbage_collection::cident_sections): New function.
10323 (Garbage_collection::add_cident_section): New function.
10324 (Garbage_collection::cident_sections_): New member.
10325 (gc_process_relocs): Add references to sections whose names are C
10327 * gold.h (cident_section_start_prefix): New constant.
10328 (cident_section_stop_prefix): New constant.
10329 (is_cident): New function.
10330 * layout.cc (Layout::define_section_symbols): Replace string constants
10331 with the newly defined constants.
10332 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10334 * testsuite/Makefile.am: Add gc_orphan_section_test.
10335 * testsuite/Makefile.in: Regenerate.
10336 * testsuite/gc_orphan_section_test.cc: New file.
10337 * testsuite/gc_orphan_section_test.sh: New file.
10339 2010-01-06 Ian Lance Taylor <iant@google.com>
10342 * options.h (class General_options): Add --warn-shared-textrel.
10343 * layout.cc (Layout::finish_dynamic_section): Implement
10344 --warn-shared-textrel.
10347 * options.h (class General_options): Add --warn-multiple-gp.
10349 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10351 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10352 $(THREADSLIB) and $(LIBDL).
10353 * Makefile.in: Rebuild.
10355 2010-01-06 Ian Lance Taylor <iant@google.com>
10358 * options.cc (General_options::parse_section_start): New function.
10359 (General_options::section_start): New function.
10360 (General_options::General_options): Initialize all members.
10361 * options.h: Include <map>
10362 (class General_options): Add --section-start. Add section_starts_
10364 * layout.cc (Layout::attach_allocated_section_to_segment): If
10365 --section-start was used, set the address of the segment. Remove
10366 local sort_sections.
10367 (Layout::relaxation_loop_body): If the address of the load segment
10368 has been set by --section-start, don't use it.
10369 * output.h (Output_segment::update_flags_for_output_section): New
10371 * output.cc (Output_segment::add_output_section): Call
10372 update_flags_for_output_section.
10374 2010-01-05 Ian Lance Taylor <iant@google.com>
10377 * options.h (class General_options): Add --undefined-version.
10378 * script.cc (struct Version_expression): Add was_matched_by_symbol
10380 (Version_script_info::matched_symbol): New function.
10381 (Version_script_info::get_symbol_version_helper): Call
10383 (Version_script_info::check_unmatched_names): New function.
10384 * script.h (class Version_script_info): Update declarations.
10385 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10387 * options.h (class General_options): Use DEFINE_bool_alias for
10388 allow_multiple_definition.
10389 * resolve.cc (Symbol_table::should_override): Don't test
10390 allow_multiple_definition.
10393 * options.h (class General_options): Add --cref.
10394 * main.cc (main): Print cref table if --cref. Don't close mapfile
10395 until after printing cref table.
10396 * cref.cc: Include "symtab.h".
10397 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10398 (Cref_table_compare::operator()): New function.
10399 (Cref_inputs::gather_cref): New function.
10400 (filecol): New static const.
10401 (Cref_inputs::print_cref): New function.
10402 (Cref::print_cref): New function.
10403 * cref.h: Include <cstdio>.
10404 (class Cref): Update declarations.
10405 * mapfile.h (Mapfile::file): New function.
10406 * object.h (class Object): Define Symbols. Declare virtual
10407 do_get_global_symbols.
10408 (Object::get_global_symbols): New function.
10409 * object.cc (Input_objects::add_object): Pass object to cref_ if
10411 (Input_objects::archive_start): Likewise.
10412 (Input_objects::archive_stop): Likewise.
10413 (Input_objects::print_cref): New function.
10414 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10415 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10417 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10419 * plugin.h (class Sized_pluginobj): Update declarations.
10421 2010-01-05 Ian Lance Taylor <iant@google.com>
10423 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10424 to is_default_version. Rename insdef to insdefault.
10425 (Symbol_table::add_from_relobj): Rename def to is_default_version
10426 and local to is_forced_local.
10427 (Symbol_table::add_from_pluginobj): Likewise.
10428 (Symbol_table::add_from_dynobj): Likewise.
10429 (Symbol_table::define_special_symbol): Rename insdef to
10432 2010-01-04 Ian Lance Taylor <iant@google.com>
10435 * options.h (class General_options): Add
10436 --allow-multiple-definition and -z muldefs.
10437 * resolve.cc (Symbol_table::should_override): Don't warn about a
10438 multiple symbol definition if --allow-multiple-definition or -z
10442 * options.h (class General_options): Add --add-needed and
10443 --copy-dt-needed-entries. Tweak --as-needed help entry.
10444 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10445 error if --copy-dt-needed-entries aka --add-needed is used and
10446 would cause a change in behaviour.
10449 * options.h (class General_options): Add -G as a short version of
10450 --shared. Add no-op options -assert, -g, and -i.
10452 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10454 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10455 check for .text or .gnu.linkonce.t sections.
10456 * icf.cc (Icf::find_identical_sections): Ditto.
10457 Change the detection for mangled function name within the section
10459 * icf.h (is_section_foldable_candidate): New function.
10461 2009-12-30 Ian Lance Taylor <iant@google.com>
10464 * options.h (class General_options): Permit two dashes with
10465 --retain-symbols-file.
10467 2009-12-30 Ian Lance Taylor <iant@google.com>
10470 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10471 don't put the file header and segment headers in the text
10475 * common.cc (Sort_commons::operator()): Stabilize sort when both
10477 (Symbol_table::do_allocate_commons_list): When allocating common
10478 symbols, skip a symbol which is no longer common.
10479 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10480 an object before checking its type.
10481 * testsuite/common_test_2.c: New file.
10482 * testsuite/common_test_3.c: New file.
10483 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10484 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10485 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10486 (common_test_2_pic.o, common_test_2.so): New targets.
10487 (common_test_3_pic.o, common_test_3.so): New targets.
10488 * testsuite/Makefile.in: Rebuild.
10491 * script.cc (read_input_script): If we see a new SECTIONS clause,
10492 and we have added an input section, give an error.
10493 * layout.h (class Layout): Add have_added_input_section function.
10494 Add have_added_input_section_ field.
10495 * layout.cc (Layout::Layout): Initialize
10496 have_added_input_section_.
10497 (Layout::layout): Set have_added_input_section_.
10498 (Layout::layout_eh_frame): Likewise.
10500 2009-12-30 Ian Lance Taylor <iant@google.com>
10503 * options.h (class General_options): Add --sort-common option.
10504 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10505 * common.cc (Sort_common): Add sort_order parameter to
10506 constructor. Add sort_order_ field.
10507 (Sort_commons::operator): Check sort_order_.
10508 (Symbol_table::allocate_commons): Determine the sort order.
10509 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10510 Change all callers.
10511 (Symbol_table::do_allocate_commons_list): Likewise.
10513 2009-12-30 Ian Lance Taylor <iant@google.com>
10516 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10517 symbols from this object, don't change the visibility of an
10519 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10521 2009-12-30 Ian Lance Taylor <iant@google.com>
10524 * script.h (class Version_script_info): Define Language enum.
10525 Update declarations. Define Glob, Exact, and Lookup types. Add
10526 new fields globals_, locals_, and is_finalized_.
10527 * script.cc: Various formatting fixes.
10528 (class Parser_closure): Change language_stack_ from a vector of
10529 std::string to one of Version_script_info::Language. Adjust all
10531 (class Lazy_demangler): Remove.
10532 (struct Version_expression): Change language from std::string to
10533 Version_script_info::Language.
10534 (Version_script_info::Version_script_info): New function.
10535 (Version_script_info::~Version_script_info): Don't call clear.
10536 (Version_script_info::finalize): New function.
10537 (Version_script_info::build_lookup_tables): New function.
10538 (Version_script_info::build_expression_list_lookup): New
10540 (Version_script_info::get_symbol_version_helper): Rewrite to use
10542 (Version_script_info::print_expression_list): Adjust to use
10543 Version_script_info::Language.
10544 (script_push_lex_into_version_mode): Check that the version script
10545 has not been finalized.
10546 (version_script_push_lang): Change language string to
10547 Version_script_info::Language.
10548 * options.cc (Command_line::version_script): New function.
10549 * options.h (class General_options): Add finalize_dynamic_list
10550 function. Change version_script from declaration to definition.
10551 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10552 * testsuite/version_script.map: Remove duplicate def of foo.
10553 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10554 version_script.map.
10555 * testsuite/Makefile.in: Rebuild.
10557 2009-12-30 Ian Lance Taylor <iant@google.com>
10560 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10561 if the input symbol index is 0, make the output symbol index 0.
10563 2009-12-30 Ian Lance Taylor <iant@google.com>
10566 * options.h (class General_options): Add -x/--discard-all.
10567 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10568 --discard-all. If the local symbol needs a dynamic entry, check
10569 that before handling --discard-locals.
10571 2009-12-30 Ian Lance Taylor <iant@google.com>
10574 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10576 (Output_segment::add_output_section): Don't change the flags if
10577 the type is PT_TLS.
10580 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10581 GNU hash table if they need a dynamic value. Otherwise, don't add
10582 them if they are defined in a dynamic object or are forced local.
10584 2009-12-29 Ian Lance Taylor <iant@google.com>
10587 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10588 .gnu.hash table for a 32-bit target.
10591 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10592 regular and a dynamic object only needs a dynamic symbol table
10593 entry if it is externally visible.
10596 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10597 constructor. Add global_offset_table_ field.
10598 (Target_i386::got_section): Set global_offset_table_.
10599 (Target_i386::do_finalize_sections): Set global_offset_table_
10601 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10602 in constructor. Add global_offset_table_ field.
10603 (Target_x86_64::got_section): Set global_offset_table_.
10604 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10607 * layout.cc (Layout::Layout): Initialize increase_relro_.
10608 (Layout::get_output_section): Add is_relro, is_last_relro, and
10609 is_first_non_relro parameters. Change all callers.
10610 (Layout::choose_output_section): Likewise.
10611 (Layout::add_output_section_data): Likewise.
10612 (Layout::make_output_section): Likewise.
10613 (Layout::set_segment_offsets): Clear increase_relro when using a
10615 * layout.h (class Layout): Add increase_relro method. Add
10616 increase_relro_ field. Update declarations.
10617 * output.cc (Output_section::Output_section): Initialize
10618 is_last_relro_ and is_first_non_relro_.
10619 (Output_segment::add_output_section): Group relro sections is
10620 do_sort is true. Handle is_last_relro and is_first_non_relro.
10621 (Output_segment::maximum_alignment): Remove relro handling.
10622 (Output_segment::set_section_addresses): Add increase_relro
10623 parameter. Change all callers. Add initial alignment to align
10624 relro sections on separate page. Remove old relro handling.
10625 (Output_segment::set_section_list_addresses): Remove in_relro
10626 parameter. Change all callers.
10627 (Output_segment::set_offset): Add increase parameter. Change all
10628 callers. Remove old relro handling.
10629 * output.h (class Output_section): Add new methods: is_last_relro,
10630 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10631 Add is_last_relro_ and is_first_non_relro_ fields.
10632 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10633 Create separate .got.plt section. Call increase_relro.
10634 * x86_64.cc (Target_x86_64::got_section): Likewise.
10635 * testsuite/relro_script_test.t: Add .got.plt.
10638 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10639 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10640 (Layout::finalize): Call set_dynamic_symbol_size.
10641 (Layout::set_dynamic_symbol_size): New function.
10642 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10643 set_dynamic_symbol_size.
10646 * output.h (class Output_section): Add is_entsize_zero_ field.
10647 * output.cc (Output_section::Output_section): Initialize
10649 (Output_section::set_entsize): If two different entsizes are
10650 requested, force it to zero.
10651 (Output_section::add_input_section): Set flags for .debug_str
10652 before updating section flags. Set entsize.
10653 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10654 and SHF_STRING if all input sections have those flags.
10656 2009-12-29 Rafael Espindola <espindola@google.com>
10658 * main.cc (main): Fix the sys time reporting.
10659 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10662 2009-12-29 Sriraman Tallam <tmsriram@google.com>
10664 * options.cc (General_options::parse_version): Allow -v to exit
10665 without an error if there is nothing to link.
10667 2009-12-29 Ian Lance Taylor <iant@google.com>
10669 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10670 using a version of gcc before 4.1.
10671 * configure: Rebuild.
10673 2009-12-28 Chris Demetriou <cgd@google.com>
10675 * attributes.cc (Output_attributes_section_data::do_write): Use
10676 std::vector::front rather than std::vector::data.
10678 2009-12-28 Ian Lance Taylor <iant@google.com>
10680 * symtab.h (class Symbol_table): Add enum Defined.
10681 * resolve.cc (Symbol_table::should_override): Add defined
10682 parameter. Change all callers. Test whether object is NULL
10683 before calling a method on it.
10684 (Symbol_table::report_resolve_problem): Add defined parameter.
10685 Change all callers.
10686 (Symbol_table::should_override_with_special): Likewise.
10687 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10688 parameter. Change all callers.
10689 (Symbol_table::do_define_in_output_data): Likewise.
10690 (Symbol_table::define_in_output_segment): Likewise.
10691 (Symbol_table::do_define_in_output_segment): Likewise.
10692 (Symbol_table::define_as_constant): Likewise.
10693 (Symbol_table::do_define_as_constant): Likewise.
10694 * script.h (class Symbol_assignment): Add is_defsym parameter to
10695 constructor; change all callers.
10696 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10697 parameter. Change all callers. Add is_defsym_ field.
10698 (class Parser_closure): Add parsing_defsym parameter to
10699 constructor; change all callers. Add parsing_defsym accessor
10700 function. Add parsing_defsym_ field.
10702 2009-12-28 Ian Lance Taylor <iant@google.com>
10704 * gold.cc (queue_middle_tasks): Fix formatting.
10705 * object.cc (Relobj::is_section_name_included): Likewise.
10707 2009-12-23 Ian Lance Taylor <iant@google.com>
10709 * i386.cc (Target_i386::do_calls_non_split): Recognize
10710 -fsplit-stack prologue for a function with a static chain.
10711 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10712 -fsplit-stack prologue when using %r11.
10714 2009-12-21 Sriraman Tallam <tmsriram@google.com>
10716 * options.cc (General_options::parse_version): Make -v continue and do
10717 the link like GNU ld does.
10719 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
10721 * Makefile.am (CCFILES): Add timer.cc.
10722 (HFILES): Add timer.h.
10723 * configure.ac: Check for sysconf and times.
10724 * main.cc: include timer.h.
10725 (main): Use Timer instead of get_run_time.
10728 * workqueue.cc: include timer.h.
10729 (Workqueue::find_and_run_task):
10730 Report user, sys and wall time.
10731 * Makefile.in: Regenerate.
10732 * config.in: Regenerate.
10733 * configure: Regenerate.
10735 2009-12-16 Doug Kwan <dougkwan@google.com>
10737 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10739 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10740 relaxed input sections.
10741 * output.cc (Output_section::find_relaxed_input_section): Change
10742 return type to Output_relaxed_input_section pointer. Adjust code
10743 for new type of relaxed_input_section_map_.
10744 * output.h (Output_section::find_relaxed_input_section): Change
10745 return type to Output_relaxed_input_section pointer.
10746 (Output_section::Output_relaxed_input_section_by_input_section_map):
10748 (Output_section::relaxed_input_section_map_): Change type to
10749 Output_section::Output_relaxed_input_section_by_input_section_map.
10750 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10753 2009-12-15 Ian Lance Taylor <iant@google.com>
10755 * layout.cc (Layout::create_shstrtab): Only write out after input
10756 sections if we are compressing debug sections.
10758 2009-12-15 Ian Lance Taylor <iant@google.com>
10760 * archive.cc (Archive::add_symbols): Only look up a symbol without
10761 a version if there is, in fact, a version.
10763 2009-12-14 Ian Lance Taylor <iant@google.com>
10765 Revert -Wshadow changes, all changes from:
10766 2009-12-11 Doug Kwan <dougkwan@google.com>
10767 2009-12-11 Nick Clifton <nickc@redhat.com>
10768 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10770 2009-12-11 Doug Kwan <dougkwan@google.com>
10772 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10774 * attributes.cc (Object_attribute::size): Ditto.
10775 (Attributes_section_data::size): Ditto.
10776 (Attributes_section_data::Attributes_section_data): Ditto.
10777 (Output_attributes_section_data::do_write): Ditto.
10778 * attributes.h (Object_attribute::set_type): Ditto.
10779 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10781 2009-12-11 Nick Clifton <nickc@redhat.com>
10783 * archive.cc: Fix shadowed variable warnings.
10784 * arm.cc: Likewise.
10785 * compressed_output.cc: Likewise.
10786 * compressed_output.h: Likewise.
10787 * configure: Likewise.
10788 * dwarf_reader.cc: Likewise.
10789 * dynobj.cc: Likewise.
10790 * dynobj.h: Likewise.
10791 * ehframe.cc: Likewise.
10792 * ehframe.h: Likewise.
10793 * errors.cc: Likewise.
10794 * expression.cc: Likewise.
10795 * fileread.cc: Likewise.
10796 * fileread.h: Likewise.
10797 * freebsd.h: Likewise.
10798 * i386.cc: Likewise.
10799 * icf.cc: Likewise.
10800 * incremental.h: Likewise.
10801 * layout.cc: Likewise.
10802 * layout.h: Likewise.
10803 * mapfile.cc: Likewise.
10804 * merge.cc: Likewise.
10805 * merge.h: Likewise.
10806 * object.cc: Likewise.
10807 * object.h: Likewise.
10808 * options.h: Likewise.
10809 * output.cc: Likewise.
10810 * output.h: Likewise.
10811 * parameters.cc: Likewise.
10812 * plugin.cc: Likewise.
10813 * powerpc.cc: Likewise.
10814 * reduced_debug_output.cc: Likewise.
10815 * reduced_debug_output.h: Likewise.
10816 * reloc.cc: Likewise.
10817 * reloc.h: Likewise.
10818 * resolve.cc: Likewise.
10819 * script-sections.cc: Likewise.
10820 * script.cc: Likewise.
10821 * script.h: Likewise.
10822 * sparc.cc: Likewise.
10823 * symtab.cc: Likewise.
10824 * symtab.h: Likewise.
10825 * target-select.cc: Likewise.
10826 * target-select.h: Likewise.
10827 * token.h: Likewise.
10828 * workqueue.cc: Likewise.
10829 * workqueue.h: Likewise.
10830 * x86_64.cc: Likewise.
10832 2009-12-10 Doug Kwan <dougkwan@google.com>
10834 * arm.cc (attributes.h): New include.
10835 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10836 (Arm_relobj::~Arm_relobj): Delete object pointed by
10837 attributes_section_data_.
10838 (Arm_relobj::attributes_section_data): New method definition.
10839 (Arm_relobj::attributes_section_data_): New data member declaration.
10840 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10841 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10842 attributes_section_data_.
10843 (Arm_dynobj::attributes_section_data): New method definition.
10844 (Arm_dynobj::attributes_section_data_): New data member declaration.
10845 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10846 initialization value of may_use_blx_ to false.
10847 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
10848 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10849 object attributes to compute results instead of hard-coding.
10850 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10851 Target_arm::get_secondary_compatible_arch,
10852 Target_arm::set_secondary_compatible_arch
10853 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10854 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10855 New method declarations.
10856 (Target_arm::get_aeabi_object_attribute): New method definition.
10857 (Target_arm::attributes_section_data_): New data member declaration.
10858 (read_arm_attributes_section): New template definition.
10859 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10860 (Arm_dynobj::do_read_symbols): Ditto.
10861 (Target_arm::do_finalize_sections): Merge attributes sections from
10862 input. Check for BLX use after attributes section merging.
10863 Fix __exidx_start and __exidx_end visibility. Create an
10864 .ARM.attributes section if necessary.
10865 (Target_arm::get_secondary_compatible_arch,
10866 Target_arm::set_secondary_compatible_arch,
10867 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10868 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
10869 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
10870 New method definitions.
10872 2009-12-09 Ian Lance Taylor <iant@google.com>
10874 * plugin.cc (Plugin::load): Don't cast from void* to a function
10877 2009-12-09 Ian Lance Taylor <iant@google.com>
10879 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10880 information fields.
10882 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10884 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10885 Replace two_file_shared_1.so with two_file_shared_2.so.
10886 * testsuite/Makefile.in: Regenerated.
10888 2009-12-08 Doug Kwan <dougkwan@google.com>
10890 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10891 (HFILES): Add attributes.h and int_encoding.h.
10892 * Makefile.in: Regenerate.
10893 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10894 function definitions to int_encoding.cc
10895 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10896 prototypes to int_encoding.h
10897 * reduced_debug_output.cc (int_encoding.h): New include.
10898 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10899 function definitions to int_encoding.cc
10900 (insert_into_vector, read_from_pointer): Move template definitions to
10902 * attributes.cc: New file.
10903 * attributes.h: New file.
10904 * int_encoding.cc: New file.
10905 * int_encoding.h: New file.
10907 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
10910 * incremental-dump.cc (dump_incremental_inputs): New.
10911 (main): Use dump_incremental_inputs.
10913 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10916 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10917 checking elfcpp::STT_FUNC.
10918 (Target_i386::Relocate::relocate): Likewise.
10919 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10921 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10922 symbols from shared libraries into normal FUNC symbols.
10924 * symtab.h (Symbol): Add is_func and use it.
10926 2009-12-05 Doug Kwan <dougkwan@google.com>
10928 * arm.cc (Target_arm::arm_info): Initialize new fields
10929 attributes_section and attributes_vendor.
10930 * i386.cc (Target_i386::i386_info): Same.
10931 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10932 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10933 fields attributes_section and attributes_vendor.
10934 * sparc.cc (Target_sparc::sparc_info): Same.
10935 * target.h (Target::attributes_section, Target::attributes_vendor,
10936 Target::is_attributes_section, Target::attribute_arg_type,
10937 Target::attributes_order): New method definitions.
10938 (Target::Target_info::attributes_section,
10939 Target::Target_info::attributes_vendor): New fields.
10940 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10941 virtual method definitions.
10942 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10943 attributes_section and attributes_vendor.
10944 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10946 2009-12-05 Doug Kwan <dougkwan@google.com>
10948 * arm.cc: Update comments about interworking and stub generation.
10949 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10950 considered as non-PIC.
10951 (Arm_relocate_functions::base_abs): Fix formatting.
10952 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10953 of function to use GOT entry address instead of offset.
10954 (Target_arm::Scan::global): Issue an error if a symbol would need a
10955 PLT does not get one because it is untyped. Remove code to create
10956 dynamic symbols for relative branches.
10957 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10958 takes unsigned integer instead of boolean.
10960 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10962 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10963 (two_file_test_LDADD): Likewise.
10964 (common_test_1_LDADD): Likewise.
10965 (exception_test_LDADD) Likewise.
10966 (weak_test_LDADD): Likewise.
10967 (many_sections_test_LDADD): Likewise.
10968 (initpri1_LDADD): Likewise.
10969 (script_test_1_LDADD): Likewise.
10970 (script_test_2_LDADD): Likewise.
10971 (justsyms_LDADD): Likewise.
10972 (binary_test_LDADD): Likewise.
10973 (large_LDADD): Likewise.
10974 * testsuite/Makefile.in: Regenerated.
10976 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
10978 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10979 (Symbol_table::override_with_special): Likewise.
10980 (Symbol_table::add_from_object): Likewise.
10982 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10984 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10985 Don't set the data_offset twice.
10987 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
10989 * testsuite/Makefile.in: Regenerate.
10991 2009-12-03 Doug Kwan <dougkwan@google.com>
10993 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10994 (Target_arm::do_finalize_sections): Add parameter for symbol table
10995 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10996 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10997 parameter for symbol table pointer.
10998 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10999 an additional parameter for a pointer to symbol table.
11000 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11001 parameter for a symbol table pointer.
11002 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11003 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11005 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11006 parameter for a symbol table pointer.
11008 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11010 * incremental.cc (Incremental_inputs_header)
11011 (Incremental_inputs_header_write, Incremental_inputs_entry)
11012 (Incremental_inputs_entry_write): Move ...
11013 * incremental.h (Incremental_inputs_header)
11014 (Incremental_inputs_header_write, Incremental_inputs_entry)
11015 (Incremental_inputs_entry_write): here.
11017 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11019 * incremental.cc (make_sized_incremental_binary): Set the target.
11020 Error if it is incompatible.
11021 * output.h (Output_file): Add filename method.
11023 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11025 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11026 from the get_* methods.
11028 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11030 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11031 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11032 Write 0 for the data_offset of scripts.
11034 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11036 * testsuite/Makefile.am: Add the incremental_test.sh test.
11037 * testsuite/incremental_test.sh: New.
11038 * testsuite/incremental_test_1.c: New.
11039 * testsuite/incremental_test_2.c: New.
11041 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11043 * incremental-dump.cc (main): Fix typos.
11045 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11048 * incremental-dump.cc (main): Use llu to print 64 bit values.
11050 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11051 H.J. Lu <hongjiu.lu@intel.com>
11053 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11055 (incremental_dump_LDADD): Likewise.
11056 * Makefile.in: Regenerated.
11058 2009-11-25 Doug Kwan <dougkwan@google.com>
11062 2009-11-25 Doug Kwan <dougkwan@google.com>
11064 * arm.cc (Target_arm::Target_arm): Move method definition
11065 outside of class definition. Add code to handle
11066 --target1-rel, --target1-abs and --target2= options.
11067 (Target_arm::get_reloc_reloc_type): Change method to be
11068 non-static and const.
11069 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11070 New data member declaration.
11071 (Target_arm::Scan::local, Target_arm::Scan::global,
11072 Target_arm::Relocate::relocate,
11073 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11074 Adjust call to Target_arm::get_real_reloc_type.
11075 (Target_arm::get_real_reloc_type): Use command line options
11076 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11077 * options.h (--target1-rel, --target1-abs, --target2): New
11080 2009-11-25 Doug Kwan <dougkwan@google.com>
11082 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11083 class definition. Add code to handle --target1-rel, --target1-abs
11084 and --target2= options.
11085 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11087 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11088 member declaration.
11089 (Target_arm::Scan::local, Target_arm::Scan::global,
11090 Target_arm::Relocate::relocate,
11091 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11092 call to Target_arm::get_real_reloc_type.
11093 (Target_arm::get_real_reloc_type): Use command line options to
11094 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11095 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11098 2009-11-25 Doug Kwan <dougkwan@google.com>
11100 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11101 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11102 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11104 (Arm_relocate_functions::thm_call): Replace body with a call to
11105 Arm_relocate_functions::thumb_branch_common.
11106 (Arm_relocate_functions::thm_jump24,
11107 Arm_relocate_functions::thm_xpc22): New method definitions.
11108 (Arm_relocate_functions::thumb_branch_common): New method definition.
11109 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11111 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11112 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11114 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11116 * Makefile.am: Build incremental-dump
11117 * Makefile.in: Regenerate.
11118 * incremental-dump.cc: New.
11119 * incremental.cc (Incremental_inputs_header_data,
11120 Incremental_inputs_entry_data): Move to incremental.h
11121 * incremental.h: (Incremental_inputs_header_data,
11122 Incremental_inputs_entry_data): Move from incremental.cc
11124 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11126 * incremental.cc (Incremental_inputs_header,
11127 Incremental_inputs_header_write, Incremental_inputs_entry,
11128 Incremental_inputs_entry_write): Add a typedef with the data type.
11130 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11132 * incremental.cc (Incremental_inputs_header,
11133 Incremental_inputs_header_write, Incremental_inputs_entry,
11134 Incremental_inputs_entry_write): Update comment about which
11135 type has the filed descriptions.
11137 2009-11-15 Doug Kwan <dougkwan@google.com>
11139 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11140 (Arm_relocate_functions::arm_branch_common): Change method defintion
11141 in class definition to a method declaration and update list of formal
11143 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11144 Arm_relocation_functions::jump24): Adjust call to
11145 Arm_relocate_functions::arm_branch_common. Update list of formal
11147 (Arm_relocate_functions::xpc25): New method definition.
11148 (Arm_relocate_functions::arm_branch_common): Move method defintion
11149 out from class definition. Use stubs for mode-switching and extending
11151 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11152 specially. Change code to enable use of stubs in ARM branches.
11154 2009-11-10 Doug Kwan <dougkwan@google.com>
11156 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11157 in method declaration.
11158 (Target_arm::relocate_stub): New method declaration.
11159 (Target_arm::default_target): Change to return a pointer instead of
11161 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11162 Target_arm::default_target.
11163 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11165 (Target_arm::relocate_section): Adjust view.
11166 (Target_arm::relocate_stub): New method definition.
11168 2009-11-10 Doug Kwan <dougkwan@google.com>
11170 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11172 * incremental.cc (open_incremental_binary): Initialized local
11173 variables to avoid warnings.
11174 * object.cc (make_elf_object): Ditto.
11175 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11178 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11181 * testsuite/plugin_test.c: Include "config.h".
11183 2009-11-09 Doug Kwan <dougkwan@google.com>
11185 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11186 (arm_symbol_value): Remove.
11187 (Arm_relocate_functions::arm_branch_common,
11188 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11189 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11190 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11191 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11192 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11193 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11194 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11195 Arm_relocate_functions::thm_mobw_abs_nc,
11196 Arm_relocate_functions::thm_mov_abs,
11197 Arm_relocate_functions::movw_prel_nc,
11198 Arm_relocate_functions::thm_movt_abs,
11199 Arm_relocate_functions::movt_prel,
11200 Arm_relocate_functions::thm_movw_prel_nc,
11201 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11202 (Target_arm::Relocate::relocate): Only decompose address into two
11203 parts if relocation type uses the thumb-bit and pass the actual
11204 bit instead of a flag indicating that the thumb-bit is used. Adjust
11205 calls to methods in Arm_relocate_functions for this change.
11207 2009-11-08 Ian Lance Taylor <iant@google.com>
11210 * reloc.cc: Instantiate
11211 Sized_relobj::initialize_input_to_output_maps and
11212 Sized_relobj:free_input_to_output_maps.
11214 2009-11-06 Ian Lance Taylor <iant@google.com>
11217 * defstd.cc (in_segment): Set only_if_ref true for "end".
11219 2009-11-06 Doug Kwan <dougkwan@google.com>
11221 * arm.cc (class Reloc_stub): Correct a comment.
11222 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11223 (Target_arm::scan_section_for_stubs): New method declaration.
11224 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11225 Change methods from private to protected.
11226 (Target_arm::do_may_relax): New method definition.
11227 (Target_arm::do_relax, Target_arm::group_sections,
11228 Target_arm::scan_reloc_for_stub,
11229 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11230 (Target_arm::arm_input_section_map_): New data member declaration.
11231 (Target_arm::scan_reloc_for_stub,
11232 Target_arm::scan_reloc_section_for_stubs,
11233 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11234 Target_arm::do_relax): New method definitions.
11236 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11238 * configure.ac: Check for (struct stat)::st_mtim
11239 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11240 * config.in: Regenerate.
11241 * configure: Regenerate.
11243 2009-11-05 Ian Lance Taylor <iant@google.com>
11246 * output.cc (Output_segment::add_output_section): Add missing
11249 2009-11-04 Ian Lance Taylor <iant@google.com>
11252 * object.h (class Object): Add is_needed and set_is_needed
11253 methods. Add is_needed_ field. Make bool fields into bitfields.
11254 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11255 defined in a dynamic object and referenced by a regular object,
11256 set is_needed for the dynamic object.
11257 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11258 if the file is marked with as_needed and it is not needed.
11260 2009-11-04 Ian Lance Taylor <iant@google.com>
11263 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11264 tags if data is discarded by linker script.
11265 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11266 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11267 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11268 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11270 2009-11-04 Ian Lance Taylor <iant@google.com>
11272 * layout.cc (Layout::get_output_section): Add is_interp and
11273 is_dynamic_linker_section parameters. Change all callers.
11274 (Layout::choose_output_section): Likewise.
11275 (Layout::make_output_section): Likewise.
11276 (Layout::add_output_section_data): Add is_dynamic_linker_section
11277 parameter. Change all callers.
11278 * layout.h (class Layout): Update declarations.
11279 * output.h (class Output_section): Add is_interp, set_is_interp,
11280 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11281 Add is_interp_, is_dynamic_linker_section_ fields. Change
11282 generate_code_fills_at_write_ to a bitfield.
11283 * output.cc (Output_section::Output_sections): Initialize new
11285 (Output_segment::add_output_section): Add do_sort parameter.
11286 Change all callers.
11288 2009-11-03 Ian Lance Taylor <iant@google.com>
11291 * options.h (class General_options): Add --warn-common.
11292 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11293 merging two common symbols.
11294 (Symbol_table::should_override): Handle --warn-common when merging
11295 a common symbol with a defined symbol. Use report_resolve_problem
11296 for multiple definitions.
11297 (Symbol_table::report_resolve_problem): New function.
11298 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11300 2009-11-03 Doug Kwan <dougkwan@google.com>
11302 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11304 (Target_arm::stub_factory): New method definition.
11305 (Target_arm::new_arm_input_section,
11306 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11307 Target_arm::reloc_uses_thumb_bit): New method declarations.
11308 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11309 New type definitions.
11310 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11311 member declarations.
11312 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11313 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11314 New method definitions.
11316 2009-11-03 Ian Lance Taylor <iant@google.com>
11318 * options.h (class General_options): Add --warn_constructors.
11320 2009-11-03 Ian Lance Taylor <iant@google.com>
11323 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11324 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11326 2009-11-03 Ian Lance Taylor <iant@google.com>
11329 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11330 --msgid-bugs-address.
11331 (install-pdf): New target.
11332 (install-data_yes): Look up one directory to find mkinstalldirs.
11334 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11336 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11339 2009-10-30 Doug Kwan <dougkwan@google.com>
11341 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11343 2009-10-30 Doug Kwan <dougkwan@google.com>
11345 * arm.cc (Stub_addend_reader): New struct template definition
11346 and partial specializations.
11347 (Stub_addend_reader::operator()): New method definition for a
11348 partially specialized template.
11350 2009-10-30 Doug Kwan <dougkwan@google.com>
11352 * arm.cc (Arm_relobj::processor_specific_flags): New method
11354 (Arm_relobj::do_read_symbols): New method declaration.
11355 (Arm_relobj::processor_specific_flags_): New data member declaration.
11356 (Arm_dynobj): New class definition.
11357 (Target_arm::do_finalize_sections): Add input_objects parameter.
11358 (Target_arm::do_adjust_elf_header): New method declaration.
11359 (Target_arm::are_eabi_versions_compatible,
11360 (Target_arm::merge_processor_specific_flags): New method declaration.
11361 (Target_arm::do_make_elf_object): New overloaded method definitions
11363 (Arm_relobj::do_read_symbols): New method definition.
11364 (Arm_dynobj::do_read_symbols): Ditto.
11365 (Target_arm::do_finalize_sections): Add input_objects parameters.
11366 Merge processor-specific flags from all input objects.
11367 (Target_arm::are_eabi_versions_compatible,
11368 Target_arm::merge_processor_specific_flags,
11369 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11370 New method definitions.
11371 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11372 Input_objects pointer type parameter.
11373 * layout.cc (Layout::finalize): Pass input objects to target's.
11374 finalize_sections function.
11375 * output.cc (Output_file_header::do_sized_write): Set ELF file
11376 header's processor-specific flags.
11377 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11378 Input_objects pointer type parameter.
11379 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11380 * target.h (Input_objects): New forward class declaration.
11381 (Target::processor_specific_flags,
11382 Target::are_processor_specific_flags_sect): New method definitions.
11383 (Target::finalize_sections): Add input_objects parameter.
11384 (Target::Target): Initialize processor_specific_flags_ and
11385 are_processor_specific_flags_set_.
11386 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11388 (Target::set_processor_specific_flags): New method definition.
11389 (Target::processor_specific_flags_,
11390 Target::are_processor_specific_flags_set_): New data member
11392 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11393 Input_objects pointer type parameter.
11395 2009-10-30 Doug Kwan <dougkwan@google.com>
11397 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11399 2009-10-28 Ian Lance Taylor <iant@google.com>
11401 * object.h (class Relobj): Drop options parameter from
11402 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11403 do_scan_relocs, do_relocate. Change all callers.
11404 (class Sized_relobj): Drop options parameters from
11405 do_gc_process_relocs, do_scan_relocs, do_relocate,
11406 do_relocate_sections, relocate_sections, emit_relocs_scan,
11407 emit_relocs_scan_reltype. Change all callers.
11408 (struct Relocate_info): Remove options field and all references to
11410 * reloc.h (class Read_relocs): Remove options constructor
11411 parameter and options_ field. Change all callers.
11412 (class Gc_process_relocs, class Scan_relocs): Likewise.
11413 (class Relocate_task): Likewise.
11414 * target-reloc.h (scan_relocs): Remove options parameter. Change
11416 (scan_relocatable_relocs): Likewise.
11417 * target.h (class Sized_target): Remove options parameter from
11418 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11420 * gc.h (gc_process_relocs): Remove options parameter. Change all
11422 * arm.cc: Update functions to remove options parameters.
11423 * i386.cc: Likewise.
11424 * powerpc.cc: Likewise.
11425 * sparc.cc: Likewise.
11426 * x86_64.cc: Likewise.
11427 * testsuite/testfile.cc: Likewise.
11429 2009-10-28 Doug Kwan <dougkwan@google.com>
11431 * arm.cc (Arm_relobj): New class definition.
11432 (Arm_relobj::scan_sections_for_stubs,
11433 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11434 New method definitions.
11436 2009-10-28 Cary Coutant <ccoutant@google.com>
11438 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11439 (Plugin::cleanup_done_): New member.
11440 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11441 (Plugin_manager::cleanup_done_): Remove.
11442 (Plugin_manager::add_input_file): Edit error message.
11443 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11444 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11446 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11448 * fileread.cc: (File_read::View::~View): Use the new
11449 data_ownership_ filed.
11450 (File_read::~File_read): Dispose the new whole_file_view_.
11451 (File_read::open): Mmap the whole file if needed.
11452 (File_read::open): Use whole_file_view_ instead of contents_.
11453 (File_read::find_view): Use whole_file_view_ if applicable.
11454 (File_read::do_read): Use whole_file_view_ instead of contents_.
11455 (File_read::make_view): Use whole_file_view_ instead of contents_,
11456 update File_read::View::View call.
11457 (File_read::find_or_make_view): Update File_read::View::View
11459 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11461 (File_read::View::Data_ownership): New enum.
11462 (File_read::View::View): Replace bool mapped_ with Data_ownership
11464 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11465 (File_read::View::data_ownership_): New field.
11466 (File_read::contents_): Remove (replaced by whole_file_view_).
11467 (File_read::whole_file_view_): New field.
11468 * options.h (class General_options): Add --keep-files-mapped.
11470 2009-10-27 Cary Coutant <ccoutant@google.com>
11472 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11473 * testsuite/Makefile.am (plugin_test_5): New test case.
11474 * testsuite/Makefile.in: Regenerate.
11476 2009-10-25 Doug Kwan <dougkwan@google.com>
11478 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11479 from private to protected to allow access by child class.
11480 (Sized_relobj::do_relocate_sections): New method declaration.
11481 (Sized_relobj::relocate_sections): Virtualize.
11482 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11483 Sized_relobj::relocate_sections. Instantiate template explicitly
11484 for different target sizes and endianity.
11486 2009-10-24 Doug Kwan <dougkwan@google.com>
11488 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11489 (Arm_input_section::as_arm_input_section): New method.
11490 (Arm_output_section): New class definition.
11491 (Arm_output_section::create_stub_group,
11492 Arm_output_section::group_sections): New method definitions.
11494 2009-10-22 Doug Kwan <dougkwan@google.com>
11496 * arm.cc (Arm_input_section): New class definition.
11497 (Arm_input_section::init, Arm_input_section:do_write,
11498 Arm_input_section::set_final_data_size,
11499 Arm_input_section::do_reset_address_and_file_offset): New method
11502 2009-10-21 Doug Kwan <dougkwan@google.com>
11504 * arm.cc (Stub_table, Arm_input_section): New forward class
11506 (Stub_table): New class defintion.
11507 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11508 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11509 New method definition.
11511 2009-10-21 Doug Kwan <dougkwan@google.com>
11513 * arm.cc: Update copyright comments.
11514 (Target_arm): New forward class template declaration.
11515 (Arm_address): New type.
11516 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11517 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11518 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11520 (Insn_template): Same.
11521 (DEF_STUBS): New macro.
11522 (Stub_type): New enum type.
11523 (Stub_template): New class definition.
11525 (Reloc_stub): Same.
11526 (Stub_factory): Same.
11527 (Target_arm::Target_arm): Initialize may_use_blx_ and
11528 should_force_pic_veneer_.
11529 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11530 Target_arm::should_force_pic_veneer,
11531 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11532 Target_arm::using_thumb_only, Target_arm:;default_target): New
11534 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11535 New data member declarations.
11536 (Insn_template::size, Insn_template::alignment): New method defintions.
11537 (Stub_template::Stub_template): New method definition.
11538 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11539 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11540 (Stub_factory::Stub_factory): New method definition.
11541 * gold.h (string_hash): New template.
11542 * output.h (Input_section_specifier::hash_value): Use
11544 (Input_section_specifier::string_hash): Remove.
11545 * stringpool.cc (Stringpool_template::string_hash): Use
11548 2009-10-20 Doug Kwan <dougkwan@google.com>
11550 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11551 symbols of relaxed input sections.
11552 * output.h (Output_section::find_relaxed_input_section): Make
11555 2009-10-16 Doug Kwan <dougkwan@google.com>
11557 * dynobj.cc (Versions::Versions): Initialize version_script_.
11558 Only insert base version symbol definition for a shared object
11559 if version script defines any version versions.
11560 (Versions::define_base_version): New method definition.
11561 (Versions::add_def): Check that base version is not needed.
11562 (Versions::add_need): Define base version lazily.
11563 * dynobj.h (Versions::define_base_version): New method declaration.
11564 (Versions::needs_base_version_): New data member declaration.
11565 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11566 (check_DATA): Add no_version_test.stdout.
11567 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11569 * testsuite/Makefile.in: Regenerate.
11570 * testsuite/no_version_test.c: New file.
11571 * testsuite/no_version_test.sh: Ditto.
11573 2009-10-16 Doug Kwan <dougkwan@google.com>
11575 * expression.cc (class Segment_start_expression): New class definition.
11576 (Segment_start_expression::value): New method definition.
11577 (script_exp_function_segment_start): Return a new
11578 Segment_start_expression.
11579 * gold/script-c.h (script_saw_segment_start_expression): New function
11581 * script-sections.cc (Script_sections::Script_sections): Initialize
11582 SAW_SEGMENT_START_EXPRESSION_ to false.
11583 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11584 and -Tbbs options to specify section addresses if given in
11585 command line and no SEGMENT_START expression is seen in a script.
11586 * script-sections.h (Script_sections::saw_segment_start_expression,
11587 Script_sections::set_saw_segment_start_expression): New method
11589 (Script_sections::saw_segment_start_expression_): New data member
11591 * script.cc (script_saw_segment_start_expression): New function.
11592 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11593 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11594 script_test_7.sh and script_test_8.sh.
11595 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11596 script_test_8.stdout.
11597 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11598 (script_test_6, script_test_6.stdout, script_test_7,
11599 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11600 * Makefile.in: Regenerate.
11601 * testsuite/script_test_6.sh: New file.
11602 * testsuite/script_test_6.t: Same.
11603 * testsuite/script_test_7.sh: Same.
11604 * testsuite/script_test_7.t: Same.
11605 * testsuite/script_test_8.sh: Same.
11607 2009-10-16 Doug Kwan <dougkwan@google.com>
11609 * output.cc (Output_segment::set_section_list_address): Cast
11610 expressions to unsigned long long type to avoid format warnings.
11612 2009-10-15 Ian Lance Taylor <iant@google.com>
11614 * script.cc (Script_options::add_symbol_assignment): Always add a
11615 dot assignment to script_sections_.
11616 * script-sections.cc (Script_sections::add_dot_assignment):
11617 Initialize if necessary.
11619 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11620 program headers with no load segment if there is a linker script.
11622 * layout.cc (Layout::set_segment_offsets): Align the file offset
11623 to the segment aligment for -N or -n with no load segment.
11624 * output.cc (Output_segment::add_output_section): Don't crash if
11625 the first section is a TLS section.
11626 (Output_segment::set_section_list_addresses): Print an error
11627 message if the address moves backward in a linker script.
11628 * script-sections.cc
11629 (Output_section_element_input::set_section_addresses): Don't
11630 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11631 (Orphan_output_section::set_section_addresses): Likewise.
11633 2009-10-15 Doug Kwan <dougkwan@google.com>
11635 * layout.cc (Layout::finish_dynamic_section): Generate tags
11636 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11637 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11638 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11640 2009-10-14 Ian Lance Taylor <iant@google.com>
11642 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11644 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11645 data_shdr fields of relinfo.
11646 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11647 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11648 R_386_TLS_LDO_32, adjust based on section flags.
11649 (Target_i386::Relocate::fix_up_ldo): Remove.
11651 2009-10-13 Ian Lance Taylor <iant@google.com>
11653 Add support for -pie.
11654 * options.h (class General_options): Add -pie and
11656 (General_options::output_is_position_independent): Test -pie.
11657 (General_options::output_is_executable): Return true if not shared
11658 and not relocatable.
11659 (General_options::output_is_pie): Remove.
11660 * options.cc (General_options::finalize): Reject incompatible uses
11662 * gold.cc (queue_middle_tasks): A -pie link is not static.
11663 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11664 * symtab.cc (Symbol::final_value_is_known): Return false if
11665 output_is_position_independent.
11666 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11667 output_is_position_independent.
11668 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11669 output_is_position_independent.
11670 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11671 output_is_position_independent.
11672 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11674 (basic_pie_test.o, basic_pie_test): New targets.
11675 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11676 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11677 (two_file_pie_test): New target.
11678 * testsuite/Makefile.in: Rebuild.
11679 * README: Remove note saying that -pie is not supported.
11681 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11683 * options.h (class General_options): Add -init and -fini.
11684 * layout.cc (Layout::finish_dynamic_section): Emit
11685 given init and fini functions.
11687 2009-10-13 Sriraman Tallam <tmsriram@google.com>
11689 * gc.h (gc_process_relocs): Check if icf is enabled using new
11691 * gold.cc (queue_initial_tasks): Likewise.
11692 (queue_middle_tasks): Likewise.
11693 * object.cc (do_layout): Likewise.
11694 * symtab.cc (is_section_folded): Likewise.
11695 * main.cc (main): Likewise.
11696 * reloc.cc (Read_relocs::run): Likewise.
11697 (Sized_relobj::do_scan_relocs): Likewise.
11698 * icf.cc (is_function_ctor_or_dtor): New function.
11699 (Icf::find_identical_sections): Check if function is ctor or dtor when
11700 safe icf is chosen.
11701 * options.h (General_options::icf): Change option to be an enum.
11702 (Icf_status): New enum.
11703 (icf_enabled): New method.
11704 (icf_safe_folding): New method.
11705 (set_icf_status): New method.
11706 (icf_status_): New variable.
11707 * (options.cc) (General_options::finalize): Set icf_status_.
11708 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11709 icf_test and icf_keep_unique_test to use the --icf enum flag.
11710 * testsuite/icf_safe_test.sh: New file.
11711 * testsuite/icf_safe_test.cc: New file.
11713 2009-10-12 Sriraman Tallam <tmsriram@google.com>
11715 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11716 includes to gc.h and icf.h.
11717 * arm.cc: Include gc.h.
11718 * gold.cc: Likewise.
11719 * i386.cc: Likewise.
11720 * powerpc.cc: Likewise.
11721 * sparc.cc: Likewise.
11722 * x86_64.cc: Likewise.
11723 * gc.h: Include icf.h.
11725 2009-10-11 Ian Lance Taylor <iant@google.com>
11727 * plugin.cc: Include "gold.h" before other header files.
11729 2009-10-10 Chris Demetriou <cgd@google.com>
11731 * options.h (Input_file_argument::Input_file_type): New enum.
11732 (Input_file_argument::is_lib_): Replace with...
11733 (Input_file_argument::type_): New member.
11734 (Input_file_argument::Input_file_argument): Take Input_file_type
11735 'type' rather than boolean 'is_lib' as second argument.
11736 (Input_file_argument::is_lib): Use type_.
11737 (Input_file_argument::is_searched_file): New function.
11738 (Input_file_argument::may_need_search): Handle is_searched_file.
11739 * options.cc (General_options::parse_library): Support -l:filename.
11740 (General_options::parse_just_symbols): Update for Input_file_argument
11742 (Command_line::process): Likewise.
11743 * archive.cc (Archive::get_file_and_offset): Likewise.
11744 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11745 * script.cc (read_script_file, script_add_file): Likewise.
11746 * fileread.cc (Input_file::Input_file): Likewise.
11747 (Input_file::will_search_for): Handle is_searched_file.
11748 (Input_file::open): Likewise.
11749 * readsyms.cc (Read_symbols::get_name): Likewise.
11750 * testsuite/Makefile.am (searched_file_test): New test.
11751 * testsuite/Makefile.in: Regenerate.
11752 * testsuite/searched_file_test.cc: New file.
11753 * testsuite/searched_file_test_lib.cc: New file.
11755 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11756 Ian Lance Taylor <iant@google.com>
11758 * descriptor.cc: Include <cstdio> and "binary-io.h".
11759 (Descriptors::open): Open the files in binary mode always.
11760 * script.cc (Lex::get_token): Treat \r as whitespace.
11762 2009-10-09 Ian Lance Taylor <iant@google.com>
11764 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11766 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11767 Ian Lance Taylor <iant@google.com>
11769 * configure.ac: Check for readv function also.
11770 * fileread.cc (readv): Define if not HAVE_READV.
11771 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11773 * config.in: Regenerate.
11774 * configure: Regenerate.
11776 2009-10-09 Doug Kwan <dougkwan@google.com>
11778 * layout.cc (Layout::make_output_section): Call target hook to make
11779 ordinary output section.
11780 (Layout::finalize): Adjust parameter list of call the
11781 Target::may_relax().
11782 * layout.h (class Layout::section_list): New method.
11783 * merge.h (Output_merge_base::entsize): Change visibility to public.
11784 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11786 (Output_merge_string::do_is_string): New method.
11787 * object.cc (Sized_relobj::do_setup): renamed from
11788 Sized_relobj::set_up.
11789 * object.h (Sized_relobj::adjust_shndx,
11790 Sized_relobj::initializ_input_to_output_maps,
11791 Sized_relobj::free_input_to_output_maps): Change visibilities to
11793 (Sized_relobj::setup): Virtualize.
11794 (Sized_relobj::do_setup): New method declaration.
11795 (Sized_relobj::invalidate_section_offset,
11796 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11797 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11798 * options.cc (parse_int): New function.
11799 * options.h (parse_int): New declaration.
11800 (DEFINE_int): New macro.
11801 (stub_group_size): New option.
11802 * output.cc (Output_section::Output_section): Initialize memebers
11803 merge_section_map_, merge_section_by_properties_map_,
11804 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11805 (Output_section::add_input_section): Handled deferred code-fill
11806 generation and remove an old comment.
11807 (Output_section::add_relaxed_input_section): New method definition.
11808 (Output_section::add_merge_input_section): Use merge section by
11809 properties map to speed to search. Update merge section maps
11811 (Output_section::build_relaxation_map): New method definition.
11812 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11814 (Output_section::relax_input_section): Renamed to
11815 Output_section::convert_input_sections_to_relaxed_sections and change
11816 interface to take a vector of pointers to relaxed sections.
11817 (Output_section::find_merge_section,
11818 Output_section::find_relaxed_input_section): New method definitions.
11819 (Output_section::is_input_address_mapped,
11820 Output_section::output_offset, Output_section::output_address):
11821 Use output section data maps to speed up searching.
11822 (Output_section::find_starting_output_address): Add comments.
11823 (Output_section::do_write,
11824 Output_section::write_to_postprocessing_buffer): Do code-fill
11825 generation as appropriate.
11826 (Output_section::get_input_sections): Invalidate relaxed input section
11828 (Output_section::restore_states): Adjust type of checkpoint .
11829 Invalidate relaxed input section map.
11830 * output.h (Output_merge_base): New class declaration.
11831 (Input_section_specifier): New class defintion.
11832 (class Output_relaxed_input_section) Change base class to
11833 Output_section_data_build.
11834 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11835 base class initializer.
11836 (Output_section::add_relaxed_input_section): New method declaration.
11837 (Output_section::Input_section): Change visibility to protected.
11838 (Output_section::Input_section::relobj,
11839 Output_section::Input_section::shndx): Handle relaxed input sections.
11840 Output_section::input_sections) Change visibility to protected. Also
11841 define overload to return a non-const pointer.
11842 (Output_section::Merge_section_properties): New class defintion.
11843 (Output_section::Merge_section_by_properties_map,
11844 Output_section::Output_section_data_by_input_section_map,
11845 Output_section::Relaxation_map): New types.
11846 (Output_section::relax_input_section): Rename method to
11847 Output_section::convert_input_sections_to_relaxed_sections and change
11848 interface to take a vector of relaxed section pointers.
11849 (Output_section::find_merge_section,
11850 Output_section::find_relaxed_input_section,
11851 Output_section::build_relaxation_map,
11852 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11853 New method declarations.
11854 (Output_section::merge_section_map_
11855 Output_section::merge_section_by_properties_map_,
11856 Output_section::relaxed_input_section_map_,
11857 Output_section::is_relaxed_input_section_map_valid_,
11858 Output_section::generate_code_fills_at_write_): New data members.
11859 * script-sections.cc
11860 (Output_section_element_input::set_section_addresses): Call
11861 current_data_size and addralign methods of relaxed input sections.
11862 (Orphan_output_section::set_section_addresses): Call current_data_size
11863 and addralign methods of relaxed input sections.
11864 * symtab.cc (Symbol_table::compute_final_value): Extract template
11865 from the body of Symbol_table::sized_finalize_symbol.
11866 (Symbol_table::sized_finalized_symbol): Call
11867 Symbol_table::compute_final_value.
11868 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11869 (Symbol_table::compute_final_value): New templated method declaration.
11870 * target.cc (Target::do_make_output_section): New method defintion.
11871 * target.h (Target::make_output_section): New method declaration.
11872 (Target::relax): Add more parameters for input objects, symbol table
11873 and layout. Adjust call to do_relax.
11874 (Target::do_make_output_section): New method declaration.
11875 (Target::do_relax): Add parameters for input objects, symbol table
11878 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11880 * pread.c: Include stdio.h.
11882 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11884 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11887 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11889 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11890 Change read_shndx type to unsigned int.
11891 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11893 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11894 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11895 Change read_shndx type to unsigned int.
11896 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11898 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11899 * layout.cc (Layout::create_symtab_sections): Cast the result of
11900 local_symcount * symsize to off_t in the gold_assert.
11902 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11904 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11905 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11907 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11908 (Arm_relocate_functions::thm_abs5): New function.
11909 (Arm_relocate_functions::abs12): New function.
11910 (Arm_relocate_functions::abs16): New function.
11911 (Arm_relocate_functions::base_abs): New function.
11912 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11913 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11914 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11916 (Scan::global): Likewise.
11917 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11918 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11919 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11920 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11923 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11925 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11926 (Arm_relocate_functions::movt_prel): New function.
11927 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11928 (Arm_relocate_functions::thm_movt_prel): New function.
11929 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11930 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11931 (Scan::global, Relocate::relocate): Likewise.
11932 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11934 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11936 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11937 Incremental_checker.
11938 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11940 (class Incremental_inputs_header): New class.
11941 (Incremental_inputs_header_writer): Edit comment.
11942 (Incremental_inputs_entry): New class.
11943 (Incremental_inputs_entry_writer): Edit comment.
11944 (Sized_incremental_binary::do_find_incremental_inputs_section):
11945 Add *strtab_shndx parameter, fill it.
11946 (Sized_incremental_binary::do_check_inputs): New method.
11947 (Incremental_checker::can_incrementally_link_output_file): Use
11948 Sized_incremental_binary::check_inputs.
11949 (Incremental_inputs::report_command_line): Save command line in
11952 (Incremental_binary::find_incremental_inputs_section): New
11954 (Incremental_binary::do_find_incremental_inputs_section): Add
11955 strtab_shndx parameter.
11956 (Incremental_binary::do_check_inputs): New pure virtual method.
11957 (Sized_incremental_binary::do_check_inputs): Declare.
11958 (Incremental_checker::Incremental_checker): Add incremental_inputs
11959 parameter, use it to initialize incremental_inputs_.
11960 (Incremental_checker::incremental_inputs_): New field.
11961 (Incremental_checker::command_line): New method.
11962 (Incremental_checker::inputs): New method.
11963 (Incremental_checker::command_line_): New field.
11965 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11967 * incremental.cc: Include <cstdarg> and "target-select.h".
11968 (vexplain_no_incremental): New function.
11969 (explain_no_incremental): New function.
11970 (Incremental_binary::error): New method.
11971 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11973 (make_sized_incremental_binary): New function.
11974 (open_incremental_binary): New function.
11975 (can_incrementally_link_file): Add checks if output is ELF and has
11977 * incremental.h: Include "elfcpp_file.h" and "output.h".
11978 (Incremental_binary): New class.
11979 (Sized_incremental_binary): New class.
11980 (open_incremental_binary): Declare.
11981 * object.cc (is_elf_object): Use
11982 elfcpp::Elf_recognizer::is_elf_file.
11983 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11984 * output.h (Output_file::filesize): New method.
11986 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11988 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11990 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11991 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11993 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11995 (Arm_relocate_functions::movw_abs_nc): New function.
11996 (Arm_relocate_functions::movt_abs): New function.
11997 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11998 (Arm_relocate_functions::thm_movt_abs): New function.
11999 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12000 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12001 (Scan::global): Likewise.
12002 (Relocate::relocate): Likewise.
12003 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12005 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12007 * arm.cc (Arm_relocate_functions::got_prel) New function.
12008 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12009 (Relocate::relocate): Likewise.
12010 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12012 2009-10-06 Ian Lance Taylor <iant@google.com>
12014 * options.h (class General_options): Define
12015 split_stack_adjust_size parameter.
12016 * object.h (class Object): Add uses_split_stack_ and
12017 has_no_split_stack_ fields. Add uses_split_stack and
12018 has_no_split_stack accessor functions. Declare
12019 handle_split_stack_section.
12020 (class Reloc_symbol_changes): Define.
12021 (class Sized_relobj): Define Function_offsets. Declare
12022 split_stack_adjust, split_stack_adjust_reltype, and
12024 * object.cc (Object::handle_split_stack_section): New function.
12025 (Sized_relobj::do_layout): Call handle_split_stack_section.
12026 * dynobj.cc (Sized_dynobj::do_layout): Call
12027 handle_split_stack_section.
12028 * reloc.cc (Sized_relobj::relocate_sections): Call
12029 split_stack_adjust for executable sections in split_stack
12030 objects. Pass reloc_map to relocate_section.
12031 (Sized_relobj::split_stack_adjust): New function.
12032 (Sized_relobj::split_stack_adjust_reltype): New function.
12033 (Sized_relobj::find_functions): New function.
12034 * target-reloc.h: Include "object.h".
12035 (relocate_section): Add reloc_symbol_changes parameter. Change
12037 * target.h (class Target): Add calls_non_split method. Declare
12038 do_calls_non_split virtual method. Declare match_view and
12040 * target.cc: Include "elfcpp.h".
12041 (Target::do_calls_non_split): New function.
12042 (Target::match_view): New function.
12043 (Target::set_view_to_nop): New function.
12044 * gold.cc (queue_middle_tasks): Give an error if mixing
12045 split-stack and non-split-stack objects with -r.
12046 * i386.cc (Target_i386::relocate_section): Add
12047 reloc_symbol_changes parameter.
12048 (Target_i386::do_calls_non_split): New function.
12049 * x86_64.cc (Target_x86_64::relocate_section): Add
12050 reloc_symbol_changes parameter.
12051 (Target_x86_64::do_calls_non_split): New function.
12052 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12054 * powerpc.cc (Target_powerpc::relocate_section): Add
12055 reloc_symbol_changes parameter.
12056 * sparc.cc (Target_sparc::relocate_section): Add
12057 reloc_symbol_changes parameter.
12058 * configure.ac: Call AM_CONDITIONAL for the default target.
12059 * configure: Rebuild.
12060 * testsuite/Makefile.am (TEST_AS): New variable.
12061 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12062 (check_DATA): Add split_i386 and split_x86_64 files.
12063 (SPLIT_DEFSYMS): Define.
12064 (split_i386_[1234n].o): New targets.
12065 (split_i386_[124]): New targets.
12066 (split_i386_[1234r].stdout): New targets.
12067 (split_x86_64_[1234n].o): New targets.
12068 (split_x86_64_[124]): New targets.
12069 (split_x86_64_[1234r].stdout): New targets.
12070 (MOSTLYCLEANFILES): Add new executables.
12071 * testsuite/split_i386.sh: New file.
12072 * testsuite/split_x86_64.sh: New file.
12073 * testsuite/split_i386_1.s: New file.
12074 * testsuite/split_i386_2.s: New file.
12075 * testsuite/split_i386_3.s: New file.
12076 * testsuite/split_i386_4.s: New file.
12077 * testsuite/split_i386_n.s: New file.
12078 * testsuite/split_x86_64_1.s: New file.
12079 * testsuite/split_x86_64_2.s: New file.
12080 * testsuite/split_x86_64_3.s: New file.
12081 * testsuite/split_x86_64_4.s: New file.
12082 * testsuite/split_x86_64_n.s: New file.
12083 * testsuite/testfile.cc (Target_test): Update relocation_section
12085 * testsuite/Makefile.in: Rebuild.
12087 2009-10-06 Ian Lance Taylor <iant@google.com>
12089 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12090 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12091 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12092 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12093 the address on ldo_addrs_.
12094 (Target_i386::Relocate::fix_up_ldo): New function.
12096 2009-10-06 Rafael Espindola <espindola@google.com>
12098 * plugin.cc (add_input_library): New.
12099 (Plugin::load): Add add_input_library to tv.
12100 (Plugin_manager::add_input_file): Add the is_lib argument.
12101 (add_input_file): Update call to Plugin_manager::add_input_file.
12102 (add_input_library): New.
12103 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12105 2009-09-30 Doug Kwan <dougkwan@google.com>
12107 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12108 symbol and call Symbol::may_need_copy_reloc to determine if
12109 a copy reloc is needed.
12110 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12111 nocopyreloc is given in command line.
12112 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12113 given in command line.
12114 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12115 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12116 of the removed Target_i386::may_need_copy_reloc.
12117 * options.h (copyreloc): New option with default value false.
12118 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12119 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12120 instead of the removed Target_powerpc::may_need_copy_reloc.
12121 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12122 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12123 instead of the removed Target_sparc::may_need_copy_reloc.
12124 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12125 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12126 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12127 instead of the removed Target_x86_64::may_need_copy_reloc.
12129 2009-09-30 Ian Lance Taylor <iant@google.com>
12131 * object.h (class Object): Remove target_ field, and target,
12132 sized_target, and set_target methods.
12133 (Object::sized_target): Remove.
12134 (class Sized_relobj): Update declarations. Remove sized_target.
12135 * object.cc (Sized_relobj::setup): Remove target parameter.
12136 Change all callers.
12137 (Input_objects::add_object): Don't do anything with the target.
12138 (make_elf_sized_object): Add punconfigured parameter. Change all
12139 callers. Set or test parameter target.
12140 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12141 Change all callers.
12142 * parameters.cc (Parameters::set_target): Change parameter type to
12144 (Parameters::default_target): Remove.
12145 (set_parameters_target): Change parameter type to be non-const.
12146 (parameters_force_valid_target): New function.
12147 (parameters_clear_target): New function.
12148 * parameters.h (class Parameters): Update declarations. Remove
12149 default_target method. Add sized_target and clear_target
12150 methods. Change target_ to be non-const.
12151 (set_parameters_target): Update declaration.
12152 (parameters_force_valid_target): Declare.
12153 (parameters_clear_target): Declare.
12154 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12155 as NULL if we aren't searching.
12156 (Add_symbols::run): Don't check for compatible target.
12157 * fileread.cc (Input_file::open_binary): Call
12158 parameters_force_valid_target.
12159 * gold.cc (queue_middle_tasks): Likewise.
12160 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12161 set_target on object.
12162 * dynobj.h (class Sized_dynobj): Update declarations.
12163 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12164 make_elf_object returns NULL.
12165 (Archive::include_member): Don't check whether object target is
12167 * output.cc (Output_section::add_input_section): Get target from
12169 (Output_section::relax_input_section): Likewise.
12170 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12172 (Sized_relobj::do_scan_relocs): Likewise.
12173 (Sized_relobj::relocate_sections): Likewise.
12174 * resolve.cc (Symbol_table::resolve): Likewise.
12175 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12176 parameter. Change all callers.
12177 (Symbol_table::add_from_object): Get target from parameters.
12178 (Symbol_table::add_from_relobj): Don't check object target.
12179 (Symbol_table::add_from_dynobj): Likewise.
12180 (Symbol_table::define_special_symbol): Get target from
12182 * symtab.h (class Symbol_table): Update declaration.
12183 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12184 parameter. Change all callers. Clear parameter target.
12185 (Binary_test): Test target here.
12186 * testsuite/object_unittest.cc (gold_testsuite): Remove
12187 target_test_pointer parameter. Change all callers.
12188 (Object_test): Test target here.
12190 2009-09-26 Ian Lance Taylor <iant@google.com>
12192 * testsuite/initpri1.c: Don't try to use constructor priorities if
12193 compiling with gcc before 4.3.
12195 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12197 * testsuite/retain_symbols_file_test.sh (check_present): Change
12198 output file name to retain_symbols_file_test.stdout.
12199 (check_absent): Likewise.
12201 2009-09-18 Craig Silverstein <csilvers@google.com>
12203 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12204 * options.cc: Include <cerrno> and <fstream>.
12205 (General_options::finalize): Parse -retain-symbols-file tag.
12206 * options.h: New flag.
12207 (General_options): New method should_retain_symbol, new
12208 variable symbols_to_retain.
12209 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12210 should_retain_symbol map.
12211 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12212 * testsuite/Makefile.in: Regenerate.
12213 * testsuite/retain_symbols_file_test.sh: New file.
12215 2009-09-18 Nick Clifton <nickc@redhat.com>
12217 * po/es.po: Updated Spanish translation.
12219 2009-09-17 Doug Kwan <dougkwan@google.com>
12221 * debug.h (DEBUG_RELAXATION): New constant.
12222 (DEBUG_ALL): Add DEBUG_RELAXATION.
12223 (debug_string_to_enum): Add relaxation debug option.
12225 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12226 Layout::Relaxation_debug_check::read_sections,
12227 Layout::Relaxation_debug_check::read_sections): New method definitions.
12228 (Layout::Layout): Initialize data members
12229 record_output_section_data_from_scrips_,
12230 script_output_section_data_list_ and relaxation_debug_check_.
12231 (Layout::save_segments, Layout::restore_segments,
12232 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12233 Layout::relaxation_loop_body): New method definitions.
12234 (Layout::finalize): Support relaxation. Move section layout code to
12235 Layout::relaxation_loop_body.
12236 (Layout::set_asection_address_from_script): Move code for orphan
12237 section placement out.
12238 (Layout::place_orphan_sections_in_script): New method definition.
12239 * layout.h (Output_segment_headers, Output_file_header):
12240 New forward class declarations.
12241 (Layout::~Layout): Define.
12242 (Layout::new_output_section_data_from_script): New method definition.
12243 (Layout::place_orphan_sections_in_script): New method declaration.
12244 (Layout::Segment_states): New type declaration.
12245 (Layout::save_segments, Layout::restore_segments,
12246 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12247 Layout::relaxation_loop_body): New method declarations.
12248 (Layout::Output_section_data_list): New type declaration.
12249 (Layout::Relaxation_debug_check): New class definition.
12250 (Layout::record_output_section_data_from_script_,
12251 Layout::script_output_section_data_list_, Layout::segment_states_,
12252 Layout::relaxation_debug_check_): New data members.
12253 * output.cc: (Output_section_headers::do_size): New method definition.
12254 (Output_section_headers::Output_section_headers): Move size
12255 computation to Output_section_headers::do_size.
12256 (Output_segment_headers::do_size): New method definition.
12257 (Output_file_header::Output_file_header): Move size computation to
12258 Output_file_header::do_size and call it.
12259 (Output_file_header::do_size): New method definition.
12260 (Output_data_group::Output_data_group): Adjust call to
12261 Output_section_data.
12262 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12263 (Output_symtab_xindex::do_write): Add array bound check.
12264 (Output_section::Input_section::print_to_mapfile): Handle
12265 RELAXED_INPUT_SECTION_CODE.
12266 (Output_section::Output_section): Initialize data member checkpoint_.
12267 (Output_section::~Output_section): Delete checkpoint object pointed
12269 (Output_section::add_input_section): Always add an Input_section if
12271 (Output_section::add_merge_input_section): Add assert.
12272 (Output_section::relax_input_section): New method definition.
12273 (Output_section::set_final_data_size): Set load address to zero for
12274 an unallocated section.
12275 (Output_section::do_address_and_file_offset_have_reset_values):
12276 New method definition.
12277 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12278 Handle relaxed input section.
12279 (Output_section::sort_attached_input_sections): Checkpoint input
12280 section list lazily.
12281 (Output_section::get_input_sections): Change type of input_sections to
12282 list of Simple_input_section pointers. Checkpoint input section list
12283 lazily. Also handle relaxed input sections.
12284 (Output_section::add_input_section_for_script): Take a reference to
12285 a Simple_input_section object instead of Relobj pointer and section
12286 index as parameter. Handle relaxed input sections.
12287 (Output_section::save_states, Output_section::restore_states): New
12288 method definitions.
12289 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12290 (Output_data::is_data_size_fixed): New method definition.
12291 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12293 (Output_data::address_and_file_offset_have_reset_values): New method
12295 (Output_data::do_address_and_file_offset_have_reset_values): New method
12297 (Output_data::set_data_size): Check that data size is not fixed.
12298 (Output_data::fix_data_size): New method definition.
12299 (Output_data::is_data_size_fixed_): New data member.
12300 (Output_section_headers::set_final_data_size): New method definition.
12301 (Output_section_headers::do_size): New method declaration.
12302 (Output_segment_headers::set_final_data_size): New method definition.
12303 (Output_segment_headers::do_size): New method declaration.
12304 (Output_file_header::set_final_data_size)::New method definition.
12305 (Output_file_header::do_size)::New method declaration.
12306 (Output_section_data::Output_section_data): Add new parameter
12307 is_data_size_fixed and use it to fix data size.
12308 (Output_data_const::Output_data_const): Adjust call to base class
12309 constructor and fix data size.
12310 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12311 base class constructor and fix data size.
12312 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12313 base class constructor and fix data size.
12314 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12315 class constructor and fix data size.
12316 (Output_data_group::set_final_data_size): New method definition.
12317 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12318 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12319 class constructor and fix data size.
12320 (Output_relaxed_input_section): New class definition.
12321 (Output_section::Simple_input_section): New class definition.
12322 (Output_section::get_input_sections): Adjust parameter list.
12323 (Output_section::add_input_section_for_script): Same.
12324 (Output_section::save_states, Output_section::restore_states,
12325 Output_section::do_address_and_file_offset_have_reset_values,
12326 (Output_section::Input_section::Input_section): Handle
12327 RELAXED_INPUT_SECTION_CODE. Add new overload for
12328 Output_relaxed_input_section.
12329 (Output_section::Input_section::is_input_section,
12330 Output_section::Input_section::set_output_section): Handle relaxed
12332 (Output_section::Input_section::is_relaxed_input_section,
12333 Output_section::Input_section::output_section_data,
12334 Output_section::Input_section::relaxed_input_section): New method
12336 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12338 (Output_section::Input_section::u1_): Update comments.
12339 (Output_section::Input_section::u2_): Add new union member poris.
12340 (Output_section::Checkpoint_output_section): New classs definition.
12341 (Output_section::relax_input_section): New method declaration.
12342 (Output_section::checkpoint_): New data member.
12343 (Output_segment): Update comments.
12344 (Output_segment::Output_segment): Un-privatize copy constructor.
12345 (Output_segment::operator=): Un-privatize.
12346 * script-sections.cc (Output_section_element::Input_section_list):
12347 Change element type to Output_section::Simple_input_section.
12348 (Output_section_element_dot_assignment::set_section_addresses):
12349 Register output section data for relaxation clean up.
12350 (Output_data_exression::Output_data_expression): Adjust call to base
12351 constructor to fix data size.
12352 (Output_section_element_data::set_section_addresses): Register
12353 Output_data_expression object for relaxation clean up.
12354 (struct Input_section_info): Replace Relobj pointer and section index
12355 pair with Output_section::Simple_input_section and Convert struct to a
12357 (Input_section_sorter::operator()): Adjust access to
12358 Input_section_info data member to use accessors.
12359 (Output_section_element_input::set_section_addresses): Use layout
12360 parameter. Adjust code to use Output_section::Simple_input_section
12361 and Input_secction_info classes. Register filler for relaxation
12363 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12364 and section index pair with Output_section::Simple_input_section
12365 class. Adjust code accordingly.
12366 (Phdrs_element::release_segment): New method definition.
12367 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12369 (Script_sections::release_segments): New method definition.
12370 * gold/script-sections.h (Script_sections::release_segments): New
12371 method declaration.
12372 * gold/target.h (Target::may_relax, Target::relax,
12373 Target::do_may_relax, Target::do_relax): New method definitions.
12375 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12377 * arm.cc (has_signed_unsigned_overflow): New function.
12378 (Arm_relocate_functions::abs8): New function.
12379 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12380 (Target_arm::Scan::global): Likewise.
12381 (Target_arm::relocate::relocate): Likewise.
12382 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12385 2009-09-16 Cary Coutant <ccoutant@google.com>
12387 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12388 * testsuite/Makefile.in: Regenerate.
12390 2009-09-11 Nick Clifton <nickc@redhat.com>
12392 * po/gold.pot: Updated by the Translation project.
12394 2009-09-08 Cary Coutant <ccoutant@google.com>
12396 * output.cc (Output_file::open): Add execute permission to empty file.
12397 * testsuite/Makefile.am (permission_test): New test.
12398 * testsuite/Makefile.in: Regenerate.
12400 2009-09-02 Ian Lance Taylor <iant@google.com>
12402 * output.cc (Output_file::resize): Call map_no_anonymous rather
12405 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12407 * gold.cc: Include "incremental.h".
12408 (queue_initial_tasks): Call Incremental_checker methods.
12409 * incremental.cc: Include "output.h".
12410 (Incremental_checker::can_incrementally_link_output_file): New
12412 * incremental.h (Incremental_checker): New class.
12414 * output.cc (Output_file::open_for_modification): New method.
12415 (Output_file::map_anonymous): Changed return type to bool. Record
12416 map in base_ field.
12417 (Output_file::map_no_anonymous): New method, broken out of map.
12418 (Output_file::map): Use map_no_anonymous and map_anonymous.
12419 * output.h (class Output_file): Update declarations.
12421 2009-08-24 Cary Coutant <ccoutant@google.com>
12423 * options.h (Command_line::Pre_options): New class.
12424 (Command_line::pre_options): New member.
12425 * options.cc (gold::options::ready_to_register): New variable.
12426 (One_option::register_option): Do nothing if not registering options.
12427 Assert if same short option registered twice.
12428 (General_options::General_options): Turn off option registration when
12430 (Command_line::Pre_options::Pre_options): New constructor.
12432 2009-08-24 Cary Coutant <ccoutant@google.com>
12434 * options.h (General_options::no_keep_memory): Remove incorrect
12437 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12439 * Makefile.am (am__skiplex, am__skipyacc): New.
12440 * Makefile.in: Regenerate.
12442 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12444 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12445 (INCLUDES): ... this.
12446 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12447 (AM_CPPFLAGS): Renamed from ...
12448 (INCLUDE): ... this.
12449 * Makefile.in, testsuite/Makefile.in: Regenerate.
12451 * Makefile.in: Regenerate.
12452 * aclocal.m4: Likewise.
12453 * config.in: Likewise.
12454 * configure: Likewise.
12455 * testsuite/Makefile.in: Likewise.
12457 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12458 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12459 * Makefile.in: Regenerate.
12460 * testsuite/Makefile.in: Regenerate.
12462 2009-08-19 Cary Coutant <ccoutant@google.com>
12464 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12465 symbols in shared libraries overridden by hidden or internal symbols
12466 in the main program.
12468 2009-08-19 Chris Demetriou <cgd@google.com>
12470 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12471 checking source file names in error messages.
12473 2009-08-18 Doug Kwan <dougkwan@google.com>
12475 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12476 an elcpp::Ehdr as parameter. Adjust call to set_target.
12477 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12478 an elfcpp::Ehdr as parameter.
12479 * object.cc (Object::set_target): Remove the version that looks up
12480 a target and sets it.
12481 (Sized_relobj::setup): Take a Target object instead of
12482 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12483 (make_elf_sized_object): Find target and ask target to
12484 make an ELF object.
12485 * object.h: (Object::set_target): Remove the version that looks up
12486 a target and sets it.
12487 (Sized_relobj::setup): Take a Target object instead of
12488 an elfcpp:Ehdr as parameter.
12489 * target.cc: Include dynobj.h.
12490 (Target::do_make_elf_object_implementation): New.
12491 (Target::do_make_elf_object): New.
12492 * target.h (Target::make_elf_object): New template declaration.
12493 (Target::do_make_elf_object): New method declarations.
12494 (Target::do_make_elf_object_implementation): New template declaration.
12496 2009-08-14 Ian Lance Taylor <iant@google.com>
12498 * gold.h (FUNCTION_NAME): Define.
12499 (gold_unreachable): Use FUNCTION_NAME.
12501 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12503 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12504 symbol in the --keep-unique list is not found.
12506 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12508 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12509 been maked as --keep-unique.
12510 (Icf::unfold_section): New function.
12511 * icf.h (Icf::unfold_section): New function.
12512 * options.h (General_options::keep_unique): New option.
12513 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12514 * testsuite/Makefile.in: Regenerate.
12515 * testsuite/icf_keep_unique_test.sh: New file.
12516 * testsuite/icf_keep_unique_test.cc: New file.
12518 2009-08-12 Cary Coutant <ccoutant@google.com>
12521 * resolve.cc (Symbol_table::resolve): Check for references from
12522 dynamic objects to hidden and internal symbols.
12523 * testsuite/Makefile.am (hidden_test.sh): New test.
12524 * testsuite/Makefile.in: Regenerate.
12525 * testsuite/hidden_test.sh: New script.
12526 * testsuite/hidden_test_1.c: New test source.
12527 * testsuite/hidden_test_main.c: New test source.
12529 2009-08-11 Doug Kwan <dougkwan@google.com>
12531 * arm.cc: Update comments.
12532 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12533 segment to locate the .ARM.exidx section if present.
12535 2009-08-09 Doug Kwan <dougkwan@google.com>
12537 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12540 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12541 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12544 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12546 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12547 valid tls_segment only for non-debug-section relocations.
12548 * testsuite/Makefile.am: Add gc_tls_test.
12549 * testsuite/Makefile.in: Regenerate.
12550 * testsuite/gc_tls_test.cc: New file.
12551 * testsuite/gc_tls_test.sh: New file.
12553 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12555 * icf.cc: New file.
12557 * Makefile.am (CCFILES): Add icf.cc.
12558 (HFILES): Add icf.h
12559 * Makefile.in: Regenerate.
12560 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12561 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12562 section, symbol and addend information for the relocs.
12563 * gold.cc (queue_middle_tasks): Call identical code folding.
12564 * gold.h: Add defines for multimap.
12565 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12566 to the call of finalize_local_symbols.
12567 * main.cc (main): Create object of class Icf.
12568 * object.cc (Sized_relobj::do_layout): Allow this function to be
12569 called twice during icf.
12570 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12571 to sections marked as identical by icf.
12572 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12574 (Sized_relobj::do_section_entsize): New function.
12575 * object.h (Object::section_entsize): New function.
12576 (Object::do_section_entsize): New pure virtual function.
12577 (Relobj::finalize_local_symbols): Add new parameter.
12578 (Relobj::do_section_entsize): New function.
12579 * options.h (General_options::icf): New option.
12580 (General_options::icf_iterations): New option.
12581 (General_options::print_icf_sections): New option.
12582 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12583 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12584 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12586 * symtab.cc (Symbol_table::is_section_folded): New function.
12587 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12588 to sections marked as identical by icf.
12589 * symtab.h (Symbol_table::set_icf): New function.
12590 (Symbol_table::icf): New function.
12591 (Symbol_table::is_section_folded): New function.
12592 (Symbol_table::icf_): New data member.
12593 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12594 * testsuite/Makefile.am: Add commands to build icf_test.
12595 * testsuite/Makefile.in: Regenerate.
12596 * testsuite/icf_test.sh: New file.
12597 * testsuite/icf_test.cc: New file.
12599 2009-07-24 Chris Demetriou <cgd@google.com>
12601 * layout.cc (is_compressible_debug_section): Fix incorrect
12602 comment about compressed section names.
12604 2009-07-20 Ian Lance Taylor <ian@airs.com>
12607 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12609 2009-07-16 Ian Lance Taylor <iant@google.com>
12612 * layout.h: #include <map>.
12613 (class Kept_section): Change from struct to class. Add accessors
12614 and setters. Add section size to Comdat_group mapping. Change
12615 Comdat_group to std::map. Add is_comdat_ field. Add
12616 linkonce_size field in union.
12617 (class Layout): Update declaration of find_or_add_kept_section.
12618 Don't declare find_kept_object.
12619 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12620 parameter. Add object, shndx, is_comdat, and is_group_name
12621 parameters. Change all callers. Adjust for new Kept_section.
12622 (Layout::find_kept_object): Remove.
12623 * object.cc (Sized_relobj::include_section_group): Update use of
12624 Kept_section. Rename secnum to shndx. Only record
12625 Kept_comdat_section if sections are the same size.
12626 (Sized_relobj::include_linkonce_section): Update use of
12627 Kept_section. Only record Kept_comdat_section if sections are the
12628 same size. Set size of linkonce section.
12629 (Sized_relobj::map_to_kept_section): Update call to
12630 get_kept_comdat_section.
12631 * object.h (class Sized_relobj): Rename fields in
12632 Kept_comdat_section to drop trailing underscores; change object
12633 field to Relobj*. Change Kept_comdat_section_table to store
12634 struct rather than pointer.
12635 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12636 Add kept_object and kept_shndx parameters. Change all callers.
12637 (Sized_relobj::get_kept_comdat_section): Change return type to
12638 bool. Add kept_object and kept_shndx parameters. Change all
12640 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12641 Layout::find_or_add_kept_section.
12643 2009-07-09 Ian Lance Taylor <iant@google.com>
12645 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12646 Reserve space in the hash table.
12648 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12650 * fileread.cc (File_read::get_mtime): New method.
12651 * fileread.h (Timespec): New structure.
12652 (File_read::get_mtime): New method.
12653 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12654 Renamed from timestamp_nsec.
12655 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12657 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
12659 (Incremental_inputs::report_archive): Save mtime; style fix.
12660 (Incremental_inputs::report_obejct): Save mtime; style fix.
12661 (Incremental_inputs::report_script): Save mtime; style fix.
12662 (Incremental_inputs::finalize_inputs): Style fix.
12663 (Incremental_inputs::finalize): Style fix.
12664 (Incremental_inputs::create_input_section_data): Store inputs
12666 * incremental.h (Incremental_inputs::report_script): Add mtime
12668 (Incremental_inputs::Input_info::Input_info): Intialize only one
12670 (Incremental_inputs::Input_info::archive): Move to nameless
12672 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12673 (Incremental_inputs::Input_info::script): Move to nameless union.
12674 (Incremental_inputs::mtime): New field.
12675 * script.cc (read_input_script): Pass file mtime to
12677 * script.h (Script_info::inputs): Style fix.
12679 2009-07-01 Ian Lance Taylor <ian@airs.com>
12681 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12684 2009-06-24 Ian Lance Taylor <iant@google.com>
12687 * layout.cc (Layout::choose_output_section): If we find an
12688 existing section, update the flags.
12689 (Layout::create_notes): New function, broken out of
12691 (Layout::finalize): Don't create note sections.
12692 (Layout::create_note): Don't crash if linker script discards
12694 (Layout::create_gold_note): Likewise.
12695 (Layout::create_build_id): Likewise. Don't set
12696 after_input_sections on the section.
12697 (Layout::create_executable_stack_info): Remove target parameter.
12699 * layout.h (class Layout): Declare create_notes. Update
12700 declaration of create_executable_stack_info.
12701 * gold.cc (queue_middle_tasks): Call create_notes.
12702 * output.cc (Output_section::update_flags_for_input_section): Move
12703 here from output.h. If SHF_ALLOC flag is newly set, mark address
12705 * output.h (Output_data::mark_address_invalid): New function.
12706 (class Output_section): Only declare, not define,
12707 update_flags_for_input_section. Remove set_flags.
12709 2009-06-24 Ian Lance Taylor <iant@google.com>
12711 * script-sections.cc (Output_section_definition::
12712 set_section_addresses): Rename shadowing local load_address to
12715 2009-06-24 Ian Lance Taylor <iant@google.com>
12718 * reloc.cc (relocate_sections): Skip empty relocation sections.
12720 2009-06-23 Ian Lance Taylor <iant@google.com>
12723 * layout.cc (Layout::create_note): Use choose_output_section
12724 rather than make_output_section.
12726 2009-06-23 Ian Lance Taylor <iant@google.com>
12729 * options.cc (General_options::parse_V): Set printed_version_.
12730 (General_options::General_options): Initialize printed_version_.
12731 * options.h (class General_options): Add printed_version_ field.
12732 * gold.cc (queue_initial_tasks): If there are no input files,
12733 don't give a fatal error if we printed the version information.
12734 (queue_middle_tasks): If using -r with a shared object, give a
12735 fatal error rather than an ordinary error.
12737 2009-06-23 Ian Lance Taylor <iant@google.com>
12740 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12741 (Layout::make_output_section): Set have_stabstr_section_ if we see
12742 a .stab*str section.
12743 (Layout::finalize): Call link_stabs_sections.
12744 (Layout::link_stabs_sections): New file.
12745 * layout.h (class Layout): Add have_stabstr_section_ field.
12746 Declare link_stabs_sections.
12748 2009-06-23 Doug Kwan <dougkwan@google.com>
12750 * Makefile.am (libgold_a_LIBADD): New.
12751 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
12752 * Makefile.in: Regenerate.
12753 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12754 * configure: Regenerate.
12755 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12756 * fileread.cc: Include sys/state.h
12757 * gold.h: Declare memmem and strndup if found missing.
12758 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12760 2009-06-23 Ian Lance Taylor <iant@google.com>
12762 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12763 * configure: Rebuild.
12765 2009-06-23 Ian Lance Taylor <iant@google.com>
12768 * object.cc (Object::section_contents): Don't try to get a view if
12769 the section has length zero.
12770 (Object::handle_gnu_warning_section): If the section is empty, use
12771 the name of the section as the warning.
12773 2009-06-23 Ian Lance Taylor <iant@google.com>
12776 * stringpool.h (class Stringpool_template): Add optimize_ field.
12777 (Stringpool_template::set_optimize): New function.
12778 * stringpool.cc (Stringpool_template::Stringpool_template):
12779 Initialize optimize_ field.
12780 (Stringpool_template::set_string_offsets): Test local optimize
12781 fild rather than parameter.
12782 * layout.cc (Layout::Layout): Call set_optimize on the section
12785 2009-06-22 Ian Lance Taylor <iant@google.com>
12788 * yyscript.y: Parse TARGET.
12789 * script.cc (script_set_target): New function.
12790 * script-c.h (script_set_target): Declare.
12791 * options.cc (General_options::string_to_object_format): Rename
12792 from string_to_object_format in anonymous namespace. Change
12794 * options.h (class General_options): Declare
12795 string_to_object_format.
12797 2009-06-22 Ian Lance Taylor <iant@google.com>
12799 * script-sections.cc (Script_sections::create_segments): Don't put
12800 program headers in a PT_LOAD segment if -n or -N.
12802 2009-06-22 Ian Lance Taylor <iant@google.com>
12805 * options.h (class General_options): Add -z lazy and -z now. Sort
12806 -z options into alphabetical order.
12807 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12809 2009-06-21 Ian Lance Taylor <iant@google.com>
12811 * layout.cc (Layout::make_output_section): Call
12812 Target::new_output_section.
12813 (Layout::attach_allocated_section_to_segment): Put large section
12814 sections in a separate load segment with the large segment flag
12816 (Layout::segment_precedes): Sort large data segments after other
12818 (align_file_offset): New static function.
12819 (Layout::set_segment_offsets): Use align_file_offset.
12820 * output.h (class Output_section): Add is_small_section_ and
12821 is_large_section_ fields.
12822 (Output_section::is_small_section): New function.
12823 (Output_section::set_is_small_section): New function.
12824 (Output_section::is_large_section): New function.
12825 (Output_section::set_is_large_section): New function.
12826 (Output_section::is_large_data_section): New function.
12827 (class Output_segment): Add is_large_data_segment_ field.
12828 (Output_segment::is_large_data_segment): New function.
12829 (Output_segment::set_is_large_data_segment): New function.
12830 * output.cc (Output_section::Output_section): Initialize new
12832 (Output_segment::Output_segment): Likewise.
12833 (Output_segment::add_output_section): Add assertion that large
12834 data sections always go in large data segments. Force small data
12835 sections to the end of the list of data sections. Force small BSS
12836 sections to the start of the list of BSS sections. For large BSS
12837 sections to the end of the list of BSS sections.
12838 * symtab.h (class Symbol): Declare is_common_shndx.
12839 (Symbol::is_defined): Check Symbol::is_common_shndx.
12840 (Symbol::is_common): Likewise.
12841 (class Symbol_table): Define enum Commons_section_type. Update
12842 declarations. Add small_commons_ and large_commons_ fields.
12843 * symtab.cc (Symbol::is_common_shndx): New function.
12844 (Symbol_table::Symbol_table): Initialize new fields.
12845 (Symbol_table::add_from_object): Put small and large common
12846 symbols in the right list.
12847 (Symbol_table::sized_finalized_symbol): Check
12848 Symbol::is_common_shndx.
12849 (Symbol_table::sized_write_globals): Likewise.
12850 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12851 common symbol lists. Don't call do_allocate_commons_list if the
12853 (Symbol_table::do_allocate_commons_list): Remove is_tls
12854 parameter. Add comons_section_type parameter. Change all
12855 callers. Handle small and large common symbols.
12856 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12857 Symbol::is_common_shndx.
12858 * resolve.cc (symbol_to_bits): Likewise.
12859 * target.h (Target::small_common_shndx): New function.
12860 (Target::small_common_section_flags): New function.
12861 (Target::large_common_shndx): New function.
12862 (Target::large_common_section_flags): New function.
12863 (Target::new_output_section): New function.
12864 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12865 small_common_section_flags, and large_common_section_flags
12867 (Target::do_new_output_section): New virtual function.
12868 * arm.cc (Target_arm::arm_info): Initialize new fields.
12869 * i386.cc (Target_i386::i386_info): Likewise.
12870 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12872 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12873 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12874 (Target_x86_64::do_new_output_section): New function.
12875 * configure.ac: Define conditional MCMODEL_MEDIUM.
12876 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12877 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12878 (large_LDFLAGS): Define.
12879 * testsuite/large.c: New file.
12880 * testsuite/testfile.cc (Target_test::test_target_info):
12881 Initialize new fields.
12882 * configure, testsuite/Makefile.in: Rebuild.
12884 2009-06-05 Doug Kwan <dougkwan@google.com>
12886 * Makefile.am (CCFILES): Add target.cc.
12887 * Makefile.in: Regenerate.
12888 * i386.cc (class Target_i386): Define new virtual method to
12889 override do_is_local_label_name in parent.
12890 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12891 local symbols if --discard-locals or -X is given.
12892 * options.h (class General_options): Declare new options
12893 '--discard-locals' and '-X' for discarding locals.
12894 * target.h (class Target): Define new methods is_local_label_name.
12895 Declare new virtual method do_is_local_label_name.
12896 * target.cc: New file.
12897 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12898 (check_SCRIPTS): Add discard_locals_test.sh.
12899 (check_DATA): Add discard_local_tests.syms.
12900 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12901 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12902 * testsuite/Makefile.in: Regenerate.
12903 * testsuite/discard_locals_test.c: New file.
12904 * testsuite/discard_locals_test.sh: Same.
12906 2009-06-05 Doug Kwan <dougkwan@google.com>
12908 * object.cc (Sized_relobj::Sized_relobj): Initialize
12909 discarded_eh_frame_shndx_ to -1U.
12910 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12912 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12913 a discarded .eh_frame section.
12914 (Sized_relobj::do_finalize_local_symbols): Ditto.
12915 * object.h (class Sized_relobj): Declare new member
12916 discarded_eh_frame_shndx_.
12917 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12918 (local_labels_test.o, local_labels_test): New rules.
12919 * testsuite/Makefile.in: Regenerate.
12921 2009-06-04 Doug Kwan <dougkwan@google.com>
12923 * layout.cc (Layout::section_name_mapping): Add mapping for
12924 special ARM sections.
12926 2009-06-03 Doug Kwan <dougkwan@google.com>
12928 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12929 (utils::has_overflow): Same.
12931 2009-06-03 Ian Lance Taylor <iant@google.com>
12933 * layout.cc (Layout::section_name_mapping): New array, replacing
12934 Layout::linkonce_mapping.
12935 (Layout::section_name_mapping_count): New variable, replacing
12936 Layout::linkonce_mapping_count.
12937 (Layout::linkonce_output_name): Remove.
12938 (Layout::output_section_name): Rewrite.
12939 * layout.h (class Layout): Rename Linkonce_mapping to
12940 Section_name_mapping, linkonce_mapping to section_name_mapping,
12941 linkonce_mapping_count to section_name_mapping_count. Don't
12942 declare linkonce_output_name.
12944 2009-06-03 Doug Kwan <dougkwan@google.com>
12946 * gold/arm.cc (namespace utils): New.
12947 (Target_arm::reloc_is_non_pic): Define new method.
12948 (class Arm_relocate_functions): New.
12949 (Target_arm::Relocate::relocate): Handle relocation types used by
12952 2009-06-03 Ian Lance Taylor <iant@google.com>
12954 * arm.cc (Target_arm::scan::global): Use || instead of |.
12956 2009-06-02 Doug Kwan <dougkwan@google.com>
12958 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12959 issued_non_pic_error_.
12960 (class Target_arm::Scan): Declare new method check_non_pic.
12961 Define new method symbol_needs_plt_entry.
12962 Declare new data member issued_non_pic_error_.
12963 (class Target_arm::Relocate): Declare new method
12964 should_apply_static_reloc.
12965 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12966 (Target_arm::Scan::check_non_pic): Define new method.
12967 (Target_arm::Scan::local): Handle a small subset of reloc types used
12969 (Target_arm::Scan::local): Same.
12970 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12972 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12974 * incremental.cc (Incremental_inputs::report_command_line): Filter
12975 out --incremental-* options.
12977 2009-05-29 Doug Kwan <dougkwan@google.com>
12979 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12981 (class Target_arm): Update comment.
12982 (Target_arm::Target_arm): Initialize new data members GOT_,
12983 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12984 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12985 and Target_arm::rel_dyn_section.
12986 Declare new_enum Target_arm::Got_type.
12987 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12989 Update commments for member do_dynsym_value.
12990 (Target_arm::got_size, Target_arm::plt_section,
12991 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12992 new methods inside class defintion.
12993 (Target_arm::got_section): Define new method.
12994 (Target_arm::rel_dyn_section): Same.
12995 (Output_data_plt_arm): New template class.
12996 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12997 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12998 (Output_data_plt_arm::add_entry): Same.
12999 (Output_data_plt_arm::first_plt_entry): Define new
13000 static data member for PLT instruction template.
13001 (Output_data_plt_arm::plt_entry): Same.
13002 (Output_data_plt_arm::do_write): Define new method.
13003 (Target_arm::make_plt_entry): Same.
13004 (Target_arm::do_finalize_sections): Same.
13005 (Target_arm::do_dynsym_value): Same.
13007 2009-05-28 Doug Kwan <dougkwan@google.com>
13009 * Makefile.am (TARGETSOURCES): Add arm.cc.
13010 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13011 * Makefile.in: Regenerate.
13012 * arm.cc: New file.
13013 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13015 2009-05-26 Doug Kwan <dougkwan@google.com>
13017 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13018 (General_options::check_excluded_libs): Strip off directories in
13019 archive name before matching like GNU ld does.
13020 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13021 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13022 (exclude_libs_test_LDFLAGS): Add linker option
13023 -Wl,--exclude-libs,libexclude_libs_test_3
13024 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13025 an explicit archive without using -l.
13026 (alt/libexclude_libs_test_3.a): New make rule.
13027 * testsuite/Makefile.in: Regenerate.
13028 * testsuite/exclude_libs_test.c : Declare lib3_default().
13030 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13031 * exclude_libs_test_3.c: New file.
13033 2009-05-26 Nick Clifton <nickc@redhat.com>
13035 * po/id.po: New Indonesian translation.
13036 * po/gold.pot: Updated template file.
13038 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13040 * testsuite/Makefile.am: Add -ffunction-sections to compile
13041 gc_comdat_test files. Add -Wl,--gc-sections to build
13043 * testsuite/Makefile.in: Regenerate.
13044 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13046 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13048 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13049 kept comdat section was garbage collected.
13050 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13051 * testsuite/Makefile.in: Regenerate.
13052 * testsuite/gc_comdat_test.sh: New file.
13053 * testsuite/gc_comdat_test_1.cc: New file.
13054 * testsuite/gc_comdat_test_2.cc: New file.
13056 2009-05-19 Doug Kwan <dougkwan@google.com>
13058 * archive.cc (Archive::Archive): Move constructor from archive.h
13059 to here. Initialize no_export_.
13060 (Archive::get_elf_object_for_member): Set no_export flag of object.
13061 * archive.h (Archive::Archive): Move constructor body to
13063 (Archive::no_export): New method.
13064 (Archive::no_export_): New field.
13065 * object.h (Object::Object): Initialize no_export_ to false.
13066 (Object::no_export, Object::set_no_export): New methods.
13067 (Object::no_export_): New field.
13068 * options.cc (General_options::parse_exclude_libs): New method.
13069 (General_options::check_excluded_libs) Same.
13070 * options.h (exclude_libs): New option.
13071 (General_options::check_excluded_libs): New method declaration.
13072 (General_options::excluded_libs_): New field.
13073 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13074 default or protected visibility if an object has no-export flag set.
13075 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13076 (check_SCRIPTS): Add exclude_libs_test.sh.
13077 (check_DATA): Add exclude_libs_test.syms.
13078 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13079 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13080 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13081 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13082 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13083 libexclude_libs_test_2.a): New rules.
13084 * testsuite/Makefile.in: Regenerate.
13085 * testsuite/exclude_libs_test.c: New file.
13086 * testsuite/exclude_libs_test.sh: Ditto.
13087 * testsuite/exclude_libs_test_1.c: Ditto.
13088 * testsuite/exclude_libs_test_2.c: Ditto.
13090 2009-05-15 Ian Lance Taylor <iant@google.com>
13092 * configure.ac: Check for declarations for cases where libiberty.h
13093 checks HAVE_DECL_xxx.
13094 * configure, config.in: Rebuild.
13096 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13098 * gold.h (Incremental_argument_list): Remove (invalid) forward
13100 * incremental.cc (Incremental_inputs::report_achive): New method.
13101 (Incremental_inputs::report_object): New method.
13102 (Incremental_inputs::report_script): New method.
13103 (Incremental_inputs::finalize_inputs): New method.
13104 (Incremental_inputs::finalize): Call finalize_inputs().
13105 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13106 Create inputs entries.
13107 * incremental.h (Incremental_input_type): New enum.
13108 (Incremental_inputs::Incremental_input): Initialize new fields.
13109 (Incremental_inputs::report_inputs): New method.
13110 (Incremental_inputs::report_achive): New method.
13111 (Incremental_inputs::report_object): New method.
13112 (Incremental_inputs::report_script): New method.
13113 (Incremental_inputs::finalize_inputs): New method.
13114 (Incremental_inputs::Input_info): New struct.
13115 (Incremental_inputs::Input_info_map): New typedef.
13116 (Incremental_inputs::lock_): New field.
13117 (Incremental_inputs::Inputs_): New field.
13118 (Incremental_inputs::Inputs_map): New field.
13119 * main.cc (main): Call Incremental_input::report_inputs.
13120 * options.h (Input_argument_list): Typedef moved from
13122 (Input_file_group::Files): Remove, use ::Input_argument_list.
13123 (Input_file_group::Input_argument_list): Remove, use
13124 ::Input_argument_list.
13125 * plugin.cc (Plugin_manager::add_input_file): Add error in
13127 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13129 * script.cc (read_input_script): Call
13130 Incremental_input::report_script.
13131 * script.h (Script_info): New class.
13133 2009-04-27 Ian Lance Taylor <iant@google.com>
13135 * x86_64.cc (do_adjust_output_section): Set entsize to
13138 2009-04-23 Elliott Hughes <enh@google.com>
13140 * output.cc (Output_file::close): After short writes, continue
13141 writing from the correct offset in the buffer being written.
13143 2009-04-23 Chris Demetriou <cgd@google.com>
13145 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13146 * configure: Regenerate.
13147 * config.in: Regenerate.
13148 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13149 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13151 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13153 * incremental.cc (Incremental_inputs_header_data): Renamed from
13154 Incremental_input_header_data.
13155 (Incremental_inputs_header_data::data_size): New field.
13156 (Incremental_inputs_header_data::put_input_file_count): Renamed
13157 from input_file_count.
13158 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13159 from command_line_offset.
13160 (Incremental_inputs_header_data::put_reserved): Renamed from
13162 (Incremental_inputs_entry_data): Renamed from
13163 Incremental_input_entry_data.
13164 (Incremental_inputs_entry_data::data_size): New field.
13165 (Incremental_inputs::report_command_line): New method.
13166 (Incremental_inputs::finalize): New method.
13167 (Incremental_inputs::create_incremental_inputs_data): New method.
13168 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13169 * incremental.h: New file.
13170 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13171 (Layout::finalize): Create incremental inputs section in
13172 incremental builds.
13173 (Layout::create_incremental_info_sections): New method.
13174 * layout.h (Layout::incremental_inputs): New method.
13175 (Layout::create_incremental_info_sections): New method.
13176 (Layout::incremental_inputs_): New field.
13177 * main.cc (main): Notify Incremental_input of the command line.
13179 2009-04-01 Ian Lance Taylor <iant@google.com>
13180 Mikolaj Zalewski <mikolajz@google.com>
13182 * gold.h (reserve_unordered_map): Define, three versions, one for
13183 each version of Unordered_map.
13184 * layout.cc (Layout::Layout): Remove options parameter. Add
13185 number_of_input_files parameter. Don't initialize options_.
13186 Initialize number_of_input_files_ and resized_signatures_. Move
13187 sections_are_attached_.
13188 (Layout::layout_group): Reserve space for group_signatures_.
13189 (Layout::find_or_add_kept_section): Change name parameter to be a
13190 reference. Resize signatures_ map when it gets large enough.
13191 (Layout::layout_eh_frame): Use parameters->options() instead of
13193 (Layout::make_output_section): Likewise.
13194 (Layout::attach_allocated_section_to_segment): Likewise.
13195 (Layout::finalize, Layout::create_executable_stack): Likewise.
13196 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13197 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13198 * layout.h (class Layout): Update declarations. Remove options_
13199 field. Add number_of_input_files_ and resized_signatures_
13200 fields. Move sections_are_attached_ field.
13201 * main.cc (main): Pass number of input files to Layout
13202 constructor. Don't pass options.
13204 2009-03-30 Ian Lance Taylor <iant@google.com>
13206 * ffsll.c (ffsll): Correct implementation.
13208 2009-03-27 Ian Lance Taylor <iant@google.com>
13210 * ffsll.c: New file.
13211 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13212 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13213 * ftruncate.c (ftruncate): Declare before definition.
13214 * mremap.c (mremap): Likewise.
13215 * pread.c (pread): Likewise.
13216 * configure, Makefile.in, config.in: Rebuild.
13218 * mremap.c: New file.
13219 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13220 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13221 (mremap): Declare if HAVE_MREMAP is not defined.
13222 * configure, Makefile.in, config.in: Rebuild.
13224 2009-03-27 Cary Coutant <ccoutant@google.com>
13226 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13227 position independent.
13228 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13229 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13231 2009-03-24 Cary Coutant <ccoutant@google.com>
13233 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13235 (needs_dynamic_reloc): Likewise.
13237 2009-03-24 Ian Lance Taylor <iant@google.com>
13239 * yyscript.y (file_cmd): Recognize EXTERN.
13240 (extern_name_list, extern_name_list_body): New nonterminals.
13241 * script.cc (script_add_extern): Define.
13242 * script-c.h (script_add_extern): Declare.
13244 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13246 * object.cc (is_elf_object): Define.
13247 * object.h (is_elf_object): Declare.
13248 * archive.cc (Archive::get_elf_object_for_member): Call
13250 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13252 2009-03-24 Elliott Hughes <enh@google.com>
13254 * output.cc (Output_file::map_anonymous): Define.
13255 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13256 try an anonymous one. Report the size if the mmap fails.
13257 * output.h (class Output_file): Declare map_anonymous.
13259 2009-03-24 Ian Lance Taylor <iant@google.com>
13261 * target-select.cc (instantiate_target): Don't acquire the lock if
13262 the instantiated_target_ field has already been set.
13264 2009-03-23 Ian Lance Taylor <iant@google.com>
13266 * gold-threads.h (class Initialize_lock): Define.
13267 * gold-threads.cc (class Initialize_lock_once): Define.
13268 (initialize_lock_control): New static variable.
13269 (initialize_lock_pointer): New static variable.
13270 (initialize_lock_once): New static function.
13271 (Initialize_lock::Initialize_lock): Define.
13272 (Initialize_lock::initialize): Define.
13273 * target-select.h: Include "gold-threads.h".
13274 (class Target_selector): Add lock_ and initialize_lock_ fields.
13275 Don't define instantiate_target, just declare it.
13276 * target-select.cc (Target_selector::Target_selector): Initialize
13278 (Target_selector::instantiate_target): Define.
13279 * descriptors.h: Include "gold-threads.h".
13280 (class Descriptors): Add initialize_lock_ field.
13281 * descriptors.cc (Descriptors::Descriptors): Initialize new
13283 (Descriptors::open): Use initialize_lock_ field
13284 * errors.h (class Errors): Add initialize_lock_ field.
13285 * errors.cc (Errors::Errors): Initialize new field.
13286 (Errors::initialize_lock): Use initialize_lock_ field.
13287 * powerpc.cc (class Target_selector_powerpc): Remove
13288 instantiated_target_ field. In do_recognize call
13289 instantiate_target rather than do_instantiate_target. In
13290 do_instantiate_target just allocate a new target.
13291 * sparc.cc (class Target_selector_sparc): Likewise.
13293 * freebsd.h: New file.
13294 * i386.cc: Include "freebsd.h".
13295 (Target_i386): Derive from Target_freebsd rather than
13297 (Target_selector_i386): Derive from Target_selector_freebsd rather
13298 than Target_selector.
13299 * x86_64.cc: Include "freebsd.h".
13300 (Target_x86_64): Derive from Target_freebsd rather than
13302 (Target_selector_x86_64): Derive from Target_selector_freebsd
13303 rather than Target_selector.
13304 * target.h (class Target): Add adjust_elf_header and
13305 do_adjust_elf_header.
13306 * output.cc (Output_file_header:: do_sized_write): Call target
13307 adjust_elf_header routine.
13308 * configure.tgt: Set targ_osabi.
13309 * configure.ac: Define GOLD_DEFAULT_OSABI.
13310 * parameters.cc (Parameters::default_target): Pass
13311 GOLD_DEFAULT_OSABI to select_target.
13312 * target-select.h (class Target_selector): Make instantiate_target
13313 protected rather than private.
13314 * Makefile.am (HFILES): Add freebsd.h.
13315 * configure, Makefile.in, config.in: Rebuild.
13317 * merge.cc (do_add_input_section): Correct pend value. Change
13318 message about last entry not being null terminated from error to
13321 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13323 * incremental.cc: New file.
13324 * Makefile.am (CCFILES): Add incremental.cc.
13325 * Makefile.in: Rebuild.
13327 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13329 * layout.cc (Layout::output_section_name): Preserve names
13330 of '.note.' sections.
13332 2009-03-19 Ian Lance Taylor <iant@google.com>
13334 * descriptors.cc (Descriptors::open): Check that the options are
13335 valid before using them.
13337 2009-03-18 Ian Lance Taylor <iant@google.com>
13339 * script-sections.h: Include <list>.
13340 (class Script_sections): Change Sections_elements from std::vector
13341 to std::list. Typedef public Elements_iterator. Add
13342 orphan_section_placement_, data_segment_align_start_, and
13343 saw_data_segment_align_ fields. Remove data_segment_align_index_
13345 * script-sections.cc (class Orphan_section_placement): New class.
13346 (class Sections_element): Add virtual functions is_relro and
13347 orphan_section_init. Remove virtual function place_orphan_here.
13348 (class Output_section_definition): Add is_relro and
13349 orphan_section_init. Remove place_orphan_here.
13350 (class Orphan_output_section): Likewise.
13351 (Script_sections::Script_sections): Update for field changes.
13352 (Script_sections::data_segment_align): Set saw_data_segment_align_
13353 and data_segment_align_start_, not data_segment_align_index.
13354 (Script_sections::data_segment_relro_end): Check
13355 saw_data_segment_align_. Use data_segment_align_start_ rather
13356 than data_segment_align_index_.
13357 (Script_sections::place_orphan): Rewrite to use
13358 Orphan_section_placement.
13360 2009-03-17 Ian Lance Taylor <iant@google.com>
13362 * archive.cc (Archive::add_symbols): Check for a version attached
13363 to the symbol name in the archive map.
13364 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13365 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13366 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13367 (ver_test_11.a): New target.
13368 * testsuite/Makefile.in: Rebuild.
13370 * configure.ac: Check for chsize and posix_fallocate. Replace
13372 * ftruncate.c: New file, from gnulib.
13373 * output.cc (posix_fallocate): Define dummy version if not
13374 HAVE_POSIX_FALLOCATE.
13375 (Output_file::map): Call posix_fallocate rather than lseek and
13377 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13378 * configure, Makefile.in, config.in: Rebuild.
13380 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13382 * layout.h (Layout::create_note): Add section_name parameter.
13383 * layout.cc (Layout::create_note): Likewise.
13384 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13386 2009-03-17 Ian Lance Taylor <iant@google.com>
13388 * descriptors.cc: Include "options.h".
13389 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13390 (Descriptors::open): Always use O_CLOEXEC when opening a new
13391 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13392 then set FD_CLOEXEC.
13394 * sparc.cc (class Target_sparc): Add has_got_section.
13395 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13396 make sure we have a GOT section.
13398 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13399 (Target_sparc::Scan::local): Likewise.
13400 (Target_sparc::Scan::global): Likewise.
13401 (Target_sparc::Relocate::relocate): Likewise.
13402 (Target_sparc::Relocate::relocate_tls): Likewise.
13404 * symtab.cc (Symbol_table::define_default_version): New function,
13405 broken out of add_from_object.
13406 (Symbol_table::add_from_object): Call define_default_version.
13407 (Symbol_table::define_special_symbol): Add resolve_oldsym
13408 parameter. Change all callers. If the version for a symbol comes
13409 from a version script, resolve it with the symbol with the same
13410 name with no version. Also add the symbol without a version if
13412 (do_define_in_output_data): If resolving with oldsym, don't delete
13414 (do_define_in_output_segment): Likewise.
13415 (do_define_as_constant): Likewise.
13416 * symtab.h (class Symbol_table): Update declarations.
13418 2009-03-13 Ian Lance Taylor <iant@google.com>
13420 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13421 (Read_symbols::requeue): New function.
13422 (Read_symbols::do_read_symbols): If make_elf_object fails because
13423 the target type is not configured, and the file was searched for,
13424 issue a warning and retry with the next directory.
13425 (Add_symbols::run): If the file has an incompatible format, and
13426 it was searched for, requeue the Read_symbols task. On error,
13427 release the object.
13428 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13429 dirindex parameter to constructor. Change all callers. Declare
13430 incompatible_warning and requeue.
13431 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13432 input_argument_ and input_group_ fields. Add them to
13433 constructor. Change all callers.
13434 (class Read_script): Add dirindex_ field. Add it to constructor.
13435 Change all callers.
13436 * archive.cc (Archive::setup): Remove input_objects parameter.
13437 Change all callers.
13438 (Archive::get_file_and_offset): Likewise.
13439 (Archive::read_all_symbols): Likewise.
13440 (Archive::read_symbols): Likewise.
13441 (Archive::get_elf_object_for_member): Remove input_objects
13442 parameter. Add punconfigured parameter. Change all callers.
13443 (Archive::add_symbols): Change return type to bool. Check return
13444 value of include_member.
13445 (Archive::include_all_members): Likewise.
13446 (Archive::include_member): Change return type to bool. Return
13447 false if first included object has incompatible target. Set
13448 included_member_ field.
13449 (Add_archive_symbols::run): If add_symbols returns false, requeue
13451 * archive.h (class Archive): Add included_member_ field.
13452 Initialize it in constructor. Add input_file and searched_for
13453 methods. Update declarations.
13454 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13455 input_argument_ fields. Add them to constructor. Change all
13457 * script.cc: Include "target-select.h".
13458 (class Parser_closure): Add skip_on_incompatible_target_ and
13459 found_incompatible_target_ fields. Add
13460 skip_on_incompatible_target parameter to constructor. Change all
13461 callers. Add methods skip_on_incompatible_target,
13462 clear_skip_on_incompatible_target, found_incompatible_target, and
13463 set_found_incompatible_target.
13464 (read_input_script): Add dirindex parameter. Change all callers.
13465 If parser finds an incompatible target, requeue Read_symbols
13467 (script_set_symbol): Clear skip_on_incompatible_target in
13469 (script_add_assertion, script_parse_option): Likewise.
13470 (script_start_sections, script_add_phdr): Likewise.
13471 (script_check_output_format): New function.
13472 * script.h (read_input_script): Update declaration.
13473 * script-c.h (script_check_output_format): Declare.
13474 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13475 (ignore_cmd): Remove OUTPUT_FORMAT.
13476 * fileread.cc (Input_file::Input_file): Add explicit this.
13477 (Input_file::will_search_for): New function.
13478 (Input_file::open): Add pindex parameter. Change all callers.
13479 * fileread.h (class Input_file): Add input_file_argument method.
13480 Declare will_search_for. Update declarations.
13481 * object.cc (make_elf_object): Add punconfigured parameter.
13482 Change all callers.
13483 * object.h (class Object): Make input_file public. Add
13484 searched_for method.
13485 (make_elf_object): Update declaration.
13486 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13488 * dirsearch.h (class Dirsearch): Update declaration.
13489 * options.h (class General_options): Add --warn-search-mismatch.
13490 * parameters.cc (Parameters::is_compatible_target): New function.
13491 * parameters.h (class Parameters): Declare is_compatible_target.
13492 * workqueue.cc (Workqueue::add_blocker): New function.
13493 * workqueue.h (class Workqueue): Declare add_blocker.
13495 * fileread.cc (Input_file::open): Remove options parameter.
13496 Change all callers.
13497 (Input_file::open_binary): Likewise.
13498 * script.cc (read_input_script): Likewise.
13499 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13500 options parameter from constructor. Change all callers.
13501 (class Read_script): Likewise.
13502 * fileread.h (class Input_file): Update declarations.
13503 * script.h (read_input_script): Update declaration.
13505 2009-03-10 Nick Clifton <nickc@redhat.com>
13507 * po/es.po: New Spanish translation.
13509 2009-03-06 Cary Coutant <ccoutant@google.com>
13511 * options.cc (parse_short_option): Keep dash_z from registering itself.
13513 2009-03-03 Ian Lance Taylor <iant@google.com>
13516 * target-reloc.h (relocate_section): Pass output_section to
13518 * i386.cc (Target_i386::should_apply_static_reloc): Add
13519 output_section parameter. Change all callers.
13520 (Target_i386::Relocate::relocate): Add output_section parameter.
13521 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13522 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13523 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13524 * testsuite/two_file_shared.sh: New script.
13525 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13526 (check_DATA): Add two_file_shared.dbg.
13527 (two_file_shared.dbg): New target.
13528 * testsuite/Makefile.in: Rebuild.
13530 2009-03-01 Ian Lance Taylor <iant@google.com>
13532 * configure.ac: Check for byteswap.h.
13533 * configure: Rebuild.
13534 * config.in: Rebuild.
13536 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13538 * layout.cc (Layout::find_or_add_kept_section): New function.
13539 (Layout::add_comdat): Removed.
13540 * layout.h (struct Kept_section): Move out of class Layout.
13541 Remove trailing underscores from field names. Add group_sections
13542 field. Rename group_ field to is_group. Change all uses.
13543 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13544 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13545 comdat_groups_ field.
13546 (Sized_relobj::include_section_group): Use
13547 find_or_add_kept_section and Kept_section::group_sections.
13548 (Sized_relobj::include_linkonce_section): Likewise.
13549 * object.cc (class Sized_relobj): Don't define Comdat_group or
13550 Comdat_group_table. Remove find_comdat_group and
13551 add_comdat_group. Remove comdat_groups_ field.
13552 * plugin.cc (include_comdat_group): Use
13553 Layout::find_or_add_kept_section.
13555 2009-02-28 Ian Lance Taylor <iant@google.com>
13557 * README: --gc-sections and map files are now supported. Document
13558 some build requirements.
13561 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13562 relocatable link set the value of the section symbol to zero.
13563 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13564 relocatable link don't include the section address in the local
13567 2009-02-27 Ian Lance Taylor <iant@google.com>
13570 * options.h (class Search_directory): Add is_system_directory.
13571 (class General_options): Declare is_in_system_directory.
13572 * options.cc (get_relative_sysroot): Make static.
13573 (get_default_sysroot): Make static.
13574 (General_optoins::is_in_system_directory): New function.
13575 * fileread.cc (Input_file::is_in_system_directory): New function.
13576 * fileread.h (class Input_file): Declare is_in_system_directory.
13577 * object.h (class Object): Add is_in_system_directory.
13578 (class Input_objects): Remove system_library_directory_ field.
13579 * object.cc (Input_objects::add_object): Don't set
13580 system_library_directory_.
13581 (input_objects::found_in_system_library_directory): Remove.
13582 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13583 parameter. Change all callers.
13584 (Symbol_table::sized_write_globals): Likewise.
13585 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13586 Call Object::is_in_system_directory.
13587 * symtab.h (class Symbol_table): Update declarations.
13590 * descriptors.h (Open_descriptor): Add is_on_stack field.
13591 * descriptors.cc (Descriptors::open): If the descriptor is on the
13592 top of the stack, remove it. Initialize is_on_stack field.
13593 (Descriptors::release): Only add pod to stack if it is not on the
13595 (Descriptors::close_some_descriptor): Clear stack_next and
13596 is_on_stack fields.
13599 * output.cc (Output_section::find_starting_output_address): Rename
13600 from starting_output_address; add PADDR parameter; change return
13602 * output.h (class Output_section): Declare
13603 find_starting_output_address instead of starting_output_address.
13604 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13605 section symbol for which we can't find a merge section.
13608 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13609 hidden or internal, force the symbol to be local.
13610 * resolve.cc (Symbol::override_visibility): Define.
13611 (Symbol::override_base): Use override_visibility.
13612 (Symbol_table::resolve): Likewise.
13613 (Symbol::override_base_with_special): Likewise.
13614 (Symbol_table::override_with_special): If the visibility is hidden
13615 or internal, force the symbol to be local.
13616 * symtab.h (class Symbol): Add set_visibility and
13617 override_visibility.
13618 * testsuite/ver_test_1.sh: New file.
13619 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13620 (check_DATA): Add ver_test_1.syms.
13621 (ver_test_1.syms): New target.
13622 * testsuite/Makefile.in: Rebuild.
13624 2009-02-25 Cary Coutant <ccoutant@google.com>
13626 * layout.cc (Layout::choose_output_section): Don't rename sections
13627 when using a linker script that has a SECTIONS clause.
13628 * Makefile.in: Regenerate.
13630 * testsuite/Makefile.am (script_test_5.sh): New test case.
13631 * testsuite/Makefile.in: Regenerate.
13632 * testsuite/script_test_5.cc: New file.
13633 * testsuite/script_test_5.sh: New file.
13634 * testsuite/script_test_5.t: New file.
13636 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
13638 * archive.cc (Archive::include_member): Update calls to add_symbols.
13639 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13640 the Layout argument.
13641 * dynobj.h (do_add_symbols): Add the Layout argument.
13642 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13644 * object.h (Object::add_symbols): Add the Layout argument.
13645 (Object::do_add_symbols): Add the Layout argument.
13646 (Sized_relobj::do_add_symbols): Add the Layout argument.
13647 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13648 Unify the two versions.
13649 (Add_plugin_symbols): Remove.
13650 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13651 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13652 (Add_plugin_symbols): Remove.
13653 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13654 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13655 (Add_symbols::run): Make it work with Pulginobj.
13657 2009-02-06 Ian Lance Taylor <iant@google.com>
13659 * object.cc (Sized_relobj::do_layout): Make info message start
13660 with lower case letter.
13662 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13664 * binary.cc: Fix file comment.
13666 * options.h (enum Incremental_disposition): Define.
13667 (class General_options): Add new options: --incremental,
13668 --incremental_changed, --incremental_unchanged,
13669 --incremental_unknown. Add incremental_disposition_ and
13670 implicit_incremental_ fields.
13671 (General_options::incremental_disposition): New function.
13672 (class Position_dependent_options): Add incremental_disposition
13674 (Position_dependent_options::copy_from_options): Set incremental
13676 * options.cc (General_options::parse_incremental_changed): New
13678 (General_options::parse_incremental_unchanged): New function.
13679 (General_options::parse_incremental_unknown): New function.
13680 (General_options::General_options): Initialize new fields
13681 incremental_disposition_ and implicit_incremental_.
13682 (General_options::finalize): Check for uasge of --incremental-*
13683 without --incremental.
13685 2009-02-06 Chris Demetriou <cgd@google.com>
13687 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13688 pointer and to report location as the file name associated with
13690 (gold_undefined_symbol_at_location): New function to replace the
13691 old gold_undefined_symbol functionality.
13692 * target-reloc.h (relocate_section): Update to use
13693 gold_undefined_symbol_at_location.
13694 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13695 Call gold_undefined_symbol function rather than gold_error.
13696 * errors.h (Errors::undefined_symbol): Take location as a
13697 string, rather than calculating it from a relocation.
13698 * errors.cc (Errors::fatal): Print "fatal error:" before the
13700 (Errors::error, Errors::error_at_location): Print "error: "
13701 before the formatted message.
13702 (Errors::undefined_symbol): Take location as a string, rather
13703 than calculating it from a relocation.
13704 (gold_undefined_symbol_at_location): New function akin to
13705 old gold_undefined_symbol, calculates location from relocation.
13706 (gold_undefined_symbol): Change to take only a Symbol pointer
13707 and to report location as the file name associated with the symbol.
13708 * testsuite/debug_msg.sh: Update for changed error messages.
13709 * testsuite/undef_symbol.sh: Likewise.
13711 2009-02-04 Duncan Sands <baldrick@free.fr>
13714 * reduced_debug_output.h
13715 (Output_reduced_debug_abbrev_section::failed): Use format for
13717 (Output_reduced_debug_info_section::faild): Likewise.
13719 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13721 * script.cc (Lazy_demangler): New class.
13722 (Version_script_info::get_symbol_version_helper): Demangle a
13725 2009-01-29 Cary Coutant <ccoutant@google.com>
13727 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13729 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13731 2009-01-28 Ian Lance Taylor <iant@google.com>
13733 * version.cc (version_string): Bump to 1.9.
13735 * gold.h: Include <cstring> and <stdint.h>.
13736 * version.cc: Include <cstdio>.
13737 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13739 * reduced_debug_output.cc (insert_into_vector): Rename from
13740 Insert_into_vector; change all callers. Use Swap_unaligned to
13741 avoid aliasing issue; remove union since it is unnecessary.
13743 2009-01-27 Sriraman Tallam <tmsriram@google.com>
13745 * Makefile.am (CCFILES): Add gc.cc.
13746 (HFILES): Add gc.h.
13747 * Makefile.in: Regenerate.
13748 * gold.cc (Gc_runner): New class.
13749 (queue_initial_tasks): Call garbage collection related tasks
13750 when corresponding options are invoked.
13751 (queue_middle_gc_tasks): New function.
13752 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13753 processed early before laying out sections during garbage collection.
13754 * gold.h (queue_middle_gc_tasks): New function.
13755 (is_prefix_of): Move from "layout.cc".
13756 * i386.cc (Target_i386::gc_process_relocs): New function.
13757 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13758 * main.cc (main): Create object of class "Garbage_collection".
13759 * object.cc (Relobj::copy_symbols_data): New function.
13760 (Relobj::is_section_name_included): New function.
13761 (Sized_relobj::do_layout): Allow this function to be called twice
13762 during garbage collection and defer layout of section during the
13764 * object.h (Relobj::get_symbols_data): New function.
13765 (Relobj::is_section_name_included): New function.
13766 (Relobj::copy_symbols_data): New function.
13767 (Relobj::set_symbols_data): New function.
13768 (Relobj::get_relocs_data): New function.
13769 (Relobj::set_relocs_data): New function.
13770 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13771 (Relobj::gc_process_relocs): New function.
13772 (Relobj::do_gc_process_relocs): New pure virtual function.
13773 (Relobj::sd_): New data member.
13774 (Sized_relobj::is_output_section_offset_invalid): New function.
13775 (Sized_relobj::do_gc_process_relocs): New function.
13776 * options.h (General_options::gc_sections): Modify to not be a no-op.
13777 (General_options::print_gc_sections): New option.
13778 * plugin.cc (Plugin_finish::run): Remove function call to
13779 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13780 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13781 * reloc.cc (Read_relocs::run): Add task to process relocs and
13782 determine unreferenced sections when doing garbage collection.
13783 (Gc_process_relocs): New class.
13784 (Sized_relobj::do_gc_process_relocs): New function.
13785 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13786 sections that are garbage collected.
13787 * reloc.h (Gc_process_relocs): New class.
13788 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13789 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13790 symbols whose corresponding sections are garbage collected.
13791 (Symbol_table::Symbol_table): Add new parameter for the garbage
13793 (Symbol_table::gc_mark_undef_symbols): New function.
13794 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13795 (Symbol_table::gc_mark_dyn_syms): New function.
13796 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13798 (Symbol_table::add_from_object): Likewise.
13799 (Symbol_table::add_from_relobj): When building shared objects, do not
13800 treat externally visible symbols as garbage.
13801 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13802 table information for static and relocatable links.
13803 * symtab.h (Symbol_table::set_gc): New function.
13804 (Symbol_table::gc): New function.
13805 (Symbol_table::gc_mark_undef_symbols): New function.
13806 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13807 (Symbol_table::gc_mark_dyn_syms): New function.
13808 (Symbol_table::gc_): New data member.
13809 * target.h (Sized_target::gc_process_relocs): New pure virtual
13811 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13812 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13814 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13816 * options.h (General_options::gc_sections): Define as a no-op for now.
13817 (General_options::no_keep_memory): Ditto.
13818 (General_options::Bshareable): Define.
13819 * options.cc (General_options::finalize): Honor -Bshareable.
13821 2009-01-20 Andreas Schwab <schwab@suse.de>
13823 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13824 read the value in the contents, since we don't use it. Use the
13825 template endianness when writing.
13826 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13828 2009-01-19 Andreas Schwab <schwab@suse.de>
13830 * configure.tgt (powerpc64-*): Fix targ_obj.
13832 2009-01-15 Ian Lance Taylor <iant@google.com>
13834 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13835 local symbols when stripping all symbols.
13837 2009-01-14 Cary Coutant <ccoutant@google.com>
13839 * output.cc (Output_reloc): Add explicit instantiations.
13841 2009-01-14 Cary Coutant <ccoutant@google.com>
13843 * archive.cc (Archive::get_elf_object_for_member): Remove call
13844 to File_read::claim_for_plugin.
13845 * descriptors.cc (Descriptors::open): Remove reference to
13847 (Descriptors::claim_for_plugin): Remove.
13848 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13849 (Descriptors::is_claimed): Remove.
13850 (claim_descriptor_for_plugin): Remove.
13851 * fileread.cc (File_read::claim_for_plugin): Remove.
13852 * fileread.h (File_read::claim_for_plugin): Remove.
13853 (File_read::descriptor): Reopen descriptor if necessary.
13854 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13855 (Plugin_manager::all_symbols_read): Add task parameter. Change
13857 (Plugin_manager::get_input_file): New function.
13858 (Plugin_manager::release_input_file): New function.
13859 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13860 corresponding data member.
13861 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13862 and pass to base constructor. Change all callers.
13863 (get_input_file, release_input_file): New functions.
13864 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13865 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13866 (Plugin_manager::all_symbols_read): Add task parameter.
13867 (Plugin_manager::get_input_file): New function.
13868 (Plugin_manager::release_input_file): New function.
13869 (Plugin_manager::task_): New data member.
13870 (Pluginobj::Pluginobj): Add filesize parameter.
13871 (Pluginobj::filename): New function.
13872 (Pluginobj::descriptor): New function.
13873 (Pluginobj::filesize): New function.
13874 (Pluginobj::filesize_): New data member.
13875 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13876 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13877 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13879 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13880 with archive libraries.
13881 * testsuite/Makefile.in: Regenerate.
13882 * testsuite/plugin_test.c (struct sym_info): New type.
13883 (get_input_file, release_input_file): New static variables.
13884 (onload): Capture new transfer vector entries.
13885 (claim_file_hook): Stop reading at end of file according to filesize.
13886 Factor out parsing of readelf output into separate function.
13887 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13888 APIs and get the source file name from the symbol table. Convert
13889 source file name to corresponding object file name. Print info
13890 message when adding new input files.
13891 (parse_readelf_line): New function.
13892 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13893 * testsuite/plugin_test_2.sh: Likewise.
13894 * testsuite/plugin_test_3.sh: Likewise.
13895 * testsuite/plugin_test_4.sh: New test case.
13897 2009-01-07 Ian Lance Taylor <iant@google.com>
13899 * version.cc (version_string): Bump to 1.8.
13901 2008-12-23 Cary Coutant <ccoutant@google.com>
13903 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13904 * plugin.cc (Plugin_manager::finish): Rename as
13905 layout_deferred_objects. Move cleanup to separate function.
13906 (Plugin_manager::cleanup): New function.
13907 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13909 * plugin.h (Plugin_manager::finish): Rename as
13910 layout_deferred_objects.
13911 (Plugin_manager::cleanup): New function.
13912 (Plugin_manager::cleanup_done): New field.
13914 2008-12-23 Cary Coutant <ccoutant@google.com>
13916 * plugin.cc (is_visible_from_outside): New function.
13917 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13918 so we don't return "IR only" status for exported symbols or -r links.
13920 * testsuite/Makefile.am (plugin_test_3): New test case.
13921 * testsuite/Makefile.in: Regenerate.
13922 * testsuite/plugin_test_3.sh: New file.
13924 2008-12-22 Cary Coutant <ccoutant@google.com>
13926 * object.cc (Sized_relobj::layout_section): New function.
13927 (Sized_relobj::do_layout): Defer layout of input sections until after
13928 plugin has provided replacement files.
13929 (Sized_relobj::do_layout_deferred_sections): New function.
13930 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13931 (Relobj::layout_deferred_sections): New function.
13932 (Relobj::do_layout_deferred_sections): New function.
13933 (Sized_relobj::do_layout_deferred_sections): New function.
13934 (Sized_relobj::layout_section): New function.
13935 (Sized_relobj::Deferred_layout): New structure.
13936 (Sized_relobj::deferred_layout_): New field.
13937 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13938 Change all callers. Layout deferred sections.
13939 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13941 (Plugin_hook::run): Move code from do_plugin_hook inline.
13942 (Plugin_hook::do_plugin_hook): Remove.
13943 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13944 (Plugin_manager::finish): Renamed, was cleanup.
13945 (Plugin_manager::should_defer_layout): New function.
13946 (Plugin_manager::add_deferred_layout_object): New function.
13947 (Plugin_manager::Deferred_layout_list): New type.
13948 (Plugin_manager::deferred_layout_objects_): New field.
13949 (Plugin_hook::do_plugin_hook): Remove.
13951 2008-12-17 Ian Lance Taylor <iant@google.com>
13953 * options.h (class General_options): Add --no case for
13956 2008-12-16 Cary Coutant <ccoutant@google.com>
13958 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13960 (Plugin_manager::claim_file): Create plugin object even if
13961 plugin did not call the add_symbols callback.
13962 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13963 asking for more symbols than were added.
13964 * testsuite/Makefile.am (plugin_test_1): Add test case with
13966 (empty.syms): New target.
13967 * testsuite/Makefile.in: Regenerate.
13968 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13969 message. Don't call add_symbols if no globals.
13970 (all_symbols_read_hook): Don't provide replacement for empty
13973 2008-12-12 Ian Lance Taylor <iant@google.com>
13975 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13976 r_type == 0 for a local symbol with r_sym == 0.
13977 (scan_relocatable_relocs): Pass r_sym to
13978 local_non_section_strategy.
13979 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13982 * configure.ac: Update test for TLS descriptors: they are
13983 supported as of glibc 2.9.
13984 * configure: Rebuild.
13986 2008-12-11 Ian Lance Taylor <iant@google.com>
13989 * target-reloc.h (Default_scan_relocatable_relocs): For each
13990 function, map r_type == 0 to RELOC_DISCARD.
13992 2008-12-10 Cary Coutant <ccoutant@google.com>
13994 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13995 object to override a kept COMDAT group from a plugin object.
13997 2008-12-09 Ian Lance Taylor <iant@google.com>
14000 * yyscript.y (file_cmd): Handle INPUT.
14002 * testsuite/initpri1.c: Change all declarations to be full
14003 prototypes by adding void, to avoid compiler warnings.
14005 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14007 * options.cc (General_options::parse_plugin_opt): New.
14008 (General_options::add_plugin): The argument now is just the filename.
14009 (General_options::add_plugin_option): New.
14010 * options.h (plugin_opt): New.
14011 (add_plugin): Change argument name.
14012 (add_plugin_option): New.
14013 * plugin.cc (Plugin::load): Don't parse the plugin option.
14014 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14015 (Plugin::add_option): New.
14016 (Plugin::args_): Change type.
14017 (Plugin::filename_): New.
14018 (Plugin_manager::add_plugin_option): New.
14019 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14020 * testsuite/Makefile.in: Regenerate.
14022 2008-12-05 Cary Coutant <ccoutant@google.com>
14024 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14025 Handle --strip-lto-sections option.
14026 * options.h (strip_lto_sections): New option.
14028 2008-12-01 Cary Coutant <ccoutant@google.com>
14030 * plugin.cc (ld_plugin_message): Change format parameter to const.
14031 Fix mismatch between new[] and delete.
14033 2008-11-14 Cary Coutant <ccoutant@google.com>
14035 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14038 2008-11-05 Craig Silverstein <csilvers@google.com>
14040 * options.cc (General_options::parse_dynamic_list): New function.
14041 * options.h (General_options): New flags dynamic_list,
14042 dynamic_list_data, dynamic_list_cpp_new, and
14043 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14044 (General_options::in_dynamic_list): New function.
14045 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14046 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14047 (Lex::can_continue_name): Likewise.
14049 (read_script_file): New parameter script_options.
14050 (read_dynamic_list): New function.
14051 (Script_options::define_dynamic_list): New function.
14052 (dynamic_list_keyword_parsecodes): New variable.
14053 (dynamic_list_keywords): New variable.
14054 * script.h (Script_options::define_dynamic_list): New function
14056 (read_dynamic_list): New function prototype.
14057 * symtab.cc (strprefix): New macro.
14058 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14059 dynamic_list_data, dynamic_list_cpp_new, and
14060 dynamic_list_cpp_typeinfo.
14061 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14062 (dynamic_list_expr): New rule.
14063 (dynamic_list_nodes): Likewise.
14064 (dynamic_list_node): Likewise.
14065 * testsuite/Makefile.am (dynamic_list): New test.
14066 * testsuite/Makefile.in: Regenerated.
14067 * testsuite/dynamic_list.t: New file.
14068 * testsuite/dynamic_list.sh: New file.
14070 2008-11-05 Craig Silverstein <csilvers@google.com>
14072 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14073 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14074 (t11_last): Likewise.
14075 * testsuite/ver_test_6.c (main): Likewise.
14077 2008-10-07 Cary Coutant <ccoutant@google.com>
14079 * options.c (General_options::finalize): Add check for -static and
14081 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14084 2008-10-02 Cary Coutant <ccoutant@google.com>
14086 * plugin.cc (make_sized_plugin_object): Fix conditional
14087 compilation to work when not all targets are enabled.
14089 2008-09-29 Cary Coutant <ccoutant@google.com>
14091 * archive.cc (Archive::get_file_and_offset): Use filename instead
14092 of name to get library path.
14093 (Archive::include_member): Unlock external member of a thin archive.
14095 * testsuite/Makefile.am (TEST_AR): New variable.
14096 (thin_archive_test_1): New test.
14097 (thin_archive_test_2): New test.
14098 * testsuite/Makefile.in: Regenerate.
14099 * testsuite/thin_archive_main.cc: New file.
14100 * testsuite/thin_archive_test_1.cc: New file.
14101 * testsuite/thin_archive_test_2.cc: New file.
14102 * testsuite/thin_archive_test_3.cc: New file.
14103 * testsuite/thin_archive_test_4.cc: New file.
14105 2008-09-29 Cary Coutant <ccoutant@google.com>
14107 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14108 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14110 (Sized_relobj::do_finalize_local_symbols): Likewise.
14111 (Sized_relobj::map_to_kept_section): Likewise.
14112 * object.h (Sized_relobj::invalid_address): New constant.
14113 (Sized_relobj::do_output_section_offset): Check for invalid_address
14115 * output.cc (Output_reloc::local_section_offset): Use constant
14116 invalid_address instead of -1U.
14117 (Output_reloc::get_address): Likewise.
14118 (Output_section::output_address): Change -1U to -1ULL.
14119 * output.h (Output_reloc::invalid_address): New constant.
14120 * reloc.cc (Sized_relobj::write_sections): Use constant
14121 invalid_address instead of -1U.
14122 (Sized_relobj::relocate_sections): Likewise.
14123 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14124 values for merge sections.
14125 * target-reloc.h (relocate_for_relocatable): Use constant
14126 invalid_address instead of -1U.
14128 2008-09-19 Cary Coutant <ccoutant@google.com>
14130 Add plugin functionality for link-time optimization (LTO).
14131 * configure.ac (plugins): Add --enable-plugins option.
14132 * configure: Regenerate.
14133 * config.in: Regenerate.
14134 * Makefile.am (LIBDL): New variable.
14135 (CCFILES): Add plugin.cc.
14136 (HFILES): Add plugin.h.
14137 (ldadd_var): Add LIBDL.
14138 * Makefile.in: Regenerate.
14140 * archive.cc: Include "plugin.h".
14141 (Archive::setup): Don't preread archive symbols when using a plugin.
14142 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14143 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14145 (Archive::include_member): Add symbols from plugin objects.
14146 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14147 * descriptors.cc (Descriptors::open): Check for file descriptors
14148 abandoned by plugins.
14149 (Descriptors::claim_for_plugin): New function.
14150 * descriptors.h (Descriptors::claim_for_plugin): New function.
14151 (Open_descriptor::is_claimed): New field.
14152 (claim_descriptor_for_plugin): New function.
14153 * fileread.cc (File_read::claim_for_plugin): New function.
14154 * fileread.h (File_read::claim_for_plugin): New function.
14155 (File_read::descriptor): New function.
14156 * gold.cc: Include "plugin.h".
14157 (queue_initial_tasks): Add task to call plugin hooks for generating
14159 * main.cc: Include "plugin.h".
14160 (main): Load plugin libraries.
14161 * object.h (Pluginobj): Declare.
14162 (Object::pluginobj): New function.
14163 (Object::do_pluginobj): New function.
14164 (Object::set_target): New function.
14165 * options.cc: Include "plugin.h".
14166 (General_options::parse_plugin): New function.
14167 (General_options::General_options): Initialize plugins_ field.
14168 (General_options::add_plugin): New function.
14169 * options.h (Plugin_manager): Declare.
14170 (General_options): Add --plugin option.
14171 (General_options::has_plugins): New function.
14172 (General_options::plugins): New function.
14173 (General_options::add_plugin): New function.
14174 (General_options::plugins_): New field.
14175 * plugin.cc: New file.
14176 * plugin.h: New file.
14177 * readsyms.cc: Include "plugin.h".
14178 (Read_symbols::do_read_symbols): Check for archive before checking
14179 for ELF file. Call plugin hooks to claim files.
14180 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14181 from a real object file; force override when processing replacement
14183 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14184 (Symbol::init_base_object): Likewise.
14185 (Symbol::init_base_output_data): Likewise.
14186 (Symbol::init_base_output_segment): Likewise.
14187 (Symbol::init_base_constant): Likewise.
14188 (Symbol::init_base_undefined): Likewise.
14189 (Symbol::output_section): Assert that object is not a plugin.
14190 (Symbol_table::add_from_pluginobj): New function.
14191 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14193 (Symbol_table::sized_write_globals): Likewise.
14194 (Symbol_table::add_from_pluginobj): Instantiate template.
14195 * symtab.h (Sized_pluginobj): Declare.
14196 (Symbol::in_real_elf): New function.
14197 (Symbol::set_in_real_elf): New function.
14198 (Symbol::in_real_elf_): New field.
14199 (Symbol_table::add_from_pluginobj): New function.
14201 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14202 (LIBDL): New variable.
14203 (LDADD): Add LIBDL.
14204 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14205 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14206 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14207 (MOSTLYCLEANFILES): Likewise.
14208 * testsuite/Makefile.in: Regenerate.
14209 * testsuite/plugin_test.c: New file.
14210 * testsuite/plugin_test_1.sh: New file.
14211 * testsuite/plugin_test_2.sh: New file.
14213 2008-09-16 Ian Lance Taylor <iant@google.com>
14215 * target-reloc.h (relocate_section): Check whether a symbol is
14216 defined by the ABI before reporting an undefined symbol error.
14217 * target.h (Target::is_defined_by_abi): Make parameter const.
14218 (Target::do_is_defined_by_abi): Likewise.
14219 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14220 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14221 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14222 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14223 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14224 * testsuite/Makefile.in: Rebuild.
14226 * fileread.cc (make_view): Add casts to avoid warning.
14228 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14230 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14231 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14233 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14235 * options.h (General_options::output_is_executable): New.
14236 (General_options::output_is_pie): New.
14237 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14238 for shared libraries.
14239 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14241 2008-09-11 Chris Demetriou <cgd@google.com>
14243 * options.h (origin): New -z option.
14244 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14245 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14248 2008-09-05 Cary Coutant <ccoutant@google.com>
14250 * fileread.cc (File_read::make_view): Add check for attempt to map
14251 beyond end of file.
14253 2008-09-05 Cary Coutant <ccoutant@google.com>
14255 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14256 explicit instantiations.
14258 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14261 * options.cc (General_options::finalize): Allow undefined symbols
14262 in shlibs if linking -shared.
14265 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14266 symbols as not needing a dynsym entry.
14268 2008-08-20 Craig Silverstein <csilvers@google.com>
14270 * fileread.cc (File_read::open): Do not lock the file unless it
14271 was successfully opened.
14273 2008-08-14 Cary Coutant <ccoutant@google.com>
14275 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14276 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14277 * testsuite/tls_test.cc (struct int128): 128-bit struct
14278 for testing TLS relocs with non-zero addend.
14279 (v12): New TLS variable.
14281 (t_last): Add check for v12.
14282 * testsuite/tls_test.h (t12): New function.
14283 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14285 2008-08-13 Ian Lance Taylor <iant@google.com>
14287 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14288 set tls_segment_ or relro_segment_.
14289 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14291 * output.h (Output_section::clear_is_relro): New function.
14292 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14293 sections specially even when output_data_ is empty.
14294 (Output_segment::maximum_alignment): When first section is relro,
14295 only force alignment for PT_LOAD segments.
14296 * script.cc (script_data_segment_align): New function.
14297 (script_data_segment_relro_end): New function.
14298 * script-c.h (script_data_segment_align): Declare.
14299 (script_data_segment_relro_end): Declare.
14300 * script-sections.h (class Script_sections): Declare
14301 data_segment_align and data_segment_relro_end. Add fields
14302 segment_align_index_ and saw_relro_end_.
14303 * script-sections.cc (class Sections_element): Add set_is_relro
14304 virtual function. Add new bool* parameter to place_orphan_here.
14305 Add get_output_section virtual function.
14306 (class Output_section_definition): Add set_is_relro. Add new
14307 bool* parameter to place_orphan_here. Add get_output_section.
14308 Add is_relro_ field.
14309 (Output_section_definition::Output_section_definition): Initialize
14310 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14311 and is_relro_ fields.
14312 (Output_section_definition::place_orphan_here): Add is_relro
14314 (Output_section_definition::set_section_addresses): Set relro for
14316 (Output_section_definition::alternate_constraint): Likewise.
14317 (class Orphan_output_section): Add new bool* parameter to
14318 place_orphan_here. Add get_output_section.
14319 (Orphan_output_section::place_orphan_here): Add is_relro
14321 (Script_sections::Script_sections): Initialize
14322 data_segment_align_index_ and saw_relro_end_.
14323 (Script_sections::data_segment_align): New function.
14324 (Script_sections::data_segment_relro_end): New function.
14325 (Script_sections::place_orphan): Set or clear is_relro.
14326 (Script_sections::set_section_addresses): Force alignment of first
14328 * yyscript.y (exp): Call script_data_segment_align and
14329 script_data_segment_relro_end.
14330 * testsuite/relro_script_test.t: New file.
14331 * testsuite/relro_test.cc (using_script): Declare.
14332 (t1, t2): Test using_script.
14333 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14334 (relro_script_test_SOURCES): Define.
14335 (relro_script_test_DEPENDENCIES): Define.
14336 (relro_script_test_LDFLAGS): Define.
14337 (relro_script_test_LDADD): Define.
14338 (relro_script_test.so): New target.
14339 * testsuite/Makefile.in: Rebuild.
14341 2008-08-06 Cary Coutant <ccoutant@google.com>
14343 * archive.cc (Archive::total_archives, Archive::total_members)
14344 (Archive::total_members_loaded): New variables.
14345 (Archive::setup): Add parameter. Add option to preread
14347 (Archive::read_armap): Add counter.
14348 (Archive::get_file_and_offset): New function.
14349 (Archive::get_elf_object_for_member): New function.
14350 (Archive::read_all_symbols): New function.
14351 (Archive::read_symbols): New function.
14352 (Archive::add_symbols): Add counters.
14353 (Archive::include_all_members): Use armap to find members if it's
14355 (Archive::include_member): Skip reading symbols if already read.
14356 Factored code into Archive::get_file_and_offset and
14357 Archive::get_elf_object_for_member. Changed call to
14358 Mapfile::report_include_archive_member.
14359 (Archive::print_stats): New function.
14360 * archive.h: Declare Object and Read_symbols_data classes.
14361 (Archive::Archive): Add initializers for new members.
14362 (Archive::setup): Add parameter.
14363 (Archive::print_stats): New function.
14364 (Archive::total_archives, Archive::total_members)
14365 (Archive::total_members_loaded): New variables.
14366 (Archive::get_file_and_offset): New function.
14367 (Archive::get_elf_object_for_member): New function.
14368 (Archive::read_all_symbols): New function.
14369 (Archive::read_symbols): New function.
14370 (Archive::Archive_member): New class.
14371 (Archive::members_): New member.
14372 (Archive::num_members_): New member.
14373 * main.cc: Include archive.h.
14374 (main): Call Archive::print_stats.
14375 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14376 archive parameter; member_name is now the fully-decorated name.
14377 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14378 * options.h: (General_options): Add --preread-archive-symbols option.
14379 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14382 2008-08-04 Ian Lance Taylor <iant@google.com>
14384 * symtab.h (Symbol::use_plt_offset): New function.
14385 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14386 * powerpc.cc (Relocate::relocate): Likewise.
14387 * sparc.cc (Relocate::relocate): Likewise.
14388 * x86_64.cc (Relocate::relocate): Likewise.
14389 * testsuite/weak_plt.sh: New test.
14390 * testsuite/weak_plt_main.cc: New test.
14391 * testsuite/weak_plt_shared.cc: New test.
14392 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14393 (check_PROGRAMS): Add weak_plt.
14394 (check_DATA): Add weak_plt_shared.so.
14395 (weak_plt_main_pic.o, weak_plt): New targets.
14396 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14397 * testsuite/Makefile.in: Rebuild.
14399 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14401 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14402 * testsuite/Makefile.in: Rebuild.
14404 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14406 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14407 * Makefile.in: Regenerate.
14408 * po/POTFILES.in: Regenerate.
14410 2008-07-29 Ian Lance Taylor <iant@google.com>
14412 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14413 symbols before other symbols.
14414 * testsuite/script_test_2.cc (test_addr): Declare.
14415 (test_addr_alias): Declare.
14416 (main): Check that test_addr and test_addr_alias have the right
14418 * testsuite/script_test_2.t: Define test_addr_alias and
14421 2008-07-24 Ian Lance Taylor <iant@google.com>
14424 * descriptors.cc: New file.
14425 * descriptors.h: New file.
14426 * gold-threads.h (class Hold_optional_lock): New class.
14427 * fileread.cc: Include "descriptors.h".
14428 (File_read::~File_read): Release descriptor rather than closing
14430 (File_read::open) [file]: Call open_descriptor rather than open.
14431 Set is_descriptor_opened_.
14432 (File_read::open) [memory]: Assert that descriptor is not open.
14433 (File_read::reopen_descriptor): New function.
14434 (File_read::release): Release descriptor.
14435 (File_read::do_read): Make non-const. Reopen descriptor.
14436 (File_read::read): Make non-const.
14437 (File_read::make_view): Reopen descriptor.
14438 (File_read::do_readv): Likewise.
14439 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14440 Update declarations.
14441 * layout.cc: Include "descriptors.h".
14442 (Layout::create_build_id): Use open_descriptor rather than open.
14443 * output.cc: Include "descriptors.h".
14444 (Output_file::open): Use open_descriptor rather than open.
14445 * archive.cc (Archive::const_iterator): Change Archive to be
14447 (Archive::begin, Archive::end): Make non-const.
14448 (Archive::count_members): Likewise.
14449 * archive.h (class Archive): Update declarations.
14450 * object.h (Object::read): Make non-const.
14451 * Makefile.am (CCFILES): Add descriptors.cc.
14452 (HFILES): Add descriptors.h.
14453 * Makefile.in: Rebuild.
14456 * gold.h: Always include <clocale>. Add Solaris workarounds
14457 following code in binutils/sysdep.h.
14460 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14461 this->eh_frame_hdr_ is NULL before using it.
14463 * dynobj.cc (Versions::Versions): Update comment.
14465 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14466 the base version name.
14468 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14469 array size plus one.
14470 (Stringpool_template::set_string_offsets): Subtract one from key
14471 before using it as an array index.
14472 (Stringpool_template::get_offset_with_length): Likewise.
14473 (Stringpool_template::write_to_buffer): Likewise.
14474 * stringpool.h (Stringpool_template::get_offset_from_key):
14477 2008-07-23 Ian Lance Taylor <iant@google.com>
14480 * object.h (Merged_symbol_value::value): Do our best to handle a
14484 * script.cc (Version_script_info::get_versions): Don't add empty
14485 version tag to return value.
14486 (Version_script_info::get_symbol_version_helper): Change return
14487 type to bool. Add pversion parameter. Change all callers.
14488 (script_register_vers_node): Don't require a non-NULL tag.
14489 * script.h (class Version_script_info): Update declarations.
14490 (Version_script_info::get_symbol_version): Change return type to
14491 bool. Add version parameter. Change all callers.
14492 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14493 handling. Handle an empty version from a version script.
14494 (Symbol_table::define_special_symbol): Likewise.
14495 * testsuite/ver_test_10.script: New file.
14496 * testsuite/ver_test_10.sh: New file.
14497 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14498 (check_DATA): Add ver_test_10.syms.
14499 (ver_test_10.syms, ver_test_10.so): New target.
14500 * testsuite/Makefile.in: Rebuild.
14502 2008-07-23 Simon Baldwin <simonb@google.com>
14504 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14505 to zero for undefined symbols from dynamic libraries.
14507 2008-07-23 Ian Lance Taylor <iant@google.com>
14509 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14510 Change all callers.
14511 * symtab.h (class Symbol_table): Update declaration.
14512 * testsuite/ver_test_9.cc: New file.
14513 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14514 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14515 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14516 (ver_test_9.so, ver_test_9.o): New targets.
14517 * testsuite/Makefile.in: Rebuild.
14519 2008-07-22 Ian Lance Taylor <iant@google.com>
14521 * options.h (class General_options): Define --check-sections.
14522 * layout.cc (Layout::set_segment_offsets): Handle
14525 * options.h (class General_options): Define -n/--nmagic and
14527 * options.cc (General_options::finalize): For -n/--nmagic or
14528 -N/--omagic, set -static.
14529 * layout.cc (Layout::attach_allocated_section_to_segment): If
14530 -N/--omagic, don't put read-only and read-write sections in
14531 different segments.
14532 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14533 finding a read-only segment.
14534 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14535 don't set the minimum segment alignment to the common page size,
14536 and don't set the file offset to the address modulo the page size.
14537 * script-sections.cc (Script_sections::create_segments): If
14538 -n/--omagic, don't put read-only and read-write sections in
14539 different segments.
14541 * cref.cc: New file.
14542 * cref.h: New file.
14543 * options.h (class General_options): Add --print-symbol-counts.
14544 * main.cc (main): Issue defined symbol report if requested.
14545 * archive.cc (Archive::interpret_header): Make into a const member
14547 (Archive::add_symbols): Call Input_objects::archive_start and
14549 (Archive::const_iterator): Define new class.
14550 (Archive::begin, Archive::end): New functions.
14551 (Archive::include_all_members): Rewrite to use iterator.
14552 (Archive::count_members): New function.
14553 * archive.h (class Archive): Update declarations.
14554 (Archive::filename): New function.
14555 * object.cc: Include "cref.h".
14556 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14557 (Sized_relobj::do_get_global_symbol_counts): New function.
14558 (Input_objects::add_object): Add object to cross-referencer.
14559 (Input_objects::archive_start): New function.
14560 (Input_objects::archive_stop): New function.
14561 (Input_objects::print_symbol_counts): New function.
14562 * object.h: Declare Cref and Archive.
14563 (Object::get_global_symbol_counts): New function.
14564 (Object::do_get_global_symbol_counts): New pure virtual function.
14565 (class Sized_relobj): Add defined_count_ field. Update
14567 (class Input_objects): Add cref_ field. Update constructor.
14568 Update declarations.
14569 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14571 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14573 (Sized_dynobj::do_get_global_symbol_counts): New function.
14574 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14575 defined_count_. Update declarations. Define Symbols typedef.
14576 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14577 parameter. Change all callers.
14578 (Symbol_table::add_from_dynobj): Add sympointers and defined
14579 parameters. Change all callers.
14580 * symtab.h (class Symbol_table): Update declarations.
14581 * Makefile.am (CCFILES): Add cref.cc.
14582 (HFILES): Add cref.h.
14583 * Makefile.in: Rebuild.
14585 2008-07-22 Simon Baldwin <simonb@google.com>
14587 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14588 to zero when writing undefined symbols.
14590 2008-07-22 Ian Lance Taylor <iant@google.com>
14592 * output.cc (Output_section::add_input_section): Don't try to
14593 merge empty merge sections.
14595 2008-07-21 Craig Silverstein <csilvers@google.com>
14597 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14598 Include symbol version in error message.
14600 2008-07-20 Chris Demetriou <cgd@google.com>
14602 * configure.ac (gold_cv_c_random_seed): New configured variable.
14603 (RANDOM_SEED_CFLAGS): New substituted variable.
14604 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14605 * configure: Rebuild.
14606 * Makefile.in: Likewise.
14607 * testsuite/Makefile.in: Likewise.
14609 2008-07-18 Ian Lance Taylor <iant@google.com>
14611 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14612 where we see NAME/NULL and NAME/VERSION as separate symbols.
14613 * testsuite/ver_test_main.cc (main): Call t4.
14614 (t4, t4_2a): Define.
14615 * testsuite/ver_test_2.cc (t4_2): Define.
14616 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14617 * testsuite/ver_test_4.cc (t4_2a): Define.
14618 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14619 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14621 2008-07-17 Ian Lance Taylor <iant@google.com>
14623 * dynobj.cc (Versions::add_def): If we give an error about a
14624 missing version, go ahead and create the version anyhow.
14626 2008-07-10 Ian Lance Taylor <iant@google.com>
14628 Handle output sections with more than 0x7fffffff bytes.
14629 * object.h (class Relobj): Change map_to_output_ to
14630 output_sections_, and just keep a section pointer. Change all
14631 uses. Move comdat group support to Sized_relobj.
14632 (Relobj::is_section_specially_mapped): Remove.
14633 (Relobj::output_section): Remove poff parameter. Change all
14635 (Relobj::output_section_offset): New function.
14636 (Relobj::set_section_offset): Rewrite.
14637 (Relobj::map_to_output): Remove.
14638 (Relobj::output_sections): New function.
14639 (Relobj::do_output_section_offset): New pure virtual function.
14640 (Relobj::do_set_section_offset): Likewise.
14641 (class Sized_relobj): Add section_offsets_ field. Add comdat
14642 group support from Relobj. Update declarations.
14643 (Sized_relobj::get_output_section_offset): New function.
14644 (Sized_relobj::do_output_section_offset): New function.
14645 (Sized_relobj::do_set_section_offset): New function.
14646 * object.cc (Relobj::output_section_address): Remove.
14647 (Sized_relobj::Sized_relobj): Initialize new fields.
14648 (Sized_relobj::include_section_group): Cast find_kept_object to
14650 (Sized_relobj::include_linkonce_section): Likewise.
14651 (Sized_relobj::do_layout): Use separate arrays for output section
14653 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14655 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14656 output_sections and section_offsets.
14657 (Sized_relobj::write_local_symbols): Likewise.
14658 (map_to_kept_section): Compute output address directly.
14659 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14660 output_sections and section_offsets.
14661 (Sized_relobj::write_sections): Likewise.
14662 (Sized_relobj::relocate_sections): Likewise.
14663 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14664 * output.h (class Output_reloc): Update declarations. Change
14665 u2_.relobj to Sized_relobj*.
14666 (class Output_data_reloc): Change add functions to use
14668 * output.cc (Output_reloc::Output_reloc): Change relobj to
14670 (Output_reloc::local_section_offset): Change return type to
14671 Elf_Addr. Use get_output_section_offset.
14672 (Output_reloc::get_address): Likewise.
14673 (Output_section::is_input_address_mapped): Don't call
14674 is_section_specially_mapped.
14675 (Output_section::output_offset): Likewise.
14676 (Output_section::output_address): Likewise.
14677 (Output_section::starting_output_address): Likewise.
14678 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14679 parameter to Sized_relobj*.
14680 (Copy_relocs::need_copy_reloc): Likewise.
14681 (Copy_relocs::save): Likewise.
14682 * copy-relocs.h (class Copy_relocs): Update declarations.
14683 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14684 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14685 * target-reloc.h (relocate_for_relocatable): Change
14686 offset_in_output_section type to Elf_Addr. Change code that uses
14688 * layout.cc (Layout::layout): Always set *off.
14689 * mapfile.cc (Mapfile::print_input_section): Use
14690 output_section_offset.
14691 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14693 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14694 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14695 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14697 2008-07-03 Ian Lance Taylor <iant@google.com>
14699 * layout.cc (Layout::include_section): Do not discard unrecognized
14700 SHT_STRTAB sections.
14702 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14704 * script.cc (Lex::can_continue_name): Make '?' allowable in
14705 version-script names.
14706 * testsuite/version_script.map: Change glob pattern to use '?'
14708 2008-06-30 Manish Singh <yosh@gimp.org>
14711 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14714 2008-06-30 Ian Lance Taylor <iant@google.com>
14718 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14719 versions]: Don't try to read the value in the contents, since we
14720 don't use it. Use the template endianness when writing.
14722 2008-06-25 Cary Coutant <ccoutant@google.com>
14724 * fileread.cc (File_read::make_view): Assert on zero-length view.
14725 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14726 symbol table when there are no symbols to read.
14728 2008-06-23 Craig Silverstein <csilvers@google.com>
14730 * version.cc (version_string): Bump to 1.7
14732 2008-06-18 Craig Silverstein <csilvers@google.com>
14734 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14735 constant 0xFFFF to type Valtype.
14736 (Powerpc_relocate_functions::rel16_ha): Likewise.
14738 2008-06-17 Ian Lance Taylor <iant@google.com>
14740 * output.h (Output_section::Input_section): Initialize p2align_ to
14741 zero for Output_section_data constructors.
14742 (Output_section::Input_section::addralign): If not an input
14743 section, return the alignment of the Output_section_data.
14744 * testsuite/copy_test.cc: New file.
14745 * testsuite/copy_test_1.cc: New file.
14746 * testsuite/copy_test_2.cc: New file.
14747 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14748 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14749 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14750 (copy_test_1_pic.o, copy_test_1.so): New targets.
14751 (copy_test_2_pic.o, copy_test_2.so): New targets.
14752 * testsuite/Makefile.in: Rebuild.
14754 * script-sections.cc (Script_sections::place_orphan): Initialize
14755 local variable exact.
14757 2008-06-13 David Edelsohn <edelsohn@gnu.org>
14759 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14761 2008-06-12 David Edelsohn <edelsohn@gnu.org>
14762 David S. Miller <davem@davemloft.net>
14764 * powerpc.cc: New file.
14765 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14766 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14767 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14768 * Makefile.in: Rebuild.
14770 2008-06-09 Ian Lance Taylor <iant@google.com>
14772 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14774 (throwing, orig_terminate): New static variables.
14775 (terminate_handler): New static function.
14776 (t2): Set terminate handler.
14778 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14781 * binary.cc (Binary_to_elf::sized_convert): Fix .data
14784 2008-05-30 Cary Coutant <ccoutant@google.com>
14786 * archive.cc (Archive::include_all_members) Correct to step
14787 over symbol table and extended name table in thin archives.
14789 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14792 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14795 2008-05-28 Caleb Howe <cshowe@google.com>
14797 * reduced_debug_output.cc: New file.
14798 * reduced_debug_output.h: New file.
14799 * options.h (class General_options): Add --strip-debug-non-line.
14800 * options.cc (General_options::finalize): Add strip_debug_non_line
14801 to the strip heirarchy.
14802 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14804 * layout.cc: Include "reduced_debug_output.h".
14805 (Layout::Layout): Initialize new fields.
14806 (line_only_debug_sections): New static array.
14807 (is_lines_only_debug_sections): New static inline function.
14808 (Layout::include_section): Handle --strip-debug-non-line.
14809 (Layout::make_output_section): If --strip-debug-non-line, build
14810 new output sections for .debug_abbrev and .debug_info.
14811 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14812 gold. Warn about possible overflow.
14813 (read_signed_LEB_128): Likewise.
14814 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14815 (read_signed_LEB_128): Declare.
14816 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14817 (HFILES): Add reduced_debug_output.h.
14818 * Makefile.in: Rebuild.
14820 2008-05-21 Ian Lance Taylor <iant@google.com>
14822 * mapfile.cc: New file.
14823 * mapfile.h: New file.
14824 * options.h (class General_options): Add -M/--print-map and -Map.
14825 * options.cc (General_options::finalize): Make -M equivalent to
14827 * main.cc: Include <cstdio> and "mapfile.h".
14828 (main): Open mapfile if requested.
14829 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14830 constructor. Change caller.
14831 (queue_initial_tasks): Add mapfile parameter. Change caller.
14832 (queue_middle_tasks): Likewise.
14833 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14835 * archive.cc: Include "mapfile.h".
14836 (Archive::add_symbols): Add mapfile parameter. Change all
14837 callers. Pass mapfile, symbol, and reason to include_member.
14838 (Archive::include_all_members): Add mapfile parameter. Change all
14840 (Archive::include_member): Add mapfile, sym, and why parameters.
14841 Change all callers. Report inclusion to map file.
14842 * archive.h: Include "fileread.h".
14843 (class Archive): Update declarations.
14844 (Archive::file): New const method.
14845 (class Add_archive_symbols): Add mapfile_ field. Update
14846 constructor. Change all callers.
14847 * readsyms.h (class Read_symbols): Likewise.
14848 (class Finish_group): Likewise.
14849 (class Read_script): Likewise.
14850 * common.cc: Include "mapfile.h".
14851 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14853 (Symbol_table::do_allocate_commons): Likewise.
14854 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14855 symbol allocation to mapfile.
14856 * common.h (class Allocate_commons_task): Add mapfile_ field.
14857 Update constructor. Change all callers.
14858 * symtab.h (class Symbol_table): Update declarations.
14859 * layout.cc: Include "mapfile.h".
14860 (Layout_task_runner::run): Print information to mapfile.
14861 (Layout::create_gold_note): Change Output_data_fixed_space to
14862 Output_data_zero_fill.
14863 (Layout::create_build_id): Likewise.
14864 (Layout::print_to_mapfile): New function.
14865 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14866 constructor. Change caller.
14867 (class Layout): Declare print_to_mapfile.
14868 * output.cc (Output_section::Input_section::print_to_mapfile): New
14870 (Output_section::add_input_section): If producing a map, always
14871 add to input_sections_ list.
14872 (Output_section::do_print_to_mapfile): New function.
14873 (Output_segment::print_sections_to_mapfile): New function.
14874 (Output_segment::print_section_list_to_mapfile): New function.
14875 * output.h: Include "mapfile.h".
14876 (Output_data::print_to_mapfile): New function.
14877 (Output_data::do_print_to_mapfile): New virtual function.
14878 (Output_segment_headers::do_print_to_mapfile): New function.
14879 (Output_file_header::do_print_to_mapfile): New function.
14880 (Output_data_const::do_print_to_mapfile): New function.
14881 (class Output_data_const_buffer): Add map_name_ field. Update
14882 constructor. Change all callers. Add do_print_to_mapfile
14884 (class Output_data_fixed_space): Likewise.
14885 (class Output_data_space): Likewise.
14886 (class Output_data_zero_fill): New class.
14887 (Output_data_strtab::do_print_to_mapfile): New function.
14888 (Output_data_reloc_base::do_print_to_mapfile): New function.
14889 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14890 (Output_data_group::do_print_to_mapfile): New function.
14891 (Output_data_got::do_print_to_mapfile): New function.
14892 (Output_data_dynamic::do_print_to_mapfile): New function.
14893 (Output_symtab_xindex::do_print_to_mapfile): New function.
14894 (class Output_section): Declare do_print_to_mapflie. Declare
14895 print_to_mapfile in Input_section.
14896 (class Output_segment): Declare new functions.
14897 * object.h (Sized_relobj::symbol_count): New function.
14898 * script-sections.cc
14899 (Output_section_element_dot_assignment::set_section_addresses):
14900 Change Output_data_fixed_space to Output_data_zero_fill.
14901 (Output_data_expression::do_print_to_mapfile): New function.
14902 * script.cc (read_input_script): Add mapfile parameter. Change
14904 * script.h (read_input_script): Update declaration.
14905 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14906 (Eh_frame::do_print_to_mapfile): New function.
14907 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14908 (Output_merge_string::do_print_to_mapfile): New function.
14909 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14911 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14913 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14915 * Makefile.am (CCFILES): Add mapfile.cc.
14916 (HFILES): Add mapfile.h.
14917 * Makefile.in: Rebuild.
14919 2008-05-19 Ian Lance Taylor <iant@google.com>
14921 * options.h (class General_options): Add -z relro.
14922 * layout.cc (Layout::Layout): Initialize relro_segment_.
14923 (Layout::add_output_section_data): Return the output section.
14924 (Layout::make_output_section): Rcognize relro sections and mark
14925 them appropriately.
14926 (Layout::attach_allocated_section_to_segment): Put relro sections
14927 in a PT_GNU_RELRO segment.
14928 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14930 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14932 (Layout::linkonce_mapping): Map d.rel.ro.local to
14933 .data.rel.ro.local.
14934 (Layout::output_section_name): Us .data.rel.ro.local for any
14935 section which begins with that.
14936 * layout.h (class Layout): Update add_output_section_data
14937 declaration. Add relro_segment_ field.
14938 * output.cc (Output_section::Output_section): Initialize is_relro_
14939 and is_relro_local_ fields.
14940 (Output_segment::add_output_section): Group relro sections.
14941 (Output_segment::is_first_section_relro): New function.
14942 (Output_segment::maximum_alignment): If there is a relro section,
14943 align the segment to the common page size.
14944 (Output_segment::set_section_addresses): Track whether we are
14945 looking at relro sections. If the last section is a relro
14946 section, align to the common page size.
14947 (Output_segment::set_section_list_addresses): Add in_relro
14948 parameter. Change all callers. Align to the page size when
14949 moving from relro to non-relro section.
14950 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14952 * output.h (class Output_section): Add is_relro_ and
14953 is_relro_local_ fields.
14954 (Output_section::is_relro): New function.
14955 (Output_section::set_is_relro): New function.
14956 (Output_section::is_relro_local): New function.
14957 (Output_section::set_is_relro_local): New function.
14958 (class Output_segment): Update declarations.
14959 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14960 * sparc.cc (Target_sparc::got_section): Likewise.
14961 * x86_64.cc (Target_x86_64::got_section): Likewise.
14962 * testsuite/relro_test_main.cc: New file.
14963 * testsuite/relro_test.cc: New file.
14964 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14965 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14966 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14967 (relro_test.so, relro_test_pic.o): New targets.
14968 * testsuite/Makefile.in: Rebuild.
14970 2008-05-16 Ian Lance Taylor <iant@google.com>
14972 * output.cc (Output_segment::add_output_section): Remove front
14974 * output.h (class Output_segment): Remove
14975 add_initial_output_section and overloaded add_output_section.
14976 Update declaration of remaining add_output_section.
14977 * layout.cc (Layout::create_interp): Call add_output_section
14978 rather than add_initial_output_section.
14979 (Layout::finish_dynamic_section): Likewise.
14981 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14982 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14983 know the dynamic type.
14984 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14985 field. Initialize it in constructor.
14986 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14987 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14988 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14991 * output.cc (Output_reloc::get_address): Change return type to
14993 * output.h (class Output_reloc): Update get_address declaration.
14994 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14995 for section addresses.
14997 2008-05-09 Ian Lance Taylor <iant@google.com>
15000 * gold.cc (gold_nomem): Use return value of write.
15002 2008-05-08 Ian Lance Taylor <iant@google.com>
15004 * symtab.c (Symbol::init_base_output_data): Add version
15005 parameter. Change all callers.
15006 (Symbol::init_base_output_segment): Likewise.
15007 (Symbol::init_base_constant): Likewise.
15008 (Symbol::init_base_undefined): Likewise.
15009 (Sized_symbol::init_output_data): Likewise.
15010 (Sized_symbol::init_output_segment): Likewise.
15011 (Sized_symbol::init_constant): Likewise.
15012 (Sized_symbol::init_undefined): Likewise.
15013 (Symbol_table::do_define_in_output_data): If the new symbol has a
15014 version, mark it as the default.
15015 (Symbol_table::do_define_in_output_segment): Likewise.
15016 (Symbol_table::do_define_as_constant): Likewise.
15017 * symtab.h (class Symbol): Update declarations.
15018 (class Sized_symbol): Likewise.
15019 * resolve.cc (Symbol::override_version): New function.
15020 (Symbol::override_base): Call override_version.
15021 (Symbol::override_base_with_special): Likewise.
15022 * testsuite/ver_script_8.script: New file.
15023 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15024 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15025 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15026 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15028 2008-05-06 Ian Lance Taylor <iant@google.com>
15031 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15033 (class General_options): Remove existing --undefined, and add
15034 --no-undefined instead. Add new --undefined as synonym for -u.
15035 * archive.cc (Archive::add_symbols): Check whether symbol was
15037 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15038 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15039 all uses. Add IS_UNDEFINED. Update declarations to split
15040 different versions of init_base. Declare init_base_undefined.
15041 (Symbol::is_defined): Handle IS_UNDEFINED.
15042 (Symbol::is_undefined): Likewise.
15043 (Symbol::is_weak_undefined): Call is_undefined.
15044 (Symbol::is_absolute): Handle IS_CONSTANT.
15045 (class Sized_symbol): Update declarations to split different
15046 versions of init. Declare init_undefined.
15047 (class Symbol_table): Declare new functions.
15048 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15049 Change all callers.
15050 (Symbol::init_base_output_data): Likewise.
15051 (Symbol::init_base_output_segment): Likewise.
15052 (Symbol::init_base_constant): Likewise.
15053 (Symbol::init_base_undefined): New function.
15054 (Sized_symbol::init_object): Rename from init. Change all
15056 (Sized_symbol::init_output_data): Likewise.
15057 (Sized_symbol::init_output_segment): Likewise.
15058 (Sized_symbol::init_constant): Likewise.
15059 (Sized_symbol::init_undefined): New function.
15060 (Symbol_table::add_undefined_symbols_from_command_line): New
15062 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15064 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15065 (Symbol::output_section): Likewise.
15066 (Symbol::set_output_section): Likewise.
15067 (Symbol_table::sized_finalize_symbol): Likewise.
15068 (Symbol_table::sized_write_globals): Likewise.
15069 * resolve.cc (Symbol_table::should_override): Likewise.
15070 (Symbol::override_base_with_special): Likewise.
15072 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15073 symbol, change it to have default visibility.
15074 * testsuite/protected_1.cc: New file.
15075 * testsuite/protected_2.cc: New file.
15076 * testsuite/protected_3.cc: New file.
15077 * testsuite/protected_main_1.cc: New file.
15078 * testsuite/protected_main_2.cc: New file.
15079 * testsuite/protected_main_3.cc: New file.
15080 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15081 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15082 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15083 (protected_1.so): New target.
15084 (protected_1_pic.o, protected_2_pic.o): New targets.
15085 (protected_3_pic.o): New target.
15086 (check_PROGRAMS): Add protected_2.
15087 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15088 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15089 * testsuite/Makefile.in: Rebuild.
15091 * options.h (DEFINE_var): Add set_user_set_##varname__.
15092 (DEFINE_bool_alias): New macro.
15093 (class General_options): Define -Bstatic using DEFINE_bool_alias
15094 rather than DEFINE_special. Add --undefined as an alias for -z
15096 * options.cc (General_options::parse_Bstatic): Remove.
15098 * options.h (class General_options): Add --fatal-warnings.
15099 * main.cc (main): Implement --fatal-warnings.
15100 * errors.h (Errors::warning_count): New function.
15102 * options.h (class General_options): Add -Bsymbolic-functions.
15103 * symtab.h (Symbol::is_preemptible): Check for
15104 -Bsymbolic-functions.
15106 2008-05-05 Ian Lance Taylor <iant@google.com>
15108 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15109 as noVARNAME rather than no-VARNAME.
15110 (class General_options): Add option -z combreloc.
15111 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15113 (Output_reloc::sort_before) [SHT_REL]: New function.
15114 (Output_reloc::sort_before) [SHT_RELA]: New function.
15115 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15116 Sort_relocs_comparison.
15117 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15118 parameter. Change all callers.
15119 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15120 sort_relocs parameter. Change all callers.
15121 * output.cc (Output_reloc::get_address): New function, broken out
15123 (Output_reloc::write_rel): Call it.
15124 (Output_reloc::compare): New function.
15125 (Output_data_reloc_base::do_write): Optionally sort relocs.
15127 * configure.ac: If targ_extra_obj is set, link it in.
15128 * configure.tgt: Initialize all variables.
15129 (x86_64*): Set targ_extra_obj and targ_extra_size.
15130 * configure: Rebuild.
15132 * object.cc (Sized_relobj::include_section_group): Adjust section
15133 indexes read from group data. Build vector to pass to
15135 * layout.cc (Layout::layout_group): Add flags and shndxes
15136 parameters. Remove contents parameter. Change caller. Update
15137 explicit instantiations.
15138 * layout.h (class Layout): Update layout_group declaration.
15139 * output.cc (Output_data_group::Output_data_group): Add flags and
15140 input_shndxes parameters. Remove contents parameter. Change
15142 (Output_data_group::do_write): Change input_sections_ to
15144 * output.h (class Output_data_group): Update constructor
15145 declaration. Rename input_sections_ to input_shndxes_.
15146 * testsuite/many_sections_test.cc: Add template.
15148 2008-04-30 Cary Coutant <ccoutant@google.com>
15150 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15152 * layout.cc (Layout::include_section): Refactored check for debug
15154 (Layout::add_comdat): Add new parameters. Change type
15155 of signature parameter. Add object and shndx to signatures table.
15156 (Layout::find_kept_object): New function.
15157 * layout.h: Include <cstring>.
15158 (Layout::is_debug_info_section): New function.
15159 (Layout::add_comdat): Add new parameters.
15160 (Layout::find_kept_object): New function.
15161 (Layout::Kept_section): New struct.
15162 (Layout::Signatures): Change type of map range.
15163 * object.cc (Relobj::output_section_address): New function.
15164 (Sized_relobj::include_section_group): Add new parameters. Change
15165 calls to Layout::add_comdat. Change to build table of kept comdat
15166 groups and table mapping discarded sections to kept sections.
15167 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15168 (Sized_relobj::do_layout): Change calls to include_section_group and
15169 include_linkonce_section.
15170 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15171 value to zero when section is discarded.
15172 (Sized_relobj::map_to_kept_section): New function.
15173 * object.h (Relobj::output_section_address): New function.
15174 (Relobj::Comdat_group): New type.
15175 (Relobj::find_comdat_group): New function.
15176 (Relobj::Comdat_group_table): New type.
15177 (Relobj::Kept_comdat_section): New type.
15178 (Relobj::Kept_comdat_section_table): New type.
15179 (Relobj::add_comdat_group): New function.
15180 (Relobj::set_kept_comdat_section): New function.
15181 (Relobj::get_kept_comdat_section): New function.
15182 (Relobj::comdat_groups_): New field.
15183 (Relobj::kept_comdat_sections_): New field.
15184 (Symbol_value::input_value): Update comment.
15185 (Sized_relobj::map_to_kept_section) New function.
15186 (Sized_relobj::include_linkonce_section): Add new parameter.
15187 * target-reloc.h (Comdat_behavior): New type.
15188 (get_comdat_behavior): New function.
15189 (relocate_section): Add code to map a discarded section to the
15190 corresponding kept section when applying a relocation.
15192 2008-04-30 Craig Silverstein <csilvers@google.com>
15194 * dwarf_reader.cc (next_generation_count): New static var.
15195 (Addr2line_cache_entry): New struct.
15196 (addr2line_cache): New static var.
15197 (Dwarf_line_info::one_addr2line): Added caching.
15198 (Dwarf_line_info::clear_addr2line_cache): New function.
15199 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15200 cache-size parameter.
15201 (Dwarf_line_info::one_addr2line_cache): New function.
15202 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15203 new cache-size argument to one_addr2line(), and clear cache.
15205 2008-04-28 Cary Coutant <ccoutant@google.com>
15207 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15208 R_386_PC8 relocations.
15210 2008-04-23 Ian Lance Taylor <iant@google.com>
15212 * object.cc (Sized_relobj::include_section_group): Check for
15213 invalid section group.
15215 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15218 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15219 than read for file header.
15220 * archive.cc (Archive::include_member): Likewise.
15222 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15224 * aclocal.m4: Regenerate.
15225 * configure: Regenerate.
15227 2008-04-19 Ian Lance Taylor <iant@google.com>
15229 * version.cc (version_string): Bump to 1.6.
15231 * testsuite/Makefile.am (many_sections_r_test): New target.
15232 (many_sections_r_test_SOURCES): Remove.
15233 (many_sections_r_test_DEPENDENCIES): Remove.
15234 (many_sections_r_test_LDFLAGS): Remove.
15235 (many_sections_r_test_LDADD): Remove.
15237 * object.cc (Sized_relobj::do_add_symbols): Always pass
15238 local_symbol_count_ to add_from_relobj.
15240 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15241 every thousand variables.
15242 * testsuite/Makefile.in: Rebuild.
15244 * object.cc (Xindex::initialize_symtab_xindex): New function.
15245 (Xindex::read_symtab_xindex): New function.
15246 (Xindex::sym_xindex_to_shndx): New function.
15247 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15249 (Sized_relobj::do_initialize_xindex): New function.
15250 (Sized_relobj::do_read_symbols): Adjust section links.
15251 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15252 parameter. Change all callers.
15253 (Sized_relobj::include_section_group): Adjust section links and
15254 symbol section indexes.
15255 (Sized_relobj::do_layout): Adjust section links.
15256 (Sized_relobj::do_count_local_symbols): Adjust section links and
15257 symbol section indexes.
15258 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15259 ordinary and special symbols.
15260 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15261 dynsym_xindex parameters. Change all callers. Adjust section
15262 links. Use SHN_XINDEX when needed.
15263 (Sized_relobj::get_symbol_location_info): Adjust section links.
15264 Don't get fooled by special symbols.
15265 * object.h (class Xindex): Define.
15266 (class Object): Add xindex_ parameter. Declare virtual functoin
15267 do_initialize_xindex.
15268 (Object::adjust_sym_shndx): New function.
15269 (Object::set_xindex): New protected function.
15270 (class Symbol_value): Add is_ordinary_shndx_ field.
15271 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15272 (Symbol_value::value): Assert ordinary section.
15273 (Symbol_value::initialize_input_to_output_map): Likewise.
15274 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15275 Change all callers.
15276 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15278 (class Sized_relobj): Update declarations.
15279 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15280 parameter. Change all callers.
15281 (Sized_relobj::adjust_shndx): New function.
15282 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15284 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15285 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15286 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15287 (Sized_dynobj::read_dynsym_section): Adjust section links.
15288 (Sized_dynobj::read_dynamic): Likewise.
15289 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15291 (Sized_dynobj::do_initialize_xindex): New function.
15292 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15293 do_initialize_xindex.
15294 (Sized_dynobj::adjust_shndx): New function.
15295 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15296 dynsym_xindex_ fields.
15297 (Layout::finalize): Add a call to set_section_indexes before
15298 creating the symtab sections.
15299 (Layout::set_section_indexes): Don't do anything if the section
15300 already has a section index.
15301 (Layout::create_symtab_sections): Add shnum parameter. Change
15302 caller. Create .symtab_shndx section if needed.
15303 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15305 (Layout::allocated_output_section_count): New function.
15306 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15308 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15309 fields. Update declarations.
15310 (Layout::symtab_xindex): New function.
15311 (Layout::dynsym_xindex): New function.
15312 (class Write_symbols_task): Add layout_ field.
15313 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15315 * output.cc (Output_section_headers::Output_section_headers): Add
15316 shstrtab_section parameter. Change all callers.
15317 (Output_section_headers::do_sized_write): Store overflow values
15318 for section count and section string table section index in
15319 section header zero.
15320 (Output_file_header::do_sized_write): Check for overflow of
15321 section count and section string table section index.
15322 (Output_symtab_xindex::do_write): New function.
15323 (Output_symtab_xindex::endian_do_write): New function.
15324 * output.h (class Output_section_headers): Add shstrtab_section_.
15325 Update declarations.
15326 (class Output_symtab_xindex): Define.
15327 (Output_section::has_out_shndx): New function.
15328 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15330 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15331 Change all callers.
15332 (Sized_symbol::init): Likewise.
15333 (Symbol::output_section): Check for ordinary symbol.
15334 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15335 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15337 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15338 Change all callers. Simplify handling of symbols from sections
15339 not included in the link.
15340 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15342 (Weak_alias_sorter::operator()): Assert that symbols are
15344 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15346 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15347 parameters. Change all callers.
15348 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15349 symbol distinction. Use SHN_XINDEX when needed.
15350 (Symbol_table::write_section_symbol): Add symtab_xindex
15351 parameter. Change all callers.
15352 (Symbol_table::sized_write_section_symbol): Likewise. Use
15353 SHN_XINDEX when needed.
15354 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15356 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15357 (Symbol::is_defined): Check is_ordinary.
15358 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15359 (Symbol::is_absolute, Symbol::is_common): Likewise.
15360 (class Sized_symbol): Update declarations.
15361 (class Symbol_table): Update declarations.
15362 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15363 parameters. Change all callers.
15364 (Sized_symbol::override): Likewise.
15365 (Symbol_table::override): Likewise.
15366 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15367 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15368 is_ordinary, and orig_st_shndx parameters. Change all callers.
15369 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15370 to be in an ordinary section.
15371 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15372 object and is_ordinary parameters. Change all callers.
15373 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15374 Change all callers. Don't add undefined or non-ordinary symbols
15376 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15377 Change all callers.
15378 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15380 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15381 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15382 (Sized_relobj::relocate_sections): Likewise.
15383 * target-reloc.h (scan_relocs): Adjust section symbol index.
15384 (scan_relocatable_relocs): Likewise.
15385 * i386.cc (Scan::local): Check for ordinary symbols.
15386 * sparc.cc (Scan::local): Likewise.
15387 * x86_64.cc (Scan::local): Likewise.
15388 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15389 to symbol_section_and_value.
15390 * testsuite/many_sections_test.cc: New file.
15391 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15392 (check_PROGRAMS): Add many_sections_test.
15393 (many_sections_test_SOURCES): Define.
15394 (many_sections_test_DEPENDENCIES): Define.
15395 (many_sections_test_LDFLAGS): Define.
15396 (BUILT_SOURCES): Add many_sections_define.h.
15397 (many_sections_define.h): New target.
15398 (BUILT_SOURCES): Add many_sections_check.h.
15399 (many_sections_check.h): New target.
15400 (check_PROGRAMS): Add many_sections_r_test.
15401 (many_sections_r_test_SOURCES): Define.
15402 (many_sections_r_test_DEPENDENCIES): Define.
15403 (many_sections_r_test_LDFLAGS): Define.
15404 (many_sections_r_test_LDADD): Define.
15405 (many_sections_r_test.o): New target.
15406 * testsuite/Makefile.in: Rebuild.
15408 2008-04-17 Cary Coutant <ccoutant@google.com>
15410 * errors.cc (Errors::info): New function.
15411 (gold_info): New function.
15412 * errors.h (Errors::info): New function.
15413 * gold.h (gold_info): New function.
15414 * object.cc (Input_objects::add_object): Print trace output.
15415 * options.cc (options::parse_set): New function.
15416 (General_options::parse_wrap): Deleted.
15417 (General_options::General_options): Deleted initializer.
15418 * options.h (options::String_set): New typedef.
15419 (options::parse_set): New function.
15420 (DEFINE_set): New macro.
15421 (General_options::wrap): Changed to use DEFINE_set. Changed
15422 callers of any_wrap_symbols and is_wrap_symbol.
15423 (General_options::trace, General_options::trace_symbol):
15425 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15426 (General_options::wrap_symbols_): Deleted.
15427 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15429 2008-04-17 David S. Miller <davem@davemloft.net>
15431 * options.cc (General_options::parse_V): New function.
15432 * options.h: Add entries for -V and -Qy.
15434 2008-04-17 Ian Lance Taylor <iant@google.com>
15436 * common.cc (Symbol_table::allocate_commons): Remove options
15437 parameter. Change caller.
15438 (Symbol_table::do_allocate_commons): Remove options parameter.
15439 Change caller. Just call do_allocate_commons_list twice.
15440 (Symbol_table::do_allocate_commons_list): New function, broken out
15441 of do_allocate_commons.
15442 * common.h (class Allocate_commons_task): Remove options_ field.
15443 Update constructor.
15444 * symtab.cc (Symbol_table::Symbol_table): Initialize
15446 (Symbol_table::add_from_object): Put TLS common symbols on
15448 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15449 which are IN_OUTPUT_DATA.
15450 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15451 allocate_commons and do_allocate_commons declarations. Declare
15452 do_allocate_commons_list.
15453 * gold.cc (queue_middle_tasks): Update creation of
15454 Allocate_commons_task to not pass options.
15455 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15456 (TLS_TEST_C_FLAGS): New variable.
15457 (tls_test_c_pic.o): New target.
15458 (tls_test_shared.so): Link in tls_test_c_pic.o.
15459 (tls_test_c_pic_ie.o): New target.
15460 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15461 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15462 (tls_test_c.o): New target.
15463 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15464 (tls_pic_test_LDADD): Likewise.
15465 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15466 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15467 (tls_test_c_gnu2.o): New target.
15468 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15470 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15471 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15472 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15473 * testsuite/tls_test.cc: Include "config.h".
15474 (t_last): Call t11_last.
15475 * testsuite/tls_test.h (t11, t11_last): Declare.
15476 * testsuite/tls_test_c.c: New file.
15477 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15478 * configure.ac: Check for OpenMP support.
15479 * configure, config.in, Makefile.in: Rebuild.
15480 * testsuite/Makefile.in: Rebuild.
15482 2008-04-16 Cary Coutant <ccoutant@google.com>
15484 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15485 (Target_i386::tls_base_symbol_defined_): New field.
15486 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15487 (Target_i386::Scan::global): Likewise.
15488 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15489 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15490 (Target_x86_64::tls_base_symbol_defined_): New field.
15491 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15492 (Target_x86_64::Scan::global): Likewise.
15494 2008-04-16 Cary Coutant <ccoutant@google.com>
15496 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15497 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15498 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15499 building shared libraries.
15500 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15501 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15502 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15503 * testsuite/Makefile.in: Rebuild.
15504 * testsuite/weak_undef.h: New file.
15505 * testsuite/weak_undef_file1.cc: Add extra test cases.
15506 * testsuite/weak_undef_file2.cc: Likewise.
15507 * testsuite/weak_undef_test.cc: Likewise.
15509 2008-04-16 David S. Miller <davem@davemloft.net>
15511 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15512 Add issued_non_pic_error_ field. Declare check_non_pic.
15513 (Target_sparc::Scan::check_non_pic): New function.
15514 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15515 (Target_sparc::Scan::global): Likewise.
15517 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15518 * configure: Rebuild.
15520 * options.h (DEFINE_enable): New macro.
15521 (new_dtags): New enable option.
15522 (initfirst, interpose, loadfltr, nodefaultlib,
15523 nodelete, nodlopen, nodump): New -z options.
15524 * layout.cc (Layout:finish_dynamic_section): If new
15525 dtags enabled, emit DT_RUNPATH. Also, emit a
15526 DT_FLAGS_1 containing any specified -z flags.
15528 2008-04-16 Ian Lance Taylor <iant@google.com>
15530 * copy-relocs.cc: New file.
15531 * copy-relocs.h: New file.
15532 * reloc.cc: Remove Copy_relocs code.
15533 * reloc.h: Likewise.
15534 * reloc-types.h (struct Reloc_types) [both versions]: Add
15535 get_reloc_addend_noerror.
15536 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15537 variants of add_global which take an addend which must be zero.
15538 * i386.cc: Include "copy-relocs.h".
15539 (class Target_i386): Change type of copy_relocs_ to variable,
15540 update initializer.
15541 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15542 Change all callers.
15543 (Target_i386::do_finalize_sections): Change handling of
15545 * sparc.cc: Include "copy-relocs.h".
15546 (class Target_sparc): Change type of copy_relocs_ to variable,
15547 update initializer.
15548 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15549 Change all callers.
15550 (Target_sparc::do_finalize_sections): Change handling of
15552 * x86_64.cc: Include "copy-relocs.h".
15553 (class Target_x86_64): Change type of copy_relocs_ to variable,
15554 update initializer.
15555 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15556 class. Change all callers.
15557 (Target_x86_64::do_finalize_sections): Change handling of
15559 * Makefile.am (CCFILES): Add copy-relocs.cc.
15560 (HFILES): Add copy-relocs.h.
15562 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15564 * testsuite/script_test_4.sh: Permit leading zeroes.
15566 2008-04-15 Ian Lance Taylor <iant@google.com>
15568 * script-sections.cc (Script_sections::create_segments): Use
15569 header_size_adjustment even when there is enough room for the
15571 * testsuite/script_test_4.sh: New file.
15572 * testsuite/script_test_4.t: New file.
15573 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15574 (check_DATA): Add script_test_4.stdout.
15575 (MOSTLYCLEANFILES): Likewise.
15576 (script_test_4): New target.
15577 (script_test_4.stdout): New target.
15578 * testsuite/Makefile.in: Rebuild.
15580 * sparc.cc: Add definitions for Output_data_plt_sparc class
15583 2008-04-14 David S. Miller <davem@davemloft.net>
15585 * sparc.cc: New file.
15586 * Makefile.am (TARGETSOURCES): Add sparc.cc
15587 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15588 * configure.tgt: Document targ_extra_size and
15589 targ_extra_big_endian. Add entries for sparc-* and
15591 * configure.ac: Handle targ_extra_size and
15592 targ_extra_big_endian.
15593 * Makefile.in: Rebuild.
15594 * configure: Likewise.
15595 * po/POTFILES.in: Likewise.
15596 * po/gold.pot: Likewise.
15598 2008-04-14 Ian Lance Taylor <iant@google.com>
15600 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15601 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15602 in the name/type/flags to section mapping. Don't call
15603 allocate_output_section.
15604 (Layout::choose_output_section): Change parameter from adjust_name
15605 to is_input_section. Don't permit input sections after sections
15606 are attached to segments. Don't call allocate_output_section.
15607 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15608 not write_enable_output_section.
15609 (Layout::make_output_section): Don't push to
15610 unattached_section_list_ nor call attach_to_segment. Call
15611 attach_section_to_segment if sections are attached.
15612 (Layout::attach_sections_to_segments): New function.
15613 (Layout::attach_section_to_segment): New function.
15614 (Layout::attach_allocated_section_to_segment): Rename from
15615 attach_to_segment. Remove flags parameter.
15616 (Layout::allocate_output_section): Remove function.
15617 (Layout::write_enable_output_section): Remove function.
15618 * layout.h (class Layout): Update for above changes. Add new
15619 field sections_are_attached_.
15620 * output.h (Output_section::update_flags_for_input_section): New
15622 * output.cc (Output_section::add_input_section): Call
15623 update_flags_for_input_section.
15624 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15626 2008-04-11 Cary Coutant <ccoutant@google.com>
15628 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15629 thought unnecessary.
15630 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15632 2008-04-11 Ian Lance Taylor <iant@google.com>
15634 * output.h (class Output_section_data): Remove inline definition
15636 * output.cc (Output_section_data::set_addralign): New function.
15638 2008-04-11 Cary Coutant <ccoutant@google.com>
15640 Add support for TLS descriptors for i386 and x86_64.
15641 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15642 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15643 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15645 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15646 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15647 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15649 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15650 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15651 Fix problem with initial-exec relocations.
15652 (Target_i386::Relocate::relocate_tls): Likewise.
15653 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15655 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15656 support for section-plus-offset dynamic table entries.
15657 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15658 (Output_data_dynamic::Dynamic_entry): Add support for
15659 section-plus-offset dynamic table entries.
15660 (Output_data_dynamic::Classification): Likewise.
15661 (Output_data_dynamic::classification_): Renamed offset_.
15662 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15663 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15664 (Target_x86_64::make_plt_section): New function.
15665 (Target_x86_64::reserve_tlsdesc_entries): New function.
15666 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15667 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15668 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15669 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15670 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15671 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15672 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15673 add extra PLT entry for TLS descriptors.
15674 (Output_data_plt_x86_64::got_): New field.
15675 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15676 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15678 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15680 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15681 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15682 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15683 R_386_TLS_DESC_CALL relocations.
15684 (Target_x86_64::Scan::global): Likewise.
15685 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15686 for TLS descriptors.
15687 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15688 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15689 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15690 GD-to-IE relaxation.
15691 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15692 and TLS_DESCRIPTORS.
15693 * Makefile.in: Rebuild.
15694 * configure: Rebuild.
15695 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15696 (tls_test_shared2.so): New target.
15697 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15698 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15699 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15700 (tls_shared_gd_to_ie_test_LDADD): New variable.
15701 (tls_shared_gnu2_gd_to_ie_test): New target.
15702 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15704 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15705 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15706 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15707 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15708 (tls_shared_gnu2_test): New target.
15709 (tls_test_gnu2_shared.so): New target.
15710 (tls_shared_gnu2_test_SOURCES): New variable.
15711 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15712 (tls_shared_gnu2_test_LDFLAGS): New variable.
15713 (tls_shared_gnu2_test_LDADD): New variable.
15714 * testsuite/Makefile.in: Rebuild.
15715 * testsuite/Makefile.
15717 2008-04-11 Ian Lance Taylor <iant@google.com>
15719 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15721 * testsuite/Makefile.in: Rebuild.
15723 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15725 * testsuite/script_test_2.cc (main): Adjust test.
15727 2008-04-11 David S. Miller <davem@davemloft.net>
15728 Ian Lance Taylor <iant@google.com>
15730 * options.h (General_options): Add entries for '-Y' and
15732 * options.cc (General_options:finalize): If -Y was used, add those
15733 entries to the library path instead of the default "/lib" and
15736 2008-04-11 David S. Miller <davem@davemloft.net>
15738 * testsuite/justsyms.t: Start at 0x100.
15739 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
15740 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15742 * testsuite/script_test_2.cc: Adjust string and section length
15745 2008-04-09 Ian Lance Taylor <iant@google.com>
15748 * script-sections.cc (Sections_element::allocate_to_segment): Add
15750 (Output_section_definition::allocate_to_segment): Likewise.
15751 (Orphan_output_section::allocate_to_segment): Likewise.
15752 (Script_sections::attach_sections_using_phdrs_clause): Don't
15753 propagate non-PT_LOAD segments to orphan sections.
15754 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15755 readelf rather than objdump.
15756 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15757 .interp section and PT_INTERP segment are the same size.
15758 * testsuite/Makefile.in: Rebuild.
15760 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15761 aliases for symbols defined in the same object.
15762 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15763 (weak_alias_test_SOURCES): New variable.
15764 (weak_alias_test_DEPENDENCIES): New variable.
15765 (weak_alias_test_LDFLAGS): New variable.
15766 (weak_alias_test_LDADD): New variable.
15767 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15768 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15769 (weak_alias_test_3.o): New target.
15770 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15771 * testsuite/weak_alias_test_main.cc: New file.
15772 * testsuite/weak_alias_test_1.cc: New file.
15773 * testsuite/weak_alias_test_2.cc: New file.
15774 * testsuite/weak_alias_test_3.cc: New file.
15776 2008-04-08 Ian Lance Taylor <iant@google.com>
15778 * options.h (class General_options): Add --noinhibit-exec option.
15779 * main.cc (main): Check --noinhibit-exec.
15781 * options.h (class General_options): Define --wrap as a special
15782 option. Add wrap_symbols_ field.
15783 (General_options::any_wrap_symbols): New function.
15784 (General_options::is_wrap_symbol): New function.
15785 * options.cc (General_options::parse_wrap): New function.
15786 (General_options::General_options): Initialize wrap_symbols_.
15787 * symtab.cc (Symbol_table::wrap_symbol): New function.
15788 (Symbol_table::add_from_object): Handle --wrap.
15789 * symtab.h (class Symbol_table): Declare wrap_symbol.
15790 * target.h (Target::wrap_char): New function.
15791 (Target::Target_info): Add wrap_char field.
15792 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15793 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15794 * testsuite/testfile.cc (Target_test::test_target_info):
15797 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15800 * layout.h (class Layout): Add added_eh_frame_data_ field.
15801 * layout.cc (Layout::Layout): Initialize new field.
15802 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15803 output section until we find a section we merged successfully.
15804 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15805 that the size be non-zero.
15807 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15810 2008-04-08 Craig Silverstein <csilvers@google.com>
15812 * configure.ac: Export new conditional variable HAVE_ZLIB.
15813 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15815 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15816 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15818 2008-04-07 Ian Lance Taylor <iant@google.com>
15820 * version.cc (version_string): Set to "1.5".
15822 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15823 Add issued_non_pic_error_ field. Declare check_non_pic.
15824 (Target_x86_64::Scan::check_non_pic): New function.
15825 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15826 (Target_x86_64::Scan::global): Likewise.
15828 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15829 addend parameter. Change caller. Handle merge sections.
15830 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15831 Address to Addend. Don't add in the result of
15832 local_section_offset, pass down the addend and use the returned
15834 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15835 Update declarations of local_section_offset and symbol_value.
15836 * testsuite/two_file_test_1.cc (t18): New function.
15837 * testsuite/two_file_test_2.cc (f18): New function.
15838 * testsuite/two_file_test_main.cc (main): Call t18.
15839 * testsuite/two_file_test.h (t18, f18): Declare.
15841 * configure.ac: Don't test for objdump, c++filt, or readelf.
15842 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15844 (TEST_READELF): New variable.
15845 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15846 (check_PROGRAMS): Add two_file_strip_test.
15847 (two_file_strip_test): New target.
15848 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15849 (two_file_same_shared_strip_test_SOURCES): New variable.
15850 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15851 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15852 (two_file_same_shared_strip_test_LDADD): New variable.
15853 (two_file_shared_strip.so): New target.
15854 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15855 (ver_test_5.syms, ver_test_7.syms): Likewise.
15856 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15857 (strip_test_3.stdout): Use TEST_OBJDUMP.
15858 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15860 2008-04-04 Cary Coutant <ccoutant@google.com>
15862 * symtab.h (Symbol::is_weak_undefined): New function.
15863 (Symbol::is_strong_undefined): New function.
15864 (Symbol::is_absolute): New function.
15865 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15866 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15868 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15869 (weak_undef_test): New target.
15870 * testsuite/Makefile.in: Rebuild.
15871 * testsuite/weak_undef_file1.cc: New file.
15872 * testsuite/weak_undef_file2.cc: New file.
15873 * testsuite/weak_undef_test.cc: New file.
15875 2008-04-03 Craig Silverstein <csilvers@google.com>
15877 * compressed_output.h (class Output_compressed_section): Use
15879 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15881 (zlib_compressed_suffix): Removed.
15882 (Output_compressed_section::set_final_data_size): Use unsigned
15884 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15885 Fix linker invocation.
15886 (flagstest_o_specialfile_and_compress_debug_sections):
15888 * testsuite/Makefile.in: Regenerated.
15890 2008-04-02 David S. Miller <davem@davemloft.net>
15892 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15893 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15895 2008-04-02 Craig Silverstein <csilvers@google.com>
15899 2008-04-02 Ian Lance Taylor <iant@google.com>
15901 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15902 parameters. Update for new key type to views_. Change all
15904 (File_read::read): Adjust for byteshift in returned view.
15905 (File_read::add_view): New function, broken out of
15906 find_and_make_view.
15907 (File_read::make_view): New function, broken out of
15908 find_and_make_view.
15909 (File_read::find_or_make_view): Add offset and aligned
15910 parameters. Rewrite accordingly. Change all callers.
15911 (File_read::get_view): Add offset and aligned parameters. Adjust
15912 for byteshift in return value.
15913 (File_read::get_lasting_view): Likewise.
15914 * fileread.h (class File_read): Update declarations.
15915 (class File_read::View): Add byteshift_ field. Add byteshift to
15916 constructor. Add byteshift method.
15917 * archive.h (Archive::clear_uncached_views): New function.
15918 (Archive::get_view): Add aligned parameter. Change all callers.
15919 * object.h (Object::get_view): Add aligned parameter. Change all
15921 (Object::get_lasting_view): Likewise.
15923 * fileread.cc (File_read::release): Don't call clear_views if
15924 there are multiple objects.
15925 * fileread.h (File_read::clear_uncached_views): New function.
15926 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15929 2008-03-31 Cary Coutant <ccoutant@google.com>
15931 Add thin archive support.
15932 * archive.cc (Archive::armagt): New const.
15933 (Archive::setup): Remove task parameter and calls to unlock.
15934 (Archive::unlock_nested_archives): New function.
15935 (Archive::read_header): Add nested_off parameter. Change
15937 (Archive::interpret_header): Likewise.
15938 (Archive::include_all_members): Change to handle thin
15940 (Archive::include_member): Likewise.
15941 * archive.h (Archive::Archive): Add new parameters and
15943 (Archive::armagt): New const.
15944 (Archive::setup): Remove task parameter.
15945 (Archive::unlock_nested_archives): New function.
15946 (Archive::read_header): Add nested_off parameter.
15947 (Archive::interpret_header): Likewise.
15948 (Archive::Nested_archive_table): New typedef.
15949 (Archive::is_thin_archive_): New field.
15950 (Archive::nested_archives_): New field.
15951 (Archive::options_): New field.
15952 (Archive::dirpath_): New field.
15953 (Archive::task_): New field.
15954 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15955 for thin archives. Pass additional parameters to
15956 Archive::Archive. Unlock the archive file after calling
15959 2008-03-29 Ian Lance Taylor <iant@google.com>
15961 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15962 version symbol to be local.
15963 * testsuite/ver_test_4.sh: New file.
15964 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15965 (check_DATA): Add ver_test_4.syms.
15966 (ver_test_4.syms): New target.
15967 * testsuite/Makefile.in: Rebuild.
15970 (Output_section::Input_section_sort_entry::has_priority): New
15972 (Output_section::Input_section_sort_entry::match_file_name): New
15974 (Output_section::Input_section_sort_entry::match_section_name):
15976 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15978 (Output_section::Input_section_sort_entry::match_section_file):
15980 (Output_section::Input_section_sort_compare::operator()): Rewrite
15981 using new Input_section_sort_entry functions. Sort crtbegin and
15982 crtend first. Sort sections with no priority before sections with
15984 * testsuite/initpri1.c (d3): Check j != 4.
15985 (cd5): New constructor/destructor function.
15986 (main): Check j != 2.
15988 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15989 new symbol when resolving, don't call set_is_default.
15990 * testsuite/ver_test_7.cc: New file.
15991 * testsuite/ver_test_7.sh: New file.
15992 * testsuite/Makefile.am (ver_test_7.so): New target.
15993 (ver_test_7.o): New target.
15994 (check_SCRIPTS): Add ver_test_7.sh.
15995 (check_DATA): Add ver_test_7.syms.
15996 (ver_test_7.syms): New target.
15998 2008-03-28 Ian Lance Taylor <iant@google.com>
16000 * layout.cc (Layout::layout): If we see an input section with a
16001 name that needs sorting, set the must_sort flag for the output
16003 (Layout::make_output_section): If the name of the output section
16004 indicates that it might require sorting, set the may_sort flag.
16005 * output.h (Output_section::may_sort_attached_input_sections): New
16007 (Output_section::set_may_sort_attached_input_sections): New
16009 (Output_section::must_sort_attached_input_sections): New
16011 (Output_section::set_must_sort_attached_input_sections): New
16013 (class Output_section): Declare Input_section_sort_entry. Define
16014 Input_section_sort_compare. Declare
16015 sort_attached_input_sections. Add new fields:
16016 may_sort_attached_input_sections_,
16017 must_sort_attached_input_sections_,
16018 attached_input_sections_are_sorted_.
16019 * output.cc (Output_section::Output_section): Initialize new
16021 (Output_section::add_input_section): Add an entry to
16022 input_sections_ if may_sort or must_sort are true.
16023 (Output_section::set_final_data_size): Call
16024 sort_attached_input_sections if necessary.
16025 (Output_section::Input_section_sort_entry): Define new class.
16026 (Output_section::Input_section_sort_compare::operator()): New
16028 (Output_section::sort_attached_input_sections): New function.
16029 * configure.ac: Check whether the compiler supports constructor
16030 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16031 * testsuite/initpri1.c: New file.
16032 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16033 CONSTRUCTOR_PRIORITY.
16034 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16035 (initpri1_LDFLAGS): New variable.
16036 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16038 2008-03-27 Ian Lance Taylor <iant@google.com>
16040 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16041 * testsuite/common_test_1.c: New file.
16042 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16043 (common_test_1_SOURCES): New variable.
16044 (common_test_1_DEPENDENCIES): New variable.
16045 (common_test_1_LDFLAGS): New variable.
16047 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16048 and commons_ correctly when NAME/VERSION does not override
16050 * testsuite/ver_test_6.c: New file.
16051 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16052 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16053 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16055 2008-03-26 Ian Lance Taylor <iant@google.com>
16057 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16058 of an undefined symbol from a version script.
16059 * testsuite/Makefile.am (ver_test_5.so): New target.
16060 (ver_test_5.o): New target.
16061 (check_SCRIPTS): Add ver_test_5.sh.
16062 (check_DATA): Add ver_test_5.syms.
16063 (ver_test_5.syms): New target.
16064 * testsuite/ver_test_5.cc: New file.
16065 * testsuite/ver_test_5.script: New file.
16066 * testsuite/ver_test_5.sh: New file.
16067 * Makefile.in, testsuite/Makefile.in: Rebuild.
16070 Fix problems building gold with gcc 4.3.0.
16071 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16072 (gold_error_at_location, gold_warning_at_location): Use it.
16073 * configure.ac: Check whether we can compile and use a template
16074 function with a printf attribute.
16075 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16076 when jumping over bytes.
16077 * object.cc: Instantiate Object::read_section_data.
16078 * debug.h: Include <cstring>
16079 * dwarf_reader.cc: Include <algorithm>
16080 * main.cc: Include <cstring>.
16081 * options.cc: Include <cstring>.
16082 * output.cc: Include <cstring>.
16083 * script.cc: Include <cstring>.
16084 * script.h: Include <string>.
16085 * symtab.cc: Include <cstring> and <algorithm>.
16086 * target-select.cc: Include <cstring>.
16087 * version.cc: Include <string>.
16088 * testsuite/testmain.cc: Include <cstdlib>.
16089 * configure, config.in: Rebuild.
16091 2008-03-25 Ian Lance Taylor <iant@google.com>
16093 * options.cc: Include "../bfd/bfdver.h".
16094 (options::help): Print bug reporting address.
16096 * version.cc (print_version): Adjust output for current value of
16097 BFD_VERSION_STRING.
16101 * options.cc (options::help): Print list of supported targets.
16102 * target-select.h: Include <vector>.
16103 (class Target_selector): Make machine_, size_, and is_big_endian_
16104 fields const. Add bfd_name_ and instantiated_target_ fields.
16105 (Target_selector::Target_selector): Add bfd_name parameter.
16106 (Target_selector::recognize): Make non-virtual, call
16108 (Target_selector::recognize_by_name): Make non-virtual, call
16109 do_recognize_by_name.
16110 (Target_selector::supported_names): New function.
16111 (Target_selector::bfd_name): New function.
16112 (Target_selector::do_instantiate_target): New pure virtual
16114 (Target_selector::do_recognize): New virtual function.
16115 (Target_selector::do_recognize_by_name): New virtual function.
16116 (Target_selector::instantiate_target): New private function.
16117 (supported_target_names): Declare.
16118 * target-select.cc (Target_selector::Target_selector): Update for
16119 new parameter and fields.
16120 (select_target_by_name): Check that the name matches before
16121 calling recognize_by_name.
16122 (supported_target_names): New function.
16123 * i386.cc (class Target_selector_i386): Update Target_selector
16124 constructor call. Remove recognize and recognize_by_name. Add
16125 do_instantiate_target.
16126 * x86_64.cc (class Target_selector_x86_64): Likewise.
16127 * testsuite/testfile.cc (class Target_selector_test): Update for
16128 changes to Target_selector.
16130 * README: Rewrite, with some notes on unsupported features.
16132 2008-03-24 Cary Coutant <ccoutant@google.com>
16134 * i386.cc (Target_i386::Got_type): New enum declaration.
16135 (Target_i386::Scan::local): Updated callers of Output_data_got
16137 (Target_i386::Scan::global): Likewise.
16138 (Target_i386::Relocate::relocate): Likewise.
16139 (Target_i386::Relocate::relocate_tls): Likewise.
16140 * object.h (Got_offset_list): New class.
16141 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16142 (Sized_relobj::local_got_offset): Likewise.
16143 (Sized_relobj::set_local_got_offset): Likewise.
16144 (Sized_relobj::local_has_tls_got_offset): Removed.
16145 (Sized_relobj::local_tls_got_offset): Removed.
16146 (Sized_relobj::set_local_tls_got_offset): Removed.
16147 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16148 * output.cc (Output_data_got::add_global): Added got_type parameter.
16149 (Output_data_got::add_global_with_rel): Likewise.
16150 (Output_data_got::add_global_with_rela): Likewise.
16151 (Output_data_got::add_global_pair_with_rel): New function.
16152 (Output_data_got::add_global_pair_with_rela): New function.
16153 (Output_data_got::add_local): Added got_type parameter.
16154 (Output_data_got::add_local_with_rel): Likewise.
16155 (Output_data_got::add_local_with_rela): Likewise.
16156 (Output_data_got::add_local_pair_with_rel): New function.
16157 (Output_data_got::add_local_pair_with_rela): New function.
16158 (Output_data_got::add_global_tls): Removed.
16159 (Output_data_got::add_global_tls_with_rel): Removed.
16160 (Output_data_got::add_global_tls_with_rela): Removed.
16161 (Output_data_got::add_local_tls): Removed.
16162 (Output_data_got::add_local_tls_with_rel): Removed.
16163 (Output_data_got::add_local_tls_with_rela): Removed.
16164 * output.h (Output_data_got::add_global): Added got_type parameter.
16165 (Output_data_got::add_global_with_rel): Likewise.
16166 (Output_data_got::add_global_with_rela): Likewise.
16167 (Output_data_got::add_global_pair_with_rel): New function.
16168 (Output_data_got::add_global_pair_with_rela): New function.
16169 (Output_data_got::add_local): Added got_type parameter.
16170 (Output_data_got::add_local_with_rel): Likewise.
16171 (Output_data_got::add_local_with_rela): Likewise.
16172 (Output_data_got::add_local_pair_with_rel): New function.
16173 (Output_data_got::add_local_pair_with_rela): New function.
16174 (Output_data_got::add_global_tls): Removed.
16175 (Output_data_got::add_global_tls_with_rel): Removed.
16176 (Output_data_got::add_global_tls_with_rela): Removed.
16177 (Output_data_got::add_local_tls): Removed.
16178 (Output_data_got::add_local_tls_with_rel): Removed.
16179 (Output_data_got::add_local_tls_with_rela): Removed.
16180 * resolve.cc (Symbol::override_base_with_special): Removed
16181 reference to has_got_offset_ field.
16182 * symtab.cc (Symbol::init_fields): Replaced initialization
16183 of got_offset_ with got_offsets_. Removed initialization
16185 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16186 (Symbol::got_offset): Likewise.
16187 (Symbol::set_got_offset): Likewise.
16188 (Symbol::has_tls_got_offset): Removed.
16189 (Symbol::tls_got_offset): Removed.
16190 (Symbol::set_tls_got_offset): Removed.
16191 (Symbol::got_offset_): Removed.
16192 (Symbol::tls_mod_got_offset_): Removed.
16193 (Symbol::tls_pair_got_offset_): Removed.
16194 (Symbol::got_offsets_): New field.
16195 (Symbol::has_got_offset): Removed.
16196 (Symbol::has_tls_mod_got_offset): Removed.
16197 (Symbol::has_tls_pair_got_offset): Removed.
16198 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16199 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16201 (Target_x86_64::Scan::global): Likewise.
16202 (Target_x86_64::Relocate::relocate): Likewise.
16203 (Target_x86_64::Relocate::relocate_tls): Likewise.
16205 2008-03-25 Ben Elliston <bje@au.ibm.com>
16207 * yyscript.y: Fix spelling error in comment.
16209 2008-03-24 Ian Lance Taylor <iant@google.com>
16211 * options.h (class General_options): Define build_id option.
16212 * layout.h (class Layout): Declare write_build_id, create_note,
16213 create_build_id. Add build_id_note_ member.
16214 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16215 "libiberty.h", "md5.h", "sha1.h".
16216 (Layout::Layout): Initialize eh_frame_data_,
16217 eh_frame_hdr_section_, and build_id_note_.
16218 (Layout::finalize): Call create_build_id.
16219 (Layout::create_note): New function, broken out of
16220 Layout::create_gold_note.
16221 (Layout::create_gold_note): Call create_note.
16222 (Layout::create_build_id): New function.
16223 (Layout::write_build_id): New function.
16224 (Close_task_runner::run): Call write_build_id.
16226 * x86_64.cc: Correct license to GPLv3.
16228 2008-03-23 Ian Lance Taylor <iant@google.com>
16230 * options.cc: Include "demangle.h".
16231 (parse_optional_string): New function.
16232 (parse_long_option): Handle takes_optional_argument.
16233 (parse_short_option): Update dash_z initializer. Handle
16234 takes_optional_argument.
16235 (General_options::General_options): Initialize do_demangle_.
16236 (General_options::finalize): Set do_demangle_. Handle demangling
16238 * options.h (parse_optional_string): Declare.
16239 (struct One_option): Add optional_arg field. Update constructor.
16240 Update call constructor calls. Add takes_optional_argument
16242 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16243 (DEFINE_optional_string): Define.
16244 (General_options::demangle): Change from DEFINE_bool to
16245 DEFINE_optional_string.
16246 (General_options::no_demangle): New function.
16247 (General_options::do_demangle): New function.
16248 (General_options::set_do_demangle): New function.
16249 (General_options::execstack_status_): Move definition to end of
16251 (General_options::static_): Likewise.
16252 (General_options::do_demangle_): New field.
16253 * object.cc (big_endian>::get_symbol_location_info): Call
16254 Options::do_demangle, not Options::demangle.
16255 * symtab.cc (demangle): Likewise.
16257 2008-03-22 Ian Lance Taylor <iant@google.com>
16259 * gold.h: Include <cstddef> and <sys/types.h>
16260 * options.h: Include <cstring>.
16262 2008-03-21 Ian Lance Taylor <iant@google.com>
16264 * Added source code to GNU binutils.
16266 Copyright (C) 2008-2014 Free Software Foundation, Inc.
16268 Copying and distribution of this file, with or without modification,
16269 are permitted in any medium without royalty provided the copyright
16270 notice and this notice are preserved.
16276 version-control: never