1 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
3 * Makefile.am (ZLIB): New.
5 (AM_CFLAGS): Add $(ZLIBINC).
6 (AM_CXXFLAGS): Likewise.
7 (ldadd_varldadd_var): Add $(ZLIB).
8 (incremental_dump_LDADD): Likewise.
10 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
12 (zlib_compress): Don't check HAVE_ZLIB_H.
13 (zlib_decompress): Likewise.
14 * options.h (compress_debug_sections): Likewise.
15 * configure.ac (AM_CONDITIONAL): Removed.
16 * testsuite/Makefile.am (ZLIB): New.
18 Don't check HAVE_ZLIB.
19 * Makefile.in: Regenerated.
20 * config.in: Likewise.
21 * configure: Likewise.
22 * testsuite/Makefile.in: Likewise.
24 2015-03-30 Jing Yu <jingyu@google.com>
26 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
27 TLSLD_ADD_DTPREL_LO12_NC.
28 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
29 _TLS_MODULE_BASE_ point to the start of tls segment.
30 (Target_aarch64::optimize_tls_reloc): Add cases for
31 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
32 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
33 (Target_aarch64::Scan::local): Likewise.
34 (Target_aarch64::Scan::global): Likewise.
35 (Target_aarch64::Relocate::relocate): Likewise.
36 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
37 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
40 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
42 * merge.cc (Object_merge_map::add_mapping): call
43 Object_merge_map::Input_merge_map::add_mapping.
44 (Object_merge_map::Input_merge_map::add_mapping): New.
45 (Output_merge_data::do_add_input_section): Call
46 get_or_make_input_merge_map before a loop.
47 (Output_merge_string<Char_type>::finalize_merged_data): Call
48 get_or_make_input_merge_map before a loop.
49 * merge.h (Object_merge_map): Make Input_merge_map public.
50 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
51 (Relobj::get_or_create_merge_map): New.
52 * object.h (Relobj::get_or_create_merge_map): New.
54 2015-03-24 Alan Modra <amodra@gmail.com>
57 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
58 relocation errors for branches to strong undefined symbols.
60 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
62 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
63 (Object_merge_map::is_merge_section_for): Remove.
64 (Object_merge_map::find_merge_section): New.
65 * merge.h (Object_merge_map::is_merge_section_for): Remove.
66 (Object_merge_map::find_merge_section): New.
67 (Object_merge_map::get_input_merge_map): Add a const version.
68 * object.cc (Relobj::is_merge_section_for): Remove.
69 (Relobj::find_merge_section): New.
70 * object.h (Relobj::is_merge_section_for): Remove.
71 (Relobj::find_merge_section): New.
73 (Output_section::Input_section::is_merge_section_for): Remove.
74 (Output_section::add_merge_input_section): Don't call
75 add_merge_input_section.
76 (Output_section::find_merge_section): Return const. Use
77 object->find_merge_section.
78 (Output_section::build_lookup_maps): Don't build a map for
80 (Output_section::is_input_address_mapped): Return false if
82 (Output_section::find_starting_output_address): Use
83 find_merge_section instead of is_merge_section_for.
84 (Output_section::add_script_input_section): Don't build a map for
86 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
87 (Output_section_lookup_maps::find_merge_section): Remove.
88 (Output_section_lookup_maps::add_merge_input_section) Remove.
89 (Output_section::find_merge_section): Return const.
91 2015-03-22 Cary Coutant <cary@google.com>
94 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
95 non-SIB form of lea, with nop after the call.
97 2015-03-21 Cary Coutant <cary@google.com>
100 * output.cc (Output_segment::is_first_section_relro): Don't ignore
102 (Output_segment::set_section_addresses): Don't align size of relro
105 2015-03-21 Cary Coutant <cary@google.com>
108 * stringpool.cc (Stringpool_template): Don't optimize if section
109 alignment is greater than sizeof(char).
111 2015-03-21 Cary Coutant <cary@google.com>
114 * script-c.h (script_include_directive): Add first_token parameter.
115 * script.cc (script_include_directive): Add first_token parameter, and
116 pass it to read_script_file.
117 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
118 (PARSING_MEMORY_DEF): New tokens.
119 (top): Add new productions for INCLUDE files.
120 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
121 Pass PARSING_LINKER_SCRIPT to script_include_directive.
122 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
123 (section_cmd): Pass PARSING_SECTION_CMDS.
124 (file_or_sections_cmd): Remove.
125 (memory_def): Pass PARSING_MEMORY_DEF.
126 * testsuite/Makefile.am (memory_test_2): New test.
127 * testsuite/Makefile.in: Regenerate.
128 * testsuite/memory_test_inc.t: New script file.
129 * testsuite/memory_test_inc_1.t.src: New script file.
130 * testsuite/memory_test_inc_2.t.src: New script file.
131 * testsuite/memory_test_inc_3.t.src: New script file.
133 2015-03-21 Cary Coutant <cary@google.com>
135 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
136 (Sized_relobj_dwo::setup): Build compressed section map.
137 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
138 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
140 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
141 compressed_sections_ field.
142 (build_compressed_section_map): Take Object instead of
143 Sized_relobj_file parameter; add decompress_if_needed parameter.
144 (Sized_relobj_file::do_find_special_sections): Store compressed
145 section map in parent Object.
146 (Sized_relobj_file::do_decompressed_section_contents): Move
147 implementation to Object::decompressed_section_contents.
148 (Sized_relobj_file::do_discard_decompressed_sections): Move
149 implementation to Object::discard_decompressed_sections.
150 * object.h (build_compressed_section_map): Declare.
151 (Object::Object): Add compressed_sections_ field.
152 (Object::section_is_compressed): Move implementation here.
153 (Object::decompressed_section_contents): De-virtualize.
154 (Object::discard_decompressed_sections): De-virtualize.
155 (Object::do_section_is_compressed): Delete.
156 (Object::do_decompressed_section_contents): Delete.
157 (Object::set_compressed_sections): New method.
158 (Object::compressed_sections): New method.
159 (Object::compressed_sections_): New data member.
160 (Compressed_section_info, Compressed_section_map): Move to top of file.
161 (Sized_relobj_file::do_section_is_compressed): Delete.
162 (Sized_relobj_file::do_decompressed_section_contents): Delete.
163 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
164 (Sized_relobj_file::compressed_sections_): Move to Object class.
166 2015-03-21 Cary Coutant <ccoutant@google.com>
169 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
172 2015-03-11 Cary Coutant <ccoutant@google.com>
174 * options.cc (General_options::finalize): Don't allow -z relro
175 with incremental linking.
176 * testsuite/Makefile.am (incremental_test): Add -z norelro.
177 (incremental_test_2): Likewise.
178 (incremental_test_3): Likewise.
179 (incremental_test_4): Likewise.
180 (incremental_test_5): Likewise.
181 (incremental_test_6): Likewise.
182 (incremental_copy_test): Likewise.
183 (incremental_common_test_1): Likewise.
184 (incremental_comdat_test_1): Likewise.
185 * testsuite/Makefile.in: Regenerate.
187 2015-03-09 Cary Coutant <ccoutant@google.com>
190 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
191 return enum indicating whether .eh_frame section is empty, optimizable,
192 unrecognized, or an end marker. Adjust explicit instantiations.
193 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
194 (Eh_frame::add_ehframe_input_section): Change return type.
195 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
196 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
197 to the .eh_frame output section until we see the end marker.
198 (Layout::finalize_eh_frame_section): New.
199 * layout.h: (Layout::finalize_eh_frame_section): New.
201 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
203 * output.cc (Relobj::initialize_input_to_output_map<size>):
204 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
206 2015-03-04 Cary Coutant <ccoutant@google.com>
208 * parameters.cc (Parameters::set_target_once): Call
209 Target::select_as_default_target just once from here...
210 (set_parameters_target): ...instead of from here.
212 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
214 * ehframe.cc (Cie::set_output_offset): Pass in and use a
215 Output_section_data instead of a Merge_map.
216 (Eh_frame::Eh_frame): Don't initialize merge_map_.
217 (Eh_frame::read_cie): Use add_merge_mapping instead of
218 Merge_map::add_mapping.
219 (Eh_frame::read_fde): Ditto.
220 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
221 (Eh_frame::do_output_offset): Use merge_output_offset istead of
222 merge_map_->get_output_offset.
223 (Eh_frame::do_is_merge_section_for): Delete.
224 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
225 instead of a Merge_map.
226 (Cie::set_output_offset): Pass in a Output_section_data instead of a
228 (Eh_frame::do_is_merge_section_for): Delete.
229 (Eh_frame::merge_map_): Delete.
230 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
231 and use a Output_section_data instead of a Merge_map.
232 (Object_merge_map::add_mapping): Ditto.
233 (Object_merge_map::get_output_offset): Remove the merge_map argument.
234 (Object_merge_map::is_merge_section_for): Pass in and use a
235 Output_section_data instead of a Merge_map.
237 (Output_merge_base::do_output_offset): Use merge_output_offset instead
238 of merge_map_.get_output_offset.
239 (Output_merge_base::do_is_merge_section_for): Delete.
240 (Output_merge_data::do_add_input_section): Use
241 object->add_merge_mapping instead of add_mapping.
242 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
243 * merge.h (Merge_map): Delete forward declaration.
244 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
245 instead of a Merge_map.
246 (Object_merge_map::get_output_offset): Remove the merge_map argument.
247 (Object_merge_map::is_merge_section_for): Pass in and use a
248 Output_section_data instead of a Merge_map.
249 (Input_merge_map::Object_merge_map::merge_map): Replace with
251 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
252 Output_section_data instead of a Merge_map.
254 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
255 (Output_merge_base::do_is_merge_section_for): Delete.
256 (Output_merge_base::add_mapping): Delete.
257 (Output_merge_base::merge_map_): Delete.
258 * object.cc (Relobj::initialize_input_to_output_map): New.
259 (Relobj::initialize_input_to_output_map): New.
260 (Relobj::merge_output_offset): New.
261 (Relobj::is_merge_section_for): New.
262 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
264 * object.h (Relobj::merge_map): Delete.
265 (initialize_input_to_output_map): New.
266 (set_merge_map): Delete.
267 (add_merge_mapping): New.
268 (merge_output_offset): New.
269 (is_merge_section_for): New.
270 * output.cc (Output_section::Input_section::is_merge_section_for):
271 Use object->is_merge_section_for.
272 * output.h (Output_section_data::is_merge_section_for): Delete.
273 (Output_section_data::do_is_merge_section_for): Delete.
274 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
275 Use object->initialize_input_to_output_map.
276 (Merged_symbol_value<size>::value_from_output_section): Use
277 object->merge_output_offset.
279 2015-03-02 Peter Collingbourne <pcc@google.com>
280 Cary Coutant <ccoutant@google.com>
282 * output.cc (Output_section::add_merge_input_section): Do not
283 attempt to merge sections with an entsize of 0.
285 2015-03-02 Khem Raj <raj.khem@gmail.com>
287 * attributes.h (class Output_attributes_section_data ): Add
288 do_print_to_mapfile function.
290 2015-02-24 Alan Modra <amodra@gmail.com>
293 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
294 complain if value is not a multiple of four.
295 (Target_powerpc::Relocate::relocate): Correct handling of
296 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
298 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
300 * configure.ac (default_size): Set to 32 for x32.
301 * configure: Regenerated.
303 2015-02-18 Alan Modra <amodra@gmail.com>
306 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
309 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
311 * gc.h (Garbage_collection::add_reference): Don't use find.
313 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
315 * object.cc (write_local_symbols): avoid std::vector copy.
317 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
319 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
321 2015-02-09 Mark Wielaard <mjw@redhat.com>
323 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
324 DW_LANG_Fortran03 and DW_LANG_Fortran08.
326 2015-02-16 Cary Coutant <ccoutant@google.com>
330 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
331 DF_SYMBOLIC if --dynamic-list option is used.
332 * options.cc (General_options::finalize): --dynamic-list is not
333 mutually exclusive with -Bsymbolic.
334 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
335 listed in --dynamic-list.
336 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
337 -Bsymbolic-functions.
338 * testsuite/Makefile.in: Regenerate.
340 2015-02-16 Cary Coutant <ccoutant@google.com>
343 * incremental.cc: Remove redundant include of "output.h".
345 2015-02-12 Jing Yu <jingyu@google.com>
347 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
348 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
350 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
351 TLSLE_MOVW_* relocations.
352 (Target_aarch64::Scan::global): Likewise.
353 (Target_aarch64::Relocate::relocate): Likewise.
354 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
355 for new TLSLE_MOVW_* relocations.
357 2015-02-11 Will Newton <will.newton@linaro.org>
360 * arm.cc (Target_arm::make_plt_section): Create an ARM
361 state mapping symbol at the start of the PLT.
363 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
365 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
366 Replace two_file_shared_2.so with two_file_shared_1.so.
367 * testsuite/Makefile.in: Regenerated.
369 2015-02-09 Alan Modra <amodra@gmail.com>
371 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
372 plugin_test_thin.a and defsym_test.
373 * testsuite/Makefile.in: Regenerate.
375 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
377 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
380 2015-02-04 Peter Collingbourne <pcc@google.com>
382 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
383 forwarding symbols when computing symbol resolution info for plugins.
384 * plugin.h (Plugin_manager::symtab): New method.
385 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
387 2015-02-03 Cary Coutant <ccoutant@google.com>
388 Peter Collingbourne <pcc@google.com>
391 * archive.cc (Thin_archive_object_unlocker): New class.
392 (Archive::include_member): Unlock external members of thin archives.
393 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
394 (plugin_test_2): Likewise.
395 (plugin_test_3): Likewise.
396 (plugin_test_4): Likewise.
397 (plugin_test_5): Likewise.
398 (plugin_test_6): Likewise.
399 (plugin_test_7): Likewise.
400 (plugin_test_8): Likewise.
401 (plugin_test_9): Likewise.
402 (plugin_test_10): Likewise.
403 (plugin_test_11): New test case.
404 * testsuite/Makefile.in: Regenerate.
405 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
406 file to decide whether to claim file.
407 (all_symbols_read_hook): Likewise.
408 * testsuite/plugin_test_1.sh: Adjust expected output.
409 * testsuite/plugin_test_2.sh: Likewise.
410 * testsuite/plugin_test_3.sh: Likewise.
411 * testsuite/plugin_test_6.sh: Likewise.
412 * testsuite/plugin_test_tls.sh: Likewise.
413 * testsuite/plugin_test_11.sh: New testcase.
415 2015-02-03 Cary Coutant <ccoutant@google.com>
417 * descriptors.cc (Descriptors::open): Set artificially-low limit for
418 file descriptors when debugging enabled. Add debug output.
419 (Descriptors::release): Add debug output.
420 (Descriptors::close_some_descriptor): Likewise.
421 (Descriptors::close_all): Likewise.
422 * fileread.cc (File_read::lock): Likewise.
423 (File_read::unlock): Likewise.
425 2015-02-02 Cary Coutant <ccoutant@google.com>
427 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
428 executable output file.
430 2015-01-22 Han Shen <shenhan@google.com>
432 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
433 (Target_arm::do_plt_address_for_global): New method.
434 (Target_arm::do_plt_address_for_local): New method.
435 (Target_arm::rel_irelative_section): New method.
436 (Target_arm::make_data_plt): Add more parameters for plt ctor.
437 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
438 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
439 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
440 (Target_arm::Scan::check_non_pic): Add ifunc support.
441 (Target_arm::Scan::local): Add ifunc support.
442 (Target_arm::Scan::global): Add ifunc support.
443 (Target_arm::make_plt_section): New method.
444 (Target_arm::make_plt_entry): Change to call to make_plt_section.
445 (Target_arm::make_local_ifunc_plt_entry): New method.
446 (Target_arm::got_irelative_): New member.
447 (Target_arm::rel_irelative_): New member.
448 (Target_arm::got_section): Add creation for got_irelative_.
449 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
450 (Target_arm::Relocate::relocate): Properly set local ifunc address.
451 (Target_arm::do_dynsym_value): Properly set global ifunc address.
452 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
453 (Output_data_plt_arm::IRelative_data): New type.
454 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
455 (Output_data_plt_arm::add_entry): Add more parameters.
456 (Output_data_plt_arm::add_relocation): New method.
457 (Output_data_plt_arm::add_local_ifunc_entry): New method.
458 (Output_data_plt_arm::rel_irelative): New method.
459 (Output_data_plt_arm::entry_count): Modified.
460 (Output_data_plt_arm::address_for_global): New method.
461 (Output_data_plt_arm::address_for_local): New method.
463 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
464 (Output_data_plt_arm::insert_irelative_data): New method.
465 (Output_data_plt_arm::irelative_rel_): New member.
466 (Output_data_plt_arm::got_): New member.
467 (Output_data_plt_arm::got_irelative_): New member.
468 (Output_data_plt_arm::irelative_count_): New member.
469 (Output_data_plt_arm::IRelative_data_vec): New typedef.
470 (Output_data_plt_arm::irelative_data_vec_): New member.
471 (Output_data_plt_arm::do_write): Write out irelative entries.
472 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
473 more parameters to ctor.
474 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
475 more parameters to ctor.
476 * output.h (Output_data_reloc::add_local_relative): New method.
477 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
479 2015-01-29 Alan Modra <amodra@gmail.com>
481 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
482 and GOT_TLSGD to LE optimization.
484 2015-01-28 Cary Coutant <ccoutant@google.com>
486 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
487 for undef TLS symbols.
488 (Target_x86_64::Relocate::relocate_tls): Likewise.
489 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
491 2015-01-25 Cary Coutant <ccoutant@google.com>
493 * output.cc (Output_segment::set_section_addresses): Fix calculation
494 of size of relro segment.
496 2015-01-22 Alan Modra <amodra@gmail.com>
498 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
499 condition for need of ifunc plt entry.
500 (Target_powerpc::Scan::global <got relocs>): Likewise.
502 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
504 * mips.cc (reloc_high): Add r_sym.
505 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
506 reloc_high constructor.
507 (Mips_relocate_functions::relgot16_local): Likewise.
508 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
509 r_type to decide whether LO16 matches HI16.
510 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
511 rello16 and relgot16_local.
513 2015-01-09 Cary Coutant <ccoutant@google.com>
515 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
516 unless alignment is larger than page size.
518 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
519 Cary Coutant <ccoutant@google.com>
522 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
523 (DEFAULT_TARGET_X32): Set for x32.
524 * x86_64.cc (cmp_insn_32): New.
525 (lea_r10_insn_32): Likewise.
526 (lea_r11_insn_32): Likewise.
527 (cmp_insn_64): Likewise.
528 (lea_r10_insn_64): Likewise.
529 (lea_r11_insn_64): Likewise.
530 (Target_x86_64<size>::do_calls_non_split): Handle x32.
531 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
532 (check_DATA): Add split_x32 files.
533 (split_x32_[1234n].o): New targets.
534 (split_x32_[124]): New targets.
535 (split_x32_[1234r].stdout): New targets.
536 * testsuite/split_x32.sh: New file.
537 * testsuite/split_x32_1.s: Likewise.
538 * testsuite/split_x32_2.s: Likewise.
539 * testsuite/split_x32_3.s: Likewise.
540 * testsuite/split_x32_4.s: Likewise.
541 * testsuite/split_x32_n.s: Likewise.
542 * configure: Regenerated.
543 * testsuite/Makefile.in: Likewise.
545 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
548 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
551 2015-01-02 Alan Modra <amodra@gmail.com>
553 * version.cc (print_version): Just print current year.
554 * dwp.cc (print_version): Likewise.
556 2015-01-01 Alan Modra <amodra@gmail.com>
558 Update year range in copyright notice of all files.
560 2014-12-25 Alan Modra <amodra@gmail.com>
562 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
564 (Target_arm::merge_object_attributes, ): Likewise.
566 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
568 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
569 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
570 AEABI_VFP_args_vfp to check that.
571 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
572 value and replace hardcoded values by enum values.
574 2014-12-22 Cary Coutant <ccoutant@google.com>
576 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
578 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
581 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
582 to "return i * i * 3;".
584 2014-12-16 Cary Coutant <ccoutant@google.com>
586 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
587 (Mapfile::print_output_data): Use current_data_size() to avoid
588 assert for sections requiring postprocessing; if address is not valid,
590 (Mapfile::print_output_section): Use current_data_size(); print note
591 that addresses and sizes are before compression.
593 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
595 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
596 Cast current_group_size to unsigned long when reporting error.
598 2014-12-10 Jing Yu <jingyu@google.com>
600 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
601 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
602 Update error message.
603 (Target_aarch64::do_relax): Use absolute value of option
604 stub_group_size. Replace local variable with class member
607 2014-12-04 Alan Modra <amodra@gmail.com>
609 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
610 addend of PLTREL24 reloc when not generating a plt stub. Make
611 max_branch_offset an "Address".
612 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
613 (Target_powerpc::Relocate::relocate): Likewise.
615 2014-12-04 Alan Modra <amodra@gmail.com>
618 * symtab.cc (Symbol::set_undefined): Remove assertion.
619 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
620 on symbols defined in discarded sections, instead return false.
621 Rearrange params, update all callers.
622 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
623 branches to syms in discarded sections.
624 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
625 undefined and flag as discarded.
626 (Target_powerpc::Relocate::relocate): Localize variable.
628 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
631 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
632 * testsuite/Makefile.in: Regenerated.
634 2014-12-03 Alan Modra <amodra@gmail.com>
637 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
638 when adding dynamic relocations against section symbols.
640 2014-12-01 Dimitry Ivanov <dimitry@google.com>
642 * layout.cc (Layout::finish_dynamic_section): When '-z global'
643 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
644 * options.h (General_options): New -z option (global).
646 2014-12-01 Cary Coutant <ccoutant@google.com>
649 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
651 (Layout::create_executable_stack_info): Warn when -z noexecstack is
652 given but some inputs require executable stack.
654 2014-11-26 Cary Coutant <ccoutant@google.com>
656 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
657 .debug_str_offsets; strip .debug_gnu_pubnames and
659 (lines_only_debug_sections): Strip all four new sections.
661 2014-11-26 Jing Yu <jingyu@google.com>
663 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
664 register to be x0 when to relax TLSDESC_LD64_LO12.
666 2014-11-26 Alan Modra <amodra@gmail.com>
668 * powerpc.cc (struct Stub_table_owner): New.
669 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
670 unsigned int vector. Update all references.
671 (powerpc_relobj::set_stub_table): Take an unsigned int param
672 rather than a Stub_table. Update callers.
673 (Powerpc_relobj::clear_stub_table): New function.
674 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
675 stub_group_size_ vars.
676 (Target_powerpc::new_stub_table): Delete.
677 (max_branch_delta): New function, extracted from..
678 (Target_powerpc::Relocate::relocate): ..here..
679 (Target_powerpc::Branch_info::make_stub): ..and here. Return
680 status on whether stub created successfully.
681 (Stub_control::Stub_control): Add "no_size_errors" param. Move
683 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
684 reduce on relax failure.
685 (Target_powerpc::group_sections): Add "no_size_errors" param.
686 Use stub_group_size_. Set up group info in a temp vector,
687 before building Stub_table vector. Account for input sections
688 possibly already converted to relaxed sections.
689 (Stub_table::init): Delete. Merge into..
690 (Stub_table::Stub_table): ..here.
691 (Stub_table::can_reach_stub): New function.
692 (Stub_table::add_plt_call_entry): Add "from" parameter and
693 return true iff stub could be reached.
694 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
696 (Stub_table::clear_stubs): Add "all" param.
698 2014-11-26 Alan Modra <amodra@gmail.com>
700 * powerpc.cc (Stub_control::set_output_and_owner): New function.
701 (Target_powerpc::group_sections): Use it.
703 2014-11-25 Cary Coutant <ccoutant@google.com>
705 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
706 (Binary_to_elf::write_symbol): Add st_size parameter.
707 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
709 2014-11-25 Cary Coutant <ccoutant@google.com>
712 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
713 (Sized_relobj_file::do_layout): Handle deferred sections properly
714 during GC pass 1. Don't add reloc sections to deferred list twice.
715 * object.h (Sized_relobj_file::is_deferred_layout): New function.
716 (Sized_relobj_file::is_deferred_layout_): New data member.
718 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
721 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
722 Check PC-relative offset overflow in PLT entry.
724 2014-11-21 Alan Modra <amodra@gmail.com>
726 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
729 2014-11-20 Alan Modra <amodra@gmail.com>
731 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
732 from --stub-group-size parameter divided by 1024.
733 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
734 template parameter. Update all uses.
735 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
736 has_stub_value. Set for long branches. Don't report overflow for
737 branch to undefined weak symbols. Print info message on
738 overflowing branch to stub.
740 2014-11-20 Alan Modra <amodra@gmail.com>
742 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
744 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
746 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
747 entry for R_X86_64_GOTPLT64.
748 (Target_x86_64<size>::Relocate::relocate): Update comments for
751 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
753 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
754 * plugin.h: add lock definition
756 2014-10-29 Han Shen <shenhan@google.com>
757 Jing Yu <jingyu@google.com>
759 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
760 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
761 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
763 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
765 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
766 (Target_aarch64::tls_ld_to_le): New method.
767 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
769 (Output_data_plt_aarch64::irelative_rel_): New data member.
770 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
771 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
772 (Output_data_plt_aarch64::add_relocation): New method.
773 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
774 offset. Add got_irelative size to got size.
775 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
776 type string with the new typename.
777 (AArch64_relocate_functions::update_adr): Replace parameter x with
779 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
780 (AArch64_relocate_functions::reloc_common): New method.
781 (AArch64_relocate_funcsions::rela_general): Extract common part out
782 into reloc_common method.
783 (AArch64_relocate_functions::rela_general): Likewise.
784 (AArch64_relocate_functions::pcrela_general): Likewise.
785 (AArch64_relocate_functions::adr): New method.
786 (AArch64_relocate_functions::adrp): Calculate immed before calling
788 (AArch64_relocate_functions::adrp): Likewise.
789 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
790 comparing x to 0. Calculate immed from ~x when x < 0.
791 (Target_aarch64::optimize_tls_reloc): Add new cases for
792 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
793 TLSLD_MOVW_DTPREL_G0_NC.
794 (Target_aarch64::possible_function_pointer_reloc): Implement this
796 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
798 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
799 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
800 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
801 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
802 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
803 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
804 (Target_aarch64::make_plt_entry): Call add_entry with two more
806 (Target_aarch64::make_local_ifunc_plt_entry): New method.
807 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
808 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
809 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
810 (Target_aarch64::Relocate::relocate_tls): Add cases for
811 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
812 TLSLD_MOVW_DTPREL_G0_NC.
813 * testsuite/icf_safe_so_test.cc: Correct test comment.
814 * testsuite/icf_safe_test.sh: Add AArch64 arch.
816 2014-10-22 Alan Modra <amodra@gmail.com>
818 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
821 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
823 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
825 2014-10-17 Cary Coutant <ccoutant@google.com>
827 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
828 Add "typename" keyword.
830 2014-10-15 Han Shen <shenhan@google.com>
831 Jing Yu <jingyu@google.com>
833 Patch for gold aarch64 backend to support relaxation.
834 * aarch64-reloc.def: Change format.
835 * aarch64.cc (class Reloc_stub): New class.
836 (class Stub_table): New class.
837 (class AArch64_relobj): New class.
838 (class AArch64_input_section): New class.
839 (class AArch64_output_section): New class.
840 (Target_aarch64::new_stub_table): New method.
841 (Target_aarch64::new_aarch64_input_section): New method.
842 (Target_aarch64::find_aarch64_input_section): New method.
843 (Target_aarch64::scan_section_for_stubs): New method.
844 (Target_aarch64::scan_reloc_section_for_stubs): New method.
845 (Target_aarch64::relocate_stub): New method.
846 (Target_aarch64::current_target): New method.
847 (Target_aarch64::do_make_elf_object): New method.
848 (Target_aarch64::do_may_relax): New method.
849 (Target_aarch64::do_relax): New method.
850 (Target_aarch64::group_sections): New method.
851 (Target_aarch64::scan_reloc_for_stub): New method.
852 (Target_aarch64::do_make_output_section): New method.
853 (Target_aarch64::stub_tables_): New data member.
854 (Target_aarch64::aarch64_input_section_map_): New data member.
855 (AArch64_relocate_functions::maybe_apply_stub): New method.
857 2014-09-30 Cary Coutant <ccoutant@google.com>
860 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
862 2014-09-30 Kito Cheng <kito@0xlab.org>
865 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
866 hash table before sysv-style hash table.
868 2014-09-29 Sriraman Tallam <tmsriram@google.com>
870 * options.h (--pic-executable): Add negative to alias to -no-pie.
872 2014-09-26 Cary Coutant <ccoutant@google.com>
875 * object.cc (Sized_relobj_file): Compute value of section symbols
876 for TLS sections the same as TLS symbols.
878 2014-09-25 Cary Coutant <ccoutant@google.com>
881 * resolve.cc (Symbol_table::resolve): Override common placeholder
882 symbols, but adjust sizes.
883 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
884 symbols to common lists.
886 2014-09-24 Alan Modra <amodra@gmail.com>
888 * po/POTFILES.in: Regenerate.
890 2014-09-23 Taiju Tsuiki <tzik@google.com>
891 Cary Coutant <ccoutant@google.com>
894 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
895 on input_sections_blocker.
896 * layout.cc (Write_sections_task::locks): Unblock
897 input_sections_blocker_.
898 * layout.h (Write_sections_task::Write_sections_task): Add
899 input_sections_blocker.
900 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
902 * testsuite/Makefile.in: Regenerate.
904 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
906 * testsuite/Makefile.am (plugin_test_10): New test.
907 * testsuite/Makefile.in: Regenerate
908 * testsuite/plugin_common_test_2.c (c1): Align to 8.
909 * testsuite/plugin_test_10.sh: New file.
911 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
913 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
914 * resolve.cc (Symbol_table::resolve): Don't override common symbols
915 during the replacement phase.
917 2014-09-17 Han Shen <shenhan@google.com>
918 Jing Yu <jingyu@google.com>
920 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
921 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
922 * aarch64.cc (Target_aarch64): Add data members
923 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
924 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
926 (Target_aarch64::do_reloc_symbol_index): New method.
927 (Target_aarch64::do_reloc_addend): New method.
928 (Target_aarch64::add_tlsdesc_info): New method.
929 (Target_aarch64::do_dynsym_value): New method.
930 (Target_aarch64::do_make_data_plt): Add new parameters: got,
931 got_irelative. Pass them to Output_data_plt_aarch64_standard.
932 (Target_aarch64::make_data_plt): Add new parameters: got,
933 got_irelative. Pass them to do_make_data_plt.
934 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
935 (Target_aarch64::Relocate:tls_gd_to_le): New method.
936 (Target_aarch64::Relocate:tls_ie_to_le): New method.
937 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
938 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
939 (Target_aarch64::got_tlsdesc_section): New method.
940 (Target_aarch64::make_local_ifunc_plt_entry): New method.
941 (Target_aarch64::define_tls_base_symbol): New method.
942 (Target_aarch64::reserve_tlsdesc_entries): New method.
943 (Target_aarch64::got_mod_index_entry): New method.
944 (Target_aarch64::rela_tlsdesc_section): New method.
945 (Target_aarch64::rela_irelative_section): New method.
946 (Target_aarch64::Tlsdesc_info): New struct.
947 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
948 relocations and tlsdesc relocations.
949 (Target_aarch64::optimize_tls_reloc): Implement method.
950 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
951 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
953 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
954 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
955 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
956 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
957 (Output_data_plt_aarch64::rela_tlsdesc): New method.
958 (Output_data_plt_aarch64::rela_irelative): New method.
959 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
960 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
961 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
962 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
963 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
964 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
965 (Output_data_plt_aarch64_standard): New member variables:
966 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
967 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
968 New parameter: got, got_irelative.
969 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
970 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
971 (Output_data_plt_aarch64::do_write): Replace got_address with
972 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
973 (AArch64_relocate_functions::update_movnz): New method.
974 (AArch64_relocate_functions): Correct format.
975 (AArch64_relocate_functions::movnz): New method.
976 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
977 before the switch. Add new cases to switch.
978 Check ie_to_le relaxation on tlsie relocations. Add code handling
980 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
981 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
982 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
983 Call reloc_name_in_error_message to print unsupported reloc.
984 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
986 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
987 relocs. Fill in some more dynamic tags.
988 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
989 Skip call tls_get_addr when tlsgd is relaxed.
990 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
991 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
992 tlsdesc->ie relaxation.
994 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
996 * mips.cc (Target_mips_nacl): New class.
997 (Target_selector_mips_nacl): New class.
998 (target_selector_mips32): Rename from target_selector_mips32be and use
999 Target_selector_mips_nacl instead of Target_selector_mips.
1000 (target_selector_mips32el): Rename from target_selector_mips32 and use
1001 Target_selector_mips_nacl instead of Target_selector_mips.
1002 (target_selector_mips64): Rename from target_selector_mips64be and use
1003 Target_selector_mips_nacl instead of Target_selector_mips.
1004 (target_selector_mips64el): Rename from target_selector_mips64 and use
1005 Target_selector_mips_nacl instead of Target_selector_mips.
1006 (Target_mips::mips_info): Add const attribute.
1008 2014-09-02 Cary Coutant <ccoutant@google.com>
1010 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1011 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1012 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1013 (Sized_incr_dynobj::do_section_name): Likewise.
1014 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1015 (Sized_incr_dynobj::do_section_name): Likewise.
1016 * object.h (Object::section_name): Likewise.
1017 (Object::do_section_name): Likewise.
1018 (Sized_relobj_file::do_section_name): Likewise.
1019 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1020 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1022 2014-09-02 Cary Coutant <ccoutant@google.com>
1025 * ehframe.cc (Fde::write): Add output_offset parameter.
1026 (Cie::write): Likewise.
1027 (Eh_frame::set_final_data_size): Account for offset within output
1029 (Eh_frame::do_sized_write): Likewise.
1030 * ehframe.h (Fde::write): Add output_offset parameter.
1031 (Cie::write): Likewise.
1032 * output.cc (Output_section::Input_section_sort_entry): Remove
1033 section_has_name_; add output_section_name parameter. Use
1034 output section name for non-input sections.
1035 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1036 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1037 (Output_section::Input_section_sort_compare): Remove logic for
1038 sections without names.
1039 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1040 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1042 (Output_section::Input_section_sort_section_name_compare): Likewise.
1044 2014-08-29 Han Shen <shenhan@google.com>
1045 Jing Yu <jingyu@google.com>
1047 * aarch64-reloc-property.cc
1048 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1049 reference reloc property in the table.
1050 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1052 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1053 2 new overloaded methods.
1054 (Output_data_got_aarch64::do_write): Add code to write out
1056 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1058 (Output_data_got_aarch64::static_relocs): New vector to
1060 (Target_aarch64::TCB_SIZE): New const static memeber.
1061 (Target_aarch64::tcb_size): New method.
1062 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1063 (Target_aarch64::Relocate::relocate_tls): New method.
1064 (Target_aarch64::Scan::local): Add code handling new reloc types.
1065 (Target_aarch64::Scan::global): Add code handling new reloc types.
1067 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1069 * options.h (-no-pie): Add option.
1071 2014-08-08 Jing Yu <jingyu@google.com>
1072 Han Shen <shenhan@google.com>
1074 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1075 (DEFFILES): add aarch64-reloc.def.
1076 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1077 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1078 * Makefile.in: Regenerate.
1079 * aarch64-reloc-property.cc: New file.
1080 * aarch64-reloc-property.h: New file.
1081 * aarch64-reloc.def: New file.
1082 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1083 with tab to make the format consistent.
1084 (Output_data_got_aarch64::symbol_table_): New method.
1085 (Target_aarch64::do_plt_address_for_global): New method.
1086 (Target_aarch64::do_plt_address_for_local): New method.
1087 (Target_aarch64::do_select_as_default_target): New method.
1088 (Target_aarch64::do_make_data_plt): New method.
1089 (Target_aarch64::make_data_plt): New method.
1090 (Output_data_plt_aarch64::has_irelative_section): New method.
1091 (Output_data_plt_aarch64::address_for_global): New method.
1092 (Output_data_plt_aarch64::address_for_local): New method.
1093 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1094 (Output_data_plt_aarch64::add_entry): Implement contents.
1095 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1096 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1097 the got_pov entry to plt0.
1098 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1100 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1101 (AArch64_howto): New struct.
1102 (aarch64_howto[]): New static const array.
1103 (AArch64_relocate_functions): New class.
1104 (Target_aarch64::Scan::get_reference_flags): Remove method.
1105 (Target_aarch64::Scan::local): Implement to support a few relocations.
1106 (Target_aarch64::Scan::global): Implement to support a few relocations.
1107 (Target_aarch64::make_plt_section): Implement contents.
1108 (Target_aarch64::make_plt_entry): Implement contents.
1109 (Target_aarch64::do_finalize_sections): Implement contents.
1110 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1111 (Target_aarch64::relocate_section): Implement contents.
1113 2014-08-06 Alan Modra <amodra@gmail.com>
1115 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1117 2014-08-06 Alan Modra <amodra@gmail.com>
1120 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1122 2014-07-21 Sriraman Tallam <tmsriram@google.com>
1124 * object.cc (Relobj::is_section_name_included): Add
1125 ".rodata.nptl_version" to not garbage collect this section.
1127 2014-07-08 Cary Coutant <ccoutant@google.com>
1129 * expression.cc (struct Expression::Expression_eval_info): Add
1130 new fields type_pointer, vis_pointer, and nonvis_pointer.
1131 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1132 nonvis_pointer parameters. Adjust all calls.
1133 (Symbol_expression::value): Update type, visibility, and nonvis bits
1135 * script.cc (Symbol_assignment::sized_finalize): Update type,
1136 visibility, and remaining st_other bits for new symbol.
1137 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1138 vis_pointer, and nonvis_pointer parameters.
1139 * symtab.h (Symbol::set_type): New method.
1141 * testsuite/Makefile.am (defsym_test): New test.
1142 * testsuite/Makefile.in: Regenerate.
1143 * testsuite/defsym_test.c: New file.
1144 * testsuite/defsym_test.sh: New file.
1146 2014-07-08 Cary Coutant <ccoutant@google.com>
1149 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1150 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1151 (Sized_dynobj::base_read_symbols): ...new method.
1152 * object.h (Sized_relobj_file::base_read_symbols): New method.
1153 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1154 (Sized_relobj_file::base_read_symbols): ...new method.
1155 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1156 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1157 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1159 2014-07-04 Alan Modra <amodra@gmail.com>
1161 * po/POTFILES.in: Regenerate.
1163 2014-07-02 Jing Yu <jingyu@google.com>
1165 * aarch64.cc: New file
1166 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1167 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1168 * Makefile.in: Regenerate.
1169 * configure.tgt: Add entries for aarch64*.
1170 * configure.ac: Likewise.
1171 * configure: Likewise.
1173 2014-06-27 Alan Modra <amodra@gmail.com>
1175 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1177 2014-06-24 Cary Coutant <ccoutant@google.com>
1179 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1181 (Dwo_file::sized_read_unit_index): Likewise.
1183 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1185 * mips.cc: New file.
1186 * Makefile.am (TARGETSOURCES): Add mips.cc
1187 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1188 * configure.tgt: Add entries for mips*.
1189 * configure.ac: Likewise.
1190 * Makefile.in: Regenerate.
1191 * configure: Likewise.
1193 2014-06-09 Cary Coutant <ccoutant@google.com>
1195 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1196 unit_length is within section bounds.
1198 2014-06-09 Cary Coutant <ccoutant@google.com>
1201 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1204 2014-06-07 Alan Modra <amodra@gmail.com>
1206 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1208 2014-06-06 Cary Coutant <ccoutant@google.com>
1210 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1211 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1212 (Dwarf_pubnames_table::read_header): Likewise.
1213 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1214 .debug_gnu_pubtypes.
1216 2014-06-05 Joel Brobecker <brobecker@adacore.com>
1218 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1219 * Makefile.in, configure: Regenerate.
1221 2014-06-03 Alan Modra <amodra@gmail.com>
1223 * powerpc.cc (addis_12_2): Define.
1224 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1226 2014-06-03 Alan Modra <amodra@gmail.com>
1228 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1231 2014-06-02 Alan Modra <amodra@gmail.com>
1233 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1234 Only ignore relocs on ELFv1.
1235 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1237 2014-05-30 Cary Coutant <ccoutant@google.com>
1239 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1240 * testsuite/Makefile.in: Regenerate.
1241 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1243 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1246 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1247 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1249 2014-05-15 Alan Modra <amodra@gmail.com>
1251 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1252 Compare FDE contents with DW_CFA_nop rather than 0.
1254 2014-05-13 Sriraman Tallam <tmsriram@google.com>
1256 * symtab.h (may_need_copy_reloc): Remove check for position independent
1258 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1259 position independence before pc absolute may_need_copy_reloc call.
1260 Add check for executable output befor pc relative may_need_copy_reloc
1266 * powerpc.cc: Add check for no position independence before
1267 may_need_copy_reloc calls.
1268 * testsuite/pie_copyrelocs_test.cc: New file.
1269 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1270 * Makefile.am (pie_copyrelocs_test): New test.
1271 * Makefile.in: Regenerate.
1273 2014-05-08 Martin Liška <mliska@suse.cz>
1275 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1277 2014-05-06 Cary Coutant <ccoutant@google.com>
1280 * i386.cc (Output_data_got_plt_i386): New class.
1281 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1282 parameter. Change all callers.
1283 (Output_data_plt_i386::layout_): Remove.
1284 (Output_data_plt_i386::got_plt_): Change type.
1285 (Target_i386::got_plt_): Change type. Change all references.
1286 (Target_i386::got_section): Create instance of new class.
1287 (Output_data_got_plt_i386::do_write): New function.
1288 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1289 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1290 parameter. Change all callers.
1291 (Output_data_plt_x86_64::layout_): Remove.
1292 (Output_data_plt_x86_64::got_plt_): Change type.
1293 (Target_x86_64::got_plt_): Change type. Change all references.
1294 (Target_x86_64::got_section): Create instance of new class.
1295 (Output_data_got_plt_x86_64::do_write): New function.
1296 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1297 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1300 2014-05-05 Cary Coutant <ccoutant@google.com>
1302 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1303 if we have pubnames/pubtypes.
1305 2014-05-02 Cary Coutant <ccoutant@google.com>
1307 * defstd.cc (in_segment): Define __ehdr_start here...
1308 * layout.cc (Layout::finalize): ...Instead of here. Set the
1309 output segment when known.
1310 * resolve.cc (Symbol::override_base_with_special): Remember
1311 the original binding.
1312 * symtab.cc (Symbol::set_output_segment): New function.
1313 (Symbol::set_undefined): New function.
1314 * symtab.h (Symbol::is_weak_undefined): Check original undef
1316 (Symbol::is_strong_undefined): New function.
1317 (Symbol::set_output_segment): New function.
1318 (Symbol::set_undefined): New function.
1319 * target-reloc.h (is_strong_undefined): Remove.
1320 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1321 Check for hidden undefs.
1322 (relocate_section): Call Symbol::is_strong_undefined.
1324 * testsuite/Makefile.am (ehdr_start_test_1)
1325 (ehdr_start_test_2, ehdr_start_test_3)
1326 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1327 * testsuite/Makefile.in: Regenerate.
1328 * testsuite/ehdr_start_def.cc: New source file.
1329 * testsuite/ehdr_start_test.cc: New source file.
1330 * testsuite/ehdr_start_test.t: New linker script.
1331 * testsuite/ehdr_start_test_4.sh: New shell script.
1333 2014-04-23 Cary Coutant <ccoutant@google.com>
1336 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1338 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1340 * layout.cc (Layout::include_section): Allow a target to decide
1341 whether to include a section.
1342 * target.h (Target::should_include_section): New function.
1343 (Target::do_should_include_section): New function.
1345 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1347 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1349 (Copy_relocs::emit): ... here.
1350 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1351 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1352 (Copy_reloc_entry::entries_): Change from private to protected.
1354 2014-04-02 Sriraman Tallam <tmsriram@google.com>
1356 * icf.cc (get_section_contents): Replace copies of reloc
1357 vectors with const references.
1359 2014-04-02 Cary Coutant <ccoutant@google.com>
1361 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1362 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1363 * configure: Regenerate.
1364 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1365 -fno-use-linker-plugin.
1366 (LINK1, CXXLINK1): Add it to the link command.
1367 * testsuite/Makefile.in: Regenerate.
1369 2014-03-12 Alan Modra <amodra@gmail.com>
1371 * Makefile.in: Regenerate.
1373 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1375 * symtab.h (Symbol::set_nonvis): New function.
1377 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1379 * symtab.cc (Sized_symbol<32>::init_output_data):
1380 Instantiate the template.
1381 (Sized_symbol<64>::init_output_data): Likewise.
1383 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1385 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1386 adjust dynamic symbol value.
1387 * target.h (Target::adjust_dyn_symbol): New function.
1388 (Target::do_adjust_dyn_symbol): New function.
1390 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1392 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1393 Get the value of DYNAMIC_CUSTOM dynamic entry.
1394 * output.h (Output_data_dynamic::add_custom): New function.
1395 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1397 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1398 * target.h (Target::dynamic_tag_custom_value): New function.
1399 (Target::do_dynamic_tag_custom_value): New function.
1401 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1403 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1405 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1406 (Target::do_has_custom_set_dynsym_indexes): New function.
1407 (Target::set_dynsym_indexes): New function.
1408 (Target::do_set_dynsym_indexes): New function.
1410 2014-03-07 Alan Modra <amodra@gmail.com>
1412 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1413 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1414 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1415 (Powerpc_relocate_functions::has_overflow_bitfield,
1416 overflowed): Use the above.
1417 (Target_powerpc::Relocate::relocate): Correct overflow checking
1418 for a number of relocations. Modify overflow test for 16-bit
1419 fields in instructions to signed/unsigned according to whether
1420 the field takes a signed or unsigned value.
1422 2014-03-05 Alan Modra <amodra@gmail.com>
1424 Update copyright years.
1426 2014-03-05 Alan Modra <amodra@gmail.com>
1428 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1429 R_PPC64_ADDR64_LOCAL.
1430 (Target_powerpc::Relocate::relocate): Likewise.
1432 2014-03-03 Alan Modra <amodra@gmail.com>
1434 * dwp.cc (print_version): Update copyright year to current.
1436 2014-02-10 Alan Modra <amodra@gmail.com>
1438 * po/gold.pot: Regenerate.
1440 2014-02-06 Cary Coutant <ccoutant@google.com>
1442 Fix problem where -u is ignored when a weak undef is seen.
1444 * archive.cc (Library_base::should_include_member): Reorder
1445 code to check for -u option if a weak undef has already been seen.
1446 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1447 * testsuite/Makefile.in: Regenerate.
1448 * testsuite/weak_undef_file3.cc: New file.
1449 * testsuite/weak_undef_file4.cc: New file.
1450 * testsuite/weak_undef_test_2.cc: New file.
1452 2014-02-05 Cary Coutant <ccoutant@google.com>
1454 Fix issues with gold undefined symbol diagnostics.
1457 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1459 * target-reloc.h (is_strong_undefined): New function.
1460 (relocate_section): Move undef vtable symbol check from here.
1461 Check for is_strong_undefined.
1463 2014-02-05 Cary Coutant <ccoutant@google.com>
1465 Fix problems with the --dynamic-list option.
1468 * options.cc (General_options::parse_dynamic_list):
1469 Set have_dynamic_list_.
1470 (General_options::General_options): Initialize have_dynamic_list_.
1471 (General_options::finalize): Turn off -Bsymbolic and
1472 -Bsymbolic-functions if --dynamic-list provided.
1473 * options.h (General_options::have_dynamic_list): New function.
1474 (General_options::have_dynamic_list_): New data member.
1475 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1479 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1480 in --dynamic-list, mark it.
1482 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1483 (dynamic_list_2): New test case.
1484 * testsuite/Makefile.in: Regenerate.
1485 * testsuite/dynamic_list_2.cc: New file.
1486 * testsuite/dynamic_list_2.t: New file.
1487 * testsuite/dynamic_list_lib1.cc: New file.
1488 * testsuite/dynamic_list_lib2.cc: New file.
1489 * testsuite/gc_dynamic_list_test.c: New file.
1490 * testsuite/gc_dynamic_list_test.sh: New file.
1491 * testsuite/gc_dynamic_list_test.t: New file.
1493 2014-01-28 Cary Coutant <ccoutant@google.com>
1495 Add .gdb_index version 7 support.
1497 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1498 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1500 (Dwarf_ranges_table::read_ranges_table): Likewise.
1501 (Dwarf_pubnames_table::read_section): Check for GNU-style
1502 sections, and for compressed debug sections.
1503 (Dwarf_pubnames_table::read_header): Compute end address of table.
1504 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1505 for end of list by offset, not by offset == 0.
1506 (Dwarf_info_reader::do_read_string_table): Check for compressed
1508 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1509 Initialize new data members.
1510 (Dwarf_pubnames_table::next_name): return flag_byte.
1511 (Dwarf_pubnames_table::end_of_table_): New data member.
1512 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1513 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1514 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1515 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1516 read skeleton type unit DIEs.
1517 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1518 (Gdb_index::do_write): Write flag_byte.
1519 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1520 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1521 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1522 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1524 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1526 * version.cc (print_version): Update copyright year to 2014.
1528 2013-12-19 Dimitry Andric <dimitry@andric.com>
1530 * stringpool.cc (Stringpool_template::reserve): Add
1531 HAVE_UNORDERED_MAP case.
1532 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1534 2013-12-18 Cary Coutant <ccoutant@google.com>
1536 * configure.ac: Check for <unordered_set> and <unordered_map>.
1537 * config.in: Regenerate.
1538 * configure: Regenerate.
1539 * system.h: Use <unordered_set> and <unordered_map> if available.
1541 2013-12-10 Roland McGrath <mcgrathr@google.com>
1543 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1544 with $(INSTALL_PROGRAM_ENV).
1545 * Makefile.in: Regenerate.
1547 2013-11-22 Cary Coutant <ccoutant@google.com>
1549 * configure.ac: Add check for which library is needed for
1551 * configure: Regenerate.
1553 2013-11-22 Cary Coutant <ccoutant@google.com>
1555 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1557 * testsuite/Makefile.in: Regenerate.
1559 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1561 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1562 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1563 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1564 (Target_x86_64<size>::Scan::local): Likewise.
1565 (Target_x86_64<size>::Scan::global): Likewise.
1566 (Target_x86_64<size>::Relocate::relocate): Likewise.
1567 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1569 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1572 * testsuite/Makefile.am (check_PROGRAMS): Add
1573 exception_x86_64_bnd_test.
1574 (exception_x86_64_bnd_test_SOURCES): New macro.
1575 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1576 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1577 (exception_x86_64_bnd_test_LDADD): Likewise.
1578 (exception_x86_64_bnd_1.o): New rule.
1579 (exception_x86_64_bnd_2.o): Likewise.
1580 * testsuite/Makefile.in: Regenerated.
1582 2013-11-15 Alan Modra <amodra@gmail.com>
1584 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1586 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1587 Only call ppc64_local_entry_offset for 64-bit. Restrict
1588 symval_for_branch lookup to ELFv1.
1589 (Stub_table::add_plt_call_entry): Use unsigned int off.
1590 (Output_data_glink::Address, invalid_address): New.
1591 (Output_data_glink::add_eh_frame): Move out of line. Add
1593 (Output_data_glink::add_global_entry, find_global_entry,
1594 global_entry_address): New functions.
1595 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1596 ge_size): New variables.
1597 (Output_data_glink::set_final_data_size): Add global entry
1599 (Output_data_glink::do_write): Write global entry stubs.
1600 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1601 parameter. Return true for ELFv2. Adjust callers.
1602 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1603 ELFv1. Similarly for ifunc and dynamic relocation processing
1604 specific to ELFv1. Recognize that symbols are defined on
1605 their plt entries for ELFv2.
1606 (Target_powerpc::symval_for_branch): Assert if called for
1608 (Target_powerpc::Relocate::relocate): Use global entry plt
1609 stub for symbol value if such exists on ELFv2.
1610 (Target_powerpc::Relocate::relocate): Don't call
1611 symval_for_branch when ELFv2. Do adjust for local entry
1613 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1615 (Target_powerpc::do_plt_address_for_global): Similarly.
1617 2013-11-14 Cary Coutant <ccoutant@google.com>
1619 Revert patch -- this did not fix the problem, and there is
1622 2013-11-14 Cary Coutant <ccoutant@google.com>
1625 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1626 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1627 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1628 updating fde_offsets_.
1629 (Eh_frame_hdr::lock_): New data member.
1631 2013-11-14 Cary Coutant <ccoutant@google.com>
1633 * dwp.cc (Dwo_file_entry): New type.
1634 (File_list): Use Dwo_file_entry.
1635 (Dwo_file::verify): New function.
1636 (Dwo_file::verify_dwo_list): New function.
1637 (Dwo_file::sized_verify_dwo_list): New function.
1638 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1640 (Dwp_options): New enum type.
1641 (dwp_options): Add --verify-only.
1644 * dwp.h (gold_info): Add declaration.
1646 2013-11-14 Cary Coutant <ccoutant@google.com>
1649 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1650 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1651 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1652 updating fde_offsets_.
1653 (Eh_frame_hdr::lock_): New data member.
1655 2013-11-06 Cary Coutant <ccoutant@google.com>
1658 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1659 before reloc sections.
1661 2013-11-04 Alan Modra <amodra@gmail.com>
1663 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1664 (Symbol::needs_dynamic_reloc): Test new flag.
1665 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1666 (Target_powerpc::Scan::get_reference_flags): Add target param.
1667 Return FUNC_DESC_ABI for 64-bit ELFv1.
1668 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1670 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1671 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1673 2013-10-31 Cary Coutant <ccoutant@google.com>
1675 Restore support for dwp v2 DWARF package file format.
1677 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1678 tu_length parameter. Adjust all callers.
1679 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1680 * dwp.cc: Include dwarf.h.
1681 (Section_bounds): New struct type.
1682 (Unit_set): New struct type.
1683 (Dwo_file::Dwo_file): Initialize new data member.
1684 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1685 Combine and rename to...
1686 (Dwo_file::read_unit_index): ...this.
1687 (Dwo_file::sized_read_compunit_index)
1688 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1689 (Dwo_file::sized_read_unit_index): ...this.
1690 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1691 parameters; add section_id parameter.
1692 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1693 (Dwo_file::add_unit_set): ...this.
1694 (Dwo_file::shndx_map_): Remove.
1695 (Dwo_file::sect_offsets_): New data member.
1696 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1697 (Dwp_output_file::add_section): Rename to...
1698 (Dwp_output_file::add_contribution): ...this.
1699 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1700 (Dwp_output_file::add_tu_set): Likewise.
1701 (Dwp_output_file::Contribution): New type.
1702 (Dwp_output_file::Section::contributions): New data member.
1703 (Dwp_output_file::Cu_or_tu_set): Remove.
1704 (Dwp_output_file::Section::Section): New ctor.
1705 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1706 (Dwp_output_file::Dwp_index::Section_table): New type.
1707 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1708 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1710 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1711 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1712 (Dwp_output_file::Dwp_index::section_table): New member function.
1713 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1714 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1715 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1716 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1717 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1718 (Dwp_output_file::Dwp_index::section_table_): New data member.
1719 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1720 (Dwp_output_file::add_output_section): New member function.
1721 (Dwp_output_file::write_new_section): New member function.
1722 (Dwp_output_file::write_contributions): New member function.
1723 (Dwp_output_file::section_id_map_): New data member.
1724 (class Dwo_id_info_reader): Remove.
1725 (class Unit_reader): New class.
1726 (get_dwarf_section_name): New function.
1727 (Dwo_file::read_executable): Adjust initializations of class data.
1728 (Dwo_file::read): Add support for v2 package file format.
1729 (Dwo_file::read_unit_index): Likewise.
1730 (Dwo_file::sized_read_unit_index): Likewise.
1731 (Dwo_file::copy_section): Likewise.
1732 (Dwo_file::add_unit_set): Likewise.
1733 (Dwp_output_file::add_output_section): Likewise.
1734 (Dwp_output_file::add_contribution): Likewise.
1735 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1737 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1739 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1741 (Dwp_output_file::initialize): Remove unused function.
1742 (Dwp_output_file::finalize): Add support for v2 package file format.
1743 (Dwp_output_file::write_index): Likewise.
1744 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1747 2013-10-31 Cary Coutant <ccoutant@google.com>
1749 * configure.ac: Fix check for -fmerge-constants.
1750 * configure.ac: Regenerate.
1752 2013-10-30 Roland McGrath <mcgrathr@google.com>
1754 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1755 Correct 9-byte nop sequence to match what the assembler generates.
1757 2013-10-30 Alan Modra <amodra@gmail.com>
1759 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1760 ppc64_local_entry_offset, ppc64_local_entry_offset,
1761 do_read_symbols): New functions.
1762 (Powerpc_relobj::e_flags_, st_other_): New vars.
1763 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1764 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1765 (Powerpc_relobj::e_flags_): New var.
1766 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1767 and adjust for ELFv2.
1768 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1769 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1770 (Powerpc_dynobj::do_find_special_sections): Likewise.
1771 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1772 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1773 to ELFv2 local entry.
1774 (Target_powerpc::do_relax): No thread safe barriers needed for
1776 (Output_data_plt_powerpc::initial_plt_entry_size_,
1777 plt_entry_size): Delete. Replace all uses with
1778 first_plt_entry_offset() and plt_entry_size().
1779 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1780 reserved_size parm. Update callers.
1781 (Output_data_plt_powerpc::entry_count): Update.
1782 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1783 and use Target_powerpc::first_plt_entry_offset().
1784 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1785 rename to plt_entry_size.
1786 (Output_data_plt_powerpc::add_ifunc_entry,
1787 add_local_ifunc_entry): Adjust reloc for ELFv2.
1788 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1789 (glink_eh_frame_fde_64v2): New.
1790 (Stub_table::plt_call_size): Support ELFv2 sizing.
1791 (Output_data_glink::add_eh_frame): Use the new FDE.
1792 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1793 (Stub_table::do_write): Write ELFv2 stubs and glink.
1794 (Target_powerpc::Relocate::relocate): Replaces nop after call
1795 with ld 2,24(1) and adjust local offset destination for ELFv2.
1797 2013-10-30 Alan Modra <amodra@gmail.com>
1799 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1800 (Target_powerpc::Scan::global, local): Likewise.
1801 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1802 on all ppc64 @h and @ha relocs.
1804 2013-10-14 Alan Modra <amodra@gmail.com>
1806 * output.h (Output_data_got::add_constant): Tidy.
1807 (Output_data_got::add_constant_pair): New function.
1808 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1809 methods used so as to first call reserve_ent().
1811 2013-10-11 Roland McGrath <mcgrathr@google.com>
1813 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1814 add_got_entry and add_got_entry_pair.
1816 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1817 (HAVE_PUBNAMES): Likewise.
1818 * configure: Regenerate.
1820 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1821 * testsuite/Makefile.in: Regenerate.
1823 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1824 Remove const from declaration.
1825 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1826 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1827 * output.h (Output_file_header): Remove const from member target_
1828 and corresponding constructor argument.
1829 * output.cc (Output_file_header::Output_file_header): Update prototype.
1830 (Output_file_header::do_sized_write): Use this->target_ in place
1831 of parameters()->target().
1833 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1835 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1836 * configure: Regenerate.
1837 * Makefile.in: Regenerate.
1838 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1839 * testsuite/merge_string_literals_2.c: Likewise.
1840 * testsuite/Makefile.am
1841 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1842 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1843 literal -fmerge-constants.
1844 * testsuite/Makefile.in: Regenerate.
1846 * i386.cc (Target_i386): Remove unused member dynbss_.
1847 * arm.cc (Target_arm): Likewise.
1848 * powerpc.cc (Target_powerpc): Likewise.
1849 * sparc.cc (Target_sparc): Likewise.
1850 * tilegx.cc (Target_tilegx): Likewise.
1851 * x86_64.cc (Target_x86_64): Likewise.
1852 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1853 type_signature_, type_offset_.
1854 * plugin.h (Plugin_hook): Remove unused member layout_.
1855 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1857 (Read_member): Remove unused members input_objects_, symtab_,
1859 (Check_library): Remove unused member symtab_.
1860 * archive.h (Lib_group): Remove unused member lib_.
1861 * archive.cc (Lib_group::Lib_group): Update initializer.
1862 * incremental.h (Incremental_binary): Remove unused member target_.
1863 (Incremental_script_entry): Removed unused member script_.
1864 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1865 * icf.h (Icf): Remove unused member num_tracked_relocs.
1867 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1868 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1870 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1872 * archive.h: Use struct rather than class for forward declaration
1873 of Read_symbols_data.
1875 2013-10-07 Cary Coutant <ccoutant@google.com>
1878 * testsuite/Makefile.am (icf_test): Fix dependencies.
1879 (icf_safe_test): Likewise.
1880 (icf_safe_so_test): Likewise.
1881 (large_symbol_alignment): Add empty _LDADD rule.
1882 * testsuite/Makefile.in: Regenerate.
1884 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1887 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1888 relocation for R_X86_64_32 on x32.
1890 2013-08-27 Roland McGrath <mcgrathr@google.com>
1892 * output.cc (Output_segment::set_section_addresses): Take new
1893 Target* argument. If target->isolate_execinstr() and the segment
1894 is executable and starts at a target->abi_pagesize() boundary,
1895 pad its end out to a target->abi_pagesize() boundary with code fill.
1896 * output.h (Output_segment::set_section_addresses): Update decl.
1897 * layout.h (Layout::check_output_data_for_reset_values): Take new
1898 argument RELAX_OUTPUTS.
1899 (Layout): New member relax_output_list_.
1900 (Layout::add_relax_output): New method.
1901 * layout.cc (Layout::Layout): Update constructor.
1902 (Layout::reset_relax_output): New method.
1903 (Layout::clean_up_after_relaxation): Call it.
1904 (Layout::prepare_for_relaxation): Update caller.
1905 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1906 Call reset_relax_output before re-processing segments for
1907 isolate_execinstr case.
1908 (Layout::write_data): Handle relax_output_list_.
1909 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1910 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1912 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1915 * object.h: Fix typos.
1917 2013-08-16 Roland McGrath <mcgrathr@google.com>
1919 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1920 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1922 2013-08-07 Cary Coutant <ccoutant@google.com>
1924 Revert support for v2 DWP files:
1926 2013-03-01 Cary Coutant <ccoutant@google.com>
1928 Add dwp support for v2 DWARF package file format.
1929 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1930 tu_length parameter. Adjust all callers.
1931 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1932 * dwp.cc: Include dwarf.h.
1933 (Section_bounds): New struct type.
1934 (Unit_set): New struct type.
1935 (Dwo_file::Dwo_file): Initialize new data member.
1936 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1937 Combine and rename to...
1938 (Dwo_file::read_unit_index): ...this.
1939 (Dwo_file::sized_read_compunit_index)
1940 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1941 (Dwo_file::sized_read_unit_index): ...this.
1942 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1943 parameters; add section_id parameter.
1944 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1945 (Dwo_file::add_unit_set): ...this.
1946 (Dwo_file::shndx_map_): Remove.
1947 (Dwo_file::sect_offsets_): New data member.
1948 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1949 (Dwp_output_file::add_section): Rename to...
1950 (Dwp_output_file::add_contribution): ...this.
1951 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1952 (Dwp_output_file::add_tu_set): Likewise.
1953 (Dwp_output_file::Contribution): New type.
1954 (Dwp_output_file::Section::contributions): New data member.
1955 (Dwp_output_file::Cu_or_tu_set): Remove.
1956 (Dwp_output_file::Section::Section): New ctor.
1957 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1958 (Dwp_output_file::Dwp_index::Section_table): New type.
1959 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1960 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1962 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1963 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1964 (Dwp_output_file::Dwp_index::section_table): New member function.
1965 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1966 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1967 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1968 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1969 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1970 (Dwp_output_file::Dwp_index::section_table_): New data member.
1971 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1972 (Dwp_output_file::add_output_section): New member function.
1973 (Dwp_output_file::write_new_section): New member function.
1974 (Dwp_output_file::write_contributions): New member function.
1975 (Dwp_output_file::section_id_map_): New data member.
1976 (class Dwo_id_info_reader): Remove.
1977 (class Unit_reader): New class.
1978 (get_dwarf_section_name): New function.
1979 (Dwo_file::read_executable): Adjust initializations of class data.
1980 (Dwo_file::read): Add support for v2 package file format.
1981 (Dwo_file::read_unit_index): Likewise.
1982 (Dwo_file::sized_read_unit_index): Likewise.
1983 (Dwo_file::copy_section): Likewise.
1984 (Dwo_file::add_unit_set): Likewise.
1985 (Dwp_output_file::add_output_section): Likewise.
1986 (Dwp_output_file::add_contribution): Likewise.
1987 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1989 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1991 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1993 (Dwp_output_file::initialize): Remove unused function.
1994 (Dwp_output_file::finalize): Add support for v2 package file format.
1995 (Dwp_output_file::write_index): Likewise.
1996 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1999 2013-07-31 Cary Coutant <ccoutant@google.com>
2001 * object.cc (Sized_relobj::do_output_section_address): New function.
2002 (Sized_relobj): Instantiate explicitly.
2003 * object.h (Object::output_section_address): New function.
2004 (Object::do_output_section_address): New function.
2005 (Sized_relobj::do_output_section_address): New function.
2006 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2008 2013-07-30 Cary Coutant <ccoutant@google.com>
2009 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2011 * parameters.cc (Parameters::entry): Return target-specific entry
2013 * target.h (Target::entry_symbol_name): New function.
2014 (Target_info::entry_symbol_name): New data member.
2016 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2017 * i386.cc (Target_i386::i386_info): Likewise.
2018 (Target_i386_nacl::i386_nacl_info): Likewise.
2019 * sparc.cc (Target_sparc::sparc_info): Likewise.
2020 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2021 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2022 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2023 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2025 2013-07-22 Sterling Augustine <saugustine@google.com>
2027 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2028 Convert parameter shndx to local variable. Add parameters symtab
2029 and symtab_size. Scan over section names. Find relocation
2030 section corresponding to current section. Create and initialize
2031 reloc_mapper_ and reloc_type_.
2032 (Dwarf_pubnames_table::read_header): Add assertion. Change
2033 unit_length to off_t. Initialize member unit_length_. Fill in field
2035 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2036 Initialize new fields unit_length_ and cu_offset_.
2037 (Dwarf_pubnames_table::read_section): Update prototype.
2038 (Dwarf_pubnames_table::cu_offset): New member function.
2039 (Dwarf_pubnames_table::subsection_size): Likewise.
2040 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2042 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2043 member functions public.
2044 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2045 Update comment. Rework logic. Move repeated parts to...
2046 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2047 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2048 pubtypes_table_, and stmt_list_offset.
2049 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2050 Gdb_index::find_pubtype_offset,
2051 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2052 (Gdb_index::pubnames_read): Update prototype and rework logic.
2053 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2055 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2056 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2057 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2058 Gdb_index::map_pubtable_to_dies):
2060 (Gdb_index::pubnames_read): Update declaration.
2061 (Gdb_index::Pubname_offset_map): New type.
2062 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2063 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2064 Gdb_index::stmt_list_offset): Declare.
2065 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2066 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2067 Gdb_index::pubtypes_offset_): Remove.
2069 2013-07-19 Roland McGrath <mcgrathr@google.com>
2071 * options.h (General_options): Add -Trodata-segment option.
2072 * parameters.cc (Parameters::check_rodata_segment): New function.
2073 (Parameters::set_target_once): Call it.
2074 * parameters.h (Parameters): Declare it (private member function).
2075 * layout.cc (load_seg_unusable_for_headers): New function, broken
2076 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2077 then validate rodata segment rather than text segment.
2078 (relaxation_loop_body): Call that.
2079 (is_text_segment): New function. Don't admit a non-executable
2080 segment if TARGET->isolate_execinstr().
2081 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2083 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2086 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2087 * nacl.h (Sniff_file::View::View): Request aligned view.
2089 2013-07-11 Cary Coutant <ccoutant@google.com>
2091 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2092 correct BRLT entry size.
2094 2013-07-03 Alan Modra <amodra@gmail.com>
2096 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2099 2013-07-01 Cary Coutant <ccoutant@google.com>
2101 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2103 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2104 (Dwarf_ranges_table::lookup_reloc): New function.
2105 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2107 (Dwarf_ranges_table::lookup_reloc): New function.
2108 (Dwarf_ranges_table::reloc_type_): New data member.
2110 2013-06-27 Jing Yu <jingyu@google.com>
2113 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2115 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2116 (Target_powerpc::do_relax): Call the above.
2118 2013-06-27 Cary Coutant <ccoutant@google.com>
2120 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2121 on garbage collected .opd section.
2123 2013-06-27 Alan Modra <amodra@gmail.com>
2125 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2127 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2128 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2130 2013-06-14 Cary Coutant <ccoutant@google.com>
2132 * resolve.cc (Symbol::override_base): Don't override st_type
2133 from plugin placeholder symbols.
2134 (Symbol_table::resolve): Likewise.
2135 (Symbol_table::should_override): Don't complain about TLS mismatch
2136 if the TO symbol is a plugin placeholder.
2137 * testsuite/Makefile.am (plugin_test_tls): New test.
2138 * testsuite/Makefile.in: Regenerate.
2139 * testsuite/plugin_test_tls.sh: New test script.
2140 * testsuite/two_file_test_2_tls.cc: New test source.
2141 * testsuite/two_file_test_tls.cc: New test source.
2143 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2145 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2146 the maximum segment alignment is larger than the page size.
2147 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2148 correctly aligns the symbols with large alignemnt.
2149 * testsuite/Makefile.in: Regenerate.
2150 * testsuite/large_symbol_alignment.cc: New file.
2152 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2153 Sriraman Tallam <tmsriram@google.com>
2155 * options.h (sort_section): New option.
2156 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2157 Rename from Input_section_sort_section_name_special_ordering_compare.
2158 (Input_section_sort_section_name_compare): New struct.
2159 * output.cc (Output_section::Input_section_sort_section_name_compare::
2160 operator()): New function.
2161 (Output_section::sort_attached_input_sections): Use new sort function
2162 for .text if --sort-section=name is specified.
2163 * layout.cc (Layout::make_output_section):
2164 Add sorting by name when --sort-section=name is specified.
2165 * testsuite/Makefile.am (text_section_grouping): Test option
2166 --sort-section=name.
2167 * testsuite/Makefile.in: Regenerate.
2168 * testsuite/section_sorting_name.cc: New file.
2169 * testsuite/section_sorting_name.sh: New file.
2171 2013-05-21 Cary Coutant <ccoutant@google.com>
2173 * symtab.h (Symbol::is_cxx_vtable): New function.
2174 * target-reloc.h (relocate_section): Check for vtable symbol.
2175 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2176 * testsuite/Makefile.in: Regenerate.
2177 * testsuite/missing_key_func.cc: New test source.
2178 * testsuite/missing_key_func.sh: New test script.
2180 2013-05-21 Cary Coutant <ccoutant@google.com>
2182 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2183 type of enclosing symbol.
2184 (Relocate_info::location): Check symbol type when describing symbol.
2185 * object.h (Symbol_location_info): Remove unused line_number;
2186 add enclosing_symbol_type.
2187 * testsuite/debug_msg.sh: Adjust expected output.
2189 2013-05-13 Cary Coutant <ccoutant@google.com>
2191 * configure.ac: Export DEFAULT_TARGET.
2192 * configure: Regenerate.
2193 * Makefile.in: Regenerate.
2194 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2195 * testsuite/Makefile.in: Regenerate.
2196 * testsuite/debug_msg.sh: Delete duplicate tests.
2197 Don't check undef_int error message match for powerpc where the
2198 source file and line number aren't available.
2200 2013-05-10 Roland McGrath <mcgrathr@google.com>
2202 * options.h (General_options): Add --rosegment-gap option.
2203 * options.cc (finalize): --rosegment-gap implies --rosegment.
2204 * layout.cc (set_segment_offsets): Let user option override
2205 target->rosegment_gap().
2207 2013-05-10 Roland McGrath <mcgrathr@google.com>
2209 * options.h (General_options): Remove leading space from help
2210 messages for -nostdlib and --rosegment.
2212 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2215 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2217 2013-05-03 Alan Modra <amodra@gmail.com>
2219 * merge.cc (Output_merge_string::do_add_input_section): Correct
2220 scan for number of strings. Rename vars to avoid shadowing.
2221 Include missing terminator in input_size_.
2223 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2225 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2226 Restore empty string handling.
2228 2013-05-01 Cary Coutant <ccoutant@google.com>
2230 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2231 uninitialized warning.
2233 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2235 * output.cc (Output_section::add_merge_input_section): Allow
2236 to merge sections if the alignment is more than character size.
2237 * merge.h (Output_merge_string::Output_merge_string): Remove
2239 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2240 only not-null strings. Check the alignment of strings.
2242 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2243 alignment as the argument.
2244 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2245 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2246 Align non-zero length strings according to the addralign_.
2247 (Stringpool_template<Stringpool_char>::set_string_offsets):
2248 Updating offsets according to the given alignment.
2249 * testsuite/Makefile.am (text_section_grouping): Test if string
2250 literals are getting merged.
2251 * testsuite/Makefile.in: Regenerate.
2252 * testsuite/merge_string_literals_1.c: New file.
2253 * testsuite/merge_string_literals_2.c: Ditto.
2254 * testsuite/merge_string_literals.sh: Ditto.
2256 2013-04-26 Ian Lance Taylor <iant@google.com>
2258 * target-reloc.h (relocate_section): If the reloc offset is out of
2259 range, pass VIEW as NULL to relocate.relocate.
2260 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2261 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2262 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2263 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2264 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2265 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2267 2013-04-26 Geoff Pike <gpike@chromium.org>
2269 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2270 * layout.cc (Hash_task): New class.
2271 (Layout::queue_build_id_tasks): New function.
2272 (Layout::write_build_id): Handle single-thread portion of build ID
2273 computation. (In some cases, all of it is single-threaded.) Replace
2274 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2275 functionality in fewer lines of code.
2276 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2277 * options.h (General_options): make "--build-id" default to tree
2278 rather than sha1. Add two new options related to --build-id=tree:
2279 --build-id-chunk-size-for-treehash and
2280 --build-id-min-file-size-for-treehash.
2281 * Makefile.am: add testing of --build-id=tree and related new options
2282 (these tests will be invoked by "make check").
2283 * Makefile.in: Regenerate.
2285 2013-04-25 Alan Modra <amodra@gmail.com>
2287 * configure.tgt: Add powerpcle and powerpc64le.
2289 2013-04-22 Alan Modra <amodra@gmail.com>
2292 * layout.cc (Layout::segment_precedes): Allow more than one
2293 segment with the same type and flags.
2295 2013-04-15 Cary Coutant <ccoutant@google.com>
2297 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2298 allocate space in file for BSS sections.
2300 2013-04-15 Cary Coutant <ccoutant@google.com>
2302 * script-sections.cc (Orphan_output_section): Reset address
2303 to zero after each orphaned section for relocatable links.
2305 2013-04-15 Cary Coutant <ccoutant@google.com>
2307 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2308 section starting address for relocatable link.
2309 * testsuite/Makefile.am (script_test_11): New test.
2310 * testsuite/Makefile.in: Regenerate.
2311 * testsuite/script_test_11.c: New source file.
2312 * testsuite/script_test_11.t: New linker script.
2314 2013-04-13 Alan Modra <amodra@gmail.com>
2316 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2317 owner when sections are not adjacent and exceed group size.
2318 (Target_powerpc::group_sections): Handle corner case.
2319 (Target_powerpc::Branch_info::make_stub): Handle case where
2320 stub table doesn't exist due to branches in non-exec sections.
2321 (Target_powerpc::Relocate::relocate): Likewise.
2323 2013-04-11 Alan Modra <amodra@gmail.com>
2326 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2327 .branch_lt to match bfd ld. Adjust comments throughout file.
2329 2013-04-04 Ian Lance Taylor <iant@google.com>
2332 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2333 sections before checking whether they are included in the link.
2335 2013-03-29 Sriraman Tallam <tmsriram@google.com>
2337 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2338 object before calling the plugin claim_file handler. Pass the elf
2339 object of the archive to the plugin. Delete the elf object if the
2340 plugin claims the file.
2342 2013-03-21 Alan Modra <amodra@gmail.com>
2344 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2345 segment when omagic.
2347 2013-03-21 Alan Modra <amodra@gmail.com>
2349 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2351 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2352 uninitialized" warning.
2354 2013-03-20 Alan Modra <amodra@gmail.com>
2356 * symtab.h (Symbol::clear_version): New function.
2357 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2358 is_needed by weak references. Clear version for symbols defined
2359 in as-needed objects that are not needed.
2361 2013-03-15 Alan Modra <amodra@gmail.com>
2363 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2364 static and public. Add report_err param. Return false for data refs.
2365 (Target_powerpc::rela_dyn_section): New overloaded function.
2366 (Target_powerpc::plt_, iplt_): Elucidate.
2367 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2368 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2369 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2370 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2371 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2372 push_branch and make_plt_entry for ifunc syms when
2373 reloc_needs_plt_for_ifunc.
2374 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2375 for ifunc unless reloc_needs_plt_for_ifunc.
2377 2013-03-15 Alan Modra <amodra@gmail.com>
2379 * gc.h (gc_process_relocs): Don't look through function descriptors.
2380 * icf.cc (get_section_contents): Do so here instead.
2382 2013-03-13 Alan Modra <amodra@gmail.com>
2384 * powerpc.cc (is_branch_reloc): Forward declare.
2385 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2386 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2387 false for 64-bit, true for 32-bit non-branch relocs.
2388 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2389 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2391 (icf_safe_test): Generate linker map file as well as nm output.
2392 (icf_safe_so_test): Likewise.
2393 * testsuite/Makefile.in: Regenerate.
2394 * testsuite/icf_test.sh: Parse linker map file to determine
2396 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2397 * testsuite/icf_safe_so_test.sh: Likewise.
2398 (X86_32_or_ARM_specific_safe_fold): Merge into..
2399 (arch_specific_safe_fold): ..this.
2400 (X86_64_specific_safe_fold): Delete unused function.
2402 2013-03-12 Alan Modra <amodra@gmail.com>
2404 * gc.h (gc_process_relocs): Look through function descriptors
2405 to determine shndx, symvalue and addend used by ICF. Tidy
2406 variable duplication.
2408 2013-03-11 Alan Modra <amodra@gmail.com>
2410 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2411 * layout.cc (Layout_task_runner::run): ..to here.
2412 * symtab.h (struct Symbol_location): Extract from..
2413 (class Symbol_table): ..here.
2414 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2415 * target.h (class Target): Add function_location and
2416 do_function_location functions.
2417 (class Sized_target): Add do_function_location.
2418 * object.h (class Sized_relobj_file): Move find_shdr..
2419 (class Object): ..to here.
2420 * object.cc: Likewise. Update to suit. Instantiate.
2421 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2422 * powerpc.cc (class Powerpc_dynobj): New.
2423 (Target_powerpc::do_function_location): New function.
2424 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2425 (Powerpc_dynobj::do_read_symbols): New function.
2426 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2428 2013-03-08 Ian Lance Taylor <iant@google.com>
2430 * options.cc (General_options::string_to_object_format): Accept
2433 2013-03-08 Alan Modra <amodra@gmail.com>
2435 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2436 pointer to Post_fde.
2437 (struct Post_fde): Move definition to here..
2438 * ehframe.cc (struct Post_fde): ..from here.
2439 (Cie::write): Don't alloc Post_fde.
2440 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2442 2013-03-07 Alan Modra <amodra@gmail.com>
2444 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2445 relocation referencing .LC0.
2446 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2448 2013-03-07 Alan Modra <amodra@gmail.com>
2450 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2451 always_inline. Add assembly for powerpc to avoid GOT.
2453 2013-03-07 Alan Modra <amodra@gmail.com>
2455 * testsuite/script_test_10.sh: Don't test .bss section
2458 2013-03-06 Alan Modra <amodra@gmail.com>
2460 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2461 (Target_powerpc::symval_for_branch): Add symtab param. Update
2462 all callers. Handle folded sections.
2463 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2465 (Global_symbol_visitor_opd::operator()): Likewise.
2467 2013-03-04 Alan Modra <amodra@gmail.com>
2469 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2470 * testsuite/Makefile.in: Regenerate.
2472 2013-03-01 Cary Coutant <ccoutant@google.com>
2474 Add dwp support for v2 DWARF package file format.
2475 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2476 tu_length parameter. Adjust all callers.
2477 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2478 * dwp.cc: Include dwarf.h.
2479 (Section_bounds): New struct type.
2480 (Unit_set): New struct type.
2481 (Dwo_file::Dwo_file): Initialize new data member.
2482 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2483 Combine and rename to...
2484 (Dwo_file::read_unit_index): ...this.
2485 (Dwo_file::sized_read_compunit_index)
2486 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2487 (Dwo_file::sized_read_unit_index): ...this.
2488 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2489 parameters; add section_id parameter.
2490 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2491 (Dwo_file::add_unit_set): ...this.
2492 (Dwo_file::shndx_map_): Remove.
2493 (Dwo_file::sect_offsets_): New data member.
2494 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2495 (Dwp_output_file::add_section): Rename to...
2496 (Dwp_output_file::add_contribution): ...this.
2497 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2498 (Dwp_output_file::add_tu_set): Likewise.
2499 (Dwp_output_file::Contribution): New type.
2500 (Dwp_output_file::Section::contributions): New data member.
2501 (Dwp_output_file::Cu_or_tu_set): Remove.
2502 (Dwp_output_file::Section::Section): New ctor.
2503 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2504 (Dwp_output_file::Dwp_index::Section_table): New type.
2505 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2506 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2508 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2509 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2510 (Dwp_output_file::Dwp_index::section_table): New member function.
2511 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2512 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2513 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2514 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2515 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2516 (Dwp_output_file::Dwp_index::section_table_): New data member.
2517 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2518 (Dwp_output_file::add_output_section): New member function.
2519 (Dwp_output_file::write_new_section): New member function.
2520 (Dwp_output_file::write_contributions): New member function.
2521 (Dwp_output_file::section_id_map_): New data member.
2522 (class Dwo_id_info_reader): Remove.
2523 (class Unit_reader): New class.
2524 (get_dwarf_section_name): New function.
2525 (Dwo_file::read_executable): Adjust initializations of class data.
2526 (Dwo_file::read): Add support for v2 package file format.
2527 (Dwo_file::read_unit_index): Likewise.
2528 (Dwo_file::sized_read_unit_index): Likewise.
2529 (Dwo_file::copy_section): Likewise.
2530 (Dwo_file::add_unit_set): Likewise.
2531 (Dwp_output_file::add_output_section): Likewise.
2532 (Dwp_output_file::add_contribution): Likewise.
2533 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2535 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2537 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2539 (Dwp_output_file::initialize): Remove unused function.
2540 (Dwp_output_file::finalize): Add support for v2 package file format.
2541 (Dwp_output_file::write_index): Likewise.
2542 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2545 2013-03-01 Cary Coutant <ccoutant@google.com>
2547 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2548 function into class definition in header file.
2549 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2550 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2552 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2554 2013-02-28 Alan Modra <amodra@gmail.com>
2556 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2557 * target.cc (Target::do_plt_fde_location): New function.
2558 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2559 accessor function, and constructor param.
2560 (struct Post_fde, Post_fdes): Declare.
2561 (Cie::write): Add post_fdes param.
2562 * ehframe.cc (Fde::write): Use plt_fde_location.
2563 (struct Post_fde): Define.
2564 (Cie::write): Stash FDEs added post merge mapping.
2565 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2566 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2567 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2569 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2570 (Target_powerpc::has_glink): New function.
2571 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2572 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2573 glink_eh_frame_fde_32, default_fde): New data.
2574 (Stub_table::eh_frame_added_): New var.
2575 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2577 (Stub_table::add_eh_frame): New function.
2578 (Output_data_glink::add_eh_frame): New function.
2579 (Target_powerpc::make_glink_section): Call add_eh_frame.
2581 2013-02-15 Ian Lance Taylor <iant@google.com>
2583 * options.h (DEFINE_uint64_alias): Define.
2584 (class General_options): Add -Ttext-segment as an alias for
2587 2013-02-15 Alan Modra <amodra@gmail.com>
2589 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2590 (Stub_table::do_write): ..here, two places.
2591 (Stub_table::plt_call_size): Use it here too.
2593 2013-02-11 Ian Lance Taylor <iant@google.com>
2595 * descriptors.cc (Descriptors::close_all): New function.
2596 * descriptors.h (class Descriptors): Declare close_all.
2597 (close_all_descriptors): New inline function.
2598 * plugin.cc: Include "descriptors.h".
2599 (Plugin_manager::cleanup): Call close_all_descriptors.
2601 2013-02-06 Alan Modra <amodra@gmail.com>
2603 * README: Update coding style link.
2605 2013-01-28 Cary Coutant <ccoutant@google.com>
2607 * dwp.cc (File_list): New typedef.
2608 (Dwo_name_info_reader): New class.
2609 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2610 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2611 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2612 (Dwo_file::read_executable): New function.
2613 (Dwo_file::read): Move common setup code to ...
2614 (Dwo_file::make_object): ... here.
2615 (dwp_options): Add --exec/-e.
2619 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2621 * layout.cc (Layout::layout): Check for option text_reorder.
2622 (Layout::make_output_section): Ditto.
2623 * options.h (text_reorder): New option.
2624 * output.cc (Input_section_sort_compare): Remove special ordering
2627 Input_section_sort_section_name_special_ordering_compare::
2628 operator()): New function.
2629 (Output_section::sort_attached_input_sections): Use new sort function
2631 * output.h (Input_section_sort_section_name_special_ordering_compare):
2633 * testsuite/Makefile.am (text_section_grouping): Test option
2635 * testsuite/Makefile.in: Regenerate.
2636 * testsuite/text_section_grouping.sh: Check order of functions without
2637 default text reordering.
2639 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2641 * options.h (General_options): Change default to true for new_dtags.
2643 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2645 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2646 when enable_new_dtags is false. Only add DT_RUNPATH when
2647 enable_new_dtags is true.
2649 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2651 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2652 used in declaration and definition consistent.
2653 (Target_powerpc::symval_for_branch): Ditto.
2655 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2657 * testsuite/plugin_final_layout.cc: Fix comment.
2659 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2661 * layout.cc (Layout::layout): Do not do default sorting for
2662 text sections when section ordering is specified.
2663 (make_output_section): Ditto.
2664 * testsuite/plugin_final_layout.cc: Name the function sections
2665 to catch reordering issues.
2667 2013-01-15 Alan Modra <amodra@gmail.com>
2669 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2672 2013-01-15 Alan Modra <amodra@gmail.com>
2674 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2675 * testsuite/Makefile.in: Regenerate.
2677 2013-01-14 Alan Modra <amodra@gmail.com>
2679 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2680 * testsuite/Makefile.in: Regenerate.
2682 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2685 Fix mingw gold build with plugins enabled
2686 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2687 * configure.ac: Export DLOPEN_LIBS and add headers check.
2688 * plugin.cc: Handle non-dlfcn case.
2689 * Makefile.in: Regenerate.
2690 * config.in: Regenerate.
2691 * configure: Regenerate.
2692 * testsuite/Makefile.in: Regenerate.
2694 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2696 * output.h (sort_attached_input_sections): Change to be public.
2697 * script-sections.cc
2698 (Output_section_definition::set_section_addresses): Sort
2699 attached input sections according to section order before linker
2700 script assigns section addresses.
2701 (Orphan_output_section::set_section_addresses): Sort
2702 attached input sections according to section order before linker
2703 script assigns section addresses.
2704 * Makefile.am (final_layout.sh): Use a simple linker script to
2705 check if section ordering still works.
2706 * Makefile.in: Regenerate.
2708 2013-01-09 Ben Cheng <bccheng@google.com>
2710 * arm.cc (Target_arm::attributes_accept_div): New function.
2711 (Target_arm::attributes_forbid_div): New function.
2712 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2713 attribute using the same new functions as what bfd/elf32_arm.c
2716 2013-01-07 Cary Coutant <ccoutant@google.com>
2719 * output.cc (Output_section::add_input_section): For incremental
2720 updates, don't track input sections that are allocated from patch
2723 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2724 Ian Lance Taylor <iant@google.com>
2727 * configure.ac (--enable-ld): Removed.
2728 (install_as_default): Set to yes only for --enable-gold=default
2730 * configure: Regenerated.
2732 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2734 * options.h (General_options): Add -fuse-ld= for GCC linker
2735 option compatibility.
2737 2013-01-04 Cary Coutant <ccoutant@google.com>
2739 * configure.ac: Fix typo restoring CXXFLAGS.
2740 * configure: Regenerate.
2742 2013-01-04 Cary Coutant <ccoutant@google.com>
2744 * testsuite/Makefile.am (CXXLINK_S): New macro.
2745 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2746 * testsuite/Makefile.in: Regenerate.
2748 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2750 * version.cc (print_version): Update copyright year to 2013.
2752 2012-12-20 Ian Lance Taylor <iant@google.com>
2754 * layout.cc (Layout::special_ordering_of_input_section): New
2756 (Layout::layout): If input section requires special ordering, must
2757 sort input sections.
2758 (Layout::make_output_section): May sort .text input sections.
2759 (Layout::is_section_name_prefix_grouped): Remove.
2760 * layout.h (class Layout): Declare
2761 special_ordering_of_input_section. Don't declare
2762 is_section_name_prefix_grouped.
2763 * output.cc (Output_section::add_input_section): Revert last
2765 (Output_section::Input_section_sort::match_file_name): Don't crash
2766 if called on output section data.
2767 (Output_section::Input_section_sort_compare): Sort based on
2769 (Output_section::Input_section_sort_section_order_index_compare):
2771 (Output_section::sort_attached_input_sections): Likewise.
2773 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2775 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2776 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2777 * output.cc (Output_section::add_input_section): Check if section
2778 name contains special prefix. Keep input sections to sort such
2780 (Output_section::Input_section_sort_section_order_index_compare
2781 ::operator()): Group sections according to prefixes.
2782 (Output_section::sort_attached_input_sections): Add condition to
2783 Input_section_entry constructor call.
2784 * testsuite/Makefile.am (text_section_grouping): New test.
2785 * testsuite/Makefile.in: Regenerate.
2786 * testsuite/text_section_grouping.cc: New file.
2787 * testsuite/text_section_grouping.sh: New file.
2789 2012-12-17 Nick Clifton <nickc@redhat.com>
2791 * Makefile.am: Add copyright notice.
2794 * configure.ac: Likewise.
2795 * ftruncate.c: Likewise.
2796 * Makefile.in: Regenerate.
2798 2012-12-14 Cary Coutant <ccoutant@google.com>
2800 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2801 --no-as-needed flag.
2802 (exception_separate_shared_12_test): Likewise.
2803 (incremental_copy_test): Likewise.
2804 * testsuite/Makefile.in: Regenerate.
2806 2012-12-14 Cary Coutant <ccoutant@google.com>
2808 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2809 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2811 2012-12-12 Alan Modra <amodra@gmail.com>
2813 * powerpc.cc (class Track_tls): New.
2814 (class Relocate, class Scan): Inherit Track_tls.
2815 (Target_powerpc::Scan::local, global): Track tls optimization
2816 and avoid creating plt entry for __tls_get_addr if all uses
2818 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2820 2012-12-12 Alan Modra <amodra@gmail.com>
2822 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2823 Replace no_toc_optimize with toc_optimize.
2824 * output.h (Output_section::input_sections): Provide non-const variant.
2825 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2826 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2828 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2829 (class Sort_toc_sections): New.
2830 (Target_powerpc::do_finalize_sections): Sort toc sections.
2831 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2833 2012-12-10 Roland McGrath <mcgrathr@google.com>
2835 * testsuite/binary_unittest.cc (read_all): New function.
2836 (Sized_binary_test): Use it instead of ::read.
2837 * fileread.cc (do_read): Don't assume pread always reads the whole
2838 amount in a single call.
2840 2012-12-10 Alan Modra <amodra@gmail.com>
2842 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2843 Set EM_PPC64 or EM_PPC here.
2844 (Target_selector_powerpc::do_recognize): Delete.
2846 2012-12-10 Alan Modra <amodra@gmail.com>
2848 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2850 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2852 2012-12-07 Roland McGrath <mcgrathr@google.com>
2854 * testsuite/binary_unittest.cc (Sized_binary_test):
2855 Use open_descriptor rather than ::open.
2857 2012-12-07 Alan Modra <amodra@gmail.com>
2859 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2860 typedef and invalid_address constant.
2861 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2862 instantiate constants.
2864 2012-12-06 Roland McGrath <mcgrathr@google.com>
2866 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2867 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2868 * aclocal.m4: Regenerate.
2869 * configure: Regenerate.
2870 * Makefile.in: Regenerate.
2871 * testsuite/Makefile.in: Regenerate.
2873 2012-12-07 Alan Modra <amodra@gmail.com>
2875 * options.h (General_options): Add no_toc_optimize.
2876 * powerpc.cc (ok_lo_toc_insn): New function.
2877 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2879 2012-12-06 Alan Modra <amodra@gmail.com>
2881 * options.h (General_options): Add plt_align, plt_static_chain,
2882 plt_thread_safe. Update stub_group_size help text.
2883 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2884 for new plt_thread_safe_ var.
2885 (use_plt_offset): Correct comments.
2886 (Target_powerpc::do_relax): Look for thread creation symbols to
2887 determine default plt_thread_safe value. Clear plt call stubs
2888 as well as branch stubs each iteration.
2889 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2891 (l, hi, ha, write_insn): Move earlier.
2892 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2893 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2895 (Stub_table::update_size): Adjust.
2896 (Stub_table::prev_size, set_prev_size): Delete.
2897 (Stub_table::stub_align): Let --plt-align affect result.
2898 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2899 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2900 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2901 (Stub_table::do_write): Support more stub variants.
2903 2012-12-04 Alan Modra <amodra@gmail.com>
2905 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2906 (Target_powerpc::do_define_standard_symbols): New function.
2908 2012-12-03 Alan Modra <amodra@gmail.com>
2910 * output.h: Formatting, whitespace.
2912 2012-12-03 Alan Modra <amodra@gmail.com>
2914 * layout.h (Layout::get_executable_sections): Declare.
2915 * layout.cc (Layout::get_executable_sections): New function.
2916 * arm.cc (Target_arm::group_sections): Use it.
2917 (Arm_output_section::group_sections): Delete now redundant test.
2918 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2919 param to handle relative relocs.
2920 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2921 (Output_data_reloc::add_absolute): Adjust.
2922 (Output_data_reloc::add_relative): New function.
2923 (Output_data::reset_data_size): New function.
2924 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2925 (Output_section::set_addralign): New function.
2926 (Output_section::checkpoint_set_addralign): New function.
2927 (Output_section::clear_section_offsets_need_adjustment): New function.
2928 (Output_section::input_sections): Make public.
2929 * powerpc.cc (class Output_data_brlt_powerpc): New.
2930 (class Stub_table, class Stub_control): New.
2931 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2932 stub_table_, set_stub_table, stub_table): New vectors and accessor
2934 (Target_powerpc::do_may_relax, do_relax, push_branch,
2935 new_stub_table, stub_tables, brlt_section, group_sections,
2936 add_branch_lookup_table, find_branch_lookup_table,
2937 write_branch_lookup_table, make_brlt_section): New functions.
2938 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2939 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2940 branch_info_): New vars.
2941 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2942 make call stubs here.
2943 (Output_data_glink): Remove all call stub handling from this class.
2944 (Target_powerpc::Scan::local, global): Save interesting branch
2945 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2946 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2947 functions on final link.
2948 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2949 Handle long branch destinations too.
2950 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2951 do_plt_address_for_local): Adjust lookup of plt call stubs.
2953 2012-11-30 Alan Modra <amodra@gmail.com>
2955 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2956 relocs against protected symbols when building 32-bit shared libs.
2958 2012-11-30 Alan Modra <amodra@gmail.com>
2960 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2961 param. Call got_section() to make .got. Update all callers
2962 and their callers and so on.
2964 2012-11-30 Alan Modra <amodra@gmail.com>
2966 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2967 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2968 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2969 value if it already exists.
2971 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2974 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2976 2012-11-14 Roland McGrath <mcgrathr@google.com>
2978 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2979 than bfc instruction for data sandboxing.
2981 2012-11-08 Alan Modra <amodra@gmail.com>
2983 * po/POTFILES.in: Regenerate.
2985 2012-11-05 Alan Modra <amodra@gmail.com>
2987 * configure.ac: Apply 2012-09-10 change to config.in here.
2988 * configure: Regenerate.
2990 2012-11-05 Alan Modra <amodra@gmail.com>
2992 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2993 (struct Opd_ent): Use "Address" rather than "Offset".
2994 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2995 (Target_powerpc::got_section): Make public.
2996 (Target_powerpc::scan_relocs): Move code setting symbols..
2997 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2998 Create _SDA_BASE_ only when referenced.
3000 2012-11-02 Roland McGrath <mcgrathr@google.com>
3002 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3005 2012-11-01 Roland McGrath <mcgrathr@google.com>
3007 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3008 for offset_in_output_section parameter.
3009 (Sized_target::relocate_special_relocatable): Likewise.
3010 * arm.cc (Target_arm::relocate_relocs): Likewise.
3011 (Target_arm::relocate_special_relocatable): Likewise.
3012 * i386.cc (Target_i386::relocate_relocs): Likewise.
3013 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3014 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3015 * target-reloc.h (relocate_relocs): Likewise.
3016 * testsuite/testfile.cc (Target_test): Likewise.
3017 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3018 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3020 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3021 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3023 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3024 parameter, which is unused in the [!F_SETFD] case.
3026 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3027 SYMNDX to off_t before comparing it to this->data_size().
3028 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3029 * incremental.cc (Output_section_incremental_inputs::do_write):
3030 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3032 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3034 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3036 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3037 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3040 2012-10-29 Cary Coutant <ccoutant@google.com>
3042 * dwp.cc (usage): Add file and exit status parameters;
3043 add --help and --version options.
3044 (print_version): New function.
3045 (main): Add --help and --version options.
3047 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3049 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3050 final_layout_sequence.txt.
3051 * testsuite/Makefile.in: Regenerated.
3053 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3055 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3056 COMPILE generated by automake.
3058 (CXXCOMPILE1): Likewise.
3059 (CXXLINK1): Likewise.
3060 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3062 (CXXCOMPILE): Likewise.
3063 (CXXLINK): Likewise.
3064 * testsuite/Makefile.in: Regenerated.
3066 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3068 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3069 on bad fwrite return.
3071 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3073 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3076 2012-10-23 Cary Coutant <ccoutant@google.com>
3078 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3079 * testsuite/Makefile.in: Regenerate.
3080 * testsuite/dwp_test.h: New source file.
3081 * testsuite/dwp_test_1.cc: New source file.
3082 * testsuite/dwp_test_1.s: New source file.
3083 * testsuite/dwp_test_1.sh: New source file.
3084 * testsuite/dwp_test_1b.cc: New source file.
3085 * testsuite/dwp_test_1b.s: New source file.
3086 * testsuite/dwp_test_2.cc: New source file.
3087 * testsuite/dwp_test_2.s: New source file.
3088 * testsuite/dwp_test_2.sh: New source file.
3089 * testsuite/dwp_test_main.cc: New source file.
3090 * testsuite/dwp_test_main.s: New source file.
3092 2012-10-23 Cary Coutant <ccoutant@google.com>
3094 * dwp.h: New header file.
3095 * dwp.cc: New source file.
3096 * gold.h: Move shared declarations to system.h.
3097 * system.h: New header file.
3098 * Makefile.am: Add dwp.
3099 * Makefile.in: Regenerate.
3101 2012-10-23 Cary Coutant <ccoutant@google.com>
3103 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3104 Dwarf_info_reader::read_from_pointer.
3105 (Dwarf_pubnames_table::read_header): Likewise.
3106 (Dwarf_pubnames_table::next_name): Likewise.
3107 (Dwarf_die::read_attributes): Likewise.
3108 (Dwarf_die::skip_attributes): Likewise.
3109 (Dwarf_info_reader::read_from_pointer): New function template.
3110 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3111 (Dwarf_pubnames_table): Likewise.
3112 (Dwarf_info_reader::read_from_pointer): New function template.
3113 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3114 Dwarf_pubnames_table ctor.
3116 2012-10-23 Cary Coutant <ccoutant@google.com>
3118 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3120 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3122 (Dwarf_info_reader::set_abbrev_shndx): New method.
3123 (Dwarf_info_reader::abbrev_shndx_): New data member.
3125 2012-10-23 Cary Coutant <ccoutant@google.com>
3127 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3128 from object, not parameters.
3129 (Dwarf_info_reader::parse): Likewise.
3130 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3131 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3132 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3135 2012-10-23 Cary Coutant <ccoutant@google.com>
3137 * fileread.cc (Input_file::Input_file): New constructor.
3138 * fileread.h (class Input_file): Add new constructor.
3140 2012-10-18 Alan Modra <amodra@gmail.com>
3143 * object.cc (Relobj::is_section_name_included): Also match
3144 .sdata personality section.
3146 2012-10-18 Alan Modra <amodra@gmail.com>
3148 * target-reloc.h (class Default_comdat_behavior): New, package up..
3149 (get_comdat_behaviour): ..this.
3150 (relocate_section): Add Relocate_comdat_behavior template arg,
3151 adjust code to suit.
3152 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3153 (Target_arm::scan_reloc_section): Likewise.
3154 * i386.cc (Target_i386::relocate_section): Likewise.
3155 * sparc.cc (Target_sparc::relocate_section): Likewise.
3156 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3157 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3158 * powerpc.cc (class Relocate_comdat_behavior): New.
3159 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3160 gold::relocate_section with new template arg.
3162 2012-10-18 Alan Modra <amodra@gmail.com>
3164 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3165 dynamic relocs for GOT_TPREL got entries, without symbol if
3167 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3168 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3169 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3171 2012-10-17 Alan Modra <amodra@gmail.com>
3174 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3176 2012-10-16 Sriraman Tallam <tmsriram@google.com>
3178 * layout.cc (Layout::include_section): Keep sections marked
3179 SHF_EXCLUDE when doing relocatable links.
3181 2012-10-16 Alan Modra <amodra@gmail.com>
3183 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3184 (Target_powerpc::do_finalize_sections): Call it.
3185 (Output_data_save_res): New class and supporting functions.
3186 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3187 normal symbols defined in object files.
3189 2012-10-12 Alan Modra <amodra@gmail.com>
3191 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3192 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3193 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3194 section if scan_opd_relocs not yet called.
3195 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3197 2012-10-12 Alan Modra <amodra@gmail.com>
3199 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3200 add_local_ifunc_entry): Revert last change.
3201 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3203 2012-10-05 Alan Modra <amodra@gmail.com>
3205 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3206 do_plt_address_for_global): New functions.
3207 (Output_data_got_powerpc::do_write): Don't segfault when linking
3209 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3210 add_local_ifunc_entry): Return true on adding entry..
3211 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3212 glink->add_entry call. Remove unused symtab param. Adjust calls.
3213 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3214 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3215 set up symbols here.
3216 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3217 syms here. Do so even when no .iplt. Don't segfault when linking
3219 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3220 new variants without reloc param.
3221 (Glink_sym_ent::Glink_sym_ent): Likewise.
3222 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3223 reloc when refs will resolve to plt call stub.
3224 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3225 R_PPC_PLTREL24 to resolve locally.
3226 (Target_powerpc::Scan::global): Correct ifunc handling.
3227 (Target_powerpc::Relocate::relocate): Correct local sym glink
3228 lookup. Don't destroy "value" when we have a plt call stub,
3229 and when checking plt call validity.
3230 (Target_powerpc::do_dynsym_value): Simplify.
3232 2012-10-05 Alan Modra <amodra@gmail.com>
3234 * i386.cc (Output_data_plt_i386::address_for_global,
3235 address_for_local): Add plt offset to returned value. Adjust uses.
3236 * sparc.cc (Output_data_plt_sparc::address_for_global,
3237 address_for_local): Likewise.
3238 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3239 address_for_local): Likewise.
3240 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3241 address_for_local): Likewise.
3242 * target.h (Target::plt_address_for_global, plt_address_for_local):
3244 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3245 (Output_data_got::Got_entry::write): Nor here.
3246 * output.h: Comment fix.
3248 2012-10-02 Jiong Wang <jiwang@tilera.com>
3250 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3251 global_offset_table_ value for larget got.
3252 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3254 2012-09-29 Alan Modra <amodra@gmail.com>
3256 * powerpc.cc (Target_powerpc::iplt_): New output section.
3257 (Target_powerpc::iplt_section, make_iplt_section,
3258 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3259 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3260 Target_powerpc::plt_entry_count): Count iplt entries too.
3261 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3262 reloc section in constructor. New params.
3263 (Target_powerpc::make_plt_section): Create reloc section here instead.
3264 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3266 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3267 (Output_data_glink::add_entry, find_entry): New functions to
3268 deal with local syms.
3269 (Glink_sym_ent): Add support for local syms.
3270 (Output_data_glink::do_write): Handle ifunc plt entries.
3271 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3272 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3273 (Target_powerpc::Relocate::relocate): Likewise.
3274 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3276 2012-09-25 Alan Modra <amodra@gmail.com>
3278 * object.h (Sized_relobj_file::adjust_local_symbol,
3279 do_adjust_local_symbol): New functions.
3280 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3281 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3282 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3283 and irregular opd entry spacing.
3284 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3285 (Global_symbol_visitor_opd): New functor.
3286 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3287 on deleted opd entries.
3289 2012-09-15 Jiong Wang <jiwang@tilera.com>
3291 * tilegx.cc: New file.
3292 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3293 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3294 * configure.tgt: Add entries for tilegx*.
3295 * configure.ac: Likewise.
3296 * Makefile.in: Rebuild.
3297 * configure: Likewise.
3298 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3301 2012-09-13 Alan Modra <amodra@gmail.com>
3303 * target-reloc.h (scan_relocs): Call scan.local for relocs
3304 against symbols in discarded sections. Pass is_discarded
3306 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3307 Add is_discarded param.
3308 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3309 is_discarded to flag opd entry as discarded. Don't emit dyn
3310 relocs on such entries.
3311 (Target_powerpc::Scan::global): Similarly detect and handle
3313 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3314 opd_ent_. Update all uses.
3315 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3316 (Target_powerpc::relocate_section): Zero out discarded opd
3319 2012-09-12 Ian Lance Taylor <iant@google.com>
3322 * output.cc: Rename Output_data_got template parameter from size
3323 to got_size for all functions. Compile all variants of
3325 (Output_data_got::Got_entry::write): Correct use of size for
3326 symbol value. Use local_is_tls rather than casting to
3328 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3329 (class Sized_relobj_file): Add do_local_is_tls.
3330 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3332 2012-09-11 Alan Modra <amodra@gmail.com>
3335 * layout.cc (Layout::set_segment_offsets): When using
3336 common-page-size alignment, ensure we are on a new max-page-size
3338 * output.cc (Output_segment::set_section_addresses): Use
3339 abi_pagesize, not common_pagesize for relro boundary.
3340 (Output_segment::set_offset): Likewise.
3342 2012-09-11 Alan Modra <amodra@gmail.com>
3344 * output.h (Output_data_got::add_global_tls, add_local_tls,
3345 add_local_tls_pair): New functions.
3346 (Output_data_got::add_local_pair_with_rel): Remove second
3347 reloc param. Expand comment.
3348 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3349 use_plt_or_tls_offset_, similarly for constructor param.
3350 (Output_data_got::Got_entry::write): Add got_index param.
3351 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3352 add_local_tls_pair): New functions.
3353 (Output_data_got::Got_entry::write): Handle tls symbols
3354 with use_plt_or_tls_offset_ set specially.
3355 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3356 (Output_data_got::do_write): Replace iterator with index, pass
3357 index to entry write function.
3358 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3359 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3360 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3362 * i386.cc (Target_i386::Scan::local): Likewise.
3363 * sparc.cc (Target_sparc::Scan::local): Likewise.
3364 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3365 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3366 do_tls_offset_for_global): New functions.
3367 (Target_powerpc::Scan::local): Correct TLS relocations and got
3369 (Target_powerpc::Scan::global): Don't emit unnecessary
3370 dynamic relocations on TLS GOT entries.
3372 2012-09-10 Matthias Klose <doko@ubuntu.com>
3374 * config.in: Disable sanity check for kfreebsd.
3376 2012-09-10 Sterling Augustine <saugustine@google.com>
3378 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3379 (Gdb_index::pubtypes_read): New parameter.
3380 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3382 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3385 2012-09-09 Alan Modra <amodra@gmail.com>
3387 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3388 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3389 * gc.h (gc_process_relocs): Call target gc_add_reference.
3390 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3391 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3392 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3394 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3395 to cater for when we don't need code offset. Update use.
3396 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3397 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3398 set_opd_valid): New functions.
3399 (Target_powerpc::do_gc_add_reference): New function.
3400 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3402 (Target_powerpc::do_gc_mark_symbol): New function.
3404 2012-09-06 Cary Coutant <ccoutant@google.com>
3406 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3407 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3408 (Dwarf_die::skip_attributes): Likewise.
3409 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3410 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3412 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3414 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3416 * testsuite/script_test_3.t: Add .got.plt output section
3418 * testsuite/script_test_4.t: Likewise.
3420 2012-09-05 Alan Modra <amodra@gmail.com>
3422 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3423 update all uses and lose "enum" when using type.
3425 2012-09-05 Alan Modra <amodra@gmail.com>
3427 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3428 * configure: Regenerate.
3429 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3430 (plugin_final_layout.stdout): Likewise.
3431 (memory_test): Set page sizes to 0x1000.
3432 * testsuite/Makefile.in: Regenerate.
3433 * testsuite/discard_locals_test.sh: Add FIXME comment.
3434 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3435 * testsuite/pr14265.t: Add .got output section statement.
3436 * testsuite/script_test_2.t: Likewise.
3437 * testsuite/script_test_3.t: Likewise.
3438 * testsuite/script_test_4.t: Likewise.
3439 * testsuite/script_test_5.t: Likewise.
3440 * testsuite/script_test_6.t: Likewise.
3441 * testsuite/script_test_7.t: Likewise.
3442 * testsuite/script_test_9.t: Likewise.
3444 2012-09-05 Alan Modra <amodra@gmail.com>
3446 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3447 (Powerpc_relocate_functions::Status): New typedef.
3448 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3449 (Target_powerpc::Scan::local): Handle REL64.
3450 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3451 for REL32 and REL64.
3452 (Target_powerpc::symval_for_branch): New function, extracted from..
3453 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3454 checks. Report overflow errors.
3456 2012-09-05 Alan Modra <amodra@gmail.com>
3458 * object.h (Sized_relobj_file::emit_relocs): Delete.
3459 (Sized_relobj_file::emit_relocs_reltype): Delete.
3460 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3461 relocate_relocs for --emit-relocs.
3462 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3463 * output.h: Update comment.
3464 (Output_segment::first_section): New function.
3465 (Output_segment::first_section_load_address): Use first_section.
3466 * output.cc (Output_segment::first_section): New function extracted..
3467 (Output_segment::first_section_load_address): ..from here. Delete.
3468 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3469 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3470 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3471 adjust call to target.h function.
3472 * i386.cc (Target_i386): Likewise.
3473 * sparc.cc (Target_sparc): Likewise.
3474 * x86_64.cc (Target_x86_64): Likewise.
3475 * powerpc.cc (Target_powerpc): Likewise.
3476 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3477 first tls section has section symbol for optimised local dynamic
3479 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3480 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3482 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3483 Rename to relocate_relocs. Update error message.
3485 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3487 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3490 2012-08-31 Alan Modra <amodra@gmail.com>
3492 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3493 (Powerpc_relobj::toc_base_offset): New stub function.
3494 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3495 got_mod_index_offset to tlsld_got_offset. Update all refs.
3496 (Target_powerpc::Relocate::enum skip_tls): New.
3497 (Target_powerpc::call_tls_get_addr_): New var.
3498 (Target_powerpc::is_branch_reloc): Move to file scope.
3499 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3500 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3502 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3503 (powerpc_info): Correct common_pagesize for ppc64.
3504 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3505 (Powerpc_relocate_functions): Add overflow check enums and functions.
3506 Add non-shift version of rela, rela_ua. Delete all rel public
3507 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3508 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3509 addr16_ha3, addr14 functions.
3510 (Output_data_got_powerpc::add_constant_pair): New function.
3511 (Output_data_got_powerpc::got_base_offset): Likewise.
3512 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3513 (instruction constants): Sort, add some more.
3514 (Output_data_glink::do_write): Add and use Address typedef. Use
3515 object->toc_base_offset() stub for 64-bit.
3516 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3517 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3518 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3519 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3520 Always treat .opd relocs as against locally defined symbol.
3521 Correct condition for RELATIVE relocs.
3522 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3523 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3524 for 32-bit syms with a plt entry. Correct ppc64 toc base
3525 calculations. Handle TLS relocs, and more. Add overflow
3526 checking and adjust for Powerpc_relocate_functions changes.
3527 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3528 Reinstate --emit-relocs code with FIXME.
3530 2012-08-30 Alan Modra <amodra@gmail.com>
3532 * layout.cc (Layout::set_segment_offsets): Set p_align to
3533 abi_pagesize, not common_pagesize.
3534 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3535 to determine whether file header can go in segment.
3537 2012-08-30 Alan Modra <amodra@gmail.com>
3539 * output.h (Output_reloc::Output_reloc <output section>): Add
3540 is_relative param. Adjust calls.
3541 (Output_reloc::add_output_section_relative): New functions.
3542 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3544 (Output_reloc::symbol_value): Handle SECTION_CODE.
3546 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3548 * gold.cc (queue_middle_tasks): Call layout again when unique
3549 segments for sections is desired.
3550 * layout.cc (Layout::Layout): Initialize new members.
3551 (Layout::get_output_section_flags): New function.
3552 (Layout::choose_output_section): Call get_output_section_flags.
3553 (Layout::layout): Make output section for mapping to a unique segment.
3554 (Layout::insert_section_segment_map): New function.
3555 (Layout::attach_allocated_section_to_segment): Make unique segment for
3556 output sections marked so.
3557 (Layout::segment_precedes): Check for unique segments when sorting.
3558 * layout.h (Layout::Unique_segment_info): New struct.
3559 (Layout::Section_segment_map): New typedef.
3560 (Layout::insert_section_segment_map): New function.
3561 (Layout::get_output_section_flags): New function.
3562 (Layout::is_unique_segment_for_sections_specified): New function.
3563 (Layout::set_unique_segment_for_sections_specified): New function.
3564 (Layout::unique_segment_for_sections_specified_): New member.
3565 (Layout::section_segment_map_): New member.
3566 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3567 Rename is_gc_pass_one to is_pass_one.
3568 Rename is_gc_pass_two to is_pass_two.
3569 Rename is_gc_or_icf to is_two_pass.
3570 Check for which pass based on whether symbols data is present.
3571 Make it two pass when unique segments for sections is desired.
3572 * output.cc (Output_section::Output_section): Initialize new
3574 * output.h (Output_section::is_unique_segment): New function.
3575 (Output_section::set_is_unique_segment): New function.
3576 (Output_section::is_unique_segment_): New member.
3577 (Output_section::extra_segment_flags): New function.
3578 (Output_section::set_extra_segment_flags): New function.
3579 (Output_section::extra_segment_flags_): New member.
3580 (Output_section::segment_alignment): New function.
3581 (Output_section::set_segment_alignment): New function.
3582 (Output_section::segment_alignment_): New member.
3583 (Output_segment::Output_segment): Initialize is_unique_segment_.
3584 (Output_segment::is_unique_segment): New function.
3585 (Output_segment::set_is_unique_segment): New function.
3586 (Output_segment::is_unique_segment_): New member.
3587 * plugin.cc (allow_unique_segment_for_sections): New function.
3588 (unique_segment_for_sections): New function.
3589 (Plugin::load): Add new functions to transfer vector.
3590 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3591 * Makefile.in: Regenerate.
3592 * testsuite/plugin_final_layout.sh: Check if unique segment
3593 functionality works.
3594 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3596 (allow_unique_segment_for_sections): New global.
3597 (unique_segment_for_sections): New global.
3598 (claim_file_hook): Call allow_unique_segment_for_sections.
3599 (all_symbols_read_hook): Call unique_segment_for_sections.
3601 2012-08-22 Cary Coutant <ccoutant@google.com>
3603 * layout.cc (Layout::include_section): Don't assert on GROUP
3604 sections with --emit-relocs.
3606 2012-08-21 Cary Coutant <ccoutant@google.com>
3608 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3609 if --export-dynamic-symbol names an undef symbol.
3611 2012-08-18 Alan Modra <amodra@gmail.com>
3613 * powerpc.cc: Formatting and white space.
3614 (Powerpc_relobj): Rename got2_section_ to special_.
3615 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3616 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3617 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3618 (Target_powerpc): Add Address typedef and invalid_address. Use
3620 (Target_powerpc::is_branch_reloc): New function.
3621 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3622 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3623 for dst_mask, value and addend.
3624 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3625 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3626 (Output_data_glink::do_write): Correct toc base. Don't try to use
3627 uint16_t for 24-bit offset. Use get_output_section_offset and
3629 (Target_powerpc::Scan::local): Handle more relocs.
3630 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3631 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3632 Plug in toc restoring insn after plt calls. Translate branches
3633 to function descriptor symbols to corresponding entry point.
3634 (Target_powerpc::relocate_for_relocatable): Check return from
3635 get_output_section_offset.
3636 * symtab.h: Comment typo.
3638 2012-08-14 Ian Lance Taylor <iant@google.com>
3640 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3641 unsupported_relocal_local to call unsupported_reloc_global.
3643 2012-08-14 Nick Clifton <nickc@redhat.com>
3646 * script-sections.cc (Sections_element::output_section_name): Add
3647 keep return parameter.
3648 (Output_section_element::match_name): Add keep return parameter.
3649 Return the value of the keep_ member.
3650 * script-sections.h (class Output_section): Update
3651 output_section_name prototype.
3652 * layout.cc (Layout::keep_input_section): New public member
3654 (Layout::choose_output_section): Pass keep parameter to
3655 output_section_name.
3656 * layout.h (class Layout): Add keep_input_section.
3657 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3659 * testsuite/Makefile.am: Add a test.
3660 * testsuite/Makefile.in: Regenerate.
3661 * testsuite/pr14265.c: Source file for the test.
3662 * testsuite/pr14265.t: Linker script for the test.
3663 * testsuite/pr14265.sh: Shell script for the test.
3665 2012-08-14 Alan Modra <amodra@gmail.com>
3667 * target.h (Target::output_section_name): New function.
3668 (Target::do_output_section_name): New function.
3669 * layout.cc (Layout::choose_output_section): Call the above.
3670 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3672 2012-08-14 Alan Modra <amodra@gmail.com>
3674 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3675 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3676 for replace_constant call.
3677 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3678 (Output_data_glink::do_print_to_mapfile): New function.
3679 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3680 (Target_powerpc::Relocate::relocate): Likewise.
3682 2012-08-14 Alan Modra <amodra@gmail.com>
3684 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3685 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3686 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3687 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3688 all references to shndx_. Handle special case for R_PPC_PLTREL24
3690 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3691 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3692 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3694 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3695 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3697 2012-08-12 Alan Modra <amodra@gmail.com>
3699 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3700 (glink insn constants): Use uint32_t.
3701 (Output_data_glink::add_entry): Use insert, not [] operator.
3703 2012-08-11 Alan Modra <amodra@gmail.com>
3705 * object.h (Sized_relobj_file::find_shdr): New function.
3706 (Sized_relobj_file::find_special_sections): New function.
3707 * object.cc (Sized_relobj_file::find_shdr): New function.
3708 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3709 (Sized_relobj_file::find_special_sections): New function, split out..
3710 (Sized_relobj_file::do_read_symbols): ..from here.
3711 * output.h (Output_data_got::replace_constant): New function.
3712 (Output_data_got::num_entries): New function.
3713 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3714 (Output_data_got::got_offset): Protected rather than private.
3715 (Output_data_got::replace_got_entry): New function.
3716 * output.cc (Output_data_got::replace_got_entry): New function.
3717 * powerpc.cc (class Powerpc_relobj): New.
3718 (class Powerpc_relocate_functions): Delete all psymval variants or
3719 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3720 Implement _ha functions using corresponding _hi function.
3721 (Powerpc_relobj::find_special_sections): New function.
3722 (Target_powerpc::do_make_elf_object): New function.
3723 (class Output_data_got_powerpc): New.
3724 (class Output_data_glink): New.
3725 (class Powerpc_scan_relocatable_reloc): New.
3726 Many more changes througout file.
3728 2012-08-09 Nick Clifton <nickc@redhat.com>
3730 * po/vi.po: Updated Vietnamese translation.
3732 2012-08-07 Ian Lance Taylor <iant@google.com>
3734 * layout.cc (Layout::add_target_dynamic_tags): If
3735 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3738 2012-07-30 Nick Clifton <nickc@redhat.com>
3740 * po/gold.pot: Updated template.
3741 * po/es.po: Updated Spanish translation.
3743 2012-07-18 Cary Coutant <ccoutant@google.com>
3746 * configure.ac: Add check for -gpubnames support.
3747 * configure: Regenerate.
3748 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3749 support; force -gno-pubnames.
3750 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3752 (gdb_index_test_4): New test.
3753 * testsuite/Makefile.in: Regenerate.
3754 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3755 * testsuite/gdb_index_test_2.sh: Likewise.
3756 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3757 * testsuite/gdb_index_test_4.sh: New script.
3758 * testsuite/gdb_index_test_comm.sh: New script with common code;
3759 don't look for space after colon.
3761 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3763 * gold.cc (queue_middle_tasks): Update function order only after
3764 deferred objects due to plugins are processed.
3766 2012-07-11 Ian Lance Taylor <iant@google.com>
3768 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3769 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3770 (Target_arm::scan_reloc_for_stub): Likewise.
3771 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3772 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3773 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3774 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3775 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3777 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3778 Ian Lance Taylor <iant@google.com>
3781 * configure.ac: Test whether std::tr1::hash<off_t> works.
3782 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3784 * output.h (class Output_fill): Add virtual destructor.
3785 * configure, config.in: Rebuild.
3787 2012-06-22 Roland McGrath <mcgrathr@google.com>
3789 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3791 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3793 * plugin.cc (Plugin::load): Handle position independent executables.
3795 2012-06-06 Cary Coutant <ccoutant@google.com>
3797 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3799 (lines_only_debug_sections): Likewise.
3800 (gdb_fast_lookup_sections): New static array.
3801 (is_gdb_debug_section): Rename formal parameter.
3802 (is_lines_only_debug_section): Likewise.
3803 (is_gdb_fast_lookup_section): New function.
3804 (Layout::include_section): Check for ".zdebug_" prefix; pass
3805 section name suffix to is_gdb_debug_section, et al.; check for
3806 fast-lookup sections when building .gdb_index.
3807 * options.h (--strip-debug-gdb): Update GDB version number.
3809 2012-06-06 Cary Coutant <ccoutant@google.com>
3811 * configure.ac: Add check for fallocate.
3812 * configure: Regenerate.
3813 * config.in: Regenerate.
3815 * options.h (class General_options): Add --mmap-output-file and
3816 --posix-fallocate options.
3817 * output.cc: (posix_fallocate): Remove; replace with...
3818 (gold_fallocate): New function.
3819 (Output_file::map_no_anonymous): Call gold_fallocate.
3820 (Output_file::map): Check --mmap-output-file option.
3822 2012-06-05 Jing Yu <jingyu@google.com>
3824 * gold.h (textdomain): Add do {} to empty while(0).
3825 (bindtextdomain): Likewise.
3827 2012-06-04 Cary Coutant <ccoutant@google.com>
3829 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3832 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3834 * symtab.cc (Symbol_table::define_special_symbol):
3835 Initialize *poldsym to prevent uninitialized variable errors.
3837 2012-05-23 Cary Coutant <ccoutant@google.com>
3839 * layout.cc (Layout::section_name_mapping): Add rules to handle
3840 exact match on .data.rel.ro.local or .data.rel.ro.
3841 (Layout::output_section_name): Check for exact matches.
3843 2012-05-23 Cary Coutant <ccoutant@google.com>
3845 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3848 2012-05-22 Cary Coutant <ccoutant@google.com>
3850 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3851 object before exporting symbol.
3853 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3855 * testsuite/tls_test.cc: Include "config.h" first.
3856 * testsuite/tls_test_c.c: Likewise.
3858 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3859 Nick Clifton <nickc@redhat.com>
3862 * configure.in: Add check that sysdep.h has been included before
3863 any system header files.
3864 * configure: Regenerate.
3865 * config.in: Regenerate.
3867 2012-05-14 Cary Coutant <ccoutant@google.com>
3869 * layout.cc (Layout::make_output_section): Mark .tdata section
3871 * testsuite/relro_test.cc: Add a TLS variable.
3873 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3876 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3877 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3880 2012-05-08 Cary Coutant <ccoutant@google.com>
3882 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3883 (lines_only_debug_sections): Likewise.
3885 2012-05-02 Roland McGrath <mcgrathr@google.com>
3887 * nacl.cc: New file.
3889 * Makefile.am (CCFILES, HFILES): Add them.
3890 * Makefile.in: Regenerate.
3891 * i386.cc (Output_data_plt_i386_nacl): New class.
3892 (Output_data_plt_i386_nacl_exec): New class.
3893 (Output_data_plt_i386_nacl_dyn): New class.
3894 (Target_i386_nacl): New class.
3895 (Target_selector_i386_nacl): New class.
3896 (target_selector_i386): Use it instead of Target_selector_i386.
3897 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3898 (Target_x86_64_nacl): New class.
3899 (Target_selector_x86_64_nacl): New class.
3900 (target_selector_x86_64, target_selector_x32): Use it instead of
3901 Target_selector_x86_64.
3902 * arm.cc (Output_data_plt_arm_nacl): New class.
3903 (Target_arm_nacl): New class.
3904 (Target_selector_arm_nacl): New class.
3905 (target_selector_arm, target_selector_armbe): Use it instead of
3906 Target_selector_arm.
3908 * target-select.cc (select_target): Take new Input_file* and off_t
3909 arguments, pass them on to recognize method of selector.
3910 * object.cc (make_elf_sized_object): Update caller.
3911 * parameters.cc (parameters_force_valid_target): Likewise.
3912 * incremental.cc (make_sized_incremental_binary): Likewise.
3913 * target-select.h: Update decl.
3914 (Target_selector::recognize): Take new Input_file* argument,
3915 pass it on to do_recognize.
3916 (Target_selector::do_recognize): Take new Input_file* argument.
3917 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3918 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3919 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3920 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3922 * target.h (Target::Target_info): New members isolate_execinstr
3924 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3925 * arm.cc (Target_arm::arm_info): Update initializer.
3926 * i386.cc (Target_i386::i386_info): Likewise.
3927 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3928 * sparc.cc (Target_sparc::sparc_info): Likewise.
3929 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3930 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3931 * layout.cc (Layout::attach_allocated_section_to_segment):
3932 Take new const Target* argument. If target->isolate_execinstr(), act
3934 (Layout::find_first_load_seg): Take new const Target* argument;
3935 if target->isolate_execinstr(), reject PF_X segments.
3936 (Layout::relaxation_loop_body): Update caller.
3937 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3938 reset file offset to zero when we hit LOAD_SEG, and then do a second
3939 loop over the segments before LOAD_SEG to reassign offsets after
3940 addresses have been determined. Handle target->rosegment_gap().
3941 (Layout::attach_section_to_segment): Take new const Target* argument;
3942 pass it to attach_allocated_section_to_segment.
3943 (Layout::make_output_section): Update caller.
3944 (Layout::attach_sections_to_segments): Take new const Target* argument;
3945 pass it to attach_section_to_segment.
3946 * gold.cc (queue_middle_tasks): Update caller.
3947 * layout.h (Layout): Update method decls with new arguments.
3949 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3950 Target_info pointer to use.
3951 (Target_arm::do_make_data_plt): New virtual method.
3952 (Target_arm::make_data_plt): New method that calls it.
3953 (Target_arm::make_plt_entry): Use it.
3954 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3955 for the section alignment.
3956 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3958 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3959 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3961 (Output_data_plt_arm::get_plt_entry_size): Call it.
3962 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3963 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3964 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3966 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3967 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3968 method instead of sizeof(plt_entry).
3969 (Output_data_plt_arm::add_entry): Likewise.
3970 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3971 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3973 (Target_arm::plt_entry_size): Likewise.
3974 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3976 (Output_data_plt_arm_standard): ... here, new class.
3977 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3978 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3979 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3981 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3982 Take additional argument for the PLT entry size.
3983 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3984 Use get_plt_entry_size method rather than plt_entry_size variable.
3985 (Output_data_plt_x86_64::reserve_slot): Likewise.
3986 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3987 (Output_data_plt_x86_64::add_entry): Likewise.
3988 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3989 (Output_data_plt_x86_64::address_for_global): Likewise.
3990 (Output_data_plt_x86_64::address_for_local): Likewise.
3991 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3992 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3993 Make method non-static.
3994 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3996 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3997 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3998 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3999 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4001 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4002 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4004 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4005 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4007 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4008 (Output_data_plt_x86_64::plt_entry_size)
4009 (Output_data_plt_x86_64::first_plt_entry)
4010 (Output_data_plt_x86_64::plt_entry)
4011 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4012 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4013 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4014 (Output_data_plt_x86_64_standard): ... here, new class.
4015 (Target_x86_64::Target_x86_64): Take optional argument for the
4016 Target_info pointer to use.
4017 (Target_x86_64::do_make_data_plt): New virtual method.
4018 (Target_x86_64::make_data_plt): New method to call it.
4019 (Target_x86_64::init_got_plt_for_update): Use that.
4020 Call this->plt_->add_eh_frame method here.
4021 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4022 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4023 rather than static method.
4024 (Target_x86_64::plt_entry_size): Likewise.
4025 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4026 rather than plt_entry_size variable. Move guts of PLT filling to...
4027 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4028 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4029 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4031 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4032 additional argument for the section alignment.
4033 Don't do add_eh_frame_for_plt here.
4034 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4035 non-static. Use get_plt_entry_size method rather than plt_entry_size
4037 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4039 (Output_data_plt_i386::get_plt_entry_size): Call it.
4040 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4041 (Output_data_plt_i386::add_eh_frame): New method to call it.
4042 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4044 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4045 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4047 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4048 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4049 method instead of plt_entry_size.
4050 (Output_data_plt_i386::plt_entry_size)
4051 (Output_data_plt_i386::plt_eh_frame_fde_size)
4052 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4053 (Output_data_plt_i386_standard): ... here, new class.
4054 (Output_data_plt_i386_exec): New class.
4055 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4056 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4057 (Output_data_plt_i386::exec_plt_entry): Move to ...
4058 (Output_data_plt_i386_exec::plt_entry): ... here.
4059 (Output_data_plt_i386_dyn): New class.
4060 (Output_data_plt_i386::first_plt_entry): Move to ...
4061 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4062 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4063 (Output_data_plt_i386_dyn::plt_entry): ... here.
4064 (Target_i386::Target_i386): Take optional argument for the Target_info
4066 (Target_i386::do_make_data_plt): New virtual method.
4067 (Target_i386::make_data_plt): New method to call it.
4068 (Target_i386::make_plt_section): Use that.
4069 Call this->plt_->add_eh_frame method here.
4070 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4071 rather than plt_entry_size variable.
4072 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4073 (Output_data_plt_i386::address_for_local): Likewise.
4074 (Output_data_plt_i386::do_write): Likewise.
4075 Move guts of PLT filling to...
4076 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4077 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4078 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4079 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4081 2012-05-01 Cary Coutant <ccoutant@google.com>
4083 * dwarf_reader.cc (Dwarf_die::read_attributes)
4084 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4085 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4086 * reduced_debug_output.cc
4087 (Output_reduced_debug_info_section::get_die_end): Remove
4088 DW_FORM_GNU_ref_index. Add default case.
4090 2012-04-26 Mark Wielaard <mjw@redhat.com>
4092 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4093 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4094 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4095 DW_AT_high_pc as offset from DW_AT_low_pc.
4097 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4098 * testsuite/Makefile.in: Regenerate.
4099 * testsuite/gdb_index_test_3.c: New test source file.
4100 * testsuite/gdb_index_test_3.sh: New test source file.
4102 2012-04-25 Ian Lance Taylor <iant@google.com>
4104 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4106 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4107 as a class, not a struct.
4108 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4109 (Target_arm::apply_cortex_a8_workaround): Likewise.
4110 * gc.h: Declare Reloc_types as a struct, not a class.
4111 * object.h: Declare Symbols_data as a struct.
4112 * reloc.h: Declare Read_relocs_data as a struct.
4113 * target.h: Declare Relocate_info as a struct.
4115 2012-04-24 David S. Miller <davem@davemloft.net>
4117 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4118 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4121 2012-04-24 Cary Coutant <ccoutant@google.com>
4123 * incremental-dump.cc (find_input_containing_global): Replace
4124 magic number with symbolic constant.
4125 (dump_incremental_inputs): Update version number.
4126 * incremental.cc (Output_section_incremental_inputs): Update version
4127 number; import symbolic constants from Incremental_inputs_reader.
4128 (Incremental_inputs::create_data_sections): Align relocations
4129 section correctly for 64-bit targets.
4130 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4131 constants; add padding.
4132 (Output_section_incremental_inputs::write_header): Add assert for
4134 (Output_section_incremental_inputs::write_input_files): Add assert
4135 for input_entry_size.
4136 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4137 add assert for object_info_size, input_section_entry_size,
4138 global_sym_entry_size.
4139 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4140 for data structure sizes; use them.
4141 (Incremental_input_entry_reader): Import symbolic constants from
4142 Incremental_inputs_reader; use them.
4144 2012-04-23 David S. Miller <davem@davemloft.net>
4146 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4148 (Target_sparc::Target_sparc): Initialize new fields.
4149 (Target_sparc::do_make_elf_object): New function.
4150 (Target_sparc::do_adjust_elf_header): New function.
4152 2012-04-23 Cary Coutant <ccoutant@google.com>
4154 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4155 CU range table of gdb index.
4157 2012-04-20 David S. Miller <davem@davemloft.net>
4159 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4162 2012-04-16 David S. Miller <davem@davemloft.net>
4164 * sparc.cc (Target_sparc::got_address): New function.
4165 (Sparc_relocate_functions::gdop_hix22): New function.
4166 (Sparc_relocate_functions::gdop_lox10): New function.
4167 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4169 (Target_sparc::Scan::local): Likewise if the global symbol is not
4170 preemptible and is not IFUNC.
4171 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4172 transformations for local and non-preemptible non-IFUNC global
4175 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4176 writing out 64-bit part of ranges.
4178 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4179 -fpic and -fpie respectively.
4180 * Makefile.in: Regenerate.
4182 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4183 (Target_sparc::Target_sparc): Initialize new field.
4184 (Target_sparc::do_plt_section_for_global): New function.
4185 (Target_sparc::do_plt_section_for_local): New function.
4186 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4187 (Target_sparc::make_plt_section): New function, broken out of
4188 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4189 (Target_sparc::make_plt_entry): Call make_plt_section.
4190 (Target_sparc::make_local_ifunc_plt_entry): New function.
4191 (Target_sparc::rela_ifunc_section): New function.
4192 (Target_sparc::plt_section): Remove const.
4193 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4194 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4195 and ifunc_count_ fields.
4196 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4197 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4198 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4199 (Output_data_plt_sparc::rela_ifunc): New function.
4200 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4201 (Output_data_plt_sparc::has_ifunc_section): New function.
4202 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4203 (Output_data_plt_sparc::address_for_global): New function.
4204 (Output_data_plt_sparc::address_for_local): New function.
4205 (Output_data_plt_sparc::plt_index_to_offset): New function.
4206 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4208 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4210 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4211 R_SPARC_JMP_IREL to switch.
4212 (Target_sparc::Scan::check_non_pic): Likewise.
4213 (Target_sparc::Scan::local): Handle IFUNC symbols.
4214 (Target_sparc::Scan::local): Likewise.
4215 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4216 and plt_address_for_local.
4217 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4218 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4220 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4221 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4222 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4223 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4225 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4226 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4228 * sparc.cc (Target_sparc::Scan::global): Likewise.
4229 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4231 2012-04-16 Cary Coutant <ccoutant@google.com>
4233 * archive.cc (Library_base::should_include_member): Check for
4234 --export-dynamic-symbol.
4235 * options.h (class General_options): Add --export-dynamic-symbol.
4236 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4237 --export-dynamic-symbol.
4238 (Symbol_table::gc_mark_undef_symbols): Likewise.
4239 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4241 2012-04-12 David S. Miller <davem@davemloft.net>
4243 * sparc.cc (Reloc::wdisp10): New relocation method.
4244 (Reloc::h34): Likewise.
4245 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4246 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4248 (Target_sparc::Scan::local): Likewise.
4249 (Target_sparc::Scan::global): Likewise.
4250 (Target_sparc::Relocate::relocate): Likewise.
4252 2012-04-09 Cary Coutant <ccoutant@google.com>
4254 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4257 2012-04-06 Ian Lance Taylor <iant@google.com>
4259 * timer.cc: #include <unistd.h>.
4261 2012-04-06 Roland McGrath <mcgrathr@google.com>
4263 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4264 * config.in: Regenerate.
4265 * configure: Regenerate.
4267 2012-04-05 Nick Clifton <nickc@redhat.com>
4269 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4270 (AM_LC_MESSAGES): Add.
4271 * aclocal.m4: Regenerate.
4272 * config.in: Regenerate.
4273 * configure: Regenerate.
4275 2012-03-21 Cary Coutant <ccoutant@google.com>
4277 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4278 * Makefile.in: Regenerate.
4279 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4280 (Sized_elf_reloc_mapper::symbol_section): New function.
4281 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4282 (make_elf_reloc_mapper): New function.
4283 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4284 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4285 (Dwarf_abbrev_table::do_get_abbrev): New function.
4286 (Dwarf_ranges_table::read_ranges_table): New function.
4287 (Dwarf_ranges_table::read_range_list): New function.
4288 (Dwarf_pubnames_table::read_section): New function.
4289 (Dwarf_pubnames_table::read_header): New function.
4290 (Dwarf_pubnames_table::next_name): New function.
4291 (Dwarf_die::Dwarf_die): New function.
4292 (Dwarf_die::read_attributes): New function.
4293 (Dwarf_die::skip_attributes): New function.
4294 (Dwarf_die::set_name): New function.
4295 (Dwarf_die::set_linkage_name): New function.
4296 (Dwarf_die::attribute): New function.
4297 (Dwarf_die::string_attribute): New function.
4298 (Dwarf_die::int_attribute): New function.
4299 (Dwarf_die::uint_attribute): New function.
4300 (Dwarf_die::ref_attribute): New function.
4301 (Dwarf_die::child_offset): New function.
4302 (Dwarf_die::sibling_offset): New function.
4303 (Dwarf_info_reader::check_buffer): New function.
4304 (Dwarf_info_reader::parse): New function.
4305 (Dwarf_info_reader::do_parse): New function.
4306 (Dwarf_info_reader::do_read_string_table): New function.
4307 (Dwarf_info_reader::lookup_reloc): New function.
4308 (Dwarf_info_reader::get_string): New function.
4309 (Dwarf_info_reader::visit_compilation_unit): New function.
4310 (Dwarf_info_reader::visit_type_unit): New function.
4311 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4312 Sized_elf_reloc_mapper.
4313 (Sized_dwarf_line_info::symbol_section): Remove function.
4314 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4315 (Sized_dwarf_line_info::read_line_mappings): Remove object
4316 parameter, adjust callers.
4317 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4318 * dwarf_reader.h: Include <sys/types.h>.
4319 (class Track_relocs): Remove forward declaration.
4320 (class Elf_reloc_mapper): New class.
4321 (class Sized_elf_reloc_mapper): New class.
4322 (class Dwarf_abbrev_table): New class.
4323 (class Dwarf_range_list): New class.
4324 (class Dwarf_ranges_table): New class.
4325 (class Dwarf_pubnames_table): New class.
4326 (class Dwarf_die): New class.
4327 (class Dwarf_info_reader): New class.
4328 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4329 (Sized_dwarf_line_info::symbol_section): Remove member function.
4330 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4332 * gdb-index.cc: New source file.
4333 * gdb-index.h: New source file.
4334 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4335 and .debug_types sections, call Layout::add_to_gdb_index.
4336 (Sized_relobj_incr::do_section_name): Implement.
4337 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4338 return type; Implement.
4339 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4341 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4342 parameter list and return type.
4343 (Sized_incr_dynobj::do_section_contents): Likewise.
4344 * layout.cc: Include gdb-index.h.
4345 (Layout::Layout): Initialize gdb_index_data_.
4346 (Layout::init_fixed_output_section): Check for .gdb_index section.
4347 (Layout::add_to_gdb_index): New function. Instantiate.
4348 * layout.h: Add forward declaration for class Gdb_index.
4349 (Layout::add_to_gdb_index): New member function.
4350 (Layout::gdb_index_data_): New data member.
4351 * main.cc: Include gdb-index.h.
4352 (main): Print statistics for gdb index.
4353 * object.cc (Object::section_contents): Move code into
4354 do_section_contents.
4355 (need_decompressed_section): Check for sections needed when building
4357 (build_compressed_section_map): Likewise.
4358 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4360 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4361 sections; call Layout::add_to_gdb_index.
4362 (Sized_relobj_file::do_decompressed_section_contents): Call
4363 do_section_contents directly.
4364 * object.h (Object::do_section_contents): Adjust parameter list and
4366 (Object::do_decompressed_section_contents): Call do_section_contents
4368 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4370 * options.h (class General_options): Add --gdb-index option.
4371 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4372 list and return type.
4373 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4374 * reloc.h (Track_relocs::checkpoint): New function.
4375 (Track_relocs::reset): New function.
4377 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4379 * testsuite/Makefile.in: Regenerate.
4380 * testsuite/gdb_index_test.cc: New test source file.
4381 * testsuite/gdb_index_test_1.sh: New test source file.
4382 * testsuite/gdb_index_test_2.sh: New test source file.
4384 2012-03-19 Doug Kwan <dougkwan@google.com>
4386 * arm.cc (Target_arm::do_define_standard_symbols): New method.
4387 (Target_arm::do_finalize_sections): Remove code which defines
4388 __exidx_start and __exidx_end. Make symbol table parameter
4389 anonymous as it is not used.
4390 * gold.cc (queue_middle_tasks): Call target hook to define any
4391 target-specific symbols.
4392 * target.h (Target::define_standard_symbols): New method.
4393 (Target::do_define_standard_symbols): Same.
4394 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4395 * testsuite/Makefile.in: Regenerate.
4396 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4398 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4399 relocations are generated for __exidx_start and __exidx_end.
4401 2012-03-16 Doug Kwan <dougkwan@google.com>
4403 * testsuite/Makefile.am: Disable test initpri3b.
4404 * testsuite/Makefile.in: Regenerate.
4406 2012-03-15 Doug Kwan <dougkwan@google.com>
4408 * arm.cc (Target_arm::got_section): Make .got section read-only
4411 2012-03-15 Ian Lance Taylor <iant@google.com>
4414 * layout.cc (Layout::make_output_section): Correctly mark
4415 SHT_INIT_ARRAY, et. al., as relro.
4417 2012-03-14 Doug Kwan <dougkwan@google.com>
4419 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4420 dynamic relocations for protected symbols in shared objects.
4422 2012-03-13 Ian Lance Taylor <iant@google.com>
4424 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4425 keep the larger alignment.
4427 2012-03-12 Cary Coutant <ccoutant@google.com>
4429 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4430 handling of DW_LNE_define_file.
4432 2012-03-12 Cary Coutant <ccoutant@google.com>
4434 * reduced_debug_output.cc
4435 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4438 2012-02-29 Cary Coutant <ccoutant@google.com>
4440 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4442 2012-02-29 Cary Coutant <ccoutant@google.com>
4444 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4445 Call Object::decompressed_section_contents.
4446 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4448 (Sized_dwarf_line_info::buffer_start_): New data member.
4449 * merge.cc (Output_merge_data::do_add_input_section): Call
4450 Object::decompressed_section_contents.
4451 (Output_merge_string::do_add_input_section): Likewise.
4452 * object.cc (need_decompressed_section): New function.
4453 (build_compressed_section_map): Decompress sections needed later.
4454 (Sized_relobj_file::do_decompressed_section_contents): New function.
4455 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4456 * object.h (Object::decompressed_section_contents): New function.
4457 (Object::discard_decompressed_sections): New function.
4458 (Object::do_decompressed_section_contents): New function.
4459 (Object::do_discard_decompressed_sections): New function.
4460 (Compressed_section_info): New type.
4461 (Compressed_section_map): Include decompressed section contents.
4462 (Sized_relobj_file::do_decompressed_section_contents): New function.
4463 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4465 2012-02-16 Cary Coutant <ccoutant@google.com>
4467 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4468 * testsuite/Makefile.in: Regenerate.
4470 2012-02-14 Cary Coutant <ccoutant@google.com>
4472 * options.cc (General_options::finalize): Disallow -pie and -static.
4474 2012-02-03 Doug Kwan <dougkwan@google.com>
4476 * arm.cc (Arm_relocate_functions::abs8,
4477 Arm_relocate_functions::abs16): Use
4478 Bits::has_signed_unsigned_overflow32.
4479 (Arm_relocate_functions::thm_abs8): Correct range of
4481 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4484 2012-02-02 Doug Kwan <dougkwan@google.com>
4486 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4487 position independent outputs, not just shared objects.
4489 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4491 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4492 * configure: Regenerated.
4494 2012-01-27 Ian Lance Taylor <iant@google.com>
4496 * reloc.h (Bits): New class with static functions, copied from
4497 namespace utils in arm.cc.
4498 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4501 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4503 * incremental.cc (write_info_blocks): Correct relocation offset.
4505 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4507 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4508 (Relocate::tls_gd_to_le): Likewise.
4510 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4512 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4514 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4516 * configure.ac: Check if -mcmodel=medium works.
4517 * configure: Regenerated.
4519 2012-01-24 Cary Coutant <ccoutant@google.com>
4521 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4523 (read_unsigned_LEB_128_x): ... this new function.
4524 (read_signed_LEB_128): Replaced with inline definition and ...
4525 (read_signed_LEB_128_x): ... this new function.
4526 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4527 (read_unsigned_LEB_128): Add inline definition.
4528 (read_signed_LEB_128_x): New function.
4529 (read_signed_LEB_128): Add inline definition.
4530 * testsuite/Makefile.am (leb128_unittest): New unit test.
4531 * testsuite/Makefile.in: Regenerate.
4532 * testsuite/leb128_unittest.cc: New unit test.
4534 2012-01-23 Ian Lance Taylor <iant@google.com>
4537 * i386.cc (Target_i386::do_code_fill): When using a jmp
4538 instruction, pad with nop instructions.
4539 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4541 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4543 * x86_64.cc (gc_process_relocs): Add typename on types used in
4545 (scan_relocs): Likewise.
4546 (relocate_section): Likewise.
4547 (apply_relocation): Likewise.
4549 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4551 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4552 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4555 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4557 * x86_64.cc: Initial support for x32.
4559 2012-01-03 Cary Coutant <ccoutant@google.com>
4561 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4562 Use abstract base class for GOT.
4563 * gold/output.h (class Output_data_got_base): New abstract base class.
4564 (class Output_data_got): Derive from new base class, adjust ctors.
4565 (Output_data_got::reserve_slot): Make virtual; rename to
4566 do_reserve_slot; Adjust callers.
4567 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4568 pointer to abstract base class.
4569 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4571 2011-12-18 Ian Lance Taylor <iant@google.com>
4573 * object.h (Relobj::local_symbol_value): New function.
4574 (Relobj::local_plt_offset): New function.
4575 (Relobj::local_has_got_offset): New function.
4576 (Relobj::local_got_offset): New function.
4577 (Relobj::set_local_got_offset): New function.
4578 (Relobj::do_local_symbol_value): New pure virtual function.
4579 (Relobj::do_local_plt_offset): Likewise.
4580 (Relobj::do_local_has_got_offset): Likewise.
4581 (Relobj::do_local_got_offset): Likewise.
4582 (Relobj::do_set_local_got_offset): Likewise.
4583 (Sized_relobj::do_local_has_got_offset): Rename from
4584 local_has_got_offset.
4585 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4586 (Sized_relobj::do_set_local_got_offset): Rename from
4587 set_local_got_offset.
4588 (Sized_relobj_file::do_local_plt_offset): Rename from
4590 (Sized_relobj_file::do_local_symbol_value): New function.
4591 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4593 * output.cc (Output_data_got::Got_entry::write): Change object to
4594 Relobj. Use local_symbol_value.
4595 (Output_data_got::add_global_with_rel): Change rel_dyn to
4596 Output_data_reloc_generic*. Use add_global_generic.
4597 (Output_data_got::add_global_with_rela): Remove. Change all
4598 callers to use add_global_with_rel.
4599 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4600 Output_data_reloc_generic*. Use add_global_generic.
4601 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4602 callers to use add_global_pair_with_rel.
4603 (Output_data_got::add_local): Change object to Relobj*.
4604 (Output_data_got::add_local_plt): Likewise.
4605 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4606 change rel_dyn to Output_data_reloc_generic*. Use
4608 (Output_data_got::add_local_with_rela): Remove. Change all
4609 callers to use all_local_with_rel.
4610 (Output_data_got::add_local_pair_with_rel): Change object to
4611 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4612 add_output_section_generic.
4613 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4614 callers to use add_local_pair_with_rel.
4615 (Output_data_got::reserve_local): Change object to Relobj*.
4616 * output.h: (class Output_data_reloc_generic): Add pure virtual
4617 declarations for add_global_generic, add_local_generic,
4618 add_output_section_generic.
4619 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4620 functions for Output_data_reloc_generic. Update declarations for
4621 changes listed in output.cc.
4622 (class Output_data_got): Change template parameter to got_size.
4623 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4624 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4626 (Sized_relobj_incr::do_local_plt_offset): New function.
4627 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4630 2011-12-17 Cary Coutant <ccoutant@google.com>
4632 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4633 * resolve.cc (Symbol_table::resolve): Likewise.
4634 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4636 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4638 2011-12-16 Ian Lance Taylor <iant@google.com>
4640 * output.h (Output_data_reloc_generic::add): Only call
4641 add_dynamic_reloc if this is a dynamic reloc section.
4643 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4646 * target-reloc.h (apply_relocation): Replace <64, false> with
4649 2011-11-25 Nick Clifton <nickc@redhat.com>
4651 * po/it.po: New Italian translation.
4653 2011-11-17 Sterling Augustine <saugustine@google.com>
4655 * script.cc (script_include_directive): Implement.
4656 (read_script_file): New local variables name and search_path. Update
4657 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4658 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4659 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4661 2011-11-11 Sterling Augustine <saugustine@google.com>
4663 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4664 (file_or_sections_cmd): Likewise.
4666 2011-11-11 Doug Kwan <dougkwan@google.com>
4668 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4669 if --just-symbols is given.
4671 2011-11-10 Doug Kwan <dougkwan@google.com>
4674 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4675 when processing data relocs.
4676 * reloc.h (Relocate_functions::rel_unaligned): New method.
4677 (Relocate_functions::pcrel_unaligned): Ditto.
4678 (Relocate_functions::rel32_unaligned): Ditto.
4679 (Relocate_functions::pcrel32_unaligned): Ditto.
4681 2011-11-09 Doug Kwan <dougkwan@google.com>
4684 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4685 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4686 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4687 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4688 (Relocate_functions::rel_unaligned): New.
4689 (Relocate_functions::rel32_unaligned): New.
4690 * target-reloc.h (relocate_for_relocatable): Add code to handle
4691 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4692 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4693 arm_unaligned_reloc_r): New targets.
4694 * testsuite/Makefile.in: Regenerate.
4695 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4698 2011-11-02 Ian Lance Taylor <iant@google.com>
4700 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4702 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4703 * options.cc (General_options::finalize): Use library search path
4704 from configure script if specified. If not native and no sysroot,
4705 only search TOOLLIBDIR.
4706 * options.h (Search_directory::Search_directory): Change name to
4708 (General_options::add_to_library_path_with_sysroot): Change arg to
4710 * configure, Makefile.in, config.in: Rebuild.
4712 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4714 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4715 we are working around the ARM1176 Erratum.
4716 * options.h (General_options::fix_arm1176): Add option.
4717 * testsuite/Makefile.am: Add testcases, and keep current ones
4719 * testsuite/Makefile.in: Regenerate.
4720 * testsuite/arm_fix_1176.s: New file.
4721 * testsuite/arm_fix_1176.sh: Likewise.
4723 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4725 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4727 (Target_arm::may_use_blx): Remove method.
4728 (Target_arm::set_may_use_blx): Likewise.
4729 (Target_arm::may_use_v4t_interworking): New method.
4730 (Target_arm::may_use_v5t_interworking): Likewise.
4731 (Target_arm::may_use_blx_): Remove member variable.
4732 (Arm_relocate_functions::arm_branch_common): Check for v5T
4734 (Arm_relocate_functions::thumb_branch_common): Likewise.
4735 (Reloc_stub::stub_type_for_reloc): Likewise.
4736 (Target_arm::do_finalize_sections): Correct interworking checks.
4737 * testsuite/Makefile.am: Add new tests.
4738 * testsuite/Makefile.in: Regenerate.
4739 * testsuite/arm_farcall_arm_arm.s: New test.
4740 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4741 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4742 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4743 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4744 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4745 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4746 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4748 2011-10-31 Cary Coutant <ccoutant@google.com>
4751 * expression.cc (Expression::eval_with_dot): Add
4752 is_section_dot_assignment parameter.
4753 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4754 absolute and assigning to dot within a section.
4755 * script-sections.cc
4756 (Output_section_element_assignment::set_section_addresses): Pass
4757 dot_section to set_if_absolute.
4758 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4759 as is_section_dot_assignment flag to eval_with_dot.
4760 (Output_section_element_dot_assignment::set_section_addresses):
4762 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4763 parameter. Also set value if relative to dot_section; set the
4764 symbol's output_section.
4765 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4766 parameter. Adjust all callers.
4767 (Expression::eval_maybe_dot): Likewise.
4768 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4770 * testsuite/script_test_2.t: Test assignment of an absolute value
4771 to dot within an output section element.
4773 2011-10-31 Cary Coutant <ccoutant@google.com>
4775 * options.h (class General_options): Add --[no-]gnu-unique options.
4776 * symtab.cc (Symbol_table::sized_write_globals): Convert
4777 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4779 2011-10-31 Cary Coutant <ccoutant@google.com>
4782 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4783 unnecessary assertion.
4784 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4786 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4788 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4790 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4792 Change to just keep the section associated with symbol.
4793 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4794 they are externally visible and --export-dynamic is turned on.
4795 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4797 2011-10-19 Ian Lance Taylor <iant@google.com>
4800 * script-sections.cc
4801 (Output_section_element_dot_assignment::needs_output_section): New
4804 2011-10-19 Ian Lance Taylor <iant@google.com>
4807 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4808 --section-start option was seen.
4809 * options.h (General_options::any_section_start): New function.
4811 2011-10-18 David S. Miller <davem@davemloft.net>
4814 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4815 member to track relocation locations that have moved during TLS
4816 reloc optimizations.
4817 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4818 (Target_sparc::Relocate::relocate): Adjust view down by 4
4819 bytes if it matches reloc_adjust_addr_.
4820 (Target_sparc::Relocate::relocate_tls): Always move the
4821 __tls_get_addr call delay slot instruction forward 4 bytes when
4822 performing relaxation.
4824 2011-10-18 Cary Coutant <ccoutant@google.com>
4826 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4827 (Output_file::map_no_anonymous): Check for non-zero
4828 return code from posix_fallocate.
4830 2011-10-17 Cary Coutant <ccoutant@google.com>
4833 * plugin.cc (is_visible_from_outside): Check for symbols
4834 referenced from dynamic objects.
4835 * resolve.cc (Symbol_table::resolve): Don't count references
4836 from dynamic objects as references from real ELF files.
4837 * testsuite/plugin_test_2.sh: Adjust expected result.
4839 2011-10-17 Cary Coutant <ccoutant@google.com>
4841 * gold.cc: Include timer.h.
4842 (queue_middle_tasks): Stamp time.
4843 (queue_final_tasks): Likewise.
4844 * main.cc (main): Store timer in parameters. Print timers
4846 * parameters.cc (Parameters::Parameters): Initialize timer_.
4847 (Parameters::set_timer): New function.
4848 (set_parameters_timer): New function.
4849 * parameters.h (Parameters::set_timer): New function.
4850 (Parameters::timer): New function.
4851 (Parameters::timer_): New data member.
4852 (set_parameters_timer): New function.
4853 * timer.cc (Timer::stamp): New function.
4854 (Timer::get_pass_time): New function.
4855 * timer.h (Timer::stamp): New function.
4856 (Timer::get_pass_time): New function.
4857 (Timer::pass_times_): New data member.
4859 2011-10-17 Cary Coutant <ccoutant@google.com>
4861 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4862 task for members of lib groups.
4864 2011-10-17 Cary Coutant <ccoutant@google.com>
4867 * fileread.cc (File_read::find_view): Add assert.
4868 (File_read::make_view): Move bounds check (replace with assert)...
4869 (File_read::find_or_make_view): ... to here.
4871 2011-10-12 Cary Coutant <ccoutant@google.com>
4873 * output.cc (Output_file::open_base_file): Handle case where
4874 ::read returns less than requested size.
4876 2011-10-10 Cary Coutant <ccoutant@google.com>
4878 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4879 Initialize defined_count_.
4880 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4881 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4882 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4883 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4884 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4885 * incremental.h (Sized_relobj_incr::defined_count_): New data
4887 (Sized_incr_dynobj::defined_count_): New data member.
4888 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4889 Return zeroes instead of internal error.
4891 2011-10-10 Cary Coutant <ccoutant@google.com>
4894 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4895 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4896 * output.h (class Output_reloc): Add use_plt_offset flag.
4897 (Output_reloc::type_): Adjust size of bit field.
4898 (Output_reloc::use_plt_offset_): New bit field.
4899 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4900 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4901 flag. Adjust all callers.
4902 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4903 creating RELATIVE relocations.
4905 2011-10-10 Nick Clifton <nickc@redhat.com>
4907 * po/es.po: Updated Spanish translation.
4908 * po/fi.po: Updated Finnish translation.
4910 2011-10-03 Diego Novillo <dnovillo@google.com>
4912 * options.cc (parse_uint): Fix dereference of RETVAL.
4914 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4916 * layout.h (section_order_map_): New member.
4917 (get_section_order_map): New member function.
4918 * output.cc (Output_section::add_input_section): Check for patterns
4919 only when --section-ordering-file is specified.
4920 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4921 output_sections have been formed.
4922 * layout.cc (Layout_Layout): Initialize section_order_map_.
4923 * plugin.cc (update_section_order): Store order in order_map. Do not
4925 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4926 * testsuite/Makefile.in: Regenerate.
4927 * testsuite/plugin_section_order.c: New file.
4928 * testsuite/plugin_final_layout.cc: New file.
4929 * testsuite/plugin_final_layout.sh: New file.
4931 2011-09-29 Cary Coutant <ccoutant@google.com>
4933 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4935 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4936 symbols during incremental update.
4937 (Symbol_table::add_from_dynobj): Likewise.
4939 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4940 Ian Lance Taylor <iant@google.com>
4942 * symtab.cc (Symbol_table::define_special_symbol): Always
4943 canonicalize version string.
4945 2011-09-26 Cary Coutant <ccoutant@google.com>
4947 * gold.cc (queue_initial_tasks): Move option checks ...
4948 * options.cc (General_options::finalize): ... to here. Disable
4949 some options; make others fatal.
4951 2011-09-26 Cary Coutant <ccoutant@google.com>
4954 * plugin.cc (get_symbols_v2): New function.
4955 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4956 (is_referenced_from_outside): New function.
4957 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4958 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4959 (get_symbols): Pass version parameter.
4960 (get_symbols_v2): New function.
4961 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4963 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4964 (onload): Add LDPT_GET_SYMBOLS_V2.
4965 (all_symbols_read_hook): Use get_symbols_v2; check for
4966 LDPR_PREVAILING_DEF_IRONLY_EXP.
4967 * testsuite/plugin_test_3.sh: Update expected results.
4969 2011-09-23 Simon Baldwin <simonb@google.com>
4971 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4972 configuration options.
4973 * configure: Regenerate.
4974 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4975 * Makefile.in: Regenerate.
4976 * testsuite/Makefile.in: Regenerate.
4978 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4980 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4982 2011-09-19 Cary Coutant <ccoutant@google.com>
4984 * incremental.cc (can_incremental_update): Fix typo in comment.
4985 * incremental.h (can_incremental_update): Likewise.
4987 2011-09-18 Cary Coutant <ccoutant@google.com>
4989 * incremental.cc (can_incremental_update): New function.
4990 * incremental.h (can_incremental_update): New function.
4991 * layout.cc (Layout::init_fixed_output_section): Call it.
4992 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4993 * object.cc (Sized_relobj_file::do_layout): Call
4994 can_incremental_update.
4996 2011-09-13 Cary Coutant <ccoutant@google.com>
4998 * configure.ac: Check for glibc support for gnu_indirect_function
4999 support with static linking, setting automake conditional
5001 * Makefile.in: Regenerate.
5002 * configure: Regenerate.
5004 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5005 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5007 * testsuite/Makefile.in: Regenerate.
5009 2011-09-13 Cary Coutant <ccoutant@google.com>
5011 * incremental.cc (Sized_relobj_incr::do_layout): Call
5012 report_comdat_group for kept comdat sections.
5013 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5014 * testsuite/Makefile.in: Regenerate.
5015 * testsuite/incr_comdat_test_1.cc: New source file.
5016 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5017 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5018 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5020 2011-09-13 Ian Lance Taylor <iant@google.com>
5022 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5023 variable external_symbols_offset.
5025 2011-09-12 Ian Lance Taylor <iant@google.com>
5027 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5028 triggered if object has no symbols.
5030 2011-09-09 David S. Miller <davem@davemloft.net>
5032 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5033 (Output_fill_debug_line::do_write): Likewise.
5035 2011-08-29 Cary Coutant <ccoutant@google.com>
5037 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5038 casts to match formatting specs.
5039 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5041 2011-08-26 Cary Coutant <ccoutant@google.com>
5043 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5044 remaining hole size when allocating.
5045 (Layout::make_output_section): Set fill methods for debug sections.
5046 * layout.h (Free_list::Free_list_node): Move from private to
5048 (Free_list::set_min_hole_size): New function.
5049 (Free_list::begin, Free_list::end): New functions.
5050 (Free_list::min_hole_): New data member.
5051 * output.cc: Include dwarf.h.
5052 (Output_fill_debug_info::do_minimum_hole_size): New function.
5053 (Output_fill_debug_info::do_write): New function.
5054 (Output_fill_debug_line::do_minimum_hole_size): New function.
5055 (Output_fill_debug_line::do_write): New function.
5056 (Output_section::Output_section): Initialize new data member.
5057 (Output_section::set_final_data_size): Ensure patch space is larger
5058 than minimum hole size.
5059 (Output_section::do_write): Fill holes in debug sections.
5060 * output.h (Output_fill): New class.
5061 (Output_fill_debug_info): New class.
5062 (Output_fill_debug_line): New class.
5063 (Output_section::set_free_space_fill): New function.
5064 (Output_section::free_space_fill_): New data member.
5065 * testsuite/Makefile.am (incremental_test_3): Add
5066 --incremental-patch option.
5067 (incremental_test_4): Likewise.
5068 (incremental_test_5): Likewise.
5069 (incremental_test_6): Likewise.
5070 (incremental_copy_test): Likewise.
5071 (incremental_common_test_1): Likewise.
5072 * testsuite/Makefile.in: Regenerate.
5074 2011-08-26 Nick Clifton <nickc@redhat.com>
5076 * po/es.po: Updated Spanish translation.
5078 2011-08-01 Cary Coutant <ccoutant@google.com>
5080 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5081 * gold/testsuite/Makefile.in: Regenerate.
5082 * gold/testsuite/justsyms_exec.c: New source file.
5083 * gold/testsuite/justsyms_lib.c: New source file.
5085 2011-08-01 Cary Coutant <ccoutant@google.com>
5087 * layout.cc (Layout::set_segment_offsets): Don't realign text
5088 segment if -Ttext was specified.
5089 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5091 * object.h (Sized_relobj_file::e_type): New function.
5092 (Sized_relobj_file::e_type_): New data member.
5093 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5094 base address for ET_EXEC files.
5095 * target.cc (Target::do_make_elf_object_implementation): Allow
5096 ET_EXEC files with --just-symbols option.
5098 2011-07-28 Cary Coutant <ccoutant@google.com>
5100 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5101 Add thread_number parameter.
5102 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5103 * workqueue-threads.cc
5104 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5105 current thread if its thread number is greater than desired thread
5107 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5108 Add thread_number parameter.
5109 (Workqueue::should_cancel_thread): Likewise.
5110 (Workqueue::find_runnable_or_wait): Pass thread_number to
5111 should_cancel_thread.
5112 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5115 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5117 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5118 only after checking if it cannot be forced local.
5119 * symtab.h (is_externally_visible): Check if the symbol is not forced
5122 2011-07-15 Ian Lance Taylor <iant@google.com>
5124 * options.h (class General_options): Add --print-output-format.
5125 Move -EL next to -EB, for better --help output.
5126 * target-select.cc: Include <cstdio>, "options.h", and
5128 (Target_selector::do_target_bfd_name): New function.
5129 (print_output_format): New function.
5130 * target-select.h (class Target_selector): Update declarations.
5131 (Target_selector::target_bfd_name): New function.
5132 (print_output_format): Declare.
5133 * main.cc: Include "target-select.h".
5134 (main): Handle --print-output-format.
5135 * gold.cc: Include "target-select.h".
5136 (queue_initial_tasks): Handle --print-output-format when there are
5138 * parameters.cc (parameters_force_valid_target): Give a better
5139 error message if -EB/-EL does not match target.
5140 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5143 2011-07-15 Ian Lance Taylor <iant@google.com>
5145 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5146 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5147 (Output_data_plt_i386::do_write): Write address of .dynamic
5148 section to first entry in .got.plt section.
5149 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5150 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5152 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5153 section to first entry in .got.plt section.
5154 * layout.h (Layout::dynamic_section): New function.
5156 2011-07-13 Sriraman Tallam <tmsriram@google.com>
5158 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5160 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5161 input_section_position_, and input_section_glob_.
5162 (read_layout_from_file): Call function section_ordering_specified.
5163 * layout.h (is_section_ordering_specified): New function.
5164 (section_ordering_specified): New function.
5165 (section_ordering_specified_): New boolean member.
5166 * main.cc(main): Call load_plugins after layout object is defined.
5167 * output.cc (Output_section::add_input_section): Use
5168 function section_ordering_specified to check if section ordering is
5170 * output.cc (Output_section::add_relaxed_input_section): Use
5171 function section_ordering_specified to check if section ordering is
5173 (Output_section::update_section_layout): New function.
5174 (Output_section::sort_attached_input_sections): Check if input section
5176 * output.h (Output_section::update_section_layout): New function.
5177 * plugin.cc (get_section_count): New function.
5178 (get_section_type): New function.
5179 (get_section_name): New function.
5180 (get_section_contents): New function.
5181 (update_section_order): New function.
5182 (allow_section_ordering): New function.
5183 (Plugin::load): Add the new interfaces to the transfer vector.
5184 (Plugin_manager::load_plugins): New parameter.
5185 (Plugin_manager::all_symbols_read): New parameter.
5186 (Plugin_manager::claim_file): New parameter. Save the elf object for
5188 (Plugin_manager::get_elf_object): New function.
5189 (Plugin_manager::get_view): Change to directly use the bool to check
5190 if get_view is called from claim_file_hook.
5191 * plugin.h (input_objects): New function
5192 (Plugin__manager::load_plugins): New parameter.
5193 (Plugin_manager::claim_file): New parameter.
5194 (Plugin_manager::get_elf_object): New function.
5195 (Plugin_manager::in_claim_file_handler): New function.
5196 (Plugin_manager::in_claim_file_handler_): New member.
5197 (layout): New function.
5198 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5199 handler with an extra parameter. Make the elf object before calling
5201 * testsuite/plugin_test.c (get_section_count): New function pointer.
5202 (get_section_type): New function pointer.
5203 (get_section_name): New function pointer.
5204 (get_section_contents): New function pointer.
5205 (update_section_order): New function pointer.
5206 (allow_section_ordering): New function pointer.
5207 (onload): Check if the new interfaces exist.
5209 2011-07-13 Ian Lance Taylor <iant@google.com>
5211 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5213 * x86_64.cc (Target_x86_64::got_section): Likewise.
5214 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5215 (relro_now_test_SOURCES): New variable.
5216 (relro_now_test_DEPENDENCIES): New variable.
5217 (relro_now_test_LDFLAGS): New variable.
5218 (relro_now_test_LDADD): New variable.
5219 (relro_now_test.so): New target.
5220 * testsuite/Makefile.in: Rebuild.
5222 2011-07-12 Ian Lance Taylor <iant@google.com>
5225 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5226 GLOB_DAT relocation rather than a RELATIVE relocation for a
5227 protected symbol when creating a shared library.
5228 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5229 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5230 * testsuite/protected_main_1.cc (main): Test that protected
5231 function has same address.
5233 2011-07-11 Ian Lance Taylor <iant@google.com>
5236 * options.h (class General_options): Add -Bgroup.
5237 * options.cc (General_options::finalize): If -Bgroup is set,
5238 default to --unresolved-symbols=report-all.
5239 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5240 * target-reloc.h (issue_undefined_symbol_error): Handle
5241 --unresolved-symbols=report-all.
5243 2011-07-08 Ian Lance Taylor <iant@google.com>
5246 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5247 if linker script discards key sections.
5248 (Layout::create_dynamic_symtab): Likewise.
5249 (Layout::assign_local_dynsym_offsets): Likewise.
5250 (Layout::sized_create_version_sections): Likewise.
5251 (Layout::create_interp): Likewise.
5252 (Layout::finish_dynamic_section): Likewise.
5253 (Layout::set_dynamic_symbol_size): Likewise.
5255 2011-07-08 Ian Lance Taylor <iant@google.com>
5258 * options.h (class General_options): Add --unresolved-symbols.
5259 * target-reloc.h (issue_undefined_symbol_error): Check
5260 --unresolved-symbols. Add comments.
5262 2011-07-08 Ian Lance Taylor <iant@google.com>
5264 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5265 expression more complex.
5267 2011-07-08 Ian Lance Taylor <iant@google.com>
5270 * target-reloc.h (issue_undefined_symbol_error): New inline
5271 function, broken out of relocate_section.
5272 (relocate_section): Call issue_undefined_symbol_error.
5273 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5274 there is no TLS segment if we are about to issue an undefined
5276 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5278 2011-07-08 Ian Lance Taylor <iant@google.com>
5281 * resolve.cc (Symbol_table::should_override): Add fromtype
5282 parameter. Change all callers. Give error when linking together
5283 TLS and non-TLS symbol.
5284 (Symbol_table::should_override_with_special): Add fromtype
5285 parameter. Change all callers.
5286 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5287 there is no TLS segment if we have reported some errors.
5288 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5290 2011-07-08 Ian Lance Taylor <iant@google.com>
5293 * target.h (Target::plt_address_for_global): New function.
5294 (Target::plt_address_for_local): New function.
5295 (Target::plt_section_for_global): Remove.
5296 (Target::plt_section_for_local): Remove.
5297 (Target::do_plt_address_for_global): New virtual function.
5298 (Target::do_plt_address_for_local): New virtual function.
5299 (Target::do_plt_section_for_global): Remove.
5300 (Target::do_plt_section_for_local): Remove.
5301 (Target::register_global_plt_entry): Add Symbol_table and Layout
5303 * output.cc (Output_data_got::Got_entry::write): Use
5304 plt_address_for_global and plt_address_for_local.
5305 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5306 address of output section.
5307 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5308 got_irelative_, and irelative_count_ fields. Update
5310 (Output_data_plt_i386::has_irelative_section): New function.
5311 (Output_data_plt_i386::entry_count): Add irelative_count_.
5312 (Output_data_plt_i386::set_final_data_size): Likewise.
5313 (class Target_i386): Add got_irelative_ and rel_irelative_
5314 fields. Update declarations.
5315 (Target_i386::Target_i386): Initialize new fields.
5316 (Target_i386::do_plt_address_for_global): New function replacing
5317 do_plt_section_for_global.
5318 (Target_i386::do_plt_address_for_local): New function replacing
5319 do_plt_section_for_local.
5320 (Target_i386::got_section): Create got_irelative_.
5321 (Target_i386::rel_irelative_section): New function.
5322 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5323 fields. Don't define __rel_iplt_{start,end}.
5324 (Output_data_plt_i386::add_entry): Add symtab and layout
5325 parameters. Change all callers. Use different PLT and GOT for
5327 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5328 layout parameters. Change all callers. Use different PLT and
5330 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5331 (Output_data_plt_i386::rel_irelative): New function.
5332 (Output_data_plt_i386::address_for_global): New function.
5333 (Output_data_plt_i386::address_for_local): New function.
5334 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5335 IRELATIVE GOT when changing IFUNC GOT entries.
5336 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5338 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5339 if we didn't create an IRELATIVE GOT.
5340 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5341 plt_address_for_local.
5342 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5343 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5344 got_irelative_, and irelative_count_ fields. Update
5346 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5347 Initialize new fields. Remove symtab parameter. Change all
5349 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5351 (Output_data_plt_x86_64::has_irelative_section): New function.
5352 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5353 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5354 fields. Update declarations.
5355 (Target_x86_64::Target_x86_64): Initialize new fields.
5356 (Target_x86_64::do_plt_address_for_global): New function replacing
5357 do_plt_section_for_global.
5358 (Target_x86_64::do_plt_address_for_local): New function replacing
5359 do_plt_section_for_local.
5360 (Target_x86_64::got_section): Create got_irelative_.
5361 (Target_x86_64::rela_irelative_section): New function.
5362 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5363 all callers. Don't create __rel_iplt_{start,end}.
5364 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5365 parameters. Change all callers. Use different PLT and GOT for
5367 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5368 layout parameters. Change all callers. Use different PLT and
5370 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5371 parameters. Change all callers. Use different PLT and GOT for
5373 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5374 (Output_data_plt_x86_64::rela_irelative): New function.
5375 (Output_data_plt_x86_64::address_for_global): New function.
5376 (Output_data_plt_x86_64::address_for_local): New function.
5377 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5378 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5379 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5380 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5382 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5384 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5385 symbols if we didn't create an IRELATIVE GOT.
5386 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5387 plt_address_for_local.
5388 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5389 * testsuite/ifuncvar1.c: New test file.
5390 * testsuite/ifuncvar2.c: New test file.
5391 * testsuite/ifuncvar3.c: New test file.
5392 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5393 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5394 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5395 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5396 * testsuite/Makefile.in: Rebuild.
5398 2011-07-07 Cary Coutant <ccoutant@google.com>
5400 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5401 (two_file_test_1_ndebug.o): Likewise.
5402 (two_file_test_1b_ndebug.o): Likewise.
5403 (two_file_test_2_ndebug.o): Likewise.
5404 (two_file_test_main_ndebug.o): Likewise.
5405 (incremental_test_2): Link with no-debug versions.
5407 2011-07-06 Cary Coutant <ccoutant@google.com>
5409 * gold/incremental.cc
5410 (Output_section_incremental_inputs::write_info_blocks): Check for
5411 hidden and internal symbols.
5413 2011-07-06 Cary Coutant <ccoutant@google.com>
5415 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5416 Check disposition for startup file.
5417 (Incremental_inputs::report_command_line): Ignore
5418 --incremental-startup-unchanged option.
5419 * options.cc (General_options::parse_incremental_startup_unchanged):
5421 (General_options::General_options): Initialize new data member.
5422 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5423 (General_options): Add --incremental-startup-unchanged option.
5424 (General_options::incremental_startup_disposition): New function.
5425 (General_options::incremental_startup_disposition_): New data member.
5427 2011-07-06 Cary Coutant <ccoutant@google.com>
5429 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5430 input file index to Script_info ctor.
5431 (Sized_incremental_binary::do_file_has_changed): Find the
5432 command-line argument for files named in scripts.
5433 * incremental.h (Script_info::Script_info): New ctor
5434 with input file index.
5435 (Script_info::input_file_index): New function.
5436 (Script_info::input_file_index_): New data member.
5437 (Incremental_binary::get_library): Add const.
5438 (Incremental_binary::get_script_info): Add const.
5439 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5440 * testsuite/Makefile.am (incremental_test_5): New test case.
5441 (incremental_test_6): New test case.
5442 * testsuite/Makefile.in: Regenerate.
5444 2011-07-06 Cary Coutant <ccoutant@google.com>
5446 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5447 debug output when command lines differ.
5449 2011-07-06 Cary Coutant <ccoutant@google.com>
5451 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5452 --incremental-patch option.
5453 * layout.cc (Free_list::allocate): Extend allocation beyond original
5455 (Layout::make_output_section): Mark sections that should get
5457 * options.cc (parse_percent): New function.
5458 * options.h (parse_percent): New function.
5459 (DEFINE_percent): New macro.
5460 (General_options): Add --incremental-patch option.
5461 * output.cc (Output_section::Output_section): Initialize new data
5463 (Output_section::add_input_section): Print section name when out
5465 (Output_section::add_output_section_data): Likewise.
5466 (Output_section::set_final_data_size): Add patch space when
5467 doing --incremental-full.
5468 (Output_section::do_reset_address_and_file_offset): Remove patch
5470 (Output_segment::set_section_list_addresses): Print debug output
5471 only if --incremental-update.
5472 * output.h (Output_section::set_is_patch_space_allowed): New function.
5473 (Output_section::is_patch_space_allowed_): New data member.
5474 (Output_section::patch_space_): New data member.
5475 * parameters.cc (Parameters::incremental_full): New function.
5476 * parameters.h (Parameters::incremental_full): New function
5477 * testsuite/Makefile.am (incremental_test_2): Add test for
5478 --incremental-patch option.
5479 * testsuite/Makefile.in: Regenerate.
5480 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5481 (t18): Remove function body.
5483 2011-07-05 Doug Kwan <dougkwan@google.com>
5486 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5487 Arm_Address type for relocation result.
5488 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5490 (Arm_relocate_functions::abs32): Use unaligned access.
5491 (Arm_relocate_functions::rel32): Ditto.
5492 (Arm_relocate_functions::prel31): Ditto.
5493 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5494 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5495 static data relocations.
5496 * testsuite/Makefile.in: Regnerate.
5497 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5499 2011-07-05 Ian Lance Taylor <iant@google.com>
5502 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5503 symbols if necessary.
5504 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5506 2011-07-05 Ian Lance Taylor <iant@google.com>
5509 * resolve.cc (Symbol::override_base_with_special): Simply override
5510 version with special symbol version, ignoring previous version.
5512 2011-07-05 Ian Lance Taylor <iant@google.com>
5514 * object.cc (Sized_relobj_file::include_section_group): Add
5515 information to comment about signature location.
5517 2011-07-02 Ian Lance Taylor <iant@google.com>
5520 * options.h (class General_options): Add -f and -F.
5521 * options.cc (General_options::finalize): Fatal error if -f/-F
5522 are used without -shared.
5523 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5525 2011-07-02 Ian Lance Taylor <iant@google.com>
5527 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5529 2011-07-01 Ian Lance Taylor <iant@google.com>
5533 * resolve.cc (Symbol::override_base_with_special): Don't override
5534 the version if the overriding symbol has a different name.
5535 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5536 all callers. If we give an error about an undefined version,
5537 define the base version if necessary.
5538 * dynobj.h (class Versions): Update declaration.
5539 * testsuite/weak_alias_test_5.cc: New file.
5540 * testsuite/weak_alias_test.script: New file.
5541 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5542 and versioned_alias have the right value, and call t2.
5543 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5544 weak_alias_test_5.so.
5545 (weak_alias_test_LDADD): Likewise.
5546 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5547 * testsuite/Makefile.in: Rebuild.
5549 2011-07-01 Ian Lance Taylor <iant@google.com>
5552 * options.h (class General_options): Support -z notext.
5553 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5555 (two_file_shared_nonpic.so): Likewise.
5556 (two_file_shared_mixed.so): Likewise.
5557 (two_file_shared_mixed_1.so): Likewise.
5558 (weak_undef_lib_nonpic.so): Likewise.
5559 (alt/weak_undef_lib_nonpic.so): Likewise.
5560 (tls_test_shared_nonpic.so): Likewise.
5561 * testsuite/Makefile.in: Rebuild.
5563 2011-07-01 Ian Lance Taylor <iant@google.com>
5566 * configure.ac: Test whether static linking works, setting
5567 the automake conditional HAVE_STATIC.
5568 * testsuite/Makefile.am: Disable tests using -static if
5569 HAVE_STATIC is not true.
5570 * configure, testsuite/Makefile.in: Rebuild.
5572 2011-07-01 Ian Lance Taylor <iant@google.com>
5575 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5576 Assert if we see DW_EH_PE_indirect.
5577 * target.h (Target::ehframe_datarel_base): New function.
5578 (Target::do_ehframe_datarel_base): New target function.
5579 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5580 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5583 2011-07-01 Ian Lance Taylor <iant@google.com>
5586 * options.h (class General_options): Add
5587 --ld-generated-unwind-info.
5588 * ehframe.cc (Fde::write): Add address parameter. Change all
5589 callers. If associated with PLT, fill in address and size.
5590 (Cie::set_output_offset): Only add merge mapping if there is an
5592 (Cie::write): Add address parameter. Change all callers.
5593 (Eh_frame::add_ehframe_for_plt): New function.
5594 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5595 input_offset_ fields into union u_, with new plt field.
5596 (Fde::Fde): Adjust for new union field.
5597 (Fde::Fde) [Output_data version]: New constructor.
5598 (Fde::add_mapping): Only add merge mapping if there is an object.
5599 (class Cie): Update declarations.
5600 (class Eh_frame): Declare add_ehframe_for_plt.
5601 * layout.cc (Layout::layout_eh_frame): Break out code into
5602 make_eh_frame_section, and call it.
5603 (Layout::make_eh_frame_section): New function.
5604 (Layout::add_eh_frame_for_plt): New function.
5605 * layout.h (class Layout): Update declarations.
5606 * merge.cc (Merge_map::add_mapping): Add assertion.
5607 * i386.cc: Include "dwarf.h".
5608 (class Output_data_plt_i386): Make first_plt_entry,
5609 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5610 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5611 and plt_eh_frame_fde.
5612 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5613 boundary. Call add_eh_frame_for_plt if appropriate.
5614 * x86_64.cc: Include "dwarf.h".
5615 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5616 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5617 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5618 and plt_eh_frame_fde.
5619 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5622 2011-06-29 Ian Lance Taylor <iant@google.com>
5625 * object.cc (Sized_relobj_file::layout_section): Change shdr
5626 parameter to be const.
5627 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5629 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5630 appropriate. Call layout_eh_frame_section.
5631 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5633 * object.h (class Sized_relobj_file): Update declarations.
5635 2011-06-29 Ian Lance Taylor <iant@google.com>
5638 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5640 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5642 2011-06-29 Ian Lance Taylor <iant@google.com>
5645 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5647 * layout.cc (Layout::layout_eh_frame): Likewise.
5649 2011-06-29 Ian Lance Taylor <iant@google.com>
5652 * layout.cc (Layout::symtab_section_shndx): New function.
5653 * layout.h (class Layout): Declare symtab_section_shndx.
5654 * output.cc (Output_section::write_header): Call it.
5656 2011-06-29 Ian Lance Taylor <iant@google.com>
5659 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5660 symbols which are not used in a relocation.
5662 2011-06-28 Ian Lance Taylor <iant@google.com>
5665 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5666 script create indistinguishable segments.
5667 (Layout::set_segment_offsets): Use stable_sort when sorting
5668 segments. Pass this to Compare_segments constructor.
5669 * layout.h (class Layout): Make segment_precedes non-static.
5670 (class Compare_segments): Change from struct to class. Add
5671 layout_ field. Add constructor.
5672 * script-sections.cc
5673 (Script_sections::attach_sections_using_phdrs_clause): Rename
5674 local orphan to is_orphan. Don't report failure to put empty
5675 section in segment. On attachment failure, report name of
5676 section, and attach to first PT_LOAD segment.
5678 2011-06-28 Ian Lance Taylor <iant@google.com>
5681 * target-select.cc (Target_selector::Target_selector): Add
5682 emulation parameter. Change all callers.
5683 (select_target_by_bfd_name): Rename from select_target_by_name.
5685 (select_target_by_emulation): New function.
5686 (supported_emulation_names): New function.
5687 * target-select.h (class Target_selector): Add emulation_ field.
5688 Update declarations.
5689 (Target_selector::recognize_by_bfd_name): Rename from
5690 recognize_by_name. Change all callers.
5691 (Target_selector::supported_bfd_names): Rename from
5692 supported_names. Change all callers.
5693 (Target_selector::recognize_by_emulation): New function.
5694 (Target_selector::supported_emulations): New function.
5695 (Target_selector::emulation): New function.
5696 (Target_selector::do_recognize_by_bfd_name): Rename from
5697 do_recognize_by_name. Change all callers.
5698 (Target_selector::do_supported_bfd_names): Rename from
5699 do_supported_names. Change all callers.
5700 (Target_selector::do_recognize_by_emulation): New function.
5701 (Target_selector::do_supported_emulations): New function.
5702 (select_target_by_bfd_name): Change name in declaration.
5703 (select_target_by_emulation): Declare.
5704 (supported_emulation_names): Declare.
5705 * parameters.cc (parameters_force_valid_target): Try to find
5706 target based on emulation from -m option.
5707 * options.h (class General_options): Change doc string for -m.
5708 * options.cc (help): Print emulations.
5709 (General_options::parse_V): Likewise.
5710 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5711 Add emulation parameter. Change all callers.
5713 2011-06-28 Ian Lance Taylor <iant@google.com>
5715 * target.h (class Target): Add osabi_ field.
5716 (Target::osabi): New function.
5717 (Target::set_osabi): New function.
5718 (Target::Target): Initialize osabi_.
5719 (Target::do_adjust_elf_header): Make pure virtual.
5720 (Sized_target::do_adjust_elf_header): Declare.
5721 * target.cc (Sized_target::do_adjust_elf_header): New function.
5722 (class Sized_target): Instantiate all versions.
5723 * freebsd.h (class Target_freebsd): Remove.
5724 (Target_selector_freebsd::do_recognize): Call set_osabi on
5726 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5727 (Target_selector_freebsd::set_osabi): Remove.
5728 * i386.cc (class Target_i386): Inherit from Sized_target rather
5729 than Target_freebsd.
5730 * x86_64.cc (class Target_x86_64): Likewise.
5732 2011-06-28 Ian Lance Taylor <iant@google.com>
5734 * target.h (Target::can_check_for_function_pointers): Rewrite.
5736 (Target::can_icf_inline_merge_sections): Likewise.
5737 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5738 (Target::Target_info): Add can_icf_inline_merge_sections field.
5739 (Target::do_can_check_for_function_pointers): New virtual
5741 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5742 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5743 from can_check_for_function_pointers, move in file.
5744 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5745 section_may_have_icf_unsafe_poineters, move in file.
5746 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5747 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5748 Rename from can_check_for_function_pointers, move in file.
5749 (Target_i386::can_icf_inline_merge_sections): Remove.
5750 (Target_i386::i386_info): Initialize
5751 can_icf_inline_merge_sections.
5752 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5753 Initialize can_icf_inline_merge_sections.
5754 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5755 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5756 Rename from can_check_for_function_pointers, move in file.
5757 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5758 (Target_x86_64::x86_64_info): Initialize
5759 can_icf_inline_merge_sections.
5760 * testsuite/testfile.cc (Target_test::test_target_info):
5762 * icf.cc (get_section_contents): Correct formatting.
5764 2011-06-27 Ian Lance Taylor <iant@google.com>
5766 * symtab.cc (Symbol::versioned_name): New function.
5767 (Symbol_table::add_to_final_symtab): Use versioned_name when
5769 (Symbol_table::sized_write_symbol): Likewise.
5770 * symtab.h (class Symbol): Declare versioned_name.
5771 * stringpool.h (class Stringpool_template): Add variant of add
5772 which takes a std::basic_string.
5773 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5774 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5775 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5776 (ver_test_12.o): New target.
5777 * testsuite/Makefile.in: Rebuild.
5779 2011-06-27 Doug Kwan <dougkwan@google.com>
5781 * arm.cc (Arm_relocate_functions::thm_jump8,
5782 Arm_relocate_functions::thm_jump11): Use a wider signed
5783 type to compute offset.
5784 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5786 * testsuite/Makefile.in: Regenerate.
5787 * testsuite/arm_branch_in_range.sh: Check test results of
5788 arm_thm_jump11 and arm_thm_jump8.
5789 * testsuite/arm_thm_jump11.s: New test source file.
5790 * testsuite/arm_thm_jump11.t: New linker script.
5791 * testsuite/arm_thm_jump8.s: New test source file.
5792 * testsuite/arm_thm_jump8.t: New linker script.
5794 2011-06-24 Ian Lance Taylor <iant@google.com>
5796 * layout.cc: Include "object.h".
5797 (ctors_sections_in_init_array): New static variable.
5798 (Layout::is_ctors_in_init_array): New function.
5799 (Layout::layout): Add entry to ctors_sections_in_init_array if
5801 * layout.h (class Layout): Declare is_ctors_in_init_array.
5802 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5803 is_ctors_reverse_view is set.
5804 (Sized_relobj_file::write_sections): Add layout parameter. Change
5805 all callers. Set is_ctors_reverse_view field of View_size.
5806 (Sized_relobj_file::reverse_words): New function.
5807 * object.h (Sized_relobj_file::View_size): Add
5808 is_ctors_reverse_view field.
5809 (class Sized_relobj_file): Update declarations.
5810 * testsuite/initpri3.c: New test.
5811 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5813 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5814 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5815 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5816 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5817 * testsuite/Makefile.in: Rebuild.
5819 2011-06-24 Cary Coutant <ccoutant@google.com>
5821 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5822 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5823 (debug_msg_cdebug.err): New targets.
5824 * testsuite/Makefile.in: Regenerate.
5825 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5826 Fix checks for link with shared library.
5828 2011-06-24 Doug Kwan <dougkwan@google.com>
5830 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5831 skip empty text sections.
5832 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5834 2011-06-22 Ian Lance Taylor <iant@google.com>
5837 * options.h (class General_options): Add --ctors-in-init-array.
5838 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5839 friends as SHT_PROGBITS for merging sections.
5840 (Layout::layout): Remove special handling of .init_array and
5841 friends. Don't sort if doing relocatable link. Sort for .ctors
5842 and .dtors if ctors_in_init_array.
5843 (Layout::make_output_section): Force correct section types for
5844 .init_array and friends. Don't sort if doing relocatable link,
5845 Don't sort .ctors and .dtors if ctors_in_init_array.
5846 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5847 (Layout::output_section_name): Add relobj parameter. Change all
5848 callers. Handle .ctors. and .dtors. in code rather than table.
5849 Handle .ctors and .dtors if ctors_in_init_array.
5850 (Layout::match_file_name): New function, moved from output.cc.
5851 * layout.h (class Layout): Update declarations.
5852 * output.cc: Include "layout.h".
5853 (Input_section_sort_entry::get_priority): New function.
5854 (Input_section_sort_entry::match_file_name): Just call
5855 Layout::match_file_name.
5856 (Output_section::Input_section_sort_init_fini_compare::operator()):
5857 Handle .ctors and .dtors. Sort by explicit priority rather than
5859 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5860 * testsuite/initpri2.c: New test.
5861 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5862 (check_PROGRAMS): Add initpri2.
5863 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5864 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5865 * configure, testsuite/Makefile.in: Rebuild.
5867 2011-06-19 Ian Lance Taylor <iant@google.com>
5870 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5871 .interp section to a PT_INTERP segment even if we have seen a
5872 --dynamic-linker option. Don't do it if we have seen a PHDRS
5873 clause in a linker script.
5874 (Layout::finalize): Don't create a .interp section if we've
5875 already create a PT_INTERP segment.
5876 (Layout::create_interp): Always call choose_output_section (revert
5877 patch of 2011-06-17). Don't create PT_INTERP segment.
5878 * script-sections.cc
5879 (Script_sections::create_note_and_tls_segments): Add a .interp
5880 section to a PT_INTERP segment even if we have seen a
5881 --dynamic-linker option.
5883 2011-06-18 Ian Lance Taylor <iant@google.com>
5885 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5886 merely because a non-PT_LOAD segment has a dynamic reloc.
5888 2011-06-18 Ian Lance Taylor <iant@google.com>
5890 * layout.cc (Layout::finish_dynamic_section): Don't create
5891 DT_FLAGS entry if not needed.
5893 2011-06-18 Ian Lance Taylor <iant@google.com>
5896 * layout.cc (Layout::layout_eh_frame): Correct handling of
5897 writable .eh_frame section.
5899 2011-06-17 Ian Lance Taylor <iant@google.com>
5902 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5903 symbol is redefined with the exact same object and value.
5905 2011-06-17 Ian Lance Taylor <iant@google.com>
5908 * layout.h (class Layout): Add interp_segment_ field.
5909 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5910 (Layout::attach_allocated_section_to_segment): If making shared
5911 library, put .interp section in PT_INTERP segment.
5912 (Layout::finalize): Also call create_interp if -dynamic-linker
5914 (Layout::create_interp): Assert that there is no PT_INTERP
5915 segment. If not using a SECTIONS clause, use make_output_section.
5916 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5917 * script-sections.cc
5918 (Script_sections::create_note_and_tls_segments): If making shared
5919 library, put .interp section in PT_INTERP segment.
5921 2011-06-17 Ian Lance Taylor <iant@google.com>
5923 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5924 when making a shared library.
5926 2011-06-17 Ian Lance Taylor <iant@google.com>
5928 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5929 parameter. Change all callers. Don't issue warning about PC32
5930 against locally defined symbol.
5932 2011-06-16 Ian Lance Taylor <iant@google.com>
5934 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5935 occurs in same object.
5937 2011-06-14 Alan Modra <amodra@gmail.com>
5939 * po/POTFILES.in: Regenerate.
5941 2011-06-09 Ian Lance Taylor <iant@google.com>
5943 * script-sections.cc
5944 (Orphan_output_section::set_section_addresses): For a relocatable
5945 link set address to 0.
5947 2011-06-09 Cary Coutant <ccoutant@google.com>
5950 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5951 used with --compress-debug-sections.
5952 * gold/object.cc (Sized_relobj_file::do_layout): Report
5953 uncompressed size of compressed input sections.
5955 2011-06-08 Cary Coutant <ccoutant@google.com>
5958 * testsuite/two_file_test_2_v1.cc: Change initialization of
5959 v2 to keep it in .data.
5961 2011-06-07 Cary Coutant <ccoutant@google.com>
5963 * common.cc (Symbol_table::do_allocate_commons_list): Call
5965 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5966 (Errors::fallback): New function.
5967 (gold_fallback): New function.
5968 * errors.h (Errors::fallback): New function.
5969 * gold.cc (gold_exit): Change status parameter to enum; adjust
5971 (queue_initial_tasks): Call gold_fallback.
5972 * gold.h: Include cstdlib.
5973 (Exit_status): New enum type.
5974 (gold_exit): Change status parameter to enum.
5975 (gold_fallback): New function.
5976 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5977 (Layout::create_symtab_sections): Likewise.
5978 (Layout::create_shdrs): Likewise.
5979 * main.cc (main): Adjust call to gold_exit.
5980 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5981 (Output_data_got::add_got_entry_pair): Likewise.
5982 (Output_section::add_input_section): Likewise.
5983 (Output_section::add_output_section_data): Likewise.
5984 (Output_segment::set_section_list_addresses): Likewise.
5985 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5987 2011-06-07 Cary Coutant <ccoutant@google.com>
5989 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5990 for incremental links.
5991 * output.cc (Output_segment::set_section_list_addresses): Remove
5992 FIXME and test for TLS or BSS.
5994 2011-06-07 Cary Coutant <ccoutant@google.com>
5996 * testsuite/Makefile.am: Add incremental_copy_test,
5997 incremental_common_test_1.
5998 * testsuite/Makefile.in: Regenerate.
5999 * testsuite/common_test_1_v1.c: New source file.
6000 * testsuite/common_test_1_v2.c: New source file.
6001 * testsuite/copy_test_v1.cc: New source file.
6003 2011-06-07 Cary Coutant <ccoutant@google.com>
6005 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6006 update, allocate common from bss section's free list.
6007 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6008 linker-defined symbols.
6009 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6010 Skip GOT and PLT entries that are no longer referenced.
6011 (Output_section_incremental_inputs::write_info_blocks): Mark
6012 linker-defined symbols.
6013 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6014 * output.cc (Output_section::allocate): New function.
6015 * output.h (Output_section::allocate): New function.
6016 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6017 linker-defined symbols.
6018 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6019 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6020 (Symbol::init_base_output_data): Likewise.
6021 (Symbol::init_base_output_segment): Likewise.
6022 (Symbol::init_base_constant): Likewise.
6023 (Sized_symbol::init_output_data): Likewise.
6024 (Sized_symbol::init_output_segment): Likewise.
6025 (Sized_symbol::init_constant): Likewise.
6026 (Symbol_table::do_define_in_output_data): Likewise.
6027 (Symbol_table::do_define_in_output_segment): Likewise.
6028 (Symbol_table::do_define_as_constant): Likewise.
6029 * symtab.h (Symbol::is_predefined): New function.
6030 (Symbol::init_base_output_data): Add is_predefined parameter.
6031 (Symbol::init_base_output_segment): Likewise.
6032 (Symbol::init_base_constant): Likewise.
6033 (Symbol::is_predefined_): New data member.
6034 (Sized_symbol::init_output_data): Add is_predefined parameter.
6035 (Sized_symbol::init_output_segment): Likewise.
6036 (Sized_symbol::init_constant): Likewise.
6037 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6039 2011-06-07 Cary Coutant <ccoutant@google.com>
6041 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6042 instead of emit_copy_reloc.
6043 (Copy_relocs::emit_copy_reloc): Refactor.
6044 (Copy_relocs::make_copy_reloc): New function.
6045 (Copy_relocs::add_copy_reloc): Remove.
6046 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6048 (Copy_relocs::make_copy_reloc): New function.
6049 (Copy_relocs::add_copy_reloc): Remove.
6050 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6051 unchanged input files.
6052 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6053 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6054 Reserve BSS space for COPY relocations.
6055 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6056 (Output_section_incremental_inputs::write_info_blocks): Record
6057 whether a symbol is copied from a shared object.
6058 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6059 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6060 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6061 (Incremental_input_entry_reader::get_output_symbol_index): Add
6063 (Incremental_binary::emit_copy_relocs): New function.
6064 (Incremental_binary::do_emit_copy_relocs): New function.
6065 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6067 (Sized_incremental_binary::add_copy_reloc): New function.
6068 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6069 (Sized_incremental_binary::Copy_reloc): New struct.
6070 (Sized_incremental_binary::Copy_relocs): New typedef.
6071 (Sized_incremental_binary::copy_relocs_): New data member.
6072 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6073 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6074 * target.h (Sized_target::emit_copy_reloc): New function.
6075 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6077 2011-06-02 Cary Coutant <ccoutant@google.com>
6080 * gold/archive.cc (Archive::Archive): Initialize new data member.
6081 (Archive::include_all_members): Return if archive has already been
6083 * gold/archive.h (Archive::include_all_members_): New data member.
6085 2011-06-02 Nick Clifton <nickc@redhat.com>
6087 * dynobj.h: Fix spelling mistake in comment.
6088 * output.cc: Likewise.
6090 2011-05-31 Doug Kwan <dougkwan@google.com>
6094 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6095 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6096 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6097 redundant arm_exidx_test.so.
6098 * testsuite/Makefile.in: Regenerate.
6099 (check_SCRIPTS): Add pr12826.sh
6100 (check_DATA): Add pr12826.stdout
6101 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6102 * testsuite/pr12826.sh: New file.
6103 * testsuite/pr12826_1.s: Ditto.
6104 * testsuite/pr12826_1.s: Ditto.
6106 2011-05-30 Ian Lance Taylor <iant@google.com>
6108 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6111 2011-05-29 Ian Lance Taylor <iant@google.com>
6114 * testsuite/Makefile.am: Use different file name for two_file_test
6115 temporary file for each incremental test.
6116 * testsuite/Makefile.in: Rebuild.
6118 2011-05-29 Ian Lance Taylor <iant@google.com>
6120 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6121 binary input file is empty.
6123 2011-05-27 Ian Lance Taylor <iant@google.com>
6125 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6126 (ver_test_9.so): Likewise.
6127 * testsuite/Makefile.in: Rebuild.
6129 2011-05-26 Cary Coutant <ccoutant@google.com>
6131 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6132 * incremental.cc (Incremental_inputs::report_input_section): Fix
6133 comment, indentation.
6134 (Incremental_inputs::report_comdat_group): New function.
6135 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6136 of data for incremental input file entry.
6137 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6138 group count, COMDAT group signatures.
6139 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6140 an unchanged input file.
6141 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6142 Initialize new data member.
6143 (Incremental_object_entry::add_comdat_group): New function.
6144 (Incremental_object_entry::get_comdat_group_count): New function.
6145 (Incremental_object_entry::get_comdat_signature_key): New function.
6146 (Incremental_object_entry::groups_): New data member.
6147 (Incremental_inputs::report_comdat_group): New function.
6148 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6149 data for incremental input file entry.
6150 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6151 (Incremental_input_entry_reader::get_input_section): Adjust size of
6152 data for incremental input file entry.
6153 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6154 (Incremental_input_entry_reader::get_comdat_group_signature): New
6156 * object.cc (Sized_relobj::include_section_group): Report kept
6157 COMDAT groups for incremental links.
6159 2011-05-24 David Meyer <pdox@google.com>
6161 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6162 with name parameter. Add found_name parameter.
6163 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6164 * dirsearch.h (class Dirsearch): Update declaration.
6166 2011-05-24 Ian Lance Taylor <iant@google.com>
6168 * archive.cc (Library_base::should_include_member): Pull in object
6169 from archive if it defines the entry symbol.
6170 * parameters.cc (Parameters::entry): New function.
6171 * parameters.h (class Parameters): Declare entry.
6172 * output.h (class Output_file_header): Remove entry_ field.
6173 * output.cc (Output_file_header::Output_file_header): Remove entry
6174 parameter. Change all callers.
6175 (Output_file_header::entry): Use parameters->entry.
6176 * gold.cc (queue_middle_tasks): Likewise.
6177 * plugin.cc (Plugin_hook::run): Likewise.
6179 2011-05-24 Cary Coutant <ccoutant@google.com>
6181 * gold.cc (queue_initial_tasks): Pass incremental base filename
6182 to Output_file::open_base_file; don't print error message.
6183 * incremental-dump.cc (main): Adjust call to
6184 Output_file::open_for_modification.
6185 * incremental-dump.cc (main): Likewise.
6186 * incremental.cc (Incremental_inputs::report_command_line):
6187 Ignore --incremental-base option when comparing command lines.
6188 Ignore parameter when given as separate argument.
6189 * options.h (class General_options): Add --incremental-base.
6190 * output.cc (Output_file::Output_file):
6191 (Output_file::open_base_file): Add base_name and writable parameters;
6192 read base file into new file; print error message here.
6193 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6195 * output.h (Output_file::open_for_modification): Rename to...
6196 (Output_file::open_base_file): ...this; add base_name and
6197 writable parameters; adjust all callers.
6198 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6200 * testsuite/Makefile.am (incremental_test_4): Test
6202 * testsuite/Makefile.in: Regenerate.
6204 2011-05-24 Cary Coutant <ccoutant@google.com>
6206 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6208 * testsuite/Makefile.in: Regenerate.
6209 * testsuite/two_file_test_1_v1.cc: New test source file.
6210 * testsuite/two_file_test_1b_v1.cc: New test source file.
6211 * testsuite/two_file_test_2_v1.cc: New test source file.
6213 2011-05-24 Cary Coutant <ccoutant@google.com>
6215 * dynobj.h (Dynobj::do_dynobj): New function.
6216 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6217 flag and soname for shared objects.
6218 * incremental.cc (Incremental_inputs::report_object): Make
6219 either Incremental_object_entry or Incremental_dynobj_entry; add
6220 soname to string table.
6221 (Incremental_inputs::report_input_section): Add assertion.
6222 (Output_section_incremental_inputs::set_final_data_size): Adjust
6223 type of input file entry for shared libraries; adjust size of
6224 shared library info entry.
6225 (Output_section_incremental_inputs::write_input_files): Write
6226 as_needed flag for shared libraries.
6227 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6228 of input file entry for shared libraries; write soname.
6229 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6230 soname from incremental info.
6231 * incremental.h (enum Incremental_input_flags): Add
6232 INCREMENTAL_INPUT_AS_NEEDED.
6233 (Incremental_input_entry::Incremental_input_entry): Initialize new
6235 (Incremental_input_entry::set_as_needed): New function.
6236 (Incremental_input_entry::as_needed): New function.
6237 (Incremental_input_entry::do_dynobj_entry): New function.
6238 (Incremental_input_entry::as_needed_): New data member.
6239 (Incremental_object_entry::Incremental_object_entry): Don't check
6241 (Incremental_object_entry::do_type): Likewise.
6242 (class Incremental_dynobj_entry): New class.
6243 (Incremental_input_entry_reader::as_needed): New function.
6244 (Incremental_input_entry_reader::get_soname): New function.
6245 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6246 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6247 size of shared library info entry.
6248 * layout.cc (Layout::finish_dynamic_section): Don't test for
6249 incremental link when adding DT_NEEDED entries.
6250 * object.h (Object::Object): Initialize new data member.
6251 (Object::dynobj): New function.
6252 (Object::set_as_needed): New function.
6253 (Object::as_needed): New function.
6254 (Object::do_dynobj): New function.
6255 (Object::as_needed_): New data member.
6257 2011-05-24 Cary Coutant <ccoutant@google.com>
6259 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6260 info; adjust display of GOT entries.
6261 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6262 vector of input objects; remove file_status_.
6263 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6264 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6265 got_plt reader; call target hooks to reserve GOT entries.
6266 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6267 of input file info header and GOT info entry.
6268 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6270 (Got_plt_view_info::got_descriptor): Remove.
6271 (Got_plt_view_info::sym_index): New data member.
6272 (Got_plt_view_info::input_index): New data member.
6273 (Local_got_offset_visitor::visit): Write input file index.
6274 (Global_got_offset_visitor::visit): Write 0 for input file index.
6275 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6276 with sym_index and input_index.
6277 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6278 incremental info GOT entry; replace got_descriptor with input_index.
6279 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6280 map from input file index to object.
6281 (Sized_relobj_incr::do_layout): Replace direct data member reference
6282 with accessor function.
6283 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6284 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6285 Adjust size of input file info header.
6286 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6287 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6288 (Incremental_input_entry_reader::get_input_section): Adjust size of
6289 input file info header.
6290 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6291 of incremental info GOT entry.
6292 (Incremental_got_plt_reader::get_got_desc): Remove.
6293 (Incremental_got_plt_reader::get_got_symndx): New function.
6294 (Incremental_got_plt_reader::get_got_input_index): New function.
6295 (Sized_incremental_binary::Sized_incremental_binary): Remove
6296 file_status_; add input_objects_.
6297 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6298 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6299 (Sized_incremental_binary::file_is_unchanged): Remove.
6300 (Sized_incremental_binary::set_input_object): New function.
6301 (Sized_incremental_binary::input_object): New function.
6302 (Sized_incremental_binary::file_status_): Remove.
6303 (Sized_incremental_binary::input_objects_): New data member.
6304 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6306 (Sized_relobj_incr::invalid_address): Move to base class.
6307 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6309 (Sized_relobj_incr::do_output_section_offset): Likewise.
6310 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6311 (Sized_relobj_incr::section_offsets_): Likewise.
6312 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6314 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6315 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6316 with accessor function.
6317 (Sized_relobj_file::do_layout): Likewise.
6318 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6319 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6320 (Sized_relobj_file::compute_final_local_value): Replace refs to
6321 section_offsets_ with accessor function.
6322 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6323 * object.h (Relobj::Relobj): Initialize new data members.
6324 (Relobj::add_dyn_reloc): New function.
6325 (Relobj::first_dyn_reloc): New function.
6326 (Relobj::dyn_reloc_count): New function.
6327 (Relobj::first_dyn_reloc_): New data member.
6328 (Relobj::dyn_reloc_count_): New data member.
6329 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6331 (Sized_relobj::Address): New typedef.
6332 (Sized_relobj::invalid_address): Move here from child class.
6333 (Sized_relobj::Sized_relobj): Initialize new data members.
6334 (Sized_relobj::sized_relobj): New function.
6335 (Sized_relobj::is_output_section_offset_invalid): Move here from
6337 (Sized_relobj::get_output_section_offset): Likewise.
6338 (Sized_relobj::local_has_got_offset): Likewise.
6339 (Sized_relobj::local_got_offset): Likewise.
6340 (Sized_relobj::set_local_got_offset): Likewise.
6341 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6342 (Sized_relobj::clear_got_offsets): New function.
6343 (Sized_relobj::section_offsets): Move here from child class.
6344 (Sized_relobj::do_output_section_offset): Likewise.
6345 (Sized_relobj::do_set_section_offset): Likewise.
6346 (Sized_relobj::Local_got_offsets): Likewise.
6347 (Sized_relobj::local_got_offsets_): Likewise.
6348 (Sized_relobj::section_offsets_): Likewise.
6349 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6351 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6353 (Sized_relobj_file::sized_relobj): New function
6354 (Sized_relobj_file::local_has_got_offset): Move to base class.
6355 (Sized_relobj_file::local_got_offset): Likewise.
6356 (Sized_relobj_file::set_local_got_offset): Likewise.
6357 (Sized_relobj_file::get_output_section_offset): Likewise.
6358 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6359 (Sized_relobj_file::do_output_section_offset): Likewise.
6360 (Sized_relobj_file::do_set_section_offset): Likewise.
6361 (Sized_relobj_file::Local_got_offsets): Likewise.
6362 (Sized_relobj_file::local_got_offsets_): Likewise.
6363 (Sized_relobj_file::section_offsets_): Likewise.
6364 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6366 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6367 (Output_reloc::get_symbol_index): Likewise.
6368 (Output_reloc::local_section_offset): Likewise.
6369 (Output_reloc::get_address): Likewise.
6370 (Output_reloc::symbol_value): Likewise.
6371 (Output_data_got::reserve_slot): Move to class definition.
6372 (Output_data_got::reserve_local): New function.
6373 (Output_data_got::reserve_slot_for_global): Remove.
6374 (Output_data_got::reserve_global): New function.
6375 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6376 (all constructors, two instantiations).
6377 (Output_reloc::get_relobj): New function (two instantiations).
6378 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6379 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6380 (Output_data_reloc::add_global): Adjust type of relobj.
6381 (Output_data_reloc::add_global_relative): Likewise.
6382 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6383 (Output_data_reloc::add_local): Likewise.
6384 (Output_data_reloc::add_local_relative): Likewise.
6385 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6386 (Output_data_reloc::add_local_section): Likewise.
6387 (Output_data_reloc::add_output_section): Likewise.
6388 (Output_data_reloc::add_absolute): Likewise.
6389 (Output_data_reloc::add_target_specific): Likewise.
6390 (Output_data_got::reserve_slot): Move definition here.
6391 (Output_data_got::reserve_local): New function.
6392 (Output_data_got::reserve_global): New function.
6393 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6394 section_offsets_ with accessor function.
6395 (Sized_relobj_file::write_sections): Likewise.
6396 (Sized_relobj_file::do_relocate_sections): Likewise.
6397 * target.h (Sized_target::reserve_local_got_entry): New function.
6398 (Sized_target::reserve_global_got_entry): New function.
6399 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6400 (Target_x86_64::reserve_global_got_entry): New function.
6401 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6403 2011-05-23 Cary Coutant <ccoutant@google.com>
6405 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6406 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6407 bit when checking got_type.
6408 * incremental.cc (Sized_incremental_binary::setup_readers):
6409 Store symbol table and string table locations; initialize bit vector
6410 of file status flags.
6411 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6413 (Sized_incremental_binary::do_process_got_plt): New function.
6414 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6415 (Output_section_incremental_inputs::set_final_data_size): Record
6416 file index for each input file.
6417 (Output_section_incremental_inputs::write_got_plt): Store file index
6418 instead of input entry offset for each GOT entry.
6420 (Incremental_input_entry::Incremental_input_entry): Initialize new
6422 (Incremental_input_entry::set_offset): Store file index.
6423 (Incremental_input_entry::get_file_index): New function.
6424 (Incremental_input_entry::file_index_): New data member.
6425 (Incremental_binary::process_got_plt): New function.
6426 (Incremental_binary::do_process_got_plt): New function.
6427 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6429 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6430 (Sized_incremental_binary::set_file_is_unchanged): New function.
6431 (Sized_incremental_binary::file_is_unchanged): New function.
6432 (Sized_incremental_binary::do_process_got_plt): New function.
6433 (Sized_incremental_binary::file_status_): New data member.
6434 (Sized_incremental_binary::main_symtab_loc_): New data member.
6435 (Sized_incremental_binary::main_strtab_loc_): New data member.
6436 * output.cc (Output_data_got::Got_entry::write): Add case
6438 (Output_data_got::add_global): Call add_got_entry.
6439 (Output_data_got::add_global_plt): Likewise.
6440 (Output_data_got::add_global_with_rel): Likewise.
6441 (Output_data_got::add_global_with_rela): Likewise.
6442 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6443 (Output_data_got::add_global_pair_with_rela): Likewise.
6444 (Output_data_got::add_local): Call add_got_entry.
6445 (Output_data_got::add_local_plt): Likewise.
6446 (Output_data_got::add_local_with_rel): Likewise.
6447 (Output_data_got::add_local_with_rela): Likewise.
6448 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6449 (Output_data_got::add_local_pair_with_rela): Likewise.
6450 (Output_data_got::reserve_slot): New function.
6451 (Output_data_got::reserve_slot_for_global): New function.
6452 (Output_data_got::add_got_entry): New function.
6453 (Output_data_got::add_got_entry_pair): New function.
6454 (Output_section::add_output_section_data): Edit FIXME.
6456 (Output_section_data_build::Output_section_data_build): New
6457 constructor with size parameter.
6458 (Output_data_space::Output_data_space): Likewise.
6459 (Output_data_got::Output_data_got): Initialize new data member; new
6460 constructor with size parameter.
6461 (Output_data_got::add_constant): Call add_got_entry.
6462 (Output_data_got::reserve_slot): New function.
6463 (Output_data_got::reserve_slot_for_global): New function.
6464 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6465 (Output_data_got::add_got_entry): New function.
6466 (Output_data_got::add_got_entry_pair): New function.
6467 (Output_data_got::free_list_): New data member.
6468 * target.h (Sized_target::init_got_plt_for_update): New function.
6469 (Sized_target::register_global_plt_entry): New function.
6470 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6471 Initialize new data member; call init; add constructor with PLT count.
6472 (Output_data_plt_x86_64::init): New function.
6473 (Output_data_plt_x86_64::add_relocation): New function.
6474 (Output_data_plt_x86_64::reserve_slot): New function.
6475 (Output_data_plt_x86_64::free_list_): New data member.
6476 (Target_x86_64::init_got_plt_for_update): New function.
6477 (Target_x86_64::register_global_plt_entry): New function.
6478 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6479 incremental updates.
6480 (Output_data_plt_x86_64::add_relocation): New function.
6481 * testsuite/object_unittest.cc (Object_test): Set default options.
6483 2011-05-16 Ian Lance Taylor <iant@google.com>
6485 * options.h (class General_options): Make -i a synonym for -r.
6487 2011-05-16 Ian Lance Taylor <iant@google.com>
6489 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6491 2011-05-10 Cary Coutant <ccoutant@google.com>
6493 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6496 2011-05-06 Ian Lance Taylor <iant@google.com>
6498 * layout.cc (Layout::layout): If the output section flags change,
6499 update the ordering.
6501 2011-04-25 Cary Coutant <ccoutant@google.com>
6503 * incremental-dump.cc (dump_incremental_inputs): Print local
6504 symbol info for each input file.
6506 (Output_section_incremental_inputs::set_final_data_size): Add local
6507 symbol info to input file entries in incremental info.
6508 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6509 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6510 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6511 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6513 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6514 (Sized_incr_relobj::do_relocate): Write the local symbols.
6515 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6516 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6517 Adjust size of input file header.
6518 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6519 (Incremental_inputs_reader::get_local_symbol_count): New function.
6520 (Incremental_inputs_reader::get_input_section): Adjust size of input
6522 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6523 (Sized_incr_relobj::This): New typedef.
6524 (Sized_incr_relobj::sym_size): New const data member.
6525 (Sized_incr_relobj::Local_symbol): New struct.
6526 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6527 (Sized_incr_relobj::do_local_symbol_offset): New function.
6528 (Sized_incr_relobj::local_symbol_count_): New data member.
6529 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6530 (Sized_incr_relobj::local_symbol_index_): New data member.
6531 (Sized_incr_relobj::local_symbol_offset_): New data member.
6532 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6533 (Sized_incr_relobj::local_symbols_): New data member.
6534 * object.h (Relobj::output_local_symbol_count): New function.
6535 (Relobj::local_symbol_offset): New function.
6536 (Relobj::do_output_local_symbol_count): New function.
6537 (Relobj::do_local_symbol_offset): New function.
6538 (Sized_relobj::do_output_local_symbol_count): New function.
6539 (Sized_relobj::do_local_symbol_offset): New function.
6541 2011-04-22 Vladimir Simonov <sv@sw.ru>
6543 * descriptors.cc (set_close_on_exec): New function.
6544 (Descriptors::open): Use set_close_on_exec.
6545 * output.cc (S_ISLNK): Define if not defined.
6547 2011-04-22 Cary Coutant <ccoutant@google.com>
6549 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6551 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6552 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6553 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6555 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6556 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6557 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6559 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6561 (Incremental_binary::apply_incremental_relocs): New function.
6562 (Incremental_binary::do_apply_incremental_relocs): New function.
6563 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6565 (Sized_incremental_binary::add_global_symbol): New function.
6566 (Sized_incremental_binary::global_symbol): New function.
6567 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6568 (Sized_incremental_binary::symbol_map_): New data member.
6569 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6570 * target.h (Sized_target::apply_relocation): New function.
6571 * target-reloc.h (apply_relocation): New function.
6572 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6574 2011-04-22 Doug Kwan <dougkwan@google.com>
6576 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6577 flag of a SHT_ARM_EXIDX section.
6578 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6579 * testsuite/Makefile.in: Regenerate.
6580 * testsuite/arm_exidx_test.s: New file.
6581 * testsuite/arm_exidx_test.sh: Same.
6583 2011-04-20 Cary Coutant <ccoutant@google.com>
6586 * archive.h (Incremental_archive_entry::Archive_member):
6587 Initialize arg_serial_ (second constructor).
6589 2011-04-17 Ian Lance Taylor <iant@google.com>
6591 * object.cc (Relocate_info::location): Simplify location string.
6592 * errors.cc (Errors::error_at_location): Don't print program
6594 (Errors::warning_at_location): Likewise.
6595 (Errors::undefined_symbol): Likewise.
6596 * testsuite/debug_msg.sh: Update accordingly.
6598 2011-04-14 Cary Coutant <ccoutant@google.com>
6600 * gold/layout.cc (Layout::symtab_section_offset): New function.
6601 * gold/layout.h (Layout::symtab_section_offset): New function.
6602 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6604 2011-04-12 Ian Lance Taylor <iant@google.com>
6606 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6607 with MREMAP_MAYMOVE.
6608 * output.h (class Output_file): Add map_is_allocated_ field.
6609 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6610 not available, provide stubs. If mremap is not available, #define
6612 (MREMAP_MAYMOVE): Define if not defined.
6613 (Output_file::Output_file): Initialize map_is_allocated_.
6614 (Output_file::resize): Check map_is_allocated_.
6615 (Output_file::map_anonymous): If mmap fails, use malloc.
6616 (Output_file::unmap): Don't do anything for an anonymous map.
6617 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6618 is not available, provide stubs.
6619 (File_read::View::~View): Use free rather than delete[].
6620 (File_read::make_view): Use malloc rather than new[]. If mmap
6622 (File_read::find_or_make_view): Use malloc rather than new[].
6623 * gold.h: Remove HAVE_REMAP code.
6624 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6625 exists. Rename mremap to gold_mremap. If mmap is not available
6627 * configure, config.in: Rebuild.
6629 2011-04-11 Ian Lance Taylor <iant@google.com>
6631 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6632 initialize local variable v.
6634 2011-04-11 Cary Coutant <ccoutant@google.com>
6636 * archive.cc (Archive::include_member): Adjust call to
6638 (Add_archive_symbols::run): Track argument serial numbers.
6639 (Lib_group::include_member): Likewise.
6640 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6641 * archive.h (Incremental_archive_entry::Archive_member):
6642 Initialize arg_serial_.
6643 (Archive_member::arg_serial_): New data member.
6644 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6645 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6647 (Sized_dynobj::do_for_all_local_got_entries): New function.
6648 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6650 * fileread.cc (get_mtime): New function.
6651 * fileread.h (get_mtime): New function.
6652 * gold.cc (queue_initial_tasks): Check for incremental update.
6653 (process_incremental_input): New function.
6654 (queue_middle_tasks): Don't force valid target for incremental
6656 * incremental-dump.cc (find_input_containing_global): Adjust
6657 size of symbol info entry.
6658 (dump_incremental_inputs): Dump argument serial number and
6659 in_system_directory flag; bias shndx by 1; print symbol names
6660 when dumping per-file symbol lists; use new symbol info readers.
6662 (Output_section_incremental_inputs:update_data_size): New function.
6663 (Sized_incremental_binary::setup_readers): Setup input readers
6664 for each input file; build maps for files added from libraries
6666 (Sized_incremental_binary::check_input_args): New function.
6667 (Sized_incremental_binary::do_check_inputs): Build map of argument
6668 serial numbers to input arguments.
6669 (Sized_incremental_binary::do_file_has_changed): Rename
6670 do_file_is_unchanged to this; compare file modification times.
6671 (Sized_incremental_binary::do_init_layout): New function.
6672 (Sized_incremental_binary::do_reserve_layout): New function.
6673 (Sized_incremental_binary::do_get_input_reader): Remove.
6674 (Sized_incremental_binary::get_symtab_view): New function.
6675 (Incremental_checker::can_incrementally_link_output_file): Remove.
6676 (Incremental_inputs::report_command_line): Exclude --debug options.
6677 (Incremental_inputs::report_archive_begin): Add parameter; track
6678 argument serial numbers; don't put input file entry for archive
6679 before archive members.
6680 (Incremental_inputs::report_archive_end): Put input file entry
6681 for archive after archive members.
6682 (Incremental_inputs::report_object): Add parameter; track argument
6683 serial numbers and in_system_directory flag.
6684 (Incremental_inputs::report_script): Add parameter; track argument
6686 (Output_section_incremental_inputs::set_final_data_size): Adjust
6687 size of symbol info entry; check for forwarding symbols.
6688 (Output_section_incremental_inputs::write_input_files): Write
6689 in_system_directory flag and argument serial number.
6690 (Output_section_incremental_inputs::write_info_blocks): Map section
6691 indices between incremental info and original input file; store
6692 input section index for each symbol.
6693 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6694 change operator() to visit().
6695 (class Global_got_offset_visitor): Likewise.
6696 (class Global_symbol_visitor_got_plt):
6697 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6699 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6700 (Sized_incr_relobj::do_read_symbols): New function.
6701 (Sized_incr_relobj::do_layout): New function.
6702 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6703 (Sized_incr_relobj::do_add_symbols): New function.
6704 (Sized_incr_relobj::do_should_include_member): New function.
6705 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6706 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6707 (Sized_incr_relobj::do_section_size): New function.
6708 (Sized_incr_relobj::do_section_name): New function.
6709 (Sized_incr_relobj::do_section_contents): New function.
6710 (Sized_incr_relobj::do_section_flags): New function.
6711 (Sized_incr_relobj::do_section_entsize): New function.
6712 (Sized_incr_relobj::do_section_address): New function.
6713 (Sized_incr_relobj::do_section_type): New function.
6714 (Sized_incr_relobj::do_section_link): New function.
6715 (Sized_incr_relobj::do_section_info): New function.
6716 (Sized_incr_relobj::do_section_addralign): New function.
6717 (Sized_incr_relobj::do_initialize_xindex): New function.
6718 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6719 (Sized_incr_relobj::do_read_relocs): New function.
6720 (Sized_incr_relobj::do_gc_process_relocs): New function.
6721 (Sized_incr_relobj::do_scan_relocs): New function.
6722 (Sized_incr_relobj::do_count_local_symbols): New function.
6723 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6724 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6725 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6726 (Sized_incr_relobj::do_relocate): New function.
6727 (Sized_incr_relobj::do_set_section_offset): New function.
6728 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6729 (Sized_incr_dynobj::do_read_symbols): New function.
6730 (Sized_incr_dynobj::do_layout): New function.
6731 (Sized_incr_dynobj::do_add_symbols): New function.
6732 (Sized_incr_dynobj::do_should_include_member): New function.
6733 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6734 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6735 (Sized_incr_dynobj::do_section_size): New function.
6736 (Sized_incr_dynobj::do_section_name): New function.
6737 (Sized_incr_dynobj::do_section_contents): New function.
6738 (Sized_incr_dynobj::do_section_flags): New function.
6739 (Sized_incr_dynobj::do_section_entsize): New function.
6740 (Sized_incr_dynobj::do_section_address): New function.
6741 (Sized_incr_dynobj::do_section_type): New function.
6742 (Sized_incr_dynobj::do_section_link): New function.
6743 (Sized_incr_dynobj::do_section_info): New function.
6744 (Sized_incr_dynobj::do_section_addralign): New function.
6745 (Sized_incr_dynobj::do_initialize_xindex): New function.
6746 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6747 (make_sized_incremental_object): New function.
6748 (Incremental_library::copy_unused_symbols): New function.
6749 (Incremental_library::do_for_all_unused_symbols): New function.
6750 * incremental.h (enum Incremental_input_flags): New type.
6751 (class Incremental_checker): Remove.
6752 (Incremental_input_entry::Incremental_input_entry): Add argument
6754 (Incremental_input_entry::arg_serial): New function.
6755 (Incremental_input_entry::set_is_in_system_directory): New function.
6756 (Incremental_input_entry::is_in_system_directory): New function.
6757 (Incremental_input_entry::arg_serial_): New data member.
6758 (Incremental_input_entry::is_in_system_directory_): New data member.
6759 (class Script_info): Move here from script.h.
6760 (Script_info::Script_info): Add filename parameter.
6761 (Script_info::filename): New function.
6762 (Script_info::filename_): New data member.
6763 (Incremental_script_entry::Incremental_script_entry): Add argument
6765 (Incremental_object_entry::Incremental_object_entry): Likewise.
6766 (Incremental_object_entry::add_input_section): Build list of input
6767 sections with map to original shndx.
6768 (Incremental_object_entry::get_input_section_index): New function.
6769 (Incremental_object_entry::shndx_): New data member.
6770 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6771 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6772 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6774 (Incremental_inputs::report_archive_begin): Likewise.
6775 (Incremental_inputs::report_object): Likewise.
6776 (Incremental_inputs::report_script): Likewise.
6777 (class Incremental_global_symbol_reader): New class.
6778 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6779 and store flags and input file type.
6780 (Incremental_input_entry_reader::arg_serial): New function.
6781 (Incremental_input_entry_reader::type): Extract type from flags.
6782 (Incremental_input_entry_reader::is_in_system_directory): New function.
6783 (Incremental_input_entry_reader::get_input_section_count): Call
6784 accessor function for type.
6785 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6786 function for type; adjust size of global symbol entry.
6787 (Incremental_input_entry_reader::get_global_symbol_count): Call
6788 accessor function for type.
6789 (Incremental_input_entry_reader::get_object_count): Likewise.
6790 (Incremental_input_entry_reader::get_object_offset): Likewise.
6791 (Incremental_input_entry_reader::get_member_count): Likewise.
6792 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6793 (Incremental_input_entry_reader::get_member_offset): Likewise.
6794 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6795 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6796 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6797 (Incremental_input_entry_reader::get_global_symbol_reader): New
6799 (Incremental_input_entry_reader::get_output_symbol_index): New
6801 (Incremental_input_entry_reader::type_): Remove.
6802 (Incremental_input_entry_reader::flags_): New data member.
6803 (Incremental_inputs_reader::input_file_offset): New function.
6804 (Incremental_inputs_reader::input_file_index): New function.
6805 (Incremental_inputs_reader::input_file): Call input_file_offset.
6806 (Incremental_inputs_reader::input_file_at_offset): New function.
6807 (Incremental_relocs_reader::get_r_type): Reformat.
6808 (Incremental_relocs_reader::get_r_shndx): Reformat.
6809 (Incremental_relocs_reader::get_r_offset): Reformat.
6810 (Incremental_relocs_reader::data): New function.
6811 (Incremental_binary::Incremental_binary): Initialize new data members.
6812 (Incremental_binary::check_inputs): Add cmdline parameter.
6813 (Incremental_binary::file_is_unchanged): Remove.
6814 (Input_reader::arg_serial): New function.
6815 (Input_reader::get_unused_symbol_count): New function.
6816 (Input_reader::get_unused_symbol): New function.
6817 (Input_reader::do_arg_serial): New function.
6818 (Input_reader::do_get_unused_symbol_count): New function.
6819 (Input_reader::do_get_unused_symbol): New function.
6820 (Incremental_binary::input_file_count): New function.
6821 (Incremental_binary::get_input_reader): Change signature to use
6822 index instead of filename.
6823 (Incremental_binary::file_has_changed): New function.
6824 (Incremental_binary::get_input_argument): New function.
6825 (Incremental_binary::get_library): New function.
6826 (Incremental_binary::get_script_info): New function.
6827 (Incremental_binary::init_layout): New function.
6828 (Incremental_binary::reserve_layout): New function.
6829 (Incremental_binary::output_file): New function.
6830 (Incremental_binary::do_check_inputs): New function.
6831 (Incremental_binary::do_file_is_unchanged): Remove.
6832 (Incremental_binary::do_file_has_changed): New function.
6833 (Incremental_binary::do_init_layout): New function.
6834 (Incremental_binary::do_reserve_layout): New function.
6835 (Incremental_binary::do_input_file_count): New function.
6836 (Incremental_binary::do_get_input_reader): Change signature.
6837 (Incremental_binary::input_args_map_): New data member.
6838 (Incremental_binary::library_map_): New data member.
6839 (Incremental_binary::script_map_): New data member.
6840 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6842 (Sized_incremental_binary::output_section): New function.
6843 (Sized_incremental_binary::inputs_reader): Add const.
6844 (Sized_incremental_binary::symtab_reader): Add const.
6845 (Sized_incremental_binary::relocs_reader): Add const.
6846 (Sized_incremental_binary::got_plt_reader): Add const.
6847 (Sized_incremental_binary::get_symtab_view): New function.
6848 (Sized_incremental_binary::Inputs_reader): New typedef.
6849 (Sized_incremental_binary::Input_entry_reader): New typedef.
6850 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6851 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6852 (Sized_incremental_binary::do_file_has_changed): New function.
6853 (Sized_incremental_binary::do_init_layout): New function.
6854 (Sized_incremental_binary::do_reserve_layout): New function.
6855 (Sized_input_reader::Inputs_reader): Remove.
6856 (Sized_input_reader::Input_entry_reader): Remove.
6857 (Sized_input_reader::do_arg_serial): New function.
6858 (Sized_input_reader::do_get_unused_symbol_count): New function.
6859 (Sized_input_reader::do_get_unused_symbol): New function.
6860 (Sized_incremental_binary::do_input_file_count): New function.
6861 (Sized_incremental_binary::do_get_input_reader): Change signature;
6862 use index instead of filename.
6863 (Sized_incremental_binary::section_map_): New data member.
6864 (Sized_incremental_binary::input_entry_readers_): New data member.
6865 (class Sized_incr_relobj): New class.
6866 (class Sized_incr_dynobj): New class.
6867 (make_sized_incremental_object): New function.
6868 (class Incremental_library): New class.
6869 * layout.cc (Free_list::num_lists): New static data member.
6870 (Free_list::num_nodes): New static data member.
6871 (Free_list::num_removes): New static data member.
6872 (Free_list::num_remove_visits): New static data member.
6873 (Free_list::num_allocates): New static data member.
6874 (Free_list::num_allocate_visits): New static data member.
6875 (Free_list::init): New function.
6876 (Free_list::remove): New function.
6877 (Free_list::allocate): New function.
6878 (Free_list::dump): New function.
6879 (Free_list::print_stats): New function.
6880 (Layout_task_runner::run): Resize output file for incremental updates.
6881 (Layout::Layout): Initialize new data members.
6882 (Layout::set_incremental_base): New function.
6883 (Layout::init_fixed_output_section): New function.
6884 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6885 incremental updates.
6886 (Layout::create_gold_note): Do not create gold note section for
6887 incremental updates.
6888 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6889 for incremental updates.
6890 (Layout::set_section_offsets): For incremental updates, allocate space
6892 (Layout::create_symtab_sections): Layout with offsets relative to
6893 start of section; for incremental updates, allocate space from free
6895 (Layout::create_shdrs): For incremental updates, allocate space from
6897 (Layout::finish_dynamic_section): For incremental updates, do not
6898 check --as-needed (fixed in subsequent patch).
6899 * layout.h (class Free_list): New class.
6900 (Layout::set_incremental_base): New function.
6901 (Layout::incremental_base): New function.
6902 (Layout::init_fixed_output_section): New function.
6903 (Layout::allocate): New function.
6904 (Layout::incremental_base_): New data member.
6905 (Layout::free_list_): New data member.
6906 * main.cc (main): Print Free_list statistics.
6907 * object.cc (Relobj::finalize_incremental_relocs): Add
6908 clear_counts parameter; clear counts only when clear_counts is set.
6909 (Sized_relobj::Sized_relobj): Initialize new base class.
6910 (Sized_relobj::do_layout): Don't report special sections.
6911 (Sized_relobj::do_for_all_local_got_entries): New function.
6912 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6913 symtab_off to all symbol table offsets.
6914 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6915 * object.h (class Got_offset_list): Move to top of file.
6916 (Object::Object): Allow case where input_file == NULL.
6917 (Object::~Object): Likewise.
6918 (Object::input_file): Assert that input_file != NULL.
6919 (Object::lock): Allow case where input_file == NULL.
6920 (Object::unlock): Likewise.
6921 (Object::is_locked): Likewise.
6922 (Object::token): Likewise.
6923 (Object::release): Likewise.
6924 (Object::is_incremental): New function.
6925 (Object::get_mtime): New function.
6926 (Object::for_all_local_got_entries): New function.
6927 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6928 (Object::set_is_in_system_directory): New function.
6929 (Object::is_in_system_directory): New function.
6930 (Object::do_is_incremental): New function.
6931 (Object::do_get_mtime): New function.
6932 (Object::do_for_all_local_got_entries): New function.
6933 (Object::is_in_system_directory_): New data member.
6934 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6935 (class Sized_relobj_base): New class.
6936 (class Sized_relobj): Derive from Sized_relobj_base.
6937 (class Sized_relobj::Symbols): Redeclare from base class.
6938 (class Sized_relobj::local_got_offset_list): Remove.
6939 (class Sized_relobj::Output_sections): Redeclare from base class.
6940 (class Sized_relobj::do_for_all_local_got_entries): New function.
6941 (class Sized_relobj::write_local_symbols): Add offset parameter.
6942 (class Sized_relobj::local_symbol_offset_): Update comment.
6943 (class Sized_relobj::local_dynsym_offset_): Update comment.
6944 * options.cc (Input_arguments::add_file): Remove const.
6945 * options.h (Input_file_argument::Input_file_argument):
6946 Initialize arg_serial_ (all constructors).
6947 (Input_file_argument::set_arg_serial): New function.
6948 (Input_file_argument::arg_serial): New function.
6949 (Input_file_argument::arg_serial_): New data member.
6950 (Input_arguments::Input_arguments): Initialize file_count_.
6951 (Input_arguments::add_file): Remove const.
6952 (Input_arguments::number_of_input_files): New function.
6953 (Input_arguments::file_count_): New data member.
6954 (Command_line::number_of_input_files): Call
6955 Input_arguments::number_of_input_files.
6956 * output.cc (Output_segment_headers::Output_segment_headers):
6958 (Output_section::Input_section::current_data_size): New function.
6959 (Output_section::Output_section): Initialize new data members.
6960 (Output_section::add_input_section): Don't do merge sections for
6961 an incremental link; allocate space from free list for an
6963 (Output_section::add_output_section_data): Allocate space from
6964 free list for an incremental update.
6965 (Output_section::update_data_size): New function.
6966 (Output_section::set_fixed_layout): New function.
6967 (Output_section::reserve): New function.
6968 (Output_segment::set_section_addresses): Remove const.
6969 (Output_segment::set_section_list_addresses): Remove const; allocate
6970 space from free list for an incremental update.
6971 (Output_segment::set_offset): Adjust size of RELRO segment for an
6973 * output.h (Output_data::current_data_size): Move here from
6975 (Output_data::pre_finalize_data_size): New function.
6976 (Output_data::update_data_size): New function.
6977 (Output_section_headers::update_data_size): new function.
6978 (Output_section_data_build::current_data_size): Move to Output_data.
6979 (Output_data_strtab::update_data_size): New function.
6980 (Output_section::current_data_size): Move to Output_data.
6981 (Output_section::set_fixed_layout): New function.
6982 (Output_section::has_fixed_layout): New function.
6983 (Output_section::reserve): New function.
6984 (Output_section::update_data_size): New function.
6985 (Output_section::has_fixed_layout_): New data member.
6986 (Output_section::free_list_): New data member.
6987 (Output_segment::set_section_addresses): Remove const.
6988 (Output_segment::set_section_list_addresses): Remove const.
6989 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6991 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6993 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6994 parameter when calling Add_symbols constructor; store argument
6995 serial number for members of a lib group.
6996 (Add_symbols::locks): Allow case where token == NULL.
6997 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6998 (Read_member::~Read_member): New function.
6999 (Read_member::is_runnable): New function.
7000 (Read_member::locks): New function.
7001 (Read_member::run): New function.
7002 (Check_script::~Check_script): New function.
7003 (Check_script::is_runnable): New function.
7004 (Check_script::locks): New function.
7005 (Check_script::run): New function.
7006 (Check_library::~Check_library): New function.
7007 (Check_library::is_runnable): New function.
7008 (Check_library::locks): New function.
7009 (Check_library::run): New function.
7010 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7011 (Add_symbols::library_): New data member.
7012 (class Read_member): New class.
7013 (class Check_script): New class.
7014 (class Check_library): New class.
7015 * reloc.cc (Read_relocs::is_runnable): Allow case where
7017 (Read_relocs::locks): Likewise.
7018 (Scan_relocs::locks): Likewise.
7019 (Relocate_task::locks): Likewise.
7020 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7022 (Sized_relobj::incremental_relocs_scan): Fix comment.
7023 (Sized_relobj::do_relocate): Pass output file offset to
7024 write_local_symbols.
7025 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7026 from class declaration.
7027 * script.cc (read_input_script): Allocate Script_info; pass
7028 argument serial number to report_script.
7029 * script.h (class Script_info): Move to incremental.h.
7030 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7031 * symtab.h (Symbol_table::add_from_incrobj): New function.
7032 (Symbol_table::set_file_offset): New function.
7034 2011-04-05 Cary Coutant <ccoutant@google.com>
7036 * incremental-dump.cc (dump_incremental_inputs): Change signature
7037 to take a Sized_incremental_binary; change caller. Use readers
7038 in Sized_incremental_binary.
7040 (Sized_incremental_binary::find_incremental_inputs_sections):
7041 Rename do_find_incremental_inputs_sections to this.
7042 (Sized_incremental_binary::setup_readers): New function.
7043 (Sized_incremental_binary::do_check_inputs): Check
7044 has_incremental_info_ flag; move setup code to setup_readers;
7046 (Sized_incremental_binary::do_file_is_unchanged): New function.
7047 (Sized_incremental_binary::do_get_input_reader): New function.
7048 * incremental.h (class Incremental_binary): Move to end of file.
7049 (Incremental_binary::file_is_unchanged): New function.
7050 (Incremental_binary::do_file_is_unchanged): New function.
7051 (Incremental_binary::Input_reader): New class.
7052 (Incremental_binary::get_input_reader): New function.
7053 (class Sized_incremental_binary): Move to end of file.
7054 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7055 input section reader classes.
7056 (Sized_incremental_binary::has_incremental_info): New function.
7057 (Sized_incremental_binary::inputs_reader): New function.
7058 (Sized_incremental_binary::symtab_reader): New function.
7059 (Sized_incremental_binary::relocs_reader): New function.
7060 (Sized_incremental_binary::got_plt_reader): New function.
7061 (Sized_incremental_binary::do_file_is_unchanged): New function.
7062 (Sized_incremental_binary::Sized_input_reader): New class.
7063 (Sized_incremental_binary::get_input_reader): New function.
7064 (Sized_incremental_binary::find_incremental_inputs_sections):
7065 Rename do_find_incremental_inputs_sections to this.
7066 (Sized_incremental_binary::setup_readers): New function.
7067 (Sized_incremental_binary::has_incremental_info_): New data member.
7068 (Sized_incremental_binary::inputs_reader_): New data member.
7069 (Sized_incremental_binary::symtab_reader_): New data member.
7070 (Sized_incremental_binary::relocs_reader_): New data member.
7071 (Sized_incremental_binary::got_plt_reader_): New data member.
7072 (Sized_incremental_binary::current_input_file_): New data member.
7074 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7077 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7080 2011-03-30 Cary Coutant <ccoutant@google.com>
7082 * archive.cc (Archive::include_member): Adjust call to report_object.
7083 (Add_archive_symbols::run): Add script_info to call to
7084 report_archive_begin.
7085 (Lib_group::include_member): Adjust call to report_object.
7086 (Add_lib_group_symbols::run): Adjust call to report_object.
7087 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7088 blocks. Add object count for script input files.
7089 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7090 script_info parameter; change all callers.
7091 (Incremental_inputs::report_object): Add script_info parameter;
7093 (Incremental_inputs::report_script): Store backpointer to
7094 incremental info entry.
7095 (Output_section_incremental_inputs::set_final_data_size): Record
7096 additional information for scripts.
7097 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7098 * incremental.h (Incremental_script_entry::add_object): New function.
7099 (Incremental_script_entry::get_object_count): New function.
7100 (Incremental_script_entry::get_object): New function.
7101 (Incremental_script_entry::objects_): New data member; adjust
7103 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7104 (Incremental_inputs::report_object): Add script_info parameter.
7105 (Incremental_inputs_reader::get_object_count): New function.
7106 (Incremental_inputs_reader::get_object_offset): New function.
7107 * options.cc (Input_arguments::add_file): Return reference to
7109 * options.h (Input_argument::set_script_info): New function.
7110 (Input_argument::script_info): New function.
7111 (Input_argument::script_info_): New data member; adjust all
7113 (Input_file_group::add_file): Return reference to new input argument.
7114 (Input_file_lib::add_file): Likewise.
7115 (Input_arguments::add_file): Likewise.
7116 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7117 * script.cc (Parser_closure::Parser_closure): Add script_info
7118 parameter; adjust all callers.
7119 (Parser_closure::script_info): New function.
7120 (Parser_closure::script_info_): New data member.
7121 (read_input_script): Report scripts earlier to incremental info.
7122 (script_add_file): Set script_info in Input_argument.
7123 (script_add_library): Likewise.
7124 * script.h (Script_options::Script_info): Rewrite class.
7126 2011-03-29 Cary Coutant <ccoutant@google.com>
7128 * archive.cc (Library_base::should_include_member): Move
7129 method here from class Archive.
7130 (Archive::Archive): Initialize base class.
7131 (Archive::should_include_member): Move to base class.
7132 (Archive::do_for_all_unused_symbols): New function.
7133 (Add_archive_symbols::run): Remove redundant access to
7135 (Lib_group::Lib_group): Initialize base class.
7136 (Lib_group::do_filename): New function.
7137 (Lib_group::include_member): Pass pointer to Lib_group to
7139 (Lib_group::do_for_all_unused_symbols): New function.
7140 (Add_lib_group_symbols::run): Report archive information for
7142 * archive.h (class Library_base): New base class.
7143 (class Archive): Derive from Library_base.
7144 (Archive::filename): Move to base class.
7145 (Archive::set_incremental_info): Likewise.
7146 (Archive::incremental_info): Likewise.
7147 (Archive::Should_include): Likewise.
7148 (Archive::should_include_member): Likewise.
7149 (Archive::Armap_entry): Remove.
7150 (Archive::Unused_symbol_iterator): Remove.
7151 (Archive::unused_symbols_begin): Remove.
7152 (Archive::unused_symbols_end): Remove.
7153 (Archive::do_filename): New function.
7154 (Archive::do_get_mtime): New function.
7155 (Archive::do_for_all_unused_symbols): New function.
7156 (Archive::task_): Move to base class.
7157 (Archive::incremental_info_): Likewise.
7158 (class Lib_group): Derive from Library_base.
7159 (Lib_group::do_filename): New function.
7160 (Lib_group::do_get_mtime): New function.
7161 (Lib_group::do_for_all_unused_symbols): New function.
7162 (Lib_group::task_): Move to base class.
7163 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7165 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7167 * incremental.cc (Incremental_inputs::report_archive_begin):
7168 Use Library_base; call library's get_mtime; add incremental inputs
7169 entry before members.
7170 (class Unused_symbol_visitor): New class.
7171 (Incremental_inputs::report_archive_end): Use Library_base; use
7172 visitor class to record unused symbols; don't add incremental inputs
7173 entry after members.
7174 (Incremental_inputs::report_object): Use Library_base.
7176 (Incremental_archive_entry::Incremental_archive_entry): Remove
7177 unused Archive parameter.
7178 (Incremental_inputs::report_archive_begin): Use Library_base.
7179 (Incremental_inputs::report_archive_end): Likewise.
7180 (Incremental_inputs::report_object): Likewise.
7181 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7183 * object.h (Object::for_all_global_symbols): New function.
7184 (Object::do_for_all_global_symbols): New function.
7185 (Sized_relobj::do_for_all_global_symbols): New function.
7186 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7188 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7191 2011-03-27 Ian Lance Taylor <iant@google.com>
7193 * archive.cc (Archive::interpret_header): Return -1 if something
7194 goes wrong. Change callers accordingly.
7196 2011-03-25 Cary Coutant <ccoutant@google.com>
7198 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7199 * testsuite/Makefile.in: Regenerate.
7201 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
7203 * plugin.cc (get_view): New.
7204 (Plugin::load): Pass get_view to the plugin.
7205 (Plugin_manager::get_view): New.
7207 2011-03-21 Ian Lance Taylor <iant@google.com>
7209 * testsuite/final_layout.sh: Rewrite to not use dc.
7210 * testsuite/relro_test.sh: Fail if dc is not present.
7212 2011-03-21 Sriraman Tallam <tmsriram@google.com>
7214 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7216 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7217 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7219 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7220 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7222 2011-03-14 Ian Lance Taylor <iant@google.com>
7224 * script-sections.cc (Sort_output_sections::script_compare):
7225 Rename from is_before, change return type.
7226 (Sort_output_sections::operator()): Adjust accordingly.
7228 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7231 * testsuite/odr_violation2.cc: Add comment to make all error line
7232 numbers double digits.
7233 * testsuite/debug_msg.sh: Adjust expected errors.
7235 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7237 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7238 but mark earlier ones as non-canonical
7239 (offset_to_iterator): Update search target and example
7240 (do_addr2line): Return extra lines in a vector*
7241 (format_file_lineno): Extract from do_addr2line
7242 (one_addr2line): Add vector* out-param
7243 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7244 when a lineno entry appeared last for its instruction
7245 (Dwarf_line_info): Add vector* out-param
7246 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7247 * symtab.cc (Odr_violation_compare): Include the lineno in the
7249 (linenos_from_loc): New. Combine the canonical line for an
7250 address with its other lines.
7251 (True_if_intersect): New. Helper functor to make
7252 std::set_intersection a query.
7253 (detect_odr_violations): Compare sets of lines instead of just
7254 one line for each function. This became less deterministic, but
7255 has fewer false positives.
7256 * symtab.h: Declarations.
7257 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7258 mix an optimized and non-optimized object in the same binary
7259 (odr_violation2.so): Same.
7260 * testsuite/Makefile.in: Regenerate from Makefile.am.
7261 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7262 * testsuite/debug_msg.sh: Update line numbers and add
7264 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7265 non-optimized context.
7266 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7267 isn't inlined, and use OdrDerived in an optimized context.
7268 * testsuite/odr_header1.h: Defines OdrDerived, where
7269 optimization will change the
7270 first-instruction-in-the-destructor's file and line number.
7271 * testsuite/odr_header2.h: Defines OdrBase.
7273 2011-03-09 Ian Lance Taylor <iant@google.com>
7275 * fileread.cc (File_read::clear_views): Don't delete the whole
7278 2011-03-08 Ian Lance Taylor <iant@google.com>
7281 * fileread.cc: #include <climits>.
7282 (GOLD_IOV_MAX): Define.
7283 (File_read::read_multiple): Limit number of entries by iov_max.
7284 * fileread.h (class File_read): Always set max_readv_entries to
7287 2011-03-07 Ian Lance Taylor <iant@google.com>
7290 * options.h (class General_options): Add -dy and -dn.
7292 2011-03-02 Cary Coutant <ccoutant@google.com>
7294 * testsuite/script_test_9.t: Add TLS segment.
7296 2011-03-02 Simon Baldwin <simonb@google.com>
7298 * configure.ac: Add check for gnu_indirect_function support in
7299 the toolchain building binutils.
7300 * configure: Rebuild.
7302 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
7304 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7305 plugin only symbols.
7306 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7307 in plugin files as not needed in the symbol table.
7309 2011-02-11 Sriraman Tallam <tmsriram@google.com>
7311 * output.cc (Output_section::add_input_section): Delay fill
7312 generation for section ordering.
7314 2011-02-09 Ian Lance Taylor <iant@google.com>
7317 * object.h (class Sized_relobj): Remove clear_local_symbols.
7318 * reloc.cc (Sized_relobj::do_relocate): Don't call
7319 clear_local_symbols.
7321 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
7323 * plugin.cc (is_visible_from_outside): Return true for symbols
7326 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7328 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7331 2011-02-02 Sriraman Tallam <tmsriram@google.com>
7333 * icf.h (is_section_foldable_candidate): Change type of parameter
7335 * icf.cc (Icf::find_identical_sections): Change type of local variable
7336 section_name to be std::string.
7337 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7339 2011-01-25 Ian Lance Taylor <iant@google.com>
7341 * script.cc (script_add_extern): Rewrite to use
7342 add_symbol_reference.
7344 2011-01-25 Doug Kwan <dougkwan@google.com>
7346 * icf.cc (get_section_contents): Always lock section's object.
7348 2011-01-24 Ian Lance Taylor <iant@google.com>
7350 * options.h (class General_options): Accept
7351 --no-detect-odr-violations.
7353 2011-01-24 Ian Lance Taylor <iant@google.com>
7355 * version.cc (version_string): Bump to 1.11.
7357 2011-01-24 Ian Lance Taylor <iant@google.com>
7359 * plugin.cc (class Plugin_rescan): Define new class.
7360 (Plugin_manager::claim_file): Set any_claimed_.
7361 (Plugin_manager::save_archive): New function.
7362 (Plugin_manager::save_input_group): New function.
7363 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7365 (Plugin_manager::new_undefined_symbol): New function.
7366 (Plugin_manager::rescan): New function.
7367 (Plugin_manager::rescannable_defines): New function.
7368 (Plugin_manager::add_input_file): Set any_added_.
7369 * plugin.h (class Plugin_manager): define new fields rescannable_,
7370 undefined_symbols_, any_claimed_, and any_added_. Declare
7371 Plugin_rescan as friend. Declare new functions.
7372 (Plugin_manager::Rescannable): Define type.
7373 (Plugin_manager::Rescannable_list): Define type.
7374 (Plugin_manager::Undefined_symbol_list): Define type.
7375 (Plugin_manager::Plugin_manager): Initialize new fields.
7376 * archive.cc (Archive::defines_symbol): New function.
7377 (Add_archive_symbols::run): Pass archive to plugins if any.
7378 * archive.h (class Archive): Declare defines_symbol.
7379 * readsyms.cc (Input_group::~Input_group): New function.
7380 (Finish_group::run): Pass input_group to plugins if any.
7381 * readsyms.h (class Input_group): Declare destructor.
7382 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7385 2011-01-10 Ian Lance Taylor <iant@google.com>
7387 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7389 (Layout::set_segment_offsets): Reset increase_relro before calling
7390 set_section_addresses a second time.
7392 2011-01-04 Cary Coutant <ccoutant@google.com>
7394 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7395 sections before NOBITS sections.
7397 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7399 * version.cc (print_version): Update copyright to 2011.
7401 2010-12-23 Cary Coutant <ccoutant@google.com>
7403 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7404 of OS to this->add. Add OD parameter to second form of the function.
7406 2010-12-20 Ian Lance Taylor <iant@google.com>
7408 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7409 second of two consecutive entries with same offset.
7411 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7413 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7414 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7415 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7416 to avoid unneeded links against $(LDADD).
7417 * testsuite/Makefile.in: Regenerate.
7419 2010-12-15 Ian Lance Taylor <iant@google.com>
7422 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7423 for R_X86_64_32 and R_X86_64_PC32.
7424 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7425 ver_matching_def_pic.o.
7426 (ver_matching_def_pic.o): New target.
7428 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7430 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7431 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7432 Move definition before File_read::View member definitions.
7433 (File_read::View::~View): Initialize and hold lock before
7434 updating current_mapped_bytes.
7436 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7438 * dwarf_reader.cc: Remove outdated comment.
7439 * gold-threads.cc: Fix typo in error message.
7440 * archive.cc: Fix typos in comments.
7441 * archive.h: Likewise.
7442 * arm-reloc-property.cc: Likewise.
7443 * arm-reloc-property.h: Likewise.
7444 * arm-reloc.def: Likewise.
7446 * attributes.h: Likewise.
7447 * cref.cc: Likewise.
7448 * ehframe.cc: Likewise.
7449 * fileread.h: Likewise.
7451 * i386.cc: Likewise.
7453 * incremental.h: Likewise.
7454 * int_encoding.cc: Likewise.
7455 * layout.h: Likewise.
7456 * main.cc: Likewise.
7457 * merge.h: Likewise.
7458 * object.cc: Likewise.
7459 * object.h: Likewise.
7460 * options.cc: Likewise.
7461 * readsyms.cc: Likewise.
7462 * reduced_debug_output.cc: Likewise.
7463 * reloc.cc: Likewise.
7464 * script-sections.cc: Likewise.
7465 * sparc.cc: Likewise.
7466 * symtab.h: Likewise.
7467 * target-reloc.h: Likewise.
7468 * target.cc: Likewise.
7469 * target.h: Likewise.
7470 * timer.cc: Likewise.
7471 * timer.h: Likewise.
7472 * x86_64.cc: Likewise.
7474 2010-12-09 Cary Coutant <ccoutant@google.com>
7476 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7478 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7479 parameter; change all callers.
7480 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7481 * options.h (warn_execstack): New option.
7483 2010-12-07 Doug Kwan <dougkwan@google.com>
7485 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7486 like function call relocations.
7488 2010-12-07 Ian Lance Taylor <iant@google.com>
7490 * archive.cc (Archive::get_elf_object_for_member): Permit
7491 punconfigured to be NULL.
7492 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7493 (Archive::include_member): Pass NULL to get_elf_object_for_member
7494 if we searched for the archive and this is the first included
7497 2010-12-01 Ian Lance Taylor <iant@google.com>
7499 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7500 track_relocs_type_ field.
7501 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7502 Set track_relocs_type_.
7503 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7504 contents when using RELA relocs.
7505 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7507 * reloc.cc (Track_relocs::next_addend): New function.
7508 * reloc.h (class Track_relocs): Declare next_addend.
7510 2010-12-01 Ian Lance Taylor <iant@google.com>
7512 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7515 2010-12-01 Ian Lance Taylor <iant@google.com>
7517 * README: Update compilers known to work and fail.
7519 2010-11-23 Matthias Klose <doko@ubuntu.com>
7521 * configure.in: For --enable-gold, handle value `default' instead of
7522 `both*'. Always install ld as ld.bfd, install as ld if gold is
7524 * configure: Regenerate.
7526 2010-11-18 Doug Kwan <dougkwan@google.com>
7528 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7529 and right_alignment to be zero. Store result alignment only if it is
7530 greater than existing alignment.
7532 2010-11-16 Cary Coutant <ccoutant@google.com>
7535 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7536 Check for ".zdebug_line".
7538 2010-11-16 Doug Kwan <dougkwan@google.com>
7539 Cary Coutant <ccoutant@google.com>
7541 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7542 by reference; adjust all callers.
7543 * output.cc (Output_segment::set_section_addresses): Adjust references
7544 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7546 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7547 end at page boundary.
7549 2010-11-16 Cary Coutant <ccoutant@google.com>
7552 * layout.cc (Layout::choose_output_section): Transform names of
7553 compressed sections even when using a script with a SECTIONS clause.
7554 (Layout::output_section_name): Remove code to transform
7555 compressed debug section names.
7556 * output.cc (Output_section::add_input_section): Use uncompressed
7557 section size when tracking input sections.
7559 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7561 * symtab.h (Symbol::NON_PIC_REF): Remove.
7562 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7563 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7564 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7565 (Symbol::use_plt_offset): Take a flags argument and pass it
7566 directly to needs_dynamic_reloc. Restrict check for undefined
7567 weak symbols to function calls.
7568 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7569 (Target_arm::Scan::global): Use it.
7570 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7571 (Target_arm::Relocate::relocate): Likewise.
7572 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7573 parameter with an r_type parameter. Use get_reference_flags
7575 (Target_arm::Relocate::relocate): Update accordingly.
7576 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7577 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7578 (Target_i386::Scan::global): Likewise.
7579 (Target_i386::Relocate::relocate): Likewise.
7580 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7581 parameter with an r_type parameter. Use get_reference_flags
7583 (Target_i386::Relocate::relocate): Update accordingly.
7584 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7585 (Target_powerpc::Scan::global): Use it.
7586 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7587 (Target_powerpc::Relocate::relocate): Likewise.
7588 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7589 (Target_sparc::Scan::global): Use it.
7590 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7591 (Target_sparc::Relocate::relocate): Likewise.
7592 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7593 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7594 (Target_x86_64::Scan::global): Likewise.
7595 (Target_x86_64::Relocate::relocate): Likewise.
7597 2010-11-08 Doug Kwan <dougkwan@google.com>
7598 Cary Coutant <ccoutant@google.com>
7600 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7601 (Arm_exidx_merge_section::section_contents_): New data member.
7602 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7603 (Arm_input_section::~Arm_input_section): De-allocate memory.
7604 (Arm_input_section::original_contents_): New data member.
7605 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7606 in parameters instead of calling Object::section_contents without
7608 (Arm_output_section::group_section): New parameter TASK. Pass it
7609 to callees that need locking objects.
7610 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7611 to lock EXIDX input sections. Fix a formatting issue. Call
7612 Arm_exidx_merged_section::build_contents to create merged section
7614 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7615 to lock object of stub table owner.
7616 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7617 TEXT_SIZE to initialize data member TEXT_SIZE_.
7618 (Arm_exidx_input_section::addralign): Fix typo in comment.
7619 (Arm_exidx_input_section::text_size): New method.
7620 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7621 that require locking objects. Lock objects before scanning for stubs
7622 and updating local symbols.
7623 (Arm_input_section<big_endian>::init): Copy contents of original
7625 (Arm_input_section<big_endian>::do_write): Use saved contents of
7626 original input section instead of calling Object::section_contents
7628 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7629 size without calling Object::section_size().
7630 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7631 for size. Allocate a buffer for merged EXIDX entries.
7632 (Arm_exidx_merged_section::build_contents): New method.
7633 (Arm_exidx_merged_section::do_write): Move merge section contents
7634 building code to Arm_exidx_merged_section::build_contetns. Write
7635 out contetns in buffer instead of building it on the fly.
7636 (Arm_relobj::make_exidx_input_section): Also pass text section size
7637 to Arm_exidx_input_section constructor.
7638 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7639 (Arm_dynobj::do_read_symbols): Fix memory leak.
7640 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7641 * target.h: (class Task): Add forward declaration.
7642 (Target::relax): Add new parameter TASK and pass it to
7644 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7646 2010-11-05 Cary Coutant <ccoutant@google.com>
7649 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7650 object when reading from the file.
7651 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7653 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7654 when reading section contents.
7655 (get_section_contents): Likewise.
7656 (icf::find_identical_sections): Likewise.
7657 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7658 object when reading from the file.
7659 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7660 the object when doing deferred section layout.
7662 2010-11-03 Nick Clifton <nickc@redhat.com>
7665 * script.h (class Symbol_assignment: name): New member. Returns
7666 the name of the symbol.
7667 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7668 Returns true if the given symbol name is on the list of
7669 assignments wating to be processed.
7670 * archive.cc (should_incldue_member): If the symbol is undefined,
7671 check to see if it is on the list of symbols pending assignment.
7673 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7675 * script-sections.cc (Script_sections::find_memory_region): Check
7676 for a NULL output section pointer.
7678 2010-10-29 Doug Kwan <dougkwan@google.com>
7680 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7681 Output_section::add_relaxed_input_section.
7682 * output.cc (Output_section::add_relaxed_input_section): Add new
7683 arguments LAYOUT and NAME. Set section order index.
7684 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7685 Copy section order index.
7686 * output.h (Output_section::add_relaxed_input_section): Add new
7687 arguments LAYOUT and NAME.
7689 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7691 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7692 NATIVE_OR_CROSS_LINKER.
7693 * testsuite/Makefile.in: Regenerate.
7695 2010-10-20 Doug Kwan <dougkwan@google.com>
7697 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7698 without SHF_LINK_ORDER flags.
7699 * layout.cc (Layout::choose_output_section): Do not filter
7700 SHF_LINK_ORDER flag in a relocatable link.
7702 2010-10-17 Cary Coutant <ccoutant@google.com>
7704 * output.h (Output_segment::set_section_addresses): Change function
7705 signature. Update all callers.
7706 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7708 (Output_segment::set_section_addresses): Align after last TLS
7709 section. Add padding before last relro section instead of after.
7711 2010-10-17 Doug Kwan <dougkwan@google.com>
7713 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7714 GOT output section to be writable.
7716 2010-10-14 Cary Coutant <ccoutant@google.com>
7718 * debug.h (DEBUG_INCREMENTAL): New flag.
7719 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7720 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7722 * incremental.cc (report_command_line): Ignore all forms of
7724 * layout.cc (Layout::Layout): Check parameters for incremental link
7726 * options.cc (General_options::parse_incremental): New function.
7727 (General_options::parse_no_incremental): New function.
7728 (General_options::parse_incremental_full): New function.
7729 (General_options::parse_incremental_update): New function.
7730 (General_options::incremental_mode_): New data member.
7731 (General_options::finalize): Check incremental_mode_.
7732 * options.h (General_options): Update help text for --incremental.
7733 Add --no-incremental, --incremental-full, --incremental-update.
7734 (General_options::Incremental_mode): New enum type.
7735 (General_options::incremental_mode): New function.
7736 (General_options::incremental_mode_): New data member.
7737 * parameters.cc (Parameters::incremental_mode_): New data member.
7738 (Parameters::set_options): Set incremental_mode_.
7739 (Parameters::set_incremental_full): New function.
7740 (Parameters::incremental): New function.
7741 (Parameters::incremental_update): New function.
7742 (set_parameters_incremental_full): New function.
7743 * parameters.h (Parameters::set_incremental_full): New function.
7744 (Parameters::incremental): New function.
7745 (Parameters::incremental_update): New function.
7746 (Parameters::incremental_mode_): New data member.
7747 (set_parameters_incremental_full): New function.
7748 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7749 incremental link mode.
7750 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7751 (Sized_relobj::do_relocate_sections): Likewise.
7752 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7754 * testsuite/Makefile.in: Regenerate.
7755 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7757 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7759 * script-sections.h (class Script_sections): Make
7760 Sections_elements typedef public.
7761 * script-sections.cc (class Sort_output_sections): Add elements_
7762 field. Add constructor which sets it; change all callers.
7763 (Sort_output_sections::is_before): New function.
7764 (Sort_output_sections::operator()): Call is_before.
7765 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7767 * testsuite/script_test_10.sh: New test. Test script section
7769 * testsuite/script_test_10.t: Likewise.
7770 * testsuite/script_test_10.s: Likewise.
7771 * testsuite/Makefile.am: Wrap the cross linker tests and the
7772 common tests into NATIVE_OR_CROSS_LINKER.
7773 (check_SCRIPTS): Add script_test_10.sh.
7774 (check_DATA): Add script_test_10.stdout.
7775 (script_test_10.o, script_test_10): New targets.
7776 (script_test_10.stdout): New target.
7777 * configure, testsuite/Makefile.in: Regenerate.
7779 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7781 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7782 error for the deprecated relocations.
7783 (Target_arm::Scan::global): Likewise.
7784 (Target_arm::Relocate::relocate): Likewise.
7786 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7788 * fileread.cc (Input_file::find_file): Initialize *found_name
7789 and *namep when using the fallback search for case 4.
7791 2010-10-11 Cary Coutant <ccoutant@google.com>
7793 * options.h (class General_options): Redefine -z lazy as an alias for
7794 the negation of -z now.
7796 2010-10-11 Ian Lance Taylor <iant@google.com>
7798 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7801 2010-10-06 Nick Clifton <nickc@redhat.com>
7803 * script-sections.cc(class Memory_region): Remove
7804 current_lma_offset_ field. Rename current_vma_offset_ to
7805 current_offset_. Add last_section_ field.
7806 (Memory_region::get_current_vma_address): Rename to
7807 get_current_address.
7808 (Memory_region::get_current_lma_address): Delete.
7809 (Memory_region::increment_vma_offset): Rename to
7811 (Memory_region::increment_lma_offset): Delete.
7812 (Memory_region::attributes_compatible): New method. Returns
7813 true if the provided section is compatible with the region.
7814 (Memory_region::get_last_section): New method. Returns the last
7815 section to use the region.
7816 (Memory_region::set_last_section): New method. Stores the last
7817 section to use the region.
7818 (Script_sections::block_in_region): New method. Returns true if
7819 a block of memory is contained within a region.
7820 (Script_sections::find_memory_region): New method. Locates a
7821 memory region to be used to set a VMA or LMA address.
7822 (Output_section_definition::set_section_addresses): Add code to
7823 check for addresses set by memory regions.
7824 (Output_segment::set_section_addresses): Remove memory region
7826 (Script_sections::create_segment): Add a warning if a header
7827 segment is created outside of any region.
7828 * script-sections.h (class Script_sections): Add prototypes for
7829 find_memory_region and block_in_region methods.
7830 * testsuite/memory_test.s: Use .long instead of .word.
7831 * testsuite/memory_test.t: Add some more output sections.
7832 * testsuite/memory_test.sh: Update expected output.
7834 2010-10-02 Doug Kwan <dougkwan@google.com>
7836 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7837 defintion to symtab.h
7838 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7839 declaration to defintion.
7841 2010-10-01 Nick Clifton <nickc@redhat.com>
7843 * expression.cc (eval): Replace dummy argument with NULL.
7844 (eval_maybe_dot): Check for a NULL result section pointer.
7845 (Symbol_expression::value): Likewise.
7846 (Dot_expression::value): Likewise.
7847 (BINARY_EXPRESSION): Likewise.
7848 (Max_expression::value): Likewise.
7849 (Min_expression::value): Likewise.
7850 (Absolute_expression::value): Likewise.
7851 (Addr_expression::value_from_output_section): Likewise.
7852 (Loaddddr_expression::value_from_output_section): Likewise.
7853 (Segment_start_expression::value): Likewise.
7854 * script-sections.cc
7855 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7857 (Sections_elememt_dot_assignment::set_section_addresses):
7859 (Output_data_expression::do_write_to_buffer): Likewise.
7860 (Output_section_definition::finalize_symbols): Likewise.
7861 (Output_section_definition::set_section_addresses): Likewise.
7863 2010-09-30 Doug Kwan <dougkwan@google.com>
7865 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7867 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7869 * target.h (Target::can_icf_inline_merge_sections): New virtual
7871 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7873 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7875 * icf.cc (get_section_contents): Inline merge sections only when
7878 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7880 * configure: Regenerate.
7882 2010-09-17 Ian Lance Taylor <iant@google.com>
7884 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7885 * testsuite/Makefile.am (memory_test.o): New target.
7886 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7888 * testsuite/Makefile.in: Rebuild.
7890 2010-09-17 Doug Kwan <dougkwan@google.com>
7892 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7893 defintion if relocation uses GOT entries of the symbol.
7894 * testsuite/icf_safe_test.sh: Fix test.
7895 * testsuite/icf_safe_so_test.sh: Fix test.
7897 2010-09-16 Cary Coutant <ccoutant@google.com>
7899 * script_sections.cc (class Memory_region): Remove "NULL" from
7900 vector initializations.
7902 2010-09-15 Cary Coutant <ccoutant@google.com>
7904 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7905 Resolve forwarding symbols.
7907 2010-09-15 Doug Kwan <dougkwan@google.com>
7909 * gold/testsuite/script_test_3.t: Add ARM special sections.
7910 * gold/testsuite/script_test_4.t: Same.
7911 * gold/testsuite/script_test_5.t: Same.
7912 * gold/testsuite/script_test_6.t: Same.
7913 * gold/testsuite/script_test_7.t: Same.
7914 * gold/testsuite/script_test_7.t: Same.
7915 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7917 2010-09-14 Cary Coutant <ccoutant@google.com>
7919 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7920 (Target_x86_64::Relocate::relocate_tls): Replace check for
7921 saw_tls_block_reloc_ with test for executable section.
7923 2010-09-12 Cary Coutant <ccoutant@google.com>
7925 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7926 position-independent executables to shared libraries need dynamic
7928 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7929 position-independent executables.
7930 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7931 * testsuite/Makefile.in: Regenerate.
7933 2010-09-10 Nick Clifton <nickc@redhat.com>
7936 * testsuite/memory_test.t: Discard any sections that are not
7939 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7942 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7943 "This::" to work around a bug in gcc 4.2.
7945 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7947 2010-09-09 Rafael Espindola <espindola@google.com>
7949 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7950 sections with different PF_X flags in the same segment.
7951 (Layout::find_first_load_seg): Search all segments to find the first
7953 * options.h (rosegment): New.
7955 2010-09-08 Rafael Espindola <espindola@google.com>
7957 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7959 2010-09-08 Doug Kwan <dougkwan@google.com>
7961 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7962 (Arm_relobj::do_relocate_sections): Add new parameter for output
7963 file to match the parent.
7964 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7965 of local symbols instead of input values. Update code to track
7966 changes in gold::relocate_section.
7967 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7968 (Sized_relobj::compute_final_local_value_internal): New methods.
7969 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7970 body into private version of Sized_relobj::compute_final_local_value.
7971 Call the inline method.
7972 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7973 merged symbol value if there is one.
7974 (Symbol_value::has_output_value): New method defintiion.
7975 (Sized_relobj::Compute_final_local_value_status): New enum type.
7976 (Sized_relobj::compute_final_local_value): New methods.
7977 (Sized_relobj::compute_final_local_value_internal): New methods.
7978 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7979 and arm_cortex_a8.sh.
7980 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7981 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7983 * Makefile.in: Regenerate.
7984 * testsuite/arm_bl_out_of_range.s: Update test.
7985 * testsuite/thumb_bl_out_of_range.s: Ditto.
7986 * testsuite/thumb_blx_out_of_range.s: Ditto.
7987 * testsuite/arm_branch_out_of_range.sh: New file.
7988 * testsuite/arm_cortex_a8.sh: Ditto.
7989 * testsuite/arm_cortex_a8_b.s: Ditto.
7990 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7991 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7992 * testsuite/arm_cortex_a8_bl.s: Ditto.
7993 * testsuite/arm_cortex_a8_blx.s: Ditto.
7994 * testsuite/arm_cortex_a8_local.s: Ditto.
7995 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7996 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7998 2010-09-08 Rafael Espindola <espindola@google.com>
8000 * Makefile.am (memory_test.stdout): Run readelf with -W.
8001 * Makefile.in: Regenerate.
8002 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8005 2010-09-08 Rafael Espindola <espindola@google.com>
8007 * script-sections.cc (Script_sections::add_memory_region): Convert
8008 field precision to int.
8009 * script.cc (script_set_section_region, script_set_section_region):
8010 Convert field precision to int.
8012 2010-09-08 Rafael Espindola <espindola@google.com>
8014 * arm.cc (do_finalize_sections): Create the __exidx_start and
8015 __exdix_end symbols even when the section is missing.
8017 2010-09-08 Nick Clifton <nickc@redhat.com>
8019 * README: Remove claim that MEMORY is not supported.
8020 * expression.cc (script_exp_function_origin)
8021 (script_exp_function_length): Move from here to ...
8022 * script.cc: ... here.
8023 (script_set_section_region, script_add_memory)
8024 (script_parse_memory_attr, script_include_directive): New
8026 * script-sections.cc
8027 (class Memory_region): New class.
8028 (class Output_section_definition): Add set_memory_region,
8029 set_section_vma, set_section_lma and get_section_name methods.
8030 (class Script_Sections): Add add_memory_region,
8031 find_memory_region, find_memory_region_origin,
8032 find_memory_region_length and set_memory_region methods.
8033 Have set_section_addresses method walk the list of set memory
8035 Extend the print methos to display memory regions.
8036 * script-sections.h: Add prototypes for new methods.
8037 Add enum for MEMORY region attributes.
8038 * yyscript.y: Add support for parsing MEMORY regions.
8039 * script-c.h: Add prototypes for new functions.
8040 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8041 * testsuite/Makefile.in: Regenerate.
8042 * testsuite/memory_test.sh: New script.
8043 * testsuite/memory_test.s: New assembler source file.
8044 * testsuite/memory_test.t: New linker script.
8046 2010-08-27 Doug Kwan <dougkwan@google.com>
8048 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8049 reference override an existing dynamic weak reference.
8050 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8051 * testsuite/Makefile.in: Regenerate.
8052 * testsuite/dyn_weak_ref.sh: New file.
8053 * testsuite/dyn_weak_ref_1.c: Ditto.
8054 * testsuite/dyn_weak_ref_2.c: Ditto.
8056 2010-08-27 Ian Lance Taylor <iant@google.com>
8058 * incremental.h (class Incremental_input_entry): Add virtual
8061 2010-08-27 Ian Lance Taylor <iant@google.com>
8063 * testsuite/start_lib_test_3.c: Mark t3 as used.
8065 2010-08-27 Nick Clifton <nickc@redhat.com>
8067 * options.cc (version_script): Fix small typo in previous
8070 2010-08-25 Nick Clifton <nickc@redhat.com>
8072 * archive.cc: Formatting fixes: Remove whitespace between
8073 typename and following asterisk. Remove whitespace between
8074 function name and opening parenthesis.
8075 * archive.h: Likewise.
8077 * attributes.cc: Likewise.
8078 * attributes.h: Likewise.
8079 * common.cc: Likewise.
8080 * copy-relocs.cc: Likewise.
8081 * dirsearch.h: Likewise.
8082 * dynobj.cc: Likewise.
8083 * ehframe.cc: Likewise.
8084 * ehframe.h: Likewise.
8085 * expression.cc: Likewise.
8086 * fileread.cc: Likewise.
8087 * fileread.h: Likewise.
8089 * gold-threads.cc: Likewise.
8090 * gold.cc: Likewise.
8091 * i386.cc: Likewise.
8093 * incremental-dump.cc: Likewise.
8094 * incremental.cc: Likewise.
8095 * layout.cc: Likewise.
8096 * layout.h: Likewise.
8097 * main.cc: Likewise.
8098 * merge.cc: Likewise.
8099 * merge.h: Likewise.
8100 * object.cc: Likewise.
8101 * object.h: Likewise.
8102 * options.cc: Likewise.
8103 * options.h: Likewise.
8104 * output.cc: Likewise.
8105 * output.h: Likewise.
8106 * plugin.cc: Likewise.
8107 * plugin.h: Likewise.
8108 * powerpc.cc: Likewise.
8109 * reloc.cc: Likewise.
8110 * script-c.h: Likewise.
8111 * script-sections.cc: Likewise.
8112 * script.cc: Likewise.
8113 * stringpool.cc: Likewise.
8114 * symtab.cc: Likewise.
8115 * symtab.h: Likewise.
8116 * target.cc: Likewise.
8117 * timer.cc: Likewise.
8118 * timer.h: Likewise.
8119 * version.cc: Likewise.
8120 * x86_64.cc: Likewise.
8122 2010-08-24 Nick Clifton <nickc@redhat.com>
8125 * layout.cc (segment_precedes): Sort segments by their physical
8126 addresses, if they have been set.
8128 2010-08-23 Cary Coutant <ccoutant@google.com>
8130 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8132 (Lib_group::include_member): Unlock object after deleting its
8134 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8137 2010-08-19 Neil Vachharajani <nvachhar@google.com>
8138 Cary Coutant <ccoutant@google.com>
8140 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8141 constructor, and set_blocker.
8142 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8144 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8145 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8146 * testsuite/Makefile.am (start_lib_test): New test case.
8147 * testsuite/Makefile.in: Regenerate.
8148 * testsuite/start_lib_test_main.c: New file.
8149 * testsuite/start_lib_test_1.c: New file.
8150 * testsuite/start_lib_test_2.c: New file.
8151 * testsuite/start_lib_test_3.c: New file.
8153 2010-08-19 Ian Lance Taylor <iant@google.com>
8155 * Makefile.in: Rebuild with automake 1.11.1.
8156 * aclocal.m4: Likewise.
8157 * testsuite/Makefile.in: Likewise.
8159 2010-08-19 Ian Lance Taylor <iant@google.com>
8162 * i386.cc (class Output_data_plt_i386): Update declarations.
8163 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8164 local_ifuncs_ fields.
8165 (Target_i386::do_plt_section_for_global): New function.
8166 (Target_i386::do_plt_section_for_local): New function.
8167 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8168 parameter; change all callers. Initialize global_ifuncs_ and
8169 local_ifuncs_. If doing a static link define __rel_iplt_start and
8171 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8172 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8173 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8175 (Target_i386::make_plt_section): New function, broken out of
8176 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8177 (Target_i386::make_plt_entry): Call make_plt_section.
8178 (Target_i386::make_local_ifunc_plt_entry): New function.
8179 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8180 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8181 R_386_IRELATIVE to switch.
8182 (Target_i386::Scan::global): Likewise.
8183 (Target_i386::Relocate::relocate): Likewise.
8184 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8186 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8187 (Target_x86_64::do_plt_section_for_global): New function.
8188 (Target_x86_64::do_plt_section_for_local): New function.
8189 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8190 parameter; change all callers. If doing a static link define
8191 __rela_iplt_start and __rela_iplt_end.
8192 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8193 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8194 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8196 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8197 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8199 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8200 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8201 R_X86_64_IRELATIVE to switch.
8202 (Target_x86_64::Scan::global): Likewise.
8203 (Target_x86_64::Relocate::relocate): Likewise.
8204 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8206 * target.h (class Target): Add plt_section_for_global and
8207 plt_section_for_local functions. Add do_plt_section_for_global
8208 and do_plt_section_for_local virtual functions.
8209 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8210 clarifying comments.
8211 (Symbol::use_plt_offset): Handle IFUNC symbol.
8212 * object.cc (Sized_relobj::Sized_relobj): Initialize
8214 (Sized_relobj::local_has_plt_offset): New function.
8215 (Sized_relobj::local_plt_offset): New function.
8216 (Sized_relobj::set_local_plt_offset): New function.
8217 (Sized_relobj::do_count): Handle IFUNC symbol.
8218 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8219 a bit away from input_shndx_ field. Add set_is_func_symbol and
8220 is_ifunc_symbol functions.
8221 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8222 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8223 local_plt_offsets_ field.
8224 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8225 * output.h (class Output_section_data): Add non-const
8226 output_section function.
8227 (class Output_data_got): Update declarations.
8228 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8229 Add use_plt_offset parameter to global and local constructors.
8230 Change all callers. Change local_sym_index_ field to 31 bits.
8231 Change GSYM_CODE and CONSTANT_CODE accordingly.
8232 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8233 doing a static link don't set sh_link field.
8234 (Output_data_got::Got_entry::write): Use PLT offset if
8236 (Output_data_got::add_global_plt): New function.
8237 (Output_data_got::add_local_plt): New function.
8238 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8239 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8240 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8241 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8242 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8244 * testsuite/ifunc-sel.h: New file.
8245 * testsuite/ifuncmain1.c: New file.
8246 * testsuite/ifuncmain1vis.c: New file.
8247 * testsuite/ifuncmod1.c: New file.
8248 * testsuite/ifuncdep2.c: New file.
8249 * testsuite/ifuncmain2.c: New file.
8250 * testsuite/ifuncmain3.c: New file.
8251 * testsuite/ifuncmod3.c: New file.
8252 * testsuite/ifuncmain4.c: New file.
8253 * testsuite/ifuncmain5.c: New file.
8254 * testsuite/ifuncmod5.c: New file.
8255 * testsuite/ifuncmain6pie.c: New file.
8256 * testsuite/ifuncmod6.c: New file.
8257 * testsuite/ifuncmain7.c: New file.
8258 * configure, testsuite/Makefile.in: Rebuild.
8260 2010-08-18 Ian Lance Taylor <iant@google.com>
8263 (Output_section_incremental_inputs::write_input_files): Add cast
8264 to avoid signed/unsigned comparison warning.
8265 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8267 2010-08-12 Cary Coutant <ccoutant@google.com>
8269 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8271 2010-08-13 Ian Lance Taylor <iant@google.com>
8273 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8275 2010-08-12 Cary Coutant <ccoutant@google.com>
8276 Doug Kwan <dougkwan@google.com>
8278 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8279 defintion overrides non-weak undef, remember that the original undef
8281 * symtab.cc (Symbol_table::sized_write_global): For undef without
8282 an original weak binding, set binding to global in output.
8283 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8284 * testsuite/Makefile.in: Regenerate.
8285 * testsuite/strong_ref_weak_def.sh: New file.
8286 * testsuite/strong_ref_weak_def_1.c: Ditto.
8287 * testsuite/strong_ref_weak_def_2.c: Ditto.
8289 2010-08-12 Cary Coutant <ccoutant@google.com>
8291 * testsuite/incremental_test.sh: Rewrite.
8292 * testsuite/incremental_test_1.c: Rewrite.
8293 * testsuite/incremental_test_2.c: Rewrite.
8295 2010-08-12 Cary Coutant <ccoutant@google.com>
8297 * arm.cc (Target_arm::got_size): Add const.
8298 (Target_arm::got_entry_count): New function.
8299 (Target_arm::plt_entry_count): New function.
8300 (Target_arm::first_plt_entry_offset): New function.
8301 (Target_arm::plt_entry_size): New function.
8302 (Output_data_plt_arm::entry_count): New function.
8303 (Output_data_plt_arm::first_plt_entry_offset): New function.
8304 (Output_data_plt_arm::get_plt_entry_size): New function.
8305 * i386.cc (Target_i386::got_size): Add const.
8306 (Target_i386::got_entry_count): New function.
8307 (Target_i386::plt_entry_count): New function.
8308 (Target_i386::first_plt_entry_offset): New function.
8309 (Target_i386::plt_entry_size): New function.
8310 (Output_data_plt_i386::entry_count): New function.
8311 (Output_data_plt_i386::first_plt_entry_offset): New function.
8312 (Output_data_plt_i386::get_plt_entry_size): New function.
8313 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8314 find_incremental_inputs_sections. Dump incremental_got_plt section.
8315 * incremental.cc: Include target.h.
8316 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8317 parameter. Adjust all callers. Find incremental_got_plt section.
8318 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8320 (Output_section_incremental_inputs::set_final_data_size): Calculate
8321 size of incremental_got_plt section.
8322 (Output_section_incremental_inputs::do_write): Write the
8323 incremental_got_plt section.
8324 (Got_plt_view_info): New struct.
8325 (Local_got_offset_visitor): New class.
8326 (Global_got_offset_visitor): New class.
8327 (Global_symbol_visitor_got_plt): New class.
8328 (Output_section_incremental_inputs::write_got_plt): New function.
8329 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8330 Add parameter. Adjust all callers.
8331 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8332 (Incremental_inputs::got_plt_section): New function.
8333 (Incremental_inputs::got_plt_section_): New data member.
8334 (Incremental_got_plt_reader): New class.
8335 * layout.cc (Layout::create_incremental_info_sections): Add the
8336 incremental_got_plt section.
8337 * object.h (Got_offset_list::get_list): New function.
8338 (Got offset_list::for_all_got_offsets): New function.
8339 (Sized_relobj::local_got_offset_list): New function.
8340 * powerpc.cc (Target_powerpc::got_size): Add const.
8341 (Target_powerpc::got_entry_count): New function.
8342 (Target_powerpc::plt_entry_count): New function.
8343 (Target_powerpc::first_plt_entry_offset): New function.
8344 (Target_powerpc::plt_entry_size): New function.
8345 (Output_data_plt_powerpc::entry_count): New function.
8346 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8347 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8348 * sparc.cc (Target_sparc::got_size): Add const.
8349 (Target_sparc::got_entry_count): New function.
8350 (Target_sparc::plt_entry_count): New function.
8351 (Target_sparc::first_plt_entry_offset): New function.
8352 (Target_sparc::plt_entry_size): New function.
8353 (Output_data_plt_sparc::entry_count): New function.
8354 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8355 (Output_data_plt_sparc::get_plt_entry_size): New function.
8356 * symtab.h (Symbol::got_offset_list): New function.
8357 (Symbol_table::for_all_symbols): New function.
8358 * target.h (Sized_target::got_entry_count): New function.
8359 (Sized_target::plt_entry_count): New function.
8360 (Sized_target::plt_entry_size): New function.
8361 * x86_64.cc (Target_x86_64::got_size): Add const.
8362 (Target_x86_64::got_entry_count): New function.
8363 (Target_x86_64::plt_entry_count): New function.
8364 (Target_x86_64::first_plt_entry_offset): New function.
8365 (Target_x86_64::plt_entry_size): New function.
8366 (Output_data_plt_x86_64::entry_count): New function.
8367 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8368 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8370 2010-08-12 Cary Coutant <ccoutant@google.com>
8372 * archive.cc: Include incremental.h.
8373 (Archive::Archive): Initialize incremental_info_.
8374 (Archive::include_member): Record archive members in incremental info.
8375 (Add_archive_symbols::run): Record begin and end of an archive in
8377 (Lib_group::include_member): Record objects in incremental info.
8378 * archive.h (Incremental_archive_entry): Forward declaration.
8379 (Archive::set_incremental_info): New member function.
8380 (Archive::incremental_info): New member function.
8381 (Archive::Unused_symbol_iterator): New class.
8382 (Archive::unused_symbols_begin): New member function.
8383 (Archive::unused_symbols_end): New member function.
8384 (Archive::incremental_info_): New data member.
8385 * incremental-dump.cc (find_input_containing_global): New function.
8386 (dump_incremental_inputs): Dump new incremental info sections.
8387 * incremental.cc: Include symtab.h.
8388 (Output_section_incremental_inputs): New class.
8389 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8390 new incremental info sections.
8391 (Sized_incremental_binary::do_check_inputs): Likewise.
8392 (Incremental_inputs::report_archive): Remove.
8393 (Incremental_inputs::report_archive_begin): New function.
8394 (Incremental_inputs::report_archive_end): New function.
8395 (Incremental_inputs::report_object): New function.
8396 (Incremental_inputs::finalize_inputs): Remove.
8397 (Incremental_inputs::report_input_section): New function.
8398 (Incremental_inputs::report_script): Rewrite.
8399 (Incremental_inputs::finalize): Do nothing but finalize string table.
8400 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8401 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8402 (Incremental_inputs::create_data_sections): New function.
8403 (Incremental_inputs::relocs_entsize): New function.
8404 (Output_section_incremental_inputs::set_final_data_size): New function.
8405 (Output_section_incremental_inputs::do_write): New function.
8406 (Output_section_incremental_inputs::write_header): New function.
8407 (Output_section_incremental_inputs::write_input_files): New function.
8408 (Output_section_incremental_inputs::write_info_blocks): New function.
8409 (Output_section_incremental_inputs::write_symtab): New function.
8410 * incremental.h (Incremental_script_entry): Forward declaration.
8411 (Incremental_object_entry): Forward declaration.
8412 (Incremental_archive_entry): Forward declaration.
8413 (Incremental_inputs): Forward declaration.
8414 (Incremental_inputs_header_data): Remove.
8415 (Incremental_inputs_header): Remove.
8416 (Incremental_inputs_header_write): Remove.
8417 (Incremental_inputs_entry_data): Remove.
8418 (Incremental_inputs_entry): Remove.
8419 (Incremental_inputs_entry_write): Remove.
8420 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8421 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8422 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8423 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8425 (Incremental_input_entry): New class.
8426 (Incremental_script_entry): New class.
8427 (Incremental_object_entry): New class.
8428 (Incremental_archive_entry): New class.
8429 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8430 (Incremental_inputs::report_inputs): Remove.
8431 (Incremental_inputs::report_archive): Remove.
8432 (Incremental_inputs::report_archive_begin): New function.
8433 (Incremental_inputs::report_archive_end): New function.
8434 (Incremental_inputs::report_object): Change prototype.
8435 (Incremental_inputs::report_input_section): New function.
8436 (Incremental_inputs::report_script): Change prototype.
8437 (Incremental_inputs::get_reloc_count): New function.
8438 (Incremental_inputs::set_reloc_count): New function.
8439 (Incremental_inputs::create_data_sections): New function.
8440 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8441 (Incremental_inputs::inputs_section): New function.
8442 (Incremental_inputs::symtab_section): New function.
8443 (Incremental_inputs::relocs_section): New function.
8444 (Incremental_inputs::get_stringpool): Add const.
8445 (Incremental_inputs::command_line): Add const.
8446 (Incremental_inputs::inputs): Remove.
8447 (Incremental_inputs::command_line_key): New function.
8448 (Incremental_inputs::input_file_count): New function.
8449 (Incremental_inputs::input_files): New function.
8450 (Incremental_inputs::relocs_entsize): New function.
8451 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8452 (Incremental_inputs::finalize_inputs): Remove.
8453 (Incremental_inputs::Input_info): Remove.
8454 (Incremental_inputs::lock_): Remove.
8455 (Incremental_inputs::inputs_): Change type.
8456 (Incremental_inputs::inputs_map_): Remove.
8457 (Incremental_inputs::current_object_entry_): New data member.
8458 (Incremental_inputs::inputs_section_): New data member.
8459 (Incremental_inputs::symtab_section_): New data member.
8460 (Incremental_inputs::relocs_section_): New data member.
8461 (Incremental_inputs::reloc_count_): New data member.
8462 (Incremental_inputs_reader): New class.
8463 (Incremental_symtab_reader): New class.
8464 (Incremental_relocs_reader): New class.
8465 * layout.cc (Layout::finalize): Move finalization of incremental info
8466 and creation of incremental info sections to follow finalization of
8467 symbol table. Set offsets for postprocessing sections.
8468 (Layout::create_incremental_info_sections): Call
8469 Incremental_inputs::create_data_sections. Add incremental symtab
8470 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8471 sections to layout after input sections.
8472 * layout.h (struct Timespec): Forward declaration.
8473 (Layout::incremental_inputs): Add const.
8474 (Layout::create_incremental_info_sections): Add parameter.
8475 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8476 * object.cc: Include incremental.h.
8477 (Relobj::finalize_incremental_relocs): New function.
8478 (Sized_relobj::do_layout): Record input sections in incremental info.
8479 * object.h (Object::output_section): New function.
8480 (Object::output_section_offset): Moved from Relobj.
8481 (Object::get_incremental_reloc_base): New function.
8482 (Object::get_incremental_reloc_count): New function.
8483 (Object::do_output_section): New function.
8484 (Object::do_output_section_offset): Moved from Relobj.
8485 (Object::do_get_incremental_reloc_base): New function.
8486 (Object::do_get_incremental_reloc_count): New function.
8487 (Object::Object): Initialize new data members.
8488 (Relobj::output_section): Renamed do_output_section and moved to
8490 (Relobj::output_section_offset): Moved to Object.
8491 (Relobj::do_get_incremental_reloc_base): New function.
8492 (Relobj::do_get_incremental_reloc_count): New function.
8493 (Relobj::allocate_incremental_reloc_counts): New function.
8494 (Relobj::count_incremental_reloc): New function.
8495 (Relobj::finalize_incremental_relocs): New function.
8496 (Relobj::next_incremental_reloc_index): New function.
8497 (Relobj::reloc_counts_): New data member.
8498 (Relobj::reloc_bases_): New data member.
8499 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8500 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8501 (Sized_relobj::incremental_relocs_scan): New function.
8502 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8503 (Sized_relobj::incremental_relocs_write): New function.
8504 (Sized_relobj::incremental_relocs_write_reltype): New function.
8505 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8507 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8508 archives and object files elsewhere.
8509 (Add_symbols::run): Report object files here.
8510 (Finish_group::run): Report end of archive at end of group.
8511 * reloc.cc: Include layout.h, incremental.h.
8512 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8513 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8514 (Sized_relobj::incremental_relocs_scan): New function.
8515 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8516 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8517 (Sized_relobj::incremental_relocs_write): New function.
8518 (Sized_relobj::incremental_relocs_write_reltype): New function.
8519 * script.cc (read_input_script): Rewrite test for incremental link.
8520 Change call to Incremental_inputs::report_script.
8521 * symtab.h (Symbol_table::first_global_index): New function.
8522 (Symbol_table::output_count): New function.
8524 2010-08-12 Doug Kwan <dougkwan@google.com>
8526 * arm.cc (Target_arm::merge_object_attributes): Check command line
8527 options --no-wchar-size-warning and --no-enum-size-warning.
8528 * options.h (General_options): Add ld-compatible options
8529 --no-enum-size-warning and --no-wchar-size-warning.
8531 2010-08-04 Ian Lance Taylor <iant@google.com>
8533 * x86_64.cc (Target_x86_64::Scan::local): Use
8534 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8535 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8536 (Target_x86_64::Scan::global): Likewise.
8537 (Target_x86_64::Relocate::relocate): Likewise.
8538 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8541 2010-08-03 Cary Coutant <ccoutant@google.com>
8543 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8544 to reserve space in merged_strings vector. Keep total input size
8546 (Output_merge_string::do_print_merge_stats): Print total input size.
8547 * merge.h (Output_merge_string): Add input_size_ field.
8548 * stringpool.cc (Stringpool_template::string_length): Move
8549 implementations out of Stringpool_template class and place in
8551 * stringpool.h (string_length): Move out of Stringpool_template.
8553 2010-08-03 Ian Lance Taylor <iant@google.com>
8556 * layout.cc (relaxation_loop_body): If address of load segment is
8557 set, adjust address to include headers if possible.
8559 2010-08-03 Ian Lance Taylor <iant@google.com>
8561 * version.cc (version_string): Bump to 1.10.
8563 2010-08-03 Ian Lance Taylor <iant@google.com>
8566 * layout.h (enum Output_section_order): Define.
8567 (class Layout): Update declarations.
8568 * layout.cc (Layout::get_output_section): Add order parameter.
8569 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8570 is_first_non_relro parameters. Change all callers.
8571 (Layout::choose_output_section): Likewise.
8572 (Layout::add_output_section_data): Likewise.
8573 (Layout::make_output_section): Likewise. Set order.
8574 (Layout::default_section_order): New function.
8575 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8576 * output.cc (Output_section::Output_section): Initialize order_.
8577 Don't initialize deleted fields.
8578 (Output_segment::Output_segment): Don't initialize deleted
8580 (Output_segment::add_output_section_to_load): New function
8581 replacing add_output_section. Change all callers to call this or
8582 add_output_section_to_nonload.
8583 (Output_segment::add_output_section_to_nonload): New function.
8584 (Output_segment::remove_output_section): Rewrite.
8585 (Output_segment::add_initial_output_data): Likewise.
8586 (Output_segment::has_any_data_sections): Likewise.
8587 (Output_segment::is_first_section_relro): Likewise.
8588 (Output_segment::maximum_alignment): Likewise.
8589 (Output_segment::has_dynamic_reloc): New function replacing
8590 dynamic_reloc_count. Change all callers.
8591 (Output_segment::has_dynamic_reloc_list): New function replacing
8592 dynamic_reloc_count_list. Change all callers.
8593 (Output_segment::set_section_addresses): Rewrite.
8594 (Output_segment::set_offset): Rewrite.
8595 (Output_segment::find_first_and_last_list): Remove.
8596 (Output_segment::set_tls_offsets): Rewrite.
8597 (Output_segment::first_section_load_address): Likewise.
8598 (Output_segment::output_section_count): Likewise.
8599 (Output_segment::section_with_lowest_load_address): Likewise.
8600 (Output_segment::write_section_headers): Likewise.
8601 (Output_segment::print_sections_to_map): Likewise.
8602 * output.h (class Output_data): Remove dynamic_reloc_count_
8603 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8604 (Output_data::add_dynamic_reloc): Rewrite.
8605 (Output_data::has_dynamic_reloc): New function.
8606 (Output_data::dynamic_reloc_count): Remove.
8607 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8608 is_last_relro_, is_first_non_relro_, is_interp_,
8609 is_dynamic_linker_section_ fields. Add order and set_order
8610 functions. Remove is_relro_local, set_is_relro_local,
8611 is_last_relro, set_is_last_relro, is_first_non_relro,
8612 set_is_first_non_relro functions, is_interp, set_is_interp,
8613 is_dynamic_linker_section, and set_is_dynamic_linker_section
8615 (class Output_segment): Change Output_data_list from std::list to
8616 std:;vector. Add output_lists_ field. Remove output_data_ and
8617 output_bss_ fields. Update declarations.
8619 2010-08-02 Ian Lance Taylor <iant@google.com>
8621 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8622 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8623 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8625 2010-08-02 Ian Lance Taylor <iant@google.com>
8628 * script.cc (Script_options::Script_options): Initialize
8629 symbol_definitions_ and symbol_references_.
8630 (Script_options::add_symbol_assignment): Update
8631 symbol_definitions_ and symbol_references_.
8632 (Script_options::add_symbol_reference): New function.
8633 (script_symbol): New function.
8634 * script.h (class Script_options): Add symbol_definitions_ and
8635 symbol_references_ fields.
8636 (Script_options::referenced_const_iterator): New type.
8637 (Script_options::referenced_begin): New function.
8638 (Script_options::referenced_end): New function.
8639 (Script_options::is_referenced): New function.
8640 (Script_options::any_unreferenced): New function.
8641 * script-c.h (script_symbol): Declare.
8642 * yyscript.y (exp): Call script_symbol.
8643 * symtab.cc: Include "script.h".
8644 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8645 Change all callers. Check symbols referenced by scripts.
8646 (Symbol_table::add_undefined_symbols_from_command_line): Add
8647 layout parameter. Change all callers.
8648 (Symbol_table::do_add_undefined_symbols_from_command_line):
8649 Likewise. Break out loop body. Check symbols referenced by
8651 (Symbol_table::add_undefined_symbol_from_command_line): New
8652 function broken out of
8653 do_add_undefined_symbols_from_command_line.
8654 * symtab.h (class Symbol_table): Update declarations.
8655 * archive.cc: Include "layout.h".
8656 (Archive::should_include_member): Add layout parameter. Change
8657 all callers. Check for symbol mentioned in expression.
8658 * archive.h (class Archive): Update declaration.
8659 * object.cc (Sized_relobj::do_should_include_member): Add layout
8661 * object.h (Object::should_include_member): Add layout parameter.
8663 (Object::do_should_include_member): Add layout parameter.
8664 (class Sized_relobj): Update declaration.
8665 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8667 * dynobj.h (class Sized_dynobj): Update declaration.
8668 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8670 * plugin.h (class Sized_pluginobj): Update declaration.
8672 2010-08-02 Ian Lance Taylor <iant@google.com>
8675 * output.cc (Output_segment::set_offset): Search for the first and
8676 last sections rather than assuming that the list is in order.
8677 (Output_segment::find_first_and_last_list): New function.
8678 * output.h (class Output_segment): Update declarations.
8679 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8680 (relro_strip_test_SOURCES): New variable.
8681 (relro_strip_test_DEPENDENCIES): New variable.
8682 (relro_strip_test_LDFLAGS): New variable.
8683 (relro_strip_test_LDADD): New variable.
8684 (relro_strip_test.so): New target.
8686 2010-08-02 Ian Lance Taylor <iant@google.com>
8688 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8689 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8690 (Target_i386::got_tlsdesc_section): New function.
8691 (Target_i386::got_section): Create space for GOT entries for
8692 TLSDESC relocations.
8693 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8695 (Target_i386::Scan::global): Likewise.
8696 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8698 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8699 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8700 (Target_x86_64::got_tlsdesc_section): New function.
8701 (Target_x86_64::got_section): Create space for GOT entries for
8702 TLSDESC relocations.
8703 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8705 (Target_x86_64::Scan::global): Likewise.
8706 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8709 2010-08-02 Ian Lance Taylor <iant@google.com>
8711 * testsuite/final_layout.sh: Use dc to convert from hex to
8714 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8716 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8717 paramter to the call to gold::gc_process_relocs.
8718 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8719 paramter to the call to gold::gc_process_relocs.
8720 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8721 parameter to the call to gold::gc_process_relocs.
8722 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8723 template parameter to the call to gold::gc_process_relocs.
8724 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8725 paramter to the call to gold::gc_process_relocs.
8726 * gc.h (get_embedded_addend_size): New function.
8727 (gc_process_relocs): Save the size of the reloc for use by ICF.
8728 * icf.cc (get_section_contents): Get the addend from the text section
8729 for SHT_REL relocation sections.
8730 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8731 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8732 * int_encoding.h (read_from_pointer): New overloaded function.
8733 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8734 * testsuite/icf_sht_rel_addend_test.sh: New file.
8735 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8736 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8738 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8740 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8741 * Makefile.in: Regenerate.
8742 * testsuite/Makefile.in: Regenerate.
8744 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8746 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8747 * gold/testsuite/debug_msg.cc: Likewise.
8748 * gold/testsuite/odr_violation1.cc
8749 * gold/testsuite/odr_violation2.cc
8751 2010-07-21 Cary Coutant <ccoutant@google.com>
8753 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8754 string, and length fields.
8755 (Output_merge_string::Merged_strings_list): New type.
8756 (Output_merge_string::Merged_strings_lists): New typedef.
8757 (Output_merge_string): Replace merged_strings_ with
8758 merged_strings_lists_.
8759 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8760 Merged_strings_list per input object and section. Don't store pointer
8761 to the string. Don't store length with each merged string entry.
8762 (Output_merge_string::finalize_merged_data): Loop over list of merged
8763 strings lists. Recompute length of each merged string.
8765 2010-07-15 Cary Coutant <ccoutant@google.com>
8767 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8770 2010-07-14 Ian Lance Taylor <iant@google.com>
8772 * descriptors.cc (Descriptors::open): Report correct name in error
8775 2010-07-13 Doug Kwan <dougkwan@google.com>
8777 * arm.cc (Arm_input_section::Arm_input_section): For a
8778 SHT_ARM_EXIDX section, always keeps the input sections.
8779 (Arm_input_section::set_exidx_section_link): New method.
8780 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8781 has_errors_ to false.
8782 (Arm_exidx_input_section::has_errors,
8783 Arm_exidx_input_section::set_has_errors): New methods.
8784 (Arm_exidx_input_section::has_errors_): New data member.
8785 (Arm_relobj::get_exidx_shndx_list): New method.
8786 (Arm_output_section::append_text_sections_to_list): Do not skip
8787 section without SHF_EXECINSTR.
8788 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8790 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8791 section header. Make error messages more verbose. Check for
8792 a non-executable section linked to an EXIDX section.
8793 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8794 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8795 check that there is no deferred EXIDX section if we exit early.
8796 Instead of not making an EXIDX section in case of an error, make one
8797 and set the has_errors flag of it.
8798 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8799 in a relocatable link.
8800 (Target_arm::do_relax): Look for the EXIDX output section instead of
8801 assuming that it is called .ARM.exidx.
8802 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8803 section list. Do not check for SHF_EXECINSTR section flags but
8804 skip any input section with errors.
8805 * output.cc (Output_section::Output_section): Initialize
8806 always_keeps_input_sections_ to false.
8807 (Output_section::add_input_section): Check for
8808 always_keeps_input_sections_.
8809 * output.h (Output_section::always_keeps_input_sections,
8810 Output_section::set_always_keeps_input_sections): New methods.
8811 (Output_section::always_keeps_input_sections): New data member.
8813 2010-07-13 Rafael Espindola <espindola@google.com>
8815 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8816 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8818 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8819 Ian Lance Taylor <iant@google.com>
8821 * output.h (Output_section_lookup_maps::add_merge_section):
8822 Correct check of whether value was inserted.
8823 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8824 (Output_section_lookup_maps::add_relaxed_input_section):
8826 * arm.cc (Target_arm::got_section): Remove used local os.
8827 * i386.cc (Target_i386::got_section): Likewise.
8828 * x86_64.cc (Target_x86_64::got_section): Likewise.
8829 * sparc.cc (Target_sparc::got_section): Likewise.
8830 (Target_sparc::relocate): Remove unused local have_got_offset.
8831 * powerpc.cc (Target_powerpc::relocate): Likewise.
8833 2010-07-13 Ian Lance Taylor <iant@google.com>
8835 * compressed_output.cc (zlib_decompress): Fix signature in
8838 * archive.cc (Archive::include_member): Unlock an external member
8839 of a thin archive. Don't bother to delete an object we know is
8842 2010-07-12 Cary Coutant <ccoutant@google.com>
8844 * compressed_output.cc (zlib_decompress): New function.
8845 (get_uncompressed_size): New function.
8846 (decompress_input_section): New function.
8847 * compressed_output.h (get_uncompressed_size): New function.
8848 (decompress_input_section): New function.
8849 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8850 Handle compressed debug sections.
8851 * layout.cc (is_compressed_debug_section): New function.
8852 (Layout::output_section_name): Map compressed section names to
8854 * layout.h (is_compressed_debug_section): New function.
8855 (is_debug_info_section): Recognize compressed debug sections.
8856 * merge.cc: Include compressed_output.h.
8857 (Output_merge_data::do_add_input_section): Handle compressed
8859 (Output_merge_string::do_add_input_section): Handle compressed
8861 * object.cc: Include compressed_output.h.
8862 (Sized_relobj::Sized_relobj): Initialize new data members.
8863 (build_compressed_section_map): New function.
8864 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8865 * object.h (Object::section_is_compressed): New method.
8866 (Object::do_section_is_compressed): New method.
8867 (Sized_relobj::Compressed_section_map): New type.
8868 (Sized_relobj::do_section_is_compressed): New method.
8869 (Sized_relobj::compressed_sections_): New data member.
8870 * output.cc (Output_section::add_input_section): Handle compressed
8872 * reloc.cc: Include compressed_output.h.
8873 (Sized_relobj::write_sections): Handle compressed debug sections.
8875 2010-07-08 Cary Coutant <ccoutant@google.com>
8877 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8878 weak when resolving to a dynamic def.
8879 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8880 for weak undef/dynamic def cases. Adjust callers.
8881 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8882 undef_binding_weak_.
8883 (Symbol_table::sized_write_globals): Adjust symbol binding.
8884 (Symbol_table::sized_write_symbol): Add binding parameter.
8885 * symtab.h (Symbol::set_undef_binding): New method.
8886 (Symbol::is_undef_binding_weak): New method.
8887 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8888 (Symbol_table::should_override): Add new parameter.
8889 (Symbol_table::sized_write_symbol): Add new parameter.
8891 * testsuite/weak_undef_file1.cc: Add new test case.
8892 * testsuite/weak_undef_file2.cc: Fix header comment.
8893 * testsuite/weak_undef_test.cc: Add new test case.
8895 2010-06-29 Doug Kwan <dougkwan@google.com>
8897 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8898 Initialize USE_SYMBOL_.
8899 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8901 (Arm_reloc_property::uses_symbol_): New data member declaration.
8902 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8903 uses symbol value and symbol is undefined but not weakly undefined.
8905 2010-06-28 Rafael Espindola <espindola@google.com>
8907 * plugin.cc (Plugin::load): Use dlerror.
8909 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8911 * symtab.cc (detect_odr_violations): When reporting an ODR
8912 violation, report an object where the symbol is defined.
8914 2010-06-25 Doug Kwan <dougkwan@google.com>
8916 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8917 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8919 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8920 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8921 target hook to detect function points.
8922 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8923 * icf.h (Icf::check_section_for_function_pointers): Change type of
8924 parameter SECTION_NAME to const reference to std::string. Use
8925 target hook to determine if section may have unsafe pointers.
8926 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8929 2010-06-21 Rafael Espindola <espindola@google.com>
8931 * fileread.cc (Input_file::find_fie): New
8932 (Input_file::open): Use Input_file::find_fie.
8933 * fileread.h (Input_file::find_fie): New
8934 * plugin.cc (set_extra_library_path): New.
8935 (Plugin::load): Add set_extra_library_path to the transfer vector.
8936 (Plugin_manager::set_extra_library_path): New.
8937 (Plugin_manager::add_input_file): Use the extra search path if set.
8938 (set_extra_library_path(): New.
8939 * plugin.h (Plugin_manager): Add set_extra_library_path and
8942 2010-06-19 Cary Coutant <ccoutant@google.com>
8944 * layout.cc (gdb_sections): Add .debug_types.
8945 (lines_only_debug_sections): Likewise.
8947 2010-06-18 Rafael Espindola <espindola@google.com>
8949 * plugin.cc (add_input_file,add_input_library)
8950 (Plugin_manager::add_input_file): Make filename arguments const.
8951 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8954 2010-06-16 Doug Kwan <dougkwan@google.com>
8956 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8957 .ARM.attributes section if we have not merged any input
8958 attributes sections.
8960 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8962 * arm.cc: Allow combining objects with no EABI version
8965 2010-06-15 Rafael Espindola <espindola@google.com>
8967 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8969 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8971 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8972 (struct iovec): Correct !HAVE_READV definition.
8974 2010-06-10 Cary Coutant <ccoutant@google.com>
8976 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8977 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8979 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8982 * symtab.h (Symbol::is_placeholder): New member function.
8983 * target-reloc.h (relocate_section): Check for placeholder symbols.
8985 * testsuite/Makefile.am (plugin_test_8): New test.
8986 (plugin_test_9): New test.
8987 * testsuite/Makefile.in: Regenerate.
8989 2010-06-09 Nick Clifton <nickc@redhat.com>
8991 * yyscript.y (input_list_element): Allow strings prefixed with
8992 the '-' character. Treat these as libraries.
8993 * script.cc (script_add_library): New function. Adds a library
8994 specified by "-l<name>" found in an input script.
8995 * script-c.h: Add prototype for script_add_library.
8997 2010-06-07 Doug Kwan <dougkwan@google.com>
8999 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9000 Restrict stub-group size to be within long conditional branch
9001 range when working around cortex-A8 erratum.
9003 2010-06-07 Damien Diederen <dd@crosstwine.com>
9005 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9008 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9012 (Output_section::Input_section_sort_entry::compare_section_ordering):
9013 Change to return non-zero correctly.
9014 (Output_section::Input_section_sort_section_order_index_compare
9015 ::operator()): Change to fix ambiguity in comparisons.
9017 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9019 * gold.h (is_wildcard_string): New function.
9020 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9021 (Layout::layout_eh_frame): Ditto.
9022 (Layout::find_section_order_index): New method.
9023 (Layout::read_layout_from_file): New method.
9024 * layout.h (Layout::find_section_order_index): New method.
9025 (Layout::read_layout_from_file): New method.
9026 (Layout::input_section_position_): New private member.
9027 (Layout::input_section_glob_): New private member.
9028 * main.cc (main): Call read_layout_from_file here.
9029 * options.h (--section-ordering-file): New option.
9030 * output.cc (Output_section::input_section_order_specified_): New
9032 (Output_section::Output_section): Initialize new member.
9033 (Output_section::add_input_section): Add new parameter.
9034 Keep input sections when --section-ordering-file is used.
9035 (Output_section::set_final_data_size): Sort input sections when
9036 section ordering file is specified.
9037 (Output_section::Input_section_sort_entry): Add new parameter.
9039 (Output_section::Input_section_sort_entry::compare_section_ordering):
9041 (Output_section::Input_section_sort_compare::operator()): Change to
9042 consider section_order_index.
9043 (Output_section::Input_section_sort_init_fini_compare::operator()):
9044 Change to consider section_order_index.
9045 (Output_section::Input_section_sort_section_order_index_compare
9046 ::operator()): New method.
9047 (Output_section::sort_attached_input_sections): Change to sort
9048 according to section order when specified.
9049 (Output_section::add_input_section<32, true>): Add new parameter.
9050 (Output_section::add_input_section<64, true>): Add new parameter.
9051 (Output_section::add_input_section<32, false>): Add new parameter.
9052 (Output_section::add_input_section<64, false>): Add new parameter.
9053 * output.h (Output_section::add_input_section): Add new parameter.
9054 (Output_section::input_section_order_specified): New
9056 (Output_section::set_input_section_order_specified): New method.
9057 (Input_section::Input_section): Initialize section_order_index_.
9058 (Input_section::section_order_index): New method.
9059 (Input_section::set_section_order_index): New method.
9060 (Input_section::section_order_index_): New member.
9061 (Input_section::Input_section_sort_section_order_index_compare): New
9063 (Output_section::input_section_order_specified_): New member.
9064 * script-sections.cc (is_wildcard_string): Delete and move modified
9066 (Output_section_element_input::Output_section_element_input): Modify
9067 call to is_wildcard_string.
9068 (Output_section_element_input::Input_section_pattern
9069 ::Input_section_pattern): Ditto.
9070 (Output_section_element_input::Output_section_element_input): Ditto.
9071 * testsuite/Makefile.am (final_layout): New test case.
9072 * testsuite/Makefile.in: Regenerate.
9073 * testsuite/final_layout.cc: New file.
9074 * testsuite/final_layout.sh: New file.
9076 2010-06-01 Rafael Espindola <espindola@google.com>
9078 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9080 2010-06-01 Rafael Espindola <espindola@google.com>
9082 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9083 visibility of symbols.
9085 2010-05-27 Doug Kwan <dougkwan@google.com>
9087 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9088 from start of output section instead of address for a local symbol
9089 in a merged or relaxed section when doing a relocatable link.
9091 2010-05-26 Rafael Espindola <espindola@google.com>
9094 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9095 adding sections the garbage collector removed.
9096 * gold/testsuite/Makefile.am: Add test.
9097 * gold/testsuite/Makefile.in: Regenerate.
9098 * gold/testsuite/plugin_test_7.sh: New.
9099 * gold/testsuite/plugin_test_7_1.c: New.
9100 * gold/testsuite/plugin_test_7_2.c: New.
9102 2010-05-26 Rafael Espindola <espindola@google.com>
9104 * script-sections.cc (Output_section_definition::set_section_addresses):
9105 Check for --section-start.
9107 2010-05-26 Doug Kwan <dougkwan@google.com>
9109 * arm.cc (Arm_scan_relocatable_relocs): New class.
9110 (Target_arm::relocate_special_relocatable): New method.
9111 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9112 (Arm_relocate_functions::thumb_branch_common): Same.
9113 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9114 instead of Default_scan_relocatable_relocs.
9115 * target-reloc.h (relocate_for_relocatable): Let target handle
9116 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9117 * target.h (Sized_target::relocate_special_relocatable): New method.
9119 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9121 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9123 2010-05-23 Doug Kwan <dougkwan@google.com>
9125 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9127 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9128 with a direct branch, not a conditional branch, to a stub.
9129 * merge.cc (Output_merge_base::record_input_section): New method
9131 (Output_merge_data::do_add_input_section): Record input section if
9132 keeps-input-sections flag is set.
9133 (Output_merge_string::do_add_input_section): Ditto.
9134 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9135 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9137 (Output_merge_base::keeps_input_sections,
9138 Output_merge_base::set_keeps_input_sections,
9139 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9141 (Output_merge_base::Input_sections): New type declaration.
9142 (Output_merge_base::input_sections_begin,
9143 Output_merge_base::input_sections_end,
9144 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9145 (Output_merge_base::bool keeps_input_sections_,
9146 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9147 Output_merge_base::input_sections_): New data members.
9148 (Output_merge_data::do_set_keeps_input_sections): New method
9150 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9151 * output.cc (Output_section::Input_section::relobj): Move method
9152 defintion from class declaration to here and handle merge sections.
9153 (Output_section::Input_section::shndx): Ditto.
9154 (Output_section::Output_section): Remove initializations of removed
9155 data members and initialize new data member LOOKUP_MAPS_.
9156 (Output_section::add_input_section): Set keeps-input-sections flag
9157 for a newly created merge output section as appropriate. Adjust code
9158 to use Output_section_lookup_maps class.
9159 (Output_section::add_relaxed_input_section): Adjst code for lookup
9160 maps code refactoring.
9161 (Output_section::add_merge_input_section): Add a new parameter
9162 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9163 class. If adding input section to a newly created merge output
9164 section fails, remove the new merge section.
9165 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
9166 Adjust code for use of the Output_section_lookup_maps class.
9167 (Output_section::find_merge_section): Ditto.
9168 (Output_section::build_lookup_maps): New method defintion.
9169 (Output_section::find_relaxed_input_section): Adjust code to use
9170 Output_section_lookup_maps class.
9171 (Output_section::get_input_sections): Export merge sections. Adjust
9172 code to use Output_section_lookup_maps class.
9173 (Output_section:::add_script_input_section): Adjust code to use
9174 Output_section_lookup_maps class. Update lookup maps for merge
9176 (Output_section::discard_states): Use Output_section_lookup_maps.
9177 (Output_section::restore_states): Same.
9178 * output.h (Merge_section_properties): Move class defintion out of
9180 (Output_section_lookup_maps): New class.
9181 (Output_section::Input_section::is_merge_section): New method
9183 (Output_section::Input_section::relobj): Move defintion out of class
9184 defintion. Declare method only.
9185 (Output_section::Input_section::shndx): Ditto.
9186 (Output_section::Input_section::output_merge_base): New method defintion.
9187 (Output_section::Input_section::u2_.pomb): New union field.
9188 (Output_section::Merge_section_by_properties_map,
9189 Output_section::Output_section_data_by_input_section_map,
9190 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9192 (Output_section::add_merge_input_section): Add new parameter
9193 KEEPS_INPUT_SECTIONS.
9194 (Output_section::build_lookup_maps): New method declaration.
9195 (Output_section::merge_section_map_,
9196 Output_section::merge_section_by_properties_map_,
9197 Output_section::relaxed_input_section_map_,
9198 Output_section::is_relaxed_input_section_map_valid_): Remove data
9200 (Output_section::lookup_maps_): New data member.
9202 2010-05-21 Doug Kwan <dougkwan@google.com>
9205 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9206 avoid a compilation error.
9208 2010-05-19 Rafael Espindola <espindola@google.com>
9210 * script-sections.cc (Output_section_definition::allocate_to_segment):
9211 Update the phdrs_list even when the output section is NULL.
9212 * testsuite/Makefile.am: Add test.
9213 * testsuite/Makefile.in: Regenerate.
9214 * testsuite/script_test_9.cc: New.
9215 * testsuite/script_test_9.sh: New.
9216 * testsuite/script_test_9.t: New.
9218 2010-05-19 Doug Kwan <dougkwan@google.com>
9220 * arm.cc (Arm_input_section::original_size): New method.
9221 (Arm_input_section::do_addralign): Add a cast.
9222 (Arm_input_section::do_output_offset): Remove static cast.
9223 (Arm_input_section::original_addralign,
9224 Arm_input_section::original_size_): Change type to uint32_t.
9225 (Arm_input_section::init): Add safe casts for section alignment
9227 (Arm_input_section::set_final_data_size): Do not set address and
9228 offset of stub table.
9229 (Arm_output_section::fix_exidx_coverage): Change use of of
9230 Output_section::Simple_input_section to that of
9231 Output_section::Input_section.
9232 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9233 except for the first pass.
9234 * output.cc (Output_section::get_input_sections): Change type of
9235 input_sections to std::list<Input_section>.
9236 (Output_section::add_script_input_section): Rename from
9237 Output_section::add_simple_input_section. Change type of SIS
9238 parameter from Simple_input_section to Input_section.
9239 * output.h (Output_section::Simple_input_section): Remove class.
9240 (Output_section::Input_section): Change class visibility to public.
9241 (Output_section::Input_section::addralign): Use stored alignments
9242 for special input sections if set.
9243 (Output_section::Input_section::set_addralign): New method.
9244 (Output_section::get_input_sections): Change parameter type from
9245 list of Simple_input_section to list of Input_section.
9246 (Output_section::add_script_input_section): Rename from
9247 Output_section::add_simple_input_section. Change first parameter's
9248 type from Simple_input_section to Input_section and remove the
9249 second and third parameters.
9250 * script-sections.cc (Input_section::Input_section_list): Change
9251 type to list of Output_section::Input_section/
9252 (Input_section_info::Input_section_info): Change parameter type of
9253 INPUT_SECTION to Output_section::Input_section.
9254 (Input_section_info::input_section): Change return type.
9255 (Input_section_info::input_section_): Change type to
9256 Output_section::Input_section.
9257 (Output_section_element_input::set_section_addresses): Adjust code
9258 to use Output_section::Input_section instead of
9259 Output_section::Simple_input_section. Adjust code for renaming
9260 of Output_section::add_simple_input_section.
9261 (Orphan_output_section::set_section_addresses): Ditto.
9263 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9265 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9266 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9268 2010-05-18 Rafael Espindola <espindola@google.com>
9270 * options.cc (General_options::finalize): Handle -nostdlib.
9271 * options.h (nostdlib): New option.
9272 * script.cc (script_add_search_dir): Handle -nostdlib.
9274 2010-05-12 Doug Kwan <dougkwan@google.com>
9276 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9277 attributes section only if there no attributes section after merging.
9278 (Target_arm::merge_object_attributes): Move value of
9279 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
9280 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9281 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9282 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9283 and arm_attr_merge_7.stdout.
9284 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9285 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9286 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9287 arm_attr_merge_7b.o): New rules.
9288 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9290 * testsuite/Makefile.in: Regenerate.
9291 * testsuite/arm_attr_merge.sh: New file.
9292 * testsuite/arm_attr_merge_[67][ab].s: Same.
9294 2010-05-05 Nick Clifton <nickc@redhat.com>
9296 * po/es.po: Updated Spanish translation.
9298 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9300 * Makefile.am (install-exec-local): Properly install gold as
9301 default cross linker.
9302 * Makefile.in: Regenerated.
9304 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9305 Nick Clifton <nickc@redhat.com>
9307 * configure.ac (install_as_default): Define and set to false
9308 unless --enable-gold or --enable-gold=both/gold has been
9310 * configure: Regenerate.
9312 * Makefile.am (install-exec-local): Install the executable as
9313 'ld.gold'. If install_as_default is true then also install it as
9315 * Makefile.in: Regenerated.
9317 2010-04-24 Ian Lance Taylor <iant@google.com>
9319 * layout.cc (Layout::layout_reloc): In relocatable link don't
9320 combine reloc sections for grouped sections.
9322 2010-04-23 Sriraman Tallam <tmsriram@google.com>
9324 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9325 sections that are not ordinary to icf.
9326 * icf.cc (get_section_contents): Handle relocation pointing to section
9327 with no object or shndx information.
9328 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9329 * testsuite/Makefile.in: Regenerate.
9330 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9331 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9333 2010-04-22 Ian Lance Taylor <iant@google.com>
9335 * expression.cc (Expression::Expression_eval_info): Add
9336 result_alignment_pointer field.
9337 (Expression::eval_with_dot): Add result_alignment_pointer
9338 parameter. Change all callers.
9339 (Expression::eval_maybe_dot): Likewise.
9340 (class Binary_expression): Add alignment_pointer parameter to
9341 left_value and right_value. Change all callers.
9342 (BINARY_EXPRESSION): Set result alignment.
9343 (class Trinary_expression): Add alignment_pointer parameter to
9344 arg2_value and arg3_value. Change all callers.
9345 (Trinary_cond::value): Set result alignment.
9346 (Max_expression::value, Min_expression::value): Likewise.
9347 (Align_expression::value): Likewise.
9348 * script-sections.cc (class Sections_element): Add dot_alignment
9349 parameter to set_section_addresses virtual function. Update
9351 (class Output_section_element): Likewise.
9352 (Script_sections::create_segments): Add dot_alignment parameter.
9354 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9355 (Script_sections::set_phdrs_clause_addresses): Likewise.
9356 * script-sections.h: Update declarations.
9357 * script.h: Update declarations.
9358 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9360 * testsuite/script_test_3.t: Set large alignment.
9361 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9362 segment has expected alignment.
9364 2010-04-22 Nick Clifton <nickc@redhat.com>
9366 * po/gold.pot: Updated by the Translation project.
9367 * po/vi.po: Updated Vietnamese translation.
9369 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9371 * testsuite/Makefile.am (check_PROGRAMS): Add
9372 icf_virtual_function_folding_test.
9373 * testsuite/Makefile.in: Regenerated.
9375 2010-04-15 Andrew Haley <aph@redhat.com>
9377 * options.h (merge_exidx_entries): New option.
9378 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9379 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9380 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9381 (Target_arm::merge_exidx_entries): New function.
9382 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9383 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9384 to Arm_exidx_fixup constructor.
9385 Add new arg, merge_exidx_entries.
9386 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9387 Arm_output_section::fix_exidx_coverage.
9389 2010-04-18 Sriraman Tallam <tmsriram@google.com>
9391 * icf.cc (get_section_contents): Check for preemptible functions.
9392 Ignore addend when appropriate.
9393 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9395 (add_from_relobj): Check for section folded.
9396 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9397 * symtab.h (should_add_dynsym_entry): Add new parameter.
9398 * target-reloc.h (scan_relocs): Check for section folded.
9399 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9400 Check reloc types for function pointers in shared objects.
9401 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9403 (icf_preemptible_functions_test): New test case.
9404 (icf_string_merge_test): New test case.
9405 * testsuite.Makefile.in: Regenerate.
9406 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9407 bar_glob. Refactor code.
9408 * testsuite/icf_preemptible_functions_test.cc: New file.
9409 * testsuite/icf_preemptible_functions_test.sh: New file.
9410 * testsuite/icf_string_merge_test.cc: New file.
9411 * testsuite/icf_string_merge_test.sh: New file.
9412 * testsuite/icf_virtual_function_folding_test.cc: New file.
9413 * testsuite/icf_virtual_function_folding_test.sh: New file.
9415 2010-04-14 Doug Kwan <dougkwan@google.com>
9417 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9418 for local symbol recounting if we remove a section due to ICF.
9419 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9420 there are no regular objects in input.
9422 2010-04-13 Doug Kwan <dougkwan@google.com>
9424 * arm.cc (Arm_input_section::set_final_data_size): Compute
9425 accurate final data size instead of using current data size.
9427 2010-04-09 Doug Kwan <dougkwan@google.com>
9429 * layout.cc (Layout::choose_output_section): Handle script section
9431 (Layout::make_output_section_for_script): Add section type parameter.
9432 Handle script section types.
9433 * layout.h (Layout::make_output_section_for_script): Add section
9435 * output.cc (Output_section::Output_section): Initialize data member
9437 (Output_section::do_reset_address_and_file_offset): Do not set address
9438 to 0 if section is a NOLOAD section.
9439 * output.h (Output_section::is_noload): New method.
9440 (Output_section::set_is_noload): Ditto.
9441 (Output_section::is_noload_): New data member.
9442 * script-c.h (Script_section_type): New enum type.
9443 (struct Parser_output_section_header): Add new file section_type.
9444 * script-sections.cc (Sections_element::output_section_name): Add
9445 parameter for returning script section type.
9446 (Output_section_definition::output_section_name): Ditto.
9447 (Output_section_definition::section_type)P; New method.
9448 (Output_section_definiton::script_section_type_name): Ditto.
9449 (Output_section_definition::script_section_type_): New data member.
9450 (Output_section_definition::Output_section_definition): Initialize
9451 data member Output_section_definition::script_section_type_.
9452 (Output_section_definition::create_sections): Pass script section type
9453 to Layout::make_output_section_for_script.
9454 (Output_section_definition::output_section_name): Return script
9455 section type to caller.
9456 (Output_section_definition::set_section_address): Do not advance
9457 dot value and load address if section type is NOLOAD. Set address
9458 of NOLOAD sections regardless of section flags.
9459 (Output_section_definition::print): Print section type if it is
9460 not SCRIPT_SECTION_TYPE_NONE.
9461 (Output_section_definition::section_type): New method.
9462 (Output_section_definition::script_section_type_name): Ditto.
9463 (Script_sections::output_section_name): Add new parameter
9464 PSECTION_TYPE for returning script section type. Pass it to
9465 section elements. Handle discard sections.
9466 (Sort_output_sections::operator()): Handle NOLOAD sections.
9467 * script-sections.h (Script_sections::Section_type): New enum type.
9468 (Script_sections::output_section_name): Add a new parameter for
9469 returning script section type.
9470 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9472 * yyscript.y (union): Add new field SECTION_TYPE.
9473 (COPY, DSECT, INFO, NOLOAD): New tokens.
9474 (opt_address_and_section_type): Change type to output_section_header.
9475 (section_type): New non-terminal
9476 (section_header): Handle section type.
9477 (opt_address_and_section_type): Return section type value.
9479 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9481 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9482 * testsuite/plugin_common_test_2.c (foo): Likewise.
9484 2010-04-08 Doug Kwan <dougkwan@google.com>
9486 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9488 * output.cc (Output_section::add_merge_input_section): Simplify
9489 code and return status of Output_merge_base::add_input_section.
9490 Update merge section map only if Output_merge_base::add_input_section
9493 2010-04-07 Doug Kwan <dougkwan@google.com>
9495 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9496 if section is marked as containing instructions but has no mapping
9498 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9499 correct section index.
9500 (Arm_relobj::find_linked_text_section): Ditto.
9502 2010-04-07 Cary Coutant <ccoutant@google.com>
9504 * archive.cc (include_member): Destroy Read_symbols_data object before
9506 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9507 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9508 (Read_symbols_data::~Read_symbols_data) New destructor.
9509 (Section_relocs::Section_relocs) New constructor.
9510 (Section_relocs::~Section_relocs) New destructor.
9511 (Read_relocs_data::Read_relocs_data) New constructor.
9512 (Read_relocs_data::~Read_relocs_data) New destructor.
9513 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9514 pointers to NULL after deleting.
9516 2010-04-07 Doug Kwan <dougkwan@google.com>
9518 * arm.cc: Replace "endianity" with "endianness" in comments.
9519 (Arm_exidx_cantunwind): Ditto.
9520 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9521 (Arm_relobj::merge_flags_and_attributes): New method.
9522 (Arm_relobj::merge_flags_and_attributes_): New data member.
9523 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9524 (Arm_relobj::scan_sections_for_stubs): Ditto.
9525 (Arm_relobj::do_read_symbols): Check to see if we really want to
9526 merge processor-specific flags and attributes. Exit early if
9527 an object is empty except for section names and the undefined symbol.
9528 (Target_arm::do_finalize_sections): Move check for ELF format to
9529 Arm_relobj::do_read_symbols. Merge processor specific flags and
9530 attributes from a regular object only when we have determined that
9531 it is aapropriate. Do not create an .ARM.attributes section in
9532 output if there is no regular input object.
9533 (Target_arm::merge_processor_specific_flags): Check
9534 --warn-mismatch before printing any error.
9535 (Target_arm::merge_object_attributes): Ditto.
9536 * gold.cc (queue_middle_tasks): Handle the case in which there is
9537 no regular object in input.
9538 * options.cc (General_options::parse_EB): New method.
9539 (General_options::parse_EL): Same.
9540 (General_options::General_options): Initialize endianness_.
9541 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9543 (General_options::Endianness): New enum.
9544 (General_options::endianness): New method.
9545 (General_options::endianness_): New data member.
9546 * parameters.cc (Parameters::set_options): Check target endianness.
9547 (Parameters::set_target_once): Ditto.
9548 (Parameters::check_target_endianness): New method.
9549 (parameters_force_valid_target): If either -EL or -EB is specified,
9550 use it to define endianness of default target.
9551 * parameters.h (Parameters::check_target_endianness): New method
9553 * target.h (class Target): Change "endianity" to "endianness"
9556 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9558 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9559 * configure: Regenerate.
9560 * Makefile.in: Regenerate.
9561 * testsuite/Makefile.in: Regenerate.
9563 2010-04-06 Cary Coutant <ccoutant@google.com>
9566 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9567 prevailing definitions of common symbols.
9568 * testsuite/plugin_test_6.sh: New test case.
9569 * testsuite/plugin_common_test_1.c: New test case.
9570 * testsuite/plugin_common_test_2.c: New test case.
9571 * testsuite/Makefile.am (plugin_test_6): New test case.
9572 * testsuite/Makefile.in: Regenerate.
9574 2010-04-06 Nick Clifton <nickc@redhat.com>
9576 * po/vi.po: New Vietnamese translation.
9578 2010-03-30 Doug Kwan <dougkwan@google.com>
9580 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9582 2010-03-25 Doug Kwan <dougkwan@google.com>
9584 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9585 to avoid a conversion warning on a 32-bit host.
9587 2010-03-24 Ian Lance Taylor <iant@google.com>
9589 * testsuite/script_test_3.t: Add a TLS segment.
9590 * testsuite/Makefile.am (check_PROGRAMS): Add
9591 tls_phdrs_script_test.
9592 (tls_phdrs_script_test_SOURCES): Define.
9593 (tls_phdrs_script_test_DEPENDENCIES): Define.
9594 (tls_phdrs_script_test_LDFLAGS): Define.
9595 (tls_phdrs_script_test_LDADD): Define.
9596 * testsuite/Makefile.in: Rebuild.
9598 2010-03-23 Cary Coutant <ccoutant@google.com>
9600 * fileread.cc (find_or_make_view): Fix comment.
9602 2010-03-23 Ian Lance Taylor <iant@google.com>
9604 * script-sections.cc (class Orphan_section_placement): Define
9605 PLACE_TLS and PLACE_TLS_BSS.
9606 (Orphan_section_placement::Orphan_section_placement): Initialize
9608 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9609 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9610 (tls_script_test_SOURCES): Define.
9611 (tls_script_test_DEPENDENCIES): Define.
9612 (tls_script_test_LDFLAGS): Define.
9613 (tls_script_test_LDADD): Define.
9614 * testsuite/Makefile.in: Rebuild.
9616 2010-03-22 Doug Kwan <dougkwan@google.com>
9618 * arm.cc (Arm_relocate_functions::abs8,
9619 Arm_relocate_functions::abs16): Use correct check for overflow
9620 specified in the ARM ELF specs.
9621 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9622 target of a BLX instruction specially.
9623 (Reloc_stub::stub_type_for_reloc): Ditto.
9624 (Relocate::relocate): Use symbolic names instead of numeric relocation
9625 codes to report error.
9626 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9628 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9629 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9630 thumb2_blx_out_of_range.stdout
9631 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9632 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9633 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9634 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9635 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9636 thumb2_blx_in_range, thumb2_blx_in_range.o,
9637 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9638 thumb2_blx_out_of_range.o): New rules.
9639 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9640 thumb2_blx_in_range and thumb2_blx_out_of_range.
9641 * testsuite/Makefile.in: Regenerate.
9642 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9643 * testsuite/thumb_blx_in_range.s: New file.
9644 * testsuite/thumb_blx_out_of_range.s: New file.
9646 2010-03-22 Rafael Espindola <espindola@google.com>
9648 * archive.cc (Should_include): Move to archive.h.
9649 (should_include_member): Make it a member of Archive.
9651 (Add_lib_group_symbols): New.
9652 * archive.h: Include options.h.
9653 (Archive_member): Moved from Archive.
9654 (Should_include): Moved from archive.cc.
9656 (Add_lib_group_symbols): New.
9657 * dynobj.cc (do_should_include_member): New.
9658 * dynobj.h (do_should_include_member): New.
9659 * gold.cc (queue_initial_tasks): Update call to queue.
9660 * main.cc (main): Print lib group stats.
9661 * object.cc (do_should_include_member): New.
9662 * object.h: Include archive.h.
9663 (Object::should_include_member): New.
9664 (Object::do_should_include_member): New.
9665 (Sized_relobj::do_should_include_member): New.
9666 * options.cc (General_options::parse_start_lib): New.
9667 (General_options::parse_end_lib): New.
9668 (Input_arguments::add_file): Handle lib groups.
9669 (Input_arguments::start_group): Check we are not in a lib.
9670 (Input_arguments::start_lib): New.
9671 (Input_arguments::end_lib): New.
9672 * options.h (General_options): Add start_lib and end_lib.
9673 (Input_argument::lib_): New.
9674 (Input_argument::lib): New.
9675 (Input_argument::is_lib): New.
9676 (Input_file_lib): New.
9677 (Input_arguments::in_lib_): New.
9678 (Input_arguments::in_lib): New.
9679 (Input_arguments::start_lib): New.
9680 (Input_arguments::end_lib_): New.
9681 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9682 in unused members as preempted.
9683 (Sized_pluginobj::do_should_include_member): New.
9684 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9685 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9687 (Read_symbols::do_whole_lib_group): New.
9688 (Read_symbols::do_lib_group): New.
9689 (Read_symbols::do_read_symbols): Handle lib groups.
9690 (Read_symbols::get_name): Handle lib groups.
9691 * readsyms.h (Read_symbols): Add an archive member pointer.
9692 (Read_symbols::do_whole_lib_group): New.
9693 (Read_symbols::do_lib_group): New.
9694 (Read_symbols::member_): New.
9695 * script.cc (read_input_script): Update call to queue_soon.
9697 2010-03-19 Doug Kwan <dougkwan@google.com>
9699 * arm.cc (Stub_table::Stub_table): Initialize new data members
9700 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9701 (Stub_table::add_reloc_stub): Assign stub offset and update
9702 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9703 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9705 (Stub_table::update_data_size_and_addralign): Use
9706 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9707 instead of going over all reloc stubs.
9708 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9709 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9710 Stringpool_template::offset_ to size of Stringpool_char.
9711 (Stringpool_template::new_key_offset): Remove code to initialize
9712 Stringpool_template::offset_.
9713 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9714 Stringpool_template::offset_ to zero.
9716 2010-03-15 Doug Kwan <dougkwan@google.com>
9718 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9720 (Stringpool_template::new_key_offset): New method.
9721 (Stringpool_template::add_string): Assign offsets when adding new
9723 (Stringpool_template::set_string_offsets): Do not set string offsets
9724 when not optimizing.
9725 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9727 (Chunked_vector::clear): Clear size_.
9728 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9729 (Chunked_vector::size): Return size_.
9730 (Chunked_vector::push_back): Use size_ to find insert position.
9731 (Chunked_vector::size_): New data member.
9732 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9733 (Stringpool_template::new_key_offset): New method declaration.
9734 (Stringpool_template::offset_): New data member.
9736 2010-03-15 Rafael Espindola <espindola@google.com>
9738 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9739 Add_symbols' constructor.
9740 * readsyms.h (Add_symbols): Remove the input_group member.
9742 2010-03-10 Ian Lance Taylor <iant@google.com>
9744 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9745 target to ask whether a reference to a symbol requires a stack
9747 * target.h (Target::is_call_to_non_split): New function.
9748 (Target::do_is_call_to_non_split): Declare virtual function.
9749 * target.cc: Include "symtab.h".
9750 (Target::do_is_call_to_non_split): New function.
9751 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9753 2010-03-10 Cary Coutant <ccoutant@google.com>
9755 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9756 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9757 (File_read::open[2]): Add whole_file_view_ to list of views.
9758 (File_read::make_view): Remove test of whole_file_view_.
9759 (File_read::find_or_make_view): Create whole_file_view_ if
9761 (File_read::clear_views): Replace bool parameter with enum;
9762 adjust all callers. Don't delete views with permanent data;
9763 do delete cached views and views from archives if
9764 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9765 if clearing the corresponding view.
9766 * fileread.h (File_read::Clear_views_mode): New enum.
9767 (File_read::View::is_permanent_view): New method.
9768 (File_read::clear_views): Replace bool parameter
9769 with enum; adjust all callers.
9770 * options.h (General_options): Change keep_files_mapped option;
9771 add map_whole_files.
9772 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9774 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9777 2010-03-10 David S. Miller <davem@davemloft.net>
9779 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9781 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9783 * icf.cc (get_section_contents): Add '@' marker after processing the
9786 2010-03-08 Doug Kwan <dougkwan@google.com>
9788 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9789 due to a conversion warning.
9790 (Arm_relobj::update_output_local_symbol_count): Check for local
9791 symbol with unset output index.
9793 2010-03-05 Ian Lance Taylor <iant@google.com>
9795 * options.h (class General_options): Add --spare-dynamic-tags.
9796 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9797 --spare-dynamic-tags.
9799 2010-03-05 Ian Lance Taylor <iant@google.com>
9801 * incremental.cc: Include "libiberty.h".
9803 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9805 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9806 function, is_info_ member.
9807 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9808 (Versions::Versions): Update caller.
9809 (Versions::define_base_version): Likewise.
9810 (Versions::add_def): Likewise.
9812 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9814 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9815 (Scan::possible_function_pointer_reloc): New function.
9816 (Scan::local_reloc_may_be_function_pointer): Change to call
9817 possible_function_pointer_reloc.
9818 (Scan::global_reloc_may_be_function_pointer): Ditto.
9819 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9820 relocations in ".data.rel.ro._ZTV" section.
9821 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9822 * testsuite/icf_safe_so_test.cc: Ditto.
9823 * testsuite/icf_safe_test.cc: Ditto.
9824 * testsuite/icf_safe_test.sh: Ditto.
9826 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9827 Ian Lance Taylor <iant@google.com>
9829 * target-reloc.h (relocate_section): Check the symbol table index
9830 for -1U before setting the local symbol index.
9831 (scan_relocatable_relocs): If copying the relocation, record that
9832 the local symbol is required.
9833 * object.h (Symbol_value::is_output_symtab_index_set): New
9835 (Symbol_value::may_be_discarded_from_output_symtab): New
9837 (Symbol_value::has_output_symtab_entry): New function.
9838 (Symbol_value::needs_output_symtab_entry): Remove.
9839 (Symbol_value::output_symtab_index): Make sure the symbol index is
9841 (Symbol_value::set_output_symtab_index): Make sure the symbol
9842 index is not set. Make sure the new index is valid.
9843 (Symbol_value::set_must_have_output_symtab_entry): New function.
9844 (Symbol_value::has_output_dynsym_entry): New function.
9845 (Symbol_value::set_output_dynsym_index): Make sure the new index
9847 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9848 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9849 local symbol if permitted.
9850 (Sized_relobj::do_finalize_local_symbols): Call
9851 is_output_symtab_index_set rather than needs_output_symtab_entry.
9852 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9853 rather than needs_output_symtab_entry. Call
9854 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9855 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9856 is_output_symtab_index_set rather than needs_output_symtab_entry.
9857 * testsuite/discard_locals_relocatable_test.c: New file.
9858 * testsuite/discard_locals_test.sh: Test -r.
9859 * testsuite/Makefile.am (check_DATA): Add
9860 discard_locals_relocatable_test1.syms,
9861 discard_local_relocatable_test2.syms.
9862 (MOSTLYCLEANFILES): Likewise. Also add
9863 discard_locals_relocatable_test1.lout and
9864 discard_locals_relocatable_test2.out.
9865 (discard_locals_relocatable_test1.syms): New target.
9866 (discard_locals_relocatable_test.o): New target.
9867 (discard_locals_relocatable_test1.out): New target.
9868 (discard_locals_relocatable_test2.syms): New target.
9869 (discard_locals_relocatable_test2.out): New target.
9870 (various): Add missing ../ld-new dependencies.
9871 * testsuite/Makefile.in: Rebuild.
9873 2010-03-03 Nick Clifton <nickc@redhat.com>
9875 * po/fi.po: New Finnish translation.
9877 2010-03-01 Doug Kwan <dougkwan@google.com>
9879 * layout.cc (Layout::Layout): Force section types of .init_array*,
9880 .preinit_array* and .fini_array* sections.
9881 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9882 Fix check of return value of std::string::find.().
9883 (Output_section::Input_section_sort_compare::operator()): Remove
9884 comment about .init_array.
9885 (Output_section::Input_section_sort_init_fini_compare::operator()):
9887 (Output_section::sort_attached_input_sections): Handle .init_array
9888 and .fini_array specially.
9889 * output.h (Output_section::Inut_section_sort_compare): Update
9891 (Output_section::Input_section_sort_init_fini_compare): New struct.
9893 2010-02-26 Doug Kwan <dougkwan@google.com>
9895 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9896 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9897 * testsuite/debug_msg.sh: Avoid matching source line number for
9898 use of global variable undef_int.
9900 2010-02-26 Doug Kwan <dougkwan@google.com>
9902 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9903 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9904 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9905 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9906 * options.cc (General_options::General_options): Initialize member
9908 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9909 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9910 and rm_no_fix_v4bx.stdout
9911 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9912 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9913 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9914 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9915 and arm_no_fix_v4bx.
9916 * Makefile.in: Regenerate.
9917 * testsuite/arm_fix_v4bx.s: New file.
9918 * testsuite/arm_fix_v4bx.sh: Ditto.
9920 2010-02-24 Doug Kwan <dougkwan@google.com>
9922 * arm.cc (Target_arm::got_section): Make the .got section the first
9923 non RELRO section in the data segment.
9924 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9925 suffixes of section names.
9927 2010-02-24 Doug Kwan <dougkwan@google.com>
9929 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9930 flags and attributes merging if an input file is a binary file.
9931 * fileread.cc (Input_file::open): Record format of original file.
9932 * fileread.h (Input_file::Format): New enum type.
9933 (Input_file::Input_file): Initialize data member format_.
9934 (Input_file::format): New method definition.
9935 (Input_file::format_):: New data member.
9937 2010-02-24 Doug Kwan <dougkwan@google.com>
9939 * arm.cc (Arm_output_data_got): New class.
9940 (ARM_TCB_SIZE): New constant
9941 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9942 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9943 If user uses a script with a SECTIONS clause, issue only a warning
9944 for a misplaced EXIDX input section. Otherwise, issue an error.
9945 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9947 (Target_arm::got_mode_index_entry): Handle static linking.
9948 (Target_arm::Scan::local): Ditto.
9949 (Target_arm::Scan::global): Ditto.
9950 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9951 all incorrectly implemented relocations.
9952 (Target_arm::fix_exidx_coverage): Pass layout to
9953 Arm_output_section::fix_exidx_coverage.
9954 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9955 from ".ARM.exidx." and ".ARM.extab.".
9957 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9959 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9960 section if it does not already exist.
9961 * attributes.cc (Attributes_section_data::Attributes_section_data):
9962 Don't crash if size is zero.
9964 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9965 Ian Lance Taylor <iant@google.com>
9967 * gold.cc (queue_middle_tasks): If no input files were opened,
9969 * workqueue.h (Task_function::Task_function): Assert that there is
9972 2010-02-22 Doug Kwan <dougkwan@google.com>
9974 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9975 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9976 types to avoid warnings due to different uint64_t implementations
9979 2010-02-21 Doug Kwan <dougkwan@google.com>
9981 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9982 handling of the maximum backward branch offset.
9983 (Arm_relocate_functions::thumb_branch_common): Ditto.
9984 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9985 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9986 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9987 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9988 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9989 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9990 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9991 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9992 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9993 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9994 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9995 thumb2_bl_out_of_range.o): New rules.
9996 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9997 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9998 thumb2_bl_out_of_range
9999 * testsuite/Makefile.in: Regenerate.
10000 * testsuite/arm_bl_in_range.s: New file.
10001 * testsuite/arm_bl_out_of_range.s: Ditto.
10002 * testsuite/arm_branch_in_range.sh: Ditto.
10003 * testsuite/arm_branch_range.t: Ditto.
10004 * testsuite/thumb2_branch_range.t: Ditto.
10005 * testsuite/thumb_bl_in_range.s: Ditto.
10006 * testsuite/thumb_bl_out_of_range.s: Ditto.
10007 * testsuite/thumb_branch_range.t: Ditto.
10009 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10011 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10012 Add reloc offset information.
10013 * icf.cc (get_section_contents): Change iterators to point to the new
10014 vectors. Add reloc offset information to the contents.
10015 * icf.h (Icf::Sections_reachable_info): New typedef.
10016 (Icf::Sections_reachable_list): New typedef.
10017 (Icf::Offset_info): New typedef.
10018 (Icf::Reloc_info): New struct typedef.
10019 (Icf::Reloc_info_list): New typedef.
10020 (Icf::symbol_reloc_list): Delete method.
10021 (Icf::addend_reloc_list): Delete method.
10022 (Icf::section_reloc_list): Delete method.
10023 (Icf::reloc_info_list): New method.
10024 (Icf::reloc_info_list_): New member.
10026 2010-02-19 Doug Kwan <dougkwan@google.com>
10028 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10029 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10030 * arm.cc (Arm_relocation_functions): New forward declaration.
10031 (Target_arm::Target_arm): Initialize new data members
10032 got_mod_index_offset_ and tls_base_symbol_defined_.
10033 (Target_arm::Relocate::relocate_tls): New method.
10034 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10035 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10037 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10038 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10039 (Target_arm::got_mod_index_offset_,
10040 Target_arm::tls_base_symbol_defined_): New data members.
10041 (Target_arm::Scan::local, Target::Scan::global,
10042 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10045 2010-02-18 Doug Kwan <dougkwan@google.com>
10047 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10048 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10049 text section as a parameter becuase some broken tools may not set
10050 the link in section header.
10051 (Target_arm::has_got_section): New method.
10052 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10053 without any mapping symbol as data only. Remove warning.
10054 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10055 link in its section header, try to discover the link by inspecting the
10056 REL31 relocation at the beginning of the section.
10057 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10059 (Target_arm::Scan::global): Treat any reference to the symbol
10060 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10062 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10064 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10065 (Scan::global_reloc_may_be_function_pointer): New function.
10066 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10067 (Scan::global_reloc_may_be_function_pointer): New function.
10068 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10069 (Scan::global_reloc_may_be_function_pointer): New function.
10070 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10071 (Scan::global_reloc_may_be_function_pointer): New function.
10072 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10073 (Scan::global_reloc_may_be_function_pointer): New function.
10074 (Scan::possible_function_pointer_reloc): New function.
10075 (Target_x86_64::can_check_for_function_pointers): New function.
10076 * gc.h (gc_process_relocs): Scan relocation types to determine if
10077 function pointers were taken for targets that support it.
10078 * icf.cc (Icf::find_identical_sections): Include functions for
10079 folding in safe ICF whose pointer is not taken.
10080 * icf.h (Secn_fptr_taken_set): New typedef.
10081 (fptr_section_id_): New member.
10082 (section_has_function_pointers): New function.
10083 (set_section_has_function_pointers): New function.
10084 (check_section_for_function_pointers): New function.
10085 * options.h: Fix comment for safe ICF option.
10086 * target.h (can_check_for_function_pointers): New function.
10087 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10088 Modify icf_safe_test for X86-64.
10089 * testsuite/Makefile.in: Regenerate.
10090 * testsuite/icf_safe_so_test.cc: New file.
10091 * testsuite/icf_safe_so_test.sh: New file.
10092 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10093 (main): Change to take pointer to function kept_func_3.
10094 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10095 folding is done correctly for X86-64.
10097 2010-02-12 David S. Miller <davem@davemloft.net>
10099 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10100 is_symbolless parameter.
10101 (Output_reloc<SHT_REL>::is_symbolless): New.
10102 (Output_reloc<SHT_REL>::is_symbolless_): New.
10103 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10104 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10105 (Output_reloc<SHT_RELA>::is_symbolless): New.
10106 (Output_data_reloc::add_global): Handle is_symbolless.
10107 (Output_data_reloc::add_global_relative): Likewise.
10108 (Output_data_reloc::add_local): Likewise.
10109 (Output_data_reloc::add_local_relative): Likewise.
10110 (Output_data_reloc::add_symbolless_global_addend): New.
10111 (Output_data_reloc::add_symbolless_local_addend): New.
10112 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10114 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10115 instead of ->is_relative_
10116 (Output_reloc::write): Likewise.
10117 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10118 (Output_reloc::write_rel): Simplify.
10120 * sparc.cc (Target_sparc::Scan::local): Use
10121 ->add_symbolless_local_addend as needed.
10122 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10123 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10124 based upon relocation offset.
10126 2010-02-11 Doug Kwan <dougkwan@google.com>
10128 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10129 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10130 beginning of function.
10131 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10132 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10133 parameter is_32bit in calls to should_apply_static_reloc.
10134 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10135 (check_DATA): Add arm_abs_global.stdout.
10136 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10137 arm_abs_global.stdout): New rules.
10138 (MOSTLLYCLEANFILES): Add arm_abs_global
10139 * Makefile.in: Regenerate.
10140 * testsuite/arm_abs_global.s: New file.
10141 * testsuite/arm_abs_global.sh: Ditto.
10142 * testsuite/arm_abs_lib.s: Ditto.
10144 2010-02-11 Ian Lance Taylor <iant@google.com>
10146 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10148 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10149 Allocate_commons_task first.
10150 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10151 task, rather than symtab_lock_.
10152 (Gc_process_relocs::~Gc_process_relocs): New function.
10153 (Gc_process_relocs::is_runnable): Check this_blocker_.
10154 (Gc_process_relocs::locks): Use next_blocker_ rather than
10156 (Scan_relocs::~Scan_relocs): New function.
10157 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10159 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10161 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10162 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10163 constructor accordingly.
10164 (class Gc_process_relocs): Likewise.
10165 (class Scan_relocs): Likewise.
10166 * common.h (class Allocate_commons_task): Remove symtab_lock_
10167 field, and corresponding constructor parameter.
10168 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10170 (Allocate_commons_task::locks): Likewise.
10172 2010-02-11 Ian Lance Taylor <iant@google.com>
10174 * gold-threads.h (class Once): Define.
10175 (class Initialize_lock): Rewrite as child of Once.
10176 * gold-threads.cc (class Once_initialize): Define.
10177 (once_pointer_control): New static variable.
10178 (once_pointer, once_arg): New static variables.
10179 (c_run_once): New static function.
10180 (Once::Once, Once::run_once, Once::internal_run): New functions.
10181 (class Initialize_lock_once): Remove.
10182 (initialize_lock_control): Remove.
10183 (initialize_lock_pointer): Remove.
10184 (initialize_lock_once): Remove.
10185 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10186 (Initialize_lock::initialize): Rewrite.
10187 (Initialize_lock::do_run_once): New function.
10188 * archive.cc (Archive::interpret_header): Only clear name if it is
10190 * fileread.cc: Include "gold-threads.h"
10191 (file_counts_lock): New static variable.
10192 (file_counts_initialize_lock): Likewise.
10193 (File_read::release): Only increment counts when using --stats.
10194 Use a lock around the increment.
10195 * parameters.cc (class Set_parameters_target_once): Define.
10196 (set_parameters_target_once): New static variable.
10197 (Parameters::Parameters): Move here from parameters.h.
10198 (Parameters::set_target): Rewrite.
10199 (Parameters::set_target_once): New function.
10200 (Parameters::clear_target): Move here and rewrite.
10201 * parameters.h (class Parameters): Update declarations. Add
10202 set_parameters_target_once_ field.
10203 (Parameters::Parameters): Move to parameters.cc.
10204 (Parameters::clear_target): Likewise.
10205 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10207 (Start_group::~Start_group): New function.
10208 (Start_group::is_runnable): New function.
10209 (Start_group::locks, Start_group::run): New functions.
10210 (Finish_group::run): Change saw_undefined to size_t.
10211 * readsyms.h (class Start_group): Define.
10212 (class Finish_group): Change saw_undefined_ field to size_t.
10213 (Finish_group::Finish_group): Remove saw_undefined and
10214 this_blocker parameters. Change all callers.
10215 (Finish_group::set_saw_undefined): New function.
10216 (Finish_group::set_blocker): New function.
10217 * symtab.h (class Symbol_table): Change saw_undefined to return
10218 size_t. Change saw_undefined_ field to size_t.
10219 * target-select.cc (Set_target_once::do_run_once): New function.
10220 (Target_selector::Target_selector): Initialize set_target_once_
10221 field. Don't initialize lock_ and initialize_lock_ fields.
10222 (Target_selector::instantiate_target): Rewrite.
10223 (Target_selector::set_target): New function.
10224 * target-select.h (class Set_target_once): Define.
10225 (class Target_selector): Update declarations. Make
10226 Set_target_once a friend. Remove lock_ and initialize_lock_
10227 fields. Add set_target_once_ field.
10229 2010-02-10 Ian Lance Taylor <iant@google.com>
10231 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10232 queueing any tasks.
10233 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10234 (queue_middle_tasks): Add all blockers before queueing any tasks.
10235 (queue_final_tasks): Likewise.
10236 * token.h (Task_token::add_blockers): New function.
10237 * object.h (Input_objects::number_of_relobjs): New function.
10239 2010-02-10 Ian Lance Taylor <iant@google.com>
10241 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10242 shared, not if not position independent.
10243 * x86_64.cc (Relocate::relocate_tls): Likewise.
10244 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10245 (tls_pie_pic_test): New target.
10246 * testsuite/Makefile.in: Rebuild.
10248 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10249 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10250 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10251 * testsuite/Makefile.in: Rebuild.
10253 2010-02-09 David S. Miller <davem@davemloft.net>
10255 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10256 R_SPARC_RELATIVE using ->add_local_relative().
10257 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10259 * output.h (Output_data_dynamic::add_section_size): New method
10260 that takes two Output_data objects.
10261 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10262 entry param. Handle it in initializers.
10263 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10264 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10265 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10267 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10268 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10269 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10270 for dynrel_includes_plt.
10271 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10272 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10273 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10275 (Target_sparc::do_finalize_sections): Update to pass true for
10276 dynrel_includes_plt.
10277 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10278 output before .rela.plt
10279 (Target_powerpc::do_finalize_sections): Update to pass true for
10280 dynrel_includes_plt when 32-bit.
10282 2010-02-08 Doug Kwan <dougkwan@google.com>
10284 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10286 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10287 Arm_relobj::scan_section_for_cortex_a8_stubs,
10288 Arm_relobj::do_relocation_section): Instead of calling
10289 Output_section::output_address, use faster
10290 Arm_relobj::simple_input_section_output_address.
10292 2010-02-08 David S. Miller <davem@davemloft.net>
10294 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10295 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10296 relocation helper function.
10298 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10299 just like R_SPARC_GOT{10,13,22}.
10300 (Target_sparc::Scan::local): Likewise.
10301 (Target_sparc::Relocate:relocate): Likewise.
10303 2010-02-06 Ian Lance Taylor <iant@google.com>
10305 * configure.ac: Rewrite targetobjs duplicate removal code to use
10306 only shell constructs.
10307 * configure: Rebuild.
10309 2010-02-05 Doug Kwan <dougkwan@google.com>
10312 * arm.cc (Arm_relobj::section_is_scannable): New method.
10313 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10314 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10316 2010-02-04 Doug Kwan <dougkwan@google.com>
10319 * arm-reloc-property.cc (cstdio): Include.
10320 * configure.ac (targetobjs): Remove duplicates.
10321 * configure: Regenerate.
10322 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10323 big and little endian version for a given address size.
10325 2010-02-03 Doug Kwan <dougkwan@google.com>
10327 * arm-reloc-property.cc
10328 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10330 * arm-reloc-property.h
10331 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10332 New method definition.
10333 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10335 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10337 (GOT_PREL): Change implemented to Y.
10338 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10339 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10340 (Arm_relocate_functions::movw_abs_nc): Remove method.
10341 (Arm_relocate_functions::movt_abs): Ditto.
10342 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10343 (Arm_relocate_functions::thm_movt_abs): Ditto.
10344 (Arm_relocate_functions::movw_rel_nc): Ditto.
10345 (Arm_relocate_functions::movw_rel): Ditto.
10346 (Arm_relocate_functions::movt_rel): Ditto.
10347 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10348 (Arm_relocate_functions:thm_movw_rel): Ditto.
10349 (Arm_relocate_functions:thm_movt_rel): Ditto.
10350 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10351 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10352 New method definitions.
10353 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10354 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10355 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10356 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10357 (Target_arm::Relocate::relocate): Check for non-static or
10358 unimplemented relocation code and exit early. Change calls to
10359 Target_arm::reloc_uses_thumb_bit and
10360 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10361 instead. Refactor code to handle similar relocations to increase
10362 code sharing. Remove check for unsupported relocation code in switch
10364 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10365 relocation property table to find out size. Change error message to
10366 print out the name of a relocation code instead of the numeric value.
10367 (Target_arm::scan_reloc_for_stub): Use relocation property table
10368 instead of calling Target_arm::reloc_uses_thumb_bit().
10370 2010-02-02 Doug Kwan <dougkwan@google.com>
10372 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10373 types of relaxed input section.
10375 2010-02-02 Doug Kwan <dougkwan@google.com>
10377 * Makefile.am (HFILES): Add arm-reloc-property.h.
10379 (TARGETSOURCES): Add arm-reloc-property.cc
10380 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
10381 (libgold_a_SOURCES): $(DEFFILES)
10382 * Makefile.in: Regenerate.
10383 * arm-reloc-property.cc: New file.
10384 * arm-reloc-property.h: New file.
10385 * arm-reloc.def: New file.
10386 * arm.cc: Update comments.
10387 (arm-reloc-property.h): New included header.
10388 (arm_reloc_property_table): New global variable.
10389 (Target_arm::do_select_as_default_target): New method definition.
10390 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10391 arm-reloc-property to targ_extra_obj.
10392 * parameters.cc (set_parameters_target): Call
10393 Target::select_as_default_target().
10394 * target.h (Target::select_as_default_target): New method definition.
10395 (Target::do_select_as_default_target): Same.
10397 2010-02-01 Doug Kwan <dougkwan@google.com>
10399 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10400 first_output_text_section_.
10401 (Arm_exidx_fixup::first_output_text_section): New method definition.
10402 (Arm_exidx_fixup::first_output_text_section_): New data member.
10403 (Arm_exidx_fixup::process_exidx_section): Record the first text
10404 output section seen.
10405 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10406 and entsize in output section header.
10408 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10410 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10411 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10412 (Arm_relocate_functions::thm_alu11): New Method.
10413 (Arm_relocate_functions::thm_pc8): New Method.
10414 (Arm_relocate_functions::thm_pc12): New Method.
10415 (Target_arm::Scan::local): Handle the relocations.
10416 (Target_arm::Scan::global): Likewise.
10417 (Target_arm::Relocate::relocate): Likewise.
10418 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10420 2010-01-29 Doug Kwan <dougkwan@google.com>
10422 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10423 of relocation types as ld.
10425 2010-01-29 Doug Kwan <dougkwan@google.com>
10427 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10429 (Arm_relocate_functions::thumb_branch_common): Ditto.
10430 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10431 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10432 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10433 Arm_relocate_functions::jump24): Remove.
10434 (Target_arm::Relocate::relocate): Adjust code to call
10435 Arm_relocation_functions::arm_branch_common and
10436 Arm_relocation_functions::thumb_branch_common instead of their removed
10437 wrappers. Merge switch-cases together to reduce source code size.
10439 2010-01-29 Doug Kwan <dougkwan@google.com>
10441 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10442 output_local_symbol_count_needs_update_.
10443 (Arm_relobj::output_local_symbol_count_needs_update,
10444 Arm_relobj::set_output_local_symbol_count_needs_update,
10445 Arm_relobj::update_output_local_symbol_count): New methods.
10446 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10448 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10449 of pointed function as in a R_ARM_PREL31 relocation.
10450 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10451 for output local symbol count updating.
10452 (Target_arm::do_relax): Update output local symbol counts in objects
10454 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10456 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10458 * arm.cc: Added support for the ARM relocations:
10459 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10460 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10461 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10463 (Arm_relocate_functions::movw_rel): New method.
10464 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10465 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10467 (Arm_relocate_functions::thm_movw_rel): New method.
10468 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10470 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10472 (Target_arm::Scan::global): Likewise.
10473 (Target_arm::Relocate::relocate): Likewise.
10474 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10477 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10479 * arm.cc: Added support for ARM group relocations.
10480 (Target_arm::reloc_needs_sym_origin): New method.
10481 (Arm_relocate_functions::calc_grp_kn): New method.
10482 (Arm_relocate_functions::calc_grp_residual): New method.
10483 (Arm_relocate_functions::calc_grp_gn): New method.
10484 (Arm_relocate_functions::arm_grp_alu): New Method.
10485 (Arm_relocate_functions::arm_grp_ldr): New Method.
10486 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10487 (Arm_relocate_functions::arm_grp_ldc): New Method.
10488 (Target_arm::Scan::local): Handle the ARM group relocations.
10489 (Target_arm::Scan::global): Likewise.
10490 (Target_arm::Relocate::relocate): Likewise.
10491 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10494 2010-01-26 Doug Kwan <dougkwan@google.com>
10496 * arm.cc (set): Include.
10497 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10499 (Arm_output_section::Text_section_list): New type.
10500 (Arm_output_section::append_text_sections_to_list): New method.
10501 (Arm_output_section::fix_exidx_coverage): Ditto.
10502 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10503 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10504 Relobj::set_section_offset() instead of
10505 Sized_relobj::invalidate_section_offset().
10506 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10507 parameter for section headers. Ignore relocation sections for
10508 unallocated sections and EXIDX sections.
10509 (Target_arm::fix_exidx_coverage): New method.
10510 (Target_arm::output_section_address_less_than): New type.
10511 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10512 linked text section instead of the EXIDX section.
10513 (Arm_output_section::create_stub_group): Add an assertion to check
10514 that this is not an EXIDX output section.
10515 (Arm_output_section::append_text_sections_to_list): New method.
10516 (Arm_output_section::fix_exidx_coverage): Ditto.
10517 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10518 Arm_relobj::section_needs_reloc_stub_scanning.
10519 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10521 (Target_arm::fix_exidx_coverage): New method.
10522 * object.h (Relobj::set_output_section): New method.
10523 (Sized_relobj::invalidate_section_offset): Remove method.
10524 (Sized_relobj::do_invalidate_section_offset): Remove method.
10525 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10527 2010-01-25 Doug Kwan <dougkwan@google.com>
10529 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10530 Fix warning due to signed and unsigned comparison on a 32-bit host.
10532 2010-01-22 Doug Kwan <dougkwan@google.com>
10534 * arm.cc (Target_arm::do_relax): Record an output section for section
10535 offset adjustment it contains any stub table that has changed.
10536 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10537 offsets in an output section if necessary.
10538 * output.cc (Output_section::Output_section): Initialize
10539 section_offsets_need_adjustments_.
10540 (Output_section::add_input_section_for_script): Renamed to
10541 Output_section::add_simple_input_section.
10542 (Output_section::save_states): Add a comment.
10543 (Output_section::discard_states): New method defintion.
10544 (Output_section::adjust_section_offsets): Same.
10545 * output.h (Output_section::add_input_section_for_script): Renamed to
10546 Output_section::add_simple_input_section.
10547 (Output_section::discard_states): New method declaration.
10548 (Output_section::adjust_section_offsets): Same.
10549 (Output_section::section_offsets_need_adjustment,
10550 Output_section::set_section_offsets_need_adjustment): New method
10552 (Output_section::section_offsets_need_adjustment_): New data member.
10553 * script-sections.cc
10554 (Output_section_element_input::set_section_address): Adjust code for
10555 renaming of Output_section::add_input_section_for_script.
10556 (Orphan_output_section::set_section_address): Same.
10558 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10560 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10561 Fix_v4bx enum values .
10562 * gold/options.h (General_options): New option definitions.
10563 (General_options::fix_v4bx): New method.
10564 (General_options::Fix_v4bx): New enum.
10565 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10566 (General_options::parse_fix_v4bx_interworking): New method.
10568 2010-01-22 Doug Kwan <dougkwan@google.com>
10570 * arm.cc (Arm_exidx_fixup): New class.
10572 2010-01-21 Doug Kwan <dougkwan@google.com>
10574 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10576 (Arm_exidx_section_offset_map): New type.
10578 2010-01-21 Doug Kwan <dougkwan@google.com>
10580 * arm.cc (Arm_exidx_input_section): New class.
10581 (Arm_relobj::exidx_input_section_by_link,
10582 Arm_relobj::exidx_input_section_by_shndx,
10583 Arm_relobj::make_exidx_input_section): New methods.
10584 (read_arm_attributes_section): Remove.
10585 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10586 information about them.
10587 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10590 2010-01-20 Doug Kwan <dougkwan@google.com>
10592 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10593 Input_section_specifier to Section_id.
10594 (Target_arm::new_arm_input_section: Adjust code for change of key
10596 (Target_arm::find_arm_input_section): Ditto.
10597 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10598 (Section_id): Remove.
10599 (Garbage_collection::Section_id_hash): Remove.
10600 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10601 (Section_id): Remove.
10602 (Icf::Section_id_hash): Remove.
10603 * object.h (Section_id, Const_section_id, Section_id_hash,
10604 Const_section_id_hash): New type definitions.
10605 * output.cc (Output_section::add_relaxed_input_section): Change to
10606 use Const_section_id instead of Input_section_specifier as key type.
10607 (Output_section::add_merge_input_section): Ditto.
10608 (Output_section::build_relaxation_map): Change to use Section_id
10609 instead of Input_section_specifier as key type.
10610 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10612 (Output_section::convert_input_sections_to_relaxed_sections): Change
10613 to use Const_section_id instead of Input_section_specifier as key type.
10614 (Output_section::find_merge_section): Ditto.
10615 (Output_section::find_relaxed_input_section): Ditto.
10616 * output.h (Input_section_specifier): Remove class.
10617 (Output_section::Output_section_data_by_input_section_map): Change
10618 key type to Const_section_id.
10619 (Output_section::Output_relaxed_input_section_by_input_section_map):
10621 (Output_section::Relaxation_map): Change key type to Section_id.
10623 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10625 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10626 (class Arm_v4bx_stub): New class.
10627 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10628 (Stub_factory::make_arm_v4bx_stub): New method.
10629 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10630 (Stub_table::empty): Handle v4bx stubs.
10631 (Stub_table::add_arm_v4bx_stub): New method.
10632 (Stub_table::find_arm_v4bx_stub): New method.
10633 (Arm_relocate_functions::v4bx): New method.
10634 (Target_arm::fix_v4bx): New method.
10635 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10636 (Stub_table::relocate_stubs): Likewise.
10637 (Stub_table::do_write): Likewise.
10638 (Stub_table::update_data_size_and_addralign): Likewise.
10639 (Stub_table::finalize_stubs): Likewise.
10640 (Target_arm::Scan::local): Likewise.
10641 (Target_arm::Scan::global): Likewise.
10642 (Target_arm::do_finalize_sections): Likewise.
10643 (Target_arm::Relocate::relocate): Likewise.
10644 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10646 (Target_arm::scan_reloc_for_stub): Likewise.
10647 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10649 2010-01-19 Ian Lance Taylor <iant@google.com>
10651 * output.cc (Output_section_headers::do_sized_write): Write large
10652 segment count to sh_info field.
10653 (Output_file_header::do_sized_write): For large segment count,
10654 write PN_XNUM to e_phnum field.
10656 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10658 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10659 (Arm_relocate_functions::thm_jump8): New function.
10660 (Arm_relocate_functions::thm_jump11): New function.
10661 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10663 (Target_arm::Scan::global): Likewise.
10664 (Target_arm::Relocate::relocate): Likewise.
10665 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10668 2010-01-14 Doug Kwan <dougkwan@google.com>
10670 * arm.cc (map, utility): Include headers.
10671 (Target_arm::apply_cortex_a8_workaround): New method.
10672 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10673 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10674 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10675 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10676 the --[no-]fix-cortex-a8 command line options.
10677 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10678 (Target_arm::relocate_stub): Use addend in instruction template.
10679 * options.h (DEFINE_bool): Set the user-set flag.
10680 (General_options): Add --[no-]-fix-cortex options.
10681 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10682 : Update fast look-up map after conversion.
10684 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10686 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10687 in the first pass of do_layout.
10689 2010-01-13 Doug Kwan <dougkwan@google.com>
10691 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10692 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10693 apparent compiler problem of not folding static constant integral
10694 data members of elfcpp::Elf_sizes<32>.
10696 2010-01-13 Doug Kwan <dougkwan@google.com>
10698 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10699 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10700 Arm_relobj::scan_section_for_cortex_a8_erratum,
10701 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10702 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10703 sections to scan for relocation stubs into a new method
10704 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10705 relocation and Cortex-A8 stub scanning.
10706 (Target_arm::do_relax): Force stubs to be after stubbed sections
10707 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10708 the beginning of a new relaxation pass. Update a comment.
10709 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10711 2010-01-12 Ian Lance Taylor <iant@google.com>
10713 * target-reloc.h (visibility_error): New inline function.
10714 (relocate_section): Call visibility_error.
10715 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10716 (MOSTLYCLEANFILES): Likewise.
10717 (protected_4_pic.o, protected_3.err): New targets.
10718 * testsuite/protected_4.cc: New file.
10720 2010-01-12 Doug Kwan <dougkwan@google.com>
10722 * arm.cc (Cortex_a8_reloc): New class.
10723 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10724 and cortex_a8_relocs_info_.
10725 (Target_arm::fix_cortex_a8): New method definition.
10726 (Target_arm::Cortex_a8_relocs_info): New type.
10727 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10728 New data member declarations.
10729 (Target_arm::scan_reloc_for_stub): Record information about
10730 relocations for THUMB branches that might be exempted from the
10731 Cortex-A8 workaround.
10732 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10733 at the beginning of a relaxation pass.
10735 2010-01-12 Doug Kwan <dougkwan@google.com>
10737 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10738 (Arm_relobj::Mapping_symbol_position,
10739 Arm_reloj::Mapping_symbol_position_less,
10740 Arm_relobj::Mapping_symbols_info): New types.
10741 (Target_arm::is_mapping_symbol_name): New method definition.
10742 (Arm_relobj::do_count_local_symbols): Save information about mapping
10745 2010-01-11 Doug Kwan <dougkwan@google.com>
10747 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10748 Arm_relocate_functions::thumb32_branch_upper,
10749 Arm_relocate_functions::thumb32_branch_lower,
10750 Arm_relocate_functions::thumb32_cond_branch_offset,
10751 Arm_relocate_functions::thumb32_cond_branch_upper,
10752 Arm_relocate_functions::thumb32_cond_branch_lower,
10753 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10754 branch offset encoding.
10755 (Arm_relocate_functions::thumb_branch_common): Use new branch
10756 offset encoding methods to avoid code duplication.
10757 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10758 (Stub_addend_reader::operator()): Use new branch encoding method
10759 to avoid code duplication.
10761 2010-01-11 Doug Kwan <dougkwan@google.com>
10763 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10764 (Target_arm::do_finalize_sections): Define special EXIDX section
10765 symbols only if referenced.
10766 * gc.h (Garbage_collection::add_reference): New method.
10767 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10770 2010-01-11 Ian Lance Taylor <iant@google.com>
10772 * script.cc (Version_script_info::build_expression_list_lookup):
10773 Change complaing about duplicate wildcard match from error to
10776 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10778 (Version_script_info::Version_script_info): Initialize globs_,
10779 default_version_, default_is_global_, and exact_. Don't
10780 initialize globals_ or locals_.
10781 (Version_script_info::build_lookup_tables): Build local symbols
10783 (Version_script_info::unquote): New function.
10784 (Version_script_info::add_exact_match): New function.
10785 (Version_script_info::build_expression_list_lookup): Remove lookup
10786 parameter. Add is_global parameter. Change all callers. Handle
10787 wildcard pattern specially. Unquote pattern. Call
10789 (Version_script_info::get_name_to_match): New function.
10790 (Version_script_info::get_symbol_version): New function.
10791 (Version_script_info::get_symbol_version_helper): Remove.
10792 (Version_script_info::check_unmatched_names): Call unquote.
10793 * script.h (class Version_script_info): Change get_symbol_version
10794 to be non-inline and add is_global parameter; change all callers.
10795 Rewrite symbol_is_local. Update declarations. Define struct
10796 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10797 Remove globals_ and locals_ members. Add exact_, globs_,
10798 default_version_, is_global_.
10799 (Version_script_info::Glob): Remove pattern, add expression and
10800 is_global. Update constructor. Change all callers.
10801 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10803 (Versions::symbol_section_contents): If a symbol is undefined, or
10804 defined in a dynamic object, set the version index to
10806 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10808 (Symbol_table::add_from_pluginobj): Likewise.
10809 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10811 2010-01-11 Doug Kwan <dougkwan@google.com>
10813 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10814 (incremental_dump_LDADD): Add linking option for libintl.
10815 * Makefile.in: Regenerate.
10817 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10820 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10822 * testsuite/Makefile.in: Regenerated.
10824 2010-01-10 Doug Kwan <dougkwan@google.com>
10826 * options.h (DEFINE_var): Use parentheses around argument varname__
10827 in macro body to avoid any unintended subsequent substitutions.
10829 2010-01-10 Ian Lance Taylor <iant@google.com>
10831 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10832 candidates before doing symbol resolution.
10834 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10835 ODR candidates if only one is weak.
10837 2010-01-08 Ian Lance Taylor <iant@google.com>
10839 * script.cc (Version_script_info::build_expression_list_lookup):
10840 Don't warn about ambiguous version, just record the ambiguity.
10841 (Version_script_info::get_symbol_version_helper): Give error if
10842 version is ambiguous.
10844 2010-01-08 Doug Kwan <dougkwan@google.com>
10846 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10847 prev_data_size_ and prev_addralign_. Remove initializer for
10848 deleted data member has_been_changed_.
10849 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10850 to determine if the table is empty.
10851 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10853 (Stub_table::add_reloc_stub): Define method in class definition
10854 instead of just declaring it there.
10855 (Stub_table::add_cortex_a8_stub): New method definition.
10856 (Stub_table::update_data_size_and_addralign): Ditto.
10857 (Stub_table::finalize_stubs): Ditto.
10858 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10859 (Stub_table::do_addralign_): Return address alignment in the
10860 (Stub_table::do_reset_address_and_file_offset): Define method in
10861 class definition instead of declaring it there. Set current data
10862 size to be the data size of the previous pass.
10863 (Stub_table::set_final_data_size): Use current data size as the
10865 (Stub_table::relocate_stub): Change parameter type of stub from
10866 Reloc_stub pointer to Stub pointer.
10867 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10868 (Stub_table::Cortex_a8_stub_list): New typedef.
10869 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10870 Stub_table::prev_addralign_): New data member.
10871 (Arm_relobj::Arm_relobj): Initialize data member
10872 section_has_cortex_a8_workaround_.
10873 (Arm_relobj::section_has_cortex_a8_workaround,
10874 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10876 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10878 (Target_arm::relocate_stub): Change parameter type of stub from
10879 Reloc_stub pointer to Stub pointer.
10880 (Insn_template::size, Insn_template::alignment): Handle
10881 THUMB16_SPECIAL_TYPE.
10882 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10883 Stub_table::update_data_size_and_addralign,
10884 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10886 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10887 (Stub_table::do_write): Ditto.
10888 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10890 2010-01-08 Ian Lance Taylor <iant@google.com>
10893 * symtab.h (class Symbol): Remove fields is_target_special_ and
10894 has_plt_offset_. Add field is_defined_in_discarded_section_.
10895 (Symbol::is_defined_in_discarded_section): New function.
10896 (Symbol::set_is_defined_in_discarded_section): New function.
10897 (Symbol::has_plt_offset): Rewrite.
10898 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10899 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10900 Don't initialize is_target_special_ or has_plt_offset_.
10901 Initialize is_defined_in_discarded_section_.
10902 (Symbol_table::add_from_relobj): If appropriate, set
10903 is_defined_in_discarded_section.
10904 * resolve.cc (Symbol::override_base_with_special): Don't test
10905 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10906 * target-reloc.h (relocate_section): Do special handling for
10907 symbols defined in discarded sections for global symbols as well
10910 2010-01-08 Ian Lance Taylor <iant@google.com>
10912 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10913 the SHT_SYMTAB case.
10915 2010-01-08 Ian Lance Taylor <iant@google.com>
10917 * object.cc (Sized_relobj::do_layout): Don't get confused if
10918 layout_eh_frame returns NULL.
10920 2010-01-08 Ian Lance Taylor <iant@google.com>
10923 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10924 dynamic symbol table, use the normal symbol table.
10925 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10928 2010-01-08 Ian Lance Taylor <iant@google.com>
10931 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10934 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10936 * version.cc (print_version): Change to "Copyright 2010".
10938 2010-01-08 Ian Lance Taylor <iant@google.com>
10942 * i386.cc (class Target_i386): Change return type of plt_section
10944 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10945 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10946 tls_desc_rel_ field.
10947 (Output_data_plt_i386::rel_tls_desc): New function.
10948 (Target_i386::rel_tls_desc_section): New function.
10949 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10950 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10951 R_386_TLS_DESC reloc in rel_tls_desc_section.
10952 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10953 Define struct Tlsdesc_info.
10954 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10955 (Target_x86_64::do_reloc_symbol_index): New function.
10956 (Target_x86_64::add_tlsdesc_info): New function.
10957 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10958 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10959 tlsdesc_rel_ field.
10960 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10962 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10963 (Target_x86_64::rela_tlsdesc_section): New function.
10964 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10966 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10967 (Target_x86_64::do_reloc_addend): New function.
10968 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10969 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10970 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10971 (Output_reloc::type): New function.
10972 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10973 (Output_reloc::is_target_specific): New function.
10974 (Output_reloc::target_arg): New function.
10975 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10976 absolute relocs and target specific relocs.
10977 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10978 add_target_specific.
10979 (class Output_data_reloc) [SHT_RELA]: Likewise.
10980 * output.cc (Output_reloc::Output_reloc): Add four new versions
10981 for absolute relocs and target specific relocs.
10982 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10983 (Output_reloc::get_symbol_index): Likewise.
10984 (Output_reloc::local_section_offset): Check that local_sym_index_
10985 is not TARGET_CODE or 0.
10986 (Output_reloc::symbol_value): Likewise.
10987 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10989 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10990 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10992 * layout.cc (add_target_dynamic_tags): Use output section for
10993 DT_PLTRELSZ and DT_JMPREL.
10995 2010-01-07 Ian Lance Taylor <iant@google.com>
10998 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11000 (class Output_data_reloc_generic): Define.
11001 (class Output_data_reloc_base): Change base class to
11002 Output_data_reloc_generic. Change add() method to call
11003 bump_relative_reloc_count for a relative reloc. Remove
11004 sort_relocs_ field.
11005 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11007 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11008 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11010 * layout.h (class Layout): Update declaration.
11012 2010-01-07 Ian Lance Taylor <iant@google.com>
11014 * output.h (class Output_data): Add const version of
11015 output_section and do_output_section.
11016 (class Output_section_data): Add const version of
11018 (class Output_section): Likewise.
11019 * layout.cc (Layout::add_target_dynamic_tags): New function.
11020 * layout.h (class Layout): Update declarations.
11021 * arm.cc (Target_arm::do_finalize_sections): Use
11022 add_target_dynamic_tags.
11023 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11024 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11025 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11026 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11028 2010-01-07 Ian Lance Taylor <iant@google.com>
11031 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11034 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11035 Ian Lance Taylor <iant@google.com>
11038 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11039 Xindex::read_symtab_xindex.
11041 2010-01-07 Doug Kwan <dougkwan@google.com>
11043 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11044 (Insn_template::thumb16_bcond_insn): New method declaration.
11045 (Insn_template): Fix spelling.
11046 (Stub::thumb16_special): New method declaration.
11047 (Stub::do_write): Define virtual method which was previously pure
11049 (Stub::do_thumb16_special): New method declaration.
11050 (Stub::do_fixed_endian_write): New template member.
11051 (Reloc_stub::do_write): Remove.
11052 (Reloc_stub::do_fixed_endian_write): Remove.
11053 (Cortex_a8_stub): New class definition.
11054 (Stub_factory::make_cortex_a8_stub): New method definition.
11055 (Stub_factory::Stub_factory): Add missing static storage class
11056 qualifier for elf32_arm_stub_a8_veneer_blx.
11058 2010-01-07 Ian Lance Taylor <iant@google.com>
11061 * options.h (class General_options): Add --warn-unresolved-symbols
11062 and --error-unresolved-symbols.
11063 * errors.cc (Errors::undefined_symbol): Implement
11064 --warn-unresolved-symbols.
11066 * options.h (class General_options): Add -z text and -z textoff.
11067 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11069 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11071 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11072 (Garbage_collection::cident_sections): New function.
11073 (Garbage_collection::add_cident_section): New function.
11074 (Garbage_collection::cident_sections_): New member.
11075 (gc_process_relocs): Add references to sections whose names are C
11077 * gold.h (cident_section_start_prefix): New constant.
11078 (cident_section_stop_prefix): New constant.
11079 (is_cident): New function.
11080 * layout.cc (Layout::define_section_symbols): Replace string constants
11081 with the newly defined constants.
11082 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11084 * testsuite/Makefile.am: Add gc_orphan_section_test.
11085 * testsuite/Makefile.in: Regenerate.
11086 * testsuite/gc_orphan_section_test.cc: New file.
11087 * testsuite/gc_orphan_section_test.sh: New file.
11089 2010-01-06 Ian Lance Taylor <iant@google.com>
11092 * options.h (class General_options): Add --warn-shared-textrel.
11093 * layout.cc (Layout::finish_dynamic_section): Implement
11094 --warn-shared-textrel.
11097 * options.h (class General_options): Add --warn-multiple-gp.
11099 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11101 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11102 $(THREADSLIB) and $(LIBDL).
11103 * Makefile.in: Rebuild.
11105 2010-01-06 Ian Lance Taylor <iant@google.com>
11108 * options.cc (General_options::parse_section_start): New function.
11109 (General_options::section_start): New function.
11110 (General_options::General_options): Initialize all members.
11111 * options.h: Include <map>
11112 (class General_options): Add --section-start. Add section_starts_
11114 * layout.cc (Layout::attach_allocated_section_to_segment): If
11115 --section-start was used, set the address of the segment. Remove
11116 local sort_sections.
11117 (Layout::relaxation_loop_body): If the address of the load segment
11118 has been set by --section-start, don't use it.
11119 * output.h (Output_segment::update_flags_for_output_section): New
11121 * output.cc (Output_segment::add_output_section): Call
11122 update_flags_for_output_section.
11124 2010-01-05 Ian Lance Taylor <iant@google.com>
11127 * options.h (class General_options): Add --undefined-version.
11128 * script.cc (struct Version_expression): Add was_matched_by_symbol
11130 (Version_script_info::matched_symbol): New function.
11131 (Version_script_info::get_symbol_version_helper): Call
11133 (Version_script_info::check_unmatched_names): New function.
11134 * script.h (class Version_script_info): Update declarations.
11135 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11137 * options.h (class General_options): Use DEFINE_bool_alias for
11138 allow_multiple_definition.
11139 * resolve.cc (Symbol_table::should_override): Don't test
11140 allow_multiple_definition.
11143 * options.h (class General_options): Add --cref.
11144 * main.cc (main): Print cref table if --cref. Don't close mapfile
11145 until after printing cref table.
11146 * cref.cc: Include "symtab.h".
11147 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11148 (Cref_table_compare::operator()): New function.
11149 (Cref_inputs::gather_cref): New function.
11150 (filecol): New static const.
11151 (Cref_inputs::print_cref): New function.
11152 (Cref::print_cref): New function.
11153 * cref.h: Include <cstdio>.
11154 (class Cref): Update declarations.
11155 * mapfile.h (Mapfile::file): New function.
11156 * object.h (class Object): Define Symbols. Declare virtual
11157 do_get_global_symbols.
11158 (Object::get_global_symbols): New function.
11159 * object.cc (Input_objects::add_object): Pass object to cref_ if
11161 (Input_objects::archive_start): Likewise.
11162 (Input_objects::archive_stop): Likewise.
11163 (Input_objects::print_cref): New function.
11164 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11165 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11167 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11169 * plugin.h (class Sized_pluginobj): Update declarations.
11171 2010-01-05 Ian Lance Taylor <iant@google.com>
11173 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11174 to is_default_version. Rename insdef to insdefault.
11175 (Symbol_table::add_from_relobj): Rename def to is_default_version
11176 and local to is_forced_local.
11177 (Symbol_table::add_from_pluginobj): Likewise.
11178 (Symbol_table::add_from_dynobj): Likewise.
11179 (Symbol_table::define_special_symbol): Rename insdef to
11182 2010-01-04 Ian Lance Taylor <iant@google.com>
11185 * options.h (class General_options): Add
11186 --allow-multiple-definition and -z muldefs.
11187 * resolve.cc (Symbol_table::should_override): Don't warn about a
11188 multiple symbol definition if --allow-multiple-definition or -z
11192 * options.h (class General_options): Add --add-needed and
11193 --copy-dt-needed-entries. Tweak --as-needed help entry.
11194 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11195 error if --copy-dt-needed-entries aka --add-needed is used and
11196 would cause a change in behaviour.
11199 * options.h (class General_options): Add -G as a short version of
11200 --shared. Add no-op options -assert, -g, and -i.
11202 2010-01-04 Sriraman Tallam <tmsriram@google.com>
11204 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11205 check for .text or .gnu.linkonce.t sections.
11206 * icf.cc (Icf::find_identical_sections): Ditto.
11207 Change the detection for mangled function name within the section
11209 * icf.h (is_section_foldable_candidate): New function.
11211 2009-12-30 Ian Lance Taylor <iant@google.com>
11214 * options.h (class General_options): Permit two dashes with
11215 --retain-symbols-file.
11217 2009-12-30 Ian Lance Taylor <iant@google.com>
11220 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11221 don't put the file header and segment headers in the text
11225 * common.cc (Sort_commons::operator()): Stabilize sort when both
11227 (Symbol_table::do_allocate_commons_list): When allocating common
11228 symbols, skip a symbol which is no longer common.
11229 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11230 an object before checking its type.
11231 * testsuite/common_test_2.c: New file.
11232 * testsuite/common_test_3.c: New file.
11233 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11234 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11235 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11236 (common_test_2_pic.o, common_test_2.so): New targets.
11237 (common_test_3_pic.o, common_test_3.so): New targets.
11238 * testsuite/Makefile.in: Rebuild.
11241 * script.cc (read_input_script): If we see a new SECTIONS clause,
11242 and we have added an input section, give an error.
11243 * layout.h (class Layout): Add have_added_input_section function.
11244 Add have_added_input_section_ field.
11245 * layout.cc (Layout::Layout): Initialize
11246 have_added_input_section_.
11247 (Layout::layout): Set have_added_input_section_.
11248 (Layout::layout_eh_frame): Likewise.
11250 2009-12-30 Ian Lance Taylor <iant@google.com>
11253 * options.h (class General_options): Add --sort-common option.
11254 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11255 * common.cc (Sort_common): Add sort_order parameter to
11256 constructor. Add sort_order_ field.
11257 (Sort_commons::operator): Check sort_order_.
11258 (Symbol_table::allocate_commons): Determine the sort order.
11259 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11260 Change all callers.
11261 (Symbol_table::do_allocate_commons_list): Likewise.
11263 2009-12-30 Ian Lance Taylor <iant@google.com>
11266 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11267 symbols from this object, don't change the visibility of an
11269 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11271 2009-12-30 Ian Lance Taylor <iant@google.com>
11274 * script.h (class Version_script_info): Define Language enum.
11275 Update declarations. Define Glob, Exact, and Lookup types. Add
11276 new fields globals_, locals_, and is_finalized_.
11277 * script.cc: Various formatting fixes.
11278 (class Parser_closure): Change language_stack_ from a vector of
11279 std::string to one of Version_script_info::Language. Adjust all
11281 (class Lazy_demangler): Remove.
11282 (struct Version_expression): Change language from std::string to
11283 Version_script_info::Language.
11284 (Version_script_info::Version_script_info): New function.
11285 (Version_script_info::~Version_script_info): Don't call clear.
11286 (Version_script_info::finalize): New function.
11287 (Version_script_info::build_lookup_tables): New function.
11288 (Version_script_info::build_expression_list_lookup): New
11290 (Version_script_info::get_symbol_version_helper): Rewrite to use
11292 (Version_script_info::print_expression_list): Adjust to use
11293 Version_script_info::Language.
11294 (script_push_lex_into_version_mode): Check that the version script
11295 has not been finalized.
11296 (version_script_push_lang): Change language string to
11297 Version_script_info::Language.
11298 * options.cc (Command_line::version_script): New function.
11299 * options.h (class General_options): Add finalize_dynamic_list
11300 function. Change version_script from declaration to definition.
11301 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11302 * testsuite/version_script.map: Remove duplicate def of foo.
11303 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11304 version_script.map.
11305 * testsuite/Makefile.in: Rebuild.
11307 2009-12-30 Ian Lance Taylor <iant@google.com>
11310 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11311 if the input symbol index is 0, make the output symbol index 0.
11313 2009-12-30 Ian Lance Taylor <iant@google.com>
11316 * options.h (class General_options): Add -x/--discard-all.
11317 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11318 --discard-all. If the local symbol needs a dynamic entry, check
11319 that before handling --discard-locals.
11321 2009-12-30 Ian Lance Taylor <iant@google.com>
11324 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11326 (Output_segment::add_output_section): Don't change the flags if
11327 the type is PT_TLS.
11330 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11331 GNU hash table if they need a dynamic value. Otherwise, don't add
11332 them if they are defined in a dynamic object or are forced local.
11334 2009-12-29 Ian Lance Taylor <iant@google.com>
11337 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11338 .gnu.hash table for a 32-bit target.
11341 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11342 regular and a dynamic object only needs a dynamic symbol table
11343 entry if it is externally visible.
11346 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11347 constructor. Add global_offset_table_ field.
11348 (Target_i386::got_section): Set global_offset_table_.
11349 (Target_i386::do_finalize_sections): Set global_offset_table_
11351 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11352 in constructor. Add global_offset_table_ field.
11353 (Target_x86_64::got_section): Set global_offset_table_.
11354 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11357 * layout.cc (Layout::Layout): Initialize increase_relro_.
11358 (Layout::get_output_section): Add is_relro, is_last_relro, and
11359 is_first_non_relro parameters. Change all callers.
11360 (Layout::choose_output_section): Likewise.
11361 (Layout::add_output_section_data): Likewise.
11362 (Layout::make_output_section): Likewise.
11363 (Layout::set_segment_offsets): Clear increase_relro when using a
11365 * layout.h (class Layout): Add increase_relro method. Add
11366 increase_relro_ field. Update declarations.
11367 * output.cc (Output_section::Output_section): Initialize
11368 is_last_relro_ and is_first_non_relro_.
11369 (Output_segment::add_output_section): Group relro sections is
11370 do_sort is true. Handle is_last_relro and is_first_non_relro.
11371 (Output_segment::maximum_alignment): Remove relro handling.
11372 (Output_segment::set_section_addresses): Add increase_relro
11373 parameter. Change all callers. Add initial alignment to align
11374 relro sections on separate page. Remove old relro handling.
11375 (Output_segment::set_section_list_addresses): Remove in_relro
11376 parameter. Change all callers.
11377 (Output_segment::set_offset): Add increase parameter. Change all
11378 callers. Remove old relro handling.
11379 * output.h (class Output_section): Add new methods: is_last_relro,
11380 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11381 Add is_last_relro_ and is_first_non_relro_ fields.
11382 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11383 Create separate .got.plt section. Call increase_relro.
11384 * x86_64.cc (Target_x86_64::got_section): Likewise.
11385 * testsuite/relro_script_test.t: Add .got.plt.
11388 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11389 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11390 (Layout::finalize): Call set_dynamic_symbol_size.
11391 (Layout::set_dynamic_symbol_size): New function.
11392 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11393 set_dynamic_symbol_size.
11396 * output.h (class Output_section): Add is_entsize_zero_ field.
11397 * output.cc (Output_section::Output_section): Initialize
11399 (Output_section::set_entsize): If two different entsizes are
11400 requested, force it to zero.
11401 (Output_section::add_input_section): Set flags for .debug_str
11402 before updating section flags. Set entsize.
11403 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11404 and SHF_STRING if all input sections have those flags.
11406 2009-12-29 Rafael Espindola <espindola@google.com>
11408 * main.cc (main): Fix the sys time reporting.
11409 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11412 2009-12-29 Sriraman Tallam <tmsriram@google.com>
11414 * options.cc (General_options::parse_version): Allow -v to exit
11415 without an error if there is nothing to link.
11417 2009-12-29 Ian Lance Taylor <iant@google.com>
11419 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11420 using a version of gcc before 4.1.
11421 * configure: Rebuild.
11423 2009-12-28 Chris Demetriou <cgd@google.com>
11425 * attributes.cc (Output_attributes_section_data::do_write): Use
11426 std::vector::front rather than std::vector::data.
11428 2009-12-28 Ian Lance Taylor <iant@google.com>
11430 * symtab.h (class Symbol_table): Add enum Defined.
11431 * resolve.cc (Symbol_table::should_override): Add defined
11432 parameter. Change all callers. Test whether object is NULL
11433 before calling a method on it.
11434 (Symbol_table::report_resolve_problem): Add defined parameter.
11435 Change all callers.
11436 (Symbol_table::should_override_with_special): Likewise.
11437 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11438 parameter. Change all callers.
11439 (Symbol_table::do_define_in_output_data): Likewise.
11440 (Symbol_table::define_in_output_segment): Likewise.
11441 (Symbol_table::do_define_in_output_segment): Likewise.
11442 (Symbol_table::define_as_constant): Likewise.
11443 (Symbol_table::do_define_as_constant): Likewise.
11444 * script.h (class Symbol_assignment): Add is_defsym parameter to
11445 constructor; change all callers.
11446 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11447 parameter. Change all callers. Add is_defsym_ field.
11448 (class Parser_closure): Add parsing_defsym parameter to
11449 constructor; change all callers. Add parsing_defsym accessor
11450 function. Add parsing_defsym_ field.
11452 2009-12-28 Ian Lance Taylor <iant@google.com>
11454 * gold.cc (queue_middle_tasks): Fix formatting.
11455 * object.cc (Relobj::is_section_name_included): Likewise.
11457 2009-12-23 Ian Lance Taylor <iant@google.com>
11459 * i386.cc (Target_i386::do_calls_non_split): Recognize
11460 -fsplit-stack prologue for a function with a static chain.
11461 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11462 -fsplit-stack prologue when using %r11.
11464 2009-12-21 Sriraman Tallam <tmsriram@google.com>
11466 * options.cc (General_options::parse_version): Make -v continue and do
11467 the link like GNU ld does.
11469 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
11471 * Makefile.am (CCFILES): Add timer.cc.
11472 (HFILES): Add timer.h.
11473 * configure.ac: Check for sysconf and times.
11474 * main.cc: include timer.h.
11475 (main): Use Timer instead of get_run_time.
11478 * workqueue.cc: include timer.h.
11479 (Workqueue::find_and_run_task):
11480 Report user, sys and wall time.
11481 * Makefile.in: Regenerate.
11482 * config.in: Regenerate.
11483 * configure: Regenerate.
11485 2009-12-16 Doug Kwan <dougkwan@google.com>
11487 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11489 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11490 relaxed input sections.
11491 * output.cc (Output_section::find_relaxed_input_section): Change
11492 return type to Output_relaxed_input_section pointer. Adjust code
11493 for new type of relaxed_input_section_map_.
11494 * output.h (Output_section::find_relaxed_input_section): Change
11495 return type to Output_relaxed_input_section pointer.
11496 (Output_section::Output_relaxed_input_section_by_input_section_map):
11498 (Output_section::relaxed_input_section_map_): Change type to
11499 Output_section::Output_relaxed_input_section_by_input_section_map.
11500 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11503 2009-12-15 Ian Lance Taylor <iant@google.com>
11505 * layout.cc (Layout::create_shstrtab): Only write out after input
11506 sections if we are compressing debug sections.
11508 2009-12-15 Ian Lance Taylor <iant@google.com>
11510 * archive.cc (Archive::add_symbols): Only look up a symbol without
11511 a version if there is, in fact, a version.
11513 2009-12-14 Ian Lance Taylor <iant@google.com>
11515 Revert -Wshadow changes, all changes from:
11516 2009-12-11 Doug Kwan <dougkwan@google.com>
11517 2009-12-11 Nick Clifton <nickc@redhat.com>
11518 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11520 2009-12-11 Doug Kwan <dougkwan@google.com>
11522 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11524 * attributes.cc (Object_attribute::size): Ditto.
11525 (Attributes_section_data::size): Ditto.
11526 (Attributes_section_data::Attributes_section_data): Ditto.
11527 (Output_attributes_section_data::do_write): Ditto.
11528 * attributes.h (Object_attribute::set_type): Ditto.
11529 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11531 2009-12-11 Nick Clifton <nickc@redhat.com>
11533 * archive.cc: Fix shadowed variable warnings.
11534 * arm.cc: Likewise.
11535 * compressed_output.cc: Likewise.
11536 * compressed_output.h: Likewise.
11537 * configure: Likewise.
11538 * dwarf_reader.cc: Likewise.
11539 * dynobj.cc: Likewise.
11540 * dynobj.h: Likewise.
11541 * ehframe.cc: Likewise.
11542 * ehframe.h: Likewise.
11543 * errors.cc: Likewise.
11544 * expression.cc: Likewise.
11545 * fileread.cc: Likewise.
11546 * fileread.h: Likewise.
11547 * freebsd.h: Likewise.
11548 * i386.cc: Likewise.
11549 * icf.cc: Likewise.
11550 * incremental.h: Likewise.
11551 * layout.cc: Likewise.
11552 * layout.h: Likewise.
11553 * mapfile.cc: Likewise.
11554 * merge.cc: Likewise.
11555 * merge.h: Likewise.
11556 * object.cc: Likewise.
11557 * object.h: Likewise.
11558 * options.h: Likewise.
11559 * output.cc: Likewise.
11560 * output.h: Likewise.
11561 * parameters.cc: Likewise.
11562 * plugin.cc: Likewise.
11563 * powerpc.cc: Likewise.
11564 * reduced_debug_output.cc: Likewise.
11565 * reduced_debug_output.h: Likewise.
11566 * reloc.cc: Likewise.
11567 * reloc.h: Likewise.
11568 * resolve.cc: Likewise.
11569 * script-sections.cc: Likewise.
11570 * script.cc: Likewise.
11571 * script.h: Likewise.
11572 * sparc.cc: Likewise.
11573 * symtab.cc: Likewise.
11574 * symtab.h: Likewise.
11575 * target-select.cc: Likewise.
11576 * target-select.h: Likewise.
11577 * token.h: Likewise.
11578 * workqueue.cc: Likewise.
11579 * workqueue.h: Likewise.
11580 * x86_64.cc: Likewise.
11582 2009-12-10 Doug Kwan <dougkwan@google.com>
11584 * arm.cc (attributes.h): New include.
11585 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11586 (Arm_relobj::~Arm_relobj): Delete object pointed by
11587 attributes_section_data_.
11588 (Arm_relobj::attributes_section_data): New method definition.
11589 (Arm_relobj::attributes_section_data_): New data member declaration.
11590 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11591 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11592 attributes_section_data_.
11593 (Arm_dynobj::attributes_section_data): New method definition.
11594 (Arm_dynobj::attributes_section_data_): New data member declaration.
11595 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11596 initialization value of may_use_blx_ to false.
11597 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11598 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11599 object attributes to compute results instead of hard-coding.
11600 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11601 Target_arm::get_secondary_compatible_arch,
11602 Target_arm::set_secondary_compatible_arch
11603 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11604 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11605 New method declarations.
11606 (Target_arm::get_aeabi_object_attribute): New method definition.
11607 (Target_arm::attributes_section_data_): New data member declaration.
11608 (read_arm_attributes_section): New template definition.
11609 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11610 (Arm_dynobj::do_read_symbols): Ditto.
11611 (Target_arm::do_finalize_sections): Merge attributes sections from
11612 input. Check for BLX use after attributes section merging.
11613 Fix __exidx_start and __exidx_end visibility. Create an
11614 .ARM.attributes section if necessary.
11615 (Target_arm::get_secondary_compatible_arch,
11616 Target_arm::set_secondary_compatible_arch,
11617 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11618 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11619 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11620 New method definitions.
11622 2009-12-09 Ian Lance Taylor <iant@google.com>
11624 * plugin.cc (Plugin::load): Don't cast from void* to a function
11627 2009-12-09 Ian Lance Taylor <iant@google.com>
11629 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11630 information fields.
11632 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11634 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11635 Replace two_file_shared_1.so with two_file_shared_2.so.
11636 * testsuite/Makefile.in: Regenerated.
11638 2009-12-08 Doug Kwan <dougkwan@google.com>
11640 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11641 (HFILES): Add attributes.h and int_encoding.h.
11642 * Makefile.in: Regenerate.
11643 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11644 function definitions to int_encoding.cc
11645 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11646 prototypes to int_encoding.h
11647 * reduced_debug_output.cc (int_encoding.h): New include.
11648 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11649 function definitions to int_encoding.cc
11650 (insert_into_vector, read_from_pointer): Move template definitions to
11652 * attributes.cc: New file.
11653 * attributes.h: New file.
11654 * int_encoding.cc: New file.
11655 * int_encoding.h: New file.
11657 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11660 * incremental-dump.cc (dump_incremental_inputs): New.
11661 (main): Use dump_incremental_inputs.
11663 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11666 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11667 checking elfcpp::STT_FUNC.
11668 (Target_i386::Relocate::relocate): Likewise.
11669 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11671 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11672 symbols from shared libraries into normal FUNC symbols.
11674 * symtab.h (Symbol): Add is_func and use it.
11676 2009-12-05 Doug Kwan <dougkwan@google.com>
11678 * arm.cc (Target_arm::arm_info): Initialize new fields
11679 attributes_section and attributes_vendor.
11680 * i386.cc (Target_i386::i386_info): Same.
11681 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11682 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11683 fields attributes_section and attributes_vendor.
11684 * sparc.cc (Target_sparc::sparc_info): Same.
11685 * target.h (Target::attributes_section, Target::attributes_vendor,
11686 Target::is_attributes_section, Target::attribute_arg_type,
11687 Target::attributes_order): New method definitions.
11688 (Target::Target_info::attributes_section,
11689 Target::Target_info::attributes_vendor): New fields.
11690 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11691 virtual method definitions.
11692 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11693 attributes_section and attributes_vendor.
11694 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11696 2009-12-05 Doug Kwan <dougkwan@google.com>
11698 * arm.cc: Update comments about interworking and stub generation.
11699 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11700 considered as non-PIC.
11701 (Arm_relocate_functions::base_abs): Fix formatting.
11702 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11703 of function to use GOT entry address instead of offset.
11704 (Target_arm::Scan::global): Issue an error if a symbol would need a
11705 PLT does not get one because it is untyped. Remove code to create
11706 dynamic symbols for relative branches.
11707 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11708 takes unsigned integer instead of boolean.
11710 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11712 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11713 (two_file_test_LDADD): Likewise.
11714 (common_test_1_LDADD): Likewise.
11715 (exception_test_LDADD) Likewise.
11716 (weak_test_LDADD): Likewise.
11717 (many_sections_test_LDADD): Likewise.
11718 (initpri1_LDADD): Likewise.
11719 (script_test_1_LDADD): Likewise.
11720 (script_test_2_LDADD): Likewise.
11721 (justsyms_LDADD): Likewise.
11722 (binary_test_LDADD): Likewise.
11723 (large_LDADD): Likewise.
11724 * testsuite/Makefile.in: Regenerated.
11726 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11728 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11729 (Symbol_table::override_with_special): Likewise.
11730 (Symbol_table::add_from_object): Likewise.
11732 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11734 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11735 Don't set the data_offset twice.
11737 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11739 * testsuite/Makefile.in: Regenerate.
11741 2009-12-03 Doug Kwan <dougkwan@google.com>
11743 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11744 (Target_arm::do_finalize_sections): Add parameter for symbol table
11745 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11746 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11747 parameter for symbol table pointer.
11748 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11749 an additional parameter for a pointer to symbol table.
11750 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11751 parameter for a symbol table pointer.
11752 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11753 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11755 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11756 parameter for a symbol table pointer.
11758 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11760 * incremental.cc (Incremental_inputs_header)
11761 (Incremental_inputs_header_write, Incremental_inputs_entry)
11762 (Incremental_inputs_entry_write): Move ...
11763 * incremental.h (Incremental_inputs_header)
11764 (Incremental_inputs_header_write, Incremental_inputs_entry)
11765 (Incremental_inputs_entry_write): here.
11767 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11769 * incremental.cc (make_sized_incremental_binary): Set the target.
11770 Error if it is incompatible.
11771 * output.h (Output_file): Add filename method.
11773 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11775 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11776 from the get_* methods.
11778 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11780 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11781 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11782 Write 0 for the data_offset of scripts.
11784 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11786 * testsuite/Makefile.am: Add the incremental_test.sh test.
11787 * testsuite/incremental_test.sh: New.
11788 * testsuite/incremental_test_1.c: New.
11789 * testsuite/incremental_test_2.c: New.
11791 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11793 * incremental-dump.cc (main): Fix typos.
11795 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11798 * incremental-dump.cc (main): Use llu to print 64 bit values.
11800 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11801 H.J. Lu <hongjiu.lu@intel.com>
11803 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11805 (incremental_dump_LDADD): Likewise.
11806 * Makefile.in: Regenerated.
11808 2009-11-25 Doug Kwan <dougkwan@google.com>
11812 2009-11-25 Doug Kwan <dougkwan@google.com>
11814 * arm.cc (Target_arm::Target_arm): Move method definition
11815 outside of class definition. Add code to handle
11816 --target1-rel, --target1-abs and --target2= options.
11817 (Target_arm::get_reloc_reloc_type): Change method to be
11818 non-static and const.
11819 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11820 New data member declaration.
11821 (Target_arm::Scan::local, Target_arm::Scan::global,
11822 Target_arm::Relocate::relocate,
11823 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11824 Adjust call to Target_arm::get_real_reloc_type.
11825 (Target_arm::get_real_reloc_type): Use command line options
11826 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11827 * options.h (--target1-rel, --target1-abs, --target2): New
11830 2009-11-25 Doug Kwan <dougkwan@google.com>
11832 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11833 class definition. Add code to handle --target1-rel, --target1-abs
11834 and --target2= options.
11835 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11837 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11838 member declaration.
11839 (Target_arm::Scan::local, Target_arm::Scan::global,
11840 Target_arm::Relocate::relocate,
11841 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11842 call to Target_arm::get_real_reloc_type.
11843 (Target_arm::get_real_reloc_type): Use command line options to
11844 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11845 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11848 2009-11-25 Doug Kwan <dougkwan@google.com>
11850 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11851 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11852 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11854 (Arm_relocate_functions::thm_call): Replace body with a call to
11855 Arm_relocate_functions::thumb_branch_common.
11856 (Arm_relocate_functions::thm_jump24,
11857 Arm_relocate_functions::thm_xpc22): New method definitions.
11858 (Arm_relocate_functions::thumb_branch_common): New method definition.
11859 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11861 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11862 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11864 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11866 * Makefile.am: Build incremental-dump
11867 * Makefile.in: Regenerate.
11868 * incremental-dump.cc: New.
11869 * incremental.cc (Incremental_inputs_header_data,
11870 Incremental_inputs_entry_data): Move to incremental.h
11871 * incremental.h: (Incremental_inputs_header_data,
11872 Incremental_inputs_entry_data): Move from incremental.cc
11874 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11876 * incremental.cc (Incremental_inputs_header,
11877 Incremental_inputs_header_write, Incremental_inputs_entry,
11878 Incremental_inputs_entry_write): Add a typedef with the data type.
11880 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11882 * incremental.cc (Incremental_inputs_header,
11883 Incremental_inputs_header_write, Incremental_inputs_entry,
11884 Incremental_inputs_entry_write): Update comment about which
11885 type has the filed descriptions.
11887 2009-11-15 Doug Kwan <dougkwan@google.com>
11889 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11890 (Arm_relocate_functions::arm_branch_common): Change method defintion
11891 in class definition to a method declaration and update list of formal
11893 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11894 Arm_relocation_functions::jump24): Adjust call to
11895 Arm_relocate_functions::arm_branch_common. Update list of formal
11897 (Arm_relocate_functions::xpc25): New method definition.
11898 (Arm_relocate_functions::arm_branch_common): Move method defintion
11899 out from class definition. Use stubs for mode-switching and extending
11901 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11902 specially. Change code to enable use of stubs in ARM branches.
11904 2009-11-10 Doug Kwan <dougkwan@google.com>
11906 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11907 in method declaration.
11908 (Target_arm::relocate_stub): New method declaration.
11909 (Target_arm::default_target): Change to return a pointer instead of
11911 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11912 Target_arm::default_target.
11913 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11915 (Target_arm::relocate_section): Adjust view.
11916 (Target_arm::relocate_stub): New method definition.
11918 2009-11-10 Doug Kwan <dougkwan@google.com>
11920 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11922 * incremental.cc (open_incremental_binary): Initialized local
11923 variables to avoid warnings.
11924 * object.cc (make_elf_object): Ditto.
11925 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11928 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11931 * testsuite/plugin_test.c: Include "config.h".
11933 2009-11-09 Doug Kwan <dougkwan@google.com>
11935 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11936 (arm_symbol_value): Remove.
11937 (Arm_relocate_functions::arm_branch_common,
11938 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11939 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11940 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11941 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11942 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11943 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11944 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11945 Arm_relocate_functions::thm_mobw_abs_nc,
11946 Arm_relocate_functions::thm_mov_abs,
11947 Arm_relocate_functions::movw_prel_nc,
11948 Arm_relocate_functions::thm_movt_abs,
11949 Arm_relocate_functions::movt_prel,
11950 Arm_relocate_functions::thm_movw_prel_nc,
11951 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11952 (Target_arm::Relocate::relocate): Only decompose address into two
11953 parts if relocation type uses the thumb-bit and pass the actual
11954 bit instead of a flag indicating that the thumb-bit is used. Adjust
11955 calls to methods in Arm_relocate_functions for this change.
11957 2009-11-08 Ian Lance Taylor <iant@google.com>
11960 * reloc.cc: Instantiate
11961 Sized_relobj::initialize_input_to_output_maps and
11962 Sized_relobj:free_input_to_output_maps.
11964 2009-11-06 Ian Lance Taylor <iant@google.com>
11967 * defstd.cc (in_segment): Set only_if_ref true for "end".
11969 2009-11-06 Doug Kwan <dougkwan@google.com>
11971 * arm.cc (class Reloc_stub): Correct a comment.
11972 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11973 (Target_arm::scan_section_for_stubs): New method declaration.
11974 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11975 Change methods from private to protected.
11976 (Target_arm::do_may_relax): New method definition.
11977 (Target_arm::do_relax, Target_arm::group_sections,
11978 Target_arm::scan_reloc_for_stub,
11979 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11980 (Target_arm::arm_input_section_map_): New data member declaration.
11981 (Target_arm::scan_reloc_for_stub,
11982 Target_arm::scan_reloc_section_for_stubs,
11983 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11984 Target_arm::do_relax): New method definitions.
11986 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11988 * configure.ac: Check for (struct stat)::st_mtim
11989 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11990 * config.in: Regenerate.
11991 * configure: Regenerate.
11993 2009-11-05 Ian Lance Taylor <iant@google.com>
11996 * output.cc (Output_segment::add_output_section): Add missing
11999 2009-11-04 Ian Lance Taylor <iant@google.com>
12002 * object.h (class Object): Add is_needed and set_is_needed
12003 methods. Add is_needed_ field. Make bool fields into bitfields.
12004 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12005 defined in a dynamic object and referenced by a regular object,
12006 set is_needed for the dynamic object.
12007 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12008 if the file is marked with as_needed and it is not needed.
12010 2009-11-04 Ian Lance Taylor <iant@google.com>
12013 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12014 tags if data is discarded by linker script.
12015 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12016 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12017 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12018 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12020 2009-11-04 Ian Lance Taylor <iant@google.com>
12022 * layout.cc (Layout::get_output_section): Add is_interp and
12023 is_dynamic_linker_section parameters. Change all callers.
12024 (Layout::choose_output_section): Likewise.
12025 (Layout::make_output_section): Likewise.
12026 (Layout::add_output_section_data): Add is_dynamic_linker_section
12027 parameter. Change all callers.
12028 * layout.h (class Layout): Update declarations.
12029 * output.h (class Output_section): Add is_interp, set_is_interp,
12030 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12031 Add is_interp_, is_dynamic_linker_section_ fields. Change
12032 generate_code_fills_at_write_ to a bitfield.
12033 * output.cc (Output_section::Output_sections): Initialize new
12035 (Output_segment::add_output_section): Add do_sort parameter.
12036 Change all callers.
12038 2009-11-03 Ian Lance Taylor <iant@google.com>
12041 * options.h (class General_options): Add --warn-common.
12042 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12043 merging two common symbols.
12044 (Symbol_table::should_override): Handle --warn-common when merging
12045 a common symbol with a defined symbol. Use report_resolve_problem
12046 for multiple definitions.
12047 (Symbol_table::report_resolve_problem): New function.
12048 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12050 2009-11-03 Doug Kwan <dougkwan@google.com>
12052 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12054 (Target_arm::stub_factory): New method definition.
12055 (Target_arm::new_arm_input_section,
12056 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12057 Target_arm::reloc_uses_thumb_bit): New method declarations.
12058 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12059 New type definitions.
12060 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12061 member declarations.
12062 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12063 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12064 New method definitions.
12066 2009-11-03 Ian Lance Taylor <iant@google.com>
12068 * options.h (class General_options): Add --warn_constructors.
12070 2009-11-03 Ian Lance Taylor <iant@google.com>
12073 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12074 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12076 2009-11-03 Ian Lance Taylor <iant@google.com>
12079 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12080 --msgid-bugs-address.
12081 (install-pdf): New target.
12082 (install-data_yes): Look up one directory to find mkinstalldirs.
12084 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12086 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12089 2009-10-30 Doug Kwan <dougkwan@google.com>
12091 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12093 2009-10-30 Doug Kwan <dougkwan@google.com>
12095 * arm.cc (Stub_addend_reader): New struct template definition
12096 and partial specializations.
12097 (Stub_addend_reader::operator()): New method definition for a
12098 partially specialized template.
12100 2009-10-30 Doug Kwan <dougkwan@google.com>
12102 * arm.cc (Arm_relobj::processor_specific_flags): New method
12104 (Arm_relobj::do_read_symbols): New method declaration.
12105 (Arm_relobj::processor_specific_flags_): New data member declaration.
12106 (Arm_dynobj): New class definition.
12107 (Target_arm::do_finalize_sections): Add input_objects parameter.
12108 (Target_arm::do_adjust_elf_header): New method declaration.
12109 (Target_arm::are_eabi_versions_compatible,
12110 (Target_arm::merge_processor_specific_flags): New method declaration.
12111 (Target_arm::do_make_elf_object): New overloaded method definitions
12113 (Arm_relobj::do_read_symbols): New method definition.
12114 (Arm_dynobj::do_read_symbols): Ditto.
12115 (Target_arm::do_finalize_sections): Add input_objects parameters.
12116 Merge processor-specific flags from all input objects.
12117 (Target_arm::are_eabi_versions_compatible,
12118 Target_arm::merge_processor_specific_flags,
12119 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12120 New method definitions.
12121 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12122 Input_objects pointer type parameter.
12123 * layout.cc (Layout::finalize): Pass input objects to target's.
12124 finalize_sections function.
12125 * output.cc (Output_file_header::do_sized_write): Set ELF file
12126 header's processor-specific flags.
12127 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12128 Input_objects pointer type parameter.
12129 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12130 * target.h (Input_objects): New forward class declaration.
12131 (Target::processor_specific_flags,
12132 Target::are_processor_specific_flags_sect): New method definitions.
12133 (Target::finalize_sections): Add input_objects parameter.
12134 (Target::Target): Initialize processor_specific_flags_ and
12135 are_processor_specific_flags_set_.
12136 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12138 (Target::set_processor_specific_flags): New method definition.
12139 (Target::processor_specific_flags_,
12140 Target::are_processor_specific_flags_set_): New data member
12142 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12143 Input_objects pointer type parameter.
12145 2009-10-30 Doug Kwan <dougkwan@google.com>
12147 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12149 2009-10-28 Ian Lance Taylor <iant@google.com>
12151 * object.h (class Relobj): Drop options parameter from
12152 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12153 do_scan_relocs, do_relocate. Change all callers.
12154 (class Sized_relobj): Drop options parameters from
12155 do_gc_process_relocs, do_scan_relocs, do_relocate,
12156 do_relocate_sections, relocate_sections, emit_relocs_scan,
12157 emit_relocs_scan_reltype. Change all callers.
12158 (struct Relocate_info): Remove options field and all references to
12160 * reloc.h (class Read_relocs): Remove options constructor
12161 parameter and options_ field. Change all callers.
12162 (class Gc_process_relocs, class Scan_relocs): Likewise.
12163 (class Relocate_task): Likewise.
12164 * target-reloc.h (scan_relocs): Remove options parameter. Change
12166 (scan_relocatable_relocs): Likewise.
12167 * target.h (class Sized_target): Remove options parameter from
12168 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12170 * gc.h (gc_process_relocs): Remove options parameter. Change all
12172 * arm.cc: Update functions to remove options parameters.
12173 * i386.cc: Likewise.
12174 * powerpc.cc: Likewise.
12175 * sparc.cc: Likewise.
12176 * x86_64.cc: Likewise.
12177 * testsuite/testfile.cc: Likewise.
12179 2009-10-28 Doug Kwan <dougkwan@google.com>
12181 * arm.cc (Arm_relobj): New class definition.
12182 (Arm_relobj::scan_sections_for_stubs,
12183 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12184 New method definitions.
12186 2009-10-28 Cary Coutant <ccoutant@google.com>
12188 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12189 (Plugin::cleanup_done_): New member.
12190 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12191 (Plugin_manager::cleanup_done_): Remove.
12192 (Plugin_manager::add_input_file): Edit error message.
12193 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12194 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12196 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12198 * fileread.cc: (File_read::View::~View): Use the new
12199 data_ownership_ filed.
12200 (File_read::~File_read): Dispose the new whole_file_view_.
12201 (File_read::open): Mmap the whole file if needed.
12202 (File_read::open): Use whole_file_view_ instead of contents_.
12203 (File_read::find_view): Use whole_file_view_ if applicable.
12204 (File_read::do_read): Use whole_file_view_ instead of contents_.
12205 (File_read::make_view): Use whole_file_view_ instead of contents_,
12206 update File_read::View::View call.
12207 (File_read::find_or_make_view): Update File_read::View::View
12209 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12211 (File_read::View::Data_ownership): New enum.
12212 (File_read::View::View): Replace bool mapped_ with Data_ownership
12214 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12215 (File_read::View::data_ownership_): New field.
12216 (File_read::contents_): Remove (replaced by whole_file_view_).
12217 (File_read::whole_file_view_): New field.
12218 * options.h (class General_options): Add --keep-files-mapped.
12220 2009-10-27 Cary Coutant <ccoutant@google.com>
12222 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12223 * testsuite/Makefile.am (plugin_test_5): New test case.
12224 * testsuite/Makefile.in: Regenerate.
12226 2009-10-25 Doug Kwan <dougkwan@google.com>
12228 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12229 from private to protected to allow access by child class.
12230 (Sized_relobj::do_relocate_sections): New method declaration.
12231 (Sized_relobj::relocate_sections): Virtualize.
12232 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
12233 Sized_relobj::relocate_sections. Instantiate template explicitly
12234 for different target sizes and endianity.
12236 2009-10-24 Doug Kwan <dougkwan@google.com>
12238 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12239 (Arm_input_section::as_arm_input_section): New method.
12240 (Arm_output_section): New class definition.
12241 (Arm_output_section::create_stub_group,
12242 Arm_output_section::group_sections): New method definitions.
12244 2009-10-22 Doug Kwan <dougkwan@google.com>
12246 * arm.cc (Arm_input_section): New class definition.
12247 (Arm_input_section::init, Arm_input_section:do_write,
12248 Arm_input_section::set_final_data_size,
12249 Arm_input_section::do_reset_address_and_file_offset): New method
12252 2009-10-21 Doug Kwan <dougkwan@google.com>
12254 * arm.cc (Stub_table, Arm_input_section): New forward class
12256 (Stub_table): New class defintion.
12257 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12258 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12259 New method definition.
12261 2009-10-21 Doug Kwan <dougkwan@google.com>
12263 * arm.cc: Update copyright comments.
12264 (Target_arm): New forward class template declaration.
12265 (Arm_address): New type.
12266 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12267 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12268 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12270 (Insn_template): Same.
12271 (DEF_STUBS): New macro.
12272 (Stub_type): New enum type.
12273 (Stub_template): New class definition.
12275 (Reloc_stub): Same.
12276 (Stub_factory): Same.
12277 (Target_arm::Target_arm): Initialize may_use_blx_ and
12278 should_force_pic_veneer_.
12279 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12280 Target_arm::should_force_pic_veneer,
12281 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12282 Target_arm::using_thumb_only, Target_arm:;default_target): New
12284 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12285 New data member declarations.
12286 (Insn_template::size, Insn_template::alignment): New method defintions.
12287 (Stub_template::Stub_template): New method definition.
12288 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12289 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12290 (Stub_factory::Stub_factory): New method definition.
12291 * gold.h (string_hash): New template.
12292 * output.h (Input_section_specifier::hash_value): Use
12294 (Input_section_specifier::string_hash): Remove.
12295 * stringpool.cc (Stringpool_template::string_hash): Use
12298 2009-10-20 Doug Kwan <dougkwan@google.com>
12300 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12301 symbols of relaxed input sections.
12302 * output.h (Output_section::find_relaxed_input_section): Make
12305 2009-10-16 Doug Kwan <dougkwan@google.com>
12307 * dynobj.cc (Versions::Versions): Initialize version_script_.
12308 Only insert base version symbol definition for a shared object
12309 if version script defines any version versions.
12310 (Versions::define_base_version): New method definition.
12311 (Versions::add_def): Check that base version is not needed.
12312 (Versions::add_need): Define base version lazily.
12313 * dynobj.h (Versions::define_base_version): New method declaration.
12314 (Versions::needs_base_version_): New data member declaration.
12315 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12316 (check_DATA): Add no_version_test.stdout.
12317 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12319 * testsuite/Makefile.in: Regenerate.
12320 * testsuite/no_version_test.c: New file.
12321 * testsuite/no_version_test.sh: Ditto.
12323 2009-10-16 Doug Kwan <dougkwan@google.com>
12325 * expression.cc (class Segment_start_expression): New class definition.
12326 (Segment_start_expression::value): New method definition.
12327 (script_exp_function_segment_start): Return a new
12328 Segment_start_expression.
12329 * gold/script-c.h (script_saw_segment_start_expression): New function
12331 * script-sections.cc (Script_sections::Script_sections): Initialize
12332 SAW_SEGMENT_START_EXPRESSION_ to false.
12333 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12334 and -Tbbs options to specify section addresses if given in
12335 command line and no SEGMENT_START expression is seen in a script.
12336 * script-sections.h (Script_sections::saw_segment_start_expression,
12337 Script_sections::set_saw_segment_start_expression): New method
12339 (Script_sections::saw_segment_start_expression_): New data member
12341 * script.cc (script_saw_segment_start_expression): New function.
12342 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12343 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12344 script_test_7.sh and script_test_8.sh.
12345 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12346 script_test_8.stdout.
12347 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12348 (script_test_6, script_test_6.stdout, script_test_7,
12349 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12350 * Makefile.in: Regenerate.
12351 * testsuite/script_test_6.sh: New file.
12352 * testsuite/script_test_6.t: Same.
12353 * testsuite/script_test_7.sh: Same.
12354 * testsuite/script_test_7.t: Same.
12355 * testsuite/script_test_8.sh: Same.
12357 2009-10-16 Doug Kwan <dougkwan@google.com>
12359 * output.cc (Output_segment::set_section_list_address): Cast
12360 expressions to unsigned long long type to avoid format warnings.
12362 2009-10-15 Ian Lance Taylor <iant@google.com>
12364 * script.cc (Script_options::add_symbol_assignment): Always add a
12365 dot assignment to script_sections_.
12366 * script-sections.cc (Script_sections::add_dot_assignment):
12367 Initialize if necessary.
12369 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12370 program headers with no load segment if there is a linker script.
12372 * layout.cc (Layout::set_segment_offsets): Align the file offset
12373 to the segment aligment for -N or -n with no load segment.
12374 * output.cc (Output_segment::add_output_section): Don't crash if
12375 the first section is a TLS section.
12376 (Output_segment::set_section_list_addresses): Print an error
12377 message if the address moves backward in a linker script.
12378 * script-sections.cc
12379 (Output_section_element_input::set_section_addresses): Don't
12380 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12381 (Orphan_output_section::set_section_addresses): Likewise.
12383 2009-10-15 Doug Kwan <dougkwan@google.com>
12385 * layout.cc (Layout::finish_dynamic_section): Generate tags
12386 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12387 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12388 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12390 2009-10-14 Ian Lance Taylor <iant@google.com>
12392 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12394 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12395 data_shdr fields of relinfo.
12396 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12397 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12398 R_386_TLS_LDO_32, adjust based on section flags.
12399 (Target_i386::Relocate::fix_up_ldo): Remove.
12401 2009-10-13 Ian Lance Taylor <iant@google.com>
12403 Add support for -pie.
12404 * options.h (class General_options): Add -pie and
12406 (General_options::output_is_position_independent): Test -pie.
12407 (General_options::output_is_executable): Return true if not shared
12408 and not relocatable.
12409 (General_options::output_is_pie): Remove.
12410 * options.cc (General_options::finalize): Reject incompatible uses
12412 * gold.cc (queue_middle_tasks): A -pie link is not static.
12413 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12414 * symtab.cc (Symbol::final_value_is_known): Return false if
12415 output_is_position_independent.
12416 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12417 output_is_position_independent.
12418 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12419 output_is_position_independent.
12420 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12421 output_is_position_independent.
12422 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12424 (basic_pie_test.o, basic_pie_test): New targets.
12425 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12426 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12427 (two_file_pie_test): New target.
12428 * testsuite/Makefile.in: Rebuild.
12429 * README: Remove note saying that -pie is not supported.
12431 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12433 * options.h (class General_options): Add -init and -fini.
12434 * layout.cc (Layout::finish_dynamic_section): Emit
12435 given init and fini functions.
12437 2009-10-13 Sriraman Tallam <tmsriram@google.com>
12439 * gc.h (gc_process_relocs): Check if icf is enabled using new
12441 * gold.cc (queue_initial_tasks): Likewise.
12442 (queue_middle_tasks): Likewise.
12443 * object.cc (do_layout): Likewise.
12444 * symtab.cc (is_section_folded): Likewise.
12445 * main.cc (main): Likewise.
12446 * reloc.cc (Read_relocs::run): Likewise.
12447 (Sized_relobj::do_scan_relocs): Likewise.
12448 * icf.cc (is_function_ctor_or_dtor): New function.
12449 (Icf::find_identical_sections): Check if function is ctor or dtor when
12450 safe icf is chosen.
12451 * options.h (General_options::icf): Change option to be an enum.
12452 (Icf_status): New enum.
12453 (icf_enabled): New method.
12454 (icf_safe_folding): New method.
12455 (set_icf_status): New method.
12456 (icf_status_): New variable.
12457 * (options.cc) (General_options::finalize): Set icf_status_.
12458 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12459 icf_test and icf_keep_unique_test to use the --icf enum flag.
12460 * testsuite/icf_safe_test.sh: New file.
12461 * testsuite/icf_safe_test.cc: New file.
12463 2009-10-12 Sriraman Tallam <tmsriram@google.com>
12465 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12466 includes to gc.h and icf.h.
12467 * arm.cc: Include gc.h.
12468 * gold.cc: Likewise.
12469 * i386.cc: Likewise.
12470 * powerpc.cc: Likewise.
12471 * sparc.cc: Likewise.
12472 * x86_64.cc: Likewise.
12473 * gc.h: Include icf.h.
12475 2009-10-11 Ian Lance Taylor <iant@google.com>
12477 * plugin.cc: Include "gold.h" before other header files.
12479 2009-10-10 Chris Demetriou <cgd@google.com>
12481 * options.h (Input_file_argument::Input_file_type): New enum.
12482 (Input_file_argument::is_lib_): Replace with...
12483 (Input_file_argument::type_): New member.
12484 (Input_file_argument::Input_file_argument): Take Input_file_type
12485 'type' rather than boolean 'is_lib' as second argument.
12486 (Input_file_argument::is_lib): Use type_.
12487 (Input_file_argument::is_searched_file): New function.
12488 (Input_file_argument::may_need_search): Handle is_searched_file.
12489 * options.cc (General_options::parse_library): Support -l:filename.
12490 (General_options::parse_just_symbols): Update for Input_file_argument
12492 (Command_line::process): Likewise.
12493 * archive.cc (Archive::get_file_and_offset): Likewise.
12494 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12495 * script.cc (read_script_file, script_add_file): Likewise.
12496 * fileread.cc (Input_file::Input_file): Likewise.
12497 (Input_file::will_search_for): Handle is_searched_file.
12498 (Input_file::open): Likewise.
12499 * readsyms.cc (Read_symbols::get_name): Likewise.
12500 * testsuite/Makefile.am (searched_file_test): New test.
12501 * testsuite/Makefile.in: Regenerate.
12502 * testsuite/searched_file_test.cc: New file.
12503 * testsuite/searched_file_test_lib.cc: New file.
12505 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12506 Ian Lance Taylor <iant@google.com>
12508 * descriptor.cc: Include <cstdio> and "binary-io.h".
12509 (Descriptors::open): Open the files in binary mode always.
12510 * script.cc (Lex::get_token): Treat \r as whitespace.
12512 2009-10-09 Ian Lance Taylor <iant@google.com>
12514 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12516 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12517 Ian Lance Taylor <iant@google.com>
12519 * configure.ac: Check for readv function also.
12520 * fileread.cc (readv): Define if not HAVE_READV.
12521 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12523 * config.in: Regenerate.
12524 * configure: Regenerate.
12526 2009-10-09 Doug Kwan <dougkwan@google.com>
12528 * layout.cc (Layout::make_output_section): Call target hook to make
12529 ordinary output section.
12530 (Layout::finalize): Adjust parameter list of call the
12531 Target::may_relax().
12532 * layout.h (class Layout::section_list): New method.
12533 * merge.h (Output_merge_base::entsize): Change visibility to public.
12534 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12536 (Output_merge_string::do_is_string): New method.
12537 * object.cc (Sized_relobj::do_setup): renamed from
12538 Sized_relobj::set_up.
12539 * object.h (Sized_relobj::adjust_shndx,
12540 Sized_relobj::initializ_input_to_output_maps,
12541 Sized_relobj::free_input_to_output_maps): Change visibilities to
12543 (Sized_relobj::setup): Virtualize.
12544 (Sized_relobj::do_setup): New method declaration.
12545 (Sized_relobj::invalidate_section_offset,
12546 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12547 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12548 * options.cc (parse_int): New function.
12549 * options.h (parse_int): New declaration.
12550 (DEFINE_int): New macro.
12551 (stub_group_size): New option.
12552 * output.cc (Output_section::Output_section): Initialize memebers
12553 merge_section_map_, merge_section_by_properties_map_,
12554 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12555 (Output_section::add_input_section): Handled deferred code-fill
12556 generation and remove an old comment.
12557 (Output_section::add_relaxed_input_section): New method definition.
12558 (Output_section::add_merge_input_section): Use merge section by
12559 properties map to speed to search. Update merge section maps
12561 (Output_section::build_relaxation_map): New method definition.
12562 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12564 (Output_section::relax_input_section): Renamed to
12565 Output_section::convert_input_sections_to_relaxed_sections and change
12566 interface to take a vector of pointers to relaxed sections.
12567 (Output_section::find_merge_section,
12568 Output_section::find_relaxed_input_section): New method definitions.
12569 (Output_section::is_input_address_mapped,
12570 Output_section::output_offset, Output_section::output_address):
12571 Use output section data maps to speed up searching.
12572 (Output_section::find_starting_output_address): Add comments.
12573 (Output_section::do_write,
12574 Output_section::write_to_postprocessing_buffer): Do code-fill
12575 generation as appropriate.
12576 (Output_section::get_input_sections): Invalidate relaxed input section
12578 (Output_section::restore_states): Adjust type of checkpoint .
12579 Invalidate relaxed input section map.
12580 * output.h (Output_merge_base): New class declaration.
12581 (Input_section_specifier): New class defintion.
12582 (class Output_relaxed_input_section) Change base class to
12583 Output_section_data_build.
12584 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12585 base class initializer.
12586 (Output_section::add_relaxed_input_section): New method declaration.
12587 (Output_section::Input_section): Change visibility to protected.
12588 (Output_section::Input_section::relobj,
12589 Output_section::Input_section::shndx): Handle relaxed input sections.
12590 Output_section::input_sections) Change visibility to protected. Also
12591 define overload to return a non-const pointer.
12592 (Output_section::Merge_section_properties): New class defintion.
12593 (Output_section::Merge_section_by_properties_map,
12594 Output_section::Output_section_data_by_input_section_map,
12595 Output_section::Relaxation_map): New types.
12596 (Output_section::relax_input_section): Rename method to
12597 Output_section::convert_input_sections_to_relaxed_sections and change
12598 interface to take a vector of relaxed section pointers.
12599 (Output_section::find_merge_section,
12600 Output_section::find_relaxed_input_section,
12601 Output_section::build_relaxation_map,
12602 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12603 New method declarations.
12604 (Output_section::merge_section_map_
12605 Output_section::merge_section_by_properties_map_,
12606 Output_section::relaxed_input_section_map_,
12607 Output_section::is_relaxed_input_section_map_valid_,
12608 Output_section::generate_code_fills_at_write_): New data members.
12609 * script-sections.cc
12610 (Output_section_element_input::set_section_addresses): Call
12611 current_data_size and addralign methods of relaxed input sections.
12612 (Orphan_output_section::set_section_addresses): Call current_data_size
12613 and addralign methods of relaxed input sections.
12614 * symtab.cc (Symbol_table::compute_final_value): Extract template
12615 from the body of Symbol_table::sized_finalize_symbol.
12616 (Symbol_table::sized_finalized_symbol): Call
12617 Symbol_table::compute_final_value.
12618 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12619 (Symbol_table::compute_final_value): New templated method declaration.
12620 * target.cc (Target::do_make_output_section): New method defintion.
12621 * target.h (Target::make_output_section): New method declaration.
12622 (Target::relax): Add more parameters for input objects, symbol table
12623 and layout. Adjust call to do_relax.
12624 (Target::do_make_output_section): New method declaration.
12625 (Target::do_relax): Add parameters for input objects, symbol table
12628 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12630 * pread.c: Include stdio.h.
12632 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12634 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12637 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12639 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12640 Change read_shndx type to unsigned int.
12641 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12643 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12644 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12645 Change read_shndx type to unsigned int.
12646 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12648 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12649 * layout.cc (Layout::create_symtab_sections): Cast the result of
12650 local_symcount * symsize to off_t in the gold_assert.
12652 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12654 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12655 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12657 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12658 (Arm_relocate_functions::thm_abs5): New function.
12659 (Arm_relocate_functions::abs12): New function.
12660 (Arm_relocate_functions::abs16): New function.
12661 (Arm_relocate_functions::base_abs): New function.
12662 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12663 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12664 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12666 (Scan::global): Likewise.
12667 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12668 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12669 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12670 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12673 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12675 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12676 (Arm_relocate_functions::movt_prel): New function.
12677 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12678 (Arm_relocate_functions::thm_movt_prel): New function.
12679 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12680 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12681 (Scan::global, Relocate::relocate): Likewise.
12682 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12684 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12686 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12687 Incremental_checker.
12688 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12690 (class Incremental_inputs_header): New class.
12691 (Incremental_inputs_header_writer): Edit comment.
12692 (Incremental_inputs_entry): New class.
12693 (Incremental_inputs_entry_writer): Edit comment.
12694 (Sized_incremental_binary::do_find_incremental_inputs_section):
12695 Add *strtab_shndx parameter, fill it.
12696 (Sized_incremental_binary::do_check_inputs): New method.
12697 (Incremental_checker::can_incrementally_link_output_file): Use
12698 Sized_incremental_binary::check_inputs.
12699 (Incremental_inputs::report_command_line): Save command line in
12702 (Incremental_binary::find_incremental_inputs_section): New
12704 (Incremental_binary::do_find_incremental_inputs_section): Add
12705 strtab_shndx parameter.
12706 (Incremental_binary::do_check_inputs): New pure virtual method.
12707 (Sized_incremental_binary::do_check_inputs): Declare.
12708 (Incremental_checker::Incremental_checker): Add incremental_inputs
12709 parameter, use it to initialize incremental_inputs_.
12710 (Incremental_checker::incremental_inputs_): New field.
12711 (Incremental_checker::command_line): New method.
12712 (Incremental_checker::inputs): New method.
12713 (Incremental_checker::command_line_): New field.
12715 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12717 * incremental.cc: Include <cstdarg> and "target-select.h".
12718 (vexplain_no_incremental): New function.
12719 (explain_no_incremental): New function.
12720 (Incremental_binary::error): New method.
12721 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12723 (make_sized_incremental_binary): New function.
12724 (open_incremental_binary): New function.
12725 (can_incrementally_link_file): Add checks if output is ELF and has
12727 * incremental.h: Include "elfcpp_file.h" and "output.h".
12728 (Incremental_binary): New class.
12729 (Sized_incremental_binary): New class.
12730 (open_incremental_binary): Declare.
12731 * object.cc (is_elf_object): Use
12732 elfcpp::Elf_recognizer::is_elf_file.
12733 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12734 * output.h (Output_file::filesize): New method.
12736 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12738 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12740 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12741 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12743 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12745 (Arm_relocate_functions::movw_abs_nc): New function.
12746 (Arm_relocate_functions::movt_abs): New function.
12747 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12748 (Arm_relocate_functions::thm_movt_abs): New function.
12749 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12750 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12751 (Scan::global): Likewise.
12752 (Relocate::relocate): Likewise.
12753 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12755 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12757 * arm.cc (Arm_relocate_functions::got_prel) New function.
12758 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12759 (Relocate::relocate): Likewise.
12760 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12762 2009-10-06 Ian Lance Taylor <iant@google.com>
12764 * options.h (class General_options): Define
12765 split_stack_adjust_size parameter.
12766 * object.h (class Object): Add uses_split_stack_ and
12767 has_no_split_stack_ fields. Add uses_split_stack and
12768 has_no_split_stack accessor functions. Declare
12769 handle_split_stack_section.
12770 (class Reloc_symbol_changes): Define.
12771 (class Sized_relobj): Define Function_offsets. Declare
12772 split_stack_adjust, split_stack_adjust_reltype, and
12774 * object.cc (Object::handle_split_stack_section): New function.
12775 (Sized_relobj::do_layout): Call handle_split_stack_section.
12776 * dynobj.cc (Sized_dynobj::do_layout): Call
12777 handle_split_stack_section.
12778 * reloc.cc (Sized_relobj::relocate_sections): Call
12779 split_stack_adjust for executable sections in split_stack
12780 objects. Pass reloc_map to relocate_section.
12781 (Sized_relobj::split_stack_adjust): New function.
12782 (Sized_relobj::split_stack_adjust_reltype): New function.
12783 (Sized_relobj::find_functions): New function.
12784 * target-reloc.h: Include "object.h".
12785 (relocate_section): Add reloc_symbol_changes parameter. Change
12787 * target.h (class Target): Add calls_non_split method. Declare
12788 do_calls_non_split virtual method. Declare match_view and
12790 * target.cc: Include "elfcpp.h".
12791 (Target::do_calls_non_split): New function.
12792 (Target::match_view): New function.
12793 (Target::set_view_to_nop): New function.
12794 * gold.cc (queue_middle_tasks): Give an error if mixing
12795 split-stack and non-split-stack objects with -r.
12796 * i386.cc (Target_i386::relocate_section): Add
12797 reloc_symbol_changes parameter.
12798 (Target_i386::do_calls_non_split): New function.
12799 * x86_64.cc (Target_x86_64::relocate_section): Add
12800 reloc_symbol_changes parameter.
12801 (Target_x86_64::do_calls_non_split): New function.
12802 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12804 * powerpc.cc (Target_powerpc::relocate_section): Add
12805 reloc_symbol_changes parameter.
12806 * sparc.cc (Target_sparc::relocate_section): Add
12807 reloc_symbol_changes parameter.
12808 * configure.ac: Call AM_CONDITIONAL for the default target.
12809 * configure: Rebuild.
12810 * testsuite/Makefile.am (TEST_AS): New variable.
12811 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12812 (check_DATA): Add split_i386 and split_x86_64 files.
12813 (SPLIT_DEFSYMS): Define.
12814 (split_i386_[1234n].o): New targets.
12815 (split_i386_[124]): New targets.
12816 (split_i386_[1234r].stdout): New targets.
12817 (split_x86_64_[1234n].o): New targets.
12818 (split_x86_64_[124]): New targets.
12819 (split_x86_64_[1234r].stdout): New targets.
12820 (MOSTLYCLEANFILES): Add new executables.
12821 * testsuite/split_i386.sh: New file.
12822 * testsuite/split_x86_64.sh: New file.
12823 * testsuite/split_i386_1.s: New file.
12824 * testsuite/split_i386_2.s: New file.
12825 * testsuite/split_i386_3.s: New file.
12826 * testsuite/split_i386_4.s: New file.
12827 * testsuite/split_i386_n.s: New file.
12828 * testsuite/split_x86_64_1.s: New file.
12829 * testsuite/split_x86_64_2.s: New file.
12830 * testsuite/split_x86_64_3.s: New file.
12831 * testsuite/split_x86_64_4.s: New file.
12832 * testsuite/split_x86_64_n.s: New file.
12833 * testsuite/testfile.cc (Target_test): Update relocation_section
12835 * testsuite/Makefile.in: Rebuild.
12837 2009-10-06 Ian Lance Taylor <iant@google.com>
12839 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12840 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12841 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12842 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12843 the address on ldo_addrs_.
12844 (Target_i386::Relocate::fix_up_ldo): New function.
12846 2009-10-06 Rafael Espindola <espindola@google.com>
12848 * plugin.cc (add_input_library): New.
12849 (Plugin::load): Add add_input_library to tv.
12850 (Plugin_manager::add_input_file): Add the is_lib argument.
12851 (add_input_file): Update call to Plugin_manager::add_input_file.
12852 (add_input_library): New.
12853 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12855 2009-09-30 Doug Kwan <dougkwan@google.com>
12857 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12858 symbol and call Symbol::may_need_copy_reloc to determine if
12859 a copy reloc is needed.
12860 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12861 nocopyreloc is given in command line.
12862 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12863 given in command line.
12864 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12865 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12866 of the removed Target_i386::may_need_copy_reloc.
12867 * options.h (copyreloc): New option with default value false.
12868 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12869 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12870 instead of the removed Target_powerpc::may_need_copy_reloc.
12871 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12872 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12873 instead of the removed Target_sparc::may_need_copy_reloc.
12874 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12875 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12876 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12877 instead of the removed Target_x86_64::may_need_copy_reloc.
12879 2009-09-30 Ian Lance Taylor <iant@google.com>
12881 * object.h (class Object): Remove target_ field, and target,
12882 sized_target, and set_target methods.
12883 (Object::sized_target): Remove.
12884 (class Sized_relobj): Update declarations. Remove sized_target.
12885 * object.cc (Sized_relobj::setup): Remove target parameter.
12886 Change all callers.
12887 (Input_objects::add_object): Don't do anything with the target.
12888 (make_elf_sized_object): Add punconfigured parameter. Change all
12889 callers. Set or test parameter target.
12890 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12891 Change all callers.
12892 * parameters.cc (Parameters::set_target): Change parameter type to
12894 (Parameters::default_target): Remove.
12895 (set_parameters_target): Change parameter type to be non-const.
12896 (parameters_force_valid_target): New function.
12897 (parameters_clear_target): New function.
12898 * parameters.h (class Parameters): Update declarations. Remove
12899 default_target method. Add sized_target and clear_target
12900 methods. Change target_ to be non-const.
12901 (set_parameters_target): Update declaration.
12902 (parameters_force_valid_target): Declare.
12903 (parameters_clear_target): Declare.
12904 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12905 as NULL if we aren't searching.
12906 (Add_symbols::run): Don't check for compatible target.
12907 * fileread.cc (Input_file::open_binary): Call
12908 parameters_force_valid_target.
12909 * gold.cc (queue_middle_tasks): Likewise.
12910 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12911 set_target on object.
12912 * dynobj.h (class Sized_dynobj): Update declarations.
12913 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12914 make_elf_object returns NULL.
12915 (Archive::include_member): Don't check whether object target is
12917 * output.cc (Output_section::add_input_section): Get target from
12919 (Output_section::relax_input_section): Likewise.
12920 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12922 (Sized_relobj::do_scan_relocs): Likewise.
12923 (Sized_relobj::relocate_sections): Likewise.
12924 * resolve.cc (Symbol_table::resolve): Likewise.
12925 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12926 parameter. Change all callers.
12927 (Symbol_table::add_from_object): Get target from parameters.
12928 (Symbol_table::add_from_relobj): Don't check object target.
12929 (Symbol_table::add_from_dynobj): Likewise.
12930 (Symbol_table::define_special_symbol): Get target from
12932 * symtab.h (class Symbol_table): Update declaration.
12933 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12934 parameter. Change all callers. Clear parameter target.
12935 (Binary_test): Test target here.
12936 * testsuite/object_unittest.cc (gold_testsuite): Remove
12937 target_test_pointer parameter. Change all callers.
12938 (Object_test): Test target here.
12940 2009-09-26 Ian Lance Taylor <iant@google.com>
12942 * testsuite/initpri1.c: Don't try to use constructor priorities if
12943 compiling with gcc before 4.3.
12945 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12947 * testsuite/retain_symbols_file_test.sh (check_present): Change
12948 output file name to retain_symbols_file_test.stdout.
12949 (check_absent): Likewise.
12951 2009-09-18 Craig Silverstein <csilvers@google.com>
12953 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12954 * options.cc: Include <cerrno> and <fstream>.
12955 (General_options::finalize): Parse -retain-symbols-file tag.
12956 * options.h: New flag.
12957 (General_options): New method should_retain_symbol, new
12958 variable symbols_to_retain.
12959 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12960 should_retain_symbol map.
12961 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12962 * testsuite/Makefile.in: Regenerate.
12963 * testsuite/retain_symbols_file_test.sh: New file.
12965 2009-09-18 Nick Clifton <nickc@redhat.com>
12967 * po/es.po: Updated Spanish translation.
12969 2009-09-17 Doug Kwan <dougkwan@google.com>
12971 * debug.h (DEBUG_RELAXATION): New constant.
12972 (DEBUG_ALL): Add DEBUG_RELAXATION.
12973 (debug_string_to_enum): Add relaxation debug option.
12975 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12976 Layout::Relaxation_debug_check::read_sections,
12977 Layout::Relaxation_debug_check::read_sections): New method definitions.
12978 (Layout::Layout): Initialize data members
12979 record_output_section_data_from_scrips_,
12980 script_output_section_data_list_ and relaxation_debug_check_.
12981 (Layout::save_segments, Layout::restore_segments,
12982 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12983 Layout::relaxation_loop_body): New method definitions.
12984 (Layout::finalize): Support relaxation. Move section layout code to
12985 Layout::relaxation_loop_body.
12986 (Layout::set_asection_address_from_script): Move code for orphan
12987 section placement out.
12988 (Layout::place_orphan_sections_in_script): New method definition.
12989 * layout.h (Output_segment_headers, Output_file_header):
12990 New forward class declarations.
12991 (Layout::~Layout): Define.
12992 (Layout::new_output_section_data_from_script): New method definition.
12993 (Layout::place_orphan_sections_in_script): New method declaration.
12994 (Layout::Segment_states): New type declaration.
12995 (Layout::save_segments, Layout::restore_segments,
12996 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12997 Layout::relaxation_loop_body): New method declarations.
12998 (Layout::Output_section_data_list): New type declaration.
12999 (Layout::Relaxation_debug_check): New class definition.
13000 (Layout::record_output_section_data_from_script_,
13001 Layout::script_output_section_data_list_, Layout::segment_states_,
13002 Layout::relaxation_debug_check_): New data members.
13003 * output.cc: (Output_section_headers::do_size): New method definition.
13004 (Output_section_headers::Output_section_headers): Move size
13005 computation to Output_section_headers::do_size.
13006 (Output_segment_headers::do_size): New method definition.
13007 (Output_file_header::Output_file_header): Move size computation to
13008 Output_file_header::do_size and call it.
13009 (Output_file_header::do_size): New method definition.
13010 (Output_data_group::Output_data_group): Adjust call to
13011 Output_section_data.
13012 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13013 (Output_symtab_xindex::do_write): Add array bound check.
13014 (Output_section::Input_section::print_to_mapfile): Handle
13015 RELAXED_INPUT_SECTION_CODE.
13016 (Output_section::Output_section): Initialize data member checkpoint_.
13017 (Output_section::~Output_section): Delete checkpoint object pointed
13019 (Output_section::add_input_section): Always add an Input_section if
13021 (Output_section::add_merge_input_section): Add assert.
13022 (Output_section::relax_input_section): New method definition.
13023 (Output_section::set_final_data_size): Set load address to zero for
13024 an unallocated section.
13025 (Output_section::do_address_and_file_offset_have_reset_values):
13026 New method definition.
13027 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13028 Handle relaxed input section.
13029 (Output_section::sort_attached_input_sections): Checkpoint input
13030 section list lazily.
13031 (Output_section::get_input_sections): Change type of input_sections to
13032 list of Simple_input_section pointers. Checkpoint input section list
13033 lazily. Also handle relaxed input sections.
13034 (Output_section::add_input_section_for_script): Take a reference to
13035 a Simple_input_section object instead of Relobj pointer and section
13036 index as parameter. Handle relaxed input sections.
13037 (Output_section::save_states, Output_section::restore_states): New
13038 method definitions.
13039 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13040 (Output_data::is_data_size_fixed): New method definition.
13041 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13043 (Output_data::address_and_file_offset_have_reset_values): New method
13045 (Output_data::do_address_and_file_offset_have_reset_values): New method
13047 (Output_data::set_data_size): Check that data size is not fixed.
13048 (Output_data::fix_data_size): New method definition.
13049 (Output_data::is_data_size_fixed_): New data member.
13050 (Output_section_headers::set_final_data_size): New method definition.
13051 (Output_section_headers::do_size): New method declaration.
13052 (Output_segment_headers::set_final_data_size): New method definition.
13053 (Output_segment_headers::do_size): New method declaration.
13054 (Output_file_header::set_final_data_size)::New method definition.
13055 (Output_file_header::do_size)::New method declaration.
13056 (Output_section_data::Output_section_data): Add new parameter
13057 is_data_size_fixed and use it to fix data size.
13058 (Output_data_const::Output_data_const): Adjust call to base class
13059 constructor and fix data size.
13060 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13061 base class constructor and fix data size.
13062 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13063 base class constructor and fix data size.
13064 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13065 class constructor and fix data size.
13066 (Output_data_group::set_final_data_size): New method definition.
13067 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13068 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13069 class constructor and fix data size.
13070 (Output_relaxed_input_section): New class definition.
13071 (Output_section::Simple_input_section): New class definition.
13072 (Output_section::get_input_sections): Adjust parameter list.
13073 (Output_section::add_input_section_for_script): Same.
13074 (Output_section::save_states, Output_section::restore_states,
13075 Output_section::do_address_and_file_offset_have_reset_values,
13076 (Output_section::Input_section::Input_section): Handle
13077 RELAXED_INPUT_SECTION_CODE. Add new overload for
13078 Output_relaxed_input_section.
13079 (Output_section::Input_section::is_input_section,
13080 Output_section::Input_section::set_output_section): Handle relaxed
13082 (Output_section::Input_section::is_relaxed_input_section,
13083 Output_section::Input_section::output_section_data,
13084 Output_section::Input_section::relaxed_input_section): New method
13086 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13088 (Output_section::Input_section::u1_): Update comments.
13089 (Output_section::Input_section::u2_): Add new union member poris.
13090 (Output_section::Checkpoint_output_section): New classs definition.
13091 (Output_section::relax_input_section): New method declaration.
13092 (Output_section::checkpoint_): New data member.
13093 (Output_segment): Update comments.
13094 (Output_segment::Output_segment): Un-privatize copy constructor.
13095 (Output_segment::operator=): Un-privatize.
13096 * script-sections.cc (Output_section_element::Input_section_list):
13097 Change element type to Output_section::Simple_input_section.
13098 (Output_section_element_dot_assignment::set_section_addresses):
13099 Register output section data for relaxation clean up.
13100 (Output_data_exression::Output_data_expression): Adjust call to base
13101 constructor to fix data size.
13102 (Output_section_element_data::set_section_addresses): Register
13103 Output_data_expression object for relaxation clean up.
13104 (struct Input_section_info): Replace Relobj pointer and section index
13105 pair with Output_section::Simple_input_section and Convert struct to a
13107 (Input_section_sorter::operator()): Adjust access to
13108 Input_section_info data member to use accessors.
13109 (Output_section_element_input::set_section_addresses): Use layout
13110 parameter. Adjust code to use Output_section::Simple_input_section
13111 and Input_secction_info classes. Register filler for relaxation
13113 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13114 and section index pair with Output_section::Simple_input_section
13115 class. Adjust code accordingly.
13116 (Phdrs_element::release_segment): New method definition.
13117 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13119 (Script_sections::release_segments): New method definition.
13120 * gold/script-sections.h (Script_sections::release_segments): New
13121 method declaration.
13122 * gold/target.h (Target::may_relax, Target::relax,
13123 Target::do_may_relax, Target::do_relax): New method definitions.
13125 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13127 * arm.cc (has_signed_unsigned_overflow): New function.
13128 (Arm_relocate_functions::abs8): New function.
13129 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13130 (Target_arm::Scan::global): Likewise.
13131 (Target_arm::relocate::relocate): Likewise.
13132 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13135 2009-09-16 Cary Coutant <ccoutant@google.com>
13137 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13138 * testsuite/Makefile.in: Regenerate.
13140 2009-09-11 Nick Clifton <nickc@redhat.com>
13142 * po/gold.pot: Updated by the Translation project.
13144 2009-09-08 Cary Coutant <ccoutant@google.com>
13146 * output.cc (Output_file::open): Add execute permission to empty file.
13147 * testsuite/Makefile.am (permission_test): New test.
13148 * testsuite/Makefile.in: Regenerate.
13150 2009-09-02 Ian Lance Taylor <iant@google.com>
13152 * output.cc (Output_file::resize): Call map_no_anonymous rather
13155 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13157 * gold.cc: Include "incremental.h".
13158 (queue_initial_tasks): Call Incremental_checker methods.
13159 * incremental.cc: Include "output.h".
13160 (Incremental_checker::can_incrementally_link_output_file): New
13162 * incremental.h (Incremental_checker): New class.
13164 * output.cc (Output_file::open_for_modification): New method.
13165 (Output_file::map_anonymous): Changed return type to bool. Record
13166 map in base_ field.
13167 (Output_file::map_no_anonymous): New method, broken out of map.
13168 (Output_file::map): Use map_no_anonymous and map_anonymous.
13169 * output.h (class Output_file): Update declarations.
13171 2009-08-24 Cary Coutant <ccoutant@google.com>
13173 * options.h (Command_line::Pre_options): New class.
13174 (Command_line::pre_options): New member.
13175 * options.cc (gold::options::ready_to_register): New variable.
13176 (One_option::register_option): Do nothing if not registering options.
13177 Assert if same short option registered twice.
13178 (General_options::General_options): Turn off option registration when
13180 (Command_line::Pre_options::Pre_options): New constructor.
13182 2009-08-24 Cary Coutant <ccoutant@google.com>
13184 * options.h (General_options::no_keep_memory): Remove incorrect
13187 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13189 * Makefile.am (am__skiplex, am__skipyacc): New.
13190 * Makefile.in: Regenerate.
13192 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13194 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13195 (INCLUDES): ... this.
13196 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13197 (AM_CPPFLAGS): Renamed from ...
13198 (INCLUDE): ... this.
13199 * Makefile.in, testsuite/Makefile.in: Regenerate.
13201 * Makefile.in: Regenerate.
13202 * aclocal.m4: Likewise.
13203 * config.in: Likewise.
13204 * configure: Likewise.
13205 * testsuite/Makefile.in: Likewise.
13207 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13208 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13209 * Makefile.in: Regenerate.
13210 * testsuite/Makefile.in: Regenerate.
13212 2009-08-19 Cary Coutant <ccoutant@google.com>
13214 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13215 symbols in shared libraries overridden by hidden or internal symbols
13216 in the main program.
13218 2009-08-19 Chris Demetriou <cgd@google.com>
13220 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13221 checking source file names in error messages.
13223 2009-08-18 Doug Kwan <dougkwan@google.com>
13225 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13226 an elcpp::Ehdr as parameter. Adjust call to set_target.
13227 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13228 an elfcpp::Ehdr as parameter.
13229 * object.cc (Object::set_target): Remove the version that looks up
13230 a target and sets it.
13231 (Sized_relobj::setup): Take a Target object instead of
13232 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13233 (make_elf_sized_object): Find target and ask target to
13234 make an ELF object.
13235 * object.h: (Object::set_target): Remove the version that looks up
13236 a target and sets it.
13237 (Sized_relobj::setup): Take a Target object instead of
13238 an elfcpp:Ehdr as parameter.
13239 * target.cc: Include dynobj.h.
13240 (Target::do_make_elf_object_implementation): New.
13241 (Target::do_make_elf_object): New.
13242 * target.h (Target::make_elf_object): New template declaration.
13243 (Target::do_make_elf_object): New method declarations.
13244 (Target::do_make_elf_object_implementation): New template declaration.
13246 2009-08-14 Ian Lance Taylor <iant@google.com>
13248 * gold.h (FUNCTION_NAME): Define.
13249 (gold_unreachable): Use FUNCTION_NAME.
13251 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13253 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13254 symbol in the --keep-unique list is not found.
13256 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13258 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13259 been maked as --keep-unique.
13260 (Icf::unfold_section): New function.
13261 * icf.h (Icf::unfold_section): New function.
13262 * options.h (General_options::keep_unique): New option.
13263 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13264 * testsuite/Makefile.in: Regenerate.
13265 * testsuite/icf_keep_unique_test.sh: New file.
13266 * testsuite/icf_keep_unique_test.cc: New file.
13268 2009-08-12 Cary Coutant <ccoutant@google.com>
13271 * resolve.cc (Symbol_table::resolve): Check for references from
13272 dynamic objects to hidden and internal symbols.
13273 * testsuite/Makefile.am (hidden_test.sh): New test.
13274 * testsuite/Makefile.in: Regenerate.
13275 * testsuite/hidden_test.sh: New script.
13276 * testsuite/hidden_test_1.c: New test source.
13277 * testsuite/hidden_test_main.c: New test source.
13279 2009-08-11 Doug Kwan <dougkwan@google.com>
13281 * arm.cc: Update comments.
13282 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13283 segment to locate the .ARM.exidx section if present.
13285 2009-08-09 Doug Kwan <dougkwan@google.com>
13287 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13290 2009-08-07 Sriraman Tallam <tmsriram@google.com>
13291 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13294 2009-08-06 Sriraman Tallam <tmsriram@google.com>
13296 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13297 valid tls_segment only for non-debug-section relocations.
13298 * testsuite/Makefile.am: Add gc_tls_test.
13299 * testsuite/Makefile.in: Regenerate.
13300 * testsuite/gc_tls_test.cc: New file.
13301 * testsuite/gc_tls_test.sh: New file.
13303 2009-08-05 Sriraman Tallam <tmsriram@google.com>
13305 * icf.cc: New file.
13307 * Makefile.am (CCFILES): Add icf.cc.
13308 (HFILES): Add icf.h
13309 * Makefile.in: Regenerate.
13310 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13311 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13312 section, symbol and addend information for the relocs.
13313 * gold.cc (queue_middle_tasks): Call identical code folding.
13314 * gold.h: Add defines for multimap.
13315 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13316 to the call of finalize_local_symbols.
13317 * main.cc (main): Create object of class Icf.
13318 * object.cc (Sized_relobj::do_layout): Allow this function to be
13319 called twice during icf.
13320 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13321 to sections marked as identical by icf.
13322 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13324 (Sized_relobj::do_section_entsize): New function.
13325 * object.h (Object::section_entsize): New function.
13326 (Object::do_section_entsize): New pure virtual function.
13327 (Relobj::finalize_local_symbols): Add new parameter.
13328 (Relobj::do_section_entsize): New function.
13329 * options.h (General_options::icf): New option.
13330 (General_options::icf_iterations): New option.
13331 (General_options::print_icf_sections): New option.
13332 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13333 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13334 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13336 * symtab.cc (Symbol_table::is_section_folded): New function.
13337 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13338 to sections marked as identical by icf.
13339 * symtab.h (Symbol_table::set_icf): New function.
13340 (Symbol_table::icf): New function.
13341 (Symbol_table::is_section_folded): New function.
13342 (Symbol_table::icf_): New data member.
13343 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13344 * testsuite/Makefile.am: Add commands to build icf_test.
13345 * testsuite/Makefile.in: Regenerate.
13346 * testsuite/icf_test.sh: New file.
13347 * testsuite/icf_test.cc: New file.
13349 2009-07-24 Chris Demetriou <cgd@google.com>
13351 * layout.cc (is_compressible_debug_section): Fix incorrect
13352 comment about compressed section names.
13354 2009-07-20 Ian Lance Taylor <ian@airs.com>
13357 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13359 2009-07-16 Ian Lance Taylor <iant@google.com>
13362 * layout.h: #include <map>.
13363 (class Kept_section): Change from struct to class. Add accessors
13364 and setters. Add section size to Comdat_group mapping. Change
13365 Comdat_group to std::map. Add is_comdat_ field. Add
13366 linkonce_size field in union.
13367 (class Layout): Update declaration of find_or_add_kept_section.
13368 Don't declare find_kept_object.
13369 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13370 parameter. Add object, shndx, is_comdat, and is_group_name
13371 parameters. Change all callers. Adjust for new Kept_section.
13372 (Layout::find_kept_object): Remove.
13373 * object.cc (Sized_relobj::include_section_group): Update use of
13374 Kept_section. Rename secnum to shndx. Only record
13375 Kept_comdat_section if sections are the same size.
13376 (Sized_relobj::include_linkonce_section): Update use of
13377 Kept_section. Only record Kept_comdat_section if sections are the
13378 same size. Set size of linkonce section.
13379 (Sized_relobj::map_to_kept_section): Update call to
13380 get_kept_comdat_section.
13381 * object.h (class Sized_relobj): Rename fields in
13382 Kept_comdat_section to drop trailing underscores; change object
13383 field to Relobj*. Change Kept_comdat_section_table to store
13384 struct rather than pointer.
13385 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13386 Add kept_object and kept_shndx parameters. Change all callers.
13387 (Sized_relobj::get_kept_comdat_section): Change return type to
13388 bool. Add kept_object and kept_shndx parameters. Change all
13390 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13391 Layout::find_or_add_kept_section.
13393 2009-07-09 Ian Lance Taylor <iant@google.com>
13395 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13396 Reserve space in the hash table.
13398 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13400 * fileread.cc (File_read::get_mtime): New method.
13401 * fileread.h (Timespec): New structure.
13402 (File_read::get_mtime): New method.
13403 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13404 Renamed from timestamp_nsec.
13405 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13407 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
13409 (Incremental_inputs::report_archive): Save mtime; style fix.
13410 (Incremental_inputs::report_obejct): Save mtime; style fix.
13411 (Incremental_inputs::report_script): Save mtime; style fix.
13412 (Incremental_inputs::finalize_inputs): Style fix.
13413 (Incremental_inputs::finalize): Style fix.
13414 (Incremental_inputs::create_input_section_data): Store inputs
13416 * incremental.h (Incremental_inputs::report_script): Add mtime
13418 (Incremental_inputs::Input_info::Input_info): Intialize only one
13420 (Incremental_inputs::Input_info::archive): Move to nameless
13422 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13423 (Incremental_inputs::Input_info::script): Move to nameless union.
13424 (Incremental_inputs::mtime): New field.
13425 * script.cc (read_input_script): Pass file mtime to
13427 * script.h (Script_info::inputs): Style fix.
13429 2009-07-01 Ian Lance Taylor <ian@airs.com>
13431 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13434 2009-06-24 Ian Lance Taylor <iant@google.com>
13437 * layout.cc (Layout::choose_output_section): If we find an
13438 existing section, update the flags.
13439 (Layout::create_notes): New function, broken out of
13441 (Layout::finalize): Don't create note sections.
13442 (Layout::create_note): Don't crash if linker script discards
13444 (Layout::create_gold_note): Likewise.
13445 (Layout::create_build_id): Likewise. Don't set
13446 after_input_sections on the section.
13447 (Layout::create_executable_stack_info): Remove target parameter.
13449 * layout.h (class Layout): Declare create_notes. Update
13450 declaration of create_executable_stack_info.
13451 * gold.cc (queue_middle_tasks): Call create_notes.
13452 * output.cc (Output_section::update_flags_for_input_section): Move
13453 here from output.h. If SHF_ALLOC flag is newly set, mark address
13455 * output.h (Output_data::mark_address_invalid): New function.
13456 (class Output_section): Only declare, not define,
13457 update_flags_for_input_section. Remove set_flags.
13459 2009-06-24 Ian Lance Taylor <iant@google.com>
13461 * script-sections.cc (Output_section_definition::
13462 set_section_addresses): Rename shadowing local load_address to
13465 2009-06-24 Ian Lance Taylor <iant@google.com>
13468 * reloc.cc (relocate_sections): Skip empty relocation sections.
13470 2009-06-23 Ian Lance Taylor <iant@google.com>
13473 * layout.cc (Layout::create_note): Use choose_output_section
13474 rather than make_output_section.
13476 2009-06-23 Ian Lance Taylor <iant@google.com>
13479 * options.cc (General_options::parse_V): Set printed_version_.
13480 (General_options::General_options): Initialize printed_version_.
13481 * options.h (class General_options): Add printed_version_ field.
13482 * gold.cc (queue_initial_tasks): If there are no input files,
13483 don't give a fatal error if we printed the version information.
13484 (queue_middle_tasks): If using -r with a shared object, give a
13485 fatal error rather than an ordinary error.
13487 2009-06-23 Ian Lance Taylor <iant@google.com>
13490 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13491 (Layout::make_output_section): Set have_stabstr_section_ if we see
13492 a .stab*str section.
13493 (Layout::finalize): Call link_stabs_sections.
13494 (Layout::link_stabs_sections): New file.
13495 * layout.h (class Layout): Add have_stabstr_section_ field.
13496 Declare link_stabs_sections.
13498 2009-06-23 Doug Kwan <dougkwan@google.com>
13500 * Makefile.am (libgold_a_LIBADD): New.
13501 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13502 * Makefile.in: Regenerate.
13503 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13504 * configure: Regenerate.
13505 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13506 * fileread.cc: Include sys/state.h
13507 * gold.h: Declare memmem and strndup if found missing.
13508 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13510 2009-06-23 Ian Lance Taylor <iant@google.com>
13512 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13513 * configure: Rebuild.
13515 2009-06-23 Ian Lance Taylor <iant@google.com>
13518 * object.cc (Object::section_contents): Don't try to get a view if
13519 the section has length zero.
13520 (Object::handle_gnu_warning_section): If the section is empty, use
13521 the name of the section as the warning.
13523 2009-06-23 Ian Lance Taylor <iant@google.com>
13526 * stringpool.h (class Stringpool_template): Add optimize_ field.
13527 (Stringpool_template::set_optimize): New function.
13528 * stringpool.cc (Stringpool_template::Stringpool_template):
13529 Initialize optimize_ field.
13530 (Stringpool_template::set_string_offsets): Test local optimize
13531 fild rather than parameter.
13532 * layout.cc (Layout::Layout): Call set_optimize on the section
13535 2009-06-22 Ian Lance Taylor <iant@google.com>
13538 * yyscript.y: Parse TARGET.
13539 * script.cc (script_set_target): New function.
13540 * script-c.h (script_set_target): Declare.
13541 * options.cc (General_options::string_to_object_format): Rename
13542 from string_to_object_format in anonymous namespace. Change
13544 * options.h (class General_options): Declare
13545 string_to_object_format.
13547 2009-06-22 Ian Lance Taylor <iant@google.com>
13549 * script-sections.cc (Script_sections::create_segments): Don't put
13550 program headers in a PT_LOAD segment if -n or -N.
13552 2009-06-22 Ian Lance Taylor <iant@google.com>
13555 * options.h (class General_options): Add -z lazy and -z now. Sort
13556 -z options into alphabetical order.
13557 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13559 2009-06-21 Ian Lance Taylor <iant@google.com>
13561 * layout.cc (Layout::make_output_section): Call
13562 Target::new_output_section.
13563 (Layout::attach_allocated_section_to_segment): Put large section
13564 sections in a separate load segment with the large segment flag
13566 (Layout::segment_precedes): Sort large data segments after other
13568 (align_file_offset): New static function.
13569 (Layout::set_segment_offsets): Use align_file_offset.
13570 * output.h (class Output_section): Add is_small_section_ and
13571 is_large_section_ fields.
13572 (Output_section::is_small_section): New function.
13573 (Output_section::set_is_small_section): New function.
13574 (Output_section::is_large_section): New function.
13575 (Output_section::set_is_large_section): New function.
13576 (Output_section::is_large_data_section): New function.
13577 (class Output_segment): Add is_large_data_segment_ field.
13578 (Output_segment::is_large_data_segment): New function.
13579 (Output_segment::set_is_large_data_segment): New function.
13580 * output.cc (Output_section::Output_section): Initialize new
13582 (Output_segment::Output_segment): Likewise.
13583 (Output_segment::add_output_section): Add assertion that large
13584 data sections always go in large data segments. Force small data
13585 sections to the end of the list of data sections. Force small BSS
13586 sections to the start of the list of BSS sections. For large BSS
13587 sections to the end of the list of BSS sections.
13588 * symtab.h (class Symbol): Declare is_common_shndx.
13589 (Symbol::is_defined): Check Symbol::is_common_shndx.
13590 (Symbol::is_common): Likewise.
13591 (class Symbol_table): Define enum Commons_section_type. Update
13592 declarations. Add small_commons_ and large_commons_ fields.
13593 * symtab.cc (Symbol::is_common_shndx): New function.
13594 (Symbol_table::Symbol_table): Initialize new fields.
13595 (Symbol_table::add_from_object): Put small and large common
13596 symbols in the right list.
13597 (Symbol_table::sized_finalized_symbol): Check
13598 Symbol::is_common_shndx.
13599 (Symbol_table::sized_write_globals): Likewise.
13600 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13601 common symbol lists. Don't call do_allocate_commons_list if the
13603 (Symbol_table::do_allocate_commons_list): Remove is_tls
13604 parameter. Add comons_section_type parameter. Change all
13605 callers. Handle small and large common symbols.
13606 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13607 Symbol::is_common_shndx.
13608 * resolve.cc (symbol_to_bits): Likewise.
13609 * target.h (Target::small_common_shndx): New function.
13610 (Target::small_common_section_flags): New function.
13611 (Target::large_common_shndx): New function.
13612 (Target::large_common_section_flags): New function.
13613 (Target::new_output_section): New function.
13614 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13615 small_common_section_flags, and large_common_section_flags
13617 (Target::do_new_output_section): New virtual function.
13618 * arm.cc (Target_arm::arm_info): Initialize new fields.
13619 * i386.cc (Target_i386::i386_info): Likewise.
13620 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13622 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13623 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13624 (Target_x86_64::do_new_output_section): New function.
13625 * configure.ac: Define conditional MCMODEL_MEDIUM.
13626 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13627 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13628 (large_LDFLAGS): Define.
13629 * testsuite/large.c: New file.
13630 * testsuite/testfile.cc (Target_test::test_target_info):
13631 Initialize new fields.
13632 * configure, testsuite/Makefile.in: Rebuild.
13634 2009-06-05 Doug Kwan <dougkwan@google.com>
13636 * Makefile.am (CCFILES): Add target.cc.
13637 * Makefile.in: Regenerate.
13638 * i386.cc (class Target_i386): Define new virtual method to
13639 override do_is_local_label_name in parent.
13640 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13641 local symbols if --discard-locals or -X is given.
13642 * options.h (class General_options): Declare new options
13643 '--discard-locals' and '-X' for discarding locals.
13644 * target.h (class Target): Define new methods is_local_label_name.
13645 Declare new virtual method do_is_local_label_name.
13646 * target.cc: New file.
13647 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13648 (check_SCRIPTS): Add discard_locals_test.sh.
13649 (check_DATA): Add discard_local_tests.syms.
13650 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13651 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13652 * testsuite/Makefile.in: Regenerate.
13653 * testsuite/discard_locals_test.c: New file.
13654 * testsuite/discard_locals_test.sh: Same.
13656 2009-06-05 Doug Kwan <dougkwan@google.com>
13658 * object.cc (Sized_relobj::Sized_relobj): Initialize
13659 discarded_eh_frame_shndx_ to -1U.
13660 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13662 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13663 a discarded .eh_frame section.
13664 (Sized_relobj::do_finalize_local_symbols): Ditto.
13665 * object.h (class Sized_relobj): Declare new member
13666 discarded_eh_frame_shndx_.
13667 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13668 (local_labels_test.o, local_labels_test): New rules.
13669 * testsuite/Makefile.in: Regenerate.
13671 2009-06-04 Doug Kwan <dougkwan@google.com>
13673 * layout.cc (Layout::section_name_mapping): Add mapping for
13674 special ARM sections.
13676 2009-06-03 Doug Kwan <dougkwan@google.com>
13678 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13679 (utils::has_overflow): Same.
13681 2009-06-03 Ian Lance Taylor <iant@google.com>
13683 * layout.cc (Layout::section_name_mapping): New array, replacing
13684 Layout::linkonce_mapping.
13685 (Layout::section_name_mapping_count): New variable, replacing
13686 Layout::linkonce_mapping_count.
13687 (Layout::linkonce_output_name): Remove.
13688 (Layout::output_section_name): Rewrite.
13689 * layout.h (class Layout): Rename Linkonce_mapping to
13690 Section_name_mapping, linkonce_mapping to section_name_mapping,
13691 linkonce_mapping_count to section_name_mapping_count. Don't
13692 declare linkonce_output_name.
13694 2009-06-03 Doug Kwan <dougkwan@google.com>
13696 * gold/arm.cc (namespace utils): New.
13697 (Target_arm::reloc_is_non_pic): Define new method.
13698 (class Arm_relocate_functions): New.
13699 (Target_arm::Relocate::relocate): Handle relocation types used by
13702 2009-06-03 Ian Lance Taylor <iant@google.com>
13704 * arm.cc (Target_arm::scan::global): Use || instead of |.
13706 2009-06-02 Doug Kwan <dougkwan@google.com>
13708 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13709 issued_non_pic_error_.
13710 (class Target_arm::Scan): Declare new method check_non_pic.
13711 Define new method symbol_needs_plt_entry.
13712 Declare new data member issued_non_pic_error_.
13713 (class Target_arm::Relocate): Declare new method
13714 should_apply_static_reloc.
13715 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13716 (Target_arm::Scan::check_non_pic): Define new method.
13717 (Target_arm::Scan::local): Handle a small subset of reloc types used
13719 (Target_arm::Scan::local): Same.
13720 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13722 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13724 * incremental.cc (Incremental_inputs::report_command_line): Filter
13725 out --incremental-* options.
13727 2009-05-29 Doug Kwan <dougkwan@google.com>
13729 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13731 (class Target_arm): Update comment.
13732 (Target_arm::Target_arm): Initialize new data members GOT_,
13733 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13734 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13735 and Target_arm::rel_dyn_section.
13736 Declare new_enum Target_arm::Got_type.
13737 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13739 Update commments for member do_dynsym_value.
13740 (Target_arm::got_size, Target_arm::plt_section,
13741 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13742 new methods inside class defintion.
13743 (Target_arm::got_section): Define new method.
13744 (Target_arm::rel_dyn_section): Same.
13745 (Output_data_plt_arm): New template class.
13746 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13747 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13748 (Output_data_plt_arm::add_entry): Same.
13749 (Output_data_plt_arm::first_plt_entry): Define new
13750 static data member for PLT instruction template.
13751 (Output_data_plt_arm::plt_entry): Same.
13752 (Output_data_plt_arm::do_write): Define new method.
13753 (Target_arm::make_plt_entry): Same.
13754 (Target_arm::do_finalize_sections): Same.
13755 (Target_arm::do_dynsym_value): Same.
13757 2009-05-28 Doug Kwan <dougkwan@google.com>
13759 * Makefile.am (TARGETSOURCES): Add arm.cc.
13760 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13761 * Makefile.in: Regenerate.
13762 * arm.cc: New file.
13763 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13765 2009-05-26 Doug Kwan <dougkwan@google.com>
13767 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13768 (General_options::check_excluded_libs): Strip off directories in
13769 archive name before matching like GNU ld does.
13770 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13771 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13772 (exclude_libs_test_LDFLAGS): Add linker option
13773 -Wl,--exclude-libs,libexclude_libs_test_3
13774 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13775 an explicit archive without using -l.
13776 (alt/libexclude_libs_test_3.a): New make rule.
13777 * testsuite/Makefile.in: Regenerate.
13778 * testsuite/exclude_libs_test.c : Declare lib3_default().
13780 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13781 * exclude_libs_test_3.c: New file.
13783 2009-05-26 Nick Clifton <nickc@redhat.com>
13785 * po/id.po: New Indonesian translation.
13786 * po/gold.pot: Updated template file.
13788 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13790 * testsuite/Makefile.am: Add -ffunction-sections to compile
13791 gc_comdat_test files. Add -Wl,--gc-sections to build
13793 * testsuite/Makefile.in: Regenerate.
13794 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13796 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13798 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13799 kept comdat section was garbage collected.
13800 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13801 * testsuite/Makefile.in: Regenerate.
13802 * testsuite/gc_comdat_test.sh: New file.
13803 * testsuite/gc_comdat_test_1.cc: New file.
13804 * testsuite/gc_comdat_test_2.cc: New file.
13806 2009-05-19 Doug Kwan <dougkwan@google.com>
13808 * archive.cc (Archive::Archive): Move constructor from archive.h
13809 to here. Initialize no_export_.
13810 (Archive::get_elf_object_for_member): Set no_export flag of object.
13811 * archive.h (Archive::Archive): Move constructor body to
13813 (Archive::no_export): New method.
13814 (Archive::no_export_): New field.
13815 * object.h (Object::Object): Initialize no_export_ to false.
13816 (Object::no_export, Object::set_no_export): New methods.
13817 (Object::no_export_): New field.
13818 * options.cc (General_options::parse_exclude_libs): New method.
13819 (General_options::check_excluded_libs) Same.
13820 * options.h (exclude_libs): New option.
13821 (General_options::check_excluded_libs): New method declaration.
13822 (General_options::excluded_libs_): New field.
13823 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13824 default or protected visibility if an object has no-export flag set.
13825 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13826 (check_SCRIPTS): Add exclude_libs_test.sh.
13827 (check_DATA): Add exclude_libs_test.syms.
13828 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13829 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13830 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13831 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13832 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13833 libexclude_libs_test_2.a): New rules.
13834 * testsuite/Makefile.in: Regenerate.
13835 * testsuite/exclude_libs_test.c: New file.
13836 * testsuite/exclude_libs_test.sh: Ditto.
13837 * testsuite/exclude_libs_test_1.c: Ditto.
13838 * testsuite/exclude_libs_test_2.c: Ditto.
13840 2009-05-15 Ian Lance Taylor <iant@google.com>
13842 * configure.ac: Check for declarations for cases where libiberty.h
13843 checks HAVE_DECL_xxx.
13844 * configure, config.in: Rebuild.
13846 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13848 * gold.h (Incremental_argument_list): Remove (invalid) forward
13850 * incremental.cc (Incremental_inputs::report_achive): New method.
13851 (Incremental_inputs::report_object): New method.
13852 (Incremental_inputs::report_script): New method.
13853 (Incremental_inputs::finalize_inputs): New method.
13854 (Incremental_inputs::finalize): Call finalize_inputs().
13855 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13856 Create inputs entries.
13857 * incremental.h (Incremental_input_type): New enum.
13858 (Incremental_inputs::Incremental_input): Initialize new fields.
13859 (Incremental_inputs::report_inputs): New method.
13860 (Incremental_inputs::report_achive): New method.
13861 (Incremental_inputs::report_object): New method.
13862 (Incremental_inputs::report_script): New method.
13863 (Incremental_inputs::finalize_inputs): New method.
13864 (Incremental_inputs::Input_info): New struct.
13865 (Incremental_inputs::Input_info_map): New typedef.
13866 (Incremental_inputs::lock_): New field.
13867 (Incremental_inputs::Inputs_): New field.
13868 (Incremental_inputs::Inputs_map): New field.
13869 * main.cc (main): Call Incremental_input::report_inputs.
13870 * options.h (Input_argument_list): Typedef moved from
13872 (Input_file_group::Files): Remove, use ::Input_argument_list.
13873 (Input_file_group::Input_argument_list): Remove, use
13874 ::Input_argument_list.
13875 * plugin.cc (Plugin_manager::add_input_file): Add error in
13877 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13879 * script.cc (read_input_script): Call
13880 Incremental_input::report_script.
13881 * script.h (Script_info): New class.
13883 2009-04-27 Ian Lance Taylor <iant@google.com>
13885 * x86_64.cc (do_adjust_output_section): Set entsize to
13888 2009-04-23 Elliott Hughes <enh@google.com>
13890 * output.cc (Output_file::close): After short writes, continue
13891 writing from the correct offset in the buffer being written.
13893 2009-04-23 Chris Demetriou <cgd@google.com>
13895 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13896 * configure: Regenerate.
13897 * config.in: Regenerate.
13898 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13899 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13901 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13903 * incremental.cc (Incremental_inputs_header_data): Renamed from
13904 Incremental_input_header_data.
13905 (Incremental_inputs_header_data::data_size): New field.
13906 (Incremental_inputs_header_data::put_input_file_count): Renamed
13907 from input_file_count.
13908 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13909 from command_line_offset.
13910 (Incremental_inputs_header_data::put_reserved): Renamed from
13912 (Incremental_inputs_entry_data): Renamed from
13913 Incremental_input_entry_data.
13914 (Incremental_inputs_entry_data::data_size): New field.
13915 (Incremental_inputs::report_command_line): New method.
13916 (Incremental_inputs::finalize): New method.
13917 (Incremental_inputs::create_incremental_inputs_data): New method.
13918 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13919 * incremental.h: New file.
13920 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13921 (Layout::finalize): Create incremental inputs section in
13922 incremental builds.
13923 (Layout::create_incremental_info_sections): New method.
13924 * layout.h (Layout::incremental_inputs): New method.
13925 (Layout::create_incremental_info_sections): New method.
13926 (Layout::incremental_inputs_): New field.
13927 * main.cc (main): Notify Incremental_input of the command line.
13929 2009-04-01 Ian Lance Taylor <iant@google.com>
13930 Mikolaj Zalewski <mikolajz@google.com>
13932 * gold.h (reserve_unordered_map): Define, three versions, one for
13933 each version of Unordered_map.
13934 * layout.cc (Layout::Layout): Remove options parameter. Add
13935 number_of_input_files parameter. Don't initialize options_.
13936 Initialize number_of_input_files_ and resized_signatures_. Move
13937 sections_are_attached_.
13938 (Layout::layout_group): Reserve space for group_signatures_.
13939 (Layout::find_or_add_kept_section): Change name parameter to be a
13940 reference. Resize signatures_ map when it gets large enough.
13941 (Layout::layout_eh_frame): Use parameters->options() instead of
13943 (Layout::make_output_section): Likewise.
13944 (Layout::attach_allocated_section_to_segment): Likewise.
13945 (Layout::finalize, Layout::create_executable_stack): Likewise.
13946 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13947 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13948 * layout.h (class Layout): Update declarations. Remove options_
13949 field. Add number_of_input_files_ and resized_signatures_
13950 fields. Move sections_are_attached_ field.
13951 * main.cc (main): Pass number of input files to Layout
13952 constructor. Don't pass options.
13954 2009-03-30 Ian Lance Taylor <iant@google.com>
13956 * ffsll.c (ffsll): Correct implementation.
13958 2009-03-27 Ian Lance Taylor <iant@google.com>
13960 * ffsll.c: New file.
13961 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13962 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13963 * ftruncate.c (ftruncate): Declare before definition.
13964 * mremap.c (mremap): Likewise.
13965 * pread.c (pread): Likewise.
13966 * configure, Makefile.in, config.in: Rebuild.
13968 * mremap.c: New file.
13969 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13970 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13971 (mremap): Declare if HAVE_MREMAP is not defined.
13972 * configure, Makefile.in, config.in: Rebuild.
13974 2009-03-27 Cary Coutant <ccoutant@google.com>
13976 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13977 position independent.
13978 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13979 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13981 2009-03-24 Cary Coutant <ccoutant@google.com>
13983 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13985 (needs_dynamic_reloc): Likewise.
13987 2009-03-24 Ian Lance Taylor <iant@google.com>
13989 * yyscript.y (file_cmd): Recognize EXTERN.
13990 (extern_name_list, extern_name_list_body): New nonterminals.
13991 * script.cc (script_add_extern): Define.
13992 * script-c.h (script_add_extern): Declare.
13994 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13996 * object.cc (is_elf_object): Define.
13997 * object.h (is_elf_object): Declare.
13998 * archive.cc (Archive::get_elf_object_for_member): Call
14000 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14002 2009-03-24 Elliott Hughes <enh@google.com>
14004 * output.cc (Output_file::map_anonymous): Define.
14005 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14006 try an anonymous one. Report the size if the mmap fails.
14007 * output.h (class Output_file): Declare map_anonymous.
14009 2009-03-24 Ian Lance Taylor <iant@google.com>
14011 * target-select.cc (instantiate_target): Don't acquire the lock if
14012 the instantiated_target_ field has already been set.
14014 2009-03-23 Ian Lance Taylor <iant@google.com>
14016 * gold-threads.h (class Initialize_lock): Define.
14017 * gold-threads.cc (class Initialize_lock_once): Define.
14018 (initialize_lock_control): New static variable.
14019 (initialize_lock_pointer): New static variable.
14020 (initialize_lock_once): New static function.
14021 (Initialize_lock::Initialize_lock): Define.
14022 (Initialize_lock::initialize): Define.
14023 * target-select.h: Include "gold-threads.h".
14024 (class Target_selector): Add lock_ and initialize_lock_ fields.
14025 Don't define instantiate_target, just declare it.
14026 * target-select.cc (Target_selector::Target_selector): Initialize
14028 (Target_selector::instantiate_target): Define.
14029 * descriptors.h: Include "gold-threads.h".
14030 (class Descriptors): Add initialize_lock_ field.
14031 * descriptors.cc (Descriptors::Descriptors): Initialize new
14033 (Descriptors::open): Use initialize_lock_ field
14034 * errors.h (class Errors): Add initialize_lock_ field.
14035 * errors.cc (Errors::Errors): Initialize new field.
14036 (Errors::initialize_lock): Use initialize_lock_ field.
14037 * powerpc.cc (class Target_selector_powerpc): Remove
14038 instantiated_target_ field. In do_recognize call
14039 instantiate_target rather than do_instantiate_target. In
14040 do_instantiate_target just allocate a new target.
14041 * sparc.cc (class Target_selector_sparc): Likewise.
14043 * freebsd.h: New file.
14044 * i386.cc: Include "freebsd.h".
14045 (Target_i386): Derive from Target_freebsd rather than
14047 (Target_selector_i386): Derive from Target_selector_freebsd rather
14048 than Target_selector.
14049 * x86_64.cc: Include "freebsd.h".
14050 (Target_x86_64): Derive from Target_freebsd rather than
14052 (Target_selector_x86_64): Derive from Target_selector_freebsd
14053 rather than Target_selector.
14054 * target.h (class Target): Add adjust_elf_header and
14055 do_adjust_elf_header.
14056 * output.cc (Output_file_header:: do_sized_write): Call target
14057 adjust_elf_header routine.
14058 * configure.tgt: Set targ_osabi.
14059 * configure.ac: Define GOLD_DEFAULT_OSABI.
14060 * parameters.cc (Parameters::default_target): Pass
14061 GOLD_DEFAULT_OSABI to select_target.
14062 * target-select.h (class Target_selector): Make instantiate_target
14063 protected rather than private.
14064 * Makefile.am (HFILES): Add freebsd.h.
14065 * configure, Makefile.in, config.in: Rebuild.
14067 * merge.cc (do_add_input_section): Correct pend value. Change
14068 message about last entry not being null terminated from error to
14071 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14073 * incremental.cc: New file.
14074 * Makefile.am (CCFILES): Add incremental.cc.
14075 * Makefile.in: Rebuild.
14077 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14079 * layout.cc (Layout::output_section_name): Preserve names
14080 of '.note.' sections.
14082 2009-03-19 Ian Lance Taylor <iant@google.com>
14084 * descriptors.cc (Descriptors::open): Check that the options are
14085 valid before using them.
14087 2009-03-18 Ian Lance Taylor <iant@google.com>
14089 * script-sections.h: Include <list>.
14090 (class Script_sections): Change Sections_elements from std::vector
14091 to std::list. Typedef public Elements_iterator. Add
14092 orphan_section_placement_, data_segment_align_start_, and
14093 saw_data_segment_align_ fields. Remove data_segment_align_index_
14095 * script-sections.cc (class Orphan_section_placement): New class.
14096 (class Sections_element): Add virtual functions is_relro and
14097 orphan_section_init. Remove virtual function place_orphan_here.
14098 (class Output_section_definition): Add is_relro and
14099 orphan_section_init. Remove place_orphan_here.
14100 (class Orphan_output_section): Likewise.
14101 (Script_sections::Script_sections): Update for field changes.
14102 (Script_sections::data_segment_align): Set saw_data_segment_align_
14103 and data_segment_align_start_, not data_segment_align_index.
14104 (Script_sections::data_segment_relro_end): Check
14105 saw_data_segment_align_. Use data_segment_align_start_ rather
14106 than data_segment_align_index_.
14107 (Script_sections::place_orphan): Rewrite to use
14108 Orphan_section_placement.
14110 2009-03-17 Ian Lance Taylor <iant@google.com>
14112 * archive.cc (Archive::add_symbols): Check for a version attached
14113 to the symbol name in the archive map.
14114 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14115 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14116 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14117 (ver_test_11.a): New target.
14118 * testsuite/Makefile.in: Rebuild.
14120 * configure.ac: Check for chsize and posix_fallocate. Replace
14122 * ftruncate.c: New file, from gnulib.
14123 * output.cc (posix_fallocate): Define dummy version if not
14124 HAVE_POSIX_FALLOCATE.
14125 (Output_file::map): Call posix_fallocate rather than lseek and
14127 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14128 * configure, Makefile.in, config.in: Rebuild.
14130 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
14132 * layout.h (Layout::create_note): Add section_name parameter.
14133 * layout.cc (Layout::create_note): Likewise.
14134 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
14136 2009-03-17 Ian Lance Taylor <iant@google.com>
14138 * descriptors.cc: Include "options.h".
14139 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14140 (Descriptors::open): Always use O_CLOEXEC when opening a new
14141 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14142 then set FD_CLOEXEC.
14144 * sparc.cc (class Target_sparc): Add has_got_section.
14145 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14146 make sure we have a GOT section.
14148 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14149 (Target_sparc::Scan::local): Likewise.
14150 (Target_sparc::Scan::global): Likewise.
14151 (Target_sparc::Relocate::relocate): Likewise.
14152 (Target_sparc::Relocate::relocate_tls): Likewise.
14154 * symtab.cc (Symbol_table::define_default_version): New function,
14155 broken out of add_from_object.
14156 (Symbol_table::add_from_object): Call define_default_version.
14157 (Symbol_table::define_special_symbol): Add resolve_oldsym
14158 parameter. Change all callers. If the version for a symbol comes
14159 from a version script, resolve it with the symbol with the same
14160 name with no version. Also add the symbol without a version if
14162 (do_define_in_output_data): If resolving with oldsym, don't delete
14164 (do_define_in_output_segment): Likewise.
14165 (do_define_as_constant): Likewise.
14166 * symtab.h (class Symbol_table): Update declarations.
14168 2009-03-13 Ian Lance Taylor <iant@google.com>
14170 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14171 (Read_symbols::requeue): New function.
14172 (Read_symbols::do_read_symbols): If make_elf_object fails because
14173 the target type is not configured, and the file was searched for,
14174 issue a warning and retry with the next directory.
14175 (Add_symbols::run): If the file has an incompatible format, and
14176 it was searched for, requeue the Read_symbols task. On error,
14177 release the object.
14178 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14179 dirindex parameter to constructor. Change all callers. Declare
14180 incompatible_warning and requeue.
14181 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14182 input_argument_ and input_group_ fields. Add them to
14183 constructor. Change all callers.
14184 (class Read_script): Add dirindex_ field. Add it to constructor.
14185 Change all callers.
14186 * archive.cc (Archive::setup): Remove input_objects parameter.
14187 Change all callers.
14188 (Archive::get_file_and_offset): Likewise.
14189 (Archive::read_all_symbols): Likewise.
14190 (Archive::read_symbols): Likewise.
14191 (Archive::get_elf_object_for_member): Remove input_objects
14192 parameter. Add punconfigured parameter. Change all callers.
14193 (Archive::add_symbols): Change return type to bool. Check return
14194 value of include_member.
14195 (Archive::include_all_members): Likewise.
14196 (Archive::include_member): Change return type to bool. Return
14197 false if first included object has incompatible target. Set
14198 included_member_ field.
14199 (Add_archive_symbols::run): If add_symbols returns false, requeue
14201 * archive.h (class Archive): Add included_member_ field.
14202 Initialize it in constructor. Add input_file and searched_for
14203 methods. Update declarations.
14204 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14205 input_argument_ fields. Add them to constructor. Change all
14207 * script.cc: Include "target-select.h".
14208 (class Parser_closure): Add skip_on_incompatible_target_ and
14209 found_incompatible_target_ fields. Add
14210 skip_on_incompatible_target parameter to constructor. Change all
14211 callers. Add methods skip_on_incompatible_target,
14212 clear_skip_on_incompatible_target, found_incompatible_target, and
14213 set_found_incompatible_target.
14214 (read_input_script): Add dirindex parameter. Change all callers.
14215 If parser finds an incompatible target, requeue Read_symbols
14217 (script_set_symbol): Clear skip_on_incompatible_target in
14219 (script_add_assertion, script_parse_option): Likewise.
14220 (script_start_sections, script_add_phdr): Likewise.
14221 (script_check_output_format): New function.
14222 * script.h (read_input_script): Update declaration.
14223 * script-c.h (script_check_output_format): Declare.
14224 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14225 (ignore_cmd): Remove OUTPUT_FORMAT.
14226 * fileread.cc (Input_file::Input_file): Add explicit this.
14227 (Input_file::will_search_for): New function.
14228 (Input_file::open): Add pindex parameter. Change all callers.
14229 * fileread.h (class Input_file): Add input_file_argument method.
14230 Declare will_search_for. Update declarations.
14231 * object.cc (make_elf_object): Add punconfigured parameter.
14232 Change all callers.
14233 * object.h (class Object): Make input_file public. Add
14234 searched_for method.
14235 (make_elf_object): Update declaration.
14236 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14238 * dirsearch.h (class Dirsearch): Update declaration.
14239 * options.h (class General_options): Add --warn-search-mismatch.
14240 * parameters.cc (Parameters::is_compatible_target): New function.
14241 * parameters.h (class Parameters): Declare is_compatible_target.
14242 * workqueue.cc (Workqueue::add_blocker): New function.
14243 * workqueue.h (class Workqueue): Declare add_blocker.
14245 * fileread.cc (Input_file::open): Remove options parameter.
14246 Change all callers.
14247 (Input_file::open_binary): Likewise.
14248 * script.cc (read_input_script): Likewise.
14249 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14250 options parameter from constructor. Change all callers.
14251 (class Read_script): Likewise.
14252 * fileread.h (class Input_file): Update declarations.
14253 * script.h (read_input_script): Update declaration.
14255 2009-03-10 Nick Clifton <nickc@redhat.com>
14257 * po/es.po: New Spanish translation.
14259 2009-03-06 Cary Coutant <ccoutant@google.com>
14261 * options.cc (parse_short_option): Keep dash_z from registering itself.
14263 2009-03-03 Ian Lance Taylor <iant@google.com>
14266 * target-reloc.h (relocate_section): Pass output_section to
14268 * i386.cc (Target_i386::should_apply_static_reloc): Add
14269 output_section parameter. Change all callers.
14270 (Target_i386::Relocate::relocate): Add output_section parameter.
14271 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14272 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14273 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14274 * testsuite/two_file_shared.sh: New script.
14275 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14276 (check_DATA): Add two_file_shared.dbg.
14277 (two_file_shared.dbg): New target.
14278 * testsuite/Makefile.in: Rebuild.
14280 2009-03-01 Ian Lance Taylor <iant@google.com>
14282 * configure.ac: Check for byteswap.h.
14283 * configure: Rebuild.
14284 * config.in: Rebuild.
14286 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14288 * layout.cc (Layout::find_or_add_kept_section): New function.
14289 (Layout::add_comdat): Removed.
14290 * layout.h (struct Kept_section): Move out of class Layout.
14291 Remove trailing underscores from field names. Add group_sections
14292 field. Rename group_ field to is_group. Change all uses.
14293 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14294 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14295 comdat_groups_ field.
14296 (Sized_relobj::include_section_group): Use
14297 find_or_add_kept_section and Kept_section::group_sections.
14298 (Sized_relobj::include_linkonce_section): Likewise.
14299 * object.cc (class Sized_relobj): Don't define Comdat_group or
14300 Comdat_group_table. Remove find_comdat_group and
14301 add_comdat_group. Remove comdat_groups_ field.
14302 * plugin.cc (include_comdat_group): Use
14303 Layout::find_or_add_kept_section.
14305 2009-02-28 Ian Lance Taylor <iant@google.com>
14307 * README: --gc-sections and map files are now supported. Document
14308 some build requirements.
14311 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14312 relocatable link set the value of the section symbol to zero.
14313 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14314 relocatable link don't include the section address in the local
14317 2009-02-27 Ian Lance Taylor <iant@google.com>
14320 * options.h (class Search_directory): Add is_system_directory.
14321 (class General_options): Declare is_in_system_directory.
14322 * options.cc (get_relative_sysroot): Make static.
14323 (get_default_sysroot): Make static.
14324 (General_optoins::is_in_system_directory): New function.
14325 * fileread.cc (Input_file::is_in_system_directory): New function.
14326 * fileread.h (class Input_file): Declare is_in_system_directory.
14327 * object.h (class Object): Add is_in_system_directory.
14328 (class Input_objects): Remove system_library_directory_ field.
14329 * object.cc (Input_objects::add_object): Don't set
14330 system_library_directory_.
14331 (input_objects::found_in_system_library_directory): Remove.
14332 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14333 parameter. Change all callers.
14334 (Symbol_table::sized_write_globals): Likewise.
14335 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14336 Call Object::is_in_system_directory.
14337 * symtab.h (class Symbol_table): Update declarations.
14340 * descriptors.h (Open_descriptor): Add is_on_stack field.
14341 * descriptors.cc (Descriptors::open): If the descriptor is on the
14342 top of the stack, remove it. Initialize is_on_stack field.
14343 (Descriptors::release): Only add pod to stack if it is not on the
14345 (Descriptors::close_some_descriptor): Clear stack_next and
14346 is_on_stack fields.
14349 * output.cc (Output_section::find_starting_output_address): Rename
14350 from starting_output_address; add PADDR parameter; change return
14352 * output.h (class Output_section): Declare
14353 find_starting_output_address instead of starting_output_address.
14354 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14355 section symbol for which we can't find a merge section.
14358 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14359 hidden or internal, force the symbol to be local.
14360 * resolve.cc (Symbol::override_visibility): Define.
14361 (Symbol::override_base): Use override_visibility.
14362 (Symbol_table::resolve): Likewise.
14363 (Symbol::override_base_with_special): Likewise.
14364 (Symbol_table::override_with_special): If the visibility is hidden
14365 or internal, force the symbol to be local.
14366 * symtab.h (class Symbol): Add set_visibility and
14367 override_visibility.
14368 * testsuite/ver_test_1.sh: New file.
14369 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14370 (check_DATA): Add ver_test_1.syms.
14371 (ver_test_1.syms): New target.
14372 * testsuite/Makefile.in: Rebuild.
14374 2009-02-25 Cary Coutant <ccoutant@google.com>
14376 * layout.cc (Layout::choose_output_section): Don't rename sections
14377 when using a linker script that has a SECTIONS clause.
14378 * Makefile.in: Regenerate.
14380 * testsuite/Makefile.am (script_test_5.sh): New test case.
14381 * testsuite/Makefile.in: Regenerate.
14382 * testsuite/script_test_5.cc: New file.
14383 * testsuite/script_test_5.sh: New file.
14384 * testsuite/script_test_5.t: New file.
14386 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
14388 * archive.cc (Archive::include_member): Update calls to add_symbols.
14389 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14390 the Layout argument.
14391 * dynobj.h (do_add_symbols): Add the Layout argument.
14392 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14394 * object.h (Object::add_symbols): Add the Layout argument.
14395 (Object::do_add_symbols): Add the Layout argument.
14396 (Sized_relobj::do_add_symbols): Add the Layout argument.
14397 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14398 Unify the two versions.
14399 (Add_plugin_symbols): Remove.
14400 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14401 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14402 (Add_plugin_symbols): Remove.
14403 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14404 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14405 (Add_symbols::run): Make it work with Pulginobj.
14407 2009-02-06 Ian Lance Taylor <iant@google.com>
14409 * object.cc (Sized_relobj::do_layout): Make info message start
14410 with lower case letter.
14412 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14414 * binary.cc: Fix file comment.
14416 * options.h (enum Incremental_disposition): Define.
14417 (class General_options): Add new options: --incremental,
14418 --incremental_changed, --incremental_unchanged,
14419 --incremental_unknown. Add incremental_disposition_ and
14420 implicit_incremental_ fields.
14421 (General_options::incremental_disposition): New function.
14422 (class Position_dependent_options): Add incremental_disposition
14424 (Position_dependent_options::copy_from_options): Set incremental
14426 * options.cc (General_options::parse_incremental_changed): New
14428 (General_options::parse_incremental_unchanged): New function.
14429 (General_options::parse_incremental_unknown): New function.
14430 (General_options::General_options): Initialize new fields
14431 incremental_disposition_ and implicit_incremental_.
14432 (General_options::finalize): Check for uasge of --incremental-*
14433 without --incremental.
14435 2009-02-06 Chris Demetriou <cgd@google.com>
14437 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14438 pointer and to report location as the file name associated with
14440 (gold_undefined_symbol_at_location): New function to replace the
14441 old gold_undefined_symbol functionality.
14442 * target-reloc.h (relocate_section): Update to use
14443 gold_undefined_symbol_at_location.
14444 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14445 Call gold_undefined_symbol function rather than gold_error.
14446 * errors.h (Errors::undefined_symbol): Take location as a
14447 string, rather than calculating it from a relocation.
14448 * errors.cc (Errors::fatal): Print "fatal error:" before the
14450 (Errors::error, Errors::error_at_location): Print "error: "
14451 before the formatted message.
14452 (Errors::undefined_symbol): Take location as a string, rather
14453 than calculating it from a relocation.
14454 (gold_undefined_symbol_at_location): New function akin to
14455 old gold_undefined_symbol, calculates location from relocation.
14456 (gold_undefined_symbol): Change to take only a Symbol pointer
14457 and to report location as the file name associated with the symbol.
14458 * testsuite/debug_msg.sh: Update for changed error messages.
14459 * testsuite/undef_symbol.sh: Likewise.
14461 2009-02-04 Duncan Sands <baldrick@free.fr>
14464 * reduced_debug_output.h
14465 (Output_reduced_debug_abbrev_section::failed): Use format for
14467 (Output_reduced_debug_info_section::faild): Likewise.
14469 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14471 * script.cc (Lazy_demangler): New class.
14472 (Version_script_info::get_symbol_version_helper): Demangle a
14475 2009-01-29 Cary Coutant <ccoutant@google.com>
14477 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14479 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14481 2009-01-28 Ian Lance Taylor <iant@google.com>
14483 * version.cc (version_string): Bump to 1.9.
14485 * gold.h: Include <cstring> and <stdint.h>.
14486 * version.cc: Include <cstdio>.
14487 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14489 * reduced_debug_output.cc (insert_into_vector): Rename from
14490 Insert_into_vector; change all callers. Use Swap_unaligned to
14491 avoid aliasing issue; remove union since it is unnecessary.
14493 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14495 * Makefile.am (CCFILES): Add gc.cc.
14496 (HFILES): Add gc.h.
14497 * Makefile.in: Regenerate.
14498 * gold.cc (Gc_runner): New class.
14499 (queue_initial_tasks): Call garbage collection related tasks
14500 when corresponding options are invoked.
14501 (queue_middle_gc_tasks): New function.
14502 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14503 processed early before laying out sections during garbage collection.
14504 * gold.h (queue_middle_gc_tasks): New function.
14505 (is_prefix_of): Move from "layout.cc".
14506 * i386.cc (Target_i386::gc_process_relocs): New function.
14507 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14508 * main.cc (main): Create object of class "Garbage_collection".
14509 * object.cc (Relobj::copy_symbols_data): New function.
14510 (Relobj::is_section_name_included): New function.
14511 (Sized_relobj::do_layout): Allow this function to be called twice
14512 during garbage collection and defer layout of section during the
14514 * object.h (Relobj::get_symbols_data): New function.
14515 (Relobj::is_section_name_included): New function.
14516 (Relobj::copy_symbols_data): New function.
14517 (Relobj::set_symbols_data): New function.
14518 (Relobj::get_relocs_data): New function.
14519 (Relobj::set_relocs_data): New function.
14520 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14521 (Relobj::gc_process_relocs): New function.
14522 (Relobj::do_gc_process_relocs): New pure virtual function.
14523 (Relobj::sd_): New data member.
14524 (Sized_relobj::is_output_section_offset_invalid): New function.
14525 (Sized_relobj::do_gc_process_relocs): New function.
14526 * options.h (General_options::gc_sections): Modify to not be a no-op.
14527 (General_options::print_gc_sections): New option.
14528 * plugin.cc (Plugin_finish::run): Remove function call to
14529 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14530 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14531 * reloc.cc (Read_relocs::run): Add task to process relocs and
14532 determine unreferenced sections when doing garbage collection.
14533 (Gc_process_relocs): New class.
14534 (Sized_relobj::do_gc_process_relocs): New function.
14535 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14536 sections that are garbage collected.
14537 * reloc.h (Gc_process_relocs): New class.
14538 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14539 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14540 symbols whose corresponding sections are garbage collected.
14541 (Symbol_table::Symbol_table): Add new parameter for the garbage
14543 (Symbol_table::gc_mark_undef_symbols): New function.
14544 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14545 (Symbol_table::gc_mark_dyn_syms): New function.
14546 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14548 (Symbol_table::add_from_object): Likewise.
14549 (Symbol_table::add_from_relobj): When building shared objects, do not
14550 treat externally visible symbols as garbage.
14551 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14552 table information for static and relocatable links.
14553 * symtab.h (Symbol_table::set_gc): New function.
14554 (Symbol_table::gc): New function.
14555 (Symbol_table::gc_mark_undef_symbols): New function.
14556 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14557 (Symbol_table::gc_mark_dyn_syms): New function.
14558 (Symbol_table::gc_): New data member.
14559 * target.h (Sized_target::gc_process_relocs): New pure virtual
14561 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14562 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14564 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14566 * options.h (General_options::gc_sections): Define as a no-op for now.
14567 (General_options::no_keep_memory): Ditto.
14568 (General_options::Bshareable): Define.
14569 * options.cc (General_options::finalize): Honor -Bshareable.
14571 2009-01-20 Andreas Schwab <schwab@suse.de>
14573 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14574 read the value in the contents, since we don't use it. Use the
14575 template endianness when writing.
14576 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14578 2009-01-19 Andreas Schwab <schwab@suse.de>
14580 * configure.tgt (powerpc64-*): Fix targ_obj.
14582 2009-01-15 Ian Lance Taylor <iant@google.com>
14584 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14585 local symbols when stripping all symbols.
14587 2009-01-14 Cary Coutant <ccoutant@google.com>
14589 * output.cc (Output_reloc): Add explicit instantiations.
14591 2009-01-14 Cary Coutant <ccoutant@google.com>
14593 * archive.cc (Archive::get_elf_object_for_member): Remove call
14594 to File_read::claim_for_plugin.
14595 * descriptors.cc (Descriptors::open): Remove reference to
14597 (Descriptors::claim_for_plugin): Remove.
14598 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14599 (Descriptors::is_claimed): Remove.
14600 (claim_descriptor_for_plugin): Remove.
14601 * fileread.cc (File_read::claim_for_plugin): Remove.
14602 * fileread.h (File_read::claim_for_plugin): Remove.
14603 (File_read::descriptor): Reopen descriptor if necessary.
14604 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14605 (Plugin_manager::all_symbols_read): Add task parameter. Change
14607 (Plugin_manager::get_input_file): New function.
14608 (Plugin_manager::release_input_file): New function.
14609 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14610 corresponding data member.
14611 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14612 and pass to base constructor. Change all callers.
14613 (get_input_file, release_input_file): New functions.
14614 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14615 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14616 (Plugin_manager::all_symbols_read): Add task parameter.
14617 (Plugin_manager::get_input_file): New function.
14618 (Plugin_manager::release_input_file): New function.
14619 (Plugin_manager::task_): New data member.
14620 (Pluginobj::Pluginobj): Add filesize parameter.
14621 (Pluginobj::filename): New function.
14622 (Pluginobj::descriptor): New function.
14623 (Pluginobj::filesize): New function.
14624 (Pluginobj::filesize_): New data member.
14625 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14626 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14627 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14629 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14630 with archive libraries.
14631 * testsuite/Makefile.in: Regenerate.
14632 * testsuite/plugin_test.c (struct sym_info): New type.
14633 (get_input_file, release_input_file): New static variables.
14634 (onload): Capture new transfer vector entries.
14635 (claim_file_hook): Stop reading at end of file according to filesize.
14636 Factor out parsing of readelf output into separate function.
14637 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14638 APIs and get the source file name from the symbol table. Convert
14639 source file name to corresponding object file name. Print info
14640 message when adding new input files.
14641 (parse_readelf_line): New function.
14642 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14643 * testsuite/plugin_test_2.sh: Likewise.
14644 * testsuite/plugin_test_3.sh: Likewise.
14645 * testsuite/plugin_test_4.sh: New test case.
14647 2009-01-07 Ian Lance Taylor <iant@google.com>
14649 * version.cc (version_string): Bump to 1.8.
14651 2008-12-23 Cary Coutant <ccoutant@google.com>
14653 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14654 * plugin.cc (Plugin_manager::finish): Rename as
14655 layout_deferred_objects. Move cleanup to separate function.
14656 (Plugin_manager::cleanup): New function.
14657 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14659 * plugin.h (Plugin_manager::finish): Rename as
14660 layout_deferred_objects.
14661 (Plugin_manager::cleanup): New function.
14662 (Plugin_manager::cleanup_done): New field.
14664 2008-12-23 Cary Coutant <ccoutant@google.com>
14666 * plugin.cc (is_visible_from_outside): New function.
14667 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14668 so we don't return "IR only" status for exported symbols or -r links.
14670 * testsuite/Makefile.am (plugin_test_3): New test case.
14671 * testsuite/Makefile.in: Regenerate.
14672 * testsuite/plugin_test_3.sh: New file.
14674 2008-12-22 Cary Coutant <ccoutant@google.com>
14676 * object.cc (Sized_relobj::layout_section): New function.
14677 (Sized_relobj::do_layout): Defer layout of input sections until after
14678 plugin has provided replacement files.
14679 (Sized_relobj::do_layout_deferred_sections): New function.
14680 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14681 (Relobj::layout_deferred_sections): New function.
14682 (Relobj::do_layout_deferred_sections): New function.
14683 (Sized_relobj::do_layout_deferred_sections): New function.
14684 (Sized_relobj::layout_section): New function.
14685 (Sized_relobj::Deferred_layout): New structure.
14686 (Sized_relobj::deferred_layout_): New field.
14687 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14688 Change all callers. Layout deferred sections.
14689 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14691 (Plugin_hook::run): Move code from do_plugin_hook inline.
14692 (Plugin_hook::do_plugin_hook): Remove.
14693 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14694 (Plugin_manager::finish): Renamed, was cleanup.
14695 (Plugin_manager::should_defer_layout): New function.
14696 (Plugin_manager::add_deferred_layout_object): New function.
14697 (Plugin_manager::Deferred_layout_list): New type.
14698 (Plugin_manager::deferred_layout_objects_): New field.
14699 (Plugin_hook::do_plugin_hook): Remove.
14701 2008-12-17 Ian Lance Taylor <iant@google.com>
14703 * options.h (class General_options): Add --no case for
14706 2008-12-16 Cary Coutant <ccoutant@google.com>
14708 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14710 (Plugin_manager::claim_file): Create plugin object even if
14711 plugin did not call the add_symbols callback.
14712 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14713 asking for more symbols than were added.
14714 * testsuite/Makefile.am (plugin_test_1): Add test case with
14716 (empty.syms): New target.
14717 * testsuite/Makefile.in: Regenerate.
14718 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14719 message. Don't call add_symbols if no globals.
14720 (all_symbols_read_hook): Don't provide replacement for empty
14723 2008-12-12 Ian Lance Taylor <iant@google.com>
14725 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14726 r_type == 0 for a local symbol with r_sym == 0.
14727 (scan_relocatable_relocs): Pass r_sym to
14728 local_non_section_strategy.
14729 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14732 * configure.ac: Update test for TLS descriptors: they are
14733 supported as of glibc 2.9.
14734 * configure: Rebuild.
14736 2008-12-11 Ian Lance Taylor <iant@google.com>
14739 * target-reloc.h (Default_scan_relocatable_relocs): For each
14740 function, map r_type == 0 to RELOC_DISCARD.
14742 2008-12-10 Cary Coutant <ccoutant@google.com>
14744 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14745 object to override a kept COMDAT group from a plugin object.
14747 2008-12-09 Ian Lance Taylor <iant@google.com>
14750 * yyscript.y (file_cmd): Handle INPUT.
14752 * testsuite/initpri1.c: Change all declarations to be full
14753 prototypes by adding void, to avoid compiler warnings.
14755 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14757 * options.cc (General_options::parse_plugin_opt): New.
14758 (General_options::add_plugin): The argument now is just the filename.
14759 (General_options::add_plugin_option): New.
14760 * options.h (plugin_opt): New.
14761 (add_plugin): Change argument name.
14762 (add_plugin_option): New.
14763 * plugin.cc (Plugin::load): Don't parse the plugin option.
14764 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14765 (Plugin::add_option): New.
14766 (Plugin::args_): Change type.
14767 (Plugin::filename_): New.
14768 (Plugin_manager::add_plugin_option): New.
14769 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14770 * testsuite/Makefile.in: Regenerate.
14772 2008-12-05 Cary Coutant <ccoutant@google.com>
14774 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14775 Handle --strip-lto-sections option.
14776 * options.h (strip_lto_sections): New option.
14778 2008-12-01 Cary Coutant <ccoutant@google.com>
14780 * plugin.cc (ld_plugin_message): Change format parameter to const.
14781 Fix mismatch between new[] and delete.
14783 2008-11-14 Cary Coutant <ccoutant@google.com>
14785 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14788 2008-11-05 Craig Silverstein <csilvers@google.com>
14790 * options.cc (General_options::parse_dynamic_list): New function.
14791 * options.h (General_options): New flags dynamic_list,
14792 dynamic_list_data, dynamic_list_cpp_new, and
14793 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14794 (General_options::in_dynamic_list): New function.
14795 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14796 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14797 (Lex::can_continue_name): Likewise.
14799 (read_script_file): New parameter script_options.
14800 (read_dynamic_list): New function.
14801 (Script_options::define_dynamic_list): New function.
14802 (dynamic_list_keyword_parsecodes): New variable.
14803 (dynamic_list_keywords): New variable.
14804 * script.h (Script_options::define_dynamic_list): New function
14806 (read_dynamic_list): New function prototype.
14807 * symtab.cc (strprefix): New macro.
14808 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14809 dynamic_list_data, dynamic_list_cpp_new, and
14810 dynamic_list_cpp_typeinfo.
14811 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14812 (dynamic_list_expr): New rule.
14813 (dynamic_list_nodes): Likewise.
14814 (dynamic_list_node): Likewise.
14815 * testsuite/Makefile.am (dynamic_list): New test.
14816 * testsuite/Makefile.in: Regenerated.
14817 * testsuite/dynamic_list.t: New file.
14818 * testsuite/dynamic_list.sh: New file.
14820 2008-11-05 Craig Silverstein <csilvers@google.com>
14822 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14823 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14824 (t11_last): Likewise.
14825 * testsuite/ver_test_6.c (main): Likewise.
14827 2008-10-07 Cary Coutant <ccoutant@google.com>
14829 * options.c (General_options::finalize): Add check for -static and
14831 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14834 2008-10-02 Cary Coutant <ccoutant@google.com>
14836 * plugin.cc (make_sized_plugin_object): Fix conditional
14837 compilation to work when not all targets are enabled.
14839 2008-09-29 Cary Coutant <ccoutant@google.com>
14841 * archive.cc (Archive::get_file_and_offset): Use filename instead
14842 of name to get library path.
14843 (Archive::include_member): Unlock external member of a thin archive.
14845 * testsuite/Makefile.am (TEST_AR): New variable.
14846 (thin_archive_test_1): New test.
14847 (thin_archive_test_2): New test.
14848 * testsuite/Makefile.in: Regenerate.
14849 * testsuite/thin_archive_main.cc: New file.
14850 * testsuite/thin_archive_test_1.cc: New file.
14851 * testsuite/thin_archive_test_2.cc: New file.
14852 * testsuite/thin_archive_test_3.cc: New file.
14853 * testsuite/thin_archive_test_4.cc: New file.
14855 2008-09-29 Cary Coutant <ccoutant@google.com>
14857 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14858 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14860 (Sized_relobj::do_finalize_local_symbols): Likewise.
14861 (Sized_relobj::map_to_kept_section): Likewise.
14862 * object.h (Sized_relobj::invalid_address): New constant.
14863 (Sized_relobj::do_output_section_offset): Check for invalid_address
14865 * output.cc (Output_reloc::local_section_offset): Use constant
14866 invalid_address instead of -1U.
14867 (Output_reloc::get_address): Likewise.
14868 (Output_section::output_address): Change -1U to -1ULL.
14869 * output.h (Output_reloc::invalid_address): New constant.
14870 * reloc.cc (Sized_relobj::write_sections): Use constant
14871 invalid_address instead of -1U.
14872 (Sized_relobj::relocate_sections): Likewise.
14873 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14874 values for merge sections.
14875 * target-reloc.h (relocate_for_relocatable): Use constant
14876 invalid_address instead of -1U.
14878 2008-09-19 Cary Coutant <ccoutant@google.com>
14880 Add plugin functionality for link-time optimization (LTO).
14881 * configure.ac (plugins): Add --enable-plugins option.
14882 * configure: Regenerate.
14883 * config.in: Regenerate.
14884 * Makefile.am (LIBDL): New variable.
14885 (CCFILES): Add plugin.cc.
14886 (HFILES): Add plugin.h.
14887 (ldadd_var): Add LIBDL.
14888 * Makefile.in: Regenerate.
14890 * archive.cc: Include "plugin.h".
14891 (Archive::setup): Don't preread archive symbols when using a plugin.
14892 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14893 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14895 (Archive::include_member): Add symbols from plugin objects.
14896 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14897 * descriptors.cc (Descriptors::open): Check for file descriptors
14898 abandoned by plugins.
14899 (Descriptors::claim_for_plugin): New function.
14900 * descriptors.h (Descriptors::claim_for_plugin): New function.
14901 (Open_descriptor::is_claimed): New field.
14902 (claim_descriptor_for_plugin): New function.
14903 * fileread.cc (File_read::claim_for_plugin): New function.
14904 * fileread.h (File_read::claim_for_plugin): New function.
14905 (File_read::descriptor): New function.
14906 * gold.cc: Include "plugin.h".
14907 (queue_initial_tasks): Add task to call plugin hooks for generating
14909 * main.cc: Include "plugin.h".
14910 (main): Load plugin libraries.
14911 * object.h (Pluginobj): Declare.
14912 (Object::pluginobj): New function.
14913 (Object::do_pluginobj): New function.
14914 (Object::set_target): New function.
14915 * options.cc: Include "plugin.h".
14916 (General_options::parse_plugin): New function.
14917 (General_options::General_options): Initialize plugins_ field.
14918 (General_options::add_plugin): New function.
14919 * options.h (Plugin_manager): Declare.
14920 (General_options): Add --plugin option.
14921 (General_options::has_plugins): New function.
14922 (General_options::plugins): New function.
14923 (General_options::add_plugin): New function.
14924 (General_options::plugins_): New field.
14925 * plugin.cc: New file.
14926 * plugin.h: New file.
14927 * readsyms.cc: Include "plugin.h".
14928 (Read_symbols::do_read_symbols): Check for archive before checking
14929 for ELF file. Call plugin hooks to claim files.
14930 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14931 from a real object file; force override when processing replacement
14933 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14934 (Symbol::init_base_object): Likewise.
14935 (Symbol::init_base_output_data): Likewise.
14936 (Symbol::init_base_output_segment): Likewise.
14937 (Symbol::init_base_constant): Likewise.
14938 (Symbol::init_base_undefined): Likewise.
14939 (Symbol::output_section): Assert that object is not a plugin.
14940 (Symbol_table::add_from_pluginobj): New function.
14941 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14943 (Symbol_table::sized_write_globals): Likewise.
14944 (Symbol_table::add_from_pluginobj): Instantiate template.
14945 * symtab.h (Sized_pluginobj): Declare.
14946 (Symbol::in_real_elf): New function.
14947 (Symbol::set_in_real_elf): New function.
14948 (Symbol::in_real_elf_): New field.
14949 (Symbol_table::add_from_pluginobj): New function.
14951 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14952 (LIBDL): New variable.
14953 (LDADD): Add LIBDL.
14954 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14955 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14956 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14957 (MOSTLYCLEANFILES): Likewise.
14958 * testsuite/Makefile.in: Regenerate.
14959 * testsuite/plugin_test.c: New file.
14960 * testsuite/plugin_test_1.sh: New file.
14961 * testsuite/plugin_test_2.sh: New file.
14963 2008-09-16 Ian Lance Taylor <iant@google.com>
14965 * target-reloc.h (relocate_section): Check whether a symbol is
14966 defined by the ABI before reporting an undefined symbol error.
14967 * target.h (Target::is_defined_by_abi): Make parameter const.
14968 (Target::do_is_defined_by_abi): Likewise.
14969 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14970 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14971 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14972 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14973 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14974 * testsuite/Makefile.in: Rebuild.
14976 * fileread.cc (make_view): Add casts to avoid warning.
14978 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14980 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14981 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14983 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14985 * options.h (General_options::output_is_executable): New.
14986 (General_options::output_is_pie): New.
14987 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14988 for shared libraries.
14989 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14991 2008-09-11 Chris Demetriou <cgd@google.com>
14993 * options.h (origin): New -z option.
14994 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14995 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14998 2008-09-05 Cary Coutant <ccoutant@google.com>
15000 * fileread.cc (File_read::make_view): Add check for attempt to map
15001 beyond end of file.
15003 2008-09-05 Cary Coutant <ccoutant@google.com>
15005 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15006 explicit instantiations.
15008 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15011 * options.cc (General_options::finalize): Allow undefined symbols
15012 in shlibs if linking -shared.
15015 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15016 symbols as not needing a dynsym entry.
15018 2008-08-20 Craig Silverstein <csilvers@google.com>
15020 * fileread.cc (File_read::open): Do not lock the file unless it
15021 was successfully opened.
15023 2008-08-14 Cary Coutant <ccoutant@google.com>
15025 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15026 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15027 * testsuite/tls_test.cc (struct int128): 128-bit struct
15028 for testing TLS relocs with non-zero addend.
15029 (v12): New TLS variable.
15031 (t_last): Add check for v12.
15032 * testsuite/tls_test.h (t12): New function.
15033 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15035 2008-08-13 Ian Lance Taylor <iant@google.com>
15037 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15038 set tls_segment_ or relro_segment_.
15039 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15041 * output.h (Output_section::clear_is_relro): New function.
15042 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15043 sections specially even when output_data_ is empty.
15044 (Output_segment::maximum_alignment): When first section is relro,
15045 only force alignment for PT_LOAD segments.
15046 * script.cc (script_data_segment_align): New function.
15047 (script_data_segment_relro_end): New function.
15048 * script-c.h (script_data_segment_align): Declare.
15049 (script_data_segment_relro_end): Declare.
15050 * script-sections.h (class Script_sections): Declare
15051 data_segment_align and data_segment_relro_end. Add fields
15052 segment_align_index_ and saw_relro_end_.
15053 * script-sections.cc (class Sections_element): Add set_is_relro
15054 virtual function. Add new bool* parameter to place_orphan_here.
15055 Add get_output_section virtual function.
15056 (class Output_section_definition): Add set_is_relro. Add new
15057 bool* parameter to place_orphan_here. Add get_output_section.
15058 Add is_relro_ field.
15059 (Output_section_definition::Output_section_definition): Initialize
15060 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15061 and is_relro_ fields.
15062 (Output_section_definition::place_orphan_here): Add is_relro
15064 (Output_section_definition::set_section_addresses): Set relro for
15066 (Output_section_definition::alternate_constraint): Likewise.
15067 (class Orphan_output_section): Add new bool* parameter to
15068 place_orphan_here. Add get_output_section.
15069 (Orphan_output_section::place_orphan_here): Add is_relro
15071 (Script_sections::Script_sections): Initialize
15072 data_segment_align_index_ and saw_relro_end_.
15073 (Script_sections::data_segment_align): New function.
15074 (Script_sections::data_segment_relro_end): New function.
15075 (Script_sections::place_orphan): Set or clear is_relro.
15076 (Script_sections::set_section_addresses): Force alignment of first
15078 * yyscript.y (exp): Call script_data_segment_align and
15079 script_data_segment_relro_end.
15080 * testsuite/relro_script_test.t: New file.
15081 * testsuite/relro_test.cc (using_script): Declare.
15082 (t1, t2): Test using_script.
15083 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15084 (relro_script_test_SOURCES): Define.
15085 (relro_script_test_DEPENDENCIES): Define.
15086 (relro_script_test_LDFLAGS): Define.
15087 (relro_script_test_LDADD): Define.
15088 (relro_script_test.so): New target.
15089 * testsuite/Makefile.in: Rebuild.
15091 2008-08-06 Cary Coutant <ccoutant@google.com>
15093 * archive.cc (Archive::total_archives, Archive::total_members)
15094 (Archive::total_members_loaded): New variables.
15095 (Archive::setup): Add parameter. Add option to preread
15097 (Archive::read_armap): Add counter.
15098 (Archive::get_file_and_offset): New function.
15099 (Archive::get_elf_object_for_member): New function.
15100 (Archive::read_all_symbols): New function.
15101 (Archive::read_symbols): New function.
15102 (Archive::add_symbols): Add counters.
15103 (Archive::include_all_members): Use armap to find members if it's
15105 (Archive::include_member): Skip reading symbols if already read.
15106 Factored code into Archive::get_file_and_offset and
15107 Archive::get_elf_object_for_member. Changed call to
15108 Mapfile::report_include_archive_member.
15109 (Archive::print_stats): New function.
15110 * archive.h: Declare Object and Read_symbols_data classes.
15111 (Archive::Archive): Add initializers for new members.
15112 (Archive::setup): Add parameter.
15113 (Archive::print_stats): New function.
15114 (Archive::total_archives, Archive::total_members)
15115 (Archive::total_members_loaded): New variables.
15116 (Archive::get_file_and_offset): New function.
15117 (Archive::get_elf_object_for_member): New function.
15118 (Archive::read_all_symbols): New function.
15119 (Archive::read_symbols): New function.
15120 (Archive::Archive_member): New class.
15121 (Archive::members_): New member.
15122 (Archive::num_members_): New member.
15123 * main.cc: Include archive.h.
15124 (main): Call Archive::print_stats.
15125 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15126 archive parameter; member_name is now the fully-decorated name.
15127 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15128 * options.h: (General_options): Add --preread-archive-symbols option.
15129 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15132 2008-08-04 Ian Lance Taylor <iant@google.com>
15134 * symtab.h (Symbol::use_plt_offset): New function.
15135 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15136 * powerpc.cc (Relocate::relocate): Likewise.
15137 * sparc.cc (Relocate::relocate): Likewise.
15138 * x86_64.cc (Relocate::relocate): Likewise.
15139 * testsuite/weak_plt.sh: New test.
15140 * testsuite/weak_plt_main.cc: New test.
15141 * testsuite/weak_plt_shared.cc: New test.
15142 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15143 (check_PROGRAMS): Add weak_plt.
15144 (check_DATA): Add weak_plt_shared.so.
15145 (weak_plt_main_pic.o, weak_plt): New targets.
15146 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15147 * testsuite/Makefile.in: Rebuild.
15149 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15151 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15152 * testsuite/Makefile.in: Rebuild.
15154 2008-08-04 Alan Modra <amodra@bigpond.net.au>
15156 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15157 * Makefile.in: Regenerate.
15158 * po/POTFILES.in: Regenerate.
15160 2008-07-29 Ian Lance Taylor <iant@google.com>
15162 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15163 symbols before other symbols.
15164 * testsuite/script_test_2.cc (test_addr): Declare.
15165 (test_addr_alias): Declare.
15166 (main): Check that test_addr and test_addr_alias have the right
15168 * testsuite/script_test_2.t: Define test_addr_alias and
15171 2008-07-24 Ian Lance Taylor <iant@google.com>
15174 * descriptors.cc: New file.
15175 * descriptors.h: New file.
15176 * gold-threads.h (class Hold_optional_lock): New class.
15177 * fileread.cc: Include "descriptors.h".
15178 (File_read::~File_read): Release descriptor rather than closing
15180 (File_read::open) [file]: Call open_descriptor rather than open.
15181 Set is_descriptor_opened_.
15182 (File_read::open) [memory]: Assert that descriptor is not open.
15183 (File_read::reopen_descriptor): New function.
15184 (File_read::release): Release descriptor.
15185 (File_read::do_read): Make non-const. Reopen descriptor.
15186 (File_read::read): Make non-const.
15187 (File_read::make_view): Reopen descriptor.
15188 (File_read::do_readv): Likewise.
15189 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15190 Update declarations.
15191 * layout.cc: Include "descriptors.h".
15192 (Layout::create_build_id): Use open_descriptor rather than open.
15193 * output.cc: Include "descriptors.h".
15194 (Output_file::open): Use open_descriptor rather than open.
15195 * archive.cc (Archive::const_iterator): Change Archive to be
15197 (Archive::begin, Archive::end): Make non-const.
15198 (Archive::count_members): Likewise.
15199 * archive.h (class Archive): Update declarations.
15200 * object.h (Object::read): Make non-const.
15201 * Makefile.am (CCFILES): Add descriptors.cc.
15202 (HFILES): Add descriptors.h.
15203 * Makefile.in: Rebuild.
15206 * gold.h: Always include <clocale>. Add Solaris workarounds
15207 following code in binutils/sysdep.h.
15210 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15211 this->eh_frame_hdr_ is NULL before using it.
15213 * dynobj.cc (Versions::Versions): Update comment.
15215 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15216 the base version name.
15218 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15219 array size plus one.
15220 (Stringpool_template::set_string_offsets): Subtract one from key
15221 before using it as an array index.
15222 (Stringpool_template::get_offset_with_length): Likewise.
15223 (Stringpool_template::write_to_buffer): Likewise.
15224 * stringpool.h (Stringpool_template::get_offset_from_key):
15227 2008-07-23 Ian Lance Taylor <iant@google.com>
15230 * object.h (Merged_symbol_value::value): Do our best to handle a
15234 * script.cc (Version_script_info::get_versions): Don't add empty
15235 version tag to return value.
15236 (Version_script_info::get_symbol_version_helper): Change return
15237 type to bool. Add pversion parameter. Change all callers.
15238 (script_register_vers_node): Don't require a non-NULL tag.
15239 * script.h (class Version_script_info): Update declarations.
15240 (Version_script_info::get_symbol_version): Change return type to
15241 bool. Add version parameter. Change all callers.
15242 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15243 handling. Handle an empty version from a version script.
15244 (Symbol_table::define_special_symbol): Likewise.
15245 * testsuite/ver_test_10.script: New file.
15246 * testsuite/ver_test_10.sh: New file.
15247 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15248 (check_DATA): Add ver_test_10.syms.
15249 (ver_test_10.syms, ver_test_10.so): New target.
15250 * testsuite/Makefile.in: Rebuild.
15252 2008-07-23 Simon Baldwin <simonb@google.com>
15254 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15255 to zero for undefined symbols from dynamic libraries.
15257 2008-07-23 Ian Lance Taylor <iant@google.com>
15259 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15260 Change all callers.
15261 * symtab.h (class Symbol_table): Update declaration.
15262 * testsuite/ver_test_9.cc: New file.
15263 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15264 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15265 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15266 (ver_test_9.so, ver_test_9.o): New targets.
15267 * testsuite/Makefile.in: Rebuild.
15269 2008-07-22 Ian Lance Taylor <iant@google.com>
15271 * options.h (class General_options): Define --check-sections.
15272 * layout.cc (Layout::set_segment_offsets): Handle
15275 * options.h (class General_options): Define -n/--nmagic and
15277 * options.cc (General_options::finalize): For -n/--nmagic or
15278 -N/--omagic, set -static.
15279 * layout.cc (Layout::attach_allocated_section_to_segment): If
15280 -N/--omagic, don't put read-only and read-write sections in
15281 different segments.
15282 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15283 finding a read-only segment.
15284 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15285 don't set the minimum segment alignment to the common page size,
15286 and don't set the file offset to the address modulo the page size.
15287 * script-sections.cc (Script_sections::create_segments): If
15288 -n/--omagic, don't put read-only and read-write sections in
15289 different segments.
15291 * cref.cc: New file.
15292 * cref.h: New file.
15293 * options.h (class General_options): Add --print-symbol-counts.
15294 * main.cc (main): Issue defined symbol report if requested.
15295 * archive.cc (Archive::interpret_header): Make into a const member
15297 (Archive::add_symbols): Call Input_objects::archive_start and
15299 (Archive::const_iterator): Define new class.
15300 (Archive::begin, Archive::end): New functions.
15301 (Archive::include_all_members): Rewrite to use iterator.
15302 (Archive::count_members): New function.
15303 * archive.h (class Archive): Update declarations.
15304 (Archive::filename): New function.
15305 * object.cc: Include "cref.h".
15306 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15307 (Sized_relobj::do_get_global_symbol_counts): New function.
15308 (Input_objects::add_object): Add object to cross-referencer.
15309 (Input_objects::archive_start): New function.
15310 (Input_objects::archive_stop): New function.
15311 (Input_objects::print_symbol_counts): New function.
15312 * object.h: Declare Cref and Archive.
15313 (Object::get_global_symbol_counts): New function.
15314 (Object::do_get_global_symbol_counts): New pure virtual function.
15315 (class Sized_relobj): Add defined_count_ field. Update
15317 (class Input_objects): Add cref_ field. Update constructor.
15318 Update declarations.
15319 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15321 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15323 (Sized_dynobj::do_get_global_symbol_counts): New function.
15324 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15325 defined_count_. Update declarations. Define Symbols typedef.
15326 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15327 parameter. Change all callers.
15328 (Symbol_table::add_from_dynobj): Add sympointers and defined
15329 parameters. Change all callers.
15330 * symtab.h (class Symbol_table): Update declarations.
15331 * Makefile.am (CCFILES): Add cref.cc.
15332 (HFILES): Add cref.h.
15333 * Makefile.in: Rebuild.
15335 2008-07-22 Simon Baldwin <simonb@google.com>
15337 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15338 to zero when writing undefined symbols.
15340 2008-07-22 Ian Lance Taylor <iant@google.com>
15342 * output.cc (Output_section::add_input_section): Don't try to
15343 merge empty merge sections.
15345 2008-07-21 Craig Silverstein <csilvers@google.com>
15347 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15348 Include symbol version in error message.
15350 2008-07-20 Chris Demetriou <cgd@google.com>
15352 * configure.ac (gold_cv_c_random_seed): New configured variable.
15353 (RANDOM_SEED_CFLAGS): New substituted variable.
15354 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15355 * configure: Rebuild.
15356 * Makefile.in: Likewise.
15357 * testsuite/Makefile.in: Likewise.
15359 2008-07-18 Ian Lance Taylor <iant@google.com>
15361 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15362 where we see NAME/NULL and NAME/VERSION as separate symbols.
15363 * testsuite/ver_test_main.cc (main): Call t4.
15364 (t4, t4_2a): Define.
15365 * testsuite/ver_test_2.cc (t4_2): Define.
15366 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15367 * testsuite/ver_test_4.cc (t4_2a): Define.
15368 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15369 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15371 2008-07-17 Ian Lance Taylor <iant@google.com>
15373 * dynobj.cc (Versions::add_def): If we give an error about a
15374 missing version, go ahead and create the version anyhow.
15376 2008-07-10 Ian Lance Taylor <iant@google.com>
15378 Handle output sections with more than 0x7fffffff bytes.
15379 * object.h (class Relobj): Change map_to_output_ to
15380 output_sections_, and just keep a section pointer. Change all
15381 uses. Move comdat group support to Sized_relobj.
15382 (Relobj::is_section_specially_mapped): Remove.
15383 (Relobj::output_section): Remove poff parameter. Change all
15385 (Relobj::output_section_offset): New function.
15386 (Relobj::set_section_offset): Rewrite.
15387 (Relobj::map_to_output): Remove.
15388 (Relobj::output_sections): New function.
15389 (Relobj::do_output_section_offset): New pure virtual function.
15390 (Relobj::do_set_section_offset): Likewise.
15391 (class Sized_relobj): Add section_offsets_ field. Add comdat
15392 group support from Relobj. Update declarations.
15393 (Sized_relobj::get_output_section_offset): New function.
15394 (Sized_relobj::do_output_section_offset): New function.
15395 (Sized_relobj::do_set_section_offset): New function.
15396 * object.cc (Relobj::output_section_address): Remove.
15397 (Sized_relobj::Sized_relobj): Initialize new fields.
15398 (Sized_relobj::include_section_group): Cast find_kept_object to
15400 (Sized_relobj::include_linkonce_section): Likewise.
15401 (Sized_relobj::do_layout): Use separate arrays for output section
15403 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15405 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15406 output_sections and section_offsets.
15407 (Sized_relobj::write_local_symbols): Likewise.
15408 (map_to_kept_section): Compute output address directly.
15409 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15410 output_sections and section_offsets.
15411 (Sized_relobj::write_sections): Likewise.
15412 (Sized_relobj::relocate_sections): Likewise.
15413 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15414 * output.h (class Output_reloc): Update declarations. Change
15415 u2_.relobj to Sized_relobj*.
15416 (class Output_data_reloc): Change add functions to use
15418 * output.cc (Output_reloc::Output_reloc): Change relobj to
15420 (Output_reloc::local_section_offset): Change return type to
15421 Elf_Addr. Use get_output_section_offset.
15422 (Output_reloc::get_address): Likewise.
15423 (Output_section::is_input_address_mapped): Don't call
15424 is_section_specially_mapped.
15425 (Output_section::output_offset): Likewise.
15426 (Output_section::output_address): Likewise.
15427 (Output_section::starting_output_address): Likewise.
15428 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15429 parameter to Sized_relobj*.
15430 (Copy_relocs::need_copy_reloc): Likewise.
15431 (Copy_relocs::save): Likewise.
15432 * copy-relocs.h (class Copy_relocs): Update declarations.
15433 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15434 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15435 * target-reloc.h (relocate_for_relocatable): Change
15436 offset_in_output_section type to Elf_Addr. Change code that uses
15438 * layout.cc (Layout::layout): Always set *off.
15439 * mapfile.cc (Mapfile::print_input_section): Use
15440 output_section_offset.
15441 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15443 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15444 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15445 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15447 2008-07-03 Ian Lance Taylor <iant@google.com>
15449 * layout.cc (Layout::include_section): Do not discard unrecognized
15450 SHT_STRTAB sections.
15452 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15454 * script.cc (Lex::can_continue_name): Make '?' allowable in
15455 version-script names.
15456 * testsuite/version_script.map: Change glob pattern to use '?'
15458 2008-06-30 Manish Singh <yosh@gimp.org>
15461 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15464 2008-06-30 Ian Lance Taylor <iant@google.com>
15468 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15469 versions]: Don't try to read the value in the contents, since we
15470 don't use it. Use the template endianness when writing.
15472 2008-06-25 Cary Coutant <ccoutant@google.com>
15474 * fileread.cc (File_read::make_view): Assert on zero-length view.
15475 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15476 symbol table when there are no symbols to read.
15478 2008-06-23 Craig Silverstein <csilvers@google.com>
15480 * version.cc (version_string): Bump to 1.7
15482 2008-06-18 Craig Silverstein <csilvers@google.com>
15484 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15485 constant 0xFFFF to type Valtype.
15486 (Powerpc_relocate_functions::rel16_ha): Likewise.
15488 2008-06-17 Ian Lance Taylor <iant@google.com>
15490 * output.h (Output_section::Input_section): Initialize p2align_ to
15491 zero for Output_section_data constructors.
15492 (Output_section::Input_section::addralign): If not an input
15493 section, return the alignment of the Output_section_data.
15494 * testsuite/copy_test.cc: New file.
15495 * testsuite/copy_test_1.cc: New file.
15496 * testsuite/copy_test_2.cc: New file.
15497 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15498 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15499 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15500 (copy_test_1_pic.o, copy_test_1.so): New targets.
15501 (copy_test_2_pic.o, copy_test_2.so): New targets.
15502 * testsuite/Makefile.in: Rebuild.
15504 * script-sections.cc (Script_sections::place_orphan): Initialize
15505 local variable exact.
15507 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15509 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15511 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15512 David S. Miller <davem@davemloft.net>
15514 * powerpc.cc: New file.
15515 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15516 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15517 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15518 * Makefile.in: Rebuild.
15520 2008-06-09 Ian Lance Taylor <iant@google.com>
15522 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15524 (throwing, orig_terminate): New static variables.
15525 (terminate_handler): New static function.
15526 (t2): Set terminate handler.
15528 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15531 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15534 2008-05-30 Cary Coutant <ccoutant@google.com>
15536 * archive.cc (Archive::include_all_members) Correct to step
15537 over symbol table and extended name table in thin archives.
15539 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15542 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15545 2008-05-28 Caleb Howe <cshowe@google.com>
15547 * reduced_debug_output.cc: New file.
15548 * reduced_debug_output.h: New file.
15549 * options.h (class General_options): Add --strip-debug-non-line.
15550 * options.cc (General_options::finalize): Add strip_debug_non_line
15551 to the strip heirarchy.
15552 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15554 * layout.cc: Include "reduced_debug_output.h".
15555 (Layout::Layout): Initialize new fields.
15556 (line_only_debug_sections): New static array.
15557 (is_lines_only_debug_sections): New static inline function.
15558 (Layout::include_section): Handle --strip-debug-non-line.
15559 (Layout::make_output_section): If --strip-debug-non-line, build
15560 new output sections for .debug_abbrev and .debug_info.
15561 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15562 gold. Warn about possible overflow.
15563 (read_signed_LEB_128): Likewise.
15564 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15565 (read_signed_LEB_128): Declare.
15566 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15567 (HFILES): Add reduced_debug_output.h.
15568 * Makefile.in: Rebuild.
15570 2008-05-21 Ian Lance Taylor <iant@google.com>
15572 * mapfile.cc: New file.
15573 * mapfile.h: New file.
15574 * options.h (class General_options): Add -M/--print-map and -Map.
15575 * options.cc (General_options::finalize): Make -M equivalent to
15577 * main.cc: Include <cstdio> and "mapfile.h".
15578 (main): Open mapfile if requested.
15579 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15580 constructor. Change caller.
15581 (queue_initial_tasks): Add mapfile parameter. Change caller.
15582 (queue_middle_tasks): Likewise.
15583 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15585 * archive.cc: Include "mapfile.h".
15586 (Archive::add_symbols): Add mapfile parameter. Change all
15587 callers. Pass mapfile, symbol, and reason to include_member.
15588 (Archive::include_all_members): Add mapfile parameter. Change all
15590 (Archive::include_member): Add mapfile, sym, and why parameters.
15591 Change all callers. Report inclusion to map file.
15592 * archive.h: Include "fileread.h".
15593 (class Archive): Update declarations.
15594 (Archive::file): New const method.
15595 (class Add_archive_symbols): Add mapfile_ field. Update
15596 constructor. Change all callers.
15597 * readsyms.h (class Read_symbols): Likewise.
15598 (class Finish_group): Likewise.
15599 (class Read_script): Likewise.
15600 * common.cc: Include "mapfile.h".
15601 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15603 (Symbol_table::do_allocate_commons): Likewise.
15604 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15605 symbol allocation to mapfile.
15606 * common.h (class Allocate_commons_task): Add mapfile_ field.
15607 Update constructor. Change all callers.
15608 * symtab.h (class Symbol_table): Update declarations.
15609 * layout.cc: Include "mapfile.h".
15610 (Layout_task_runner::run): Print information to mapfile.
15611 (Layout::create_gold_note): Change Output_data_fixed_space to
15612 Output_data_zero_fill.
15613 (Layout::create_build_id): Likewise.
15614 (Layout::print_to_mapfile): New function.
15615 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15616 constructor. Change caller.
15617 (class Layout): Declare print_to_mapfile.
15618 * output.cc (Output_section::Input_section::print_to_mapfile): New
15620 (Output_section::add_input_section): If producing a map, always
15621 add to input_sections_ list.
15622 (Output_section::do_print_to_mapfile): New function.
15623 (Output_segment::print_sections_to_mapfile): New function.
15624 (Output_segment::print_section_list_to_mapfile): New function.
15625 * output.h: Include "mapfile.h".
15626 (Output_data::print_to_mapfile): New function.
15627 (Output_data::do_print_to_mapfile): New virtual function.
15628 (Output_segment_headers::do_print_to_mapfile): New function.
15629 (Output_file_header::do_print_to_mapfile): New function.
15630 (Output_data_const::do_print_to_mapfile): New function.
15631 (class Output_data_const_buffer): Add map_name_ field. Update
15632 constructor. Change all callers. Add do_print_to_mapfile
15634 (class Output_data_fixed_space): Likewise.
15635 (class Output_data_space): Likewise.
15636 (class Output_data_zero_fill): New class.
15637 (Output_data_strtab::do_print_to_mapfile): New function.
15638 (Output_data_reloc_base::do_print_to_mapfile): New function.
15639 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15640 (Output_data_group::do_print_to_mapfile): New function.
15641 (Output_data_got::do_print_to_mapfile): New function.
15642 (Output_data_dynamic::do_print_to_mapfile): New function.
15643 (Output_symtab_xindex::do_print_to_mapfile): New function.
15644 (class Output_section): Declare do_print_to_mapflie. Declare
15645 print_to_mapfile in Input_section.
15646 (class Output_segment): Declare new functions.
15647 * object.h (Sized_relobj::symbol_count): New function.
15648 * script-sections.cc
15649 (Output_section_element_dot_assignment::set_section_addresses):
15650 Change Output_data_fixed_space to Output_data_zero_fill.
15651 (Output_data_expression::do_print_to_mapfile): New function.
15652 * script.cc (read_input_script): Add mapfile parameter. Change
15654 * script.h (read_input_script): Update declaration.
15655 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15656 (Eh_frame::do_print_to_mapfile): New function.
15657 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15658 (Output_merge_string::do_print_to_mapfile): New function.
15659 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15661 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15663 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15665 * Makefile.am (CCFILES): Add mapfile.cc.
15666 (HFILES): Add mapfile.h.
15667 * Makefile.in: Rebuild.
15669 2008-05-19 Ian Lance Taylor <iant@google.com>
15671 * options.h (class General_options): Add -z relro.
15672 * layout.cc (Layout::Layout): Initialize relro_segment_.
15673 (Layout::add_output_section_data): Return the output section.
15674 (Layout::make_output_section): Rcognize relro sections and mark
15675 them appropriately.
15676 (Layout::attach_allocated_section_to_segment): Put relro sections
15677 in a PT_GNU_RELRO segment.
15678 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15680 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15682 (Layout::linkonce_mapping): Map d.rel.ro.local to
15683 .data.rel.ro.local.
15684 (Layout::output_section_name): Us .data.rel.ro.local for any
15685 section which begins with that.
15686 * layout.h (class Layout): Update add_output_section_data
15687 declaration. Add relro_segment_ field.
15688 * output.cc (Output_section::Output_section): Initialize is_relro_
15689 and is_relro_local_ fields.
15690 (Output_segment::add_output_section): Group relro sections.
15691 (Output_segment::is_first_section_relro): New function.
15692 (Output_segment::maximum_alignment): If there is a relro section,
15693 align the segment to the common page size.
15694 (Output_segment::set_section_addresses): Track whether we are
15695 looking at relro sections. If the last section is a relro
15696 section, align to the common page size.
15697 (Output_segment::set_section_list_addresses): Add in_relro
15698 parameter. Change all callers. Align to the page size when
15699 moving from relro to non-relro section.
15700 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15702 * output.h (class Output_section): Add is_relro_ and
15703 is_relro_local_ fields.
15704 (Output_section::is_relro): New function.
15705 (Output_section::set_is_relro): New function.
15706 (Output_section::is_relro_local): New function.
15707 (Output_section::set_is_relro_local): New function.
15708 (class Output_segment): Update declarations.
15709 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15710 * sparc.cc (Target_sparc::got_section): Likewise.
15711 * x86_64.cc (Target_x86_64::got_section): Likewise.
15712 * testsuite/relro_test_main.cc: New file.
15713 * testsuite/relro_test.cc: New file.
15714 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15715 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15716 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15717 (relro_test.so, relro_test_pic.o): New targets.
15718 * testsuite/Makefile.in: Rebuild.
15720 2008-05-16 Ian Lance Taylor <iant@google.com>
15722 * output.cc (Output_segment::add_output_section): Remove front
15724 * output.h (class Output_segment): Remove
15725 add_initial_output_section and overloaded add_output_section.
15726 Update declaration of remaining add_output_section.
15727 * layout.cc (Layout::create_interp): Call add_output_section
15728 rather than add_initial_output_section.
15729 (Layout::finish_dynamic_section): Likewise.
15731 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15732 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15733 know the dynamic type.
15734 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15735 field. Initialize it in constructor.
15736 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15737 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15738 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15741 * output.cc (Output_reloc::get_address): Change return type to
15743 * output.h (class Output_reloc): Update get_address declaration.
15744 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15745 for section addresses.
15747 2008-05-09 Ian Lance Taylor <iant@google.com>
15750 * gold.cc (gold_nomem): Use return value of write.
15752 2008-05-08 Ian Lance Taylor <iant@google.com>
15754 * symtab.c (Symbol::init_base_output_data): Add version
15755 parameter. Change all callers.
15756 (Symbol::init_base_output_segment): Likewise.
15757 (Symbol::init_base_constant): Likewise.
15758 (Symbol::init_base_undefined): Likewise.
15759 (Sized_symbol::init_output_data): Likewise.
15760 (Sized_symbol::init_output_segment): Likewise.
15761 (Sized_symbol::init_constant): Likewise.
15762 (Sized_symbol::init_undefined): Likewise.
15763 (Symbol_table::do_define_in_output_data): If the new symbol has a
15764 version, mark it as the default.
15765 (Symbol_table::do_define_in_output_segment): Likewise.
15766 (Symbol_table::do_define_as_constant): Likewise.
15767 * symtab.h (class Symbol): Update declarations.
15768 (class Sized_symbol): Likewise.
15769 * resolve.cc (Symbol::override_version): New function.
15770 (Symbol::override_base): Call override_version.
15771 (Symbol::override_base_with_special): Likewise.
15772 * testsuite/ver_script_8.script: New file.
15773 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15774 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15775 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15776 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15778 2008-05-06 Ian Lance Taylor <iant@google.com>
15781 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15783 (class General_options): Remove existing --undefined, and add
15784 --no-undefined instead. Add new --undefined as synonym for -u.
15785 * archive.cc (Archive::add_symbols): Check whether symbol was
15787 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15788 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15789 all uses. Add IS_UNDEFINED. Update declarations to split
15790 different versions of init_base. Declare init_base_undefined.
15791 (Symbol::is_defined): Handle IS_UNDEFINED.
15792 (Symbol::is_undefined): Likewise.
15793 (Symbol::is_weak_undefined): Call is_undefined.
15794 (Symbol::is_absolute): Handle IS_CONSTANT.
15795 (class Sized_symbol): Update declarations to split different
15796 versions of init. Declare init_undefined.
15797 (class Symbol_table): Declare new functions.
15798 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15799 Change all callers.
15800 (Symbol::init_base_output_data): Likewise.
15801 (Symbol::init_base_output_segment): Likewise.
15802 (Symbol::init_base_constant): Likewise.
15803 (Symbol::init_base_undefined): New function.
15804 (Sized_symbol::init_object): Rename from init. Change all
15806 (Sized_symbol::init_output_data): Likewise.
15807 (Sized_symbol::init_output_segment): Likewise.
15808 (Sized_symbol::init_constant): Likewise.
15809 (Sized_symbol::init_undefined): New function.
15810 (Symbol_table::add_undefined_symbols_from_command_line): New
15812 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15814 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15815 (Symbol::output_section): Likewise.
15816 (Symbol::set_output_section): Likewise.
15817 (Symbol_table::sized_finalize_symbol): Likewise.
15818 (Symbol_table::sized_write_globals): Likewise.
15819 * resolve.cc (Symbol_table::should_override): Likewise.
15820 (Symbol::override_base_with_special): Likewise.
15822 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15823 symbol, change it to have default visibility.
15824 * testsuite/protected_1.cc: New file.
15825 * testsuite/protected_2.cc: New file.
15826 * testsuite/protected_3.cc: New file.
15827 * testsuite/protected_main_1.cc: New file.
15828 * testsuite/protected_main_2.cc: New file.
15829 * testsuite/protected_main_3.cc: New file.
15830 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15831 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15832 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15833 (protected_1.so): New target.
15834 (protected_1_pic.o, protected_2_pic.o): New targets.
15835 (protected_3_pic.o): New target.
15836 (check_PROGRAMS): Add protected_2.
15837 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15838 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15839 * testsuite/Makefile.in: Rebuild.
15841 * options.h (DEFINE_var): Add set_user_set_##varname__.
15842 (DEFINE_bool_alias): New macro.
15843 (class General_options): Define -Bstatic using DEFINE_bool_alias
15844 rather than DEFINE_special. Add --undefined as an alias for -z
15846 * options.cc (General_options::parse_Bstatic): Remove.
15848 * options.h (class General_options): Add --fatal-warnings.
15849 * main.cc (main): Implement --fatal-warnings.
15850 * errors.h (Errors::warning_count): New function.
15852 * options.h (class General_options): Add -Bsymbolic-functions.
15853 * symtab.h (Symbol::is_preemptible): Check for
15854 -Bsymbolic-functions.
15856 2008-05-05 Ian Lance Taylor <iant@google.com>
15858 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15859 as noVARNAME rather than no-VARNAME.
15860 (class General_options): Add option -z combreloc.
15861 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15863 (Output_reloc::sort_before) [SHT_REL]: New function.
15864 (Output_reloc::sort_before) [SHT_RELA]: New function.
15865 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15866 Sort_relocs_comparison.
15867 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15868 parameter. Change all callers.
15869 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15870 sort_relocs parameter. Change all callers.
15871 * output.cc (Output_reloc::get_address): New function, broken out
15873 (Output_reloc::write_rel): Call it.
15874 (Output_reloc::compare): New function.
15875 (Output_data_reloc_base::do_write): Optionally sort relocs.
15877 * configure.ac: If targ_extra_obj is set, link it in.
15878 * configure.tgt: Initialize all variables.
15879 (x86_64*): Set targ_extra_obj and targ_extra_size.
15880 * configure: Rebuild.
15882 * object.cc (Sized_relobj::include_section_group): Adjust section
15883 indexes read from group data. Build vector to pass to
15885 * layout.cc (Layout::layout_group): Add flags and shndxes
15886 parameters. Remove contents parameter. Change caller. Update
15887 explicit instantiations.
15888 * layout.h (class Layout): Update layout_group declaration.
15889 * output.cc (Output_data_group::Output_data_group): Add flags and
15890 input_shndxes parameters. Remove contents parameter. Change
15892 (Output_data_group::do_write): Change input_sections_ to
15894 * output.h (class Output_data_group): Update constructor
15895 declaration. Rename input_sections_ to input_shndxes_.
15896 * testsuite/many_sections_test.cc: Add template.
15898 2008-04-30 Cary Coutant <ccoutant@google.com>
15900 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15902 * layout.cc (Layout::include_section): Refactored check for debug
15904 (Layout::add_comdat): Add new parameters. Change type
15905 of signature parameter. Add object and shndx to signatures table.
15906 (Layout::find_kept_object): New function.
15907 * layout.h: Include <cstring>.
15908 (Layout::is_debug_info_section): New function.
15909 (Layout::add_comdat): Add new parameters.
15910 (Layout::find_kept_object): New function.
15911 (Layout::Kept_section): New struct.
15912 (Layout::Signatures): Change type of map range.
15913 * object.cc (Relobj::output_section_address): New function.
15914 (Sized_relobj::include_section_group): Add new parameters. Change
15915 calls to Layout::add_comdat. Change to build table of kept comdat
15916 groups and table mapping discarded sections to kept sections.
15917 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15918 (Sized_relobj::do_layout): Change calls to include_section_group and
15919 include_linkonce_section.
15920 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15921 value to zero when section is discarded.
15922 (Sized_relobj::map_to_kept_section): New function.
15923 * object.h (Relobj::output_section_address): New function.
15924 (Relobj::Comdat_group): New type.
15925 (Relobj::find_comdat_group): New function.
15926 (Relobj::Comdat_group_table): New type.
15927 (Relobj::Kept_comdat_section): New type.
15928 (Relobj::Kept_comdat_section_table): New type.
15929 (Relobj::add_comdat_group): New function.
15930 (Relobj::set_kept_comdat_section): New function.
15931 (Relobj::get_kept_comdat_section): New function.
15932 (Relobj::comdat_groups_): New field.
15933 (Relobj::kept_comdat_sections_): New field.
15934 (Symbol_value::input_value): Update comment.
15935 (Sized_relobj::map_to_kept_section) New function.
15936 (Sized_relobj::include_linkonce_section): Add new parameter.
15937 * target-reloc.h (Comdat_behavior): New type.
15938 (get_comdat_behavior): New function.
15939 (relocate_section): Add code to map a discarded section to the
15940 corresponding kept section when applying a relocation.
15942 2008-04-30 Craig Silverstein <csilvers@google.com>
15944 * dwarf_reader.cc (next_generation_count): New static var.
15945 (Addr2line_cache_entry): New struct.
15946 (addr2line_cache): New static var.
15947 (Dwarf_line_info::one_addr2line): Added caching.
15948 (Dwarf_line_info::clear_addr2line_cache): New function.
15949 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15950 cache-size parameter.
15951 (Dwarf_line_info::one_addr2line_cache): New function.
15952 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15953 new cache-size argument to one_addr2line(), and clear cache.
15955 2008-04-28 Cary Coutant <ccoutant@google.com>
15957 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15958 R_386_PC8 relocations.
15960 2008-04-23 Ian Lance Taylor <iant@google.com>
15962 * object.cc (Sized_relobj::include_section_group): Check for
15963 invalid section group.
15965 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15968 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15969 than read for file header.
15970 * archive.cc (Archive::include_member): Likewise.
15972 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15974 * aclocal.m4: Regenerate.
15975 * configure: Regenerate.
15977 2008-04-19 Ian Lance Taylor <iant@google.com>
15979 * version.cc (version_string): Bump to 1.6.
15981 * testsuite/Makefile.am (many_sections_r_test): New target.
15982 (many_sections_r_test_SOURCES): Remove.
15983 (many_sections_r_test_DEPENDENCIES): Remove.
15984 (many_sections_r_test_LDFLAGS): Remove.
15985 (many_sections_r_test_LDADD): Remove.
15987 * object.cc (Sized_relobj::do_add_symbols): Always pass
15988 local_symbol_count_ to add_from_relobj.
15990 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15991 every thousand variables.
15992 * testsuite/Makefile.in: Rebuild.
15994 * object.cc (Xindex::initialize_symtab_xindex): New function.
15995 (Xindex::read_symtab_xindex): New function.
15996 (Xindex::sym_xindex_to_shndx): New function.
15997 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15999 (Sized_relobj::do_initialize_xindex): New function.
16000 (Sized_relobj::do_read_symbols): Adjust section links.
16001 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16002 parameter. Change all callers.
16003 (Sized_relobj::include_section_group): Adjust section links and
16004 symbol section indexes.
16005 (Sized_relobj::do_layout): Adjust section links.
16006 (Sized_relobj::do_count_local_symbols): Adjust section links and
16007 symbol section indexes.
16008 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16009 ordinary and special symbols.
16010 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16011 dynsym_xindex parameters. Change all callers. Adjust section
16012 links. Use SHN_XINDEX when needed.
16013 (Sized_relobj::get_symbol_location_info): Adjust section links.
16014 Don't get fooled by special symbols.
16015 * object.h (class Xindex): Define.
16016 (class Object): Add xindex_ parameter. Declare virtual functoin
16017 do_initialize_xindex.
16018 (Object::adjust_sym_shndx): New function.
16019 (Object::set_xindex): New protected function.
16020 (class Symbol_value): Add is_ordinary_shndx_ field.
16021 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16022 (Symbol_value::value): Assert ordinary section.
16023 (Symbol_value::initialize_input_to_output_map): Likewise.
16024 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16025 Change all callers.
16026 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16028 (class Sized_relobj): Update declarations.
16029 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16030 parameter. Change all callers.
16031 (Sized_relobj::adjust_shndx): New function.
16032 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16034 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16035 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16036 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16037 (Sized_dynobj::read_dynsym_section): Adjust section links.
16038 (Sized_dynobj::read_dynamic): Likewise.
16039 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16041 (Sized_dynobj::do_initialize_xindex): New function.
16042 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16043 do_initialize_xindex.
16044 (Sized_dynobj::adjust_shndx): New function.
16045 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16046 dynsym_xindex_ fields.
16047 (Layout::finalize): Add a call to set_section_indexes before
16048 creating the symtab sections.
16049 (Layout::set_section_indexes): Don't do anything if the section
16050 already has a section index.
16051 (Layout::create_symtab_sections): Add shnum parameter. Change
16052 caller. Create .symtab_shndx section if needed.
16053 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16055 (Layout::allocated_output_section_count): New function.
16056 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16058 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16059 fields. Update declarations.
16060 (Layout::symtab_xindex): New function.
16061 (Layout::dynsym_xindex): New function.
16062 (class Write_symbols_task): Add layout_ field.
16063 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16065 * output.cc (Output_section_headers::Output_section_headers): Add
16066 shstrtab_section parameter. Change all callers.
16067 (Output_section_headers::do_sized_write): Store overflow values
16068 for section count and section string table section index in
16069 section header zero.
16070 (Output_file_header::do_sized_write): Check for overflow of
16071 section count and section string table section index.
16072 (Output_symtab_xindex::do_write): New function.
16073 (Output_symtab_xindex::endian_do_write): New function.
16074 * output.h (class Output_section_headers): Add shstrtab_section_.
16075 Update declarations.
16076 (class Output_symtab_xindex): Define.
16077 (Output_section::has_out_shndx): New function.
16078 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16080 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16081 Change all callers.
16082 (Sized_symbol::init): Likewise.
16083 (Symbol::output_section): Check for ordinary symbol.
16084 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16085 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16087 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16088 Change all callers. Simplify handling of symbols from sections
16089 not included in the link.
16090 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16092 (Weak_alias_sorter::operator()): Assert that symbols are
16094 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16096 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16097 parameters. Change all callers.
16098 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16099 symbol distinction. Use SHN_XINDEX when needed.
16100 (Symbol_table::write_section_symbol): Add symtab_xindex
16101 parameter. Change all callers.
16102 (Symbol_table::sized_write_section_symbol): Likewise. Use
16103 SHN_XINDEX when needed.
16104 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16106 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16107 (Symbol::is_defined): Check is_ordinary.
16108 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16109 (Symbol::is_absolute, Symbol::is_common): Likewise.
16110 (class Sized_symbol): Update declarations.
16111 (class Symbol_table): Update declarations.
16112 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16113 parameters. Change all callers.
16114 (Sized_symbol::override): Likewise.
16115 (Symbol_table::override): Likewise.
16116 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16117 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16118 is_ordinary, and orig_st_shndx parameters. Change all callers.
16119 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16120 to be in an ordinary section.
16121 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16122 object and is_ordinary parameters. Change all callers.
16123 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16124 Change all callers. Don't add undefined or non-ordinary symbols
16126 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16127 Change all callers.
16128 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16130 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16131 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16132 (Sized_relobj::relocate_sections): Likewise.
16133 * target-reloc.h (scan_relocs): Adjust section symbol index.
16134 (scan_relocatable_relocs): Likewise.
16135 * i386.cc (Scan::local): Check for ordinary symbols.
16136 * sparc.cc (Scan::local): Likewise.
16137 * x86_64.cc (Scan::local): Likewise.
16138 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16139 to symbol_section_and_value.
16140 * testsuite/many_sections_test.cc: New file.
16141 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16142 (check_PROGRAMS): Add many_sections_test.
16143 (many_sections_test_SOURCES): Define.
16144 (many_sections_test_DEPENDENCIES): Define.
16145 (many_sections_test_LDFLAGS): Define.
16146 (BUILT_SOURCES): Add many_sections_define.h.
16147 (many_sections_define.h): New target.
16148 (BUILT_SOURCES): Add many_sections_check.h.
16149 (many_sections_check.h): New target.
16150 (check_PROGRAMS): Add many_sections_r_test.
16151 (many_sections_r_test_SOURCES): Define.
16152 (many_sections_r_test_DEPENDENCIES): Define.
16153 (many_sections_r_test_LDFLAGS): Define.
16154 (many_sections_r_test_LDADD): Define.
16155 (many_sections_r_test.o): New target.
16156 * testsuite/Makefile.in: Rebuild.
16158 2008-04-17 Cary Coutant <ccoutant@google.com>
16160 * errors.cc (Errors::info): New function.
16161 (gold_info): New function.
16162 * errors.h (Errors::info): New function.
16163 * gold.h (gold_info): New function.
16164 * object.cc (Input_objects::add_object): Print trace output.
16165 * options.cc (options::parse_set): New function.
16166 (General_options::parse_wrap): Deleted.
16167 (General_options::General_options): Deleted initializer.
16168 * options.h (options::String_set): New typedef.
16169 (options::parse_set): New function.
16170 (DEFINE_set): New macro.
16171 (General_options::wrap): Changed to use DEFINE_set. Changed
16172 callers of any_wrap_symbols and is_wrap_symbol.
16173 (General_options::trace, General_options::trace_symbol):
16175 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16176 (General_options::wrap_symbols_): Deleted.
16177 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16179 2008-04-17 David S. Miller <davem@davemloft.net>
16181 * options.cc (General_options::parse_V): New function.
16182 * options.h: Add entries for -V and -Qy.
16184 2008-04-17 Ian Lance Taylor <iant@google.com>
16186 * common.cc (Symbol_table::allocate_commons): Remove options
16187 parameter. Change caller.
16188 (Symbol_table::do_allocate_commons): Remove options parameter.
16189 Change caller. Just call do_allocate_commons_list twice.
16190 (Symbol_table::do_allocate_commons_list): New function, broken out
16191 of do_allocate_commons.
16192 * common.h (class Allocate_commons_task): Remove options_ field.
16193 Update constructor.
16194 * symtab.cc (Symbol_table::Symbol_table): Initialize
16196 (Symbol_table::add_from_object): Put TLS common symbols on
16198 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16199 which are IN_OUTPUT_DATA.
16200 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16201 allocate_commons and do_allocate_commons declarations. Declare
16202 do_allocate_commons_list.
16203 * gold.cc (queue_middle_tasks): Update creation of
16204 Allocate_commons_task to not pass options.
16205 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16206 (TLS_TEST_C_FLAGS): New variable.
16207 (tls_test_c_pic.o): New target.
16208 (tls_test_shared.so): Link in tls_test_c_pic.o.
16209 (tls_test_c_pic_ie.o): New target.
16210 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16211 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16212 (tls_test_c.o): New target.
16213 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16214 (tls_pic_test_LDADD): Likewise.
16215 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16216 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16217 (tls_test_c_gnu2.o): New target.
16218 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16220 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16221 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16222 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16223 * testsuite/tls_test.cc: Include "config.h".
16224 (t_last): Call t11_last.
16225 * testsuite/tls_test.h (t11, t11_last): Declare.
16226 * testsuite/tls_test_c.c: New file.
16227 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16228 * configure.ac: Check for OpenMP support.
16229 * configure, config.in, Makefile.in: Rebuild.
16230 * testsuite/Makefile.in: Rebuild.
16232 2008-04-16 Cary Coutant <ccoutant@google.com>
16234 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16235 (Target_i386::tls_base_symbol_defined_): New field.
16236 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16237 (Target_i386::Scan::global): Likewise.
16238 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16239 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16240 (Target_x86_64::tls_base_symbol_defined_): New field.
16241 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16242 (Target_x86_64::Scan::global): Likewise.
16244 2008-04-16 Cary Coutant <ccoutant@google.com>
16246 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16247 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16248 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16249 building shared libraries.
16250 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16251 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16252 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16253 * testsuite/Makefile.in: Rebuild.
16254 * testsuite/weak_undef.h: New file.
16255 * testsuite/weak_undef_file1.cc: Add extra test cases.
16256 * testsuite/weak_undef_file2.cc: Likewise.
16257 * testsuite/weak_undef_test.cc: Likewise.
16259 2008-04-16 David S. Miller <davem@davemloft.net>
16261 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16262 Add issued_non_pic_error_ field. Declare check_non_pic.
16263 (Target_sparc::Scan::check_non_pic): New function.
16264 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16265 (Target_sparc::Scan::global): Likewise.
16267 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16268 * configure: Rebuild.
16270 * options.h (DEFINE_enable): New macro.
16271 (new_dtags): New enable option.
16272 (initfirst, interpose, loadfltr, nodefaultlib,
16273 nodelete, nodlopen, nodump): New -z options.
16274 * layout.cc (Layout:finish_dynamic_section): If new
16275 dtags enabled, emit DT_RUNPATH. Also, emit a
16276 DT_FLAGS_1 containing any specified -z flags.
16278 2008-04-16 Ian Lance Taylor <iant@google.com>
16280 * copy-relocs.cc: New file.
16281 * copy-relocs.h: New file.
16282 * reloc.cc: Remove Copy_relocs code.
16283 * reloc.h: Likewise.
16284 * reloc-types.h (struct Reloc_types) [both versions]: Add
16285 get_reloc_addend_noerror.
16286 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16287 variants of add_global which take an addend which must be zero.
16288 * i386.cc: Include "copy-relocs.h".
16289 (class Target_i386): Change type of copy_relocs_ to variable,
16290 update initializer.
16291 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16292 Change all callers.
16293 (Target_i386::do_finalize_sections): Change handling of
16295 * sparc.cc: Include "copy-relocs.h".
16296 (class Target_sparc): Change type of copy_relocs_ to variable,
16297 update initializer.
16298 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16299 Change all callers.
16300 (Target_sparc::do_finalize_sections): Change handling of
16302 * x86_64.cc: Include "copy-relocs.h".
16303 (class Target_x86_64): Change type of copy_relocs_ to variable,
16304 update initializer.
16305 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16306 class. Change all callers.
16307 (Target_x86_64::do_finalize_sections): Change handling of
16309 * Makefile.am (CCFILES): Add copy-relocs.cc.
16310 (HFILES): Add copy-relocs.h.
16312 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16314 * testsuite/script_test_4.sh: Permit leading zeroes.
16316 2008-04-15 Ian Lance Taylor <iant@google.com>
16318 * script-sections.cc (Script_sections::create_segments): Use
16319 header_size_adjustment even when there is enough room for the
16321 * testsuite/script_test_4.sh: New file.
16322 * testsuite/script_test_4.t: New file.
16323 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16324 (check_DATA): Add script_test_4.stdout.
16325 (MOSTLYCLEANFILES): Likewise.
16326 (script_test_4): New target.
16327 (script_test_4.stdout): New target.
16328 * testsuite/Makefile.in: Rebuild.
16330 * sparc.cc: Add definitions for Output_data_plt_sparc class
16333 2008-04-14 David S. Miller <davem@davemloft.net>
16335 * sparc.cc: New file.
16336 * Makefile.am (TARGETSOURCES): Add sparc.cc
16337 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16338 * configure.tgt: Document targ_extra_size and
16339 targ_extra_big_endian. Add entries for sparc-* and
16341 * configure.ac: Handle targ_extra_size and
16342 targ_extra_big_endian.
16343 * Makefile.in: Rebuild.
16344 * configure: Likewise.
16345 * po/POTFILES.in: Likewise.
16346 * po/gold.pot: Likewise.
16348 2008-04-14 Ian Lance Taylor <iant@google.com>
16350 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16351 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16352 in the name/type/flags to section mapping. Don't call
16353 allocate_output_section.
16354 (Layout::choose_output_section): Change parameter from adjust_name
16355 to is_input_section. Don't permit input sections after sections
16356 are attached to segments. Don't call allocate_output_section.
16357 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16358 not write_enable_output_section.
16359 (Layout::make_output_section): Don't push to
16360 unattached_section_list_ nor call attach_to_segment. Call
16361 attach_section_to_segment if sections are attached.
16362 (Layout::attach_sections_to_segments): New function.
16363 (Layout::attach_section_to_segment): New function.
16364 (Layout::attach_allocated_section_to_segment): Rename from
16365 attach_to_segment. Remove flags parameter.
16366 (Layout::allocate_output_section): Remove function.
16367 (Layout::write_enable_output_section): Remove function.
16368 * layout.h (class Layout): Update for above changes. Add new
16369 field sections_are_attached_.
16370 * output.h (Output_section::update_flags_for_input_section): New
16372 * output.cc (Output_section::add_input_section): Call
16373 update_flags_for_input_section.
16374 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16376 2008-04-11 Cary Coutant <ccoutant@google.com>
16378 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16379 thought unnecessary.
16380 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16382 2008-04-11 Ian Lance Taylor <iant@google.com>
16384 * output.h (class Output_section_data): Remove inline definition
16386 * output.cc (Output_section_data::set_addralign): New function.
16388 2008-04-11 Cary Coutant <ccoutant@google.com>
16390 Add support for TLS descriptors for i386 and x86_64.
16391 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16392 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16393 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16395 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16396 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16397 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16399 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16400 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16401 Fix problem with initial-exec relocations.
16402 (Target_i386::Relocate::relocate_tls): Likewise.
16403 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16405 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16406 support for section-plus-offset dynamic table entries.
16407 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16408 (Output_data_dynamic::Dynamic_entry): Add support for
16409 section-plus-offset dynamic table entries.
16410 (Output_data_dynamic::Classification): Likewise.
16411 (Output_data_dynamic::classification_): Renamed offset_.
16412 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16413 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16414 (Target_x86_64::make_plt_section): New function.
16415 (Target_x86_64::reserve_tlsdesc_entries): New function.
16416 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16417 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16418 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16419 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16420 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16421 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16422 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16423 add extra PLT entry for TLS descriptors.
16424 (Output_data_plt_x86_64::got_): New field.
16425 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16426 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16428 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16430 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16431 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16432 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16433 R_386_TLS_DESC_CALL relocations.
16434 (Target_x86_64::Scan::global): Likewise.
16435 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16436 for TLS descriptors.
16437 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16438 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16439 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16440 GD-to-IE relaxation.
16441 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16442 and TLS_DESCRIPTORS.
16443 * Makefile.in: Rebuild.
16444 * configure: Rebuild.
16445 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16446 (tls_test_shared2.so): New target.
16447 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16448 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16449 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16450 (tls_shared_gd_to_ie_test_LDADD): New variable.
16451 (tls_shared_gnu2_gd_to_ie_test): New target.
16452 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16454 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16455 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16456 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16457 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16458 (tls_shared_gnu2_test): New target.
16459 (tls_test_gnu2_shared.so): New target.
16460 (tls_shared_gnu2_test_SOURCES): New variable.
16461 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16462 (tls_shared_gnu2_test_LDFLAGS): New variable.
16463 (tls_shared_gnu2_test_LDADD): New variable.
16464 * testsuite/Makefile.in: Rebuild.
16465 * testsuite/Makefile.
16467 2008-04-11 Ian Lance Taylor <iant@google.com>
16469 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16471 * testsuite/Makefile.in: Rebuild.
16473 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16475 * testsuite/script_test_2.cc (main): Adjust test.
16477 2008-04-11 David S. Miller <davem@davemloft.net>
16478 Ian Lance Taylor <iant@google.com>
16480 * options.h (General_options): Add entries for '-Y' and
16482 * options.cc (General_options:finalize): If -Y was used, add those
16483 entries to the library path instead of the default "/lib" and
16486 2008-04-11 David S. Miller <davem@davemloft.net>
16488 * testsuite/justsyms.t: Start at 0x100.
16489 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
16490 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16492 * testsuite/script_test_2.cc: Adjust string and section length
16495 2008-04-09 Ian Lance Taylor <iant@google.com>
16498 * script-sections.cc (Sections_element::allocate_to_segment): Add
16500 (Output_section_definition::allocate_to_segment): Likewise.
16501 (Orphan_output_section::allocate_to_segment): Likewise.
16502 (Script_sections::attach_sections_using_phdrs_clause): Don't
16503 propagate non-PT_LOAD segments to orphan sections.
16504 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16505 readelf rather than objdump.
16506 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16507 .interp section and PT_INTERP segment are the same size.
16508 * testsuite/Makefile.in: Rebuild.
16510 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16511 aliases for symbols defined in the same object.
16512 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16513 (weak_alias_test_SOURCES): New variable.
16514 (weak_alias_test_DEPENDENCIES): New variable.
16515 (weak_alias_test_LDFLAGS): New variable.
16516 (weak_alias_test_LDADD): New variable.
16517 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16518 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16519 (weak_alias_test_3.o): New target.
16520 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16521 * testsuite/weak_alias_test_main.cc: New file.
16522 * testsuite/weak_alias_test_1.cc: New file.
16523 * testsuite/weak_alias_test_2.cc: New file.
16524 * testsuite/weak_alias_test_3.cc: New file.
16526 2008-04-08 Ian Lance Taylor <iant@google.com>
16528 * options.h (class General_options): Add --noinhibit-exec option.
16529 * main.cc (main): Check --noinhibit-exec.
16531 * options.h (class General_options): Define --wrap as a special
16532 option. Add wrap_symbols_ field.
16533 (General_options::any_wrap_symbols): New function.
16534 (General_options::is_wrap_symbol): New function.
16535 * options.cc (General_options::parse_wrap): New function.
16536 (General_options::General_options): Initialize wrap_symbols_.
16537 * symtab.cc (Symbol_table::wrap_symbol): New function.
16538 (Symbol_table::add_from_object): Handle --wrap.
16539 * symtab.h (class Symbol_table): Declare wrap_symbol.
16540 * target.h (Target::wrap_char): New function.
16541 (Target::Target_info): Add wrap_char field.
16542 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16543 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16544 * testsuite/testfile.cc (Target_test::test_target_info):
16547 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16550 * layout.h (class Layout): Add added_eh_frame_data_ field.
16551 * layout.cc (Layout::Layout): Initialize new field.
16552 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16553 output section until we find a section we merged successfully.
16554 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16555 that the size be non-zero.
16557 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16560 2008-04-08 Craig Silverstein <csilvers@google.com>
16562 * configure.ac: Export new conditional variable HAVE_ZLIB.
16563 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16565 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16566 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16568 2008-04-07 Ian Lance Taylor <iant@google.com>
16570 * version.cc (version_string): Set to "1.5".
16572 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16573 Add issued_non_pic_error_ field. Declare check_non_pic.
16574 (Target_x86_64::Scan::check_non_pic): New function.
16575 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16576 (Target_x86_64::Scan::global): Likewise.
16578 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16579 addend parameter. Change caller. Handle merge sections.
16580 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16581 Address to Addend. Don't add in the result of
16582 local_section_offset, pass down the addend and use the returned
16584 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16585 Update declarations of local_section_offset and symbol_value.
16586 * testsuite/two_file_test_1.cc (t18): New function.
16587 * testsuite/two_file_test_2.cc (f18): New function.
16588 * testsuite/two_file_test_main.cc (main): Call t18.
16589 * testsuite/two_file_test.h (t18, f18): Declare.
16591 * configure.ac: Don't test for objdump, c++filt, or readelf.
16592 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16594 (TEST_READELF): New variable.
16595 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16596 (check_PROGRAMS): Add two_file_strip_test.
16597 (two_file_strip_test): New target.
16598 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16599 (two_file_same_shared_strip_test_SOURCES): New variable.
16600 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16601 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16602 (two_file_same_shared_strip_test_LDADD): New variable.
16603 (two_file_shared_strip.so): New target.
16604 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16605 (ver_test_5.syms, ver_test_7.syms): Likewise.
16606 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16607 (strip_test_3.stdout): Use TEST_OBJDUMP.
16608 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16610 2008-04-04 Cary Coutant <ccoutant@google.com>
16612 * symtab.h (Symbol::is_weak_undefined): New function.
16613 (Symbol::is_strong_undefined): New function.
16614 (Symbol::is_absolute): New function.
16615 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16616 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16618 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16619 (weak_undef_test): New target.
16620 * testsuite/Makefile.in: Rebuild.
16621 * testsuite/weak_undef_file1.cc: New file.
16622 * testsuite/weak_undef_file2.cc: New file.
16623 * testsuite/weak_undef_test.cc: New file.
16625 2008-04-03 Craig Silverstein <csilvers@google.com>
16627 * compressed_output.h (class Output_compressed_section): Use
16629 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16631 (zlib_compressed_suffix): Removed.
16632 (Output_compressed_section::set_final_data_size): Use unsigned
16634 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16635 Fix linker invocation.
16636 (flagstest_o_specialfile_and_compress_debug_sections):
16638 * testsuite/Makefile.in: Regenerated.
16640 2008-04-02 David S. Miller <davem@davemloft.net>
16642 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16643 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16645 2008-04-02 Craig Silverstein <csilvers@google.com>
16649 2008-04-02 Ian Lance Taylor <iant@google.com>
16651 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16652 parameters. Update for new key type to views_. Change all
16654 (File_read::read): Adjust for byteshift in returned view.
16655 (File_read::add_view): New function, broken out of
16656 find_and_make_view.
16657 (File_read::make_view): New function, broken out of
16658 find_and_make_view.
16659 (File_read::find_or_make_view): Add offset and aligned
16660 parameters. Rewrite accordingly. Change all callers.
16661 (File_read::get_view): Add offset and aligned parameters. Adjust
16662 for byteshift in return value.
16663 (File_read::get_lasting_view): Likewise.
16664 * fileread.h (class File_read): Update declarations.
16665 (class File_read::View): Add byteshift_ field. Add byteshift to
16666 constructor. Add byteshift method.
16667 * archive.h (Archive::clear_uncached_views): New function.
16668 (Archive::get_view): Add aligned parameter. Change all callers.
16669 * object.h (Object::get_view): Add aligned parameter. Change all
16671 (Object::get_lasting_view): Likewise.
16673 * fileread.cc (File_read::release): Don't call clear_views if
16674 there are multiple objects.
16675 * fileread.h (File_read::clear_uncached_views): New function.
16676 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16679 2008-03-31 Cary Coutant <ccoutant@google.com>
16681 Add thin archive support.
16682 * archive.cc (Archive::armagt): New const.
16683 (Archive::setup): Remove task parameter and calls to unlock.
16684 (Archive::unlock_nested_archives): New function.
16685 (Archive::read_header): Add nested_off parameter. Change
16687 (Archive::interpret_header): Likewise.
16688 (Archive::include_all_members): Change to handle thin
16690 (Archive::include_member): Likewise.
16691 * archive.h (Archive::Archive): Add new parameters and
16693 (Archive::armagt): New const.
16694 (Archive::setup): Remove task parameter.
16695 (Archive::unlock_nested_archives): New function.
16696 (Archive::read_header): Add nested_off parameter.
16697 (Archive::interpret_header): Likewise.
16698 (Archive::Nested_archive_table): New typedef.
16699 (Archive::is_thin_archive_): New field.
16700 (Archive::nested_archives_): New field.
16701 (Archive::options_): New field.
16702 (Archive::dirpath_): New field.
16703 (Archive::task_): New field.
16704 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16705 for thin archives. Pass additional parameters to
16706 Archive::Archive. Unlock the archive file after calling
16709 2008-03-29 Ian Lance Taylor <iant@google.com>
16711 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16712 version symbol to be local.
16713 * testsuite/ver_test_4.sh: New file.
16714 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16715 (check_DATA): Add ver_test_4.syms.
16716 (ver_test_4.syms): New target.
16717 * testsuite/Makefile.in: Rebuild.
16720 (Output_section::Input_section_sort_entry::has_priority): New
16722 (Output_section::Input_section_sort_entry::match_file_name): New
16724 (Output_section::Input_section_sort_entry::match_section_name):
16726 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16728 (Output_section::Input_section_sort_entry::match_section_file):
16730 (Output_section::Input_section_sort_compare::operator()): Rewrite
16731 using new Input_section_sort_entry functions. Sort crtbegin and
16732 crtend first. Sort sections with no priority before sections with
16734 * testsuite/initpri1.c (d3): Check j != 4.
16735 (cd5): New constructor/destructor function.
16736 (main): Check j != 2.
16738 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16739 new symbol when resolving, don't call set_is_default.
16740 * testsuite/ver_test_7.cc: New file.
16741 * testsuite/ver_test_7.sh: New file.
16742 * testsuite/Makefile.am (ver_test_7.so): New target.
16743 (ver_test_7.o): New target.
16744 (check_SCRIPTS): Add ver_test_7.sh.
16745 (check_DATA): Add ver_test_7.syms.
16746 (ver_test_7.syms): New target.
16748 2008-03-28 Ian Lance Taylor <iant@google.com>
16750 * layout.cc (Layout::layout): If we see an input section with a
16751 name that needs sorting, set the must_sort flag for the output
16753 (Layout::make_output_section): If the name of the output section
16754 indicates that it might require sorting, set the may_sort flag.
16755 * output.h (Output_section::may_sort_attached_input_sections): New
16757 (Output_section::set_may_sort_attached_input_sections): New
16759 (Output_section::must_sort_attached_input_sections): New
16761 (Output_section::set_must_sort_attached_input_sections): New
16763 (class Output_section): Declare Input_section_sort_entry. Define
16764 Input_section_sort_compare. Declare
16765 sort_attached_input_sections. Add new fields:
16766 may_sort_attached_input_sections_,
16767 must_sort_attached_input_sections_,
16768 attached_input_sections_are_sorted_.
16769 * output.cc (Output_section::Output_section): Initialize new
16771 (Output_section::add_input_section): Add an entry to
16772 input_sections_ if may_sort or must_sort are true.
16773 (Output_section::set_final_data_size): Call
16774 sort_attached_input_sections if necessary.
16775 (Output_section::Input_section_sort_entry): Define new class.
16776 (Output_section::Input_section_sort_compare::operator()): New
16778 (Output_section::sort_attached_input_sections): New function.
16779 * configure.ac: Check whether the compiler supports constructor
16780 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16781 * testsuite/initpri1.c: New file.
16782 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16783 CONSTRUCTOR_PRIORITY.
16784 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16785 (initpri1_LDFLAGS): New variable.
16786 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16788 2008-03-27 Ian Lance Taylor <iant@google.com>
16790 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16791 * testsuite/common_test_1.c: New file.
16792 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16793 (common_test_1_SOURCES): New variable.
16794 (common_test_1_DEPENDENCIES): New variable.
16795 (common_test_1_LDFLAGS): New variable.
16797 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16798 and commons_ correctly when NAME/VERSION does not override
16800 * testsuite/ver_test_6.c: New file.
16801 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16802 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16803 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16805 2008-03-26 Ian Lance Taylor <iant@google.com>
16807 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16808 of an undefined symbol from a version script.
16809 * testsuite/Makefile.am (ver_test_5.so): New target.
16810 (ver_test_5.o): New target.
16811 (check_SCRIPTS): Add ver_test_5.sh.
16812 (check_DATA): Add ver_test_5.syms.
16813 (ver_test_5.syms): New target.
16814 * testsuite/ver_test_5.cc: New file.
16815 * testsuite/ver_test_5.script: New file.
16816 * testsuite/ver_test_5.sh: New file.
16817 * Makefile.in, testsuite/Makefile.in: Rebuild.
16820 Fix problems building gold with gcc 4.3.0.
16821 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16822 (gold_error_at_location, gold_warning_at_location): Use it.
16823 * configure.ac: Check whether we can compile and use a template
16824 function with a printf attribute.
16825 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16826 when jumping over bytes.
16827 * object.cc: Instantiate Object::read_section_data.
16828 * debug.h: Include <cstring>
16829 * dwarf_reader.cc: Include <algorithm>
16830 * main.cc: Include <cstring>.
16831 * options.cc: Include <cstring>.
16832 * output.cc: Include <cstring>.
16833 * script.cc: Include <cstring>.
16834 * script.h: Include <string>.
16835 * symtab.cc: Include <cstring> and <algorithm>.
16836 * target-select.cc: Include <cstring>.
16837 * version.cc: Include <string>.
16838 * testsuite/testmain.cc: Include <cstdlib>.
16839 * configure, config.in: Rebuild.
16841 2008-03-25 Ian Lance Taylor <iant@google.com>
16843 * options.cc: Include "../bfd/bfdver.h".
16844 (options::help): Print bug reporting address.
16846 * version.cc (print_version): Adjust output for current value of
16847 BFD_VERSION_STRING.
16851 * options.cc (options::help): Print list of supported targets.
16852 * target-select.h: Include <vector>.
16853 (class Target_selector): Make machine_, size_, and is_big_endian_
16854 fields const. Add bfd_name_ and instantiated_target_ fields.
16855 (Target_selector::Target_selector): Add bfd_name parameter.
16856 (Target_selector::recognize): Make non-virtual, call
16858 (Target_selector::recognize_by_name): Make non-virtual, call
16859 do_recognize_by_name.
16860 (Target_selector::supported_names): New function.
16861 (Target_selector::bfd_name): New function.
16862 (Target_selector::do_instantiate_target): New pure virtual
16864 (Target_selector::do_recognize): New virtual function.
16865 (Target_selector::do_recognize_by_name): New virtual function.
16866 (Target_selector::instantiate_target): New private function.
16867 (supported_target_names): Declare.
16868 * target-select.cc (Target_selector::Target_selector): Update for
16869 new parameter and fields.
16870 (select_target_by_name): Check that the name matches before
16871 calling recognize_by_name.
16872 (supported_target_names): New function.
16873 * i386.cc (class Target_selector_i386): Update Target_selector
16874 constructor call. Remove recognize and recognize_by_name. Add
16875 do_instantiate_target.
16876 * x86_64.cc (class Target_selector_x86_64): Likewise.
16877 * testsuite/testfile.cc (class Target_selector_test): Update for
16878 changes to Target_selector.
16880 * README: Rewrite, with some notes on unsupported features.
16882 2008-03-24 Cary Coutant <ccoutant@google.com>
16884 * i386.cc (Target_i386::Got_type): New enum declaration.
16885 (Target_i386::Scan::local): Updated callers of Output_data_got
16887 (Target_i386::Scan::global): Likewise.
16888 (Target_i386::Relocate::relocate): Likewise.
16889 (Target_i386::Relocate::relocate_tls): Likewise.
16890 * object.h (Got_offset_list): New class.
16891 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16892 (Sized_relobj::local_got_offset): Likewise.
16893 (Sized_relobj::set_local_got_offset): Likewise.
16894 (Sized_relobj::local_has_tls_got_offset): Removed.
16895 (Sized_relobj::local_tls_got_offset): Removed.
16896 (Sized_relobj::set_local_tls_got_offset): Removed.
16897 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16898 * output.cc (Output_data_got::add_global): Added got_type parameter.
16899 (Output_data_got::add_global_with_rel): Likewise.
16900 (Output_data_got::add_global_with_rela): Likewise.
16901 (Output_data_got::add_global_pair_with_rel): New function.
16902 (Output_data_got::add_global_pair_with_rela): New function.
16903 (Output_data_got::add_local): Added got_type parameter.
16904 (Output_data_got::add_local_with_rel): Likewise.
16905 (Output_data_got::add_local_with_rela): Likewise.
16906 (Output_data_got::add_local_pair_with_rel): New function.
16907 (Output_data_got::add_local_pair_with_rela): New function.
16908 (Output_data_got::add_global_tls): Removed.
16909 (Output_data_got::add_global_tls_with_rel): Removed.
16910 (Output_data_got::add_global_tls_with_rela): Removed.
16911 (Output_data_got::add_local_tls): Removed.
16912 (Output_data_got::add_local_tls_with_rel): Removed.
16913 (Output_data_got::add_local_tls_with_rela): Removed.
16914 * output.h (Output_data_got::add_global): Added got_type parameter.
16915 (Output_data_got::add_global_with_rel): Likewise.
16916 (Output_data_got::add_global_with_rela): Likewise.
16917 (Output_data_got::add_global_pair_with_rel): New function.
16918 (Output_data_got::add_global_pair_with_rela): New function.
16919 (Output_data_got::add_local): Added got_type parameter.
16920 (Output_data_got::add_local_with_rel): Likewise.
16921 (Output_data_got::add_local_with_rela): Likewise.
16922 (Output_data_got::add_local_pair_with_rel): New function.
16923 (Output_data_got::add_local_pair_with_rela): New function.
16924 (Output_data_got::add_global_tls): Removed.
16925 (Output_data_got::add_global_tls_with_rel): Removed.
16926 (Output_data_got::add_global_tls_with_rela): Removed.
16927 (Output_data_got::add_local_tls): Removed.
16928 (Output_data_got::add_local_tls_with_rel): Removed.
16929 (Output_data_got::add_local_tls_with_rela): Removed.
16930 * resolve.cc (Symbol::override_base_with_special): Removed
16931 reference to has_got_offset_ field.
16932 * symtab.cc (Symbol::init_fields): Replaced initialization
16933 of got_offset_ with got_offsets_. Removed initialization
16935 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16936 (Symbol::got_offset): Likewise.
16937 (Symbol::set_got_offset): Likewise.
16938 (Symbol::has_tls_got_offset): Removed.
16939 (Symbol::tls_got_offset): Removed.
16940 (Symbol::set_tls_got_offset): Removed.
16941 (Symbol::got_offset_): Removed.
16942 (Symbol::tls_mod_got_offset_): Removed.
16943 (Symbol::tls_pair_got_offset_): Removed.
16944 (Symbol::got_offsets_): New field.
16945 (Symbol::has_got_offset): Removed.
16946 (Symbol::has_tls_mod_got_offset): Removed.
16947 (Symbol::has_tls_pair_got_offset): Removed.
16948 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16949 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16951 (Target_x86_64::Scan::global): Likewise.
16952 (Target_x86_64::Relocate::relocate): Likewise.
16953 (Target_x86_64::Relocate::relocate_tls): Likewise.
16955 2008-03-25 Ben Elliston <bje@au.ibm.com>
16957 * yyscript.y: Fix spelling error in comment.
16959 2008-03-24 Ian Lance Taylor <iant@google.com>
16961 * options.h (class General_options): Define build_id option.
16962 * layout.h (class Layout): Declare write_build_id, create_note,
16963 create_build_id. Add build_id_note_ member.
16964 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16965 "libiberty.h", "md5.h", "sha1.h".
16966 (Layout::Layout): Initialize eh_frame_data_,
16967 eh_frame_hdr_section_, and build_id_note_.
16968 (Layout::finalize): Call create_build_id.
16969 (Layout::create_note): New function, broken out of
16970 Layout::create_gold_note.
16971 (Layout::create_gold_note): Call create_note.
16972 (Layout::create_build_id): New function.
16973 (Layout::write_build_id): New function.
16974 (Close_task_runner::run): Call write_build_id.
16976 * x86_64.cc: Correct license to GPLv3.
16978 2008-03-23 Ian Lance Taylor <iant@google.com>
16980 * options.cc: Include "demangle.h".
16981 (parse_optional_string): New function.
16982 (parse_long_option): Handle takes_optional_argument.
16983 (parse_short_option): Update dash_z initializer. Handle
16984 takes_optional_argument.
16985 (General_options::General_options): Initialize do_demangle_.
16986 (General_options::finalize): Set do_demangle_. Handle demangling
16988 * options.h (parse_optional_string): Declare.
16989 (struct One_option): Add optional_arg field. Update constructor.
16990 Update call constructor calls. Add takes_optional_argument
16992 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16993 (DEFINE_optional_string): Define.
16994 (General_options::demangle): Change from DEFINE_bool to
16995 DEFINE_optional_string.
16996 (General_options::no_demangle): New function.
16997 (General_options::do_demangle): New function.
16998 (General_options::set_do_demangle): New function.
16999 (General_options::execstack_status_): Move definition to end of
17001 (General_options::static_): Likewise.
17002 (General_options::do_demangle_): New field.
17003 * object.cc (big_endian>::get_symbol_location_info): Call
17004 Options::do_demangle, not Options::demangle.
17005 * symtab.cc (demangle): Likewise.
17007 2008-03-22 Ian Lance Taylor <iant@google.com>
17009 * gold.h: Include <cstddef> and <sys/types.h>
17010 * options.h: Include <cstring>.
17012 2008-03-21 Ian Lance Taylor <iant@google.com>
17014 * Added source code to GNU binutils.
17016 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17018 Copying and distribution of this file, with or without modification,
17019 are permitted in any medium without royalty provided the copyright
17020 notice and this notice are preserved.
17026 version-control: never