1 2012-09-11 Alan Modra <amodra@gmail.com>
4 * layout.cc (Layout::set_segment_offsets): When using
5 common-page-size alignment, ensure we are on a new max-page-size
7 * output.cc (Output_segment::set_section_addresses): Use
8 abi_pagesize, not common_pagesize for relro boundary.
9 (Output_segment::set_offset): Likewise.
11 2012-09-11 Alan Modra <amodra@gmail.com>
13 * output.h (Output_data_got::add_global_tls, add_local_tls,
14 add_local_tls_pair): New functions.
15 (Output_data_got::add_local_pair_with_rel): Remove second
16 reloc param. Expand comment.
17 (Output_data_got::Got_entry): Rename use_plt_offset_ to
18 use_plt_or_tls_offset_, similarly for constructor param.
19 (Output_data_got::Got_entry::write): Add got_index param.
20 * output.cc (Output_data_got::add_global_tls, add_local_tls,
21 add_local_tls_pair): New functions.
22 (Output_data_got::Got_entry::write): Handle tls symbols
23 with use_plt_or_tls_offset_ set specially.
24 (Output_data_got::add_local_pair_with_rel): Only one reloc.
25 (Output_data_got::do_write): Replace iterator with index, pass
26 index to entry write function.
27 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
28 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
29 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
31 * i386.cc (Target_i386::Scan::local): Likewise.
32 * sparc.cc (Target_sparc::Scan::local): Likewise.
33 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
34 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
35 do_tls_offset_for_global): New functions.
36 (Target_powerpc::Scan::local): Correct TLS relocations and got
38 (Target_powerpc::Scan::global): Don't emit unnecessary
39 dynamic relocations on TLS GOT entries.
41 2012-09-10 Matthias Klose <doko@ubuntu.com>
43 * config.in: Disable sanity check for kfreebsd.
45 2012-09-10 Sterling Augustine <saugustine@google.com>
47 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
48 (Gdb_index::pubtypes_read): New parameter.
49 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
51 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
54 2012-09-09 Alan Modra <amodra@gmail.com>
56 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
57 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
58 * gc.h (gc_process_relocs): Call target gc_add_reference.
59 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
60 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
61 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
63 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
64 to cater for when we don't need code offset. Update use.
65 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
66 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
67 set_opd_valid): New functions.
68 (Target_powerpc::do_gc_add_reference): New function.
69 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
71 (Target_powerpc::do_gc_mark_symbol): New function.
73 2012-09-06 Cary Coutant <ccoutant@google.com>
75 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
76 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
77 (Dwarf_die::skip_attributes): Likewise.
78 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
79 * testsuite/gdb_index_test.cc (inline_func_1): New function.
81 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
83 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
85 * testsuite/script_test_3.t: Add .got.plt output section
87 * testsuite/script_test_4.t: Likewise.
89 2012-09-05 Alan Modra <amodra@gmail.com>
91 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
92 update all uses and lose "enum" when using type.
94 2012-09-05 Alan Modra <amodra@gmail.com>
96 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
97 * configure: Regenerate.
98 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
99 (plugin_final_layout.stdout): Likewise.
100 (memory_test): Set page sizes to 0x1000.
101 * testsuite/Makefile.in: Regenerate.
102 * testsuite/discard_locals_test.sh: Add FIXME comment.
103 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
104 * testsuite/pr14265.t: Add .got output section statement.
105 * testsuite/script_test_2.t: Likewise.
106 * testsuite/script_test_3.t: Likewise.
107 * testsuite/script_test_4.t: Likewise.
108 * testsuite/script_test_5.t: Likewise.
109 * testsuite/script_test_6.t: Likewise.
110 * testsuite/script_test_7.t: Likewise.
111 * testsuite/script_test_9.t: Likewise.
113 2012-09-05 Alan Modra <amodra@gmail.com>
115 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
116 (Powerpc_relocate_functions::Status): New typedef.
117 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
118 (Target_powerpc::Scan::local): Handle REL64.
119 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
121 (Target_powerpc::symval_for_branch): New function, extracted from..
122 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
123 checks. Report overflow errors.
125 2012-09-05 Alan Modra <amodra@gmail.com>
127 * object.h (Sized_relobj_file::emit_relocs): Delete.
128 (Sized_relobj_file::emit_relocs_reltype): Delete.
129 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
130 relocate_relocs for --emit-relocs.
131 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
132 * output.h: Update comment.
133 (Output_segment::first_section): New function.
134 (Output_segment::first_section_load_address): Use first_section.
135 * output.cc (Output_segment::first_section): New function extracted..
136 (Output_segment::first_section_load_address): ..from here. Delete.
137 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
138 * target.h (Sized_target::relocate_for_relocatable): Likewise.
139 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
140 adjust call to target.h function.
141 * i386.cc (Target_i386): Likewise.
142 * sparc.cc (Target_sparc): Likewise.
143 * x86_64.cc (Target_x86_64): Likewise.
144 * powerpc.cc (Target_powerpc): Likewise.
145 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
146 first tls section has section symbol for optimised local dynamic
148 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
149 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
151 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
152 Rename to relocate_relocs. Update error message.
154 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
156 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
159 2012-08-31 Alan Modra <amodra@gmail.com>
161 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
162 (Powerpc_relobj::toc_base_offset): New stub function.
163 (Target_powerpc): Add tp_offset, dtp_offset. Rename
164 got_mod_index_offset to tlsld_got_offset. Update all refs.
165 (Target_powerpc::Relocate::enum skip_tls): New.
166 (Target_powerpc::call_tls_get_addr_): New var.
167 (Target_powerpc::is_branch_reloc): Move to file scope.
168 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
169 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
171 (Target_powerpc::enum Got_type): Delete old values, add new ones.
172 (powerpc_info): Correct common_pagesize for ppc64.
173 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
174 (Powerpc_relocate_functions): Add overflow check enums and functions.
175 Add non-shift version of rela, rela_ua. Delete all rel public
176 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
177 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
178 addr16_ha3, addr14 functions.
179 (Output_data_got_powerpc::add_constant_pair): New function.
180 (Output_data_got_powerpc::got_base_offset): Likewise.
181 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
182 (instruction constants): Sort, add some more.
183 (Output_data_glink::do_write): Add and use Address typedef. Use
184 object->toc_base_offset() stub for 64-bit.
185 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
186 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
187 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
188 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
189 Always treat .opd relocs as against locally defined symbol.
190 Correct condition for RELATIVE relocs.
191 (Target_powerpc::do_finalize_sections): Test for NULL sections.
192 (Target_powerpc::Relocate::relocate): Use plt call stub as value
193 for 32-bit syms with a plt entry. Correct ppc64 toc base
194 calculations. Handle TLS relocs, and more. Add overflow
195 checking and adjust for Powerpc_relocate_functions changes.
196 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
197 Reinstate --emit-relocs code with FIXME.
199 2012-08-30 Alan Modra <amodra@gmail.com>
201 * layout.cc (Layout::set_segment_offsets): Set p_align to
202 abi_pagesize, not common_pagesize.
203 (Layout::relaxation_loop_body): Similarly use abi_pagesize
204 to determine whether file header can go in segment.
206 2012-08-30 Alan Modra <amodra@gmail.com>
208 * output.h (Output_reloc::Output_reloc <output section>): Add
209 is_relative param. Adjust calls.
210 (Output_reloc::add_output_section_relative): New functions.
211 * output.cc (Output_reloc::Output_reloc <output section>): Handle
213 (Output_reloc::symbol_value): Handle SECTION_CODE.
215 2012-08-24 Sriraman Tallam <tmsriram@google.com>
217 * gold.cc (queue_middle_tasks): Call layout again when unique
218 segments for sections is desired.
219 * layout.cc (Layout::Layout): Initialize new members.
220 (Layout::get_output_section_flags): New function.
221 (Layout::choose_output_section): Call get_output_section_flags.
222 (Layout::layout): Make output section for mapping to a unique segment.
223 (Layout::insert_section_segment_map): New function.
224 (Layout::attach_allocated_section_to_segment): Make unique segment for
225 output sections marked so.
226 (Layout::segment_precedes): Check for unique segments when sorting.
227 * layout.h (Layout::Unique_segment_info): New struct.
228 (Layout::Section_segment_map): New typedef.
229 (Layout::insert_section_segment_map): New function.
230 (Layout::get_output_section_flags): New function.
231 (Layout::is_unique_segment_for_sections_specified): New function.
232 (Layout::set_unique_segment_for_sections_specified): New function.
233 (Layout::unique_segment_for_sections_specified_): New member.
234 (Layout::section_segment_map_): New member.
235 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
236 Rename is_gc_pass_one to is_pass_one.
237 Rename is_gc_pass_two to is_pass_two.
238 Rename is_gc_or_icf to is_two_pass.
239 Check for which pass based on whether symbols data is present.
240 Make it two pass when unique segments for sections is desired.
241 * output.cc (Output_section::Output_section): Initialize new
243 * output.h (Output_section::is_unique_segment): New function.
244 (Output_section::set_is_unique_segment): New function.
245 (Output_section::is_unique_segment_): New member.
246 (Output_section::extra_segment_flags): New function.
247 (Output_section::set_extra_segment_flags): New function.
248 (Output_section::extra_segment_flags_): New member.
249 (Output_section::segment_alignment): New function.
250 (Output_section::set_segment_alignment): New function.
251 (Output_section::segment_alignment_): New member.
252 (Output_segment::Output_segment): Initialize is_unique_segment_.
253 (Output_segment::is_unique_segment): New function.
254 (Output_segment::set_is_unique_segment): New function.
255 (Output_segment::is_unique_segment_): New member.
256 * plugin.cc (allow_unique_segment_for_sections): New function.
257 (unique_segment_for_sections): New function.
258 (Plugin::load): Add new functions to transfer vector.
259 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
260 * Makefile.in: Regenerate.
261 * testsuite/plugin_final_layout.sh: Check if unique segment
263 * testsuite/plugin_section_order.c (onload): Check if new interfaces
265 (allow_unique_segment_for_sections): New global.
266 (unique_segment_for_sections): New global.
267 (claim_file_hook): Call allow_unique_segment_for_sections.
268 (all_symbols_read_hook): Call unique_segment_for_sections.
270 2012-08-22 Cary Coutant <ccoutant@google.com>
272 * layout.cc (Layout::include_section): Don't assert on GROUP
273 sections with --emit-relocs.
275 2012-08-21 Cary Coutant <ccoutant@google.com>
277 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
278 if --export-dynamic-symbol names an undef symbol.
280 2012-08-18 Alan Modra <amodra@gmail.com>
282 * powerpc.cc: Formatting and white space.
283 (Powerpc_relobj): Rename got2_section_ to special_.
284 Add opd_ent_shndx_ and opd_ent_off_ vectors.
285 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
286 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
287 (Target_powerpc): Add Address typedef and invalid_address. Use
289 (Target_powerpc::is_branch_reloc): New function.
290 (Powerpc_relocate_functions): Add Address typedef, use throughout.
291 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
292 for dst_mask, value and addend.
293 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
294 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
295 (Output_data_glink::do_write): Correct toc base. Don't try to use
296 uint16_t for 24-bit offset. Use get_output_section_offset and
298 (Target_powerpc::Scan::local): Handle more relocs.
299 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
300 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
301 Plug in toc restoring insn after plt calls. Translate branches
302 to function descriptor symbols to corresponding entry point.
303 (Target_powerpc::relocate_for_relocatable): Check return from
304 get_output_section_offset.
305 * symtab.h: Comment typo.
307 2012-08-14 Ian Lance Taylor <iant@google.com>
309 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
310 unsupported_relocal_local to call unsupported_reloc_global.
312 2012-08-14 Nick Clifton <nickc@redhat.com>
315 * script-sections.cc (Sections_element::output_section_name): Add
316 keep return parameter.
317 (Output_section_element::match_name): Add keep return parameter.
318 Return the value of the keep_ member.
319 * script-sections.h (class Output_section): Update
320 output_section_name prototype.
321 * layout.cc (Layout::keep_input_section): New public member
323 (Layout::choose_output_section): Pass keep parameter to
325 * layout.h (class Layout): Add keep_input_section.
326 * object.cc (Sized_relobj_file::do_layout): Check for kept input
328 * testsuite/Makefile.am: Add a test.
329 * testsuite/Makefile.in: Regenerate.
330 * testsuite/pr14265.c: Source file for the test.
331 * testsuite/pr14265.t: Linker script for the test.
332 * testsuite/pr14265.sh: Shell script for the test.
334 2012-08-14 Alan Modra <amodra@gmail.com>
336 * target.h (Target::output_section_name): New function.
337 (Target::do_output_section_name): New function.
338 * layout.cc (Layout::choose_output_section): Call the above.
339 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
341 2012-08-14 Alan Modra <amodra@gmail.com>
343 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
344 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
345 for replace_constant call.
346 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
347 (Output_data_glink::do_print_to_mapfile): New function.
348 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
349 (Target_powerpc::Relocate::relocate): Likewise.
351 2012-08-14 Alan Modra <amodra@gmail.com>
353 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
354 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
355 (Output_data_glink::add_entry,find_entry): Remove shndx param.
356 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
357 all references to shndx_. Handle special case for R_PPC_PLTREL24
359 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
360 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
361 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
363 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
364 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
366 2012-08-12 Alan Modra <amodra@gmail.com>
368 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
369 (glink insn constants): Use uint32_t.
370 (Output_data_glink::add_entry): Use insert, not [] operator.
372 2012-08-11 Alan Modra <amodra@gmail.com>
374 * object.h (Sized_relobj_file::find_shdr): New function.
375 (Sized_relobj_file::find_special_sections): New function.
376 * object.cc (Sized_relobj_file::find_shdr): New function.
377 (Sized_relobj_file::find_eh_frame): Use find_shdr.
378 (Sized_relobj_file::find_special_sections): New function, split out..
379 (Sized_relobj_file::do_read_symbols): ..from here.
380 * output.h (Output_data_got::replace_constant): New function.
381 (Output_data_got::num_entries): New function.
382 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
383 (Output_data_got::got_offset): Protected rather than private.
384 (Output_data_got::replace_got_entry): New function.
385 * output.cc (Output_data_got::replace_got_entry): New function.
386 * powerpc.cc (class Powerpc_relobj): New.
387 (class Powerpc_relocate_functions): Delete all psymval variants or
388 convert to value,addend type. Delete pcrela, pcrela_unaligned.
389 Implement _ha functions using corresponding _hi function.
390 (Powerpc_relobj::find_special_sections): New function.
391 (Target_powerpc::do_make_elf_object): New function.
392 (class Output_data_got_powerpc): New.
393 (class Output_data_glink): New.
394 (class Powerpc_scan_relocatable_reloc): New.
395 Many more changes througout file.
397 2012-08-09 Nick Clifton <nickc@redhat.com>
399 * po/vi.po: Updated Vietnamese translation.
401 2012-08-07 Ian Lance Taylor <iant@google.com>
403 * layout.cc (Layout::add_target_dynamic_tags): If
404 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
407 2012-07-30 Nick Clifton <nickc@redhat.com>
409 * po/gold.pot: Updated template.
410 * po/es.po: Updated Spanish translation.
412 2012-07-18 Cary Coutant <ccoutant@google.com>
415 * configure.ac: Add check for -gpubnames support.
416 * configure: Regenerate.
417 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
418 support; force -gno-pubnames.
419 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
421 (gdb_index_test_4): New test.
422 * testsuite/Makefile.in: Regenerate.
423 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
424 * testsuite/gdb_index_test_2.sh: Likewise.
425 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
426 * testsuite/gdb_index_test_4.sh: New script.
427 * testsuite/gdb_index_test_comm.sh: New script with common code;
428 don't look for space after colon.
430 2012-07-16 Sriraman Tallam <tmsriram@google.com>
432 * gold.cc (queue_middle_tasks): Update function order only after
433 deferred objects due to plugins are processed.
435 2012-07-11 Ian Lance Taylor <iant@google.com>
437 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
438 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
439 (Target_arm::scan_reloc_for_stub): Likewise.
440 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
441 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
442 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
443 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
444 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
446 2012-07-10 Dodji Seketeli <dodji@redhat.com>
447 Ian Lance Taylor <iant@google.com>
450 * configure.ac: Test whether std::tr1::hash<off_t> works.
451 * gold.h: Add a specialization for std::tr1::hash<off_t> if
453 * output.h (class Output_fill): Add virtual destructor.
454 * configure, config.in: Rebuild.
456 2012-06-22 Roland McGrath <mcgrathr@google.com>
458 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
460 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
462 * plugin.cc (Plugin::load): Handle position independent executables.
464 2012-06-06 Cary Coutant <ccoutant@google.com>
466 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
468 (lines_only_debug_sections): Likewise.
469 (gdb_fast_lookup_sections): New static array.
470 (is_gdb_debug_section): Rename formal parameter.
471 (is_lines_only_debug_section): Likewise.
472 (is_gdb_fast_lookup_section): New function.
473 (Layout::include_section): Check for ".zdebug_" prefix; pass
474 section name suffix to is_gdb_debug_section, et al.; check for
475 fast-lookup sections when building .gdb_index.
476 * options.h (--strip-debug-gdb): Update GDB version number.
478 2012-06-06 Cary Coutant <ccoutant@google.com>
480 * configure.ac: Add check for fallocate.
481 * configure: Regenerate.
482 * config.in: Regenerate.
484 * options.h (class General_options): Add --mmap-output-file and
485 --posix-fallocate options.
486 * output.cc: (posix_fallocate): Remove; replace with...
487 (gold_fallocate): New function.
488 (Output_file::map_no_anonymous): Call gold_fallocate.
489 (Output_file::map): Check --mmap-output-file option.
491 2012-06-05 Jing Yu <jingyu@google.com>
493 * gold.h (textdomain): Add do {} to empty while(0).
494 (bindtextdomain): Likewise.
496 2012-06-04 Cary Coutant <ccoutant@google.com>
498 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
501 2012-05-25 Sriraman Tallam <tmsriram@google.com>
503 * symtab.cc (Symbol_table::define_special_symbol):
504 Initialize *poldsym to prevent uninitialized variable errors.
506 2012-05-23 Cary Coutant <ccoutant@google.com>
508 * layout.cc (Layout::section_name_mapping): Add rules to handle
509 exact match on .data.rel.ro.local or .data.rel.ro.
510 (Layout::output_section_name): Check for exact matches.
512 2012-05-23 Cary Coutant <ccoutant@google.com>
514 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
517 2012-05-22 Cary Coutant <ccoutant@google.com>
519 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
520 object before exporting symbol.
522 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
524 * testsuite/tls_test.cc: Include "config.h" first.
525 * testsuite/tls_test_c.c: Likewise.
527 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
528 Nick Clifton <nickc@redhat.com>
531 * configure.in: Add check that sysdep.h has been included before
532 any system header files.
533 * configure: Regenerate.
534 * config.in: Regenerate.
536 2012-05-14 Cary Coutant <ccoutant@google.com>
538 * layout.cc (Layout::make_output_section): Mark .tdata section
540 * testsuite/relro_test.cc: Add a TLS variable.
542 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
545 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
546 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
549 2012-05-08 Cary Coutant <ccoutant@google.com>
551 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
552 (lines_only_debug_sections): Likewise.
554 2012-05-02 Roland McGrath <mcgrathr@google.com>
558 * Makefile.am (CCFILES, HFILES): Add them.
559 * Makefile.in: Regenerate.
560 * i386.cc (Output_data_plt_i386_nacl): New class.
561 (Output_data_plt_i386_nacl_exec): New class.
562 (Output_data_plt_i386_nacl_dyn): New class.
563 (Target_i386_nacl): New class.
564 (Target_selector_i386_nacl): New class.
565 (target_selector_i386): Use it instead of Target_selector_i386.
566 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
567 (Target_x86_64_nacl): New class.
568 (Target_selector_x86_64_nacl): New class.
569 (target_selector_x86_64, target_selector_x32): Use it instead of
570 Target_selector_x86_64.
571 * arm.cc (Output_data_plt_arm_nacl): New class.
572 (Target_arm_nacl): New class.
573 (Target_selector_arm_nacl): New class.
574 (target_selector_arm, target_selector_armbe): Use it instead of
577 * target-select.cc (select_target): Take new Input_file* and off_t
578 arguments, pass them on to recognize method of selector.
579 * object.cc (make_elf_sized_object): Update caller.
580 * parameters.cc (parameters_force_valid_target): Likewise.
581 * incremental.cc (make_sized_incremental_binary): Likewise.
582 * target-select.h: Update decl.
583 (Target_selector::recognize): Take new Input_file* argument,
584 pass it on to do_recognize.
585 (Target_selector::do_recognize): Take new Input_file* argument.
586 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
587 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
588 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
589 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
591 * target.h (Target::Target_info): New members isolate_execinstr
593 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
594 * arm.cc (Target_arm::arm_info): Update initializer.
595 * i386.cc (Target_i386::i386_info): Likewise.
596 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
597 * sparc.cc (Target_sparc::sparc_info): Likewise.
598 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
599 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
600 * layout.cc (Layout::attach_allocated_section_to_segment):
601 Take new const Target* argument. If target->isolate_execinstr(), act
603 (Layout::find_first_load_seg): Take new const Target* argument;
604 if target->isolate_execinstr(), reject PF_X segments.
605 (Layout::relaxation_loop_body): Update caller.
606 (Layout::set_segment_offsets): If target->isolate_execinstr(),
607 reset file offset to zero when we hit LOAD_SEG, and then do a second
608 loop over the segments before LOAD_SEG to reassign offsets after
609 addresses have been determined. Handle target->rosegment_gap().
610 (Layout::attach_section_to_segment): Take new const Target* argument;
611 pass it to attach_allocated_section_to_segment.
612 (Layout::make_output_section): Update caller.
613 (Layout::attach_sections_to_segments): Take new const Target* argument;
614 pass it to attach_section_to_segment.
615 * gold.cc (queue_middle_tasks): Update caller.
616 * layout.h (Layout): Update method decls with new arguments.
618 * arm.cc (Target_arm::Target_arm): Take optional argument for the
619 Target_info pointer to use.
620 (Target_arm::do_make_data_plt): New virtual method.
621 (Target_arm::make_data_plt): New method that calls it.
622 (Target_arm::make_plt_entry): Use it.
623 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
624 for the section alignment.
625 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
627 (Output_data_plt_arm::first_plt_entry_offset): Call it.
628 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
630 (Output_data_plt_arm::get_plt_entry_size): Call it.
631 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
632 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
633 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
635 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
636 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
637 method instead of sizeof(plt_entry).
638 (Output_data_plt_arm::add_entry): Likewise.
639 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
640 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
642 (Target_arm::plt_entry_size): Likewise.
643 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
645 (Output_data_plt_arm_standard): ... here, new class.
646 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
647 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
648 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
650 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
651 Take additional argument for the PLT entry size.
652 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
653 Use get_plt_entry_size method rather than plt_entry_size variable.
654 (Output_data_plt_x86_64::reserve_slot): Likewise.
655 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
656 (Output_data_plt_x86_64::add_entry): Likewise.
657 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
658 (Output_data_plt_x86_64::address_for_global): Likewise.
659 (Output_data_plt_x86_64::address_for_local): Likewise.
660 (Output_data_plt_x86_64::set_final_data_size): Likewise.
661 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
662 Make method non-static.
663 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
665 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
666 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
667 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
668 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
670 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
671 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
673 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
674 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
676 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
677 (Output_data_plt_x86_64::plt_entry_size)
678 (Output_data_plt_x86_64::first_plt_entry)
679 (Output_data_plt_x86_64::plt_entry)
680 (Output_data_plt_x86_64::tlsdesc_plt_entry)
681 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
682 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
683 (Output_data_plt_x86_64_standard): ... here, new class.
684 (Target_x86_64::Target_x86_64): Take optional argument for the
685 Target_info pointer to use.
686 (Target_x86_64::do_make_data_plt): New virtual method.
687 (Target_x86_64::make_data_plt): New method to call it.
688 (Target_x86_64::init_got_plt_for_update): Use that.
689 Call this->plt_->add_eh_frame method here.
690 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
691 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
692 rather than static method.
693 (Target_x86_64::plt_entry_size): Likewise.
694 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
695 rather than plt_entry_size variable. Move guts of PLT filling to...
696 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
697 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
698 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
700 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
701 additional argument for the section alignment.
702 Don't do add_eh_frame_for_plt here.
703 (Output_data_plt_i386::first_plt_entry_offset): Make the method
704 non-static. Use get_plt_entry_size method rather than plt_entry_size
706 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
708 (Output_data_plt_i386::get_plt_entry_size): Call it.
709 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
710 (Output_data_plt_i386::add_eh_frame): New method to call it.
711 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
713 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
714 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
716 (Output_data_plt_i386::fill_plt_entry): New method to call it.
717 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
718 method instead of plt_entry_size.
719 (Output_data_plt_i386::plt_entry_size)
720 (Output_data_plt_i386::plt_eh_frame_fde_size)
721 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
722 (Output_data_plt_i386_standard): ... here, new class.
723 (Output_data_plt_i386_exec): New class.
724 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
725 (Output_data_plt_i386_exec::first_plt_entry): ... here.
726 (Output_data_plt_i386::exec_plt_entry): Move to ...
727 (Output_data_plt_i386_exec::plt_entry): ... here.
728 (Output_data_plt_i386_dyn): New class.
729 (Output_data_plt_i386::first_plt_entry): Move to ...
730 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
731 (Output_data_plt_i386::dyn_plt_entry): Move to ...
732 (Output_data_plt_i386_dyn::plt_entry): ... here.
733 (Target_i386::Target_i386): Take optional argument for the Target_info
735 (Target_i386::do_make_data_plt): New virtual method.
736 (Target_i386::make_data_plt): New method to call it.
737 (Target_i386::make_plt_section): Use that.
738 Call this->plt_->add_eh_frame method here.
739 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
740 rather than plt_entry_size variable.
741 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
742 (Output_data_plt_i386::address_for_local): Likewise.
743 (Output_data_plt_i386::do_write): Likewise.
744 Move guts of PLT filling to...
745 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
746 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
747 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
748 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
750 2012-05-01 Cary Coutant <ccoutant@google.com>
752 * dwarf_reader.cc (Dwarf_die::read_attributes)
753 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
754 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
755 * reduced_debug_output.cc
756 (Output_reduced_debug_info_section::get_die_end): Remove
757 DW_FORM_GNU_ref_index. Add default case.
759 2012-04-26 Mark Wielaard <mjw@redhat.com>
761 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
762 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
763 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
764 DW_AT_high_pc as offset from DW_AT_low_pc.
766 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
767 * testsuite/Makefile.in: Regenerate.
768 * testsuite/gdb_index_test_3.c: New test source file.
769 * testsuite/gdb_index_test_3.sh: New test source file.
771 2012-04-25 Ian Lance Taylor <iant@google.com>
773 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
775 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
776 as a class, not a struct.
777 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
778 (Target_arm::apply_cortex_a8_workaround): Likewise.
779 * gc.h: Declare Reloc_types as a struct, not a class.
780 * object.h: Declare Symbols_data as a struct.
781 * reloc.h: Declare Read_relocs_data as a struct.
782 * target.h: Declare Relocate_info as a struct.
784 2012-04-24 David S. Miller <davem@davemloft.net>
786 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
787 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
790 2012-04-24 Cary Coutant <ccoutant@google.com>
792 * incremental-dump.cc (find_input_containing_global): Replace
793 magic number with symbolic constant.
794 (dump_incremental_inputs): Update version number.
795 * incremental.cc (Output_section_incremental_inputs): Update version
796 number; import symbolic constants from Incremental_inputs_reader.
797 (Incremental_inputs::create_data_sections): Align relocations
798 section correctly for 64-bit targets.
799 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
800 constants; add padding.
801 (Output_section_incremental_inputs::write_header): Add assert for
803 (Output_section_incremental_inputs::write_input_files): Add assert
804 for input_entry_size.
805 (Output_section_incremental_inputs::write_info_blocks): Add padding;
806 add assert for object_info_size, input_section_entry_size,
807 global_sym_entry_size.
808 * incremental.h (Incremental_inputs_reader): Add symbolic constants
809 for data structure sizes; use them.
810 (Incremental_input_entry_reader): Import symbolic constants from
811 Incremental_inputs_reader; use them.
813 2012-04-23 David S. Miller <davem@davemloft.net>
815 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
817 (Target_sparc::Target_sparc): Initialize new fields.
818 (Target_sparc::do_make_elf_object): New function.
819 (Target_sparc::do_adjust_elf_header): New function.
821 2012-04-23 Cary Coutant <ccoutant@google.com>
823 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
824 CU range table of gdb index.
826 2012-04-20 David S. Miller <davem@davemloft.net>
828 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
831 2012-04-16 David S. Miller <davem@davemloft.net>
833 * sparc.cc (Target_sparc::got_address): New function.
834 (Sparc_relocate_functions::gdop_hix22): New function.
835 (Sparc_relocate_functions::gdop_lox10): New function.
836 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
838 (Target_sparc::Scan::local): Likewise if the global symbol is not
839 preemptible and is not IFUNC.
840 (Target_sparc::Relocate::relocate): Perform GOTDATA code
841 transformations for local and non-preemptible non-IFUNC global
844 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
845 writing out 64-bit part of ranges.
847 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
848 -fpic and -fpie respectively.
849 * Makefile.in: Regenerate.
851 * sparc.cc (class Target_sparc): Add rela_ifunc_.
852 (Target_sparc::Target_sparc): Initialize new field.
853 (Target_sparc::do_plt_section_for_global): New function.
854 (Target_sparc::do_plt_section_for_local): New function.
855 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
856 (Target_sparc::make_plt_section): New function, broken out of
857 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
858 (Target_sparc::make_plt_entry): Call make_plt_section.
859 (Target_sparc::make_local_ifunc_plt_entry): New function.
860 (Target_sparc::rela_ifunc_section): New function.
861 (Target_sparc::plt_section): Remove const.
862 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
863 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
864 and ifunc_count_ fields.
865 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
866 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
867 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
868 (Output_data_plt_sparc::rela_ifunc): New function.
869 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
870 (Output_data_plt_sparc::has_ifunc_section): New function.
871 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
872 (Output_data_plt_sparc::address_for_global): New function.
873 (Output_data_plt_sparc::address_for_local): New function.
874 (Output_data_plt_sparc::plt_index_to_offset): New function.
875 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
877 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
879 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
880 R_SPARC_JMP_IREL to switch.
881 (Target_sparc::Scan::check_non_pic): Likewise.
882 (Target_sparc::Scan::local): Handle IFUNC symbols.
883 (Target_sparc::Scan::local): Likewise.
884 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
885 and plt_address_for_local.
886 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
887 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
889 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
890 (class Output_data_reloc): Adjust calls to Output_reloc_type.
891 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
892 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
894 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
895 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
897 * sparc.cc (Target_sparc::Scan::global): Likewise.
898 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
900 2012-04-16 Cary Coutant <ccoutant@google.com>
902 * archive.cc (Library_base::should_include_member): Check for
903 --export-dynamic-symbol.
904 * options.h (class General_options): Add --export-dynamic-symbol.
905 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
906 --export-dynamic-symbol.
907 (Symbol_table::gc_mark_undef_symbols): Likewise.
908 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
910 2012-04-12 David S. Miller <davem@davemloft.net>
912 * sparc.cc (Reloc::wdisp10): New relocation method.
913 (Reloc::h34): Likewise.
914 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
915 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
917 (Target_sparc::Scan::local): Likewise.
918 (Target_sparc::Scan::global): Likewise.
919 (Target_sparc::Relocate::relocate): Likewise.
921 2012-04-09 Cary Coutant <ccoutant@google.com>
923 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
926 2012-04-06 Ian Lance Taylor <iant@google.com>
928 * timer.cc: #include <unistd.h>.
930 2012-04-06 Roland McGrath <mcgrathr@google.com>
932 * configure.in (AC_CHECK_HEADERS): Add locale.h.
933 * config.in: Regenerate.
934 * configure: Regenerate.
936 2012-04-05 Nick Clifton <nickc@redhat.com>
938 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
939 (AM_LC_MESSAGES): Add.
940 * aclocal.m4: Regenerate.
941 * config.in: Regenerate.
942 * configure: Regenerate.
944 2012-03-21 Cary Coutant <ccoutant@google.com>
946 * Makefile.am: Add gdb-index.cc, gdb-index.h.
947 * Makefile.in: Regenerate.
948 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
949 (Sized_elf_reloc_mapper::symbol_section): New function.
950 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
951 (make_elf_reloc_mapper): New function.
952 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
953 (Dwarf_abbrev_table::do_read_abbrevs): New function.
954 (Dwarf_abbrev_table::do_get_abbrev): New function.
955 (Dwarf_ranges_table::read_ranges_table): New function.
956 (Dwarf_ranges_table::read_range_list): New function.
957 (Dwarf_pubnames_table::read_section): New function.
958 (Dwarf_pubnames_table::read_header): New function.
959 (Dwarf_pubnames_table::next_name): New function.
960 (Dwarf_die::Dwarf_die): New function.
961 (Dwarf_die::read_attributes): New function.
962 (Dwarf_die::skip_attributes): New function.
963 (Dwarf_die::set_name): New function.
964 (Dwarf_die::set_linkage_name): New function.
965 (Dwarf_die::attribute): New function.
966 (Dwarf_die::string_attribute): New function.
967 (Dwarf_die::int_attribute): New function.
968 (Dwarf_die::uint_attribute): New function.
969 (Dwarf_die::ref_attribute): New function.
970 (Dwarf_die::child_offset): New function.
971 (Dwarf_die::sibling_offset): New function.
972 (Dwarf_info_reader::check_buffer): New function.
973 (Dwarf_info_reader::parse): New function.
974 (Dwarf_info_reader::do_parse): New function.
975 (Dwarf_info_reader::do_read_string_table): New function.
976 (Dwarf_info_reader::lookup_reloc): New function.
977 (Dwarf_info_reader::get_string): New function.
978 (Dwarf_info_reader::visit_compilation_unit): New function.
979 (Dwarf_info_reader::visit_type_unit): New function.
980 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
981 Sized_elf_reloc_mapper.
982 (Sized_dwarf_line_info::symbol_section): Remove function.
983 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
984 (Sized_dwarf_line_info::read_line_mappings): Remove object
985 parameter, adjust callers.
986 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
987 * dwarf_reader.h: Include <sys/types.h>.
988 (class Track_relocs): Remove forward declaration.
989 (class Elf_reloc_mapper): New class.
990 (class Sized_elf_reloc_mapper): New class.
991 (class Dwarf_abbrev_table): New class.
992 (class Dwarf_range_list): New class.
993 (class Dwarf_ranges_table): New class.
994 (class Dwarf_pubnames_table): New class.
995 (class Dwarf_die): New class.
996 (class Dwarf_info_reader): New class.
997 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
998 (Sized_dwarf_line_info::symbol_section): Remove member function.
999 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1001 * gdb-index.cc: New source file.
1002 * gdb-index.h: New source file.
1003 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1004 and .debug_types sections, call Layout::add_to_gdb_index.
1005 (Sized_relobj_incr::do_section_name): Implement.
1006 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1007 return type; Implement.
1008 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1010 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1011 parameter list and return type.
1012 (Sized_incr_dynobj::do_section_contents): Likewise.
1013 * layout.cc: Include gdb-index.h.
1014 (Layout::Layout): Initialize gdb_index_data_.
1015 (Layout::init_fixed_output_section): Check for .gdb_index section.
1016 (Layout::add_to_gdb_index): New function. Instantiate.
1017 * layout.h: Add forward declaration for class Gdb_index.
1018 (Layout::add_to_gdb_index): New member function.
1019 (Layout::gdb_index_data_): New data member.
1020 * main.cc: Include gdb-index.h.
1021 (main): Print statistics for gdb index.
1022 * object.cc (Object::section_contents): Move code into
1023 do_section_contents.
1024 (need_decompressed_section): Check for sections needed when building
1026 (build_compressed_section_map): Likewise.
1027 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1029 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1030 sections; call Layout::add_to_gdb_index.
1031 (Sized_relobj_file::do_decompressed_section_contents): Call
1032 do_section_contents directly.
1033 * object.h (Object::do_section_contents): Adjust parameter list and
1035 (Object::do_decompressed_section_contents): Call do_section_contents
1037 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1039 * options.h (class General_options): Add --gdb-index option.
1040 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1041 list and return type.
1042 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1043 * reloc.h (Track_relocs::checkpoint): New function.
1044 (Track_relocs::reset): New function.
1046 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1048 * testsuite/Makefile.in: Regenerate.
1049 * testsuite/gdb_index_test.cc: New test source file.
1050 * testsuite/gdb_index_test_1.sh: New test source file.
1051 * testsuite/gdb_index_test_2.sh: New test source file.
1053 2012-03-19 Doug Kwan <dougkwan@google.com>
1055 * arm.cc (Target_arm::do_define_standard_symbols): New method.
1056 (Target_arm::do_finalize_sections): Remove code which defines
1057 __exidx_start and __exidx_end. Make symbol table parameter
1058 anonymous as it is not used.
1059 * gold.cc (queue_middle_tasks): Call target hook to define any
1060 target-specific symbols.
1061 * target.h (Target::define_standard_symbols): New method.
1062 (Target::do_define_standard_symbols): Same.
1063 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1064 * testsuite/Makefile.in: Regenerate.
1065 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1067 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1068 relocations are generated for __exidx_start and __exidx_end.
1070 2012-03-16 Doug Kwan <dougkwan@google.com>
1072 * testsuite/Makefile.am: Disable test initpri3b.
1073 * testsuite/Makefile.in: Regenerate.
1075 2012-03-15 Doug Kwan <dougkwan@google.com>
1077 * arm.cc (Target_arm::got_section): Make .got section read-only
1080 2012-03-15 Ian Lance Taylor <iant@google.com>
1083 * layout.cc (Layout::make_output_section): Correctly mark
1084 SHT_INIT_ARRAY, et. al., as relro.
1086 2012-03-14 Doug Kwan <dougkwan@google.com>
1088 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1089 dynamic relocations for protected symbols in shared objects.
1091 2012-03-13 Ian Lance Taylor <iant@google.com>
1093 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1094 keep the larger alignment.
1096 2012-03-12 Cary Coutant <ccoutant@google.com>
1098 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1099 handling of DW_LNE_define_file.
1101 2012-03-12 Cary Coutant <ccoutant@google.com>
1103 * reduced_debug_output.cc
1104 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1107 2012-02-29 Cary Coutant <ccoutant@google.com>
1109 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1111 2012-02-29 Cary Coutant <ccoutant@google.com>
1113 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1114 Call Object::decompressed_section_contents.
1115 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1117 (Sized_dwarf_line_info::buffer_start_): New data member.
1118 * merge.cc (Output_merge_data::do_add_input_section): Call
1119 Object::decompressed_section_contents.
1120 (Output_merge_string::do_add_input_section): Likewise.
1121 * object.cc (need_decompressed_section): New function.
1122 (build_compressed_section_map): Decompress sections needed later.
1123 (Sized_relobj_file::do_decompressed_section_contents): New function.
1124 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1125 * object.h (Object::decompressed_section_contents): New function.
1126 (Object::discard_decompressed_sections): New function.
1127 (Object::do_decompressed_section_contents): New function.
1128 (Object::do_discard_decompressed_sections): New function.
1129 (Compressed_section_info): New type.
1130 (Compressed_section_map): Include decompressed section contents.
1131 (Sized_relobj_file::do_decompressed_section_contents): New function.
1132 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1134 2012-02-16 Cary Coutant <ccoutant@google.com>
1136 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1137 * testsuite/Makefile.in: Regenerate.
1139 2012-02-14 Cary Coutant <ccoutant@google.com>
1141 * options.cc (General_options::finalize): Disallow -pie and -static.
1143 2012-02-03 Doug Kwan <dougkwan@google.com>
1145 * arm.cc (Arm_relocate_functions::abs8,
1146 Arm_relocate_functions::abs16): Use
1147 Bits::has_signed_unsigned_overflow32.
1148 (Arm_relocate_functions::thm_abs8): Correct range of
1150 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1153 2012-02-02 Doug Kwan <dougkwan@google.com>
1155 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1156 position independent outputs, not just shared objects.
1158 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1160 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1161 * configure: Regenerated.
1163 2012-01-27 Ian Lance Taylor <iant@google.com>
1165 * reloc.h (Bits): New class with static functions, copied from
1166 namespace utils in arm.cc.
1167 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1170 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1172 * incremental.cc (write_info_blocks): Correct relocation offset.
1174 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1176 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1177 (Relocate::tls_gd_to_le): Likewise.
1179 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1181 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1183 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1185 * configure.ac: Check if -mcmodel=medium works.
1186 * configure: Regenerated.
1188 2012-01-24 Cary Coutant <ccoutant@google.com>
1190 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1192 (read_unsigned_LEB_128_x): ... this new function.
1193 (read_signed_LEB_128): Replaced with inline definition and ...
1194 (read_signed_LEB_128_x): ... this new function.
1195 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1196 (read_unsigned_LEB_128): Add inline definition.
1197 (read_signed_LEB_128_x): New function.
1198 (read_signed_LEB_128): Add inline definition.
1199 * testsuite/Makefile.am (leb128_unittest): New unit test.
1200 * testsuite/Makefile.in: Regenerate.
1201 * testsuite/leb128_unittest.cc: New unit test.
1203 2012-01-23 Ian Lance Taylor <iant@google.com>
1206 * i386.cc (Target_i386::do_code_fill): When using a jmp
1207 instruction, pad with nop instructions.
1208 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1210 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1212 * x86_64.cc (gc_process_relocs): Add typename on types used in
1214 (scan_relocs): Likewise.
1215 (relocate_section): Likewise.
1216 (apply_relocation): Likewise.
1218 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1220 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1221 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1224 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1226 * x86_64.cc: Initial support for x32.
1228 2012-01-03 Cary Coutant <ccoutant@google.com>
1230 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1231 Use abstract base class for GOT.
1232 * gold/output.h (class Output_data_got_base): New abstract base class.
1233 (class Output_data_got): Derive from new base class, adjust ctors.
1234 (Output_data_got::reserve_slot): Make virtual; rename to
1235 do_reserve_slot; Adjust callers.
1236 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1237 pointer to abstract base class.
1238 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1240 2011-12-18 Ian Lance Taylor <iant@google.com>
1242 * object.h (Relobj::local_symbol_value): New function.
1243 (Relobj::local_plt_offset): New function.
1244 (Relobj::local_has_got_offset): New function.
1245 (Relobj::local_got_offset): New function.
1246 (Relobj::set_local_got_offset): New function.
1247 (Relobj::do_local_symbol_value): New pure virtual function.
1248 (Relobj::do_local_plt_offset): Likewise.
1249 (Relobj::do_local_has_got_offset): Likewise.
1250 (Relobj::do_local_got_offset): Likewise.
1251 (Relobj::do_set_local_got_offset): Likewise.
1252 (Sized_relobj::do_local_has_got_offset): Rename from
1253 local_has_got_offset.
1254 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1255 (Sized_relobj::do_set_local_got_offset): Rename from
1256 set_local_got_offset.
1257 (Sized_relobj_file::do_local_plt_offset): Rename from
1259 (Sized_relobj_file::do_local_symbol_value): New function.
1260 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1262 * output.cc (Output_data_got::Got_entry::write): Change object to
1263 Relobj. Use local_symbol_value.
1264 (Output_data_got::add_global_with_rel): Change rel_dyn to
1265 Output_data_reloc_generic*. Use add_global_generic.
1266 (Output_data_got::add_global_with_rela): Remove. Change all
1267 callers to use add_global_with_rel.
1268 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1269 Output_data_reloc_generic*. Use add_global_generic.
1270 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1271 callers to use add_global_pair_with_rel.
1272 (Output_data_got::add_local): Change object to Relobj*.
1273 (Output_data_got::add_local_plt): Likewise.
1274 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1275 change rel_dyn to Output_data_reloc_generic*. Use
1277 (Output_data_got::add_local_with_rela): Remove. Change all
1278 callers to use all_local_with_rel.
1279 (Output_data_got::add_local_pair_with_rel): Change object to
1280 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1281 add_output_section_generic.
1282 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1283 callers to use add_local_pair_with_rel.
1284 (Output_data_got::reserve_local): Change object to Relobj*.
1285 * output.h: (class Output_data_reloc_generic): Add pure virtual
1286 declarations for add_global_generic, add_local_generic,
1287 add_output_section_generic.
1288 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1289 functions for Output_data_reloc_generic. Update declarations for
1290 changes listed in output.cc.
1291 (class Output_data_got): Change template parameter to got_size.
1292 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1293 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1295 (Sized_relobj_incr::do_local_plt_offset): New function.
1296 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1299 2011-12-17 Cary Coutant <ccoutant@google.com>
1301 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1302 * resolve.cc (Symbol_table::resolve): Likewise.
1303 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1305 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1307 2011-12-16 Ian Lance Taylor <iant@google.com>
1309 * output.h (Output_data_reloc_generic::add): Only call
1310 add_dynamic_reloc if this is a dynamic reloc section.
1312 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1315 * target-reloc.h (apply_relocation): Replace <64, false> with
1318 2011-11-25 Nick Clifton <nickc@redhat.com>
1320 * po/it.po: New Italian translation.
1322 2011-11-17 Sterling Augustine <saugustine@google.com>
1324 * script.cc (script_include_directive): Implement.
1325 (read_script_file): New local variables name and search_path. Update
1326 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1327 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1328 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1330 2011-11-11 Sterling Augustine <saugustine@google.com>
1332 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1333 (file_or_sections_cmd): Likewise.
1335 2011-11-11 Doug Kwan <dougkwan@google.com>
1337 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1338 if --just-symbols is given.
1340 2011-11-10 Doug Kwan <dougkwan@google.com>
1343 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1344 when processing data relocs.
1345 * reloc.h (Relocate_functions::rel_unaligned): New method.
1346 (Relocate_functions::pcrel_unaligned): Ditto.
1347 (Relocate_functions::rel32_unaligned): Ditto.
1348 (Relocate_functions::pcrel32_unaligned): Ditto.
1350 2011-11-09 Doug Kwan <dougkwan@google.com>
1353 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1354 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1355 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1356 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1357 (Relocate_functions::rel_unaligned): New.
1358 (Relocate_functions::rel32_unaligned): New.
1359 * target-reloc.h (relocate_for_relocatable): Add code to handle
1360 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1361 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1362 arm_unaligned_reloc_r): New targets.
1363 * testsuite/Makefile.in: Regenerate.
1364 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1367 2011-11-02 Ian Lance Taylor <iant@google.com>
1369 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1371 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1372 * options.cc (General_options::finalize): Use library search path
1373 from configure script if specified. If not native and no sysroot,
1374 only search TOOLLIBDIR.
1375 * options.h (Search_directory::Search_directory): Change name to
1377 (General_options::add_to_library_path_with_sysroot): Change arg to
1379 * configure, Makefile.in, config.in: Rebuild.
1381 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1383 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1384 we are working around the ARM1176 Erratum.
1385 * options.h (General_options::fix_arm1176): Add option.
1386 * testsuite/Makefile.am: Add testcases, and keep current ones
1388 * testsuite/Makefile.in: Regenerate.
1389 * testsuite/arm_fix_1176.s: New file.
1390 * testsuite/arm_fix_1176.sh: Likewise.
1392 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1394 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1396 (Target_arm::may_use_blx): Remove method.
1397 (Target_arm::set_may_use_blx): Likewise.
1398 (Target_arm::may_use_v4t_interworking): New method.
1399 (Target_arm::may_use_v5t_interworking): Likewise.
1400 (Target_arm::may_use_blx_): Remove member variable.
1401 (Arm_relocate_functions::arm_branch_common): Check for v5T
1403 (Arm_relocate_functions::thumb_branch_common): Likewise.
1404 (Reloc_stub::stub_type_for_reloc): Likewise.
1405 (Target_arm::do_finalize_sections): Correct interworking checks.
1406 * testsuite/Makefile.am: Add new tests.
1407 * testsuite/Makefile.in: Regenerate.
1408 * testsuite/arm_farcall_arm_arm.s: New test.
1409 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1410 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1411 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1412 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1413 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1414 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1415 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1417 2011-10-31 Cary Coutant <ccoutant@google.com>
1420 * expression.cc (Expression::eval_with_dot): Add
1421 is_section_dot_assignment parameter.
1422 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1423 absolute and assigning to dot within a section.
1424 * script-sections.cc
1425 (Output_section_element_assignment::set_section_addresses): Pass
1426 dot_section to set_if_absolute.
1427 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1428 as is_section_dot_assignment flag to eval_with_dot.
1429 (Output_section_element_dot_assignment::set_section_addresses):
1431 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1432 parameter. Also set value if relative to dot_section; set the
1433 symbol's output_section.
1434 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1435 parameter. Adjust all callers.
1436 (Expression::eval_maybe_dot): Likewise.
1437 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1439 * testsuite/script_test_2.t: Test assignment of an absolute value
1440 to dot within an output section element.
1442 2011-10-31 Cary Coutant <ccoutant@google.com>
1444 * options.h (class General_options): Add --[no-]gnu-unique options.
1445 * symtab.cc (Symbol_table::sized_write_globals): Convert
1446 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1448 2011-10-31 Cary Coutant <ccoutant@google.com>
1451 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1452 unnecessary assertion.
1453 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1455 2011-10-31 Sriraman Tallam <tmsriram@google.com>
1457 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1459 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1461 Change to just keep the section associated with symbol.
1462 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1463 they are externally visible and --export-dynamic is turned on.
1464 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1466 2011-10-19 Ian Lance Taylor <iant@google.com>
1469 * script-sections.cc
1470 (Output_section_element_dot_assignment::needs_output_section): New
1473 2011-10-19 Ian Lance Taylor <iant@google.com>
1476 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1477 --section-start option was seen.
1478 * options.h (General_options::any_section_start): New function.
1480 2011-10-18 David S. Miller <davem@davemloft.net>
1483 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1484 member to track relocation locations that have moved during TLS
1485 reloc optimizations.
1486 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1487 (Target_sparc::Relocate::relocate): Adjust view down by 4
1488 bytes if it matches reloc_adjust_addr_.
1489 (Target_sparc::Relocate::relocate_tls): Always move the
1490 __tls_get_addr call delay slot instruction forward 4 bytes when
1491 performing relaxation.
1493 2011-10-18 Cary Coutant <ccoutant@google.com>
1495 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1496 (Output_file::map_no_anonymous): Check for non-zero
1497 return code from posix_fallocate.
1499 2011-10-17 Cary Coutant <ccoutant@google.com>
1502 * plugin.cc (is_visible_from_outside): Check for symbols
1503 referenced from dynamic objects.
1504 * resolve.cc (Symbol_table::resolve): Don't count references
1505 from dynamic objects as references from real ELF files.
1506 * testsuite/plugin_test_2.sh: Adjust expected result.
1508 2011-10-17 Cary Coutant <ccoutant@google.com>
1510 * gold.cc: Include timer.h.
1511 (queue_middle_tasks): Stamp time.
1512 (queue_final_tasks): Likewise.
1513 * main.cc (main): Store timer in parameters. Print timers
1515 * parameters.cc (Parameters::Parameters): Initialize timer_.
1516 (Parameters::set_timer): New function.
1517 (set_parameters_timer): New function.
1518 * parameters.h (Parameters::set_timer): New function.
1519 (Parameters::timer): New function.
1520 (Parameters::timer_): New data member.
1521 (set_parameters_timer): New function.
1522 * timer.cc (Timer::stamp): New function.
1523 (Timer::get_pass_time): New function.
1524 * timer.h (Timer::stamp): New function.
1525 (Timer::get_pass_time): New function.
1526 (Timer::pass_times_): New data member.
1528 2011-10-17 Cary Coutant <ccoutant@google.com>
1530 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1531 task for members of lib groups.
1533 2011-10-17 Cary Coutant <ccoutant@google.com>
1536 * fileread.cc (File_read::find_view): Add assert.
1537 (File_read::make_view): Move bounds check (replace with assert)...
1538 (File_read::find_or_make_view): ... to here.
1540 2011-10-12 Cary Coutant <ccoutant@google.com>
1542 * output.cc (Output_file::open_base_file): Handle case where
1543 ::read returns less than requested size.
1545 2011-10-10 Cary Coutant <ccoutant@google.com>
1547 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
1548 Initialize defined_count_.
1549 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1550 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1551 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1552 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1553 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
1554 * incremental.h (Sized_relobj_incr::defined_count_): New data
1556 (Sized_incr_dynobj::defined_count_): New data member.
1557 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
1558 Return zeroes instead of internal error.
1560 2011-10-10 Cary Coutant <ccoutant@google.com>
1563 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
1564 (Output_reloc::symbol_value): Return PLT offset if flag is set.
1565 * output.h (class Output_reloc): Add use_plt_offset flag.
1566 (Output_reloc::type_): Adjust size of bit field.
1567 (Output_reloc::use_plt_offset_): New bit field.
1568 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1569 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1570 flag. Adjust all callers.
1571 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
1572 creating RELATIVE relocations.
1574 2011-10-10 Nick Clifton <nickc@redhat.com>
1576 * po/es.po: Updated Spanish translation.
1577 * po/fi.po: Updated Finnish translation.
1579 2011-10-03 Diego Novillo <dnovillo@google.com>
1581 * options.cc (parse_uint): Fix dereference of RETVAL.
1583 2011-09-29 Sriraman Tallam <tmsriram@google.com>
1585 * layout.h (section_order_map_): New member.
1586 (get_section_order_map): New member function.
1587 * output.cc (Output_section::add_input_section): Check for patterns
1588 only when --section-ordering-file is specified.
1589 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1590 output_sections have been formed.
1591 * layout.cc (Layout_Layout): Initialize section_order_map_.
1592 * plugin.cc (update_section_order): Store order in order_map. Do not
1594 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1595 * testsuite/Makefile.in: Regenerate.
1596 * testsuite/plugin_section_order.c: New file.
1597 * testsuite/plugin_final_layout.cc: New file.
1598 * testsuite/plugin_final_layout.sh: New file.
1600 2011-09-29 Cary Coutant <ccoutant@google.com>
1602 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1604 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
1605 symbols during incremental update.
1606 (Symbol_table::add_from_dynobj): Likewise.
1608 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1609 Ian Lance Taylor <iant@google.com>
1611 * symtab.cc (Symbol_table::define_special_symbol): Always
1612 canonicalize version string.
1614 2011-09-26 Cary Coutant <ccoutant@google.com>
1616 * gold.cc (queue_initial_tasks): Move option checks ...
1617 * options.cc (General_options::finalize): ... to here. Disable
1618 some options; make others fatal.
1620 2011-09-26 Cary Coutant <ccoutant@google.com>
1623 * plugin.cc (get_symbols_v2): New function.
1624 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1625 (is_referenced_from_outside): New function.
1626 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1627 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1628 (get_symbols): Pass version parameter.
1629 (get_symbols_v2): New function.
1630 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1632 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1633 (onload): Add LDPT_GET_SYMBOLS_V2.
1634 (all_symbols_read_hook): Use get_symbols_v2; check for
1635 LDPR_PREVAILING_DEF_IRONLY_EXP.
1636 * testsuite/plugin_test_3.sh: Update expected results.
1638 2011-09-23 Simon Baldwin <simonb@google.com>
1640 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1641 configuration options.
1642 * configure: Regenerate.
1643 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1644 * Makefile.in: Regenerate.
1645 * testsuite/Makefile.in: Regenerate.
1647 2011-09-19 Sriraman Tallam <tmsriram@google.com>
1649 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1651 2011-09-19 Cary Coutant <ccoutant@google.com>
1653 * incremental.cc (can_incremental_update): Fix typo in comment.
1654 * incremental.h (can_incremental_update): Likewise.
1656 2011-09-18 Cary Coutant <ccoutant@google.com>
1658 * incremental.cc (can_incremental_update): New function.
1659 * incremental.h (can_incremental_update): New function.
1660 * layout.cc (Layout::init_fixed_output_section): Call it.
1661 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1662 * object.cc (Sized_relobj_file::do_layout): Call
1663 can_incremental_update.
1665 2011-09-13 Cary Coutant <ccoutant@google.com>
1667 * configure.ac: Check for glibc support for gnu_indirect_function
1668 support with static linking, setting automake conditional
1670 * Makefile.in: Regenerate.
1671 * configure: Regenerate.
1673 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1674 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1676 * testsuite/Makefile.in: Regenerate.
1678 2011-09-13 Cary Coutant <ccoutant@google.com>
1680 * incremental.cc (Sized_relobj_incr::do_layout): Call
1681 report_comdat_group for kept comdat sections.
1682 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1683 * testsuite/Makefile.in: Regenerate.
1684 * testsuite/incr_comdat_test_1.cc: New source file.
1685 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1686 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1687 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1689 2011-09-13 Ian Lance Taylor <iant@google.com>
1691 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1692 variable external_symbols_offset.
1694 2011-09-12 Ian Lance Taylor <iant@google.com>
1696 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1697 triggered if object has no symbols.
1699 2011-09-09 David S. Miller <davem@davemloft.net>
1701 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1702 (Output_fill_debug_line::do_write): Likewise.
1704 2011-08-29 Cary Coutant <ccoutant@google.com>
1706 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1707 casts to match formatting specs.
1708 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1710 2011-08-26 Cary Coutant <ccoutant@google.com>
1712 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1713 remaining hole size when allocating.
1714 (Layout::make_output_section): Set fill methods for debug sections.
1715 * layout.h (Free_list::Free_list_node): Move from private to
1717 (Free_list::set_min_hole_size): New function.
1718 (Free_list::begin, Free_list::end): New functions.
1719 (Free_list::min_hole_): New data member.
1720 * output.cc: Include dwarf.h.
1721 (Output_fill_debug_info::do_minimum_hole_size): New function.
1722 (Output_fill_debug_info::do_write): New function.
1723 (Output_fill_debug_line::do_minimum_hole_size): New function.
1724 (Output_fill_debug_line::do_write): New function.
1725 (Output_section::Output_section): Initialize new data member.
1726 (Output_section::set_final_data_size): Ensure patch space is larger
1727 than minimum hole size.
1728 (Output_section::do_write): Fill holes in debug sections.
1729 * output.h (Output_fill): New class.
1730 (Output_fill_debug_info): New class.
1731 (Output_fill_debug_line): New class.
1732 (Output_section::set_free_space_fill): New function.
1733 (Output_section::free_space_fill_): New data member.
1734 * testsuite/Makefile.am (incremental_test_3): Add
1735 --incremental-patch option.
1736 (incremental_test_4): Likewise.
1737 (incremental_test_5): Likewise.
1738 (incremental_test_6): Likewise.
1739 (incremental_copy_test): Likewise.
1740 (incremental_common_test_1): Likewise.
1741 * testsuite/Makefile.in: Regenerate.
1743 2011-08-26 Nick Clifton <nickc@redhat.com>
1745 * po/es.po: Updated Spanish translation.
1747 2011-08-01 Cary Coutant <ccoutant@google.com>
1749 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1750 * gold/testsuite/Makefile.in: Regenerate.
1751 * gold/testsuite/justsyms_exec.c: New source file.
1752 * gold/testsuite/justsyms_lib.c: New source file.
1754 2011-08-01 Cary Coutant <ccoutant@google.com>
1756 * layout.cc (Layout::set_segment_offsets): Don't realign text
1757 segment if -Ttext was specified.
1758 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1760 * object.h (Sized_relobj_file::e_type): New function.
1761 (Sized_relobj_file::e_type_): New data member.
1762 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1763 base address for ET_EXEC files.
1764 * target.cc (Target::do_make_elf_object_implementation): Allow
1765 ET_EXEC files with --just-symbols option.
1767 2011-07-28 Cary Coutant <ccoutant@google.com>
1769 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1770 Add thread_number parameter.
1771 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1772 * workqueue-threads.cc
1773 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1774 current thread if its thread number is greater than desired thread
1776 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1777 Add thread_number parameter.
1778 (Workqueue::should_cancel_thread): Likewise.
1779 (Workqueue::find_runnable_or_wait): Pass thread_number to
1780 should_cancel_thread.
1781 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1784 2011-07-22 Sriraman Tallam <tmsriram@google.com>
1786 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1787 only after checking if it cannot be forced local.
1788 * symtab.h (is_externally_visible): Check if the symbol is not forced
1791 2011-07-15 Ian Lance Taylor <iant@google.com>
1793 * options.h (class General_options): Add --print-output-format.
1794 Move -EL next to -EB, for better --help output.
1795 * target-select.cc: Include <cstdio>, "options.h", and
1797 (Target_selector::do_target_bfd_name): New function.
1798 (print_output_format): New function.
1799 * target-select.h (class Target_selector): Update declarations.
1800 (Target_selector::target_bfd_name): New function.
1801 (print_output_format): Declare.
1802 * main.cc: Include "target-select.h".
1803 (main): Handle --print-output-format.
1804 * gold.cc: Include "target-select.h".
1805 (queue_initial_tasks): Handle --print-output-format when there are
1807 * parameters.cc (parameters_force_valid_target): Give a better
1808 error message if -EB/-EL does not match target.
1809 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1812 2011-07-15 Ian Lance Taylor <iant@google.com>
1814 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1815 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1816 (Output_data_plt_i386::do_write): Write address of .dynamic
1817 section to first entry in .got.plt section.
1818 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1819 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1821 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1822 section to first entry in .got.plt section.
1823 * layout.h (Layout::dynamic_section): New function.
1825 2011-07-13 Sriraman Tallam <tmsriram@google.com>
1827 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1829 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1830 input_section_position_, and input_section_glob_.
1831 (read_layout_from_file): Call function section_ordering_specified.
1832 * layout.h (is_section_ordering_specified): New function.
1833 (section_ordering_specified): New function.
1834 (section_ordering_specified_): New boolean member.
1835 * main.cc(main): Call load_plugins after layout object is defined.
1836 * output.cc (Output_section::add_input_section): Use
1837 function section_ordering_specified to check if section ordering is
1839 * output.cc (Output_section::add_relaxed_input_section): Use
1840 function section_ordering_specified to check if section ordering is
1842 (Output_section::update_section_layout): New function.
1843 (Output_section::sort_attached_input_sections): Check if input section
1845 * output.h (Output_section::update_section_layout): New function.
1846 * plugin.cc (get_section_count): New function.
1847 (get_section_type): New function.
1848 (get_section_name): New function.
1849 (get_section_contents): New function.
1850 (update_section_order): New function.
1851 (allow_section_ordering): New function.
1852 (Plugin::load): Add the new interfaces to the transfer vector.
1853 (Plugin_manager::load_plugins): New parameter.
1854 (Plugin_manager::all_symbols_read): New parameter.
1855 (Plugin_manager::claim_file): New parameter. Save the elf object for
1857 (Plugin_manager::get_elf_object): New function.
1858 (Plugin_manager::get_view): Change to directly use the bool to check
1859 if get_view is called from claim_file_hook.
1860 * plugin.h (input_objects): New function
1861 (Plugin__manager::load_plugins): New parameter.
1862 (Plugin_manager::claim_file): New parameter.
1863 (Plugin_manager::get_elf_object): New function.
1864 (Plugin_manager::in_claim_file_handler): New function.
1865 (Plugin_manager::in_claim_file_handler_): New member.
1866 (layout): New function.
1867 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1868 handler with an extra parameter. Make the elf object before calling
1870 * testsuite/plugin_test.c (get_section_count): New function pointer.
1871 (get_section_type): New function pointer.
1872 (get_section_name): New function pointer.
1873 (get_section_contents): New function pointer.
1874 (update_section_order): New function pointer.
1875 (allow_section_ordering): New function pointer.
1876 (onload): Check if the new interfaces exist.
1878 2011-07-13 Ian Lance Taylor <iant@google.com>
1880 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1882 * x86_64.cc (Target_x86_64::got_section): Likewise.
1883 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1884 (relro_now_test_SOURCES): New variable.
1885 (relro_now_test_DEPENDENCIES): New variable.
1886 (relro_now_test_LDFLAGS): New variable.
1887 (relro_now_test_LDADD): New variable.
1888 (relro_now_test.so): New target.
1889 * testsuite/Makefile.in: Rebuild.
1891 2011-07-12 Ian Lance Taylor <iant@google.com>
1894 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1895 GLOB_DAT relocation rather than a RELATIVE relocation for a
1896 protected symbol when creating a shared library.
1897 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1898 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1899 * testsuite/protected_main_1.cc (main): Test that protected
1900 function has same address.
1902 2011-07-11 Ian Lance Taylor <iant@google.com>
1905 * options.h (class General_options): Add -Bgroup.
1906 * options.cc (General_options::finalize): If -Bgroup is set,
1907 default to --unresolved-symbols=report-all.
1908 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1909 * target-reloc.h (issue_undefined_symbol_error): Handle
1910 --unresolved-symbols=report-all.
1912 2011-07-08 Ian Lance Taylor <iant@google.com>
1915 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1916 if linker script discards key sections.
1917 (Layout::create_dynamic_symtab): Likewise.
1918 (Layout::assign_local_dynsym_offsets): Likewise.
1919 (Layout::sized_create_version_sections): Likewise.
1920 (Layout::create_interp): Likewise.
1921 (Layout::finish_dynamic_section): Likewise.
1922 (Layout::set_dynamic_symbol_size): Likewise.
1924 2011-07-08 Ian Lance Taylor <iant@google.com>
1927 * options.h (class General_options): Add --unresolved-symbols.
1928 * target-reloc.h (issue_undefined_symbol_error): Check
1929 --unresolved-symbols. Add comments.
1931 2011-07-08 Ian Lance Taylor <iant@google.com>
1933 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1934 expression more complex.
1936 2011-07-08 Ian Lance Taylor <iant@google.com>
1939 * target-reloc.h (issue_undefined_symbol_error): New inline
1940 function, broken out of relocate_section.
1941 (relocate_section): Call issue_undefined_symbol_error.
1942 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1943 there is no TLS segment if we are about to issue an undefined
1945 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1947 2011-07-08 Ian Lance Taylor <iant@google.com>
1950 * resolve.cc (Symbol_table::should_override): Add fromtype
1951 parameter. Change all callers. Give error when linking together
1952 TLS and non-TLS symbol.
1953 (Symbol_table::should_override_with_special): Add fromtype
1954 parameter. Change all callers.
1955 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1956 there is no TLS segment if we have reported some errors.
1957 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1959 2011-07-08 Ian Lance Taylor <iant@google.com>
1962 * target.h (Target::plt_address_for_global): New function.
1963 (Target::plt_address_for_local): New function.
1964 (Target::plt_section_for_global): Remove.
1965 (Target::plt_section_for_local): Remove.
1966 (Target::do_plt_address_for_global): New virtual function.
1967 (Target::do_plt_address_for_local): New virtual function.
1968 (Target::do_plt_section_for_global): Remove.
1969 (Target::do_plt_section_for_local): Remove.
1970 (Target::register_global_plt_entry): Add Symbol_table and Layout
1972 * output.cc (Output_data_got::Got_entry::write): Use
1973 plt_address_for_global and plt_address_for_local.
1974 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1975 address of output section.
1976 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1977 got_irelative_, and irelative_count_ fields. Update
1979 (Output_data_plt_i386::has_irelative_section): New function.
1980 (Output_data_plt_i386::entry_count): Add irelative_count_.
1981 (Output_data_plt_i386::set_final_data_size): Likewise.
1982 (class Target_i386): Add got_irelative_ and rel_irelative_
1983 fields. Update declarations.
1984 (Target_i386::Target_i386): Initialize new fields.
1985 (Target_i386::do_plt_address_for_global): New function replacing
1986 do_plt_section_for_global.
1987 (Target_i386::do_plt_address_for_local): New function replacing
1988 do_plt_section_for_local.
1989 (Target_i386::got_section): Create got_irelative_.
1990 (Target_i386::rel_irelative_section): New function.
1991 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1992 fields. Don't define __rel_iplt_{start,end}.
1993 (Output_data_plt_i386::add_entry): Add symtab and layout
1994 parameters. Change all callers. Use different PLT and GOT for
1996 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1997 layout parameters. Change all callers. Use different PLT and
1999 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2000 (Output_data_plt_i386::rel_irelative): New function.
2001 (Output_data_plt_i386::address_for_global): New function.
2002 (Output_data_plt_i386::address_for_local): New function.
2003 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2004 IRELATIVE GOT when changing IFUNC GOT entries.
2005 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2007 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2008 if we didn't create an IRELATIVE GOT.
2009 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2010 plt_address_for_local.
2011 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2012 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2013 got_irelative_, and irelative_count_ fields. Update
2015 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2016 Initialize new fields. Remove symtab parameter. Change all
2018 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2020 (Output_data_plt_x86_64::has_irelative_section): New function.
2021 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2022 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2023 fields. Update declarations.
2024 (Target_x86_64::Target_x86_64): Initialize new fields.
2025 (Target_x86_64::do_plt_address_for_global): New function replacing
2026 do_plt_section_for_global.
2027 (Target_x86_64::do_plt_address_for_local): New function replacing
2028 do_plt_section_for_local.
2029 (Target_x86_64::got_section): Create got_irelative_.
2030 (Target_x86_64::rela_irelative_section): New function.
2031 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2032 all callers. Don't create __rel_iplt_{start,end}.
2033 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2034 parameters. Change all callers. Use different PLT and GOT for
2036 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2037 layout parameters. Change all callers. Use different PLT and
2039 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2040 parameters. Change all callers. Use different PLT and GOT for
2042 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2043 (Output_data_plt_x86_64::rela_irelative): New function.
2044 (Output_data_plt_x86_64::address_for_global): New function.
2045 (Output_data_plt_x86_64::address_for_local): New function.
2046 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2047 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2048 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2049 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2051 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2053 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2054 symbols if we didn't create an IRELATIVE GOT.
2055 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2056 plt_address_for_local.
2057 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2058 * testsuite/ifuncvar1.c: New test file.
2059 * testsuite/ifuncvar2.c: New test file.
2060 * testsuite/ifuncvar3.c: New test file.
2061 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2062 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2063 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2064 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2065 * testsuite/Makefile.in: Rebuild.
2067 2011-07-07 Cary Coutant <ccoutant@google.com>
2069 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2070 (two_file_test_1_ndebug.o): Likewise.
2071 (two_file_test_1b_ndebug.o): Likewise.
2072 (two_file_test_2_ndebug.o): Likewise.
2073 (two_file_test_main_ndebug.o): Likewise.
2074 (incremental_test_2): Link with no-debug versions.
2076 2011-07-06 Cary Coutant <ccoutant@google.com>
2078 * gold/incremental.cc
2079 (Output_section_incremental_inputs::write_info_blocks): Check for
2080 hidden and internal symbols.
2082 2011-07-06 Cary Coutant <ccoutant@google.com>
2084 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2085 Check disposition for startup file.
2086 (Incremental_inputs::report_command_line): Ignore
2087 --incremental-startup-unchanged option.
2088 * options.cc (General_options::parse_incremental_startup_unchanged):
2090 (General_options::General_options): Initialize new data member.
2091 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2092 (General_options): Add --incremental-startup-unchanged option.
2093 (General_options::incremental_startup_disposition): New function.
2094 (General_options::incremental_startup_disposition_): New data member.
2096 2011-07-06 Cary Coutant <ccoutant@google.com>
2098 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2099 input file index to Script_info ctor.
2100 (Sized_incremental_binary::do_file_has_changed): Find the
2101 command-line argument for files named in scripts.
2102 * incremental.h (Script_info::Script_info): New ctor
2103 with input file index.
2104 (Script_info::input_file_index): New function.
2105 (Script_info::input_file_index_): New data member.
2106 (Incremental_binary::get_library): Add const.
2107 (Incremental_binary::get_script_info): Add const.
2108 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2109 * testsuite/Makefile.am (incremental_test_5): New test case.
2110 (incremental_test_6): New test case.
2111 * testsuite/Makefile.in: Regenerate.
2113 2011-07-06 Cary Coutant <ccoutant@google.com>
2115 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2116 debug output when command lines differ.
2118 2011-07-06 Cary Coutant <ccoutant@google.com>
2120 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2121 --incremental-patch option.
2122 * layout.cc (Free_list::allocate): Extend allocation beyond original
2124 (Layout::make_output_section): Mark sections that should get
2126 * options.cc (parse_percent): New function.
2127 * options.h (parse_percent): New function.
2128 (DEFINE_percent): New macro.
2129 (General_options): Add --incremental-patch option.
2130 * output.cc (Output_section::Output_section): Initialize new data
2132 (Output_section::add_input_section): Print section name when out
2134 (Output_section::add_output_section_data): Likewise.
2135 (Output_section::set_final_data_size): Add patch space when
2136 doing --incremental-full.
2137 (Output_section::do_reset_address_and_file_offset): Remove patch
2139 (Output_segment::set_section_list_addresses): Print debug output
2140 only if --incremental-update.
2141 * output.h (Output_section::set_is_patch_space_allowed): New function.
2142 (Output_section::is_patch_space_allowed_): New data member.
2143 (Output_section::patch_space_): New data member.
2144 * parameters.cc (Parameters::incremental_full): New function.
2145 * parameters.h (Parameters::incremental_full): New function
2146 * testsuite/Makefile.am (incremental_test_2): Add test for
2147 --incremental-patch option.
2148 * testsuite/Makefile.in: Regenerate.
2149 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2150 (t18): Remove function body.
2152 2011-07-05 Doug Kwan <dougkwan@google.com>
2155 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2156 Arm_Address type for relocation result.
2157 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2159 (Arm_relocate_functions::abs32): Use unaligned access.
2160 (Arm_relocate_functions::rel32): Ditto.
2161 (Arm_relocate_functions::prel31): Ditto.
2162 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2163 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2164 static data relocations.
2165 * testsuite/Makefile.in: Regnerate.
2166 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2168 2011-07-05 Ian Lance Taylor <iant@google.com>
2171 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2172 symbols if necessary.
2173 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2175 2011-07-05 Ian Lance Taylor <iant@google.com>
2178 * resolve.cc (Symbol::override_base_with_special): Simply override
2179 version with special symbol version, ignoring previous version.
2181 2011-07-05 Ian Lance Taylor <iant@google.com>
2183 * object.cc (Sized_relobj_file::include_section_group): Add
2184 information to comment about signature location.
2186 2011-07-02 Ian Lance Taylor <iant@google.com>
2189 * options.h (class General_options): Add -f and -F.
2190 * options.cc (General_options::finalize): Fatal error if -f/-F
2191 are used without -shared.
2192 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2194 2011-07-02 Ian Lance Taylor <iant@google.com>
2196 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2198 2011-07-01 Ian Lance Taylor <iant@google.com>
2202 * resolve.cc (Symbol::override_base_with_special): Don't override
2203 the version if the overriding symbol has a different name.
2204 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2205 all callers. If we give an error about an undefined version,
2206 define the base version if necessary.
2207 * dynobj.h (class Versions): Update declaration.
2208 * testsuite/weak_alias_test_5.cc: New file.
2209 * testsuite/weak_alias_test.script: New file.
2210 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2211 and versioned_alias have the right value, and call t2.
2212 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2213 weak_alias_test_5.so.
2214 (weak_alias_test_LDADD): Likewise.
2215 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2216 * testsuite/Makefile.in: Rebuild.
2218 2011-07-01 Ian Lance Taylor <iant@google.com>
2221 * options.h (class General_options): Support -z notext.
2222 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2224 (two_file_shared_nonpic.so): Likewise.
2225 (two_file_shared_mixed.so): Likewise.
2226 (two_file_shared_mixed_1.so): Likewise.
2227 (weak_undef_lib_nonpic.so): Likewise.
2228 (alt/weak_undef_lib_nonpic.so): Likewise.
2229 (tls_test_shared_nonpic.so): Likewise.
2230 * testsuite/Makefile.in: Rebuild.
2232 2011-07-01 Ian Lance Taylor <iant@google.com>
2235 * configure.ac: Test whether static linking works, setting
2236 the automake conditional HAVE_STATIC.
2237 * testsuite/Makefile.am: Disable tests using -static if
2238 HAVE_STATIC is not true.
2239 * configure, testsuite/Makefile.in: Rebuild.
2241 2011-07-01 Ian Lance Taylor <iant@google.com>
2244 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2245 Assert if we see DW_EH_PE_indirect.
2246 * target.h (Target::ehframe_datarel_base): New function.
2247 (Target::do_ehframe_datarel_base): New target function.
2248 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2249 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2252 2011-07-01 Ian Lance Taylor <iant@google.com>
2255 * options.h (class General_options): Add
2256 --ld-generated-unwind-info.
2257 * ehframe.cc (Fde::write): Add address parameter. Change all
2258 callers. If associated with PLT, fill in address and size.
2259 (Cie::set_output_offset): Only add merge mapping if there is an
2261 (Cie::write): Add address parameter. Change all callers.
2262 (Eh_frame::add_ehframe_for_plt): New function.
2263 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2264 input_offset_ fields into union u_, with new plt field.
2265 (Fde::Fde): Adjust for new union field.
2266 (Fde::Fde) [Output_data version]: New constructor.
2267 (Fde::add_mapping): Only add merge mapping if there is an object.
2268 (class Cie): Update declarations.
2269 (class Eh_frame): Declare add_ehframe_for_plt.
2270 * layout.cc (Layout::layout_eh_frame): Break out code into
2271 make_eh_frame_section, and call it.
2272 (Layout::make_eh_frame_section): New function.
2273 (Layout::add_eh_frame_for_plt): New function.
2274 * layout.h (class Layout): Update declarations.
2275 * merge.cc (Merge_map::add_mapping): Add assertion.
2276 * i386.cc: Include "dwarf.h".
2277 (class Output_data_plt_i386): Make first_plt_entry,
2278 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2279 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2280 and plt_eh_frame_fde.
2281 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2282 boundary. Call add_eh_frame_for_plt if appropriate.
2283 * x86_64.cc: Include "dwarf.h".
2284 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2285 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2286 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2287 and plt_eh_frame_fde.
2288 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2291 2011-06-29 Ian Lance Taylor <iant@google.com>
2294 * object.cc (Sized_relobj_file::layout_section): Change shdr
2295 parameter to be const.
2296 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2298 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2299 appropriate. Call layout_eh_frame_section.
2300 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2302 * object.h (class Sized_relobj_file): Update declarations.
2304 2011-06-29 Ian Lance Taylor <iant@google.com>
2307 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2309 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2311 2011-06-29 Ian Lance Taylor <iant@google.com>
2314 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2316 * layout.cc (Layout::layout_eh_frame): Likewise.
2318 2011-06-29 Ian Lance Taylor <iant@google.com>
2321 * layout.cc (Layout::symtab_section_shndx): New function.
2322 * layout.h (class Layout): Declare symtab_section_shndx.
2323 * output.cc (Output_section::write_header): Call it.
2325 2011-06-29 Ian Lance Taylor <iant@google.com>
2328 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2329 symbols which are not used in a relocation.
2331 2011-06-28 Ian Lance Taylor <iant@google.com>
2334 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2335 script create indistinguishable segments.
2336 (Layout::set_segment_offsets): Use stable_sort when sorting
2337 segments. Pass this to Compare_segments constructor.
2338 * layout.h (class Layout): Make segment_precedes non-static.
2339 (class Compare_segments): Change from struct to class. Add
2340 layout_ field. Add constructor.
2341 * script-sections.cc
2342 (Script_sections::attach_sections_using_phdrs_clause): Rename
2343 local orphan to is_orphan. Don't report failure to put empty
2344 section in segment. On attachment failure, report name of
2345 section, and attach to first PT_LOAD segment.
2347 2011-06-28 Ian Lance Taylor <iant@google.com>
2350 * target-select.cc (Target_selector::Target_selector): Add
2351 emulation parameter. Change all callers.
2352 (select_target_by_bfd_name): Rename from select_target_by_name.
2354 (select_target_by_emulation): New function.
2355 (supported_emulation_names): New function.
2356 * target-select.h (class Target_selector): Add emulation_ field.
2357 Update declarations.
2358 (Target_selector::recognize_by_bfd_name): Rename from
2359 recognize_by_name. Change all callers.
2360 (Target_selector::supported_bfd_names): Rename from
2361 supported_names. Change all callers.
2362 (Target_selector::recognize_by_emulation): New function.
2363 (Target_selector::supported_emulations): New function.
2364 (Target_selector::emulation): New function.
2365 (Target_selector::do_recognize_by_bfd_name): Rename from
2366 do_recognize_by_name. Change all callers.
2367 (Target_selector::do_supported_bfd_names): Rename from
2368 do_supported_names. Change all callers.
2369 (Target_selector::do_recognize_by_emulation): New function.
2370 (Target_selector::do_supported_emulations): New function.
2371 (select_target_by_bfd_name): Change name in declaration.
2372 (select_target_by_emulation): Declare.
2373 (supported_emulation_names): Declare.
2374 * parameters.cc (parameters_force_valid_target): Try to find
2375 target based on emulation from -m option.
2376 * options.h (class General_options): Change doc string for -m.
2377 * options.cc (help): Print emulations.
2378 (General_options::parse_V): Likewise.
2379 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2380 Add emulation parameter. Change all callers.
2382 2011-06-28 Ian Lance Taylor <iant@google.com>
2384 * target.h (class Target): Add osabi_ field.
2385 (Target::osabi): New function.
2386 (Target::set_osabi): New function.
2387 (Target::Target): Initialize osabi_.
2388 (Target::do_adjust_elf_header): Make pure virtual.
2389 (Sized_target::do_adjust_elf_header): Declare.
2390 * target.cc (Sized_target::do_adjust_elf_header): New function.
2391 (class Sized_target): Instantiate all versions.
2392 * freebsd.h (class Target_freebsd): Remove.
2393 (Target_selector_freebsd::do_recognize): Call set_osabi on
2395 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2396 (Target_selector_freebsd::set_osabi): Remove.
2397 * i386.cc (class Target_i386): Inherit from Sized_target rather
2398 than Target_freebsd.
2399 * x86_64.cc (class Target_x86_64): Likewise.
2401 2011-06-28 Ian Lance Taylor <iant@google.com>
2403 * target.h (Target::can_check_for_function_pointers): Rewrite.
2405 (Target::can_icf_inline_merge_sections): Likewise.
2406 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2407 (Target::Target_info): Add can_icf_inline_merge_sections field.
2408 (Target::do_can_check_for_function_pointers): New virtual
2410 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2411 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2412 from can_check_for_function_pointers, move in file.
2413 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2414 section_may_have_icf_unsafe_poineters, move in file.
2415 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2416 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2417 Rename from can_check_for_function_pointers, move in file.
2418 (Target_i386::can_icf_inline_merge_sections): Remove.
2419 (Target_i386::i386_info): Initialize
2420 can_icf_inline_merge_sections.
2421 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2422 Initialize can_icf_inline_merge_sections.
2423 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2424 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2425 Rename from can_check_for_function_pointers, move in file.
2426 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2427 (Target_x86_64::x86_64_info): Initialize
2428 can_icf_inline_merge_sections.
2429 * testsuite/testfile.cc (Target_test::test_target_info):
2431 * icf.cc (get_section_contents): Correct formatting.
2433 2011-06-27 Ian Lance Taylor <iant@google.com>
2435 * symtab.cc (Symbol::versioned_name): New function.
2436 (Symbol_table::add_to_final_symtab): Use versioned_name when
2438 (Symbol_table::sized_write_symbol): Likewise.
2439 * symtab.h (class Symbol): Declare versioned_name.
2440 * stringpool.h (class Stringpool_template): Add variant of add
2441 which takes a std::basic_string.
2442 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2443 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2444 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2445 (ver_test_12.o): New target.
2446 * testsuite/Makefile.in: Rebuild.
2448 2011-06-27 Doug Kwan <dougkwan@google.com>
2450 * arm.cc (Arm_relocate_functions::thm_jump8,
2451 Arm_relocate_functions::thm_jump11): Use a wider signed
2452 type to compute offset.
2453 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2455 * testsuite/Makefile.in: Regenerate.
2456 * testsuite/arm_branch_in_range.sh: Check test results of
2457 arm_thm_jump11 and arm_thm_jump8.
2458 * testsuite/arm_thm_jump11.s: New test source file.
2459 * testsuite/arm_thm_jump11.t: New linker script.
2460 * testsuite/arm_thm_jump8.s: New test source file.
2461 * testsuite/arm_thm_jump8.t: New linker script.
2463 2011-06-24 Ian Lance Taylor <iant@google.com>
2465 * layout.cc: Include "object.h".
2466 (ctors_sections_in_init_array): New static variable.
2467 (Layout::is_ctors_in_init_array): New function.
2468 (Layout::layout): Add entry to ctors_sections_in_init_array if
2470 * layout.h (class Layout): Declare is_ctors_in_init_array.
2471 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2472 is_ctors_reverse_view is set.
2473 (Sized_relobj_file::write_sections): Add layout parameter. Change
2474 all callers. Set is_ctors_reverse_view field of View_size.
2475 (Sized_relobj_file::reverse_words): New function.
2476 * object.h (Sized_relobj_file::View_size): Add
2477 is_ctors_reverse_view field.
2478 (class Sized_relobj_file): Update declarations.
2479 * testsuite/initpri3.c: New test.
2480 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2482 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2483 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2484 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2485 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2486 * testsuite/Makefile.in: Rebuild.
2488 2011-06-24 Cary Coutant <ccoutant@google.com>
2490 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2491 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2492 (debug_msg_cdebug.err): New targets.
2493 * testsuite/Makefile.in: Regenerate.
2494 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2495 Fix checks for link with shared library.
2497 2011-06-24 Doug Kwan <dougkwan@google.com>
2499 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2500 skip empty text sections.
2501 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2503 2011-06-22 Ian Lance Taylor <iant@google.com>
2506 * options.h (class General_options): Add --ctors-in-init-array.
2507 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2508 friends as SHT_PROGBITS for merging sections.
2509 (Layout::layout): Remove special handling of .init_array and
2510 friends. Don't sort if doing relocatable link. Sort for .ctors
2511 and .dtors if ctors_in_init_array.
2512 (Layout::make_output_section): Force correct section types for
2513 .init_array and friends. Don't sort if doing relocatable link,
2514 Don't sort .ctors and .dtors if ctors_in_init_array.
2515 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2516 (Layout::output_section_name): Add relobj parameter. Change all
2517 callers. Handle .ctors. and .dtors. in code rather than table.
2518 Handle .ctors and .dtors if ctors_in_init_array.
2519 (Layout::match_file_name): New function, moved from output.cc.
2520 * layout.h (class Layout): Update declarations.
2521 * output.cc: Include "layout.h".
2522 (Input_section_sort_entry::get_priority): New function.
2523 (Input_section_sort_entry::match_file_name): Just call
2524 Layout::match_file_name.
2525 (Output_section::Input_section_sort_init_fini_compare::operator()):
2526 Handle .ctors and .dtors. Sort by explicit priority rather than
2528 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2529 * testsuite/initpri2.c: New test.
2530 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2531 (check_PROGRAMS): Add initpri2.
2532 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2533 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2534 * configure, testsuite/Makefile.in: Rebuild.
2536 2011-06-19 Ian Lance Taylor <iant@google.com>
2539 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2540 .interp section to a PT_INTERP segment even if we have seen a
2541 --dynamic-linker option. Don't do it if we have seen a PHDRS
2542 clause in a linker script.
2543 (Layout::finalize): Don't create a .interp section if we've
2544 already create a PT_INTERP segment.
2545 (Layout::create_interp): Always call choose_output_section (revert
2546 patch of 2011-06-17). Don't create PT_INTERP segment.
2547 * script-sections.cc
2548 (Script_sections::create_note_and_tls_segments): Add a .interp
2549 section to a PT_INTERP segment even if we have seen a
2550 --dynamic-linker option.
2552 2011-06-18 Ian Lance Taylor <iant@google.com>
2554 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2555 merely because a non-PT_LOAD segment has a dynamic reloc.
2557 2011-06-18 Ian Lance Taylor <iant@google.com>
2559 * layout.cc (Layout::finish_dynamic_section): Don't create
2560 DT_FLAGS entry if not needed.
2562 2011-06-18 Ian Lance Taylor <iant@google.com>
2565 * layout.cc (Layout::layout_eh_frame): Correct handling of
2566 writable .eh_frame section.
2568 2011-06-17 Ian Lance Taylor <iant@google.com>
2571 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2572 symbol is redefined with the exact same object and value.
2574 2011-06-17 Ian Lance Taylor <iant@google.com>
2577 * layout.h (class Layout): Add interp_segment_ field.
2578 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2579 (Layout::attach_allocated_section_to_segment): If making shared
2580 library, put .interp section in PT_INTERP segment.
2581 (Layout::finalize): Also call create_interp if -dynamic-linker
2583 (Layout::create_interp): Assert that there is no PT_INTERP
2584 segment. If not using a SECTIONS clause, use make_output_section.
2585 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2586 * script-sections.cc
2587 (Script_sections::create_note_and_tls_segments): If making shared
2588 library, put .interp section in PT_INTERP segment.
2590 2011-06-17 Ian Lance Taylor <iant@google.com>
2592 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2593 when making a shared library.
2595 2011-06-17 Ian Lance Taylor <iant@google.com>
2597 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2598 parameter. Change all callers. Don't issue warning about PC32
2599 against locally defined symbol.
2601 2011-06-16 Ian Lance Taylor <iant@google.com>
2603 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2604 occurs in same object.
2606 2011-06-14 Alan Modra <amodra@gmail.com>
2608 * po/POTFILES.in: Regenerate.
2610 2011-06-09 Ian Lance Taylor <iant@google.com>
2612 * script-sections.cc
2613 (Orphan_output_section::set_section_addresses): For a relocatable
2614 link set address to 0.
2616 2011-06-09 Cary Coutant <ccoutant@google.com>
2619 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2620 used with --compress-debug-sections.
2621 * gold/object.cc (Sized_relobj_file::do_layout): Report
2622 uncompressed size of compressed input sections.
2624 2011-06-08 Cary Coutant <ccoutant@google.com>
2627 * testsuite/two_file_test_2_v1.cc: Change initialization of
2628 v2 to keep it in .data.
2630 2011-06-07 Cary Coutant <ccoutant@google.com>
2632 * common.cc (Symbol_table::do_allocate_commons_list): Call
2634 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2635 (Errors::fallback): New function.
2636 (gold_fallback): New function.
2637 * errors.h (Errors::fallback): New function.
2638 * gold.cc (gold_exit): Change status parameter to enum; adjust
2640 (queue_initial_tasks): Call gold_fallback.
2641 * gold.h: Include cstdlib.
2642 (Exit_status): New enum type.
2643 (gold_exit): Change status parameter to enum.
2644 (gold_fallback): New function.
2645 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2646 (Layout::create_symtab_sections): Likewise.
2647 (Layout::create_shdrs): Likewise.
2648 * main.cc (main): Adjust call to gold_exit.
2649 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2650 (Output_data_got::add_got_entry_pair): Likewise.
2651 (Output_section::add_input_section): Likewise.
2652 (Output_section::add_output_section_data): Likewise.
2653 (Output_segment::set_section_list_addresses): Likewise.
2654 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2656 2011-06-07 Cary Coutant <ccoutant@google.com>
2658 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2659 for incremental links.
2660 * output.cc (Output_segment::set_section_list_addresses): Remove
2661 FIXME and test for TLS or BSS.
2663 2011-06-07 Cary Coutant <ccoutant@google.com>
2665 * testsuite/Makefile.am: Add incremental_copy_test,
2666 incremental_common_test_1.
2667 * testsuite/Makefile.in: Regenerate.
2668 * testsuite/common_test_1_v1.c: New source file.
2669 * testsuite/common_test_1_v2.c: New source file.
2670 * testsuite/copy_test_v1.cc: New source file.
2672 2011-06-07 Cary Coutant <ccoutant@google.com>
2674 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2675 update, allocate common from bss section's free list.
2676 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2677 linker-defined symbols.
2678 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2679 Skip GOT and PLT entries that are no longer referenced.
2680 (Output_section_incremental_inputs::write_info_blocks): Mark
2681 linker-defined symbols.
2682 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2683 * output.cc (Output_section::allocate): New function.
2684 * output.h (Output_section::allocate): New function.
2685 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2686 linker-defined symbols.
2687 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2688 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2689 (Symbol::init_base_output_data): Likewise.
2690 (Symbol::init_base_output_segment): Likewise.
2691 (Symbol::init_base_constant): Likewise.
2692 (Sized_symbol::init_output_data): Likewise.
2693 (Sized_symbol::init_output_segment): Likewise.
2694 (Sized_symbol::init_constant): Likewise.
2695 (Symbol_table::do_define_in_output_data): Likewise.
2696 (Symbol_table::do_define_in_output_segment): Likewise.
2697 (Symbol_table::do_define_as_constant): Likewise.
2698 * symtab.h (Symbol::is_predefined): New function.
2699 (Symbol::init_base_output_data): Add is_predefined parameter.
2700 (Symbol::init_base_output_segment): Likewise.
2701 (Symbol::init_base_constant): Likewise.
2702 (Symbol::is_predefined_): New data member.
2703 (Sized_symbol::init_output_data): Add is_predefined parameter.
2704 (Sized_symbol::init_output_segment): Likewise.
2705 (Sized_symbol::init_constant): Likewise.
2706 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2708 2011-06-07 Cary Coutant <ccoutant@google.com>
2710 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2711 instead of emit_copy_reloc.
2712 (Copy_relocs::emit_copy_reloc): Refactor.
2713 (Copy_relocs::make_copy_reloc): New function.
2714 (Copy_relocs::add_copy_reloc): Remove.
2715 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2717 (Copy_relocs::make_copy_reloc): New function.
2718 (Copy_relocs::add_copy_reloc): Remove.
2719 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2720 unchanged input files.
2721 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2722 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2723 Reserve BSS space for COPY relocations.
2724 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2725 (Output_section_incremental_inputs::write_info_blocks): Record
2726 whether a symbol is copied from a shared object.
2727 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2728 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2729 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2730 (Incremental_input_entry_reader::get_output_symbol_index): Add
2732 (Incremental_binary::emit_copy_relocs): New function.
2733 (Incremental_binary::do_emit_copy_relocs): New function.
2734 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2736 (Sized_incremental_binary::add_copy_reloc): New function.
2737 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2738 (Sized_incremental_binary::Copy_reloc): New struct.
2739 (Sized_incremental_binary::Copy_relocs): New typedef.
2740 (Sized_incremental_binary::copy_relocs_): New data member.
2741 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2742 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2743 * target.h (Sized_target::emit_copy_reloc): New function.
2744 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2746 2011-06-02 Cary Coutant <ccoutant@google.com>
2749 * gold/archive.cc (Archive::Archive): Initialize new data member.
2750 (Archive::include_all_members): Return if archive has already been
2752 * gold/archive.h (Archive::include_all_members_): New data member.
2754 2011-06-02 Nick Clifton <nickc@redhat.com>
2756 * dynobj.h: Fix spelling mistake in comment.
2757 * output.cc: Likewise.
2759 2011-05-31 Doug Kwan <dougkwan@google.com>
2763 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
2764 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2765 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2766 redundant arm_exidx_test.so.
2767 * testsuite/Makefile.in: Regenerate.
2768 (check_SCRIPTS): Add pr12826.sh
2769 (check_DATA): Add pr12826.stdout
2770 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2771 * testsuite/pr12826.sh: New file.
2772 * testsuite/pr12826_1.s: Ditto.
2773 * testsuite/pr12826_1.s: Ditto.
2775 2011-05-30 Ian Lance Taylor <iant@google.com>
2777 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2780 2011-05-29 Ian Lance Taylor <iant@google.com>
2783 * testsuite/Makefile.am: Use different file name for two_file_test
2784 temporary file for each incremental test.
2785 * testsuite/Makefile.in: Rebuild.
2787 2011-05-29 Ian Lance Taylor <iant@google.com>
2789 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2790 binary input file is empty.
2792 2011-05-27 Ian Lance Taylor <iant@google.com>
2794 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2795 (ver_test_9.so): Likewise.
2796 * testsuite/Makefile.in: Rebuild.
2798 2011-05-26 Cary Coutant <ccoutant@google.com>
2800 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2801 * incremental.cc (Incremental_inputs::report_input_section): Fix
2802 comment, indentation.
2803 (Incremental_inputs::report_comdat_group): New function.
2804 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2805 of data for incremental input file entry.
2806 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2807 group count, COMDAT group signatures.
2808 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2809 an unchanged input file.
2810 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2811 Initialize new data member.
2812 (Incremental_object_entry::add_comdat_group): New function.
2813 (Incremental_object_entry::get_comdat_group_count): New function.
2814 (Incremental_object_entry::get_comdat_signature_key): New function.
2815 (Incremental_object_entry::groups_): New data member.
2816 (Incremental_inputs::report_comdat_group): New function.
2817 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2818 data for incremental input file entry.
2819 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2820 (Incremental_input_entry_reader::get_input_section): Adjust size of
2821 data for incremental input file entry.
2822 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2823 (Incremental_input_entry_reader::get_comdat_group_signature): New
2825 * object.cc (Sized_relobj::include_section_group): Report kept
2826 COMDAT groups for incremental links.
2828 2011-05-24 David Meyer <pdox@google.com>
2830 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2831 with name parameter. Add found_name parameter.
2832 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2833 * dirsearch.h (class Dirsearch): Update declaration.
2835 2011-05-24 Ian Lance Taylor <iant@google.com>
2837 * archive.cc (Library_base::should_include_member): Pull in object
2838 from archive if it defines the entry symbol.
2839 * parameters.cc (Parameters::entry): New function.
2840 * parameters.h (class Parameters): Declare entry.
2841 * output.h (class Output_file_header): Remove entry_ field.
2842 * output.cc (Output_file_header::Output_file_header): Remove entry
2843 parameter. Change all callers.
2844 (Output_file_header::entry): Use parameters->entry.
2845 * gold.cc (queue_middle_tasks): Likewise.
2846 * plugin.cc (Plugin_hook::run): Likewise.
2848 2011-05-24 Cary Coutant <ccoutant@google.com>
2850 * gold.cc (queue_initial_tasks): Pass incremental base filename
2851 to Output_file::open_base_file; don't print error message.
2852 * incremental-dump.cc (main): Adjust call to
2853 Output_file::open_for_modification.
2854 * incremental-dump.cc (main): Likewise.
2855 * incremental.cc (Incremental_inputs::report_command_line):
2856 Ignore --incremental-base option when comparing command lines.
2857 Ignore parameter when given as separate argument.
2858 * options.h (class General_options): Add --incremental-base.
2859 * output.cc (Output_file::Output_file):
2860 (Output_file::open_base_file): Add base_name and writable parameters;
2861 read base file into new file; print error message here.
2862 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2864 * output.h (Output_file::open_for_modification): Rename to...
2865 (Output_file::open_base_file): ...this; add base_name and
2866 writable parameters; adjust all callers.
2867 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2869 * testsuite/Makefile.am (incremental_test_4): Test
2871 * testsuite/Makefile.in: Regenerate.
2873 2011-05-24 Cary Coutant <ccoutant@google.com>
2875 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2877 * testsuite/Makefile.in: Regenerate.
2878 * testsuite/two_file_test_1_v1.cc: New test source file.
2879 * testsuite/two_file_test_1b_v1.cc: New test source file.
2880 * testsuite/two_file_test_2_v1.cc: New test source file.
2882 2011-05-24 Cary Coutant <ccoutant@google.com>
2884 * dynobj.h (Dynobj::do_dynobj): New function.
2885 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2886 flag and soname for shared objects.
2887 * incremental.cc (Incremental_inputs::report_object): Make
2888 either Incremental_object_entry or Incremental_dynobj_entry; add
2889 soname to string table.
2890 (Incremental_inputs::report_input_section): Add assertion.
2891 (Output_section_incremental_inputs::set_final_data_size): Adjust
2892 type of input file entry for shared libraries; adjust size of
2893 shared library info entry.
2894 (Output_section_incremental_inputs::write_input_files): Write
2895 as_needed flag for shared libraries.
2896 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2897 of input file entry for shared libraries; write soname.
2898 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2899 soname from incremental info.
2900 * incremental.h (enum Incremental_input_flags): Add
2901 INCREMENTAL_INPUT_AS_NEEDED.
2902 (Incremental_input_entry::Incremental_input_entry): Initialize new
2904 (Incremental_input_entry::set_as_needed): New function.
2905 (Incremental_input_entry::as_needed): New function.
2906 (Incremental_input_entry::do_dynobj_entry): New function.
2907 (Incremental_input_entry::as_needed_): New data member.
2908 (Incremental_object_entry::Incremental_object_entry): Don't check
2910 (Incremental_object_entry::do_type): Likewise.
2911 (class Incremental_dynobj_entry): New class.
2912 (Incremental_input_entry_reader::as_needed): New function.
2913 (Incremental_input_entry_reader::get_soname): New function.
2914 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2915 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2916 size of shared library info entry.
2917 * layout.cc (Layout::finish_dynamic_section): Don't test for
2918 incremental link when adding DT_NEEDED entries.
2919 * object.h (Object::Object): Initialize new data member.
2920 (Object::dynobj): New function.
2921 (Object::set_as_needed): New function.
2922 (Object::as_needed): New function.
2923 (Object::do_dynobj): New function.
2924 (Object::as_needed_): New data member.
2926 2011-05-24 Cary Coutant <ccoutant@google.com>
2928 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2929 info; adjust display of GOT entries.
2930 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2931 vector of input objects; remove file_status_.
2932 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2933 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2934 got_plt reader; call target hooks to reserve GOT entries.
2935 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2936 of input file info header and GOT info entry.
2937 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2939 (Got_plt_view_info::got_descriptor): Remove.
2940 (Got_plt_view_info::sym_index): New data member.
2941 (Got_plt_view_info::input_index): New data member.
2942 (Local_got_offset_visitor::visit): Write input file index.
2943 (Global_got_offset_visitor::visit): Write 0 for input file index.
2944 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2945 with sym_index and input_index.
2946 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2947 incremental info GOT entry; replace got_descriptor with input_index.
2948 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2949 map from input file index to object.
2950 (Sized_relobj_incr::do_layout): Replace direct data member reference
2951 with accessor function.
2952 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2953 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2954 Adjust size of input file info header.
2955 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2956 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2957 (Incremental_input_entry_reader::get_input_section): Adjust size of
2958 input file info header.
2959 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2960 of incremental info GOT entry.
2961 (Incremental_got_plt_reader::get_got_desc): Remove.
2962 (Incremental_got_plt_reader::get_got_symndx): New function.
2963 (Incremental_got_plt_reader::get_got_input_index): New function.
2964 (Sized_incremental_binary::Sized_incremental_binary): Remove
2965 file_status_; add input_objects_.
2966 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2967 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2968 (Sized_incremental_binary::file_is_unchanged): Remove.
2969 (Sized_incremental_binary::set_input_object): New function.
2970 (Sized_incremental_binary::input_object): New function.
2971 (Sized_incremental_binary::file_status_): Remove.
2972 (Sized_incremental_binary::input_objects_): New data member.
2973 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2975 (Sized_relobj_incr::invalid_address): Move to base class.
2976 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2978 (Sized_relobj_incr::do_output_section_offset): Likewise.
2979 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2980 (Sized_relobj_incr::section_offsets_): Likewise.
2981 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2983 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2984 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2985 with accessor function.
2986 (Sized_relobj_file::do_layout): Likewise.
2987 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2988 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2989 (Sized_relobj_file::compute_final_local_value): Replace refs to
2990 section_offsets_ with accessor function.
2991 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2992 * object.h (Relobj::Relobj): Initialize new data members.
2993 (Relobj::add_dyn_reloc): New function.
2994 (Relobj::first_dyn_reloc): New function.
2995 (Relobj::dyn_reloc_count): New function.
2996 (Relobj::first_dyn_reloc_): New data member.
2997 (Relobj::dyn_reloc_count_): New data member.
2998 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3000 (Sized_relobj::Address): New typedef.
3001 (Sized_relobj::invalid_address): Move here from child class.
3002 (Sized_relobj::Sized_relobj): Initialize new data members.
3003 (Sized_relobj::sized_relobj): New function.
3004 (Sized_relobj::is_output_section_offset_invalid): Move here from
3006 (Sized_relobj::get_output_section_offset): Likewise.
3007 (Sized_relobj::local_has_got_offset): Likewise.
3008 (Sized_relobj::local_got_offset): Likewise.
3009 (Sized_relobj::set_local_got_offset): Likewise.
3010 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3011 (Sized_relobj::clear_got_offsets): New function.
3012 (Sized_relobj::section_offsets): Move here from child class.
3013 (Sized_relobj::do_output_section_offset): Likewise.
3014 (Sized_relobj::do_set_section_offset): Likewise.
3015 (Sized_relobj::Local_got_offsets): Likewise.
3016 (Sized_relobj::local_got_offsets_): Likewise.
3017 (Sized_relobj::section_offsets_): Likewise.
3018 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3020 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3022 (Sized_relobj_file::sized_relobj): New function
3023 (Sized_relobj_file::local_has_got_offset): Move to base class.
3024 (Sized_relobj_file::local_got_offset): Likewise.
3025 (Sized_relobj_file::set_local_got_offset): Likewise.
3026 (Sized_relobj_file::get_output_section_offset): Likewise.
3027 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3028 (Sized_relobj_file::do_output_section_offset): Likewise.
3029 (Sized_relobj_file::do_set_section_offset): Likewise.
3030 (Sized_relobj_file::Local_got_offsets): Likewise.
3031 (Sized_relobj_file::local_got_offsets_): Likewise.
3032 (Sized_relobj_file::section_offsets_): Likewise.
3033 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3035 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3036 (Output_reloc::get_symbol_index): Likewise.
3037 (Output_reloc::local_section_offset): Likewise.
3038 (Output_reloc::get_address): Likewise.
3039 (Output_reloc::symbol_value): Likewise.
3040 (Output_data_got::reserve_slot): Move to class definition.
3041 (Output_data_got::reserve_local): New function.
3042 (Output_data_got::reserve_slot_for_global): Remove.
3043 (Output_data_got::reserve_global): New function.
3044 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3045 (all constructors, two instantiations).
3046 (Output_reloc::get_relobj): New function (two instantiations).
3047 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3048 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3049 (Output_data_reloc::add_global): Adjust type of relobj.
3050 (Output_data_reloc::add_global_relative): Likewise.
3051 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3052 (Output_data_reloc::add_local): Likewise.
3053 (Output_data_reloc::add_local_relative): Likewise.
3054 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3055 (Output_data_reloc::add_local_section): Likewise.
3056 (Output_data_reloc::add_output_section): Likewise.
3057 (Output_data_reloc::add_absolute): Likewise.
3058 (Output_data_reloc::add_target_specific): Likewise.
3059 (Output_data_got::reserve_slot): Move definition here.
3060 (Output_data_got::reserve_local): New function.
3061 (Output_data_got::reserve_global): New function.
3062 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3063 section_offsets_ with accessor function.
3064 (Sized_relobj_file::write_sections): Likewise.
3065 (Sized_relobj_file::do_relocate_sections): Likewise.
3066 * target.h (Sized_target::reserve_local_got_entry): New function.
3067 (Sized_target::reserve_global_got_entry): New function.
3068 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3069 (Target_x86_64::reserve_global_got_entry): New function.
3070 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3072 2011-05-23 Cary Coutant <ccoutant@google.com>
3074 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3075 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3076 bit when checking got_type.
3077 * incremental.cc (Sized_incremental_binary::setup_readers):
3078 Store symbol table and string table locations; initialize bit vector
3079 of file status flags.
3080 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3082 (Sized_incremental_binary::do_process_got_plt): New function.
3083 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3084 (Output_section_incremental_inputs::set_final_data_size): Record
3085 file index for each input file.
3086 (Output_section_incremental_inputs::write_got_plt): Store file index
3087 instead of input entry offset for each GOT entry.
3089 (Incremental_input_entry::Incremental_input_entry): Initialize new
3091 (Incremental_input_entry::set_offset): Store file index.
3092 (Incremental_input_entry::get_file_index): New function.
3093 (Incremental_input_entry::file_index_): New data member.
3094 (Incremental_binary::process_got_plt): New function.
3095 (Incremental_binary::do_process_got_plt): New function.
3096 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3098 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3099 (Sized_incremental_binary::set_file_is_unchanged): New function.
3100 (Sized_incremental_binary::file_is_unchanged): New function.
3101 (Sized_incremental_binary::do_process_got_plt): New function.
3102 (Sized_incremental_binary::file_status_): New data member.
3103 (Sized_incremental_binary::main_symtab_loc_): New data member.
3104 (Sized_incremental_binary::main_strtab_loc_): New data member.
3105 * output.cc (Output_data_got::Got_entry::write): Add case
3107 (Output_data_got::add_global): Call add_got_entry.
3108 (Output_data_got::add_global_plt): Likewise.
3109 (Output_data_got::add_global_with_rel): Likewise.
3110 (Output_data_got::add_global_with_rela): Likewise.
3111 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3112 (Output_data_got::add_global_pair_with_rela): Likewise.
3113 (Output_data_got::add_local): Call add_got_entry.
3114 (Output_data_got::add_local_plt): Likewise.
3115 (Output_data_got::add_local_with_rel): Likewise.
3116 (Output_data_got::add_local_with_rela): Likewise.
3117 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3118 (Output_data_got::add_local_pair_with_rela): Likewise.
3119 (Output_data_got::reserve_slot): New function.
3120 (Output_data_got::reserve_slot_for_global): New function.
3121 (Output_data_got::add_got_entry): New function.
3122 (Output_data_got::add_got_entry_pair): New function.
3123 (Output_section::add_output_section_data): Edit FIXME.
3125 (Output_section_data_build::Output_section_data_build): New
3126 constructor with size parameter.
3127 (Output_data_space::Output_data_space): Likewise.
3128 (Output_data_got::Output_data_got): Initialize new data member; new
3129 constructor with size parameter.
3130 (Output_data_got::add_constant): Call add_got_entry.
3131 (Output_data_got::reserve_slot): New function.
3132 (Output_data_got::reserve_slot_for_global): New function.
3133 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3134 (Output_data_got::add_got_entry): New function.
3135 (Output_data_got::add_got_entry_pair): New function.
3136 (Output_data_got::free_list_): New data member.
3137 * target.h (Sized_target::init_got_plt_for_update): New function.
3138 (Sized_target::register_global_plt_entry): New function.
3139 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3140 Initialize new data member; call init; add constructor with PLT count.
3141 (Output_data_plt_x86_64::init): New function.
3142 (Output_data_plt_x86_64::add_relocation): New function.
3143 (Output_data_plt_x86_64::reserve_slot): New function.
3144 (Output_data_plt_x86_64::free_list_): New data member.
3145 (Target_x86_64::init_got_plt_for_update): New function.
3146 (Target_x86_64::register_global_plt_entry): New function.
3147 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3148 incremental updates.
3149 (Output_data_plt_x86_64::add_relocation): New function.
3150 * testsuite/object_unittest.cc (Object_test): Set default options.
3152 2011-05-16 Ian Lance Taylor <iant@google.com>
3154 * options.h (class General_options): Make -i a synonym for -r.
3156 2011-05-16 Ian Lance Taylor <iant@google.com>
3158 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3160 2011-05-10 Cary Coutant <ccoutant@google.com>
3162 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3165 2011-05-06 Ian Lance Taylor <iant@google.com>
3167 * layout.cc (Layout::layout): If the output section flags change,
3168 update the ordering.
3170 2011-04-25 Cary Coutant <ccoutant@google.com>
3172 * incremental-dump.cc (dump_incremental_inputs): Print local
3173 symbol info for each input file.
3175 (Output_section_incremental_inputs::set_final_data_size): Add local
3176 symbol info to input file entries in incremental info.
3177 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3178 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3179 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3180 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3182 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3183 (Sized_incr_relobj::do_relocate): Write the local symbols.
3184 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3185 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3186 Adjust size of input file header.
3187 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3188 (Incremental_inputs_reader::get_local_symbol_count): New function.
3189 (Incremental_inputs_reader::get_input_section): Adjust size of input
3191 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3192 (Sized_incr_relobj::This): New typedef.
3193 (Sized_incr_relobj::sym_size): New const data member.
3194 (Sized_incr_relobj::Local_symbol): New struct.
3195 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3196 (Sized_incr_relobj::do_local_symbol_offset): New function.
3197 (Sized_incr_relobj::local_symbol_count_): New data member.
3198 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3199 (Sized_incr_relobj::local_symbol_index_): New data member.
3200 (Sized_incr_relobj::local_symbol_offset_): New data member.
3201 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3202 (Sized_incr_relobj::local_symbols_): New data member.
3203 * object.h (Relobj::output_local_symbol_count): New function.
3204 (Relobj::local_symbol_offset): New function.
3205 (Relobj::do_output_local_symbol_count): New function.
3206 (Relobj::do_local_symbol_offset): New function.
3207 (Sized_relobj::do_output_local_symbol_count): New function.
3208 (Sized_relobj::do_local_symbol_offset): New function.
3210 2011-04-22 Vladimir Simonov <sv@sw.ru>
3212 * descriptors.cc (set_close_on_exec): New function.
3213 (Descriptors::open): Use set_close_on_exec.
3214 * output.cc (S_ISLNK): Define if not defined.
3216 2011-04-22 Cary Coutant <ccoutant@google.com>
3218 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3220 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3221 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3222 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3224 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3225 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3226 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3228 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3230 (Incremental_binary::apply_incremental_relocs): New function.
3231 (Incremental_binary::do_apply_incremental_relocs): New function.
3232 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3234 (Sized_incremental_binary::add_global_symbol): New function.
3235 (Sized_incremental_binary::global_symbol): New function.
3236 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3237 (Sized_incremental_binary::symbol_map_): New data member.
3238 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3239 * target.h (Sized_target::apply_relocation): New function.
3240 * target-reloc.h (apply_relocation): New function.
3241 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3243 2011-04-22 Doug Kwan <dougkwan@google.com>
3245 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3246 flag of a SHT_ARM_EXIDX section.
3247 * testsuite/Makefile.am (arm_exidx_test): New test rules.
3248 * testsuite/Makefile.in: Regenerate.
3249 * testsuite/arm_exidx_test.s: New file.
3250 * testsuite/arm_exidx_test.sh: Same.
3252 2011-04-20 Cary Coutant <ccoutant@google.com>
3255 * archive.h (Incremental_archive_entry::Archive_member):
3256 Initialize arg_serial_ (second constructor).
3258 2011-04-17 Ian Lance Taylor <iant@google.com>
3260 * object.cc (Relocate_info::location): Simplify location string.
3261 * errors.cc (Errors::error_at_location): Don't print program
3263 (Errors::warning_at_location): Likewise.
3264 (Errors::undefined_symbol): Likewise.
3265 * testsuite/debug_msg.sh: Update accordingly.
3267 2011-04-14 Cary Coutant <ccoutant@google.com>
3269 * gold/layout.cc (Layout::symtab_section_offset): New function.
3270 * gold/layout.h (Layout::symtab_section_offset): New function.
3271 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3273 2011-04-12 Ian Lance Taylor <iant@google.com>
3275 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3276 with MREMAP_MAYMOVE.
3277 * output.h (class Output_file): Add map_is_allocated_ field.
3278 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3279 not available, provide stubs. If mremap is not available, #define
3281 (MREMAP_MAYMOVE): Define if not defined.
3282 (Output_file::Output_file): Initialize map_is_allocated_.
3283 (Output_file::resize): Check map_is_allocated_.
3284 (Output_file::map_anonymous): If mmap fails, use malloc.
3285 (Output_file::unmap): Don't do anything for an anonymous map.
3286 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3287 is not available, provide stubs.
3288 (File_read::View::~View): Use free rather than delete[].
3289 (File_read::make_view): Use malloc rather than new[]. If mmap
3291 (File_read::find_or_make_view): Use malloc rather than new[].
3292 * gold.h: Remove HAVE_REMAP code.
3293 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3294 exists. Rename mremap to gold_mremap. If mmap is not available
3296 * configure, config.in: Rebuild.
3298 2011-04-11 Ian Lance Taylor <iant@google.com>
3300 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3301 initialize local variable v.
3303 2011-04-11 Cary Coutant <ccoutant@google.com>
3305 * archive.cc (Archive::include_member): Adjust call to
3307 (Add_archive_symbols::run): Track argument serial numbers.
3308 (Lib_group::include_member): Likewise.
3309 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3310 * archive.h (Incremental_archive_entry::Archive_member):
3311 Initialize arg_serial_.
3312 (Archive_member::arg_serial_): New data member.
3313 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3314 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3316 (Sized_dynobj::do_for_all_local_got_entries): New function.
3317 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3319 * fileread.cc (get_mtime): New function.
3320 * fileread.h (get_mtime): New function.
3321 * gold.cc (queue_initial_tasks): Check for incremental update.
3322 (process_incremental_input): New function.
3323 (queue_middle_tasks): Don't force valid target for incremental
3325 * incremental-dump.cc (find_input_containing_global): Adjust
3326 size of symbol info entry.
3327 (dump_incremental_inputs): Dump argument serial number and
3328 in_system_directory flag; bias shndx by 1; print symbol names
3329 when dumping per-file symbol lists; use new symbol info readers.
3331 (Output_section_incremental_inputs:update_data_size): New function.
3332 (Sized_incremental_binary::setup_readers): Setup input readers
3333 for each input file; build maps for files added from libraries
3335 (Sized_incremental_binary::check_input_args): New function.
3336 (Sized_incremental_binary::do_check_inputs): Build map of argument
3337 serial numbers to input arguments.
3338 (Sized_incremental_binary::do_file_has_changed): Rename
3339 do_file_is_unchanged to this; compare file modification times.
3340 (Sized_incremental_binary::do_init_layout): New function.
3341 (Sized_incremental_binary::do_reserve_layout): New function.
3342 (Sized_incremental_binary::do_get_input_reader): Remove.
3343 (Sized_incremental_binary::get_symtab_view): New function.
3344 (Incremental_checker::can_incrementally_link_output_file): Remove.
3345 (Incremental_inputs::report_command_line): Exclude --debug options.
3346 (Incremental_inputs::report_archive_begin): Add parameter; track
3347 argument serial numbers; don't put input file entry for archive
3348 before archive members.
3349 (Incremental_inputs::report_archive_end): Put input file entry
3350 for archive after archive members.
3351 (Incremental_inputs::report_object): Add parameter; track argument
3352 serial numbers and in_system_directory flag.
3353 (Incremental_inputs::report_script): Add parameter; track argument
3355 (Output_section_incremental_inputs::set_final_data_size): Adjust
3356 size of symbol info entry; check for forwarding symbols.
3357 (Output_section_incremental_inputs::write_input_files): Write
3358 in_system_directory flag and argument serial number.
3359 (Output_section_incremental_inputs::write_info_blocks): Map section
3360 indices between incremental info and original input file; store
3361 input section index for each symbol.
3362 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3363 change operator() to visit().
3364 (class Global_got_offset_visitor): Likewise.
3365 (class Global_symbol_visitor_got_plt):
3366 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3368 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3369 (Sized_incr_relobj::do_read_symbols): New function.
3370 (Sized_incr_relobj::do_layout): New function.
3371 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3372 (Sized_incr_relobj::do_add_symbols): New function.
3373 (Sized_incr_relobj::do_should_include_member): New function.
3374 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3375 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3376 (Sized_incr_relobj::do_section_size): New function.
3377 (Sized_incr_relobj::do_section_name): New function.
3378 (Sized_incr_relobj::do_section_contents): New function.
3379 (Sized_incr_relobj::do_section_flags): New function.
3380 (Sized_incr_relobj::do_section_entsize): New function.
3381 (Sized_incr_relobj::do_section_address): New function.
3382 (Sized_incr_relobj::do_section_type): New function.
3383 (Sized_incr_relobj::do_section_link): New function.
3384 (Sized_incr_relobj::do_section_info): New function.
3385 (Sized_incr_relobj::do_section_addralign): New function.
3386 (Sized_incr_relobj::do_initialize_xindex): New function.
3387 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3388 (Sized_incr_relobj::do_read_relocs): New function.
3389 (Sized_incr_relobj::do_gc_process_relocs): New function.
3390 (Sized_incr_relobj::do_scan_relocs): New function.
3391 (Sized_incr_relobj::do_count_local_symbols): New function.
3392 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3393 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3394 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3395 (Sized_incr_relobj::do_relocate): New function.
3396 (Sized_incr_relobj::do_set_section_offset): New function.
3397 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3398 (Sized_incr_dynobj::do_read_symbols): New function.
3399 (Sized_incr_dynobj::do_layout): New function.
3400 (Sized_incr_dynobj::do_add_symbols): New function.
3401 (Sized_incr_dynobj::do_should_include_member): New function.
3402 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3403 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3404 (Sized_incr_dynobj::do_section_size): New function.
3405 (Sized_incr_dynobj::do_section_name): New function.
3406 (Sized_incr_dynobj::do_section_contents): New function.
3407 (Sized_incr_dynobj::do_section_flags): New function.
3408 (Sized_incr_dynobj::do_section_entsize): New function.
3409 (Sized_incr_dynobj::do_section_address): New function.
3410 (Sized_incr_dynobj::do_section_type): New function.
3411 (Sized_incr_dynobj::do_section_link): New function.
3412 (Sized_incr_dynobj::do_section_info): New function.
3413 (Sized_incr_dynobj::do_section_addralign): New function.
3414 (Sized_incr_dynobj::do_initialize_xindex): New function.
3415 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3416 (make_sized_incremental_object): New function.
3417 (Incremental_library::copy_unused_symbols): New function.
3418 (Incremental_library::do_for_all_unused_symbols): New function.
3419 * incremental.h (enum Incremental_input_flags): New type.
3420 (class Incremental_checker): Remove.
3421 (Incremental_input_entry::Incremental_input_entry): Add argument
3423 (Incremental_input_entry::arg_serial): New function.
3424 (Incremental_input_entry::set_is_in_system_directory): New function.
3425 (Incremental_input_entry::is_in_system_directory): New function.
3426 (Incremental_input_entry::arg_serial_): New data member.
3427 (Incremental_input_entry::is_in_system_directory_): New data member.
3428 (class Script_info): Move here from script.h.
3429 (Script_info::Script_info): Add filename parameter.
3430 (Script_info::filename): New function.
3431 (Script_info::filename_): New data member.
3432 (Incremental_script_entry::Incremental_script_entry): Add argument
3434 (Incremental_object_entry::Incremental_object_entry): Likewise.
3435 (Incremental_object_entry::add_input_section): Build list of input
3436 sections with map to original shndx.
3437 (Incremental_object_entry::get_input_section_index): New function.
3438 (Incremental_object_entry::shndx_): New data member.
3439 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3440 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3441 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3443 (Incremental_inputs::report_archive_begin): Likewise.
3444 (Incremental_inputs::report_object): Likewise.
3445 (Incremental_inputs::report_script): Likewise.
3446 (class Incremental_global_symbol_reader): New class.
3447 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3448 and store flags and input file type.
3449 (Incremental_input_entry_reader::arg_serial): New function.
3450 (Incremental_input_entry_reader::type): Extract type from flags.
3451 (Incremental_input_entry_reader::is_in_system_directory): New function.
3452 (Incremental_input_entry_reader::get_input_section_count): Call
3453 accessor function for type.
3454 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3455 function for type; adjust size of global symbol entry.
3456 (Incremental_input_entry_reader::get_global_symbol_count): Call
3457 accessor function for type.
3458 (Incremental_input_entry_reader::get_object_count): Likewise.
3459 (Incremental_input_entry_reader::get_object_offset): Likewise.
3460 (Incremental_input_entry_reader::get_member_count): Likewise.
3461 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3462 (Incremental_input_entry_reader::get_member_offset): Likewise.
3463 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3464 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3465 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3466 (Incremental_input_entry_reader::get_global_symbol_reader): New
3468 (Incremental_input_entry_reader::get_output_symbol_index): New
3470 (Incremental_input_entry_reader::type_): Remove.
3471 (Incremental_input_entry_reader::flags_): New data member.
3472 (Incremental_inputs_reader::input_file_offset): New function.
3473 (Incremental_inputs_reader::input_file_index): New function.
3474 (Incremental_inputs_reader::input_file): Call input_file_offset.
3475 (Incremental_inputs_reader::input_file_at_offset): New function.
3476 (Incremental_relocs_reader::get_r_type): Reformat.
3477 (Incremental_relocs_reader::get_r_shndx): Reformat.
3478 (Incremental_relocs_reader::get_r_offset): Reformat.
3479 (Incremental_relocs_reader::data): New function.
3480 (Incremental_binary::Incremental_binary): Initialize new data members.
3481 (Incremental_binary::check_inputs): Add cmdline parameter.
3482 (Incremental_binary::file_is_unchanged): Remove.
3483 (Input_reader::arg_serial): New function.
3484 (Input_reader::get_unused_symbol_count): New function.
3485 (Input_reader::get_unused_symbol): New function.
3486 (Input_reader::do_arg_serial): New function.
3487 (Input_reader::do_get_unused_symbol_count): New function.
3488 (Input_reader::do_get_unused_symbol): New function.
3489 (Incremental_binary::input_file_count): New function.
3490 (Incremental_binary::get_input_reader): Change signature to use
3491 index instead of filename.
3492 (Incremental_binary::file_has_changed): New function.
3493 (Incremental_binary::get_input_argument): New function.
3494 (Incremental_binary::get_library): New function.
3495 (Incremental_binary::get_script_info): New function.
3496 (Incremental_binary::init_layout): New function.
3497 (Incremental_binary::reserve_layout): New function.
3498 (Incremental_binary::output_file): New function.
3499 (Incremental_binary::do_check_inputs): New function.
3500 (Incremental_binary::do_file_is_unchanged): Remove.
3501 (Incremental_binary::do_file_has_changed): New function.
3502 (Incremental_binary::do_init_layout): New function.
3503 (Incremental_binary::do_reserve_layout): New function.
3504 (Incremental_binary::do_input_file_count): New function.
3505 (Incremental_binary::do_get_input_reader): Change signature.
3506 (Incremental_binary::input_args_map_): New data member.
3507 (Incremental_binary::library_map_): New data member.
3508 (Incremental_binary::script_map_): New data member.
3509 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3511 (Sized_incremental_binary::output_section): New function.
3512 (Sized_incremental_binary::inputs_reader): Add const.
3513 (Sized_incremental_binary::symtab_reader): Add const.
3514 (Sized_incremental_binary::relocs_reader): Add const.
3515 (Sized_incremental_binary::got_plt_reader): Add const.
3516 (Sized_incremental_binary::get_symtab_view): New function.
3517 (Sized_incremental_binary::Inputs_reader): New typedef.
3518 (Sized_incremental_binary::Input_entry_reader): New typedef.
3519 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3520 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3521 (Sized_incremental_binary::do_file_has_changed): New function.
3522 (Sized_incremental_binary::do_init_layout): New function.
3523 (Sized_incremental_binary::do_reserve_layout): New function.
3524 (Sized_input_reader::Inputs_reader): Remove.
3525 (Sized_input_reader::Input_entry_reader): Remove.
3526 (Sized_input_reader::do_arg_serial): New function.
3527 (Sized_input_reader::do_get_unused_symbol_count): New function.
3528 (Sized_input_reader::do_get_unused_symbol): New function.
3529 (Sized_incremental_binary::do_input_file_count): New function.
3530 (Sized_incremental_binary::do_get_input_reader): Change signature;
3531 use index instead of filename.
3532 (Sized_incremental_binary::section_map_): New data member.
3533 (Sized_incremental_binary::input_entry_readers_): New data member.
3534 (class Sized_incr_relobj): New class.
3535 (class Sized_incr_dynobj): New class.
3536 (make_sized_incremental_object): New function.
3537 (class Incremental_library): New class.
3538 * layout.cc (Free_list::num_lists): New static data member.
3539 (Free_list::num_nodes): New static data member.
3540 (Free_list::num_removes): New static data member.
3541 (Free_list::num_remove_visits): New static data member.
3542 (Free_list::num_allocates): New static data member.
3543 (Free_list::num_allocate_visits): New static data member.
3544 (Free_list::init): New function.
3545 (Free_list::remove): New function.
3546 (Free_list::allocate): New function.
3547 (Free_list::dump): New function.
3548 (Free_list::print_stats): New function.
3549 (Layout_task_runner::run): Resize output file for incremental updates.
3550 (Layout::Layout): Initialize new data members.
3551 (Layout::set_incremental_base): New function.
3552 (Layout::init_fixed_output_section): New function.
3553 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3554 incremental updates.
3555 (Layout::create_gold_note): Do not create gold note section for
3556 incremental updates.
3557 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3558 for incremental updates.
3559 (Layout::set_section_offsets): For incremental updates, allocate space
3561 (Layout::create_symtab_sections): Layout with offsets relative to
3562 start of section; for incremental updates, allocate space from free
3564 (Layout::create_shdrs): For incremental updates, allocate space from
3566 (Layout::finish_dynamic_section): For incremental updates, do not
3567 check --as-needed (fixed in subsequent patch).
3568 * layout.h (class Free_list): New class.
3569 (Layout::set_incremental_base): New function.
3570 (Layout::incremental_base): New function.
3571 (Layout::init_fixed_output_section): New function.
3572 (Layout::allocate): New function.
3573 (Layout::incremental_base_): New data member.
3574 (Layout::free_list_): New data member.
3575 * main.cc (main): Print Free_list statistics.
3576 * object.cc (Relobj::finalize_incremental_relocs): Add
3577 clear_counts parameter; clear counts only when clear_counts is set.
3578 (Sized_relobj::Sized_relobj): Initialize new base class.
3579 (Sized_relobj::do_layout): Don't report special sections.
3580 (Sized_relobj::do_for_all_local_got_entries): New function.
3581 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3582 symtab_off to all symbol table offsets.
3583 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3584 * object.h (class Got_offset_list): Move to top of file.
3585 (Object::Object): Allow case where input_file == NULL.
3586 (Object::~Object): Likewise.
3587 (Object::input_file): Assert that input_file != NULL.
3588 (Object::lock): Allow case where input_file == NULL.
3589 (Object::unlock): Likewise.
3590 (Object::is_locked): Likewise.
3591 (Object::token): Likewise.
3592 (Object::release): Likewise.
3593 (Object::is_incremental): New function.
3594 (Object::get_mtime): New function.
3595 (Object::for_all_local_got_entries): New function.
3596 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3597 (Object::set_is_in_system_directory): New function.
3598 (Object::is_in_system_directory): New function.
3599 (Object::do_is_incremental): New function.
3600 (Object::do_get_mtime): New function.
3601 (Object::do_for_all_local_got_entries): New function.
3602 (Object::is_in_system_directory_): New data member.
3603 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3604 (class Sized_relobj_base): New class.
3605 (class Sized_relobj): Derive from Sized_relobj_base.
3606 (class Sized_relobj::Symbols): Redeclare from base class.
3607 (class Sized_relobj::local_got_offset_list): Remove.
3608 (class Sized_relobj::Output_sections): Redeclare from base class.
3609 (class Sized_relobj::do_for_all_local_got_entries): New function.
3610 (class Sized_relobj::write_local_symbols): Add offset parameter.
3611 (class Sized_relobj::local_symbol_offset_): Update comment.
3612 (class Sized_relobj::local_dynsym_offset_): Update comment.
3613 * options.cc (Input_arguments::add_file): Remove const.
3614 * options.h (Input_file_argument::Input_file_argument):
3615 Initialize arg_serial_ (all constructors).
3616 (Input_file_argument::set_arg_serial): New function.
3617 (Input_file_argument::arg_serial): New function.
3618 (Input_file_argument::arg_serial_): New data member.
3619 (Input_arguments::Input_arguments): Initialize file_count_.
3620 (Input_arguments::add_file): Remove const.
3621 (Input_arguments::number_of_input_files): New function.
3622 (Input_arguments::file_count_): New data member.
3623 (Command_line::number_of_input_files): Call
3624 Input_arguments::number_of_input_files.
3625 * output.cc (Output_segment_headers::Output_segment_headers):
3627 (Output_section::Input_section::current_data_size): New function.
3628 (Output_section::Output_section): Initialize new data members.
3629 (Output_section::add_input_section): Don't do merge sections for
3630 an incremental link; allocate space from free list for an
3632 (Output_section::add_output_section_data): Allocate space from
3633 free list for an incremental update.
3634 (Output_section::update_data_size): New function.
3635 (Output_section::set_fixed_layout): New function.
3636 (Output_section::reserve): New function.
3637 (Output_segment::set_section_addresses): Remove const.
3638 (Output_segment::set_section_list_addresses): Remove const; allocate
3639 space from free list for an incremental update.
3640 (Output_segment::set_offset): Adjust size of RELRO segment for an
3642 * output.h (Output_data::current_data_size): Move here from
3644 (Output_data::pre_finalize_data_size): New function.
3645 (Output_data::update_data_size): New function.
3646 (Output_section_headers::update_data_size): new function.
3647 (Output_section_data_build::current_data_size): Move to Output_data.
3648 (Output_data_strtab::update_data_size): New function.
3649 (Output_section::current_data_size): Move to Output_data.
3650 (Output_section::set_fixed_layout): New function.
3651 (Output_section::has_fixed_layout): New function.
3652 (Output_section::reserve): New function.
3653 (Output_section::update_data_size): New function.
3654 (Output_section::has_fixed_layout_): New data member.
3655 (Output_section::free_list_): New data member.
3656 (Output_segment::set_section_addresses): Remove const.
3657 (Output_segment::set_section_list_addresses): Remove const.
3658 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3660 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3662 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3663 parameter when calling Add_symbols constructor; store argument
3664 serial number for members of a lib group.
3665 (Add_symbols::locks): Allow case where token == NULL.
3666 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3667 (Read_member::~Read_member): New function.
3668 (Read_member::is_runnable): New function.
3669 (Read_member::locks): New function.
3670 (Read_member::run): New function.
3671 (Check_script::~Check_script): New function.
3672 (Check_script::is_runnable): New function.
3673 (Check_script::locks): New function.
3674 (Check_script::run): New function.
3675 (Check_library::~Check_library): New function.
3676 (Check_library::is_runnable): New function.
3677 (Check_library::locks): New function.
3678 (Check_library::run): New function.
3679 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3680 (Add_symbols::library_): New data member.
3681 (class Read_member): New class.
3682 (class Check_script): New class.
3683 (class Check_library): New class.
3684 * reloc.cc (Read_relocs::is_runnable): Allow case where
3686 (Read_relocs::locks): Likewise.
3687 (Scan_relocs::locks): Likewise.
3688 (Relocate_task::locks): Likewise.
3689 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3691 (Sized_relobj::incremental_relocs_scan): Fix comment.
3692 (Sized_relobj::do_relocate): Pass output file offset to
3693 write_local_symbols.
3694 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3695 from class declaration.
3696 * script.cc (read_input_script): Allocate Script_info; pass
3697 argument serial number to report_script.
3698 * script.h (class Script_info): Move to incremental.h.
3699 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3700 * symtab.h (Symbol_table::add_from_incrobj): New function.
3701 (Symbol_table::set_file_offset): New function.
3703 2011-04-05 Cary Coutant <ccoutant@google.com>
3705 * incremental-dump.cc (dump_incremental_inputs): Change signature
3706 to take a Sized_incremental_binary; change caller. Use readers
3707 in Sized_incremental_binary.
3709 (Sized_incremental_binary::find_incremental_inputs_sections):
3710 Rename do_find_incremental_inputs_sections to this.
3711 (Sized_incremental_binary::setup_readers): New function.
3712 (Sized_incremental_binary::do_check_inputs): Check
3713 has_incremental_info_ flag; move setup code to setup_readers;
3715 (Sized_incremental_binary::do_file_is_unchanged): New function.
3716 (Sized_incremental_binary::do_get_input_reader): New function.
3717 * incremental.h (class Incremental_binary): Move to end of file.
3718 (Incremental_binary::file_is_unchanged): New function.
3719 (Incremental_binary::do_file_is_unchanged): New function.
3720 (Incremental_binary::Input_reader): New class.
3721 (Incremental_binary::get_input_reader): New function.
3722 (class Sized_incremental_binary): Move to end of file.
3723 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3724 input section reader classes.
3725 (Sized_incremental_binary::has_incremental_info): New function.
3726 (Sized_incremental_binary::inputs_reader): New function.
3727 (Sized_incremental_binary::symtab_reader): New function.
3728 (Sized_incremental_binary::relocs_reader): New function.
3729 (Sized_incremental_binary::got_plt_reader): New function.
3730 (Sized_incremental_binary::do_file_is_unchanged): New function.
3731 (Sized_incremental_binary::Sized_input_reader): New class.
3732 (Sized_incremental_binary::get_input_reader): New function.
3733 (Sized_incremental_binary::find_incremental_inputs_sections):
3734 Rename do_find_incremental_inputs_sections to this.
3735 (Sized_incremental_binary::setup_readers): New function.
3736 (Sized_incremental_binary::has_incremental_info_): New data member.
3737 (Sized_incremental_binary::inputs_reader_): New data member.
3738 (Sized_incremental_binary::symtab_reader_): New data member.
3739 (Sized_incremental_binary::relocs_reader_): New data member.
3740 (Sized_incremental_binary::got_plt_reader_): New data member.
3741 (Sized_incremental_binary::current_input_file_): New data member.
3743 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3746 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3749 2011-03-30 Cary Coutant <ccoutant@google.com>
3751 * archive.cc (Archive::include_member): Adjust call to report_object.
3752 (Add_archive_symbols::run): Add script_info to call to
3753 report_archive_begin.
3754 (Lib_group::include_member): Adjust call to report_object.
3755 (Add_lib_group_symbols::run): Adjust call to report_object.
3756 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3757 blocks. Add object count for script input files.
3758 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3759 script_info parameter; change all callers.
3760 (Incremental_inputs::report_object): Add script_info parameter;
3762 (Incremental_inputs::report_script): Store backpointer to
3763 incremental info entry.
3764 (Output_section_incremental_inputs::set_final_data_size): Record
3765 additional information for scripts.
3766 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3767 * incremental.h (Incremental_script_entry::add_object): New function.
3768 (Incremental_script_entry::get_object_count): New function.
3769 (Incremental_script_entry::get_object): New function.
3770 (Incremental_script_entry::objects_): New data member; adjust
3772 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3773 (Incremental_inputs::report_object): Add script_info parameter.
3774 (Incremental_inputs_reader::get_object_count): New function.
3775 (Incremental_inputs_reader::get_object_offset): New function.
3776 * options.cc (Input_arguments::add_file): Return reference to
3778 * options.h (Input_argument::set_script_info): New function.
3779 (Input_argument::script_info): New function.
3780 (Input_argument::script_info_): New data member; adjust all
3782 (Input_file_group::add_file): Return reference to new input argument.
3783 (Input_file_lib::add_file): Likewise.
3784 (Input_arguments::add_file): Likewise.
3785 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3786 * script.cc (Parser_closure::Parser_closure): Add script_info
3787 parameter; adjust all callers.
3788 (Parser_closure::script_info): New function.
3789 (Parser_closure::script_info_): New data member.
3790 (read_input_script): Report scripts earlier to incremental info.
3791 (script_add_file): Set script_info in Input_argument.
3792 (script_add_library): Likewise.
3793 * script.h (Script_options::Script_info): Rewrite class.
3795 2011-03-29 Cary Coutant <ccoutant@google.com>
3797 * archive.cc (Library_base::should_include_member): Move
3798 method here from class Archive.
3799 (Archive::Archive): Initialize base class.
3800 (Archive::should_include_member): Move to base class.
3801 (Archive::do_for_all_unused_symbols): New function.
3802 (Add_archive_symbols::run): Remove redundant access to
3804 (Lib_group::Lib_group): Initialize base class.
3805 (Lib_group::do_filename): New function.
3806 (Lib_group::include_member): Pass pointer to Lib_group to
3808 (Lib_group::do_for_all_unused_symbols): New function.
3809 (Add_lib_group_symbols::run): Report archive information for
3811 * archive.h (class Library_base): New base class.
3812 (class Archive): Derive from Library_base.
3813 (Archive::filename): Move to base class.
3814 (Archive::set_incremental_info): Likewise.
3815 (Archive::incremental_info): Likewise.
3816 (Archive::Should_include): Likewise.
3817 (Archive::should_include_member): Likewise.
3818 (Archive::Armap_entry): Remove.
3819 (Archive::Unused_symbol_iterator): Remove.
3820 (Archive::unused_symbols_begin): Remove.
3821 (Archive::unused_symbols_end): Remove.
3822 (Archive::do_filename): New function.
3823 (Archive::do_get_mtime): New function.
3824 (Archive::do_for_all_unused_symbols): New function.
3825 (Archive::task_): Move to base class.
3826 (Archive::incremental_info_): Likewise.
3827 (class Lib_group): Derive from Library_base.
3828 (Lib_group::do_filename): New function.
3829 (Lib_group::do_get_mtime): New function.
3830 (Lib_group::do_for_all_unused_symbols): New function.
3831 (Lib_group::task_): Move to base class.
3832 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3834 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3836 * incremental.cc (Incremental_inputs::report_archive_begin):
3837 Use Library_base; call library's get_mtime; add incremental inputs
3838 entry before members.
3839 (class Unused_symbol_visitor): New class.
3840 (Incremental_inputs::report_archive_end): Use Library_base; use
3841 visitor class to record unused symbols; don't add incremental inputs
3842 entry after members.
3843 (Incremental_inputs::report_object): Use Library_base.
3845 (Incremental_archive_entry::Incremental_archive_entry): Remove
3846 unused Archive parameter.
3847 (Incremental_inputs::report_archive_begin): Use Library_base.
3848 (Incremental_inputs::report_archive_end): Likewise.
3849 (Incremental_inputs::report_object): Likewise.
3850 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3852 * object.h (Object::for_all_global_symbols): New function.
3853 (Object::do_for_all_global_symbols): New function.
3854 (Sized_relobj::do_for_all_global_symbols): New function.
3855 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3857 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3860 2011-03-27 Ian Lance Taylor <iant@google.com>
3862 * archive.cc (Archive::interpret_header): Return -1 if something
3863 goes wrong. Change callers accordingly.
3865 2011-03-25 Cary Coutant <ccoutant@google.com>
3867 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3868 * testsuite/Makefile.in: Regenerate.
3870 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
3872 * plugin.cc (get_view): New.
3873 (Plugin::load): Pass get_view to the plugin.
3874 (Plugin_manager::get_view): New.
3876 2011-03-21 Ian Lance Taylor <iant@google.com>
3878 * testsuite/final_layout.sh: Rewrite to not use dc.
3879 * testsuite/relro_test.sh: Fail if dc is not present.
3881 2011-03-21 Sriraman Tallam <tmsriram@google.com>
3883 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3885 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3886 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3888 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3889 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3891 2011-03-14 Ian Lance Taylor <iant@google.com>
3893 * script-sections.cc (Sort_output_sections::script_compare):
3894 Rename from is_before, change return type.
3895 (Sort_output_sections::operator()): Adjust accordingly.
3897 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3900 * testsuite/odr_violation2.cc: Add comment to make all error line
3901 numbers double digits.
3902 * testsuite/debug_msg.sh: Adjust expected errors.
3904 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3906 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3907 but mark earlier ones as non-canonical
3908 (offset_to_iterator): Update search target and example
3909 (do_addr2line): Return extra lines in a vector*
3910 (format_file_lineno): Extract from do_addr2line
3911 (one_addr2line): Add vector* out-param
3912 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3913 when a lineno entry appeared last for its instruction
3914 (Dwarf_line_info): Add vector* out-param
3915 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3916 * symtab.cc (Odr_violation_compare): Include the lineno in the
3918 (linenos_from_loc): New. Combine the canonical line for an
3919 address with its other lines.
3920 (True_if_intersect): New. Helper functor to make
3921 std::set_intersection a query.
3922 (detect_odr_violations): Compare sets of lines instead of just
3923 one line for each function. This became less deterministic, but
3924 has fewer false positives.
3925 * symtab.h: Declarations.
3926 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3927 mix an optimized and non-optimized object in the same binary
3928 (odr_violation2.so): Same.
3929 * testsuite/Makefile.in: Regenerate from Makefile.am.
3930 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3931 * testsuite/debug_msg.sh: Update line numbers and add
3933 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3934 non-optimized context.
3935 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3936 isn't inlined, and use OdrDerived in an optimized context.
3937 * testsuite/odr_header1.h: Defines OdrDerived, where
3938 optimization will change the
3939 first-instruction-in-the-destructor's file and line number.
3940 * testsuite/odr_header2.h: Defines OdrBase.
3942 2011-03-09 Ian Lance Taylor <iant@google.com>
3944 * fileread.cc (File_read::clear_views): Don't delete the whole
3947 2011-03-08 Ian Lance Taylor <iant@google.com>
3950 * fileread.cc: #include <climits>.
3951 (GOLD_IOV_MAX): Define.
3952 (File_read::read_multiple): Limit number of entries by iov_max.
3953 * fileread.h (class File_read): Always set max_readv_entries to
3956 2011-03-07 Ian Lance Taylor <iant@google.com>
3959 * options.h (class General_options): Add -dy and -dn.
3961 2011-03-02 Cary Coutant <ccoutant@google.com>
3963 * testsuite/script_test_9.t: Add TLS segment.
3965 2011-03-02 Simon Baldwin <simonb@google.com>
3967 * configure.ac: Add check for gnu_indirect_function support in
3968 the toolchain building binutils.
3969 * configure: Rebuild.
3971 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
3973 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3974 plugin only symbols.
3975 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3976 in plugin files as not needed in the symbol table.
3978 2011-02-11 Sriraman Tallam <tmsriram@google.com>
3980 * output.cc (Output_section::add_input_section): Delay fill
3981 generation for section ordering.
3983 2011-02-09 Ian Lance Taylor <iant@google.com>
3986 * object.h (class Sized_relobj): Remove clear_local_symbols.
3987 * reloc.cc (Sized_relobj::do_relocate): Don't call
3988 clear_local_symbols.
3990 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
3992 * plugin.cc (is_visible_from_outside): Return true for symbols
3995 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3997 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4000 2011-02-02 Sriraman Tallam <tmsriram@google.com>
4002 * icf.h (is_section_foldable_candidate): Change type of parameter
4004 * icf.cc (Icf::find_identical_sections): Change type of local variable
4005 section_name to be std::string.
4006 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4008 2011-01-25 Ian Lance Taylor <iant@google.com>
4010 * script.cc (script_add_extern): Rewrite to use
4011 add_symbol_reference.
4013 2011-01-25 Doug Kwan <dougkwan@google.com>
4015 * icf.cc (get_section_contents): Always lock section's object.
4017 2011-01-24 Ian Lance Taylor <iant@google.com>
4019 * options.h (class General_options): Accept
4020 --no-detect-odr-violations.
4022 2011-01-24 Ian Lance Taylor <iant@google.com>
4024 * version.cc (version_string): Bump to 1.11.
4026 2011-01-24 Ian Lance Taylor <iant@google.com>
4028 * plugin.cc (class Plugin_rescan): Define new class.
4029 (Plugin_manager::claim_file): Set any_claimed_.
4030 (Plugin_manager::save_archive): New function.
4031 (Plugin_manager::save_input_group): New function.
4032 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4034 (Plugin_manager::new_undefined_symbol): New function.
4035 (Plugin_manager::rescan): New function.
4036 (Plugin_manager::rescannable_defines): New function.
4037 (Plugin_manager::add_input_file): Set any_added_.
4038 * plugin.h (class Plugin_manager): define new fields rescannable_,
4039 undefined_symbols_, any_claimed_, and any_added_. Declare
4040 Plugin_rescan as friend. Declare new functions.
4041 (Plugin_manager::Rescannable): Define type.
4042 (Plugin_manager::Rescannable_list): Define type.
4043 (Plugin_manager::Undefined_symbol_list): Define type.
4044 (Plugin_manager::Plugin_manager): Initialize new fields.
4045 * archive.cc (Archive::defines_symbol): New function.
4046 (Add_archive_symbols::run): Pass archive to plugins if any.
4047 * archive.h (class Archive): Declare defines_symbol.
4048 * readsyms.cc (Input_group::~Input_group): New function.
4049 (Finish_group::run): Pass input_group to plugins if any.
4050 * readsyms.h (class Input_group): Declare destructor.
4051 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4054 2011-01-10 Ian Lance Taylor <iant@google.com>
4056 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4058 (Layout::set_segment_offsets): Reset increase_relro before calling
4059 set_section_addresses a second time.
4061 2011-01-04 Cary Coutant <ccoutant@google.com>
4063 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4064 sections before NOBITS sections.
4066 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4068 * version.cc (print_version): Update copyright to 2011.
4070 2010-12-23 Cary Coutant <ccoutant@google.com>
4072 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4073 of OS to this->add. Add OD parameter to second form of the function.
4075 2010-12-20 Ian Lance Taylor <iant@google.com>
4077 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4078 second of two consecutive entries with same offset.
4080 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4082 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4083 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4084 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4085 to avoid unneeded links against $(LDADD).
4086 * testsuite/Makefile.in: Regenerate.
4088 2010-12-15 Ian Lance Taylor <iant@google.com>
4091 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4092 for R_X86_64_32 and R_X86_64_PC32.
4093 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4094 ver_matching_def_pic.o.
4095 (ver_matching_def_pic.o): New target.
4097 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4099 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4100 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4101 Move definition before File_read::View member definitions.
4102 (File_read::View::~View): Initialize and hold lock before
4103 updating current_mapped_bytes.
4105 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4107 * dwarf_reader.cc: Remove outdated comment.
4108 * gold-threads.cc: Fix typo in error message.
4109 * archive.cc: Fix typos in comments.
4110 * archive.h: Likewise.
4111 * arm-reloc-property.cc: Likewise.
4112 * arm-reloc-property.h: Likewise.
4113 * arm-reloc.def: Likewise.
4115 * attributes.h: Likewise.
4116 * cref.cc: Likewise.
4117 * ehframe.cc: Likewise.
4118 * fileread.h: Likewise.
4120 * i386.cc: Likewise.
4122 * incremental.h: Likewise.
4123 * int_encoding.cc: Likewise.
4124 * layout.h: Likewise.
4125 * main.cc: Likewise.
4126 * merge.h: Likewise.
4127 * object.cc: Likewise.
4128 * object.h: Likewise.
4129 * options.cc: Likewise.
4130 * readsyms.cc: Likewise.
4131 * reduced_debug_output.cc: Likewise.
4132 * reloc.cc: Likewise.
4133 * script-sections.cc: Likewise.
4134 * sparc.cc: Likewise.
4135 * symtab.h: Likewise.
4136 * target-reloc.h: Likewise.
4137 * target.cc: Likewise.
4138 * target.h: Likewise.
4139 * timer.cc: Likewise.
4140 * timer.h: Likewise.
4141 * x86_64.cc: Likewise.
4143 2010-12-09 Cary Coutant <ccoutant@google.com>
4145 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4147 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4148 parameter; change all callers.
4149 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4150 * options.h (warn_execstack): New option.
4152 2010-12-07 Doug Kwan <dougkwan@google.com>
4154 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4155 like function call relocations.
4157 2010-12-07 Ian Lance Taylor <iant@google.com>
4159 * archive.cc (Archive::get_elf_object_for_member): Permit
4160 punconfigured to be NULL.
4161 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4162 (Archive::include_member): Pass NULL to get_elf_object_for_member
4163 if we searched for the archive and this is the first included
4166 2010-12-01 Ian Lance Taylor <iant@google.com>
4168 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4169 track_relocs_type_ field.
4170 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4171 Set track_relocs_type_.
4172 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4173 contents when using RELA relocs.
4174 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4176 * reloc.cc (Track_relocs::next_addend): New function.
4177 * reloc.h (class Track_relocs): Declare next_addend.
4179 2010-12-01 Ian Lance Taylor <iant@google.com>
4181 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4184 2010-12-01 Ian Lance Taylor <iant@google.com>
4186 * README: Update compilers known to work and fail.
4188 2010-11-23 Matthias Klose <doko@ubuntu.com>
4190 * configure.in: For --enable-gold, handle value `default' instead of
4191 `both*'. Always install ld as ld.bfd, install as ld if gold is
4193 * configure: Regenerate.
4195 2010-11-18 Doug Kwan <dougkwan@google.com>
4197 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4198 and right_alignment to be zero. Store result alignment only if it is
4199 greater than existing alignment.
4201 2010-11-16 Cary Coutant <ccoutant@google.com>
4204 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4205 Check for ".zdebug_line".
4207 2010-11-16 Doug Kwan <dougkwan@google.com>
4208 Cary Coutant <ccoutant@google.com>
4210 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4211 by reference; adjust all callers.
4212 * output.cc (Output_segment::set_section_addresses): Adjust references
4213 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4215 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4216 end at page boundary.
4218 2010-11-16 Cary Coutant <ccoutant@google.com>
4221 * layout.cc (Layout::choose_output_section): Transform names of
4222 compressed sections even when using a script with a SECTIONS clause.
4223 (Layout::output_section_name): Remove code to transform
4224 compressed debug section names.
4225 * output.cc (Output_section::add_input_section): Use uncompressed
4226 section size when tracking input sections.
4228 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4230 * symtab.h (Symbol::NON_PIC_REF): Remove.
4231 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4232 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4233 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4234 (Symbol::use_plt_offset): Take a flags argument and pass it
4235 directly to needs_dynamic_reloc. Restrict check for undefined
4236 weak symbols to function calls.
4237 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4238 (Target_arm::Scan::global): Use it.
4239 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4240 (Target_arm::Relocate::relocate): Likewise.
4241 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4242 parameter with an r_type parameter. Use get_reference_flags
4244 (Target_arm::Relocate::relocate): Update accordingly.
4245 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4246 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4247 (Target_i386::Scan::global): Likewise.
4248 (Target_i386::Relocate::relocate): Likewise.
4249 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4250 parameter with an r_type parameter. Use get_reference_flags
4252 (Target_i386::Relocate::relocate): Update accordingly.
4253 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4254 (Target_powerpc::Scan::global): Use it.
4255 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4256 (Target_powerpc::Relocate::relocate): Likewise.
4257 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4258 (Target_sparc::Scan::global): Use it.
4259 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4260 (Target_sparc::Relocate::relocate): Likewise.
4261 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4262 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4263 (Target_x86_64::Scan::global): Likewise.
4264 (Target_x86_64::Relocate::relocate): Likewise.
4266 2010-11-08 Doug Kwan <dougkwan@google.com>
4267 Cary Coutant <ccoutant@google.com>
4269 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4270 (Arm_exidx_merge_section::section_contents_): New data member.
4271 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4272 (Arm_input_section::~Arm_input_section): De-allocate memory.
4273 (Arm_input_section::original_contents_): New data member.
4274 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4275 in parameters instead of calling Object::section_contents without
4277 (Arm_output_section::group_section): New parameter TASK. Pass it
4278 to callees that need locking objects.
4279 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4280 to lock EXIDX input sections. Fix a formatting issue. Call
4281 Arm_exidx_merged_section::build_contents to create merged section
4283 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4284 to lock object of stub table owner.
4285 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4286 TEXT_SIZE to initialize data member TEXT_SIZE_.
4287 (Arm_exidx_input_section::addralign): Fix typo in comment.
4288 (Arm_exidx_input_section::text_size): New method.
4289 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4290 that require locking objects. Lock objects before scanning for stubs
4291 and updating local symbols.
4292 (Arm_input_section<big_endian>::init): Copy contents of original
4294 (Arm_input_section<big_endian>::do_write): Use saved contents of
4295 original input section instead of calling Object::section_contents
4297 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4298 size without calling Object::section_size().
4299 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4300 for size. Allocate a buffer for merged EXIDX entries.
4301 (Arm_exidx_merged_section::build_contents): New method.
4302 (Arm_exidx_merged_section::do_write): Move merge section contents
4303 building code to Arm_exidx_merged_section::build_contetns. Write
4304 out contetns in buffer instead of building it on the fly.
4305 (Arm_relobj::make_exidx_input_section): Also pass text section size
4306 to Arm_exidx_input_section constructor.
4307 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4308 (Arm_dynobj::do_read_symbols): Fix memory leak.
4309 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4310 * target.h: (class Task): Add forward declaration.
4311 (Target::relax): Add new parameter TASK and pass it to
4313 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4315 2010-11-05 Cary Coutant <ccoutant@google.com>
4318 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4319 object when reading from the file.
4320 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4322 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4323 when reading section contents.
4324 (get_section_contents): Likewise.
4325 (icf::find_identical_sections): Likewise.
4326 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4327 object when reading from the file.
4328 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4329 the object when doing deferred section layout.
4331 2010-11-03 Nick Clifton <nickc@redhat.com>
4334 * script.h (class Symbol_assignment: name): New member. Returns
4335 the name of the symbol.
4336 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4337 Returns true if the given symbol name is on the list of
4338 assignments wating to be processed.
4339 * archive.cc (should_incldue_member): If the symbol is undefined,
4340 check to see if it is on the list of symbols pending assignment.
4342 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4344 * script-sections.cc (Script_sections::find_memory_region): Check
4345 for a NULL output section pointer.
4347 2010-10-29 Doug Kwan <dougkwan@google.com>
4349 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4350 Output_section::add_relaxed_input_section.
4351 * output.cc (Output_section::add_relaxed_input_section): Add new
4352 arguments LAYOUT and NAME. Set section order index.
4353 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4354 Copy section order index.
4355 * output.h (Output_section::add_relaxed_input_section): Add new
4356 arguments LAYOUT and NAME.
4358 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4360 * testsuite/Makefile.am: Move gcctestdir/ld rule to
4361 NATIVE_OR_CROSS_LINKER.
4362 * testsuite/Makefile.in: Regenerate.
4364 2010-10-20 Doug Kwan <dougkwan@google.com>
4366 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4367 without SHF_LINK_ORDER flags.
4368 * layout.cc (Layout::choose_output_section): Do not filter
4369 SHF_LINK_ORDER flag in a relocatable link.
4371 2010-10-17 Cary Coutant <ccoutant@google.com>
4373 * output.h (Output_segment::set_section_addresses): Change function
4374 signature. Update all callers.
4375 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4377 (Output_segment::set_section_addresses): Align after last TLS
4378 section. Add padding before last relro section instead of after.
4380 2010-10-17 Doug Kwan <dougkwan@google.com>
4382 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4383 GOT output section to be writable.
4385 2010-10-14 Cary Coutant <ccoutant@google.com>
4387 * debug.h (DEBUG_INCREMENTAL): New flag.
4388 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4389 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4391 * incremental.cc (report_command_line): Ignore all forms of
4393 * layout.cc (Layout::Layout): Check parameters for incremental link
4395 * options.cc (General_options::parse_incremental): New function.
4396 (General_options::parse_no_incremental): New function.
4397 (General_options::parse_incremental_full): New function.
4398 (General_options::parse_incremental_update): New function.
4399 (General_options::incremental_mode_): New data member.
4400 (General_options::finalize): Check incremental_mode_.
4401 * options.h (General_options): Update help text for --incremental.
4402 Add --no-incremental, --incremental-full, --incremental-update.
4403 (General_options::Incremental_mode): New enum type.
4404 (General_options::incremental_mode): New function.
4405 (General_options::incremental_mode_): New data member.
4406 * parameters.cc (Parameters::incremental_mode_): New data member.
4407 (Parameters::set_options): Set incremental_mode_.
4408 (Parameters::set_incremental_full): New function.
4409 (Parameters::incremental): New function.
4410 (Parameters::incremental_update): New function.
4411 (set_parameters_incremental_full): New function.
4412 * parameters.h (Parameters::set_incremental_full): New function.
4413 (Parameters::incremental): New function.
4414 (Parameters::incremental_update): New function.
4415 (Parameters::incremental_mode_): New data member.
4416 (set_parameters_incremental_full): New function.
4417 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4418 incremental link mode.
4419 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4420 (Sized_relobj::do_relocate_sections): Likewise.
4421 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4423 * testsuite/Makefile.in: Regenerate.
4424 * testsuite/incremental_test.sh: Filter all forms of --incremental.
4426 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4428 * script-sections.h (class Script_sections): Make
4429 Sections_elements typedef public.
4430 * script-sections.cc (class Sort_output_sections): Add elements_
4431 field. Add constructor which sets it; change all callers.
4432 (Sort_output_sections::is_before): New function.
4433 (Sort_output_sections::operator()): Call is_before.
4434 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4436 * testsuite/script_test_10.sh: New test. Test script section
4438 * testsuite/script_test_10.t: Likewise.
4439 * testsuite/script_test_10.s: Likewise.
4440 * testsuite/Makefile.am: Wrap the cross linker tests and the
4441 common tests into NATIVE_OR_CROSS_LINKER.
4442 (check_SCRIPTS): Add script_test_10.sh.
4443 (check_DATA): Add script_test_10.stdout.
4444 (script_test_10.o, script_test_10): New targets.
4445 (script_test_10.stdout): New target.
4446 * configure, testsuite/Makefile.in: Regenerate.
4448 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4450 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4451 error for the deprecated relocations.
4452 (Target_arm::Scan::global): Likewise.
4453 (Target_arm::Relocate::relocate): Likewise.
4455 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4457 * fileread.cc (Input_file::find_file): Initialize *found_name
4458 and *namep when using the fallback search for case 4.
4460 2010-10-11 Cary Coutant <ccoutant@google.com>
4462 * options.h (class General_options): Redefine -z lazy as an alias for
4463 the negation of -z now.
4465 2010-10-11 Ian Lance Taylor <iant@google.com>
4467 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4470 2010-10-06 Nick Clifton <nickc@redhat.com>
4472 * script-sections.cc(class Memory_region): Remove
4473 current_lma_offset_ field. Rename current_vma_offset_ to
4474 current_offset_. Add last_section_ field.
4475 (Memory_region::get_current_vma_address): Rename to
4476 get_current_address.
4477 (Memory_region::get_current_lma_address): Delete.
4478 (Memory_region::increment_vma_offset): Rename to
4480 (Memory_region::increment_lma_offset): Delete.
4481 (Memory_region::attributes_compatible): New method. Returns
4482 true if the provided section is compatible with the region.
4483 (Memory_region::get_last_section): New method. Returns the last
4484 section to use the region.
4485 (Memory_region::set_last_section): New method. Stores the last
4486 section to use the region.
4487 (Script_sections::block_in_region): New method. Returns true if
4488 a block of memory is contained within a region.
4489 (Script_sections::find_memory_region): New method. Locates a
4490 memory region to be used to set a VMA or LMA address.
4491 (Output_section_definition::set_section_addresses): Add code to
4492 check for addresses set by memory regions.
4493 (Output_segment::set_section_addresses): Remove memory region
4495 (Script_sections::create_segment): Add a warning if a header
4496 segment is created outside of any region.
4497 * script-sections.h (class Script_sections): Add prototypes for
4498 find_memory_region and block_in_region methods.
4499 * testsuite/memory_test.s: Use .long instead of .word.
4500 * testsuite/memory_test.t: Add some more output sections.
4501 * testsuite/memory_test.sh: Update expected output.
4503 2010-10-02 Doug Kwan <dougkwan@google.com>
4505 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4506 defintion to symtab.h
4507 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4508 declaration to defintion.
4510 2010-10-01 Nick Clifton <nickc@redhat.com>
4512 * expression.cc (eval): Replace dummy argument with NULL.
4513 (eval_maybe_dot): Check for a NULL result section pointer.
4514 (Symbol_expression::value): Likewise.
4515 (Dot_expression::value): Likewise.
4516 (BINARY_EXPRESSION): Likewise.
4517 (Max_expression::value): Likewise.
4518 (Min_expression::value): Likewise.
4519 (Absolute_expression::value): Likewise.
4520 (Addr_expression::value_from_output_section): Likewise.
4521 (Loaddddr_expression::value_from_output_section): Likewise.
4522 (Segment_start_expression::value): Likewise.
4523 * script-sections.cc
4524 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4526 (Sections_elememt_dot_assignment::set_section_addresses):
4528 (Output_data_expression::do_write_to_buffer): Likewise.
4529 (Output_section_definition::finalize_symbols): Likewise.
4530 (Output_section_definition::set_section_addresses): Likewise.
4532 2010-09-30 Doug Kwan <dougkwan@google.com>
4534 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4536 2010-09-28 Sriraman Tallam <tmsriram@google.com>
4538 * target.h (Target::can_icf_inline_merge_sections): New virtual
4540 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4542 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4544 * icf.cc (get_section_contents): Inline merge sections only when
4547 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4549 * configure: Regenerate.
4551 2010-09-17 Ian Lance Taylor <iant@google.com>
4553 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
4554 * testsuite/Makefile.am (memory_test.o): New target.
4555 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4557 * testsuite/Makefile.in: Rebuild.
4559 2010-09-17 Doug Kwan <dougkwan@google.com>
4561 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4562 defintion if relocation uses GOT entries of the symbol.
4563 * testsuite/icf_safe_test.sh: Fix test.
4564 * testsuite/icf_safe_so_test.sh: Fix test.
4566 2010-09-16 Cary Coutant <ccoutant@google.com>
4568 * script_sections.cc (class Memory_region): Remove "NULL" from
4569 vector initializations.
4571 2010-09-15 Cary Coutant <ccoutant@google.com>
4573 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4574 Resolve forwarding symbols.
4576 2010-09-15 Doug Kwan <dougkwan@google.com>
4578 * gold/testsuite/script_test_3.t: Add ARM special sections.
4579 * gold/testsuite/script_test_4.t: Same.
4580 * gold/testsuite/script_test_5.t: Same.
4581 * gold/testsuite/script_test_6.t: Same.
4582 * gold/testsuite/script_test_7.t: Same.
4583 * gold/testsuite/script_test_7.t: Same.
4584 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4586 2010-09-14 Cary Coutant <ccoutant@google.com>
4588 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4589 (Target_x86_64::Relocate::relocate_tls): Replace check for
4590 saw_tls_block_reloc_ with test for executable section.
4592 2010-09-12 Cary Coutant <ccoutant@google.com>
4594 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4595 position-independent executables to shared libraries need dynamic
4597 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4598 position-independent executables.
4599 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4600 * testsuite/Makefile.in: Regenerate.
4602 2010-09-10 Nick Clifton <nickc@redhat.com>
4605 * testsuite/memory_test.t: Discard any sections that are not
4608 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4611 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4612 "This::" to work around a bug in gcc 4.2.
4614 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4616 2010-09-09 Rafael Espindola <espindola@google.com>
4618 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4619 sections with different PF_X flags in the same segment.
4620 (Layout::find_first_load_seg): Search all segments to find the first
4622 * options.h (rosegment): New.
4624 2010-09-08 Rafael Espindola <espindola@google.com>
4626 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
4628 2010-09-08 Doug Kwan <dougkwan@google.com>
4630 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4631 (Arm_relobj::do_relocate_sections): Add new parameter for output
4632 file to match the parent.
4633 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4634 of local symbols instead of input values. Update code to track
4635 changes in gold::relocate_section.
4636 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4637 (Sized_relobj::compute_final_local_value_internal): New methods.
4638 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4639 body into private version of Sized_relobj::compute_final_local_value.
4640 Call the inline method.
4641 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4642 merged symbol value if there is one.
4643 (Symbol_value::has_output_value): New method defintiion.
4644 (Sized_relobj::Compute_final_local_value_status): New enum type.
4645 (Sized_relobj::compute_final_local_value): New methods.
4646 (Sized_relobj::compute_final_local_value_internal): New methods.
4647 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4648 and arm_cortex_a8.sh.
4649 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4650 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4652 * Makefile.in: Regenerate.
4653 * testsuite/arm_bl_out_of_range.s: Update test.
4654 * testsuite/thumb_bl_out_of_range.s: Ditto.
4655 * testsuite/thumb_blx_out_of_range.s: Ditto.
4656 * testsuite/arm_branch_out_of_range.sh: New file.
4657 * testsuite/arm_cortex_a8.sh: Ditto.
4658 * testsuite/arm_cortex_a8_b.s: Ditto.
4659 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4660 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4661 * testsuite/arm_cortex_a8_bl.s: Ditto.
4662 * testsuite/arm_cortex_a8_blx.s: Ditto.
4663 * testsuite/arm_cortex_a8_local.s: Ditto.
4664 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4665 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4667 2010-09-08 Rafael Espindola <espindola@google.com>
4669 * Makefile.am (memory_test.stdout): Run readelf with -W.
4670 * Makefile.in: Regenerate.
4671 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4674 2010-09-08 Rafael Espindola <espindola@google.com>
4676 * script-sections.cc (Script_sections::add_memory_region): Convert
4677 field precision to int.
4678 * script.cc (script_set_section_region, script_set_section_region):
4679 Convert field precision to int.
4681 2010-09-08 Rafael Espindola <espindola@google.com>
4683 * arm.cc (do_finalize_sections): Create the __exidx_start and
4684 __exdix_end symbols even when the section is missing.
4686 2010-09-08 Nick Clifton <nickc@redhat.com>
4688 * README: Remove claim that MEMORY is not supported.
4689 * expression.cc (script_exp_function_origin)
4690 (script_exp_function_length): Move from here to ...
4691 * script.cc: ... here.
4692 (script_set_section_region, script_add_memory)
4693 (script_parse_memory_attr, script_include_directive): New
4695 * script-sections.cc
4696 (class Memory_region): New class.
4697 (class Output_section_definition): Add set_memory_region,
4698 set_section_vma, set_section_lma and get_section_name methods.
4699 (class Script_Sections): Add add_memory_region,
4700 find_memory_region, find_memory_region_origin,
4701 find_memory_region_length and set_memory_region methods.
4702 Have set_section_addresses method walk the list of set memory
4704 Extend the print methos to display memory regions.
4705 * script-sections.h: Add prototypes for new methods.
4706 Add enum for MEMORY region attributes.
4707 * yyscript.y: Add support for parsing MEMORY regions.
4708 * script-c.h: Add prototypes for new functions.
4709 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4710 * testsuite/Makefile.in: Regenerate.
4711 * testsuite/memory_test.sh: New script.
4712 * testsuite/memory_test.s: New assembler source file.
4713 * testsuite/memory_test.t: New linker script.
4715 2010-08-27 Doug Kwan <dougkwan@google.com>
4717 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4718 reference override an existing dynamic weak reference.
4719 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4720 * testsuite/Makefile.in: Regenerate.
4721 * testsuite/dyn_weak_ref.sh: New file.
4722 * testsuite/dyn_weak_ref_1.c: Ditto.
4723 * testsuite/dyn_weak_ref_2.c: Ditto.
4725 2010-08-27 Ian Lance Taylor <iant@google.com>
4727 * incremental.h (class Incremental_input_entry): Add virtual
4730 2010-08-27 Ian Lance Taylor <iant@google.com>
4732 * testsuite/start_lib_test_3.c: Mark t3 as used.
4734 2010-08-27 Nick Clifton <nickc@redhat.com>
4736 * options.cc (version_script): Fix small typo in previous
4739 2010-08-25 Nick Clifton <nickc@redhat.com>
4741 * archive.cc: Formatting fixes: Remove whitespace between
4742 typename and following asterisk. Remove whitespace between
4743 function name and opening parenthesis.
4744 * archive.h: Likewise.
4746 * attributes.cc: Likewise.
4747 * attributes.h: Likewise.
4748 * common.cc: Likewise.
4749 * copy-relocs.cc: Likewise.
4750 * dirsearch.h: Likewise.
4751 * dynobj.cc: Likewise.
4752 * ehframe.cc: Likewise.
4753 * ehframe.h: Likewise.
4754 * expression.cc: Likewise.
4755 * fileread.cc: Likewise.
4756 * fileread.h: Likewise.
4758 * gold-threads.cc: Likewise.
4759 * gold.cc: Likewise.
4760 * i386.cc: Likewise.
4762 * incremental-dump.cc: Likewise.
4763 * incremental.cc: Likewise.
4764 * layout.cc: Likewise.
4765 * layout.h: Likewise.
4766 * main.cc: Likewise.
4767 * merge.cc: Likewise.
4768 * merge.h: Likewise.
4769 * object.cc: Likewise.
4770 * object.h: Likewise.
4771 * options.cc: Likewise.
4772 * options.h: Likewise.
4773 * output.cc: Likewise.
4774 * output.h: Likewise.
4775 * plugin.cc: Likewise.
4776 * plugin.h: Likewise.
4777 * powerpc.cc: Likewise.
4778 * reloc.cc: Likewise.
4779 * script-c.h: Likewise.
4780 * script-sections.cc: Likewise.
4781 * script.cc: Likewise.
4782 * stringpool.cc: Likewise.
4783 * symtab.cc: Likewise.
4784 * symtab.h: Likewise.
4785 * target.cc: Likewise.
4786 * timer.cc: Likewise.
4787 * timer.h: Likewise.
4788 * version.cc: Likewise.
4789 * x86_64.cc: Likewise.
4791 2010-08-24 Nick Clifton <nickc@redhat.com>
4794 * layout.cc (segment_precedes): Sort segments by their physical
4795 addresses, if they have been set.
4797 2010-08-23 Cary Coutant <ccoutant@google.com>
4799 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4801 (Lib_group::include_member): Unlock object after deleting its
4803 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4806 2010-08-19 Neil Vachharajani <nvachhar@google.com>
4807 Cary Coutant <ccoutant@google.com>
4809 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4810 constructor, and set_blocker.
4811 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4813 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4814 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4815 * testsuite/Makefile.am (start_lib_test): New test case.
4816 * testsuite/Makefile.in: Regenerate.
4817 * testsuite/start_lib_test_main.c: New file.
4818 * testsuite/start_lib_test_1.c: New file.
4819 * testsuite/start_lib_test_2.c: New file.
4820 * testsuite/start_lib_test_3.c: New file.
4822 2010-08-19 Ian Lance Taylor <iant@google.com>
4824 * Makefile.in: Rebuild with automake 1.11.1.
4825 * aclocal.m4: Likewise.
4826 * testsuite/Makefile.in: Likewise.
4828 2010-08-19 Ian Lance Taylor <iant@google.com>
4831 * i386.cc (class Output_data_plt_i386): Update declarations.
4832 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4833 local_ifuncs_ fields.
4834 (Target_i386::do_plt_section_for_global): New function.
4835 (Target_i386::do_plt_section_for_local): New function.
4836 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4837 parameter; change all callers. Initialize global_ifuncs_ and
4838 local_ifuncs_. If doing a static link define __rel_iplt_start and
4840 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4841 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4842 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4844 (Target_i386::make_plt_section): New function, broken out of
4845 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4846 (Target_i386::make_plt_entry): Call make_plt_section.
4847 (Target_i386::make_local_ifunc_plt_entry): New function.
4848 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4849 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4850 R_386_IRELATIVE to switch.
4851 (Target_i386::Scan::global): Likewise.
4852 (Target_i386::Relocate::relocate): Likewise.
4853 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4855 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4856 (Target_x86_64::do_plt_section_for_global): New function.
4857 (Target_x86_64::do_plt_section_for_local): New function.
4858 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4859 parameter; change all callers. If doing a static link define
4860 __rela_iplt_start and __rela_iplt_end.
4861 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4862 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4863 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4865 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4866 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4868 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4869 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4870 R_X86_64_IRELATIVE to switch.
4871 (Target_x86_64::Scan::global): Likewise.
4872 (Target_x86_64::Relocate::relocate): Likewise.
4873 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4875 * target.h (class Target): Add plt_section_for_global and
4876 plt_section_for_local functions. Add do_plt_section_for_global
4877 and do_plt_section_for_local virtual functions.
4878 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4879 clarifying comments.
4880 (Symbol::use_plt_offset): Handle IFUNC symbol.
4881 * object.cc (Sized_relobj::Sized_relobj): Initialize
4883 (Sized_relobj::local_has_plt_offset): New function.
4884 (Sized_relobj::local_plt_offset): New function.
4885 (Sized_relobj::set_local_plt_offset): New function.
4886 (Sized_relobj::do_count): Handle IFUNC symbol.
4887 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4888 a bit away from input_shndx_ field. Add set_is_func_symbol and
4889 is_ifunc_symbol functions.
4890 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4891 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4892 local_plt_offsets_ field.
4893 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4894 * output.h (class Output_section_data): Add non-const
4895 output_section function.
4896 (class Output_data_got): Update declarations.
4897 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4898 Add use_plt_offset parameter to global and local constructors.
4899 Change all callers. Change local_sym_index_ field to 31 bits.
4900 Change GSYM_CODE and CONSTANT_CODE accordingly.
4901 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4902 doing a static link don't set sh_link field.
4903 (Output_data_got::Got_entry::write): Use PLT offset if
4905 (Output_data_got::add_global_plt): New function.
4906 (Output_data_got::add_local_plt): New function.
4907 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4908 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4909 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4910 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4911 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4913 * testsuite/ifunc-sel.h: New file.
4914 * testsuite/ifuncmain1.c: New file.
4915 * testsuite/ifuncmain1vis.c: New file.
4916 * testsuite/ifuncmod1.c: New file.
4917 * testsuite/ifuncdep2.c: New file.
4918 * testsuite/ifuncmain2.c: New file.
4919 * testsuite/ifuncmain3.c: New file.
4920 * testsuite/ifuncmod3.c: New file.
4921 * testsuite/ifuncmain4.c: New file.
4922 * testsuite/ifuncmain5.c: New file.
4923 * testsuite/ifuncmod5.c: New file.
4924 * testsuite/ifuncmain6pie.c: New file.
4925 * testsuite/ifuncmod6.c: New file.
4926 * testsuite/ifuncmain7.c: New file.
4927 * configure, testsuite/Makefile.in: Rebuild.
4929 2010-08-18 Ian Lance Taylor <iant@google.com>
4932 (Output_section_incremental_inputs::write_input_files): Add cast
4933 to avoid signed/unsigned comparison warning.
4934 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4936 2010-08-12 Cary Coutant <ccoutant@google.com>
4938 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4940 2010-08-13 Ian Lance Taylor <iant@google.com>
4942 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4944 2010-08-12 Cary Coutant <ccoutant@google.com>
4945 Doug Kwan <dougkwan@google.com>
4947 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4948 defintion overrides non-weak undef, remember that the original undef
4950 * symtab.cc (Symbol_table::sized_write_global): For undef without
4951 an original weak binding, set binding to global in output.
4952 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4953 * testsuite/Makefile.in: Regenerate.
4954 * testsuite/strong_ref_weak_def.sh: New file.
4955 * testsuite/strong_ref_weak_def_1.c: Ditto.
4956 * testsuite/strong_ref_weak_def_2.c: Ditto.
4958 2010-08-12 Cary Coutant <ccoutant@google.com>
4960 * testsuite/incremental_test.sh: Rewrite.
4961 * testsuite/incremental_test_1.c: Rewrite.
4962 * testsuite/incremental_test_2.c: Rewrite.
4964 2010-08-12 Cary Coutant <ccoutant@google.com>
4966 * arm.cc (Target_arm::got_size): Add const.
4967 (Target_arm::got_entry_count): New function.
4968 (Target_arm::plt_entry_count): New function.
4969 (Target_arm::first_plt_entry_offset): New function.
4970 (Target_arm::plt_entry_size): New function.
4971 (Output_data_plt_arm::entry_count): New function.
4972 (Output_data_plt_arm::first_plt_entry_offset): New function.
4973 (Output_data_plt_arm::get_plt_entry_size): New function.
4974 * i386.cc (Target_i386::got_size): Add const.
4975 (Target_i386::got_entry_count): New function.
4976 (Target_i386::plt_entry_count): New function.
4977 (Target_i386::first_plt_entry_offset): New function.
4978 (Target_i386::plt_entry_size): New function.
4979 (Output_data_plt_i386::entry_count): New function.
4980 (Output_data_plt_i386::first_plt_entry_offset): New function.
4981 (Output_data_plt_i386::get_plt_entry_size): New function.
4982 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4983 find_incremental_inputs_sections. Dump incremental_got_plt section.
4984 * incremental.cc: Include target.h.
4985 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4986 parameter. Adjust all callers. Find incremental_got_plt section.
4987 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4989 (Output_section_incremental_inputs::set_final_data_size): Calculate
4990 size of incremental_got_plt section.
4991 (Output_section_incremental_inputs::do_write): Write the
4992 incremental_got_plt section.
4993 (Got_plt_view_info): New struct.
4994 (Local_got_offset_visitor): New class.
4995 (Global_got_offset_visitor): New class.
4996 (Global_symbol_visitor_got_plt): New class.
4997 (Output_section_incremental_inputs::write_got_plt): New function.
4998 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4999 Add parameter. Adjust all callers.
5000 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5001 (Incremental_inputs::got_plt_section): New function.
5002 (Incremental_inputs::got_plt_section_): New data member.
5003 (Incremental_got_plt_reader): New class.
5004 * layout.cc (Layout::create_incremental_info_sections): Add the
5005 incremental_got_plt section.
5006 * object.h (Got_offset_list::get_list): New function.
5007 (Got offset_list::for_all_got_offsets): New function.
5008 (Sized_relobj::local_got_offset_list): New function.
5009 * powerpc.cc (Target_powerpc::got_size): Add const.
5010 (Target_powerpc::got_entry_count): New function.
5011 (Target_powerpc::plt_entry_count): New function.
5012 (Target_powerpc::first_plt_entry_offset): New function.
5013 (Target_powerpc::plt_entry_size): New function.
5014 (Output_data_plt_powerpc::entry_count): New function.
5015 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5016 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5017 * sparc.cc (Target_sparc::got_size): Add const.
5018 (Target_sparc::got_entry_count): New function.
5019 (Target_sparc::plt_entry_count): New function.
5020 (Target_sparc::first_plt_entry_offset): New function.
5021 (Target_sparc::plt_entry_size): New function.
5022 (Output_data_plt_sparc::entry_count): New function.
5023 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5024 (Output_data_plt_sparc::get_plt_entry_size): New function.
5025 * symtab.h (Symbol::got_offset_list): New function.
5026 (Symbol_table::for_all_symbols): New function.
5027 * target.h (Sized_target::got_entry_count): New function.
5028 (Sized_target::plt_entry_count): New function.
5029 (Sized_target::plt_entry_size): New function.
5030 * x86_64.cc (Target_x86_64::got_size): Add const.
5031 (Target_x86_64::got_entry_count): New function.
5032 (Target_x86_64::plt_entry_count): New function.
5033 (Target_x86_64::first_plt_entry_offset): New function.
5034 (Target_x86_64::plt_entry_size): New function.
5035 (Output_data_plt_x86_64::entry_count): New function.
5036 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5037 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5039 2010-08-12 Cary Coutant <ccoutant@google.com>
5041 * archive.cc: Include incremental.h.
5042 (Archive::Archive): Initialize incremental_info_.
5043 (Archive::include_member): Record archive members in incremental info.
5044 (Add_archive_symbols::run): Record begin and end of an archive in
5046 (Lib_group::include_member): Record objects in incremental info.
5047 * archive.h (Incremental_archive_entry): Forward declaration.
5048 (Archive::set_incremental_info): New member function.
5049 (Archive::incremental_info): New member function.
5050 (Archive::Unused_symbol_iterator): New class.
5051 (Archive::unused_symbols_begin): New member function.
5052 (Archive::unused_symbols_end): New member function.
5053 (Archive::incremental_info_): New data member.
5054 * incremental-dump.cc (find_input_containing_global): New function.
5055 (dump_incremental_inputs): Dump new incremental info sections.
5056 * incremental.cc: Include symtab.h.
5057 (Output_section_incremental_inputs): New class.
5058 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5059 new incremental info sections.
5060 (Sized_incremental_binary::do_check_inputs): Likewise.
5061 (Incremental_inputs::report_archive): Remove.
5062 (Incremental_inputs::report_archive_begin): New function.
5063 (Incremental_inputs::report_archive_end): New function.
5064 (Incremental_inputs::report_object): New function.
5065 (Incremental_inputs::finalize_inputs): Remove.
5066 (Incremental_inputs::report_input_section): New function.
5067 (Incremental_inputs::report_script): Rewrite.
5068 (Incremental_inputs::finalize): Do nothing but finalize string table.
5069 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5070 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5071 (Incremental_inputs::create_data_sections): New function.
5072 (Incremental_inputs::relocs_entsize): New function.
5073 (Output_section_incremental_inputs::set_final_data_size): New function.
5074 (Output_section_incremental_inputs::do_write): New function.
5075 (Output_section_incremental_inputs::write_header): New function.
5076 (Output_section_incremental_inputs::write_input_files): New function.
5077 (Output_section_incremental_inputs::write_info_blocks): New function.
5078 (Output_section_incremental_inputs::write_symtab): New function.
5079 * incremental.h (Incremental_script_entry): Forward declaration.
5080 (Incremental_object_entry): Forward declaration.
5081 (Incremental_archive_entry): Forward declaration.
5082 (Incremental_inputs): Forward declaration.
5083 (Incremental_inputs_header_data): Remove.
5084 (Incremental_inputs_header): Remove.
5085 (Incremental_inputs_header_write): Remove.
5086 (Incremental_inputs_entry_data): Remove.
5087 (Incremental_inputs_entry): Remove.
5088 (Incremental_inputs_entry_write): Remove.
5089 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5090 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5091 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5092 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5094 (Incremental_input_entry): New class.
5095 (Incremental_script_entry): New class.
5096 (Incremental_object_entry): New class.
5097 (Incremental_archive_entry): New class.
5098 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5099 (Incremental_inputs::report_inputs): Remove.
5100 (Incremental_inputs::report_archive): Remove.
5101 (Incremental_inputs::report_archive_begin): New function.
5102 (Incremental_inputs::report_archive_end): New function.
5103 (Incremental_inputs::report_object): Change prototype.
5104 (Incremental_inputs::report_input_section): New function.
5105 (Incremental_inputs::report_script): Change prototype.
5106 (Incremental_inputs::get_reloc_count): New function.
5107 (Incremental_inputs::set_reloc_count): New function.
5108 (Incremental_inputs::create_data_sections): New function.
5109 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5110 (Incremental_inputs::inputs_section): New function.
5111 (Incremental_inputs::symtab_section): New function.
5112 (Incremental_inputs::relocs_section): New function.
5113 (Incremental_inputs::get_stringpool): Add const.
5114 (Incremental_inputs::command_line): Add const.
5115 (Incremental_inputs::inputs): Remove.
5116 (Incremental_inputs::command_line_key): New function.
5117 (Incremental_inputs::input_file_count): New function.
5118 (Incremental_inputs::input_files): New function.
5119 (Incremental_inputs::relocs_entsize): New function.
5120 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5121 (Incremental_inputs::finalize_inputs): Remove.
5122 (Incremental_inputs::Input_info): Remove.
5123 (Incremental_inputs::lock_): Remove.
5124 (Incremental_inputs::inputs_): Change type.
5125 (Incremental_inputs::inputs_map_): Remove.
5126 (Incremental_inputs::current_object_entry_): New data member.
5127 (Incremental_inputs::inputs_section_): New data member.
5128 (Incremental_inputs::symtab_section_): New data member.
5129 (Incremental_inputs::relocs_section_): New data member.
5130 (Incremental_inputs::reloc_count_): New data member.
5131 (Incremental_inputs_reader): New class.
5132 (Incremental_symtab_reader): New class.
5133 (Incremental_relocs_reader): New class.
5134 * layout.cc (Layout::finalize): Move finalization of incremental info
5135 and creation of incremental info sections to follow finalization of
5136 symbol table. Set offsets for postprocessing sections.
5137 (Layout::create_incremental_info_sections): Call
5138 Incremental_inputs::create_data_sections. Add incremental symtab
5139 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5140 sections to layout after input sections.
5141 * layout.h (struct Timespec): Forward declaration.
5142 (Layout::incremental_inputs): Add const.
5143 (Layout::create_incremental_info_sections): Add parameter.
5144 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5145 * object.cc: Include incremental.h.
5146 (Relobj::finalize_incremental_relocs): New function.
5147 (Sized_relobj::do_layout): Record input sections in incremental info.
5148 * object.h (Object::output_section): New function.
5149 (Object::output_section_offset): Moved from Relobj.
5150 (Object::get_incremental_reloc_base): New function.
5151 (Object::get_incremental_reloc_count): New function.
5152 (Object::do_output_section): New function.
5153 (Object::do_output_section_offset): Moved from Relobj.
5154 (Object::do_get_incremental_reloc_base): New function.
5155 (Object::do_get_incremental_reloc_count): New function.
5156 (Object::Object): Initialize new data members.
5157 (Relobj::output_section): Renamed do_output_section and moved to
5159 (Relobj::output_section_offset): Moved to Object.
5160 (Relobj::do_get_incremental_reloc_base): New function.
5161 (Relobj::do_get_incremental_reloc_count): New function.
5162 (Relobj::allocate_incremental_reloc_counts): New function.
5163 (Relobj::count_incremental_reloc): New function.
5164 (Relobj::finalize_incremental_relocs): New function.
5165 (Relobj::next_incremental_reloc_index): New function.
5166 (Relobj::reloc_counts_): New data member.
5167 (Relobj::reloc_bases_): New data member.
5168 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5169 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5170 (Sized_relobj::incremental_relocs_scan): New function.
5171 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5172 (Sized_relobj::incremental_relocs_write): New function.
5173 (Sized_relobj::incremental_relocs_write_reltype): New function.
5174 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5176 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5177 archives and object files elsewhere.
5178 (Add_symbols::run): Report object files here.
5179 (Finish_group::run): Report end of archive at end of group.
5180 * reloc.cc: Include layout.h, incremental.h.
5181 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5182 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5183 (Sized_relobj::incremental_relocs_scan): New function.
5184 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5185 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5186 (Sized_relobj::incremental_relocs_write): New function.
5187 (Sized_relobj::incremental_relocs_write_reltype): New function.
5188 * script.cc (read_input_script): Rewrite test for incremental link.
5189 Change call to Incremental_inputs::report_script.
5190 * symtab.h (Symbol_table::first_global_index): New function.
5191 (Symbol_table::output_count): New function.
5193 2010-08-12 Doug Kwan <dougkwan@google.com>
5195 * arm.cc (Target_arm::merge_object_attributes): Check command line
5196 options --no-wchar-size-warning and --no-enum-size-warning.
5197 * options.h (General_options): Add ld-compatible options
5198 --no-enum-size-warning and --no-wchar-size-warning.
5200 2010-08-04 Ian Lance Taylor <iant@google.com>
5202 * x86_64.cc (Target_x86_64::Scan::local): Use
5203 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5204 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5205 (Target_x86_64::Scan::global): Likewise.
5206 (Target_x86_64::Relocate::relocate): Likewise.
5207 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5210 2010-08-03 Cary Coutant <ccoutant@google.com>
5212 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5213 to reserve space in merged_strings vector. Keep total input size
5215 (Output_merge_string::do_print_merge_stats): Print total input size.
5216 * merge.h (Output_merge_string): Add input_size_ field.
5217 * stringpool.cc (Stringpool_template::string_length): Move
5218 implementations out of Stringpool_template class and place in
5220 * stringpool.h (string_length): Move out of Stringpool_template.
5222 2010-08-03 Ian Lance Taylor <iant@google.com>
5225 * layout.cc (relaxation_loop_body): If address of load segment is
5226 set, adjust address to include headers if possible.
5228 2010-08-03 Ian Lance Taylor <iant@google.com>
5230 * version.cc (version_string): Bump to 1.10.
5232 2010-08-03 Ian Lance Taylor <iant@google.com>
5235 * layout.h (enum Output_section_order): Define.
5236 (class Layout): Update declarations.
5237 * layout.cc (Layout::get_output_section): Add order parameter.
5238 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5239 is_first_non_relro parameters. Change all callers.
5240 (Layout::choose_output_section): Likewise.
5241 (Layout::add_output_section_data): Likewise.
5242 (Layout::make_output_section): Likewise. Set order.
5243 (Layout::default_section_order): New function.
5244 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5245 * output.cc (Output_section::Output_section): Initialize order_.
5246 Don't initialize deleted fields.
5247 (Output_segment::Output_segment): Don't initialize deleted
5249 (Output_segment::add_output_section_to_load): New function
5250 replacing add_output_section. Change all callers to call this or
5251 add_output_section_to_nonload.
5252 (Output_segment::add_output_section_to_nonload): New function.
5253 (Output_segment::remove_output_section): Rewrite.
5254 (Output_segment::add_initial_output_data): Likewise.
5255 (Output_segment::has_any_data_sections): Likewise.
5256 (Output_segment::is_first_section_relro): Likewise.
5257 (Output_segment::maximum_alignment): Likewise.
5258 (Output_segment::has_dynamic_reloc): New function replacing
5259 dynamic_reloc_count. Change all callers.
5260 (Output_segment::has_dynamic_reloc_list): New function replacing
5261 dynamic_reloc_count_list. Change all callers.
5262 (Output_segment::set_section_addresses): Rewrite.
5263 (Output_segment::set_offset): Rewrite.
5264 (Output_segment::find_first_and_last_list): Remove.
5265 (Output_segment::set_tls_offsets): Rewrite.
5266 (Output_segment::first_section_load_address): Likewise.
5267 (Output_segment::output_section_count): Likewise.
5268 (Output_segment::section_with_lowest_load_address): Likewise.
5269 (Output_segment::write_section_headers): Likewise.
5270 (Output_segment::print_sections_to_map): Likewise.
5271 * output.h (class Output_data): Remove dynamic_reloc_count_
5272 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5273 (Output_data::add_dynamic_reloc): Rewrite.
5274 (Output_data::has_dynamic_reloc): New function.
5275 (Output_data::dynamic_reloc_count): Remove.
5276 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5277 is_last_relro_, is_first_non_relro_, is_interp_,
5278 is_dynamic_linker_section_ fields. Add order and set_order
5279 functions. Remove is_relro_local, set_is_relro_local,
5280 is_last_relro, set_is_last_relro, is_first_non_relro,
5281 set_is_first_non_relro functions, is_interp, set_is_interp,
5282 is_dynamic_linker_section, and set_is_dynamic_linker_section
5284 (class Output_segment): Change Output_data_list from std::list to
5285 std:;vector. Add output_lists_ field. Remove output_data_ and
5286 output_bss_ fields. Update declarations.
5288 2010-08-02 Ian Lance Taylor <iant@google.com>
5290 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5291 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5292 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5294 2010-08-02 Ian Lance Taylor <iant@google.com>
5297 * script.cc (Script_options::Script_options): Initialize
5298 symbol_definitions_ and symbol_references_.
5299 (Script_options::add_symbol_assignment): Update
5300 symbol_definitions_ and symbol_references_.
5301 (Script_options::add_symbol_reference): New function.
5302 (script_symbol): New function.
5303 * script.h (class Script_options): Add symbol_definitions_ and
5304 symbol_references_ fields.
5305 (Script_options::referenced_const_iterator): New type.
5306 (Script_options::referenced_begin): New function.
5307 (Script_options::referenced_end): New function.
5308 (Script_options::is_referenced): New function.
5309 (Script_options::any_unreferenced): New function.
5310 * script-c.h (script_symbol): Declare.
5311 * yyscript.y (exp): Call script_symbol.
5312 * symtab.cc: Include "script.h".
5313 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5314 Change all callers. Check symbols referenced by scripts.
5315 (Symbol_table::add_undefined_symbols_from_command_line): Add
5316 layout parameter. Change all callers.
5317 (Symbol_table::do_add_undefined_symbols_from_command_line):
5318 Likewise. Break out loop body. Check symbols referenced by
5320 (Symbol_table::add_undefined_symbol_from_command_line): New
5321 function broken out of
5322 do_add_undefined_symbols_from_command_line.
5323 * symtab.h (class Symbol_table): Update declarations.
5324 * archive.cc: Include "layout.h".
5325 (Archive::should_include_member): Add layout parameter. Change
5326 all callers. Check for symbol mentioned in expression.
5327 * archive.h (class Archive): Update declaration.
5328 * object.cc (Sized_relobj::do_should_include_member): Add layout
5330 * object.h (Object::should_include_member): Add layout parameter.
5332 (Object::do_should_include_member): Add layout parameter.
5333 (class Sized_relobj): Update declaration.
5334 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5336 * dynobj.h (class Sized_dynobj): Update declaration.
5337 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5339 * plugin.h (class Sized_pluginobj): Update declaration.
5341 2010-08-02 Ian Lance Taylor <iant@google.com>
5344 * output.cc (Output_segment::set_offset): Search for the first and
5345 last sections rather than assuming that the list is in order.
5346 (Output_segment::find_first_and_last_list): New function.
5347 * output.h (class Output_segment): Update declarations.
5348 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5349 (relro_strip_test_SOURCES): New variable.
5350 (relro_strip_test_DEPENDENCIES): New variable.
5351 (relro_strip_test_LDFLAGS): New variable.
5352 (relro_strip_test_LDADD): New variable.
5353 (relro_strip_test.so): New target.
5355 2010-08-02 Ian Lance Taylor <iant@google.com>
5357 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5358 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5359 (Target_i386::got_tlsdesc_section): New function.
5360 (Target_i386::got_section): Create space for GOT entries for
5361 TLSDESC relocations.
5362 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5364 (Target_i386::Scan::global): Likewise.
5365 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5367 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5368 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5369 (Target_x86_64::got_tlsdesc_section): New function.
5370 (Target_x86_64::got_section): Create space for GOT entries for
5371 TLSDESC relocations.
5372 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5374 (Target_x86_64::Scan::global): Likewise.
5375 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5378 2010-08-02 Ian Lance Taylor <iant@google.com>
5380 * testsuite/final_layout.sh: Use dc to convert from hex to
5383 2010-07-29 Sriraman Tallam <tmsriram@google.com>
5385 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5386 paramter to the call to gold::gc_process_relocs.
5387 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5388 paramter to the call to gold::gc_process_relocs.
5389 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5390 parameter to the call to gold::gc_process_relocs.
5391 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5392 template parameter to the call to gold::gc_process_relocs.
5393 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5394 paramter to the call to gold::gc_process_relocs.
5395 * gc.h (get_embedded_addend_size): New function.
5396 (gc_process_relocs): Save the size of the reloc for use by ICF.
5397 * icf.cc (get_section_contents): Get the addend from the text section
5398 for SHT_REL relocation sections.
5399 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5400 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5401 * int_encoding.h (read_from_pointer): New overloaded function.
5402 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5403 * testsuite/icf_sht_rel_addend_test.sh: New file.
5404 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5405 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5407 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5409 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5410 * Makefile.in: Regenerate.
5411 * testsuite/Makefile.in: Regenerate.
5413 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5415 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5416 * gold/testsuite/debug_msg.cc: Likewise.
5417 * gold/testsuite/odr_violation1.cc
5418 * gold/testsuite/odr_violation2.cc
5420 2010-07-21 Cary Coutant <ccoutant@google.com>
5422 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5423 string, and length fields.
5424 (Output_merge_string::Merged_strings_list): New type.
5425 (Output_merge_string::Merged_strings_lists): New typedef.
5426 (Output_merge_string): Replace merged_strings_ with
5427 merged_strings_lists_.
5428 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5429 Merged_strings_list per input object and section. Don't store pointer
5430 to the string. Don't store length with each merged string entry.
5431 (Output_merge_string::finalize_merged_data): Loop over list of merged
5432 strings lists. Recompute length of each merged string.
5434 2010-07-15 Cary Coutant <ccoutant@google.com>
5436 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5439 2010-07-14 Ian Lance Taylor <iant@google.com>
5441 * descriptors.cc (Descriptors::open): Report correct name in error
5444 2010-07-13 Doug Kwan <dougkwan@google.com>
5446 * arm.cc (Arm_input_section::Arm_input_section): For a
5447 SHT_ARM_EXIDX section, always keeps the input sections.
5448 (Arm_input_section::set_exidx_section_link): New method.
5449 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5450 has_errors_ to false.
5451 (Arm_exidx_input_section::has_errors,
5452 Arm_exidx_input_section::set_has_errors): New methods.
5453 (Arm_exidx_input_section::has_errors_): New data member.
5454 (Arm_relobj::get_exidx_shndx_list): New method.
5455 (Arm_output_section::append_text_sections_to_list): Do not skip
5456 section without SHF_EXECINSTR.
5457 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5459 (Arm_relobj::make_exidx_input_section): Add new parameter for text
5460 section header. Make error messages more verbose. Check for
5461 a non-executable section linked to an EXIDX section.
5462 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5463 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5464 check that there is no deferred EXIDX section if we exit early.
5465 Instead of not making an EXIDX section in case of an error, make one
5466 and set the has_errors flag of it.
5467 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5468 in a relocatable link.
5469 (Target_arm::do_relax): Look for the EXIDX output section instead of
5470 assuming that it is called .ARM.exidx.
5471 (Target_arm::fix_exidx_coverage): Add a new parameter for input
5472 section list. Do not check for SHF_EXECINSTR section flags but
5473 skip any input section with errors.
5474 * output.cc (Output_section::Output_section): Initialize
5475 always_keeps_input_sections_ to false.
5476 (Output_section::add_input_section): Check for
5477 always_keeps_input_sections_.
5478 * output.h (Output_section::always_keeps_input_sections,
5479 Output_section::set_always_keeps_input_sections): New methods.
5480 (Output_section::always_keeps_input_sections): New data member.
5482 2010-07-13 Rafael Espindola <espindola@google.com>
5484 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5485 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5487 2010-07-13 Philip Herron <herron.philip@googlemail.com>
5488 Ian Lance Taylor <iant@google.com>
5490 * output.h (Output_section_lookup_maps::add_merge_section):
5491 Correct check of whether value was inserted.
5492 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5493 (Output_section_lookup_maps::add_relaxed_input_section):
5495 * arm.cc (Target_arm::got_section): Remove used local os.
5496 * i386.cc (Target_i386::got_section): Likewise.
5497 * x86_64.cc (Target_x86_64::got_section): Likewise.
5498 * sparc.cc (Target_sparc::got_section): Likewise.
5499 (Target_sparc::relocate): Remove unused local have_got_offset.
5500 * powerpc.cc (Target_powerpc::relocate): Likewise.
5502 2010-07-13 Ian Lance Taylor <iant@google.com>
5504 * compressed_output.cc (zlib_decompress): Fix signature in
5507 * archive.cc (Archive::include_member): Unlock an external member
5508 of a thin archive. Don't bother to delete an object we know is
5511 2010-07-12 Cary Coutant <ccoutant@google.com>
5513 * compressed_output.cc (zlib_decompress): New function.
5514 (get_uncompressed_size): New function.
5515 (decompress_input_section): New function.
5516 * compressed_output.h (get_uncompressed_size): New function.
5517 (decompress_input_section): New function.
5518 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5519 Handle compressed debug sections.
5520 * layout.cc (is_compressed_debug_section): New function.
5521 (Layout::output_section_name): Map compressed section names to
5523 * layout.h (is_compressed_debug_section): New function.
5524 (is_debug_info_section): Recognize compressed debug sections.
5525 * merge.cc: Include compressed_output.h.
5526 (Output_merge_data::do_add_input_section): Handle compressed
5528 (Output_merge_string::do_add_input_section): Handle compressed
5530 * object.cc: Include compressed_output.h.
5531 (Sized_relobj::Sized_relobj): Initialize new data members.
5532 (build_compressed_section_map): New function.
5533 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5534 * object.h (Object::section_is_compressed): New method.
5535 (Object::do_section_is_compressed): New method.
5536 (Sized_relobj::Compressed_section_map): New type.
5537 (Sized_relobj::do_section_is_compressed): New method.
5538 (Sized_relobj::compressed_sections_): New data member.
5539 * output.cc (Output_section::add_input_section): Handle compressed
5541 * reloc.cc: Include compressed_output.h.
5542 (Sized_relobj::write_sections): Handle compressed debug sections.
5544 2010-07-08 Cary Coutant <ccoutant@google.com>
5546 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5547 weak when resolving to a dynamic def.
5548 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5549 for weak undef/dynamic def cases. Adjust callers.
5550 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5551 undef_binding_weak_.
5552 (Symbol_table::sized_write_globals): Adjust symbol binding.
5553 (Symbol_table::sized_write_symbol): Add binding parameter.
5554 * symtab.h (Symbol::set_undef_binding): New method.
5555 (Symbol::is_undef_binding_weak): New method.
5556 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5557 (Symbol_table::should_override): Add new parameter.
5558 (Symbol_table::sized_write_symbol): Add new parameter.
5560 * testsuite/weak_undef_file1.cc: Add new test case.
5561 * testsuite/weak_undef_file2.cc: Fix header comment.
5562 * testsuite/weak_undef_test.cc: Add new test case.
5564 2010-06-29 Doug Kwan <dougkwan@google.com>
5566 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5567 Initialize USE_SYMBOL_.
5568 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5570 (Arm_reloc_property::uses_symbol_): New data member declaration.
5571 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5572 uses symbol value and symbol is undefined but not weakly undefined.
5574 2010-06-28 Rafael Espindola <espindola@google.com>
5576 * plugin.cc (Plugin::load): Use dlerror.
5578 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5580 * symtab.cc (detect_odr_violations): When reporting an ODR
5581 violation, report an object where the symbol is defined.
5583 2010-06-25 Doug Kwan <dougkwan@google.com>
5585 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5586 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5588 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5589 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5590 target hook to detect function points.
5591 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5592 * icf.h (Icf::check_section_for_function_pointers): Change type of
5593 parameter SECTION_NAME to const reference to std::string. Use
5594 target hook to determine if section may have unsafe pointers.
5595 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5598 2010-06-21 Rafael Espindola <espindola@google.com>
5600 * fileread.cc (Input_file::find_fie): New
5601 (Input_file::open): Use Input_file::find_fie.
5602 * fileread.h (Input_file::find_fie): New
5603 * plugin.cc (set_extra_library_path): New.
5604 (Plugin::load): Add set_extra_library_path to the transfer vector.
5605 (Plugin_manager::set_extra_library_path): New.
5606 (Plugin_manager::add_input_file): Use the extra search path if set.
5607 (set_extra_library_path(): New.
5608 * plugin.h (Plugin_manager): Add set_extra_library_path and
5611 2010-06-19 Cary Coutant <ccoutant@google.com>
5613 * layout.cc (gdb_sections): Add .debug_types.
5614 (lines_only_debug_sections): Likewise.
5616 2010-06-18 Rafael Espindola <espindola@google.com>
5618 * plugin.cc (add_input_file,add_input_library)
5619 (Plugin_manager::add_input_file): Make filename arguments const.
5620 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5623 2010-06-16 Doug Kwan <dougkwan@google.com>
5625 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5626 .ARM.attributes section if we have not merged any input
5627 attributes sections.
5629 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5631 * arm.cc: Allow combining objects with no EABI version
5634 2010-06-15 Rafael Espindola <espindola@google.com>
5636 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5638 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5640 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5641 (struct iovec): Correct !HAVE_READV definition.
5643 2010-06-10 Cary Coutant <ccoutant@google.com>
5645 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5646 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5648 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5651 * symtab.h (Symbol::is_placeholder): New member function.
5652 * target-reloc.h (relocate_section): Check for placeholder symbols.
5654 * testsuite/Makefile.am (plugin_test_8): New test.
5655 (plugin_test_9): New test.
5656 * testsuite/Makefile.in: Regenerate.
5658 2010-06-09 Nick Clifton <nickc@redhat.com>
5660 * yyscript.y (input_list_element): Allow strings prefixed with
5661 the '-' character. Treat these as libraries.
5662 * script.cc (script_add_library): New function. Adds a library
5663 specified by "-l<name>" found in an input script.
5664 * script-c.h: Add prototype for script_add_library.
5666 2010-06-07 Doug Kwan <dougkwan@google.com>
5668 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5669 Restrict stub-group size to be within long conditional branch
5670 range when working around cortex-A8 erratum.
5672 2010-06-07 Damien Diederen <dd@crosstwine.com>
5674 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5677 2010-06-03 Sriraman Tallam <tmsriram@google.com>
5681 (Output_section::Input_section_sort_entry::compare_section_ordering):
5682 Change to return non-zero correctly.
5683 (Output_section::Input_section_sort_section_order_index_compare
5684 ::operator()): Change to fix ambiguity in comparisons.
5686 2010-06-01 Sriraman Tallam <tmsriram@google.com>
5688 * gold.h (is_wildcard_string): New function.
5689 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5690 (Layout::layout_eh_frame): Ditto.
5691 (Layout::find_section_order_index): New method.
5692 (Layout::read_layout_from_file): New method.
5693 * layout.h (Layout::find_section_order_index): New method.
5694 (Layout::read_layout_from_file): New method.
5695 (Layout::input_section_position_): New private member.
5696 (Layout::input_section_glob_): New private member.
5697 * main.cc (main): Call read_layout_from_file here.
5698 * options.h (--section-ordering-file): New option.
5699 * output.cc (Output_section::input_section_order_specified_): New
5701 (Output_section::Output_section): Initialize new member.
5702 (Output_section::add_input_section): Add new parameter.
5703 Keep input sections when --section-ordering-file is used.
5704 (Output_section::set_final_data_size): Sort input sections when
5705 section ordering file is specified.
5706 (Output_section::Input_section_sort_entry): Add new parameter.
5708 (Output_section::Input_section_sort_entry::compare_section_ordering):
5710 (Output_section::Input_section_sort_compare::operator()): Change to
5711 consider section_order_index.
5712 (Output_section::Input_section_sort_init_fini_compare::operator()):
5713 Change to consider section_order_index.
5714 (Output_section::Input_section_sort_section_order_index_compare
5715 ::operator()): New method.
5716 (Output_section::sort_attached_input_sections): Change to sort
5717 according to section order when specified.
5718 (Output_section::add_input_section<32, true>): Add new parameter.
5719 (Output_section::add_input_section<64, true>): Add new parameter.
5720 (Output_section::add_input_section<32, false>): Add new parameter.
5721 (Output_section::add_input_section<64, false>): Add new parameter.
5722 * output.h (Output_section::add_input_section): Add new parameter.
5723 (Output_section::input_section_order_specified): New
5725 (Output_section::set_input_section_order_specified): New method.
5726 (Input_section::Input_section): Initialize section_order_index_.
5727 (Input_section::section_order_index): New method.
5728 (Input_section::set_section_order_index): New method.
5729 (Input_section::section_order_index_): New member.
5730 (Input_section::Input_section_sort_section_order_index_compare): New
5732 (Output_section::input_section_order_specified_): New member.
5733 * script-sections.cc (is_wildcard_string): Delete and move modified
5735 (Output_section_element_input::Output_section_element_input): Modify
5736 call to is_wildcard_string.
5737 (Output_section_element_input::Input_section_pattern
5738 ::Input_section_pattern): Ditto.
5739 (Output_section_element_input::Output_section_element_input): Ditto.
5740 * testsuite/Makefile.am (final_layout): New test case.
5741 * testsuite/Makefile.in: Regenerate.
5742 * testsuite/final_layout.cc: New file.
5743 * testsuite/final_layout.sh: New file.
5745 2010-06-01 Rafael Espindola <espindola@google.com>
5747 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5749 2010-06-01 Rafael Espindola <espindola@google.com>
5751 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5752 visibility of symbols.
5754 2010-05-27 Doug Kwan <dougkwan@google.com>
5756 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5757 from start of output section instead of address for a local symbol
5758 in a merged or relaxed section when doing a relocatable link.
5760 2010-05-26 Rafael Espindola <espindola@google.com>
5763 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5764 adding sections the garbage collector removed.
5765 * gold/testsuite/Makefile.am: Add test.
5766 * gold/testsuite/Makefile.in: Regenerate.
5767 * gold/testsuite/plugin_test_7.sh: New.
5768 * gold/testsuite/plugin_test_7_1.c: New.
5769 * gold/testsuite/plugin_test_7_2.c: New.
5771 2010-05-26 Rafael Espindola <espindola@google.com>
5773 * script-sections.cc (Output_section_definition::set_section_addresses):
5774 Check for --section-start.
5776 2010-05-26 Doug Kwan <dougkwan@google.com>
5778 * arm.cc (Arm_scan_relocatable_relocs): New class.
5779 (Target_arm::relocate_special_relocatable): New method.
5780 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5781 (Arm_relocate_functions::thumb_branch_common): Same.
5782 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5783 instead of Default_scan_relocatable_relocs.
5784 * target-reloc.h (relocate_for_relocatable): Let target handle
5785 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5786 * target.h (Sized_target::relocate_special_relocatable): New method.
5788 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5790 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5792 2010-05-23 Doug Kwan <dougkwan@google.com>
5794 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5796 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5797 with a direct branch, not a conditional branch, to a stub.
5798 * merge.cc (Output_merge_base::record_input_section): New method
5800 (Output_merge_data::do_add_input_section): Record input section if
5801 keeps-input-sections flag is set.
5802 (Output_merge_string::do_add_input_section): Ditto.
5803 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5804 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5806 (Output_merge_base::keeps_input_sections,
5807 Output_merge_base::set_keeps_input_sections,
5808 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5810 (Output_merge_base::Input_sections): New type declaration.
5811 (Output_merge_base::input_sections_begin,
5812 Output_merge_base::input_sections_end,
5813 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5814 (Output_merge_base::bool keeps_input_sections_,
5815 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5816 Output_merge_base::input_sections_): New data members.
5817 (Output_merge_data::do_set_keeps_input_sections): New method
5819 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5820 * output.cc (Output_section::Input_section::relobj): Move method
5821 defintion from class declaration to here and handle merge sections.
5822 (Output_section::Input_section::shndx): Ditto.
5823 (Output_section::Output_section): Remove initializations of removed
5824 data members and initialize new data member LOOKUP_MAPS_.
5825 (Output_section::add_input_section): Set keeps-input-sections flag
5826 for a newly created merge output section as appropriate. Adjust code
5827 to use Output_section_lookup_maps class.
5828 (Output_section::add_relaxed_input_section): Adjst code for lookup
5829 maps code refactoring.
5830 (Output_section::add_merge_input_section): Add a new parameter
5831 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5832 class. If adding input section to a newly created merge output
5833 section fails, remove the new merge section.
5834 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
5835 Adjust code for use of the Output_section_lookup_maps class.
5836 (Output_section::find_merge_section): Ditto.
5837 (Output_section::build_lookup_maps): New method defintion.
5838 (Output_section::find_relaxed_input_section): Adjust code to use
5839 Output_section_lookup_maps class.
5840 (Output_section::get_input_sections): Export merge sections. Adjust
5841 code to use Output_section_lookup_maps class.
5842 (Output_section:::add_script_input_section): Adjust code to use
5843 Output_section_lookup_maps class. Update lookup maps for merge
5845 (Output_section::discard_states): Use Output_section_lookup_maps.
5846 (Output_section::restore_states): Same.
5847 * output.h (Merge_section_properties): Move class defintion out of
5849 (Output_section_lookup_maps): New class.
5850 (Output_section::Input_section::is_merge_section): New method
5852 (Output_section::Input_section::relobj): Move defintion out of class
5853 defintion. Declare method only.
5854 (Output_section::Input_section::shndx): Ditto.
5855 (Output_section::Input_section::output_merge_base): New method defintion.
5856 (Output_section::Input_section::u2_.pomb): New union field.
5857 (Output_section::Merge_section_by_properties_map,
5858 Output_section::Output_section_data_by_input_section_map,
5859 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5861 (Output_section::add_merge_input_section): Add new parameter
5862 KEEPS_INPUT_SECTIONS.
5863 (Output_section::build_lookup_maps): New method declaration.
5864 (Output_section::merge_section_map_,
5865 Output_section::merge_section_by_properties_map_,
5866 Output_section::relaxed_input_section_map_,
5867 Output_section::is_relaxed_input_section_map_valid_): Remove data
5869 (Output_section::lookup_maps_): New data member.
5871 2010-05-21 Doug Kwan <dougkwan@google.com>
5874 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5875 avoid a compilation error.
5877 2010-05-19 Rafael Espindola <espindola@google.com>
5879 * script-sections.cc (Output_section_definition::allocate_to_segment):
5880 Update the phdrs_list even when the output section is NULL.
5881 * testsuite/Makefile.am: Add test.
5882 * testsuite/Makefile.in: Regenerate.
5883 * testsuite/script_test_9.cc: New.
5884 * testsuite/script_test_9.sh: New.
5885 * testsuite/script_test_9.t: New.
5887 2010-05-19 Doug Kwan <dougkwan@google.com>
5889 * arm.cc (Arm_input_section::original_size): New method.
5890 (Arm_input_section::do_addralign): Add a cast.
5891 (Arm_input_section::do_output_offset): Remove static cast.
5892 (Arm_input_section::original_addralign,
5893 Arm_input_section::original_size_): Change type to uint32_t.
5894 (Arm_input_section::init): Add safe casts for section alignment
5896 (Arm_input_section::set_final_data_size): Do not set address and
5897 offset of stub table.
5898 (Arm_output_section::fix_exidx_coverage): Change use of of
5899 Output_section::Simple_input_section to that of
5900 Output_section::Input_section.
5901 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5902 except for the first pass.
5903 * output.cc (Output_section::get_input_sections): Change type of
5904 input_sections to std::list<Input_section>.
5905 (Output_section::add_script_input_section): Rename from
5906 Output_section::add_simple_input_section. Change type of SIS
5907 parameter from Simple_input_section to Input_section.
5908 * output.h (Output_section::Simple_input_section): Remove class.
5909 (Output_section::Input_section): Change class visibility to public.
5910 (Output_section::Input_section::addralign): Use stored alignments
5911 for special input sections if set.
5912 (Output_section::Input_section::set_addralign): New method.
5913 (Output_section::get_input_sections): Change parameter type from
5914 list of Simple_input_section to list of Input_section.
5915 (Output_section::add_script_input_section): Rename from
5916 Output_section::add_simple_input_section. Change first parameter's
5917 type from Simple_input_section to Input_section and remove the
5918 second and third parameters.
5919 * script-sections.cc (Input_section::Input_section_list): Change
5920 type to list of Output_section::Input_section/
5921 (Input_section_info::Input_section_info): Change parameter type of
5922 INPUT_SECTION to Output_section::Input_section.
5923 (Input_section_info::input_section): Change return type.
5924 (Input_section_info::input_section_): Change type to
5925 Output_section::Input_section.
5926 (Output_section_element_input::set_section_addresses): Adjust code
5927 to use Output_section::Input_section instead of
5928 Output_section::Simple_input_section. Adjust code for renaming
5929 of Output_section::add_simple_input_section.
5930 (Orphan_output_section::set_section_addresses): Ditto.
5932 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5934 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5935 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5937 2010-05-18 Rafael Espindola <espindola@google.com>
5939 * options.cc (General_options::finalize): Handle -nostdlib.
5940 * options.h (nostdlib): New option.
5941 * script.cc (script_add_search_dir): Handle -nostdlib.
5943 2010-05-12 Doug Kwan <dougkwan@google.com>
5945 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5946 attributes section only if there no attributes section after merging.
5947 (Target_arm::merge_object_attributes): Move value of
5948 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
5949 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5950 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5951 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5952 and arm_attr_merge_7.stdout.
5953 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5954 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5955 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5956 arm_attr_merge_7b.o): New rules.
5957 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5959 * testsuite/Makefile.in: Regenerate.
5960 * testsuite/arm_attr_merge.sh: New file.
5961 * testsuite/arm_attr_merge_[67][ab].s: Same.
5963 2010-05-05 Nick Clifton <nickc@redhat.com>
5965 * po/es.po: Updated Spanish translation.
5967 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5969 * Makefile.am (install-exec-local): Properly install gold as
5970 default cross linker.
5971 * Makefile.in: Regenerated.
5973 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5974 Nick Clifton <nickc@redhat.com>
5976 * configure.ac (install_as_default): Define and set to false
5977 unless --enable-gold or --enable-gold=both/gold has been
5979 * configure: Regenerate.
5981 * Makefile.am (install-exec-local): Install the executable as
5982 'ld.gold'. If install_as_default is true then also install it as
5984 * Makefile.in: Regenerated.
5986 2010-04-24 Ian Lance Taylor <iant@google.com>
5988 * layout.cc (Layout::layout_reloc): In relocatable link don't
5989 combine reloc sections for grouped sections.
5991 2010-04-23 Sriraman Tallam <tmsriram@google.com>
5993 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5994 sections that are not ordinary to icf.
5995 * icf.cc (get_section_contents): Handle relocation pointing to section
5996 with no object or shndx information.
5997 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5998 * testsuite/Makefile.in: Regenerate.
5999 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6000 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6002 2010-04-22 Ian Lance Taylor <iant@google.com>
6004 * expression.cc (Expression::Expression_eval_info): Add
6005 result_alignment_pointer field.
6006 (Expression::eval_with_dot): Add result_alignment_pointer
6007 parameter. Change all callers.
6008 (Expression::eval_maybe_dot): Likewise.
6009 (class Binary_expression): Add alignment_pointer parameter to
6010 left_value and right_value. Change all callers.
6011 (BINARY_EXPRESSION): Set result alignment.
6012 (class Trinary_expression): Add alignment_pointer parameter to
6013 arg2_value and arg3_value. Change all callers.
6014 (Trinary_cond::value): Set result alignment.
6015 (Max_expression::value, Min_expression::value): Likewise.
6016 (Align_expression::value): Likewise.
6017 * script-sections.cc (class Sections_element): Add dot_alignment
6018 parameter to set_section_addresses virtual function. Update
6020 (class Output_section_element): Likewise.
6021 (Script_sections::create_segments): Add dot_alignment parameter.
6023 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6024 (Script_sections::set_phdrs_clause_addresses): Likewise.
6025 * script-sections.h: Update declarations.
6026 * script.h: Update declarations.
6027 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6029 * testsuite/script_test_3.t: Set large alignment.
6030 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6031 segment has expected alignment.
6033 2010-04-22 Nick Clifton <nickc@redhat.com>
6035 * po/gold.pot: Updated by the Translation project.
6036 * po/vi.po: Updated Vietnamese translation.
6038 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6040 * testsuite/Makefile.am (check_PROGRAMS): Add
6041 icf_virtual_function_folding_test.
6042 * testsuite/Makefile.in: Regenerated.
6044 2010-04-15 Andrew Haley <aph@redhat.com>
6046 * options.h (merge_exidx_entries): New option.
6047 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6048 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6049 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6050 (Target_arm::merge_exidx_entries): New function.
6051 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6052 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6053 to Arm_exidx_fixup constructor.
6054 Add new arg, merge_exidx_entries.
6055 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6056 Arm_output_section::fix_exidx_coverage.
6058 2010-04-18 Sriraman Tallam <tmsriram@google.com>
6060 * icf.cc (get_section_contents): Check for preemptible functions.
6061 Ignore addend when appropriate.
6062 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6064 (add_from_relobj): Check for section folded.
6065 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6066 * symtab.h (should_add_dynsym_entry): Add new parameter.
6067 * target-reloc.h (scan_relocs): Check for section folded.
6068 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6069 Check reloc types for function pointers in shared objects.
6070 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6072 (icf_preemptible_functions_test): New test case.
6073 (icf_string_merge_test): New test case.
6074 * testsuite.Makefile.in: Regenerate.
6075 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6076 bar_glob. Refactor code.
6077 * testsuite/icf_preemptible_functions_test.cc: New file.
6078 * testsuite/icf_preemptible_functions_test.sh: New file.
6079 * testsuite/icf_string_merge_test.cc: New file.
6080 * testsuite/icf_string_merge_test.sh: New file.
6081 * testsuite/icf_virtual_function_folding_test.cc: New file.
6082 * testsuite/icf_virtual_function_folding_test.sh: New file.
6084 2010-04-14 Doug Kwan <dougkwan@google.com>
6086 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6087 for local symbol recounting if we remove a section due to ICF.
6088 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6089 there are no regular objects in input.
6091 2010-04-13 Doug Kwan <dougkwan@google.com>
6093 * arm.cc (Arm_input_section::set_final_data_size): Compute
6094 accurate final data size instead of using current data size.
6096 2010-04-09 Doug Kwan <dougkwan@google.com>
6098 * layout.cc (Layout::choose_output_section): Handle script section
6100 (Layout::make_output_section_for_script): Add section type parameter.
6101 Handle script section types.
6102 * layout.h (Layout::make_output_section_for_script): Add section
6104 * output.cc (Output_section::Output_section): Initialize data member
6106 (Output_section::do_reset_address_and_file_offset): Do not set address
6107 to 0 if section is a NOLOAD section.
6108 * output.h (Output_section::is_noload): New method.
6109 (Output_section::set_is_noload): Ditto.
6110 (Output_section::is_noload_): New data member.
6111 * script-c.h (Script_section_type): New enum type.
6112 (struct Parser_output_section_header): Add new file section_type.
6113 * script-sections.cc (Sections_element::output_section_name): Add
6114 parameter for returning script section type.
6115 (Output_section_definition::output_section_name): Ditto.
6116 (Output_section_definition::section_type)P; New method.
6117 (Output_section_definiton::script_section_type_name): Ditto.
6118 (Output_section_definition::script_section_type_): New data member.
6119 (Output_section_definition::Output_section_definition): Initialize
6120 data member Output_section_definition::script_section_type_.
6121 (Output_section_definition::create_sections): Pass script section type
6122 to Layout::make_output_section_for_script.
6123 (Output_section_definition::output_section_name): Return script
6124 section type to caller.
6125 (Output_section_definition::set_section_address): Do not advance
6126 dot value and load address if section type is NOLOAD. Set address
6127 of NOLOAD sections regardless of section flags.
6128 (Output_section_definition::print): Print section type if it is
6129 not SCRIPT_SECTION_TYPE_NONE.
6130 (Output_section_definition::section_type): New method.
6131 (Output_section_definition::script_section_type_name): Ditto.
6132 (Script_sections::output_section_name): Add new parameter
6133 PSECTION_TYPE for returning script section type. Pass it to
6134 section elements. Handle discard sections.
6135 (Sort_output_sections::operator()): Handle NOLOAD sections.
6136 * script-sections.h (Script_sections::Section_type): New enum type.
6137 (Script_sections::output_section_name): Add a new parameter for
6138 returning script section type.
6139 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6141 * yyscript.y (union): Add new field SECTION_TYPE.
6142 (COPY, DSECT, INFO, NOLOAD): New tokens.
6143 (opt_address_and_section_type): Change type to output_section_header.
6144 (section_type): New non-terminal
6145 (section_header): Handle section type.
6146 (opt_address_and_section_type): Return section type value.
6148 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6150 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6151 * testsuite/plugin_common_test_2.c (foo): Likewise.
6153 2010-04-08 Doug Kwan <dougkwan@google.com>
6155 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6157 * output.cc (Output_section::add_merge_input_section): Simplify
6158 code and return status of Output_merge_base::add_input_section.
6159 Update merge section map only if Output_merge_base::add_input_section
6162 2010-04-07 Doug Kwan <dougkwan@google.com>
6164 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6165 if section is marked as containing instructions but has no mapping
6167 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6168 correct section index.
6169 (Arm_relobj::find_linked_text_section): Ditto.
6171 2010-04-07 Cary Coutant <ccoutant@google.com>
6173 * archive.cc (include_member): Destroy Read_symbols_data object before
6175 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6176 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6177 (Read_symbols_data::~Read_symbols_data) New destructor.
6178 (Section_relocs::Section_relocs) New constructor.
6179 (Section_relocs::~Section_relocs) New destructor.
6180 (Read_relocs_data::Read_relocs_data) New constructor.
6181 (Read_relocs_data::~Read_relocs_data) New destructor.
6182 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6183 pointers to NULL after deleting.
6185 2010-04-07 Doug Kwan <dougkwan@google.com>
6187 * arm.cc: Replace "endianity" with "endianness" in comments.
6188 (Arm_exidx_cantunwind): Ditto.
6189 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6190 (Arm_relobj::merge_flags_and_attributes): New method.
6191 (Arm_relobj::merge_flags_and_attributes_): New data member.
6192 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6193 (Arm_relobj::scan_sections_for_stubs): Ditto.
6194 (Arm_relobj::do_read_symbols): Check to see if we really want to
6195 merge processor-specific flags and attributes. Exit early if
6196 an object is empty except for section names and the undefined symbol.
6197 (Target_arm::do_finalize_sections): Move check for ELF format to
6198 Arm_relobj::do_read_symbols. Merge processor specific flags and
6199 attributes from a regular object only when we have determined that
6200 it is aapropriate. Do not create an .ARM.attributes section in
6201 output if there is no regular input object.
6202 (Target_arm::merge_processor_specific_flags): Check
6203 --warn-mismatch before printing any error.
6204 (Target_arm::merge_object_attributes): Ditto.
6205 * gold.cc (queue_middle_tasks): Handle the case in which there is
6206 no regular object in input.
6207 * options.cc (General_options::parse_EB): New method.
6208 (General_options::parse_EL): Same.
6209 (General_options::General_options): Initialize endianness_.
6210 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6212 (General_options::Endianness): New enum.
6213 (General_options::endianness): New method.
6214 (General_options::endianness_): New data member.
6215 * parameters.cc (Parameters::set_options): Check target endianness.
6216 (Parameters::set_target_once): Ditto.
6217 (Parameters::check_target_endianness): New method.
6218 (parameters_force_valid_target): If either -EL or -EB is specified,
6219 use it to define endianness of default target.
6220 * parameters.h (Parameters::check_target_endianness): New method
6222 * target.h (class Target): Change "endianity" to "endianness"
6225 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6227 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6228 * configure: Regenerate.
6229 * Makefile.in: Regenerate.
6230 * testsuite/Makefile.in: Regenerate.
6232 2010-04-06 Cary Coutant <ccoutant@google.com>
6235 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6236 prevailing definitions of common symbols.
6237 * testsuite/plugin_test_6.sh: New test case.
6238 * testsuite/plugin_common_test_1.c: New test case.
6239 * testsuite/plugin_common_test_2.c: New test case.
6240 * testsuite/Makefile.am (plugin_test_6): New test case.
6241 * testsuite/Makefile.in: Regenerate.
6243 2010-04-06 Nick Clifton <nickc@redhat.com>
6245 * po/vi.po: New Vietnamese translation.
6247 2010-03-30 Doug Kwan <dougkwan@google.com>
6249 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6251 2010-03-25 Doug Kwan <dougkwan@google.com>
6253 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6254 to avoid a conversion warning on a 32-bit host.
6256 2010-03-24 Ian Lance Taylor <iant@google.com>
6258 * testsuite/script_test_3.t: Add a TLS segment.
6259 * testsuite/Makefile.am (check_PROGRAMS): Add
6260 tls_phdrs_script_test.
6261 (tls_phdrs_script_test_SOURCES): Define.
6262 (tls_phdrs_script_test_DEPENDENCIES): Define.
6263 (tls_phdrs_script_test_LDFLAGS): Define.
6264 (tls_phdrs_script_test_LDADD): Define.
6265 * testsuite/Makefile.in: Rebuild.
6267 2010-03-23 Cary Coutant <ccoutant@google.com>
6269 * fileread.cc (find_or_make_view): Fix comment.
6271 2010-03-23 Ian Lance Taylor <iant@google.com>
6273 * script-sections.cc (class Orphan_section_placement): Define
6274 PLACE_TLS and PLACE_TLS_BSS.
6275 (Orphan_section_placement::Orphan_section_placement): Initialize
6277 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6278 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6279 (tls_script_test_SOURCES): Define.
6280 (tls_script_test_DEPENDENCIES): Define.
6281 (tls_script_test_LDFLAGS): Define.
6282 (tls_script_test_LDADD): Define.
6283 * testsuite/Makefile.in: Rebuild.
6285 2010-03-22 Doug Kwan <dougkwan@google.com>
6287 * arm.cc (Arm_relocate_functions::abs8,
6288 Arm_relocate_functions::abs16): Use correct check for overflow
6289 specified in the ARM ELF specs.
6290 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6291 target of a BLX instruction specially.
6292 (Reloc_stub::stub_type_for_reloc): Ditto.
6293 (Relocate::relocate): Use symbolic names instead of numeric relocation
6294 codes to report error.
6295 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6297 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6298 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6299 thumb2_blx_out_of_range.stdout
6300 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6301 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6302 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6303 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6304 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6305 thumb2_blx_in_range, thumb2_blx_in_range.o,
6306 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6307 thumb2_blx_out_of_range.o): New rules.
6308 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
6309 thumb2_blx_in_range and thumb2_blx_out_of_range.
6310 * testsuite/Makefile.in: Regenerate.
6311 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6312 * testsuite/thumb_blx_in_range.s: New file.
6313 * testsuite/thumb_blx_out_of_range.s: New file.
6315 2010-03-22 Rafael Espindola <espindola@google.com>
6317 * archive.cc (Should_include): Move to archive.h.
6318 (should_include_member): Make it a member of Archive.
6320 (Add_lib_group_symbols): New.
6321 * archive.h: Include options.h.
6322 (Archive_member): Moved from Archive.
6323 (Should_include): Moved from archive.cc.
6325 (Add_lib_group_symbols): New.
6326 * dynobj.cc (do_should_include_member): New.
6327 * dynobj.h (do_should_include_member): New.
6328 * gold.cc (queue_initial_tasks): Update call to queue.
6329 * main.cc (main): Print lib group stats.
6330 * object.cc (do_should_include_member): New.
6331 * object.h: Include archive.h.
6332 (Object::should_include_member): New.
6333 (Object::do_should_include_member): New.
6334 (Sized_relobj::do_should_include_member): New.
6335 * options.cc (General_options::parse_start_lib): New.
6336 (General_options::parse_end_lib): New.
6337 (Input_arguments::add_file): Handle lib groups.
6338 (Input_arguments::start_group): Check we are not in a lib.
6339 (Input_arguments::start_lib): New.
6340 (Input_arguments::end_lib): New.
6341 * options.h (General_options): Add start_lib and end_lib.
6342 (Input_argument::lib_): New.
6343 (Input_argument::lib): New.
6344 (Input_argument::is_lib): New.
6345 (Input_file_lib): New.
6346 (Input_arguments::in_lib_): New.
6347 (Input_arguments::in_lib): New.
6348 (Input_arguments::start_lib): New.
6349 (Input_arguments::end_lib_): New.
6350 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6351 in unused members as preempted.
6352 (Sized_pluginobj::do_should_include_member): New.
6353 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6354 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6356 (Read_symbols::do_whole_lib_group): New.
6357 (Read_symbols::do_lib_group): New.
6358 (Read_symbols::do_read_symbols): Handle lib groups.
6359 (Read_symbols::get_name): Handle lib groups.
6360 * readsyms.h (Read_symbols): Add an archive member pointer.
6361 (Read_symbols::do_whole_lib_group): New.
6362 (Read_symbols::do_lib_group): New.
6363 (Read_symbols::member_): New.
6364 * script.cc (read_input_script): Update call to queue_soon.
6366 2010-03-19 Doug Kwan <dougkwan@google.com>
6368 * arm.cc (Stub_table::Stub_table): Initialize new data members
6369 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6370 (Stub_table::add_reloc_stub): Assign stub offset and update
6371 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6372 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6374 (Stub_table::update_data_size_and_addralign): Use
6375 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6376 instead of going over all reloc stubs.
6377 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
6378 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6379 Stringpool_template::offset_ to size of Stringpool_char.
6380 (Stringpool_template::new_key_offset): Remove code to initialize
6381 Stringpool_template::offset_.
6382 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6383 Stringpool_template::offset_ to zero.
6385 2010-03-15 Doug Kwan <dougkwan@google.com>
6387 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6389 (Stringpool_template::new_key_offset): New method.
6390 (Stringpool_template::add_string): Assign offsets when adding new
6392 (Stringpool_template::set_string_offsets): Do not set string offsets
6393 when not optimizing.
6394 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6396 (Chunked_vector::clear): Clear size_.
6397 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6398 (Chunked_vector::size): Return size_.
6399 (Chunked_vector::push_back): Use size_ to find insert position.
6400 (Chunked_vector::size_): New data member.
6401 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6402 (Stringpool_template::new_key_offset): New method declaration.
6403 (Stringpool_template::offset_): New data member.
6405 2010-03-15 Rafael Espindola <espindola@google.com>
6407 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6408 Add_symbols' constructor.
6409 * readsyms.h (Add_symbols): Remove the input_group member.
6411 2010-03-10 Ian Lance Taylor <iant@google.com>
6413 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6414 target to ask whether a reference to a symbol requires a stack
6416 * target.h (Target::is_call_to_non_split): New function.
6417 (Target::do_is_call_to_non_split): Declare virtual function.
6418 * target.cc: Include "symtab.h".
6419 (Target::do_is_call_to_non_split): New function.
6420 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6422 2010-03-10 Cary Coutant <ccoutant@google.com>
6424 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6425 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6426 (File_read::open[2]): Add whole_file_view_ to list of views.
6427 (File_read::make_view): Remove test of whole_file_view_.
6428 (File_read::find_or_make_view): Create whole_file_view_ if
6430 (File_read::clear_views): Replace bool parameter with enum;
6431 adjust all callers. Don't delete views with permanent data;
6432 do delete cached views and views from archives if
6433 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6434 if clearing the corresponding view.
6435 * fileread.h (File_read::Clear_views_mode): New enum.
6436 (File_read::View::is_permanent_view): New method.
6437 (File_read::clear_views): Replace bool parameter
6438 with enum; adjust all callers.
6439 * options.h (General_options): Change keep_files_mapped option;
6440 add map_whole_files.
6441 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6443 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6446 2010-03-10 David S. Miller <davem@davemloft.net>
6448 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6450 2010-03-09 Sriraman Tallam <tmsriram@google.com>
6452 * icf.cc (get_section_contents): Add '@' marker after processing the
6455 2010-03-08 Doug Kwan <dougkwan@google.com>
6457 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6458 due to a conversion warning.
6459 (Arm_relobj::update_output_local_symbol_count): Check for local
6460 symbol with unset output index.
6462 2010-03-05 Ian Lance Taylor <iant@google.com>
6464 * options.h (class General_options): Add --spare-dynamic-tags.
6465 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6466 --spare-dynamic-tags.
6468 2010-03-05 Ian Lance Taylor <iant@google.com>
6470 * incremental.cc: Include "libiberty.h".
6472 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6474 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6475 function, is_info_ member.
6476 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6477 (Versions::Versions): Update caller.
6478 (Versions::define_base_version): Likewise.
6479 (Versions::add_def): Likewise.
6481 2010-03-03 Sriraman Tallam <tmsriram@google.com>
6483 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6484 (Scan::possible_function_pointer_reloc): New function.
6485 (Scan::local_reloc_may_be_function_pointer): Change to call
6486 possible_function_pointer_reloc.
6487 (Scan::global_reloc_may_be_function_pointer): Ditto.
6488 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6489 relocations in ".data.rel.ro._ZTV" section.
6490 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6491 * testsuite/icf_safe_so_test.cc: Ditto.
6492 * testsuite/icf_safe_test.cc: Ditto.
6493 * testsuite/icf_safe_test.sh: Ditto.
6495 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6496 Ian Lance Taylor <iant@google.com>
6498 * target-reloc.h (relocate_section): Check the symbol table index
6499 for -1U before setting the local symbol index.
6500 (scan_relocatable_relocs): If copying the relocation, record that
6501 the local symbol is required.
6502 * object.h (Symbol_value::is_output_symtab_index_set): New
6504 (Symbol_value::may_be_discarded_from_output_symtab): New
6506 (Symbol_value::has_output_symtab_entry): New function.
6507 (Symbol_value::needs_output_symtab_entry): Remove.
6508 (Symbol_value::output_symtab_index): Make sure the symbol index is
6510 (Symbol_value::set_output_symtab_index): Make sure the symbol
6511 index is not set. Make sure the new index is valid.
6512 (Symbol_value::set_must_have_output_symtab_entry): New function.
6513 (Symbol_value::has_output_dynsym_entry): New function.
6514 (Symbol_value::set_output_dynsym_index): Make sure the new index
6516 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6517 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6518 local symbol if permitted.
6519 (Sized_relobj::do_finalize_local_symbols): Call
6520 is_output_symtab_index_set rather than needs_output_symtab_entry.
6521 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6522 rather than needs_output_symtab_entry. Call
6523 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6524 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6525 is_output_symtab_index_set rather than needs_output_symtab_entry.
6526 * testsuite/discard_locals_relocatable_test.c: New file.
6527 * testsuite/discard_locals_test.sh: Test -r.
6528 * testsuite/Makefile.am (check_DATA): Add
6529 discard_locals_relocatable_test1.syms,
6530 discard_local_relocatable_test2.syms.
6531 (MOSTLYCLEANFILES): Likewise. Also add
6532 discard_locals_relocatable_test1.lout and
6533 discard_locals_relocatable_test2.out.
6534 (discard_locals_relocatable_test1.syms): New target.
6535 (discard_locals_relocatable_test.o): New target.
6536 (discard_locals_relocatable_test1.out): New target.
6537 (discard_locals_relocatable_test2.syms): New target.
6538 (discard_locals_relocatable_test2.out): New target.
6539 (various): Add missing ../ld-new dependencies.
6540 * testsuite/Makefile.in: Rebuild.
6542 2010-03-03 Nick Clifton <nickc@redhat.com>
6544 * po/fi.po: New Finnish translation.
6546 2010-03-01 Doug Kwan <dougkwan@google.com>
6548 * layout.cc (Layout::Layout): Force section types of .init_array*,
6549 .preinit_array* and .fini_array* sections.
6550 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6551 Fix check of return value of std::string::find.().
6552 (Output_section::Input_section_sort_compare::operator()): Remove
6553 comment about .init_array.
6554 (Output_section::Input_section_sort_init_fini_compare::operator()):
6556 (Output_section::sort_attached_input_sections): Handle .init_array
6557 and .fini_array specially.
6558 * output.h (Output_section::Inut_section_sort_compare): Update
6560 (Output_section::Input_section_sort_init_fini_compare): New struct.
6562 2010-02-26 Doug Kwan <dougkwan@google.com>
6564 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6565 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6566 * testsuite/debug_msg.sh: Avoid matching source line number for
6567 use of global variable undef_int.
6569 2010-02-26 Doug Kwan <dougkwan@google.com>
6571 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6572 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6573 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6574 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6575 * options.cc (General_options::General_options): Initialize member
6577 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6578 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6579 and rm_no_fix_v4bx.stdout
6580 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6581 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6582 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6583 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6584 and arm_no_fix_v4bx.
6585 * Makefile.in: Regenerate.
6586 * testsuite/arm_fix_v4bx.s: New file.
6587 * testsuite/arm_fix_v4bx.sh: Ditto.
6589 2010-02-24 Doug Kwan <dougkwan@google.com>
6591 * arm.cc (Target_arm::got_section): Make the .got section the first
6592 non RELRO section in the data segment.
6593 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6594 suffixes of section names.
6596 2010-02-24 Doug Kwan <dougkwan@google.com>
6598 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6599 flags and attributes merging if an input file is a binary file.
6600 * fileread.cc (Input_file::open): Record format of original file.
6601 * fileread.h (Input_file::Format): New enum type.
6602 (Input_file::Input_file): Initialize data member format_.
6603 (Input_file::format): New method definition.
6604 (Input_file::format_):: New data member.
6606 2010-02-24 Doug Kwan <dougkwan@google.com>
6608 * arm.cc (Arm_output_data_got): New class.
6609 (ARM_TCB_SIZE): New constant
6610 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6611 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6612 If user uses a script with a SECTIONS clause, issue only a warning
6613 for a misplaced EXIDX input section. Otherwise, issue an error.
6614 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
6616 (Target_arm::got_mode_index_entry): Handle static linking.
6617 (Target_arm::Scan::local): Ditto.
6618 (Target_arm::Scan::global): Ditto.
6619 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6620 all incorrectly implemented relocations.
6621 (Target_arm::fix_exidx_coverage): Pass layout to
6622 Arm_output_section::fix_exidx_coverage.
6623 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6624 from ".ARM.exidx." and ".ARM.extab.".
6626 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6628 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6629 section if it does not already exist.
6630 * attributes.cc (Attributes_section_data::Attributes_section_data):
6631 Don't crash if size is zero.
6633 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6634 Ian Lance Taylor <iant@google.com>
6636 * gold.cc (queue_middle_tasks): If no input files were opened,
6638 * workqueue.h (Task_function::Task_function): Assert that there is
6641 2010-02-22 Doug Kwan <dougkwan@google.com>
6643 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6644 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6645 types to avoid warnings due to different uint64_t implementations
6648 2010-02-21 Doug Kwan <dougkwan@google.com>
6650 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6651 handling of the maximum backward branch offset.
6652 (Arm_relocate_functions::thumb_branch_common): Ditto.
6653 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6654 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
6655 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
6656 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6657 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6658 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6659 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6660 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6661 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6662 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6663 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6664 thumb2_bl_out_of_range.o): New rules.
6665 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6666 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6667 thumb2_bl_out_of_range
6668 * testsuite/Makefile.in: Regenerate.
6669 * testsuite/arm_bl_in_range.s: New file.
6670 * testsuite/arm_bl_out_of_range.s: Ditto.
6671 * testsuite/arm_branch_in_range.sh: Ditto.
6672 * testsuite/arm_branch_range.t: Ditto.
6673 * testsuite/thumb2_branch_range.t: Ditto.
6674 * testsuite/thumb_bl_in_range.s: Ditto.
6675 * testsuite/thumb_bl_out_of_range.s: Ditto.
6676 * testsuite/thumb_branch_range.t: Ditto.
6678 2010-02-20 Sriraman Tallam <tmsriram@google.com>
6680 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6681 Add reloc offset information.
6682 * icf.cc (get_section_contents): Change iterators to point to the new
6683 vectors. Add reloc offset information to the contents.
6684 * icf.h (Icf::Sections_reachable_info): New typedef.
6685 (Icf::Sections_reachable_list): New typedef.
6686 (Icf::Offset_info): New typedef.
6687 (Icf::Reloc_info): New struct typedef.
6688 (Icf::Reloc_info_list): New typedef.
6689 (Icf::symbol_reloc_list): Delete method.
6690 (Icf::addend_reloc_list): Delete method.
6691 (Icf::section_reloc_list): Delete method.
6692 (Icf::reloc_info_list): New method.
6693 (Icf::reloc_info_list_): New member.
6695 2010-02-19 Doug Kwan <dougkwan@google.com>
6697 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6698 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6699 * arm.cc (Arm_relocation_functions): New forward declaration.
6700 (Target_arm::Target_arm): Initialize new data members
6701 got_mod_index_offset_ and tls_base_symbol_defined_.
6702 (Target_arm::Relocate::relocate_tls): New method.
6703 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6704 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6706 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
6707 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6708 (Target_arm::got_mod_index_offset_,
6709 Target_arm::tls_base_symbol_defined_): New data members.
6710 (Target_arm::Scan::local, Target::Scan::global,
6711 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6714 2010-02-18 Doug Kwan <dougkwan@google.com>
6716 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6717 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6718 text section as a parameter becuase some broken tools may not set
6719 the link in section header.
6720 (Target_arm::has_got_section): New method.
6721 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6722 without any mapping symbol as data only. Remove warning.
6723 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6724 link in its section header, try to discover the link by inspecting the
6725 REL31 relocation at the beginning of the section.
6726 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6728 (Target_arm::Scan::global): Treat any reference to the symbol
6729 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6731 2010-02-12 Sriraman Tallam <tmsriram@google.com>
6733 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6734 (Scan::global_reloc_may_be_function_pointer): New function.
6735 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6736 (Scan::global_reloc_may_be_function_pointer): New function.
6737 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6738 (Scan::global_reloc_may_be_function_pointer): New function.
6739 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6740 (Scan::global_reloc_may_be_function_pointer): New function.
6741 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6742 (Scan::global_reloc_may_be_function_pointer): New function.
6743 (Scan::possible_function_pointer_reloc): New function.
6744 (Target_x86_64::can_check_for_function_pointers): New function.
6745 * gc.h (gc_process_relocs): Scan relocation types to determine if
6746 function pointers were taken for targets that support it.
6747 * icf.cc (Icf::find_identical_sections): Include functions for
6748 folding in safe ICF whose pointer is not taken.
6749 * icf.h (Secn_fptr_taken_set): New typedef.
6750 (fptr_section_id_): New member.
6751 (section_has_function_pointers): New function.
6752 (set_section_has_function_pointers): New function.
6753 (check_section_for_function_pointers): New function.
6754 * options.h: Fix comment for safe ICF option.
6755 * target.h (can_check_for_function_pointers): New function.
6756 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6757 Modify icf_safe_test for X86-64.
6758 * testsuite/Makefile.in: Regenerate.
6759 * testsuite/icf_safe_so_test.cc: New file.
6760 * testsuite/icf_safe_so_test.sh: New file.
6761 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6762 (main): Change to take pointer to function kept_func_3.
6763 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6764 folding is done correctly for X86-64.
6766 2010-02-12 David S. Miller <davem@davemloft.net>
6768 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6769 is_symbolless parameter.
6770 (Output_reloc<SHT_REL>::is_symbolless): New.
6771 (Output_reloc<SHT_REL>::is_symbolless_): New.
6772 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6773 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6774 (Output_reloc<SHT_RELA>::is_symbolless): New.
6775 (Output_data_reloc::add_global): Handle is_symbolless.
6776 (Output_data_reloc::add_global_relative): Likewise.
6777 (Output_data_reloc::add_local): Likewise.
6778 (Output_data_reloc::add_local_relative): Likewise.
6779 (Output_data_reloc::add_symbolless_global_addend): New.
6780 (Output_data_reloc::add_symbolless_local_addend): New.
6781 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6783 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6784 instead of ->is_relative_
6785 (Output_reloc::write): Likewise.
6786 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6787 (Output_reloc::write_rel): Simplify.
6789 * sparc.cc (Target_sparc::Scan::local): Use
6790 ->add_symbolless_local_addend as needed.
6791 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6792 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6793 based upon relocation offset.
6795 2010-02-11 Doug Kwan <dougkwan@google.com>
6797 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6798 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6799 beginning of function.
6800 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6801 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6802 parameter is_32bit in calls to should_apply_static_reloc.
6803 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6804 (check_DATA): Add arm_abs_global.stdout.
6805 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6806 arm_abs_global.stdout): New rules.
6807 (MOSTLLYCLEANFILES): Add arm_abs_global
6808 * Makefile.in: Regenerate.
6809 * testsuite/arm_abs_global.s: New file.
6810 * testsuite/arm_abs_global.sh: Ditto.
6811 * testsuite/arm_abs_lib.s: Ditto.
6813 2010-02-11 Ian Lance Taylor <iant@google.com>
6815 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6817 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6818 Allocate_commons_task first.
6819 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6820 task, rather than symtab_lock_.
6821 (Gc_process_relocs::~Gc_process_relocs): New function.
6822 (Gc_process_relocs::is_runnable): Check this_blocker_.
6823 (Gc_process_relocs::locks): Use next_blocker_ rather than
6825 (Scan_relocs::~Scan_relocs): New function.
6826 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6828 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6830 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6831 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6832 constructor accordingly.
6833 (class Gc_process_relocs): Likewise.
6834 (class Scan_relocs): Likewise.
6835 * common.h (class Allocate_commons_task): Remove symtab_lock_
6836 field, and corresponding constructor parameter.
6837 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6839 (Allocate_commons_task::locks): Likewise.
6841 2010-02-11 Ian Lance Taylor <iant@google.com>
6843 * gold-threads.h (class Once): Define.
6844 (class Initialize_lock): Rewrite as child of Once.
6845 * gold-threads.cc (class Once_initialize): Define.
6846 (once_pointer_control): New static variable.
6847 (once_pointer, once_arg): New static variables.
6848 (c_run_once): New static function.
6849 (Once::Once, Once::run_once, Once::internal_run): New functions.
6850 (class Initialize_lock_once): Remove.
6851 (initialize_lock_control): Remove.
6852 (initialize_lock_pointer): Remove.
6853 (initialize_lock_once): Remove.
6854 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6855 (Initialize_lock::initialize): Rewrite.
6856 (Initialize_lock::do_run_once): New function.
6857 * archive.cc (Archive::interpret_header): Only clear name if it is
6859 * fileread.cc: Include "gold-threads.h"
6860 (file_counts_lock): New static variable.
6861 (file_counts_initialize_lock): Likewise.
6862 (File_read::release): Only increment counts when using --stats.
6863 Use a lock around the increment.
6864 * parameters.cc (class Set_parameters_target_once): Define.
6865 (set_parameters_target_once): New static variable.
6866 (Parameters::Parameters): Move here from parameters.h.
6867 (Parameters::set_target): Rewrite.
6868 (Parameters::set_target_once): New function.
6869 (Parameters::clear_target): Move here and rewrite.
6870 * parameters.h (class Parameters): Update declarations. Add
6871 set_parameters_target_once_ field.
6872 (Parameters::Parameters): Move to parameters.cc.
6873 (Parameters::clear_target): Likewise.
6874 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6876 (Start_group::~Start_group): New function.
6877 (Start_group::is_runnable): New function.
6878 (Start_group::locks, Start_group::run): New functions.
6879 (Finish_group::run): Change saw_undefined to size_t.
6880 * readsyms.h (class Start_group): Define.
6881 (class Finish_group): Change saw_undefined_ field to size_t.
6882 (Finish_group::Finish_group): Remove saw_undefined and
6883 this_blocker parameters. Change all callers.
6884 (Finish_group::set_saw_undefined): New function.
6885 (Finish_group::set_blocker): New function.
6886 * symtab.h (class Symbol_table): Change saw_undefined to return
6887 size_t. Change saw_undefined_ field to size_t.
6888 * target-select.cc (Set_target_once::do_run_once): New function.
6889 (Target_selector::Target_selector): Initialize set_target_once_
6890 field. Don't initialize lock_ and initialize_lock_ fields.
6891 (Target_selector::instantiate_target): Rewrite.
6892 (Target_selector::set_target): New function.
6893 * target-select.h (class Set_target_once): Define.
6894 (class Target_selector): Update declarations. Make
6895 Set_target_once a friend. Remove lock_ and initialize_lock_
6896 fields. Add set_target_once_ field.
6898 2010-02-10 Ian Lance Taylor <iant@google.com>
6900 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6902 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6903 (queue_middle_tasks): Add all blockers before queueing any tasks.
6904 (queue_final_tasks): Likewise.
6905 * token.h (Task_token::add_blockers): New function.
6906 * object.h (Input_objects::number_of_relobjs): New function.
6908 2010-02-10 Ian Lance Taylor <iant@google.com>
6910 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6911 shared, not if not position independent.
6912 * x86_64.cc (Relocate::relocate_tls): Likewise.
6913 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6914 (tls_pie_pic_test): New target.
6915 * testsuite/Makefile.in: Rebuild.
6917 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6918 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6919 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6920 * testsuite/Makefile.in: Rebuild.
6922 2010-02-09 David S. Miller <davem@davemloft.net>
6924 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6925 R_SPARC_RELATIVE using ->add_local_relative().
6926 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6928 * output.h (Output_data_dynamic::add_section_size): New method
6929 that takes two Output_data objects.
6930 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6931 entry param. Handle it in initializers.
6932 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6933 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6934 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6936 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6937 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6938 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6939 for dynrel_includes_plt.
6940 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6941 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6942 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6944 (Target_sparc::do_finalize_sections): Update to pass true for
6945 dynrel_includes_plt.
6946 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6947 output before .rela.plt
6948 (Target_powerpc::do_finalize_sections): Update to pass true for
6949 dynrel_includes_plt when 32-bit.
6951 2010-02-08 Doug Kwan <dougkwan@google.com>
6953 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6955 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6956 Arm_relobj::scan_section_for_cortex_a8_stubs,
6957 Arm_relobj::do_relocation_section): Instead of calling
6958 Output_section::output_address, use faster
6959 Arm_relobj::simple_input_section_output_address.
6961 2010-02-08 David S. Miller <davem@davemloft.net>
6963 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6964 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6965 relocation helper function.
6967 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6968 just like R_SPARC_GOT{10,13,22}.
6969 (Target_sparc::Scan::local): Likewise.
6970 (Target_sparc::Relocate:relocate): Likewise.
6972 2010-02-06 Ian Lance Taylor <iant@google.com>
6974 * configure.ac: Rewrite targetobjs duplicate removal code to use
6975 only shell constructs.
6976 * configure: Rebuild.
6978 2010-02-05 Doug Kwan <dougkwan@google.com>
6981 * arm.cc (Arm_relobj::section_is_scannable): New method.
6982 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6983 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6985 2010-02-04 Doug Kwan <dougkwan@google.com>
6988 * arm-reloc-property.cc (cstdio): Include.
6989 * configure.ac (targetobjs): Remove duplicates.
6990 * configure: Regenerate.
6991 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6992 big and little endian version for a given address size.
6994 2010-02-03 Doug Kwan <dougkwan@google.com>
6996 * arm-reloc-property.cc
6997 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6999 * arm-reloc-property.h
7000 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7001 New method definition.
7002 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7004 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7006 (GOT_PREL): Change implemented to Y.
7007 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7008 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7009 (Arm_relocate_functions::movw_abs_nc): Remove method.
7010 (Arm_relocate_functions::movt_abs): Ditto.
7011 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7012 (Arm_relocate_functions::thm_movt_abs): Ditto.
7013 (Arm_relocate_functions::movw_rel_nc): Ditto.
7014 (Arm_relocate_functions::movw_rel): Ditto.
7015 (Arm_relocate_functions::movt_rel): Ditto.
7016 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7017 (Arm_relocate_functions:thm_movw_rel): Ditto.
7018 (Arm_relocate_functions:thm_movt_rel): Ditto.
7019 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7020 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7021 New method definitions.
7022 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7023 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7024 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7025 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7026 (Target_arm::Relocate::relocate): Check for non-static or
7027 unimplemented relocation code and exit early. Change calls to
7028 Target_arm::reloc_uses_thumb_bit and
7029 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7030 instead. Refactor code to handle similar relocations to increase
7031 code sharing. Remove check for unsupported relocation code in switch
7033 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7034 relocation property table to find out size. Change error message to
7035 print out the name of a relocation code instead of the numeric value.
7036 (Target_arm::scan_reloc_for_stub): Use relocation property table
7037 instead of calling Target_arm::reloc_uses_thumb_bit().
7039 2010-02-02 Doug Kwan <dougkwan@google.com>
7041 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7042 types of relaxed input section.
7044 2010-02-02 Doug Kwan <dougkwan@google.com>
7046 * Makefile.am (HFILES): Add arm-reloc-property.h.
7048 (TARGETSOURCES): Add arm-reloc-property.cc
7049 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
7050 (libgold_a_SOURCES): $(DEFFILES)
7051 * Makefile.in: Regenerate.
7052 * arm-reloc-property.cc: New file.
7053 * arm-reloc-property.h: New file.
7054 * arm-reloc.def: New file.
7055 * arm.cc: Update comments.
7056 (arm-reloc-property.h): New included header.
7057 (arm_reloc_property_table): New global variable.
7058 (Target_arm::do_select_as_default_target): New method definition.
7059 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7060 arm-reloc-property to targ_extra_obj.
7061 * parameters.cc (set_parameters_target): Call
7062 Target::select_as_default_target().
7063 * target.h (Target::select_as_default_target): New method definition.
7064 (Target::do_select_as_default_target): Same.
7066 2010-02-01 Doug Kwan <dougkwan@google.com>
7068 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7069 first_output_text_section_.
7070 (Arm_exidx_fixup::first_output_text_section): New method definition.
7071 (Arm_exidx_fixup::first_output_text_section_): New data member.
7072 (Arm_exidx_fixup::process_exidx_section): Record the first text
7073 output section seen.
7074 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7075 and entsize in output section header.
7077 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7079 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7080 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7081 (Arm_relocate_functions::thm_alu11): New Method.
7082 (Arm_relocate_functions::thm_pc8): New Method.
7083 (Arm_relocate_functions::thm_pc12): New Method.
7084 (Target_arm::Scan::local): Handle the relocations.
7085 (Target_arm::Scan::global): Likewise.
7086 (Target_arm::Relocate::relocate): Likewise.
7087 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7089 2010-01-29 Doug Kwan <dougkwan@google.com>
7091 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7092 of relocation types as ld.
7094 2010-01-29 Doug Kwan <dougkwan@google.com>
7096 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7098 (Arm_relocate_functions::thumb_branch_common): Ditto.
7099 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7100 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7101 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7102 Arm_relocate_functions::jump24): Remove.
7103 (Target_arm::Relocate::relocate): Adjust code to call
7104 Arm_relocation_functions::arm_branch_common and
7105 Arm_relocation_functions::thumb_branch_common instead of their removed
7106 wrappers. Merge switch-cases together to reduce source code size.
7108 2010-01-29 Doug Kwan <dougkwan@google.com>
7110 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7111 output_local_symbol_count_needs_update_.
7112 (Arm_relobj::output_local_symbol_count_needs_update,
7113 Arm_relobj::set_output_local_symbol_count_needs_update,
7114 Arm_relobj::update_output_local_symbol_count): New methods.
7115 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7117 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7118 of pointed function as in a R_ARM_PREL31 relocation.
7119 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7120 for output local symbol count updating.
7121 (Target_arm::do_relax): Update output local symbol counts in objects
7123 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7125 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7127 * arm.cc: Added support for the ARM relocations:
7128 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7129 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7130 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7132 (Arm_relocate_functions::movw_rel): New method.
7133 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7134 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7136 (Arm_relocate_functions::thm_movw_rel): New method.
7137 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7139 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7141 (Target_arm::Scan::global): Likewise.
7142 (Target_arm::Relocate::relocate): Likewise.
7143 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7146 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7148 * arm.cc: Added support for ARM group relocations.
7149 (Target_arm::reloc_needs_sym_origin): New method.
7150 (Arm_relocate_functions::calc_grp_kn): New method.
7151 (Arm_relocate_functions::calc_grp_residual): New method.
7152 (Arm_relocate_functions::calc_grp_gn): New method.
7153 (Arm_relocate_functions::arm_grp_alu): New Method.
7154 (Arm_relocate_functions::arm_grp_ldr): New Method.
7155 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7156 (Arm_relocate_functions::arm_grp_ldc): New Method.
7157 (Target_arm::Scan::local): Handle the ARM group relocations.
7158 (Target_arm::Scan::global): Likewise.
7159 (Target_arm::Relocate::relocate): Likewise.
7160 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7163 2010-01-26 Doug Kwan <dougkwan@google.com>
7165 * arm.cc (set): Include.
7166 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7168 (Arm_output_section::Text_section_list): New type.
7169 (Arm_output_section::append_text_sections_to_list): New method.
7170 (Arm_output_section::fix_exidx_coverage): Ditto.
7171 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
7172 (Arm_relobj::convert_input_section_to_relaxed_section): Use
7173 Relobj::set_section_offset() instead of
7174 Sized_relobj::invalidate_section_offset().
7175 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
7176 parameter for section headers. Ignore relocation sections for
7177 unallocated sections and EXIDX sections.
7178 (Target_arm::fix_exidx_coverage): New method.
7179 (Target_arm::output_section_address_less_than): New type.
7180 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7181 linked text section instead of the EXIDX section.
7182 (Arm_output_section::create_stub_group): Add an assertion to check
7183 that this is not an EXIDX output section.
7184 (Arm_output_section::append_text_sections_to_list): New method.
7185 (Arm_output_section::fix_exidx_coverage): Ditto.
7186 (Arm_relobj::scan_sections_for_stubs): Adjust call to
7187 Arm_relobj::section_needs_reloc_stub_scanning.
7188 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7190 (Target_arm::fix_exidx_coverage): New method.
7191 * object.h (Relobj::set_output_section): New method.
7192 (Sized_relobj::invalidate_section_offset): Remove method.
7193 (Sized_relobj::do_invalidate_section_offset): Remove method.
7194 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7196 2010-01-25 Doug Kwan <dougkwan@google.com>
7198 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7199 Fix warning due to signed and unsigned comparison on a 32-bit host.
7201 2010-01-22 Doug Kwan <dougkwan@google.com>
7203 * arm.cc (Target_arm::do_relax): Record an output section for section
7204 offset adjustment it contains any stub table that has changed.
7205 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7206 offsets in an output section if necessary.
7207 * output.cc (Output_section::Output_section): Initialize
7208 section_offsets_need_adjustments_.
7209 (Output_section::add_input_section_for_script): Renamed to
7210 Output_section::add_simple_input_section.
7211 (Output_section::save_states): Add a comment.
7212 (Output_section::discard_states): New method defintion.
7213 (Output_section::adjust_section_offsets): Same.
7214 * output.h (Output_section::add_input_section_for_script): Renamed to
7215 Output_section::add_simple_input_section.
7216 (Output_section::discard_states): New method declaration.
7217 (Output_section::adjust_section_offsets): Same.
7218 (Output_section::section_offsets_need_adjustment,
7219 Output_section::set_section_offsets_need_adjustment): New method
7221 (Output_section::section_offsets_need_adjustment_): New data member.
7222 * script-sections.cc
7223 (Output_section_element_input::set_section_address): Adjust code for
7224 renaming of Output_section::add_input_section_for_script.
7225 (Orphan_output_section::set_section_address): Same.
7227 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7229 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7230 Fix_v4bx enum values .
7231 * gold/options.h (General_options): New option definitions.
7232 (General_options::fix_v4bx): New method.
7233 (General_options::Fix_v4bx): New enum.
7234 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7235 (General_options::parse_fix_v4bx_interworking): New method.
7237 2010-01-22 Doug Kwan <dougkwan@google.com>
7239 * arm.cc (Arm_exidx_fixup): New class.
7241 2010-01-21 Doug Kwan <dougkwan@google.com>
7243 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7245 (Arm_exidx_section_offset_map): New type.
7247 2010-01-21 Doug Kwan <dougkwan@google.com>
7249 * arm.cc (Arm_exidx_input_section): New class.
7250 (Arm_relobj::exidx_input_section_by_link,
7251 Arm_relobj::exidx_input_section_by_shndx,
7252 Arm_relobj::make_exidx_input_section): New methods.
7253 (read_arm_attributes_section): Remove.
7254 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7255 information about them.
7256 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7259 2010-01-20 Doug Kwan <dougkwan@google.com>
7261 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7262 Input_section_specifier to Section_id.
7263 (Target_arm::new_arm_input_section: Adjust code for change of key
7265 (Target_arm::find_arm_input_section): Ditto.
7266 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7267 (Section_id): Remove.
7268 (Garbage_collection::Section_id_hash): Remove.
7269 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7270 (Section_id): Remove.
7271 (Icf::Section_id_hash): Remove.
7272 * object.h (Section_id, Const_section_id, Section_id_hash,
7273 Const_section_id_hash): New type definitions.
7274 * output.cc (Output_section::add_relaxed_input_section): Change to
7275 use Const_section_id instead of Input_section_specifier as key type.
7276 (Output_section::add_merge_input_section): Ditto.
7277 (Output_section::build_relaxation_map): Change to use Section_id
7278 instead of Input_section_specifier as key type.
7279 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7281 (Output_section::convert_input_sections_to_relaxed_sections): Change
7282 to use Const_section_id instead of Input_section_specifier as key type.
7283 (Output_section::find_merge_section): Ditto.
7284 (Output_section::find_relaxed_input_section): Ditto.
7285 * output.h (Input_section_specifier): Remove class.
7286 (Output_section::Output_section_data_by_input_section_map): Change
7287 key type to Const_section_id.
7288 (Output_section::Output_relaxed_input_section_by_input_section_map):
7290 (Output_section::Relaxation_map): Change key type to Section_id.
7292 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7294 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7295 (class Arm_v4bx_stub): New class.
7296 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7297 (Stub_factory::make_arm_v4bx_stub): New method.
7298 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7299 (Stub_table::empty): Handle v4bx stubs.
7300 (Stub_table::add_arm_v4bx_stub): New method.
7301 (Stub_table::find_arm_v4bx_stub): New method.
7302 (Arm_relocate_functions::v4bx): New method.
7303 (Target_arm::fix_v4bx): New method.
7304 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7305 (Stub_table::relocate_stubs): Likewise.
7306 (Stub_table::do_write): Likewise.
7307 (Stub_table::update_data_size_and_addralign): Likewise.
7308 (Stub_table::finalize_stubs): Likewise.
7309 (Target_arm::Scan::local): Likewise.
7310 (Target_arm::Scan::global): Likewise.
7311 (Target_arm::do_finalize_sections): Likewise.
7312 (Target_arm::Relocate::relocate): Likewise.
7313 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7315 (Target_arm::scan_reloc_for_stub): Likewise.
7316 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7318 2010-01-19 Ian Lance Taylor <iant@google.com>
7320 * output.cc (Output_section_headers::do_sized_write): Write large
7321 segment count to sh_info field.
7322 (Output_file_header::do_sized_write): For large segment count,
7323 write PN_XNUM to e_phnum field.
7325 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7327 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7328 (Arm_relocate_functions::thm_jump8): New function.
7329 (Arm_relocate_functions::thm_jump11): New function.
7330 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7332 (Target_arm::Scan::global): Likewise.
7333 (Target_arm::Relocate::relocate): Likewise.
7334 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7337 2010-01-14 Doug Kwan <dougkwan@google.com>
7339 * arm.cc (map, utility): Include headers.
7340 (Target_arm::apply_cortex_a8_workaround): New method.
7341 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7342 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7343 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7344 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7345 the --[no-]fix-cortex-a8 command line options.
7346 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7347 (Target_arm::relocate_stub): Use addend in instruction template.
7348 * options.h (DEFINE_bool): Set the user-set flag.
7349 (General_options): Add --[no-]-fix-cortex options.
7350 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
7351 : Update fast look-up map after conversion.
7353 2010-01-14 Sriraman Tallam <tmsriram@google.com>
7355 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7356 in the first pass of do_layout.
7358 2010-01-13 Doug Kwan <dougkwan@google.com>
7360 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7361 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7362 apparent compiler problem of not folding static constant integral
7363 data members of elfcpp::Elf_sizes<32>.
7365 2010-01-13 Doug Kwan <dougkwan@google.com>
7367 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7368 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7369 Arm_relobj::scan_section_for_cortex_a8_erratum,
7370 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7371 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7372 sections to scan for relocation stubs into a new method
7373 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7374 relocation and Cortex-A8 stub scanning.
7375 (Target_arm::do_relax): Force stubs to be after stubbed sections
7376 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
7377 the beginning of a new relaxation pass. Update a comment.
7378 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7380 2010-01-12 Ian Lance Taylor <iant@google.com>
7382 * target-reloc.h (visibility_error): New inline function.
7383 (relocate_section): Call visibility_error.
7384 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7385 (MOSTLYCLEANFILES): Likewise.
7386 (protected_4_pic.o, protected_3.err): New targets.
7387 * testsuite/protected_4.cc: New file.
7389 2010-01-12 Doug Kwan <dougkwan@google.com>
7391 * arm.cc (Cortex_a8_reloc): New class.
7392 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7393 and cortex_a8_relocs_info_.
7394 (Target_arm::fix_cortex_a8): New method definition.
7395 (Target_arm::Cortex_a8_relocs_info): New type.
7396 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7397 New data member declarations.
7398 (Target_arm::scan_reloc_for_stub): Record information about
7399 relocations for THUMB branches that might be exempted from the
7400 Cortex-A8 workaround.
7401 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7402 at the beginning of a relaxation pass.
7404 2010-01-12 Doug Kwan <dougkwan@google.com>
7406 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7407 (Arm_relobj::Mapping_symbol_position,
7408 Arm_reloj::Mapping_symbol_position_less,
7409 Arm_relobj::Mapping_symbols_info): New types.
7410 (Target_arm::is_mapping_symbol_name): New method definition.
7411 (Arm_relobj::do_count_local_symbols): Save information about mapping
7414 2010-01-11 Doug Kwan <dougkwan@google.com>
7416 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7417 Arm_relocate_functions::thumb32_branch_upper,
7418 Arm_relocate_functions::thumb32_branch_lower,
7419 Arm_relocate_functions::thumb32_cond_branch_offset,
7420 Arm_relocate_functions::thumb32_cond_branch_upper,
7421 Arm_relocate_functions::thumb32_cond_branch_lower,
7422 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7423 branch offset encoding.
7424 (Arm_relocate_functions::thumb_branch_common): Use new branch
7425 offset encoding methods to avoid code duplication.
7426 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7427 (Stub_addend_reader::operator()): Use new branch encoding method
7428 to avoid code duplication.
7430 2010-01-11 Doug Kwan <dougkwan@google.com>
7432 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7433 (Target_arm::do_finalize_sections): Define special EXIDX section
7434 symbols only if referenced.
7435 * gc.h (Garbage_collection::add_reference): New method.
7436 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7439 2010-01-11 Ian Lance Taylor <iant@google.com>
7441 * script.cc (Version_script_info::build_expression_list_lookup):
7442 Change complaing about duplicate wildcard match from error to
7445 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7447 (Version_script_info::Version_script_info): Initialize globs_,
7448 default_version_, default_is_global_, and exact_. Don't
7449 initialize globals_ or locals_.
7450 (Version_script_info::build_lookup_tables): Build local symbols
7452 (Version_script_info::unquote): New function.
7453 (Version_script_info::add_exact_match): New function.
7454 (Version_script_info::build_expression_list_lookup): Remove lookup
7455 parameter. Add is_global parameter. Change all callers. Handle
7456 wildcard pattern specially. Unquote pattern. Call
7458 (Version_script_info::get_name_to_match): New function.
7459 (Version_script_info::get_symbol_version): New function.
7460 (Version_script_info::get_symbol_version_helper): Remove.
7461 (Version_script_info::check_unmatched_names): Call unquote.
7462 * script.h (class Version_script_info): Change get_symbol_version
7463 to be non-inline and add is_global parameter; change all callers.
7464 Rewrite symbol_is_local. Update declarations. Define struct
7465 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7466 Remove globals_ and locals_ members. Add exact_, globs_,
7467 default_version_, is_global_.
7468 (Version_script_info::Glob): Remove pattern, add expression and
7469 is_global. Update constructor. Change all callers.
7470 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7472 (Versions::symbol_section_contents): If a symbol is undefined, or
7473 defined in a dynamic object, set the version index to
7475 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7477 (Symbol_table::add_from_pluginobj): Likewise.
7478 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7480 2010-01-11 Doug Kwan <dougkwan@google.com>
7482 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7483 (incremental_dump_LDADD): Add linking option for libintl.
7484 * Makefile.in: Regenerate.
7486 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7489 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7491 * testsuite/Makefile.in: Regenerated.
7493 2010-01-10 Doug Kwan <dougkwan@google.com>
7495 * options.h (DEFINE_var): Use parentheses around argument varname__
7496 in macro body to avoid any unintended subsequent substitutions.
7498 2010-01-10 Ian Lance Taylor <iant@google.com>
7500 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7501 candidates before doing symbol resolution.
7503 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7504 ODR candidates if only one is weak.
7506 2010-01-08 Ian Lance Taylor <iant@google.com>
7508 * script.cc (Version_script_info::build_expression_list_lookup):
7509 Don't warn about ambiguous version, just record the ambiguity.
7510 (Version_script_info::get_symbol_version_helper): Give error if
7511 version is ambiguous.
7513 2010-01-08 Doug Kwan <dougkwan@google.com>
7515 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7516 prev_data_size_ and prev_addralign_. Remove initializer for
7517 deleted data member has_been_changed_.
7518 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7519 to determine if the table is empty.
7520 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7522 (Stub_table::add_reloc_stub): Define method in class definition
7523 instead of just declaring it there.
7524 (Stub_table::add_cortex_a8_stub): New method definition.
7525 (Stub_table::update_data_size_and_addralign): Ditto.
7526 (Stub_table::finalize_stubs): Ditto.
7527 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7528 (Stub_table::do_addralign_): Return address alignment in the
7529 (Stub_table::do_reset_address_and_file_offset): Define method in
7530 class definition instead of declaring it there. Set current data
7531 size to be the data size of the previous pass.
7532 (Stub_table::set_final_data_size): Use current data size as the
7534 (Stub_table::relocate_stub): Change parameter type of stub from
7535 Reloc_stub pointer to Stub pointer.
7536 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7537 (Stub_table::Cortex_a8_stub_list): New typedef.
7538 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7539 Stub_table::prev_addralign_): New data member.
7540 (Arm_relobj::Arm_relobj): Initialize data member
7541 section_has_cortex_a8_workaround_.
7542 (Arm_relobj::section_has_cortex_a8_workaround,
7543 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7545 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7547 (Target_arm::relocate_stub): Change parameter type of stub from
7548 Reloc_stub pointer to Stub pointer.
7549 (Insn_template::size, Insn_template::alignment): Handle
7550 THUMB16_SPECIAL_TYPE.
7551 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7552 Stub_table::update_data_size_and_addralign,
7553 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7555 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7556 (Stub_table::do_write): Ditto.
7557 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7559 2010-01-08 Ian Lance Taylor <iant@google.com>
7562 * symtab.h (class Symbol): Remove fields is_target_special_ and
7563 has_plt_offset_. Add field is_defined_in_discarded_section_.
7564 (Symbol::is_defined_in_discarded_section): New function.
7565 (Symbol::set_is_defined_in_discarded_section): New function.
7566 (Symbol::has_plt_offset): Rewrite.
7567 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7568 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7569 Don't initialize is_target_special_ or has_plt_offset_.
7570 Initialize is_defined_in_discarded_section_.
7571 (Symbol_table::add_from_relobj): If appropriate, set
7572 is_defined_in_discarded_section.
7573 * resolve.cc (Symbol::override_base_with_special): Don't test
7574 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7575 * target-reloc.h (relocate_section): Do special handling for
7576 symbols defined in discarded sections for global symbols as well
7579 2010-01-08 Ian Lance Taylor <iant@google.com>
7581 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7582 the SHT_SYMTAB case.
7584 2010-01-08 Ian Lance Taylor <iant@google.com>
7586 * object.cc (Sized_relobj::do_layout): Don't get confused if
7587 layout_eh_frame returns NULL.
7589 2010-01-08 Ian Lance Taylor <iant@google.com>
7592 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7593 dynamic symbol table, use the normal symbol table.
7594 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7597 2010-01-08 Ian Lance Taylor <iant@google.com>
7600 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7603 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7605 * version.cc (print_version): Change to "Copyright 2010".
7607 2010-01-08 Ian Lance Taylor <iant@google.com>
7611 * i386.cc (class Target_i386): Change return type of plt_section
7613 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7614 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7615 tls_desc_rel_ field.
7616 (Output_data_plt_i386::rel_tls_desc): New function.
7617 (Target_i386::rel_tls_desc_section): New function.
7618 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7619 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7620 R_386_TLS_DESC reloc in rel_tls_desc_section.
7621 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7622 Define struct Tlsdesc_info.
7623 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7624 (Target_x86_64::do_reloc_symbol_index): New function.
7625 (Target_x86_64::add_tlsdesc_info): New function.
7626 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7627 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7629 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7631 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7632 (Target_x86_64::rela_tlsdesc_section): New function.
7633 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7635 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7636 (Target_x86_64::do_reloc_addend): New function.
7637 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7638 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7639 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7640 (Output_reloc::type): New function.
7641 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7642 (Output_reloc::is_target_specific): New function.
7643 (Output_reloc::target_arg): New function.
7644 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7645 absolute relocs and target specific relocs.
7646 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7647 add_target_specific.
7648 (class Output_data_reloc) [SHT_RELA]: Likewise.
7649 * output.cc (Output_reloc::Output_reloc): Add four new versions
7650 for absolute relocs and target specific relocs.
7651 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7652 (Output_reloc::get_symbol_index): Likewise.
7653 (Output_reloc::local_section_offset): Check that local_sym_index_
7654 is not TARGET_CODE or 0.
7655 (Output_reloc::symbol_value): Likewise.
7656 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7658 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7659 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7661 * layout.cc (add_target_dynamic_tags): Use output section for
7662 DT_PLTRELSZ and DT_JMPREL.
7664 2010-01-07 Ian Lance Taylor <iant@google.com>
7667 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7669 (class Output_data_reloc_generic): Define.
7670 (class Output_data_reloc_base): Change base class to
7671 Output_data_reloc_generic. Change add() method to call
7672 bump_relative_reloc_count for a relative reloc. Remove
7674 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7676 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7677 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7679 * layout.h (class Layout): Update declaration.
7681 2010-01-07 Ian Lance Taylor <iant@google.com>
7683 * output.h (class Output_data): Add const version of
7684 output_section and do_output_section.
7685 (class Output_section_data): Add const version of
7687 (class Output_section): Likewise.
7688 * layout.cc (Layout::add_target_dynamic_tags): New function.
7689 * layout.h (class Layout): Update declarations.
7690 * arm.cc (Target_arm::do_finalize_sections): Use
7691 add_target_dynamic_tags.
7692 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7693 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7694 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7695 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7697 2010-01-07 Ian Lance Taylor <iant@google.com>
7700 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7703 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7704 Ian Lance Taylor <iant@google.com>
7707 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7708 Xindex::read_symtab_xindex.
7710 2010-01-07 Doug Kwan <dougkwan@google.com>
7712 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7713 (Insn_template::thumb16_bcond_insn): New method declaration.
7714 (Insn_template): Fix spelling.
7715 (Stub::thumb16_special): New method declaration.
7716 (Stub::do_write): Define virtual method which was previously pure
7718 (Stub::do_thumb16_special): New method declaration.
7719 (Stub::do_fixed_endian_write): New template member.
7720 (Reloc_stub::do_write): Remove.
7721 (Reloc_stub::do_fixed_endian_write): Remove.
7722 (Cortex_a8_stub): New class definition.
7723 (Stub_factory::make_cortex_a8_stub): New method definition.
7724 (Stub_factory::Stub_factory): Add missing static storage class
7725 qualifier for elf32_arm_stub_a8_veneer_blx.
7727 2010-01-07 Ian Lance Taylor <iant@google.com>
7730 * options.h (class General_options): Add --warn-unresolved-symbols
7731 and --error-unresolved-symbols.
7732 * errors.cc (Errors::undefined_symbol): Implement
7733 --warn-unresolved-symbols.
7735 * options.h (class General_options): Add -z text and -z textoff.
7736 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7738 2010-01-06 Sriraman Tallam <tmsriram@google.com>
7740 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7741 (Garbage_collection::cident_sections): New function.
7742 (Garbage_collection::add_cident_section): New function.
7743 (Garbage_collection::cident_sections_): New member.
7744 (gc_process_relocs): Add references to sections whose names are C
7746 * gold.h (cident_section_start_prefix): New constant.
7747 (cident_section_stop_prefix): New constant.
7748 (is_cident): New function.
7749 * layout.cc (Layout::define_section_symbols): Replace string constants
7750 with the newly defined constants.
7751 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7753 * testsuite/Makefile.am: Add gc_orphan_section_test.
7754 * testsuite/Makefile.in: Regenerate.
7755 * testsuite/gc_orphan_section_test.cc: New file.
7756 * testsuite/gc_orphan_section_test.sh: New file.
7758 2010-01-06 Ian Lance Taylor <iant@google.com>
7761 * options.h (class General_options): Add --warn-shared-textrel.
7762 * layout.cc (Layout::finish_dynamic_section): Implement
7763 --warn-shared-textrel.
7766 * options.h (class General_options): Add --warn-multiple-gp.
7768 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7770 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7771 $(THREADSLIB) and $(LIBDL).
7772 * Makefile.in: Rebuild.
7774 2010-01-06 Ian Lance Taylor <iant@google.com>
7777 * options.cc (General_options::parse_section_start): New function.
7778 (General_options::section_start): New function.
7779 (General_options::General_options): Initialize all members.
7780 * options.h: Include <map>
7781 (class General_options): Add --section-start. Add section_starts_
7783 * layout.cc (Layout::attach_allocated_section_to_segment): If
7784 --section-start was used, set the address of the segment. Remove
7785 local sort_sections.
7786 (Layout::relaxation_loop_body): If the address of the load segment
7787 has been set by --section-start, don't use it.
7788 * output.h (Output_segment::update_flags_for_output_section): New
7790 * output.cc (Output_segment::add_output_section): Call
7791 update_flags_for_output_section.
7793 2010-01-05 Ian Lance Taylor <iant@google.com>
7796 * options.h (class General_options): Add --undefined-version.
7797 * script.cc (struct Version_expression): Add was_matched_by_symbol
7799 (Version_script_info::matched_symbol): New function.
7800 (Version_script_info::get_symbol_version_helper): Call
7802 (Version_script_info::check_unmatched_names): New function.
7803 * script.h (class Version_script_info): Update declarations.
7804 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7806 * options.h (class General_options): Use DEFINE_bool_alias for
7807 allow_multiple_definition.
7808 * resolve.cc (Symbol_table::should_override): Don't test
7809 allow_multiple_definition.
7812 * options.h (class General_options): Add --cref.
7813 * main.cc (main): Print cref table if --cref. Don't close mapfile
7814 until after printing cref table.
7815 * cref.cc: Include "symtab.h".
7816 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7817 (Cref_table_compare::operator()): New function.
7818 (Cref_inputs::gather_cref): New function.
7819 (filecol): New static const.
7820 (Cref_inputs::print_cref): New function.
7821 (Cref::print_cref): New function.
7822 * cref.h: Include <cstdio>.
7823 (class Cref): Update declarations.
7824 * mapfile.h (Mapfile::file): New function.
7825 * object.h (class Object): Define Symbols. Declare virtual
7826 do_get_global_symbols.
7827 (Object::get_global_symbols): New function.
7828 * object.cc (Input_objects::add_object): Pass object to cref_ if
7830 (Input_objects::archive_start): Likewise.
7831 (Input_objects::archive_stop): Likewise.
7832 (Input_objects::print_cref): New function.
7833 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7834 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7836 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7838 * plugin.h (class Sized_pluginobj): Update declarations.
7840 2010-01-05 Ian Lance Taylor <iant@google.com>
7842 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7843 to is_default_version. Rename insdef to insdefault.
7844 (Symbol_table::add_from_relobj): Rename def to is_default_version
7845 and local to is_forced_local.
7846 (Symbol_table::add_from_pluginobj): Likewise.
7847 (Symbol_table::add_from_dynobj): Likewise.
7848 (Symbol_table::define_special_symbol): Rename insdef to
7851 2010-01-04 Ian Lance Taylor <iant@google.com>
7854 * options.h (class General_options): Add
7855 --allow-multiple-definition and -z muldefs.
7856 * resolve.cc (Symbol_table::should_override): Don't warn about a
7857 multiple symbol definition if --allow-multiple-definition or -z
7861 * options.h (class General_options): Add --add-needed and
7862 --copy-dt-needed-entries. Tweak --as-needed help entry.
7863 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7864 error if --copy-dt-needed-entries aka --add-needed is used and
7865 would cause a change in behaviour.
7868 * options.h (class General_options): Add -G as a short version of
7869 --shared. Add no-op options -assert, -g, and -i.
7871 2010-01-04 Sriraman Tallam <tmsriram@google.com>
7873 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7874 check for .text or .gnu.linkonce.t sections.
7875 * icf.cc (Icf::find_identical_sections): Ditto.
7876 Change the detection for mangled function name within the section
7878 * icf.h (is_section_foldable_candidate): New function.
7880 2009-12-30 Ian Lance Taylor <iant@google.com>
7883 * options.h (class General_options): Permit two dashes with
7884 --retain-symbols-file.
7886 2009-12-30 Ian Lance Taylor <iant@google.com>
7889 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7890 don't put the file header and segment headers in the text
7894 * common.cc (Sort_commons::operator()): Stabilize sort when both
7896 (Symbol_table::do_allocate_commons_list): When allocating common
7897 symbols, skip a symbol which is no longer common.
7898 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7899 an object before checking its type.
7900 * testsuite/common_test_2.c: New file.
7901 * testsuite/common_test_3.c: New file.
7902 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7903 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7904 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7905 (common_test_2_pic.o, common_test_2.so): New targets.
7906 (common_test_3_pic.o, common_test_3.so): New targets.
7907 * testsuite/Makefile.in: Rebuild.
7910 * script.cc (read_input_script): If we see a new SECTIONS clause,
7911 and we have added an input section, give an error.
7912 * layout.h (class Layout): Add have_added_input_section function.
7913 Add have_added_input_section_ field.
7914 * layout.cc (Layout::Layout): Initialize
7915 have_added_input_section_.
7916 (Layout::layout): Set have_added_input_section_.
7917 (Layout::layout_eh_frame): Likewise.
7919 2009-12-30 Ian Lance Taylor <iant@google.com>
7922 * options.h (class General_options): Add --sort-common option.
7923 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7924 * common.cc (Sort_common): Add sort_order parameter to
7925 constructor. Add sort_order_ field.
7926 (Sort_commons::operator): Check sort_order_.
7927 (Symbol_table::allocate_commons): Determine the sort order.
7928 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7930 (Symbol_table::do_allocate_commons_list): Likewise.
7932 2009-12-30 Ian Lance Taylor <iant@google.com>
7935 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7936 symbols from this object, don't change the visibility of an
7938 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7940 2009-12-30 Ian Lance Taylor <iant@google.com>
7943 * script.h (class Version_script_info): Define Language enum.
7944 Update declarations. Define Glob, Exact, and Lookup types. Add
7945 new fields globals_, locals_, and is_finalized_.
7946 * script.cc: Various formatting fixes.
7947 (class Parser_closure): Change language_stack_ from a vector of
7948 std::string to one of Version_script_info::Language. Adjust all
7950 (class Lazy_demangler): Remove.
7951 (struct Version_expression): Change language from std::string to
7952 Version_script_info::Language.
7953 (Version_script_info::Version_script_info): New function.
7954 (Version_script_info::~Version_script_info): Don't call clear.
7955 (Version_script_info::finalize): New function.
7956 (Version_script_info::build_lookup_tables): New function.
7957 (Version_script_info::build_expression_list_lookup): New
7959 (Version_script_info::get_symbol_version_helper): Rewrite to use
7961 (Version_script_info::print_expression_list): Adjust to use
7962 Version_script_info::Language.
7963 (script_push_lex_into_version_mode): Check that the version script
7964 has not been finalized.
7965 (version_script_push_lang): Change language string to
7966 Version_script_info::Language.
7967 * options.cc (Command_line::version_script): New function.
7968 * options.h (class General_options): Add finalize_dynamic_list
7969 function. Change version_script from declaration to definition.
7970 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7971 * testsuite/version_script.map: Remove duplicate def of foo.
7972 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7974 * testsuite/Makefile.in: Rebuild.
7976 2009-12-30 Ian Lance Taylor <iant@google.com>
7979 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7980 if the input symbol index is 0, make the output symbol index 0.
7982 2009-12-30 Ian Lance Taylor <iant@google.com>
7985 * options.h (class General_options): Add -x/--discard-all.
7986 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7987 --discard-all. If the local symbol needs a dynamic entry, check
7988 that before handling --discard-locals.
7990 2009-12-30 Ian Lance Taylor <iant@google.com>
7993 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7995 (Output_segment::add_output_section): Don't change the flags if
7999 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8000 GNU hash table if they need a dynamic value. Otherwise, don't add
8001 them if they are defined in a dynamic object or are forced local.
8003 2009-12-29 Ian Lance Taylor <iant@google.com>
8006 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8007 .gnu.hash table for a 32-bit target.
8010 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8011 regular and a dynamic object only needs a dynamic symbol table
8012 entry if it is externally visible.
8015 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8016 constructor. Add global_offset_table_ field.
8017 (Target_i386::got_section): Set global_offset_table_.
8018 (Target_i386::do_finalize_sections): Set global_offset_table_
8020 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8021 in constructor. Add global_offset_table_ field.
8022 (Target_x86_64::got_section): Set global_offset_table_.
8023 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8026 * layout.cc (Layout::Layout): Initialize increase_relro_.
8027 (Layout::get_output_section): Add is_relro, is_last_relro, and
8028 is_first_non_relro parameters. Change all callers.
8029 (Layout::choose_output_section): Likewise.
8030 (Layout::add_output_section_data): Likewise.
8031 (Layout::make_output_section): Likewise.
8032 (Layout::set_segment_offsets): Clear increase_relro when using a
8034 * layout.h (class Layout): Add increase_relro method. Add
8035 increase_relro_ field. Update declarations.
8036 * output.cc (Output_section::Output_section): Initialize
8037 is_last_relro_ and is_first_non_relro_.
8038 (Output_segment::add_output_section): Group relro sections is
8039 do_sort is true. Handle is_last_relro and is_first_non_relro.
8040 (Output_segment::maximum_alignment): Remove relro handling.
8041 (Output_segment::set_section_addresses): Add increase_relro
8042 parameter. Change all callers. Add initial alignment to align
8043 relro sections on separate page. Remove old relro handling.
8044 (Output_segment::set_section_list_addresses): Remove in_relro
8045 parameter. Change all callers.
8046 (Output_segment::set_offset): Add increase parameter. Change all
8047 callers. Remove old relro handling.
8048 * output.h (class Output_section): Add new methods: is_last_relro,
8049 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8050 Add is_last_relro_ and is_first_non_relro_ fields.
8051 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8052 Create separate .got.plt section. Call increase_relro.
8053 * x86_64.cc (Target_x86_64::got_section): Likewise.
8054 * testsuite/relro_script_test.t: Add .got.plt.
8057 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8058 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8059 (Layout::finalize): Call set_dynamic_symbol_size.
8060 (Layout::set_dynamic_symbol_size): New function.
8061 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8062 set_dynamic_symbol_size.
8065 * output.h (class Output_section): Add is_entsize_zero_ field.
8066 * output.cc (Output_section::Output_section): Initialize
8068 (Output_section::set_entsize): If two different entsizes are
8069 requested, force it to zero.
8070 (Output_section::add_input_section): Set flags for .debug_str
8071 before updating section flags. Set entsize.
8072 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8073 and SHF_STRING if all input sections have those flags.
8075 2009-12-29 Rafael Espindola <espindola@google.com>
8077 * main.cc (main): Fix the sys time reporting.
8078 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8081 2009-12-29 Sriraman Tallam <tmsriram@google.com>
8083 * options.cc (General_options::parse_version): Allow -v to exit
8084 without an error if there is nothing to link.
8086 2009-12-29 Ian Lance Taylor <iant@google.com>
8088 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8089 using a version of gcc before 4.1.
8090 * configure: Rebuild.
8092 2009-12-28 Chris Demetriou <cgd@google.com>
8094 * attributes.cc (Output_attributes_section_data::do_write): Use
8095 std::vector::front rather than std::vector::data.
8097 2009-12-28 Ian Lance Taylor <iant@google.com>
8099 * symtab.h (class Symbol_table): Add enum Defined.
8100 * resolve.cc (Symbol_table::should_override): Add defined
8101 parameter. Change all callers. Test whether object is NULL
8102 before calling a method on it.
8103 (Symbol_table::report_resolve_problem): Add defined parameter.
8105 (Symbol_table::should_override_with_special): Likewise.
8106 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8107 parameter. Change all callers.
8108 (Symbol_table::do_define_in_output_data): Likewise.
8109 (Symbol_table::define_in_output_segment): Likewise.
8110 (Symbol_table::do_define_in_output_segment): Likewise.
8111 (Symbol_table::define_as_constant): Likewise.
8112 (Symbol_table::do_define_as_constant): Likewise.
8113 * script.h (class Symbol_assignment): Add is_defsym parameter to
8114 constructor; change all callers.
8115 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8116 parameter. Change all callers. Add is_defsym_ field.
8117 (class Parser_closure): Add parsing_defsym parameter to
8118 constructor; change all callers. Add parsing_defsym accessor
8119 function. Add parsing_defsym_ field.
8121 2009-12-28 Ian Lance Taylor <iant@google.com>
8123 * gold.cc (queue_middle_tasks): Fix formatting.
8124 * object.cc (Relobj::is_section_name_included): Likewise.
8126 2009-12-23 Ian Lance Taylor <iant@google.com>
8128 * i386.cc (Target_i386::do_calls_non_split): Recognize
8129 -fsplit-stack prologue for a function with a static chain.
8130 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8131 -fsplit-stack prologue when using %r11.
8133 2009-12-21 Sriraman Tallam <tmsriram@google.com>
8135 * options.cc (General_options::parse_version): Make -v continue and do
8136 the link like GNU ld does.
8138 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
8140 * Makefile.am (CCFILES): Add timer.cc.
8141 (HFILES): Add timer.h.
8142 * configure.ac: Check for sysconf and times.
8143 * main.cc: include timer.h.
8144 (main): Use Timer instead of get_run_time.
8147 * workqueue.cc: include timer.h.
8148 (Workqueue::find_and_run_task):
8149 Report user, sys and wall time.
8150 * Makefile.in: Regenerate.
8151 * config.in: Regenerate.
8152 * configure: Regenerate.
8154 2009-12-16 Doug Kwan <dougkwan@google.com>
8156 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8158 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8159 relaxed input sections.
8160 * output.cc (Output_section::find_relaxed_input_section): Change
8161 return type to Output_relaxed_input_section pointer. Adjust code
8162 for new type of relaxed_input_section_map_.
8163 * output.h (Output_section::find_relaxed_input_section): Change
8164 return type to Output_relaxed_input_section pointer.
8165 (Output_section::Output_relaxed_input_section_by_input_section_map):
8167 (Output_section::relaxed_input_section_map_): Change type to
8168 Output_section::Output_relaxed_input_section_by_input_section_map.
8169 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8172 2009-12-15 Ian Lance Taylor <iant@google.com>
8174 * layout.cc (Layout::create_shstrtab): Only write out after input
8175 sections if we are compressing debug sections.
8177 2009-12-15 Ian Lance Taylor <iant@google.com>
8179 * archive.cc (Archive::add_symbols): Only look up a symbol without
8180 a version if there is, in fact, a version.
8182 2009-12-14 Ian Lance Taylor <iant@google.com>
8184 Revert -Wshadow changes, all changes from:
8185 2009-12-11 Doug Kwan <dougkwan@google.com>
8186 2009-12-11 Nick Clifton <nickc@redhat.com>
8187 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8189 2009-12-11 Doug Kwan <dougkwan@google.com>
8191 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8193 * attributes.cc (Object_attribute::size): Ditto.
8194 (Attributes_section_data::size): Ditto.
8195 (Attributes_section_data::Attributes_section_data): Ditto.
8196 (Output_attributes_section_data::do_write): Ditto.
8197 * attributes.h (Object_attribute::set_type): Ditto.
8198 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8200 2009-12-11 Nick Clifton <nickc@redhat.com>
8202 * archive.cc: Fix shadowed variable warnings.
8204 * compressed_output.cc: Likewise.
8205 * compressed_output.h: Likewise.
8206 * configure: Likewise.
8207 * dwarf_reader.cc: Likewise.
8208 * dynobj.cc: Likewise.
8209 * dynobj.h: Likewise.
8210 * ehframe.cc: Likewise.
8211 * ehframe.h: Likewise.
8212 * errors.cc: Likewise.
8213 * expression.cc: Likewise.
8214 * fileread.cc: Likewise.
8215 * fileread.h: Likewise.
8216 * freebsd.h: Likewise.
8217 * i386.cc: Likewise.
8219 * incremental.h: Likewise.
8220 * layout.cc: Likewise.
8221 * layout.h: Likewise.
8222 * mapfile.cc: Likewise.
8223 * merge.cc: Likewise.
8224 * merge.h: Likewise.
8225 * object.cc: Likewise.
8226 * object.h: Likewise.
8227 * options.h: Likewise.
8228 * output.cc: Likewise.
8229 * output.h: Likewise.
8230 * parameters.cc: Likewise.
8231 * plugin.cc: Likewise.
8232 * powerpc.cc: Likewise.
8233 * reduced_debug_output.cc: Likewise.
8234 * reduced_debug_output.h: Likewise.
8235 * reloc.cc: Likewise.
8236 * reloc.h: Likewise.
8237 * resolve.cc: Likewise.
8238 * script-sections.cc: Likewise.
8239 * script.cc: Likewise.
8240 * script.h: Likewise.
8241 * sparc.cc: Likewise.
8242 * symtab.cc: Likewise.
8243 * symtab.h: Likewise.
8244 * target-select.cc: Likewise.
8245 * target-select.h: Likewise.
8246 * token.h: Likewise.
8247 * workqueue.cc: Likewise.
8248 * workqueue.h: Likewise.
8249 * x86_64.cc: Likewise.
8251 2009-12-10 Doug Kwan <dougkwan@google.com>
8253 * arm.cc (attributes.h): New include.
8254 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8255 (Arm_relobj::~Arm_relobj): Delete object pointed by
8256 attributes_section_data_.
8257 (Arm_relobj::attributes_section_data): New method definition.
8258 (Arm_relobj::attributes_section_data_): New data member declaration.
8259 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8260 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8261 attributes_section_data_.
8262 (Arm_dynobj::attributes_section_data): New method definition.
8263 (Arm_dynobj::attributes_section_data_): New data member declaration.
8264 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8265 initialization value of may_use_blx_ to false.
8266 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
8267 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8268 object attributes to compute results instead of hard-coding.
8269 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8270 Target_arm::get_secondary_compatible_arch,
8271 Target_arm::set_secondary_compatible_arch
8272 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8273 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8274 New method declarations.
8275 (Target_arm::get_aeabi_object_attribute): New method definition.
8276 (Target_arm::attributes_section_data_): New data member declaration.
8277 (read_arm_attributes_section): New template definition.
8278 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8279 (Arm_dynobj::do_read_symbols): Ditto.
8280 (Target_arm::do_finalize_sections): Merge attributes sections from
8281 input. Check for BLX use after attributes section merging.
8282 Fix __exidx_start and __exidx_end visibility. Create an
8283 .ARM.attributes section if necessary.
8284 (Target_arm::get_secondary_compatible_arch,
8285 Target_arm::set_secondary_compatible_arch,
8286 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8287 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
8288 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
8289 New method definitions.
8291 2009-12-09 Ian Lance Taylor <iant@google.com>
8293 * plugin.cc (Plugin::load): Don't cast from void* to a function
8296 2009-12-09 Ian Lance Taylor <iant@google.com>
8298 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8301 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8303 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8304 Replace two_file_shared_1.so with two_file_shared_2.so.
8305 * testsuite/Makefile.in: Regenerated.
8307 2009-12-08 Doug Kwan <dougkwan@google.com>
8309 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8310 (HFILES): Add attributes.h and int_encoding.h.
8311 * Makefile.in: Regenerate.
8312 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8313 function definitions to int_encoding.cc
8314 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8315 prototypes to int_encoding.h
8316 * reduced_debug_output.cc (int_encoding.h): New include.
8317 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8318 function definitions to int_encoding.cc
8319 (insert_into_vector, read_from_pointer): Move template definitions to
8321 * attributes.cc: New file.
8322 * attributes.h: New file.
8323 * int_encoding.cc: New file.
8324 * int_encoding.h: New file.
8326 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
8329 * incremental-dump.cc (dump_incremental_inputs): New.
8330 (main): Use dump_incremental_inputs.
8332 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8335 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8336 checking elfcpp::STT_FUNC.
8337 (Target_i386::Relocate::relocate): Likewise.
8338 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8340 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8341 symbols from shared libraries into normal FUNC symbols.
8343 * symtab.h (Symbol): Add is_func and use it.
8345 2009-12-05 Doug Kwan <dougkwan@google.com>
8347 * arm.cc (Target_arm::arm_info): Initialize new fields
8348 attributes_section and attributes_vendor.
8349 * i386.cc (Target_i386::i386_info): Same.
8350 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8351 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8352 fields attributes_section and attributes_vendor.
8353 * sparc.cc (Target_sparc::sparc_info): Same.
8354 * target.h (Target::attributes_section, Target::attributes_vendor,
8355 Target::is_attributes_section, Target::attribute_arg_type,
8356 Target::attributes_order): New method definitions.
8357 (Target::Target_info::attributes_section,
8358 Target::Target_info::attributes_vendor): New fields.
8359 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8360 virtual method definitions.
8361 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8362 attributes_section and attributes_vendor.
8363 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8365 2009-12-05 Doug Kwan <dougkwan@google.com>
8367 * arm.cc: Update comments about interworking and stub generation.
8368 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8369 considered as non-PIC.
8370 (Arm_relocate_functions::base_abs): Fix formatting.
8371 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8372 of function to use GOT entry address instead of offset.
8373 (Target_arm::Scan::global): Issue an error if a symbol would need a
8374 PLT does not get one because it is untyped. Remove code to create
8375 dynamic symbols for relative branches.
8376 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8377 takes unsigned integer instead of boolean.
8379 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8381 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8382 (two_file_test_LDADD): Likewise.
8383 (common_test_1_LDADD): Likewise.
8384 (exception_test_LDADD) Likewise.
8385 (weak_test_LDADD): Likewise.
8386 (many_sections_test_LDADD): Likewise.
8387 (initpri1_LDADD): Likewise.
8388 (script_test_1_LDADD): Likewise.
8389 (script_test_2_LDADD): Likewise.
8390 (justsyms_LDADD): Likewise.
8391 (binary_test_LDADD): Likewise.
8392 (large_LDADD): Likewise.
8393 * testsuite/Makefile.in: Regenerated.
8395 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
8397 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8398 (Symbol_table::override_with_special): Likewise.
8399 (Symbol_table::add_from_object): Likewise.
8401 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8403 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8404 Don't set the data_offset twice.
8406 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
8408 * testsuite/Makefile.in: Regenerate.
8410 2009-12-03 Doug Kwan <dougkwan@google.com>
8412 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8413 (Target_arm::do_finalize_sections): Add parameter for symbol table
8414 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8415 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8416 parameter for symbol table pointer.
8417 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8418 an additional parameter for a pointer to symbol table.
8419 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8420 parameter for a symbol table pointer.
8421 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8422 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8424 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8425 parameter for a symbol table pointer.
8427 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
8429 * incremental.cc (Incremental_inputs_header)
8430 (Incremental_inputs_header_write, Incremental_inputs_entry)
8431 (Incremental_inputs_entry_write): Move ...
8432 * incremental.h (Incremental_inputs_header)
8433 (Incremental_inputs_header_write, Incremental_inputs_entry)
8434 (Incremental_inputs_entry_write): here.
8436 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8438 * incremental.cc (make_sized_incremental_binary): Set the target.
8439 Error if it is incompatible.
8440 * output.h (Output_file): Add filename method.
8442 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8444 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8445 from the get_* methods.
8447 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8449 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8450 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8451 Write 0 for the data_offset of scripts.
8453 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
8455 * testsuite/Makefile.am: Add the incremental_test.sh test.
8456 * testsuite/incremental_test.sh: New.
8457 * testsuite/incremental_test_1.c: New.
8458 * testsuite/incremental_test_2.c: New.
8460 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
8462 * incremental-dump.cc (main): Fix typos.
8464 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
8467 * incremental-dump.cc (main): Use llu to print 64 bit values.
8469 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8470 H.J. Lu <hongjiu.lu@intel.com>
8472 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8474 (incremental_dump_LDADD): Likewise.
8475 * Makefile.in: Regenerated.
8477 2009-11-25 Doug Kwan <dougkwan@google.com>
8481 2009-11-25 Doug Kwan <dougkwan@google.com>
8483 * arm.cc (Target_arm::Target_arm): Move method definition
8484 outside of class definition. Add code to handle
8485 --target1-rel, --target1-abs and --target2= options.
8486 (Target_arm::get_reloc_reloc_type): Change method to be
8487 non-static and const.
8488 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8489 New data member declaration.
8490 (Target_arm::Scan::local, Target_arm::Scan::global,
8491 Target_arm::Relocate::relocate,
8492 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8493 Adjust call to Target_arm::get_real_reloc_type.
8494 (Target_arm::get_real_reloc_type): Use command line options
8495 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8496 * options.h (--target1-rel, --target1-abs, --target2): New
8499 2009-11-25 Doug Kwan <dougkwan@google.com>
8501 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8502 class definition. Add code to handle --target1-rel, --target1-abs
8503 and --target2= options.
8504 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8506 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8508 (Target_arm::Scan::local, Target_arm::Scan::global,
8509 Target_arm::Relocate::relocate,
8510 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8511 call to Target_arm::get_real_reloc_type.
8512 (Target_arm::get_real_reloc_type): Use command line options to
8513 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8514 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8517 2009-11-25 Doug Kwan <dougkwan@google.com>
8519 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8520 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8521 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8523 (Arm_relocate_functions::thm_call): Replace body with a call to
8524 Arm_relocate_functions::thumb_branch_common.
8525 (Arm_relocate_functions::thm_jump24,
8526 Arm_relocate_functions::thm_xpc22): New method definitions.
8527 (Arm_relocate_functions::thumb_branch_common): New method definition.
8528 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8530 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8531 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8533 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8535 * Makefile.am: Build incremental-dump
8536 * Makefile.in: Regenerate.
8537 * incremental-dump.cc: New.
8538 * incremental.cc (Incremental_inputs_header_data,
8539 Incremental_inputs_entry_data): Move to incremental.h
8540 * incremental.h: (Incremental_inputs_header_data,
8541 Incremental_inputs_entry_data): Move from incremental.cc
8543 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8545 * incremental.cc (Incremental_inputs_header,
8546 Incremental_inputs_header_write, Incremental_inputs_entry,
8547 Incremental_inputs_entry_write): Add a typedef with the data type.
8549 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
8551 * incremental.cc (Incremental_inputs_header,
8552 Incremental_inputs_header_write, Incremental_inputs_entry,
8553 Incremental_inputs_entry_write): Update comment about which
8554 type has the filed descriptions.
8556 2009-11-15 Doug Kwan <dougkwan@google.com>
8558 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8559 (Arm_relocate_functions::arm_branch_common): Change method defintion
8560 in class definition to a method declaration and update list of formal
8562 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8563 Arm_relocation_functions::jump24): Adjust call to
8564 Arm_relocate_functions::arm_branch_common. Update list of formal
8566 (Arm_relocate_functions::xpc25): New method definition.
8567 (Arm_relocate_functions::arm_branch_common): Move method defintion
8568 out from class definition. Use stubs for mode-switching and extending
8570 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8571 specially. Change code to enable use of stubs in ARM branches.
8573 2009-11-10 Doug Kwan <dougkwan@google.com>
8575 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8576 in method declaration.
8577 (Target_arm::relocate_stub): New method declaration.
8578 (Target_arm::default_target): Change to return a pointer instead of
8580 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8581 Target_arm::default_target.
8582 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8584 (Target_arm::relocate_section): Adjust view.
8585 (Target_arm::relocate_stub): New method definition.
8587 2009-11-10 Doug Kwan <dougkwan@google.com>
8589 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8591 * incremental.cc (open_incremental_binary): Initialized local
8592 variables to avoid warnings.
8593 * object.cc (make_elf_object): Ditto.
8594 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8597 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8600 * testsuite/plugin_test.c: Include "config.h".
8602 2009-11-09 Doug Kwan <dougkwan@google.com>
8604 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8605 (arm_symbol_value): Remove.
8606 (Arm_relocate_functions::arm_branch_common,
8607 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8608 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8609 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8610 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8611 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8612 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8613 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8614 Arm_relocate_functions::thm_mobw_abs_nc,
8615 Arm_relocate_functions::thm_mov_abs,
8616 Arm_relocate_functions::movw_prel_nc,
8617 Arm_relocate_functions::thm_movt_abs,
8618 Arm_relocate_functions::movt_prel,
8619 Arm_relocate_functions::thm_movw_prel_nc,
8620 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8621 (Target_arm::Relocate::relocate): Only decompose address into two
8622 parts if relocation type uses the thumb-bit and pass the actual
8623 bit instead of a flag indicating that the thumb-bit is used. Adjust
8624 calls to methods in Arm_relocate_functions for this change.
8626 2009-11-08 Ian Lance Taylor <iant@google.com>
8629 * reloc.cc: Instantiate
8630 Sized_relobj::initialize_input_to_output_maps and
8631 Sized_relobj:free_input_to_output_maps.
8633 2009-11-06 Ian Lance Taylor <iant@google.com>
8636 * defstd.cc (in_segment): Set only_if_ref true for "end".
8638 2009-11-06 Doug Kwan <dougkwan@google.com>
8640 * arm.cc (class Reloc_stub): Correct a comment.
8641 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8642 (Target_arm::scan_section_for_stubs): New method declaration.
8643 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8644 Change methods from private to protected.
8645 (Target_arm::do_may_relax): New method definition.
8646 (Target_arm::do_relax, Target_arm::group_sections,
8647 Target_arm::scan_reloc_for_stub,
8648 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8649 (Target_arm::arm_input_section_map_): New data member declaration.
8650 (Target_arm::scan_reloc_for_stub,
8651 Target_arm::scan_reloc_section_for_stubs,
8652 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8653 Target_arm::do_relax): New method definitions.
8655 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8657 * configure.ac: Check for (struct stat)::st_mtim
8658 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8659 * config.in: Regenerate.
8660 * configure: Regenerate.
8662 2009-11-05 Ian Lance Taylor <iant@google.com>
8665 * output.cc (Output_segment::add_output_section): Add missing
8668 2009-11-04 Ian Lance Taylor <iant@google.com>
8671 * object.h (class Object): Add is_needed and set_is_needed
8672 methods. Add is_needed_ field. Make bool fields into bitfields.
8673 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8674 defined in a dynamic object and referenced by a regular object,
8675 set is_needed for the dynamic object.
8676 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8677 if the file is marked with as_needed and it is not needed.
8679 2009-11-04 Ian Lance Taylor <iant@google.com>
8682 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8683 tags if data is discarded by linker script.
8684 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8685 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8686 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8687 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8689 2009-11-04 Ian Lance Taylor <iant@google.com>
8691 * layout.cc (Layout::get_output_section): Add is_interp and
8692 is_dynamic_linker_section parameters. Change all callers.
8693 (Layout::choose_output_section): Likewise.
8694 (Layout::make_output_section): Likewise.
8695 (Layout::add_output_section_data): Add is_dynamic_linker_section
8696 parameter. Change all callers.
8697 * layout.h (class Layout): Update declarations.
8698 * output.h (class Output_section): Add is_interp, set_is_interp,
8699 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8700 Add is_interp_, is_dynamic_linker_section_ fields. Change
8701 generate_code_fills_at_write_ to a bitfield.
8702 * output.cc (Output_section::Output_sections): Initialize new
8704 (Output_segment::add_output_section): Add do_sort parameter.
8707 2009-11-03 Ian Lance Taylor <iant@google.com>
8710 * options.h (class General_options): Add --warn-common.
8711 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8712 merging two common symbols.
8713 (Symbol_table::should_override): Handle --warn-common when merging
8714 a common symbol with a defined symbol. Use report_resolve_problem
8715 for multiple definitions.
8716 (Symbol_table::report_resolve_problem): New function.
8717 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8719 2009-11-03 Doug Kwan <dougkwan@google.com>
8721 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8723 (Target_arm::stub_factory): New method definition.
8724 (Target_arm::new_arm_input_section,
8725 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8726 Target_arm::reloc_uses_thumb_bit): New method declarations.
8727 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
8728 New type definitions.
8729 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8730 member declarations.
8731 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8732 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8733 New method definitions.
8735 2009-11-03 Ian Lance Taylor <iant@google.com>
8737 * options.h (class General_options): Add --warn_constructors.
8739 2009-11-03 Ian Lance Taylor <iant@google.com>
8742 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8743 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8745 2009-11-03 Ian Lance Taylor <iant@google.com>
8748 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8749 --msgid-bugs-address.
8750 (install-pdf): New target.
8751 (install-data_yes): Look up one directory to find mkinstalldirs.
8753 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8755 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8758 2009-10-30 Doug Kwan <dougkwan@google.com>
8760 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8762 2009-10-30 Doug Kwan <dougkwan@google.com>
8764 * arm.cc (Stub_addend_reader): New struct template definition
8765 and partial specializations.
8766 (Stub_addend_reader::operator()): New method definition for a
8767 partially specialized template.
8769 2009-10-30 Doug Kwan <dougkwan@google.com>
8771 * arm.cc (Arm_relobj::processor_specific_flags): New method
8773 (Arm_relobj::do_read_symbols): New method declaration.
8774 (Arm_relobj::processor_specific_flags_): New data member declaration.
8775 (Arm_dynobj): New class definition.
8776 (Target_arm::do_finalize_sections): Add input_objects parameter.
8777 (Target_arm::do_adjust_elf_header): New method declaration.
8778 (Target_arm::are_eabi_versions_compatible,
8779 (Target_arm::merge_processor_specific_flags): New method declaration.
8780 (Target_arm::do_make_elf_object): New overloaded method definitions
8782 (Arm_relobj::do_read_symbols): New method definition.
8783 (Arm_dynobj::do_read_symbols): Ditto.
8784 (Target_arm::do_finalize_sections): Add input_objects parameters.
8785 Merge processor-specific flags from all input objects.
8786 (Target_arm::are_eabi_versions_compatible,
8787 Target_arm::merge_processor_specific_flags,
8788 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8789 New method definitions.
8790 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8791 Input_objects pointer type parameter.
8792 * layout.cc (Layout::finalize): Pass input objects to target's.
8793 finalize_sections function.
8794 * output.cc (Output_file_header::do_sized_write): Set ELF file
8795 header's processor-specific flags.
8796 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8797 Input_objects pointer type parameter.
8798 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8799 * target.h (Input_objects): New forward class declaration.
8800 (Target::processor_specific_flags,
8801 Target::are_processor_specific_flags_sect): New method definitions.
8802 (Target::finalize_sections): Add input_objects parameter.
8803 (Target::Target): Initialize processor_specific_flags_ and
8804 are_processor_specific_flags_set_.
8805 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8807 (Target::set_processor_specific_flags): New method definition.
8808 (Target::processor_specific_flags_,
8809 Target::are_processor_specific_flags_set_): New data member
8811 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8812 Input_objects pointer type parameter.
8814 2009-10-30 Doug Kwan <dougkwan@google.com>
8816 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8818 2009-10-28 Ian Lance Taylor <iant@google.com>
8820 * object.h (class Relobj): Drop options parameter from
8821 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8822 do_scan_relocs, do_relocate. Change all callers.
8823 (class Sized_relobj): Drop options parameters from
8824 do_gc_process_relocs, do_scan_relocs, do_relocate,
8825 do_relocate_sections, relocate_sections, emit_relocs_scan,
8826 emit_relocs_scan_reltype. Change all callers.
8827 (struct Relocate_info): Remove options field and all references to
8829 * reloc.h (class Read_relocs): Remove options constructor
8830 parameter and options_ field. Change all callers.
8831 (class Gc_process_relocs, class Scan_relocs): Likewise.
8832 (class Relocate_task): Likewise.
8833 * target-reloc.h (scan_relocs): Remove options parameter. Change
8835 (scan_relocatable_relocs): Likewise.
8836 * target.h (class Sized_target): Remove options parameter from
8837 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8839 * gc.h (gc_process_relocs): Remove options parameter. Change all
8841 * arm.cc: Update functions to remove options parameters.
8842 * i386.cc: Likewise.
8843 * powerpc.cc: Likewise.
8844 * sparc.cc: Likewise.
8845 * x86_64.cc: Likewise.
8846 * testsuite/testfile.cc: Likewise.
8848 2009-10-28 Doug Kwan <dougkwan@google.com>
8850 * arm.cc (Arm_relobj): New class definition.
8851 (Arm_relobj::scan_sections_for_stubs,
8852 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8853 New method definitions.
8855 2009-10-28 Cary Coutant <ccoutant@google.com>
8857 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8858 (Plugin::cleanup_done_): New member.
8859 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8860 (Plugin_manager::cleanup_done_): Remove.
8861 (Plugin_manager::add_input_file): Edit error message.
8862 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8863 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8865 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8867 * fileread.cc: (File_read::View::~View): Use the new
8868 data_ownership_ filed.
8869 (File_read::~File_read): Dispose the new whole_file_view_.
8870 (File_read::open): Mmap the whole file if needed.
8871 (File_read::open): Use whole_file_view_ instead of contents_.
8872 (File_read::find_view): Use whole_file_view_ if applicable.
8873 (File_read::do_read): Use whole_file_view_ instead of contents_.
8874 (File_read::make_view): Use whole_file_view_ instead of contents_,
8875 update File_read::View::View call.
8876 (File_read::find_or_make_view): Update File_read::View::View
8878 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8880 (File_read::View::Data_ownership): New enum.
8881 (File_read::View::View): Replace bool mapped_ with Data_ownership
8883 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8884 (File_read::View::data_ownership_): New field.
8885 (File_read::contents_): Remove (replaced by whole_file_view_).
8886 (File_read::whole_file_view_): New field.
8887 * options.h (class General_options): Add --keep-files-mapped.
8889 2009-10-27 Cary Coutant <ccoutant@google.com>
8891 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8892 * testsuite/Makefile.am (plugin_test_5): New test case.
8893 * testsuite/Makefile.in: Regenerate.
8895 2009-10-25 Doug Kwan <dougkwan@google.com>
8897 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8898 from private to protected to allow access by child class.
8899 (Sized_relobj::do_relocate_sections): New method declaration.
8900 (Sized_relobj::relocate_sections): Virtualize.
8901 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
8902 Sized_relobj::relocate_sections. Instantiate template explicitly
8903 for different target sizes and endianity.
8905 2009-10-24 Doug Kwan <dougkwan@google.com>
8907 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8908 (Arm_input_section::as_arm_input_section): New method.
8909 (Arm_output_section): New class definition.
8910 (Arm_output_section::create_stub_group,
8911 Arm_output_section::group_sections): New method definitions.
8913 2009-10-22 Doug Kwan <dougkwan@google.com>
8915 * arm.cc (Arm_input_section): New class definition.
8916 (Arm_input_section::init, Arm_input_section:do_write,
8917 Arm_input_section::set_final_data_size,
8918 Arm_input_section::do_reset_address_and_file_offset): New method
8921 2009-10-21 Doug Kwan <dougkwan@google.com>
8923 * arm.cc (Stub_table, Arm_input_section): New forward class
8925 (Stub_table): New class defintion.
8926 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8927 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8928 New method definition.
8930 2009-10-21 Doug Kwan <dougkwan@google.com>
8932 * arm.cc: Update copyright comments.
8933 (Target_arm): New forward class template declaration.
8934 (Arm_address): New type.
8935 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8936 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8937 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8939 (Insn_template): Same.
8940 (DEF_STUBS): New macro.
8941 (Stub_type): New enum type.
8942 (Stub_template): New class definition.
8945 (Stub_factory): Same.
8946 (Target_arm::Target_arm): Initialize may_use_blx_ and
8947 should_force_pic_veneer_.
8948 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8949 Target_arm::should_force_pic_veneer,
8950 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8951 Target_arm::using_thumb_only, Target_arm:;default_target): New
8953 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8954 New data member declarations.
8955 (Insn_template::size, Insn_template::alignment): New method defintions.
8956 (Stub_template::Stub_template): New method definition.
8957 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8958 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8959 (Stub_factory::Stub_factory): New method definition.
8960 * gold.h (string_hash): New template.
8961 * output.h (Input_section_specifier::hash_value): Use
8963 (Input_section_specifier::string_hash): Remove.
8964 * stringpool.cc (Stringpool_template::string_hash): Use
8967 2009-10-20 Doug Kwan <dougkwan@google.com>
8969 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8970 symbols of relaxed input sections.
8971 * output.h (Output_section::find_relaxed_input_section): Make
8974 2009-10-16 Doug Kwan <dougkwan@google.com>
8976 * dynobj.cc (Versions::Versions): Initialize version_script_.
8977 Only insert base version symbol definition for a shared object
8978 if version script defines any version versions.
8979 (Versions::define_base_version): New method definition.
8980 (Versions::add_def): Check that base version is not needed.
8981 (Versions::add_need): Define base version lazily.
8982 * dynobj.h (Versions::define_base_version): New method declaration.
8983 (Versions::needs_base_version_): New data member declaration.
8984 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8985 (check_DATA): Add no_version_test.stdout.
8986 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8988 * testsuite/Makefile.in: Regenerate.
8989 * testsuite/no_version_test.c: New file.
8990 * testsuite/no_version_test.sh: Ditto.
8992 2009-10-16 Doug Kwan <dougkwan@google.com>
8994 * expression.cc (class Segment_start_expression): New class definition.
8995 (Segment_start_expression::value): New method definition.
8996 (script_exp_function_segment_start): Return a new
8997 Segment_start_expression.
8998 * gold/script-c.h (script_saw_segment_start_expression): New function
9000 * script-sections.cc (Script_sections::Script_sections): Initialize
9001 SAW_SEGMENT_START_EXPRESSION_ to false.
9002 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9003 and -Tbbs options to specify section addresses if given in
9004 command line and no SEGMENT_START expression is seen in a script.
9005 * script-sections.h (Script_sections::saw_segment_start_expression,
9006 Script_sections::set_saw_segment_start_expression): New method
9008 (Script_sections::saw_segment_start_expression_): New data member
9010 * script.cc (script_saw_segment_start_expression): New function.
9011 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9012 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9013 script_test_7.sh and script_test_8.sh.
9014 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9015 script_test_8.stdout.
9016 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9017 (script_test_6, script_test_6.stdout, script_test_7,
9018 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9019 * Makefile.in: Regenerate.
9020 * testsuite/script_test_6.sh: New file.
9021 * testsuite/script_test_6.t: Same.
9022 * testsuite/script_test_7.sh: Same.
9023 * testsuite/script_test_7.t: Same.
9024 * testsuite/script_test_8.sh: Same.
9026 2009-10-16 Doug Kwan <dougkwan@google.com>
9028 * output.cc (Output_segment::set_section_list_address): Cast
9029 expressions to unsigned long long type to avoid format warnings.
9031 2009-10-15 Ian Lance Taylor <iant@google.com>
9033 * script.cc (Script_options::add_symbol_assignment): Always add a
9034 dot assignment to script_sections_.
9035 * script-sections.cc (Script_sections::add_dot_assignment):
9036 Initialize if necessary.
9038 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9039 program headers with no load segment if there is a linker script.
9041 * layout.cc (Layout::set_segment_offsets): Align the file offset
9042 to the segment aligment for -N or -n with no load segment.
9043 * output.cc (Output_segment::add_output_section): Don't crash if
9044 the first section is a TLS section.
9045 (Output_segment::set_section_list_addresses): Print an error
9046 message if the address moves backward in a linker script.
9047 * script-sections.cc
9048 (Output_section_element_input::set_section_addresses): Don't
9049 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9050 (Orphan_output_section::set_section_addresses): Likewise.
9052 2009-10-15 Doug Kwan <dougkwan@google.com>
9054 * layout.cc (Layout::finish_dynamic_section): Generate tags
9055 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9056 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9057 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9059 2009-10-14 Ian Lance Taylor <iant@google.com>
9061 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9063 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9064 data_shdr fields of relinfo.
9065 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9066 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9067 R_386_TLS_LDO_32, adjust based on section flags.
9068 (Target_i386::Relocate::fix_up_ldo): Remove.
9070 2009-10-13 Ian Lance Taylor <iant@google.com>
9072 Add support for -pie.
9073 * options.h (class General_options): Add -pie and
9075 (General_options::output_is_position_independent): Test -pie.
9076 (General_options::output_is_executable): Return true if not shared
9077 and not relocatable.
9078 (General_options::output_is_pie): Remove.
9079 * options.cc (General_options::finalize): Reject incompatible uses
9081 * gold.cc (queue_middle_tasks): A -pie link is not static.
9082 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9083 * symtab.cc (Symbol::final_value_is_known): Return false if
9084 output_is_position_independent.
9085 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9086 output_is_position_independent.
9087 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9088 output_is_position_independent.
9089 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9090 output_is_position_independent.
9091 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9093 (basic_pie_test.o, basic_pie_test): New targets.
9094 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9095 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9096 (two_file_pie_test): New target.
9097 * testsuite/Makefile.in: Rebuild.
9098 * README: Remove note saying that -pie is not supported.
9100 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9102 * options.h (class General_options): Add -init and -fini.
9103 * layout.cc (Layout::finish_dynamic_section): Emit
9104 given init and fini functions.
9106 2009-10-13 Sriraman Tallam <tmsriram@google.com>
9108 * gc.h (gc_process_relocs): Check if icf is enabled using new
9110 * gold.cc (queue_initial_tasks): Likewise.
9111 (queue_middle_tasks): Likewise.
9112 * object.cc (do_layout): Likewise.
9113 * symtab.cc (is_section_folded): Likewise.
9114 * main.cc (main): Likewise.
9115 * reloc.cc (Read_relocs::run): Likewise.
9116 (Sized_relobj::do_scan_relocs): Likewise.
9117 * icf.cc (is_function_ctor_or_dtor): New function.
9118 (Icf::find_identical_sections): Check if function is ctor or dtor when
9120 * options.h (General_options::icf): Change option to be an enum.
9121 (Icf_status): New enum.
9122 (icf_enabled): New method.
9123 (icf_safe_folding): New method.
9124 (set_icf_status): New method.
9125 (icf_status_): New variable.
9126 * (options.cc) (General_options::finalize): Set icf_status_.
9127 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9128 icf_test and icf_keep_unique_test to use the --icf enum flag.
9129 * testsuite/icf_safe_test.sh: New file.
9130 * testsuite/icf_safe_test.cc: New file.
9132 2009-10-12 Sriraman Tallam <tmsriram@google.com>
9134 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9135 includes to gc.h and icf.h.
9136 * arm.cc: Include gc.h.
9137 * gold.cc: Likewise.
9138 * i386.cc: Likewise.
9139 * powerpc.cc: Likewise.
9140 * sparc.cc: Likewise.
9141 * x86_64.cc: Likewise.
9142 * gc.h: Include icf.h.
9144 2009-10-11 Ian Lance Taylor <iant@google.com>
9146 * plugin.cc: Include "gold.h" before other header files.
9148 2009-10-10 Chris Demetriou <cgd@google.com>
9150 * options.h (Input_file_argument::Input_file_type): New enum.
9151 (Input_file_argument::is_lib_): Replace with...
9152 (Input_file_argument::type_): New member.
9153 (Input_file_argument::Input_file_argument): Take Input_file_type
9154 'type' rather than boolean 'is_lib' as second argument.
9155 (Input_file_argument::is_lib): Use type_.
9156 (Input_file_argument::is_searched_file): New function.
9157 (Input_file_argument::may_need_search): Handle is_searched_file.
9158 * options.cc (General_options::parse_library): Support -l:filename.
9159 (General_options::parse_just_symbols): Update for Input_file_argument
9161 (Command_line::process): Likewise.
9162 * archive.cc (Archive::get_file_and_offset): Likewise.
9163 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9164 * script.cc (read_script_file, script_add_file): Likewise.
9165 * fileread.cc (Input_file::Input_file): Likewise.
9166 (Input_file::will_search_for): Handle is_searched_file.
9167 (Input_file::open): Likewise.
9168 * readsyms.cc (Read_symbols::get_name): Likewise.
9169 * testsuite/Makefile.am (searched_file_test): New test.
9170 * testsuite/Makefile.in: Regenerate.
9171 * testsuite/searched_file_test.cc: New file.
9172 * testsuite/searched_file_test_lib.cc: New file.
9174 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9175 Ian Lance Taylor <iant@google.com>
9177 * descriptor.cc: Include <cstdio> and "binary-io.h".
9178 (Descriptors::open): Open the files in binary mode always.
9179 * script.cc (Lex::get_token): Treat \r as whitespace.
9181 2009-10-09 Ian Lance Taylor <iant@google.com>
9183 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9185 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9186 Ian Lance Taylor <iant@google.com>
9188 * configure.ac: Check for readv function also.
9189 * fileread.cc (readv): Define if not HAVE_READV.
9190 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9192 * config.in: Regenerate.
9193 * configure: Regenerate.
9195 2009-10-09 Doug Kwan <dougkwan@google.com>
9197 * layout.cc (Layout::make_output_section): Call target hook to make
9198 ordinary output section.
9199 (Layout::finalize): Adjust parameter list of call the
9200 Target::may_relax().
9201 * layout.h (class Layout::section_list): New method.
9202 * merge.h (Output_merge_base::entsize): Change visibility to public.
9203 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9205 (Output_merge_string::do_is_string): New method.
9206 * object.cc (Sized_relobj::do_setup): renamed from
9207 Sized_relobj::set_up.
9208 * object.h (Sized_relobj::adjust_shndx,
9209 Sized_relobj::initializ_input_to_output_maps,
9210 Sized_relobj::free_input_to_output_maps): Change visibilities to
9212 (Sized_relobj::setup): Virtualize.
9213 (Sized_relobj::do_setup): New method declaration.
9214 (Sized_relobj::invalidate_section_offset,
9215 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9216 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9217 * options.cc (parse_int): New function.
9218 * options.h (parse_int): New declaration.
9219 (DEFINE_int): New macro.
9220 (stub_group_size): New option.
9221 * output.cc (Output_section::Output_section): Initialize memebers
9222 merge_section_map_, merge_section_by_properties_map_,
9223 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9224 (Output_section::add_input_section): Handled deferred code-fill
9225 generation and remove an old comment.
9226 (Output_section::add_relaxed_input_section): New method definition.
9227 (Output_section::add_merge_input_section): Use merge section by
9228 properties map to speed to search. Update merge section maps
9230 (Output_section::build_relaxation_map): New method definition.
9231 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9233 (Output_section::relax_input_section): Renamed to
9234 Output_section::convert_input_sections_to_relaxed_sections and change
9235 interface to take a vector of pointers to relaxed sections.
9236 (Output_section::find_merge_section,
9237 Output_section::find_relaxed_input_section): New method definitions.
9238 (Output_section::is_input_address_mapped,
9239 Output_section::output_offset, Output_section::output_address):
9240 Use output section data maps to speed up searching.
9241 (Output_section::find_starting_output_address): Add comments.
9242 (Output_section::do_write,
9243 Output_section::write_to_postprocessing_buffer): Do code-fill
9244 generation as appropriate.
9245 (Output_section::get_input_sections): Invalidate relaxed input section
9247 (Output_section::restore_states): Adjust type of checkpoint .
9248 Invalidate relaxed input section map.
9249 * output.h (Output_merge_base): New class declaration.
9250 (Input_section_specifier): New class defintion.
9251 (class Output_relaxed_input_section) Change base class to
9252 Output_section_data_build.
9253 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9254 base class initializer.
9255 (Output_section::add_relaxed_input_section): New method declaration.
9256 (Output_section::Input_section): Change visibility to protected.
9257 (Output_section::Input_section::relobj,
9258 Output_section::Input_section::shndx): Handle relaxed input sections.
9259 Output_section::input_sections) Change visibility to protected. Also
9260 define overload to return a non-const pointer.
9261 (Output_section::Merge_section_properties): New class defintion.
9262 (Output_section::Merge_section_by_properties_map,
9263 Output_section::Output_section_data_by_input_section_map,
9264 Output_section::Relaxation_map): New types.
9265 (Output_section::relax_input_section): Rename method to
9266 Output_section::convert_input_sections_to_relaxed_sections and change
9267 interface to take a vector of relaxed section pointers.
9268 (Output_section::find_merge_section,
9269 Output_section::find_relaxed_input_section,
9270 Output_section::build_relaxation_map,
9271 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9272 New method declarations.
9273 (Output_section::merge_section_map_
9274 Output_section::merge_section_by_properties_map_,
9275 Output_section::relaxed_input_section_map_,
9276 Output_section::is_relaxed_input_section_map_valid_,
9277 Output_section::generate_code_fills_at_write_): New data members.
9278 * script-sections.cc
9279 (Output_section_element_input::set_section_addresses): Call
9280 current_data_size and addralign methods of relaxed input sections.
9281 (Orphan_output_section::set_section_addresses): Call current_data_size
9282 and addralign methods of relaxed input sections.
9283 * symtab.cc (Symbol_table::compute_final_value): Extract template
9284 from the body of Symbol_table::sized_finalize_symbol.
9285 (Symbol_table::sized_finalized_symbol): Call
9286 Symbol_table::compute_final_value.
9287 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9288 (Symbol_table::compute_final_value): New templated method declaration.
9289 * target.cc (Target::do_make_output_section): New method defintion.
9290 * target.h (Target::make_output_section): New method declaration.
9291 (Target::relax): Add more parameters for input objects, symbol table
9292 and layout. Adjust call to do_relax.
9293 (Target::do_make_output_section): New method declaration.
9294 (Target::do_relax): Add parameters for input objects, symbol table
9297 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9299 * pread.c: Include stdio.h.
9301 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9303 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9306 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9308 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9309 Change read_shndx type to unsigned int.
9310 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9312 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9313 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9314 Change read_shndx type to unsigned int.
9315 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9317 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9318 * layout.cc (Layout::create_symtab_sections): Cast the result of
9319 local_symcount * symsize to off_t in the gold_assert.
9321 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9323 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9324 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9326 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9327 (Arm_relocate_functions::thm_abs5): New function.
9328 (Arm_relocate_functions::abs12): New function.
9329 (Arm_relocate_functions::abs16): New function.
9330 (Arm_relocate_functions::base_abs): New function.
9331 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9332 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9333 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9335 (Scan::global): Likewise.
9336 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9337 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9338 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9339 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9342 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9344 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9345 (Arm_relocate_functions::movt_prel): New function.
9346 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9347 (Arm_relocate_functions::thm_movt_prel): New function.
9348 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9349 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9350 (Scan::global, Relocate::relocate): Likewise.
9351 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9353 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9355 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9356 Incremental_checker.
9357 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9359 (class Incremental_inputs_header): New class.
9360 (Incremental_inputs_header_writer): Edit comment.
9361 (Incremental_inputs_entry): New class.
9362 (Incremental_inputs_entry_writer): Edit comment.
9363 (Sized_incremental_binary::do_find_incremental_inputs_section):
9364 Add *strtab_shndx parameter, fill it.
9365 (Sized_incremental_binary::do_check_inputs): New method.
9366 (Incremental_checker::can_incrementally_link_output_file): Use
9367 Sized_incremental_binary::check_inputs.
9368 (Incremental_inputs::report_command_line): Save command line in
9371 (Incremental_binary::find_incremental_inputs_section): New
9373 (Incremental_binary::do_find_incremental_inputs_section): Add
9374 strtab_shndx parameter.
9375 (Incremental_binary::do_check_inputs): New pure virtual method.
9376 (Sized_incremental_binary::do_check_inputs): Declare.
9377 (Incremental_checker::Incremental_checker): Add incremental_inputs
9378 parameter, use it to initialize incremental_inputs_.
9379 (Incremental_checker::incremental_inputs_): New field.
9380 (Incremental_checker::command_line): New method.
9381 (Incremental_checker::inputs): New method.
9382 (Incremental_checker::command_line_): New field.
9384 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9386 * incremental.cc: Include <cstdarg> and "target-select.h".
9387 (vexplain_no_incremental): New function.
9388 (explain_no_incremental): New function.
9389 (Incremental_binary::error): New method.
9390 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9392 (make_sized_incremental_binary): New function.
9393 (open_incremental_binary): New function.
9394 (can_incrementally_link_file): Add checks if output is ELF and has
9396 * incremental.h: Include "elfcpp_file.h" and "output.h".
9397 (Incremental_binary): New class.
9398 (Sized_incremental_binary): New class.
9399 (open_incremental_binary): Declare.
9400 * object.cc (is_elf_object): Use
9401 elfcpp::Elf_recognizer::is_elf_file.
9402 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9403 * output.h (Output_file::filesize): New method.
9405 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9407 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9409 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9410 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9412 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9414 (Arm_relocate_functions::movw_abs_nc): New function.
9415 (Arm_relocate_functions::movt_abs): New function.
9416 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9417 (Arm_relocate_functions::thm_movt_abs): New function.
9418 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9419 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9420 (Scan::global): Likewise.
9421 (Relocate::relocate): Likewise.
9422 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9424 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9426 * arm.cc (Arm_relocate_functions::got_prel) New function.
9427 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9428 (Relocate::relocate): Likewise.
9429 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9431 2009-10-06 Ian Lance Taylor <iant@google.com>
9433 * options.h (class General_options): Define
9434 split_stack_adjust_size parameter.
9435 * object.h (class Object): Add uses_split_stack_ and
9436 has_no_split_stack_ fields. Add uses_split_stack and
9437 has_no_split_stack accessor functions. Declare
9438 handle_split_stack_section.
9439 (class Reloc_symbol_changes): Define.
9440 (class Sized_relobj): Define Function_offsets. Declare
9441 split_stack_adjust, split_stack_adjust_reltype, and
9443 * object.cc (Object::handle_split_stack_section): New function.
9444 (Sized_relobj::do_layout): Call handle_split_stack_section.
9445 * dynobj.cc (Sized_dynobj::do_layout): Call
9446 handle_split_stack_section.
9447 * reloc.cc (Sized_relobj::relocate_sections): Call
9448 split_stack_adjust for executable sections in split_stack
9449 objects. Pass reloc_map to relocate_section.
9450 (Sized_relobj::split_stack_adjust): New function.
9451 (Sized_relobj::split_stack_adjust_reltype): New function.
9452 (Sized_relobj::find_functions): New function.
9453 * target-reloc.h: Include "object.h".
9454 (relocate_section): Add reloc_symbol_changes parameter. Change
9456 * target.h (class Target): Add calls_non_split method. Declare
9457 do_calls_non_split virtual method. Declare match_view and
9459 * target.cc: Include "elfcpp.h".
9460 (Target::do_calls_non_split): New function.
9461 (Target::match_view): New function.
9462 (Target::set_view_to_nop): New function.
9463 * gold.cc (queue_middle_tasks): Give an error if mixing
9464 split-stack and non-split-stack objects with -r.
9465 * i386.cc (Target_i386::relocate_section): Add
9466 reloc_symbol_changes parameter.
9467 (Target_i386::do_calls_non_split): New function.
9468 * x86_64.cc (Target_x86_64::relocate_section): Add
9469 reloc_symbol_changes parameter.
9470 (Target_x86_64::do_calls_non_split): New function.
9471 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9473 * powerpc.cc (Target_powerpc::relocate_section): Add
9474 reloc_symbol_changes parameter.
9475 * sparc.cc (Target_sparc::relocate_section): Add
9476 reloc_symbol_changes parameter.
9477 * configure.ac: Call AM_CONDITIONAL for the default target.
9478 * configure: Rebuild.
9479 * testsuite/Makefile.am (TEST_AS): New variable.
9480 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9481 (check_DATA): Add split_i386 and split_x86_64 files.
9482 (SPLIT_DEFSYMS): Define.
9483 (split_i386_[1234n].o): New targets.
9484 (split_i386_[124]): New targets.
9485 (split_i386_[1234r].stdout): New targets.
9486 (split_x86_64_[1234n].o): New targets.
9487 (split_x86_64_[124]): New targets.
9488 (split_x86_64_[1234r].stdout): New targets.
9489 (MOSTLYCLEANFILES): Add new executables.
9490 * testsuite/split_i386.sh: New file.
9491 * testsuite/split_x86_64.sh: New file.
9492 * testsuite/split_i386_1.s: New file.
9493 * testsuite/split_i386_2.s: New file.
9494 * testsuite/split_i386_3.s: New file.
9495 * testsuite/split_i386_4.s: New file.
9496 * testsuite/split_i386_n.s: New file.
9497 * testsuite/split_x86_64_1.s: New file.
9498 * testsuite/split_x86_64_2.s: New file.
9499 * testsuite/split_x86_64_3.s: New file.
9500 * testsuite/split_x86_64_4.s: New file.
9501 * testsuite/split_x86_64_n.s: New file.
9502 * testsuite/testfile.cc (Target_test): Update relocation_section
9504 * testsuite/Makefile.in: Rebuild.
9506 2009-10-06 Ian Lance Taylor <iant@google.com>
9508 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9509 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9510 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9511 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9512 the address on ldo_addrs_.
9513 (Target_i386::Relocate::fix_up_ldo): New function.
9515 2009-10-06 Rafael Espindola <espindola@google.com>
9517 * plugin.cc (add_input_library): New.
9518 (Plugin::load): Add add_input_library to tv.
9519 (Plugin_manager::add_input_file): Add the is_lib argument.
9520 (add_input_file): Update call to Plugin_manager::add_input_file.
9521 (add_input_library): New.
9522 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9524 2009-09-30 Doug Kwan <dougkwan@google.com>
9526 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9527 symbol and call Symbol::may_need_copy_reloc to determine if
9528 a copy reloc is needed.
9529 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9530 nocopyreloc is given in command line.
9531 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9532 given in command line.
9533 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9534 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9535 of the removed Target_i386::may_need_copy_reloc.
9536 * options.h (copyreloc): New option with default value false.
9537 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9538 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9539 instead of the removed Target_powerpc::may_need_copy_reloc.
9540 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9541 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9542 instead of the removed Target_sparc::may_need_copy_reloc.
9543 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9544 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9545 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9546 instead of the removed Target_x86_64::may_need_copy_reloc.
9548 2009-09-30 Ian Lance Taylor <iant@google.com>
9550 * object.h (class Object): Remove target_ field, and target,
9551 sized_target, and set_target methods.
9552 (Object::sized_target): Remove.
9553 (class Sized_relobj): Update declarations. Remove sized_target.
9554 * object.cc (Sized_relobj::setup): Remove target parameter.
9556 (Input_objects::add_object): Don't do anything with the target.
9557 (make_elf_sized_object): Add punconfigured parameter. Change all
9558 callers. Set or test parameter target.
9559 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9561 * parameters.cc (Parameters::set_target): Change parameter type to
9563 (Parameters::default_target): Remove.
9564 (set_parameters_target): Change parameter type to be non-const.
9565 (parameters_force_valid_target): New function.
9566 (parameters_clear_target): New function.
9567 * parameters.h (class Parameters): Update declarations. Remove
9568 default_target method. Add sized_target and clear_target
9569 methods. Change target_ to be non-const.
9570 (set_parameters_target): Update declaration.
9571 (parameters_force_valid_target): Declare.
9572 (parameters_clear_target): Declare.
9573 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9574 as NULL if we aren't searching.
9575 (Add_symbols::run): Don't check for compatible target.
9576 * fileread.cc (Input_file::open_binary): Call
9577 parameters_force_valid_target.
9578 * gold.cc (queue_middle_tasks): Likewise.
9579 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9580 set_target on object.
9581 * dynobj.h (class Sized_dynobj): Update declarations.
9582 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9583 make_elf_object returns NULL.
9584 (Archive::include_member): Don't check whether object target is
9586 * output.cc (Output_section::add_input_section): Get target from
9588 (Output_section::relax_input_section): Likewise.
9589 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9591 (Sized_relobj::do_scan_relocs): Likewise.
9592 (Sized_relobj::relocate_sections): Likewise.
9593 * resolve.cc (Symbol_table::resolve): Likewise.
9594 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9595 parameter. Change all callers.
9596 (Symbol_table::add_from_object): Get target from parameters.
9597 (Symbol_table::add_from_relobj): Don't check object target.
9598 (Symbol_table::add_from_dynobj): Likewise.
9599 (Symbol_table::define_special_symbol): Get target from
9601 * symtab.h (class Symbol_table): Update declaration.
9602 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9603 parameter. Change all callers. Clear parameter target.
9604 (Binary_test): Test target here.
9605 * testsuite/object_unittest.cc (gold_testsuite): Remove
9606 target_test_pointer parameter. Change all callers.
9607 (Object_test): Test target here.
9609 2009-09-26 Ian Lance Taylor <iant@google.com>
9611 * testsuite/initpri1.c: Don't try to use constructor priorities if
9612 compiling with gcc before 4.3.
9614 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9616 * testsuite/retain_symbols_file_test.sh (check_present): Change
9617 output file name to retain_symbols_file_test.stdout.
9618 (check_absent): Likewise.
9620 2009-09-18 Craig Silverstein <csilvers@google.com>
9622 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9623 * options.cc: Include <cerrno> and <fstream>.
9624 (General_options::finalize): Parse -retain-symbols-file tag.
9625 * options.h: New flag.
9626 (General_options): New method should_retain_symbol, new
9627 variable symbols_to_retain.
9628 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9629 should_retain_symbol map.
9630 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9631 * testsuite/Makefile.in: Regenerate.
9632 * testsuite/retain_symbols_file_test.sh: New file.
9634 2009-09-18 Nick Clifton <nickc@redhat.com>
9636 * po/es.po: Updated Spanish translation.
9638 2009-09-17 Doug Kwan <dougkwan@google.com>
9640 * debug.h (DEBUG_RELAXATION): New constant.
9641 (DEBUG_ALL): Add DEBUG_RELAXATION.
9642 (debug_string_to_enum): Add relaxation debug option.
9644 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9645 Layout::Relaxation_debug_check::read_sections,
9646 Layout::Relaxation_debug_check::read_sections): New method definitions.
9647 (Layout::Layout): Initialize data members
9648 record_output_section_data_from_scrips_,
9649 script_output_section_data_list_ and relaxation_debug_check_.
9650 (Layout::save_segments, Layout::restore_segments,
9651 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9652 Layout::relaxation_loop_body): New method definitions.
9653 (Layout::finalize): Support relaxation. Move section layout code to
9654 Layout::relaxation_loop_body.
9655 (Layout::set_asection_address_from_script): Move code for orphan
9656 section placement out.
9657 (Layout::place_orphan_sections_in_script): New method definition.
9658 * layout.h (Output_segment_headers, Output_file_header):
9659 New forward class declarations.
9660 (Layout::~Layout): Define.
9661 (Layout::new_output_section_data_from_script): New method definition.
9662 (Layout::place_orphan_sections_in_script): New method declaration.
9663 (Layout::Segment_states): New type declaration.
9664 (Layout::save_segments, Layout::restore_segments,
9665 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9666 Layout::relaxation_loop_body): New method declarations.
9667 (Layout::Output_section_data_list): New type declaration.
9668 (Layout::Relaxation_debug_check): New class definition.
9669 (Layout::record_output_section_data_from_script_,
9670 Layout::script_output_section_data_list_, Layout::segment_states_,
9671 Layout::relaxation_debug_check_): New data members.
9672 * output.cc: (Output_section_headers::do_size): New method definition.
9673 (Output_section_headers::Output_section_headers): Move size
9674 computation to Output_section_headers::do_size.
9675 (Output_segment_headers::do_size): New method definition.
9676 (Output_file_header::Output_file_header): Move size computation to
9677 Output_file_header::do_size and call it.
9678 (Output_file_header::do_size): New method definition.
9679 (Output_data_group::Output_data_group): Adjust call to
9680 Output_section_data.
9681 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9682 (Output_symtab_xindex::do_write): Add array bound check.
9683 (Output_section::Input_section::print_to_mapfile): Handle
9684 RELAXED_INPUT_SECTION_CODE.
9685 (Output_section::Output_section): Initialize data member checkpoint_.
9686 (Output_section::~Output_section): Delete checkpoint object pointed
9688 (Output_section::add_input_section): Always add an Input_section if
9690 (Output_section::add_merge_input_section): Add assert.
9691 (Output_section::relax_input_section): New method definition.
9692 (Output_section::set_final_data_size): Set load address to zero for
9693 an unallocated section.
9694 (Output_section::do_address_and_file_offset_have_reset_values):
9695 New method definition.
9696 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9697 Handle relaxed input section.
9698 (Output_section::sort_attached_input_sections): Checkpoint input
9699 section list lazily.
9700 (Output_section::get_input_sections): Change type of input_sections to
9701 list of Simple_input_section pointers. Checkpoint input section list
9702 lazily. Also handle relaxed input sections.
9703 (Output_section::add_input_section_for_script): Take a reference to
9704 a Simple_input_section object instead of Relobj pointer and section
9705 index as parameter. Handle relaxed input sections.
9706 (Output_section::save_states, Output_section::restore_states): New
9708 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9709 (Output_data::is_data_size_fixed): New method definition.
9710 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9712 (Output_data::address_and_file_offset_have_reset_values): New method
9714 (Output_data::do_address_and_file_offset_have_reset_values): New method
9716 (Output_data::set_data_size): Check that data size is not fixed.
9717 (Output_data::fix_data_size): New method definition.
9718 (Output_data::is_data_size_fixed_): New data member.
9719 (Output_section_headers::set_final_data_size): New method definition.
9720 (Output_section_headers::do_size): New method declaration.
9721 (Output_segment_headers::set_final_data_size): New method definition.
9722 (Output_segment_headers::do_size): New method declaration.
9723 (Output_file_header::set_final_data_size)::New method definition.
9724 (Output_file_header::do_size)::New method declaration.
9725 (Output_section_data::Output_section_data): Add new parameter
9726 is_data_size_fixed and use it to fix data size.
9727 (Output_data_const::Output_data_const): Adjust call to base class
9728 constructor and fix data size.
9729 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9730 base class constructor and fix data size.
9731 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9732 base class constructor and fix data size.
9733 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9734 class constructor and fix data size.
9735 (Output_data_group::set_final_data_size): New method definition.
9736 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9737 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9738 class constructor and fix data size.
9739 (Output_relaxed_input_section): New class definition.
9740 (Output_section::Simple_input_section): New class definition.
9741 (Output_section::get_input_sections): Adjust parameter list.
9742 (Output_section::add_input_section_for_script): Same.
9743 (Output_section::save_states, Output_section::restore_states,
9744 Output_section::do_address_and_file_offset_have_reset_values,
9745 (Output_section::Input_section::Input_section): Handle
9746 RELAXED_INPUT_SECTION_CODE. Add new overload for
9747 Output_relaxed_input_section.
9748 (Output_section::Input_section::is_input_section,
9749 Output_section::Input_section::set_output_section): Handle relaxed
9751 (Output_section::Input_section::is_relaxed_input_section,
9752 Output_section::Input_section::output_section_data,
9753 Output_section::Input_section::relaxed_input_section): New method
9755 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9757 (Output_section::Input_section::u1_): Update comments.
9758 (Output_section::Input_section::u2_): Add new union member poris.
9759 (Output_section::Checkpoint_output_section): New classs definition.
9760 (Output_section::relax_input_section): New method declaration.
9761 (Output_section::checkpoint_): New data member.
9762 (Output_segment): Update comments.
9763 (Output_segment::Output_segment): Un-privatize copy constructor.
9764 (Output_segment::operator=): Un-privatize.
9765 * script-sections.cc (Output_section_element::Input_section_list):
9766 Change element type to Output_section::Simple_input_section.
9767 (Output_section_element_dot_assignment::set_section_addresses):
9768 Register output section data for relaxation clean up.
9769 (Output_data_exression::Output_data_expression): Adjust call to base
9770 constructor to fix data size.
9771 (Output_section_element_data::set_section_addresses): Register
9772 Output_data_expression object for relaxation clean up.
9773 (struct Input_section_info): Replace Relobj pointer and section index
9774 pair with Output_section::Simple_input_section and Convert struct to a
9776 (Input_section_sorter::operator()): Adjust access to
9777 Input_section_info data member to use accessors.
9778 (Output_section_element_input::set_section_addresses): Use layout
9779 parameter. Adjust code to use Output_section::Simple_input_section
9780 and Input_secction_info classes. Register filler for relaxation
9782 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9783 and section index pair with Output_section::Simple_input_section
9784 class. Adjust code accordingly.
9785 (Phdrs_element::release_segment): New method definition.
9786 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9788 (Script_sections::release_segments): New method definition.
9789 * gold/script-sections.h (Script_sections::release_segments): New
9791 * gold/target.h (Target::may_relax, Target::relax,
9792 Target::do_may_relax, Target::do_relax): New method definitions.
9794 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9796 * arm.cc (has_signed_unsigned_overflow): New function.
9797 (Arm_relocate_functions::abs8): New function.
9798 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9799 (Target_arm::Scan::global): Likewise.
9800 (Target_arm::relocate::relocate): Likewise.
9801 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9804 2009-09-16 Cary Coutant <ccoutant@google.com>
9806 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9807 * testsuite/Makefile.in: Regenerate.
9809 2009-09-11 Nick Clifton <nickc@redhat.com>
9811 * po/gold.pot: Updated by the Translation project.
9813 2009-09-08 Cary Coutant <ccoutant@google.com>
9815 * output.cc (Output_file::open): Add execute permission to empty file.
9816 * testsuite/Makefile.am (permission_test): New test.
9817 * testsuite/Makefile.in: Regenerate.
9819 2009-09-02 Ian Lance Taylor <iant@google.com>
9821 * output.cc (Output_file::resize): Call map_no_anonymous rather
9824 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9826 * gold.cc: Include "incremental.h".
9827 (queue_initial_tasks): Call Incremental_checker methods.
9828 * incremental.cc: Include "output.h".
9829 (Incremental_checker::can_incrementally_link_output_file): New
9831 * incremental.h (Incremental_checker): New class.
9833 * output.cc (Output_file::open_for_modification): New method.
9834 (Output_file::map_anonymous): Changed return type to bool. Record
9836 (Output_file::map_no_anonymous): New method, broken out of map.
9837 (Output_file::map): Use map_no_anonymous and map_anonymous.
9838 * output.h (class Output_file): Update declarations.
9840 2009-08-24 Cary Coutant <ccoutant@google.com>
9842 * options.h (Command_line::Pre_options): New class.
9843 (Command_line::pre_options): New member.
9844 * options.cc (gold::options::ready_to_register): New variable.
9845 (One_option::register_option): Do nothing if not registering options.
9846 Assert if same short option registered twice.
9847 (General_options::General_options): Turn off option registration when
9849 (Command_line::Pre_options::Pre_options): New constructor.
9851 2009-08-24 Cary Coutant <ccoutant@google.com>
9853 * options.h (General_options::no_keep_memory): Remove incorrect
9856 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9858 * Makefile.am (am__skiplex, am__skipyacc): New.
9859 * Makefile.in: Regenerate.
9861 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9863 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9864 (INCLUDES): ... this.
9865 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9866 (AM_CPPFLAGS): Renamed from ...
9867 (INCLUDE): ... this.
9868 * Makefile.in, testsuite/Makefile.in: Regenerate.
9870 * Makefile.in: Regenerate.
9871 * aclocal.m4: Likewise.
9872 * config.in: Likewise.
9873 * configure: Likewise.
9874 * testsuite/Makefile.in: Likewise.
9876 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9877 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9878 * Makefile.in: Regenerate.
9879 * testsuite/Makefile.in: Regenerate.
9881 2009-08-19 Cary Coutant <ccoutant@google.com>
9883 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9884 symbols in shared libraries overridden by hidden or internal symbols
9885 in the main program.
9887 2009-08-19 Chris Demetriou <cgd@google.com>
9889 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9890 checking source file names in error messages.
9892 2009-08-18 Doug Kwan <dougkwan@google.com>
9894 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9895 an elcpp::Ehdr as parameter. Adjust call to set_target.
9896 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9897 an elfcpp::Ehdr as parameter.
9898 * object.cc (Object::set_target): Remove the version that looks up
9899 a target and sets it.
9900 (Sized_relobj::setup): Take a Target object instead of
9901 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9902 (make_elf_sized_object): Find target and ask target to
9904 * object.h: (Object::set_target): Remove the version that looks up
9905 a target and sets it.
9906 (Sized_relobj::setup): Take a Target object instead of
9907 an elfcpp:Ehdr as parameter.
9908 * target.cc: Include dynobj.h.
9909 (Target::do_make_elf_object_implementation): New.
9910 (Target::do_make_elf_object): New.
9911 * target.h (Target::make_elf_object): New template declaration.
9912 (Target::do_make_elf_object): New method declarations.
9913 (Target::do_make_elf_object_implementation): New template declaration.
9915 2009-08-14 Ian Lance Taylor <iant@google.com>
9917 * gold.h (FUNCTION_NAME): Define.
9918 (gold_unreachable): Use FUNCTION_NAME.
9920 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9922 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9923 symbol in the --keep-unique list is not found.
9925 2009-08-12 Sriraman Tallam <tmsriram@google.com>
9927 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9928 been maked as --keep-unique.
9929 (Icf::unfold_section): New function.
9930 * icf.h (Icf::unfold_section): New function.
9931 * options.h (General_options::keep_unique): New option.
9932 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9933 * testsuite/Makefile.in: Regenerate.
9934 * testsuite/icf_keep_unique_test.sh: New file.
9935 * testsuite/icf_keep_unique_test.cc: New file.
9937 2009-08-12 Cary Coutant <ccoutant@google.com>
9940 * resolve.cc (Symbol_table::resolve): Check for references from
9941 dynamic objects to hidden and internal symbols.
9942 * testsuite/Makefile.am (hidden_test.sh): New test.
9943 * testsuite/Makefile.in: Regenerate.
9944 * testsuite/hidden_test.sh: New script.
9945 * testsuite/hidden_test_1.c: New test source.
9946 * testsuite/hidden_test_main.c: New test source.
9948 2009-08-11 Doug Kwan <dougkwan@google.com>
9950 * arm.cc: Update comments.
9951 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9952 segment to locate the .ARM.exidx section if present.
9954 2009-08-09 Doug Kwan <dougkwan@google.com>
9956 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9959 2009-08-07 Sriraman Tallam <tmsriram@google.com>
9960 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9963 2009-08-06 Sriraman Tallam <tmsriram@google.com>
9965 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9966 valid tls_segment only for non-debug-section relocations.
9967 * testsuite/Makefile.am: Add gc_tls_test.
9968 * testsuite/Makefile.in: Regenerate.
9969 * testsuite/gc_tls_test.cc: New file.
9970 * testsuite/gc_tls_test.sh: New file.
9972 2009-08-05 Sriraman Tallam <tmsriram@google.com>
9976 * Makefile.am (CCFILES): Add icf.cc.
9978 * Makefile.in: Regenerate.
9979 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9980 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9981 section, symbol and addend information for the relocs.
9982 * gold.cc (queue_middle_tasks): Call identical code folding.
9983 * gold.h: Add defines for multimap.
9984 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9985 to the call of finalize_local_symbols.
9986 * main.cc (main): Create object of class Icf.
9987 * object.cc (Sized_relobj::do_layout): Allow this function to be
9988 called twice during icf.
9989 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9990 to sections marked as identical by icf.
9991 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9993 (Sized_relobj::do_section_entsize): New function.
9994 * object.h (Object::section_entsize): New function.
9995 (Object::do_section_entsize): New pure virtual function.
9996 (Relobj::finalize_local_symbols): Add new parameter.
9997 (Relobj::do_section_entsize): New function.
9998 * options.h (General_options::icf): New option.
9999 (General_options::icf_iterations): New option.
10000 (General_options::print_icf_sections): New option.
10001 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10002 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10003 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10005 * symtab.cc (Symbol_table::is_section_folded): New function.
10006 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10007 to sections marked as identical by icf.
10008 * symtab.h (Symbol_table::set_icf): New function.
10009 (Symbol_table::icf): New function.
10010 (Symbol_table::is_section_folded): New function.
10011 (Symbol_table::icf_): New data member.
10012 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10013 * testsuite/Makefile.am: Add commands to build icf_test.
10014 * testsuite/Makefile.in: Regenerate.
10015 * testsuite/icf_test.sh: New file.
10016 * testsuite/icf_test.cc: New file.
10018 2009-07-24 Chris Demetriou <cgd@google.com>
10020 * layout.cc (is_compressible_debug_section): Fix incorrect
10021 comment about compressed section names.
10023 2009-07-20 Ian Lance Taylor <ian@airs.com>
10026 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10028 2009-07-16 Ian Lance Taylor <iant@google.com>
10031 * layout.h: #include <map>.
10032 (class Kept_section): Change from struct to class. Add accessors
10033 and setters. Add section size to Comdat_group mapping. Change
10034 Comdat_group to std::map. Add is_comdat_ field. Add
10035 linkonce_size field in union.
10036 (class Layout): Update declaration of find_or_add_kept_section.
10037 Don't declare find_kept_object.
10038 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10039 parameter. Add object, shndx, is_comdat, and is_group_name
10040 parameters. Change all callers. Adjust for new Kept_section.
10041 (Layout::find_kept_object): Remove.
10042 * object.cc (Sized_relobj::include_section_group): Update use of
10043 Kept_section. Rename secnum to shndx. Only record
10044 Kept_comdat_section if sections are the same size.
10045 (Sized_relobj::include_linkonce_section): Update use of
10046 Kept_section. Only record Kept_comdat_section if sections are the
10047 same size. Set size of linkonce section.
10048 (Sized_relobj::map_to_kept_section): Update call to
10049 get_kept_comdat_section.
10050 * object.h (class Sized_relobj): Rename fields in
10051 Kept_comdat_section to drop trailing underscores; change object
10052 field to Relobj*. Change Kept_comdat_section_table to store
10053 struct rather than pointer.
10054 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10055 Add kept_object and kept_shndx parameters. Change all callers.
10056 (Sized_relobj::get_kept_comdat_section): Change return type to
10057 bool. Add kept_object and kept_shndx parameters. Change all
10059 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10060 Layout::find_or_add_kept_section.
10062 2009-07-09 Ian Lance Taylor <iant@google.com>
10064 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10065 Reserve space in the hash table.
10067 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10069 * fileread.cc (File_read::get_mtime): New method.
10070 * fileread.h (Timespec): New structure.
10071 (File_read::get_mtime): New method.
10072 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10073 Renamed from timestamp_nsec.
10074 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10076 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
10078 (Incremental_inputs::report_archive): Save mtime; style fix.
10079 (Incremental_inputs::report_obejct): Save mtime; style fix.
10080 (Incremental_inputs::report_script): Save mtime; style fix.
10081 (Incremental_inputs::finalize_inputs): Style fix.
10082 (Incremental_inputs::finalize): Style fix.
10083 (Incremental_inputs::create_input_section_data): Store inputs
10085 * incremental.h (Incremental_inputs::report_script): Add mtime
10087 (Incremental_inputs::Input_info::Input_info): Intialize only one
10089 (Incremental_inputs::Input_info::archive): Move to nameless
10091 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10092 (Incremental_inputs::Input_info::script): Move to nameless union.
10093 (Incremental_inputs::mtime): New field.
10094 * script.cc (read_input_script): Pass file mtime to
10096 * script.h (Script_info::inputs): Style fix.
10098 2009-07-01 Ian Lance Taylor <ian@airs.com>
10100 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10103 2009-06-24 Ian Lance Taylor <iant@google.com>
10106 * layout.cc (Layout::choose_output_section): If we find an
10107 existing section, update the flags.
10108 (Layout::create_notes): New function, broken out of
10110 (Layout::finalize): Don't create note sections.
10111 (Layout::create_note): Don't crash if linker script discards
10113 (Layout::create_gold_note): Likewise.
10114 (Layout::create_build_id): Likewise. Don't set
10115 after_input_sections on the section.
10116 (Layout::create_executable_stack_info): Remove target parameter.
10118 * layout.h (class Layout): Declare create_notes. Update
10119 declaration of create_executable_stack_info.
10120 * gold.cc (queue_middle_tasks): Call create_notes.
10121 * output.cc (Output_section::update_flags_for_input_section): Move
10122 here from output.h. If SHF_ALLOC flag is newly set, mark address
10124 * output.h (Output_data::mark_address_invalid): New function.
10125 (class Output_section): Only declare, not define,
10126 update_flags_for_input_section. Remove set_flags.
10128 2009-06-24 Ian Lance Taylor <iant@google.com>
10130 * script-sections.cc (Output_section_definition::
10131 set_section_addresses): Rename shadowing local load_address to
10134 2009-06-24 Ian Lance Taylor <iant@google.com>
10137 * reloc.cc (relocate_sections): Skip empty relocation sections.
10139 2009-06-23 Ian Lance Taylor <iant@google.com>
10142 * layout.cc (Layout::create_note): Use choose_output_section
10143 rather than make_output_section.
10145 2009-06-23 Ian Lance Taylor <iant@google.com>
10148 * options.cc (General_options::parse_V): Set printed_version_.
10149 (General_options::General_options): Initialize printed_version_.
10150 * options.h (class General_options): Add printed_version_ field.
10151 * gold.cc (queue_initial_tasks): If there are no input files,
10152 don't give a fatal error if we printed the version information.
10153 (queue_middle_tasks): If using -r with a shared object, give a
10154 fatal error rather than an ordinary error.
10156 2009-06-23 Ian Lance Taylor <iant@google.com>
10159 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10160 (Layout::make_output_section): Set have_stabstr_section_ if we see
10161 a .stab*str section.
10162 (Layout::finalize): Call link_stabs_sections.
10163 (Layout::link_stabs_sections): New file.
10164 * layout.h (class Layout): Add have_stabstr_section_ field.
10165 Declare link_stabs_sections.
10167 2009-06-23 Doug Kwan <dougkwan@google.com>
10169 * Makefile.am (libgold_a_LIBADD): New.
10170 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
10171 * Makefile.in: Regenerate.
10172 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10173 * configure: Regenerate.
10174 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10175 * fileread.cc: Include sys/state.h
10176 * gold.h: Declare memmem and strndup if found missing.
10177 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10179 2009-06-23 Ian Lance Taylor <iant@google.com>
10181 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10182 * configure: Rebuild.
10184 2009-06-23 Ian Lance Taylor <iant@google.com>
10187 * object.cc (Object::section_contents): Don't try to get a view if
10188 the section has length zero.
10189 (Object::handle_gnu_warning_section): If the section is empty, use
10190 the name of the section as the warning.
10192 2009-06-23 Ian Lance Taylor <iant@google.com>
10195 * stringpool.h (class Stringpool_template): Add optimize_ field.
10196 (Stringpool_template::set_optimize): New function.
10197 * stringpool.cc (Stringpool_template::Stringpool_template):
10198 Initialize optimize_ field.
10199 (Stringpool_template::set_string_offsets): Test local optimize
10200 fild rather than parameter.
10201 * layout.cc (Layout::Layout): Call set_optimize on the section
10204 2009-06-22 Ian Lance Taylor <iant@google.com>
10207 * yyscript.y: Parse TARGET.
10208 * script.cc (script_set_target): New function.
10209 * script-c.h (script_set_target): Declare.
10210 * options.cc (General_options::string_to_object_format): Rename
10211 from string_to_object_format in anonymous namespace. Change
10213 * options.h (class General_options): Declare
10214 string_to_object_format.
10216 2009-06-22 Ian Lance Taylor <iant@google.com>
10218 * script-sections.cc (Script_sections::create_segments): Don't put
10219 program headers in a PT_LOAD segment if -n or -N.
10221 2009-06-22 Ian Lance Taylor <iant@google.com>
10224 * options.h (class General_options): Add -z lazy and -z now. Sort
10225 -z options into alphabetical order.
10226 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10228 2009-06-21 Ian Lance Taylor <iant@google.com>
10230 * layout.cc (Layout::make_output_section): Call
10231 Target::new_output_section.
10232 (Layout::attach_allocated_section_to_segment): Put large section
10233 sections in a separate load segment with the large segment flag
10235 (Layout::segment_precedes): Sort large data segments after other
10237 (align_file_offset): New static function.
10238 (Layout::set_segment_offsets): Use align_file_offset.
10239 * output.h (class Output_section): Add is_small_section_ and
10240 is_large_section_ fields.
10241 (Output_section::is_small_section): New function.
10242 (Output_section::set_is_small_section): New function.
10243 (Output_section::is_large_section): New function.
10244 (Output_section::set_is_large_section): New function.
10245 (Output_section::is_large_data_section): New function.
10246 (class Output_segment): Add is_large_data_segment_ field.
10247 (Output_segment::is_large_data_segment): New function.
10248 (Output_segment::set_is_large_data_segment): New function.
10249 * output.cc (Output_section::Output_section): Initialize new
10251 (Output_segment::Output_segment): Likewise.
10252 (Output_segment::add_output_section): Add assertion that large
10253 data sections always go in large data segments. Force small data
10254 sections to the end of the list of data sections. Force small BSS
10255 sections to the start of the list of BSS sections. For large BSS
10256 sections to the end of the list of BSS sections.
10257 * symtab.h (class Symbol): Declare is_common_shndx.
10258 (Symbol::is_defined): Check Symbol::is_common_shndx.
10259 (Symbol::is_common): Likewise.
10260 (class Symbol_table): Define enum Commons_section_type. Update
10261 declarations. Add small_commons_ and large_commons_ fields.
10262 * symtab.cc (Symbol::is_common_shndx): New function.
10263 (Symbol_table::Symbol_table): Initialize new fields.
10264 (Symbol_table::add_from_object): Put small and large common
10265 symbols in the right list.
10266 (Symbol_table::sized_finalized_symbol): Check
10267 Symbol::is_common_shndx.
10268 (Symbol_table::sized_write_globals): Likewise.
10269 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10270 common symbol lists. Don't call do_allocate_commons_list if the
10272 (Symbol_table::do_allocate_commons_list): Remove is_tls
10273 parameter. Add comons_section_type parameter. Change all
10274 callers. Handle small and large common symbols.
10275 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10276 Symbol::is_common_shndx.
10277 * resolve.cc (symbol_to_bits): Likewise.
10278 * target.h (Target::small_common_shndx): New function.
10279 (Target::small_common_section_flags): New function.
10280 (Target::large_common_shndx): New function.
10281 (Target::large_common_section_flags): New function.
10282 (Target::new_output_section): New function.
10283 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10284 small_common_section_flags, and large_common_section_flags
10286 (Target::do_new_output_section): New virtual function.
10287 * arm.cc (Target_arm::arm_info): Initialize new fields.
10288 * i386.cc (Target_i386::i386_info): Likewise.
10289 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10291 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10292 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10293 (Target_x86_64::do_new_output_section): New function.
10294 * configure.ac: Define conditional MCMODEL_MEDIUM.
10295 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10296 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10297 (large_LDFLAGS): Define.
10298 * testsuite/large.c: New file.
10299 * testsuite/testfile.cc (Target_test::test_target_info):
10300 Initialize new fields.
10301 * configure, testsuite/Makefile.in: Rebuild.
10303 2009-06-05 Doug Kwan <dougkwan@google.com>
10305 * Makefile.am (CCFILES): Add target.cc.
10306 * Makefile.in: Regenerate.
10307 * i386.cc (class Target_i386): Define new virtual method to
10308 override do_is_local_label_name in parent.
10309 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10310 local symbols if --discard-locals or -X is given.
10311 * options.h (class General_options): Declare new options
10312 '--discard-locals' and '-X' for discarding locals.
10313 * target.h (class Target): Define new methods is_local_label_name.
10314 Declare new virtual method do_is_local_label_name.
10315 * target.cc: New file.
10316 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10317 (check_SCRIPTS): Add discard_locals_test.sh.
10318 (check_DATA): Add discard_local_tests.syms.
10319 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10320 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10321 * testsuite/Makefile.in: Regenerate.
10322 * testsuite/discard_locals_test.c: New file.
10323 * testsuite/discard_locals_test.sh: Same.
10325 2009-06-05 Doug Kwan <dougkwan@google.com>
10327 * object.cc (Sized_relobj::Sized_relobj): Initialize
10328 discarded_eh_frame_shndx_ to -1U.
10329 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10331 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10332 a discarded .eh_frame section.
10333 (Sized_relobj::do_finalize_local_symbols): Ditto.
10334 * object.h (class Sized_relobj): Declare new member
10335 discarded_eh_frame_shndx_.
10336 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10337 (local_labels_test.o, local_labels_test): New rules.
10338 * testsuite/Makefile.in: Regenerate.
10340 2009-06-04 Doug Kwan <dougkwan@google.com>
10342 * layout.cc (Layout::section_name_mapping): Add mapping for
10343 special ARM sections.
10345 2009-06-03 Doug Kwan <dougkwan@google.com>
10347 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10348 (utils::has_overflow): Same.
10350 2009-06-03 Ian Lance Taylor <iant@google.com>
10352 * layout.cc (Layout::section_name_mapping): New array, replacing
10353 Layout::linkonce_mapping.
10354 (Layout::section_name_mapping_count): New variable, replacing
10355 Layout::linkonce_mapping_count.
10356 (Layout::linkonce_output_name): Remove.
10357 (Layout::output_section_name): Rewrite.
10358 * layout.h (class Layout): Rename Linkonce_mapping to
10359 Section_name_mapping, linkonce_mapping to section_name_mapping,
10360 linkonce_mapping_count to section_name_mapping_count. Don't
10361 declare linkonce_output_name.
10363 2009-06-03 Doug Kwan <dougkwan@google.com>
10365 * gold/arm.cc (namespace utils): New.
10366 (Target_arm::reloc_is_non_pic): Define new method.
10367 (class Arm_relocate_functions): New.
10368 (Target_arm::Relocate::relocate): Handle relocation types used by
10371 2009-06-03 Ian Lance Taylor <iant@google.com>
10373 * arm.cc (Target_arm::scan::global): Use || instead of |.
10375 2009-06-02 Doug Kwan <dougkwan@google.com>
10377 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10378 issued_non_pic_error_.
10379 (class Target_arm::Scan): Declare new method check_non_pic.
10380 Define new method symbol_needs_plt_entry.
10381 Declare new data member issued_non_pic_error_.
10382 (class Target_arm::Relocate): Declare new method
10383 should_apply_static_reloc.
10384 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10385 (Target_arm::Scan::check_non_pic): Define new method.
10386 (Target_arm::Scan::local): Handle a small subset of reloc types used
10388 (Target_arm::Scan::local): Same.
10389 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10391 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10393 * incremental.cc (Incremental_inputs::report_command_line): Filter
10394 out --incremental-* options.
10396 2009-05-29 Doug Kwan <dougkwan@google.com>
10398 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10400 (class Target_arm): Update comment.
10401 (Target_arm::Target_arm): Initialize new data members GOT_,
10402 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10403 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10404 and Target_arm::rel_dyn_section.
10405 Declare new_enum Target_arm::Got_type.
10406 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10408 Update commments for member do_dynsym_value.
10409 (Target_arm::got_size, Target_arm::plt_section,
10410 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10411 new methods inside class defintion.
10412 (Target_arm::got_section): Define new method.
10413 (Target_arm::rel_dyn_section): Same.
10414 (Output_data_plt_arm): New template class.
10415 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10416 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10417 (Output_data_plt_arm::add_entry): Same.
10418 (Output_data_plt_arm::first_plt_entry): Define new
10419 static data member for PLT instruction template.
10420 (Output_data_plt_arm::plt_entry): Same.
10421 (Output_data_plt_arm::do_write): Define new method.
10422 (Target_arm::make_plt_entry): Same.
10423 (Target_arm::do_finalize_sections): Same.
10424 (Target_arm::do_dynsym_value): Same.
10426 2009-05-28 Doug Kwan <dougkwan@google.com>
10428 * Makefile.am (TARGETSOURCES): Add arm.cc.
10429 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10430 * Makefile.in: Regenerate.
10431 * arm.cc: New file.
10432 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10434 2009-05-26 Doug Kwan <dougkwan@google.com>
10436 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10437 (General_options::check_excluded_libs): Strip off directories in
10438 archive name before matching like GNU ld does.
10439 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10440 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10441 (exclude_libs_test_LDFLAGS): Add linker option
10442 -Wl,--exclude-libs,libexclude_libs_test_3
10443 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10444 an explicit archive without using -l.
10445 (alt/libexclude_libs_test_3.a): New make rule.
10446 * testsuite/Makefile.in: Regenerate.
10447 * testsuite/exclude_libs_test.c : Declare lib3_default().
10449 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10450 * exclude_libs_test_3.c: New file.
10452 2009-05-26 Nick Clifton <nickc@redhat.com>
10454 * po/id.po: New Indonesian translation.
10455 * po/gold.pot: Updated template file.
10457 2009-05-22 Sriraman Tallam <tmsriram@google.com>
10459 * testsuite/Makefile.am: Add -ffunction-sections to compile
10460 gc_comdat_test files. Add -Wl,--gc-sections to build
10462 * testsuite/Makefile.in: Regenerate.
10463 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10465 2009-05-21 Sriraman Tallam <tmsriram@google.com>
10467 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10468 kept comdat section was garbage collected.
10469 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10470 * testsuite/Makefile.in: Regenerate.
10471 * testsuite/gc_comdat_test.sh: New file.
10472 * testsuite/gc_comdat_test_1.cc: New file.
10473 * testsuite/gc_comdat_test_2.cc: New file.
10475 2009-05-19 Doug Kwan <dougkwan@google.com>
10477 * archive.cc (Archive::Archive): Move constructor from archive.h
10478 to here. Initialize no_export_.
10479 (Archive::get_elf_object_for_member): Set no_export flag of object.
10480 * archive.h (Archive::Archive): Move constructor body to
10482 (Archive::no_export): New method.
10483 (Archive::no_export_): New field.
10484 * object.h (Object::Object): Initialize no_export_ to false.
10485 (Object::no_export, Object::set_no_export): New methods.
10486 (Object::no_export_): New field.
10487 * options.cc (General_options::parse_exclude_libs): New method.
10488 (General_options::check_excluded_libs) Same.
10489 * options.h (exclude_libs): New option.
10490 (General_options::check_excluded_libs): New method declaration.
10491 (General_options::excluded_libs_): New field.
10492 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10493 default or protected visibility if an object has no-export flag set.
10494 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10495 (check_SCRIPTS): Add exclude_libs_test.sh.
10496 (check_DATA): Add exclude_libs_test.syms.
10497 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10498 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10499 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10500 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10501 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10502 libexclude_libs_test_2.a): New rules.
10503 * testsuite/Makefile.in: Regenerate.
10504 * testsuite/exclude_libs_test.c: New file.
10505 * testsuite/exclude_libs_test.sh: Ditto.
10506 * testsuite/exclude_libs_test_1.c: Ditto.
10507 * testsuite/exclude_libs_test_2.c: Ditto.
10509 2009-05-15 Ian Lance Taylor <iant@google.com>
10511 * configure.ac: Check for declarations for cases where libiberty.h
10512 checks HAVE_DECL_xxx.
10513 * configure, config.in: Rebuild.
10515 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10517 * gold.h (Incremental_argument_list): Remove (invalid) forward
10519 * incremental.cc (Incremental_inputs::report_achive): New method.
10520 (Incremental_inputs::report_object): New method.
10521 (Incremental_inputs::report_script): New method.
10522 (Incremental_inputs::finalize_inputs): New method.
10523 (Incremental_inputs::finalize): Call finalize_inputs().
10524 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10525 Create inputs entries.
10526 * incremental.h (Incremental_input_type): New enum.
10527 (Incremental_inputs::Incremental_input): Initialize new fields.
10528 (Incremental_inputs::report_inputs): New method.
10529 (Incremental_inputs::report_achive): New method.
10530 (Incremental_inputs::report_object): New method.
10531 (Incremental_inputs::report_script): New method.
10532 (Incremental_inputs::finalize_inputs): New method.
10533 (Incremental_inputs::Input_info): New struct.
10534 (Incremental_inputs::Input_info_map): New typedef.
10535 (Incremental_inputs::lock_): New field.
10536 (Incremental_inputs::Inputs_): New field.
10537 (Incremental_inputs::Inputs_map): New field.
10538 * main.cc (main): Call Incremental_input::report_inputs.
10539 * options.h (Input_argument_list): Typedef moved from
10541 (Input_file_group::Files): Remove, use ::Input_argument_list.
10542 (Input_file_group::Input_argument_list): Remove, use
10543 ::Input_argument_list.
10544 * plugin.cc (Plugin_manager::add_input_file): Add error in
10546 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10548 * script.cc (read_input_script): Call
10549 Incremental_input::report_script.
10550 * script.h (Script_info): New class.
10552 2009-04-27 Ian Lance Taylor <iant@google.com>
10554 * x86_64.cc (do_adjust_output_section): Set entsize to
10557 2009-04-23 Elliott Hughes <enh@google.com>
10559 * output.cc (Output_file::close): After short writes, continue
10560 writing from the correct offset in the buffer being written.
10562 2009-04-23 Chris Demetriou <cgd@google.com>
10564 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10565 * configure: Regenerate.
10566 * config.in: Regenerate.
10567 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10568 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10570 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10572 * incremental.cc (Incremental_inputs_header_data): Renamed from
10573 Incremental_input_header_data.
10574 (Incremental_inputs_header_data::data_size): New field.
10575 (Incremental_inputs_header_data::put_input_file_count): Renamed
10576 from input_file_count.
10577 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10578 from command_line_offset.
10579 (Incremental_inputs_header_data::put_reserved): Renamed from
10581 (Incremental_inputs_entry_data): Renamed from
10582 Incremental_input_entry_data.
10583 (Incremental_inputs_entry_data::data_size): New field.
10584 (Incremental_inputs::report_command_line): New method.
10585 (Incremental_inputs::finalize): New method.
10586 (Incremental_inputs::create_incremental_inputs_data): New method.
10587 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10588 * incremental.h: New file.
10589 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10590 (Layout::finalize): Create incremental inputs section in
10591 incremental builds.
10592 (Layout::create_incremental_info_sections): New method.
10593 * layout.h (Layout::incremental_inputs): New method.
10594 (Layout::create_incremental_info_sections): New method.
10595 (Layout::incremental_inputs_): New field.
10596 * main.cc (main): Notify Incremental_input of the command line.
10598 2009-04-01 Ian Lance Taylor <iant@google.com>
10599 Mikolaj Zalewski <mikolajz@google.com>
10601 * gold.h (reserve_unordered_map): Define, three versions, one for
10602 each version of Unordered_map.
10603 * layout.cc (Layout::Layout): Remove options parameter. Add
10604 number_of_input_files parameter. Don't initialize options_.
10605 Initialize number_of_input_files_ and resized_signatures_. Move
10606 sections_are_attached_.
10607 (Layout::layout_group): Reserve space for group_signatures_.
10608 (Layout::find_or_add_kept_section): Change name parameter to be a
10609 reference. Resize signatures_ map when it gets large enough.
10610 (Layout::layout_eh_frame): Use parameters->options() instead of
10612 (Layout::make_output_section): Likewise.
10613 (Layout::attach_allocated_section_to_segment): Likewise.
10614 (Layout::finalize, Layout::create_executable_stack): Likewise.
10615 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10616 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10617 * layout.h (class Layout): Update declarations. Remove options_
10618 field. Add number_of_input_files_ and resized_signatures_
10619 fields. Move sections_are_attached_ field.
10620 * main.cc (main): Pass number of input files to Layout
10621 constructor. Don't pass options.
10623 2009-03-30 Ian Lance Taylor <iant@google.com>
10625 * ffsll.c (ffsll): Correct implementation.
10627 2009-03-27 Ian Lance Taylor <iant@google.com>
10629 * ffsll.c: New file.
10630 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10631 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10632 * ftruncate.c (ftruncate): Declare before definition.
10633 * mremap.c (mremap): Likewise.
10634 * pread.c (pread): Likewise.
10635 * configure, Makefile.in, config.in: Rebuild.
10637 * mremap.c: New file.
10638 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10639 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10640 (mremap): Declare if HAVE_MREMAP is not defined.
10641 * configure, Makefile.in, config.in: Rebuild.
10643 2009-03-27 Cary Coutant <ccoutant@google.com>
10645 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10646 position independent.
10647 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10648 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10650 2009-03-24 Cary Coutant <ccoutant@google.com>
10652 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10654 (needs_dynamic_reloc): Likewise.
10656 2009-03-24 Ian Lance Taylor <iant@google.com>
10658 * yyscript.y (file_cmd): Recognize EXTERN.
10659 (extern_name_list, extern_name_list_body): New nonterminals.
10660 * script.cc (script_add_extern): Define.
10661 * script-c.h (script_add_extern): Declare.
10663 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
10665 * object.cc (is_elf_object): Define.
10666 * object.h (is_elf_object): Declare.
10667 * archive.cc (Archive::get_elf_object_for_member): Call
10669 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
10671 2009-03-24 Elliott Hughes <enh@google.com>
10673 * output.cc (Output_file::map_anonymous): Define.
10674 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10675 try an anonymous one. Report the size if the mmap fails.
10676 * output.h (class Output_file): Declare map_anonymous.
10678 2009-03-24 Ian Lance Taylor <iant@google.com>
10680 * target-select.cc (instantiate_target): Don't acquire the lock if
10681 the instantiated_target_ field has already been set.
10683 2009-03-23 Ian Lance Taylor <iant@google.com>
10685 * gold-threads.h (class Initialize_lock): Define.
10686 * gold-threads.cc (class Initialize_lock_once): Define.
10687 (initialize_lock_control): New static variable.
10688 (initialize_lock_pointer): New static variable.
10689 (initialize_lock_once): New static function.
10690 (Initialize_lock::Initialize_lock): Define.
10691 (Initialize_lock::initialize): Define.
10692 * target-select.h: Include "gold-threads.h".
10693 (class Target_selector): Add lock_ and initialize_lock_ fields.
10694 Don't define instantiate_target, just declare it.
10695 * target-select.cc (Target_selector::Target_selector): Initialize
10697 (Target_selector::instantiate_target): Define.
10698 * descriptors.h: Include "gold-threads.h".
10699 (class Descriptors): Add initialize_lock_ field.
10700 * descriptors.cc (Descriptors::Descriptors): Initialize new
10702 (Descriptors::open): Use initialize_lock_ field
10703 * errors.h (class Errors): Add initialize_lock_ field.
10704 * errors.cc (Errors::Errors): Initialize new field.
10705 (Errors::initialize_lock): Use initialize_lock_ field.
10706 * powerpc.cc (class Target_selector_powerpc): Remove
10707 instantiated_target_ field. In do_recognize call
10708 instantiate_target rather than do_instantiate_target. In
10709 do_instantiate_target just allocate a new target.
10710 * sparc.cc (class Target_selector_sparc): Likewise.
10712 * freebsd.h: New file.
10713 * i386.cc: Include "freebsd.h".
10714 (Target_i386): Derive from Target_freebsd rather than
10716 (Target_selector_i386): Derive from Target_selector_freebsd rather
10717 than Target_selector.
10718 * x86_64.cc: Include "freebsd.h".
10719 (Target_x86_64): Derive from Target_freebsd rather than
10721 (Target_selector_x86_64): Derive from Target_selector_freebsd
10722 rather than Target_selector.
10723 * target.h (class Target): Add adjust_elf_header and
10724 do_adjust_elf_header.
10725 * output.cc (Output_file_header:: do_sized_write): Call target
10726 adjust_elf_header routine.
10727 * configure.tgt: Set targ_osabi.
10728 * configure.ac: Define GOLD_DEFAULT_OSABI.
10729 * parameters.cc (Parameters::default_target): Pass
10730 GOLD_DEFAULT_OSABI to select_target.
10731 * target-select.h (class Target_selector): Make instantiate_target
10732 protected rather than private.
10733 * Makefile.am (HFILES): Add freebsd.h.
10734 * configure, Makefile.in, config.in: Rebuild.
10736 * merge.cc (do_add_input_section): Correct pend value. Change
10737 message about last entry not being null terminated from error to
10740 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10742 * incremental.cc: New file.
10743 * Makefile.am (CCFILES): Add incremental.cc.
10744 * Makefile.in: Rebuild.
10746 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10748 * layout.cc (Layout::output_section_name): Preserve names
10749 of '.note.' sections.
10751 2009-03-19 Ian Lance Taylor <iant@google.com>
10753 * descriptors.cc (Descriptors::open): Check that the options are
10754 valid before using them.
10756 2009-03-18 Ian Lance Taylor <iant@google.com>
10758 * script-sections.h: Include <list>.
10759 (class Script_sections): Change Sections_elements from std::vector
10760 to std::list. Typedef public Elements_iterator. Add
10761 orphan_section_placement_, data_segment_align_start_, and
10762 saw_data_segment_align_ fields. Remove data_segment_align_index_
10764 * script-sections.cc (class Orphan_section_placement): New class.
10765 (class Sections_element): Add virtual functions is_relro and
10766 orphan_section_init. Remove virtual function place_orphan_here.
10767 (class Output_section_definition): Add is_relro and
10768 orphan_section_init. Remove place_orphan_here.
10769 (class Orphan_output_section): Likewise.
10770 (Script_sections::Script_sections): Update for field changes.
10771 (Script_sections::data_segment_align): Set saw_data_segment_align_
10772 and data_segment_align_start_, not data_segment_align_index.
10773 (Script_sections::data_segment_relro_end): Check
10774 saw_data_segment_align_. Use data_segment_align_start_ rather
10775 than data_segment_align_index_.
10776 (Script_sections::place_orphan): Rewrite to use
10777 Orphan_section_placement.
10779 2009-03-17 Ian Lance Taylor <iant@google.com>
10781 * archive.cc (Archive::add_symbols): Check for a version attached
10782 to the symbol name in the archive map.
10783 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10784 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10785 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10786 (ver_test_11.a): New target.
10787 * testsuite/Makefile.in: Rebuild.
10789 * configure.ac: Check for chsize and posix_fallocate. Replace
10791 * ftruncate.c: New file, from gnulib.
10792 * output.cc (posix_fallocate): Define dummy version if not
10793 HAVE_POSIX_FALLOCATE.
10794 (Output_file::map): Call posix_fallocate rather than lseek and
10796 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10797 * configure, Makefile.in, config.in: Rebuild.
10799 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
10801 * layout.h (Layout::create_note): Add section_name parameter.
10802 * layout.cc (Layout::create_note): Likewise.
10803 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
10805 2009-03-17 Ian Lance Taylor <iant@google.com>
10807 * descriptors.cc: Include "options.h".
10808 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10809 (Descriptors::open): Always use O_CLOEXEC when opening a new
10810 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10811 then set FD_CLOEXEC.
10813 * sparc.cc (class Target_sparc): Add has_got_section.
10814 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10815 make sure we have a GOT section.
10817 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10818 (Target_sparc::Scan::local): Likewise.
10819 (Target_sparc::Scan::global): Likewise.
10820 (Target_sparc::Relocate::relocate): Likewise.
10821 (Target_sparc::Relocate::relocate_tls): Likewise.
10823 * symtab.cc (Symbol_table::define_default_version): New function,
10824 broken out of add_from_object.
10825 (Symbol_table::add_from_object): Call define_default_version.
10826 (Symbol_table::define_special_symbol): Add resolve_oldsym
10827 parameter. Change all callers. If the version for a symbol comes
10828 from a version script, resolve it with the symbol with the same
10829 name with no version. Also add the symbol without a version if
10831 (do_define_in_output_data): If resolving with oldsym, don't delete
10833 (do_define_in_output_segment): Likewise.
10834 (do_define_as_constant): Likewise.
10835 * symtab.h (class Symbol_table): Update declarations.
10837 2009-03-13 Ian Lance Taylor <iant@google.com>
10839 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10840 (Read_symbols::requeue): New function.
10841 (Read_symbols::do_read_symbols): If make_elf_object fails because
10842 the target type is not configured, and the file was searched for,
10843 issue a warning and retry with the next directory.
10844 (Add_symbols::run): If the file has an incompatible format, and
10845 it was searched for, requeue the Read_symbols task. On error,
10846 release the object.
10847 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10848 dirindex parameter to constructor. Change all callers. Declare
10849 incompatible_warning and requeue.
10850 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10851 input_argument_ and input_group_ fields. Add them to
10852 constructor. Change all callers.
10853 (class Read_script): Add dirindex_ field. Add it to constructor.
10854 Change all callers.
10855 * archive.cc (Archive::setup): Remove input_objects parameter.
10856 Change all callers.
10857 (Archive::get_file_and_offset): Likewise.
10858 (Archive::read_all_symbols): Likewise.
10859 (Archive::read_symbols): Likewise.
10860 (Archive::get_elf_object_for_member): Remove input_objects
10861 parameter. Add punconfigured parameter. Change all callers.
10862 (Archive::add_symbols): Change return type to bool. Check return
10863 value of include_member.
10864 (Archive::include_all_members): Likewise.
10865 (Archive::include_member): Change return type to bool. Return
10866 false if first included object has incompatible target. Set
10867 included_member_ field.
10868 (Add_archive_symbols::run): If add_symbols returns false, requeue
10870 * archive.h (class Archive): Add included_member_ field.
10871 Initialize it in constructor. Add input_file and searched_for
10872 methods. Update declarations.
10873 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10874 input_argument_ fields. Add them to constructor. Change all
10876 * script.cc: Include "target-select.h".
10877 (class Parser_closure): Add skip_on_incompatible_target_ and
10878 found_incompatible_target_ fields. Add
10879 skip_on_incompatible_target parameter to constructor. Change all
10880 callers. Add methods skip_on_incompatible_target,
10881 clear_skip_on_incompatible_target, found_incompatible_target, and
10882 set_found_incompatible_target.
10883 (read_input_script): Add dirindex parameter. Change all callers.
10884 If parser finds an incompatible target, requeue Read_symbols
10886 (script_set_symbol): Clear skip_on_incompatible_target in
10888 (script_add_assertion, script_parse_option): Likewise.
10889 (script_start_sections, script_add_phdr): Likewise.
10890 (script_check_output_format): New function.
10891 * script.h (read_input_script): Update declaration.
10892 * script-c.h (script_check_output_format): Declare.
10893 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10894 (ignore_cmd): Remove OUTPUT_FORMAT.
10895 * fileread.cc (Input_file::Input_file): Add explicit this.
10896 (Input_file::will_search_for): New function.
10897 (Input_file::open): Add pindex parameter. Change all callers.
10898 * fileread.h (class Input_file): Add input_file_argument method.
10899 Declare will_search_for. Update declarations.
10900 * object.cc (make_elf_object): Add punconfigured parameter.
10901 Change all callers.
10902 * object.h (class Object): Make input_file public. Add
10903 searched_for method.
10904 (make_elf_object): Update declaration.
10905 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10907 * dirsearch.h (class Dirsearch): Update declaration.
10908 * options.h (class General_options): Add --warn-search-mismatch.
10909 * parameters.cc (Parameters::is_compatible_target): New function.
10910 * parameters.h (class Parameters): Declare is_compatible_target.
10911 * workqueue.cc (Workqueue::add_blocker): New function.
10912 * workqueue.h (class Workqueue): Declare add_blocker.
10914 * fileread.cc (Input_file::open): Remove options parameter.
10915 Change all callers.
10916 (Input_file::open_binary): Likewise.
10917 * script.cc (read_input_script): Likewise.
10918 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10919 options parameter from constructor. Change all callers.
10920 (class Read_script): Likewise.
10921 * fileread.h (class Input_file): Update declarations.
10922 * script.h (read_input_script): Update declaration.
10924 2009-03-10 Nick Clifton <nickc@redhat.com>
10926 * po/es.po: New Spanish translation.
10928 2009-03-06 Cary Coutant <ccoutant@google.com>
10930 * options.cc (parse_short_option): Keep dash_z from registering itself.
10932 2009-03-03 Ian Lance Taylor <iant@google.com>
10935 * target-reloc.h (relocate_section): Pass output_section to
10937 * i386.cc (Target_i386::should_apply_static_reloc): Add
10938 output_section parameter. Change all callers.
10939 (Target_i386::Relocate::relocate): Add output_section parameter.
10940 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10941 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10942 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10943 * testsuite/two_file_shared.sh: New script.
10944 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10945 (check_DATA): Add two_file_shared.dbg.
10946 (two_file_shared.dbg): New target.
10947 * testsuite/Makefile.in: Rebuild.
10949 2009-03-01 Ian Lance Taylor <iant@google.com>
10951 * configure.ac: Check for byteswap.h.
10952 * configure: Rebuild.
10953 * config.in: Rebuild.
10955 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10957 * layout.cc (Layout::find_or_add_kept_section): New function.
10958 (Layout::add_comdat): Removed.
10959 * layout.h (struct Kept_section): Move out of class Layout.
10960 Remove trailing underscores from field names. Add group_sections
10961 field. Rename group_ field to is_group. Change all uses.
10962 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10963 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10964 comdat_groups_ field.
10965 (Sized_relobj::include_section_group): Use
10966 find_or_add_kept_section and Kept_section::group_sections.
10967 (Sized_relobj::include_linkonce_section): Likewise.
10968 * object.cc (class Sized_relobj): Don't define Comdat_group or
10969 Comdat_group_table. Remove find_comdat_group and
10970 add_comdat_group. Remove comdat_groups_ field.
10971 * plugin.cc (include_comdat_group): Use
10972 Layout::find_or_add_kept_section.
10974 2009-02-28 Ian Lance Taylor <iant@google.com>
10976 * README: --gc-sections and map files are now supported. Document
10977 some build requirements.
10980 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10981 relocatable link set the value of the section symbol to zero.
10982 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10983 relocatable link don't include the section address in the local
10986 2009-02-27 Ian Lance Taylor <iant@google.com>
10989 * options.h (class Search_directory): Add is_system_directory.
10990 (class General_options): Declare is_in_system_directory.
10991 * options.cc (get_relative_sysroot): Make static.
10992 (get_default_sysroot): Make static.
10993 (General_optoins::is_in_system_directory): New function.
10994 * fileread.cc (Input_file::is_in_system_directory): New function.
10995 * fileread.h (class Input_file): Declare is_in_system_directory.
10996 * object.h (class Object): Add is_in_system_directory.
10997 (class Input_objects): Remove system_library_directory_ field.
10998 * object.cc (Input_objects::add_object): Don't set
10999 system_library_directory_.
11000 (input_objects::found_in_system_library_directory): Remove.
11001 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11002 parameter. Change all callers.
11003 (Symbol_table::sized_write_globals): Likewise.
11004 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11005 Call Object::is_in_system_directory.
11006 * symtab.h (class Symbol_table): Update declarations.
11009 * descriptors.h (Open_descriptor): Add is_on_stack field.
11010 * descriptors.cc (Descriptors::open): If the descriptor is on the
11011 top of the stack, remove it. Initialize is_on_stack field.
11012 (Descriptors::release): Only add pod to stack if it is not on the
11014 (Descriptors::close_some_descriptor): Clear stack_next and
11015 is_on_stack fields.
11018 * output.cc (Output_section::find_starting_output_address): Rename
11019 from starting_output_address; add PADDR parameter; change return
11021 * output.h (class Output_section): Declare
11022 find_starting_output_address instead of starting_output_address.
11023 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11024 section symbol for which we can't find a merge section.
11027 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11028 hidden or internal, force the symbol to be local.
11029 * resolve.cc (Symbol::override_visibility): Define.
11030 (Symbol::override_base): Use override_visibility.
11031 (Symbol_table::resolve): Likewise.
11032 (Symbol::override_base_with_special): Likewise.
11033 (Symbol_table::override_with_special): If the visibility is hidden
11034 or internal, force the symbol to be local.
11035 * symtab.h (class Symbol): Add set_visibility and
11036 override_visibility.
11037 * testsuite/ver_test_1.sh: New file.
11038 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11039 (check_DATA): Add ver_test_1.syms.
11040 (ver_test_1.syms): New target.
11041 * testsuite/Makefile.in: Rebuild.
11043 2009-02-25 Cary Coutant <ccoutant@google.com>
11045 * layout.cc (Layout::choose_output_section): Don't rename sections
11046 when using a linker script that has a SECTIONS clause.
11047 * Makefile.in: Regenerate.
11049 * testsuite/Makefile.am (script_test_5.sh): New test case.
11050 * testsuite/Makefile.in: Regenerate.
11051 * testsuite/script_test_5.cc: New file.
11052 * testsuite/script_test_5.sh: New file.
11053 * testsuite/script_test_5.t: New file.
11055 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
11057 * archive.cc (Archive::include_member): Update calls to add_symbols.
11058 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11059 the Layout argument.
11060 * dynobj.h (do_add_symbols): Add the Layout argument.
11061 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11063 * object.h (Object::add_symbols): Add the Layout argument.
11064 (Object::do_add_symbols): Add the Layout argument.
11065 (Sized_relobj::do_add_symbols): Add the Layout argument.
11066 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11067 Unify the two versions.
11068 (Add_plugin_symbols): Remove.
11069 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11070 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11071 (Add_plugin_symbols): Remove.
11072 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11073 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11074 (Add_symbols::run): Make it work with Pulginobj.
11076 2009-02-06 Ian Lance Taylor <iant@google.com>
11078 * object.cc (Sized_relobj::do_layout): Make info message start
11079 with lower case letter.
11081 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11083 * binary.cc: Fix file comment.
11085 * options.h (enum Incremental_disposition): Define.
11086 (class General_options): Add new options: --incremental,
11087 --incremental_changed, --incremental_unchanged,
11088 --incremental_unknown. Add incremental_disposition_ and
11089 implicit_incremental_ fields.
11090 (General_options::incremental_disposition): New function.
11091 (class Position_dependent_options): Add incremental_disposition
11093 (Position_dependent_options::copy_from_options): Set incremental
11095 * options.cc (General_options::parse_incremental_changed): New
11097 (General_options::parse_incremental_unchanged): New function.
11098 (General_options::parse_incremental_unknown): New function.
11099 (General_options::General_options): Initialize new fields
11100 incremental_disposition_ and implicit_incremental_.
11101 (General_options::finalize): Check for uasge of --incremental-*
11102 without --incremental.
11104 2009-02-06 Chris Demetriou <cgd@google.com>
11106 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11107 pointer and to report location as the file name associated with
11109 (gold_undefined_symbol_at_location): New function to replace the
11110 old gold_undefined_symbol functionality.
11111 * target-reloc.h (relocate_section): Update to use
11112 gold_undefined_symbol_at_location.
11113 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11114 Call gold_undefined_symbol function rather than gold_error.
11115 * errors.h (Errors::undefined_symbol): Take location as a
11116 string, rather than calculating it from a relocation.
11117 * errors.cc (Errors::fatal): Print "fatal error:" before the
11119 (Errors::error, Errors::error_at_location): Print "error: "
11120 before the formatted message.
11121 (Errors::undefined_symbol): Take location as a string, rather
11122 than calculating it from a relocation.
11123 (gold_undefined_symbol_at_location): New function akin to
11124 old gold_undefined_symbol, calculates location from relocation.
11125 (gold_undefined_symbol): Change to take only a Symbol pointer
11126 and to report location as the file name associated with the symbol.
11127 * testsuite/debug_msg.sh: Update for changed error messages.
11128 * testsuite/undef_symbol.sh: Likewise.
11130 2009-02-04 Duncan Sands <baldrick@free.fr>
11133 * reduced_debug_output.h
11134 (Output_reduced_debug_abbrev_section::failed): Use format for
11136 (Output_reduced_debug_info_section::faild): Likewise.
11138 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11140 * script.cc (Lazy_demangler): New class.
11141 (Version_script_info::get_symbol_version_helper): Demangle a
11144 2009-01-29 Cary Coutant <ccoutant@google.com>
11146 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11148 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11150 2009-01-28 Ian Lance Taylor <iant@google.com>
11152 * version.cc (version_string): Bump to 1.9.
11154 * gold.h: Include <cstring> and <stdint.h>.
11155 * version.cc: Include <cstdio>.
11156 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11158 * reduced_debug_output.cc (insert_into_vector): Rename from
11159 Insert_into_vector; change all callers. Use Swap_unaligned to
11160 avoid aliasing issue; remove union since it is unnecessary.
11162 2009-01-27 Sriraman Tallam <tmsriram@google.com>
11164 * Makefile.am (CCFILES): Add gc.cc.
11165 (HFILES): Add gc.h.
11166 * Makefile.in: Regenerate.
11167 * gold.cc (Gc_runner): New class.
11168 (queue_initial_tasks): Call garbage collection related tasks
11169 when corresponding options are invoked.
11170 (queue_middle_gc_tasks): New function.
11171 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11172 processed early before laying out sections during garbage collection.
11173 * gold.h (queue_middle_gc_tasks): New function.
11174 (is_prefix_of): Move from "layout.cc".
11175 * i386.cc (Target_i386::gc_process_relocs): New function.
11176 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11177 * main.cc (main): Create object of class "Garbage_collection".
11178 * object.cc (Relobj::copy_symbols_data): New function.
11179 (Relobj::is_section_name_included): New function.
11180 (Sized_relobj::do_layout): Allow this function to be called twice
11181 during garbage collection and defer layout of section during the
11183 * object.h (Relobj::get_symbols_data): New function.
11184 (Relobj::is_section_name_included): New function.
11185 (Relobj::copy_symbols_data): New function.
11186 (Relobj::set_symbols_data): New function.
11187 (Relobj::get_relocs_data): New function.
11188 (Relobj::set_relocs_data): New function.
11189 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11190 (Relobj::gc_process_relocs): New function.
11191 (Relobj::do_gc_process_relocs): New pure virtual function.
11192 (Relobj::sd_): New data member.
11193 (Sized_relobj::is_output_section_offset_invalid): New function.
11194 (Sized_relobj::do_gc_process_relocs): New function.
11195 * options.h (General_options::gc_sections): Modify to not be a no-op.
11196 (General_options::print_gc_sections): New option.
11197 * plugin.cc (Plugin_finish::run): Remove function call to
11198 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11199 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11200 * reloc.cc (Read_relocs::run): Add task to process relocs and
11201 determine unreferenced sections when doing garbage collection.
11202 (Gc_process_relocs): New class.
11203 (Sized_relobj::do_gc_process_relocs): New function.
11204 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11205 sections that are garbage collected.
11206 * reloc.h (Gc_process_relocs): New class.
11207 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11208 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11209 symbols whose corresponding sections are garbage collected.
11210 (Symbol_table::Symbol_table): Add new parameter for the garbage
11212 (Symbol_table::gc_mark_undef_symbols): New function.
11213 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11214 (Symbol_table::gc_mark_dyn_syms): New function.
11215 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11217 (Symbol_table::add_from_object): Likewise.
11218 (Symbol_table::add_from_relobj): When building shared objects, do not
11219 treat externally visible symbols as garbage.
11220 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11221 table information for static and relocatable links.
11222 * symtab.h (Symbol_table::set_gc): New function.
11223 (Symbol_table::gc): New function.
11224 (Symbol_table::gc_mark_undef_symbols): New function.
11225 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11226 (Symbol_table::gc_mark_dyn_syms): New function.
11227 (Symbol_table::gc_): New data member.
11228 * target.h (Sized_target::gc_process_relocs): New pure virtual
11230 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11231 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11233 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11235 * options.h (General_options::gc_sections): Define as a no-op for now.
11236 (General_options::no_keep_memory): Ditto.
11237 (General_options::Bshareable): Define.
11238 * options.cc (General_options::finalize): Honor -Bshareable.
11240 2009-01-20 Andreas Schwab <schwab@suse.de>
11242 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11243 read the value in the contents, since we don't use it. Use the
11244 template endianness when writing.
11245 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11247 2009-01-19 Andreas Schwab <schwab@suse.de>
11249 * configure.tgt (powerpc64-*): Fix targ_obj.
11251 2009-01-15 Ian Lance Taylor <iant@google.com>
11253 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11254 local symbols when stripping all symbols.
11256 2009-01-14 Cary Coutant <ccoutant@google.com>
11258 * output.cc (Output_reloc): Add explicit instantiations.
11260 2009-01-14 Cary Coutant <ccoutant@google.com>
11262 * archive.cc (Archive::get_elf_object_for_member): Remove call
11263 to File_read::claim_for_plugin.
11264 * descriptors.cc (Descriptors::open): Remove reference to
11266 (Descriptors::claim_for_plugin): Remove.
11267 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11268 (Descriptors::is_claimed): Remove.
11269 (claim_descriptor_for_plugin): Remove.
11270 * fileread.cc (File_read::claim_for_plugin): Remove.
11271 * fileread.h (File_read::claim_for_plugin): Remove.
11272 (File_read::descriptor): Reopen descriptor if necessary.
11273 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11274 (Plugin_manager::all_symbols_read): Add task parameter. Change
11276 (Plugin_manager::get_input_file): New function.
11277 (Plugin_manager::release_input_file): New function.
11278 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11279 corresponding data member.
11280 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11281 and pass to base constructor. Change all callers.
11282 (get_input_file, release_input_file): New functions.
11283 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11284 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11285 (Plugin_manager::all_symbols_read): Add task parameter.
11286 (Plugin_manager::get_input_file): New function.
11287 (Plugin_manager::release_input_file): New function.
11288 (Plugin_manager::task_): New data member.
11289 (Pluginobj::Pluginobj): Add filesize parameter.
11290 (Pluginobj::filename): New function.
11291 (Pluginobj::descriptor): New function.
11292 (Pluginobj::filesize): New function.
11293 (Pluginobj::filesize_): New data member.
11294 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11295 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11296 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11298 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11299 with archive libraries.
11300 * testsuite/Makefile.in: Regenerate.
11301 * testsuite/plugin_test.c (struct sym_info): New type.
11302 (get_input_file, release_input_file): New static variables.
11303 (onload): Capture new transfer vector entries.
11304 (claim_file_hook): Stop reading at end of file according to filesize.
11305 Factor out parsing of readelf output into separate function.
11306 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11307 APIs and get the source file name from the symbol table. Convert
11308 source file name to corresponding object file name. Print info
11309 message when adding new input files.
11310 (parse_readelf_line): New function.
11311 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11312 * testsuite/plugin_test_2.sh: Likewise.
11313 * testsuite/plugin_test_3.sh: Likewise.
11314 * testsuite/plugin_test_4.sh: New test case.
11316 2009-01-07 Ian Lance Taylor <iant@google.com>
11318 * version.cc (version_string): Bump to 1.8.
11320 2008-12-23 Cary Coutant <ccoutant@google.com>
11322 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11323 * plugin.cc (Plugin_manager::finish): Rename as
11324 layout_deferred_objects. Move cleanup to separate function.
11325 (Plugin_manager::cleanup): New function.
11326 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11328 * plugin.h (Plugin_manager::finish): Rename as
11329 layout_deferred_objects.
11330 (Plugin_manager::cleanup): New function.
11331 (Plugin_manager::cleanup_done): New field.
11333 2008-12-23 Cary Coutant <ccoutant@google.com>
11335 * plugin.cc (is_visible_from_outside): New function.
11336 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11337 so we don't return "IR only" status for exported symbols or -r links.
11339 * testsuite/Makefile.am (plugin_test_3): New test case.
11340 * testsuite/Makefile.in: Regenerate.
11341 * testsuite/plugin_test_3.sh: New file.
11343 2008-12-22 Cary Coutant <ccoutant@google.com>
11345 * object.cc (Sized_relobj::layout_section): New function.
11346 (Sized_relobj::do_layout): Defer layout of input sections until after
11347 plugin has provided replacement files.
11348 (Sized_relobj::do_layout_deferred_sections): New function.
11349 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11350 (Relobj::layout_deferred_sections): New function.
11351 (Relobj::do_layout_deferred_sections): New function.
11352 (Sized_relobj::do_layout_deferred_sections): New function.
11353 (Sized_relobj::layout_section): New function.
11354 (Sized_relobj::Deferred_layout): New structure.
11355 (Sized_relobj::deferred_layout_): New field.
11356 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11357 Change all callers. Layout deferred sections.
11358 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11360 (Plugin_hook::run): Move code from do_plugin_hook inline.
11361 (Plugin_hook::do_plugin_hook): Remove.
11362 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11363 (Plugin_manager::finish): Renamed, was cleanup.
11364 (Plugin_manager::should_defer_layout): New function.
11365 (Plugin_manager::add_deferred_layout_object): New function.
11366 (Plugin_manager::Deferred_layout_list): New type.
11367 (Plugin_manager::deferred_layout_objects_): New field.
11368 (Plugin_hook::do_plugin_hook): Remove.
11370 2008-12-17 Ian Lance Taylor <iant@google.com>
11372 * options.h (class General_options): Add --no case for
11375 2008-12-16 Cary Coutant <ccoutant@google.com>
11377 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11379 (Plugin_manager::claim_file): Create plugin object even if
11380 plugin did not call the add_symbols callback.
11381 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11382 asking for more symbols than were added.
11383 * testsuite/Makefile.am (plugin_test_1): Add test case with
11385 (empty.syms): New target.
11386 * testsuite/Makefile.in: Regenerate.
11387 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11388 message. Don't call add_symbols if no globals.
11389 (all_symbols_read_hook): Don't provide replacement for empty
11392 2008-12-12 Ian Lance Taylor <iant@google.com>
11394 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11395 r_type == 0 for a local symbol with r_sym == 0.
11396 (scan_relocatable_relocs): Pass r_sym to
11397 local_non_section_strategy.
11398 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11401 * configure.ac: Update test for TLS descriptors: they are
11402 supported as of glibc 2.9.
11403 * configure: Rebuild.
11405 2008-12-11 Ian Lance Taylor <iant@google.com>
11408 * target-reloc.h (Default_scan_relocatable_relocs): For each
11409 function, map r_type == 0 to RELOC_DISCARD.
11411 2008-12-10 Cary Coutant <ccoutant@google.com>
11413 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11414 object to override a kept COMDAT group from a plugin object.
11416 2008-12-09 Ian Lance Taylor <iant@google.com>
11419 * yyscript.y (file_cmd): Handle INPUT.
11421 * testsuite/initpri1.c: Change all declarations to be full
11422 prototypes by adding void, to avoid compiler warnings.
11424 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
11426 * options.cc (General_options::parse_plugin_opt): New.
11427 (General_options::add_plugin): The argument now is just the filename.
11428 (General_options::add_plugin_option): New.
11429 * options.h (plugin_opt): New.
11430 (add_plugin): Change argument name.
11431 (add_plugin_option): New.
11432 * plugin.cc (Plugin::load): Don't parse the plugin option.
11433 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11434 (Plugin::add_option): New.
11435 (Plugin::args_): Change type.
11436 (Plugin::filename_): New.
11437 (Plugin_manager::add_plugin_option): New.
11438 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11439 * testsuite/Makefile.in: Regenerate.
11441 2008-12-05 Cary Coutant <ccoutant@google.com>
11443 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11444 Handle --strip-lto-sections option.
11445 * options.h (strip_lto_sections): New option.
11447 2008-12-01 Cary Coutant <ccoutant@google.com>
11449 * plugin.cc (ld_plugin_message): Change format parameter to const.
11450 Fix mismatch between new[] and delete.
11452 2008-11-14 Cary Coutant <ccoutant@google.com>
11454 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11457 2008-11-05 Craig Silverstein <csilvers@google.com>
11459 * options.cc (General_options::parse_dynamic_list): New function.
11460 * options.h (General_options): New flags dynamic_list,
11461 dynamic_list_data, dynamic_list_cpp_new, and
11462 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11463 (General_options::in_dynamic_list): New function.
11464 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11465 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11466 (Lex::can_continue_name): Likewise.
11468 (read_script_file): New parameter script_options.
11469 (read_dynamic_list): New function.
11470 (Script_options::define_dynamic_list): New function.
11471 (dynamic_list_keyword_parsecodes): New variable.
11472 (dynamic_list_keywords): New variable.
11473 * script.h (Script_options::define_dynamic_list): New function
11475 (read_dynamic_list): New function prototype.
11476 * symtab.cc (strprefix): New macro.
11477 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11478 dynamic_list_data, dynamic_list_cpp_new, and
11479 dynamic_list_cpp_typeinfo.
11480 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11481 (dynamic_list_expr): New rule.
11482 (dynamic_list_nodes): Likewise.
11483 (dynamic_list_node): Likewise.
11484 * testsuite/Makefile.am (dynamic_list): New test.
11485 * testsuite/Makefile.in: Regenerated.
11486 * testsuite/dynamic_list.t: New file.
11487 * testsuite/dynamic_list.sh: New file.
11489 2008-11-05 Craig Silverstein <csilvers@google.com>
11491 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11492 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11493 (t11_last): Likewise.
11494 * testsuite/ver_test_6.c (main): Likewise.
11496 2008-10-07 Cary Coutant <ccoutant@google.com>
11498 * options.c (General_options::finalize): Add check for -static and
11500 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11503 2008-10-02 Cary Coutant <ccoutant@google.com>
11505 * plugin.cc (make_sized_plugin_object): Fix conditional
11506 compilation to work when not all targets are enabled.
11508 2008-09-29 Cary Coutant <ccoutant@google.com>
11510 * archive.cc (Archive::get_file_and_offset): Use filename instead
11511 of name to get library path.
11512 (Archive::include_member): Unlock external member of a thin archive.
11514 * testsuite/Makefile.am (TEST_AR): New variable.
11515 (thin_archive_test_1): New test.
11516 (thin_archive_test_2): New test.
11517 * testsuite/Makefile.in: Regenerate.
11518 * testsuite/thin_archive_main.cc: New file.
11519 * testsuite/thin_archive_test_1.cc: New file.
11520 * testsuite/thin_archive_test_2.cc: New file.
11521 * testsuite/thin_archive_test_3.cc: New file.
11522 * testsuite/thin_archive_test_4.cc: New file.
11524 2008-09-29 Cary Coutant <ccoutant@google.com>
11526 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11527 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11529 (Sized_relobj::do_finalize_local_symbols): Likewise.
11530 (Sized_relobj::map_to_kept_section): Likewise.
11531 * object.h (Sized_relobj::invalid_address): New constant.
11532 (Sized_relobj::do_output_section_offset): Check for invalid_address
11534 * output.cc (Output_reloc::local_section_offset): Use constant
11535 invalid_address instead of -1U.
11536 (Output_reloc::get_address): Likewise.
11537 (Output_section::output_address): Change -1U to -1ULL.
11538 * output.h (Output_reloc::invalid_address): New constant.
11539 * reloc.cc (Sized_relobj::write_sections): Use constant
11540 invalid_address instead of -1U.
11541 (Sized_relobj::relocate_sections): Likewise.
11542 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11543 values for merge sections.
11544 * target-reloc.h (relocate_for_relocatable): Use constant
11545 invalid_address instead of -1U.
11547 2008-09-19 Cary Coutant <ccoutant@google.com>
11549 Add plugin functionality for link-time optimization (LTO).
11550 * configure.ac (plugins): Add --enable-plugins option.
11551 * configure: Regenerate.
11552 * config.in: Regenerate.
11553 * Makefile.am (LIBDL): New variable.
11554 (CCFILES): Add plugin.cc.
11555 (HFILES): Add plugin.h.
11556 (ldadd_var): Add LIBDL.
11557 * Makefile.in: Regenerate.
11559 * archive.cc: Include "plugin.h".
11560 (Archive::setup): Don't preread archive symbols when using a plugin.
11561 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11562 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11564 (Archive::include_member): Add symbols from plugin objects.
11565 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11566 * descriptors.cc (Descriptors::open): Check for file descriptors
11567 abandoned by plugins.
11568 (Descriptors::claim_for_plugin): New function.
11569 * descriptors.h (Descriptors::claim_for_plugin): New function.
11570 (Open_descriptor::is_claimed): New field.
11571 (claim_descriptor_for_plugin): New function.
11572 * fileread.cc (File_read::claim_for_plugin): New function.
11573 * fileread.h (File_read::claim_for_plugin): New function.
11574 (File_read::descriptor): New function.
11575 * gold.cc: Include "plugin.h".
11576 (queue_initial_tasks): Add task to call plugin hooks for generating
11578 * main.cc: Include "plugin.h".
11579 (main): Load plugin libraries.
11580 * object.h (Pluginobj): Declare.
11581 (Object::pluginobj): New function.
11582 (Object::do_pluginobj): New function.
11583 (Object::set_target): New function.
11584 * options.cc: Include "plugin.h".
11585 (General_options::parse_plugin): New function.
11586 (General_options::General_options): Initialize plugins_ field.
11587 (General_options::add_plugin): New function.
11588 * options.h (Plugin_manager): Declare.
11589 (General_options): Add --plugin option.
11590 (General_options::has_plugins): New function.
11591 (General_options::plugins): New function.
11592 (General_options::add_plugin): New function.
11593 (General_options::plugins_): New field.
11594 * plugin.cc: New file.
11595 * plugin.h: New file.
11596 * readsyms.cc: Include "plugin.h".
11597 (Read_symbols::do_read_symbols): Check for archive before checking
11598 for ELF file. Call plugin hooks to claim files.
11599 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11600 from a real object file; force override when processing replacement
11602 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11603 (Symbol::init_base_object): Likewise.
11604 (Symbol::init_base_output_data): Likewise.
11605 (Symbol::init_base_output_segment): Likewise.
11606 (Symbol::init_base_constant): Likewise.
11607 (Symbol::init_base_undefined): Likewise.
11608 (Symbol::output_section): Assert that object is not a plugin.
11609 (Symbol_table::add_from_pluginobj): New function.
11610 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11612 (Symbol_table::sized_write_globals): Likewise.
11613 (Symbol_table::add_from_pluginobj): Instantiate template.
11614 * symtab.h (Sized_pluginobj): Declare.
11615 (Symbol::in_real_elf): New function.
11616 (Symbol::set_in_real_elf): New function.
11617 (Symbol::in_real_elf_): New field.
11618 (Symbol_table::add_from_pluginobj): New function.
11620 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11621 (LIBDL): New variable.
11622 (LDADD): Add LIBDL.
11623 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11624 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11625 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11626 (MOSTLYCLEANFILES): Likewise.
11627 * testsuite/Makefile.in: Regenerate.
11628 * testsuite/plugin_test.c: New file.
11629 * testsuite/plugin_test_1.sh: New file.
11630 * testsuite/plugin_test_2.sh: New file.
11632 2008-09-16 Ian Lance Taylor <iant@google.com>
11634 * target-reloc.h (relocate_section): Check whether a symbol is
11635 defined by the ABI before reporting an undefined symbol error.
11636 * target.h (Target::is_defined_by_abi): Make parameter const.
11637 (Target::do_is_defined_by_abi): Likewise.
11638 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11639 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11640 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11641 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11642 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11643 * testsuite/Makefile.in: Rebuild.
11645 * fileread.cc (make_view): Add casts to avoid warning.
11647 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11649 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11650 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11652 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
11654 * options.h (General_options::output_is_executable): New.
11655 (General_options::output_is_pie): New.
11656 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11657 for shared libraries.
11658 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11660 2008-09-11 Chris Demetriou <cgd@google.com>
11662 * options.h (origin): New -z option.
11663 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11664 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11667 2008-09-05 Cary Coutant <ccoutant@google.com>
11669 * fileread.cc (File_read::make_view): Add check for attempt to map
11670 beyond end of file.
11672 2008-09-05 Cary Coutant <ccoutant@google.com>
11674 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11675 explicit instantiations.
11677 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11680 * options.cc (General_options::finalize): Allow undefined symbols
11681 in shlibs if linking -shared.
11684 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11685 symbols as not needing a dynsym entry.
11687 2008-08-20 Craig Silverstein <csilvers@google.com>
11689 * fileread.cc (File_read::open): Do not lock the file unless it
11690 was successfully opened.
11692 2008-08-14 Cary Coutant <ccoutant@google.com>
11694 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11695 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11696 * testsuite/tls_test.cc (struct int128): 128-bit struct
11697 for testing TLS relocs with non-zero addend.
11698 (v12): New TLS variable.
11700 (t_last): Add check for v12.
11701 * testsuite/tls_test.h (t12): New function.
11702 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11704 2008-08-13 Ian Lance Taylor <iant@google.com>
11706 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11707 set tls_segment_ or relro_segment_.
11708 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11710 * output.h (Output_section::clear_is_relro): New function.
11711 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11712 sections specially even when output_data_ is empty.
11713 (Output_segment::maximum_alignment): When first section is relro,
11714 only force alignment for PT_LOAD segments.
11715 * script.cc (script_data_segment_align): New function.
11716 (script_data_segment_relro_end): New function.
11717 * script-c.h (script_data_segment_align): Declare.
11718 (script_data_segment_relro_end): Declare.
11719 * script-sections.h (class Script_sections): Declare
11720 data_segment_align and data_segment_relro_end. Add fields
11721 segment_align_index_ and saw_relro_end_.
11722 * script-sections.cc (class Sections_element): Add set_is_relro
11723 virtual function. Add new bool* parameter to place_orphan_here.
11724 Add get_output_section virtual function.
11725 (class Output_section_definition): Add set_is_relro. Add new
11726 bool* parameter to place_orphan_here. Add get_output_section.
11727 Add is_relro_ field.
11728 (Output_section_definition::Output_section_definition): Initialize
11729 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11730 and is_relro_ fields.
11731 (Output_section_definition::place_orphan_here): Add is_relro
11733 (Output_section_definition::set_section_addresses): Set relro for
11735 (Output_section_definition::alternate_constraint): Likewise.
11736 (class Orphan_output_section): Add new bool* parameter to
11737 place_orphan_here. Add get_output_section.
11738 (Orphan_output_section::place_orphan_here): Add is_relro
11740 (Script_sections::Script_sections): Initialize
11741 data_segment_align_index_ and saw_relro_end_.
11742 (Script_sections::data_segment_align): New function.
11743 (Script_sections::data_segment_relro_end): New function.
11744 (Script_sections::place_orphan): Set or clear is_relro.
11745 (Script_sections::set_section_addresses): Force alignment of first
11747 * yyscript.y (exp): Call script_data_segment_align and
11748 script_data_segment_relro_end.
11749 * testsuite/relro_script_test.t: New file.
11750 * testsuite/relro_test.cc (using_script): Declare.
11751 (t1, t2): Test using_script.
11752 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11753 (relro_script_test_SOURCES): Define.
11754 (relro_script_test_DEPENDENCIES): Define.
11755 (relro_script_test_LDFLAGS): Define.
11756 (relro_script_test_LDADD): Define.
11757 (relro_script_test.so): New target.
11758 * testsuite/Makefile.in: Rebuild.
11760 2008-08-06 Cary Coutant <ccoutant@google.com>
11762 * archive.cc (Archive::total_archives, Archive::total_members)
11763 (Archive::total_members_loaded): New variables.
11764 (Archive::setup): Add parameter. Add option to preread
11766 (Archive::read_armap): Add counter.
11767 (Archive::get_file_and_offset): New function.
11768 (Archive::get_elf_object_for_member): New function.
11769 (Archive::read_all_symbols): New function.
11770 (Archive::read_symbols): New function.
11771 (Archive::add_symbols): Add counters.
11772 (Archive::include_all_members): Use armap to find members if it's
11774 (Archive::include_member): Skip reading symbols if already read.
11775 Factored code into Archive::get_file_and_offset and
11776 Archive::get_elf_object_for_member. Changed call to
11777 Mapfile::report_include_archive_member.
11778 (Archive::print_stats): New function.
11779 * archive.h: Declare Object and Read_symbols_data classes.
11780 (Archive::Archive): Add initializers for new members.
11781 (Archive::setup): Add parameter.
11782 (Archive::print_stats): New function.
11783 (Archive::total_archives, Archive::total_members)
11784 (Archive::total_members_loaded): New variables.
11785 (Archive::get_file_and_offset): New function.
11786 (Archive::get_elf_object_for_member): New function.
11787 (Archive::read_all_symbols): New function.
11788 (Archive::read_symbols): New function.
11789 (Archive::Archive_member): New class.
11790 (Archive::members_): New member.
11791 (Archive::num_members_): New member.
11792 * main.cc: Include archive.h.
11793 (main): Call Archive::print_stats.
11794 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11795 archive parameter; member_name is now the fully-decorated name.
11796 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11797 * options.h: (General_options): Add --preread-archive-symbols option.
11798 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11801 2008-08-04 Ian Lance Taylor <iant@google.com>
11803 * symtab.h (Symbol::use_plt_offset): New function.
11804 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11805 * powerpc.cc (Relocate::relocate): Likewise.
11806 * sparc.cc (Relocate::relocate): Likewise.
11807 * x86_64.cc (Relocate::relocate): Likewise.
11808 * testsuite/weak_plt.sh: New test.
11809 * testsuite/weak_plt_main.cc: New test.
11810 * testsuite/weak_plt_shared.cc: New test.
11811 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11812 (check_PROGRAMS): Add weak_plt.
11813 (check_DATA): Add weak_plt_shared.so.
11814 (weak_plt_main_pic.o, weak_plt): New targets.
11815 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11816 * testsuite/Makefile.in: Rebuild.
11818 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11820 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11821 * testsuite/Makefile.in: Rebuild.
11823 2008-08-04 Alan Modra <amodra@bigpond.net.au>
11825 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11826 * Makefile.in: Regenerate.
11827 * po/POTFILES.in: Regenerate.
11829 2008-07-29 Ian Lance Taylor <iant@google.com>
11831 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11832 symbols before other symbols.
11833 * testsuite/script_test_2.cc (test_addr): Declare.
11834 (test_addr_alias): Declare.
11835 (main): Check that test_addr and test_addr_alias have the right
11837 * testsuite/script_test_2.t: Define test_addr_alias and
11840 2008-07-24 Ian Lance Taylor <iant@google.com>
11843 * descriptors.cc: New file.
11844 * descriptors.h: New file.
11845 * gold-threads.h (class Hold_optional_lock): New class.
11846 * fileread.cc: Include "descriptors.h".
11847 (File_read::~File_read): Release descriptor rather than closing
11849 (File_read::open) [file]: Call open_descriptor rather than open.
11850 Set is_descriptor_opened_.
11851 (File_read::open) [memory]: Assert that descriptor is not open.
11852 (File_read::reopen_descriptor): New function.
11853 (File_read::release): Release descriptor.
11854 (File_read::do_read): Make non-const. Reopen descriptor.
11855 (File_read::read): Make non-const.
11856 (File_read::make_view): Reopen descriptor.
11857 (File_read::do_readv): Likewise.
11858 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11859 Update declarations.
11860 * layout.cc: Include "descriptors.h".
11861 (Layout::create_build_id): Use open_descriptor rather than open.
11862 * output.cc: Include "descriptors.h".
11863 (Output_file::open): Use open_descriptor rather than open.
11864 * archive.cc (Archive::const_iterator): Change Archive to be
11866 (Archive::begin, Archive::end): Make non-const.
11867 (Archive::count_members): Likewise.
11868 * archive.h (class Archive): Update declarations.
11869 * object.h (Object::read): Make non-const.
11870 * Makefile.am (CCFILES): Add descriptors.cc.
11871 (HFILES): Add descriptors.h.
11872 * Makefile.in: Rebuild.
11875 * gold.h: Always include <clocale>. Add Solaris workarounds
11876 following code in binutils/sysdep.h.
11879 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11880 this->eh_frame_hdr_ is NULL before using it.
11882 * dynobj.cc (Versions::Versions): Update comment.
11884 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11885 the base version name.
11887 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11888 array size plus one.
11889 (Stringpool_template::set_string_offsets): Subtract one from key
11890 before using it as an array index.
11891 (Stringpool_template::get_offset_with_length): Likewise.
11892 (Stringpool_template::write_to_buffer): Likewise.
11893 * stringpool.h (Stringpool_template::get_offset_from_key):
11896 2008-07-23 Ian Lance Taylor <iant@google.com>
11899 * object.h (Merged_symbol_value::value): Do our best to handle a
11903 * script.cc (Version_script_info::get_versions): Don't add empty
11904 version tag to return value.
11905 (Version_script_info::get_symbol_version_helper): Change return
11906 type to bool. Add pversion parameter. Change all callers.
11907 (script_register_vers_node): Don't require a non-NULL tag.
11908 * script.h (class Version_script_info): Update declarations.
11909 (Version_script_info::get_symbol_version): Change return type to
11910 bool. Add version parameter. Change all callers.
11911 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11912 handling. Handle an empty version from a version script.
11913 (Symbol_table::define_special_symbol): Likewise.
11914 * testsuite/ver_test_10.script: New file.
11915 * testsuite/ver_test_10.sh: New file.
11916 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11917 (check_DATA): Add ver_test_10.syms.
11918 (ver_test_10.syms, ver_test_10.so): New target.
11919 * testsuite/Makefile.in: Rebuild.
11921 2008-07-23 Simon Baldwin <simonb@google.com>
11923 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11924 to zero for undefined symbols from dynamic libraries.
11926 2008-07-23 Ian Lance Taylor <iant@google.com>
11928 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11929 Change all callers.
11930 * symtab.h (class Symbol_table): Update declaration.
11931 * testsuite/ver_test_9.cc: New file.
11932 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11933 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11934 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11935 (ver_test_9.so, ver_test_9.o): New targets.
11936 * testsuite/Makefile.in: Rebuild.
11938 2008-07-22 Ian Lance Taylor <iant@google.com>
11940 * options.h (class General_options): Define --check-sections.
11941 * layout.cc (Layout::set_segment_offsets): Handle
11944 * options.h (class General_options): Define -n/--nmagic and
11946 * options.cc (General_options::finalize): For -n/--nmagic or
11947 -N/--omagic, set -static.
11948 * layout.cc (Layout::attach_allocated_section_to_segment): If
11949 -N/--omagic, don't put read-only and read-write sections in
11950 different segments.
11951 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11952 finding a read-only segment.
11953 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11954 don't set the minimum segment alignment to the common page size,
11955 and don't set the file offset to the address modulo the page size.
11956 * script-sections.cc (Script_sections::create_segments): If
11957 -n/--omagic, don't put read-only and read-write sections in
11958 different segments.
11960 * cref.cc: New file.
11961 * cref.h: New file.
11962 * options.h (class General_options): Add --print-symbol-counts.
11963 * main.cc (main): Issue defined symbol report if requested.
11964 * archive.cc (Archive::interpret_header): Make into a const member
11966 (Archive::add_symbols): Call Input_objects::archive_start and
11968 (Archive::const_iterator): Define new class.
11969 (Archive::begin, Archive::end): New functions.
11970 (Archive::include_all_members): Rewrite to use iterator.
11971 (Archive::count_members): New function.
11972 * archive.h (class Archive): Update declarations.
11973 (Archive::filename): New function.
11974 * object.cc: Include "cref.h".
11975 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11976 (Sized_relobj::do_get_global_symbol_counts): New function.
11977 (Input_objects::add_object): Add object to cross-referencer.
11978 (Input_objects::archive_start): New function.
11979 (Input_objects::archive_stop): New function.
11980 (Input_objects::print_symbol_counts): New function.
11981 * object.h: Declare Cref and Archive.
11982 (Object::get_global_symbol_counts): New function.
11983 (Object::do_get_global_symbol_counts): New pure virtual function.
11984 (class Sized_relobj): Add defined_count_ field. Update
11986 (class Input_objects): Add cref_ field. Update constructor.
11987 Update declarations.
11988 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11990 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11992 (Sized_dynobj::do_get_global_symbol_counts): New function.
11993 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11994 defined_count_. Update declarations. Define Symbols typedef.
11995 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11996 parameter. Change all callers.
11997 (Symbol_table::add_from_dynobj): Add sympointers and defined
11998 parameters. Change all callers.
11999 * symtab.h (class Symbol_table): Update declarations.
12000 * Makefile.am (CCFILES): Add cref.cc.
12001 (HFILES): Add cref.h.
12002 * Makefile.in: Rebuild.
12004 2008-07-22 Simon Baldwin <simonb@google.com>
12006 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12007 to zero when writing undefined symbols.
12009 2008-07-22 Ian Lance Taylor <iant@google.com>
12011 * output.cc (Output_section::add_input_section): Don't try to
12012 merge empty merge sections.
12014 2008-07-21 Craig Silverstein <csilvers@google.com>
12016 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12017 Include symbol version in error message.
12019 2008-07-20 Chris Demetriou <cgd@google.com>
12021 * configure.ac (gold_cv_c_random_seed): New configured variable.
12022 (RANDOM_SEED_CFLAGS): New substituted variable.
12023 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12024 * configure: Rebuild.
12025 * Makefile.in: Likewise.
12026 * testsuite/Makefile.in: Likewise.
12028 2008-07-18 Ian Lance Taylor <iant@google.com>
12030 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12031 where we see NAME/NULL and NAME/VERSION as separate symbols.
12032 * testsuite/ver_test_main.cc (main): Call t4.
12033 (t4, t4_2a): Define.
12034 * testsuite/ver_test_2.cc (t4_2): Define.
12035 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12036 * testsuite/ver_test_4.cc (t4_2a): Define.
12037 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12038 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12040 2008-07-17 Ian Lance Taylor <iant@google.com>
12042 * dynobj.cc (Versions::add_def): If we give an error about a
12043 missing version, go ahead and create the version anyhow.
12045 2008-07-10 Ian Lance Taylor <iant@google.com>
12047 Handle output sections with more than 0x7fffffff bytes.
12048 * object.h (class Relobj): Change map_to_output_ to
12049 output_sections_, and just keep a section pointer. Change all
12050 uses. Move comdat group support to Sized_relobj.
12051 (Relobj::is_section_specially_mapped): Remove.
12052 (Relobj::output_section): Remove poff parameter. Change all
12054 (Relobj::output_section_offset): New function.
12055 (Relobj::set_section_offset): Rewrite.
12056 (Relobj::map_to_output): Remove.
12057 (Relobj::output_sections): New function.
12058 (Relobj::do_output_section_offset): New pure virtual function.
12059 (Relobj::do_set_section_offset): Likewise.
12060 (class Sized_relobj): Add section_offsets_ field. Add comdat
12061 group support from Relobj. Update declarations.
12062 (Sized_relobj::get_output_section_offset): New function.
12063 (Sized_relobj::do_output_section_offset): New function.
12064 (Sized_relobj::do_set_section_offset): New function.
12065 * object.cc (Relobj::output_section_address): Remove.
12066 (Sized_relobj::Sized_relobj): Initialize new fields.
12067 (Sized_relobj::include_section_group): Cast find_kept_object to
12069 (Sized_relobj::include_linkonce_section): Likewise.
12070 (Sized_relobj::do_layout): Use separate arrays for output section
12072 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12074 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12075 output_sections and section_offsets.
12076 (Sized_relobj::write_local_symbols): Likewise.
12077 (map_to_kept_section): Compute output address directly.
12078 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12079 output_sections and section_offsets.
12080 (Sized_relobj::write_sections): Likewise.
12081 (Sized_relobj::relocate_sections): Likewise.
12082 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12083 * output.h (class Output_reloc): Update declarations. Change
12084 u2_.relobj to Sized_relobj*.
12085 (class Output_data_reloc): Change add functions to use
12087 * output.cc (Output_reloc::Output_reloc): Change relobj to
12089 (Output_reloc::local_section_offset): Change return type to
12090 Elf_Addr. Use get_output_section_offset.
12091 (Output_reloc::get_address): Likewise.
12092 (Output_section::is_input_address_mapped): Don't call
12093 is_section_specially_mapped.
12094 (Output_section::output_offset): Likewise.
12095 (Output_section::output_address): Likewise.
12096 (Output_section::starting_output_address): Likewise.
12097 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12098 parameter to Sized_relobj*.
12099 (Copy_relocs::need_copy_reloc): Likewise.
12100 (Copy_relocs::save): Likewise.
12101 * copy-relocs.h (class Copy_relocs): Update declarations.
12102 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12103 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12104 * target-reloc.h (relocate_for_relocatable): Change
12105 offset_in_output_section type to Elf_Addr. Change code that uses
12107 * layout.cc (Layout::layout): Always set *off.
12108 * mapfile.cc (Mapfile::print_input_section): Use
12109 output_section_offset.
12110 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12112 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12113 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12114 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12116 2008-07-03 Ian Lance Taylor <iant@google.com>
12118 * layout.cc (Layout::include_section): Do not discard unrecognized
12119 SHT_STRTAB sections.
12121 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12123 * script.cc (Lex::can_continue_name): Make '?' allowable in
12124 version-script names.
12125 * testsuite/version_script.map: Change glob pattern to use '?'
12127 2008-06-30 Manish Singh <yosh@gimp.org>
12130 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12133 2008-06-30 Ian Lance Taylor <iant@google.com>
12137 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12138 versions]: Don't try to read the value in the contents, since we
12139 don't use it. Use the template endianness when writing.
12141 2008-06-25 Cary Coutant <ccoutant@google.com>
12143 * fileread.cc (File_read::make_view): Assert on zero-length view.
12144 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12145 symbol table when there are no symbols to read.
12147 2008-06-23 Craig Silverstein <csilvers@google.com>
12149 * version.cc (version_string): Bump to 1.7
12151 2008-06-18 Craig Silverstein <csilvers@google.com>
12153 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12154 constant 0xFFFF to type Valtype.
12155 (Powerpc_relocate_functions::rel16_ha): Likewise.
12157 2008-06-17 Ian Lance Taylor <iant@google.com>
12159 * output.h (Output_section::Input_section): Initialize p2align_ to
12160 zero for Output_section_data constructors.
12161 (Output_section::Input_section::addralign): If not an input
12162 section, return the alignment of the Output_section_data.
12163 * testsuite/copy_test.cc: New file.
12164 * testsuite/copy_test_1.cc: New file.
12165 * testsuite/copy_test_2.cc: New file.
12166 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12167 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12168 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12169 (copy_test_1_pic.o, copy_test_1.so): New targets.
12170 (copy_test_2_pic.o, copy_test_2.so): New targets.
12171 * testsuite/Makefile.in: Rebuild.
12173 * script-sections.cc (Script_sections::place_orphan): Initialize
12174 local variable exact.
12176 2008-06-13 David Edelsohn <edelsohn@gnu.org>
12178 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12180 2008-06-12 David Edelsohn <edelsohn@gnu.org>
12181 David S. Miller <davem@davemloft.net>
12183 * powerpc.cc: New file.
12184 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12185 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12186 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12187 * Makefile.in: Rebuild.
12189 2008-06-09 Ian Lance Taylor <iant@google.com>
12191 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12193 (throwing, orig_terminate): New static variables.
12194 (terminate_handler): New static function.
12195 (t2): Set terminate handler.
12197 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12200 * binary.cc (Binary_to_elf::sized_convert): Fix .data
12203 2008-05-30 Cary Coutant <ccoutant@google.com>
12205 * archive.cc (Archive::include_all_members) Correct to step
12206 over symbol table and extended name table in thin archives.
12208 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12211 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12214 2008-05-28 Caleb Howe <cshowe@google.com>
12216 * reduced_debug_output.cc: New file.
12217 * reduced_debug_output.h: New file.
12218 * options.h (class General_options): Add --strip-debug-non-line.
12219 * options.cc (General_options::finalize): Add strip_debug_non_line
12220 to the strip heirarchy.
12221 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12223 * layout.cc: Include "reduced_debug_output.h".
12224 (Layout::Layout): Initialize new fields.
12225 (line_only_debug_sections): New static array.
12226 (is_lines_only_debug_sections): New static inline function.
12227 (Layout::include_section): Handle --strip-debug-non-line.
12228 (Layout::make_output_section): If --strip-debug-non-line, build
12229 new output sections for .debug_abbrev and .debug_info.
12230 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12231 gold. Warn about possible overflow.
12232 (read_signed_LEB_128): Likewise.
12233 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12234 (read_signed_LEB_128): Declare.
12235 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12236 (HFILES): Add reduced_debug_output.h.
12237 * Makefile.in: Rebuild.
12239 2008-05-21 Ian Lance Taylor <iant@google.com>
12241 * mapfile.cc: New file.
12242 * mapfile.h: New file.
12243 * options.h (class General_options): Add -M/--print-map and -Map.
12244 * options.cc (General_options::finalize): Make -M equivalent to
12246 * main.cc: Include <cstdio> and "mapfile.h".
12247 (main): Open mapfile if requested.
12248 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12249 constructor. Change caller.
12250 (queue_initial_tasks): Add mapfile parameter. Change caller.
12251 (queue_middle_tasks): Likewise.
12252 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12254 * archive.cc: Include "mapfile.h".
12255 (Archive::add_symbols): Add mapfile parameter. Change all
12256 callers. Pass mapfile, symbol, and reason to include_member.
12257 (Archive::include_all_members): Add mapfile parameter. Change all
12259 (Archive::include_member): Add mapfile, sym, and why parameters.
12260 Change all callers. Report inclusion to map file.
12261 * archive.h: Include "fileread.h".
12262 (class Archive): Update declarations.
12263 (Archive::file): New const method.
12264 (class Add_archive_symbols): Add mapfile_ field. Update
12265 constructor. Change all callers.
12266 * readsyms.h (class Read_symbols): Likewise.
12267 (class Finish_group): Likewise.
12268 (class Read_script): Likewise.
12269 * common.cc: Include "mapfile.h".
12270 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12272 (Symbol_table::do_allocate_commons): Likewise.
12273 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12274 symbol allocation to mapfile.
12275 * common.h (class Allocate_commons_task): Add mapfile_ field.
12276 Update constructor. Change all callers.
12277 * symtab.h (class Symbol_table): Update declarations.
12278 * layout.cc: Include "mapfile.h".
12279 (Layout_task_runner::run): Print information to mapfile.
12280 (Layout::create_gold_note): Change Output_data_fixed_space to
12281 Output_data_zero_fill.
12282 (Layout::create_build_id): Likewise.
12283 (Layout::print_to_mapfile): New function.
12284 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12285 constructor. Change caller.
12286 (class Layout): Declare print_to_mapfile.
12287 * output.cc (Output_section::Input_section::print_to_mapfile): New
12289 (Output_section::add_input_section): If producing a map, always
12290 add to input_sections_ list.
12291 (Output_section::do_print_to_mapfile): New function.
12292 (Output_segment::print_sections_to_mapfile): New function.
12293 (Output_segment::print_section_list_to_mapfile): New function.
12294 * output.h: Include "mapfile.h".
12295 (Output_data::print_to_mapfile): New function.
12296 (Output_data::do_print_to_mapfile): New virtual function.
12297 (Output_segment_headers::do_print_to_mapfile): New function.
12298 (Output_file_header::do_print_to_mapfile): New function.
12299 (Output_data_const::do_print_to_mapfile): New function.
12300 (class Output_data_const_buffer): Add map_name_ field. Update
12301 constructor. Change all callers. Add do_print_to_mapfile
12303 (class Output_data_fixed_space): Likewise.
12304 (class Output_data_space): Likewise.
12305 (class Output_data_zero_fill): New class.
12306 (Output_data_strtab::do_print_to_mapfile): New function.
12307 (Output_data_reloc_base::do_print_to_mapfile): New function.
12308 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12309 (Output_data_group::do_print_to_mapfile): New function.
12310 (Output_data_got::do_print_to_mapfile): New function.
12311 (Output_data_dynamic::do_print_to_mapfile): New function.
12312 (Output_symtab_xindex::do_print_to_mapfile): New function.
12313 (class Output_section): Declare do_print_to_mapflie. Declare
12314 print_to_mapfile in Input_section.
12315 (class Output_segment): Declare new functions.
12316 * object.h (Sized_relobj::symbol_count): New function.
12317 * script-sections.cc
12318 (Output_section_element_dot_assignment::set_section_addresses):
12319 Change Output_data_fixed_space to Output_data_zero_fill.
12320 (Output_data_expression::do_print_to_mapfile): New function.
12321 * script.cc (read_input_script): Add mapfile parameter. Change
12323 * script.h (read_input_script): Update declaration.
12324 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12325 (Eh_frame::do_print_to_mapfile): New function.
12326 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12327 (Output_merge_string::do_print_to_mapfile): New function.
12328 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12330 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12332 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12334 * Makefile.am (CCFILES): Add mapfile.cc.
12335 (HFILES): Add mapfile.h.
12336 * Makefile.in: Rebuild.
12338 2008-05-19 Ian Lance Taylor <iant@google.com>
12340 * options.h (class General_options): Add -z relro.
12341 * layout.cc (Layout::Layout): Initialize relro_segment_.
12342 (Layout::add_output_section_data): Return the output section.
12343 (Layout::make_output_section): Rcognize relro sections and mark
12344 them appropriately.
12345 (Layout::attach_allocated_section_to_segment): Put relro sections
12346 in a PT_GNU_RELRO segment.
12347 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12349 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12351 (Layout::linkonce_mapping): Map d.rel.ro.local to
12352 .data.rel.ro.local.
12353 (Layout::output_section_name): Us .data.rel.ro.local for any
12354 section which begins with that.
12355 * layout.h (class Layout): Update add_output_section_data
12356 declaration. Add relro_segment_ field.
12357 * output.cc (Output_section::Output_section): Initialize is_relro_
12358 and is_relro_local_ fields.
12359 (Output_segment::add_output_section): Group relro sections.
12360 (Output_segment::is_first_section_relro): New function.
12361 (Output_segment::maximum_alignment): If there is a relro section,
12362 align the segment to the common page size.
12363 (Output_segment::set_section_addresses): Track whether we are
12364 looking at relro sections. If the last section is a relro
12365 section, align to the common page size.
12366 (Output_segment::set_section_list_addresses): Add in_relro
12367 parameter. Change all callers. Align to the page size when
12368 moving from relro to non-relro section.
12369 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12371 * output.h (class Output_section): Add is_relro_ and
12372 is_relro_local_ fields.
12373 (Output_section::is_relro): New function.
12374 (Output_section::set_is_relro): New function.
12375 (Output_section::is_relro_local): New function.
12376 (Output_section::set_is_relro_local): New function.
12377 (class Output_segment): Update declarations.
12378 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12379 * sparc.cc (Target_sparc::got_section): Likewise.
12380 * x86_64.cc (Target_x86_64::got_section): Likewise.
12381 * testsuite/relro_test_main.cc: New file.
12382 * testsuite/relro_test.cc: New file.
12383 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12384 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12385 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12386 (relro_test.so, relro_test_pic.o): New targets.
12387 * testsuite/Makefile.in: Rebuild.
12389 2008-05-16 Ian Lance Taylor <iant@google.com>
12391 * output.cc (Output_segment::add_output_section): Remove front
12393 * output.h (class Output_segment): Remove
12394 add_initial_output_section and overloaded add_output_section.
12395 Update declaration of remaining add_output_section.
12396 * layout.cc (Layout::create_interp): Call add_output_section
12397 rather than add_initial_output_section.
12398 (Layout::finish_dynamic_section): Likewise.
12400 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12401 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12402 know the dynamic type.
12403 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12404 field. Initialize it in constructor.
12405 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12406 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12407 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12410 * output.cc (Output_reloc::get_address): Change return type to
12412 * output.h (class Output_reloc): Update get_address declaration.
12413 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12414 for section addresses.
12416 2008-05-09 Ian Lance Taylor <iant@google.com>
12419 * gold.cc (gold_nomem): Use return value of write.
12421 2008-05-08 Ian Lance Taylor <iant@google.com>
12423 * symtab.c (Symbol::init_base_output_data): Add version
12424 parameter. Change all callers.
12425 (Symbol::init_base_output_segment): Likewise.
12426 (Symbol::init_base_constant): Likewise.
12427 (Symbol::init_base_undefined): Likewise.
12428 (Sized_symbol::init_output_data): Likewise.
12429 (Sized_symbol::init_output_segment): Likewise.
12430 (Sized_symbol::init_constant): Likewise.
12431 (Sized_symbol::init_undefined): Likewise.
12432 (Symbol_table::do_define_in_output_data): If the new symbol has a
12433 version, mark it as the default.
12434 (Symbol_table::do_define_in_output_segment): Likewise.
12435 (Symbol_table::do_define_as_constant): Likewise.
12436 * symtab.h (class Symbol): Update declarations.
12437 (class Sized_symbol): Likewise.
12438 * resolve.cc (Symbol::override_version): New function.
12439 (Symbol::override_base): Call override_version.
12440 (Symbol::override_base_with_special): Likewise.
12441 * testsuite/ver_script_8.script: New file.
12442 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12443 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12444 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12445 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12447 2008-05-06 Ian Lance Taylor <iant@google.com>
12450 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12452 (class General_options): Remove existing --undefined, and add
12453 --no-undefined instead. Add new --undefined as synonym for -u.
12454 * archive.cc (Archive::add_symbols): Check whether symbol was
12456 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12457 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12458 all uses. Add IS_UNDEFINED. Update declarations to split
12459 different versions of init_base. Declare init_base_undefined.
12460 (Symbol::is_defined): Handle IS_UNDEFINED.
12461 (Symbol::is_undefined): Likewise.
12462 (Symbol::is_weak_undefined): Call is_undefined.
12463 (Symbol::is_absolute): Handle IS_CONSTANT.
12464 (class Sized_symbol): Update declarations to split different
12465 versions of init. Declare init_undefined.
12466 (class Symbol_table): Declare new functions.
12467 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12468 Change all callers.
12469 (Symbol::init_base_output_data): Likewise.
12470 (Symbol::init_base_output_segment): Likewise.
12471 (Symbol::init_base_constant): Likewise.
12472 (Symbol::init_base_undefined): New function.
12473 (Sized_symbol::init_object): Rename from init. Change all
12475 (Sized_symbol::init_output_data): Likewise.
12476 (Sized_symbol::init_output_segment): Likewise.
12477 (Sized_symbol::init_constant): Likewise.
12478 (Sized_symbol::init_undefined): New function.
12479 (Symbol_table::add_undefined_symbols_from_command_line): New
12481 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12483 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12484 (Symbol::output_section): Likewise.
12485 (Symbol::set_output_section): Likewise.
12486 (Symbol_table::sized_finalize_symbol): Likewise.
12487 (Symbol_table::sized_write_globals): Likewise.
12488 * resolve.cc (Symbol_table::should_override): Likewise.
12489 (Symbol::override_base_with_special): Likewise.
12491 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12492 symbol, change it to have default visibility.
12493 * testsuite/protected_1.cc: New file.
12494 * testsuite/protected_2.cc: New file.
12495 * testsuite/protected_3.cc: New file.
12496 * testsuite/protected_main_1.cc: New file.
12497 * testsuite/protected_main_2.cc: New file.
12498 * testsuite/protected_main_3.cc: New file.
12499 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12500 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12501 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12502 (protected_1.so): New target.
12503 (protected_1_pic.o, protected_2_pic.o): New targets.
12504 (protected_3_pic.o): New target.
12505 (check_PROGRAMS): Add protected_2.
12506 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12507 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12508 * testsuite/Makefile.in: Rebuild.
12510 * options.h (DEFINE_var): Add set_user_set_##varname__.
12511 (DEFINE_bool_alias): New macro.
12512 (class General_options): Define -Bstatic using DEFINE_bool_alias
12513 rather than DEFINE_special. Add --undefined as an alias for -z
12515 * options.cc (General_options::parse_Bstatic): Remove.
12517 * options.h (class General_options): Add --fatal-warnings.
12518 * main.cc (main): Implement --fatal-warnings.
12519 * errors.h (Errors::warning_count): New function.
12521 * options.h (class General_options): Add -Bsymbolic-functions.
12522 * symtab.h (Symbol::is_preemptible): Check for
12523 -Bsymbolic-functions.
12525 2008-05-05 Ian Lance Taylor <iant@google.com>
12527 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12528 as noVARNAME rather than no-VARNAME.
12529 (class General_options): Add option -z combreloc.
12530 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12532 (Output_reloc::sort_before) [SHT_REL]: New function.
12533 (Output_reloc::sort_before) [SHT_RELA]: New function.
12534 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12535 Sort_relocs_comparison.
12536 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12537 parameter. Change all callers.
12538 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12539 sort_relocs parameter. Change all callers.
12540 * output.cc (Output_reloc::get_address): New function, broken out
12542 (Output_reloc::write_rel): Call it.
12543 (Output_reloc::compare): New function.
12544 (Output_data_reloc_base::do_write): Optionally sort relocs.
12546 * configure.ac: If targ_extra_obj is set, link it in.
12547 * configure.tgt: Initialize all variables.
12548 (x86_64*): Set targ_extra_obj and targ_extra_size.
12549 * configure: Rebuild.
12551 * object.cc (Sized_relobj::include_section_group): Adjust section
12552 indexes read from group data. Build vector to pass to
12554 * layout.cc (Layout::layout_group): Add flags and shndxes
12555 parameters. Remove contents parameter. Change caller. Update
12556 explicit instantiations.
12557 * layout.h (class Layout): Update layout_group declaration.
12558 * output.cc (Output_data_group::Output_data_group): Add flags and
12559 input_shndxes parameters. Remove contents parameter. Change
12561 (Output_data_group::do_write): Change input_sections_ to
12563 * output.h (class Output_data_group): Update constructor
12564 declaration. Rename input_sections_ to input_shndxes_.
12565 * testsuite/many_sections_test.cc: Add template.
12567 2008-04-30 Cary Coutant <ccoutant@google.com>
12569 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12571 * layout.cc (Layout::include_section): Refactored check for debug
12573 (Layout::add_comdat): Add new parameters. Change type
12574 of signature parameter. Add object and shndx to signatures table.
12575 (Layout::find_kept_object): New function.
12576 * layout.h: Include <cstring>.
12577 (Layout::is_debug_info_section): New function.
12578 (Layout::add_comdat): Add new parameters.
12579 (Layout::find_kept_object): New function.
12580 (Layout::Kept_section): New struct.
12581 (Layout::Signatures): Change type of map range.
12582 * object.cc (Relobj::output_section_address): New function.
12583 (Sized_relobj::include_section_group): Add new parameters. Change
12584 calls to Layout::add_comdat. Change to build table of kept comdat
12585 groups and table mapping discarded sections to kept sections.
12586 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12587 (Sized_relobj::do_layout): Change calls to include_section_group and
12588 include_linkonce_section.
12589 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12590 value to zero when section is discarded.
12591 (Sized_relobj::map_to_kept_section): New function.
12592 * object.h (Relobj::output_section_address): New function.
12593 (Relobj::Comdat_group): New type.
12594 (Relobj::find_comdat_group): New function.
12595 (Relobj::Comdat_group_table): New type.
12596 (Relobj::Kept_comdat_section): New type.
12597 (Relobj::Kept_comdat_section_table): New type.
12598 (Relobj::add_comdat_group): New function.
12599 (Relobj::set_kept_comdat_section): New function.
12600 (Relobj::get_kept_comdat_section): New function.
12601 (Relobj::comdat_groups_): New field.
12602 (Relobj::kept_comdat_sections_): New field.
12603 (Symbol_value::input_value): Update comment.
12604 (Sized_relobj::map_to_kept_section) New function.
12605 (Sized_relobj::include_linkonce_section): Add new parameter.
12606 * target-reloc.h (Comdat_behavior): New type.
12607 (get_comdat_behavior): New function.
12608 (relocate_section): Add code to map a discarded section to the
12609 corresponding kept section when applying a relocation.
12611 2008-04-30 Craig Silverstein <csilvers@google.com>
12613 * dwarf_reader.cc (next_generation_count): New static var.
12614 (Addr2line_cache_entry): New struct.
12615 (addr2line_cache): New static var.
12616 (Dwarf_line_info::one_addr2line): Added caching.
12617 (Dwarf_line_info::clear_addr2line_cache): New function.
12618 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12619 cache-size parameter.
12620 (Dwarf_line_info::one_addr2line_cache): New function.
12621 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12622 new cache-size argument to one_addr2line(), and clear cache.
12624 2008-04-28 Cary Coutant <ccoutant@google.com>
12626 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12627 R_386_PC8 relocations.
12629 2008-04-23 Ian Lance Taylor <iant@google.com>
12631 * object.cc (Sized_relobj::include_section_group): Check for
12632 invalid section group.
12634 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12637 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12638 than read for file header.
12639 * archive.cc (Archive::include_member): Likewise.
12641 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
12643 * aclocal.m4: Regenerate.
12644 * configure: Regenerate.
12646 2008-04-19 Ian Lance Taylor <iant@google.com>
12648 * version.cc (version_string): Bump to 1.6.
12650 * testsuite/Makefile.am (many_sections_r_test): New target.
12651 (many_sections_r_test_SOURCES): Remove.
12652 (many_sections_r_test_DEPENDENCIES): Remove.
12653 (many_sections_r_test_LDFLAGS): Remove.
12654 (many_sections_r_test_LDADD): Remove.
12656 * object.cc (Sized_relobj::do_add_symbols): Always pass
12657 local_symbol_count_ to add_from_relobj.
12659 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12660 every thousand variables.
12661 * testsuite/Makefile.in: Rebuild.
12663 * object.cc (Xindex::initialize_symtab_xindex): New function.
12664 (Xindex::read_symtab_xindex): New function.
12665 (Xindex::sym_xindex_to_shndx): New function.
12666 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12668 (Sized_relobj::do_initialize_xindex): New function.
12669 (Sized_relobj::do_read_symbols): Adjust section links.
12670 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12671 parameter. Change all callers.
12672 (Sized_relobj::include_section_group): Adjust section links and
12673 symbol section indexes.
12674 (Sized_relobj::do_layout): Adjust section links.
12675 (Sized_relobj::do_count_local_symbols): Adjust section links and
12676 symbol section indexes.
12677 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12678 ordinary and special symbols.
12679 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12680 dynsym_xindex parameters. Change all callers. Adjust section
12681 links. Use SHN_XINDEX when needed.
12682 (Sized_relobj::get_symbol_location_info): Adjust section links.
12683 Don't get fooled by special symbols.
12684 * object.h (class Xindex): Define.
12685 (class Object): Add xindex_ parameter. Declare virtual functoin
12686 do_initialize_xindex.
12687 (Object::adjust_sym_shndx): New function.
12688 (Object::set_xindex): New protected function.
12689 (class Symbol_value): Add is_ordinary_shndx_ field.
12690 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12691 (Symbol_value::value): Assert ordinary section.
12692 (Symbol_value::initialize_input_to_output_map): Likewise.
12693 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12694 Change all callers.
12695 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12697 (class Sized_relobj): Update declarations.
12698 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12699 parameter. Change all callers.
12700 (Sized_relobj::adjust_shndx): New function.
12701 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12703 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12704 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12705 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12706 (Sized_dynobj::read_dynsym_section): Adjust section links.
12707 (Sized_dynobj::read_dynamic): Likewise.
12708 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12710 (Sized_dynobj::do_initialize_xindex): New function.
12711 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12712 do_initialize_xindex.
12713 (Sized_dynobj::adjust_shndx): New function.
12714 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12715 dynsym_xindex_ fields.
12716 (Layout::finalize): Add a call to set_section_indexes before
12717 creating the symtab sections.
12718 (Layout::set_section_indexes): Don't do anything if the section
12719 already has a section index.
12720 (Layout::create_symtab_sections): Add shnum parameter. Change
12721 caller. Create .symtab_shndx section if needed.
12722 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12724 (Layout::allocated_output_section_count): New function.
12725 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12727 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12728 fields. Update declarations.
12729 (Layout::symtab_xindex): New function.
12730 (Layout::dynsym_xindex): New function.
12731 (class Write_symbols_task): Add layout_ field.
12732 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12734 * output.cc (Output_section_headers::Output_section_headers): Add
12735 shstrtab_section parameter. Change all callers.
12736 (Output_section_headers::do_sized_write): Store overflow values
12737 for section count and section string table section index in
12738 section header zero.
12739 (Output_file_header::do_sized_write): Check for overflow of
12740 section count and section string table section index.
12741 (Output_symtab_xindex::do_write): New function.
12742 (Output_symtab_xindex::endian_do_write): New function.
12743 * output.h (class Output_section_headers): Add shstrtab_section_.
12744 Update declarations.
12745 (class Output_symtab_xindex): Define.
12746 (Output_section::has_out_shndx): New function.
12747 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12749 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12750 Change all callers.
12751 (Sized_symbol::init): Likewise.
12752 (Symbol::output_section): Check for ordinary symbol.
12753 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12754 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12756 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12757 Change all callers. Simplify handling of symbols from sections
12758 not included in the link.
12759 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12761 (Weak_alias_sorter::operator()): Assert that symbols are
12763 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12765 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12766 parameters. Change all callers.
12767 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12768 symbol distinction. Use SHN_XINDEX when needed.
12769 (Symbol_table::write_section_symbol): Add symtab_xindex
12770 parameter. Change all callers.
12771 (Symbol_table::sized_write_section_symbol): Likewise. Use
12772 SHN_XINDEX when needed.
12773 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12775 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12776 (Symbol::is_defined): Check is_ordinary.
12777 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12778 (Symbol::is_absolute, Symbol::is_common): Likewise.
12779 (class Sized_symbol): Update declarations.
12780 (class Symbol_table): Update declarations.
12781 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12782 parameters. Change all callers.
12783 (Sized_symbol::override): Likewise.
12784 (Symbol_table::override): Likewise.
12785 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12786 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12787 is_ordinary, and orig_st_shndx parameters. Change all callers.
12788 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12789 to be in an ordinary section.
12790 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12791 object and is_ordinary parameters. Change all callers.
12792 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12793 Change all callers. Don't add undefined or non-ordinary symbols
12795 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12796 Change all callers.
12797 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12799 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12800 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12801 (Sized_relobj::relocate_sections): Likewise.
12802 * target-reloc.h (scan_relocs): Adjust section symbol index.
12803 (scan_relocatable_relocs): Likewise.
12804 * i386.cc (Scan::local): Check for ordinary symbols.
12805 * sparc.cc (Scan::local): Likewise.
12806 * x86_64.cc (Scan::local): Likewise.
12807 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12808 to symbol_section_and_value.
12809 * testsuite/many_sections_test.cc: New file.
12810 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12811 (check_PROGRAMS): Add many_sections_test.
12812 (many_sections_test_SOURCES): Define.
12813 (many_sections_test_DEPENDENCIES): Define.
12814 (many_sections_test_LDFLAGS): Define.
12815 (BUILT_SOURCES): Add many_sections_define.h.
12816 (many_sections_define.h): New target.
12817 (BUILT_SOURCES): Add many_sections_check.h.
12818 (many_sections_check.h): New target.
12819 (check_PROGRAMS): Add many_sections_r_test.
12820 (many_sections_r_test_SOURCES): Define.
12821 (many_sections_r_test_DEPENDENCIES): Define.
12822 (many_sections_r_test_LDFLAGS): Define.
12823 (many_sections_r_test_LDADD): Define.
12824 (many_sections_r_test.o): New target.
12825 * testsuite/Makefile.in: Rebuild.
12827 2008-04-17 Cary Coutant <ccoutant@google.com>
12829 * errors.cc (Errors::info): New function.
12830 (gold_info): New function.
12831 * errors.h (Errors::info): New function.
12832 * gold.h (gold_info): New function.
12833 * object.cc (Input_objects::add_object): Print trace output.
12834 * options.cc (options::parse_set): New function.
12835 (General_options::parse_wrap): Deleted.
12836 (General_options::General_options): Deleted initializer.
12837 * options.h (options::String_set): New typedef.
12838 (options::parse_set): New function.
12839 (DEFINE_set): New macro.
12840 (General_options::wrap): Changed to use DEFINE_set. Changed
12841 callers of any_wrap_symbols and is_wrap_symbol.
12842 (General_options::trace, General_options::trace_symbol):
12844 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12845 (General_options::wrap_symbols_): Deleted.
12846 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12848 2008-04-17 David S. Miller <davem@davemloft.net>
12850 * options.cc (General_options::parse_V): New function.
12851 * options.h: Add entries for -V and -Qy.
12853 2008-04-17 Ian Lance Taylor <iant@google.com>
12855 * common.cc (Symbol_table::allocate_commons): Remove options
12856 parameter. Change caller.
12857 (Symbol_table::do_allocate_commons): Remove options parameter.
12858 Change caller. Just call do_allocate_commons_list twice.
12859 (Symbol_table::do_allocate_commons_list): New function, broken out
12860 of do_allocate_commons.
12861 * common.h (class Allocate_commons_task): Remove options_ field.
12862 Update constructor.
12863 * symtab.cc (Symbol_table::Symbol_table): Initialize
12865 (Symbol_table::add_from_object): Put TLS common symbols on
12867 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12868 which are IN_OUTPUT_DATA.
12869 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12870 allocate_commons and do_allocate_commons declarations. Declare
12871 do_allocate_commons_list.
12872 * gold.cc (queue_middle_tasks): Update creation of
12873 Allocate_commons_task to not pass options.
12874 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12875 (TLS_TEST_C_FLAGS): New variable.
12876 (tls_test_c_pic.o): New target.
12877 (tls_test_shared.so): Link in tls_test_c_pic.o.
12878 (tls_test_c_pic_ie.o): New target.
12879 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12880 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12881 (tls_test_c.o): New target.
12882 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12883 (tls_pic_test_LDADD): Likewise.
12884 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12885 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12886 (tls_test_c_gnu2.o): New target.
12887 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12889 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12890 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12891 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12892 * testsuite/tls_test.cc: Include "config.h".
12893 (t_last): Call t11_last.
12894 * testsuite/tls_test.h (t11, t11_last): Declare.
12895 * testsuite/tls_test_c.c: New file.
12896 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12897 * configure.ac: Check for OpenMP support.
12898 * configure, config.in, Makefile.in: Rebuild.
12899 * testsuite/Makefile.in: Rebuild.
12901 2008-04-16 Cary Coutant <ccoutant@google.com>
12903 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12904 (Target_i386::tls_base_symbol_defined_): New field.
12905 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12906 (Target_i386::Scan::global): Likewise.
12907 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12908 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12909 (Target_x86_64::tls_base_symbol_defined_): New field.
12910 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12911 (Target_x86_64::Scan::global): Likewise.
12913 2008-04-16 Cary Coutant <ccoutant@google.com>
12915 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12916 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12917 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12918 building shared libraries.
12919 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12920 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12921 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12922 * testsuite/Makefile.in: Rebuild.
12923 * testsuite/weak_undef.h: New file.
12924 * testsuite/weak_undef_file1.cc: Add extra test cases.
12925 * testsuite/weak_undef_file2.cc: Likewise.
12926 * testsuite/weak_undef_test.cc: Likewise.
12928 2008-04-16 David S. Miller <davem@davemloft.net>
12930 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12931 Add issued_non_pic_error_ field. Declare check_non_pic.
12932 (Target_sparc::Scan::check_non_pic): New function.
12933 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12934 (Target_sparc::Scan::global): Likewise.
12936 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12937 * configure: Rebuild.
12939 * options.h (DEFINE_enable): New macro.
12940 (new_dtags): New enable option.
12941 (initfirst, interpose, loadfltr, nodefaultlib,
12942 nodelete, nodlopen, nodump): New -z options.
12943 * layout.cc (Layout:finish_dynamic_section): If new
12944 dtags enabled, emit DT_RUNPATH. Also, emit a
12945 DT_FLAGS_1 containing any specified -z flags.
12947 2008-04-16 Ian Lance Taylor <iant@google.com>
12949 * copy-relocs.cc: New file.
12950 * copy-relocs.h: New file.
12951 * reloc.cc: Remove Copy_relocs code.
12952 * reloc.h: Likewise.
12953 * reloc-types.h (struct Reloc_types) [both versions]: Add
12954 get_reloc_addend_noerror.
12955 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12956 variants of add_global which take an addend which must be zero.
12957 * i386.cc: Include "copy-relocs.h".
12958 (class Target_i386): Change type of copy_relocs_ to variable,
12959 update initializer.
12960 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12961 Change all callers.
12962 (Target_i386::do_finalize_sections): Change handling of
12964 * sparc.cc: Include "copy-relocs.h".
12965 (class Target_sparc): Change type of copy_relocs_ to variable,
12966 update initializer.
12967 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12968 Change all callers.
12969 (Target_sparc::do_finalize_sections): Change handling of
12971 * x86_64.cc: Include "copy-relocs.h".
12972 (class Target_x86_64): Change type of copy_relocs_ to variable,
12973 update initializer.
12974 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12975 class. Change all callers.
12976 (Target_x86_64::do_finalize_sections): Change handling of
12978 * Makefile.am (CCFILES): Add copy-relocs.cc.
12979 (HFILES): Add copy-relocs.h.
12981 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12983 * testsuite/script_test_4.sh: Permit leading zeroes.
12985 2008-04-15 Ian Lance Taylor <iant@google.com>
12987 * script-sections.cc (Script_sections::create_segments): Use
12988 header_size_adjustment even when there is enough room for the
12990 * testsuite/script_test_4.sh: New file.
12991 * testsuite/script_test_4.t: New file.
12992 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12993 (check_DATA): Add script_test_4.stdout.
12994 (MOSTLYCLEANFILES): Likewise.
12995 (script_test_4): New target.
12996 (script_test_4.stdout): New target.
12997 * testsuite/Makefile.in: Rebuild.
12999 * sparc.cc: Add definitions for Output_data_plt_sparc class
13002 2008-04-14 David S. Miller <davem@davemloft.net>
13004 * sparc.cc: New file.
13005 * Makefile.am (TARGETSOURCES): Add sparc.cc
13006 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13007 * configure.tgt: Document targ_extra_size and
13008 targ_extra_big_endian. Add entries for sparc-* and
13010 * configure.ac: Handle targ_extra_size and
13011 targ_extra_big_endian.
13012 * Makefile.in: Rebuild.
13013 * configure: Likewise.
13014 * po/POTFILES.in: Likewise.
13015 * po/gold.pot: Likewise.
13017 2008-04-14 Ian Lance Taylor <iant@google.com>
13019 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13020 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13021 in the name/type/flags to section mapping. Don't call
13022 allocate_output_section.
13023 (Layout::choose_output_section): Change parameter from adjust_name
13024 to is_input_section. Don't permit input sections after sections
13025 are attached to segments. Don't call allocate_output_section.
13026 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13027 not write_enable_output_section.
13028 (Layout::make_output_section): Don't push to
13029 unattached_section_list_ nor call attach_to_segment. Call
13030 attach_section_to_segment if sections are attached.
13031 (Layout::attach_sections_to_segments): New function.
13032 (Layout::attach_section_to_segment): New function.
13033 (Layout::attach_allocated_section_to_segment): Rename from
13034 attach_to_segment. Remove flags parameter.
13035 (Layout::allocate_output_section): Remove function.
13036 (Layout::write_enable_output_section): Remove function.
13037 * layout.h (class Layout): Update for above changes. Add new
13038 field sections_are_attached_.
13039 * output.h (Output_section::update_flags_for_input_section): New
13041 * output.cc (Output_section::add_input_section): Call
13042 update_flags_for_input_section.
13043 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13045 2008-04-11 Cary Coutant <ccoutant@google.com>
13047 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13048 thought unnecessary.
13049 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13051 2008-04-11 Ian Lance Taylor <iant@google.com>
13053 * output.h (class Output_section_data): Remove inline definition
13055 * output.cc (Output_section_data::set_addralign): New function.
13057 2008-04-11 Cary Coutant <ccoutant@google.com>
13059 Add support for TLS descriptors for i386 and x86_64.
13060 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13061 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13062 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13064 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13065 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13066 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13068 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13069 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13070 Fix problem with initial-exec relocations.
13071 (Target_i386::Relocate::relocate_tls): Likewise.
13072 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13074 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13075 support for section-plus-offset dynamic table entries.
13076 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13077 (Output_data_dynamic::Dynamic_entry): Add support for
13078 section-plus-offset dynamic table entries.
13079 (Output_data_dynamic::Classification): Likewise.
13080 (Output_data_dynamic::classification_): Renamed offset_.
13081 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13082 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13083 (Target_x86_64::make_plt_section): New function.
13084 (Target_x86_64::reserve_tlsdesc_entries): New function.
13085 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13086 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13087 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13088 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13089 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13090 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13091 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13092 add extra PLT entry for TLS descriptors.
13093 (Output_data_plt_x86_64::got_): New field.
13094 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13095 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13097 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13099 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13100 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13101 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13102 R_386_TLS_DESC_CALL relocations.
13103 (Target_x86_64::Scan::global): Likewise.
13104 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13105 for TLS descriptors.
13106 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13107 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13108 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13109 GD-to-IE relaxation.
13110 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13111 and TLS_DESCRIPTORS.
13112 * Makefile.in: Rebuild.
13113 * configure: Rebuild.
13114 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13115 (tls_test_shared2.so): New target.
13116 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13117 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13118 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13119 (tls_shared_gd_to_ie_test_LDADD): New variable.
13120 (tls_shared_gnu2_gd_to_ie_test): New target.
13121 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13123 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13124 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13125 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13126 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13127 (tls_shared_gnu2_test): New target.
13128 (tls_test_gnu2_shared.so): New target.
13129 (tls_shared_gnu2_test_SOURCES): New variable.
13130 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13131 (tls_shared_gnu2_test_LDFLAGS): New variable.
13132 (tls_shared_gnu2_test_LDADD): New variable.
13133 * testsuite/Makefile.in: Rebuild.
13134 * testsuite/Makefile.
13136 2008-04-11 Ian Lance Taylor <iant@google.com>
13138 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13140 * testsuite/Makefile.in: Rebuild.
13142 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13144 * testsuite/script_test_2.cc (main): Adjust test.
13146 2008-04-11 David S. Miller <davem@davemloft.net>
13147 Ian Lance Taylor <iant@google.com>
13149 * options.h (General_options): Add entries for '-Y' and
13151 * options.cc (General_options:finalize): If -Y was used, add those
13152 entries to the library path instead of the default "/lib" and
13155 2008-04-11 David S. Miller <davem@davemloft.net>
13157 * testsuite/justsyms.t: Start at 0x100.
13158 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
13159 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13161 * testsuite/script_test_2.cc: Adjust string and section length
13164 2008-04-09 Ian Lance Taylor <iant@google.com>
13167 * script-sections.cc (Sections_element::allocate_to_segment): Add
13169 (Output_section_definition::allocate_to_segment): Likewise.
13170 (Orphan_output_section::allocate_to_segment): Likewise.
13171 (Script_sections::attach_sections_using_phdrs_clause): Don't
13172 propagate non-PT_LOAD segments to orphan sections.
13173 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13174 readelf rather than objdump.
13175 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13176 .interp section and PT_INTERP segment are the same size.
13177 * testsuite/Makefile.in: Rebuild.
13179 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13180 aliases for symbols defined in the same object.
13181 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13182 (weak_alias_test_SOURCES): New variable.
13183 (weak_alias_test_DEPENDENCIES): New variable.
13184 (weak_alias_test_LDFLAGS): New variable.
13185 (weak_alias_test_LDADD): New variable.
13186 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13187 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13188 (weak_alias_test_3.o): New target.
13189 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13190 * testsuite/weak_alias_test_main.cc: New file.
13191 * testsuite/weak_alias_test_1.cc: New file.
13192 * testsuite/weak_alias_test_2.cc: New file.
13193 * testsuite/weak_alias_test_3.cc: New file.
13195 2008-04-08 Ian Lance Taylor <iant@google.com>
13197 * options.h (class General_options): Add --noinhibit-exec option.
13198 * main.cc (main): Check --noinhibit-exec.
13200 * options.h (class General_options): Define --wrap as a special
13201 option. Add wrap_symbols_ field.
13202 (General_options::any_wrap_symbols): New function.
13203 (General_options::is_wrap_symbol): New function.
13204 * options.cc (General_options::parse_wrap): New function.
13205 (General_options::General_options): Initialize wrap_symbols_.
13206 * symtab.cc (Symbol_table::wrap_symbol): New function.
13207 (Symbol_table::add_from_object): Handle --wrap.
13208 * symtab.h (class Symbol_table): Declare wrap_symbol.
13209 * target.h (Target::wrap_char): New function.
13210 (Target::Target_info): Add wrap_char field.
13211 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13212 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13213 * testsuite/testfile.cc (Target_test::test_target_info):
13216 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13219 * layout.h (class Layout): Add added_eh_frame_data_ field.
13220 * layout.cc (Layout::Layout): Initialize new field.
13221 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13222 output section until we find a section we merged successfully.
13223 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13224 that the size be non-zero.
13226 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13229 2008-04-08 Craig Silverstein <csilvers@google.com>
13231 * configure.ac: Export new conditional variable HAVE_ZLIB.
13232 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13234 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13235 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13237 2008-04-07 Ian Lance Taylor <iant@google.com>
13239 * version.cc (version_string): Set to "1.5".
13241 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13242 Add issued_non_pic_error_ field. Declare check_non_pic.
13243 (Target_x86_64::Scan::check_non_pic): New function.
13244 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13245 (Target_x86_64::Scan::global): Likewise.
13247 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13248 addend parameter. Change caller. Handle merge sections.
13249 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13250 Address to Addend. Don't add in the result of
13251 local_section_offset, pass down the addend and use the returned
13253 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13254 Update declarations of local_section_offset and symbol_value.
13255 * testsuite/two_file_test_1.cc (t18): New function.
13256 * testsuite/two_file_test_2.cc (f18): New function.
13257 * testsuite/two_file_test_main.cc (main): Call t18.
13258 * testsuite/two_file_test.h (t18, f18): Declare.
13260 * configure.ac: Don't test for objdump, c++filt, or readelf.
13261 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13263 (TEST_READELF): New variable.
13264 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13265 (check_PROGRAMS): Add two_file_strip_test.
13266 (two_file_strip_test): New target.
13267 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13268 (two_file_same_shared_strip_test_SOURCES): New variable.
13269 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13270 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13271 (two_file_same_shared_strip_test_LDADD): New variable.
13272 (two_file_shared_strip.so): New target.
13273 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13274 (ver_test_5.syms, ver_test_7.syms): Likewise.
13275 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13276 (strip_test_3.stdout): Use TEST_OBJDUMP.
13277 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13279 2008-04-04 Cary Coutant <ccoutant@google.com>
13281 * symtab.h (Symbol::is_weak_undefined): New function.
13282 (Symbol::is_strong_undefined): New function.
13283 (Symbol::is_absolute): New function.
13284 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13285 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13287 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13288 (weak_undef_test): New target.
13289 * testsuite/Makefile.in: Rebuild.
13290 * testsuite/weak_undef_file1.cc: New file.
13291 * testsuite/weak_undef_file2.cc: New file.
13292 * testsuite/weak_undef_test.cc: New file.
13294 2008-04-03 Craig Silverstein <csilvers@google.com>
13296 * compressed_output.h (class Output_compressed_section): Use
13298 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13300 (zlib_compressed_suffix): Removed.
13301 (Output_compressed_section::set_final_data_size): Use unsigned
13303 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13304 Fix linker invocation.
13305 (flagstest_o_specialfile_and_compress_debug_sections):
13307 * testsuite/Makefile.in: Regenerated.
13309 2008-04-02 David S. Miller <davem@davemloft.net>
13311 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13312 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13314 2008-04-02 Craig Silverstein <csilvers@google.com>
13318 2008-04-02 Ian Lance Taylor <iant@google.com>
13320 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13321 parameters. Update for new key type to views_. Change all
13323 (File_read::read): Adjust for byteshift in returned view.
13324 (File_read::add_view): New function, broken out of
13325 find_and_make_view.
13326 (File_read::make_view): New function, broken out of
13327 find_and_make_view.
13328 (File_read::find_or_make_view): Add offset and aligned
13329 parameters. Rewrite accordingly. Change all callers.
13330 (File_read::get_view): Add offset and aligned parameters. Adjust
13331 for byteshift in return value.
13332 (File_read::get_lasting_view): Likewise.
13333 * fileread.h (class File_read): Update declarations.
13334 (class File_read::View): Add byteshift_ field. Add byteshift to
13335 constructor. Add byteshift method.
13336 * archive.h (Archive::clear_uncached_views): New function.
13337 (Archive::get_view): Add aligned parameter. Change all callers.
13338 * object.h (Object::get_view): Add aligned parameter. Change all
13340 (Object::get_lasting_view): Likewise.
13342 * fileread.cc (File_read::release): Don't call clear_views if
13343 there are multiple objects.
13344 * fileread.h (File_read::clear_uncached_views): New function.
13345 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13348 2008-03-31 Cary Coutant <ccoutant@google.com>
13350 Add thin archive support.
13351 * archive.cc (Archive::armagt): New const.
13352 (Archive::setup): Remove task parameter and calls to unlock.
13353 (Archive::unlock_nested_archives): New function.
13354 (Archive::read_header): Add nested_off parameter. Change
13356 (Archive::interpret_header): Likewise.
13357 (Archive::include_all_members): Change to handle thin
13359 (Archive::include_member): Likewise.
13360 * archive.h (Archive::Archive): Add new parameters and
13362 (Archive::armagt): New const.
13363 (Archive::setup): Remove task parameter.
13364 (Archive::unlock_nested_archives): New function.
13365 (Archive::read_header): Add nested_off parameter.
13366 (Archive::interpret_header): Likewise.
13367 (Archive::Nested_archive_table): New typedef.
13368 (Archive::is_thin_archive_): New field.
13369 (Archive::nested_archives_): New field.
13370 (Archive::options_): New field.
13371 (Archive::dirpath_): New field.
13372 (Archive::task_): New field.
13373 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13374 for thin archives. Pass additional parameters to
13375 Archive::Archive. Unlock the archive file after calling
13378 2008-03-29 Ian Lance Taylor <iant@google.com>
13380 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13381 version symbol to be local.
13382 * testsuite/ver_test_4.sh: New file.
13383 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13384 (check_DATA): Add ver_test_4.syms.
13385 (ver_test_4.syms): New target.
13386 * testsuite/Makefile.in: Rebuild.
13389 (Output_section::Input_section_sort_entry::has_priority): New
13391 (Output_section::Input_section_sort_entry::match_file_name): New
13393 (Output_section::Input_section_sort_entry::match_section_name):
13395 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13397 (Output_section::Input_section_sort_entry::match_section_file):
13399 (Output_section::Input_section_sort_compare::operator()): Rewrite
13400 using new Input_section_sort_entry functions. Sort crtbegin and
13401 crtend first. Sort sections with no priority before sections with
13403 * testsuite/initpri1.c (d3): Check j != 4.
13404 (cd5): New constructor/destructor function.
13405 (main): Check j != 2.
13407 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13408 new symbol when resolving, don't call set_is_default.
13409 * testsuite/ver_test_7.cc: New file.
13410 * testsuite/ver_test_7.sh: New file.
13411 * testsuite/Makefile.am (ver_test_7.so): New target.
13412 (ver_test_7.o): New target.
13413 (check_SCRIPTS): Add ver_test_7.sh.
13414 (check_DATA): Add ver_test_7.syms.
13415 (ver_test_7.syms): New target.
13417 2008-03-28 Ian Lance Taylor <iant@google.com>
13419 * layout.cc (Layout::layout): If we see an input section with a
13420 name that needs sorting, set the must_sort flag for the output
13422 (Layout::make_output_section): If the name of the output section
13423 indicates that it might require sorting, set the may_sort flag.
13424 * output.h (Output_section::may_sort_attached_input_sections): New
13426 (Output_section::set_may_sort_attached_input_sections): New
13428 (Output_section::must_sort_attached_input_sections): New
13430 (Output_section::set_must_sort_attached_input_sections): New
13432 (class Output_section): Declare Input_section_sort_entry. Define
13433 Input_section_sort_compare. Declare
13434 sort_attached_input_sections. Add new fields:
13435 may_sort_attached_input_sections_,
13436 must_sort_attached_input_sections_,
13437 attached_input_sections_are_sorted_.
13438 * output.cc (Output_section::Output_section): Initialize new
13440 (Output_section::add_input_section): Add an entry to
13441 input_sections_ if may_sort or must_sort are true.
13442 (Output_section::set_final_data_size): Call
13443 sort_attached_input_sections if necessary.
13444 (Output_section::Input_section_sort_entry): Define new class.
13445 (Output_section::Input_section_sort_compare::operator()): New
13447 (Output_section::sort_attached_input_sections): New function.
13448 * configure.ac: Check whether the compiler supports constructor
13449 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13450 * testsuite/initpri1.c: New file.
13451 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13452 CONSTRUCTOR_PRIORITY.
13453 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13454 (initpri1_LDFLAGS): New variable.
13455 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13457 2008-03-27 Ian Lance Taylor <iant@google.com>
13459 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13460 * testsuite/common_test_1.c: New file.
13461 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13462 (common_test_1_SOURCES): New variable.
13463 (common_test_1_DEPENDENCIES): New variable.
13464 (common_test_1_LDFLAGS): New variable.
13466 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13467 and commons_ correctly when NAME/VERSION does not override
13469 * testsuite/ver_test_6.c: New file.
13470 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13471 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13472 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13474 2008-03-26 Ian Lance Taylor <iant@google.com>
13476 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13477 of an undefined symbol from a version script.
13478 * testsuite/Makefile.am (ver_test_5.so): New target.
13479 (ver_test_5.o): New target.
13480 (check_SCRIPTS): Add ver_test_5.sh.
13481 (check_DATA): Add ver_test_5.syms.
13482 (ver_test_5.syms): New target.
13483 * testsuite/ver_test_5.cc: New file.
13484 * testsuite/ver_test_5.script: New file.
13485 * testsuite/ver_test_5.sh: New file.
13486 * Makefile.in, testsuite/Makefile.in: Rebuild.
13489 Fix problems building gold with gcc 4.3.0.
13490 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13491 (gold_error_at_location, gold_warning_at_location): Use it.
13492 * configure.ac: Check whether we can compile and use a template
13493 function with a printf attribute.
13494 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13495 when jumping over bytes.
13496 * object.cc: Instantiate Object::read_section_data.
13497 * debug.h: Include <cstring>
13498 * dwarf_reader.cc: Include <algorithm>
13499 * main.cc: Include <cstring>.
13500 * options.cc: Include <cstring>.
13501 * output.cc: Include <cstring>.
13502 * script.cc: Include <cstring>.
13503 * script.h: Include <string>.
13504 * symtab.cc: Include <cstring> and <algorithm>.
13505 * target-select.cc: Include <cstring>.
13506 * version.cc: Include <string>.
13507 * testsuite/testmain.cc: Include <cstdlib>.
13508 * configure, config.in: Rebuild.
13510 2008-03-25 Ian Lance Taylor <iant@google.com>
13512 * options.cc: Include "../bfd/bfdver.h".
13513 (options::help): Print bug reporting address.
13515 * version.cc (print_version): Adjust output for current value of
13516 BFD_VERSION_STRING.
13520 * options.cc (options::help): Print list of supported targets.
13521 * target-select.h: Include <vector>.
13522 (class Target_selector): Make machine_, size_, and is_big_endian_
13523 fields const. Add bfd_name_ and instantiated_target_ fields.
13524 (Target_selector::Target_selector): Add bfd_name parameter.
13525 (Target_selector::recognize): Make non-virtual, call
13527 (Target_selector::recognize_by_name): Make non-virtual, call
13528 do_recognize_by_name.
13529 (Target_selector::supported_names): New function.
13530 (Target_selector::bfd_name): New function.
13531 (Target_selector::do_instantiate_target): New pure virtual
13533 (Target_selector::do_recognize): New virtual function.
13534 (Target_selector::do_recognize_by_name): New virtual function.
13535 (Target_selector::instantiate_target): New private function.
13536 (supported_target_names): Declare.
13537 * target-select.cc (Target_selector::Target_selector): Update for
13538 new parameter and fields.
13539 (select_target_by_name): Check that the name matches before
13540 calling recognize_by_name.
13541 (supported_target_names): New function.
13542 * i386.cc (class Target_selector_i386): Update Target_selector
13543 constructor call. Remove recognize and recognize_by_name. Add
13544 do_instantiate_target.
13545 * x86_64.cc (class Target_selector_x86_64): Likewise.
13546 * testsuite/testfile.cc (class Target_selector_test): Update for
13547 changes to Target_selector.
13549 * README: Rewrite, with some notes on unsupported features.
13551 2008-03-24 Cary Coutant <ccoutant@google.com>
13553 * i386.cc (Target_i386::Got_type): New enum declaration.
13554 (Target_i386::Scan::local): Updated callers of Output_data_got
13556 (Target_i386::Scan::global): Likewise.
13557 (Target_i386::Relocate::relocate): Likewise.
13558 (Target_i386::Relocate::relocate_tls): Likewise.
13559 * object.h (Got_offset_list): New class.
13560 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13561 (Sized_relobj::local_got_offset): Likewise.
13562 (Sized_relobj::set_local_got_offset): Likewise.
13563 (Sized_relobj::local_has_tls_got_offset): Removed.
13564 (Sized_relobj::local_tls_got_offset): Removed.
13565 (Sized_relobj::set_local_tls_got_offset): Removed.
13566 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13567 * output.cc (Output_data_got::add_global): Added got_type parameter.
13568 (Output_data_got::add_global_with_rel): Likewise.
13569 (Output_data_got::add_global_with_rela): Likewise.
13570 (Output_data_got::add_global_pair_with_rel): New function.
13571 (Output_data_got::add_global_pair_with_rela): New function.
13572 (Output_data_got::add_local): Added got_type parameter.
13573 (Output_data_got::add_local_with_rel): Likewise.
13574 (Output_data_got::add_local_with_rela): Likewise.
13575 (Output_data_got::add_local_pair_with_rel): New function.
13576 (Output_data_got::add_local_pair_with_rela): New function.
13577 (Output_data_got::add_global_tls): Removed.
13578 (Output_data_got::add_global_tls_with_rel): Removed.
13579 (Output_data_got::add_global_tls_with_rela): Removed.
13580 (Output_data_got::add_local_tls): Removed.
13581 (Output_data_got::add_local_tls_with_rel): Removed.
13582 (Output_data_got::add_local_tls_with_rela): Removed.
13583 * output.h (Output_data_got::add_global): Added got_type parameter.
13584 (Output_data_got::add_global_with_rel): Likewise.
13585 (Output_data_got::add_global_with_rela): Likewise.
13586 (Output_data_got::add_global_pair_with_rel): New function.
13587 (Output_data_got::add_global_pair_with_rela): New function.
13588 (Output_data_got::add_local): Added got_type parameter.
13589 (Output_data_got::add_local_with_rel): Likewise.
13590 (Output_data_got::add_local_with_rela): Likewise.
13591 (Output_data_got::add_local_pair_with_rel): New function.
13592 (Output_data_got::add_local_pair_with_rela): New function.
13593 (Output_data_got::add_global_tls): Removed.
13594 (Output_data_got::add_global_tls_with_rel): Removed.
13595 (Output_data_got::add_global_tls_with_rela): Removed.
13596 (Output_data_got::add_local_tls): Removed.
13597 (Output_data_got::add_local_tls_with_rel): Removed.
13598 (Output_data_got::add_local_tls_with_rela): Removed.
13599 * resolve.cc (Symbol::override_base_with_special): Removed
13600 reference to has_got_offset_ field.
13601 * symtab.cc (Symbol::init_fields): Replaced initialization
13602 of got_offset_ with got_offsets_. Removed initialization
13604 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
13605 (Symbol::got_offset): Likewise.
13606 (Symbol::set_got_offset): Likewise.
13607 (Symbol::has_tls_got_offset): Removed.
13608 (Symbol::tls_got_offset): Removed.
13609 (Symbol::set_tls_got_offset): Removed.
13610 (Symbol::got_offset_): Removed.
13611 (Symbol::tls_mod_got_offset_): Removed.
13612 (Symbol::tls_pair_got_offset_): Removed.
13613 (Symbol::got_offsets_): New field.
13614 (Symbol::has_got_offset): Removed.
13615 (Symbol::has_tls_mod_got_offset): Removed.
13616 (Symbol::has_tls_pair_got_offset): Removed.
13617 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13618 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13620 (Target_x86_64::Scan::global): Likewise.
13621 (Target_x86_64::Relocate::relocate): Likewise.
13622 (Target_x86_64::Relocate::relocate_tls): Likewise.
13624 2008-03-25 Ben Elliston <bje@au.ibm.com>
13626 * yyscript.y: Fix spelling error in comment.
13628 2008-03-24 Ian Lance Taylor <iant@google.com>
13630 * options.h (class General_options): Define build_id option.
13631 * layout.h (class Layout): Declare write_build_id, create_note,
13632 create_build_id. Add build_id_note_ member.
13633 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13634 "libiberty.h", "md5.h", "sha1.h".
13635 (Layout::Layout): Initialize eh_frame_data_,
13636 eh_frame_hdr_section_, and build_id_note_.
13637 (Layout::finalize): Call create_build_id.
13638 (Layout::create_note): New function, broken out of
13639 Layout::create_gold_note.
13640 (Layout::create_gold_note): Call create_note.
13641 (Layout::create_build_id): New function.
13642 (Layout::write_build_id): New function.
13643 (Close_task_runner::run): Call write_build_id.
13645 * x86_64.cc: Correct license to GPLv3.
13647 2008-03-23 Ian Lance Taylor <iant@google.com>
13649 * options.cc: Include "demangle.h".
13650 (parse_optional_string): New function.
13651 (parse_long_option): Handle takes_optional_argument.
13652 (parse_short_option): Update dash_z initializer. Handle
13653 takes_optional_argument.
13654 (General_options::General_options): Initialize do_demangle_.
13655 (General_options::finalize): Set do_demangle_. Handle demangling
13657 * options.h (parse_optional_string): Declare.
13658 (struct One_option): Add optional_arg field. Update constructor.
13659 Update call constructor calls. Add takes_optional_argument
13661 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13662 (DEFINE_optional_string): Define.
13663 (General_options::demangle): Change from DEFINE_bool to
13664 DEFINE_optional_string.
13665 (General_options::no_demangle): New function.
13666 (General_options::do_demangle): New function.
13667 (General_options::set_do_demangle): New function.
13668 (General_options::execstack_status_): Move definition to end of
13670 (General_options::static_): Likewise.
13671 (General_options::do_demangle_): New field.
13672 * object.cc (big_endian>::get_symbol_location_info): Call
13673 Options::do_demangle, not Options::demangle.
13674 * symtab.cc (demangle): Likewise.
13676 2008-03-22 Ian Lance Taylor <iant@google.com>
13678 * gold.h: Include <cstddef> and <sys/types.h>
13679 * options.h: Include <cstring>.
13681 2008-03-21 Ian Lance Taylor <iant@google.com>
13683 * Added source code to GNU binutils.