1 2012-09-25 Alan Modra <amodra@gmail.com>
3 * object.h (Sized_relobj_file::adjust_local_symbol,
4 do_adjust_local_symbol): New functions.
5 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
6 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
7 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
8 and irregular opd entry spacing.
9 (Powerpc_relobj::do_read_relocs): Add opd size checks.
10 (Global_symbol_visitor_opd): New functor.
11 (Target_powerpc::do_finalize_sections): Omit global symbols defined
12 on deleted opd entries.
14 2012-09-15 Jiong Wang <jiwang@tilera.com>
16 * tilegx.cc: New file.
17 * Makefile.am (TARGETSOURCES): Add tilegx.cc
18 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
19 * configure.tgt: Add entries for tilegx*.
20 * configure.ac: Likewise.
21 * Makefile.in: Rebuild.
22 * configure: Likewise.
23 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
26 2012-09-13 Alan Modra <amodra@gmail.com>
28 * target-reloc.h (scan_relocs): Call scan.local for relocs
29 against symbols in discarded sections. Pass is_discarded
31 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
32 Add is_discarded param.
33 * powerpc (Target_powerpc::Scan::local): Likewise. Use
34 is_discarded to flag opd entry as discarded. Don't emit dyn
35 relocs on such entries.
36 (Target_powerpc::Scan::global): Similarly detect and handle
38 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
39 opd_ent_. Update all uses.
40 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
41 (Target_powerpc::relocate_section): Zero out discarded opd
44 2012-09-12 Ian Lance Taylor <iant@google.com>
47 * output.cc: Rename Output_data_got template parameter from size
48 to got_size for all functions. Compile all variants of
50 (Output_data_got::Got_entry::write): Correct use of size for
51 symbol value. Use local_is_tls rather than casting to
53 * object.h (class Object): Add local_is_tls and do_local_is_tls.
54 (class Sized_relobj_file): Add do_local_is_tls.
55 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
57 2012-09-11 Alan Modra <amodra@gmail.com>
60 * layout.cc (Layout::set_segment_offsets): When using
61 common-page-size alignment, ensure we are on a new max-page-size
63 * output.cc (Output_segment::set_section_addresses): Use
64 abi_pagesize, not common_pagesize for relro boundary.
65 (Output_segment::set_offset): Likewise.
67 2012-09-11 Alan Modra <amodra@gmail.com>
69 * output.h (Output_data_got::add_global_tls, add_local_tls,
70 add_local_tls_pair): New functions.
71 (Output_data_got::add_local_pair_with_rel): Remove second
72 reloc param. Expand comment.
73 (Output_data_got::Got_entry): Rename use_plt_offset_ to
74 use_plt_or_tls_offset_, similarly for constructor param.
75 (Output_data_got::Got_entry::write): Add got_index param.
76 * output.cc (Output_data_got::add_global_tls, add_local_tls,
77 add_local_tls_pair): New functions.
78 (Output_data_got::Got_entry::write): Handle tls symbols
79 with use_plt_or_tls_offset_ set specially.
80 (Output_data_got::add_local_pair_with_rel): Only one reloc.
81 (Output_data_got::do_write): Replace iterator with index, pass
82 index to entry write function.
83 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
84 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
85 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
87 * i386.cc (Target_i386::Scan::local): Likewise.
88 * sparc.cc (Target_sparc::Scan::local): Likewise.
89 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
90 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
91 do_tls_offset_for_global): New functions.
92 (Target_powerpc::Scan::local): Correct TLS relocations and got
94 (Target_powerpc::Scan::global): Don't emit unnecessary
95 dynamic relocations on TLS GOT entries.
97 2012-09-10 Matthias Klose <doko@ubuntu.com>
99 * config.in: Disable sanity check for kfreebsd.
101 2012-09-10 Sterling Augustine <saugustine@google.com>
103 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
104 (Gdb_index::pubtypes_read): New parameter.
105 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
107 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
110 2012-09-09 Alan Modra <amodra@gmail.com>
112 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
113 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
114 * gc.h (gc_process_relocs): Call target gc_add_reference.
115 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
116 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
117 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
119 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
120 to cater for when we don't need code offset. Update use.
121 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
122 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
123 set_opd_valid): New functions.
124 (Target_powerpc::do_gc_add_reference): New function.
125 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
127 (Target_powerpc::do_gc_mark_symbol): New function.
129 2012-09-06 Cary Coutant <ccoutant@google.com>
131 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
132 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
133 (Dwarf_die::skip_attributes): Likewise.
134 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
135 * testsuite/gdb_index_test.cc (inline_func_1): New function.
137 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
139 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
141 * testsuite/script_test_3.t: Add .got.plt output section
143 * testsuite/script_test_4.t: Likewise.
145 2012-09-05 Alan Modra <amodra@gmail.com>
147 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
148 update all uses and lose "enum" when using type.
150 2012-09-05 Alan Modra <amodra@gmail.com>
152 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
153 * configure: Regenerate.
154 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
155 (plugin_final_layout.stdout): Likewise.
156 (memory_test): Set page sizes to 0x1000.
157 * testsuite/Makefile.in: Regenerate.
158 * testsuite/discard_locals_test.sh: Add FIXME comment.
159 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
160 * testsuite/pr14265.t: Add .got output section statement.
161 * testsuite/script_test_2.t: Likewise.
162 * testsuite/script_test_3.t: Likewise.
163 * testsuite/script_test_4.t: Likewise.
164 * testsuite/script_test_5.t: Likewise.
165 * testsuite/script_test_6.t: Likewise.
166 * testsuite/script_test_7.t: Likewise.
167 * testsuite/script_test_9.t: Likewise.
169 2012-09-05 Alan Modra <amodra@gmail.com>
171 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
172 (Powerpc_relocate_functions::Status): New typedef.
173 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
174 (Target_powerpc::Scan::local): Handle REL64.
175 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
177 (Target_powerpc::symval_for_branch): New function, extracted from..
178 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
179 checks. Report overflow errors.
181 2012-09-05 Alan Modra <amodra@gmail.com>
183 * object.h (Sized_relobj_file::emit_relocs): Delete.
184 (Sized_relobj_file::emit_relocs_reltype): Delete.
185 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
186 relocate_relocs for --emit-relocs.
187 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
188 * output.h: Update comment.
189 (Output_segment::first_section): New function.
190 (Output_segment::first_section_load_address): Use first_section.
191 * output.cc (Output_segment::first_section): New function extracted..
192 (Output_segment::first_section_load_address): ..from here. Delete.
193 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
194 * target.h (Sized_target::relocate_for_relocatable): Likewise.
195 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
196 adjust call to target.h function.
197 * i386.cc (Target_i386): Likewise.
198 * sparc.cc (Target_sparc): Likewise.
199 * x86_64.cc (Target_x86_64): Likewise.
200 * powerpc.cc (Target_powerpc): Likewise.
201 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
202 first tls section has section symbol for optimised local dynamic
204 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
205 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
207 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
208 Rename to relocate_relocs. Update error message.
210 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
212 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
215 2012-08-31 Alan Modra <amodra@gmail.com>
217 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
218 (Powerpc_relobj::toc_base_offset): New stub function.
219 (Target_powerpc): Add tp_offset, dtp_offset. Rename
220 got_mod_index_offset to tlsld_got_offset. Update all refs.
221 (Target_powerpc::Relocate::enum skip_tls): New.
222 (Target_powerpc::call_tls_get_addr_): New var.
223 (Target_powerpc::is_branch_reloc): Move to file scope.
224 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
225 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
227 (Target_powerpc::enum Got_type): Delete old values, add new ones.
228 (powerpc_info): Correct common_pagesize for ppc64.
229 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
230 (Powerpc_relocate_functions): Add overflow check enums and functions.
231 Add non-shift version of rela, rela_ua. Delete all rel public
232 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
233 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
234 addr16_ha3, addr14 functions.
235 (Output_data_got_powerpc::add_constant_pair): New function.
236 (Output_data_got_powerpc::got_base_offset): Likewise.
237 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
238 (instruction constants): Sort, add some more.
239 (Output_data_glink::do_write): Add and use Address typedef. Use
240 object->toc_base_offset() stub for 64-bit.
241 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
242 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
243 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
244 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
245 Always treat .opd relocs as against locally defined symbol.
246 Correct condition for RELATIVE relocs.
247 (Target_powerpc::do_finalize_sections): Test for NULL sections.
248 (Target_powerpc::Relocate::relocate): Use plt call stub as value
249 for 32-bit syms with a plt entry. Correct ppc64 toc base
250 calculations. Handle TLS relocs, and more. Add overflow
251 checking and adjust for Powerpc_relocate_functions changes.
252 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
253 Reinstate --emit-relocs code with FIXME.
255 2012-08-30 Alan Modra <amodra@gmail.com>
257 * layout.cc (Layout::set_segment_offsets): Set p_align to
258 abi_pagesize, not common_pagesize.
259 (Layout::relaxation_loop_body): Similarly use abi_pagesize
260 to determine whether file header can go in segment.
262 2012-08-30 Alan Modra <amodra@gmail.com>
264 * output.h (Output_reloc::Output_reloc <output section>): Add
265 is_relative param. Adjust calls.
266 (Output_reloc::add_output_section_relative): New functions.
267 * output.cc (Output_reloc::Output_reloc <output section>): Handle
269 (Output_reloc::symbol_value): Handle SECTION_CODE.
271 2012-08-24 Sriraman Tallam <tmsriram@google.com>
273 * gold.cc (queue_middle_tasks): Call layout again when unique
274 segments for sections is desired.
275 * layout.cc (Layout::Layout): Initialize new members.
276 (Layout::get_output_section_flags): New function.
277 (Layout::choose_output_section): Call get_output_section_flags.
278 (Layout::layout): Make output section for mapping to a unique segment.
279 (Layout::insert_section_segment_map): New function.
280 (Layout::attach_allocated_section_to_segment): Make unique segment for
281 output sections marked so.
282 (Layout::segment_precedes): Check for unique segments when sorting.
283 * layout.h (Layout::Unique_segment_info): New struct.
284 (Layout::Section_segment_map): New typedef.
285 (Layout::insert_section_segment_map): New function.
286 (Layout::get_output_section_flags): New function.
287 (Layout::is_unique_segment_for_sections_specified): New function.
288 (Layout::set_unique_segment_for_sections_specified): New function.
289 (Layout::unique_segment_for_sections_specified_): New member.
290 (Layout::section_segment_map_): New member.
291 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
292 Rename is_gc_pass_one to is_pass_one.
293 Rename is_gc_pass_two to is_pass_two.
294 Rename is_gc_or_icf to is_two_pass.
295 Check for which pass based on whether symbols data is present.
296 Make it two pass when unique segments for sections is desired.
297 * output.cc (Output_section::Output_section): Initialize new
299 * output.h (Output_section::is_unique_segment): New function.
300 (Output_section::set_is_unique_segment): New function.
301 (Output_section::is_unique_segment_): New member.
302 (Output_section::extra_segment_flags): New function.
303 (Output_section::set_extra_segment_flags): New function.
304 (Output_section::extra_segment_flags_): New member.
305 (Output_section::segment_alignment): New function.
306 (Output_section::set_segment_alignment): New function.
307 (Output_section::segment_alignment_): New member.
308 (Output_segment::Output_segment): Initialize is_unique_segment_.
309 (Output_segment::is_unique_segment): New function.
310 (Output_segment::set_is_unique_segment): New function.
311 (Output_segment::is_unique_segment_): New member.
312 * plugin.cc (allow_unique_segment_for_sections): New function.
313 (unique_segment_for_sections): New function.
314 (Plugin::load): Add new functions to transfer vector.
315 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
316 * Makefile.in: Regenerate.
317 * testsuite/plugin_final_layout.sh: Check if unique segment
319 * testsuite/plugin_section_order.c (onload): Check if new interfaces
321 (allow_unique_segment_for_sections): New global.
322 (unique_segment_for_sections): New global.
323 (claim_file_hook): Call allow_unique_segment_for_sections.
324 (all_symbols_read_hook): Call unique_segment_for_sections.
326 2012-08-22 Cary Coutant <ccoutant@google.com>
328 * layout.cc (Layout::include_section): Don't assert on GROUP
329 sections with --emit-relocs.
331 2012-08-21 Cary Coutant <ccoutant@google.com>
333 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
334 if --export-dynamic-symbol names an undef symbol.
336 2012-08-18 Alan Modra <amodra@gmail.com>
338 * powerpc.cc: Formatting and white space.
339 (Powerpc_relobj): Rename got2_section_ to special_.
340 Add opd_ent_shndx_ and opd_ent_off_ vectors.
341 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
342 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
343 (Target_powerpc): Add Address typedef and invalid_address. Use
345 (Target_powerpc::is_branch_reloc): New function.
346 (Powerpc_relocate_functions): Add Address typedef, use throughout.
347 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
348 for dst_mask, value and addend.
349 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
350 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
351 (Output_data_glink::do_write): Correct toc base. Don't try to use
352 uint16_t for 24-bit offset. Use get_output_section_offset and
354 (Target_powerpc::Scan::local): Handle more relocs.
355 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
356 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
357 Plug in toc restoring insn after plt calls. Translate branches
358 to function descriptor symbols to corresponding entry point.
359 (Target_powerpc::relocate_for_relocatable): Check return from
360 get_output_section_offset.
361 * symtab.h: Comment typo.
363 2012-08-14 Ian Lance Taylor <iant@google.com>
365 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
366 unsupported_relocal_local to call unsupported_reloc_global.
368 2012-08-14 Nick Clifton <nickc@redhat.com>
371 * script-sections.cc (Sections_element::output_section_name): Add
372 keep return parameter.
373 (Output_section_element::match_name): Add keep return parameter.
374 Return the value of the keep_ member.
375 * script-sections.h (class Output_section): Update
376 output_section_name prototype.
377 * layout.cc (Layout::keep_input_section): New public member
379 (Layout::choose_output_section): Pass keep parameter to
381 * layout.h (class Layout): Add keep_input_section.
382 * object.cc (Sized_relobj_file::do_layout): Check for kept input
384 * testsuite/Makefile.am: Add a test.
385 * testsuite/Makefile.in: Regenerate.
386 * testsuite/pr14265.c: Source file for the test.
387 * testsuite/pr14265.t: Linker script for the test.
388 * testsuite/pr14265.sh: Shell script for the test.
390 2012-08-14 Alan Modra <amodra@gmail.com>
392 * target.h (Target::output_section_name): New function.
393 (Target::do_output_section_name): New function.
394 * layout.cc (Layout::choose_output_section): Call the above.
395 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
397 2012-08-14 Alan Modra <amodra@gmail.com>
399 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
400 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
401 for replace_constant call.
402 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
403 (Output_data_glink::do_print_to_mapfile): New function.
404 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
405 (Target_powerpc::Relocate::relocate): Likewise.
407 2012-08-14 Alan Modra <amodra@gmail.com>
409 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
410 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
411 (Output_data_glink::add_entry,find_entry): Remove shndx param.
412 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
413 all references to shndx_. Handle special case for R_PPC_PLTREL24
415 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
416 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
417 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
419 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
420 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
422 2012-08-12 Alan Modra <amodra@gmail.com>
424 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
425 (glink insn constants): Use uint32_t.
426 (Output_data_glink::add_entry): Use insert, not [] operator.
428 2012-08-11 Alan Modra <amodra@gmail.com>
430 * object.h (Sized_relobj_file::find_shdr): New function.
431 (Sized_relobj_file::find_special_sections): New function.
432 * object.cc (Sized_relobj_file::find_shdr): New function.
433 (Sized_relobj_file::find_eh_frame): Use find_shdr.
434 (Sized_relobj_file::find_special_sections): New function, split out..
435 (Sized_relobj_file::do_read_symbols): ..from here.
436 * output.h (Output_data_got::replace_constant): New function.
437 (Output_data_got::num_entries): New function.
438 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
439 (Output_data_got::got_offset): Protected rather than private.
440 (Output_data_got::replace_got_entry): New function.
441 * output.cc (Output_data_got::replace_got_entry): New function.
442 * powerpc.cc (class Powerpc_relobj): New.
443 (class Powerpc_relocate_functions): Delete all psymval variants or
444 convert to value,addend type. Delete pcrela, pcrela_unaligned.
445 Implement _ha functions using corresponding _hi function.
446 (Powerpc_relobj::find_special_sections): New function.
447 (Target_powerpc::do_make_elf_object): New function.
448 (class Output_data_got_powerpc): New.
449 (class Output_data_glink): New.
450 (class Powerpc_scan_relocatable_reloc): New.
451 Many more changes througout file.
453 2012-08-09 Nick Clifton <nickc@redhat.com>
455 * po/vi.po: Updated Vietnamese translation.
457 2012-08-07 Ian Lance Taylor <iant@google.com>
459 * layout.cc (Layout::add_target_dynamic_tags): If
460 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
463 2012-07-30 Nick Clifton <nickc@redhat.com>
465 * po/gold.pot: Updated template.
466 * po/es.po: Updated Spanish translation.
468 2012-07-18 Cary Coutant <ccoutant@google.com>
471 * configure.ac: Add check for -gpubnames support.
472 * configure: Regenerate.
473 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
474 support; force -gno-pubnames.
475 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
477 (gdb_index_test_4): New test.
478 * testsuite/Makefile.in: Regenerate.
479 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
480 * testsuite/gdb_index_test_2.sh: Likewise.
481 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
482 * testsuite/gdb_index_test_4.sh: New script.
483 * testsuite/gdb_index_test_comm.sh: New script with common code;
484 don't look for space after colon.
486 2012-07-16 Sriraman Tallam <tmsriram@google.com>
488 * gold.cc (queue_middle_tasks): Update function order only after
489 deferred objects due to plugins are processed.
491 2012-07-11 Ian Lance Taylor <iant@google.com>
493 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
494 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
495 (Target_arm::scan_reloc_for_stub): Likewise.
496 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
497 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
498 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
499 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
500 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
502 2012-07-10 Dodji Seketeli <dodji@redhat.com>
503 Ian Lance Taylor <iant@google.com>
506 * configure.ac: Test whether std::tr1::hash<off_t> works.
507 * gold.h: Add a specialization for std::tr1::hash<off_t> if
509 * output.h (class Output_fill): Add virtual destructor.
510 * configure, config.in: Rebuild.
512 2012-06-22 Roland McGrath <mcgrathr@google.com>
514 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
516 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
518 * plugin.cc (Plugin::load): Handle position independent executables.
520 2012-06-06 Cary Coutant <ccoutant@google.com>
522 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
524 (lines_only_debug_sections): Likewise.
525 (gdb_fast_lookup_sections): New static array.
526 (is_gdb_debug_section): Rename formal parameter.
527 (is_lines_only_debug_section): Likewise.
528 (is_gdb_fast_lookup_section): New function.
529 (Layout::include_section): Check for ".zdebug_" prefix; pass
530 section name suffix to is_gdb_debug_section, et al.; check for
531 fast-lookup sections when building .gdb_index.
532 * options.h (--strip-debug-gdb): Update GDB version number.
534 2012-06-06 Cary Coutant <ccoutant@google.com>
536 * configure.ac: Add check for fallocate.
537 * configure: Regenerate.
538 * config.in: Regenerate.
540 * options.h (class General_options): Add --mmap-output-file and
541 --posix-fallocate options.
542 * output.cc: (posix_fallocate): Remove; replace with...
543 (gold_fallocate): New function.
544 (Output_file::map_no_anonymous): Call gold_fallocate.
545 (Output_file::map): Check --mmap-output-file option.
547 2012-06-05 Jing Yu <jingyu@google.com>
549 * gold.h (textdomain): Add do {} to empty while(0).
550 (bindtextdomain): Likewise.
552 2012-06-04 Cary Coutant <ccoutant@google.com>
554 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
557 2012-05-25 Sriraman Tallam <tmsriram@google.com>
559 * symtab.cc (Symbol_table::define_special_symbol):
560 Initialize *poldsym to prevent uninitialized variable errors.
562 2012-05-23 Cary Coutant <ccoutant@google.com>
564 * layout.cc (Layout::section_name_mapping): Add rules to handle
565 exact match on .data.rel.ro.local or .data.rel.ro.
566 (Layout::output_section_name): Check for exact matches.
568 2012-05-23 Cary Coutant <ccoutant@google.com>
570 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
573 2012-05-22 Cary Coutant <ccoutant@google.com>
575 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
576 object before exporting symbol.
578 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
580 * testsuite/tls_test.cc: Include "config.h" first.
581 * testsuite/tls_test_c.c: Likewise.
583 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
584 Nick Clifton <nickc@redhat.com>
587 * configure.in: Add check that sysdep.h has been included before
588 any system header files.
589 * configure: Regenerate.
590 * config.in: Regenerate.
592 2012-05-14 Cary Coutant <ccoutant@google.com>
594 * layout.cc (Layout::make_output_section): Mark .tdata section
596 * testsuite/relro_test.cc: Add a TLS variable.
598 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
601 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
602 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
605 2012-05-08 Cary Coutant <ccoutant@google.com>
607 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
608 (lines_only_debug_sections): Likewise.
610 2012-05-02 Roland McGrath <mcgrathr@google.com>
614 * Makefile.am (CCFILES, HFILES): Add them.
615 * Makefile.in: Regenerate.
616 * i386.cc (Output_data_plt_i386_nacl): New class.
617 (Output_data_plt_i386_nacl_exec): New class.
618 (Output_data_plt_i386_nacl_dyn): New class.
619 (Target_i386_nacl): New class.
620 (Target_selector_i386_nacl): New class.
621 (target_selector_i386): Use it instead of Target_selector_i386.
622 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
623 (Target_x86_64_nacl): New class.
624 (Target_selector_x86_64_nacl): New class.
625 (target_selector_x86_64, target_selector_x32): Use it instead of
626 Target_selector_x86_64.
627 * arm.cc (Output_data_plt_arm_nacl): New class.
628 (Target_arm_nacl): New class.
629 (Target_selector_arm_nacl): New class.
630 (target_selector_arm, target_selector_armbe): Use it instead of
633 * target-select.cc (select_target): Take new Input_file* and off_t
634 arguments, pass them on to recognize method of selector.
635 * object.cc (make_elf_sized_object): Update caller.
636 * parameters.cc (parameters_force_valid_target): Likewise.
637 * incremental.cc (make_sized_incremental_binary): Likewise.
638 * target-select.h: Update decl.
639 (Target_selector::recognize): Take new Input_file* argument,
640 pass it on to do_recognize.
641 (Target_selector::do_recognize): Take new Input_file* argument.
642 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
643 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
644 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
645 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
647 * target.h (Target::Target_info): New members isolate_execinstr
649 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
650 * arm.cc (Target_arm::arm_info): Update initializer.
651 * i386.cc (Target_i386::i386_info): Likewise.
652 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
653 * sparc.cc (Target_sparc::sparc_info): Likewise.
654 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
655 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
656 * layout.cc (Layout::attach_allocated_section_to_segment):
657 Take new const Target* argument. If target->isolate_execinstr(), act
659 (Layout::find_first_load_seg): Take new const Target* argument;
660 if target->isolate_execinstr(), reject PF_X segments.
661 (Layout::relaxation_loop_body): Update caller.
662 (Layout::set_segment_offsets): If target->isolate_execinstr(),
663 reset file offset to zero when we hit LOAD_SEG, and then do a second
664 loop over the segments before LOAD_SEG to reassign offsets after
665 addresses have been determined. Handle target->rosegment_gap().
666 (Layout::attach_section_to_segment): Take new const Target* argument;
667 pass it to attach_allocated_section_to_segment.
668 (Layout::make_output_section): Update caller.
669 (Layout::attach_sections_to_segments): Take new const Target* argument;
670 pass it to attach_section_to_segment.
671 * gold.cc (queue_middle_tasks): Update caller.
672 * layout.h (Layout): Update method decls with new arguments.
674 * arm.cc (Target_arm::Target_arm): Take optional argument for the
675 Target_info pointer to use.
676 (Target_arm::do_make_data_plt): New virtual method.
677 (Target_arm::make_data_plt): New method that calls it.
678 (Target_arm::make_plt_entry): Use it.
679 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
680 for the section alignment.
681 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
683 (Output_data_plt_arm::first_plt_entry_offset): Call it.
684 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
686 (Output_data_plt_arm::get_plt_entry_size): Call it.
687 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
688 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
689 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
691 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
692 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
693 method instead of sizeof(plt_entry).
694 (Output_data_plt_arm::add_entry): Likewise.
695 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
696 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
698 (Target_arm::plt_entry_size): Likewise.
699 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
701 (Output_data_plt_arm_standard): ... here, new class.
702 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
703 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
704 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
706 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
707 Take additional argument for the PLT entry size.
708 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
709 Use get_plt_entry_size method rather than plt_entry_size variable.
710 (Output_data_plt_x86_64::reserve_slot): Likewise.
711 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
712 (Output_data_plt_x86_64::add_entry): Likewise.
713 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
714 (Output_data_plt_x86_64::address_for_global): Likewise.
715 (Output_data_plt_x86_64::address_for_local): Likewise.
716 (Output_data_plt_x86_64::set_final_data_size): Likewise.
717 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
718 Make method non-static.
719 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
721 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
722 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
723 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
724 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
726 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
727 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
729 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
730 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
732 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
733 (Output_data_plt_x86_64::plt_entry_size)
734 (Output_data_plt_x86_64::first_plt_entry)
735 (Output_data_plt_x86_64::plt_entry)
736 (Output_data_plt_x86_64::tlsdesc_plt_entry)
737 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
738 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
739 (Output_data_plt_x86_64_standard): ... here, new class.
740 (Target_x86_64::Target_x86_64): Take optional argument for the
741 Target_info pointer to use.
742 (Target_x86_64::do_make_data_plt): New virtual method.
743 (Target_x86_64::make_data_plt): New method to call it.
744 (Target_x86_64::init_got_plt_for_update): Use that.
745 Call this->plt_->add_eh_frame method here.
746 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
747 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
748 rather than static method.
749 (Target_x86_64::plt_entry_size): Likewise.
750 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
751 rather than plt_entry_size variable. Move guts of PLT filling to...
752 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
753 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
754 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
756 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
757 additional argument for the section alignment.
758 Don't do add_eh_frame_for_plt here.
759 (Output_data_plt_i386::first_plt_entry_offset): Make the method
760 non-static. Use get_plt_entry_size method rather than plt_entry_size
762 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
764 (Output_data_plt_i386::get_plt_entry_size): Call it.
765 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
766 (Output_data_plt_i386::add_eh_frame): New method to call it.
767 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
769 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
770 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
772 (Output_data_plt_i386::fill_plt_entry): New method to call it.
773 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
774 method instead of plt_entry_size.
775 (Output_data_plt_i386::plt_entry_size)
776 (Output_data_plt_i386::plt_eh_frame_fde_size)
777 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
778 (Output_data_plt_i386_standard): ... here, new class.
779 (Output_data_plt_i386_exec): New class.
780 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
781 (Output_data_plt_i386_exec::first_plt_entry): ... here.
782 (Output_data_plt_i386::exec_plt_entry): Move to ...
783 (Output_data_plt_i386_exec::plt_entry): ... here.
784 (Output_data_plt_i386_dyn): New class.
785 (Output_data_plt_i386::first_plt_entry): Move to ...
786 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
787 (Output_data_plt_i386::dyn_plt_entry): Move to ...
788 (Output_data_plt_i386_dyn::plt_entry): ... here.
789 (Target_i386::Target_i386): Take optional argument for the Target_info
791 (Target_i386::do_make_data_plt): New virtual method.
792 (Target_i386::make_data_plt): New method to call it.
793 (Target_i386::make_plt_section): Use that.
794 Call this->plt_->add_eh_frame method here.
795 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
796 rather than plt_entry_size variable.
797 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
798 (Output_data_plt_i386::address_for_local): Likewise.
799 (Output_data_plt_i386::do_write): Likewise.
800 Move guts of PLT filling to...
801 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
802 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
803 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
804 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
806 2012-05-01 Cary Coutant <ccoutant@google.com>
808 * dwarf_reader.cc (Dwarf_die::read_attributes)
809 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
810 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
811 * reduced_debug_output.cc
812 (Output_reduced_debug_info_section::get_die_end): Remove
813 DW_FORM_GNU_ref_index. Add default case.
815 2012-04-26 Mark Wielaard <mjw@redhat.com>
817 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
818 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
819 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
820 DW_AT_high_pc as offset from DW_AT_low_pc.
822 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
823 * testsuite/Makefile.in: Regenerate.
824 * testsuite/gdb_index_test_3.c: New test source file.
825 * testsuite/gdb_index_test_3.sh: New test source file.
827 2012-04-25 Ian Lance Taylor <iant@google.com>
829 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
831 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
832 as a class, not a struct.
833 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
834 (Target_arm::apply_cortex_a8_workaround): Likewise.
835 * gc.h: Declare Reloc_types as a struct, not a class.
836 * object.h: Declare Symbols_data as a struct.
837 * reloc.h: Declare Read_relocs_data as a struct.
838 * target.h: Declare Relocate_info as a struct.
840 2012-04-24 David S. Miller <davem@davemloft.net>
842 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
843 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
846 2012-04-24 Cary Coutant <ccoutant@google.com>
848 * incremental-dump.cc (find_input_containing_global): Replace
849 magic number with symbolic constant.
850 (dump_incremental_inputs): Update version number.
851 * incremental.cc (Output_section_incremental_inputs): Update version
852 number; import symbolic constants from Incremental_inputs_reader.
853 (Incremental_inputs::create_data_sections): Align relocations
854 section correctly for 64-bit targets.
855 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
856 constants; add padding.
857 (Output_section_incremental_inputs::write_header): Add assert for
859 (Output_section_incremental_inputs::write_input_files): Add assert
860 for input_entry_size.
861 (Output_section_incremental_inputs::write_info_blocks): Add padding;
862 add assert for object_info_size, input_section_entry_size,
863 global_sym_entry_size.
864 * incremental.h (Incremental_inputs_reader): Add symbolic constants
865 for data structure sizes; use them.
866 (Incremental_input_entry_reader): Import symbolic constants from
867 Incremental_inputs_reader; use them.
869 2012-04-23 David S. Miller <davem@davemloft.net>
871 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
873 (Target_sparc::Target_sparc): Initialize new fields.
874 (Target_sparc::do_make_elf_object): New function.
875 (Target_sparc::do_adjust_elf_header): New function.
877 2012-04-23 Cary Coutant <ccoutant@google.com>
879 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
880 CU range table of gdb index.
882 2012-04-20 David S. Miller <davem@davemloft.net>
884 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
887 2012-04-16 David S. Miller <davem@davemloft.net>
889 * sparc.cc (Target_sparc::got_address): New function.
890 (Sparc_relocate_functions::gdop_hix22): New function.
891 (Sparc_relocate_functions::gdop_lox10): New function.
892 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
894 (Target_sparc::Scan::local): Likewise if the global symbol is not
895 preemptible and is not IFUNC.
896 (Target_sparc::Relocate::relocate): Perform GOTDATA code
897 transformations for local and non-preemptible non-IFUNC global
900 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
901 writing out 64-bit part of ranges.
903 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
904 -fpic and -fpie respectively.
905 * Makefile.in: Regenerate.
907 * sparc.cc (class Target_sparc): Add rela_ifunc_.
908 (Target_sparc::Target_sparc): Initialize new field.
909 (Target_sparc::do_plt_section_for_global): New function.
910 (Target_sparc::do_plt_section_for_local): New function.
911 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
912 (Target_sparc::make_plt_section): New function, broken out of
913 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
914 (Target_sparc::make_plt_entry): Call make_plt_section.
915 (Target_sparc::make_local_ifunc_plt_entry): New function.
916 (Target_sparc::rela_ifunc_section): New function.
917 (Target_sparc::plt_section): Remove const.
918 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
919 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
920 and ifunc_count_ fields.
921 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
922 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
923 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
924 (Output_data_plt_sparc::rela_ifunc): New function.
925 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
926 (Output_data_plt_sparc::has_ifunc_section): New function.
927 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
928 (Output_data_plt_sparc::address_for_global): New function.
929 (Output_data_plt_sparc::address_for_local): New function.
930 (Output_data_plt_sparc::plt_index_to_offset): New function.
931 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
933 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
935 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
936 R_SPARC_JMP_IREL to switch.
937 (Target_sparc::Scan::check_non_pic): Likewise.
938 (Target_sparc::Scan::local): Handle IFUNC symbols.
939 (Target_sparc::Scan::local): Likewise.
940 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
941 and plt_address_for_local.
942 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
943 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
945 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
946 (class Output_data_reloc): Adjust calls to Output_reloc_type.
947 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
948 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
950 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
951 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
953 * sparc.cc (Target_sparc::Scan::global): Likewise.
954 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
956 2012-04-16 Cary Coutant <ccoutant@google.com>
958 * archive.cc (Library_base::should_include_member): Check for
959 --export-dynamic-symbol.
960 * options.h (class General_options): Add --export-dynamic-symbol.
961 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
962 --export-dynamic-symbol.
963 (Symbol_table::gc_mark_undef_symbols): Likewise.
964 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
966 2012-04-12 David S. Miller <davem@davemloft.net>
968 * sparc.cc (Reloc::wdisp10): New relocation method.
969 (Reloc::h34): Likewise.
970 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
971 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
973 (Target_sparc::Scan::local): Likewise.
974 (Target_sparc::Scan::global): Likewise.
975 (Target_sparc::Relocate::relocate): Likewise.
977 2012-04-09 Cary Coutant <ccoutant@google.com>
979 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
982 2012-04-06 Ian Lance Taylor <iant@google.com>
984 * timer.cc: #include <unistd.h>.
986 2012-04-06 Roland McGrath <mcgrathr@google.com>
988 * configure.in (AC_CHECK_HEADERS): Add locale.h.
989 * config.in: Regenerate.
990 * configure: Regenerate.
992 2012-04-05 Nick Clifton <nickc@redhat.com>
994 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
995 (AM_LC_MESSAGES): Add.
996 * aclocal.m4: Regenerate.
997 * config.in: Regenerate.
998 * configure: Regenerate.
1000 2012-03-21 Cary Coutant <ccoutant@google.com>
1002 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1003 * Makefile.in: Regenerate.
1004 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1005 (Sized_elf_reloc_mapper::symbol_section): New function.
1006 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1007 (make_elf_reloc_mapper): New function.
1008 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1009 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1010 (Dwarf_abbrev_table::do_get_abbrev): New function.
1011 (Dwarf_ranges_table::read_ranges_table): New function.
1012 (Dwarf_ranges_table::read_range_list): New function.
1013 (Dwarf_pubnames_table::read_section): New function.
1014 (Dwarf_pubnames_table::read_header): New function.
1015 (Dwarf_pubnames_table::next_name): New function.
1016 (Dwarf_die::Dwarf_die): New function.
1017 (Dwarf_die::read_attributes): New function.
1018 (Dwarf_die::skip_attributes): New function.
1019 (Dwarf_die::set_name): New function.
1020 (Dwarf_die::set_linkage_name): New function.
1021 (Dwarf_die::attribute): New function.
1022 (Dwarf_die::string_attribute): New function.
1023 (Dwarf_die::int_attribute): New function.
1024 (Dwarf_die::uint_attribute): New function.
1025 (Dwarf_die::ref_attribute): New function.
1026 (Dwarf_die::child_offset): New function.
1027 (Dwarf_die::sibling_offset): New function.
1028 (Dwarf_info_reader::check_buffer): New function.
1029 (Dwarf_info_reader::parse): New function.
1030 (Dwarf_info_reader::do_parse): New function.
1031 (Dwarf_info_reader::do_read_string_table): New function.
1032 (Dwarf_info_reader::lookup_reloc): New function.
1033 (Dwarf_info_reader::get_string): New function.
1034 (Dwarf_info_reader::visit_compilation_unit): New function.
1035 (Dwarf_info_reader::visit_type_unit): New function.
1036 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1037 Sized_elf_reloc_mapper.
1038 (Sized_dwarf_line_info::symbol_section): Remove function.
1039 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1040 (Sized_dwarf_line_info::read_line_mappings): Remove object
1041 parameter, adjust callers.
1042 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1043 * dwarf_reader.h: Include <sys/types.h>.
1044 (class Track_relocs): Remove forward declaration.
1045 (class Elf_reloc_mapper): New class.
1046 (class Sized_elf_reloc_mapper): New class.
1047 (class Dwarf_abbrev_table): New class.
1048 (class Dwarf_range_list): New class.
1049 (class Dwarf_ranges_table): New class.
1050 (class Dwarf_pubnames_table): New class.
1051 (class Dwarf_die): New class.
1052 (class Dwarf_info_reader): New class.
1053 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1054 (Sized_dwarf_line_info::symbol_section): Remove member function.
1055 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1057 * gdb-index.cc: New source file.
1058 * gdb-index.h: New source file.
1059 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1060 and .debug_types sections, call Layout::add_to_gdb_index.
1061 (Sized_relobj_incr::do_section_name): Implement.
1062 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1063 return type; Implement.
1064 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1066 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1067 parameter list and return type.
1068 (Sized_incr_dynobj::do_section_contents): Likewise.
1069 * layout.cc: Include gdb-index.h.
1070 (Layout::Layout): Initialize gdb_index_data_.
1071 (Layout::init_fixed_output_section): Check for .gdb_index section.
1072 (Layout::add_to_gdb_index): New function. Instantiate.
1073 * layout.h: Add forward declaration for class Gdb_index.
1074 (Layout::add_to_gdb_index): New member function.
1075 (Layout::gdb_index_data_): New data member.
1076 * main.cc: Include gdb-index.h.
1077 (main): Print statistics for gdb index.
1078 * object.cc (Object::section_contents): Move code into
1079 do_section_contents.
1080 (need_decompressed_section): Check for sections needed when building
1082 (build_compressed_section_map): Likewise.
1083 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1085 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1086 sections; call Layout::add_to_gdb_index.
1087 (Sized_relobj_file::do_decompressed_section_contents): Call
1088 do_section_contents directly.
1089 * object.h (Object::do_section_contents): Adjust parameter list and
1091 (Object::do_decompressed_section_contents): Call do_section_contents
1093 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1095 * options.h (class General_options): Add --gdb-index option.
1096 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1097 list and return type.
1098 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1099 * reloc.h (Track_relocs::checkpoint): New function.
1100 (Track_relocs::reset): New function.
1102 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1104 * testsuite/Makefile.in: Regenerate.
1105 * testsuite/gdb_index_test.cc: New test source file.
1106 * testsuite/gdb_index_test_1.sh: New test source file.
1107 * testsuite/gdb_index_test_2.sh: New test source file.
1109 2012-03-19 Doug Kwan <dougkwan@google.com>
1111 * arm.cc (Target_arm::do_define_standard_symbols): New method.
1112 (Target_arm::do_finalize_sections): Remove code which defines
1113 __exidx_start and __exidx_end. Make symbol table parameter
1114 anonymous as it is not used.
1115 * gold.cc (queue_middle_tasks): Call target hook to define any
1116 target-specific symbols.
1117 * target.h (Target::define_standard_symbols): New method.
1118 (Target::do_define_standard_symbols): Same.
1119 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1120 * testsuite/Makefile.in: Regenerate.
1121 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1123 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1124 relocations are generated for __exidx_start and __exidx_end.
1126 2012-03-16 Doug Kwan <dougkwan@google.com>
1128 * testsuite/Makefile.am: Disable test initpri3b.
1129 * testsuite/Makefile.in: Regenerate.
1131 2012-03-15 Doug Kwan <dougkwan@google.com>
1133 * arm.cc (Target_arm::got_section): Make .got section read-only
1136 2012-03-15 Ian Lance Taylor <iant@google.com>
1139 * layout.cc (Layout::make_output_section): Correctly mark
1140 SHT_INIT_ARRAY, et. al., as relro.
1142 2012-03-14 Doug Kwan <dougkwan@google.com>
1144 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1145 dynamic relocations for protected symbols in shared objects.
1147 2012-03-13 Ian Lance Taylor <iant@google.com>
1149 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1150 keep the larger alignment.
1152 2012-03-12 Cary Coutant <ccoutant@google.com>
1154 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1155 handling of DW_LNE_define_file.
1157 2012-03-12 Cary Coutant <ccoutant@google.com>
1159 * reduced_debug_output.cc
1160 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1163 2012-02-29 Cary Coutant <ccoutant@google.com>
1165 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1167 2012-02-29 Cary Coutant <ccoutant@google.com>
1169 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1170 Call Object::decompressed_section_contents.
1171 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1173 (Sized_dwarf_line_info::buffer_start_): New data member.
1174 * merge.cc (Output_merge_data::do_add_input_section): Call
1175 Object::decompressed_section_contents.
1176 (Output_merge_string::do_add_input_section): Likewise.
1177 * object.cc (need_decompressed_section): New function.
1178 (build_compressed_section_map): Decompress sections needed later.
1179 (Sized_relobj_file::do_decompressed_section_contents): New function.
1180 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1181 * object.h (Object::decompressed_section_contents): New function.
1182 (Object::discard_decompressed_sections): New function.
1183 (Object::do_decompressed_section_contents): New function.
1184 (Object::do_discard_decompressed_sections): New function.
1185 (Compressed_section_info): New type.
1186 (Compressed_section_map): Include decompressed section contents.
1187 (Sized_relobj_file::do_decompressed_section_contents): New function.
1188 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1190 2012-02-16 Cary Coutant <ccoutant@google.com>
1192 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1193 * testsuite/Makefile.in: Regenerate.
1195 2012-02-14 Cary Coutant <ccoutant@google.com>
1197 * options.cc (General_options::finalize): Disallow -pie and -static.
1199 2012-02-03 Doug Kwan <dougkwan@google.com>
1201 * arm.cc (Arm_relocate_functions::abs8,
1202 Arm_relocate_functions::abs16): Use
1203 Bits::has_signed_unsigned_overflow32.
1204 (Arm_relocate_functions::thm_abs8): Correct range of
1206 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1209 2012-02-02 Doug Kwan <dougkwan@google.com>
1211 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1212 position independent outputs, not just shared objects.
1214 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1216 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1217 * configure: Regenerated.
1219 2012-01-27 Ian Lance Taylor <iant@google.com>
1221 * reloc.h (Bits): New class with static functions, copied from
1222 namespace utils in arm.cc.
1223 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1226 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1228 * incremental.cc (write_info_blocks): Correct relocation offset.
1230 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1232 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1233 (Relocate::tls_gd_to_le): Likewise.
1235 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1237 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1239 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1241 * configure.ac: Check if -mcmodel=medium works.
1242 * configure: Regenerated.
1244 2012-01-24 Cary Coutant <ccoutant@google.com>
1246 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1248 (read_unsigned_LEB_128_x): ... this new function.
1249 (read_signed_LEB_128): Replaced with inline definition and ...
1250 (read_signed_LEB_128_x): ... this new function.
1251 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1252 (read_unsigned_LEB_128): Add inline definition.
1253 (read_signed_LEB_128_x): New function.
1254 (read_signed_LEB_128): Add inline definition.
1255 * testsuite/Makefile.am (leb128_unittest): New unit test.
1256 * testsuite/Makefile.in: Regenerate.
1257 * testsuite/leb128_unittest.cc: New unit test.
1259 2012-01-23 Ian Lance Taylor <iant@google.com>
1262 * i386.cc (Target_i386::do_code_fill): When using a jmp
1263 instruction, pad with nop instructions.
1264 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1266 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1268 * x86_64.cc (gc_process_relocs): Add typename on types used in
1270 (scan_relocs): Likewise.
1271 (relocate_section): Likewise.
1272 (apply_relocation): Likewise.
1274 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1276 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1277 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1280 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1282 * x86_64.cc: Initial support for x32.
1284 2012-01-03 Cary Coutant <ccoutant@google.com>
1286 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1287 Use abstract base class for GOT.
1288 * gold/output.h (class Output_data_got_base): New abstract base class.
1289 (class Output_data_got): Derive from new base class, adjust ctors.
1290 (Output_data_got::reserve_slot): Make virtual; rename to
1291 do_reserve_slot; Adjust callers.
1292 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1293 pointer to abstract base class.
1294 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1296 2011-12-18 Ian Lance Taylor <iant@google.com>
1298 * object.h (Relobj::local_symbol_value): New function.
1299 (Relobj::local_plt_offset): New function.
1300 (Relobj::local_has_got_offset): New function.
1301 (Relobj::local_got_offset): New function.
1302 (Relobj::set_local_got_offset): New function.
1303 (Relobj::do_local_symbol_value): New pure virtual function.
1304 (Relobj::do_local_plt_offset): Likewise.
1305 (Relobj::do_local_has_got_offset): Likewise.
1306 (Relobj::do_local_got_offset): Likewise.
1307 (Relobj::do_set_local_got_offset): Likewise.
1308 (Sized_relobj::do_local_has_got_offset): Rename from
1309 local_has_got_offset.
1310 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1311 (Sized_relobj::do_set_local_got_offset): Rename from
1312 set_local_got_offset.
1313 (Sized_relobj_file::do_local_plt_offset): Rename from
1315 (Sized_relobj_file::do_local_symbol_value): New function.
1316 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1318 * output.cc (Output_data_got::Got_entry::write): Change object to
1319 Relobj. Use local_symbol_value.
1320 (Output_data_got::add_global_with_rel): Change rel_dyn to
1321 Output_data_reloc_generic*. Use add_global_generic.
1322 (Output_data_got::add_global_with_rela): Remove. Change all
1323 callers to use add_global_with_rel.
1324 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1325 Output_data_reloc_generic*. Use add_global_generic.
1326 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1327 callers to use add_global_pair_with_rel.
1328 (Output_data_got::add_local): Change object to Relobj*.
1329 (Output_data_got::add_local_plt): Likewise.
1330 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1331 change rel_dyn to Output_data_reloc_generic*. Use
1333 (Output_data_got::add_local_with_rela): Remove. Change all
1334 callers to use all_local_with_rel.
1335 (Output_data_got::add_local_pair_with_rel): Change object to
1336 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1337 add_output_section_generic.
1338 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1339 callers to use add_local_pair_with_rel.
1340 (Output_data_got::reserve_local): Change object to Relobj*.
1341 * output.h: (class Output_data_reloc_generic): Add pure virtual
1342 declarations for add_global_generic, add_local_generic,
1343 add_output_section_generic.
1344 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1345 functions for Output_data_reloc_generic. Update declarations for
1346 changes listed in output.cc.
1347 (class Output_data_got): Change template parameter to got_size.
1348 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1349 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1351 (Sized_relobj_incr::do_local_plt_offset): New function.
1352 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1355 2011-12-17 Cary Coutant <ccoutant@google.com>
1357 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1358 * resolve.cc (Symbol_table::resolve): Likewise.
1359 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1361 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1363 2011-12-16 Ian Lance Taylor <iant@google.com>
1365 * output.h (Output_data_reloc_generic::add): Only call
1366 add_dynamic_reloc if this is a dynamic reloc section.
1368 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1371 * target-reloc.h (apply_relocation): Replace <64, false> with
1374 2011-11-25 Nick Clifton <nickc@redhat.com>
1376 * po/it.po: New Italian translation.
1378 2011-11-17 Sterling Augustine <saugustine@google.com>
1380 * script.cc (script_include_directive): Implement.
1381 (read_script_file): New local variables name and search_path. Update
1382 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1383 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1384 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1386 2011-11-11 Sterling Augustine <saugustine@google.com>
1388 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1389 (file_or_sections_cmd): Likewise.
1391 2011-11-11 Doug Kwan <dougkwan@google.com>
1393 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1394 if --just-symbols is given.
1396 2011-11-10 Doug Kwan <dougkwan@google.com>
1399 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1400 when processing data relocs.
1401 * reloc.h (Relocate_functions::rel_unaligned): New method.
1402 (Relocate_functions::pcrel_unaligned): Ditto.
1403 (Relocate_functions::rel32_unaligned): Ditto.
1404 (Relocate_functions::pcrel32_unaligned): Ditto.
1406 2011-11-09 Doug Kwan <dougkwan@google.com>
1409 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1410 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1411 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1412 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1413 (Relocate_functions::rel_unaligned): New.
1414 (Relocate_functions::rel32_unaligned): New.
1415 * target-reloc.h (relocate_for_relocatable): Add code to handle
1416 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1417 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1418 arm_unaligned_reloc_r): New targets.
1419 * testsuite/Makefile.in: Regenerate.
1420 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1423 2011-11-02 Ian Lance Taylor <iant@google.com>
1425 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1427 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1428 * options.cc (General_options::finalize): Use library search path
1429 from configure script if specified. If not native and no sysroot,
1430 only search TOOLLIBDIR.
1431 * options.h (Search_directory::Search_directory): Change name to
1433 (General_options::add_to_library_path_with_sysroot): Change arg to
1435 * configure, Makefile.in, config.in: Rebuild.
1437 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1439 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1440 we are working around the ARM1176 Erratum.
1441 * options.h (General_options::fix_arm1176): Add option.
1442 * testsuite/Makefile.am: Add testcases, and keep current ones
1444 * testsuite/Makefile.in: Regenerate.
1445 * testsuite/arm_fix_1176.s: New file.
1446 * testsuite/arm_fix_1176.sh: Likewise.
1448 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1450 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1452 (Target_arm::may_use_blx): Remove method.
1453 (Target_arm::set_may_use_blx): Likewise.
1454 (Target_arm::may_use_v4t_interworking): New method.
1455 (Target_arm::may_use_v5t_interworking): Likewise.
1456 (Target_arm::may_use_blx_): Remove member variable.
1457 (Arm_relocate_functions::arm_branch_common): Check for v5T
1459 (Arm_relocate_functions::thumb_branch_common): Likewise.
1460 (Reloc_stub::stub_type_for_reloc): Likewise.
1461 (Target_arm::do_finalize_sections): Correct interworking checks.
1462 * testsuite/Makefile.am: Add new tests.
1463 * testsuite/Makefile.in: Regenerate.
1464 * testsuite/arm_farcall_arm_arm.s: New test.
1465 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1466 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1467 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1468 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1469 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1470 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1471 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1473 2011-10-31 Cary Coutant <ccoutant@google.com>
1476 * expression.cc (Expression::eval_with_dot): Add
1477 is_section_dot_assignment parameter.
1478 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1479 absolute and assigning to dot within a section.
1480 * script-sections.cc
1481 (Output_section_element_assignment::set_section_addresses): Pass
1482 dot_section to set_if_absolute.
1483 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1484 as is_section_dot_assignment flag to eval_with_dot.
1485 (Output_section_element_dot_assignment::set_section_addresses):
1487 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1488 parameter. Also set value if relative to dot_section; set the
1489 symbol's output_section.
1490 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1491 parameter. Adjust all callers.
1492 (Expression::eval_maybe_dot): Likewise.
1493 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1495 * testsuite/script_test_2.t: Test assignment of an absolute value
1496 to dot within an output section element.
1498 2011-10-31 Cary Coutant <ccoutant@google.com>
1500 * options.h (class General_options): Add --[no-]gnu-unique options.
1501 * symtab.cc (Symbol_table::sized_write_globals): Convert
1502 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1504 2011-10-31 Cary Coutant <ccoutant@google.com>
1507 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1508 unnecessary assertion.
1509 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1511 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1513 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1515 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1517 Change to just keep the section associated with symbol.
1518 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1519 they are externally visible and --export-dynamic is turned on.
1520 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1522 2011-10-19 Ian Lance Taylor <iant@google.com>
1525 * script-sections.cc
1526 (Output_section_element_dot_assignment::needs_output_section): New
1529 2011-10-19 Ian Lance Taylor <iant@google.com>
1532 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1533 --section-start option was seen.
1534 * options.h (General_options::any_section_start): New function.
1536 2011-10-18 David S. Miller <davem@davemloft.net>
1539 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1540 member to track relocation locations that have moved during TLS
1541 reloc optimizations.
1542 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1543 (Target_sparc::Relocate::relocate): Adjust view down by 4
1544 bytes if it matches reloc_adjust_addr_.
1545 (Target_sparc::Relocate::relocate_tls): Always move the
1546 __tls_get_addr call delay slot instruction forward 4 bytes when
1547 performing relaxation.
1549 2011-10-18 Cary Coutant <ccoutant@google.com>
1551 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1552 (Output_file::map_no_anonymous): Check for non-zero
1553 return code from posix_fallocate.
1555 2011-10-17 Cary Coutant <ccoutant@google.com>
1558 * plugin.cc (is_visible_from_outside): Check for symbols
1559 referenced from dynamic objects.
1560 * resolve.cc (Symbol_table::resolve): Don't count references
1561 from dynamic objects as references from real ELF files.
1562 * testsuite/plugin_test_2.sh: Adjust expected result.
1564 2011-10-17 Cary Coutant <ccoutant@google.com>
1566 * gold.cc: Include timer.h.
1567 (queue_middle_tasks): Stamp time.
1568 (queue_final_tasks): Likewise.
1569 * main.cc (main): Store timer in parameters. Print timers
1571 * parameters.cc (Parameters::Parameters): Initialize timer_.
1572 (Parameters::set_timer): New function.
1573 (set_parameters_timer): New function.
1574 * parameters.h (Parameters::set_timer): New function.
1575 (Parameters::timer): New function.
1576 (Parameters::timer_): New data member.
1577 (set_parameters_timer): New function.
1578 * timer.cc (Timer::stamp): New function.
1579 (Timer::get_pass_time): New function.
1580 * timer.h (Timer::stamp): New function.
1581 (Timer::get_pass_time): New function.
1582 (Timer::pass_times_): New data member.
1584 2011-10-17 Cary Coutant <ccoutant@google.com>
1586 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1587 task for members of lib groups.
1589 2011-10-17 Cary Coutant <ccoutant@google.com>
1592 * fileread.cc (File_read::find_view): Add assert.
1593 (File_read::make_view): Move bounds check (replace with assert)...
1594 (File_read::find_or_make_view): ... to here.
1596 2011-10-12 Cary Coutant <ccoutant@google.com>
1598 * output.cc (Output_file::open_base_file): Handle case where
1599 ::read returns less than requested size.
1601 2011-10-10 Cary Coutant <ccoutant@google.com>
1603 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1604 Initialize defined_count_.
1605 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1606 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1607 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1608 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1609 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1610 * incremental.h (Sized_relobj_incr::defined_count_): New data
1612 (Sized_incr_dynobj::defined_count_): New data member.
1613 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1614 Return zeroes instead of internal error.
1616 2011-10-10 Cary Coutant <ccoutant@google.com>
1619 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1620 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1621 * output.h (class Output_reloc): Add use_plt_offset flag.
1622 (Output_reloc::type_): Adjust size of bit field.
1623 (Output_reloc::use_plt_offset_): New bit field.
1624 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1625 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1626 flag. Adjust all callers.
1627 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1628 creating RELATIVE relocations.
1630 2011-10-10 Nick Clifton <nickc@redhat.com>
1632 * po/es.po: Updated Spanish translation.
1633 * po/fi.po: Updated Finnish translation.
1635 2011-10-03 Diego Novillo <dnovillo@google.com>
1637 * options.cc (parse_uint): Fix dereference of RETVAL.
1639 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1641 * layout.h (section_order_map_): New member.
1642 (get_section_order_map): New member function.
1643 * output.cc (Output_section::add_input_section): Check for patterns
1644 only when --section-ordering-file is specified.
1645 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1646 output_sections have been formed.
1647 * layout.cc (Layout_Layout): Initialize section_order_map_.
1648 * plugin.cc (update_section_order): Store order in order_map. Do not
1650 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1651 * testsuite/Makefile.in: Regenerate.
1652 * testsuite/plugin_section_order.c: New file.
1653 * testsuite/plugin_final_layout.cc: New file.
1654 * testsuite/plugin_final_layout.sh: New file.
1656 2011-09-29 Cary Coutant <ccoutant@google.com>
1658 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1660 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1661 symbols during incremental update.
1662 (Symbol_table::add_from_dynobj): Likewise.
1664 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1665 Ian Lance Taylor <iant@google.com>
1667 * symtab.cc (Symbol_table::define_special_symbol): Always
1668 canonicalize version string.
1670 2011-09-26 Cary Coutant <ccoutant@google.com>
1672 * gold.cc (queue_initial_tasks): Move option checks ...
1673 * options.cc (General_options::finalize): ... to here. Disable
1674 some options; make others fatal.
1676 2011-09-26 Cary Coutant <ccoutant@google.com>
1679 * plugin.cc (get_symbols_v2): New function.
1680 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1681 (is_referenced_from_outside): New function.
1682 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1683 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1684 (get_symbols): Pass version parameter.
1685 (get_symbols_v2): New function.
1686 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1688 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1689 (onload): Add LDPT_GET_SYMBOLS_V2.
1690 (all_symbols_read_hook): Use get_symbols_v2; check for
1691 LDPR_PREVAILING_DEF_IRONLY_EXP.
1692 * testsuite/plugin_test_3.sh: Update expected results.
1694 2011-09-23 Simon Baldwin <simonb@google.com>
1696 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1697 configuration options.
1698 * configure: Regenerate.
1699 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1700 * Makefile.in: Regenerate.
1701 * testsuite/Makefile.in: Regenerate.
1703 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1705 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1707 2011-09-19 Cary Coutant <ccoutant@google.com>
1709 * incremental.cc (can_incremental_update): Fix typo in comment.
1710 * incremental.h (can_incremental_update): Likewise.
1712 2011-09-18 Cary Coutant <ccoutant@google.com>
1714 * incremental.cc (can_incremental_update): New function.
1715 * incremental.h (can_incremental_update): New function.
1716 * layout.cc (Layout::init_fixed_output_section): Call it.
1717 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1718 * object.cc (Sized_relobj_file::do_layout): Call
1719 can_incremental_update.
1721 2011-09-13 Cary Coutant <ccoutant@google.com>
1723 * configure.ac: Check for glibc support for gnu_indirect_function
1724 support with static linking, setting automake conditional
1726 * Makefile.in: Regenerate.
1727 * configure: Regenerate.
1729 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1730 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1732 * testsuite/Makefile.in: Regenerate.
1734 2011-09-13 Cary Coutant <ccoutant@google.com>
1736 * incremental.cc (Sized_relobj_incr::do_layout): Call
1737 report_comdat_group for kept comdat sections.
1738 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1739 * testsuite/Makefile.in: Regenerate.
1740 * testsuite/incr_comdat_test_1.cc: New source file.
1741 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1742 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1743 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1745 2011-09-13 Ian Lance Taylor <iant@google.com>
1747 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1748 variable external_symbols_offset.
1750 2011-09-12 Ian Lance Taylor <iant@google.com>
1752 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1753 triggered if object has no symbols.
1755 2011-09-09 David S. Miller <davem@davemloft.net>
1757 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1758 (Output_fill_debug_line::do_write): Likewise.
1760 2011-08-29 Cary Coutant <ccoutant@google.com>
1762 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1763 casts to match formatting specs.
1764 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1766 2011-08-26 Cary Coutant <ccoutant@google.com>
1768 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1769 remaining hole size when allocating.
1770 (Layout::make_output_section): Set fill methods for debug sections.
1771 * layout.h (Free_list::Free_list_node): Move from private to
1773 (Free_list::set_min_hole_size): New function.
1774 (Free_list::begin, Free_list::end): New functions.
1775 (Free_list::min_hole_): New data member.
1776 * output.cc: Include dwarf.h.
1777 (Output_fill_debug_info::do_minimum_hole_size): New function.
1778 (Output_fill_debug_info::do_write): New function.
1779 (Output_fill_debug_line::do_minimum_hole_size): New function.
1780 (Output_fill_debug_line::do_write): New function.
1781 (Output_section::Output_section): Initialize new data member.
1782 (Output_section::set_final_data_size): Ensure patch space is larger
1783 than minimum hole size.
1784 (Output_section::do_write): Fill holes in debug sections.
1785 * output.h (Output_fill): New class.
1786 (Output_fill_debug_info): New class.
1787 (Output_fill_debug_line): New class.
1788 (Output_section::set_free_space_fill): New function.
1789 (Output_section::free_space_fill_): New data member.
1790 * testsuite/Makefile.am (incremental_test_3): Add
1791 --incremental-patch option.
1792 (incremental_test_4): Likewise.
1793 (incremental_test_5): Likewise.
1794 (incremental_test_6): Likewise.
1795 (incremental_copy_test): Likewise.
1796 (incremental_common_test_1): Likewise.
1797 * testsuite/Makefile.in: Regenerate.
1799 2011-08-26 Nick Clifton <nickc@redhat.com>
1801 * po/es.po: Updated Spanish translation.
1803 2011-08-01 Cary Coutant <ccoutant@google.com>
1805 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1806 * gold/testsuite/Makefile.in: Regenerate.
1807 * gold/testsuite/justsyms_exec.c: New source file.
1808 * gold/testsuite/justsyms_lib.c: New source file.
1810 2011-08-01 Cary Coutant <ccoutant@google.com>
1812 * layout.cc (Layout::set_segment_offsets): Don't realign text
1813 segment if -Ttext was specified.
1814 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1816 * object.h (Sized_relobj_file::e_type): New function.
1817 (Sized_relobj_file::e_type_): New data member.
1818 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1819 base address for ET_EXEC files.
1820 * target.cc (Target::do_make_elf_object_implementation): Allow
1821 ET_EXEC files with --just-symbols option.
1823 2011-07-28 Cary Coutant <ccoutant@google.com>
1825 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1826 Add thread_number parameter.
1827 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1828 * workqueue-threads.cc
1829 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1830 current thread if its thread number is greater than desired thread
1832 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1833 Add thread_number parameter.
1834 (Workqueue::should_cancel_thread): Likewise.
1835 (Workqueue::find_runnable_or_wait): Pass thread_number to
1836 should_cancel_thread.
1837 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1840 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1842 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1843 only after checking if it cannot be forced local.
1844 * symtab.h (is_externally_visible): Check if the symbol is not forced
1847 2011-07-15 Ian Lance Taylor <iant@google.com>
1849 * options.h (class General_options): Add --print-output-format.
1850 Move -EL next to -EB, for better --help output.
1851 * target-select.cc: Include <cstdio>, "options.h", and
1853 (Target_selector::do_target_bfd_name): New function.
1854 (print_output_format): New function.
1855 * target-select.h (class Target_selector): Update declarations.
1856 (Target_selector::target_bfd_name): New function.
1857 (print_output_format): Declare.
1858 * main.cc: Include "target-select.h".
1859 (main): Handle --print-output-format.
1860 * gold.cc: Include "target-select.h".
1861 (queue_initial_tasks): Handle --print-output-format when there are
1863 * parameters.cc (parameters_force_valid_target): Give a better
1864 error message if -EB/-EL does not match target.
1865 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1868 2011-07-15 Ian Lance Taylor <iant@google.com>
1870 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1871 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1872 (Output_data_plt_i386::do_write): Write address of .dynamic
1873 section to first entry in .got.plt section.
1874 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1875 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1877 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1878 section to first entry in .got.plt section.
1879 * layout.h (Layout::dynamic_section): New function.
1881 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1883 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1885 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1886 input_section_position_, and input_section_glob_.
1887 (read_layout_from_file): Call function section_ordering_specified.
1888 * layout.h (is_section_ordering_specified): New function.
1889 (section_ordering_specified): New function.
1890 (section_ordering_specified_): New boolean member.
1891 * main.cc(main): Call load_plugins after layout object is defined.
1892 * output.cc (Output_section::add_input_section): Use
1893 function section_ordering_specified to check if section ordering is
1895 * output.cc (Output_section::add_relaxed_input_section): Use
1896 function section_ordering_specified to check if section ordering is
1898 (Output_section::update_section_layout): New function.
1899 (Output_section::sort_attached_input_sections): Check if input section
1901 * output.h (Output_section::update_section_layout): New function.
1902 * plugin.cc (get_section_count): New function.
1903 (get_section_type): New function.
1904 (get_section_name): New function.
1905 (get_section_contents): New function.
1906 (update_section_order): New function.
1907 (allow_section_ordering): New function.
1908 (Plugin::load): Add the new interfaces to the transfer vector.
1909 (Plugin_manager::load_plugins): New parameter.
1910 (Plugin_manager::all_symbols_read): New parameter.
1911 (Plugin_manager::claim_file): New parameter. Save the elf object for
1913 (Plugin_manager::get_elf_object): New function.
1914 (Plugin_manager::get_view): Change to directly use the bool to check
1915 if get_view is called from claim_file_hook.
1916 * plugin.h (input_objects): New function
1917 (Plugin__manager::load_plugins): New parameter.
1918 (Plugin_manager::claim_file): New parameter.
1919 (Plugin_manager::get_elf_object): New function.
1920 (Plugin_manager::in_claim_file_handler): New function.
1921 (Plugin_manager::in_claim_file_handler_): New member.
1922 (layout): New function.
1923 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1924 handler with an extra parameter. Make the elf object before calling
1926 * testsuite/plugin_test.c (get_section_count): New function pointer.
1927 (get_section_type): New function pointer.
1928 (get_section_name): New function pointer.
1929 (get_section_contents): New function pointer.
1930 (update_section_order): New function pointer.
1931 (allow_section_ordering): New function pointer.
1932 (onload): Check if the new interfaces exist.
1934 2011-07-13 Ian Lance Taylor <iant@google.com>
1936 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1938 * x86_64.cc (Target_x86_64::got_section): Likewise.
1939 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1940 (relro_now_test_SOURCES): New variable.
1941 (relro_now_test_DEPENDENCIES): New variable.
1942 (relro_now_test_LDFLAGS): New variable.
1943 (relro_now_test_LDADD): New variable.
1944 (relro_now_test.so): New target.
1945 * testsuite/Makefile.in: Rebuild.
1947 2011-07-12 Ian Lance Taylor <iant@google.com>
1950 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1951 GLOB_DAT relocation rather than a RELATIVE relocation for a
1952 protected symbol when creating a shared library.
1953 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1954 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1955 * testsuite/protected_main_1.cc (main): Test that protected
1956 function has same address.
1958 2011-07-11 Ian Lance Taylor <iant@google.com>
1961 * options.h (class General_options): Add -Bgroup.
1962 * options.cc (General_options::finalize): If -Bgroup is set,
1963 default to --unresolved-symbols=report-all.
1964 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1965 * target-reloc.h (issue_undefined_symbol_error): Handle
1966 --unresolved-symbols=report-all.
1968 2011-07-08 Ian Lance Taylor <iant@google.com>
1971 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1972 if linker script discards key sections.
1973 (Layout::create_dynamic_symtab): Likewise.
1974 (Layout::assign_local_dynsym_offsets): Likewise.
1975 (Layout::sized_create_version_sections): Likewise.
1976 (Layout::create_interp): Likewise.
1977 (Layout::finish_dynamic_section): Likewise.
1978 (Layout::set_dynamic_symbol_size): Likewise.
1980 2011-07-08 Ian Lance Taylor <iant@google.com>
1983 * options.h (class General_options): Add --unresolved-symbols.
1984 * target-reloc.h (issue_undefined_symbol_error): Check
1985 --unresolved-symbols. Add comments.
1987 2011-07-08 Ian Lance Taylor <iant@google.com>
1989 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1990 expression more complex.
1992 2011-07-08 Ian Lance Taylor <iant@google.com>
1995 * target-reloc.h (issue_undefined_symbol_error): New inline
1996 function, broken out of relocate_section.
1997 (relocate_section): Call issue_undefined_symbol_error.
1998 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1999 there is no TLS segment if we are about to issue an undefined
2001 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2003 2011-07-08 Ian Lance Taylor <iant@google.com>
2006 * resolve.cc (Symbol_table::should_override): Add fromtype
2007 parameter. Change all callers. Give error when linking together
2008 TLS and non-TLS symbol.
2009 (Symbol_table::should_override_with_special): Add fromtype
2010 parameter. Change all callers.
2011 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2012 there is no TLS segment if we have reported some errors.
2013 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2015 2011-07-08 Ian Lance Taylor <iant@google.com>
2018 * target.h (Target::plt_address_for_global): New function.
2019 (Target::plt_address_for_local): New function.
2020 (Target::plt_section_for_global): Remove.
2021 (Target::plt_section_for_local): Remove.
2022 (Target::do_plt_address_for_global): New virtual function.
2023 (Target::do_plt_address_for_local): New virtual function.
2024 (Target::do_plt_section_for_global): Remove.
2025 (Target::do_plt_section_for_local): Remove.
2026 (Target::register_global_plt_entry): Add Symbol_table and Layout
2028 * output.cc (Output_data_got::Got_entry::write): Use
2029 plt_address_for_global and plt_address_for_local.
2030 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2031 address of output section.
2032 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2033 got_irelative_, and irelative_count_ fields. Update
2035 (Output_data_plt_i386::has_irelative_section): New function.
2036 (Output_data_plt_i386::entry_count): Add irelative_count_.
2037 (Output_data_plt_i386::set_final_data_size): Likewise.
2038 (class Target_i386): Add got_irelative_ and rel_irelative_
2039 fields. Update declarations.
2040 (Target_i386::Target_i386): Initialize new fields.
2041 (Target_i386::do_plt_address_for_global): New function replacing
2042 do_plt_section_for_global.
2043 (Target_i386::do_plt_address_for_local): New function replacing
2044 do_plt_section_for_local.
2045 (Target_i386::got_section): Create got_irelative_.
2046 (Target_i386::rel_irelative_section): New function.
2047 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2048 fields. Don't define __rel_iplt_{start,end}.
2049 (Output_data_plt_i386::add_entry): Add symtab and layout
2050 parameters. Change all callers. Use different PLT and GOT for
2052 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2053 layout parameters. Change all callers. Use different PLT and
2055 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2056 (Output_data_plt_i386::rel_irelative): New function.
2057 (Output_data_plt_i386::address_for_global): New function.
2058 (Output_data_plt_i386::address_for_local): New function.
2059 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2060 IRELATIVE GOT when changing IFUNC GOT entries.
2061 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2063 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2064 if we didn't create an IRELATIVE GOT.
2065 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2066 plt_address_for_local.
2067 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2068 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2069 got_irelative_, and irelative_count_ fields. Update
2071 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2072 Initialize new fields. Remove symtab parameter. Change all
2074 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2076 (Output_data_plt_x86_64::has_irelative_section): New function.
2077 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2078 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2079 fields. Update declarations.
2080 (Target_x86_64::Target_x86_64): Initialize new fields.
2081 (Target_x86_64::do_plt_address_for_global): New function replacing
2082 do_plt_section_for_global.
2083 (Target_x86_64::do_plt_address_for_local): New function replacing
2084 do_plt_section_for_local.
2085 (Target_x86_64::got_section): Create got_irelative_.
2086 (Target_x86_64::rela_irelative_section): New function.
2087 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2088 all callers. Don't create __rel_iplt_{start,end}.
2089 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2090 parameters. Change all callers. Use different PLT and GOT for
2092 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2093 layout parameters. Change all callers. Use different PLT and
2095 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2096 parameters. Change all callers. Use different PLT and GOT for
2098 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2099 (Output_data_plt_x86_64::rela_irelative): New function.
2100 (Output_data_plt_x86_64::address_for_global): New function.
2101 (Output_data_plt_x86_64::address_for_local): New function.
2102 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2103 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2104 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2105 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2107 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2109 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2110 symbols if we didn't create an IRELATIVE GOT.
2111 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2112 plt_address_for_local.
2113 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2114 * testsuite/ifuncvar1.c: New test file.
2115 * testsuite/ifuncvar2.c: New test file.
2116 * testsuite/ifuncvar3.c: New test file.
2117 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2118 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2119 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2120 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2121 * testsuite/Makefile.in: Rebuild.
2123 2011-07-07 Cary Coutant <ccoutant@google.com>
2125 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2126 (two_file_test_1_ndebug.o): Likewise.
2127 (two_file_test_1b_ndebug.o): Likewise.
2128 (two_file_test_2_ndebug.o): Likewise.
2129 (two_file_test_main_ndebug.o): Likewise.
2130 (incremental_test_2): Link with no-debug versions.
2132 2011-07-06 Cary Coutant <ccoutant@google.com>
2134 * gold/incremental.cc
2135 (Output_section_incremental_inputs::write_info_blocks): Check for
2136 hidden and internal symbols.
2138 2011-07-06 Cary Coutant <ccoutant@google.com>
2140 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2141 Check disposition for startup file.
2142 (Incremental_inputs::report_command_line): Ignore
2143 --incremental-startup-unchanged option.
2144 * options.cc (General_options::parse_incremental_startup_unchanged):
2146 (General_options::General_options): Initialize new data member.
2147 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2148 (General_options): Add --incremental-startup-unchanged option.
2149 (General_options::incremental_startup_disposition): New function.
2150 (General_options::incremental_startup_disposition_): New data member.
2152 2011-07-06 Cary Coutant <ccoutant@google.com>
2154 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2155 input file index to Script_info ctor.
2156 (Sized_incremental_binary::do_file_has_changed): Find the
2157 command-line argument for files named in scripts.
2158 * incremental.h (Script_info::Script_info): New ctor
2159 with input file index.
2160 (Script_info::input_file_index): New function.
2161 (Script_info::input_file_index_): New data member.
2162 (Incremental_binary::get_library): Add const.
2163 (Incremental_binary::get_script_info): Add const.
2164 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2165 * testsuite/Makefile.am (incremental_test_5): New test case.
2166 (incremental_test_6): New test case.
2167 * testsuite/Makefile.in: Regenerate.
2169 2011-07-06 Cary Coutant <ccoutant@google.com>
2171 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2172 debug output when command lines differ.
2174 2011-07-06 Cary Coutant <ccoutant@google.com>
2176 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2177 --incremental-patch option.
2178 * layout.cc (Free_list::allocate): Extend allocation beyond original
2180 (Layout::make_output_section): Mark sections that should get
2182 * options.cc (parse_percent): New function.
2183 * options.h (parse_percent): New function.
2184 (DEFINE_percent): New macro.
2185 (General_options): Add --incremental-patch option.
2186 * output.cc (Output_section::Output_section): Initialize new data
2188 (Output_section::add_input_section): Print section name when out
2190 (Output_section::add_output_section_data): Likewise.
2191 (Output_section::set_final_data_size): Add patch space when
2192 doing --incremental-full.
2193 (Output_section::do_reset_address_and_file_offset): Remove patch
2195 (Output_segment::set_section_list_addresses): Print debug output
2196 only if --incremental-update.
2197 * output.h (Output_section::set_is_patch_space_allowed): New function.
2198 (Output_section::is_patch_space_allowed_): New data member.
2199 (Output_section::patch_space_): New data member.
2200 * parameters.cc (Parameters::incremental_full): New function.
2201 * parameters.h (Parameters::incremental_full): New function
2202 * testsuite/Makefile.am (incremental_test_2): Add test for
2203 --incremental-patch option.
2204 * testsuite/Makefile.in: Regenerate.
2205 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2206 (t18): Remove function body.
2208 2011-07-05 Doug Kwan <dougkwan@google.com>
2211 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2212 Arm_Address type for relocation result.
2213 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2215 (Arm_relocate_functions::abs32): Use unaligned access.
2216 (Arm_relocate_functions::rel32): Ditto.
2217 (Arm_relocate_functions::prel31): Ditto.
2218 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2219 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2220 static data relocations.
2221 * testsuite/Makefile.in: Regnerate.
2222 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2224 2011-07-05 Ian Lance Taylor <iant@google.com>
2227 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2228 symbols if necessary.
2229 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2231 2011-07-05 Ian Lance Taylor <iant@google.com>
2234 * resolve.cc (Symbol::override_base_with_special): Simply override
2235 version with special symbol version, ignoring previous version.
2237 2011-07-05 Ian Lance Taylor <iant@google.com>
2239 * object.cc (Sized_relobj_file::include_section_group): Add
2240 information to comment about signature location.
2242 2011-07-02 Ian Lance Taylor <iant@google.com>
2245 * options.h (class General_options): Add -f and -F.
2246 * options.cc (General_options::finalize): Fatal error if -f/-F
2247 are used without -shared.
2248 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2250 2011-07-02 Ian Lance Taylor <iant@google.com>
2252 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2254 2011-07-01 Ian Lance Taylor <iant@google.com>
2258 * resolve.cc (Symbol::override_base_with_special): Don't override
2259 the version if the overriding symbol has a different name.
2260 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2261 all callers. If we give an error about an undefined version,
2262 define the base version if necessary.
2263 * dynobj.h (class Versions): Update declaration.
2264 * testsuite/weak_alias_test_5.cc: New file.
2265 * testsuite/weak_alias_test.script: New file.
2266 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2267 and versioned_alias have the right value, and call t2.
2268 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2269 weak_alias_test_5.so.
2270 (weak_alias_test_LDADD): Likewise.
2271 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2272 * testsuite/Makefile.in: Rebuild.
2274 2011-07-01 Ian Lance Taylor <iant@google.com>
2277 * options.h (class General_options): Support -z notext.
2278 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2280 (two_file_shared_nonpic.so): Likewise.
2281 (two_file_shared_mixed.so): Likewise.
2282 (two_file_shared_mixed_1.so): Likewise.
2283 (weak_undef_lib_nonpic.so): Likewise.
2284 (alt/weak_undef_lib_nonpic.so): Likewise.
2285 (tls_test_shared_nonpic.so): Likewise.
2286 * testsuite/Makefile.in: Rebuild.
2288 2011-07-01 Ian Lance Taylor <iant@google.com>
2291 * configure.ac: Test whether static linking works, setting
2292 the automake conditional HAVE_STATIC.
2293 * testsuite/Makefile.am: Disable tests using -static if
2294 HAVE_STATIC is not true.
2295 * configure, testsuite/Makefile.in: Rebuild.
2297 2011-07-01 Ian Lance Taylor <iant@google.com>
2300 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2301 Assert if we see DW_EH_PE_indirect.
2302 * target.h (Target::ehframe_datarel_base): New function.
2303 (Target::do_ehframe_datarel_base): New target function.
2304 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2305 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2308 2011-07-01 Ian Lance Taylor <iant@google.com>
2311 * options.h (class General_options): Add
2312 --ld-generated-unwind-info.
2313 * ehframe.cc (Fde::write): Add address parameter. Change all
2314 callers. If associated with PLT, fill in address and size.
2315 (Cie::set_output_offset): Only add merge mapping if there is an
2317 (Cie::write): Add address parameter. Change all callers.
2318 (Eh_frame::add_ehframe_for_plt): New function.
2319 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2320 input_offset_ fields into union u_, with new plt field.
2321 (Fde::Fde): Adjust for new union field.
2322 (Fde::Fde) [Output_data version]: New constructor.
2323 (Fde::add_mapping): Only add merge mapping if there is an object.
2324 (class Cie): Update declarations.
2325 (class Eh_frame): Declare add_ehframe_for_plt.
2326 * layout.cc (Layout::layout_eh_frame): Break out code into
2327 make_eh_frame_section, and call it.
2328 (Layout::make_eh_frame_section): New function.
2329 (Layout::add_eh_frame_for_plt): New function.
2330 * layout.h (class Layout): Update declarations.
2331 * merge.cc (Merge_map::add_mapping): Add assertion.
2332 * i386.cc: Include "dwarf.h".
2333 (class Output_data_plt_i386): Make first_plt_entry,
2334 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2335 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2336 and plt_eh_frame_fde.
2337 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2338 boundary. Call add_eh_frame_for_plt if appropriate.
2339 * x86_64.cc: Include "dwarf.h".
2340 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2341 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2342 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2343 and plt_eh_frame_fde.
2344 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2347 2011-06-29 Ian Lance Taylor <iant@google.com>
2350 * object.cc (Sized_relobj_file::layout_section): Change shdr
2351 parameter to be const.
2352 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2354 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2355 appropriate. Call layout_eh_frame_section.
2356 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2358 * object.h (class Sized_relobj_file): Update declarations.
2360 2011-06-29 Ian Lance Taylor <iant@google.com>
2363 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2365 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2367 2011-06-29 Ian Lance Taylor <iant@google.com>
2370 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2372 * layout.cc (Layout::layout_eh_frame): Likewise.
2374 2011-06-29 Ian Lance Taylor <iant@google.com>
2377 * layout.cc (Layout::symtab_section_shndx): New function.
2378 * layout.h (class Layout): Declare symtab_section_shndx.
2379 * output.cc (Output_section::write_header): Call it.
2381 2011-06-29 Ian Lance Taylor <iant@google.com>
2384 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2385 symbols which are not used in a relocation.
2387 2011-06-28 Ian Lance Taylor <iant@google.com>
2390 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2391 script create indistinguishable segments.
2392 (Layout::set_segment_offsets): Use stable_sort when sorting
2393 segments. Pass this to Compare_segments constructor.
2394 * layout.h (class Layout): Make segment_precedes non-static.
2395 (class Compare_segments): Change from struct to class. Add
2396 layout_ field. Add constructor.
2397 * script-sections.cc
2398 (Script_sections::attach_sections_using_phdrs_clause): Rename
2399 local orphan to is_orphan. Don't report failure to put empty
2400 section in segment. On attachment failure, report name of
2401 section, and attach to first PT_LOAD segment.
2403 2011-06-28 Ian Lance Taylor <iant@google.com>
2406 * target-select.cc (Target_selector::Target_selector): Add
2407 emulation parameter. Change all callers.
2408 (select_target_by_bfd_name): Rename from select_target_by_name.
2410 (select_target_by_emulation): New function.
2411 (supported_emulation_names): New function.
2412 * target-select.h (class Target_selector): Add emulation_ field.
2413 Update declarations.
2414 (Target_selector::recognize_by_bfd_name): Rename from
2415 recognize_by_name. Change all callers.
2416 (Target_selector::supported_bfd_names): Rename from
2417 supported_names. Change all callers.
2418 (Target_selector::recognize_by_emulation): New function.
2419 (Target_selector::supported_emulations): New function.
2420 (Target_selector::emulation): New function.
2421 (Target_selector::do_recognize_by_bfd_name): Rename from
2422 do_recognize_by_name. Change all callers.
2423 (Target_selector::do_supported_bfd_names): Rename from
2424 do_supported_names. Change all callers.
2425 (Target_selector::do_recognize_by_emulation): New function.
2426 (Target_selector::do_supported_emulations): New function.
2427 (select_target_by_bfd_name): Change name in declaration.
2428 (select_target_by_emulation): Declare.
2429 (supported_emulation_names): Declare.
2430 * parameters.cc (parameters_force_valid_target): Try to find
2431 target based on emulation from -m option.
2432 * options.h (class General_options): Change doc string for -m.
2433 * options.cc (help): Print emulations.
2434 (General_options::parse_V): Likewise.
2435 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2436 Add emulation parameter. Change all callers.
2438 2011-06-28 Ian Lance Taylor <iant@google.com>
2440 * target.h (class Target): Add osabi_ field.
2441 (Target::osabi): New function.
2442 (Target::set_osabi): New function.
2443 (Target::Target): Initialize osabi_.
2444 (Target::do_adjust_elf_header): Make pure virtual.
2445 (Sized_target::do_adjust_elf_header): Declare.
2446 * target.cc (Sized_target::do_adjust_elf_header): New function.
2447 (class Sized_target): Instantiate all versions.
2448 * freebsd.h (class Target_freebsd): Remove.
2449 (Target_selector_freebsd::do_recognize): Call set_osabi on
2451 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2452 (Target_selector_freebsd::set_osabi): Remove.
2453 * i386.cc (class Target_i386): Inherit from Sized_target rather
2454 than Target_freebsd.
2455 * x86_64.cc (class Target_x86_64): Likewise.
2457 2011-06-28 Ian Lance Taylor <iant@google.com>
2459 * target.h (Target::can_check_for_function_pointers): Rewrite.
2461 (Target::can_icf_inline_merge_sections): Likewise.
2462 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2463 (Target::Target_info): Add can_icf_inline_merge_sections field.
2464 (Target::do_can_check_for_function_pointers): New virtual
2466 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2467 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2468 from can_check_for_function_pointers, move in file.
2469 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2470 section_may_have_icf_unsafe_poineters, move in file.
2471 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2472 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2473 Rename from can_check_for_function_pointers, move in file.
2474 (Target_i386::can_icf_inline_merge_sections): Remove.
2475 (Target_i386::i386_info): Initialize
2476 can_icf_inline_merge_sections.
2477 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2478 Initialize can_icf_inline_merge_sections.
2479 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2480 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2481 Rename from can_check_for_function_pointers, move in file.
2482 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2483 (Target_x86_64::x86_64_info): Initialize
2484 can_icf_inline_merge_sections.
2485 * testsuite/testfile.cc (Target_test::test_target_info):
2487 * icf.cc (get_section_contents): Correct formatting.
2489 2011-06-27 Ian Lance Taylor <iant@google.com>
2491 * symtab.cc (Symbol::versioned_name): New function.
2492 (Symbol_table::add_to_final_symtab): Use versioned_name when
2494 (Symbol_table::sized_write_symbol): Likewise.
2495 * symtab.h (class Symbol): Declare versioned_name.
2496 * stringpool.h (class Stringpool_template): Add variant of add
2497 which takes a std::basic_string.
2498 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2499 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2500 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2501 (ver_test_12.o): New target.
2502 * testsuite/Makefile.in: Rebuild.
2504 2011-06-27 Doug Kwan <dougkwan@google.com>
2506 * arm.cc (Arm_relocate_functions::thm_jump8,
2507 Arm_relocate_functions::thm_jump11): Use a wider signed
2508 type to compute offset.
2509 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2511 * testsuite/Makefile.in: Regenerate.
2512 * testsuite/arm_branch_in_range.sh: Check test results of
2513 arm_thm_jump11 and arm_thm_jump8.
2514 * testsuite/arm_thm_jump11.s: New test source file.
2515 * testsuite/arm_thm_jump11.t: New linker script.
2516 * testsuite/arm_thm_jump8.s: New test source file.
2517 * testsuite/arm_thm_jump8.t: New linker script.
2519 2011-06-24 Ian Lance Taylor <iant@google.com>
2521 * layout.cc: Include "object.h".
2522 (ctors_sections_in_init_array): New static variable.
2523 (Layout::is_ctors_in_init_array): New function.
2524 (Layout::layout): Add entry to ctors_sections_in_init_array if
2526 * layout.h (class Layout): Declare is_ctors_in_init_array.
2527 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2528 is_ctors_reverse_view is set.
2529 (Sized_relobj_file::write_sections): Add layout parameter. Change
2530 all callers. Set is_ctors_reverse_view field of View_size.
2531 (Sized_relobj_file::reverse_words): New function.
2532 * object.h (Sized_relobj_file::View_size): Add
2533 is_ctors_reverse_view field.
2534 (class Sized_relobj_file): Update declarations.
2535 * testsuite/initpri3.c: New test.
2536 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2538 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2539 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2540 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2541 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2542 * testsuite/Makefile.in: Rebuild.
2544 2011-06-24 Cary Coutant <ccoutant@google.com>
2546 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2547 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2548 (debug_msg_cdebug.err): New targets.
2549 * testsuite/Makefile.in: Regenerate.
2550 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2551 Fix checks for link with shared library.
2553 2011-06-24 Doug Kwan <dougkwan@google.com>
2555 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2556 skip empty text sections.
2557 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2559 2011-06-22 Ian Lance Taylor <iant@google.com>
2562 * options.h (class General_options): Add --ctors-in-init-array.
2563 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2564 friends as SHT_PROGBITS for merging sections.
2565 (Layout::layout): Remove special handling of .init_array and
2566 friends. Don't sort if doing relocatable link. Sort for .ctors
2567 and .dtors if ctors_in_init_array.
2568 (Layout::make_output_section): Force correct section types for
2569 .init_array and friends. Don't sort if doing relocatable link,
2570 Don't sort .ctors and .dtors if ctors_in_init_array.
2571 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2572 (Layout::output_section_name): Add relobj parameter. Change all
2573 callers. Handle .ctors. and .dtors. in code rather than table.
2574 Handle .ctors and .dtors if ctors_in_init_array.
2575 (Layout::match_file_name): New function, moved from output.cc.
2576 * layout.h (class Layout): Update declarations.
2577 * output.cc: Include "layout.h".
2578 (Input_section_sort_entry::get_priority): New function.
2579 (Input_section_sort_entry::match_file_name): Just call
2580 Layout::match_file_name.
2581 (Output_section::Input_section_sort_init_fini_compare::operator()):
2582 Handle .ctors and .dtors. Sort by explicit priority rather than
2584 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2585 * testsuite/initpri2.c: New test.
2586 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2587 (check_PROGRAMS): Add initpri2.
2588 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2589 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2590 * configure, testsuite/Makefile.in: Rebuild.
2592 2011-06-19 Ian Lance Taylor <iant@google.com>
2595 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2596 .interp section to a PT_INTERP segment even if we have seen a
2597 --dynamic-linker option. Don't do it if we have seen a PHDRS
2598 clause in a linker script.
2599 (Layout::finalize): Don't create a .interp section if we've
2600 already create a PT_INTERP segment.
2601 (Layout::create_interp): Always call choose_output_section (revert
2602 patch of 2011-06-17). Don't create PT_INTERP segment.
2603 * script-sections.cc
2604 (Script_sections::create_note_and_tls_segments): Add a .interp
2605 section to a PT_INTERP segment even if we have seen a
2606 --dynamic-linker option.
2608 2011-06-18 Ian Lance Taylor <iant@google.com>
2610 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2611 merely because a non-PT_LOAD segment has a dynamic reloc.
2613 2011-06-18 Ian Lance Taylor <iant@google.com>
2615 * layout.cc (Layout::finish_dynamic_section): Don't create
2616 DT_FLAGS entry if not needed.
2618 2011-06-18 Ian Lance Taylor <iant@google.com>
2621 * layout.cc (Layout::layout_eh_frame): Correct handling of
2622 writable .eh_frame section.
2624 2011-06-17 Ian Lance Taylor <iant@google.com>
2627 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2628 symbol is redefined with the exact same object and value.
2630 2011-06-17 Ian Lance Taylor <iant@google.com>
2633 * layout.h (class Layout): Add interp_segment_ field.
2634 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2635 (Layout::attach_allocated_section_to_segment): If making shared
2636 library, put .interp section in PT_INTERP segment.
2637 (Layout::finalize): Also call create_interp if -dynamic-linker
2639 (Layout::create_interp): Assert that there is no PT_INTERP
2640 segment. If not using a SECTIONS clause, use make_output_section.
2641 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2642 * script-sections.cc
2643 (Script_sections::create_note_and_tls_segments): If making shared
2644 library, put .interp section in PT_INTERP segment.
2646 2011-06-17 Ian Lance Taylor <iant@google.com>
2648 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2649 when making a shared library.
2651 2011-06-17 Ian Lance Taylor <iant@google.com>
2653 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2654 parameter. Change all callers. Don't issue warning about PC32
2655 against locally defined symbol.
2657 2011-06-16 Ian Lance Taylor <iant@google.com>
2659 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2660 occurs in same object.
2662 2011-06-14 Alan Modra <amodra@gmail.com>
2664 * po/POTFILES.in: Regenerate.
2666 2011-06-09 Ian Lance Taylor <iant@google.com>
2668 * script-sections.cc
2669 (Orphan_output_section::set_section_addresses): For a relocatable
2670 link set address to 0.
2672 2011-06-09 Cary Coutant <ccoutant@google.com>
2675 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2676 used with --compress-debug-sections.
2677 * gold/object.cc (Sized_relobj_file::do_layout): Report
2678 uncompressed size of compressed input sections.
2680 2011-06-08 Cary Coutant <ccoutant@google.com>
2683 * testsuite/two_file_test_2_v1.cc: Change initialization of
2684 v2 to keep it in .data.
2686 2011-06-07 Cary Coutant <ccoutant@google.com>
2688 * common.cc (Symbol_table::do_allocate_commons_list): Call
2690 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2691 (Errors::fallback): New function.
2692 (gold_fallback): New function.
2693 * errors.h (Errors::fallback): New function.
2694 * gold.cc (gold_exit): Change status parameter to enum; adjust
2696 (queue_initial_tasks): Call gold_fallback.
2697 * gold.h: Include cstdlib.
2698 (Exit_status): New enum type.
2699 (gold_exit): Change status parameter to enum.
2700 (gold_fallback): New function.
2701 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2702 (Layout::create_symtab_sections): Likewise.
2703 (Layout::create_shdrs): Likewise.
2704 * main.cc (main): Adjust call to gold_exit.
2705 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2706 (Output_data_got::add_got_entry_pair): Likewise.
2707 (Output_section::add_input_section): Likewise.
2708 (Output_section::add_output_section_data): Likewise.
2709 (Output_segment::set_section_list_addresses): Likewise.
2710 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2712 2011-06-07 Cary Coutant <ccoutant@google.com>
2714 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2715 for incremental links.
2716 * output.cc (Output_segment::set_section_list_addresses): Remove
2717 FIXME and test for TLS or BSS.
2719 2011-06-07 Cary Coutant <ccoutant@google.com>
2721 * testsuite/Makefile.am: Add incremental_copy_test,
2722 incremental_common_test_1.
2723 * testsuite/Makefile.in: Regenerate.
2724 * testsuite/common_test_1_v1.c: New source file.
2725 * testsuite/common_test_1_v2.c: New source file.
2726 * testsuite/copy_test_v1.cc: New source file.
2728 2011-06-07 Cary Coutant <ccoutant@google.com>
2730 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2731 update, allocate common from bss section's free list.
2732 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2733 linker-defined symbols.
2734 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2735 Skip GOT and PLT entries that are no longer referenced.
2736 (Output_section_incremental_inputs::write_info_blocks): Mark
2737 linker-defined symbols.
2738 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2739 * output.cc (Output_section::allocate): New function.
2740 * output.h (Output_section::allocate): New function.
2741 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2742 linker-defined symbols.
2743 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2744 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2745 (Symbol::init_base_output_data): Likewise.
2746 (Symbol::init_base_output_segment): Likewise.
2747 (Symbol::init_base_constant): Likewise.
2748 (Sized_symbol::init_output_data): Likewise.
2749 (Sized_symbol::init_output_segment): Likewise.
2750 (Sized_symbol::init_constant): Likewise.
2751 (Symbol_table::do_define_in_output_data): Likewise.
2752 (Symbol_table::do_define_in_output_segment): Likewise.
2753 (Symbol_table::do_define_as_constant): Likewise.
2754 * symtab.h (Symbol::is_predefined): New function.
2755 (Symbol::init_base_output_data): Add is_predefined parameter.
2756 (Symbol::init_base_output_segment): Likewise.
2757 (Symbol::init_base_constant): Likewise.
2758 (Symbol::is_predefined_): New data member.
2759 (Sized_symbol::init_output_data): Add is_predefined parameter.
2760 (Sized_symbol::init_output_segment): Likewise.
2761 (Sized_symbol::init_constant): Likewise.
2762 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2764 2011-06-07 Cary Coutant <ccoutant@google.com>
2766 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2767 instead of emit_copy_reloc.
2768 (Copy_relocs::emit_copy_reloc): Refactor.
2769 (Copy_relocs::make_copy_reloc): New function.
2770 (Copy_relocs::add_copy_reloc): Remove.
2771 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2773 (Copy_relocs::make_copy_reloc): New function.
2774 (Copy_relocs::add_copy_reloc): Remove.
2775 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2776 unchanged input files.
2777 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2778 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2779 Reserve BSS space for COPY relocations.
2780 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2781 (Output_section_incremental_inputs::write_info_blocks): Record
2782 whether a symbol is copied from a shared object.
2783 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2784 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2785 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2786 (Incremental_input_entry_reader::get_output_symbol_index): Add
2788 (Incremental_binary::emit_copy_relocs): New function.
2789 (Incremental_binary::do_emit_copy_relocs): New function.
2790 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2792 (Sized_incremental_binary::add_copy_reloc): New function.
2793 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2794 (Sized_incremental_binary::Copy_reloc): New struct.
2795 (Sized_incremental_binary::Copy_relocs): New typedef.
2796 (Sized_incremental_binary::copy_relocs_): New data member.
2797 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2798 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2799 * target.h (Sized_target::emit_copy_reloc): New function.
2800 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2802 2011-06-02 Cary Coutant <ccoutant@google.com>
2805 * gold/archive.cc (Archive::Archive): Initialize new data member.
2806 (Archive::include_all_members): Return if archive has already been
2808 * gold/archive.h (Archive::include_all_members_): New data member.
2810 2011-06-02 Nick Clifton <nickc@redhat.com>
2812 * dynobj.h: Fix spelling mistake in comment.
2813 * output.cc: Likewise.
2815 2011-05-31 Doug Kwan <dougkwan@google.com>
2819 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2820 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2821 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2822 redundant arm_exidx_test.so.
2823 * testsuite/Makefile.in: Regenerate.
2824 (check_SCRIPTS): Add pr12826.sh
2825 (check_DATA): Add pr12826.stdout
2826 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2827 * testsuite/pr12826.sh: New file.
2828 * testsuite/pr12826_1.s: Ditto.
2829 * testsuite/pr12826_1.s: Ditto.
2831 2011-05-30 Ian Lance Taylor <iant@google.com>
2833 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2836 2011-05-29 Ian Lance Taylor <iant@google.com>
2839 * testsuite/Makefile.am: Use different file name for two_file_test
2840 temporary file for each incremental test.
2841 * testsuite/Makefile.in: Rebuild.
2843 2011-05-29 Ian Lance Taylor <iant@google.com>
2845 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2846 binary input file is empty.
2848 2011-05-27 Ian Lance Taylor <iant@google.com>
2850 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2851 (ver_test_9.so): Likewise.
2852 * testsuite/Makefile.in: Rebuild.
2854 2011-05-26 Cary Coutant <ccoutant@google.com>
2856 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2857 * incremental.cc (Incremental_inputs::report_input_section): Fix
2858 comment, indentation.
2859 (Incremental_inputs::report_comdat_group): New function.
2860 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2861 of data for incremental input file entry.
2862 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2863 group count, COMDAT group signatures.
2864 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2865 an unchanged input file.
2866 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2867 Initialize new data member.
2868 (Incremental_object_entry::add_comdat_group): New function.
2869 (Incremental_object_entry::get_comdat_group_count): New function.
2870 (Incremental_object_entry::get_comdat_signature_key): New function.
2871 (Incremental_object_entry::groups_): New data member.
2872 (Incremental_inputs::report_comdat_group): New function.
2873 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2874 data for incremental input file entry.
2875 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2876 (Incremental_input_entry_reader::get_input_section): Adjust size of
2877 data for incremental input file entry.
2878 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2879 (Incremental_input_entry_reader::get_comdat_group_signature): New
2881 * object.cc (Sized_relobj::include_section_group): Report kept
2882 COMDAT groups for incremental links.
2884 2011-05-24 David Meyer <pdox@google.com>
2886 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2887 with name parameter. Add found_name parameter.
2888 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2889 * dirsearch.h (class Dirsearch): Update declaration.
2891 2011-05-24 Ian Lance Taylor <iant@google.com>
2893 * archive.cc (Library_base::should_include_member): Pull in object
2894 from archive if it defines the entry symbol.
2895 * parameters.cc (Parameters::entry): New function.
2896 * parameters.h (class Parameters): Declare entry.
2897 * output.h (class Output_file_header): Remove entry_ field.
2898 * output.cc (Output_file_header::Output_file_header): Remove entry
2899 parameter. Change all callers.
2900 (Output_file_header::entry): Use parameters->entry.
2901 * gold.cc (queue_middle_tasks): Likewise.
2902 * plugin.cc (Plugin_hook::run): Likewise.
2904 2011-05-24 Cary Coutant <ccoutant@google.com>
2906 * gold.cc (queue_initial_tasks): Pass incremental base filename
2907 to Output_file::open_base_file; don't print error message.
2908 * incremental-dump.cc (main): Adjust call to
2909 Output_file::open_for_modification.
2910 * incremental-dump.cc (main): Likewise.
2911 * incremental.cc (Incremental_inputs::report_command_line):
2912 Ignore --incremental-base option when comparing command lines.
2913 Ignore parameter when given as separate argument.
2914 * options.h (class General_options): Add --incremental-base.
2915 * output.cc (Output_file::Output_file):
2916 (Output_file::open_base_file): Add base_name and writable parameters;
2917 read base file into new file; print error message here.
2918 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2920 * output.h (Output_file::open_for_modification): Rename to...
2921 (Output_file::open_base_file): ...this; add base_name and
2922 writable parameters; adjust all callers.
2923 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2925 * testsuite/Makefile.am (incremental_test_4): Test
2927 * testsuite/Makefile.in: Regenerate.
2929 2011-05-24 Cary Coutant <ccoutant@google.com>
2931 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2933 * testsuite/Makefile.in: Regenerate.
2934 * testsuite/two_file_test_1_v1.cc: New test source file.
2935 * testsuite/two_file_test_1b_v1.cc: New test source file.
2936 * testsuite/two_file_test_2_v1.cc: New test source file.
2938 2011-05-24 Cary Coutant <ccoutant@google.com>
2940 * dynobj.h (Dynobj::do_dynobj): New function.
2941 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2942 flag and soname for shared objects.
2943 * incremental.cc (Incremental_inputs::report_object): Make
2944 either Incremental_object_entry or Incremental_dynobj_entry; add
2945 soname to string table.
2946 (Incremental_inputs::report_input_section): Add assertion.
2947 (Output_section_incremental_inputs::set_final_data_size): Adjust
2948 type of input file entry for shared libraries; adjust size of
2949 shared library info entry.
2950 (Output_section_incremental_inputs::write_input_files): Write
2951 as_needed flag for shared libraries.
2952 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2953 of input file entry for shared libraries; write soname.
2954 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2955 soname from incremental info.
2956 * incremental.h (enum Incremental_input_flags): Add
2957 INCREMENTAL_INPUT_AS_NEEDED.
2958 (Incremental_input_entry::Incremental_input_entry): Initialize new
2960 (Incremental_input_entry::set_as_needed): New function.
2961 (Incremental_input_entry::as_needed): New function.
2962 (Incremental_input_entry::do_dynobj_entry): New function.
2963 (Incremental_input_entry::as_needed_): New data member.
2964 (Incremental_object_entry::Incremental_object_entry): Don't check
2966 (Incremental_object_entry::do_type): Likewise.
2967 (class Incremental_dynobj_entry): New class.
2968 (Incremental_input_entry_reader::as_needed): New function.
2969 (Incremental_input_entry_reader::get_soname): New function.
2970 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2971 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2972 size of shared library info entry.
2973 * layout.cc (Layout::finish_dynamic_section): Don't test for
2974 incremental link when adding DT_NEEDED entries.
2975 * object.h (Object::Object): Initialize new data member.
2976 (Object::dynobj): New function.
2977 (Object::set_as_needed): New function.
2978 (Object::as_needed): New function.
2979 (Object::do_dynobj): New function.
2980 (Object::as_needed_): New data member.
2982 2011-05-24 Cary Coutant <ccoutant@google.com>
2984 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2985 info; adjust display of GOT entries.
2986 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2987 vector of input objects; remove file_status_.
2988 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2989 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2990 got_plt reader; call target hooks to reserve GOT entries.
2991 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2992 of input file info header and GOT info entry.
2993 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2995 (Got_plt_view_info::got_descriptor): Remove.
2996 (Got_plt_view_info::sym_index): New data member.
2997 (Got_plt_view_info::input_index): New data member.
2998 (Local_got_offset_visitor::visit): Write input file index.
2999 (Global_got_offset_visitor::visit): Write 0 for input file index.
3000 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3001 with sym_index and input_index.
3002 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3003 incremental info GOT entry; replace got_descriptor with input_index.
3004 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3005 map from input file index to object.
3006 (Sized_relobj_incr::do_layout): Replace direct data member reference
3007 with accessor function.
3008 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3009 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3010 Adjust size of input file info header.
3011 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3012 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3013 (Incremental_input_entry_reader::get_input_section): Adjust size of
3014 input file info header.
3015 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3016 of incremental info GOT entry.
3017 (Incremental_got_plt_reader::get_got_desc): Remove.
3018 (Incremental_got_plt_reader::get_got_symndx): New function.
3019 (Incremental_got_plt_reader::get_got_input_index): New function.
3020 (Sized_incremental_binary::Sized_incremental_binary): Remove
3021 file_status_; add input_objects_.
3022 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3023 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3024 (Sized_incremental_binary::file_is_unchanged): Remove.
3025 (Sized_incremental_binary::set_input_object): New function.
3026 (Sized_incremental_binary::input_object): New function.
3027 (Sized_incremental_binary::file_status_): Remove.
3028 (Sized_incremental_binary::input_objects_): New data member.
3029 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3031 (Sized_relobj_incr::invalid_address): Move to base class.
3032 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3034 (Sized_relobj_incr::do_output_section_offset): Likewise.
3035 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3036 (Sized_relobj_incr::section_offsets_): Likewise.
3037 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3039 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3040 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3041 with accessor function.
3042 (Sized_relobj_file::do_layout): Likewise.
3043 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3044 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3045 (Sized_relobj_file::compute_final_local_value): Replace refs to
3046 section_offsets_ with accessor function.
3047 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3048 * object.h (Relobj::Relobj): Initialize new data members.
3049 (Relobj::add_dyn_reloc): New function.
3050 (Relobj::first_dyn_reloc): New function.
3051 (Relobj::dyn_reloc_count): New function.
3052 (Relobj::first_dyn_reloc_): New data member.
3053 (Relobj::dyn_reloc_count_): New data member.
3054 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3056 (Sized_relobj::Address): New typedef.
3057 (Sized_relobj::invalid_address): Move here from child class.
3058 (Sized_relobj::Sized_relobj): Initialize new data members.
3059 (Sized_relobj::sized_relobj): New function.
3060 (Sized_relobj::is_output_section_offset_invalid): Move here from
3062 (Sized_relobj::get_output_section_offset): Likewise.
3063 (Sized_relobj::local_has_got_offset): Likewise.
3064 (Sized_relobj::local_got_offset): Likewise.
3065 (Sized_relobj::set_local_got_offset): Likewise.
3066 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3067 (Sized_relobj::clear_got_offsets): New function.
3068 (Sized_relobj::section_offsets): Move here from child class.
3069 (Sized_relobj::do_output_section_offset): Likewise.
3070 (Sized_relobj::do_set_section_offset): Likewise.
3071 (Sized_relobj::Local_got_offsets): Likewise.
3072 (Sized_relobj::local_got_offsets_): Likewise.
3073 (Sized_relobj::section_offsets_): Likewise.
3074 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3076 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3078 (Sized_relobj_file::sized_relobj): New function
3079 (Sized_relobj_file::local_has_got_offset): Move to base class.
3080 (Sized_relobj_file::local_got_offset): Likewise.
3081 (Sized_relobj_file::set_local_got_offset): Likewise.
3082 (Sized_relobj_file::get_output_section_offset): Likewise.
3083 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3084 (Sized_relobj_file::do_output_section_offset): Likewise.
3085 (Sized_relobj_file::do_set_section_offset): Likewise.
3086 (Sized_relobj_file::Local_got_offsets): Likewise.
3087 (Sized_relobj_file::local_got_offsets_): Likewise.
3088 (Sized_relobj_file::section_offsets_): Likewise.
3089 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3091 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3092 (Output_reloc::get_symbol_index): Likewise.
3093 (Output_reloc::local_section_offset): Likewise.
3094 (Output_reloc::get_address): Likewise.
3095 (Output_reloc::symbol_value): Likewise.
3096 (Output_data_got::reserve_slot): Move to class definition.
3097 (Output_data_got::reserve_local): New function.
3098 (Output_data_got::reserve_slot_for_global): Remove.
3099 (Output_data_got::reserve_global): New function.
3100 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3101 (all constructors, two instantiations).
3102 (Output_reloc::get_relobj): New function (two instantiations).
3103 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3104 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3105 (Output_data_reloc::add_global): Adjust type of relobj.
3106 (Output_data_reloc::add_global_relative): Likewise.
3107 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3108 (Output_data_reloc::add_local): Likewise.
3109 (Output_data_reloc::add_local_relative): Likewise.
3110 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3111 (Output_data_reloc::add_local_section): Likewise.
3112 (Output_data_reloc::add_output_section): Likewise.
3113 (Output_data_reloc::add_absolute): Likewise.
3114 (Output_data_reloc::add_target_specific): Likewise.
3115 (Output_data_got::reserve_slot): Move definition here.
3116 (Output_data_got::reserve_local): New function.
3117 (Output_data_got::reserve_global): New function.
3118 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3119 section_offsets_ with accessor function.
3120 (Sized_relobj_file::write_sections): Likewise.
3121 (Sized_relobj_file::do_relocate_sections): Likewise.
3122 * target.h (Sized_target::reserve_local_got_entry): New function.
3123 (Sized_target::reserve_global_got_entry): New function.
3124 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3125 (Target_x86_64::reserve_global_got_entry): New function.
3126 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3128 2011-05-23 Cary Coutant <ccoutant@google.com>
3130 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3131 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3132 bit when checking got_type.
3133 * incremental.cc (Sized_incremental_binary::setup_readers):
3134 Store symbol table and string table locations; initialize bit vector
3135 of file status flags.
3136 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3138 (Sized_incremental_binary::do_process_got_plt): New function.
3139 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3140 (Output_section_incremental_inputs::set_final_data_size): Record
3141 file index for each input file.
3142 (Output_section_incremental_inputs::write_got_plt): Store file index
3143 instead of input entry offset for each GOT entry.
3145 (Incremental_input_entry::Incremental_input_entry): Initialize new
3147 (Incremental_input_entry::set_offset): Store file index.
3148 (Incremental_input_entry::get_file_index): New function.
3149 (Incremental_input_entry::file_index_): New data member.
3150 (Incremental_binary::process_got_plt): New function.
3151 (Incremental_binary::do_process_got_plt): New function.
3152 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3154 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3155 (Sized_incremental_binary::set_file_is_unchanged): New function.
3156 (Sized_incremental_binary::file_is_unchanged): New function.
3157 (Sized_incremental_binary::do_process_got_plt): New function.
3158 (Sized_incremental_binary::file_status_): New data member.
3159 (Sized_incremental_binary::main_symtab_loc_): New data member.
3160 (Sized_incremental_binary::main_strtab_loc_): New data member.
3161 * output.cc (Output_data_got::Got_entry::write): Add case
3163 (Output_data_got::add_global): Call add_got_entry.
3164 (Output_data_got::add_global_plt): Likewise.
3165 (Output_data_got::add_global_with_rel): Likewise.
3166 (Output_data_got::add_global_with_rela): Likewise.
3167 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3168 (Output_data_got::add_global_pair_with_rela): Likewise.
3169 (Output_data_got::add_local): Call add_got_entry.
3170 (Output_data_got::add_local_plt): Likewise.
3171 (Output_data_got::add_local_with_rel): Likewise.
3172 (Output_data_got::add_local_with_rela): Likewise.
3173 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3174 (Output_data_got::add_local_pair_with_rela): Likewise.
3175 (Output_data_got::reserve_slot): New function.
3176 (Output_data_got::reserve_slot_for_global): New function.
3177 (Output_data_got::add_got_entry): New function.
3178 (Output_data_got::add_got_entry_pair): New function.
3179 (Output_section::add_output_section_data): Edit FIXME.
3181 (Output_section_data_build::Output_section_data_build): New
3182 constructor with size parameter.
3183 (Output_data_space::Output_data_space): Likewise.
3184 (Output_data_got::Output_data_got): Initialize new data member; new
3185 constructor with size parameter.
3186 (Output_data_got::add_constant): Call add_got_entry.
3187 (Output_data_got::reserve_slot): New function.
3188 (Output_data_got::reserve_slot_for_global): New function.
3189 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3190 (Output_data_got::add_got_entry): New function.
3191 (Output_data_got::add_got_entry_pair): New function.
3192 (Output_data_got::free_list_): New data member.
3193 * target.h (Sized_target::init_got_plt_for_update): New function.
3194 (Sized_target::register_global_plt_entry): New function.
3195 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3196 Initialize new data member; call init; add constructor with PLT count.
3197 (Output_data_plt_x86_64::init): New function.
3198 (Output_data_plt_x86_64::add_relocation): New function.
3199 (Output_data_plt_x86_64::reserve_slot): New function.
3200 (Output_data_plt_x86_64::free_list_): New data member.
3201 (Target_x86_64::init_got_plt_for_update): New function.
3202 (Target_x86_64::register_global_plt_entry): New function.
3203 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3204 incremental updates.
3205 (Output_data_plt_x86_64::add_relocation): New function.
3206 * testsuite/object_unittest.cc (Object_test): Set default options.
3208 2011-05-16 Ian Lance Taylor <iant@google.com>
3210 * options.h (class General_options): Make -i a synonym for -r.
3212 2011-05-16 Ian Lance Taylor <iant@google.com>
3214 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3216 2011-05-10 Cary Coutant <ccoutant@google.com>
3218 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3221 2011-05-06 Ian Lance Taylor <iant@google.com>
3223 * layout.cc (Layout::layout): If the output section flags change,
3224 update the ordering.
3226 2011-04-25 Cary Coutant <ccoutant@google.com>
3228 * incremental-dump.cc (dump_incremental_inputs): Print local
3229 symbol info for each input file.
3231 (Output_section_incremental_inputs::set_final_data_size): Add local
3232 symbol info to input file entries in incremental info.
3233 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3234 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3235 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3236 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3238 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3239 (Sized_incr_relobj::do_relocate): Write the local symbols.
3240 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3241 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3242 Adjust size of input file header.
3243 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3244 (Incremental_inputs_reader::get_local_symbol_count): New function.
3245 (Incremental_inputs_reader::get_input_section): Adjust size of input
3247 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3248 (Sized_incr_relobj::This): New typedef.
3249 (Sized_incr_relobj::sym_size): New const data member.
3250 (Sized_incr_relobj::Local_symbol): New struct.
3251 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3252 (Sized_incr_relobj::do_local_symbol_offset): New function.
3253 (Sized_incr_relobj::local_symbol_count_): New data member.
3254 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3255 (Sized_incr_relobj::local_symbol_index_): New data member.
3256 (Sized_incr_relobj::local_symbol_offset_): New data member.
3257 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3258 (Sized_incr_relobj::local_symbols_): New data member.
3259 * object.h (Relobj::output_local_symbol_count): New function.
3260 (Relobj::local_symbol_offset): New function.
3261 (Relobj::do_output_local_symbol_count): New function.
3262 (Relobj::do_local_symbol_offset): New function.
3263 (Sized_relobj::do_output_local_symbol_count): New function.
3264 (Sized_relobj::do_local_symbol_offset): New function.
3266 2011-04-22 Vladimir Simonov <sv@sw.ru>
3268 * descriptors.cc (set_close_on_exec): New function.
3269 (Descriptors::open): Use set_close_on_exec.
3270 * output.cc (S_ISLNK): Define if not defined.
3272 2011-04-22 Cary Coutant <ccoutant@google.com>
3274 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3276 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3277 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3278 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3280 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3281 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3282 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3284 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3286 (Incremental_binary::apply_incremental_relocs): New function.
3287 (Incremental_binary::do_apply_incremental_relocs): New function.
3288 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3290 (Sized_incremental_binary::add_global_symbol): New function.
3291 (Sized_incremental_binary::global_symbol): New function.
3292 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3293 (Sized_incremental_binary::symbol_map_): New data member.
3294 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3295 * target.h (Sized_target::apply_relocation): New function.
3296 * target-reloc.h (apply_relocation): New function.
3297 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3299 2011-04-22 Doug Kwan <dougkwan@google.com>
3301 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3302 flag of a SHT_ARM_EXIDX section.
3303 * testsuite/Makefile.am (arm_exidx_test): New test rules.
3304 * testsuite/Makefile.in: Regenerate.
3305 * testsuite/arm_exidx_test.s: New file.
3306 * testsuite/arm_exidx_test.sh: Same.
3308 2011-04-20 Cary Coutant <ccoutant@google.com>
3311 * archive.h (Incremental_archive_entry::Archive_member):
3312 Initialize arg_serial_ (second constructor).
3314 2011-04-17 Ian Lance Taylor <iant@google.com>
3316 * object.cc (Relocate_info::location): Simplify location string.
3317 * errors.cc (Errors::error_at_location): Don't print program
3319 (Errors::warning_at_location): Likewise.
3320 (Errors::undefined_symbol): Likewise.
3321 * testsuite/debug_msg.sh: Update accordingly.
3323 2011-04-14 Cary Coutant <ccoutant@google.com>
3325 * gold/layout.cc (Layout::symtab_section_offset): New function.
3326 * gold/layout.h (Layout::symtab_section_offset): New function.
3327 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3329 2011-04-12 Ian Lance Taylor <iant@google.com>
3331 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3332 with MREMAP_MAYMOVE.
3333 * output.h (class Output_file): Add map_is_allocated_ field.
3334 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3335 not available, provide stubs. If mremap is not available, #define
3337 (MREMAP_MAYMOVE): Define if not defined.
3338 (Output_file::Output_file): Initialize map_is_allocated_.
3339 (Output_file::resize): Check map_is_allocated_.
3340 (Output_file::map_anonymous): If mmap fails, use malloc.
3341 (Output_file::unmap): Don't do anything for an anonymous map.
3342 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3343 is not available, provide stubs.
3344 (File_read::View::~View): Use free rather than delete[].
3345 (File_read::make_view): Use malloc rather than new[]. If mmap
3347 (File_read::find_or_make_view): Use malloc rather than new[].
3348 * gold.h: Remove HAVE_REMAP code.
3349 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3350 exists. Rename mremap to gold_mremap. If mmap is not available
3352 * configure, config.in: Rebuild.
3354 2011-04-11 Ian Lance Taylor <iant@google.com>
3356 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3357 initialize local variable v.
3359 2011-04-11 Cary Coutant <ccoutant@google.com>
3361 * archive.cc (Archive::include_member): Adjust call to
3363 (Add_archive_symbols::run): Track argument serial numbers.
3364 (Lib_group::include_member): Likewise.
3365 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3366 * archive.h (Incremental_archive_entry::Archive_member):
3367 Initialize arg_serial_.
3368 (Archive_member::arg_serial_): New data member.
3369 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3370 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3372 (Sized_dynobj::do_for_all_local_got_entries): New function.
3373 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3375 * fileread.cc (get_mtime): New function.
3376 * fileread.h (get_mtime): New function.
3377 * gold.cc (queue_initial_tasks): Check for incremental update.
3378 (process_incremental_input): New function.
3379 (queue_middle_tasks): Don't force valid target for incremental
3381 * incremental-dump.cc (find_input_containing_global): Adjust
3382 size of symbol info entry.
3383 (dump_incremental_inputs): Dump argument serial number and
3384 in_system_directory flag; bias shndx by 1; print symbol names
3385 when dumping per-file symbol lists; use new symbol info readers.
3387 (Output_section_incremental_inputs:update_data_size): New function.
3388 (Sized_incremental_binary::setup_readers): Setup input readers
3389 for each input file; build maps for files added from libraries
3391 (Sized_incremental_binary::check_input_args): New function.
3392 (Sized_incremental_binary::do_check_inputs): Build map of argument
3393 serial numbers to input arguments.
3394 (Sized_incremental_binary::do_file_has_changed): Rename
3395 do_file_is_unchanged to this; compare file modification times.
3396 (Sized_incremental_binary::do_init_layout): New function.
3397 (Sized_incremental_binary::do_reserve_layout): New function.
3398 (Sized_incremental_binary::do_get_input_reader): Remove.
3399 (Sized_incremental_binary::get_symtab_view): New function.
3400 (Incremental_checker::can_incrementally_link_output_file): Remove.
3401 (Incremental_inputs::report_command_line): Exclude --debug options.
3402 (Incremental_inputs::report_archive_begin): Add parameter; track
3403 argument serial numbers; don't put input file entry for archive
3404 before archive members.
3405 (Incremental_inputs::report_archive_end): Put input file entry
3406 for archive after archive members.
3407 (Incremental_inputs::report_object): Add parameter; track argument
3408 serial numbers and in_system_directory flag.
3409 (Incremental_inputs::report_script): Add parameter; track argument
3411 (Output_section_incremental_inputs::set_final_data_size): Adjust
3412 size of symbol info entry; check for forwarding symbols.
3413 (Output_section_incremental_inputs::write_input_files): Write
3414 in_system_directory flag and argument serial number.
3415 (Output_section_incremental_inputs::write_info_blocks): Map section
3416 indices between incremental info and original input file; store
3417 input section index for each symbol.
3418 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3419 change operator() to visit().
3420 (class Global_got_offset_visitor): Likewise.
3421 (class Global_symbol_visitor_got_plt):
3422 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3424 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3425 (Sized_incr_relobj::do_read_symbols): New function.
3426 (Sized_incr_relobj::do_layout): New function.
3427 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3428 (Sized_incr_relobj::do_add_symbols): New function.
3429 (Sized_incr_relobj::do_should_include_member): New function.
3430 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3431 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3432 (Sized_incr_relobj::do_section_size): New function.
3433 (Sized_incr_relobj::do_section_name): New function.
3434 (Sized_incr_relobj::do_section_contents): New function.
3435 (Sized_incr_relobj::do_section_flags): New function.
3436 (Sized_incr_relobj::do_section_entsize): New function.
3437 (Sized_incr_relobj::do_section_address): New function.
3438 (Sized_incr_relobj::do_section_type): New function.
3439 (Sized_incr_relobj::do_section_link): New function.
3440 (Sized_incr_relobj::do_section_info): New function.
3441 (Sized_incr_relobj::do_section_addralign): New function.
3442 (Sized_incr_relobj::do_initialize_xindex): New function.
3443 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3444 (Sized_incr_relobj::do_read_relocs): New function.
3445 (Sized_incr_relobj::do_gc_process_relocs): New function.
3446 (Sized_incr_relobj::do_scan_relocs): New function.
3447 (Sized_incr_relobj::do_count_local_symbols): New function.
3448 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3449 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3450 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3451 (Sized_incr_relobj::do_relocate): New function.
3452 (Sized_incr_relobj::do_set_section_offset): New function.
3453 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3454 (Sized_incr_dynobj::do_read_symbols): New function.
3455 (Sized_incr_dynobj::do_layout): New function.
3456 (Sized_incr_dynobj::do_add_symbols): New function.
3457 (Sized_incr_dynobj::do_should_include_member): New function.
3458 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3459 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3460 (Sized_incr_dynobj::do_section_size): New function.
3461 (Sized_incr_dynobj::do_section_name): New function.
3462 (Sized_incr_dynobj::do_section_contents): New function.
3463 (Sized_incr_dynobj::do_section_flags): New function.
3464 (Sized_incr_dynobj::do_section_entsize): New function.
3465 (Sized_incr_dynobj::do_section_address): New function.
3466 (Sized_incr_dynobj::do_section_type): New function.
3467 (Sized_incr_dynobj::do_section_link): New function.
3468 (Sized_incr_dynobj::do_section_info): New function.
3469 (Sized_incr_dynobj::do_section_addralign): New function.
3470 (Sized_incr_dynobj::do_initialize_xindex): New function.
3471 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3472 (make_sized_incremental_object): New function.
3473 (Incremental_library::copy_unused_symbols): New function.
3474 (Incremental_library::do_for_all_unused_symbols): New function.
3475 * incremental.h (enum Incremental_input_flags): New type.
3476 (class Incremental_checker): Remove.
3477 (Incremental_input_entry::Incremental_input_entry): Add argument
3479 (Incremental_input_entry::arg_serial): New function.
3480 (Incremental_input_entry::set_is_in_system_directory): New function.
3481 (Incremental_input_entry::is_in_system_directory): New function.
3482 (Incremental_input_entry::arg_serial_): New data member.
3483 (Incremental_input_entry::is_in_system_directory_): New data member.
3484 (class Script_info): Move here from script.h.
3485 (Script_info::Script_info): Add filename parameter.
3486 (Script_info::filename): New function.
3487 (Script_info::filename_): New data member.
3488 (Incremental_script_entry::Incremental_script_entry): Add argument
3490 (Incremental_object_entry::Incremental_object_entry): Likewise.
3491 (Incremental_object_entry::add_input_section): Build list of input
3492 sections with map to original shndx.
3493 (Incremental_object_entry::get_input_section_index): New function.
3494 (Incremental_object_entry::shndx_): New data member.
3495 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3496 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3497 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3499 (Incremental_inputs::report_archive_begin): Likewise.
3500 (Incremental_inputs::report_object): Likewise.
3501 (Incremental_inputs::report_script): Likewise.
3502 (class Incremental_global_symbol_reader): New class.
3503 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3504 and store flags and input file type.
3505 (Incremental_input_entry_reader::arg_serial): New function.
3506 (Incremental_input_entry_reader::type): Extract type from flags.
3507 (Incremental_input_entry_reader::is_in_system_directory): New function.
3508 (Incremental_input_entry_reader::get_input_section_count): Call
3509 accessor function for type.
3510 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3511 function for type; adjust size of global symbol entry.
3512 (Incremental_input_entry_reader::get_global_symbol_count): Call
3513 accessor function for type.
3514 (Incremental_input_entry_reader::get_object_count): Likewise.
3515 (Incremental_input_entry_reader::get_object_offset): Likewise.
3516 (Incremental_input_entry_reader::get_member_count): Likewise.
3517 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3518 (Incremental_input_entry_reader::get_member_offset): Likewise.
3519 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3520 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3521 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3522 (Incremental_input_entry_reader::get_global_symbol_reader): New
3524 (Incremental_input_entry_reader::get_output_symbol_index): New
3526 (Incremental_input_entry_reader::type_): Remove.
3527 (Incremental_input_entry_reader::flags_): New data member.
3528 (Incremental_inputs_reader::input_file_offset): New function.
3529 (Incremental_inputs_reader::input_file_index): New function.
3530 (Incremental_inputs_reader::input_file): Call input_file_offset.
3531 (Incremental_inputs_reader::input_file_at_offset): New function.
3532 (Incremental_relocs_reader::get_r_type): Reformat.
3533 (Incremental_relocs_reader::get_r_shndx): Reformat.
3534 (Incremental_relocs_reader::get_r_offset): Reformat.
3535 (Incremental_relocs_reader::data): New function.
3536 (Incremental_binary::Incremental_binary): Initialize new data members.
3537 (Incremental_binary::check_inputs): Add cmdline parameter.
3538 (Incremental_binary::file_is_unchanged): Remove.
3539 (Input_reader::arg_serial): New function.
3540 (Input_reader::get_unused_symbol_count): New function.
3541 (Input_reader::get_unused_symbol): New function.
3542 (Input_reader::do_arg_serial): New function.
3543 (Input_reader::do_get_unused_symbol_count): New function.
3544 (Input_reader::do_get_unused_symbol): New function.
3545 (Incremental_binary::input_file_count): New function.
3546 (Incremental_binary::get_input_reader): Change signature to use
3547 index instead of filename.
3548 (Incremental_binary::file_has_changed): New function.
3549 (Incremental_binary::get_input_argument): New function.
3550 (Incremental_binary::get_library): New function.
3551 (Incremental_binary::get_script_info): New function.
3552 (Incremental_binary::init_layout): New function.
3553 (Incremental_binary::reserve_layout): New function.
3554 (Incremental_binary::output_file): New function.
3555 (Incremental_binary::do_check_inputs): New function.
3556 (Incremental_binary::do_file_is_unchanged): Remove.
3557 (Incremental_binary::do_file_has_changed): New function.
3558 (Incremental_binary::do_init_layout): New function.
3559 (Incremental_binary::do_reserve_layout): New function.
3560 (Incremental_binary::do_input_file_count): New function.
3561 (Incremental_binary::do_get_input_reader): Change signature.
3562 (Incremental_binary::input_args_map_): New data member.
3563 (Incremental_binary::library_map_): New data member.
3564 (Incremental_binary::script_map_): New data member.
3565 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3567 (Sized_incremental_binary::output_section): New function.
3568 (Sized_incremental_binary::inputs_reader): Add const.
3569 (Sized_incremental_binary::symtab_reader): Add const.
3570 (Sized_incremental_binary::relocs_reader): Add const.
3571 (Sized_incremental_binary::got_plt_reader): Add const.
3572 (Sized_incremental_binary::get_symtab_view): New function.
3573 (Sized_incremental_binary::Inputs_reader): New typedef.
3574 (Sized_incremental_binary::Input_entry_reader): New typedef.
3575 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3576 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3577 (Sized_incremental_binary::do_file_has_changed): New function.
3578 (Sized_incremental_binary::do_init_layout): New function.
3579 (Sized_incremental_binary::do_reserve_layout): New function.
3580 (Sized_input_reader::Inputs_reader): Remove.
3581 (Sized_input_reader::Input_entry_reader): Remove.
3582 (Sized_input_reader::do_arg_serial): New function.
3583 (Sized_input_reader::do_get_unused_symbol_count): New function.
3584 (Sized_input_reader::do_get_unused_symbol): New function.
3585 (Sized_incremental_binary::do_input_file_count): New function.
3586 (Sized_incremental_binary::do_get_input_reader): Change signature;
3587 use index instead of filename.
3588 (Sized_incremental_binary::section_map_): New data member.
3589 (Sized_incremental_binary::input_entry_readers_): New data member.
3590 (class Sized_incr_relobj): New class.
3591 (class Sized_incr_dynobj): New class.
3592 (make_sized_incremental_object): New function.
3593 (class Incremental_library): New class.
3594 * layout.cc (Free_list::num_lists): New static data member.
3595 (Free_list::num_nodes): New static data member.
3596 (Free_list::num_removes): New static data member.
3597 (Free_list::num_remove_visits): New static data member.
3598 (Free_list::num_allocates): New static data member.
3599 (Free_list::num_allocate_visits): New static data member.
3600 (Free_list::init): New function.
3601 (Free_list::remove): New function.
3602 (Free_list::allocate): New function.
3603 (Free_list::dump): New function.
3604 (Free_list::print_stats): New function.
3605 (Layout_task_runner::run): Resize output file for incremental updates.
3606 (Layout::Layout): Initialize new data members.
3607 (Layout::set_incremental_base): New function.
3608 (Layout::init_fixed_output_section): New function.
3609 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3610 incremental updates.
3611 (Layout::create_gold_note): Do not create gold note section for
3612 incremental updates.
3613 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3614 for incremental updates.
3615 (Layout::set_section_offsets): For incremental updates, allocate space
3617 (Layout::create_symtab_sections): Layout with offsets relative to
3618 start of section; for incremental updates, allocate space from free
3620 (Layout::create_shdrs): For incremental updates, allocate space from
3622 (Layout::finish_dynamic_section): For incremental updates, do not
3623 check --as-needed (fixed in subsequent patch).
3624 * layout.h (class Free_list): New class.
3625 (Layout::set_incremental_base): New function.
3626 (Layout::incremental_base): New function.
3627 (Layout::init_fixed_output_section): New function.
3628 (Layout::allocate): New function.
3629 (Layout::incremental_base_): New data member.
3630 (Layout::free_list_): New data member.
3631 * main.cc (main): Print Free_list statistics.
3632 * object.cc (Relobj::finalize_incremental_relocs): Add
3633 clear_counts parameter; clear counts only when clear_counts is set.
3634 (Sized_relobj::Sized_relobj): Initialize new base class.
3635 (Sized_relobj::do_layout): Don't report special sections.
3636 (Sized_relobj::do_for_all_local_got_entries): New function.
3637 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3638 symtab_off to all symbol table offsets.
3639 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3640 * object.h (class Got_offset_list): Move to top of file.
3641 (Object::Object): Allow case where input_file == NULL.
3642 (Object::~Object): Likewise.
3643 (Object::input_file): Assert that input_file != NULL.
3644 (Object::lock): Allow case where input_file == NULL.
3645 (Object::unlock): Likewise.
3646 (Object::is_locked): Likewise.
3647 (Object::token): Likewise.
3648 (Object::release): Likewise.
3649 (Object::is_incremental): New function.
3650 (Object::get_mtime): New function.
3651 (Object::for_all_local_got_entries): New function.
3652 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3653 (Object::set_is_in_system_directory): New function.
3654 (Object::is_in_system_directory): New function.
3655 (Object::do_is_incremental): New function.
3656 (Object::do_get_mtime): New function.
3657 (Object::do_for_all_local_got_entries): New function.
3658 (Object::is_in_system_directory_): New data member.
3659 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3660 (class Sized_relobj_base): New class.
3661 (class Sized_relobj): Derive from Sized_relobj_base.
3662 (class Sized_relobj::Symbols): Redeclare from base class.
3663 (class Sized_relobj::local_got_offset_list): Remove.
3664 (class Sized_relobj::Output_sections): Redeclare from base class.
3665 (class Sized_relobj::do_for_all_local_got_entries): New function.
3666 (class Sized_relobj::write_local_symbols): Add offset parameter.
3667 (class Sized_relobj::local_symbol_offset_): Update comment.
3668 (class Sized_relobj::local_dynsym_offset_): Update comment.
3669 * options.cc (Input_arguments::add_file): Remove const.
3670 * options.h (Input_file_argument::Input_file_argument):
3671 Initialize arg_serial_ (all constructors).
3672 (Input_file_argument::set_arg_serial): New function.
3673 (Input_file_argument::arg_serial): New function.
3674 (Input_file_argument::arg_serial_): New data member.
3675 (Input_arguments::Input_arguments): Initialize file_count_.
3676 (Input_arguments::add_file): Remove const.
3677 (Input_arguments::number_of_input_files): New function.
3678 (Input_arguments::file_count_): New data member.
3679 (Command_line::number_of_input_files): Call
3680 Input_arguments::number_of_input_files.
3681 * output.cc (Output_segment_headers::Output_segment_headers):
3683 (Output_section::Input_section::current_data_size): New function.
3684 (Output_section::Output_section): Initialize new data members.
3685 (Output_section::add_input_section): Don't do merge sections for
3686 an incremental link; allocate space from free list for an
3688 (Output_section::add_output_section_data): Allocate space from
3689 free list for an incremental update.
3690 (Output_section::update_data_size): New function.
3691 (Output_section::set_fixed_layout): New function.
3692 (Output_section::reserve): New function.
3693 (Output_segment::set_section_addresses): Remove const.
3694 (Output_segment::set_section_list_addresses): Remove const; allocate
3695 space from free list for an incremental update.
3696 (Output_segment::set_offset): Adjust size of RELRO segment for an
3698 * output.h (Output_data::current_data_size): Move here from
3700 (Output_data::pre_finalize_data_size): New function.
3701 (Output_data::update_data_size): New function.
3702 (Output_section_headers::update_data_size): new function.
3703 (Output_section_data_build::current_data_size): Move to Output_data.
3704 (Output_data_strtab::update_data_size): New function.
3705 (Output_section::current_data_size): Move to Output_data.
3706 (Output_section::set_fixed_layout): New function.
3707 (Output_section::has_fixed_layout): New function.
3708 (Output_section::reserve): New function.
3709 (Output_section::update_data_size): New function.
3710 (Output_section::has_fixed_layout_): New data member.
3711 (Output_section::free_list_): New data member.
3712 (Output_segment::set_section_addresses): Remove const.
3713 (Output_segment::set_section_list_addresses): Remove const.
3714 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3716 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3718 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3719 parameter when calling Add_symbols constructor; store argument
3720 serial number for members of a lib group.
3721 (Add_symbols::locks): Allow case where token == NULL.
3722 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3723 (Read_member::~Read_member): New function.
3724 (Read_member::is_runnable): New function.
3725 (Read_member::locks): New function.
3726 (Read_member::run): New function.
3727 (Check_script::~Check_script): New function.
3728 (Check_script::is_runnable): New function.
3729 (Check_script::locks): New function.
3730 (Check_script::run): New function.
3731 (Check_library::~Check_library): New function.
3732 (Check_library::is_runnable): New function.
3733 (Check_library::locks): New function.
3734 (Check_library::run): New function.
3735 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3736 (Add_symbols::library_): New data member.
3737 (class Read_member): New class.
3738 (class Check_script): New class.
3739 (class Check_library): New class.
3740 * reloc.cc (Read_relocs::is_runnable): Allow case where
3742 (Read_relocs::locks): Likewise.
3743 (Scan_relocs::locks): Likewise.
3744 (Relocate_task::locks): Likewise.
3745 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3747 (Sized_relobj::incremental_relocs_scan): Fix comment.
3748 (Sized_relobj::do_relocate): Pass output file offset to
3749 write_local_symbols.
3750 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3751 from class declaration.
3752 * script.cc (read_input_script): Allocate Script_info; pass
3753 argument serial number to report_script.
3754 * script.h (class Script_info): Move to incremental.h.
3755 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3756 * symtab.h (Symbol_table::add_from_incrobj): New function.
3757 (Symbol_table::set_file_offset): New function.
3759 2011-04-05 Cary Coutant <ccoutant@google.com>
3761 * incremental-dump.cc (dump_incremental_inputs): Change signature
3762 to take a Sized_incremental_binary; change caller. Use readers
3763 in Sized_incremental_binary.
3765 (Sized_incremental_binary::find_incremental_inputs_sections):
3766 Rename do_find_incremental_inputs_sections to this.
3767 (Sized_incremental_binary::setup_readers): New function.
3768 (Sized_incremental_binary::do_check_inputs): Check
3769 has_incremental_info_ flag; move setup code to setup_readers;
3771 (Sized_incremental_binary::do_file_is_unchanged): New function.
3772 (Sized_incremental_binary::do_get_input_reader): New function.
3773 * incremental.h (class Incremental_binary): Move to end of file.
3774 (Incremental_binary::file_is_unchanged): New function.
3775 (Incremental_binary::do_file_is_unchanged): New function.
3776 (Incremental_binary::Input_reader): New class.
3777 (Incremental_binary::get_input_reader): New function.
3778 (class Sized_incremental_binary): Move to end of file.
3779 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3780 input section reader classes.
3781 (Sized_incremental_binary::has_incremental_info): New function.
3782 (Sized_incremental_binary::inputs_reader): New function.
3783 (Sized_incremental_binary::symtab_reader): New function.
3784 (Sized_incremental_binary::relocs_reader): New function.
3785 (Sized_incremental_binary::got_plt_reader): New function.
3786 (Sized_incremental_binary::do_file_is_unchanged): New function.
3787 (Sized_incremental_binary::Sized_input_reader): New class.
3788 (Sized_incremental_binary::get_input_reader): New function.
3789 (Sized_incremental_binary::find_incremental_inputs_sections):
3790 Rename do_find_incremental_inputs_sections to this.
3791 (Sized_incremental_binary::setup_readers): New function.
3792 (Sized_incremental_binary::has_incremental_info_): New data member.
3793 (Sized_incremental_binary::inputs_reader_): New data member.
3794 (Sized_incremental_binary::symtab_reader_): New data member.
3795 (Sized_incremental_binary::relocs_reader_): New data member.
3796 (Sized_incremental_binary::got_plt_reader_): New data member.
3797 (Sized_incremental_binary::current_input_file_): New data member.
3799 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3802 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3805 2011-03-30 Cary Coutant <ccoutant@google.com>
3807 * archive.cc (Archive::include_member): Adjust call to report_object.
3808 (Add_archive_symbols::run): Add script_info to call to
3809 report_archive_begin.
3810 (Lib_group::include_member): Adjust call to report_object.
3811 (Add_lib_group_symbols::run): Adjust call to report_object.
3812 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3813 blocks. Add object count for script input files.
3814 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3815 script_info parameter; change all callers.
3816 (Incremental_inputs::report_object): Add script_info parameter;
3818 (Incremental_inputs::report_script): Store backpointer to
3819 incremental info entry.
3820 (Output_section_incremental_inputs::set_final_data_size): Record
3821 additional information for scripts.
3822 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3823 * incremental.h (Incremental_script_entry::add_object): New function.
3824 (Incremental_script_entry::get_object_count): New function.
3825 (Incremental_script_entry::get_object): New function.
3826 (Incremental_script_entry::objects_): New data member; adjust
3828 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3829 (Incremental_inputs::report_object): Add script_info parameter.
3830 (Incremental_inputs_reader::get_object_count): New function.
3831 (Incremental_inputs_reader::get_object_offset): New function.
3832 * options.cc (Input_arguments::add_file): Return reference to
3834 * options.h (Input_argument::set_script_info): New function.
3835 (Input_argument::script_info): New function.
3836 (Input_argument::script_info_): New data member; adjust all
3838 (Input_file_group::add_file): Return reference to new input argument.
3839 (Input_file_lib::add_file): Likewise.
3840 (Input_arguments::add_file): Likewise.
3841 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3842 * script.cc (Parser_closure::Parser_closure): Add script_info
3843 parameter; adjust all callers.
3844 (Parser_closure::script_info): New function.
3845 (Parser_closure::script_info_): New data member.
3846 (read_input_script): Report scripts earlier to incremental info.
3847 (script_add_file): Set script_info in Input_argument.
3848 (script_add_library): Likewise.
3849 * script.h (Script_options::Script_info): Rewrite class.
3851 2011-03-29 Cary Coutant <ccoutant@google.com>
3853 * archive.cc (Library_base::should_include_member): Move
3854 method here from class Archive.
3855 (Archive::Archive): Initialize base class.
3856 (Archive::should_include_member): Move to base class.
3857 (Archive::do_for_all_unused_symbols): New function.
3858 (Add_archive_symbols::run): Remove redundant access to
3860 (Lib_group::Lib_group): Initialize base class.
3861 (Lib_group::do_filename): New function.
3862 (Lib_group::include_member): Pass pointer to Lib_group to
3864 (Lib_group::do_for_all_unused_symbols): New function.
3865 (Add_lib_group_symbols::run): Report archive information for
3867 * archive.h (class Library_base): New base class.
3868 (class Archive): Derive from Library_base.
3869 (Archive::filename): Move to base class.
3870 (Archive::set_incremental_info): Likewise.
3871 (Archive::incremental_info): Likewise.
3872 (Archive::Should_include): Likewise.
3873 (Archive::should_include_member): Likewise.
3874 (Archive::Armap_entry): Remove.
3875 (Archive::Unused_symbol_iterator): Remove.
3876 (Archive::unused_symbols_begin): Remove.
3877 (Archive::unused_symbols_end): Remove.
3878 (Archive::do_filename): New function.
3879 (Archive::do_get_mtime): New function.
3880 (Archive::do_for_all_unused_symbols): New function.
3881 (Archive::task_): Move to base class.
3882 (Archive::incremental_info_): Likewise.
3883 (class Lib_group): Derive from Library_base.
3884 (Lib_group::do_filename): New function.
3885 (Lib_group::do_get_mtime): New function.
3886 (Lib_group::do_for_all_unused_symbols): New function.
3887 (Lib_group::task_): Move to base class.
3888 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3890 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3892 * incremental.cc (Incremental_inputs::report_archive_begin):
3893 Use Library_base; call library's get_mtime; add incremental inputs
3894 entry before members.
3895 (class Unused_symbol_visitor): New class.
3896 (Incremental_inputs::report_archive_end): Use Library_base; use
3897 visitor class to record unused symbols; don't add incremental inputs
3898 entry after members.
3899 (Incremental_inputs::report_object): Use Library_base.
3901 (Incremental_archive_entry::Incremental_archive_entry): Remove
3902 unused Archive parameter.
3903 (Incremental_inputs::report_archive_begin): Use Library_base.
3904 (Incremental_inputs::report_archive_end): Likewise.
3905 (Incremental_inputs::report_object): Likewise.
3906 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3908 * object.h (Object::for_all_global_symbols): New function.
3909 (Object::do_for_all_global_symbols): New function.
3910 (Sized_relobj::do_for_all_global_symbols): New function.
3911 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3913 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3916 2011-03-27 Ian Lance Taylor <iant@google.com>
3918 * archive.cc (Archive::interpret_header): Return -1 if something
3919 goes wrong. Change callers accordingly.
3921 2011-03-25 Cary Coutant <ccoutant@google.com>
3923 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3924 * testsuite/Makefile.in: Regenerate.
3926 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3928 * plugin.cc (get_view): New.
3929 (Plugin::load): Pass get_view to the plugin.
3930 (Plugin_manager::get_view): New.
3932 2011-03-21 Ian Lance Taylor <iant@google.com>
3934 * testsuite/final_layout.sh: Rewrite to not use dc.
3935 * testsuite/relro_test.sh: Fail if dc is not present.
3937 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3939 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3941 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3942 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3944 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3945 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3947 2011-03-14 Ian Lance Taylor <iant@google.com>
3949 * script-sections.cc (Sort_output_sections::script_compare):
3950 Rename from is_before, change return type.
3951 (Sort_output_sections::operator()): Adjust accordingly.
3953 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3956 * testsuite/odr_violation2.cc: Add comment to make all error line
3957 numbers double digits.
3958 * testsuite/debug_msg.sh: Adjust expected errors.
3960 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3962 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3963 but mark earlier ones as non-canonical
3964 (offset_to_iterator): Update search target and example
3965 (do_addr2line): Return extra lines in a vector*
3966 (format_file_lineno): Extract from do_addr2line
3967 (one_addr2line): Add vector* out-param
3968 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3969 when a lineno entry appeared last for its instruction
3970 (Dwarf_line_info): Add vector* out-param
3971 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3972 * symtab.cc (Odr_violation_compare): Include the lineno in the
3974 (linenos_from_loc): New. Combine the canonical line for an
3975 address with its other lines.
3976 (True_if_intersect): New. Helper functor to make
3977 std::set_intersection a query.
3978 (detect_odr_violations): Compare sets of lines instead of just
3979 one line for each function. This became less deterministic, but
3980 has fewer false positives.
3981 * symtab.h: Declarations.
3982 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3983 mix an optimized and non-optimized object in the same binary
3984 (odr_violation2.so): Same.
3985 * testsuite/Makefile.in: Regenerate from Makefile.am.
3986 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3987 * testsuite/debug_msg.sh: Update line numbers and add
3989 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3990 non-optimized context.
3991 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3992 isn't inlined, and use OdrDerived in an optimized context.
3993 * testsuite/odr_header1.h: Defines OdrDerived, where
3994 optimization will change the
3995 first-instruction-in-the-destructor's file and line number.
3996 * testsuite/odr_header2.h: Defines OdrBase.
3998 2011-03-09 Ian Lance Taylor <iant@google.com>
4000 * fileread.cc (File_read::clear_views): Don't delete the whole
4003 2011-03-08 Ian Lance Taylor <iant@google.com>
4006 * fileread.cc: #include <climits>.
4007 (GOLD_IOV_MAX): Define.
4008 (File_read::read_multiple): Limit number of entries by iov_max.
4009 * fileread.h (class File_read): Always set max_readv_entries to
4012 2011-03-07 Ian Lance Taylor <iant@google.com>
4015 * options.h (class General_options): Add -dy and -dn.
4017 2011-03-02 Cary Coutant <ccoutant@google.com>
4019 * testsuite/script_test_9.t: Add TLS segment.
4021 2011-03-02 Simon Baldwin <simonb@google.com>
4023 * configure.ac: Add check for gnu_indirect_function support in
4024 the toolchain building binutils.
4025 * configure: Rebuild.
4027 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
4029 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4030 plugin only symbols.
4031 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4032 in plugin files as not needed in the symbol table.
4034 2011-02-11 Sriraman Tallam <tmsriram@google.com>
4036 * output.cc (Output_section::add_input_section): Delay fill
4037 generation for section ordering.
4039 2011-02-09 Ian Lance Taylor <iant@google.com>
4042 * object.h (class Sized_relobj): Remove clear_local_symbols.
4043 * reloc.cc (Sized_relobj::do_relocate): Don't call
4044 clear_local_symbols.
4046 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
4048 * plugin.cc (is_visible_from_outside): Return true for symbols
4051 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4053 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4056 2011-02-02 Sriraman Tallam <tmsriram@google.com>
4058 * icf.h (is_section_foldable_candidate): Change type of parameter
4060 * icf.cc (Icf::find_identical_sections): Change type of local variable
4061 section_name to be std::string.
4062 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4064 2011-01-25 Ian Lance Taylor <iant@google.com>
4066 * script.cc (script_add_extern): Rewrite to use
4067 add_symbol_reference.
4069 2011-01-25 Doug Kwan <dougkwan@google.com>
4071 * icf.cc (get_section_contents): Always lock section's object.
4073 2011-01-24 Ian Lance Taylor <iant@google.com>
4075 * options.h (class General_options): Accept
4076 --no-detect-odr-violations.
4078 2011-01-24 Ian Lance Taylor <iant@google.com>
4080 * version.cc (version_string): Bump to 1.11.
4082 2011-01-24 Ian Lance Taylor <iant@google.com>
4084 * plugin.cc (class Plugin_rescan): Define new class.
4085 (Plugin_manager::claim_file): Set any_claimed_.
4086 (Plugin_manager::save_archive): New function.
4087 (Plugin_manager::save_input_group): New function.
4088 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4090 (Plugin_manager::new_undefined_symbol): New function.
4091 (Plugin_manager::rescan): New function.
4092 (Plugin_manager::rescannable_defines): New function.
4093 (Plugin_manager::add_input_file): Set any_added_.
4094 * plugin.h (class Plugin_manager): define new fields rescannable_,
4095 undefined_symbols_, any_claimed_, and any_added_. Declare
4096 Plugin_rescan as friend. Declare new functions.
4097 (Plugin_manager::Rescannable): Define type.
4098 (Plugin_manager::Rescannable_list): Define type.
4099 (Plugin_manager::Undefined_symbol_list): Define type.
4100 (Plugin_manager::Plugin_manager): Initialize new fields.
4101 * archive.cc (Archive::defines_symbol): New function.
4102 (Add_archive_symbols::run): Pass archive to plugins if any.
4103 * archive.h (class Archive): Declare defines_symbol.
4104 * readsyms.cc (Input_group::~Input_group): New function.
4105 (Finish_group::run): Pass input_group to plugins if any.
4106 * readsyms.h (class Input_group): Declare destructor.
4107 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4110 2011-01-10 Ian Lance Taylor <iant@google.com>
4112 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4114 (Layout::set_segment_offsets): Reset increase_relro before calling
4115 set_section_addresses a second time.
4117 2011-01-04 Cary Coutant <ccoutant@google.com>
4119 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4120 sections before NOBITS sections.
4122 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4124 * version.cc (print_version): Update copyright to 2011.
4126 2010-12-23 Cary Coutant <ccoutant@google.com>
4128 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4129 of OS to this->add. Add OD parameter to second form of the function.
4131 2010-12-20 Ian Lance Taylor <iant@google.com>
4133 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4134 second of two consecutive entries with same offset.
4136 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4138 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4139 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4140 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4141 to avoid unneeded links against $(LDADD).
4142 * testsuite/Makefile.in: Regenerate.
4144 2010-12-15 Ian Lance Taylor <iant@google.com>
4147 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4148 for R_X86_64_32 and R_X86_64_PC32.
4149 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4150 ver_matching_def_pic.o.
4151 (ver_matching_def_pic.o): New target.
4153 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4155 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4156 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4157 Move definition before File_read::View member definitions.
4158 (File_read::View::~View): Initialize and hold lock before
4159 updating current_mapped_bytes.
4161 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4163 * dwarf_reader.cc: Remove outdated comment.
4164 * gold-threads.cc: Fix typo in error message.
4165 * archive.cc: Fix typos in comments.
4166 * archive.h: Likewise.
4167 * arm-reloc-property.cc: Likewise.
4168 * arm-reloc-property.h: Likewise.
4169 * arm-reloc.def: Likewise.
4171 * attributes.h: Likewise.
4172 * cref.cc: Likewise.
4173 * ehframe.cc: Likewise.
4174 * fileread.h: Likewise.
4176 * i386.cc: Likewise.
4178 * incremental.h: Likewise.
4179 * int_encoding.cc: Likewise.
4180 * layout.h: Likewise.
4181 * main.cc: Likewise.
4182 * merge.h: Likewise.
4183 * object.cc: Likewise.
4184 * object.h: Likewise.
4185 * options.cc: Likewise.
4186 * readsyms.cc: Likewise.
4187 * reduced_debug_output.cc: Likewise.
4188 * reloc.cc: Likewise.
4189 * script-sections.cc: Likewise.
4190 * sparc.cc: Likewise.
4191 * symtab.h: Likewise.
4192 * target-reloc.h: Likewise.
4193 * target.cc: Likewise.
4194 * target.h: Likewise.
4195 * timer.cc: Likewise.
4196 * timer.h: Likewise.
4197 * x86_64.cc: Likewise.
4199 2010-12-09 Cary Coutant <ccoutant@google.com>
4201 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4203 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4204 parameter; change all callers.
4205 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4206 * options.h (warn_execstack): New option.
4208 2010-12-07 Doug Kwan <dougkwan@google.com>
4210 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4211 like function call relocations.
4213 2010-12-07 Ian Lance Taylor <iant@google.com>
4215 * archive.cc (Archive::get_elf_object_for_member): Permit
4216 punconfigured to be NULL.
4217 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4218 (Archive::include_member): Pass NULL to get_elf_object_for_member
4219 if we searched for the archive and this is the first included
4222 2010-12-01 Ian Lance Taylor <iant@google.com>
4224 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4225 track_relocs_type_ field.
4226 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4227 Set track_relocs_type_.
4228 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4229 contents when using RELA relocs.
4230 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4232 * reloc.cc (Track_relocs::next_addend): New function.
4233 * reloc.h (class Track_relocs): Declare next_addend.
4235 2010-12-01 Ian Lance Taylor <iant@google.com>
4237 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4240 2010-12-01 Ian Lance Taylor <iant@google.com>
4242 * README: Update compilers known to work and fail.
4244 2010-11-23 Matthias Klose <doko@ubuntu.com>
4246 * configure.in: For --enable-gold, handle value `default' instead of
4247 `both*'. Always install ld as ld.bfd, install as ld if gold is
4249 * configure: Regenerate.
4251 2010-11-18 Doug Kwan <dougkwan@google.com>
4253 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4254 and right_alignment to be zero. Store result alignment only if it is
4255 greater than existing alignment.
4257 2010-11-16 Cary Coutant <ccoutant@google.com>
4260 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4261 Check for ".zdebug_line".
4263 2010-11-16 Doug Kwan <dougkwan@google.com>
4264 Cary Coutant <ccoutant@google.com>
4266 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4267 by reference; adjust all callers.
4268 * output.cc (Output_segment::set_section_addresses): Adjust references
4269 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4271 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4272 end at page boundary.
4274 2010-11-16 Cary Coutant <ccoutant@google.com>
4277 * layout.cc (Layout::choose_output_section): Transform names of
4278 compressed sections even when using a script with a SECTIONS clause.
4279 (Layout::output_section_name): Remove code to transform
4280 compressed debug section names.
4281 * output.cc (Output_section::add_input_section): Use uncompressed
4282 section size when tracking input sections.
4284 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4286 * symtab.h (Symbol::NON_PIC_REF): Remove.
4287 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4288 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4289 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4290 (Symbol::use_plt_offset): Take a flags argument and pass it
4291 directly to needs_dynamic_reloc. Restrict check for undefined
4292 weak symbols to function calls.
4293 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4294 (Target_arm::Scan::global): Use it.
4295 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4296 (Target_arm::Relocate::relocate): Likewise.
4297 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4298 parameter with an r_type parameter. Use get_reference_flags
4300 (Target_arm::Relocate::relocate): Update accordingly.
4301 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4302 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4303 (Target_i386::Scan::global): Likewise.
4304 (Target_i386::Relocate::relocate): Likewise.
4305 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4306 parameter with an r_type parameter. Use get_reference_flags
4308 (Target_i386::Relocate::relocate): Update accordingly.
4309 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4310 (Target_powerpc::Scan::global): Use it.
4311 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4312 (Target_powerpc::Relocate::relocate): Likewise.
4313 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4314 (Target_sparc::Scan::global): Use it.
4315 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4316 (Target_sparc::Relocate::relocate): Likewise.
4317 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4318 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4319 (Target_x86_64::Scan::global): Likewise.
4320 (Target_x86_64::Relocate::relocate): Likewise.
4322 2010-11-08 Doug Kwan <dougkwan@google.com>
4323 Cary Coutant <ccoutant@google.com>
4325 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4326 (Arm_exidx_merge_section::section_contents_): New data member.
4327 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4328 (Arm_input_section::~Arm_input_section): De-allocate memory.
4329 (Arm_input_section::original_contents_): New data member.
4330 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4331 in parameters instead of calling Object::section_contents without
4333 (Arm_output_section::group_section): New parameter TASK. Pass it
4334 to callees that need locking objects.
4335 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4336 to lock EXIDX input sections. Fix a formatting issue. Call
4337 Arm_exidx_merged_section::build_contents to create merged section
4339 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4340 to lock object of stub table owner.
4341 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4342 TEXT_SIZE to initialize data member TEXT_SIZE_.
4343 (Arm_exidx_input_section::addralign): Fix typo in comment.
4344 (Arm_exidx_input_section::text_size): New method.
4345 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4346 that require locking objects. Lock objects before scanning for stubs
4347 and updating local symbols.
4348 (Arm_input_section<big_endian>::init): Copy contents of original
4350 (Arm_input_section<big_endian>::do_write): Use saved contents of
4351 original input section instead of calling Object::section_contents
4353 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4354 size without calling Object::section_size().
4355 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4356 for size. Allocate a buffer for merged EXIDX entries.
4357 (Arm_exidx_merged_section::build_contents): New method.
4358 (Arm_exidx_merged_section::do_write): Move merge section contents
4359 building code to Arm_exidx_merged_section::build_contetns. Write
4360 out contetns in buffer instead of building it on the fly.
4361 (Arm_relobj::make_exidx_input_section): Also pass text section size
4362 to Arm_exidx_input_section constructor.
4363 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4364 (Arm_dynobj::do_read_symbols): Fix memory leak.
4365 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4366 * target.h: (class Task): Add forward declaration.
4367 (Target::relax): Add new parameter TASK and pass it to
4369 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4371 2010-11-05 Cary Coutant <ccoutant@google.com>
4374 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4375 object when reading from the file.
4376 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4378 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4379 when reading section contents.
4380 (get_section_contents): Likewise.
4381 (icf::find_identical_sections): Likewise.
4382 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4383 object when reading from the file.
4384 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4385 the object when doing deferred section layout.
4387 2010-11-03 Nick Clifton <nickc@redhat.com>
4390 * script.h (class Symbol_assignment: name): New member. Returns
4391 the name of the symbol.
4392 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4393 Returns true if the given symbol name is on the list of
4394 assignments wating to be processed.
4395 * archive.cc (should_incldue_member): If the symbol is undefined,
4396 check to see if it is on the list of symbols pending assignment.
4398 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4400 * script-sections.cc (Script_sections::find_memory_region): Check
4401 for a NULL output section pointer.
4403 2010-10-29 Doug Kwan <dougkwan@google.com>
4405 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4406 Output_section::add_relaxed_input_section.
4407 * output.cc (Output_section::add_relaxed_input_section): Add new
4408 arguments LAYOUT and NAME. Set section order index.
4409 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4410 Copy section order index.
4411 * output.h (Output_section::add_relaxed_input_section): Add new
4412 arguments LAYOUT and NAME.
4414 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4416 * testsuite/Makefile.am: Move gcctestdir/ld rule to
4417 NATIVE_OR_CROSS_LINKER.
4418 * testsuite/Makefile.in: Regenerate.
4420 2010-10-20 Doug Kwan <dougkwan@google.com>
4422 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4423 without SHF_LINK_ORDER flags.
4424 * layout.cc (Layout::choose_output_section): Do not filter
4425 SHF_LINK_ORDER flag in a relocatable link.
4427 2010-10-17 Cary Coutant <ccoutant@google.com>
4429 * output.h (Output_segment::set_section_addresses): Change function
4430 signature. Update all callers.
4431 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4433 (Output_segment::set_section_addresses): Align after last TLS
4434 section. Add padding before last relro section instead of after.
4436 2010-10-17 Doug Kwan <dougkwan@google.com>
4438 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4439 GOT output section to be writable.
4441 2010-10-14 Cary Coutant <ccoutant@google.com>
4443 * debug.h (DEBUG_INCREMENTAL): New flag.
4444 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4445 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4447 * incremental.cc (report_command_line): Ignore all forms of
4449 * layout.cc (Layout::Layout): Check parameters for incremental link
4451 * options.cc (General_options::parse_incremental): New function.
4452 (General_options::parse_no_incremental): New function.
4453 (General_options::parse_incremental_full): New function.
4454 (General_options::parse_incremental_update): New function.
4455 (General_options::incremental_mode_): New data member.
4456 (General_options::finalize): Check incremental_mode_.
4457 * options.h (General_options): Update help text for --incremental.
4458 Add --no-incremental, --incremental-full, --incremental-update.
4459 (General_options::Incremental_mode): New enum type.
4460 (General_options::incremental_mode): New function.
4461 (General_options::incremental_mode_): New data member.
4462 * parameters.cc (Parameters::incremental_mode_): New data member.
4463 (Parameters::set_options): Set incremental_mode_.
4464 (Parameters::set_incremental_full): New function.
4465 (Parameters::incremental): New function.
4466 (Parameters::incremental_update): New function.
4467 (set_parameters_incremental_full): New function.
4468 * parameters.h (Parameters::set_incremental_full): New function.
4469 (Parameters::incremental): New function.
4470 (Parameters::incremental_update): New function.
4471 (Parameters::incremental_mode_): New data member.
4472 (set_parameters_incremental_full): New function.
4473 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4474 incremental link mode.
4475 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4476 (Sized_relobj::do_relocate_sections): Likewise.
4477 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4479 * testsuite/Makefile.in: Regenerate.
4480 * testsuite/incremental_test.sh: Filter all forms of --incremental.
4482 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4484 * script-sections.h (class Script_sections): Make
4485 Sections_elements typedef public.
4486 * script-sections.cc (class Sort_output_sections): Add elements_
4487 field. Add constructor which sets it; change all callers.
4488 (Sort_output_sections::is_before): New function.
4489 (Sort_output_sections::operator()): Call is_before.
4490 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4492 * testsuite/script_test_10.sh: New test. Test script section
4494 * testsuite/script_test_10.t: Likewise.
4495 * testsuite/script_test_10.s: Likewise.
4496 * testsuite/Makefile.am: Wrap the cross linker tests and the
4497 common tests into NATIVE_OR_CROSS_LINKER.
4498 (check_SCRIPTS): Add script_test_10.sh.
4499 (check_DATA): Add script_test_10.stdout.
4500 (script_test_10.o, script_test_10): New targets.
4501 (script_test_10.stdout): New target.
4502 * configure, testsuite/Makefile.in: Regenerate.
4504 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4506 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4507 error for the deprecated relocations.
4508 (Target_arm::Scan::global): Likewise.
4509 (Target_arm::Relocate::relocate): Likewise.
4511 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4513 * fileread.cc (Input_file::find_file): Initialize *found_name
4514 and *namep when using the fallback search for case 4.
4516 2010-10-11 Cary Coutant <ccoutant@google.com>
4518 * options.h (class General_options): Redefine -z lazy as an alias for
4519 the negation of -z now.
4521 2010-10-11 Ian Lance Taylor <iant@google.com>
4523 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4526 2010-10-06 Nick Clifton <nickc@redhat.com>
4528 * script-sections.cc(class Memory_region): Remove
4529 current_lma_offset_ field. Rename current_vma_offset_ to
4530 current_offset_. Add last_section_ field.
4531 (Memory_region::get_current_vma_address): Rename to
4532 get_current_address.
4533 (Memory_region::get_current_lma_address): Delete.
4534 (Memory_region::increment_vma_offset): Rename to
4536 (Memory_region::increment_lma_offset): Delete.
4537 (Memory_region::attributes_compatible): New method. Returns
4538 true if the provided section is compatible with the region.
4539 (Memory_region::get_last_section): New method. Returns the last
4540 section to use the region.
4541 (Memory_region::set_last_section): New method. Stores the last
4542 section to use the region.
4543 (Script_sections::block_in_region): New method. Returns true if
4544 a block of memory is contained within a region.
4545 (Script_sections::find_memory_region): New method. Locates a
4546 memory region to be used to set a VMA or LMA address.
4547 (Output_section_definition::set_section_addresses): Add code to
4548 check for addresses set by memory regions.
4549 (Output_segment::set_section_addresses): Remove memory region
4551 (Script_sections::create_segment): Add a warning if a header
4552 segment is created outside of any region.
4553 * script-sections.h (class Script_sections): Add prototypes for
4554 find_memory_region and block_in_region methods.
4555 * testsuite/memory_test.s: Use .long instead of .word.
4556 * testsuite/memory_test.t: Add some more output sections.
4557 * testsuite/memory_test.sh: Update expected output.
4559 2010-10-02 Doug Kwan <dougkwan@google.com>
4561 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4562 defintion to symtab.h
4563 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4564 declaration to defintion.
4566 2010-10-01 Nick Clifton <nickc@redhat.com>
4568 * expression.cc (eval): Replace dummy argument with NULL.
4569 (eval_maybe_dot): Check for a NULL result section pointer.
4570 (Symbol_expression::value): Likewise.
4571 (Dot_expression::value): Likewise.
4572 (BINARY_EXPRESSION): Likewise.
4573 (Max_expression::value): Likewise.
4574 (Min_expression::value): Likewise.
4575 (Absolute_expression::value): Likewise.
4576 (Addr_expression::value_from_output_section): Likewise.
4577 (Loaddddr_expression::value_from_output_section): Likewise.
4578 (Segment_start_expression::value): Likewise.
4579 * script-sections.cc
4580 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4582 (Sections_elememt_dot_assignment::set_section_addresses):
4584 (Output_data_expression::do_write_to_buffer): Likewise.
4585 (Output_section_definition::finalize_symbols): Likewise.
4586 (Output_section_definition::set_section_addresses): Likewise.
4588 2010-09-30 Doug Kwan <dougkwan@google.com>
4590 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4592 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4594 * target.h (Target::can_icf_inline_merge_sections): New virtual
4596 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4598 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4600 * icf.cc (get_section_contents): Inline merge sections only when
4603 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4605 * configure: Regenerate.
4607 2010-09-17 Ian Lance Taylor <iant@google.com>
4609 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4610 * testsuite/Makefile.am (memory_test.o): New target.
4611 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4613 * testsuite/Makefile.in: Rebuild.
4615 2010-09-17 Doug Kwan <dougkwan@google.com>
4617 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4618 defintion if relocation uses GOT entries of the symbol.
4619 * testsuite/icf_safe_test.sh: Fix test.
4620 * testsuite/icf_safe_so_test.sh: Fix test.
4622 2010-09-16 Cary Coutant <ccoutant@google.com>
4624 * script_sections.cc (class Memory_region): Remove "NULL" from
4625 vector initializations.
4627 2010-09-15 Cary Coutant <ccoutant@google.com>
4629 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4630 Resolve forwarding symbols.
4632 2010-09-15 Doug Kwan <dougkwan@google.com>
4634 * gold/testsuite/script_test_3.t: Add ARM special sections.
4635 * gold/testsuite/script_test_4.t: Same.
4636 * gold/testsuite/script_test_5.t: Same.
4637 * gold/testsuite/script_test_6.t: Same.
4638 * gold/testsuite/script_test_7.t: Same.
4639 * gold/testsuite/script_test_7.t: Same.
4640 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4642 2010-09-14 Cary Coutant <ccoutant@google.com>
4644 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4645 (Target_x86_64::Relocate::relocate_tls): Replace check for
4646 saw_tls_block_reloc_ with test for executable section.
4648 2010-09-12 Cary Coutant <ccoutant@google.com>
4650 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4651 position-independent executables to shared libraries need dynamic
4653 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4654 position-independent executables.
4655 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4656 * testsuite/Makefile.in: Regenerate.
4658 2010-09-10 Nick Clifton <nickc@redhat.com>
4661 * testsuite/memory_test.t: Discard any sections that are not
4664 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4667 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4668 "This::" to work around a bug in gcc 4.2.
4670 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4672 2010-09-09 Rafael Espindola <espindola@google.com>
4674 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4675 sections with different PF_X flags in the same segment.
4676 (Layout::find_first_load_seg): Search all segments to find the first
4678 * options.h (rosegment): New.
4680 2010-09-08 Rafael Espindola <espindola@google.com>
4682 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4684 2010-09-08 Doug Kwan <dougkwan@google.com>
4686 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4687 (Arm_relobj::do_relocate_sections): Add new parameter for output
4688 file to match the parent.
4689 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4690 of local symbols instead of input values. Update code to track
4691 changes in gold::relocate_section.
4692 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4693 (Sized_relobj::compute_final_local_value_internal): New methods.
4694 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4695 body into private version of Sized_relobj::compute_final_local_value.
4696 Call the inline method.
4697 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4698 merged symbol value if there is one.
4699 (Symbol_value::has_output_value): New method defintiion.
4700 (Sized_relobj::Compute_final_local_value_status): New enum type.
4701 (Sized_relobj::compute_final_local_value): New methods.
4702 (Sized_relobj::compute_final_local_value_internal): New methods.
4703 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4704 and arm_cortex_a8.sh.
4705 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4706 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4708 * Makefile.in: Regenerate.
4709 * testsuite/arm_bl_out_of_range.s: Update test.
4710 * testsuite/thumb_bl_out_of_range.s: Ditto.
4711 * testsuite/thumb_blx_out_of_range.s: Ditto.
4712 * testsuite/arm_branch_out_of_range.sh: New file.
4713 * testsuite/arm_cortex_a8.sh: Ditto.
4714 * testsuite/arm_cortex_a8_b.s: Ditto.
4715 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4716 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4717 * testsuite/arm_cortex_a8_bl.s: Ditto.
4718 * testsuite/arm_cortex_a8_blx.s: Ditto.
4719 * testsuite/arm_cortex_a8_local.s: Ditto.
4720 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4721 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4723 2010-09-08 Rafael Espindola <espindola@google.com>
4725 * Makefile.am (memory_test.stdout): Run readelf with -W.
4726 * Makefile.in: Regenerate.
4727 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4730 2010-09-08 Rafael Espindola <espindola@google.com>
4732 * script-sections.cc (Script_sections::add_memory_region): Convert
4733 field precision to int.
4734 * script.cc (script_set_section_region, script_set_section_region):
4735 Convert field precision to int.
4737 2010-09-08 Rafael Espindola <espindola@google.com>
4739 * arm.cc (do_finalize_sections): Create the __exidx_start and
4740 __exdix_end symbols even when the section is missing.
4742 2010-09-08 Nick Clifton <nickc@redhat.com>
4744 * README: Remove claim that MEMORY is not supported.
4745 * expression.cc (script_exp_function_origin)
4746 (script_exp_function_length): Move from here to ...
4747 * script.cc: ... here.
4748 (script_set_section_region, script_add_memory)
4749 (script_parse_memory_attr, script_include_directive): New
4751 * script-sections.cc
4752 (class Memory_region): New class.
4753 (class Output_section_definition): Add set_memory_region,
4754 set_section_vma, set_section_lma and get_section_name methods.
4755 (class Script_Sections): Add add_memory_region,
4756 find_memory_region, find_memory_region_origin,
4757 find_memory_region_length and set_memory_region methods.
4758 Have set_section_addresses method walk the list of set memory
4760 Extend the print methos to display memory regions.
4761 * script-sections.h: Add prototypes for new methods.
4762 Add enum for MEMORY region attributes.
4763 * yyscript.y: Add support for parsing MEMORY regions.
4764 * script-c.h: Add prototypes for new functions.
4765 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4766 * testsuite/Makefile.in: Regenerate.
4767 * testsuite/memory_test.sh: New script.
4768 * testsuite/memory_test.s: New assembler source file.
4769 * testsuite/memory_test.t: New linker script.
4771 2010-08-27 Doug Kwan <dougkwan@google.com>
4773 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4774 reference override an existing dynamic weak reference.
4775 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4776 * testsuite/Makefile.in: Regenerate.
4777 * testsuite/dyn_weak_ref.sh: New file.
4778 * testsuite/dyn_weak_ref_1.c: Ditto.
4779 * testsuite/dyn_weak_ref_2.c: Ditto.
4781 2010-08-27 Ian Lance Taylor <iant@google.com>
4783 * incremental.h (class Incremental_input_entry): Add virtual
4786 2010-08-27 Ian Lance Taylor <iant@google.com>
4788 * testsuite/start_lib_test_3.c: Mark t3 as used.
4790 2010-08-27 Nick Clifton <nickc@redhat.com>
4792 * options.cc (version_script): Fix small typo in previous
4795 2010-08-25 Nick Clifton <nickc@redhat.com>
4797 * archive.cc: Formatting fixes: Remove whitespace between
4798 typename and following asterisk. Remove whitespace between
4799 function name and opening parenthesis.
4800 * archive.h: Likewise.
4802 * attributes.cc: Likewise.
4803 * attributes.h: Likewise.
4804 * common.cc: Likewise.
4805 * copy-relocs.cc: Likewise.
4806 * dirsearch.h: Likewise.
4807 * dynobj.cc: Likewise.
4808 * ehframe.cc: Likewise.
4809 * ehframe.h: Likewise.
4810 * expression.cc: Likewise.
4811 * fileread.cc: Likewise.
4812 * fileread.h: Likewise.
4814 * gold-threads.cc: Likewise.
4815 * gold.cc: Likewise.
4816 * i386.cc: Likewise.
4818 * incremental-dump.cc: Likewise.
4819 * incremental.cc: Likewise.
4820 * layout.cc: Likewise.
4821 * layout.h: Likewise.
4822 * main.cc: Likewise.
4823 * merge.cc: Likewise.
4824 * merge.h: Likewise.
4825 * object.cc: Likewise.
4826 * object.h: Likewise.
4827 * options.cc: Likewise.
4828 * options.h: Likewise.
4829 * output.cc: Likewise.
4830 * output.h: Likewise.
4831 * plugin.cc: Likewise.
4832 * plugin.h: Likewise.
4833 * powerpc.cc: Likewise.
4834 * reloc.cc: Likewise.
4835 * script-c.h: Likewise.
4836 * script-sections.cc: Likewise.
4837 * script.cc: Likewise.
4838 * stringpool.cc: Likewise.
4839 * symtab.cc: Likewise.
4840 * symtab.h: Likewise.
4841 * target.cc: Likewise.
4842 * timer.cc: Likewise.
4843 * timer.h: Likewise.
4844 * version.cc: Likewise.
4845 * x86_64.cc: Likewise.
4847 2010-08-24 Nick Clifton <nickc@redhat.com>
4850 * layout.cc (segment_precedes): Sort segments by their physical
4851 addresses, if they have been set.
4853 2010-08-23 Cary Coutant <ccoutant@google.com>
4855 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4857 (Lib_group::include_member): Unlock object after deleting its
4859 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4862 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4863 Cary Coutant <ccoutant@google.com>
4865 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4866 constructor, and set_blocker.
4867 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4869 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4870 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4871 * testsuite/Makefile.am (start_lib_test): New test case.
4872 * testsuite/Makefile.in: Regenerate.
4873 * testsuite/start_lib_test_main.c: New file.
4874 * testsuite/start_lib_test_1.c: New file.
4875 * testsuite/start_lib_test_2.c: New file.
4876 * testsuite/start_lib_test_3.c: New file.
4878 2010-08-19 Ian Lance Taylor <iant@google.com>
4880 * Makefile.in: Rebuild with automake 1.11.1.
4881 * aclocal.m4: Likewise.
4882 * testsuite/Makefile.in: Likewise.
4884 2010-08-19 Ian Lance Taylor <iant@google.com>
4887 * i386.cc (class Output_data_plt_i386): Update declarations.
4888 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4889 local_ifuncs_ fields.
4890 (Target_i386::do_plt_section_for_global): New function.
4891 (Target_i386::do_plt_section_for_local): New function.
4892 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4893 parameter; change all callers. Initialize global_ifuncs_ and
4894 local_ifuncs_. If doing a static link define __rel_iplt_start and
4896 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4897 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4898 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4900 (Target_i386::make_plt_section): New function, broken out of
4901 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4902 (Target_i386::make_plt_entry): Call make_plt_section.
4903 (Target_i386::make_local_ifunc_plt_entry): New function.
4904 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4905 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4906 R_386_IRELATIVE to switch.
4907 (Target_i386::Scan::global): Likewise.
4908 (Target_i386::Relocate::relocate): Likewise.
4909 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4911 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4912 (Target_x86_64::do_plt_section_for_global): New function.
4913 (Target_x86_64::do_plt_section_for_local): New function.
4914 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4915 parameter; change all callers. If doing a static link define
4916 __rela_iplt_start and __rela_iplt_end.
4917 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4918 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4919 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4921 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4922 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4924 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4925 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4926 R_X86_64_IRELATIVE to switch.
4927 (Target_x86_64::Scan::global): Likewise.
4928 (Target_x86_64::Relocate::relocate): Likewise.
4929 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4931 * target.h (class Target): Add plt_section_for_global and
4932 plt_section_for_local functions. Add do_plt_section_for_global
4933 and do_plt_section_for_local virtual functions.
4934 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4935 clarifying comments.
4936 (Symbol::use_plt_offset): Handle IFUNC symbol.
4937 * object.cc (Sized_relobj::Sized_relobj): Initialize
4939 (Sized_relobj::local_has_plt_offset): New function.
4940 (Sized_relobj::local_plt_offset): New function.
4941 (Sized_relobj::set_local_plt_offset): New function.
4942 (Sized_relobj::do_count): Handle IFUNC symbol.
4943 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4944 a bit away from input_shndx_ field. Add set_is_func_symbol and
4945 is_ifunc_symbol functions.
4946 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4947 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4948 local_plt_offsets_ field.
4949 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4950 * output.h (class Output_section_data): Add non-const
4951 output_section function.
4952 (class Output_data_got): Update declarations.
4953 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4954 Add use_plt_offset parameter to global and local constructors.
4955 Change all callers. Change local_sym_index_ field to 31 bits.
4956 Change GSYM_CODE and CONSTANT_CODE accordingly.
4957 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4958 doing a static link don't set sh_link field.
4959 (Output_data_got::Got_entry::write): Use PLT offset if
4961 (Output_data_got::add_global_plt): New function.
4962 (Output_data_got::add_local_plt): New function.
4963 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4964 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4965 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4966 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4967 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4969 * testsuite/ifunc-sel.h: New file.
4970 * testsuite/ifuncmain1.c: New file.
4971 * testsuite/ifuncmain1vis.c: New file.
4972 * testsuite/ifuncmod1.c: New file.
4973 * testsuite/ifuncdep2.c: New file.
4974 * testsuite/ifuncmain2.c: New file.
4975 * testsuite/ifuncmain3.c: New file.
4976 * testsuite/ifuncmod3.c: New file.
4977 * testsuite/ifuncmain4.c: New file.
4978 * testsuite/ifuncmain5.c: New file.
4979 * testsuite/ifuncmod5.c: New file.
4980 * testsuite/ifuncmain6pie.c: New file.
4981 * testsuite/ifuncmod6.c: New file.
4982 * testsuite/ifuncmain7.c: New file.
4983 * configure, testsuite/Makefile.in: Rebuild.
4985 2010-08-18 Ian Lance Taylor <iant@google.com>
4988 (Output_section_incremental_inputs::write_input_files): Add cast
4989 to avoid signed/unsigned comparison warning.
4990 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4992 2010-08-12 Cary Coutant <ccoutant@google.com>
4994 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4996 2010-08-13 Ian Lance Taylor <iant@google.com>
4998 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5000 2010-08-12 Cary Coutant <ccoutant@google.com>
5001 Doug Kwan <dougkwan@google.com>
5003 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5004 defintion overrides non-weak undef, remember that the original undef
5006 * symtab.cc (Symbol_table::sized_write_global): For undef without
5007 an original weak binding, set binding to global in output.
5008 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5009 * testsuite/Makefile.in: Regenerate.
5010 * testsuite/strong_ref_weak_def.sh: New file.
5011 * testsuite/strong_ref_weak_def_1.c: Ditto.
5012 * testsuite/strong_ref_weak_def_2.c: Ditto.
5014 2010-08-12 Cary Coutant <ccoutant@google.com>
5016 * testsuite/incremental_test.sh: Rewrite.
5017 * testsuite/incremental_test_1.c: Rewrite.
5018 * testsuite/incremental_test_2.c: Rewrite.
5020 2010-08-12 Cary Coutant <ccoutant@google.com>
5022 * arm.cc (Target_arm::got_size): Add const.
5023 (Target_arm::got_entry_count): New function.
5024 (Target_arm::plt_entry_count): New function.
5025 (Target_arm::first_plt_entry_offset): New function.
5026 (Target_arm::plt_entry_size): New function.
5027 (Output_data_plt_arm::entry_count): New function.
5028 (Output_data_plt_arm::first_plt_entry_offset): New function.
5029 (Output_data_plt_arm::get_plt_entry_size): New function.
5030 * i386.cc (Target_i386::got_size): Add const.
5031 (Target_i386::got_entry_count): New function.
5032 (Target_i386::plt_entry_count): New function.
5033 (Target_i386::first_plt_entry_offset): New function.
5034 (Target_i386::plt_entry_size): New function.
5035 (Output_data_plt_i386::entry_count): New function.
5036 (Output_data_plt_i386::first_plt_entry_offset): New function.
5037 (Output_data_plt_i386::get_plt_entry_size): New function.
5038 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5039 find_incremental_inputs_sections. Dump incremental_got_plt section.
5040 * incremental.cc: Include target.h.
5041 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5042 parameter. Adjust all callers. Find incremental_got_plt section.
5043 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5045 (Output_section_incremental_inputs::set_final_data_size): Calculate
5046 size of incremental_got_plt section.
5047 (Output_section_incremental_inputs::do_write): Write the
5048 incremental_got_plt section.
5049 (Got_plt_view_info): New struct.
5050 (Local_got_offset_visitor): New class.
5051 (Global_got_offset_visitor): New class.
5052 (Global_symbol_visitor_got_plt): New class.
5053 (Output_section_incremental_inputs::write_got_plt): New function.
5054 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5055 Add parameter. Adjust all callers.
5056 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5057 (Incremental_inputs::got_plt_section): New function.
5058 (Incremental_inputs::got_plt_section_): New data member.
5059 (Incremental_got_plt_reader): New class.
5060 * layout.cc (Layout::create_incremental_info_sections): Add the
5061 incremental_got_plt section.
5062 * object.h (Got_offset_list::get_list): New function.
5063 (Got offset_list::for_all_got_offsets): New function.
5064 (Sized_relobj::local_got_offset_list): New function.
5065 * powerpc.cc (Target_powerpc::got_size): Add const.
5066 (Target_powerpc::got_entry_count): New function.
5067 (Target_powerpc::plt_entry_count): New function.
5068 (Target_powerpc::first_plt_entry_offset): New function.
5069 (Target_powerpc::plt_entry_size): New function.
5070 (Output_data_plt_powerpc::entry_count): New function.
5071 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5072 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5073 * sparc.cc (Target_sparc::got_size): Add const.
5074 (Target_sparc::got_entry_count): New function.
5075 (Target_sparc::plt_entry_count): New function.
5076 (Target_sparc::first_plt_entry_offset): New function.
5077 (Target_sparc::plt_entry_size): New function.
5078 (Output_data_plt_sparc::entry_count): New function.
5079 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5080 (Output_data_plt_sparc::get_plt_entry_size): New function.
5081 * symtab.h (Symbol::got_offset_list): New function.
5082 (Symbol_table::for_all_symbols): New function.
5083 * target.h (Sized_target::got_entry_count): New function.
5084 (Sized_target::plt_entry_count): New function.
5085 (Sized_target::plt_entry_size): New function.
5086 * x86_64.cc (Target_x86_64::got_size): Add const.
5087 (Target_x86_64::got_entry_count): New function.
5088 (Target_x86_64::plt_entry_count): New function.
5089 (Target_x86_64::first_plt_entry_offset): New function.
5090 (Target_x86_64::plt_entry_size): New function.
5091 (Output_data_plt_x86_64::entry_count): New function.
5092 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5093 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5095 2010-08-12 Cary Coutant <ccoutant@google.com>
5097 * archive.cc: Include incremental.h.
5098 (Archive::Archive): Initialize incremental_info_.
5099 (Archive::include_member): Record archive members in incremental info.
5100 (Add_archive_symbols::run): Record begin and end of an archive in
5102 (Lib_group::include_member): Record objects in incremental info.
5103 * archive.h (Incremental_archive_entry): Forward declaration.
5104 (Archive::set_incremental_info): New member function.
5105 (Archive::incremental_info): New member function.
5106 (Archive::Unused_symbol_iterator): New class.
5107 (Archive::unused_symbols_begin): New member function.
5108 (Archive::unused_symbols_end): New member function.
5109 (Archive::incremental_info_): New data member.
5110 * incremental-dump.cc (find_input_containing_global): New function.
5111 (dump_incremental_inputs): Dump new incremental info sections.
5112 * incremental.cc: Include symtab.h.
5113 (Output_section_incremental_inputs): New class.
5114 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5115 new incremental info sections.
5116 (Sized_incremental_binary::do_check_inputs): Likewise.
5117 (Incremental_inputs::report_archive): Remove.
5118 (Incremental_inputs::report_archive_begin): New function.
5119 (Incremental_inputs::report_archive_end): New function.
5120 (Incremental_inputs::report_object): New function.
5121 (Incremental_inputs::finalize_inputs): Remove.
5122 (Incremental_inputs::report_input_section): New function.
5123 (Incremental_inputs::report_script): Rewrite.
5124 (Incremental_inputs::finalize): Do nothing but finalize string table.
5125 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5126 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5127 (Incremental_inputs::create_data_sections): New function.
5128 (Incremental_inputs::relocs_entsize): New function.
5129 (Output_section_incremental_inputs::set_final_data_size): New function.
5130 (Output_section_incremental_inputs::do_write): New function.
5131 (Output_section_incremental_inputs::write_header): New function.
5132 (Output_section_incremental_inputs::write_input_files): New function.
5133 (Output_section_incremental_inputs::write_info_blocks): New function.
5134 (Output_section_incremental_inputs::write_symtab): New function.
5135 * incremental.h (Incremental_script_entry): Forward declaration.
5136 (Incremental_object_entry): Forward declaration.
5137 (Incremental_archive_entry): Forward declaration.
5138 (Incremental_inputs): Forward declaration.
5139 (Incremental_inputs_header_data): Remove.
5140 (Incremental_inputs_header): Remove.
5141 (Incremental_inputs_header_write): Remove.
5142 (Incremental_inputs_entry_data): Remove.
5143 (Incremental_inputs_entry): Remove.
5144 (Incremental_inputs_entry_write): Remove.
5145 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5146 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5147 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5148 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5150 (Incremental_input_entry): New class.
5151 (Incremental_script_entry): New class.
5152 (Incremental_object_entry): New class.
5153 (Incremental_archive_entry): New class.
5154 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5155 (Incremental_inputs::report_inputs): Remove.
5156 (Incremental_inputs::report_archive): Remove.
5157 (Incremental_inputs::report_archive_begin): New function.
5158 (Incremental_inputs::report_archive_end): New function.
5159 (Incremental_inputs::report_object): Change prototype.
5160 (Incremental_inputs::report_input_section): New function.
5161 (Incremental_inputs::report_script): Change prototype.
5162 (Incremental_inputs::get_reloc_count): New function.
5163 (Incremental_inputs::set_reloc_count): New function.
5164 (Incremental_inputs::create_data_sections): New function.
5165 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5166 (Incremental_inputs::inputs_section): New function.
5167 (Incremental_inputs::symtab_section): New function.
5168 (Incremental_inputs::relocs_section): New function.
5169 (Incremental_inputs::get_stringpool): Add const.
5170 (Incremental_inputs::command_line): Add const.
5171 (Incremental_inputs::inputs): Remove.
5172 (Incremental_inputs::command_line_key): New function.
5173 (Incremental_inputs::input_file_count): New function.
5174 (Incremental_inputs::input_files): New function.
5175 (Incremental_inputs::relocs_entsize): New function.
5176 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5177 (Incremental_inputs::finalize_inputs): Remove.
5178 (Incremental_inputs::Input_info): Remove.
5179 (Incremental_inputs::lock_): Remove.
5180 (Incremental_inputs::inputs_): Change type.
5181 (Incremental_inputs::inputs_map_): Remove.
5182 (Incremental_inputs::current_object_entry_): New data member.
5183 (Incremental_inputs::inputs_section_): New data member.
5184 (Incremental_inputs::symtab_section_): New data member.
5185 (Incremental_inputs::relocs_section_): New data member.
5186 (Incremental_inputs::reloc_count_): New data member.
5187 (Incremental_inputs_reader): New class.
5188 (Incremental_symtab_reader): New class.
5189 (Incremental_relocs_reader): New class.
5190 * layout.cc (Layout::finalize): Move finalization of incremental info
5191 and creation of incremental info sections to follow finalization of
5192 symbol table. Set offsets for postprocessing sections.
5193 (Layout::create_incremental_info_sections): Call
5194 Incremental_inputs::create_data_sections. Add incremental symtab
5195 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5196 sections to layout after input sections.
5197 * layout.h (struct Timespec): Forward declaration.
5198 (Layout::incremental_inputs): Add const.
5199 (Layout::create_incremental_info_sections): Add parameter.
5200 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5201 * object.cc: Include incremental.h.
5202 (Relobj::finalize_incremental_relocs): New function.
5203 (Sized_relobj::do_layout): Record input sections in incremental info.
5204 * object.h (Object::output_section): New function.
5205 (Object::output_section_offset): Moved from Relobj.
5206 (Object::get_incremental_reloc_base): New function.
5207 (Object::get_incremental_reloc_count): New function.
5208 (Object::do_output_section): New function.
5209 (Object::do_output_section_offset): Moved from Relobj.
5210 (Object::do_get_incremental_reloc_base): New function.
5211 (Object::do_get_incremental_reloc_count): New function.
5212 (Object::Object): Initialize new data members.
5213 (Relobj::output_section): Renamed do_output_section and moved to
5215 (Relobj::output_section_offset): Moved to Object.
5216 (Relobj::do_get_incremental_reloc_base): New function.
5217 (Relobj::do_get_incremental_reloc_count): New function.
5218 (Relobj::allocate_incremental_reloc_counts): New function.
5219 (Relobj::count_incremental_reloc): New function.
5220 (Relobj::finalize_incremental_relocs): New function.
5221 (Relobj::next_incremental_reloc_index): New function.
5222 (Relobj::reloc_counts_): New data member.
5223 (Relobj::reloc_bases_): New data member.
5224 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5225 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5226 (Sized_relobj::incremental_relocs_scan): New function.
5227 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5228 (Sized_relobj::incremental_relocs_write): New function.
5229 (Sized_relobj::incremental_relocs_write_reltype): New function.
5230 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5232 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5233 archives and object files elsewhere.
5234 (Add_symbols::run): Report object files here.
5235 (Finish_group::run): Report end of archive at end of group.
5236 * reloc.cc: Include layout.h, incremental.h.
5237 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5238 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5239 (Sized_relobj::incremental_relocs_scan): New function.
5240 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5241 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5242 (Sized_relobj::incremental_relocs_write): New function.
5243 (Sized_relobj::incremental_relocs_write_reltype): New function.
5244 * script.cc (read_input_script): Rewrite test for incremental link.
5245 Change call to Incremental_inputs::report_script.
5246 * symtab.h (Symbol_table::first_global_index): New function.
5247 (Symbol_table::output_count): New function.
5249 2010-08-12 Doug Kwan <dougkwan@google.com>
5251 * arm.cc (Target_arm::merge_object_attributes): Check command line
5252 options --no-wchar-size-warning and --no-enum-size-warning.
5253 * options.h (General_options): Add ld-compatible options
5254 --no-enum-size-warning and --no-wchar-size-warning.
5256 2010-08-04 Ian Lance Taylor <iant@google.com>
5258 * x86_64.cc (Target_x86_64::Scan::local): Use
5259 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5260 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5261 (Target_x86_64::Scan::global): Likewise.
5262 (Target_x86_64::Relocate::relocate): Likewise.
5263 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5266 2010-08-03 Cary Coutant <ccoutant@google.com>
5268 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5269 to reserve space in merged_strings vector. Keep total input size
5271 (Output_merge_string::do_print_merge_stats): Print total input size.
5272 * merge.h (Output_merge_string): Add input_size_ field.
5273 * stringpool.cc (Stringpool_template::string_length): Move
5274 implementations out of Stringpool_template class and place in
5276 * stringpool.h (string_length): Move out of Stringpool_template.
5278 2010-08-03 Ian Lance Taylor <iant@google.com>
5281 * layout.cc (relaxation_loop_body): If address of load segment is
5282 set, adjust address to include headers if possible.
5284 2010-08-03 Ian Lance Taylor <iant@google.com>
5286 * version.cc (version_string): Bump to 1.10.
5288 2010-08-03 Ian Lance Taylor <iant@google.com>
5291 * layout.h (enum Output_section_order): Define.
5292 (class Layout): Update declarations.
5293 * layout.cc (Layout::get_output_section): Add order parameter.
5294 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5295 is_first_non_relro parameters. Change all callers.
5296 (Layout::choose_output_section): Likewise.
5297 (Layout::add_output_section_data): Likewise.
5298 (Layout::make_output_section): Likewise. Set order.
5299 (Layout::default_section_order): New function.
5300 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5301 * output.cc (Output_section::Output_section): Initialize order_.
5302 Don't initialize deleted fields.
5303 (Output_segment::Output_segment): Don't initialize deleted
5305 (Output_segment::add_output_section_to_load): New function
5306 replacing add_output_section. Change all callers to call this or
5307 add_output_section_to_nonload.
5308 (Output_segment::add_output_section_to_nonload): New function.
5309 (Output_segment::remove_output_section): Rewrite.
5310 (Output_segment::add_initial_output_data): Likewise.
5311 (Output_segment::has_any_data_sections): Likewise.
5312 (Output_segment::is_first_section_relro): Likewise.
5313 (Output_segment::maximum_alignment): Likewise.
5314 (Output_segment::has_dynamic_reloc): New function replacing
5315 dynamic_reloc_count. Change all callers.
5316 (Output_segment::has_dynamic_reloc_list): New function replacing
5317 dynamic_reloc_count_list. Change all callers.
5318 (Output_segment::set_section_addresses): Rewrite.
5319 (Output_segment::set_offset): Rewrite.
5320 (Output_segment::find_first_and_last_list): Remove.
5321 (Output_segment::set_tls_offsets): Rewrite.
5322 (Output_segment::first_section_load_address): Likewise.
5323 (Output_segment::output_section_count): Likewise.
5324 (Output_segment::section_with_lowest_load_address): Likewise.
5325 (Output_segment::write_section_headers): Likewise.
5326 (Output_segment::print_sections_to_map): Likewise.
5327 * output.h (class Output_data): Remove dynamic_reloc_count_
5328 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5329 (Output_data::add_dynamic_reloc): Rewrite.
5330 (Output_data::has_dynamic_reloc): New function.
5331 (Output_data::dynamic_reloc_count): Remove.
5332 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5333 is_last_relro_, is_first_non_relro_, is_interp_,
5334 is_dynamic_linker_section_ fields. Add order and set_order
5335 functions. Remove is_relro_local, set_is_relro_local,
5336 is_last_relro, set_is_last_relro, is_first_non_relro,
5337 set_is_first_non_relro functions, is_interp, set_is_interp,
5338 is_dynamic_linker_section, and set_is_dynamic_linker_section
5340 (class Output_segment): Change Output_data_list from std::list to
5341 std:;vector. Add output_lists_ field. Remove output_data_ and
5342 output_bss_ fields. Update declarations.
5344 2010-08-02 Ian Lance Taylor <iant@google.com>
5346 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5347 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5348 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5350 2010-08-02 Ian Lance Taylor <iant@google.com>
5353 * script.cc (Script_options::Script_options): Initialize
5354 symbol_definitions_ and symbol_references_.
5355 (Script_options::add_symbol_assignment): Update
5356 symbol_definitions_ and symbol_references_.
5357 (Script_options::add_symbol_reference): New function.
5358 (script_symbol): New function.
5359 * script.h (class Script_options): Add symbol_definitions_ and
5360 symbol_references_ fields.
5361 (Script_options::referenced_const_iterator): New type.
5362 (Script_options::referenced_begin): New function.
5363 (Script_options::referenced_end): New function.
5364 (Script_options::is_referenced): New function.
5365 (Script_options::any_unreferenced): New function.
5366 * script-c.h (script_symbol): Declare.
5367 * yyscript.y (exp): Call script_symbol.
5368 * symtab.cc: Include "script.h".
5369 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5370 Change all callers. Check symbols referenced by scripts.
5371 (Symbol_table::add_undefined_symbols_from_command_line): Add
5372 layout parameter. Change all callers.
5373 (Symbol_table::do_add_undefined_symbols_from_command_line):
5374 Likewise. Break out loop body. Check symbols referenced by
5376 (Symbol_table::add_undefined_symbol_from_command_line): New
5377 function broken out of
5378 do_add_undefined_symbols_from_command_line.
5379 * symtab.h (class Symbol_table): Update declarations.
5380 * archive.cc: Include "layout.h".
5381 (Archive::should_include_member): Add layout parameter. Change
5382 all callers. Check for symbol mentioned in expression.
5383 * archive.h (class Archive): Update declaration.
5384 * object.cc (Sized_relobj::do_should_include_member): Add layout
5386 * object.h (Object::should_include_member): Add layout parameter.
5388 (Object::do_should_include_member): Add layout parameter.
5389 (class Sized_relobj): Update declaration.
5390 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5392 * dynobj.h (class Sized_dynobj): Update declaration.
5393 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5395 * plugin.h (class Sized_pluginobj): Update declaration.
5397 2010-08-02 Ian Lance Taylor <iant@google.com>
5400 * output.cc (Output_segment::set_offset): Search for the first and
5401 last sections rather than assuming that the list is in order.
5402 (Output_segment::find_first_and_last_list): New function.
5403 * output.h (class Output_segment): Update declarations.
5404 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5405 (relro_strip_test_SOURCES): New variable.
5406 (relro_strip_test_DEPENDENCIES): New variable.
5407 (relro_strip_test_LDFLAGS): New variable.
5408 (relro_strip_test_LDADD): New variable.
5409 (relro_strip_test.so): New target.
5411 2010-08-02 Ian Lance Taylor <iant@google.com>
5413 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5414 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5415 (Target_i386::got_tlsdesc_section): New function.
5416 (Target_i386::got_section): Create space for GOT entries for
5417 TLSDESC relocations.
5418 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5420 (Target_i386::Scan::global): Likewise.
5421 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5423 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5424 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5425 (Target_x86_64::got_tlsdesc_section): New function.
5426 (Target_x86_64::got_section): Create space for GOT entries for
5427 TLSDESC relocations.
5428 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5430 (Target_x86_64::Scan::global): Likewise.
5431 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5434 2010-08-02 Ian Lance Taylor <iant@google.com>
5436 * testsuite/final_layout.sh: Use dc to convert from hex to
5439 2010-07-29 Sriraman Tallam <tmsriram@google.com>
5441 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5442 paramter to the call to gold::gc_process_relocs.
5443 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5444 paramter to the call to gold::gc_process_relocs.
5445 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5446 parameter to the call to gold::gc_process_relocs.
5447 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5448 template parameter to the call to gold::gc_process_relocs.
5449 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5450 paramter to the call to gold::gc_process_relocs.
5451 * gc.h (get_embedded_addend_size): New function.
5452 (gc_process_relocs): Save the size of the reloc for use by ICF.
5453 * icf.cc (get_section_contents): Get the addend from the text section
5454 for SHT_REL relocation sections.
5455 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5456 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5457 * int_encoding.h (read_from_pointer): New overloaded function.
5458 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5459 * testsuite/icf_sht_rel_addend_test.sh: New file.
5460 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5461 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5463 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5465 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5466 * Makefile.in: Regenerate.
5467 * testsuite/Makefile.in: Regenerate.
5469 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5471 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5472 * gold/testsuite/debug_msg.cc: Likewise.
5473 * gold/testsuite/odr_violation1.cc
5474 * gold/testsuite/odr_violation2.cc
5476 2010-07-21 Cary Coutant <ccoutant@google.com>
5478 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5479 string, and length fields.
5480 (Output_merge_string::Merged_strings_list): New type.
5481 (Output_merge_string::Merged_strings_lists): New typedef.
5482 (Output_merge_string): Replace merged_strings_ with
5483 merged_strings_lists_.
5484 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5485 Merged_strings_list per input object and section. Don't store pointer
5486 to the string. Don't store length with each merged string entry.
5487 (Output_merge_string::finalize_merged_data): Loop over list of merged
5488 strings lists. Recompute length of each merged string.
5490 2010-07-15 Cary Coutant <ccoutant@google.com>
5492 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5495 2010-07-14 Ian Lance Taylor <iant@google.com>
5497 * descriptors.cc (Descriptors::open): Report correct name in error
5500 2010-07-13 Doug Kwan <dougkwan@google.com>
5502 * arm.cc (Arm_input_section::Arm_input_section): For a
5503 SHT_ARM_EXIDX section, always keeps the input sections.
5504 (Arm_input_section::set_exidx_section_link): New method.
5505 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5506 has_errors_ to false.
5507 (Arm_exidx_input_section::has_errors,
5508 Arm_exidx_input_section::set_has_errors): New methods.
5509 (Arm_exidx_input_section::has_errors_): New data member.
5510 (Arm_relobj::get_exidx_shndx_list): New method.
5511 (Arm_output_section::append_text_sections_to_list): Do not skip
5512 section without SHF_EXECINSTR.
5513 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5515 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5516 section header. Make error messages more verbose. Check for
5517 a non-executable section linked to an EXIDX section.
5518 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5519 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5520 check that there is no deferred EXIDX section if we exit early.
5521 Instead of not making an EXIDX section in case of an error, make one
5522 and set the has_errors flag of it.
5523 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5524 in a relocatable link.
5525 (Target_arm::do_relax): Look for the EXIDX output section instead of
5526 assuming that it is called .ARM.exidx.
5527 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5528 section list. Do not check for SHF_EXECINSTR section flags but
5529 skip any input section with errors.
5530 * output.cc (Output_section::Output_section): Initialize
5531 always_keeps_input_sections_ to false.
5532 (Output_section::add_input_section): Check for
5533 always_keeps_input_sections_.
5534 * output.h (Output_section::always_keeps_input_sections,
5535 Output_section::set_always_keeps_input_sections): New methods.
5536 (Output_section::always_keeps_input_sections): New data member.
5538 2010-07-13 Rafael Espindola <espindola@google.com>
5540 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5541 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5543 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5544 Ian Lance Taylor <iant@google.com>
5546 * output.h (Output_section_lookup_maps::add_merge_section):
5547 Correct check of whether value was inserted.
5548 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5549 (Output_section_lookup_maps::add_relaxed_input_section):
5551 * arm.cc (Target_arm::got_section): Remove used local os.
5552 * i386.cc (Target_i386::got_section): Likewise.
5553 * x86_64.cc (Target_x86_64::got_section): Likewise.
5554 * sparc.cc (Target_sparc::got_section): Likewise.
5555 (Target_sparc::relocate): Remove unused local have_got_offset.
5556 * powerpc.cc (Target_powerpc::relocate): Likewise.
5558 2010-07-13 Ian Lance Taylor <iant@google.com>
5560 * compressed_output.cc (zlib_decompress): Fix signature in
5563 * archive.cc (Archive::include_member): Unlock an external member
5564 of a thin archive. Don't bother to delete an object we know is
5567 2010-07-12 Cary Coutant <ccoutant@google.com>
5569 * compressed_output.cc (zlib_decompress): New function.
5570 (get_uncompressed_size): New function.
5571 (decompress_input_section): New function.
5572 * compressed_output.h (get_uncompressed_size): New function.
5573 (decompress_input_section): New function.
5574 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5575 Handle compressed debug sections.
5576 * layout.cc (is_compressed_debug_section): New function.
5577 (Layout::output_section_name): Map compressed section names to
5579 * layout.h (is_compressed_debug_section): New function.
5580 (is_debug_info_section): Recognize compressed debug sections.
5581 * merge.cc: Include compressed_output.h.
5582 (Output_merge_data::do_add_input_section): Handle compressed
5584 (Output_merge_string::do_add_input_section): Handle compressed
5586 * object.cc: Include compressed_output.h.
5587 (Sized_relobj::Sized_relobj): Initialize new data members.
5588 (build_compressed_section_map): New function.
5589 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5590 * object.h (Object::section_is_compressed): New method.
5591 (Object::do_section_is_compressed): New method.
5592 (Sized_relobj::Compressed_section_map): New type.
5593 (Sized_relobj::do_section_is_compressed): New method.
5594 (Sized_relobj::compressed_sections_): New data member.
5595 * output.cc (Output_section::add_input_section): Handle compressed
5597 * reloc.cc: Include compressed_output.h.
5598 (Sized_relobj::write_sections): Handle compressed debug sections.
5600 2010-07-08 Cary Coutant <ccoutant@google.com>
5602 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5603 weak when resolving to a dynamic def.
5604 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5605 for weak undef/dynamic def cases. Adjust callers.
5606 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5607 undef_binding_weak_.
5608 (Symbol_table::sized_write_globals): Adjust symbol binding.
5609 (Symbol_table::sized_write_symbol): Add binding parameter.
5610 * symtab.h (Symbol::set_undef_binding): New method.
5611 (Symbol::is_undef_binding_weak): New method.
5612 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5613 (Symbol_table::should_override): Add new parameter.
5614 (Symbol_table::sized_write_symbol): Add new parameter.
5616 * testsuite/weak_undef_file1.cc: Add new test case.
5617 * testsuite/weak_undef_file2.cc: Fix header comment.
5618 * testsuite/weak_undef_test.cc: Add new test case.
5620 2010-06-29 Doug Kwan <dougkwan@google.com>
5622 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5623 Initialize USE_SYMBOL_.
5624 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5626 (Arm_reloc_property::uses_symbol_): New data member declaration.
5627 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5628 uses symbol value and symbol is undefined but not weakly undefined.
5630 2010-06-28 Rafael Espindola <espindola@google.com>
5632 * plugin.cc (Plugin::load): Use dlerror.
5634 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5636 * symtab.cc (detect_odr_violations): When reporting an ODR
5637 violation, report an object where the symbol is defined.
5639 2010-06-25 Doug Kwan <dougkwan@google.com>
5641 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5642 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5644 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5645 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5646 target hook to detect function points.
5647 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5648 * icf.h (Icf::check_section_for_function_pointers): Change type of
5649 parameter SECTION_NAME to const reference to std::string. Use
5650 target hook to determine if section may have unsafe pointers.
5651 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5654 2010-06-21 Rafael Espindola <espindola@google.com>
5656 * fileread.cc (Input_file::find_fie): New
5657 (Input_file::open): Use Input_file::find_fie.
5658 * fileread.h (Input_file::find_fie): New
5659 * plugin.cc (set_extra_library_path): New.
5660 (Plugin::load): Add set_extra_library_path to the transfer vector.
5661 (Plugin_manager::set_extra_library_path): New.
5662 (Plugin_manager::add_input_file): Use the extra search path if set.
5663 (set_extra_library_path(): New.
5664 * plugin.h (Plugin_manager): Add set_extra_library_path and
5667 2010-06-19 Cary Coutant <ccoutant@google.com>
5669 * layout.cc (gdb_sections): Add .debug_types.
5670 (lines_only_debug_sections): Likewise.
5672 2010-06-18 Rafael Espindola <espindola@google.com>
5674 * plugin.cc (add_input_file,add_input_library)
5675 (Plugin_manager::add_input_file): Make filename arguments const.
5676 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5679 2010-06-16 Doug Kwan <dougkwan@google.com>
5681 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5682 .ARM.attributes section if we have not merged any input
5683 attributes sections.
5685 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5687 * arm.cc: Allow combining objects with no EABI version
5690 2010-06-15 Rafael Espindola <espindola@google.com>
5692 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5694 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5696 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5697 (struct iovec): Correct !HAVE_READV definition.
5699 2010-06-10 Cary Coutant <ccoutant@google.com>
5701 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5702 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5704 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5707 * symtab.h (Symbol::is_placeholder): New member function.
5708 * target-reloc.h (relocate_section): Check for placeholder symbols.
5710 * testsuite/Makefile.am (plugin_test_8): New test.
5711 (plugin_test_9): New test.
5712 * testsuite/Makefile.in: Regenerate.
5714 2010-06-09 Nick Clifton <nickc@redhat.com>
5716 * yyscript.y (input_list_element): Allow strings prefixed with
5717 the '-' character. Treat these as libraries.
5718 * script.cc (script_add_library): New function. Adds a library
5719 specified by "-l<name>" found in an input script.
5720 * script-c.h: Add prototype for script_add_library.
5722 2010-06-07 Doug Kwan <dougkwan@google.com>
5724 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5725 Restrict stub-group size to be within long conditional branch
5726 range when working around cortex-A8 erratum.
5728 2010-06-07 Damien Diederen <dd@crosstwine.com>
5730 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5733 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5737 (Output_section::Input_section_sort_entry::compare_section_ordering):
5738 Change to return non-zero correctly.
5739 (Output_section::Input_section_sort_section_order_index_compare
5740 ::operator()): Change to fix ambiguity in comparisons.
5742 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5744 * gold.h (is_wildcard_string): New function.
5745 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5746 (Layout::layout_eh_frame): Ditto.
5747 (Layout::find_section_order_index): New method.
5748 (Layout::read_layout_from_file): New method.
5749 * layout.h (Layout::find_section_order_index): New method.
5750 (Layout::read_layout_from_file): New method.
5751 (Layout::input_section_position_): New private member.
5752 (Layout::input_section_glob_): New private member.
5753 * main.cc (main): Call read_layout_from_file here.
5754 * options.h (--section-ordering-file): New option.
5755 * output.cc (Output_section::input_section_order_specified_): New
5757 (Output_section::Output_section): Initialize new member.
5758 (Output_section::add_input_section): Add new parameter.
5759 Keep input sections when --section-ordering-file is used.
5760 (Output_section::set_final_data_size): Sort input sections when
5761 section ordering file is specified.
5762 (Output_section::Input_section_sort_entry): Add new parameter.
5764 (Output_section::Input_section_sort_entry::compare_section_ordering):
5766 (Output_section::Input_section_sort_compare::operator()): Change to
5767 consider section_order_index.
5768 (Output_section::Input_section_sort_init_fini_compare::operator()):
5769 Change to consider section_order_index.
5770 (Output_section::Input_section_sort_section_order_index_compare
5771 ::operator()): New method.
5772 (Output_section::sort_attached_input_sections): Change to sort
5773 according to section order when specified.
5774 (Output_section::add_input_section<32, true>): Add new parameter.
5775 (Output_section::add_input_section<64, true>): Add new parameter.
5776 (Output_section::add_input_section<32, false>): Add new parameter.
5777 (Output_section::add_input_section<64, false>): Add new parameter.
5778 * output.h (Output_section::add_input_section): Add new parameter.
5779 (Output_section::input_section_order_specified): New
5781 (Output_section::set_input_section_order_specified): New method.
5782 (Input_section::Input_section): Initialize section_order_index_.
5783 (Input_section::section_order_index): New method.
5784 (Input_section::set_section_order_index): New method.
5785 (Input_section::section_order_index_): New member.
5786 (Input_section::Input_section_sort_section_order_index_compare): New
5788 (Output_section::input_section_order_specified_): New member.
5789 * script-sections.cc (is_wildcard_string): Delete and move modified
5791 (Output_section_element_input::Output_section_element_input): Modify
5792 call to is_wildcard_string.
5793 (Output_section_element_input::Input_section_pattern
5794 ::Input_section_pattern): Ditto.
5795 (Output_section_element_input::Output_section_element_input): Ditto.
5796 * testsuite/Makefile.am (final_layout): New test case.
5797 * testsuite/Makefile.in: Regenerate.
5798 * testsuite/final_layout.cc: New file.
5799 * testsuite/final_layout.sh: New file.
5801 2010-06-01 Rafael Espindola <espindola@google.com>
5803 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5805 2010-06-01 Rafael Espindola <espindola@google.com>
5807 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5808 visibility of symbols.
5810 2010-05-27 Doug Kwan <dougkwan@google.com>
5812 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5813 from start of output section instead of address for a local symbol
5814 in a merged or relaxed section when doing a relocatable link.
5816 2010-05-26 Rafael Espindola <espindola@google.com>
5819 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5820 adding sections the garbage collector removed.
5821 * gold/testsuite/Makefile.am: Add test.
5822 * gold/testsuite/Makefile.in: Regenerate.
5823 * gold/testsuite/plugin_test_7.sh: New.
5824 * gold/testsuite/plugin_test_7_1.c: New.
5825 * gold/testsuite/plugin_test_7_2.c: New.
5827 2010-05-26 Rafael Espindola <espindola@google.com>
5829 * script-sections.cc (Output_section_definition::set_section_addresses):
5830 Check for --section-start.
5832 2010-05-26 Doug Kwan <dougkwan@google.com>
5834 * arm.cc (Arm_scan_relocatable_relocs): New class.
5835 (Target_arm::relocate_special_relocatable): New method.
5836 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5837 (Arm_relocate_functions::thumb_branch_common): Same.
5838 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5839 instead of Default_scan_relocatable_relocs.
5840 * target-reloc.h (relocate_for_relocatable): Let target handle
5841 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5842 * target.h (Sized_target::relocate_special_relocatable): New method.
5844 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5846 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5848 2010-05-23 Doug Kwan <dougkwan@google.com>
5850 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5852 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5853 with a direct branch, not a conditional branch, to a stub.
5854 * merge.cc (Output_merge_base::record_input_section): New method
5856 (Output_merge_data::do_add_input_section): Record input section if
5857 keeps-input-sections flag is set.
5858 (Output_merge_string::do_add_input_section): Ditto.
5859 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5860 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5862 (Output_merge_base::keeps_input_sections,
5863 Output_merge_base::set_keeps_input_sections,
5864 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5866 (Output_merge_base::Input_sections): New type declaration.
5867 (Output_merge_base::input_sections_begin,
5868 Output_merge_base::input_sections_end,
5869 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5870 (Output_merge_base::bool keeps_input_sections_,
5871 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5872 Output_merge_base::input_sections_): New data members.
5873 (Output_merge_data::do_set_keeps_input_sections): New method
5875 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5876 * output.cc (Output_section::Input_section::relobj): Move method
5877 defintion from class declaration to here and handle merge sections.
5878 (Output_section::Input_section::shndx): Ditto.
5879 (Output_section::Output_section): Remove initializations of removed
5880 data members and initialize new data member LOOKUP_MAPS_.
5881 (Output_section::add_input_section): Set keeps-input-sections flag
5882 for a newly created merge output section as appropriate. Adjust code
5883 to use Output_section_lookup_maps class.
5884 (Output_section::add_relaxed_input_section): Adjst code for lookup
5885 maps code refactoring.
5886 (Output_section::add_merge_input_section): Add a new parameter
5887 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5888 class. If adding input section to a newly created merge output
5889 section fails, remove the new merge section.
5890 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5891 Adjust code for use of the Output_section_lookup_maps class.
5892 (Output_section::find_merge_section): Ditto.
5893 (Output_section::build_lookup_maps): New method defintion.
5894 (Output_section::find_relaxed_input_section): Adjust code to use
5895 Output_section_lookup_maps class.
5896 (Output_section::get_input_sections): Export merge sections. Adjust
5897 code to use Output_section_lookup_maps class.
5898 (Output_section:::add_script_input_section): Adjust code to use
5899 Output_section_lookup_maps class. Update lookup maps for merge
5901 (Output_section::discard_states): Use Output_section_lookup_maps.
5902 (Output_section::restore_states): Same.
5903 * output.h (Merge_section_properties): Move class defintion out of
5905 (Output_section_lookup_maps): New class.
5906 (Output_section::Input_section::is_merge_section): New method
5908 (Output_section::Input_section::relobj): Move defintion out of class
5909 defintion. Declare method only.
5910 (Output_section::Input_section::shndx): Ditto.
5911 (Output_section::Input_section::output_merge_base): New method defintion.
5912 (Output_section::Input_section::u2_.pomb): New union field.
5913 (Output_section::Merge_section_by_properties_map,
5914 Output_section::Output_section_data_by_input_section_map,
5915 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5917 (Output_section::add_merge_input_section): Add new parameter
5918 KEEPS_INPUT_SECTIONS.
5919 (Output_section::build_lookup_maps): New method declaration.
5920 (Output_section::merge_section_map_,
5921 Output_section::merge_section_by_properties_map_,
5922 Output_section::relaxed_input_section_map_,
5923 Output_section::is_relaxed_input_section_map_valid_): Remove data
5925 (Output_section::lookup_maps_): New data member.
5927 2010-05-21 Doug Kwan <dougkwan@google.com>
5930 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5931 avoid a compilation error.
5933 2010-05-19 Rafael Espindola <espindola@google.com>
5935 * script-sections.cc (Output_section_definition::allocate_to_segment):
5936 Update the phdrs_list even when the output section is NULL.
5937 * testsuite/Makefile.am: Add test.
5938 * testsuite/Makefile.in: Regenerate.
5939 * testsuite/script_test_9.cc: New.
5940 * testsuite/script_test_9.sh: New.
5941 * testsuite/script_test_9.t: New.
5943 2010-05-19 Doug Kwan <dougkwan@google.com>
5945 * arm.cc (Arm_input_section::original_size): New method.
5946 (Arm_input_section::do_addralign): Add a cast.
5947 (Arm_input_section::do_output_offset): Remove static cast.
5948 (Arm_input_section::original_addralign,
5949 Arm_input_section::original_size_): Change type to uint32_t.
5950 (Arm_input_section::init): Add safe casts for section alignment
5952 (Arm_input_section::set_final_data_size): Do not set address and
5953 offset of stub table.
5954 (Arm_output_section::fix_exidx_coverage): Change use of of
5955 Output_section::Simple_input_section to that of
5956 Output_section::Input_section.
5957 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5958 except for the first pass.
5959 * output.cc (Output_section::get_input_sections): Change type of
5960 input_sections to std::list<Input_section>.
5961 (Output_section::add_script_input_section): Rename from
5962 Output_section::add_simple_input_section. Change type of SIS
5963 parameter from Simple_input_section to Input_section.
5964 * output.h (Output_section::Simple_input_section): Remove class.
5965 (Output_section::Input_section): Change class visibility to public.
5966 (Output_section::Input_section::addralign): Use stored alignments
5967 for special input sections if set.
5968 (Output_section::Input_section::set_addralign): New method.
5969 (Output_section::get_input_sections): Change parameter type from
5970 list of Simple_input_section to list of Input_section.
5971 (Output_section::add_script_input_section): Rename from
5972 Output_section::add_simple_input_section. Change first parameter's
5973 type from Simple_input_section to Input_section and remove the
5974 second and third parameters.
5975 * script-sections.cc (Input_section::Input_section_list): Change
5976 type to list of Output_section::Input_section/
5977 (Input_section_info::Input_section_info): Change parameter type of
5978 INPUT_SECTION to Output_section::Input_section.
5979 (Input_section_info::input_section): Change return type.
5980 (Input_section_info::input_section_): Change type to
5981 Output_section::Input_section.
5982 (Output_section_element_input::set_section_addresses): Adjust code
5983 to use Output_section::Input_section instead of
5984 Output_section::Simple_input_section. Adjust code for renaming
5985 of Output_section::add_simple_input_section.
5986 (Orphan_output_section::set_section_addresses): Ditto.
5988 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5990 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5991 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5993 2010-05-18 Rafael Espindola <espindola@google.com>
5995 * options.cc (General_options::finalize): Handle -nostdlib.
5996 * options.h (nostdlib): New option.
5997 * script.cc (script_add_search_dir): Handle -nostdlib.
5999 2010-05-12 Doug Kwan <dougkwan@google.com>
6001 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6002 attributes section only if there no attributes section after merging.
6003 (Target_arm::merge_object_attributes): Move value of
6004 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
6005 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6006 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6007 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6008 and arm_attr_merge_7.stdout.
6009 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6010 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6011 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6012 arm_attr_merge_7b.o): New rules.
6013 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6015 * testsuite/Makefile.in: Regenerate.
6016 * testsuite/arm_attr_merge.sh: New file.
6017 * testsuite/arm_attr_merge_[67][ab].s: Same.
6019 2010-05-05 Nick Clifton <nickc@redhat.com>
6021 * po/es.po: Updated Spanish translation.
6023 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6025 * Makefile.am (install-exec-local): Properly install gold as
6026 default cross linker.
6027 * Makefile.in: Regenerated.
6029 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6030 Nick Clifton <nickc@redhat.com>
6032 * configure.ac (install_as_default): Define and set to false
6033 unless --enable-gold or --enable-gold=both/gold has been
6035 * configure: Regenerate.
6037 * Makefile.am (install-exec-local): Install the executable as
6038 'ld.gold'. If install_as_default is true then also install it as
6040 * Makefile.in: Regenerated.
6042 2010-04-24 Ian Lance Taylor <iant@google.com>
6044 * layout.cc (Layout::layout_reloc): In relocatable link don't
6045 combine reloc sections for grouped sections.
6047 2010-04-23 Sriraman Tallam <tmsriram@google.com>
6049 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6050 sections that are not ordinary to icf.
6051 * icf.cc (get_section_contents): Handle relocation pointing to section
6052 with no object or shndx information.
6053 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6054 * testsuite/Makefile.in: Regenerate.
6055 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6056 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6058 2010-04-22 Ian Lance Taylor <iant@google.com>
6060 * expression.cc (Expression::Expression_eval_info): Add
6061 result_alignment_pointer field.
6062 (Expression::eval_with_dot): Add result_alignment_pointer
6063 parameter. Change all callers.
6064 (Expression::eval_maybe_dot): Likewise.
6065 (class Binary_expression): Add alignment_pointer parameter to
6066 left_value and right_value. Change all callers.
6067 (BINARY_EXPRESSION): Set result alignment.
6068 (class Trinary_expression): Add alignment_pointer parameter to
6069 arg2_value and arg3_value. Change all callers.
6070 (Trinary_cond::value): Set result alignment.
6071 (Max_expression::value, Min_expression::value): Likewise.
6072 (Align_expression::value): Likewise.
6073 * script-sections.cc (class Sections_element): Add dot_alignment
6074 parameter to set_section_addresses virtual function. Update
6076 (class Output_section_element): Likewise.
6077 (Script_sections::create_segments): Add dot_alignment parameter.
6079 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6080 (Script_sections::set_phdrs_clause_addresses): Likewise.
6081 * script-sections.h: Update declarations.
6082 * script.h: Update declarations.
6083 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6085 * testsuite/script_test_3.t: Set large alignment.
6086 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6087 segment has expected alignment.
6089 2010-04-22 Nick Clifton <nickc@redhat.com>
6091 * po/gold.pot: Updated by the Translation project.
6092 * po/vi.po: Updated Vietnamese translation.
6094 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6096 * testsuite/Makefile.am (check_PROGRAMS): Add
6097 icf_virtual_function_folding_test.
6098 * testsuite/Makefile.in: Regenerated.
6100 2010-04-15 Andrew Haley <aph@redhat.com>
6102 * options.h (merge_exidx_entries): New option.
6103 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6104 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6105 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6106 (Target_arm::merge_exidx_entries): New function.
6107 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6108 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6109 to Arm_exidx_fixup constructor.
6110 Add new arg, merge_exidx_entries.
6111 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6112 Arm_output_section::fix_exidx_coverage.
6114 2010-04-18 Sriraman Tallam <tmsriram@google.com>
6116 * icf.cc (get_section_contents): Check for preemptible functions.
6117 Ignore addend when appropriate.
6118 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6120 (add_from_relobj): Check for section folded.
6121 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6122 * symtab.h (should_add_dynsym_entry): Add new parameter.
6123 * target-reloc.h (scan_relocs): Check for section folded.
6124 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6125 Check reloc types for function pointers in shared objects.
6126 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6128 (icf_preemptible_functions_test): New test case.
6129 (icf_string_merge_test): New test case.
6130 * testsuite.Makefile.in: Regenerate.
6131 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6132 bar_glob. Refactor code.
6133 * testsuite/icf_preemptible_functions_test.cc: New file.
6134 * testsuite/icf_preemptible_functions_test.sh: New file.
6135 * testsuite/icf_string_merge_test.cc: New file.
6136 * testsuite/icf_string_merge_test.sh: New file.
6137 * testsuite/icf_virtual_function_folding_test.cc: New file.
6138 * testsuite/icf_virtual_function_folding_test.sh: New file.
6140 2010-04-14 Doug Kwan <dougkwan@google.com>
6142 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6143 for local symbol recounting if we remove a section due to ICF.
6144 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6145 there are no regular objects in input.
6147 2010-04-13 Doug Kwan <dougkwan@google.com>
6149 * arm.cc (Arm_input_section::set_final_data_size): Compute
6150 accurate final data size instead of using current data size.
6152 2010-04-09 Doug Kwan <dougkwan@google.com>
6154 * layout.cc (Layout::choose_output_section): Handle script section
6156 (Layout::make_output_section_for_script): Add section type parameter.
6157 Handle script section types.
6158 * layout.h (Layout::make_output_section_for_script): Add section
6160 * output.cc (Output_section::Output_section): Initialize data member
6162 (Output_section::do_reset_address_and_file_offset): Do not set address
6163 to 0 if section is a NOLOAD section.
6164 * output.h (Output_section::is_noload): New method.
6165 (Output_section::set_is_noload): Ditto.
6166 (Output_section::is_noload_): New data member.
6167 * script-c.h (Script_section_type): New enum type.
6168 (struct Parser_output_section_header): Add new file section_type.
6169 * script-sections.cc (Sections_element::output_section_name): Add
6170 parameter for returning script section type.
6171 (Output_section_definition::output_section_name): Ditto.
6172 (Output_section_definition::section_type)P; New method.
6173 (Output_section_definiton::script_section_type_name): Ditto.
6174 (Output_section_definition::script_section_type_): New data member.
6175 (Output_section_definition::Output_section_definition): Initialize
6176 data member Output_section_definition::script_section_type_.
6177 (Output_section_definition::create_sections): Pass script section type
6178 to Layout::make_output_section_for_script.
6179 (Output_section_definition::output_section_name): Return script
6180 section type to caller.
6181 (Output_section_definition::set_section_address): Do not advance
6182 dot value and load address if section type is NOLOAD. Set address
6183 of NOLOAD sections regardless of section flags.
6184 (Output_section_definition::print): Print section type if it is
6185 not SCRIPT_SECTION_TYPE_NONE.
6186 (Output_section_definition::section_type): New method.
6187 (Output_section_definition::script_section_type_name): Ditto.
6188 (Script_sections::output_section_name): Add new parameter
6189 PSECTION_TYPE for returning script section type. Pass it to
6190 section elements. Handle discard sections.
6191 (Sort_output_sections::operator()): Handle NOLOAD sections.
6192 * script-sections.h (Script_sections::Section_type): New enum type.
6193 (Script_sections::output_section_name): Add a new parameter for
6194 returning script section type.
6195 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6197 * yyscript.y (union): Add new field SECTION_TYPE.
6198 (COPY, DSECT, INFO, NOLOAD): New tokens.
6199 (opt_address_and_section_type): Change type to output_section_header.
6200 (section_type): New non-terminal
6201 (section_header): Handle section type.
6202 (opt_address_and_section_type): Return section type value.
6204 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6206 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6207 * testsuite/plugin_common_test_2.c (foo): Likewise.
6209 2010-04-08 Doug Kwan <dougkwan@google.com>
6211 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6213 * output.cc (Output_section::add_merge_input_section): Simplify
6214 code and return status of Output_merge_base::add_input_section.
6215 Update merge section map only if Output_merge_base::add_input_section
6218 2010-04-07 Doug Kwan <dougkwan@google.com>
6220 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6221 if section is marked as containing instructions but has no mapping
6223 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6224 correct section index.
6225 (Arm_relobj::find_linked_text_section): Ditto.
6227 2010-04-07 Cary Coutant <ccoutant@google.com>
6229 * archive.cc (include_member): Destroy Read_symbols_data object before
6231 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6232 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6233 (Read_symbols_data::~Read_symbols_data) New destructor.
6234 (Section_relocs::Section_relocs) New constructor.
6235 (Section_relocs::~Section_relocs) New destructor.
6236 (Read_relocs_data::Read_relocs_data) New constructor.
6237 (Read_relocs_data::~Read_relocs_data) New destructor.
6238 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6239 pointers to NULL after deleting.
6241 2010-04-07 Doug Kwan <dougkwan@google.com>
6243 * arm.cc: Replace "endianity" with "endianness" in comments.
6244 (Arm_exidx_cantunwind): Ditto.
6245 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6246 (Arm_relobj::merge_flags_and_attributes): New method.
6247 (Arm_relobj::merge_flags_and_attributes_): New data member.
6248 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6249 (Arm_relobj::scan_sections_for_stubs): Ditto.
6250 (Arm_relobj::do_read_symbols): Check to see if we really want to
6251 merge processor-specific flags and attributes. Exit early if
6252 an object is empty except for section names and the undefined symbol.
6253 (Target_arm::do_finalize_sections): Move check for ELF format to
6254 Arm_relobj::do_read_symbols. Merge processor specific flags and
6255 attributes from a regular object only when we have determined that
6256 it is aapropriate. Do not create an .ARM.attributes section in
6257 output if there is no regular input object.
6258 (Target_arm::merge_processor_specific_flags): Check
6259 --warn-mismatch before printing any error.
6260 (Target_arm::merge_object_attributes): Ditto.
6261 * gold.cc (queue_middle_tasks): Handle the case in which there is
6262 no regular object in input.
6263 * options.cc (General_options::parse_EB): New method.
6264 (General_options::parse_EL): Same.
6265 (General_options::General_options): Initialize endianness_.
6266 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6268 (General_options::Endianness): New enum.
6269 (General_options::endianness): New method.
6270 (General_options::endianness_): New data member.
6271 * parameters.cc (Parameters::set_options): Check target endianness.
6272 (Parameters::set_target_once): Ditto.
6273 (Parameters::check_target_endianness): New method.
6274 (parameters_force_valid_target): If either -EL or -EB is specified,
6275 use it to define endianness of default target.
6276 * parameters.h (Parameters::check_target_endianness): New method
6278 * target.h (class Target): Change "endianity" to "endianness"
6281 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6283 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6284 * configure: Regenerate.
6285 * Makefile.in: Regenerate.
6286 * testsuite/Makefile.in: Regenerate.
6288 2010-04-06 Cary Coutant <ccoutant@google.com>
6291 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6292 prevailing definitions of common symbols.
6293 * testsuite/plugin_test_6.sh: New test case.
6294 * testsuite/plugin_common_test_1.c: New test case.
6295 * testsuite/plugin_common_test_2.c: New test case.
6296 * testsuite/Makefile.am (plugin_test_6): New test case.
6297 * testsuite/Makefile.in: Regenerate.
6299 2010-04-06 Nick Clifton <nickc@redhat.com>
6301 * po/vi.po: New Vietnamese translation.
6303 2010-03-30 Doug Kwan <dougkwan@google.com>
6305 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6307 2010-03-25 Doug Kwan <dougkwan@google.com>
6309 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6310 to avoid a conversion warning on a 32-bit host.
6312 2010-03-24 Ian Lance Taylor <iant@google.com>
6314 * testsuite/script_test_3.t: Add a TLS segment.
6315 * testsuite/Makefile.am (check_PROGRAMS): Add
6316 tls_phdrs_script_test.
6317 (tls_phdrs_script_test_SOURCES): Define.
6318 (tls_phdrs_script_test_DEPENDENCIES): Define.
6319 (tls_phdrs_script_test_LDFLAGS): Define.
6320 (tls_phdrs_script_test_LDADD): Define.
6321 * testsuite/Makefile.in: Rebuild.
6323 2010-03-23 Cary Coutant <ccoutant@google.com>
6325 * fileread.cc (find_or_make_view): Fix comment.
6327 2010-03-23 Ian Lance Taylor <iant@google.com>
6329 * script-sections.cc (class Orphan_section_placement): Define
6330 PLACE_TLS and PLACE_TLS_BSS.
6331 (Orphan_section_placement::Orphan_section_placement): Initialize
6333 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6334 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6335 (tls_script_test_SOURCES): Define.
6336 (tls_script_test_DEPENDENCIES): Define.
6337 (tls_script_test_LDFLAGS): Define.
6338 (tls_script_test_LDADD): Define.
6339 * testsuite/Makefile.in: Rebuild.
6341 2010-03-22 Doug Kwan <dougkwan@google.com>
6343 * arm.cc (Arm_relocate_functions::abs8,
6344 Arm_relocate_functions::abs16): Use correct check for overflow
6345 specified in the ARM ELF specs.
6346 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6347 target of a BLX instruction specially.
6348 (Reloc_stub::stub_type_for_reloc): Ditto.
6349 (Relocate::relocate): Use symbolic names instead of numeric relocation
6350 codes to report error.
6351 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6353 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6354 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6355 thumb2_blx_out_of_range.stdout
6356 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6357 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6358 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6359 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6360 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6361 thumb2_blx_in_range, thumb2_blx_in_range.o,
6362 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6363 thumb2_blx_out_of_range.o): New rules.
6364 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
6365 thumb2_blx_in_range and thumb2_blx_out_of_range.
6366 * testsuite/Makefile.in: Regenerate.
6367 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6368 * testsuite/thumb_blx_in_range.s: New file.
6369 * testsuite/thumb_blx_out_of_range.s: New file.
6371 2010-03-22 Rafael Espindola <espindola@google.com>
6373 * archive.cc (Should_include): Move to archive.h.
6374 (should_include_member): Make it a member of Archive.
6376 (Add_lib_group_symbols): New.
6377 * archive.h: Include options.h.
6378 (Archive_member): Moved from Archive.
6379 (Should_include): Moved from archive.cc.
6381 (Add_lib_group_symbols): New.
6382 * dynobj.cc (do_should_include_member): New.
6383 * dynobj.h (do_should_include_member): New.
6384 * gold.cc (queue_initial_tasks): Update call to queue.
6385 * main.cc (main): Print lib group stats.
6386 * object.cc (do_should_include_member): New.
6387 * object.h: Include archive.h.
6388 (Object::should_include_member): New.
6389 (Object::do_should_include_member): New.
6390 (Sized_relobj::do_should_include_member): New.
6391 * options.cc (General_options::parse_start_lib): New.
6392 (General_options::parse_end_lib): New.
6393 (Input_arguments::add_file): Handle lib groups.
6394 (Input_arguments::start_group): Check we are not in a lib.
6395 (Input_arguments::start_lib): New.
6396 (Input_arguments::end_lib): New.
6397 * options.h (General_options): Add start_lib and end_lib.
6398 (Input_argument::lib_): New.
6399 (Input_argument::lib): New.
6400 (Input_argument::is_lib): New.
6401 (Input_file_lib): New.
6402 (Input_arguments::in_lib_): New.
6403 (Input_arguments::in_lib): New.
6404 (Input_arguments::start_lib): New.
6405 (Input_arguments::end_lib_): New.
6406 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6407 in unused members as preempted.
6408 (Sized_pluginobj::do_should_include_member): New.
6409 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6410 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6412 (Read_symbols::do_whole_lib_group): New.
6413 (Read_symbols::do_lib_group): New.
6414 (Read_symbols::do_read_symbols): Handle lib groups.
6415 (Read_symbols::get_name): Handle lib groups.
6416 * readsyms.h (Read_symbols): Add an archive member pointer.
6417 (Read_symbols::do_whole_lib_group): New.
6418 (Read_symbols::do_lib_group): New.
6419 (Read_symbols::member_): New.
6420 * script.cc (read_input_script): Update call to queue_soon.
6422 2010-03-19 Doug Kwan <dougkwan@google.com>
6424 * arm.cc (Stub_table::Stub_table): Initialize new data members
6425 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6426 (Stub_table::add_reloc_stub): Assign stub offset and update
6427 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6428 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6430 (Stub_table::update_data_size_and_addralign): Use
6431 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6432 instead of going over all reloc stubs.
6433 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
6434 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6435 Stringpool_template::offset_ to size of Stringpool_char.
6436 (Stringpool_template::new_key_offset): Remove code to initialize
6437 Stringpool_template::offset_.
6438 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6439 Stringpool_template::offset_ to zero.
6441 2010-03-15 Doug Kwan <dougkwan@google.com>
6443 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6445 (Stringpool_template::new_key_offset): New method.
6446 (Stringpool_template::add_string): Assign offsets when adding new
6448 (Stringpool_template::set_string_offsets): Do not set string offsets
6449 when not optimizing.
6450 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6452 (Chunked_vector::clear): Clear size_.
6453 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6454 (Chunked_vector::size): Return size_.
6455 (Chunked_vector::push_back): Use size_ to find insert position.
6456 (Chunked_vector::size_): New data member.
6457 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6458 (Stringpool_template::new_key_offset): New method declaration.
6459 (Stringpool_template::offset_): New data member.
6461 2010-03-15 Rafael Espindola <espindola@google.com>
6463 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6464 Add_symbols' constructor.
6465 * readsyms.h (Add_symbols): Remove the input_group member.
6467 2010-03-10 Ian Lance Taylor <iant@google.com>
6469 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6470 target to ask whether a reference to a symbol requires a stack
6472 * target.h (Target::is_call_to_non_split): New function.
6473 (Target::do_is_call_to_non_split): Declare virtual function.
6474 * target.cc: Include "symtab.h".
6475 (Target::do_is_call_to_non_split): New function.
6476 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6478 2010-03-10 Cary Coutant <ccoutant@google.com>
6480 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6481 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6482 (File_read::open[2]): Add whole_file_view_ to list of views.
6483 (File_read::make_view): Remove test of whole_file_view_.
6484 (File_read::find_or_make_view): Create whole_file_view_ if
6486 (File_read::clear_views): Replace bool parameter with enum;
6487 adjust all callers. Don't delete views with permanent data;
6488 do delete cached views and views from archives if
6489 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6490 if clearing the corresponding view.
6491 * fileread.h (File_read::Clear_views_mode): New enum.
6492 (File_read::View::is_permanent_view): New method.
6493 (File_read::clear_views): Replace bool parameter
6494 with enum; adjust all callers.
6495 * options.h (General_options): Change keep_files_mapped option;
6496 add map_whole_files.
6497 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6499 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6502 2010-03-10 David S. Miller <davem@davemloft.net>
6504 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6506 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6508 * icf.cc (get_section_contents): Add '@' marker after processing the
6511 2010-03-08 Doug Kwan <dougkwan@google.com>
6513 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6514 due to a conversion warning.
6515 (Arm_relobj::update_output_local_symbol_count): Check for local
6516 symbol with unset output index.
6518 2010-03-05 Ian Lance Taylor <iant@google.com>
6520 * options.h (class General_options): Add --spare-dynamic-tags.
6521 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6522 --spare-dynamic-tags.
6524 2010-03-05 Ian Lance Taylor <iant@google.com>
6526 * incremental.cc: Include "libiberty.h".
6528 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6530 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6531 function, is_info_ member.
6532 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6533 (Versions::Versions): Update caller.
6534 (Versions::define_base_version): Likewise.
6535 (Versions::add_def): Likewise.
6537 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6539 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6540 (Scan::possible_function_pointer_reloc): New function.
6541 (Scan::local_reloc_may_be_function_pointer): Change to call
6542 possible_function_pointer_reloc.
6543 (Scan::global_reloc_may_be_function_pointer): Ditto.
6544 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6545 relocations in ".data.rel.ro._ZTV" section.
6546 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6547 * testsuite/icf_safe_so_test.cc: Ditto.
6548 * testsuite/icf_safe_test.cc: Ditto.
6549 * testsuite/icf_safe_test.sh: Ditto.
6551 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6552 Ian Lance Taylor <iant@google.com>
6554 * target-reloc.h (relocate_section): Check the symbol table index
6555 for -1U before setting the local symbol index.
6556 (scan_relocatable_relocs): If copying the relocation, record that
6557 the local symbol is required.
6558 * object.h (Symbol_value::is_output_symtab_index_set): New
6560 (Symbol_value::may_be_discarded_from_output_symtab): New
6562 (Symbol_value::has_output_symtab_entry): New function.
6563 (Symbol_value::needs_output_symtab_entry): Remove.
6564 (Symbol_value::output_symtab_index): Make sure the symbol index is
6566 (Symbol_value::set_output_symtab_index): Make sure the symbol
6567 index is not set. Make sure the new index is valid.
6568 (Symbol_value::set_must_have_output_symtab_entry): New function.
6569 (Symbol_value::has_output_dynsym_entry): New function.
6570 (Symbol_value::set_output_dynsym_index): Make sure the new index
6572 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6573 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6574 local symbol if permitted.
6575 (Sized_relobj::do_finalize_local_symbols): Call
6576 is_output_symtab_index_set rather than needs_output_symtab_entry.
6577 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6578 rather than needs_output_symtab_entry. Call
6579 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6580 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6581 is_output_symtab_index_set rather than needs_output_symtab_entry.
6582 * testsuite/discard_locals_relocatable_test.c: New file.
6583 * testsuite/discard_locals_test.sh: Test -r.
6584 * testsuite/Makefile.am (check_DATA): Add
6585 discard_locals_relocatable_test1.syms,
6586 discard_local_relocatable_test2.syms.
6587 (MOSTLYCLEANFILES): Likewise. Also add
6588 discard_locals_relocatable_test1.lout and
6589 discard_locals_relocatable_test2.out.
6590 (discard_locals_relocatable_test1.syms): New target.
6591 (discard_locals_relocatable_test.o): New target.
6592 (discard_locals_relocatable_test1.out): New target.
6593 (discard_locals_relocatable_test2.syms): New target.
6594 (discard_locals_relocatable_test2.out): New target.
6595 (various): Add missing ../ld-new dependencies.
6596 * testsuite/Makefile.in: Rebuild.
6598 2010-03-03 Nick Clifton <nickc@redhat.com>
6600 * po/fi.po: New Finnish translation.
6602 2010-03-01 Doug Kwan <dougkwan@google.com>
6604 * layout.cc (Layout::Layout): Force section types of .init_array*,
6605 .preinit_array* and .fini_array* sections.
6606 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6607 Fix check of return value of std::string::find.().
6608 (Output_section::Input_section_sort_compare::operator()): Remove
6609 comment about .init_array.
6610 (Output_section::Input_section_sort_init_fini_compare::operator()):
6612 (Output_section::sort_attached_input_sections): Handle .init_array
6613 and .fini_array specially.
6614 * output.h (Output_section::Inut_section_sort_compare): Update
6616 (Output_section::Input_section_sort_init_fini_compare): New struct.
6618 2010-02-26 Doug Kwan <dougkwan@google.com>
6620 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6621 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6622 * testsuite/debug_msg.sh: Avoid matching source line number for
6623 use of global variable undef_int.
6625 2010-02-26 Doug Kwan <dougkwan@google.com>
6627 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6628 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6629 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6630 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6631 * options.cc (General_options::General_options): Initialize member
6633 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6634 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6635 and rm_no_fix_v4bx.stdout
6636 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6637 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6638 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6639 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6640 and arm_no_fix_v4bx.
6641 * Makefile.in: Regenerate.
6642 * testsuite/arm_fix_v4bx.s: New file.
6643 * testsuite/arm_fix_v4bx.sh: Ditto.
6645 2010-02-24 Doug Kwan <dougkwan@google.com>
6647 * arm.cc (Target_arm::got_section): Make the .got section the first
6648 non RELRO section in the data segment.
6649 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6650 suffixes of section names.
6652 2010-02-24 Doug Kwan <dougkwan@google.com>
6654 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6655 flags and attributes merging if an input file is a binary file.
6656 * fileread.cc (Input_file::open): Record format of original file.
6657 * fileread.h (Input_file::Format): New enum type.
6658 (Input_file::Input_file): Initialize data member format_.
6659 (Input_file::format): New method definition.
6660 (Input_file::format_):: New data member.
6662 2010-02-24 Doug Kwan <dougkwan@google.com>
6664 * arm.cc (Arm_output_data_got): New class.
6665 (ARM_TCB_SIZE): New constant
6666 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6667 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6668 If user uses a script with a SECTIONS clause, issue only a warning
6669 for a misplaced EXIDX input section. Otherwise, issue an error.
6670 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6672 (Target_arm::got_mode_index_entry): Handle static linking.
6673 (Target_arm::Scan::local): Ditto.
6674 (Target_arm::Scan::global): Ditto.
6675 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6676 all incorrectly implemented relocations.
6677 (Target_arm::fix_exidx_coverage): Pass layout to
6678 Arm_output_section::fix_exidx_coverage.
6679 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6680 from ".ARM.exidx." and ".ARM.extab.".
6682 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6684 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6685 section if it does not already exist.
6686 * attributes.cc (Attributes_section_data::Attributes_section_data):
6687 Don't crash if size is zero.
6689 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6690 Ian Lance Taylor <iant@google.com>
6692 * gold.cc (queue_middle_tasks): If no input files were opened,
6694 * workqueue.h (Task_function::Task_function): Assert that there is
6697 2010-02-22 Doug Kwan <dougkwan@google.com>
6699 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6700 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6701 types to avoid warnings due to different uint64_t implementations
6704 2010-02-21 Doug Kwan <dougkwan@google.com>
6706 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6707 handling of the maximum backward branch offset.
6708 (Arm_relocate_functions::thumb_branch_common): Ditto.
6709 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6710 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6711 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6712 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6713 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6714 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6715 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6716 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6717 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6718 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6719 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6720 thumb2_bl_out_of_range.o): New rules.
6721 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6722 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6723 thumb2_bl_out_of_range
6724 * testsuite/Makefile.in: Regenerate.
6725 * testsuite/arm_bl_in_range.s: New file.
6726 * testsuite/arm_bl_out_of_range.s: Ditto.
6727 * testsuite/arm_branch_in_range.sh: Ditto.
6728 * testsuite/arm_branch_range.t: Ditto.
6729 * testsuite/thumb2_branch_range.t: Ditto.
6730 * testsuite/thumb_bl_in_range.s: Ditto.
6731 * testsuite/thumb_bl_out_of_range.s: Ditto.
6732 * testsuite/thumb_branch_range.t: Ditto.
6734 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6736 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6737 Add reloc offset information.
6738 * icf.cc (get_section_contents): Change iterators to point to the new
6739 vectors. Add reloc offset information to the contents.
6740 * icf.h (Icf::Sections_reachable_info): New typedef.
6741 (Icf::Sections_reachable_list): New typedef.
6742 (Icf::Offset_info): New typedef.
6743 (Icf::Reloc_info): New struct typedef.
6744 (Icf::Reloc_info_list): New typedef.
6745 (Icf::symbol_reloc_list): Delete method.
6746 (Icf::addend_reloc_list): Delete method.
6747 (Icf::section_reloc_list): Delete method.
6748 (Icf::reloc_info_list): New method.
6749 (Icf::reloc_info_list_): New member.
6751 2010-02-19 Doug Kwan <dougkwan@google.com>
6753 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6754 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6755 * arm.cc (Arm_relocation_functions): New forward declaration.
6756 (Target_arm::Target_arm): Initialize new data members
6757 got_mod_index_offset_ and tls_base_symbol_defined_.
6758 (Target_arm::Relocate::relocate_tls): New method.
6759 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6760 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6762 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6763 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6764 (Target_arm::got_mod_index_offset_,
6765 Target_arm::tls_base_symbol_defined_): New data members.
6766 (Target_arm::Scan::local, Target::Scan::global,
6767 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6770 2010-02-18 Doug Kwan <dougkwan@google.com>
6772 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6773 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6774 text section as a parameter becuase some broken tools may not set
6775 the link in section header.
6776 (Target_arm::has_got_section): New method.
6777 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6778 without any mapping symbol as data only. Remove warning.
6779 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6780 link in its section header, try to discover the link by inspecting the
6781 REL31 relocation at the beginning of the section.
6782 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6784 (Target_arm::Scan::global): Treat any reference to the symbol
6785 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6787 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6789 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6790 (Scan::global_reloc_may_be_function_pointer): New function.
6791 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6792 (Scan::global_reloc_may_be_function_pointer): New function.
6793 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6794 (Scan::global_reloc_may_be_function_pointer): New function.
6795 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6796 (Scan::global_reloc_may_be_function_pointer): New function.
6797 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6798 (Scan::global_reloc_may_be_function_pointer): New function.
6799 (Scan::possible_function_pointer_reloc): New function.
6800 (Target_x86_64::can_check_for_function_pointers): New function.
6801 * gc.h (gc_process_relocs): Scan relocation types to determine if
6802 function pointers were taken for targets that support it.
6803 * icf.cc (Icf::find_identical_sections): Include functions for
6804 folding in safe ICF whose pointer is not taken.
6805 * icf.h (Secn_fptr_taken_set): New typedef.
6806 (fptr_section_id_): New member.
6807 (section_has_function_pointers): New function.
6808 (set_section_has_function_pointers): New function.
6809 (check_section_for_function_pointers): New function.
6810 * options.h: Fix comment for safe ICF option.
6811 * target.h (can_check_for_function_pointers): New function.
6812 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6813 Modify icf_safe_test for X86-64.
6814 * testsuite/Makefile.in: Regenerate.
6815 * testsuite/icf_safe_so_test.cc: New file.
6816 * testsuite/icf_safe_so_test.sh: New file.
6817 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6818 (main): Change to take pointer to function kept_func_3.
6819 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6820 folding is done correctly for X86-64.
6822 2010-02-12 David S. Miller <davem@davemloft.net>
6824 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6825 is_symbolless parameter.
6826 (Output_reloc<SHT_REL>::is_symbolless): New.
6827 (Output_reloc<SHT_REL>::is_symbolless_): New.
6828 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6829 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6830 (Output_reloc<SHT_RELA>::is_symbolless): New.
6831 (Output_data_reloc::add_global): Handle is_symbolless.
6832 (Output_data_reloc::add_global_relative): Likewise.
6833 (Output_data_reloc::add_local): Likewise.
6834 (Output_data_reloc::add_local_relative): Likewise.
6835 (Output_data_reloc::add_symbolless_global_addend): New.
6836 (Output_data_reloc::add_symbolless_local_addend): New.
6837 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6839 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6840 instead of ->is_relative_
6841 (Output_reloc::write): Likewise.
6842 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6843 (Output_reloc::write_rel): Simplify.
6845 * sparc.cc (Target_sparc::Scan::local): Use
6846 ->add_symbolless_local_addend as needed.
6847 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6848 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6849 based upon relocation offset.
6851 2010-02-11 Doug Kwan <dougkwan@google.com>
6853 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6854 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6855 beginning of function.
6856 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6857 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6858 parameter is_32bit in calls to should_apply_static_reloc.
6859 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6860 (check_DATA): Add arm_abs_global.stdout.
6861 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6862 arm_abs_global.stdout): New rules.
6863 (MOSTLLYCLEANFILES): Add arm_abs_global
6864 * Makefile.in: Regenerate.
6865 * testsuite/arm_abs_global.s: New file.
6866 * testsuite/arm_abs_global.sh: Ditto.
6867 * testsuite/arm_abs_lib.s: Ditto.
6869 2010-02-11 Ian Lance Taylor <iant@google.com>
6871 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6873 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6874 Allocate_commons_task first.
6875 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6876 task, rather than symtab_lock_.
6877 (Gc_process_relocs::~Gc_process_relocs): New function.
6878 (Gc_process_relocs::is_runnable): Check this_blocker_.
6879 (Gc_process_relocs::locks): Use next_blocker_ rather than
6881 (Scan_relocs::~Scan_relocs): New function.
6882 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6884 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6886 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6887 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6888 constructor accordingly.
6889 (class Gc_process_relocs): Likewise.
6890 (class Scan_relocs): Likewise.
6891 * common.h (class Allocate_commons_task): Remove symtab_lock_
6892 field, and corresponding constructor parameter.
6893 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6895 (Allocate_commons_task::locks): Likewise.
6897 2010-02-11 Ian Lance Taylor <iant@google.com>
6899 * gold-threads.h (class Once): Define.
6900 (class Initialize_lock): Rewrite as child of Once.
6901 * gold-threads.cc (class Once_initialize): Define.
6902 (once_pointer_control): New static variable.
6903 (once_pointer, once_arg): New static variables.
6904 (c_run_once): New static function.
6905 (Once::Once, Once::run_once, Once::internal_run): New functions.
6906 (class Initialize_lock_once): Remove.
6907 (initialize_lock_control): Remove.
6908 (initialize_lock_pointer): Remove.
6909 (initialize_lock_once): Remove.
6910 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6911 (Initialize_lock::initialize): Rewrite.
6912 (Initialize_lock::do_run_once): New function.
6913 * archive.cc (Archive::interpret_header): Only clear name if it is
6915 * fileread.cc: Include "gold-threads.h"
6916 (file_counts_lock): New static variable.
6917 (file_counts_initialize_lock): Likewise.
6918 (File_read::release): Only increment counts when using --stats.
6919 Use a lock around the increment.
6920 * parameters.cc (class Set_parameters_target_once): Define.
6921 (set_parameters_target_once): New static variable.
6922 (Parameters::Parameters): Move here from parameters.h.
6923 (Parameters::set_target): Rewrite.
6924 (Parameters::set_target_once): New function.
6925 (Parameters::clear_target): Move here and rewrite.
6926 * parameters.h (class Parameters): Update declarations. Add
6927 set_parameters_target_once_ field.
6928 (Parameters::Parameters): Move to parameters.cc.
6929 (Parameters::clear_target): Likewise.
6930 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6932 (Start_group::~Start_group): New function.
6933 (Start_group::is_runnable): New function.
6934 (Start_group::locks, Start_group::run): New functions.
6935 (Finish_group::run): Change saw_undefined to size_t.
6936 * readsyms.h (class Start_group): Define.
6937 (class Finish_group): Change saw_undefined_ field to size_t.
6938 (Finish_group::Finish_group): Remove saw_undefined and
6939 this_blocker parameters. Change all callers.
6940 (Finish_group::set_saw_undefined): New function.
6941 (Finish_group::set_blocker): New function.
6942 * symtab.h (class Symbol_table): Change saw_undefined to return
6943 size_t. Change saw_undefined_ field to size_t.
6944 * target-select.cc (Set_target_once::do_run_once): New function.
6945 (Target_selector::Target_selector): Initialize set_target_once_
6946 field. Don't initialize lock_ and initialize_lock_ fields.
6947 (Target_selector::instantiate_target): Rewrite.
6948 (Target_selector::set_target): New function.
6949 * target-select.h (class Set_target_once): Define.
6950 (class Target_selector): Update declarations. Make
6951 Set_target_once a friend. Remove lock_ and initialize_lock_
6952 fields. Add set_target_once_ field.
6954 2010-02-10 Ian Lance Taylor <iant@google.com>
6956 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6958 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6959 (queue_middle_tasks): Add all blockers before queueing any tasks.
6960 (queue_final_tasks): Likewise.
6961 * token.h (Task_token::add_blockers): New function.
6962 * object.h (Input_objects::number_of_relobjs): New function.
6964 2010-02-10 Ian Lance Taylor <iant@google.com>
6966 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6967 shared, not if not position independent.
6968 * x86_64.cc (Relocate::relocate_tls): Likewise.
6969 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6970 (tls_pie_pic_test): New target.
6971 * testsuite/Makefile.in: Rebuild.
6973 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6974 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6975 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6976 * testsuite/Makefile.in: Rebuild.
6978 2010-02-09 David S. Miller <davem@davemloft.net>
6980 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6981 R_SPARC_RELATIVE using ->add_local_relative().
6982 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6984 * output.h (Output_data_dynamic::add_section_size): New method
6985 that takes two Output_data objects.
6986 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6987 entry param. Handle it in initializers.
6988 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6989 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6990 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6992 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6993 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6994 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6995 for dynrel_includes_plt.
6996 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6997 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6998 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7000 (Target_sparc::do_finalize_sections): Update to pass true for
7001 dynrel_includes_plt.
7002 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7003 output before .rela.plt
7004 (Target_powerpc::do_finalize_sections): Update to pass true for
7005 dynrel_includes_plt when 32-bit.
7007 2010-02-08 Doug Kwan <dougkwan@google.com>
7009 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7011 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7012 Arm_relobj::scan_section_for_cortex_a8_stubs,
7013 Arm_relobj::do_relocation_section): Instead of calling
7014 Output_section::output_address, use faster
7015 Arm_relobj::simple_input_section_output_address.
7017 2010-02-08 David S. Miller <davem@davemloft.net>
7019 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7020 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7021 relocation helper function.
7023 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7024 just like R_SPARC_GOT{10,13,22}.
7025 (Target_sparc::Scan::local): Likewise.
7026 (Target_sparc::Relocate:relocate): Likewise.
7028 2010-02-06 Ian Lance Taylor <iant@google.com>
7030 * configure.ac: Rewrite targetobjs duplicate removal code to use
7031 only shell constructs.
7032 * configure: Rebuild.
7034 2010-02-05 Doug Kwan <dougkwan@google.com>
7037 * arm.cc (Arm_relobj::section_is_scannable): New method.
7038 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7039 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7041 2010-02-04 Doug Kwan <dougkwan@google.com>
7044 * arm-reloc-property.cc (cstdio): Include.
7045 * configure.ac (targetobjs): Remove duplicates.
7046 * configure: Regenerate.
7047 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7048 big and little endian version for a given address size.
7050 2010-02-03 Doug Kwan <dougkwan@google.com>
7052 * arm-reloc-property.cc
7053 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7055 * arm-reloc-property.h
7056 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7057 New method definition.
7058 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7060 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7062 (GOT_PREL): Change implemented to Y.
7063 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7064 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7065 (Arm_relocate_functions::movw_abs_nc): Remove method.
7066 (Arm_relocate_functions::movt_abs): Ditto.
7067 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7068 (Arm_relocate_functions::thm_movt_abs): Ditto.
7069 (Arm_relocate_functions::movw_rel_nc): Ditto.
7070 (Arm_relocate_functions::movw_rel): Ditto.
7071 (Arm_relocate_functions::movt_rel): Ditto.
7072 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7073 (Arm_relocate_functions:thm_movw_rel): Ditto.
7074 (Arm_relocate_functions:thm_movt_rel): Ditto.
7075 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7076 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7077 New method definitions.
7078 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7079 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7080 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7081 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7082 (Target_arm::Relocate::relocate): Check for non-static or
7083 unimplemented relocation code and exit early. Change calls to
7084 Target_arm::reloc_uses_thumb_bit and
7085 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7086 instead. Refactor code to handle similar relocations to increase
7087 code sharing. Remove check for unsupported relocation code in switch
7089 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7090 relocation property table to find out size. Change error message to
7091 print out the name of a relocation code instead of the numeric value.
7092 (Target_arm::scan_reloc_for_stub): Use relocation property table
7093 instead of calling Target_arm::reloc_uses_thumb_bit().
7095 2010-02-02 Doug Kwan <dougkwan@google.com>
7097 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7098 types of relaxed input section.
7100 2010-02-02 Doug Kwan <dougkwan@google.com>
7102 * Makefile.am (HFILES): Add arm-reloc-property.h.
7104 (TARGETSOURCES): Add arm-reloc-property.cc
7105 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
7106 (libgold_a_SOURCES): $(DEFFILES)
7107 * Makefile.in: Regenerate.
7108 * arm-reloc-property.cc: New file.
7109 * arm-reloc-property.h: New file.
7110 * arm-reloc.def: New file.
7111 * arm.cc: Update comments.
7112 (arm-reloc-property.h): New included header.
7113 (arm_reloc_property_table): New global variable.
7114 (Target_arm::do_select_as_default_target): New method definition.
7115 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7116 arm-reloc-property to targ_extra_obj.
7117 * parameters.cc (set_parameters_target): Call
7118 Target::select_as_default_target().
7119 * target.h (Target::select_as_default_target): New method definition.
7120 (Target::do_select_as_default_target): Same.
7122 2010-02-01 Doug Kwan <dougkwan@google.com>
7124 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7125 first_output_text_section_.
7126 (Arm_exidx_fixup::first_output_text_section): New method definition.
7127 (Arm_exidx_fixup::first_output_text_section_): New data member.
7128 (Arm_exidx_fixup::process_exidx_section): Record the first text
7129 output section seen.
7130 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7131 and entsize in output section header.
7133 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7135 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7136 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7137 (Arm_relocate_functions::thm_alu11): New Method.
7138 (Arm_relocate_functions::thm_pc8): New Method.
7139 (Arm_relocate_functions::thm_pc12): New Method.
7140 (Target_arm::Scan::local): Handle the relocations.
7141 (Target_arm::Scan::global): Likewise.
7142 (Target_arm::Relocate::relocate): Likewise.
7143 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7145 2010-01-29 Doug Kwan <dougkwan@google.com>
7147 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7148 of relocation types as ld.
7150 2010-01-29 Doug Kwan <dougkwan@google.com>
7152 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7154 (Arm_relocate_functions::thumb_branch_common): Ditto.
7155 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7156 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7157 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7158 Arm_relocate_functions::jump24): Remove.
7159 (Target_arm::Relocate::relocate): Adjust code to call
7160 Arm_relocation_functions::arm_branch_common and
7161 Arm_relocation_functions::thumb_branch_common instead of their removed
7162 wrappers. Merge switch-cases together to reduce source code size.
7164 2010-01-29 Doug Kwan <dougkwan@google.com>
7166 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7167 output_local_symbol_count_needs_update_.
7168 (Arm_relobj::output_local_symbol_count_needs_update,
7169 Arm_relobj::set_output_local_symbol_count_needs_update,
7170 Arm_relobj::update_output_local_symbol_count): New methods.
7171 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7173 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7174 of pointed function as in a R_ARM_PREL31 relocation.
7175 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7176 for output local symbol count updating.
7177 (Target_arm::do_relax): Update output local symbol counts in objects
7179 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7181 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7183 * arm.cc: Added support for the ARM relocations:
7184 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7185 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7186 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7188 (Arm_relocate_functions::movw_rel): New method.
7189 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7190 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7192 (Arm_relocate_functions::thm_movw_rel): New method.
7193 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7195 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7197 (Target_arm::Scan::global): Likewise.
7198 (Target_arm::Relocate::relocate): Likewise.
7199 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7202 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7204 * arm.cc: Added support for ARM group relocations.
7205 (Target_arm::reloc_needs_sym_origin): New method.
7206 (Arm_relocate_functions::calc_grp_kn): New method.
7207 (Arm_relocate_functions::calc_grp_residual): New method.
7208 (Arm_relocate_functions::calc_grp_gn): New method.
7209 (Arm_relocate_functions::arm_grp_alu): New Method.
7210 (Arm_relocate_functions::arm_grp_ldr): New Method.
7211 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7212 (Arm_relocate_functions::arm_grp_ldc): New Method.
7213 (Target_arm::Scan::local): Handle the ARM group relocations.
7214 (Target_arm::Scan::global): Likewise.
7215 (Target_arm::Relocate::relocate): Likewise.
7216 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7219 2010-01-26 Doug Kwan <dougkwan@google.com>
7221 * arm.cc (set): Include.
7222 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7224 (Arm_output_section::Text_section_list): New type.
7225 (Arm_output_section::append_text_sections_to_list): New method.
7226 (Arm_output_section::fix_exidx_coverage): Ditto.
7227 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
7228 (Arm_relobj::convert_input_section_to_relaxed_section): Use
7229 Relobj::set_section_offset() instead of
7230 Sized_relobj::invalidate_section_offset().
7231 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
7232 parameter for section headers. Ignore relocation sections for
7233 unallocated sections and EXIDX sections.
7234 (Target_arm::fix_exidx_coverage): New method.
7235 (Target_arm::output_section_address_less_than): New type.
7236 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7237 linked text section instead of the EXIDX section.
7238 (Arm_output_section::create_stub_group): Add an assertion to check
7239 that this is not an EXIDX output section.
7240 (Arm_output_section::append_text_sections_to_list): New method.
7241 (Arm_output_section::fix_exidx_coverage): Ditto.
7242 (Arm_relobj::scan_sections_for_stubs): Adjust call to
7243 Arm_relobj::section_needs_reloc_stub_scanning.
7244 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7246 (Target_arm::fix_exidx_coverage): New method.
7247 * object.h (Relobj::set_output_section): New method.
7248 (Sized_relobj::invalidate_section_offset): Remove method.
7249 (Sized_relobj::do_invalidate_section_offset): Remove method.
7250 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7252 2010-01-25 Doug Kwan <dougkwan@google.com>
7254 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7255 Fix warning due to signed and unsigned comparison on a 32-bit host.
7257 2010-01-22 Doug Kwan <dougkwan@google.com>
7259 * arm.cc (Target_arm::do_relax): Record an output section for section
7260 offset adjustment it contains any stub table that has changed.
7261 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7262 offsets in an output section if necessary.
7263 * output.cc (Output_section::Output_section): Initialize
7264 section_offsets_need_adjustments_.
7265 (Output_section::add_input_section_for_script): Renamed to
7266 Output_section::add_simple_input_section.
7267 (Output_section::save_states): Add a comment.
7268 (Output_section::discard_states): New method defintion.
7269 (Output_section::adjust_section_offsets): Same.
7270 * output.h (Output_section::add_input_section_for_script): Renamed to
7271 Output_section::add_simple_input_section.
7272 (Output_section::discard_states): New method declaration.
7273 (Output_section::adjust_section_offsets): Same.
7274 (Output_section::section_offsets_need_adjustment,
7275 Output_section::set_section_offsets_need_adjustment): New method
7277 (Output_section::section_offsets_need_adjustment_): New data member.
7278 * script-sections.cc
7279 (Output_section_element_input::set_section_address): Adjust code for
7280 renaming of Output_section::add_input_section_for_script.
7281 (Orphan_output_section::set_section_address): Same.
7283 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7285 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7286 Fix_v4bx enum values .
7287 * gold/options.h (General_options): New option definitions.
7288 (General_options::fix_v4bx): New method.
7289 (General_options::Fix_v4bx): New enum.
7290 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7291 (General_options::parse_fix_v4bx_interworking): New method.
7293 2010-01-22 Doug Kwan <dougkwan@google.com>
7295 * arm.cc (Arm_exidx_fixup): New class.
7297 2010-01-21 Doug Kwan <dougkwan@google.com>
7299 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7301 (Arm_exidx_section_offset_map): New type.
7303 2010-01-21 Doug Kwan <dougkwan@google.com>
7305 * arm.cc (Arm_exidx_input_section): New class.
7306 (Arm_relobj::exidx_input_section_by_link,
7307 Arm_relobj::exidx_input_section_by_shndx,
7308 Arm_relobj::make_exidx_input_section): New methods.
7309 (read_arm_attributes_section): Remove.
7310 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7311 information about them.
7312 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7315 2010-01-20 Doug Kwan <dougkwan@google.com>
7317 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7318 Input_section_specifier to Section_id.
7319 (Target_arm::new_arm_input_section: Adjust code for change of key
7321 (Target_arm::find_arm_input_section): Ditto.
7322 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7323 (Section_id): Remove.
7324 (Garbage_collection::Section_id_hash): Remove.
7325 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7326 (Section_id): Remove.
7327 (Icf::Section_id_hash): Remove.
7328 * object.h (Section_id, Const_section_id, Section_id_hash,
7329 Const_section_id_hash): New type definitions.
7330 * output.cc (Output_section::add_relaxed_input_section): Change to
7331 use Const_section_id instead of Input_section_specifier as key type.
7332 (Output_section::add_merge_input_section): Ditto.
7333 (Output_section::build_relaxation_map): Change to use Section_id
7334 instead of Input_section_specifier as key type.
7335 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7337 (Output_section::convert_input_sections_to_relaxed_sections): Change
7338 to use Const_section_id instead of Input_section_specifier as key type.
7339 (Output_section::find_merge_section): Ditto.
7340 (Output_section::find_relaxed_input_section): Ditto.
7341 * output.h (Input_section_specifier): Remove class.
7342 (Output_section::Output_section_data_by_input_section_map): Change
7343 key type to Const_section_id.
7344 (Output_section::Output_relaxed_input_section_by_input_section_map):
7346 (Output_section::Relaxation_map): Change key type to Section_id.
7348 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7350 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7351 (class Arm_v4bx_stub): New class.
7352 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7353 (Stub_factory::make_arm_v4bx_stub): New method.
7354 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7355 (Stub_table::empty): Handle v4bx stubs.
7356 (Stub_table::add_arm_v4bx_stub): New method.
7357 (Stub_table::find_arm_v4bx_stub): New method.
7358 (Arm_relocate_functions::v4bx): New method.
7359 (Target_arm::fix_v4bx): New method.
7360 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7361 (Stub_table::relocate_stubs): Likewise.
7362 (Stub_table::do_write): Likewise.
7363 (Stub_table::update_data_size_and_addralign): Likewise.
7364 (Stub_table::finalize_stubs): Likewise.
7365 (Target_arm::Scan::local): Likewise.
7366 (Target_arm::Scan::global): Likewise.
7367 (Target_arm::do_finalize_sections): Likewise.
7368 (Target_arm::Relocate::relocate): Likewise.
7369 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7371 (Target_arm::scan_reloc_for_stub): Likewise.
7372 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7374 2010-01-19 Ian Lance Taylor <iant@google.com>
7376 * output.cc (Output_section_headers::do_sized_write): Write large
7377 segment count to sh_info field.
7378 (Output_file_header::do_sized_write): For large segment count,
7379 write PN_XNUM to e_phnum field.
7381 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7383 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7384 (Arm_relocate_functions::thm_jump8): New function.
7385 (Arm_relocate_functions::thm_jump11): New function.
7386 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7388 (Target_arm::Scan::global): Likewise.
7389 (Target_arm::Relocate::relocate): Likewise.
7390 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7393 2010-01-14 Doug Kwan <dougkwan@google.com>
7395 * arm.cc (map, utility): Include headers.
7396 (Target_arm::apply_cortex_a8_workaround): New method.
7397 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7398 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7399 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7400 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7401 the --[no-]fix-cortex-a8 command line options.
7402 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7403 (Target_arm::relocate_stub): Use addend in instruction template.
7404 * options.h (DEFINE_bool): Set the user-set flag.
7405 (General_options): Add --[no-]-fix-cortex options.
7406 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
7407 : Update fast look-up map after conversion.
7409 2010-01-14 Sriraman Tallam <tmsriram@google.com>
7411 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7412 in the first pass of do_layout.
7414 2010-01-13 Doug Kwan <dougkwan@google.com>
7416 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7417 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7418 apparent compiler problem of not folding static constant integral
7419 data members of elfcpp::Elf_sizes<32>.
7421 2010-01-13 Doug Kwan <dougkwan@google.com>
7423 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7424 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7425 Arm_relobj::scan_section_for_cortex_a8_erratum,
7426 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7427 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7428 sections to scan for relocation stubs into a new method
7429 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7430 relocation and Cortex-A8 stub scanning.
7431 (Target_arm::do_relax): Force stubs to be after stubbed sections
7432 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
7433 the beginning of a new relaxation pass. Update a comment.
7434 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7436 2010-01-12 Ian Lance Taylor <iant@google.com>
7438 * target-reloc.h (visibility_error): New inline function.
7439 (relocate_section): Call visibility_error.
7440 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7441 (MOSTLYCLEANFILES): Likewise.
7442 (protected_4_pic.o, protected_3.err): New targets.
7443 * testsuite/protected_4.cc: New file.
7445 2010-01-12 Doug Kwan <dougkwan@google.com>
7447 * arm.cc (Cortex_a8_reloc): New class.
7448 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7449 and cortex_a8_relocs_info_.
7450 (Target_arm::fix_cortex_a8): New method definition.
7451 (Target_arm::Cortex_a8_relocs_info): New type.
7452 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7453 New data member declarations.
7454 (Target_arm::scan_reloc_for_stub): Record information about
7455 relocations for THUMB branches that might be exempted from the
7456 Cortex-A8 workaround.
7457 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7458 at the beginning of a relaxation pass.
7460 2010-01-12 Doug Kwan <dougkwan@google.com>
7462 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7463 (Arm_relobj::Mapping_symbol_position,
7464 Arm_reloj::Mapping_symbol_position_less,
7465 Arm_relobj::Mapping_symbols_info): New types.
7466 (Target_arm::is_mapping_symbol_name): New method definition.
7467 (Arm_relobj::do_count_local_symbols): Save information about mapping
7470 2010-01-11 Doug Kwan <dougkwan@google.com>
7472 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7473 Arm_relocate_functions::thumb32_branch_upper,
7474 Arm_relocate_functions::thumb32_branch_lower,
7475 Arm_relocate_functions::thumb32_cond_branch_offset,
7476 Arm_relocate_functions::thumb32_cond_branch_upper,
7477 Arm_relocate_functions::thumb32_cond_branch_lower,
7478 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7479 branch offset encoding.
7480 (Arm_relocate_functions::thumb_branch_common): Use new branch
7481 offset encoding methods to avoid code duplication.
7482 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7483 (Stub_addend_reader::operator()): Use new branch encoding method
7484 to avoid code duplication.
7486 2010-01-11 Doug Kwan <dougkwan@google.com>
7488 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7489 (Target_arm::do_finalize_sections): Define special EXIDX section
7490 symbols only if referenced.
7491 * gc.h (Garbage_collection::add_reference): New method.
7492 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7495 2010-01-11 Ian Lance Taylor <iant@google.com>
7497 * script.cc (Version_script_info::build_expression_list_lookup):
7498 Change complaing about duplicate wildcard match from error to
7501 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7503 (Version_script_info::Version_script_info): Initialize globs_,
7504 default_version_, default_is_global_, and exact_. Don't
7505 initialize globals_ or locals_.
7506 (Version_script_info::build_lookup_tables): Build local symbols
7508 (Version_script_info::unquote): New function.
7509 (Version_script_info::add_exact_match): New function.
7510 (Version_script_info::build_expression_list_lookup): Remove lookup
7511 parameter. Add is_global parameter. Change all callers. Handle
7512 wildcard pattern specially. Unquote pattern. Call
7514 (Version_script_info::get_name_to_match): New function.
7515 (Version_script_info::get_symbol_version): New function.
7516 (Version_script_info::get_symbol_version_helper): Remove.
7517 (Version_script_info::check_unmatched_names): Call unquote.
7518 * script.h (class Version_script_info): Change get_symbol_version
7519 to be non-inline and add is_global parameter; change all callers.
7520 Rewrite symbol_is_local. Update declarations. Define struct
7521 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7522 Remove globals_ and locals_ members. Add exact_, globs_,
7523 default_version_, is_global_.
7524 (Version_script_info::Glob): Remove pattern, add expression and
7525 is_global. Update constructor. Change all callers.
7526 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7528 (Versions::symbol_section_contents): If a symbol is undefined, or
7529 defined in a dynamic object, set the version index to
7531 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7533 (Symbol_table::add_from_pluginobj): Likewise.
7534 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7536 2010-01-11 Doug Kwan <dougkwan@google.com>
7538 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7539 (incremental_dump_LDADD): Add linking option for libintl.
7540 * Makefile.in: Regenerate.
7542 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7545 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7547 * testsuite/Makefile.in: Regenerated.
7549 2010-01-10 Doug Kwan <dougkwan@google.com>
7551 * options.h (DEFINE_var): Use parentheses around argument varname__
7552 in macro body to avoid any unintended subsequent substitutions.
7554 2010-01-10 Ian Lance Taylor <iant@google.com>
7556 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7557 candidates before doing symbol resolution.
7559 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7560 ODR candidates if only one is weak.
7562 2010-01-08 Ian Lance Taylor <iant@google.com>
7564 * script.cc (Version_script_info::build_expression_list_lookup):
7565 Don't warn about ambiguous version, just record the ambiguity.
7566 (Version_script_info::get_symbol_version_helper): Give error if
7567 version is ambiguous.
7569 2010-01-08 Doug Kwan <dougkwan@google.com>
7571 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7572 prev_data_size_ and prev_addralign_. Remove initializer for
7573 deleted data member has_been_changed_.
7574 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7575 to determine if the table is empty.
7576 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7578 (Stub_table::add_reloc_stub): Define method in class definition
7579 instead of just declaring it there.
7580 (Stub_table::add_cortex_a8_stub): New method definition.
7581 (Stub_table::update_data_size_and_addralign): Ditto.
7582 (Stub_table::finalize_stubs): Ditto.
7583 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7584 (Stub_table::do_addralign_): Return address alignment in the
7585 (Stub_table::do_reset_address_and_file_offset): Define method in
7586 class definition instead of declaring it there. Set current data
7587 size to be the data size of the previous pass.
7588 (Stub_table::set_final_data_size): Use current data size as the
7590 (Stub_table::relocate_stub): Change parameter type of stub from
7591 Reloc_stub pointer to Stub pointer.
7592 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7593 (Stub_table::Cortex_a8_stub_list): New typedef.
7594 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7595 Stub_table::prev_addralign_): New data member.
7596 (Arm_relobj::Arm_relobj): Initialize data member
7597 section_has_cortex_a8_workaround_.
7598 (Arm_relobj::section_has_cortex_a8_workaround,
7599 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7601 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7603 (Target_arm::relocate_stub): Change parameter type of stub from
7604 Reloc_stub pointer to Stub pointer.
7605 (Insn_template::size, Insn_template::alignment): Handle
7606 THUMB16_SPECIAL_TYPE.
7607 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7608 Stub_table::update_data_size_and_addralign,
7609 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7611 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7612 (Stub_table::do_write): Ditto.
7613 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7615 2010-01-08 Ian Lance Taylor <iant@google.com>
7618 * symtab.h (class Symbol): Remove fields is_target_special_ and
7619 has_plt_offset_. Add field is_defined_in_discarded_section_.
7620 (Symbol::is_defined_in_discarded_section): New function.
7621 (Symbol::set_is_defined_in_discarded_section): New function.
7622 (Symbol::has_plt_offset): Rewrite.
7623 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7624 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7625 Don't initialize is_target_special_ or has_plt_offset_.
7626 Initialize is_defined_in_discarded_section_.
7627 (Symbol_table::add_from_relobj): If appropriate, set
7628 is_defined_in_discarded_section.
7629 * resolve.cc (Symbol::override_base_with_special): Don't test
7630 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7631 * target-reloc.h (relocate_section): Do special handling for
7632 symbols defined in discarded sections for global symbols as well
7635 2010-01-08 Ian Lance Taylor <iant@google.com>
7637 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7638 the SHT_SYMTAB case.
7640 2010-01-08 Ian Lance Taylor <iant@google.com>
7642 * object.cc (Sized_relobj::do_layout): Don't get confused if
7643 layout_eh_frame returns NULL.
7645 2010-01-08 Ian Lance Taylor <iant@google.com>
7648 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7649 dynamic symbol table, use the normal symbol table.
7650 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7653 2010-01-08 Ian Lance Taylor <iant@google.com>
7656 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7659 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7661 * version.cc (print_version): Change to "Copyright 2010".
7663 2010-01-08 Ian Lance Taylor <iant@google.com>
7667 * i386.cc (class Target_i386): Change return type of plt_section
7669 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7670 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7671 tls_desc_rel_ field.
7672 (Output_data_plt_i386::rel_tls_desc): New function.
7673 (Target_i386::rel_tls_desc_section): New function.
7674 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7675 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7676 R_386_TLS_DESC reloc in rel_tls_desc_section.
7677 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7678 Define struct Tlsdesc_info.
7679 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7680 (Target_x86_64::do_reloc_symbol_index): New function.
7681 (Target_x86_64::add_tlsdesc_info): New function.
7682 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7683 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7685 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7687 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7688 (Target_x86_64::rela_tlsdesc_section): New function.
7689 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7691 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7692 (Target_x86_64::do_reloc_addend): New function.
7693 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7694 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7695 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7696 (Output_reloc::type): New function.
7697 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7698 (Output_reloc::is_target_specific): New function.
7699 (Output_reloc::target_arg): New function.
7700 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7701 absolute relocs and target specific relocs.
7702 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7703 add_target_specific.
7704 (class Output_data_reloc) [SHT_RELA]: Likewise.
7705 * output.cc (Output_reloc::Output_reloc): Add four new versions
7706 for absolute relocs and target specific relocs.
7707 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7708 (Output_reloc::get_symbol_index): Likewise.
7709 (Output_reloc::local_section_offset): Check that local_sym_index_
7710 is not TARGET_CODE or 0.
7711 (Output_reloc::symbol_value): Likewise.
7712 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7714 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7715 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7717 * layout.cc (add_target_dynamic_tags): Use output section for
7718 DT_PLTRELSZ and DT_JMPREL.
7720 2010-01-07 Ian Lance Taylor <iant@google.com>
7723 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7725 (class Output_data_reloc_generic): Define.
7726 (class Output_data_reloc_base): Change base class to
7727 Output_data_reloc_generic. Change add() method to call
7728 bump_relative_reloc_count for a relative reloc. Remove
7730 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7732 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7733 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7735 * layout.h (class Layout): Update declaration.
7737 2010-01-07 Ian Lance Taylor <iant@google.com>
7739 * output.h (class Output_data): Add const version of
7740 output_section and do_output_section.
7741 (class Output_section_data): Add const version of
7743 (class Output_section): Likewise.
7744 * layout.cc (Layout::add_target_dynamic_tags): New function.
7745 * layout.h (class Layout): Update declarations.
7746 * arm.cc (Target_arm::do_finalize_sections): Use
7747 add_target_dynamic_tags.
7748 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7749 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7750 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7751 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7753 2010-01-07 Ian Lance Taylor <iant@google.com>
7756 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7759 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7760 Ian Lance Taylor <iant@google.com>
7763 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7764 Xindex::read_symtab_xindex.
7766 2010-01-07 Doug Kwan <dougkwan@google.com>
7768 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7769 (Insn_template::thumb16_bcond_insn): New method declaration.
7770 (Insn_template): Fix spelling.
7771 (Stub::thumb16_special): New method declaration.
7772 (Stub::do_write): Define virtual method which was previously pure
7774 (Stub::do_thumb16_special): New method declaration.
7775 (Stub::do_fixed_endian_write): New template member.
7776 (Reloc_stub::do_write): Remove.
7777 (Reloc_stub::do_fixed_endian_write): Remove.
7778 (Cortex_a8_stub): New class definition.
7779 (Stub_factory::make_cortex_a8_stub): New method definition.
7780 (Stub_factory::Stub_factory): Add missing static storage class
7781 qualifier for elf32_arm_stub_a8_veneer_blx.
7783 2010-01-07 Ian Lance Taylor <iant@google.com>
7786 * options.h (class General_options): Add --warn-unresolved-symbols
7787 and --error-unresolved-symbols.
7788 * errors.cc (Errors::undefined_symbol): Implement
7789 --warn-unresolved-symbols.
7791 * options.h (class General_options): Add -z text and -z textoff.
7792 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7794 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7796 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7797 (Garbage_collection::cident_sections): New function.
7798 (Garbage_collection::add_cident_section): New function.
7799 (Garbage_collection::cident_sections_): New member.
7800 (gc_process_relocs): Add references to sections whose names are C
7802 * gold.h (cident_section_start_prefix): New constant.
7803 (cident_section_stop_prefix): New constant.
7804 (is_cident): New function.
7805 * layout.cc (Layout::define_section_symbols): Replace string constants
7806 with the newly defined constants.
7807 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7809 * testsuite/Makefile.am: Add gc_orphan_section_test.
7810 * testsuite/Makefile.in: Regenerate.
7811 * testsuite/gc_orphan_section_test.cc: New file.
7812 * testsuite/gc_orphan_section_test.sh: New file.
7814 2010-01-06 Ian Lance Taylor <iant@google.com>
7817 * options.h (class General_options): Add --warn-shared-textrel.
7818 * layout.cc (Layout::finish_dynamic_section): Implement
7819 --warn-shared-textrel.
7822 * options.h (class General_options): Add --warn-multiple-gp.
7824 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7826 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7827 $(THREADSLIB) and $(LIBDL).
7828 * Makefile.in: Rebuild.
7830 2010-01-06 Ian Lance Taylor <iant@google.com>
7833 * options.cc (General_options::parse_section_start): New function.
7834 (General_options::section_start): New function.
7835 (General_options::General_options): Initialize all members.
7836 * options.h: Include <map>
7837 (class General_options): Add --section-start. Add section_starts_
7839 * layout.cc (Layout::attach_allocated_section_to_segment): If
7840 --section-start was used, set the address of the segment. Remove
7841 local sort_sections.
7842 (Layout::relaxation_loop_body): If the address of the load segment
7843 has been set by --section-start, don't use it.
7844 * output.h (Output_segment::update_flags_for_output_section): New
7846 * output.cc (Output_segment::add_output_section): Call
7847 update_flags_for_output_section.
7849 2010-01-05 Ian Lance Taylor <iant@google.com>
7852 * options.h (class General_options): Add --undefined-version.
7853 * script.cc (struct Version_expression): Add was_matched_by_symbol
7855 (Version_script_info::matched_symbol): New function.
7856 (Version_script_info::get_symbol_version_helper): Call
7858 (Version_script_info::check_unmatched_names): New function.
7859 * script.h (class Version_script_info): Update declarations.
7860 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7862 * options.h (class General_options): Use DEFINE_bool_alias for
7863 allow_multiple_definition.
7864 * resolve.cc (Symbol_table::should_override): Don't test
7865 allow_multiple_definition.
7868 * options.h (class General_options): Add --cref.
7869 * main.cc (main): Print cref table if --cref. Don't close mapfile
7870 until after printing cref table.
7871 * cref.cc: Include "symtab.h".
7872 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7873 (Cref_table_compare::operator()): New function.
7874 (Cref_inputs::gather_cref): New function.
7875 (filecol): New static const.
7876 (Cref_inputs::print_cref): New function.
7877 (Cref::print_cref): New function.
7878 * cref.h: Include <cstdio>.
7879 (class Cref): Update declarations.
7880 * mapfile.h (Mapfile::file): New function.
7881 * object.h (class Object): Define Symbols. Declare virtual
7882 do_get_global_symbols.
7883 (Object::get_global_symbols): New function.
7884 * object.cc (Input_objects::add_object): Pass object to cref_ if
7886 (Input_objects::archive_start): Likewise.
7887 (Input_objects::archive_stop): Likewise.
7888 (Input_objects::print_cref): New function.
7889 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7890 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7892 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7894 * plugin.h (class Sized_pluginobj): Update declarations.
7896 2010-01-05 Ian Lance Taylor <iant@google.com>
7898 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7899 to is_default_version. Rename insdef to insdefault.
7900 (Symbol_table::add_from_relobj): Rename def to is_default_version
7901 and local to is_forced_local.
7902 (Symbol_table::add_from_pluginobj): Likewise.
7903 (Symbol_table::add_from_dynobj): Likewise.
7904 (Symbol_table::define_special_symbol): Rename insdef to
7907 2010-01-04 Ian Lance Taylor <iant@google.com>
7910 * options.h (class General_options): Add
7911 --allow-multiple-definition and -z muldefs.
7912 * resolve.cc (Symbol_table::should_override): Don't warn about a
7913 multiple symbol definition if --allow-multiple-definition or -z
7917 * options.h (class General_options): Add --add-needed and
7918 --copy-dt-needed-entries. Tweak --as-needed help entry.
7919 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7920 error if --copy-dt-needed-entries aka --add-needed is used and
7921 would cause a change in behaviour.
7924 * options.h (class General_options): Add -G as a short version of
7925 --shared. Add no-op options -assert, -g, and -i.
7927 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7929 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7930 check for .text or .gnu.linkonce.t sections.
7931 * icf.cc (Icf::find_identical_sections): Ditto.
7932 Change the detection for mangled function name within the section
7934 * icf.h (is_section_foldable_candidate): New function.
7936 2009-12-30 Ian Lance Taylor <iant@google.com>
7939 * options.h (class General_options): Permit two dashes with
7940 --retain-symbols-file.
7942 2009-12-30 Ian Lance Taylor <iant@google.com>
7945 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7946 don't put the file header and segment headers in the text
7950 * common.cc (Sort_commons::operator()): Stabilize sort when both
7952 (Symbol_table::do_allocate_commons_list): When allocating common
7953 symbols, skip a symbol which is no longer common.
7954 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7955 an object before checking its type.
7956 * testsuite/common_test_2.c: New file.
7957 * testsuite/common_test_3.c: New file.
7958 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7959 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7960 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7961 (common_test_2_pic.o, common_test_2.so): New targets.
7962 (common_test_3_pic.o, common_test_3.so): New targets.
7963 * testsuite/Makefile.in: Rebuild.
7966 * script.cc (read_input_script): If we see a new SECTIONS clause,
7967 and we have added an input section, give an error.
7968 * layout.h (class Layout): Add have_added_input_section function.
7969 Add have_added_input_section_ field.
7970 * layout.cc (Layout::Layout): Initialize
7971 have_added_input_section_.
7972 (Layout::layout): Set have_added_input_section_.
7973 (Layout::layout_eh_frame): Likewise.
7975 2009-12-30 Ian Lance Taylor <iant@google.com>
7978 * options.h (class General_options): Add --sort-common option.
7979 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7980 * common.cc (Sort_common): Add sort_order parameter to
7981 constructor. Add sort_order_ field.
7982 (Sort_commons::operator): Check sort_order_.
7983 (Symbol_table::allocate_commons): Determine the sort order.
7984 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7986 (Symbol_table::do_allocate_commons_list): Likewise.
7988 2009-12-30 Ian Lance Taylor <iant@google.com>
7991 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7992 symbols from this object, don't change the visibility of an
7994 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7996 2009-12-30 Ian Lance Taylor <iant@google.com>
7999 * script.h (class Version_script_info): Define Language enum.
8000 Update declarations. Define Glob, Exact, and Lookup types. Add
8001 new fields globals_, locals_, and is_finalized_.
8002 * script.cc: Various formatting fixes.
8003 (class Parser_closure): Change language_stack_ from a vector of
8004 std::string to one of Version_script_info::Language. Adjust all
8006 (class Lazy_demangler): Remove.
8007 (struct Version_expression): Change language from std::string to
8008 Version_script_info::Language.
8009 (Version_script_info::Version_script_info): New function.
8010 (Version_script_info::~Version_script_info): Don't call clear.
8011 (Version_script_info::finalize): New function.
8012 (Version_script_info::build_lookup_tables): New function.
8013 (Version_script_info::build_expression_list_lookup): New
8015 (Version_script_info::get_symbol_version_helper): Rewrite to use
8017 (Version_script_info::print_expression_list): Adjust to use
8018 Version_script_info::Language.
8019 (script_push_lex_into_version_mode): Check that the version script
8020 has not been finalized.
8021 (version_script_push_lang): Change language string to
8022 Version_script_info::Language.
8023 * options.cc (Command_line::version_script): New function.
8024 * options.h (class General_options): Add finalize_dynamic_list
8025 function. Change version_script from declaration to definition.
8026 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8027 * testsuite/version_script.map: Remove duplicate def of foo.
8028 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8030 * testsuite/Makefile.in: Rebuild.
8032 2009-12-30 Ian Lance Taylor <iant@google.com>
8035 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8036 if the input symbol index is 0, make the output symbol index 0.
8038 2009-12-30 Ian Lance Taylor <iant@google.com>
8041 * options.h (class General_options): Add -x/--discard-all.
8042 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8043 --discard-all. If the local symbol needs a dynamic entry, check
8044 that before handling --discard-locals.
8046 2009-12-30 Ian Lance Taylor <iant@google.com>
8049 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8051 (Output_segment::add_output_section): Don't change the flags if
8055 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8056 GNU hash table if they need a dynamic value. Otherwise, don't add
8057 them if they are defined in a dynamic object or are forced local.
8059 2009-12-29 Ian Lance Taylor <iant@google.com>
8062 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8063 .gnu.hash table for a 32-bit target.
8066 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8067 regular and a dynamic object only needs a dynamic symbol table
8068 entry if it is externally visible.
8071 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8072 constructor. Add global_offset_table_ field.
8073 (Target_i386::got_section): Set global_offset_table_.
8074 (Target_i386::do_finalize_sections): Set global_offset_table_
8076 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8077 in constructor. Add global_offset_table_ field.
8078 (Target_x86_64::got_section): Set global_offset_table_.
8079 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8082 * layout.cc (Layout::Layout): Initialize increase_relro_.
8083 (Layout::get_output_section): Add is_relro, is_last_relro, and
8084 is_first_non_relro parameters. Change all callers.
8085 (Layout::choose_output_section): Likewise.
8086 (Layout::add_output_section_data): Likewise.
8087 (Layout::make_output_section): Likewise.
8088 (Layout::set_segment_offsets): Clear increase_relro when using a
8090 * layout.h (class Layout): Add increase_relro method. Add
8091 increase_relro_ field. Update declarations.
8092 * output.cc (Output_section::Output_section): Initialize
8093 is_last_relro_ and is_first_non_relro_.
8094 (Output_segment::add_output_section): Group relro sections is
8095 do_sort is true. Handle is_last_relro and is_first_non_relro.
8096 (Output_segment::maximum_alignment): Remove relro handling.
8097 (Output_segment::set_section_addresses): Add increase_relro
8098 parameter. Change all callers. Add initial alignment to align
8099 relro sections on separate page. Remove old relro handling.
8100 (Output_segment::set_section_list_addresses): Remove in_relro
8101 parameter. Change all callers.
8102 (Output_segment::set_offset): Add increase parameter. Change all
8103 callers. Remove old relro handling.
8104 * output.h (class Output_section): Add new methods: is_last_relro,
8105 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8106 Add is_last_relro_ and is_first_non_relro_ fields.
8107 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8108 Create separate .got.plt section. Call increase_relro.
8109 * x86_64.cc (Target_x86_64::got_section): Likewise.
8110 * testsuite/relro_script_test.t: Add .got.plt.
8113 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8114 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8115 (Layout::finalize): Call set_dynamic_symbol_size.
8116 (Layout::set_dynamic_symbol_size): New function.
8117 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8118 set_dynamic_symbol_size.
8121 * output.h (class Output_section): Add is_entsize_zero_ field.
8122 * output.cc (Output_section::Output_section): Initialize
8124 (Output_section::set_entsize): If two different entsizes are
8125 requested, force it to zero.
8126 (Output_section::add_input_section): Set flags for .debug_str
8127 before updating section flags. Set entsize.
8128 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8129 and SHF_STRING if all input sections have those flags.
8131 2009-12-29 Rafael Espindola <espindola@google.com>
8133 * main.cc (main): Fix the sys time reporting.
8134 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8137 2009-12-29 Sriraman Tallam <tmsriram@google.com>
8139 * options.cc (General_options::parse_version): Allow -v to exit
8140 without an error if there is nothing to link.
8142 2009-12-29 Ian Lance Taylor <iant@google.com>
8144 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8145 using a version of gcc before 4.1.
8146 * configure: Rebuild.
8148 2009-12-28 Chris Demetriou <cgd@google.com>
8150 * attributes.cc (Output_attributes_section_data::do_write): Use
8151 std::vector::front rather than std::vector::data.
8153 2009-12-28 Ian Lance Taylor <iant@google.com>
8155 * symtab.h (class Symbol_table): Add enum Defined.
8156 * resolve.cc (Symbol_table::should_override): Add defined
8157 parameter. Change all callers. Test whether object is NULL
8158 before calling a method on it.
8159 (Symbol_table::report_resolve_problem): Add defined parameter.
8161 (Symbol_table::should_override_with_special): Likewise.
8162 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8163 parameter. Change all callers.
8164 (Symbol_table::do_define_in_output_data): Likewise.
8165 (Symbol_table::define_in_output_segment): Likewise.
8166 (Symbol_table::do_define_in_output_segment): Likewise.
8167 (Symbol_table::define_as_constant): Likewise.
8168 (Symbol_table::do_define_as_constant): Likewise.
8169 * script.h (class Symbol_assignment): Add is_defsym parameter to
8170 constructor; change all callers.
8171 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8172 parameter. Change all callers. Add is_defsym_ field.
8173 (class Parser_closure): Add parsing_defsym parameter to
8174 constructor; change all callers. Add parsing_defsym accessor
8175 function. Add parsing_defsym_ field.
8177 2009-12-28 Ian Lance Taylor <iant@google.com>
8179 * gold.cc (queue_middle_tasks): Fix formatting.
8180 * object.cc (Relobj::is_section_name_included): Likewise.
8182 2009-12-23 Ian Lance Taylor <iant@google.com>
8184 * i386.cc (Target_i386::do_calls_non_split): Recognize
8185 -fsplit-stack prologue for a function with a static chain.
8186 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8187 -fsplit-stack prologue when using %r11.
8189 2009-12-21 Sriraman Tallam <tmsriram@google.com>
8191 * options.cc (General_options::parse_version): Make -v continue and do
8192 the link like GNU ld does.
8194 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
8196 * Makefile.am (CCFILES): Add timer.cc.
8197 (HFILES): Add timer.h.
8198 * configure.ac: Check for sysconf and times.
8199 * main.cc: include timer.h.
8200 (main): Use Timer instead of get_run_time.
8203 * workqueue.cc: include timer.h.
8204 (Workqueue::find_and_run_task):
8205 Report user, sys and wall time.
8206 * Makefile.in: Regenerate.
8207 * config.in: Regenerate.
8208 * configure: Regenerate.
8210 2009-12-16 Doug Kwan <dougkwan@google.com>
8212 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8214 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8215 relaxed input sections.
8216 * output.cc (Output_section::find_relaxed_input_section): Change
8217 return type to Output_relaxed_input_section pointer. Adjust code
8218 for new type of relaxed_input_section_map_.
8219 * output.h (Output_section::find_relaxed_input_section): Change
8220 return type to Output_relaxed_input_section pointer.
8221 (Output_section::Output_relaxed_input_section_by_input_section_map):
8223 (Output_section::relaxed_input_section_map_): Change type to
8224 Output_section::Output_relaxed_input_section_by_input_section_map.
8225 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8228 2009-12-15 Ian Lance Taylor <iant@google.com>
8230 * layout.cc (Layout::create_shstrtab): Only write out after input
8231 sections if we are compressing debug sections.
8233 2009-12-15 Ian Lance Taylor <iant@google.com>
8235 * archive.cc (Archive::add_symbols): Only look up a symbol without
8236 a version if there is, in fact, a version.
8238 2009-12-14 Ian Lance Taylor <iant@google.com>
8240 Revert -Wshadow changes, all changes from:
8241 2009-12-11 Doug Kwan <dougkwan@google.com>
8242 2009-12-11 Nick Clifton <nickc@redhat.com>
8243 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8245 2009-12-11 Doug Kwan <dougkwan@google.com>
8247 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8249 * attributes.cc (Object_attribute::size): Ditto.
8250 (Attributes_section_data::size): Ditto.
8251 (Attributes_section_data::Attributes_section_data): Ditto.
8252 (Output_attributes_section_data::do_write): Ditto.
8253 * attributes.h (Object_attribute::set_type): Ditto.
8254 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8256 2009-12-11 Nick Clifton <nickc@redhat.com>
8258 * archive.cc: Fix shadowed variable warnings.
8260 * compressed_output.cc: Likewise.
8261 * compressed_output.h: Likewise.
8262 * configure: Likewise.
8263 * dwarf_reader.cc: Likewise.
8264 * dynobj.cc: Likewise.
8265 * dynobj.h: Likewise.
8266 * ehframe.cc: Likewise.
8267 * ehframe.h: Likewise.
8268 * errors.cc: Likewise.
8269 * expression.cc: Likewise.
8270 * fileread.cc: Likewise.
8271 * fileread.h: Likewise.
8272 * freebsd.h: Likewise.
8273 * i386.cc: Likewise.
8275 * incremental.h: Likewise.
8276 * layout.cc: Likewise.
8277 * layout.h: Likewise.
8278 * mapfile.cc: Likewise.
8279 * merge.cc: Likewise.
8280 * merge.h: Likewise.
8281 * object.cc: Likewise.
8282 * object.h: Likewise.
8283 * options.h: Likewise.
8284 * output.cc: Likewise.
8285 * output.h: Likewise.
8286 * parameters.cc: Likewise.
8287 * plugin.cc: Likewise.
8288 * powerpc.cc: Likewise.
8289 * reduced_debug_output.cc: Likewise.
8290 * reduced_debug_output.h: Likewise.
8291 * reloc.cc: Likewise.
8292 * reloc.h: Likewise.
8293 * resolve.cc: Likewise.
8294 * script-sections.cc: Likewise.
8295 * script.cc: Likewise.
8296 * script.h: Likewise.
8297 * sparc.cc: Likewise.
8298 * symtab.cc: Likewise.
8299 * symtab.h: Likewise.
8300 * target-select.cc: Likewise.
8301 * target-select.h: Likewise.
8302 * token.h: Likewise.
8303 * workqueue.cc: Likewise.
8304 * workqueue.h: Likewise.
8305 * x86_64.cc: Likewise.
8307 2009-12-10 Doug Kwan <dougkwan@google.com>
8309 * arm.cc (attributes.h): New include.
8310 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8311 (Arm_relobj::~Arm_relobj): Delete object pointed by
8312 attributes_section_data_.
8313 (Arm_relobj::attributes_section_data): New method definition.
8314 (Arm_relobj::attributes_section_data_): New data member declaration.
8315 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8316 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8317 attributes_section_data_.
8318 (Arm_dynobj::attributes_section_data): New method definition.
8319 (Arm_dynobj::attributes_section_data_): New data member declaration.
8320 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8321 initialization value of may_use_blx_ to false.
8322 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
8323 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8324 object attributes to compute results instead of hard-coding.
8325 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8326 Target_arm::get_secondary_compatible_arch,
8327 Target_arm::set_secondary_compatible_arch
8328 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8329 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8330 New method declarations.
8331 (Target_arm::get_aeabi_object_attribute): New method definition.
8332 (Target_arm::attributes_section_data_): New data member declaration.
8333 (read_arm_attributes_section): New template definition.
8334 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8335 (Arm_dynobj::do_read_symbols): Ditto.
8336 (Target_arm::do_finalize_sections): Merge attributes sections from
8337 input. Check for BLX use after attributes section merging.
8338 Fix __exidx_start and __exidx_end visibility. Create an
8339 .ARM.attributes section if necessary.
8340 (Target_arm::get_secondary_compatible_arch,
8341 Target_arm::set_secondary_compatible_arch,
8342 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8343 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
8344 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
8345 New method definitions.
8347 2009-12-09 Ian Lance Taylor <iant@google.com>
8349 * plugin.cc (Plugin::load): Don't cast from void* to a function
8352 2009-12-09 Ian Lance Taylor <iant@google.com>
8354 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8357 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8359 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8360 Replace two_file_shared_1.so with two_file_shared_2.so.
8361 * testsuite/Makefile.in: Regenerated.
8363 2009-12-08 Doug Kwan <dougkwan@google.com>
8365 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8366 (HFILES): Add attributes.h and int_encoding.h.
8367 * Makefile.in: Regenerate.
8368 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8369 function definitions to int_encoding.cc
8370 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8371 prototypes to int_encoding.h
8372 * reduced_debug_output.cc (int_encoding.h): New include.
8373 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8374 function definitions to int_encoding.cc
8375 (insert_into_vector, read_from_pointer): Move template definitions to
8377 * attributes.cc: New file.
8378 * attributes.h: New file.
8379 * int_encoding.cc: New file.
8380 * int_encoding.h: New file.
8382 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
8385 * incremental-dump.cc (dump_incremental_inputs): New.
8386 (main): Use dump_incremental_inputs.
8388 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8391 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8392 checking elfcpp::STT_FUNC.
8393 (Target_i386::Relocate::relocate): Likewise.
8394 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8396 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8397 symbols from shared libraries into normal FUNC symbols.
8399 * symtab.h (Symbol): Add is_func and use it.
8401 2009-12-05 Doug Kwan <dougkwan@google.com>
8403 * arm.cc (Target_arm::arm_info): Initialize new fields
8404 attributes_section and attributes_vendor.
8405 * i386.cc (Target_i386::i386_info): Same.
8406 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8407 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8408 fields attributes_section and attributes_vendor.
8409 * sparc.cc (Target_sparc::sparc_info): Same.
8410 * target.h (Target::attributes_section, Target::attributes_vendor,
8411 Target::is_attributes_section, Target::attribute_arg_type,
8412 Target::attributes_order): New method definitions.
8413 (Target::Target_info::attributes_section,
8414 Target::Target_info::attributes_vendor): New fields.
8415 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8416 virtual method definitions.
8417 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8418 attributes_section and attributes_vendor.
8419 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8421 2009-12-05 Doug Kwan <dougkwan@google.com>
8423 * arm.cc: Update comments about interworking and stub generation.
8424 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8425 considered as non-PIC.
8426 (Arm_relocate_functions::base_abs): Fix formatting.
8427 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8428 of function to use GOT entry address instead of offset.
8429 (Target_arm::Scan::global): Issue an error if a symbol would need a
8430 PLT does not get one because it is untyped. Remove code to create
8431 dynamic symbols for relative branches.
8432 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8433 takes unsigned integer instead of boolean.
8435 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8437 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8438 (two_file_test_LDADD): Likewise.
8439 (common_test_1_LDADD): Likewise.
8440 (exception_test_LDADD) Likewise.
8441 (weak_test_LDADD): Likewise.
8442 (many_sections_test_LDADD): Likewise.
8443 (initpri1_LDADD): Likewise.
8444 (script_test_1_LDADD): Likewise.
8445 (script_test_2_LDADD): Likewise.
8446 (justsyms_LDADD): Likewise.
8447 (binary_test_LDADD): Likewise.
8448 (large_LDADD): Likewise.
8449 * testsuite/Makefile.in: Regenerated.
8451 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
8453 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8454 (Symbol_table::override_with_special): Likewise.
8455 (Symbol_table::add_from_object): Likewise.
8457 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8459 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8460 Don't set the data_offset twice.
8462 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8464 * testsuite/Makefile.in: Regenerate.
8466 2009-12-03 Doug Kwan <dougkwan@google.com>
8468 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8469 (Target_arm::do_finalize_sections): Add parameter for symbol table
8470 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8471 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8472 parameter for symbol table pointer.
8473 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8474 an additional parameter for a pointer to symbol table.
8475 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8476 parameter for a symbol table pointer.
8477 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8478 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8480 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8481 parameter for a symbol table pointer.
8483 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
8485 * incremental.cc (Incremental_inputs_header)
8486 (Incremental_inputs_header_write, Incremental_inputs_entry)
8487 (Incremental_inputs_entry_write): Move ...
8488 * incremental.h (Incremental_inputs_header)
8489 (Incremental_inputs_header_write, Incremental_inputs_entry)
8490 (Incremental_inputs_entry_write): here.
8492 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8494 * incremental.cc (make_sized_incremental_binary): Set the target.
8495 Error if it is incompatible.
8496 * output.h (Output_file): Add filename method.
8498 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8500 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8501 from the get_* methods.
8503 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8505 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8506 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8507 Write 0 for the data_offset of scripts.
8509 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8511 * testsuite/Makefile.am: Add the incremental_test.sh test.
8512 * testsuite/incremental_test.sh: New.
8513 * testsuite/incremental_test_1.c: New.
8514 * testsuite/incremental_test_2.c: New.
8516 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8518 * incremental-dump.cc (main): Fix typos.
8520 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8523 * incremental-dump.cc (main): Use llu to print 64 bit values.
8525 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8526 H.J. Lu <hongjiu.lu@intel.com>
8528 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8530 (incremental_dump_LDADD): Likewise.
8531 * Makefile.in: Regenerated.
8533 2009-11-25 Doug Kwan <dougkwan@google.com>
8537 2009-11-25 Doug Kwan <dougkwan@google.com>
8539 * arm.cc (Target_arm::Target_arm): Move method definition
8540 outside of class definition. Add code to handle
8541 --target1-rel, --target1-abs and --target2= options.
8542 (Target_arm::get_reloc_reloc_type): Change method to be
8543 non-static and const.
8544 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8545 New data member declaration.
8546 (Target_arm::Scan::local, Target_arm::Scan::global,
8547 Target_arm::Relocate::relocate,
8548 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8549 Adjust call to Target_arm::get_real_reloc_type.
8550 (Target_arm::get_real_reloc_type): Use command line options
8551 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8552 * options.h (--target1-rel, --target1-abs, --target2): New
8555 2009-11-25 Doug Kwan <dougkwan@google.com>
8557 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8558 class definition. Add code to handle --target1-rel, --target1-abs
8559 and --target2= options.
8560 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8562 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8564 (Target_arm::Scan::local, Target_arm::Scan::global,
8565 Target_arm::Relocate::relocate,
8566 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8567 call to Target_arm::get_real_reloc_type.
8568 (Target_arm::get_real_reloc_type): Use command line options to
8569 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8570 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8573 2009-11-25 Doug Kwan <dougkwan@google.com>
8575 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8576 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8577 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8579 (Arm_relocate_functions::thm_call): Replace body with a call to
8580 Arm_relocate_functions::thumb_branch_common.
8581 (Arm_relocate_functions::thm_jump24,
8582 Arm_relocate_functions::thm_xpc22): New method definitions.
8583 (Arm_relocate_functions::thumb_branch_common): New method definition.
8584 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8586 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8587 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8589 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8591 * Makefile.am: Build incremental-dump
8592 * Makefile.in: Regenerate.
8593 * incremental-dump.cc: New.
8594 * incremental.cc (Incremental_inputs_header_data,
8595 Incremental_inputs_entry_data): Move to incremental.h
8596 * incremental.h: (Incremental_inputs_header_data,
8597 Incremental_inputs_entry_data): Move from incremental.cc
8599 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8601 * incremental.cc (Incremental_inputs_header,
8602 Incremental_inputs_header_write, Incremental_inputs_entry,
8603 Incremental_inputs_entry_write): Add a typedef with the data type.
8605 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8607 * incremental.cc (Incremental_inputs_header,
8608 Incremental_inputs_header_write, Incremental_inputs_entry,
8609 Incremental_inputs_entry_write): Update comment about which
8610 type has the filed descriptions.
8612 2009-11-15 Doug Kwan <dougkwan@google.com>
8614 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8615 (Arm_relocate_functions::arm_branch_common): Change method defintion
8616 in class definition to a method declaration and update list of formal
8618 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8619 Arm_relocation_functions::jump24): Adjust call to
8620 Arm_relocate_functions::arm_branch_common. Update list of formal
8622 (Arm_relocate_functions::xpc25): New method definition.
8623 (Arm_relocate_functions::arm_branch_common): Move method defintion
8624 out from class definition. Use stubs for mode-switching and extending
8626 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8627 specially. Change code to enable use of stubs in ARM branches.
8629 2009-11-10 Doug Kwan <dougkwan@google.com>
8631 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8632 in method declaration.
8633 (Target_arm::relocate_stub): New method declaration.
8634 (Target_arm::default_target): Change to return a pointer instead of
8636 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8637 Target_arm::default_target.
8638 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8640 (Target_arm::relocate_section): Adjust view.
8641 (Target_arm::relocate_stub): New method definition.
8643 2009-11-10 Doug Kwan <dougkwan@google.com>
8645 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8647 * incremental.cc (open_incremental_binary): Initialized local
8648 variables to avoid warnings.
8649 * object.cc (make_elf_object): Ditto.
8650 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8653 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8656 * testsuite/plugin_test.c: Include "config.h".
8658 2009-11-09 Doug Kwan <dougkwan@google.com>
8660 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8661 (arm_symbol_value): Remove.
8662 (Arm_relocate_functions::arm_branch_common,
8663 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8664 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8665 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8666 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8667 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8668 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8669 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8670 Arm_relocate_functions::thm_mobw_abs_nc,
8671 Arm_relocate_functions::thm_mov_abs,
8672 Arm_relocate_functions::movw_prel_nc,
8673 Arm_relocate_functions::thm_movt_abs,
8674 Arm_relocate_functions::movt_prel,
8675 Arm_relocate_functions::thm_movw_prel_nc,
8676 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8677 (Target_arm::Relocate::relocate): Only decompose address into two
8678 parts if relocation type uses the thumb-bit and pass the actual
8679 bit instead of a flag indicating that the thumb-bit is used. Adjust
8680 calls to methods in Arm_relocate_functions for this change.
8682 2009-11-08 Ian Lance Taylor <iant@google.com>
8685 * reloc.cc: Instantiate
8686 Sized_relobj::initialize_input_to_output_maps and
8687 Sized_relobj:free_input_to_output_maps.
8689 2009-11-06 Ian Lance Taylor <iant@google.com>
8692 * defstd.cc (in_segment): Set only_if_ref true for "end".
8694 2009-11-06 Doug Kwan <dougkwan@google.com>
8696 * arm.cc (class Reloc_stub): Correct a comment.
8697 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8698 (Target_arm::scan_section_for_stubs): New method declaration.
8699 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8700 Change methods from private to protected.
8701 (Target_arm::do_may_relax): New method definition.
8702 (Target_arm::do_relax, Target_arm::group_sections,
8703 Target_arm::scan_reloc_for_stub,
8704 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8705 (Target_arm::arm_input_section_map_): New data member declaration.
8706 (Target_arm::scan_reloc_for_stub,
8707 Target_arm::scan_reloc_section_for_stubs,
8708 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8709 Target_arm::do_relax): New method definitions.
8711 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8713 * configure.ac: Check for (struct stat)::st_mtim
8714 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8715 * config.in: Regenerate.
8716 * configure: Regenerate.
8718 2009-11-05 Ian Lance Taylor <iant@google.com>
8721 * output.cc (Output_segment::add_output_section): Add missing
8724 2009-11-04 Ian Lance Taylor <iant@google.com>
8727 * object.h (class Object): Add is_needed and set_is_needed
8728 methods. Add is_needed_ field. Make bool fields into bitfields.
8729 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8730 defined in a dynamic object and referenced by a regular object,
8731 set is_needed for the dynamic object.
8732 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8733 if the file is marked with as_needed and it is not needed.
8735 2009-11-04 Ian Lance Taylor <iant@google.com>
8738 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8739 tags if data is discarded by linker script.
8740 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8741 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8742 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8743 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8745 2009-11-04 Ian Lance Taylor <iant@google.com>
8747 * layout.cc (Layout::get_output_section): Add is_interp and
8748 is_dynamic_linker_section parameters. Change all callers.
8749 (Layout::choose_output_section): Likewise.
8750 (Layout::make_output_section): Likewise.
8751 (Layout::add_output_section_data): Add is_dynamic_linker_section
8752 parameter. Change all callers.
8753 * layout.h (class Layout): Update declarations.
8754 * output.h (class Output_section): Add is_interp, set_is_interp,
8755 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8756 Add is_interp_, is_dynamic_linker_section_ fields. Change
8757 generate_code_fills_at_write_ to a bitfield.
8758 * output.cc (Output_section::Output_sections): Initialize new
8760 (Output_segment::add_output_section): Add do_sort parameter.
8763 2009-11-03 Ian Lance Taylor <iant@google.com>
8766 * options.h (class General_options): Add --warn-common.
8767 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8768 merging two common symbols.
8769 (Symbol_table::should_override): Handle --warn-common when merging
8770 a common symbol with a defined symbol. Use report_resolve_problem
8771 for multiple definitions.
8772 (Symbol_table::report_resolve_problem): New function.
8773 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8775 2009-11-03 Doug Kwan <dougkwan@google.com>
8777 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8779 (Target_arm::stub_factory): New method definition.
8780 (Target_arm::new_arm_input_section,
8781 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8782 Target_arm::reloc_uses_thumb_bit): New method declarations.
8783 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8784 New type definitions.
8785 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8786 member declarations.
8787 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8788 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8789 New method definitions.
8791 2009-11-03 Ian Lance Taylor <iant@google.com>
8793 * options.h (class General_options): Add --warn_constructors.
8795 2009-11-03 Ian Lance Taylor <iant@google.com>
8798 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8799 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8801 2009-11-03 Ian Lance Taylor <iant@google.com>
8804 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8805 --msgid-bugs-address.
8806 (install-pdf): New target.
8807 (install-data_yes): Look up one directory to find mkinstalldirs.
8809 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8811 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8814 2009-10-30 Doug Kwan <dougkwan@google.com>
8816 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8818 2009-10-30 Doug Kwan <dougkwan@google.com>
8820 * arm.cc (Stub_addend_reader): New struct template definition
8821 and partial specializations.
8822 (Stub_addend_reader::operator()): New method definition for a
8823 partially specialized template.
8825 2009-10-30 Doug Kwan <dougkwan@google.com>
8827 * arm.cc (Arm_relobj::processor_specific_flags): New method
8829 (Arm_relobj::do_read_symbols): New method declaration.
8830 (Arm_relobj::processor_specific_flags_): New data member declaration.
8831 (Arm_dynobj): New class definition.
8832 (Target_arm::do_finalize_sections): Add input_objects parameter.
8833 (Target_arm::do_adjust_elf_header): New method declaration.
8834 (Target_arm::are_eabi_versions_compatible,
8835 (Target_arm::merge_processor_specific_flags): New method declaration.
8836 (Target_arm::do_make_elf_object): New overloaded method definitions
8838 (Arm_relobj::do_read_symbols): New method definition.
8839 (Arm_dynobj::do_read_symbols): Ditto.
8840 (Target_arm::do_finalize_sections): Add input_objects parameters.
8841 Merge processor-specific flags from all input objects.
8842 (Target_arm::are_eabi_versions_compatible,
8843 Target_arm::merge_processor_specific_flags,
8844 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8845 New method definitions.
8846 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8847 Input_objects pointer type parameter.
8848 * layout.cc (Layout::finalize): Pass input objects to target's.
8849 finalize_sections function.
8850 * output.cc (Output_file_header::do_sized_write): Set ELF file
8851 header's processor-specific flags.
8852 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8853 Input_objects pointer type parameter.
8854 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8855 * target.h (Input_objects): New forward class declaration.
8856 (Target::processor_specific_flags,
8857 Target::are_processor_specific_flags_sect): New method definitions.
8858 (Target::finalize_sections): Add input_objects parameter.
8859 (Target::Target): Initialize processor_specific_flags_ and
8860 are_processor_specific_flags_set_.
8861 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8863 (Target::set_processor_specific_flags): New method definition.
8864 (Target::processor_specific_flags_,
8865 Target::are_processor_specific_flags_set_): New data member
8867 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8868 Input_objects pointer type parameter.
8870 2009-10-30 Doug Kwan <dougkwan@google.com>
8872 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8874 2009-10-28 Ian Lance Taylor <iant@google.com>
8876 * object.h (class Relobj): Drop options parameter from
8877 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8878 do_scan_relocs, do_relocate. Change all callers.
8879 (class Sized_relobj): Drop options parameters from
8880 do_gc_process_relocs, do_scan_relocs, do_relocate,
8881 do_relocate_sections, relocate_sections, emit_relocs_scan,
8882 emit_relocs_scan_reltype. Change all callers.
8883 (struct Relocate_info): Remove options field and all references to
8885 * reloc.h (class Read_relocs): Remove options constructor
8886 parameter and options_ field. Change all callers.
8887 (class Gc_process_relocs, class Scan_relocs): Likewise.
8888 (class Relocate_task): Likewise.
8889 * target-reloc.h (scan_relocs): Remove options parameter. Change
8891 (scan_relocatable_relocs): Likewise.
8892 * target.h (class Sized_target): Remove options parameter from
8893 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8895 * gc.h (gc_process_relocs): Remove options parameter. Change all
8897 * arm.cc: Update functions to remove options parameters.
8898 * i386.cc: Likewise.
8899 * powerpc.cc: Likewise.
8900 * sparc.cc: Likewise.
8901 * x86_64.cc: Likewise.
8902 * testsuite/testfile.cc: Likewise.
8904 2009-10-28 Doug Kwan <dougkwan@google.com>
8906 * arm.cc (Arm_relobj): New class definition.
8907 (Arm_relobj::scan_sections_for_stubs,
8908 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8909 New method definitions.
8911 2009-10-28 Cary Coutant <ccoutant@google.com>
8913 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8914 (Plugin::cleanup_done_): New member.
8915 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8916 (Plugin_manager::cleanup_done_): Remove.
8917 (Plugin_manager::add_input_file): Edit error message.
8918 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8919 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8921 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8923 * fileread.cc: (File_read::View::~View): Use the new
8924 data_ownership_ filed.
8925 (File_read::~File_read): Dispose the new whole_file_view_.
8926 (File_read::open): Mmap the whole file if needed.
8927 (File_read::open): Use whole_file_view_ instead of contents_.
8928 (File_read::find_view): Use whole_file_view_ if applicable.
8929 (File_read::do_read): Use whole_file_view_ instead of contents_.
8930 (File_read::make_view): Use whole_file_view_ instead of contents_,
8931 update File_read::View::View call.
8932 (File_read::find_or_make_view): Update File_read::View::View
8934 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8936 (File_read::View::Data_ownership): New enum.
8937 (File_read::View::View): Replace bool mapped_ with Data_ownership
8939 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8940 (File_read::View::data_ownership_): New field.
8941 (File_read::contents_): Remove (replaced by whole_file_view_).
8942 (File_read::whole_file_view_): New field.
8943 * options.h (class General_options): Add --keep-files-mapped.
8945 2009-10-27 Cary Coutant <ccoutant@google.com>
8947 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8948 * testsuite/Makefile.am (plugin_test_5): New test case.
8949 * testsuite/Makefile.in: Regenerate.
8951 2009-10-25 Doug Kwan <dougkwan@google.com>
8953 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8954 from private to protected to allow access by child class.
8955 (Sized_relobj::do_relocate_sections): New method declaration.
8956 (Sized_relobj::relocate_sections): Virtualize.
8957 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8958 Sized_relobj::relocate_sections. Instantiate template explicitly
8959 for different target sizes and endianity.
8961 2009-10-24 Doug Kwan <dougkwan@google.com>
8963 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8964 (Arm_input_section::as_arm_input_section): New method.
8965 (Arm_output_section): New class definition.
8966 (Arm_output_section::create_stub_group,
8967 Arm_output_section::group_sections): New method definitions.
8969 2009-10-22 Doug Kwan <dougkwan@google.com>
8971 * arm.cc (Arm_input_section): New class definition.
8972 (Arm_input_section::init, Arm_input_section:do_write,
8973 Arm_input_section::set_final_data_size,
8974 Arm_input_section::do_reset_address_and_file_offset): New method
8977 2009-10-21 Doug Kwan <dougkwan@google.com>
8979 * arm.cc (Stub_table, Arm_input_section): New forward class
8981 (Stub_table): New class defintion.
8982 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8983 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8984 New method definition.
8986 2009-10-21 Doug Kwan <dougkwan@google.com>
8988 * arm.cc: Update copyright comments.
8989 (Target_arm): New forward class template declaration.
8990 (Arm_address): New type.
8991 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8992 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8993 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8995 (Insn_template): Same.
8996 (DEF_STUBS): New macro.
8997 (Stub_type): New enum type.
8998 (Stub_template): New class definition.
9001 (Stub_factory): Same.
9002 (Target_arm::Target_arm): Initialize may_use_blx_ and
9003 should_force_pic_veneer_.
9004 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9005 Target_arm::should_force_pic_veneer,
9006 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9007 Target_arm::using_thumb_only, Target_arm:;default_target): New
9009 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9010 New data member declarations.
9011 (Insn_template::size, Insn_template::alignment): New method defintions.
9012 (Stub_template::Stub_template): New method definition.
9013 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9014 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9015 (Stub_factory::Stub_factory): New method definition.
9016 * gold.h (string_hash): New template.
9017 * output.h (Input_section_specifier::hash_value): Use
9019 (Input_section_specifier::string_hash): Remove.
9020 * stringpool.cc (Stringpool_template::string_hash): Use
9023 2009-10-20 Doug Kwan <dougkwan@google.com>
9025 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9026 symbols of relaxed input sections.
9027 * output.h (Output_section::find_relaxed_input_section): Make
9030 2009-10-16 Doug Kwan <dougkwan@google.com>
9032 * dynobj.cc (Versions::Versions): Initialize version_script_.
9033 Only insert base version symbol definition for a shared object
9034 if version script defines any version versions.
9035 (Versions::define_base_version): New method definition.
9036 (Versions::add_def): Check that base version is not needed.
9037 (Versions::add_need): Define base version lazily.
9038 * dynobj.h (Versions::define_base_version): New method declaration.
9039 (Versions::needs_base_version_): New data member declaration.
9040 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9041 (check_DATA): Add no_version_test.stdout.
9042 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9044 * testsuite/Makefile.in: Regenerate.
9045 * testsuite/no_version_test.c: New file.
9046 * testsuite/no_version_test.sh: Ditto.
9048 2009-10-16 Doug Kwan <dougkwan@google.com>
9050 * expression.cc (class Segment_start_expression): New class definition.
9051 (Segment_start_expression::value): New method definition.
9052 (script_exp_function_segment_start): Return a new
9053 Segment_start_expression.
9054 * gold/script-c.h (script_saw_segment_start_expression): New function
9056 * script-sections.cc (Script_sections::Script_sections): Initialize
9057 SAW_SEGMENT_START_EXPRESSION_ to false.
9058 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9059 and -Tbbs options to specify section addresses if given in
9060 command line and no SEGMENT_START expression is seen in a script.
9061 * script-sections.h (Script_sections::saw_segment_start_expression,
9062 Script_sections::set_saw_segment_start_expression): New method
9064 (Script_sections::saw_segment_start_expression_): New data member
9066 * script.cc (script_saw_segment_start_expression): New function.
9067 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9068 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9069 script_test_7.sh and script_test_8.sh.
9070 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9071 script_test_8.stdout.
9072 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9073 (script_test_6, script_test_6.stdout, script_test_7,
9074 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9075 * Makefile.in: Regenerate.
9076 * testsuite/script_test_6.sh: New file.
9077 * testsuite/script_test_6.t: Same.
9078 * testsuite/script_test_7.sh: Same.
9079 * testsuite/script_test_7.t: Same.
9080 * testsuite/script_test_8.sh: Same.
9082 2009-10-16 Doug Kwan <dougkwan@google.com>
9084 * output.cc (Output_segment::set_section_list_address): Cast
9085 expressions to unsigned long long type to avoid format warnings.
9087 2009-10-15 Ian Lance Taylor <iant@google.com>
9089 * script.cc (Script_options::add_symbol_assignment): Always add a
9090 dot assignment to script_sections_.
9091 * script-sections.cc (Script_sections::add_dot_assignment):
9092 Initialize if necessary.
9094 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9095 program headers with no load segment if there is a linker script.
9097 * layout.cc (Layout::set_segment_offsets): Align the file offset
9098 to the segment aligment for -N or -n with no load segment.
9099 * output.cc (Output_segment::add_output_section): Don't crash if
9100 the first section is a TLS section.
9101 (Output_segment::set_section_list_addresses): Print an error
9102 message if the address moves backward in a linker script.
9103 * script-sections.cc
9104 (Output_section_element_input::set_section_addresses): Don't
9105 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9106 (Orphan_output_section::set_section_addresses): Likewise.
9108 2009-10-15 Doug Kwan <dougkwan@google.com>
9110 * layout.cc (Layout::finish_dynamic_section): Generate tags
9111 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9112 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9113 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9115 2009-10-14 Ian Lance Taylor <iant@google.com>
9117 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9119 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9120 data_shdr fields of relinfo.
9121 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9122 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9123 R_386_TLS_LDO_32, adjust based on section flags.
9124 (Target_i386::Relocate::fix_up_ldo): Remove.
9126 2009-10-13 Ian Lance Taylor <iant@google.com>
9128 Add support for -pie.
9129 * options.h (class General_options): Add -pie and
9131 (General_options::output_is_position_independent): Test -pie.
9132 (General_options::output_is_executable): Return true if not shared
9133 and not relocatable.
9134 (General_options::output_is_pie): Remove.
9135 * options.cc (General_options::finalize): Reject incompatible uses
9137 * gold.cc (queue_middle_tasks): A -pie link is not static.
9138 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9139 * symtab.cc (Symbol::final_value_is_known): Return false if
9140 output_is_position_independent.
9141 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9142 output_is_position_independent.
9143 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9144 output_is_position_independent.
9145 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9146 output_is_position_independent.
9147 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9149 (basic_pie_test.o, basic_pie_test): New targets.
9150 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9151 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9152 (two_file_pie_test): New target.
9153 * testsuite/Makefile.in: Rebuild.
9154 * README: Remove note saying that -pie is not supported.
9156 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9158 * options.h (class General_options): Add -init and -fini.
9159 * layout.cc (Layout::finish_dynamic_section): Emit
9160 given init and fini functions.
9162 2009-10-13 Sriraman Tallam <tmsriram@google.com>
9164 * gc.h (gc_process_relocs): Check if icf is enabled using new
9166 * gold.cc (queue_initial_tasks): Likewise.
9167 (queue_middle_tasks): Likewise.
9168 * object.cc (do_layout): Likewise.
9169 * symtab.cc (is_section_folded): Likewise.
9170 * main.cc (main): Likewise.
9171 * reloc.cc (Read_relocs::run): Likewise.
9172 (Sized_relobj::do_scan_relocs): Likewise.
9173 * icf.cc (is_function_ctor_or_dtor): New function.
9174 (Icf::find_identical_sections): Check if function is ctor or dtor when
9176 * options.h (General_options::icf): Change option to be an enum.
9177 (Icf_status): New enum.
9178 (icf_enabled): New method.
9179 (icf_safe_folding): New method.
9180 (set_icf_status): New method.
9181 (icf_status_): New variable.
9182 * (options.cc) (General_options::finalize): Set icf_status_.
9183 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9184 icf_test and icf_keep_unique_test to use the --icf enum flag.
9185 * testsuite/icf_safe_test.sh: New file.
9186 * testsuite/icf_safe_test.cc: New file.
9188 2009-10-12 Sriraman Tallam <tmsriram@google.com>
9190 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9191 includes to gc.h and icf.h.
9192 * arm.cc: Include gc.h.
9193 * gold.cc: Likewise.
9194 * i386.cc: Likewise.
9195 * powerpc.cc: Likewise.
9196 * sparc.cc: Likewise.
9197 * x86_64.cc: Likewise.
9198 * gc.h: Include icf.h.
9200 2009-10-11 Ian Lance Taylor <iant@google.com>
9202 * plugin.cc: Include "gold.h" before other header files.
9204 2009-10-10 Chris Demetriou <cgd@google.com>
9206 * options.h (Input_file_argument::Input_file_type): New enum.
9207 (Input_file_argument::is_lib_): Replace with...
9208 (Input_file_argument::type_): New member.
9209 (Input_file_argument::Input_file_argument): Take Input_file_type
9210 'type' rather than boolean 'is_lib' as second argument.
9211 (Input_file_argument::is_lib): Use type_.
9212 (Input_file_argument::is_searched_file): New function.
9213 (Input_file_argument::may_need_search): Handle is_searched_file.
9214 * options.cc (General_options::parse_library): Support -l:filename.
9215 (General_options::parse_just_symbols): Update for Input_file_argument
9217 (Command_line::process): Likewise.
9218 * archive.cc (Archive::get_file_and_offset): Likewise.
9219 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9220 * script.cc (read_script_file, script_add_file): Likewise.
9221 * fileread.cc (Input_file::Input_file): Likewise.
9222 (Input_file::will_search_for): Handle is_searched_file.
9223 (Input_file::open): Likewise.
9224 * readsyms.cc (Read_symbols::get_name): Likewise.
9225 * testsuite/Makefile.am (searched_file_test): New test.
9226 * testsuite/Makefile.in: Regenerate.
9227 * testsuite/searched_file_test.cc: New file.
9228 * testsuite/searched_file_test_lib.cc: New file.
9230 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9231 Ian Lance Taylor <iant@google.com>
9233 * descriptor.cc: Include <cstdio> and "binary-io.h".
9234 (Descriptors::open): Open the files in binary mode always.
9235 * script.cc (Lex::get_token): Treat \r as whitespace.
9237 2009-10-09 Ian Lance Taylor <iant@google.com>
9239 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9241 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9242 Ian Lance Taylor <iant@google.com>
9244 * configure.ac: Check for readv function also.
9245 * fileread.cc (readv): Define if not HAVE_READV.
9246 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9248 * config.in: Regenerate.
9249 * configure: Regenerate.
9251 2009-10-09 Doug Kwan <dougkwan@google.com>
9253 * layout.cc (Layout::make_output_section): Call target hook to make
9254 ordinary output section.
9255 (Layout::finalize): Adjust parameter list of call the
9256 Target::may_relax().
9257 * layout.h (class Layout::section_list): New method.
9258 * merge.h (Output_merge_base::entsize): Change visibility to public.
9259 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9261 (Output_merge_string::do_is_string): New method.
9262 * object.cc (Sized_relobj::do_setup): renamed from
9263 Sized_relobj::set_up.
9264 * object.h (Sized_relobj::adjust_shndx,
9265 Sized_relobj::initializ_input_to_output_maps,
9266 Sized_relobj::free_input_to_output_maps): Change visibilities to
9268 (Sized_relobj::setup): Virtualize.
9269 (Sized_relobj::do_setup): New method declaration.
9270 (Sized_relobj::invalidate_section_offset,
9271 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9272 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9273 * options.cc (parse_int): New function.
9274 * options.h (parse_int): New declaration.
9275 (DEFINE_int): New macro.
9276 (stub_group_size): New option.
9277 * output.cc (Output_section::Output_section): Initialize memebers
9278 merge_section_map_, merge_section_by_properties_map_,
9279 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9280 (Output_section::add_input_section): Handled deferred code-fill
9281 generation and remove an old comment.
9282 (Output_section::add_relaxed_input_section): New method definition.
9283 (Output_section::add_merge_input_section): Use merge section by
9284 properties map to speed to search. Update merge section maps
9286 (Output_section::build_relaxation_map): New method definition.
9287 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9289 (Output_section::relax_input_section): Renamed to
9290 Output_section::convert_input_sections_to_relaxed_sections and change
9291 interface to take a vector of pointers to relaxed sections.
9292 (Output_section::find_merge_section,
9293 Output_section::find_relaxed_input_section): New method definitions.
9294 (Output_section::is_input_address_mapped,
9295 Output_section::output_offset, Output_section::output_address):
9296 Use output section data maps to speed up searching.
9297 (Output_section::find_starting_output_address): Add comments.
9298 (Output_section::do_write,
9299 Output_section::write_to_postprocessing_buffer): Do code-fill
9300 generation as appropriate.
9301 (Output_section::get_input_sections): Invalidate relaxed input section
9303 (Output_section::restore_states): Adjust type of checkpoint .
9304 Invalidate relaxed input section map.
9305 * output.h (Output_merge_base): New class declaration.
9306 (Input_section_specifier): New class defintion.
9307 (class Output_relaxed_input_section) Change base class to
9308 Output_section_data_build.
9309 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9310 base class initializer.
9311 (Output_section::add_relaxed_input_section): New method declaration.
9312 (Output_section::Input_section): Change visibility to protected.
9313 (Output_section::Input_section::relobj,
9314 Output_section::Input_section::shndx): Handle relaxed input sections.
9315 Output_section::input_sections) Change visibility to protected. Also
9316 define overload to return a non-const pointer.
9317 (Output_section::Merge_section_properties): New class defintion.
9318 (Output_section::Merge_section_by_properties_map,
9319 Output_section::Output_section_data_by_input_section_map,
9320 Output_section::Relaxation_map): New types.
9321 (Output_section::relax_input_section): Rename method to
9322 Output_section::convert_input_sections_to_relaxed_sections and change
9323 interface to take a vector of relaxed section pointers.
9324 (Output_section::find_merge_section,
9325 Output_section::find_relaxed_input_section,
9326 Output_section::build_relaxation_map,
9327 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9328 New method declarations.
9329 (Output_section::merge_section_map_
9330 Output_section::merge_section_by_properties_map_,
9331 Output_section::relaxed_input_section_map_,
9332 Output_section::is_relaxed_input_section_map_valid_,
9333 Output_section::generate_code_fills_at_write_): New data members.
9334 * script-sections.cc
9335 (Output_section_element_input::set_section_addresses): Call
9336 current_data_size and addralign methods of relaxed input sections.
9337 (Orphan_output_section::set_section_addresses): Call current_data_size
9338 and addralign methods of relaxed input sections.
9339 * symtab.cc (Symbol_table::compute_final_value): Extract template
9340 from the body of Symbol_table::sized_finalize_symbol.
9341 (Symbol_table::sized_finalized_symbol): Call
9342 Symbol_table::compute_final_value.
9343 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9344 (Symbol_table::compute_final_value): New templated method declaration.
9345 * target.cc (Target::do_make_output_section): New method defintion.
9346 * target.h (Target::make_output_section): New method declaration.
9347 (Target::relax): Add more parameters for input objects, symbol table
9348 and layout. Adjust call to do_relax.
9349 (Target::do_make_output_section): New method declaration.
9350 (Target::do_relax): Add parameters for input objects, symbol table
9353 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9355 * pread.c: Include stdio.h.
9357 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9359 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9362 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9364 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9365 Change read_shndx type to unsigned int.
9366 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9368 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9369 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9370 Change read_shndx type to unsigned int.
9371 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9373 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9374 * layout.cc (Layout::create_symtab_sections): Cast the result of
9375 local_symcount * symsize to off_t in the gold_assert.
9377 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9379 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9380 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9382 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9383 (Arm_relocate_functions::thm_abs5): New function.
9384 (Arm_relocate_functions::abs12): New function.
9385 (Arm_relocate_functions::abs16): New function.
9386 (Arm_relocate_functions::base_abs): New function.
9387 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9388 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9389 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9391 (Scan::global): Likewise.
9392 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9393 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9394 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9395 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9398 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9400 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9401 (Arm_relocate_functions::movt_prel): New function.
9402 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9403 (Arm_relocate_functions::thm_movt_prel): New function.
9404 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9405 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9406 (Scan::global, Relocate::relocate): Likewise.
9407 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9409 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9411 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9412 Incremental_checker.
9413 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9415 (class Incremental_inputs_header): New class.
9416 (Incremental_inputs_header_writer): Edit comment.
9417 (Incremental_inputs_entry): New class.
9418 (Incremental_inputs_entry_writer): Edit comment.
9419 (Sized_incremental_binary::do_find_incremental_inputs_section):
9420 Add *strtab_shndx parameter, fill it.
9421 (Sized_incremental_binary::do_check_inputs): New method.
9422 (Incremental_checker::can_incrementally_link_output_file): Use
9423 Sized_incremental_binary::check_inputs.
9424 (Incremental_inputs::report_command_line): Save command line in
9427 (Incremental_binary::find_incremental_inputs_section): New
9429 (Incremental_binary::do_find_incremental_inputs_section): Add
9430 strtab_shndx parameter.
9431 (Incremental_binary::do_check_inputs): New pure virtual method.
9432 (Sized_incremental_binary::do_check_inputs): Declare.
9433 (Incremental_checker::Incremental_checker): Add incremental_inputs
9434 parameter, use it to initialize incremental_inputs_.
9435 (Incremental_checker::incremental_inputs_): New field.
9436 (Incremental_checker::command_line): New method.
9437 (Incremental_checker::inputs): New method.
9438 (Incremental_checker::command_line_): New field.
9440 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9442 * incremental.cc: Include <cstdarg> and "target-select.h".
9443 (vexplain_no_incremental): New function.
9444 (explain_no_incremental): New function.
9445 (Incremental_binary::error): New method.
9446 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9448 (make_sized_incremental_binary): New function.
9449 (open_incremental_binary): New function.
9450 (can_incrementally_link_file): Add checks if output is ELF and has
9452 * incremental.h: Include "elfcpp_file.h" and "output.h".
9453 (Incremental_binary): New class.
9454 (Sized_incremental_binary): New class.
9455 (open_incremental_binary): Declare.
9456 * object.cc (is_elf_object): Use
9457 elfcpp::Elf_recognizer::is_elf_file.
9458 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9459 * output.h (Output_file::filesize): New method.
9461 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9463 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9465 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9466 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9468 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9470 (Arm_relocate_functions::movw_abs_nc): New function.
9471 (Arm_relocate_functions::movt_abs): New function.
9472 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9473 (Arm_relocate_functions::thm_movt_abs): New function.
9474 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9475 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9476 (Scan::global): Likewise.
9477 (Relocate::relocate): Likewise.
9478 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9480 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9482 * arm.cc (Arm_relocate_functions::got_prel) New function.
9483 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9484 (Relocate::relocate): Likewise.
9485 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9487 2009-10-06 Ian Lance Taylor <iant@google.com>
9489 * options.h (class General_options): Define
9490 split_stack_adjust_size parameter.
9491 * object.h (class Object): Add uses_split_stack_ and
9492 has_no_split_stack_ fields. Add uses_split_stack and
9493 has_no_split_stack accessor functions. Declare
9494 handle_split_stack_section.
9495 (class Reloc_symbol_changes): Define.
9496 (class Sized_relobj): Define Function_offsets. Declare
9497 split_stack_adjust, split_stack_adjust_reltype, and
9499 * object.cc (Object::handle_split_stack_section): New function.
9500 (Sized_relobj::do_layout): Call handle_split_stack_section.
9501 * dynobj.cc (Sized_dynobj::do_layout): Call
9502 handle_split_stack_section.
9503 * reloc.cc (Sized_relobj::relocate_sections): Call
9504 split_stack_adjust for executable sections in split_stack
9505 objects. Pass reloc_map to relocate_section.
9506 (Sized_relobj::split_stack_adjust): New function.
9507 (Sized_relobj::split_stack_adjust_reltype): New function.
9508 (Sized_relobj::find_functions): New function.
9509 * target-reloc.h: Include "object.h".
9510 (relocate_section): Add reloc_symbol_changes parameter. Change
9512 * target.h (class Target): Add calls_non_split method. Declare
9513 do_calls_non_split virtual method. Declare match_view and
9515 * target.cc: Include "elfcpp.h".
9516 (Target::do_calls_non_split): New function.
9517 (Target::match_view): New function.
9518 (Target::set_view_to_nop): New function.
9519 * gold.cc (queue_middle_tasks): Give an error if mixing
9520 split-stack and non-split-stack objects with -r.
9521 * i386.cc (Target_i386::relocate_section): Add
9522 reloc_symbol_changes parameter.
9523 (Target_i386::do_calls_non_split): New function.
9524 * x86_64.cc (Target_x86_64::relocate_section): Add
9525 reloc_symbol_changes parameter.
9526 (Target_x86_64::do_calls_non_split): New function.
9527 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9529 * powerpc.cc (Target_powerpc::relocate_section): Add
9530 reloc_symbol_changes parameter.
9531 * sparc.cc (Target_sparc::relocate_section): Add
9532 reloc_symbol_changes parameter.
9533 * configure.ac: Call AM_CONDITIONAL for the default target.
9534 * configure: Rebuild.
9535 * testsuite/Makefile.am (TEST_AS): New variable.
9536 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9537 (check_DATA): Add split_i386 and split_x86_64 files.
9538 (SPLIT_DEFSYMS): Define.
9539 (split_i386_[1234n].o): New targets.
9540 (split_i386_[124]): New targets.
9541 (split_i386_[1234r].stdout): New targets.
9542 (split_x86_64_[1234n].o): New targets.
9543 (split_x86_64_[124]): New targets.
9544 (split_x86_64_[1234r].stdout): New targets.
9545 (MOSTLYCLEANFILES): Add new executables.
9546 * testsuite/split_i386.sh: New file.
9547 * testsuite/split_x86_64.sh: New file.
9548 * testsuite/split_i386_1.s: New file.
9549 * testsuite/split_i386_2.s: New file.
9550 * testsuite/split_i386_3.s: New file.
9551 * testsuite/split_i386_4.s: New file.
9552 * testsuite/split_i386_n.s: New file.
9553 * testsuite/split_x86_64_1.s: New file.
9554 * testsuite/split_x86_64_2.s: New file.
9555 * testsuite/split_x86_64_3.s: New file.
9556 * testsuite/split_x86_64_4.s: New file.
9557 * testsuite/split_x86_64_n.s: New file.
9558 * testsuite/testfile.cc (Target_test): Update relocation_section
9560 * testsuite/Makefile.in: Rebuild.
9562 2009-10-06 Ian Lance Taylor <iant@google.com>
9564 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9565 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9566 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9567 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9568 the address on ldo_addrs_.
9569 (Target_i386::Relocate::fix_up_ldo): New function.
9571 2009-10-06 Rafael Espindola <espindola@google.com>
9573 * plugin.cc (add_input_library): New.
9574 (Plugin::load): Add add_input_library to tv.
9575 (Plugin_manager::add_input_file): Add the is_lib argument.
9576 (add_input_file): Update call to Plugin_manager::add_input_file.
9577 (add_input_library): New.
9578 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9580 2009-09-30 Doug Kwan <dougkwan@google.com>
9582 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9583 symbol and call Symbol::may_need_copy_reloc to determine if
9584 a copy reloc is needed.
9585 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9586 nocopyreloc is given in command line.
9587 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9588 given in command line.
9589 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9590 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9591 of the removed Target_i386::may_need_copy_reloc.
9592 * options.h (copyreloc): New option with default value false.
9593 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9594 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9595 instead of the removed Target_powerpc::may_need_copy_reloc.
9596 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9597 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9598 instead of the removed Target_sparc::may_need_copy_reloc.
9599 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9600 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9601 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9602 instead of the removed Target_x86_64::may_need_copy_reloc.
9604 2009-09-30 Ian Lance Taylor <iant@google.com>
9606 * object.h (class Object): Remove target_ field, and target,
9607 sized_target, and set_target methods.
9608 (Object::sized_target): Remove.
9609 (class Sized_relobj): Update declarations. Remove sized_target.
9610 * object.cc (Sized_relobj::setup): Remove target parameter.
9612 (Input_objects::add_object): Don't do anything with the target.
9613 (make_elf_sized_object): Add punconfigured parameter. Change all
9614 callers. Set or test parameter target.
9615 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9617 * parameters.cc (Parameters::set_target): Change parameter type to
9619 (Parameters::default_target): Remove.
9620 (set_parameters_target): Change parameter type to be non-const.
9621 (parameters_force_valid_target): New function.
9622 (parameters_clear_target): New function.
9623 * parameters.h (class Parameters): Update declarations. Remove
9624 default_target method. Add sized_target and clear_target
9625 methods. Change target_ to be non-const.
9626 (set_parameters_target): Update declaration.
9627 (parameters_force_valid_target): Declare.
9628 (parameters_clear_target): Declare.
9629 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9630 as NULL if we aren't searching.
9631 (Add_symbols::run): Don't check for compatible target.
9632 * fileread.cc (Input_file::open_binary): Call
9633 parameters_force_valid_target.
9634 * gold.cc (queue_middle_tasks): Likewise.
9635 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9636 set_target on object.
9637 * dynobj.h (class Sized_dynobj): Update declarations.
9638 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9639 make_elf_object returns NULL.
9640 (Archive::include_member): Don't check whether object target is
9642 * output.cc (Output_section::add_input_section): Get target from
9644 (Output_section::relax_input_section): Likewise.
9645 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9647 (Sized_relobj::do_scan_relocs): Likewise.
9648 (Sized_relobj::relocate_sections): Likewise.
9649 * resolve.cc (Symbol_table::resolve): Likewise.
9650 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9651 parameter. Change all callers.
9652 (Symbol_table::add_from_object): Get target from parameters.
9653 (Symbol_table::add_from_relobj): Don't check object target.
9654 (Symbol_table::add_from_dynobj): Likewise.
9655 (Symbol_table::define_special_symbol): Get target from
9657 * symtab.h (class Symbol_table): Update declaration.
9658 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9659 parameter. Change all callers. Clear parameter target.
9660 (Binary_test): Test target here.
9661 * testsuite/object_unittest.cc (gold_testsuite): Remove
9662 target_test_pointer parameter. Change all callers.
9663 (Object_test): Test target here.
9665 2009-09-26 Ian Lance Taylor <iant@google.com>
9667 * testsuite/initpri1.c: Don't try to use constructor priorities if
9668 compiling with gcc before 4.3.
9670 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9672 * testsuite/retain_symbols_file_test.sh (check_present): Change
9673 output file name to retain_symbols_file_test.stdout.
9674 (check_absent): Likewise.
9676 2009-09-18 Craig Silverstein <csilvers@google.com>
9678 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9679 * options.cc: Include <cerrno> and <fstream>.
9680 (General_options::finalize): Parse -retain-symbols-file tag.
9681 * options.h: New flag.
9682 (General_options): New method should_retain_symbol, new
9683 variable symbols_to_retain.
9684 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9685 should_retain_symbol map.
9686 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9687 * testsuite/Makefile.in: Regenerate.
9688 * testsuite/retain_symbols_file_test.sh: New file.
9690 2009-09-18 Nick Clifton <nickc@redhat.com>
9692 * po/es.po: Updated Spanish translation.
9694 2009-09-17 Doug Kwan <dougkwan@google.com>
9696 * debug.h (DEBUG_RELAXATION): New constant.
9697 (DEBUG_ALL): Add DEBUG_RELAXATION.
9698 (debug_string_to_enum): Add relaxation debug option.
9700 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9701 Layout::Relaxation_debug_check::read_sections,
9702 Layout::Relaxation_debug_check::read_sections): New method definitions.
9703 (Layout::Layout): Initialize data members
9704 record_output_section_data_from_scrips_,
9705 script_output_section_data_list_ and relaxation_debug_check_.
9706 (Layout::save_segments, Layout::restore_segments,
9707 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9708 Layout::relaxation_loop_body): New method definitions.
9709 (Layout::finalize): Support relaxation. Move section layout code to
9710 Layout::relaxation_loop_body.
9711 (Layout::set_asection_address_from_script): Move code for orphan
9712 section placement out.
9713 (Layout::place_orphan_sections_in_script): New method definition.
9714 * layout.h (Output_segment_headers, Output_file_header):
9715 New forward class declarations.
9716 (Layout::~Layout): Define.
9717 (Layout::new_output_section_data_from_script): New method definition.
9718 (Layout::place_orphan_sections_in_script): New method declaration.
9719 (Layout::Segment_states): New type declaration.
9720 (Layout::save_segments, Layout::restore_segments,
9721 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9722 Layout::relaxation_loop_body): New method declarations.
9723 (Layout::Output_section_data_list): New type declaration.
9724 (Layout::Relaxation_debug_check): New class definition.
9725 (Layout::record_output_section_data_from_script_,
9726 Layout::script_output_section_data_list_, Layout::segment_states_,
9727 Layout::relaxation_debug_check_): New data members.
9728 * output.cc: (Output_section_headers::do_size): New method definition.
9729 (Output_section_headers::Output_section_headers): Move size
9730 computation to Output_section_headers::do_size.
9731 (Output_segment_headers::do_size): New method definition.
9732 (Output_file_header::Output_file_header): Move size computation to
9733 Output_file_header::do_size and call it.
9734 (Output_file_header::do_size): New method definition.
9735 (Output_data_group::Output_data_group): Adjust call to
9736 Output_section_data.
9737 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9738 (Output_symtab_xindex::do_write): Add array bound check.
9739 (Output_section::Input_section::print_to_mapfile): Handle
9740 RELAXED_INPUT_SECTION_CODE.
9741 (Output_section::Output_section): Initialize data member checkpoint_.
9742 (Output_section::~Output_section): Delete checkpoint object pointed
9744 (Output_section::add_input_section): Always add an Input_section if
9746 (Output_section::add_merge_input_section): Add assert.
9747 (Output_section::relax_input_section): New method definition.
9748 (Output_section::set_final_data_size): Set load address to zero for
9749 an unallocated section.
9750 (Output_section::do_address_and_file_offset_have_reset_values):
9751 New method definition.
9752 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9753 Handle relaxed input section.
9754 (Output_section::sort_attached_input_sections): Checkpoint input
9755 section list lazily.
9756 (Output_section::get_input_sections): Change type of input_sections to
9757 list of Simple_input_section pointers. Checkpoint input section list
9758 lazily. Also handle relaxed input sections.
9759 (Output_section::add_input_section_for_script): Take a reference to
9760 a Simple_input_section object instead of Relobj pointer and section
9761 index as parameter. Handle relaxed input sections.
9762 (Output_section::save_states, Output_section::restore_states): New
9764 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9765 (Output_data::is_data_size_fixed): New method definition.
9766 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9768 (Output_data::address_and_file_offset_have_reset_values): New method
9770 (Output_data::do_address_and_file_offset_have_reset_values): New method
9772 (Output_data::set_data_size): Check that data size is not fixed.
9773 (Output_data::fix_data_size): New method definition.
9774 (Output_data::is_data_size_fixed_): New data member.
9775 (Output_section_headers::set_final_data_size): New method definition.
9776 (Output_section_headers::do_size): New method declaration.
9777 (Output_segment_headers::set_final_data_size): New method definition.
9778 (Output_segment_headers::do_size): New method declaration.
9779 (Output_file_header::set_final_data_size)::New method definition.
9780 (Output_file_header::do_size)::New method declaration.
9781 (Output_section_data::Output_section_data): Add new parameter
9782 is_data_size_fixed and use it to fix data size.
9783 (Output_data_const::Output_data_const): Adjust call to base class
9784 constructor and fix data size.
9785 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9786 base class constructor and fix data size.
9787 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9788 base class constructor and fix data size.
9789 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9790 class constructor and fix data size.
9791 (Output_data_group::set_final_data_size): New method definition.
9792 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9793 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9794 class constructor and fix data size.
9795 (Output_relaxed_input_section): New class definition.
9796 (Output_section::Simple_input_section): New class definition.
9797 (Output_section::get_input_sections): Adjust parameter list.
9798 (Output_section::add_input_section_for_script): Same.
9799 (Output_section::save_states, Output_section::restore_states,
9800 Output_section::do_address_and_file_offset_have_reset_values,
9801 (Output_section::Input_section::Input_section): Handle
9802 RELAXED_INPUT_SECTION_CODE. Add new overload for
9803 Output_relaxed_input_section.
9804 (Output_section::Input_section::is_input_section,
9805 Output_section::Input_section::set_output_section): Handle relaxed
9807 (Output_section::Input_section::is_relaxed_input_section,
9808 Output_section::Input_section::output_section_data,
9809 Output_section::Input_section::relaxed_input_section): New method
9811 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9813 (Output_section::Input_section::u1_): Update comments.
9814 (Output_section::Input_section::u2_): Add new union member poris.
9815 (Output_section::Checkpoint_output_section): New classs definition.
9816 (Output_section::relax_input_section): New method declaration.
9817 (Output_section::checkpoint_): New data member.
9818 (Output_segment): Update comments.
9819 (Output_segment::Output_segment): Un-privatize copy constructor.
9820 (Output_segment::operator=): Un-privatize.
9821 * script-sections.cc (Output_section_element::Input_section_list):
9822 Change element type to Output_section::Simple_input_section.
9823 (Output_section_element_dot_assignment::set_section_addresses):
9824 Register output section data for relaxation clean up.
9825 (Output_data_exression::Output_data_expression): Adjust call to base
9826 constructor to fix data size.
9827 (Output_section_element_data::set_section_addresses): Register
9828 Output_data_expression object for relaxation clean up.
9829 (struct Input_section_info): Replace Relobj pointer and section index
9830 pair with Output_section::Simple_input_section and Convert struct to a
9832 (Input_section_sorter::operator()): Adjust access to
9833 Input_section_info data member to use accessors.
9834 (Output_section_element_input::set_section_addresses): Use layout
9835 parameter. Adjust code to use Output_section::Simple_input_section
9836 and Input_secction_info classes. Register filler for relaxation
9838 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9839 and section index pair with Output_section::Simple_input_section
9840 class. Adjust code accordingly.
9841 (Phdrs_element::release_segment): New method definition.
9842 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9844 (Script_sections::release_segments): New method definition.
9845 * gold/script-sections.h (Script_sections::release_segments): New
9847 * gold/target.h (Target::may_relax, Target::relax,
9848 Target::do_may_relax, Target::do_relax): New method definitions.
9850 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9852 * arm.cc (has_signed_unsigned_overflow): New function.
9853 (Arm_relocate_functions::abs8): New function.
9854 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9855 (Target_arm::Scan::global): Likewise.
9856 (Target_arm::relocate::relocate): Likewise.
9857 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9860 2009-09-16 Cary Coutant <ccoutant@google.com>
9862 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9863 * testsuite/Makefile.in: Regenerate.
9865 2009-09-11 Nick Clifton <nickc@redhat.com>
9867 * po/gold.pot: Updated by the Translation project.
9869 2009-09-08 Cary Coutant <ccoutant@google.com>
9871 * output.cc (Output_file::open): Add execute permission to empty file.
9872 * testsuite/Makefile.am (permission_test): New test.
9873 * testsuite/Makefile.in: Regenerate.
9875 2009-09-02 Ian Lance Taylor <iant@google.com>
9877 * output.cc (Output_file::resize): Call map_no_anonymous rather
9880 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9882 * gold.cc: Include "incremental.h".
9883 (queue_initial_tasks): Call Incremental_checker methods.
9884 * incremental.cc: Include "output.h".
9885 (Incremental_checker::can_incrementally_link_output_file): New
9887 * incremental.h (Incremental_checker): New class.
9889 * output.cc (Output_file::open_for_modification): New method.
9890 (Output_file::map_anonymous): Changed return type to bool. Record
9892 (Output_file::map_no_anonymous): New method, broken out of map.
9893 (Output_file::map): Use map_no_anonymous and map_anonymous.
9894 * output.h (class Output_file): Update declarations.
9896 2009-08-24 Cary Coutant <ccoutant@google.com>
9898 * options.h (Command_line::Pre_options): New class.
9899 (Command_line::pre_options): New member.
9900 * options.cc (gold::options::ready_to_register): New variable.
9901 (One_option::register_option): Do nothing if not registering options.
9902 Assert if same short option registered twice.
9903 (General_options::General_options): Turn off option registration when
9905 (Command_line::Pre_options::Pre_options): New constructor.
9907 2009-08-24 Cary Coutant <ccoutant@google.com>
9909 * options.h (General_options::no_keep_memory): Remove incorrect
9912 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9914 * Makefile.am (am__skiplex, am__skipyacc): New.
9915 * Makefile.in: Regenerate.
9917 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9919 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9920 (INCLUDES): ... this.
9921 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9922 (AM_CPPFLAGS): Renamed from ...
9923 (INCLUDE): ... this.
9924 * Makefile.in, testsuite/Makefile.in: Regenerate.
9926 * Makefile.in: Regenerate.
9927 * aclocal.m4: Likewise.
9928 * config.in: Likewise.
9929 * configure: Likewise.
9930 * testsuite/Makefile.in: Likewise.
9932 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9933 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9934 * Makefile.in: Regenerate.
9935 * testsuite/Makefile.in: Regenerate.
9937 2009-08-19 Cary Coutant <ccoutant@google.com>
9939 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9940 symbols in shared libraries overridden by hidden or internal symbols
9941 in the main program.
9943 2009-08-19 Chris Demetriou <cgd@google.com>
9945 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9946 checking source file names in error messages.
9948 2009-08-18 Doug Kwan <dougkwan@google.com>
9950 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9951 an elcpp::Ehdr as parameter. Adjust call to set_target.
9952 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9953 an elfcpp::Ehdr as parameter.
9954 * object.cc (Object::set_target): Remove the version that looks up
9955 a target and sets it.
9956 (Sized_relobj::setup): Take a Target object instead of
9957 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9958 (make_elf_sized_object): Find target and ask target to
9960 * object.h: (Object::set_target): Remove the version that looks up
9961 a target and sets it.
9962 (Sized_relobj::setup): Take a Target object instead of
9963 an elfcpp:Ehdr as parameter.
9964 * target.cc: Include dynobj.h.
9965 (Target::do_make_elf_object_implementation): New.
9966 (Target::do_make_elf_object): New.
9967 * target.h (Target::make_elf_object): New template declaration.
9968 (Target::do_make_elf_object): New method declarations.
9969 (Target::do_make_elf_object_implementation): New template declaration.
9971 2009-08-14 Ian Lance Taylor <iant@google.com>
9973 * gold.h (FUNCTION_NAME): Define.
9974 (gold_unreachable): Use FUNCTION_NAME.
9976 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9978 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9979 symbol in the --keep-unique list is not found.
9981 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9983 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9984 been maked as --keep-unique.
9985 (Icf::unfold_section): New function.
9986 * icf.h (Icf::unfold_section): New function.
9987 * options.h (General_options::keep_unique): New option.
9988 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9989 * testsuite/Makefile.in: Regenerate.
9990 * testsuite/icf_keep_unique_test.sh: New file.
9991 * testsuite/icf_keep_unique_test.cc: New file.
9993 2009-08-12 Cary Coutant <ccoutant@google.com>
9996 * resolve.cc (Symbol_table::resolve): Check for references from
9997 dynamic objects to hidden and internal symbols.
9998 * testsuite/Makefile.am (hidden_test.sh): New test.
9999 * testsuite/Makefile.in: Regenerate.
10000 * testsuite/hidden_test.sh: New script.
10001 * testsuite/hidden_test_1.c: New test source.
10002 * testsuite/hidden_test_main.c: New test source.
10004 2009-08-11 Doug Kwan <dougkwan@google.com>
10006 * arm.cc: Update comments.
10007 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10008 segment to locate the .ARM.exidx section if present.
10010 2009-08-09 Doug Kwan <dougkwan@google.com>
10012 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10015 2009-08-07 Sriraman Tallam <tmsriram@google.com>
10016 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10019 2009-08-06 Sriraman Tallam <tmsriram@google.com>
10021 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10022 valid tls_segment only for non-debug-section relocations.
10023 * testsuite/Makefile.am: Add gc_tls_test.
10024 * testsuite/Makefile.in: Regenerate.
10025 * testsuite/gc_tls_test.cc: New file.
10026 * testsuite/gc_tls_test.sh: New file.
10028 2009-08-05 Sriraman Tallam <tmsriram@google.com>
10030 * icf.cc: New file.
10032 * Makefile.am (CCFILES): Add icf.cc.
10033 (HFILES): Add icf.h
10034 * Makefile.in: Regenerate.
10035 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10036 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10037 section, symbol and addend information for the relocs.
10038 * gold.cc (queue_middle_tasks): Call identical code folding.
10039 * gold.h: Add defines for multimap.
10040 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10041 to the call of finalize_local_symbols.
10042 * main.cc (main): Create object of class Icf.
10043 * object.cc (Sized_relobj::do_layout): Allow this function to be
10044 called twice during icf.
10045 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10046 to sections marked as identical by icf.
10047 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10049 (Sized_relobj::do_section_entsize): New function.
10050 * object.h (Object::section_entsize): New function.
10051 (Object::do_section_entsize): New pure virtual function.
10052 (Relobj::finalize_local_symbols): Add new parameter.
10053 (Relobj::do_section_entsize): New function.
10054 * options.h (General_options::icf): New option.
10055 (General_options::icf_iterations): New option.
10056 (General_options::print_icf_sections): New option.
10057 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10058 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10059 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10061 * symtab.cc (Symbol_table::is_section_folded): New function.
10062 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10063 to sections marked as identical by icf.
10064 * symtab.h (Symbol_table::set_icf): New function.
10065 (Symbol_table::icf): New function.
10066 (Symbol_table::is_section_folded): New function.
10067 (Symbol_table::icf_): New data member.
10068 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10069 * testsuite/Makefile.am: Add commands to build icf_test.
10070 * testsuite/Makefile.in: Regenerate.
10071 * testsuite/icf_test.sh: New file.
10072 * testsuite/icf_test.cc: New file.
10074 2009-07-24 Chris Demetriou <cgd@google.com>
10076 * layout.cc (is_compressible_debug_section): Fix incorrect
10077 comment about compressed section names.
10079 2009-07-20 Ian Lance Taylor <ian@airs.com>
10082 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10084 2009-07-16 Ian Lance Taylor <iant@google.com>
10087 * layout.h: #include <map>.
10088 (class Kept_section): Change from struct to class. Add accessors
10089 and setters. Add section size to Comdat_group mapping. Change
10090 Comdat_group to std::map. Add is_comdat_ field. Add
10091 linkonce_size field in union.
10092 (class Layout): Update declaration of find_or_add_kept_section.
10093 Don't declare find_kept_object.
10094 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10095 parameter. Add object, shndx, is_comdat, and is_group_name
10096 parameters. Change all callers. Adjust for new Kept_section.
10097 (Layout::find_kept_object): Remove.
10098 * object.cc (Sized_relobj::include_section_group): Update use of
10099 Kept_section. Rename secnum to shndx. Only record
10100 Kept_comdat_section if sections are the same size.
10101 (Sized_relobj::include_linkonce_section): Update use of
10102 Kept_section. Only record Kept_comdat_section if sections are the
10103 same size. Set size of linkonce section.
10104 (Sized_relobj::map_to_kept_section): Update call to
10105 get_kept_comdat_section.
10106 * object.h (class Sized_relobj): Rename fields in
10107 Kept_comdat_section to drop trailing underscores; change object
10108 field to Relobj*. Change Kept_comdat_section_table to store
10109 struct rather than pointer.
10110 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10111 Add kept_object and kept_shndx parameters. Change all callers.
10112 (Sized_relobj::get_kept_comdat_section): Change return type to
10113 bool. Add kept_object and kept_shndx parameters. Change all
10115 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10116 Layout::find_or_add_kept_section.
10118 2009-07-09 Ian Lance Taylor <iant@google.com>
10120 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10121 Reserve space in the hash table.
10123 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10125 * fileread.cc (File_read::get_mtime): New method.
10126 * fileread.h (Timespec): New structure.
10127 (File_read::get_mtime): New method.
10128 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10129 Renamed from timestamp_nsec.
10130 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10132 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
10134 (Incremental_inputs::report_archive): Save mtime; style fix.
10135 (Incremental_inputs::report_obejct): Save mtime; style fix.
10136 (Incremental_inputs::report_script): Save mtime; style fix.
10137 (Incremental_inputs::finalize_inputs): Style fix.
10138 (Incremental_inputs::finalize): Style fix.
10139 (Incremental_inputs::create_input_section_data): Store inputs
10141 * incremental.h (Incremental_inputs::report_script): Add mtime
10143 (Incremental_inputs::Input_info::Input_info): Intialize only one
10145 (Incremental_inputs::Input_info::archive): Move to nameless
10147 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10148 (Incremental_inputs::Input_info::script): Move to nameless union.
10149 (Incremental_inputs::mtime): New field.
10150 * script.cc (read_input_script): Pass file mtime to
10152 * script.h (Script_info::inputs): Style fix.
10154 2009-07-01 Ian Lance Taylor <ian@airs.com>
10156 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10159 2009-06-24 Ian Lance Taylor <iant@google.com>
10162 * layout.cc (Layout::choose_output_section): If we find an
10163 existing section, update the flags.
10164 (Layout::create_notes): New function, broken out of
10166 (Layout::finalize): Don't create note sections.
10167 (Layout::create_note): Don't crash if linker script discards
10169 (Layout::create_gold_note): Likewise.
10170 (Layout::create_build_id): Likewise. Don't set
10171 after_input_sections on the section.
10172 (Layout::create_executable_stack_info): Remove target parameter.
10174 * layout.h (class Layout): Declare create_notes. Update
10175 declaration of create_executable_stack_info.
10176 * gold.cc (queue_middle_tasks): Call create_notes.
10177 * output.cc (Output_section::update_flags_for_input_section): Move
10178 here from output.h. If SHF_ALLOC flag is newly set, mark address
10180 * output.h (Output_data::mark_address_invalid): New function.
10181 (class Output_section): Only declare, not define,
10182 update_flags_for_input_section. Remove set_flags.
10184 2009-06-24 Ian Lance Taylor <iant@google.com>
10186 * script-sections.cc (Output_section_definition::
10187 set_section_addresses): Rename shadowing local load_address to
10190 2009-06-24 Ian Lance Taylor <iant@google.com>
10193 * reloc.cc (relocate_sections): Skip empty relocation sections.
10195 2009-06-23 Ian Lance Taylor <iant@google.com>
10198 * layout.cc (Layout::create_note): Use choose_output_section
10199 rather than make_output_section.
10201 2009-06-23 Ian Lance Taylor <iant@google.com>
10204 * options.cc (General_options::parse_V): Set printed_version_.
10205 (General_options::General_options): Initialize printed_version_.
10206 * options.h (class General_options): Add printed_version_ field.
10207 * gold.cc (queue_initial_tasks): If there are no input files,
10208 don't give a fatal error if we printed the version information.
10209 (queue_middle_tasks): If using -r with a shared object, give a
10210 fatal error rather than an ordinary error.
10212 2009-06-23 Ian Lance Taylor <iant@google.com>
10215 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10216 (Layout::make_output_section): Set have_stabstr_section_ if we see
10217 a .stab*str section.
10218 (Layout::finalize): Call link_stabs_sections.
10219 (Layout::link_stabs_sections): New file.
10220 * layout.h (class Layout): Add have_stabstr_section_ field.
10221 Declare link_stabs_sections.
10223 2009-06-23 Doug Kwan <dougkwan@google.com>
10225 * Makefile.am (libgold_a_LIBADD): New.
10226 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
10227 * Makefile.in: Regenerate.
10228 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10229 * configure: Regenerate.
10230 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10231 * fileread.cc: Include sys/state.h
10232 * gold.h: Declare memmem and strndup if found missing.
10233 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10235 2009-06-23 Ian Lance Taylor <iant@google.com>
10237 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10238 * configure: Rebuild.
10240 2009-06-23 Ian Lance Taylor <iant@google.com>
10243 * object.cc (Object::section_contents): Don't try to get a view if
10244 the section has length zero.
10245 (Object::handle_gnu_warning_section): If the section is empty, use
10246 the name of the section as the warning.
10248 2009-06-23 Ian Lance Taylor <iant@google.com>
10251 * stringpool.h (class Stringpool_template): Add optimize_ field.
10252 (Stringpool_template::set_optimize): New function.
10253 * stringpool.cc (Stringpool_template::Stringpool_template):
10254 Initialize optimize_ field.
10255 (Stringpool_template::set_string_offsets): Test local optimize
10256 fild rather than parameter.
10257 * layout.cc (Layout::Layout): Call set_optimize on the section
10260 2009-06-22 Ian Lance Taylor <iant@google.com>
10263 * yyscript.y: Parse TARGET.
10264 * script.cc (script_set_target): New function.
10265 * script-c.h (script_set_target): Declare.
10266 * options.cc (General_options::string_to_object_format): Rename
10267 from string_to_object_format in anonymous namespace. Change
10269 * options.h (class General_options): Declare
10270 string_to_object_format.
10272 2009-06-22 Ian Lance Taylor <iant@google.com>
10274 * script-sections.cc (Script_sections::create_segments): Don't put
10275 program headers in a PT_LOAD segment if -n or -N.
10277 2009-06-22 Ian Lance Taylor <iant@google.com>
10280 * options.h (class General_options): Add -z lazy and -z now. Sort
10281 -z options into alphabetical order.
10282 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10284 2009-06-21 Ian Lance Taylor <iant@google.com>
10286 * layout.cc (Layout::make_output_section): Call
10287 Target::new_output_section.
10288 (Layout::attach_allocated_section_to_segment): Put large section
10289 sections in a separate load segment with the large segment flag
10291 (Layout::segment_precedes): Sort large data segments after other
10293 (align_file_offset): New static function.
10294 (Layout::set_segment_offsets): Use align_file_offset.
10295 * output.h (class Output_section): Add is_small_section_ and
10296 is_large_section_ fields.
10297 (Output_section::is_small_section): New function.
10298 (Output_section::set_is_small_section): New function.
10299 (Output_section::is_large_section): New function.
10300 (Output_section::set_is_large_section): New function.
10301 (Output_section::is_large_data_section): New function.
10302 (class Output_segment): Add is_large_data_segment_ field.
10303 (Output_segment::is_large_data_segment): New function.
10304 (Output_segment::set_is_large_data_segment): New function.
10305 * output.cc (Output_section::Output_section): Initialize new
10307 (Output_segment::Output_segment): Likewise.
10308 (Output_segment::add_output_section): Add assertion that large
10309 data sections always go in large data segments. Force small data
10310 sections to the end of the list of data sections. Force small BSS
10311 sections to the start of the list of BSS sections. For large BSS
10312 sections to the end of the list of BSS sections.
10313 * symtab.h (class Symbol): Declare is_common_shndx.
10314 (Symbol::is_defined): Check Symbol::is_common_shndx.
10315 (Symbol::is_common): Likewise.
10316 (class Symbol_table): Define enum Commons_section_type. Update
10317 declarations. Add small_commons_ and large_commons_ fields.
10318 * symtab.cc (Symbol::is_common_shndx): New function.
10319 (Symbol_table::Symbol_table): Initialize new fields.
10320 (Symbol_table::add_from_object): Put small and large common
10321 symbols in the right list.
10322 (Symbol_table::sized_finalized_symbol): Check
10323 Symbol::is_common_shndx.
10324 (Symbol_table::sized_write_globals): Likewise.
10325 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10326 common symbol lists. Don't call do_allocate_commons_list if the
10328 (Symbol_table::do_allocate_commons_list): Remove is_tls
10329 parameter. Add comons_section_type parameter. Change all
10330 callers. Handle small and large common symbols.
10331 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10332 Symbol::is_common_shndx.
10333 * resolve.cc (symbol_to_bits): Likewise.
10334 * target.h (Target::small_common_shndx): New function.
10335 (Target::small_common_section_flags): New function.
10336 (Target::large_common_shndx): New function.
10337 (Target::large_common_section_flags): New function.
10338 (Target::new_output_section): New function.
10339 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10340 small_common_section_flags, and large_common_section_flags
10342 (Target::do_new_output_section): New virtual function.
10343 * arm.cc (Target_arm::arm_info): Initialize new fields.
10344 * i386.cc (Target_i386::i386_info): Likewise.
10345 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10347 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10348 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10349 (Target_x86_64::do_new_output_section): New function.
10350 * configure.ac: Define conditional MCMODEL_MEDIUM.
10351 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10352 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10353 (large_LDFLAGS): Define.
10354 * testsuite/large.c: New file.
10355 * testsuite/testfile.cc (Target_test::test_target_info):
10356 Initialize new fields.
10357 * configure, testsuite/Makefile.in: Rebuild.
10359 2009-06-05 Doug Kwan <dougkwan@google.com>
10361 * Makefile.am (CCFILES): Add target.cc.
10362 * Makefile.in: Regenerate.
10363 * i386.cc (class Target_i386): Define new virtual method to
10364 override do_is_local_label_name in parent.
10365 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10366 local symbols if --discard-locals or -X is given.
10367 * options.h (class General_options): Declare new options
10368 '--discard-locals' and '-X' for discarding locals.
10369 * target.h (class Target): Define new methods is_local_label_name.
10370 Declare new virtual method do_is_local_label_name.
10371 * target.cc: New file.
10372 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10373 (check_SCRIPTS): Add discard_locals_test.sh.
10374 (check_DATA): Add discard_local_tests.syms.
10375 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10376 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10377 * testsuite/Makefile.in: Regenerate.
10378 * testsuite/discard_locals_test.c: New file.
10379 * testsuite/discard_locals_test.sh: Same.
10381 2009-06-05 Doug Kwan <dougkwan@google.com>
10383 * object.cc (Sized_relobj::Sized_relobj): Initialize
10384 discarded_eh_frame_shndx_ to -1U.
10385 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10387 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10388 a discarded .eh_frame section.
10389 (Sized_relobj::do_finalize_local_symbols): Ditto.
10390 * object.h (class Sized_relobj): Declare new member
10391 discarded_eh_frame_shndx_.
10392 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10393 (local_labels_test.o, local_labels_test): New rules.
10394 * testsuite/Makefile.in: Regenerate.
10396 2009-06-04 Doug Kwan <dougkwan@google.com>
10398 * layout.cc (Layout::section_name_mapping): Add mapping for
10399 special ARM sections.
10401 2009-06-03 Doug Kwan <dougkwan@google.com>
10403 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10404 (utils::has_overflow): Same.
10406 2009-06-03 Ian Lance Taylor <iant@google.com>
10408 * layout.cc (Layout::section_name_mapping): New array, replacing
10409 Layout::linkonce_mapping.
10410 (Layout::section_name_mapping_count): New variable, replacing
10411 Layout::linkonce_mapping_count.
10412 (Layout::linkonce_output_name): Remove.
10413 (Layout::output_section_name): Rewrite.
10414 * layout.h (class Layout): Rename Linkonce_mapping to
10415 Section_name_mapping, linkonce_mapping to section_name_mapping,
10416 linkonce_mapping_count to section_name_mapping_count. Don't
10417 declare linkonce_output_name.
10419 2009-06-03 Doug Kwan <dougkwan@google.com>
10421 * gold/arm.cc (namespace utils): New.
10422 (Target_arm::reloc_is_non_pic): Define new method.
10423 (class Arm_relocate_functions): New.
10424 (Target_arm::Relocate::relocate): Handle relocation types used by
10427 2009-06-03 Ian Lance Taylor <iant@google.com>
10429 * arm.cc (Target_arm::scan::global): Use || instead of |.
10431 2009-06-02 Doug Kwan <dougkwan@google.com>
10433 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10434 issued_non_pic_error_.
10435 (class Target_arm::Scan): Declare new method check_non_pic.
10436 Define new method symbol_needs_plt_entry.
10437 Declare new data member issued_non_pic_error_.
10438 (class Target_arm::Relocate): Declare new method
10439 should_apply_static_reloc.
10440 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10441 (Target_arm::Scan::check_non_pic): Define new method.
10442 (Target_arm::Scan::local): Handle a small subset of reloc types used
10444 (Target_arm::Scan::local): Same.
10445 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10447 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10449 * incremental.cc (Incremental_inputs::report_command_line): Filter
10450 out --incremental-* options.
10452 2009-05-29 Doug Kwan <dougkwan@google.com>
10454 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10456 (class Target_arm): Update comment.
10457 (Target_arm::Target_arm): Initialize new data members GOT_,
10458 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10459 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10460 and Target_arm::rel_dyn_section.
10461 Declare new_enum Target_arm::Got_type.
10462 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10464 Update commments for member do_dynsym_value.
10465 (Target_arm::got_size, Target_arm::plt_section,
10466 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10467 new methods inside class defintion.
10468 (Target_arm::got_section): Define new method.
10469 (Target_arm::rel_dyn_section): Same.
10470 (Output_data_plt_arm): New template class.
10471 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10472 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10473 (Output_data_plt_arm::add_entry): Same.
10474 (Output_data_plt_arm::first_plt_entry): Define new
10475 static data member for PLT instruction template.
10476 (Output_data_plt_arm::plt_entry): Same.
10477 (Output_data_plt_arm::do_write): Define new method.
10478 (Target_arm::make_plt_entry): Same.
10479 (Target_arm::do_finalize_sections): Same.
10480 (Target_arm::do_dynsym_value): Same.
10482 2009-05-28 Doug Kwan <dougkwan@google.com>
10484 * Makefile.am (TARGETSOURCES): Add arm.cc.
10485 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10486 * Makefile.in: Regenerate.
10487 * arm.cc: New file.
10488 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10490 2009-05-26 Doug Kwan <dougkwan@google.com>
10492 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10493 (General_options::check_excluded_libs): Strip off directories in
10494 archive name before matching like GNU ld does.
10495 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10496 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10497 (exclude_libs_test_LDFLAGS): Add linker option
10498 -Wl,--exclude-libs,libexclude_libs_test_3
10499 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10500 an explicit archive without using -l.
10501 (alt/libexclude_libs_test_3.a): New make rule.
10502 * testsuite/Makefile.in: Regenerate.
10503 * testsuite/exclude_libs_test.c : Declare lib3_default().
10505 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10506 * exclude_libs_test_3.c: New file.
10508 2009-05-26 Nick Clifton <nickc@redhat.com>
10510 * po/id.po: New Indonesian translation.
10511 * po/gold.pot: Updated template file.
10513 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10515 * testsuite/Makefile.am: Add -ffunction-sections to compile
10516 gc_comdat_test files. Add -Wl,--gc-sections to build
10518 * testsuite/Makefile.in: Regenerate.
10519 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10521 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10523 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10524 kept comdat section was garbage collected.
10525 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10526 * testsuite/Makefile.in: Regenerate.
10527 * testsuite/gc_comdat_test.sh: New file.
10528 * testsuite/gc_comdat_test_1.cc: New file.
10529 * testsuite/gc_comdat_test_2.cc: New file.
10531 2009-05-19 Doug Kwan <dougkwan@google.com>
10533 * archive.cc (Archive::Archive): Move constructor from archive.h
10534 to here. Initialize no_export_.
10535 (Archive::get_elf_object_for_member): Set no_export flag of object.
10536 * archive.h (Archive::Archive): Move constructor body to
10538 (Archive::no_export): New method.
10539 (Archive::no_export_): New field.
10540 * object.h (Object::Object): Initialize no_export_ to false.
10541 (Object::no_export, Object::set_no_export): New methods.
10542 (Object::no_export_): New field.
10543 * options.cc (General_options::parse_exclude_libs): New method.
10544 (General_options::check_excluded_libs) Same.
10545 * options.h (exclude_libs): New option.
10546 (General_options::check_excluded_libs): New method declaration.
10547 (General_options::excluded_libs_): New field.
10548 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10549 default or protected visibility if an object has no-export flag set.
10550 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10551 (check_SCRIPTS): Add exclude_libs_test.sh.
10552 (check_DATA): Add exclude_libs_test.syms.
10553 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10554 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10555 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10556 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10557 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10558 libexclude_libs_test_2.a): New rules.
10559 * testsuite/Makefile.in: Regenerate.
10560 * testsuite/exclude_libs_test.c: New file.
10561 * testsuite/exclude_libs_test.sh: Ditto.
10562 * testsuite/exclude_libs_test_1.c: Ditto.
10563 * testsuite/exclude_libs_test_2.c: Ditto.
10565 2009-05-15 Ian Lance Taylor <iant@google.com>
10567 * configure.ac: Check for declarations for cases where libiberty.h
10568 checks HAVE_DECL_xxx.
10569 * configure, config.in: Rebuild.
10571 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10573 * gold.h (Incremental_argument_list): Remove (invalid) forward
10575 * incremental.cc (Incremental_inputs::report_achive): New method.
10576 (Incremental_inputs::report_object): New method.
10577 (Incremental_inputs::report_script): New method.
10578 (Incremental_inputs::finalize_inputs): New method.
10579 (Incremental_inputs::finalize): Call finalize_inputs().
10580 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10581 Create inputs entries.
10582 * incremental.h (Incremental_input_type): New enum.
10583 (Incremental_inputs::Incremental_input): Initialize new fields.
10584 (Incremental_inputs::report_inputs): New method.
10585 (Incremental_inputs::report_achive): New method.
10586 (Incremental_inputs::report_object): New method.
10587 (Incremental_inputs::report_script): New method.
10588 (Incremental_inputs::finalize_inputs): New method.
10589 (Incremental_inputs::Input_info): New struct.
10590 (Incremental_inputs::Input_info_map): New typedef.
10591 (Incremental_inputs::lock_): New field.
10592 (Incremental_inputs::Inputs_): New field.
10593 (Incremental_inputs::Inputs_map): New field.
10594 * main.cc (main): Call Incremental_input::report_inputs.
10595 * options.h (Input_argument_list): Typedef moved from
10597 (Input_file_group::Files): Remove, use ::Input_argument_list.
10598 (Input_file_group::Input_argument_list): Remove, use
10599 ::Input_argument_list.
10600 * plugin.cc (Plugin_manager::add_input_file): Add error in
10602 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10604 * script.cc (read_input_script): Call
10605 Incremental_input::report_script.
10606 * script.h (Script_info): New class.
10608 2009-04-27 Ian Lance Taylor <iant@google.com>
10610 * x86_64.cc (do_adjust_output_section): Set entsize to
10613 2009-04-23 Elliott Hughes <enh@google.com>
10615 * output.cc (Output_file::close): After short writes, continue
10616 writing from the correct offset in the buffer being written.
10618 2009-04-23 Chris Demetriou <cgd@google.com>
10620 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10621 * configure: Regenerate.
10622 * config.in: Regenerate.
10623 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10624 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10626 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10628 * incremental.cc (Incremental_inputs_header_data): Renamed from
10629 Incremental_input_header_data.
10630 (Incremental_inputs_header_data::data_size): New field.
10631 (Incremental_inputs_header_data::put_input_file_count): Renamed
10632 from input_file_count.
10633 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10634 from command_line_offset.
10635 (Incremental_inputs_header_data::put_reserved): Renamed from
10637 (Incremental_inputs_entry_data): Renamed from
10638 Incremental_input_entry_data.
10639 (Incremental_inputs_entry_data::data_size): New field.
10640 (Incremental_inputs::report_command_line): New method.
10641 (Incremental_inputs::finalize): New method.
10642 (Incremental_inputs::create_incremental_inputs_data): New method.
10643 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10644 * incremental.h: New file.
10645 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10646 (Layout::finalize): Create incremental inputs section in
10647 incremental builds.
10648 (Layout::create_incremental_info_sections): New method.
10649 * layout.h (Layout::incremental_inputs): New method.
10650 (Layout::create_incremental_info_sections): New method.
10651 (Layout::incremental_inputs_): New field.
10652 * main.cc (main): Notify Incremental_input of the command line.
10654 2009-04-01 Ian Lance Taylor <iant@google.com>
10655 Mikolaj Zalewski <mikolajz@google.com>
10657 * gold.h (reserve_unordered_map): Define, three versions, one for
10658 each version of Unordered_map.
10659 * layout.cc (Layout::Layout): Remove options parameter. Add
10660 number_of_input_files parameter. Don't initialize options_.
10661 Initialize number_of_input_files_ and resized_signatures_. Move
10662 sections_are_attached_.
10663 (Layout::layout_group): Reserve space for group_signatures_.
10664 (Layout::find_or_add_kept_section): Change name parameter to be a
10665 reference. Resize signatures_ map when it gets large enough.
10666 (Layout::layout_eh_frame): Use parameters->options() instead of
10668 (Layout::make_output_section): Likewise.
10669 (Layout::attach_allocated_section_to_segment): Likewise.
10670 (Layout::finalize, Layout::create_executable_stack): Likewise.
10671 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10672 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10673 * layout.h (class Layout): Update declarations. Remove options_
10674 field. Add number_of_input_files_ and resized_signatures_
10675 fields. Move sections_are_attached_ field.
10676 * main.cc (main): Pass number of input files to Layout
10677 constructor. Don't pass options.
10679 2009-03-30 Ian Lance Taylor <iant@google.com>
10681 * ffsll.c (ffsll): Correct implementation.
10683 2009-03-27 Ian Lance Taylor <iant@google.com>
10685 * ffsll.c: New file.
10686 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10687 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10688 * ftruncate.c (ftruncate): Declare before definition.
10689 * mremap.c (mremap): Likewise.
10690 * pread.c (pread): Likewise.
10691 * configure, Makefile.in, config.in: Rebuild.
10693 * mremap.c: New file.
10694 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10695 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10696 (mremap): Declare if HAVE_MREMAP is not defined.
10697 * configure, Makefile.in, config.in: Rebuild.
10699 2009-03-27 Cary Coutant <ccoutant@google.com>
10701 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10702 position independent.
10703 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10704 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10706 2009-03-24 Cary Coutant <ccoutant@google.com>
10708 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10710 (needs_dynamic_reloc): Likewise.
10712 2009-03-24 Ian Lance Taylor <iant@google.com>
10714 * yyscript.y (file_cmd): Recognize EXTERN.
10715 (extern_name_list, extern_name_list_body): New nonterminals.
10716 * script.cc (script_add_extern): Define.
10717 * script-c.h (script_add_extern): Declare.
10719 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10721 * object.cc (is_elf_object): Define.
10722 * object.h (is_elf_object): Declare.
10723 * archive.cc (Archive::get_elf_object_for_member): Call
10725 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10727 2009-03-24 Elliott Hughes <enh@google.com>
10729 * output.cc (Output_file::map_anonymous): Define.
10730 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10731 try an anonymous one. Report the size if the mmap fails.
10732 * output.h (class Output_file): Declare map_anonymous.
10734 2009-03-24 Ian Lance Taylor <iant@google.com>
10736 * target-select.cc (instantiate_target): Don't acquire the lock if
10737 the instantiated_target_ field has already been set.
10739 2009-03-23 Ian Lance Taylor <iant@google.com>
10741 * gold-threads.h (class Initialize_lock): Define.
10742 * gold-threads.cc (class Initialize_lock_once): Define.
10743 (initialize_lock_control): New static variable.
10744 (initialize_lock_pointer): New static variable.
10745 (initialize_lock_once): New static function.
10746 (Initialize_lock::Initialize_lock): Define.
10747 (Initialize_lock::initialize): Define.
10748 * target-select.h: Include "gold-threads.h".
10749 (class Target_selector): Add lock_ and initialize_lock_ fields.
10750 Don't define instantiate_target, just declare it.
10751 * target-select.cc (Target_selector::Target_selector): Initialize
10753 (Target_selector::instantiate_target): Define.
10754 * descriptors.h: Include "gold-threads.h".
10755 (class Descriptors): Add initialize_lock_ field.
10756 * descriptors.cc (Descriptors::Descriptors): Initialize new
10758 (Descriptors::open): Use initialize_lock_ field
10759 * errors.h (class Errors): Add initialize_lock_ field.
10760 * errors.cc (Errors::Errors): Initialize new field.
10761 (Errors::initialize_lock): Use initialize_lock_ field.
10762 * powerpc.cc (class Target_selector_powerpc): Remove
10763 instantiated_target_ field. In do_recognize call
10764 instantiate_target rather than do_instantiate_target. In
10765 do_instantiate_target just allocate a new target.
10766 * sparc.cc (class Target_selector_sparc): Likewise.
10768 * freebsd.h: New file.
10769 * i386.cc: Include "freebsd.h".
10770 (Target_i386): Derive from Target_freebsd rather than
10772 (Target_selector_i386): Derive from Target_selector_freebsd rather
10773 than Target_selector.
10774 * x86_64.cc: Include "freebsd.h".
10775 (Target_x86_64): Derive from Target_freebsd rather than
10777 (Target_selector_x86_64): Derive from Target_selector_freebsd
10778 rather than Target_selector.
10779 * target.h (class Target): Add adjust_elf_header and
10780 do_adjust_elf_header.
10781 * output.cc (Output_file_header:: do_sized_write): Call target
10782 adjust_elf_header routine.
10783 * configure.tgt: Set targ_osabi.
10784 * configure.ac: Define GOLD_DEFAULT_OSABI.
10785 * parameters.cc (Parameters::default_target): Pass
10786 GOLD_DEFAULT_OSABI to select_target.
10787 * target-select.h (class Target_selector): Make instantiate_target
10788 protected rather than private.
10789 * Makefile.am (HFILES): Add freebsd.h.
10790 * configure, Makefile.in, config.in: Rebuild.
10792 * merge.cc (do_add_input_section): Correct pend value. Change
10793 message about last entry not being null terminated from error to
10796 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10798 * incremental.cc: New file.
10799 * Makefile.am (CCFILES): Add incremental.cc.
10800 * Makefile.in: Rebuild.
10802 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10804 * layout.cc (Layout::output_section_name): Preserve names
10805 of '.note.' sections.
10807 2009-03-19 Ian Lance Taylor <iant@google.com>
10809 * descriptors.cc (Descriptors::open): Check that the options are
10810 valid before using them.
10812 2009-03-18 Ian Lance Taylor <iant@google.com>
10814 * script-sections.h: Include <list>.
10815 (class Script_sections): Change Sections_elements from std::vector
10816 to std::list. Typedef public Elements_iterator. Add
10817 orphan_section_placement_, data_segment_align_start_, and
10818 saw_data_segment_align_ fields. Remove data_segment_align_index_
10820 * script-sections.cc (class Orphan_section_placement): New class.
10821 (class Sections_element): Add virtual functions is_relro and
10822 orphan_section_init. Remove virtual function place_orphan_here.
10823 (class Output_section_definition): Add is_relro and
10824 orphan_section_init. Remove place_orphan_here.
10825 (class Orphan_output_section): Likewise.
10826 (Script_sections::Script_sections): Update for field changes.
10827 (Script_sections::data_segment_align): Set saw_data_segment_align_
10828 and data_segment_align_start_, not data_segment_align_index.
10829 (Script_sections::data_segment_relro_end): Check
10830 saw_data_segment_align_. Use data_segment_align_start_ rather
10831 than data_segment_align_index_.
10832 (Script_sections::place_orphan): Rewrite to use
10833 Orphan_section_placement.
10835 2009-03-17 Ian Lance Taylor <iant@google.com>
10837 * archive.cc (Archive::add_symbols): Check for a version attached
10838 to the symbol name in the archive map.
10839 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10840 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10841 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10842 (ver_test_11.a): New target.
10843 * testsuite/Makefile.in: Rebuild.
10845 * configure.ac: Check for chsize and posix_fallocate. Replace
10847 * ftruncate.c: New file, from gnulib.
10848 * output.cc (posix_fallocate): Define dummy version if not
10849 HAVE_POSIX_FALLOCATE.
10850 (Output_file::map): Call posix_fallocate rather than lseek and
10852 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10853 * configure, Makefile.in, config.in: Rebuild.
10855 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10857 * layout.h (Layout::create_note): Add section_name parameter.
10858 * layout.cc (Layout::create_note): Likewise.
10859 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10861 2009-03-17 Ian Lance Taylor <iant@google.com>
10863 * descriptors.cc: Include "options.h".
10864 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10865 (Descriptors::open): Always use O_CLOEXEC when opening a new
10866 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10867 then set FD_CLOEXEC.
10869 * sparc.cc (class Target_sparc): Add has_got_section.
10870 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10871 make sure we have a GOT section.
10873 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10874 (Target_sparc::Scan::local): Likewise.
10875 (Target_sparc::Scan::global): Likewise.
10876 (Target_sparc::Relocate::relocate): Likewise.
10877 (Target_sparc::Relocate::relocate_tls): Likewise.
10879 * symtab.cc (Symbol_table::define_default_version): New function,
10880 broken out of add_from_object.
10881 (Symbol_table::add_from_object): Call define_default_version.
10882 (Symbol_table::define_special_symbol): Add resolve_oldsym
10883 parameter. Change all callers. If the version for a symbol comes
10884 from a version script, resolve it with the symbol with the same
10885 name with no version. Also add the symbol without a version if
10887 (do_define_in_output_data): If resolving with oldsym, don't delete
10889 (do_define_in_output_segment): Likewise.
10890 (do_define_as_constant): Likewise.
10891 * symtab.h (class Symbol_table): Update declarations.
10893 2009-03-13 Ian Lance Taylor <iant@google.com>
10895 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10896 (Read_symbols::requeue): New function.
10897 (Read_symbols::do_read_symbols): If make_elf_object fails because
10898 the target type is not configured, and the file was searched for,
10899 issue a warning and retry with the next directory.
10900 (Add_symbols::run): If the file has an incompatible format, and
10901 it was searched for, requeue the Read_symbols task. On error,
10902 release the object.
10903 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10904 dirindex parameter to constructor. Change all callers. Declare
10905 incompatible_warning and requeue.
10906 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10907 input_argument_ and input_group_ fields. Add them to
10908 constructor. Change all callers.
10909 (class Read_script): Add dirindex_ field. Add it to constructor.
10910 Change all callers.
10911 * archive.cc (Archive::setup): Remove input_objects parameter.
10912 Change all callers.
10913 (Archive::get_file_and_offset): Likewise.
10914 (Archive::read_all_symbols): Likewise.
10915 (Archive::read_symbols): Likewise.
10916 (Archive::get_elf_object_for_member): Remove input_objects
10917 parameter. Add punconfigured parameter. Change all callers.
10918 (Archive::add_symbols): Change return type to bool. Check return
10919 value of include_member.
10920 (Archive::include_all_members): Likewise.
10921 (Archive::include_member): Change return type to bool. Return
10922 false if first included object has incompatible target. Set
10923 included_member_ field.
10924 (Add_archive_symbols::run): If add_symbols returns false, requeue
10926 * archive.h (class Archive): Add included_member_ field.
10927 Initialize it in constructor. Add input_file and searched_for
10928 methods. Update declarations.
10929 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10930 input_argument_ fields. Add them to constructor. Change all
10932 * script.cc: Include "target-select.h".
10933 (class Parser_closure): Add skip_on_incompatible_target_ and
10934 found_incompatible_target_ fields. Add
10935 skip_on_incompatible_target parameter to constructor. Change all
10936 callers. Add methods skip_on_incompatible_target,
10937 clear_skip_on_incompatible_target, found_incompatible_target, and
10938 set_found_incompatible_target.
10939 (read_input_script): Add dirindex parameter. Change all callers.
10940 If parser finds an incompatible target, requeue Read_symbols
10942 (script_set_symbol): Clear skip_on_incompatible_target in
10944 (script_add_assertion, script_parse_option): Likewise.
10945 (script_start_sections, script_add_phdr): Likewise.
10946 (script_check_output_format): New function.
10947 * script.h (read_input_script): Update declaration.
10948 * script-c.h (script_check_output_format): Declare.
10949 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10950 (ignore_cmd): Remove OUTPUT_FORMAT.
10951 * fileread.cc (Input_file::Input_file): Add explicit this.
10952 (Input_file::will_search_for): New function.
10953 (Input_file::open): Add pindex parameter. Change all callers.
10954 * fileread.h (class Input_file): Add input_file_argument method.
10955 Declare will_search_for. Update declarations.
10956 * object.cc (make_elf_object): Add punconfigured parameter.
10957 Change all callers.
10958 * object.h (class Object): Make input_file public. Add
10959 searched_for method.
10960 (make_elf_object): Update declaration.
10961 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10963 * dirsearch.h (class Dirsearch): Update declaration.
10964 * options.h (class General_options): Add --warn-search-mismatch.
10965 * parameters.cc (Parameters::is_compatible_target): New function.
10966 * parameters.h (class Parameters): Declare is_compatible_target.
10967 * workqueue.cc (Workqueue::add_blocker): New function.
10968 * workqueue.h (class Workqueue): Declare add_blocker.
10970 * fileread.cc (Input_file::open): Remove options parameter.
10971 Change all callers.
10972 (Input_file::open_binary): Likewise.
10973 * script.cc (read_input_script): Likewise.
10974 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10975 options parameter from constructor. Change all callers.
10976 (class Read_script): Likewise.
10977 * fileread.h (class Input_file): Update declarations.
10978 * script.h (read_input_script): Update declaration.
10980 2009-03-10 Nick Clifton <nickc@redhat.com>
10982 * po/es.po: New Spanish translation.
10984 2009-03-06 Cary Coutant <ccoutant@google.com>
10986 * options.cc (parse_short_option): Keep dash_z from registering itself.
10988 2009-03-03 Ian Lance Taylor <iant@google.com>
10991 * target-reloc.h (relocate_section): Pass output_section to
10993 * i386.cc (Target_i386::should_apply_static_reloc): Add
10994 output_section parameter. Change all callers.
10995 (Target_i386::Relocate::relocate): Add output_section parameter.
10996 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10997 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10998 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10999 * testsuite/two_file_shared.sh: New script.
11000 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11001 (check_DATA): Add two_file_shared.dbg.
11002 (two_file_shared.dbg): New target.
11003 * testsuite/Makefile.in: Rebuild.
11005 2009-03-01 Ian Lance Taylor <iant@google.com>
11007 * configure.ac: Check for byteswap.h.
11008 * configure: Rebuild.
11009 * config.in: Rebuild.
11011 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11013 * layout.cc (Layout::find_or_add_kept_section): New function.
11014 (Layout::add_comdat): Removed.
11015 * layout.h (struct Kept_section): Move out of class Layout.
11016 Remove trailing underscores from field names. Add group_sections
11017 field. Rename group_ field to is_group. Change all uses.
11018 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11019 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11020 comdat_groups_ field.
11021 (Sized_relobj::include_section_group): Use
11022 find_or_add_kept_section and Kept_section::group_sections.
11023 (Sized_relobj::include_linkonce_section): Likewise.
11024 * object.cc (class Sized_relobj): Don't define Comdat_group or
11025 Comdat_group_table. Remove find_comdat_group and
11026 add_comdat_group. Remove comdat_groups_ field.
11027 * plugin.cc (include_comdat_group): Use
11028 Layout::find_or_add_kept_section.
11030 2009-02-28 Ian Lance Taylor <iant@google.com>
11032 * README: --gc-sections and map files are now supported. Document
11033 some build requirements.
11036 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11037 relocatable link set the value of the section symbol to zero.
11038 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11039 relocatable link don't include the section address in the local
11042 2009-02-27 Ian Lance Taylor <iant@google.com>
11045 * options.h (class Search_directory): Add is_system_directory.
11046 (class General_options): Declare is_in_system_directory.
11047 * options.cc (get_relative_sysroot): Make static.
11048 (get_default_sysroot): Make static.
11049 (General_optoins::is_in_system_directory): New function.
11050 * fileread.cc (Input_file::is_in_system_directory): New function.
11051 * fileread.h (class Input_file): Declare is_in_system_directory.
11052 * object.h (class Object): Add is_in_system_directory.
11053 (class Input_objects): Remove system_library_directory_ field.
11054 * object.cc (Input_objects::add_object): Don't set
11055 system_library_directory_.
11056 (input_objects::found_in_system_library_directory): Remove.
11057 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11058 parameter. Change all callers.
11059 (Symbol_table::sized_write_globals): Likewise.
11060 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11061 Call Object::is_in_system_directory.
11062 * symtab.h (class Symbol_table): Update declarations.
11065 * descriptors.h (Open_descriptor): Add is_on_stack field.
11066 * descriptors.cc (Descriptors::open): If the descriptor is on the
11067 top of the stack, remove it. Initialize is_on_stack field.
11068 (Descriptors::release): Only add pod to stack if it is not on the
11070 (Descriptors::close_some_descriptor): Clear stack_next and
11071 is_on_stack fields.
11074 * output.cc (Output_section::find_starting_output_address): Rename
11075 from starting_output_address; add PADDR parameter; change return
11077 * output.h (class Output_section): Declare
11078 find_starting_output_address instead of starting_output_address.
11079 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11080 section symbol for which we can't find a merge section.
11083 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11084 hidden or internal, force the symbol to be local.
11085 * resolve.cc (Symbol::override_visibility): Define.
11086 (Symbol::override_base): Use override_visibility.
11087 (Symbol_table::resolve): Likewise.
11088 (Symbol::override_base_with_special): Likewise.
11089 (Symbol_table::override_with_special): If the visibility is hidden
11090 or internal, force the symbol to be local.
11091 * symtab.h (class Symbol): Add set_visibility and
11092 override_visibility.
11093 * testsuite/ver_test_1.sh: New file.
11094 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11095 (check_DATA): Add ver_test_1.syms.
11096 (ver_test_1.syms): New target.
11097 * testsuite/Makefile.in: Rebuild.
11099 2009-02-25 Cary Coutant <ccoutant@google.com>
11101 * layout.cc (Layout::choose_output_section): Don't rename sections
11102 when using a linker script that has a SECTIONS clause.
11103 * Makefile.in: Regenerate.
11105 * testsuite/Makefile.am (script_test_5.sh): New test case.
11106 * testsuite/Makefile.in: Regenerate.
11107 * testsuite/script_test_5.cc: New file.
11108 * testsuite/script_test_5.sh: New file.
11109 * testsuite/script_test_5.t: New file.
11111 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
11113 * archive.cc (Archive::include_member): Update calls to add_symbols.
11114 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11115 the Layout argument.
11116 * dynobj.h (do_add_symbols): Add the Layout argument.
11117 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11119 * object.h (Object::add_symbols): Add the Layout argument.
11120 (Object::do_add_symbols): Add the Layout argument.
11121 (Sized_relobj::do_add_symbols): Add the Layout argument.
11122 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11123 Unify the two versions.
11124 (Add_plugin_symbols): Remove.
11125 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11126 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11127 (Add_plugin_symbols): Remove.
11128 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11129 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11130 (Add_symbols::run): Make it work with Pulginobj.
11132 2009-02-06 Ian Lance Taylor <iant@google.com>
11134 * object.cc (Sized_relobj::do_layout): Make info message start
11135 with lower case letter.
11137 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11139 * binary.cc: Fix file comment.
11141 * options.h (enum Incremental_disposition): Define.
11142 (class General_options): Add new options: --incremental,
11143 --incremental_changed, --incremental_unchanged,
11144 --incremental_unknown. Add incremental_disposition_ and
11145 implicit_incremental_ fields.
11146 (General_options::incremental_disposition): New function.
11147 (class Position_dependent_options): Add incremental_disposition
11149 (Position_dependent_options::copy_from_options): Set incremental
11151 * options.cc (General_options::parse_incremental_changed): New
11153 (General_options::parse_incremental_unchanged): New function.
11154 (General_options::parse_incremental_unknown): New function.
11155 (General_options::General_options): Initialize new fields
11156 incremental_disposition_ and implicit_incremental_.
11157 (General_options::finalize): Check for uasge of --incremental-*
11158 without --incremental.
11160 2009-02-06 Chris Demetriou <cgd@google.com>
11162 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11163 pointer and to report location as the file name associated with
11165 (gold_undefined_symbol_at_location): New function to replace the
11166 old gold_undefined_symbol functionality.
11167 * target-reloc.h (relocate_section): Update to use
11168 gold_undefined_symbol_at_location.
11169 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11170 Call gold_undefined_symbol function rather than gold_error.
11171 * errors.h (Errors::undefined_symbol): Take location as a
11172 string, rather than calculating it from a relocation.
11173 * errors.cc (Errors::fatal): Print "fatal error:" before the
11175 (Errors::error, Errors::error_at_location): Print "error: "
11176 before the formatted message.
11177 (Errors::undefined_symbol): Take location as a string, rather
11178 than calculating it from a relocation.
11179 (gold_undefined_symbol_at_location): New function akin to
11180 old gold_undefined_symbol, calculates location from relocation.
11181 (gold_undefined_symbol): Change to take only a Symbol pointer
11182 and to report location as the file name associated with the symbol.
11183 * testsuite/debug_msg.sh: Update for changed error messages.
11184 * testsuite/undef_symbol.sh: Likewise.
11186 2009-02-04 Duncan Sands <baldrick@free.fr>
11189 * reduced_debug_output.h
11190 (Output_reduced_debug_abbrev_section::failed): Use format for
11192 (Output_reduced_debug_info_section::faild): Likewise.
11194 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11196 * script.cc (Lazy_demangler): New class.
11197 (Version_script_info::get_symbol_version_helper): Demangle a
11200 2009-01-29 Cary Coutant <ccoutant@google.com>
11202 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11204 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11206 2009-01-28 Ian Lance Taylor <iant@google.com>
11208 * version.cc (version_string): Bump to 1.9.
11210 * gold.h: Include <cstring> and <stdint.h>.
11211 * version.cc: Include <cstdio>.
11212 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11214 * reduced_debug_output.cc (insert_into_vector): Rename from
11215 Insert_into_vector; change all callers. Use Swap_unaligned to
11216 avoid aliasing issue; remove union since it is unnecessary.
11218 2009-01-27 Sriraman Tallam <tmsriram@google.com>
11220 * Makefile.am (CCFILES): Add gc.cc.
11221 (HFILES): Add gc.h.
11222 * Makefile.in: Regenerate.
11223 * gold.cc (Gc_runner): New class.
11224 (queue_initial_tasks): Call garbage collection related tasks
11225 when corresponding options are invoked.
11226 (queue_middle_gc_tasks): New function.
11227 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11228 processed early before laying out sections during garbage collection.
11229 * gold.h (queue_middle_gc_tasks): New function.
11230 (is_prefix_of): Move from "layout.cc".
11231 * i386.cc (Target_i386::gc_process_relocs): New function.
11232 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11233 * main.cc (main): Create object of class "Garbage_collection".
11234 * object.cc (Relobj::copy_symbols_data): New function.
11235 (Relobj::is_section_name_included): New function.
11236 (Sized_relobj::do_layout): Allow this function to be called twice
11237 during garbage collection and defer layout of section during the
11239 * object.h (Relobj::get_symbols_data): New function.
11240 (Relobj::is_section_name_included): New function.
11241 (Relobj::copy_symbols_data): New function.
11242 (Relobj::set_symbols_data): New function.
11243 (Relobj::get_relocs_data): New function.
11244 (Relobj::set_relocs_data): New function.
11245 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11246 (Relobj::gc_process_relocs): New function.
11247 (Relobj::do_gc_process_relocs): New pure virtual function.
11248 (Relobj::sd_): New data member.
11249 (Sized_relobj::is_output_section_offset_invalid): New function.
11250 (Sized_relobj::do_gc_process_relocs): New function.
11251 * options.h (General_options::gc_sections): Modify to not be a no-op.
11252 (General_options::print_gc_sections): New option.
11253 * plugin.cc (Plugin_finish::run): Remove function call to
11254 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11255 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11256 * reloc.cc (Read_relocs::run): Add task to process relocs and
11257 determine unreferenced sections when doing garbage collection.
11258 (Gc_process_relocs): New class.
11259 (Sized_relobj::do_gc_process_relocs): New function.
11260 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11261 sections that are garbage collected.
11262 * reloc.h (Gc_process_relocs): New class.
11263 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11264 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11265 symbols whose corresponding sections are garbage collected.
11266 (Symbol_table::Symbol_table): Add new parameter for the garbage
11268 (Symbol_table::gc_mark_undef_symbols): New function.
11269 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11270 (Symbol_table::gc_mark_dyn_syms): New function.
11271 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11273 (Symbol_table::add_from_object): Likewise.
11274 (Symbol_table::add_from_relobj): When building shared objects, do not
11275 treat externally visible symbols as garbage.
11276 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11277 table information for static and relocatable links.
11278 * symtab.h (Symbol_table::set_gc): New function.
11279 (Symbol_table::gc): New function.
11280 (Symbol_table::gc_mark_undef_symbols): New function.
11281 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11282 (Symbol_table::gc_mark_dyn_syms): New function.
11283 (Symbol_table::gc_): New data member.
11284 * target.h (Sized_target::gc_process_relocs): New pure virtual
11286 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11287 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11289 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11291 * options.h (General_options::gc_sections): Define as a no-op for now.
11292 (General_options::no_keep_memory): Ditto.
11293 (General_options::Bshareable): Define.
11294 * options.cc (General_options::finalize): Honor -Bshareable.
11296 2009-01-20 Andreas Schwab <schwab@suse.de>
11298 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11299 read the value in the contents, since we don't use it. Use the
11300 template endianness when writing.
11301 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11303 2009-01-19 Andreas Schwab <schwab@suse.de>
11305 * configure.tgt (powerpc64-*): Fix targ_obj.
11307 2009-01-15 Ian Lance Taylor <iant@google.com>
11309 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11310 local symbols when stripping all symbols.
11312 2009-01-14 Cary Coutant <ccoutant@google.com>
11314 * output.cc (Output_reloc): Add explicit instantiations.
11316 2009-01-14 Cary Coutant <ccoutant@google.com>
11318 * archive.cc (Archive::get_elf_object_for_member): Remove call
11319 to File_read::claim_for_plugin.
11320 * descriptors.cc (Descriptors::open): Remove reference to
11322 (Descriptors::claim_for_plugin): Remove.
11323 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11324 (Descriptors::is_claimed): Remove.
11325 (claim_descriptor_for_plugin): Remove.
11326 * fileread.cc (File_read::claim_for_plugin): Remove.
11327 * fileread.h (File_read::claim_for_plugin): Remove.
11328 (File_read::descriptor): Reopen descriptor if necessary.
11329 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11330 (Plugin_manager::all_symbols_read): Add task parameter. Change
11332 (Plugin_manager::get_input_file): New function.
11333 (Plugin_manager::release_input_file): New function.
11334 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11335 corresponding data member.
11336 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11337 and pass to base constructor. Change all callers.
11338 (get_input_file, release_input_file): New functions.
11339 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11340 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11341 (Plugin_manager::all_symbols_read): Add task parameter.
11342 (Plugin_manager::get_input_file): New function.
11343 (Plugin_manager::release_input_file): New function.
11344 (Plugin_manager::task_): New data member.
11345 (Pluginobj::Pluginobj): Add filesize parameter.
11346 (Pluginobj::filename): New function.
11347 (Pluginobj::descriptor): New function.
11348 (Pluginobj::filesize): New function.
11349 (Pluginobj::filesize_): New data member.
11350 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11351 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11352 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11354 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11355 with archive libraries.
11356 * testsuite/Makefile.in: Regenerate.
11357 * testsuite/plugin_test.c (struct sym_info): New type.
11358 (get_input_file, release_input_file): New static variables.
11359 (onload): Capture new transfer vector entries.
11360 (claim_file_hook): Stop reading at end of file according to filesize.
11361 Factor out parsing of readelf output into separate function.
11362 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11363 APIs and get the source file name from the symbol table. Convert
11364 source file name to corresponding object file name. Print info
11365 message when adding new input files.
11366 (parse_readelf_line): New function.
11367 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11368 * testsuite/plugin_test_2.sh: Likewise.
11369 * testsuite/plugin_test_3.sh: Likewise.
11370 * testsuite/plugin_test_4.sh: New test case.
11372 2009-01-07 Ian Lance Taylor <iant@google.com>
11374 * version.cc (version_string): Bump to 1.8.
11376 2008-12-23 Cary Coutant <ccoutant@google.com>
11378 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11379 * plugin.cc (Plugin_manager::finish): Rename as
11380 layout_deferred_objects. Move cleanup to separate function.
11381 (Plugin_manager::cleanup): New function.
11382 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11384 * plugin.h (Plugin_manager::finish): Rename as
11385 layout_deferred_objects.
11386 (Plugin_manager::cleanup): New function.
11387 (Plugin_manager::cleanup_done): New field.
11389 2008-12-23 Cary Coutant <ccoutant@google.com>
11391 * plugin.cc (is_visible_from_outside): New function.
11392 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11393 so we don't return "IR only" status for exported symbols or -r links.
11395 * testsuite/Makefile.am (plugin_test_3): New test case.
11396 * testsuite/Makefile.in: Regenerate.
11397 * testsuite/plugin_test_3.sh: New file.
11399 2008-12-22 Cary Coutant <ccoutant@google.com>
11401 * object.cc (Sized_relobj::layout_section): New function.
11402 (Sized_relobj::do_layout): Defer layout of input sections until after
11403 plugin has provided replacement files.
11404 (Sized_relobj::do_layout_deferred_sections): New function.
11405 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11406 (Relobj::layout_deferred_sections): New function.
11407 (Relobj::do_layout_deferred_sections): New function.
11408 (Sized_relobj::do_layout_deferred_sections): New function.
11409 (Sized_relobj::layout_section): New function.
11410 (Sized_relobj::Deferred_layout): New structure.
11411 (Sized_relobj::deferred_layout_): New field.
11412 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11413 Change all callers. Layout deferred sections.
11414 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11416 (Plugin_hook::run): Move code from do_plugin_hook inline.
11417 (Plugin_hook::do_plugin_hook): Remove.
11418 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11419 (Plugin_manager::finish): Renamed, was cleanup.
11420 (Plugin_manager::should_defer_layout): New function.
11421 (Plugin_manager::add_deferred_layout_object): New function.
11422 (Plugin_manager::Deferred_layout_list): New type.
11423 (Plugin_manager::deferred_layout_objects_): New field.
11424 (Plugin_hook::do_plugin_hook): Remove.
11426 2008-12-17 Ian Lance Taylor <iant@google.com>
11428 * options.h (class General_options): Add --no case for
11431 2008-12-16 Cary Coutant <ccoutant@google.com>
11433 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11435 (Plugin_manager::claim_file): Create plugin object even if
11436 plugin did not call the add_symbols callback.
11437 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11438 asking for more symbols than were added.
11439 * testsuite/Makefile.am (plugin_test_1): Add test case with
11441 (empty.syms): New target.
11442 * testsuite/Makefile.in: Regenerate.
11443 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11444 message. Don't call add_symbols if no globals.
11445 (all_symbols_read_hook): Don't provide replacement for empty
11448 2008-12-12 Ian Lance Taylor <iant@google.com>
11450 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11451 r_type == 0 for a local symbol with r_sym == 0.
11452 (scan_relocatable_relocs): Pass r_sym to
11453 local_non_section_strategy.
11454 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11457 * configure.ac: Update test for TLS descriptors: they are
11458 supported as of glibc 2.9.
11459 * configure: Rebuild.
11461 2008-12-11 Ian Lance Taylor <iant@google.com>
11464 * target-reloc.h (Default_scan_relocatable_relocs): For each
11465 function, map r_type == 0 to RELOC_DISCARD.
11467 2008-12-10 Cary Coutant <ccoutant@google.com>
11469 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11470 object to override a kept COMDAT group from a plugin object.
11472 2008-12-09 Ian Lance Taylor <iant@google.com>
11475 * yyscript.y (file_cmd): Handle INPUT.
11477 * testsuite/initpri1.c: Change all declarations to be full
11478 prototypes by adding void, to avoid compiler warnings.
11480 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
11482 * options.cc (General_options::parse_plugin_opt): New.
11483 (General_options::add_plugin): The argument now is just the filename.
11484 (General_options::add_plugin_option): New.
11485 * options.h (plugin_opt): New.
11486 (add_plugin): Change argument name.
11487 (add_plugin_option): New.
11488 * plugin.cc (Plugin::load): Don't parse the plugin option.
11489 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11490 (Plugin::add_option): New.
11491 (Plugin::args_): Change type.
11492 (Plugin::filename_): New.
11493 (Plugin_manager::add_plugin_option): New.
11494 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11495 * testsuite/Makefile.in: Regenerate.
11497 2008-12-05 Cary Coutant <ccoutant@google.com>
11499 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11500 Handle --strip-lto-sections option.
11501 * options.h (strip_lto_sections): New option.
11503 2008-12-01 Cary Coutant <ccoutant@google.com>
11505 * plugin.cc (ld_plugin_message): Change format parameter to const.
11506 Fix mismatch between new[] and delete.
11508 2008-11-14 Cary Coutant <ccoutant@google.com>
11510 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11513 2008-11-05 Craig Silverstein <csilvers@google.com>
11515 * options.cc (General_options::parse_dynamic_list): New function.
11516 * options.h (General_options): New flags dynamic_list,
11517 dynamic_list_data, dynamic_list_cpp_new, and
11518 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11519 (General_options::in_dynamic_list): New function.
11520 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11521 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11522 (Lex::can_continue_name): Likewise.
11524 (read_script_file): New parameter script_options.
11525 (read_dynamic_list): New function.
11526 (Script_options::define_dynamic_list): New function.
11527 (dynamic_list_keyword_parsecodes): New variable.
11528 (dynamic_list_keywords): New variable.
11529 * script.h (Script_options::define_dynamic_list): New function
11531 (read_dynamic_list): New function prototype.
11532 * symtab.cc (strprefix): New macro.
11533 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11534 dynamic_list_data, dynamic_list_cpp_new, and
11535 dynamic_list_cpp_typeinfo.
11536 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11537 (dynamic_list_expr): New rule.
11538 (dynamic_list_nodes): Likewise.
11539 (dynamic_list_node): Likewise.
11540 * testsuite/Makefile.am (dynamic_list): New test.
11541 * testsuite/Makefile.in: Regenerated.
11542 * testsuite/dynamic_list.t: New file.
11543 * testsuite/dynamic_list.sh: New file.
11545 2008-11-05 Craig Silverstein <csilvers@google.com>
11547 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11548 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11549 (t11_last): Likewise.
11550 * testsuite/ver_test_6.c (main): Likewise.
11552 2008-10-07 Cary Coutant <ccoutant@google.com>
11554 * options.c (General_options::finalize): Add check for -static and
11556 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11559 2008-10-02 Cary Coutant <ccoutant@google.com>
11561 * plugin.cc (make_sized_plugin_object): Fix conditional
11562 compilation to work when not all targets are enabled.
11564 2008-09-29 Cary Coutant <ccoutant@google.com>
11566 * archive.cc (Archive::get_file_and_offset): Use filename instead
11567 of name to get library path.
11568 (Archive::include_member): Unlock external member of a thin archive.
11570 * testsuite/Makefile.am (TEST_AR): New variable.
11571 (thin_archive_test_1): New test.
11572 (thin_archive_test_2): New test.
11573 * testsuite/Makefile.in: Regenerate.
11574 * testsuite/thin_archive_main.cc: New file.
11575 * testsuite/thin_archive_test_1.cc: New file.
11576 * testsuite/thin_archive_test_2.cc: New file.
11577 * testsuite/thin_archive_test_3.cc: New file.
11578 * testsuite/thin_archive_test_4.cc: New file.
11580 2008-09-29 Cary Coutant <ccoutant@google.com>
11582 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11583 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11585 (Sized_relobj::do_finalize_local_symbols): Likewise.
11586 (Sized_relobj::map_to_kept_section): Likewise.
11587 * object.h (Sized_relobj::invalid_address): New constant.
11588 (Sized_relobj::do_output_section_offset): Check for invalid_address
11590 * output.cc (Output_reloc::local_section_offset): Use constant
11591 invalid_address instead of -1U.
11592 (Output_reloc::get_address): Likewise.
11593 (Output_section::output_address): Change -1U to -1ULL.
11594 * output.h (Output_reloc::invalid_address): New constant.
11595 * reloc.cc (Sized_relobj::write_sections): Use constant
11596 invalid_address instead of -1U.
11597 (Sized_relobj::relocate_sections): Likewise.
11598 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11599 values for merge sections.
11600 * target-reloc.h (relocate_for_relocatable): Use constant
11601 invalid_address instead of -1U.
11603 2008-09-19 Cary Coutant <ccoutant@google.com>
11605 Add plugin functionality for link-time optimization (LTO).
11606 * configure.ac (plugins): Add --enable-plugins option.
11607 * configure: Regenerate.
11608 * config.in: Regenerate.
11609 * Makefile.am (LIBDL): New variable.
11610 (CCFILES): Add plugin.cc.
11611 (HFILES): Add plugin.h.
11612 (ldadd_var): Add LIBDL.
11613 * Makefile.in: Regenerate.
11615 * archive.cc: Include "plugin.h".
11616 (Archive::setup): Don't preread archive symbols when using a plugin.
11617 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11618 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11620 (Archive::include_member): Add symbols from plugin objects.
11621 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11622 * descriptors.cc (Descriptors::open): Check for file descriptors
11623 abandoned by plugins.
11624 (Descriptors::claim_for_plugin): New function.
11625 * descriptors.h (Descriptors::claim_for_plugin): New function.
11626 (Open_descriptor::is_claimed): New field.
11627 (claim_descriptor_for_plugin): New function.
11628 * fileread.cc (File_read::claim_for_plugin): New function.
11629 * fileread.h (File_read::claim_for_plugin): New function.
11630 (File_read::descriptor): New function.
11631 * gold.cc: Include "plugin.h".
11632 (queue_initial_tasks): Add task to call plugin hooks for generating
11634 * main.cc: Include "plugin.h".
11635 (main): Load plugin libraries.
11636 * object.h (Pluginobj): Declare.
11637 (Object::pluginobj): New function.
11638 (Object::do_pluginobj): New function.
11639 (Object::set_target): New function.
11640 * options.cc: Include "plugin.h".
11641 (General_options::parse_plugin): New function.
11642 (General_options::General_options): Initialize plugins_ field.
11643 (General_options::add_plugin): New function.
11644 * options.h (Plugin_manager): Declare.
11645 (General_options): Add --plugin option.
11646 (General_options::has_plugins): New function.
11647 (General_options::plugins): New function.
11648 (General_options::add_plugin): New function.
11649 (General_options::plugins_): New field.
11650 * plugin.cc: New file.
11651 * plugin.h: New file.
11652 * readsyms.cc: Include "plugin.h".
11653 (Read_symbols::do_read_symbols): Check for archive before checking
11654 for ELF file. Call plugin hooks to claim files.
11655 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11656 from a real object file; force override when processing replacement
11658 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11659 (Symbol::init_base_object): Likewise.
11660 (Symbol::init_base_output_data): Likewise.
11661 (Symbol::init_base_output_segment): Likewise.
11662 (Symbol::init_base_constant): Likewise.
11663 (Symbol::init_base_undefined): Likewise.
11664 (Symbol::output_section): Assert that object is not a plugin.
11665 (Symbol_table::add_from_pluginobj): New function.
11666 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11668 (Symbol_table::sized_write_globals): Likewise.
11669 (Symbol_table::add_from_pluginobj): Instantiate template.
11670 * symtab.h (Sized_pluginobj): Declare.
11671 (Symbol::in_real_elf): New function.
11672 (Symbol::set_in_real_elf): New function.
11673 (Symbol::in_real_elf_): New field.
11674 (Symbol_table::add_from_pluginobj): New function.
11676 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11677 (LIBDL): New variable.
11678 (LDADD): Add LIBDL.
11679 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11680 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11681 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11682 (MOSTLYCLEANFILES): Likewise.
11683 * testsuite/Makefile.in: Regenerate.
11684 * testsuite/plugin_test.c: New file.
11685 * testsuite/plugin_test_1.sh: New file.
11686 * testsuite/plugin_test_2.sh: New file.
11688 2008-09-16 Ian Lance Taylor <iant@google.com>
11690 * target-reloc.h (relocate_section): Check whether a symbol is
11691 defined by the ABI before reporting an undefined symbol error.
11692 * target.h (Target::is_defined_by_abi): Make parameter const.
11693 (Target::do_is_defined_by_abi): Likewise.
11694 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11695 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11696 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11697 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11698 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11699 * testsuite/Makefile.in: Rebuild.
11701 * fileread.cc (make_view): Add casts to avoid warning.
11703 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11705 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11706 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11708 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11710 * options.h (General_options::output_is_executable): New.
11711 (General_options::output_is_pie): New.
11712 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11713 for shared libraries.
11714 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11716 2008-09-11 Chris Demetriou <cgd@google.com>
11718 * options.h (origin): New -z option.
11719 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11720 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11723 2008-09-05 Cary Coutant <ccoutant@google.com>
11725 * fileread.cc (File_read::make_view): Add check for attempt to map
11726 beyond end of file.
11728 2008-09-05 Cary Coutant <ccoutant@google.com>
11730 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11731 explicit instantiations.
11733 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11736 * options.cc (General_options::finalize): Allow undefined symbols
11737 in shlibs if linking -shared.
11740 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11741 symbols as not needing a dynsym entry.
11743 2008-08-20 Craig Silverstein <csilvers@google.com>
11745 * fileread.cc (File_read::open): Do not lock the file unless it
11746 was successfully opened.
11748 2008-08-14 Cary Coutant <ccoutant@google.com>
11750 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11751 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11752 * testsuite/tls_test.cc (struct int128): 128-bit struct
11753 for testing TLS relocs with non-zero addend.
11754 (v12): New TLS variable.
11756 (t_last): Add check for v12.
11757 * testsuite/tls_test.h (t12): New function.
11758 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11760 2008-08-13 Ian Lance Taylor <iant@google.com>
11762 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11763 set tls_segment_ or relro_segment_.
11764 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11766 * output.h (Output_section::clear_is_relro): New function.
11767 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11768 sections specially even when output_data_ is empty.
11769 (Output_segment::maximum_alignment): When first section is relro,
11770 only force alignment for PT_LOAD segments.
11771 * script.cc (script_data_segment_align): New function.
11772 (script_data_segment_relro_end): New function.
11773 * script-c.h (script_data_segment_align): Declare.
11774 (script_data_segment_relro_end): Declare.
11775 * script-sections.h (class Script_sections): Declare
11776 data_segment_align and data_segment_relro_end. Add fields
11777 segment_align_index_ and saw_relro_end_.
11778 * script-sections.cc (class Sections_element): Add set_is_relro
11779 virtual function. Add new bool* parameter to place_orphan_here.
11780 Add get_output_section virtual function.
11781 (class Output_section_definition): Add set_is_relro. Add new
11782 bool* parameter to place_orphan_here. Add get_output_section.
11783 Add is_relro_ field.
11784 (Output_section_definition::Output_section_definition): Initialize
11785 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11786 and is_relro_ fields.
11787 (Output_section_definition::place_orphan_here): Add is_relro
11789 (Output_section_definition::set_section_addresses): Set relro for
11791 (Output_section_definition::alternate_constraint): Likewise.
11792 (class Orphan_output_section): Add new bool* parameter to
11793 place_orphan_here. Add get_output_section.
11794 (Orphan_output_section::place_orphan_here): Add is_relro
11796 (Script_sections::Script_sections): Initialize
11797 data_segment_align_index_ and saw_relro_end_.
11798 (Script_sections::data_segment_align): New function.
11799 (Script_sections::data_segment_relro_end): New function.
11800 (Script_sections::place_orphan): Set or clear is_relro.
11801 (Script_sections::set_section_addresses): Force alignment of first
11803 * yyscript.y (exp): Call script_data_segment_align and
11804 script_data_segment_relro_end.
11805 * testsuite/relro_script_test.t: New file.
11806 * testsuite/relro_test.cc (using_script): Declare.
11807 (t1, t2): Test using_script.
11808 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11809 (relro_script_test_SOURCES): Define.
11810 (relro_script_test_DEPENDENCIES): Define.
11811 (relro_script_test_LDFLAGS): Define.
11812 (relro_script_test_LDADD): Define.
11813 (relro_script_test.so): New target.
11814 * testsuite/Makefile.in: Rebuild.
11816 2008-08-06 Cary Coutant <ccoutant@google.com>
11818 * archive.cc (Archive::total_archives, Archive::total_members)
11819 (Archive::total_members_loaded): New variables.
11820 (Archive::setup): Add parameter. Add option to preread
11822 (Archive::read_armap): Add counter.
11823 (Archive::get_file_and_offset): New function.
11824 (Archive::get_elf_object_for_member): New function.
11825 (Archive::read_all_symbols): New function.
11826 (Archive::read_symbols): New function.
11827 (Archive::add_symbols): Add counters.
11828 (Archive::include_all_members): Use armap to find members if it's
11830 (Archive::include_member): Skip reading symbols if already read.
11831 Factored code into Archive::get_file_and_offset and
11832 Archive::get_elf_object_for_member. Changed call to
11833 Mapfile::report_include_archive_member.
11834 (Archive::print_stats): New function.
11835 * archive.h: Declare Object and Read_symbols_data classes.
11836 (Archive::Archive): Add initializers for new members.
11837 (Archive::setup): Add parameter.
11838 (Archive::print_stats): New function.
11839 (Archive::total_archives, Archive::total_members)
11840 (Archive::total_members_loaded): New variables.
11841 (Archive::get_file_and_offset): New function.
11842 (Archive::get_elf_object_for_member): New function.
11843 (Archive::read_all_symbols): New function.
11844 (Archive::read_symbols): New function.
11845 (Archive::Archive_member): New class.
11846 (Archive::members_): New member.
11847 (Archive::num_members_): New member.
11848 * main.cc: Include archive.h.
11849 (main): Call Archive::print_stats.
11850 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11851 archive parameter; member_name is now the fully-decorated name.
11852 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11853 * options.h: (General_options): Add --preread-archive-symbols option.
11854 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11857 2008-08-04 Ian Lance Taylor <iant@google.com>
11859 * symtab.h (Symbol::use_plt_offset): New function.
11860 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11861 * powerpc.cc (Relocate::relocate): Likewise.
11862 * sparc.cc (Relocate::relocate): Likewise.
11863 * x86_64.cc (Relocate::relocate): Likewise.
11864 * testsuite/weak_plt.sh: New test.
11865 * testsuite/weak_plt_main.cc: New test.
11866 * testsuite/weak_plt_shared.cc: New test.
11867 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11868 (check_PROGRAMS): Add weak_plt.
11869 (check_DATA): Add weak_plt_shared.so.
11870 (weak_plt_main_pic.o, weak_plt): New targets.
11871 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11872 * testsuite/Makefile.in: Rebuild.
11874 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11876 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11877 * testsuite/Makefile.in: Rebuild.
11879 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11881 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11882 * Makefile.in: Regenerate.
11883 * po/POTFILES.in: Regenerate.
11885 2008-07-29 Ian Lance Taylor <iant@google.com>
11887 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11888 symbols before other symbols.
11889 * testsuite/script_test_2.cc (test_addr): Declare.
11890 (test_addr_alias): Declare.
11891 (main): Check that test_addr and test_addr_alias have the right
11893 * testsuite/script_test_2.t: Define test_addr_alias and
11896 2008-07-24 Ian Lance Taylor <iant@google.com>
11899 * descriptors.cc: New file.
11900 * descriptors.h: New file.
11901 * gold-threads.h (class Hold_optional_lock): New class.
11902 * fileread.cc: Include "descriptors.h".
11903 (File_read::~File_read): Release descriptor rather than closing
11905 (File_read::open) [file]: Call open_descriptor rather than open.
11906 Set is_descriptor_opened_.
11907 (File_read::open) [memory]: Assert that descriptor is not open.
11908 (File_read::reopen_descriptor): New function.
11909 (File_read::release): Release descriptor.
11910 (File_read::do_read): Make non-const. Reopen descriptor.
11911 (File_read::read): Make non-const.
11912 (File_read::make_view): Reopen descriptor.
11913 (File_read::do_readv): Likewise.
11914 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11915 Update declarations.
11916 * layout.cc: Include "descriptors.h".
11917 (Layout::create_build_id): Use open_descriptor rather than open.
11918 * output.cc: Include "descriptors.h".
11919 (Output_file::open): Use open_descriptor rather than open.
11920 * archive.cc (Archive::const_iterator): Change Archive to be
11922 (Archive::begin, Archive::end): Make non-const.
11923 (Archive::count_members): Likewise.
11924 * archive.h (class Archive): Update declarations.
11925 * object.h (Object::read): Make non-const.
11926 * Makefile.am (CCFILES): Add descriptors.cc.
11927 (HFILES): Add descriptors.h.
11928 * Makefile.in: Rebuild.
11931 * gold.h: Always include <clocale>. Add Solaris workarounds
11932 following code in binutils/sysdep.h.
11935 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11936 this->eh_frame_hdr_ is NULL before using it.
11938 * dynobj.cc (Versions::Versions): Update comment.
11940 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11941 the base version name.
11943 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11944 array size plus one.
11945 (Stringpool_template::set_string_offsets): Subtract one from key
11946 before using it as an array index.
11947 (Stringpool_template::get_offset_with_length): Likewise.
11948 (Stringpool_template::write_to_buffer): Likewise.
11949 * stringpool.h (Stringpool_template::get_offset_from_key):
11952 2008-07-23 Ian Lance Taylor <iant@google.com>
11955 * object.h (Merged_symbol_value::value): Do our best to handle a
11959 * script.cc (Version_script_info::get_versions): Don't add empty
11960 version tag to return value.
11961 (Version_script_info::get_symbol_version_helper): Change return
11962 type to bool. Add pversion parameter. Change all callers.
11963 (script_register_vers_node): Don't require a non-NULL tag.
11964 * script.h (class Version_script_info): Update declarations.
11965 (Version_script_info::get_symbol_version): Change return type to
11966 bool. Add version parameter. Change all callers.
11967 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11968 handling. Handle an empty version from a version script.
11969 (Symbol_table::define_special_symbol): Likewise.
11970 * testsuite/ver_test_10.script: New file.
11971 * testsuite/ver_test_10.sh: New file.
11972 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11973 (check_DATA): Add ver_test_10.syms.
11974 (ver_test_10.syms, ver_test_10.so): New target.
11975 * testsuite/Makefile.in: Rebuild.
11977 2008-07-23 Simon Baldwin <simonb@google.com>
11979 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11980 to zero for undefined symbols from dynamic libraries.
11982 2008-07-23 Ian Lance Taylor <iant@google.com>
11984 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11985 Change all callers.
11986 * symtab.h (class Symbol_table): Update declaration.
11987 * testsuite/ver_test_9.cc: New file.
11988 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11989 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11990 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11991 (ver_test_9.so, ver_test_9.o): New targets.
11992 * testsuite/Makefile.in: Rebuild.
11994 2008-07-22 Ian Lance Taylor <iant@google.com>
11996 * options.h (class General_options): Define --check-sections.
11997 * layout.cc (Layout::set_segment_offsets): Handle
12000 * options.h (class General_options): Define -n/--nmagic and
12002 * options.cc (General_options::finalize): For -n/--nmagic or
12003 -N/--omagic, set -static.
12004 * layout.cc (Layout::attach_allocated_section_to_segment): If
12005 -N/--omagic, don't put read-only and read-write sections in
12006 different segments.
12007 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12008 finding a read-only segment.
12009 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12010 don't set the minimum segment alignment to the common page size,
12011 and don't set the file offset to the address modulo the page size.
12012 * script-sections.cc (Script_sections::create_segments): If
12013 -n/--omagic, don't put read-only and read-write sections in
12014 different segments.
12016 * cref.cc: New file.
12017 * cref.h: New file.
12018 * options.h (class General_options): Add --print-symbol-counts.
12019 * main.cc (main): Issue defined symbol report if requested.
12020 * archive.cc (Archive::interpret_header): Make into a const member
12022 (Archive::add_symbols): Call Input_objects::archive_start and
12024 (Archive::const_iterator): Define new class.
12025 (Archive::begin, Archive::end): New functions.
12026 (Archive::include_all_members): Rewrite to use iterator.
12027 (Archive::count_members): New function.
12028 * archive.h (class Archive): Update declarations.
12029 (Archive::filename): New function.
12030 * object.cc: Include "cref.h".
12031 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12032 (Sized_relobj::do_get_global_symbol_counts): New function.
12033 (Input_objects::add_object): Add object to cross-referencer.
12034 (Input_objects::archive_start): New function.
12035 (Input_objects::archive_stop): New function.
12036 (Input_objects::print_symbol_counts): New function.
12037 * object.h: Declare Cref and Archive.
12038 (Object::get_global_symbol_counts): New function.
12039 (Object::do_get_global_symbol_counts): New pure virtual function.
12040 (class Sized_relobj): Add defined_count_ field. Update
12042 (class Input_objects): Add cref_ field. Update constructor.
12043 Update declarations.
12044 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12046 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12048 (Sized_dynobj::do_get_global_symbol_counts): New function.
12049 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12050 defined_count_. Update declarations. Define Symbols typedef.
12051 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12052 parameter. Change all callers.
12053 (Symbol_table::add_from_dynobj): Add sympointers and defined
12054 parameters. Change all callers.
12055 * symtab.h (class Symbol_table): Update declarations.
12056 * Makefile.am (CCFILES): Add cref.cc.
12057 (HFILES): Add cref.h.
12058 * Makefile.in: Rebuild.
12060 2008-07-22 Simon Baldwin <simonb@google.com>
12062 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12063 to zero when writing undefined symbols.
12065 2008-07-22 Ian Lance Taylor <iant@google.com>
12067 * output.cc (Output_section::add_input_section): Don't try to
12068 merge empty merge sections.
12070 2008-07-21 Craig Silverstein <csilvers@google.com>
12072 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12073 Include symbol version in error message.
12075 2008-07-20 Chris Demetriou <cgd@google.com>
12077 * configure.ac (gold_cv_c_random_seed): New configured variable.
12078 (RANDOM_SEED_CFLAGS): New substituted variable.
12079 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12080 * configure: Rebuild.
12081 * Makefile.in: Likewise.
12082 * testsuite/Makefile.in: Likewise.
12084 2008-07-18 Ian Lance Taylor <iant@google.com>
12086 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12087 where we see NAME/NULL and NAME/VERSION as separate symbols.
12088 * testsuite/ver_test_main.cc (main): Call t4.
12089 (t4, t4_2a): Define.
12090 * testsuite/ver_test_2.cc (t4_2): Define.
12091 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12092 * testsuite/ver_test_4.cc (t4_2a): Define.
12093 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12094 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12096 2008-07-17 Ian Lance Taylor <iant@google.com>
12098 * dynobj.cc (Versions::add_def): If we give an error about a
12099 missing version, go ahead and create the version anyhow.
12101 2008-07-10 Ian Lance Taylor <iant@google.com>
12103 Handle output sections with more than 0x7fffffff bytes.
12104 * object.h (class Relobj): Change map_to_output_ to
12105 output_sections_, and just keep a section pointer. Change all
12106 uses. Move comdat group support to Sized_relobj.
12107 (Relobj::is_section_specially_mapped): Remove.
12108 (Relobj::output_section): Remove poff parameter. Change all
12110 (Relobj::output_section_offset): New function.
12111 (Relobj::set_section_offset): Rewrite.
12112 (Relobj::map_to_output): Remove.
12113 (Relobj::output_sections): New function.
12114 (Relobj::do_output_section_offset): New pure virtual function.
12115 (Relobj::do_set_section_offset): Likewise.
12116 (class Sized_relobj): Add section_offsets_ field. Add comdat
12117 group support from Relobj. Update declarations.
12118 (Sized_relobj::get_output_section_offset): New function.
12119 (Sized_relobj::do_output_section_offset): New function.
12120 (Sized_relobj::do_set_section_offset): New function.
12121 * object.cc (Relobj::output_section_address): Remove.
12122 (Sized_relobj::Sized_relobj): Initialize new fields.
12123 (Sized_relobj::include_section_group): Cast find_kept_object to
12125 (Sized_relobj::include_linkonce_section): Likewise.
12126 (Sized_relobj::do_layout): Use separate arrays for output section
12128 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12130 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12131 output_sections and section_offsets.
12132 (Sized_relobj::write_local_symbols): Likewise.
12133 (map_to_kept_section): Compute output address directly.
12134 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12135 output_sections and section_offsets.
12136 (Sized_relobj::write_sections): Likewise.
12137 (Sized_relobj::relocate_sections): Likewise.
12138 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12139 * output.h (class Output_reloc): Update declarations. Change
12140 u2_.relobj to Sized_relobj*.
12141 (class Output_data_reloc): Change add functions to use
12143 * output.cc (Output_reloc::Output_reloc): Change relobj to
12145 (Output_reloc::local_section_offset): Change return type to
12146 Elf_Addr. Use get_output_section_offset.
12147 (Output_reloc::get_address): Likewise.
12148 (Output_section::is_input_address_mapped): Don't call
12149 is_section_specially_mapped.
12150 (Output_section::output_offset): Likewise.
12151 (Output_section::output_address): Likewise.
12152 (Output_section::starting_output_address): Likewise.
12153 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12154 parameter to Sized_relobj*.
12155 (Copy_relocs::need_copy_reloc): Likewise.
12156 (Copy_relocs::save): Likewise.
12157 * copy-relocs.h (class Copy_relocs): Update declarations.
12158 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12159 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12160 * target-reloc.h (relocate_for_relocatable): Change
12161 offset_in_output_section type to Elf_Addr. Change code that uses
12163 * layout.cc (Layout::layout): Always set *off.
12164 * mapfile.cc (Mapfile::print_input_section): Use
12165 output_section_offset.
12166 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12168 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12169 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12170 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12172 2008-07-03 Ian Lance Taylor <iant@google.com>
12174 * layout.cc (Layout::include_section): Do not discard unrecognized
12175 SHT_STRTAB sections.
12177 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12179 * script.cc (Lex::can_continue_name): Make '?' allowable in
12180 version-script names.
12181 * testsuite/version_script.map: Change glob pattern to use '?'
12183 2008-06-30 Manish Singh <yosh@gimp.org>
12186 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12189 2008-06-30 Ian Lance Taylor <iant@google.com>
12193 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12194 versions]: Don't try to read the value in the contents, since we
12195 don't use it. Use the template endianness when writing.
12197 2008-06-25 Cary Coutant <ccoutant@google.com>
12199 * fileread.cc (File_read::make_view): Assert on zero-length view.
12200 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12201 symbol table when there are no symbols to read.
12203 2008-06-23 Craig Silverstein <csilvers@google.com>
12205 * version.cc (version_string): Bump to 1.7
12207 2008-06-18 Craig Silverstein <csilvers@google.com>
12209 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12210 constant 0xFFFF to type Valtype.
12211 (Powerpc_relocate_functions::rel16_ha): Likewise.
12213 2008-06-17 Ian Lance Taylor <iant@google.com>
12215 * output.h (Output_section::Input_section): Initialize p2align_ to
12216 zero for Output_section_data constructors.
12217 (Output_section::Input_section::addralign): If not an input
12218 section, return the alignment of the Output_section_data.
12219 * testsuite/copy_test.cc: New file.
12220 * testsuite/copy_test_1.cc: New file.
12221 * testsuite/copy_test_2.cc: New file.
12222 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12223 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12224 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12225 (copy_test_1_pic.o, copy_test_1.so): New targets.
12226 (copy_test_2_pic.o, copy_test_2.so): New targets.
12227 * testsuite/Makefile.in: Rebuild.
12229 * script-sections.cc (Script_sections::place_orphan): Initialize
12230 local variable exact.
12232 2008-06-13 David Edelsohn <edelsohn@gnu.org>
12234 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12236 2008-06-12 David Edelsohn <edelsohn@gnu.org>
12237 David S. Miller <davem@davemloft.net>
12239 * powerpc.cc: New file.
12240 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12241 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12242 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12243 * Makefile.in: Rebuild.
12245 2008-06-09 Ian Lance Taylor <iant@google.com>
12247 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12249 (throwing, orig_terminate): New static variables.
12250 (terminate_handler): New static function.
12251 (t2): Set terminate handler.
12253 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12256 * binary.cc (Binary_to_elf::sized_convert): Fix .data
12259 2008-05-30 Cary Coutant <ccoutant@google.com>
12261 * archive.cc (Archive::include_all_members) Correct to step
12262 over symbol table and extended name table in thin archives.
12264 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12267 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12270 2008-05-28 Caleb Howe <cshowe@google.com>
12272 * reduced_debug_output.cc: New file.
12273 * reduced_debug_output.h: New file.
12274 * options.h (class General_options): Add --strip-debug-non-line.
12275 * options.cc (General_options::finalize): Add strip_debug_non_line
12276 to the strip heirarchy.
12277 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12279 * layout.cc: Include "reduced_debug_output.h".
12280 (Layout::Layout): Initialize new fields.
12281 (line_only_debug_sections): New static array.
12282 (is_lines_only_debug_sections): New static inline function.
12283 (Layout::include_section): Handle --strip-debug-non-line.
12284 (Layout::make_output_section): If --strip-debug-non-line, build
12285 new output sections for .debug_abbrev and .debug_info.
12286 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12287 gold. Warn about possible overflow.
12288 (read_signed_LEB_128): Likewise.
12289 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12290 (read_signed_LEB_128): Declare.
12291 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12292 (HFILES): Add reduced_debug_output.h.
12293 * Makefile.in: Rebuild.
12295 2008-05-21 Ian Lance Taylor <iant@google.com>
12297 * mapfile.cc: New file.
12298 * mapfile.h: New file.
12299 * options.h (class General_options): Add -M/--print-map and -Map.
12300 * options.cc (General_options::finalize): Make -M equivalent to
12302 * main.cc: Include <cstdio> and "mapfile.h".
12303 (main): Open mapfile if requested.
12304 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12305 constructor. Change caller.
12306 (queue_initial_tasks): Add mapfile parameter. Change caller.
12307 (queue_middle_tasks): Likewise.
12308 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12310 * archive.cc: Include "mapfile.h".
12311 (Archive::add_symbols): Add mapfile parameter. Change all
12312 callers. Pass mapfile, symbol, and reason to include_member.
12313 (Archive::include_all_members): Add mapfile parameter. Change all
12315 (Archive::include_member): Add mapfile, sym, and why parameters.
12316 Change all callers. Report inclusion to map file.
12317 * archive.h: Include "fileread.h".
12318 (class Archive): Update declarations.
12319 (Archive::file): New const method.
12320 (class Add_archive_symbols): Add mapfile_ field. Update
12321 constructor. Change all callers.
12322 * readsyms.h (class Read_symbols): Likewise.
12323 (class Finish_group): Likewise.
12324 (class Read_script): Likewise.
12325 * common.cc: Include "mapfile.h".
12326 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12328 (Symbol_table::do_allocate_commons): Likewise.
12329 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12330 symbol allocation to mapfile.
12331 * common.h (class Allocate_commons_task): Add mapfile_ field.
12332 Update constructor. Change all callers.
12333 * symtab.h (class Symbol_table): Update declarations.
12334 * layout.cc: Include "mapfile.h".
12335 (Layout_task_runner::run): Print information to mapfile.
12336 (Layout::create_gold_note): Change Output_data_fixed_space to
12337 Output_data_zero_fill.
12338 (Layout::create_build_id): Likewise.
12339 (Layout::print_to_mapfile): New function.
12340 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12341 constructor. Change caller.
12342 (class Layout): Declare print_to_mapfile.
12343 * output.cc (Output_section::Input_section::print_to_mapfile): New
12345 (Output_section::add_input_section): If producing a map, always
12346 add to input_sections_ list.
12347 (Output_section::do_print_to_mapfile): New function.
12348 (Output_segment::print_sections_to_mapfile): New function.
12349 (Output_segment::print_section_list_to_mapfile): New function.
12350 * output.h: Include "mapfile.h".
12351 (Output_data::print_to_mapfile): New function.
12352 (Output_data::do_print_to_mapfile): New virtual function.
12353 (Output_segment_headers::do_print_to_mapfile): New function.
12354 (Output_file_header::do_print_to_mapfile): New function.
12355 (Output_data_const::do_print_to_mapfile): New function.
12356 (class Output_data_const_buffer): Add map_name_ field. Update
12357 constructor. Change all callers. Add do_print_to_mapfile
12359 (class Output_data_fixed_space): Likewise.
12360 (class Output_data_space): Likewise.
12361 (class Output_data_zero_fill): New class.
12362 (Output_data_strtab::do_print_to_mapfile): New function.
12363 (Output_data_reloc_base::do_print_to_mapfile): New function.
12364 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12365 (Output_data_group::do_print_to_mapfile): New function.
12366 (Output_data_got::do_print_to_mapfile): New function.
12367 (Output_data_dynamic::do_print_to_mapfile): New function.
12368 (Output_symtab_xindex::do_print_to_mapfile): New function.
12369 (class Output_section): Declare do_print_to_mapflie. Declare
12370 print_to_mapfile in Input_section.
12371 (class Output_segment): Declare new functions.
12372 * object.h (Sized_relobj::symbol_count): New function.
12373 * script-sections.cc
12374 (Output_section_element_dot_assignment::set_section_addresses):
12375 Change Output_data_fixed_space to Output_data_zero_fill.
12376 (Output_data_expression::do_print_to_mapfile): New function.
12377 * script.cc (read_input_script): Add mapfile parameter. Change
12379 * script.h (read_input_script): Update declaration.
12380 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12381 (Eh_frame::do_print_to_mapfile): New function.
12382 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12383 (Output_merge_string::do_print_to_mapfile): New function.
12384 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12386 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12388 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12390 * Makefile.am (CCFILES): Add mapfile.cc.
12391 (HFILES): Add mapfile.h.
12392 * Makefile.in: Rebuild.
12394 2008-05-19 Ian Lance Taylor <iant@google.com>
12396 * options.h (class General_options): Add -z relro.
12397 * layout.cc (Layout::Layout): Initialize relro_segment_.
12398 (Layout::add_output_section_data): Return the output section.
12399 (Layout::make_output_section): Rcognize relro sections and mark
12400 them appropriately.
12401 (Layout::attach_allocated_section_to_segment): Put relro sections
12402 in a PT_GNU_RELRO segment.
12403 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12405 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12407 (Layout::linkonce_mapping): Map d.rel.ro.local to
12408 .data.rel.ro.local.
12409 (Layout::output_section_name): Us .data.rel.ro.local for any
12410 section which begins with that.
12411 * layout.h (class Layout): Update add_output_section_data
12412 declaration. Add relro_segment_ field.
12413 * output.cc (Output_section::Output_section): Initialize is_relro_
12414 and is_relro_local_ fields.
12415 (Output_segment::add_output_section): Group relro sections.
12416 (Output_segment::is_first_section_relro): New function.
12417 (Output_segment::maximum_alignment): If there is a relro section,
12418 align the segment to the common page size.
12419 (Output_segment::set_section_addresses): Track whether we are
12420 looking at relro sections. If the last section is a relro
12421 section, align to the common page size.
12422 (Output_segment::set_section_list_addresses): Add in_relro
12423 parameter. Change all callers. Align to the page size when
12424 moving from relro to non-relro section.
12425 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12427 * output.h (class Output_section): Add is_relro_ and
12428 is_relro_local_ fields.
12429 (Output_section::is_relro): New function.
12430 (Output_section::set_is_relro): New function.
12431 (Output_section::is_relro_local): New function.
12432 (Output_section::set_is_relro_local): New function.
12433 (class Output_segment): Update declarations.
12434 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12435 * sparc.cc (Target_sparc::got_section): Likewise.
12436 * x86_64.cc (Target_x86_64::got_section): Likewise.
12437 * testsuite/relro_test_main.cc: New file.
12438 * testsuite/relro_test.cc: New file.
12439 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12440 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12441 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12442 (relro_test.so, relro_test_pic.o): New targets.
12443 * testsuite/Makefile.in: Rebuild.
12445 2008-05-16 Ian Lance Taylor <iant@google.com>
12447 * output.cc (Output_segment::add_output_section): Remove front
12449 * output.h (class Output_segment): Remove
12450 add_initial_output_section and overloaded add_output_section.
12451 Update declaration of remaining add_output_section.
12452 * layout.cc (Layout::create_interp): Call add_output_section
12453 rather than add_initial_output_section.
12454 (Layout::finish_dynamic_section): Likewise.
12456 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12457 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12458 know the dynamic type.
12459 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12460 field. Initialize it in constructor.
12461 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12462 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12463 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12466 * output.cc (Output_reloc::get_address): Change return type to
12468 * output.h (class Output_reloc): Update get_address declaration.
12469 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12470 for section addresses.
12472 2008-05-09 Ian Lance Taylor <iant@google.com>
12475 * gold.cc (gold_nomem): Use return value of write.
12477 2008-05-08 Ian Lance Taylor <iant@google.com>
12479 * symtab.c (Symbol::init_base_output_data): Add version
12480 parameter. Change all callers.
12481 (Symbol::init_base_output_segment): Likewise.
12482 (Symbol::init_base_constant): Likewise.
12483 (Symbol::init_base_undefined): Likewise.
12484 (Sized_symbol::init_output_data): Likewise.
12485 (Sized_symbol::init_output_segment): Likewise.
12486 (Sized_symbol::init_constant): Likewise.
12487 (Sized_symbol::init_undefined): Likewise.
12488 (Symbol_table::do_define_in_output_data): If the new symbol has a
12489 version, mark it as the default.
12490 (Symbol_table::do_define_in_output_segment): Likewise.
12491 (Symbol_table::do_define_as_constant): Likewise.
12492 * symtab.h (class Symbol): Update declarations.
12493 (class Sized_symbol): Likewise.
12494 * resolve.cc (Symbol::override_version): New function.
12495 (Symbol::override_base): Call override_version.
12496 (Symbol::override_base_with_special): Likewise.
12497 * testsuite/ver_script_8.script: New file.
12498 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12499 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12500 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12501 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12503 2008-05-06 Ian Lance Taylor <iant@google.com>
12506 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12508 (class General_options): Remove existing --undefined, and add
12509 --no-undefined instead. Add new --undefined as synonym for -u.
12510 * archive.cc (Archive::add_symbols): Check whether symbol was
12512 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12513 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12514 all uses. Add IS_UNDEFINED. Update declarations to split
12515 different versions of init_base. Declare init_base_undefined.
12516 (Symbol::is_defined): Handle IS_UNDEFINED.
12517 (Symbol::is_undefined): Likewise.
12518 (Symbol::is_weak_undefined): Call is_undefined.
12519 (Symbol::is_absolute): Handle IS_CONSTANT.
12520 (class Sized_symbol): Update declarations to split different
12521 versions of init. Declare init_undefined.
12522 (class Symbol_table): Declare new functions.
12523 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12524 Change all callers.
12525 (Symbol::init_base_output_data): Likewise.
12526 (Symbol::init_base_output_segment): Likewise.
12527 (Symbol::init_base_constant): Likewise.
12528 (Symbol::init_base_undefined): New function.
12529 (Sized_symbol::init_object): Rename from init. Change all
12531 (Sized_symbol::init_output_data): Likewise.
12532 (Sized_symbol::init_output_segment): Likewise.
12533 (Sized_symbol::init_constant): Likewise.
12534 (Sized_symbol::init_undefined): New function.
12535 (Symbol_table::add_undefined_symbols_from_command_line): New
12537 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12539 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12540 (Symbol::output_section): Likewise.
12541 (Symbol::set_output_section): Likewise.
12542 (Symbol_table::sized_finalize_symbol): Likewise.
12543 (Symbol_table::sized_write_globals): Likewise.
12544 * resolve.cc (Symbol_table::should_override): Likewise.
12545 (Symbol::override_base_with_special): Likewise.
12547 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12548 symbol, change it to have default visibility.
12549 * testsuite/protected_1.cc: New file.
12550 * testsuite/protected_2.cc: New file.
12551 * testsuite/protected_3.cc: New file.
12552 * testsuite/protected_main_1.cc: New file.
12553 * testsuite/protected_main_2.cc: New file.
12554 * testsuite/protected_main_3.cc: New file.
12555 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12556 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12557 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12558 (protected_1.so): New target.
12559 (protected_1_pic.o, protected_2_pic.o): New targets.
12560 (protected_3_pic.o): New target.
12561 (check_PROGRAMS): Add protected_2.
12562 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12563 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12564 * testsuite/Makefile.in: Rebuild.
12566 * options.h (DEFINE_var): Add set_user_set_##varname__.
12567 (DEFINE_bool_alias): New macro.
12568 (class General_options): Define -Bstatic using DEFINE_bool_alias
12569 rather than DEFINE_special. Add --undefined as an alias for -z
12571 * options.cc (General_options::parse_Bstatic): Remove.
12573 * options.h (class General_options): Add --fatal-warnings.
12574 * main.cc (main): Implement --fatal-warnings.
12575 * errors.h (Errors::warning_count): New function.
12577 * options.h (class General_options): Add -Bsymbolic-functions.
12578 * symtab.h (Symbol::is_preemptible): Check for
12579 -Bsymbolic-functions.
12581 2008-05-05 Ian Lance Taylor <iant@google.com>
12583 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12584 as noVARNAME rather than no-VARNAME.
12585 (class General_options): Add option -z combreloc.
12586 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12588 (Output_reloc::sort_before) [SHT_REL]: New function.
12589 (Output_reloc::sort_before) [SHT_RELA]: New function.
12590 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12591 Sort_relocs_comparison.
12592 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12593 parameter. Change all callers.
12594 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12595 sort_relocs parameter. Change all callers.
12596 * output.cc (Output_reloc::get_address): New function, broken out
12598 (Output_reloc::write_rel): Call it.
12599 (Output_reloc::compare): New function.
12600 (Output_data_reloc_base::do_write): Optionally sort relocs.
12602 * configure.ac: If targ_extra_obj is set, link it in.
12603 * configure.tgt: Initialize all variables.
12604 (x86_64*): Set targ_extra_obj and targ_extra_size.
12605 * configure: Rebuild.
12607 * object.cc (Sized_relobj::include_section_group): Adjust section
12608 indexes read from group data. Build vector to pass to
12610 * layout.cc (Layout::layout_group): Add flags and shndxes
12611 parameters. Remove contents parameter. Change caller. Update
12612 explicit instantiations.
12613 * layout.h (class Layout): Update layout_group declaration.
12614 * output.cc (Output_data_group::Output_data_group): Add flags and
12615 input_shndxes parameters. Remove contents parameter. Change
12617 (Output_data_group::do_write): Change input_sections_ to
12619 * output.h (class Output_data_group): Update constructor
12620 declaration. Rename input_sections_ to input_shndxes_.
12621 * testsuite/many_sections_test.cc: Add template.
12623 2008-04-30 Cary Coutant <ccoutant@google.com>
12625 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12627 * layout.cc (Layout::include_section): Refactored check for debug
12629 (Layout::add_comdat): Add new parameters. Change type
12630 of signature parameter. Add object and shndx to signatures table.
12631 (Layout::find_kept_object): New function.
12632 * layout.h: Include <cstring>.
12633 (Layout::is_debug_info_section): New function.
12634 (Layout::add_comdat): Add new parameters.
12635 (Layout::find_kept_object): New function.
12636 (Layout::Kept_section): New struct.
12637 (Layout::Signatures): Change type of map range.
12638 * object.cc (Relobj::output_section_address): New function.
12639 (Sized_relobj::include_section_group): Add new parameters. Change
12640 calls to Layout::add_comdat. Change to build table of kept comdat
12641 groups and table mapping discarded sections to kept sections.
12642 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12643 (Sized_relobj::do_layout): Change calls to include_section_group and
12644 include_linkonce_section.
12645 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12646 value to zero when section is discarded.
12647 (Sized_relobj::map_to_kept_section): New function.
12648 * object.h (Relobj::output_section_address): New function.
12649 (Relobj::Comdat_group): New type.
12650 (Relobj::find_comdat_group): New function.
12651 (Relobj::Comdat_group_table): New type.
12652 (Relobj::Kept_comdat_section): New type.
12653 (Relobj::Kept_comdat_section_table): New type.
12654 (Relobj::add_comdat_group): New function.
12655 (Relobj::set_kept_comdat_section): New function.
12656 (Relobj::get_kept_comdat_section): New function.
12657 (Relobj::comdat_groups_): New field.
12658 (Relobj::kept_comdat_sections_): New field.
12659 (Symbol_value::input_value): Update comment.
12660 (Sized_relobj::map_to_kept_section) New function.
12661 (Sized_relobj::include_linkonce_section): Add new parameter.
12662 * target-reloc.h (Comdat_behavior): New type.
12663 (get_comdat_behavior): New function.
12664 (relocate_section): Add code to map a discarded section to the
12665 corresponding kept section when applying a relocation.
12667 2008-04-30 Craig Silverstein <csilvers@google.com>
12669 * dwarf_reader.cc (next_generation_count): New static var.
12670 (Addr2line_cache_entry): New struct.
12671 (addr2line_cache): New static var.
12672 (Dwarf_line_info::one_addr2line): Added caching.
12673 (Dwarf_line_info::clear_addr2line_cache): New function.
12674 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12675 cache-size parameter.
12676 (Dwarf_line_info::one_addr2line_cache): New function.
12677 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12678 new cache-size argument to one_addr2line(), and clear cache.
12680 2008-04-28 Cary Coutant <ccoutant@google.com>
12682 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12683 R_386_PC8 relocations.
12685 2008-04-23 Ian Lance Taylor <iant@google.com>
12687 * object.cc (Sized_relobj::include_section_group): Check for
12688 invalid section group.
12690 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12693 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12694 than read for file header.
12695 * archive.cc (Archive::include_member): Likewise.
12697 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12699 * aclocal.m4: Regenerate.
12700 * configure: Regenerate.
12702 2008-04-19 Ian Lance Taylor <iant@google.com>
12704 * version.cc (version_string): Bump to 1.6.
12706 * testsuite/Makefile.am (many_sections_r_test): New target.
12707 (many_sections_r_test_SOURCES): Remove.
12708 (many_sections_r_test_DEPENDENCIES): Remove.
12709 (many_sections_r_test_LDFLAGS): Remove.
12710 (many_sections_r_test_LDADD): Remove.
12712 * object.cc (Sized_relobj::do_add_symbols): Always pass
12713 local_symbol_count_ to add_from_relobj.
12715 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12716 every thousand variables.
12717 * testsuite/Makefile.in: Rebuild.
12719 * object.cc (Xindex::initialize_symtab_xindex): New function.
12720 (Xindex::read_symtab_xindex): New function.
12721 (Xindex::sym_xindex_to_shndx): New function.
12722 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12724 (Sized_relobj::do_initialize_xindex): New function.
12725 (Sized_relobj::do_read_symbols): Adjust section links.
12726 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12727 parameter. Change all callers.
12728 (Sized_relobj::include_section_group): Adjust section links and
12729 symbol section indexes.
12730 (Sized_relobj::do_layout): Adjust section links.
12731 (Sized_relobj::do_count_local_symbols): Adjust section links and
12732 symbol section indexes.
12733 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12734 ordinary and special symbols.
12735 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12736 dynsym_xindex parameters. Change all callers. Adjust section
12737 links. Use SHN_XINDEX when needed.
12738 (Sized_relobj::get_symbol_location_info): Adjust section links.
12739 Don't get fooled by special symbols.
12740 * object.h (class Xindex): Define.
12741 (class Object): Add xindex_ parameter. Declare virtual functoin
12742 do_initialize_xindex.
12743 (Object::adjust_sym_shndx): New function.
12744 (Object::set_xindex): New protected function.
12745 (class Symbol_value): Add is_ordinary_shndx_ field.
12746 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12747 (Symbol_value::value): Assert ordinary section.
12748 (Symbol_value::initialize_input_to_output_map): Likewise.
12749 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12750 Change all callers.
12751 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12753 (class Sized_relobj): Update declarations.
12754 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12755 parameter. Change all callers.
12756 (Sized_relobj::adjust_shndx): New function.
12757 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12759 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12760 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12761 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12762 (Sized_dynobj::read_dynsym_section): Adjust section links.
12763 (Sized_dynobj::read_dynamic): Likewise.
12764 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12766 (Sized_dynobj::do_initialize_xindex): New function.
12767 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12768 do_initialize_xindex.
12769 (Sized_dynobj::adjust_shndx): New function.
12770 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12771 dynsym_xindex_ fields.
12772 (Layout::finalize): Add a call to set_section_indexes before
12773 creating the symtab sections.
12774 (Layout::set_section_indexes): Don't do anything if the section
12775 already has a section index.
12776 (Layout::create_symtab_sections): Add shnum parameter. Change
12777 caller. Create .symtab_shndx section if needed.
12778 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12780 (Layout::allocated_output_section_count): New function.
12781 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12783 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12784 fields. Update declarations.
12785 (Layout::symtab_xindex): New function.
12786 (Layout::dynsym_xindex): New function.
12787 (class Write_symbols_task): Add layout_ field.
12788 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12790 * output.cc (Output_section_headers::Output_section_headers): Add
12791 shstrtab_section parameter. Change all callers.
12792 (Output_section_headers::do_sized_write): Store overflow values
12793 for section count and section string table section index in
12794 section header zero.
12795 (Output_file_header::do_sized_write): Check for overflow of
12796 section count and section string table section index.
12797 (Output_symtab_xindex::do_write): New function.
12798 (Output_symtab_xindex::endian_do_write): New function.
12799 * output.h (class Output_section_headers): Add shstrtab_section_.
12800 Update declarations.
12801 (class Output_symtab_xindex): Define.
12802 (Output_section::has_out_shndx): New function.
12803 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12805 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12806 Change all callers.
12807 (Sized_symbol::init): Likewise.
12808 (Symbol::output_section): Check for ordinary symbol.
12809 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12810 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12812 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12813 Change all callers. Simplify handling of symbols from sections
12814 not included in the link.
12815 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12817 (Weak_alias_sorter::operator()): Assert that symbols are
12819 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12821 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12822 parameters. Change all callers.
12823 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12824 symbol distinction. Use SHN_XINDEX when needed.
12825 (Symbol_table::write_section_symbol): Add symtab_xindex
12826 parameter. Change all callers.
12827 (Symbol_table::sized_write_section_symbol): Likewise. Use
12828 SHN_XINDEX when needed.
12829 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12831 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12832 (Symbol::is_defined): Check is_ordinary.
12833 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12834 (Symbol::is_absolute, Symbol::is_common): Likewise.
12835 (class Sized_symbol): Update declarations.
12836 (class Symbol_table): Update declarations.
12837 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12838 parameters. Change all callers.
12839 (Sized_symbol::override): Likewise.
12840 (Symbol_table::override): Likewise.
12841 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12842 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12843 is_ordinary, and orig_st_shndx parameters. Change all callers.
12844 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12845 to be in an ordinary section.
12846 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12847 object and is_ordinary parameters. Change all callers.
12848 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12849 Change all callers. Don't add undefined or non-ordinary symbols
12851 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12852 Change all callers.
12853 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12855 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12856 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12857 (Sized_relobj::relocate_sections): Likewise.
12858 * target-reloc.h (scan_relocs): Adjust section symbol index.
12859 (scan_relocatable_relocs): Likewise.
12860 * i386.cc (Scan::local): Check for ordinary symbols.
12861 * sparc.cc (Scan::local): Likewise.
12862 * x86_64.cc (Scan::local): Likewise.
12863 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12864 to symbol_section_and_value.
12865 * testsuite/many_sections_test.cc: New file.
12866 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12867 (check_PROGRAMS): Add many_sections_test.
12868 (many_sections_test_SOURCES): Define.
12869 (many_sections_test_DEPENDENCIES): Define.
12870 (many_sections_test_LDFLAGS): Define.
12871 (BUILT_SOURCES): Add many_sections_define.h.
12872 (many_sections_define.h): New target.
12873 (BUILT_SOURCES): Add many_sections_check.h.
12874 (many_sections_check.h): New target.
12875 (check_PROGRAMS): Add many_sections_r_test.
12876 (many_sections_r_test_SOURCES): Define.
12877 (many_sections_r_test_DEPENDENCIES): Define.
12878 (many_sections_r_test_LDFLAGS): Define.
12879 (many_sections_r_test_LDADD): Define.
12880 (many_sections_r_test.o): New target.
12881 * testsuite/Makefile.in: Rebuild.
12883 2008-04-17 Cary Coutant <ccoutant@google.com>
12885 * errors.cc (Errors::info): New function.
12886 (gold_info): New function.
12887 * errors.h (Errors::info): New function.
12888 * gold.h (gold_info): New function.
12889 * object.cc (Input_objects::add_object): Print trace output.
12890 * options.cc (options::parse_set): New function.
12891 (General_options::parse_wrap): Deleted.
12892 (General_options::General_options): Deleted initializer.
12893 * options.h (options::String_set): New typedef.
12894 (options::parse_set): New function.
12895 (DEFINE_set): New macro.
12896 (General_options::wrap): Changed to use DEFINE_set. Changed
12897 callers of any_wrap_symbols and is_wrap_symbol.
12898 (General_options::trace, General_options::trace_symbol):
12900 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12901 (General_options::wrap_symbols_): Deleted.
12902 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12904 2008-04-17 David S. Miller <davem@davemloft.net>
12906 * options.cc (General_options::parse_V): New function.
12907 * options.h: Add entries for -V and -Qy.
12909 2008-04-17 Ian Lance Taylor <iant@google.com>
12911 * common.cc (Symbol_table::allocate_commons): Remove options
12912 parameter. Change caller.
12913 (Symbol_table::do_allocate_commons): Remove options parameter.
12914 Change caller. Just call do_allocate_commons_list twice.
12915 (Symbol_table::do_allocate_commons_list): New function, broken out
12916 of do_allocate_commons.
12917 * common.h (class Allocate_commons_task): Remove options_ field.
12918 Update constructor.
12919 * symtab.cc (Symbol_table::Symbol_table): Initialize
12921 (Symbol_table::add_from_object): Put TLS common symbols on
12923 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12924 which are IN_OUTPUT_DATA.
12925 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12926 allocate_commons and do_allocate_commons declarations. Declare
12927 do_allocate_commons_list.
12928 * gold.cc (queue_middle_tasks): Update creation of
12929 Allocate_commons_task to not pass options.
12930 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12931 (TLS_TEST_C_FLAGS): New variable.
12932 (tls_test_c_pic.o): New target.
12933 (tls_test_shared.so): Link in tls_test_c_pic.o.
12934 (tls_test_c_pic_ie.o): New target.
12935 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12936 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12937 (tls_test_c.o): New target.
12938 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12939 (tls_pic_test_LDADD): Likewise.
12940 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12941 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12942 (tls_test_c_gnu2.o): New target.
12943 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12945 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12946 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12947 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12948 * testsuite/tls_test.cc: Include "config.h".
12949 (t_last): Call t11_last.
12950 * testsuite/tls_test.h (t11, t11_last): Declare.
12951 * testsuite/tls_test_c.c: New file.
12952 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12953 * configure.ac: Check for OpenMP support.
12954 * configure, config.in, Makefile.in: Rebuild.
12955 * testsuite/Makefile.in: Rebuild.
12957 2008-04-16 Cary Coutant <ccoutant@google.com>
12959 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12960 (Target_i386::tls_base_symbol_defined_): New field.
12961 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12962 (Target_i386::Scan::global): Likewise.
12963 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12964 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12965 (Target_x86_64::tls_base_symbol_defined_): New field.
12966 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12967 (Target_x86_64::Scan::global): Likewise.
12969 2008-04-16 Cary Coutant <ccoutant@google.com>
12971 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12972 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12973 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12974 building shared libraries.
12975 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12976 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12977 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12978 * testsuite/Makefile.in: Rebuild.
12979 * testsuite/weak_undef.h: New file.
12980 * testsuite/weak_undef_file1.cc: Add extra test cases.
12981 * testsuite/weak_undef_file2.cc: Likewise.
12982 * testsuite/weak_undef_test.cc: Likewise.
12984 2008-04-16 David S. Miller <davem@davemloft.net>
12986 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12987 Add issued_non_pic_error_ field. Declare check_non_pic.
12988 (Target_sparc::Scan::check_non_pic): New function.
12989 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12990 (Target_sparc::Scan::global): Likewise.
12992 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12993 * configure: Rebuild.
12995 * options.h (DEFINE_enable): New macro.
12996 (new_dtags): New enable option.
12997 (initfirst, interpose, loadfltr, nodefaultlib,
12998 nodelete, nodlopen, nodump): New -z options.
12999 * layout.cc (Layout:finish_dynamic_section): If new
13000 dtags enabled, emit DT_RUNPATH. Also, emit a
13001 DT_FLAGS_1 containing any specified -z flags.
13003 2008-04-16 Ian Lance Taylor <iant@google.com>
13005 * copy-relocs.cc: New file.
13006 * copy-relocs.h: New file.
13007 * reloc.cc: Remove Copy_relocs code.
13008 * reloc.h: Likewise.
13009 * reloc-types.h (struct Reloc_types) [both versions]: Add
13010 get_reloc_addend_noerror.
13011 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13012 variants of add_global which take an addend which must be zero.
13013 * i386.cc: Include "copy-relocs.h".
13014 (class Target_i386): Change type of copy_relocs_ to variable,
13015 update initializer.
13016 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13017 Change all callers.
13018 (Target_i386::do_finalize_sections): Change handling of
13020 * sparc.cc: Include "copy-relocs.h".
13021 (class Target_sparc): Change type of copy_relocs_ to variable,
13022 update initializer.
13023 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13024 Change all callers.
13025 (Target_sparc::do_finalize_sections): Change handling of
13027 * x86_64.cc: Include "copy-relocs.h".
13028 (class Target_x86_64): Change type of copy_relocs_ to variable,
13029 update initializer.
13030 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13031 class. Change all callers.
13032 (Target_x86_64::do_finalize_sections): Change handling of
13034 * Makefile.am (CCFILES): Add copy-relocs.cc.
13035 (HFILES): Add copy-relocs.h.
13037 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13039 * testsuite/script_test_4.sh: Permit leading zeroes.
13041 2008-04-15 Ian Lance Taylor <iant@google.com>
13043 * script-sections.cc (Script_sections::create_segments): Use
13044 header_size_adjustment even when there is enough room for the
13046 * testsuite/script_test_4.sh: New file.
13047 * testsuite/script_test_4.t: New file.
13048 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13049 (check_DATA): Add script_test_4.stdout.
13050 (MOSTLYCLEANFILES): Likewise.
13051 (script_test_4): New target.
13052 (script_test_4.stdout): New target.
13053 * testsuite/Makefile.in: Rebuild.
13055 * sparc.cc: Add definitions for Output_data_plt_sparc class
13058 2008-04-14 David S. Miller <davem@davemloft.net>
13060 * sparc.cc: New file.
13061 * Makefile.am (TARGETSOURCES): Add sparc.cc
13062 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13063 * configure.tgt: Document targ_extra_size and
13064 targ_extra_big_endian. Add entries for sparc-* and
13066 * configure.ac: Handle targ_extra_size and
13067 targ_extra_big_endian.
13068 * Makefile.in: Rebuild.
13069 * configure: Likewise.
13070 * po/POTFILES.in: Likewise.
13071 * po/gold.pot: Likewise.
13073 2008-04-14 Ian Lance Taylor <iant@google.com>
13075 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13076 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13077 in the name/type/flags to section mapping. Don't call
13078 allocate_output_section.
13079 (Layout::choose_output_section): Change parameter from adjust_name
13080 to is_input_section. Don't permit input sections after sections
13081 are attached to segments. Don't call allocate_output_section.
13082 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13083 not write_enable_output_section.
13084 (Layout::make_output_section): Don't push to
13085 unattached_section_list_ nor call attach_to_segment. Call
13086 attach_section_to_segment if sections are attached.
13087 (Layout::attach_sections_to_segments): New function.
13088 (Layout::attach_section_to_segment): New function.
13089 (Layout::attach_allocated_section_to_segment): Rename from
13090 attach_to_segment. Remove flags parameter.
13091 (Layout::allocate_output_section): Remove function.
13092 (Layout::write_enable_output_section): Remove function.
13093 * layout.h (class Layout): Update for above changes. Add new
13094 field sections_are_attached_.
13095 * output.h (Output_section::update_flags_for_input_section): New
13097 * output.cc (Output_section::add_input_section): Call
13098 update_flags_for_input_section.
13099 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13101 2008-04-11 Cary Coutant <ccoutant@google.com>
13103 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13104 thought unnecessary.
13105 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13107 2008-04-11 Ian Lance Taylor <iant@google.com>
13109 * output.h (class Output_section_data): Remove inline definition
13111 * output.cc (Output_section_data::set_addralign): New function.
13113 2008-04-11 Cary Coutant <ccoutant@google.com>
13115 Add support for TLS descriptors for i386 and x86_64.
13116 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13117 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13118 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13120 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13121 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13122 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13124 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13125 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13126 Fix problem with initial-exec relocations.
13127 (Target_i386::Relocate::relocate_tls): Likewise.
13128 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13130 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13131 support for section-plus-offset dynamic table entries.
13132 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13133 (Output_data_dynamic::Dynamic_entry): Add support for
13134 section-plus-offset dynamic table entries.
13135 (Output_data_dynamic::Classification): Likewise.
13136 (Output_data_dynamic::classification_): Renamed offset_.
13137 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13138 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13139 (Target_x86_64::make_plt_section): New function.
13140 (Target_x86_64::reserve_tlsdesc_entries): New function.
13141 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13142 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13143 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13144 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13145 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13146 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13147 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13148 add extra PLT entry for TLS descriptors.
13149 (Output_data_plt_x86_64::got_): New field.
13150 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13151 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13153 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13155 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13156 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13157 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13158 R_386_TLS_DESC_CALL relocations.
13159 (Target_x86_64::Scan::global): Likewise.
13160 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13161 for TLS descriptors.
13162 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13163 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13164 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13165 GD-to-IE relaxation.
13166 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13167 and TLS_DESCRIPTORS.
13168 * Makefile.in: Rebuild.
13169 * configure: Rebuild.
13170 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13171 (tls_test_shared2.so): New target.
13172 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13173 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13174 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13175 (tls_shared_gd_to_ie_test_LDADD): New variable.
13176 (tls_shared_gnu2_gd_to_ie_test): New target.
13177 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13179 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13180 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13181 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13182 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13183 (tls_shared_gnu2_test): New target.
13184 (tls_test_gnu2_shared.so): New target.
13185 (tls_shared_gnu2_test_SOURCES): New variable.
13186 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13187 (tls_shared_gnu2_test_LDFLAGS): New variable.
13188 (tls_shared_gnu2_test_LDADD): New variable.
13189 * testsuite/Makefile.in: Rebuild.
13190 * testsuite/Makefile.
13192 2008-04-11 Ian Lance Taylor <iant@google.com>
13194 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13196 * testsuite/Makefile.in: Rebuild.
13198 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13200 * testsuite/script_test_2.cc (main): Adjust test.
13202 2008-04-11 David S. Miller <davem@davemloft.net>
13203 Ian Lance Taylor <iant@google.com>
13205 * options.h (General_options): Add entries for '-Y' and
13207 * options.cc (General_options:finalize): If -Y was used, add those
13208 entries to the library path instead of the default "/lib" and
13211 2008-04-11 David S. Miller <davem@davemloft.net>
13213 * testsuite/justsyms.t: Start at 0x100.
13214 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
13215 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13217 * testsuite/script_test_2.cc: Adjust string and section length
13220 2008-04-09 Ian Lance Taylor <iant@google.com>
13223 * script-sections.cc (Sections_element::allocate_to_segment): Add
13225 (Output_section_definition::allocate_to_segment): Likewise.
13226 (Orphan_output_section::allocate_to_segment): Likewise.
13227 (Script_sections::attach_sections_using_phdrs_clause): Don't
13228 propagate non-PT_LOAD segments to orphan sections.
13229 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13230 readelf rather than objdump.
13231 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13232 .interp section and PT_INTERP segment are the same size.
13233 * testsuite/Makefile.in: Rebuild.
13235 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13236 aliases for symbols defined in the same object.
13237 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13238 (weak_alias_test_SOURCES): New variable.
13239 (weak_alias_test_DEPENDENCIES): New variable.
13240 (weak_alias_test_LDFLAGS): New variable.
13241 (weak_alias_test_LDADD): New variable.
13242 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13243 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13244 (weak_alias_test_3.o): New target.
13245 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13246 * testsuite/weak_alias_test_main.cc: New file.
13247 * testsuite/weak_alias_test_1.cc: New file.
13248 * testsuite/weak_alias_test_2.cc: New file.
13249 * testsuite/weak_alias_test_3.cc: New file.
13251 2008-04-08 Ian Lance Taylor <iant@google.com>
13253 * options.h (class General_options): Add --noinhibit-exec option.
13254 * main.cc (main): Check --noinhibit-exec.
13256 * options.h (class General_options): Define --wrap as a special
13257 option. Add wrap_symbols_ field.
13258 (General_options::any_wrap_symbols): New function.
13259 (General_options::is_wrap_symbol): New function.
13260 * options.cc (General_options::parse_wrap): New function.
13261 (General_options::General_options): Initialize wrap_symbols_.
13262 * symtab.cc (Symbol_table::wrap_symbol): New function.
13263 (Symbol_table::add_from_object): Handle --wrap.
13264 * symtab.h (class Symbol_table): Declare wrap_symbol.
13265 * target.h (Target::wrap_char): New function.
13266 (Target::Target_info): Add wrap_char field.
13267 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13268 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13269 * testsuite/testfile.cc (Target_test::test_target_info):
13272 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13275 * layout.h (class Layout): Add added_eh_frame_data_ field.
13276 * layout.cc (Layout::Layout): Initialize new field.
13277 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13278 output section until we find a section we merged successfully.
13279 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13280 that the size be non-zero.
13282 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13285 2008-04-08 Craig Silverstein <csilvers@google.com>
13287 * configure.ac: Export new conditional variable HAVE_ZLIB.
13288 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13290 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13291 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13293 2008-04-07 Ian Lance Taylor <iant@google.com>
13295 * version.cc (version_string): Set to "1.5".
13297 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13298 Add issued_non_pic_error_ field. Declare check_non_pic.
13299 (Target_x86_64::Scan::check_non_pic): New function.
13300 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13301 (Target_x86_64::Scan::global): Likewise.
13303 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13304 addend parameter. Change caller. Handle merge sections.
13305 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13306 Address to Addend. Don't add in the result of
13307 local_section_offset, pass down the addend and use the returned
13309 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13310 Update declarations of local_section_offset and symbol_value.
13311 * testsuite/two_file_test_1.cc (t18): New function.
13312 * testsuite/two_file_test_2.cc (f18): New function.
13313 * testsuite/two_file_test_main.cc (main): Call t18.
13314 * testsuite/two_file_test.h (t18, f18): Declare.
13316 * configure.ac: Don't test for objdump, c++filt, or readelf.
13317 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13319 (TEST_READELF): New variable.
13320 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13321 (check_PROGRAMS): Add two_file_strip_test.
13322 (two_file_strip_test): New target.
13323 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13324 (two_file_same_shared_strip_test_SOURCES): New variable.
13325 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13326 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13327 (two_file_same_shared_strip_test_LDADD): New variable.
13328 (two_file_shared_strip.so): New target.
13329 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13330 (ver_test_5.syms, ver_test_7.syms): Likewise.
13331 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13332 (strip_test_3.stdout): Use TEST_OBJDUMP.
13333 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13335 2008-04-04 Cary Coutant <ccoutant@google.com>
13337 * symtab.h (Symbol::is_weak_undefined): New function.
13338 (Symbol::is_strong_undefined): New function.
13339 (Symbol::is_absolute): New function.
13340 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13341 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13343 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13344 (weak_undef_test): New target.
13345 * testsuite/Makefile.in: Rebuild.
13346 * testsuite/weak_undef_file1.cc: New file.
13347 * testsuite/weak_undef_file2.cc: New file.
13348 * testsuite/weak_undef_test.cc: New file.
13350 2008-04-03 Craig Silverstein <csilvers@google.com>
13352 * compressed_output.h (class Output_compressed_section): Use
13354 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13356 (zlib_compressed_suffix): Removed.
13357 (Output_compressed_section::set_final_data_size): Use unsigned
13359 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13360 Fix linker invocation.
13361 (flagstest_o_specialfile_and_compress_debug_sections):
13363 * testsuite/Makefile.in: Regenerated.
13365 2008-04-02 David S. Miller <davem@davemloft.net>
13367 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13368 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13370 2008-04-02 Craig Silverstein <csilvers@google.com>
13374 2008-04-02 Ian Lance Taylor <iant@google.com>
13376 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13377 parameters. Update for new key type to views_. Change all
13379 (File_read::read): Adjust for byteshift in returned view.
13380 (File_read::add_view): New function, broken out of
13381 find_and_make_view.
13382 (File_read::make_view): New function, broken out of
13383 find_and_make_view.
13384 (File_read::find_or_make_view): Add offset and aligned
13385 parameters. Rewrite accordingly. Change all callers.
13386 (File_read::get_view): Add offset and aligned parameters. Adjust
13387 for byteshift in return value.
13388 (File_read::get_lasting_view): Likewise.
13389 * fileread.h (class File_read): Update declarations.
13390 (class File_read::View): Add byteshift_ field. Add byteshift to
13391 constructor. Add byteshift method.
13392 * archive.h (Archive::clear_uncached_views): New function.
13393 (Archive::get_view): Add aligned parameter. Change all callers.
13394 * object.h (Object::get_view): Add aligned parameter. Change all
13396 (Object::get_lasting_view): Likewise.
13398 * fileread.cc (File_read::release): Don't call clear_views if
13399 there are multiple objects.
13400 * fileread.h (File_read::clear_uncached_views): New function.
13401 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13404 2008-03-31 Cary Coutant <ccoutant@google.com>
13406 Add thin archive support.
13407 * archive.cc (Archive::armagt): New const.
13408 (Archive::setup): Remove task parameter and calls to unlock.
13409 (Archive::unlock_nested_archives): New function.
13410 (Archive::read_header): Add nested_off parameter. Change
13412 (Archive::interpret_header): Likewise.
13413 (Archive::include_all_members): Change to handle thin
13415 (Archive::include_member): Likewise.
13416 * archive.h (Archive::Archive): Add new parameters and
13418 (Archive::armagt): New const.
13419 (Archive::setup): Remove task parameter.
13420 (Archive::unlock_nested_archives): New function.
13421 (Archive::read_header): Add nested_off parameter.
13422 (Archive::interpret_header): Likewise.
13423 (Archive::Nested_archive_table): New typedef.
13424 (Archive::is_thin_archive_): New field.
13425 (Archive::nested_archives_): New field.
13426 (Archive::options_): New field.
13427 (Archive::dirpath_): New field.
13428 (Archive::task_): New field.
13429 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13430 for thin archives. Pass additional parameters to
13431 Archive::Archive. Unlock the archive file after calling
13434 2008-03-29 Ian Lance Taylor <iant@google.com>
13436 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13437 version symbol to be local.
13438 * testsuite/ver_test_4.sh: New file.
13439 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13440 (check_DATA): Add ver_test_4.syms.
13441 (ver_test_4.syms): New target.
13442 * testsuite/Makefile.in: Rebuild.
13445 (Output_section::Input_section_sort_entry::has_priority): New
13447 (Output_section::Input_section_sort_entry::match_file_name): New
13449 (Output_section::Input_section_sort_entry::match_section_name):
13451 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13453 (Output_section::Input_section_sort_entry::match_section_file):
13455 (Output_section::Input_section_sort_compare::operator()): Rewrite
13456 using new Input_section_sort_entry functions. Sort crtbegin and
13457 crtend first. Sort sections with no priority before sections with
13459 * testsuite/initpri1.c (d3): Check j != 4.
13460 (cd5): New constructor/destructor function.
13461 (main): Check j != 2.
13463 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13464 new symbol when resolving, don't call set_is_default.
13465 * testsuite/ver_test_7.cc: New file.
13466 * testsuite/ver_test_7.sh: New file.
13467 * testsuite/Makefile.am (ver_test_7.so): New target.
13468 (ver_test_7.o): New target.
13469 (check_SCRIPTS): Add ver_test_7.sh.
13470 (check_DATA): Add ver_test_7.syms.
13471 (ver_test_7.syms): New target.
13473 2008-03-28 Ian Lance Taylor <iant@google.com>
13475 * layout.cc (Layout::layout): If we see an input section with a
13476 name that needs sorting, set the must_sort flag for the output
13478 (Layout::make_output_section): If the name of the output section
13479 indicates that it might require sorting, set the may_sort flag.
13480 * output.h (Output_section::may_sort_attached_input_sections): New
13482 (Output_section::set_may_sort_attached_input_sections): New
13484 (Output_section::must_sort_attached_input_sections): New
13486 (Output_section::set_must_sort_attached_input_sections): New
13488 (class Output_section): Declare Input_section_sort_entry. Define
13489 Input_section_sort_compare. Declare
13490 sort_attached_input_sections. Add new fields:
13491 may_sort_attached_input_sections_,
13492 must_sort_attached_input_sections_,
13493 attached_input_sections_are_sorted_.
13494 * output.cc (Output_section::Output_section): Initialize new
13496 (Output_section::add_input_section): Add an entry to
13497 input_sections_ if may_sort or must_sort are true.
13498 (Output_section::set_final_data_size): Call
13499 sort_attached_input_sections if necessary.
13500 (Output_section::Input_section_sort_entry): Define new class.
13501 (Output_section::Input_section_sort_compare::operator()): New
13503 (Output_section::sort_attached_input_sections): New function.
13504 * configure.ac: Check whether the compiler supports constructor
13505 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13506 * testsuite/initpri1.c: New file.
13507 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13508 CONSTRUCTOR_PRIORITY.
13509 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13510 (initpri1_LDFLAGS): New variable.
13511 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13513 2008-03-27 Ian Lance Taylor <iant@google.com>
13515 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13516 * testsuite/common_test_1.c: New file.
13517 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13518 (common_test_1_SOURCES): New variable.
13519 (common_test_1_DEPENDENCIES): New variable.
13520 (common_test_1_LDFLAGS): New variable.
13522 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13523 and commons_ correctly when NAME/VERSION does not override
13525 * testsuite/ver_test_6.c: New file.
13526 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13527 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13528 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13530 2008-03-26 Ian Lance Taylor <iant@google.com>
13532 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13533 of an undefined symbol from a version script.
13534 * testsuite/Makefile.am (ver_test_5.so): New target.
13535 (ver_test_5.o): New target.
13536 (check_SCRIPTS): Add ver_test_5.sh.
13537 (check_DATA): Add ver_test_5.syms.
13538 (ver_test_5.syms): New target.
13539 * testsuite/ver_test_5.cc: New file.
13540 * testsuite/ver_test_5.script: New file.
13541 * testsuite/ver_test_5.sh: New file.
13542 * Makefile.in, testsuite/Makefile.in: Rebuild.
13545 Fix problems building gold with gcc 4.3.0.
13546 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13547 (gold_error_at_location, gold_warning_at_location): Use it.
13548 * configure.ac: Check whether we can compile and use a template
13549 function with a printf attribute.
13550 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13551 when jumping over bytes.
13552 * object.cc: Instantiate Object::read_section_data.
13553 * debug.h: Include <cstring>
13554 * dwarf_reader.cc: Include <algorithm>
13555 * main.cc: Include <cstring>.
13556 * options.cc: Include <cstring>.
13557 * output.cc: Include <cstring>.
13558 * script.cc: Include <cstring>.
13559 * script.h: Include <string>.
13560 * symtab.cc: Include <cstring> and <algorithm>.
13561 * target-select.cc: Include <cstring>.
13562 * version.cc: Include <string>.
13563 * testsuite/testmain.cc: Include <cstdlib>.
13564 * configure, config.in: Rebuild.
13566 2008-03-25 Ian Lance Taylor <iant@google.com>
13568 * options.cc: Include "../bfd/bfdver.h".
13569 (options::help): Print bug reporting address.
13571 * version.cc (print_version): Adjust output for current value of
13572 BFD_VERSION_STRING.
13576 * options.cc (options::help): Print list of supported targets.
13577 * target-select.h: Include <vector>.
13578 (class Target_selector): Make machine_, size_, and is_big_endian_
13579 fields const. Add bfd_name_ and instantiated_target_ fields.
13580 (Target_selector::Target_selector): Add bfd_name parameter.
13581 (Target_selector::recognize): Make non-virtual, call
13583 (Target_selector::recognize_by_name): Make non-virtual, call
13584 do_recognize_by_name.
13585 (Target_selector::supported_names): New function.
13586 (Target_selector::bfd_name): New function.
13587 (Target_selector::do_instantiate_target): New pure virtual
13589 (Target_selector::do_recognize): New virtual function.
13590 (Target_selector::do_recognize_by_name): New virtual function.
13591 (Target_selector::instantiate_target): New private function.
13592 (supported_target_names): Declare.
13593 * target-select.cc (Target_selector::Target_selector): Update for
13594 new parameter and fields.
13595 (select_target_by_name): Check that the name matches before
13596 calling recognize_by_name.
13597 (supported_target_names): New function.
13598 * i386.cc (class Target_selector_i386): Update Target_selector
13599 constructor call. Remove recognize and recognize_by_name. Add
13600 do_instantiate_target.
13601 * x86_64.cc (class Target_selector_x86_64): Likewise.
13602 * testsuite/testfile.cc (class Target_selector_test): Update for
13603 changes to Target_selector.
13605 * README: Rewrite, with some notes on unsupported features.
13607 2008-03-24 Cary Coutant <ccoutant@google.com>
13609 * i386.cc (Target_i386::Got_type): New enum declaration.
13610 (Target_i386::Scan::local): Updated callers of Output_data_got
13612 (Target_i386::Scan::global): Likewise.
13613 (Target_i386::Relocate::relocate): Likewise.
13614 (Target_i386::Relocate::relocate_tls): Likewise.
13615 * object.h (Got_offset_list): New class.
13616 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13617 (Sized_relobj::local_got_offset): Likewise.
13618 (Sized_relobj::set_local_got_offset): Likewise.
13619 (Sized_relobj::local_has_tls_got_offset): Removed.
13620 (Sized_relobj::local_tls_got_offset): Removed.
13621 (Sized_relobj::set_local_tls_got_offset): Removed.
13622 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13623 * output.cc (Output_data_got::add_global): Added got_type parameter.
13624 (Output_data_got::add_global_with_rel): Likewise.
13625 (Output_data_got::add_global_with_rela): Likewise.
13626 (Output_data_got::add_global_pair_with_rel): New function.
13627 (Output_data_got::add_global_pair_with_rela): New function.
13628 (Output_data_got::add_local): Added got_type parameter.
13629 (Output_data_got::add_local_with_rel): Likewise.
13630 (Output_data_got::add_local_with_rela): Likewise.
13631 (Output_data_got::add_local_pair_with_rel): New function.
13632 (Output_data_got::add_local_pair_with_rela): New function.
13633 (Output_data_got::add_global_tls): Removed.
13634 (Output_data_got::add_global_tls_with_rel): Removed.
13635 (Output_data_got::add_global_tls_with_rela): Removed.
13636 (Output_data_got::add_local_tls): Removed.
13637 (Output_data_got::add_local_tls_with_rel): Removed.
13638 (Output_data_got::add_local_tls_with_rela): Removed.
13639 * output.h (Output_data_got::add_global): Added got_type parameter.
13640 (Output_data_got::add_global_with_rel): Likewise.
13641 (Output_data_got::add_global_with_rela): Likewise.
13642 (Output_data_got::add_global_pair_with_rel): New function.
13643 (Output_data_got::add_global_pair_with_rela): New function.
13644 (Output_data_got::add_local): Added got_type parameter.
13645 (Output_data_got::add_local_with_rel): Likewise.
13646 (Output_data_got::add_local_with_rela): Likewise.
13647 (Output_data_got::add_local_pair_with_rel): New function.
13648 (Output_data_got::add_local_pair_with_rela): New function.
13649 (Output_data_got::add_global_tls): Removed.
13650 (Output_data_got::add_global_tls_with_rel): Removed.
13651 (Output_data_got::add_global_tls_with_rela): Removed.
13652 (Output_data_got::add_local_tls): Removed.
13653 (Output_data_got::add_local_tls_with_rel): Removed.
13654 (Output_data_got::add_local_tls_with_rela): Removed.
13655 * resolve.cc (Symbol::override_base_with_special): Removed
13656 reference to has_got_offset_ field.
13657 * symtab.cc (Symbol::init_fields): Replaced initialization
13658 of got_offset_ with got_offsets_. Removed initialization
13660 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13661 (Symbol::got_offset): Likewise.
13662 (Symbol::set_got_offset): Likewise.
13663 (Symbol::has_tls_got_offset): Removed.
13664 (Symbol::tls_got_offset): Removed.
13665 (Symbol::set_tls_got_offset): Removed.
13666 (Symbol::got_offset_): Removed.
13667 (Symbol::tls_mod_got_offset_): Removed.
13668 (Symbol::tls_pair_got_offset_): Removed.
13669 (Symbol::got_offsets_): New field.
13670 (Symbol::has_got_offset): Removed.
13671 (Symbol::has_tls_mod_got_offset): Removed.
13672 (Symbol::has_tls_pair_got_offset): Removed.
13673 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13674 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13676 (Target_x86_64::Scan::global): Likewise.
13677 (Target_x86_64::Relocate::relocate): Likewise.
13678 (Target_x86_64::Relocate::relocate_tls): Likewise.
13680 2008-03-25 Ben Elliston <bje@au.ibm.com>
13682 * yyscript.y: Fix spelling error in comment.
13684 2008-03-24 Ian Lance Taylor <iant@google.com>
13686 * options.h (class General_options): Define build_id option.
13687 * layout.h (class Layout): Declare write_build_id, create_note,
13688 create_build_id. Add build_id_note_ member.
13689 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13690 "libiberty.h", "md5.h", "sha1.h".
13691 (Layout::Layout): Initialize eh_frame_data_,
13692 eh_frame_hdr_section_, and build_id_note_.
13693 (Layout::finalize): Call create_build_id.
13694 (Layout::create_note): New function, broken out of
13695 Layout::create_gold_note.
13696 (Layout::create_gold_note): Call create_note.
13697 (Layout::create_build_id): New function.
13698 (Layout::write_build_id): New function.
13699 (Close_task_runner::run): Call write_build_id.
13701 * x86_64.cc: Correct license to GPLv3.
13703 2008-03-23 Ian Lance Taylor <iant@google.com>
13705 * options.cc: Include "demangle.h".
13706 (parse_optional_string): New function.
13707 (parse_long_option): Handle takes_optional_argument.
13708 (parse_short_option): Update dash_z initializer. Handle
13709 takes_optional_argument.
13710 (General_options::General_options): Initialize do_demangle_.
13711 (General_options::finalize): Set do_demangle_. Handle demangling
13713 * options.h (parse_optional_string): Declare.
13714 (struct One_option): Add optional_arg field. Update constructor.
13715 Update call constructor calls. Add takes_optional_argument
13717 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13718 (DEFINE_optional_string): Define.
13719 (General_options::demangle): Change from DEFINE_bool to
13720 DEFINE_optional_string.
13721 (General_options::no_demangle): New function.
13722 (General_options::do_demangle): New function.
13723 (General_options::set_do_demangle): New function.
13724 (General_options::execstack_status_): Move definition to end of
13726 (General_options::static_): Likewise.
13727 (General_options::do_demangle_): New field.
13728 * object.cc (big_endian>::get_symbol_location_info): Call
13729 Options::do_demangle, not Options::demangle.
13730 * symtab.cc (demangle): Likewise.
13732 2008-03-22 Ian Lance Taylor <iant@google.com>
13734 * gold.h: Include <cstddef> and <sys/types.h>
13735 * options.h: Include <cstring>.
13737 2008-03-21 Ian Lance Taylor <iant@google.com>
13739 * Added source code to GNU binutils.