1 2011-10-18 David S. Miller <davem@davemloft.net>
4 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5 member to track relocation locations that have moved during TLS
7 (Target_sparc::Relocate::Relocate): Initialize to NULL.
8 (Target_sparc::Relocate::relocate): Adjust view down by 4
9 bytes if it matches reloc_adjust_addr_.
10 (Target_sparc::Relocate::relocate_tls): Always move the
11 __tls_get_addr call delay slot instruction forward 4 bytes when
12 performing relaxation.
14 2011-10-18 Cary Coutant <ccoutant@google.com>
16 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
17 (Output_file::map_no_anonymous): Check for non-zero
18 return code from posix_fallocate.
20 2011-10-17 Cary Coutant <ccoutant@google.com>
23 * plugin.cc (is_visible_from_outside): Check for symbols
24 referenced from dynamic objects.
25 * resolve.cc (Symbol_table::resolve): Don't count references
26 from dynamic objects as references from real ELF files.
27 * testsuite/plugin_test_2.sh: Adjust expected result.
29 2011-10-17 Cary Coutant <ccoutant@google.com>
31 * gold.cc: Include timer.h.
32 (queue_middle_tasks): Stamp time.
33 (queue_final_tasks): Likewise.
34 * main.cc (main): Store timer in parameters. Print timers
36 * parameters.cc (Parameters::Parameters): Initialize timer_.
37 (Parameters::set_timer): New function.
38 (set_parameters_timer): New function.
39 * parameters.h (Parameters::set_timer): New function.
40 (Parameters::timer): New function.
41 (Parameters::timer_): New data member.
42 (set_parameters_timer): New function.
43 * timer.cc (Timer::stamp): New function.
44 (Timer::get_pass_time): New function.
45 * timer.h (Timer::stamp): New function.
46 (Timer::get_pass_time): New function.
47 (Timer::pass_times_): New data member.
49 2011-10-17 Cary Coutant <ccoutant@google.com>
51 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
52 task for members of lib groups.
54 2011-10-17 Cary Coutant <ccoutant@google.com>
57 * fileread.cc (File_read::find_view): Add assert.
58 (File_read::make_view): Move bounds check (replace with assert)...
59 (File_read::find_or_make_view): ... to here.
61 2011-10-12 Cary Coutant <ccoutant@google.com>
63 * output.cc (Output_file::open_base_file): Handle case where
64 ::read returns less than requested size.
66 2011-10-10 Cary Coutant <ccoutant@google.com>
68 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
69 Initialize defined_count_.
70 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
71 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
72 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
73 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
74 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
75 * incremental.h (Sized_relobj_incr::defined_count_): New data
77 (Sized_incr_dynobj::defined_count_): New data member.
78 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
79 Return zeroes instead of internal error.
81 2011-10-10 Cary Coutant <ccoutant@google.com>
84 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
85 (Output_reloc::symbol_value): Return PLT offset if flag is set.
86 * output.h (class Output_reloc): Add use_plt_offset flag.
87 (Output_reloc::type_): Adjust size of bit field.
88 (Output_reloc::use_plt_offset_): New bit field.
89 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
90 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
91 flag. Adjust all callers.
92 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
93 creating RELATIVE relocations.
95 2011-10-10 Nick Clifton <nickc@redhat.com>
97 * po/es.po: Updated Spanish translation.
98 * po/fi.po: Updated Finnish translation.
100 2011-10-03 Diego Novillo <dnovillo@google.com>
102 * options.cc (parse_uint): Fix dereference of RETVAL.
104 2011-09-29 Sriraman Tallam <tmsriram@google.com>
106 * layout.h (section_order_map_): New member.
107 (get_section_order_map): New member function.
108 * output.cc (Output_section::add_input_section): Check for patterns
109 only when --section-ordering-file is specified.
110 * gold.cc (queue_middle_tasks): Delay updating order of sections till
111 output_sections have been formed.
112 * layout.cc (Layout_Layout): Initialize section_order_map_.
113 * plugin.cc (update_section_order): Store order in order_map. Do not
115 * testsuite/Makefile.am: Add test case for plugin_final_layout.
116 * testsuite/Makefile.in: Regenerate.
117 * testsuite/plugin_section_order.c: New file.
118 * testsuite/plugin_final_layout.cc: New file.
119 * testsuite/plugin_final_layout.sh: New file.
121 2011-09-29 Cary Coutant <ccoutant@google.com>
123 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
125 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
126 symbols during incremental update.
127 (Symbol_table::add_from_dynobj): Likewise.
129 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
130 Ian Lance Taylor <iant@google.com>
132 * symtab.cc (Symbol_table::define_special_symbol): Always
133 canonicalize version string.
135 2011-09-26 Cary Coutant <ccoutant@google.com>
137 * gold.cc (queue_initial_tasks): Move option checks ...
138 * options.cc (General_options::finalize): ... to here. Disable
139 some options; make others fatal.
141 2011-09-26 Cary Coutant <ccoutant@google.com>
144 * plugin.cc (get_symbols_v2): New function.
145 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
146 (is_referenced_from_outside): New function.
147 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
148 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
149 (get_symbols): Pass version parameter.
150 (get_symbols_v2): New function.
151 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
153 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
154 (onload): Add LDPT_GET_SYMBOLS_V2.
155 (all_symbols_read_hook): Use get_symbols_v2; check for
156 LDPR_PREVAILING_DEF_IRONLY_EXP.
157 * testsuite/plugin_test_3.sh: Update expected results.
159 2011-09-23 Simon Baldwin <simonb@google.com>
161 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
162 configuration options.
163 * configure: Regenerate.
164 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
165 * Makefile.in: Regenerate.
166 * testsuite/Makefile.in: Regenerate.
168 2011-09-19 Sriraman Tallam <tmsriram@google.com>
170 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
172 2011-09-19 Cary Coutant <ccoutant@google.com>
174 * incremental.cc (can_incremental_update): Fix typo in comment.
175 * incremental.h (can_incremental_update): Likewise.
177 2011-09-18 Cary Coutant <ccoutant@google.com>
179 * incremental.cc (can_incremental_update): New function.
180 * incremental.h (can_incremental_update): New function.
181 * layout.cc (Layout::init_fixed_output_section): Call it.
182 (Layout::make_output_section): Don't allow patch space in .eh_frame.
183 * object.cc (Sized_relobj_file::do_layout): Call
184 can_incremental_update.
186 2011-09-13 Cary Coutant <ccoutant@google.com>
188 * configure.ac: Check for glibc support for gnu_indirect_function
189 support with static linking, setting automake conditional
191 * Makefile.in: Regenerate.
192 * configure: Regenerate.
194 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
195 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
197 * testsuite/Makefile.in: Regenerate.
199 2011-09-13 Cary Coutant <ccoutant@google.com>
201 * incremental.cc (Sized_relobj_incr::do_layout): Call
202 report_comdat_group for kept comdat sections.
203 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
204 * testsuite/Makefile.in: Regenerate.
205 * testsuite/incr_comdat_test_1.cc: New source file.
206 * testsuite/incr_comdat_test_2_v1.cc: New source file.
207 * testsuite/incr_comdat_test_2_v2.cc: New source file.
208 * testsuite/incr_comdat_test_2_v3.cc: New source file.
210 2011-09-13 Ian Lance Taylor <iant@google.com>
212 * object.cc (Sized_relobj_file::do_layout): Remove unused local
213 variable external_symbols_offset.
215 2011-09-12 Ian Lance Taylor <iant@google.com>
217 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
218 triggered if object has no symbols.
220 2011-09-09 David S. Miller <davem@davemloft.net>
222 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
223 (Output_fill_debug_line::do_write): Likewise.
225 2011-08-29 Cary Coutant <ccoutant@google.com>
227 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
228 casts to match formatting specs.
229 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
231 2011-08-26 Cary Coutant <ccoutant@google.com>
233 * layout.cc (Free_list::allocate): Provide guarantee of minimum
234 remaining hole size when allocating.
235 (Layout::make_output_section): Set fill methods for debug sections.
236 * layout.h (Free_list::Free_list_node): Move from private to
238 (Free_list::set_min_hole_size): New function.
239 (Free_list::begin, Free_list::end): New functions.
240 (Free_list::min_hole_): New data member.
241 * output.cc: Include dwarf.h.
242 (Output_fill_debug_info::do_minimum_hole_size): New function.
243 (Output_fill_debug_info::do_write): New function.
244 (Output_fill_debug_line::do_minimum_hole_size): New function.
245 (Output_fill_debug_line::do_write): New function.
246 (Output_section::Output_section): Initialize new data member.
247 (Output_section::set_final_data_size): Ensure patch space is larger
248 than minimum hole size.
249 (Output_section::do_write): Fill holes in debug sections.
250 * output.h (Output_fill): New class.
251 (Output_fill_debug_info): New class.
252 (Output_fill_debug_line): New class.
253 (Output_section::set_free_space_fill): New function.
254 (Output_section::free_space_fill_): New data member.
255 * testsuite/Makefile.am (incremental_test_3): Add
256 --incremental-patch option.
257 (incremental_test_4): Likewise.
258 (incremental_test_5): Likewise.
259 (incremental_test_6): Likewise.
260 (incremental_copy_test): Likewise.
261 (incremental_common_test_1): Likewise.
262 * testsuite/Makefile.in: Regenerate.
264 2011-08-26 Nick Clifton <nickc@redhat.com>
266 * po/es.po: Updated Spanish translation.
268 2011-08-01 Cary Coutant <ccoutant@google.com>
270 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
271 * gold/testsuite/Makefile.in: Regenerate.
272 * gold/testsuite/justsyms_exec.c: New source file.
273 * gold/testsuite/justsyms_lib.c: New source file.
275 2011-08-01 Cary Coutant <ccoutant@google.com>
277 * layout.cc (Layout::set_segment_offsets): Don't realign text
278 segment if -Ttext was specified.
279 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
281 * object.h (Sized_relobj_file::e_type): New function.
282 (Sized_relobj_file::e_type_): New data member.
283 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
284 base address for ET_EXEC files.
285 * target.cc (Target::do_make_elf_object_implementation): Allow
286 ET_EXEC files with --just-symbols option.
288 2011-07-28 Cary Coutant <ccoutant@google.com>
290 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
291 Add thread_number parameter.
292 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
293 * workqueue-threads.cc
294 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
295 current thread if its thread number is greater than desired thread
297 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
298 Add thread_number parameter.
299 (Workqueue::should_cancel_thread): Likewise.
300 (Workqueue::find_runnable_or_wait): Pass thread_number to
301 should_cancel_thread.
302 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
305 2011-07-22 Sriraman Tallam <tmsriram@google.com>
307 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
308 only after checking if it cannot be forced local.
309 * symtab.h (is_externally_visible): Check if the symbol is not forced
312 2011-07-15 Ian Lance Taylor <iant@google.com>
314 * options.h (class General_options): Add --print-output-format.
315 Move -EL next to -EB, for better --help output.
316 * target-select.cc: Include <cstdio>, "options.h", and
318 (Target_selector::do_target_bfd_name): New function.
319 (print_output_format): New function.
320 * target-select.h (class Target_selector): Update declarations.
321 (Target_selector::target_bfd_name): New function.
322 (print_output_format): Declare.
323 * main.cc: Include "target-select.h".
324 (main): Handle --print-output-format.
325 * gold.cc: Include "target-select.h".
326 (queue_initial_tasks): Handle --print-output-format when there are
328 * parameters.cc (parameters_force_valid_target): Give a better
329 error message if -EB/-EL does not match target.
330 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
333 2011-07-15 Ian Lance Taylor <iant@google.com>
335 * i386.cc (class Output_data_plt_i386): Add layout_ field.
336 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
337 (Output_data_plt_i386::do_write): Write address of .dynamic
338 section to first entry in .got.plt section.
339 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
340 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
342 (Output_data_plt_x86_64::do_write): Write address of .dynamic
343 section to first entry in .got.plt section.
344 * layout.h (Layout::dynamic_section): New function.
346 2011-07-13 Sriraman Tallam <tmsriram@google.com>
348 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
350 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
351 input_section_position_, and input_section_glob_.
352 (read_layout_from_file): Call function section_ordering_specified.
353 * layout.h (is_section_ordering_specified): New function.
354 (section_ordering_specified): New function.
355 (section_ordering_specified_): New boolean member.
356 * main.cc(main): Call load_plugins after layout object is defined.
357 * output.cc (Output_section::add_input_section): Use
358 function section_ordering_specified to check if section ordering is
360 * output.cc (Output_section::add_relaxed_input_section): Use
361 function section_ordering_specified to check if section ordering is
363 (Output_section::update_section_layout): New function.
364 (Output_section::sort_attached_input_sections): Check if input section
366 * output.h (Output_section::update_section_layout): New function.
367 * plugin.cc (get_section_count): New function.
368 (get_section_type): New function.
369 (get_section_name): New function.
370 (get_section_contents): New function.
371 (update_section_order): New function.
372 (allow_section_ordering): New function.
373 (Plugin::load): Add the new interfaces to the transfer vector.
374 (Plugin_manager::load_plugins): New parameter.
375 (Plugin_manager::all_symbols_read): New parameter.
376 (Plugin_manager::claim_file): New parameter. Save the elf object for
378 (Plugin_manager::get_elf_object): New function.
379 (Plugin_manager::get_view): Change to directly use the bool to check
380 if get_view is called from claim_file_hook.
381 * plugin.h (input_objects): New function
382 (Plugin__manager::load_plugins): New parameter.
383 (Plugin_manager::claim_file): New parameter.
384 (Plugin_manager::get_elf_object): New function.
385 (Plugin_manager::in_claim_file_handler): New function.
386 (Plugin_manager::in_claim_file_handler_): New member.
387 (layout): New function.
388 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
389 handler with an extra parameter. Make the elf object before calling
391 * testsuite/plugin_test.c (get_section_count): New function pointer.
392 (get_section_type): New function pointer.
393 (get_section_name): New function pointer.
394 (get_section_contents): New function pointer.
395 (update_section_order): New function pointer.
396 (allow_section_ordering): New function pointer.
397 (onload): Check if the new interfaces exist.
399 2011-07-13 Ian Lance Taylor <iant@google.com>
401 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
403 * x86_64.cc (Target_x86_64::got_section): Likewise.
404 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
405 (relro_now_test_SOURCES): New variable.
406 (relro_now_test_DEPENDENCIES): New variable.
407 (relro_now_test_LDFLAGS): New variable.
408 (relro_now_test_LDADD): New variable.
409 (relro_now_test.so): New target.
410 * testsuite/Makefile.in: Rebuild.
412 2011-07-12 Ian Lance Taylor <iant@google.com>
415 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
416 GLOB_DAT relocation rather than a RELATIVE relocation for a
417 protected symbol when creating a shared library.
418 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
419 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
420 * testsuite/protected_main_1.cc (main): Test that protected
421 function has same address.
423 2011-07-11 Ian Lance Taylor <iant@google.com>
426 * options.h (class General_options): Add -Bgroup.
427 * options.cc (General_options::finalize): If -Bgroup is set,
428 default to --unresolved-symbols=report-all.
429 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
430 * target-reloc.h (issue_undefined_symbol_error): Handle
431 --unresolved-symbols=report-all.
433 2011-07-08 Ian Lance Taylor <iant@google.com>
436 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
437 if linker script discards key sections.
438 (Layout::create_dynamic_symtab): Likewise.
439 (Layout::assign_local_dynsym_offsets): Likewise.
440 (Layout::sized_create_version_sections): Likewise.
441 (Layout::create_interp): Likewise.
442 (Layout::finish_dynamic_section): Likewise.
443 (Layout::set_dynamic_symbol_size): Likewise.
445 2011-07-08 Ian Lance Taylor <iant@google.com>
448 * options.h (class General_options): Add --unresolved-symbols.
449 * target-reloc.h (issue_undefined_symbol_error): Check
450 --unresolved-symbols. Add comments.
452 2011-07-08 Ian Lance Taylor <iant@google.com>
454 * testsuite/odr_violation2.cc (Ordering::operator()): Make
455 expression more complex.
457 2011-07-08 Ian Lance Taylor <iant@google.com>
460 * target-reloc.h (issue_undefined_symbol_error): New inline
461 function, broken out of relocate_section.
462 (relocate_section): Call issue_undefined_symbol_error.
463 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
464 there is no TLS segment if we are about to issue an undefined
466 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
468 2011-07-08 Ian Lance Taylor <iant@google.com>
471 * resolve.cc (Symbol_table::should_override): Add fromtype
472 parameter. Change all callers. Give error when linking together
473 TLS and non-TLS symbol.
474 (Symbol_table::should_override_with_special): Add fromtype
475 parameter. Change all callers.
476 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
477 there is no TLS segment if we have reported some errors.
478 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
480 2011-07-08 Ian Lance Taylor <iant@google.com>
483 * target.h (Target::plt_address_for_global): New function.
484 (Target::plt_address_for_local): New function.
485 (Target::plt_section_for_global): Remove.
486 (Target::plt_section_for_local): Remove.
487 (Target::do_plt_address_for_global): New virtual function.
488 (Target::do_plt_address_for_local): New virtual function.
489 (Target::do_plt_section_for_global): Remove.
490 (Target::do_plt_section_for_local): Remove.
491 (Target::register_global_plt_entry): Add Symbol_table and Layout
493 * output.cc (Output_data_got::Got_entry::write): Use
494 plt_address_for_global and plt_address_for_local.
495 * layout.cc (Layout::add_target_dynamic_tags): Use size and
496 address of output section.
497 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
498 got_irelative_, and irelative_count_ fields. Update
500 (Output_data_plt_i386::has_irelative_section): New function.
501 (Output_data_plt_i386::entry_count): Add irelative_count_.
502 (Output_data_plt_i386::set_final_data_size): Likewise.
503 (class Target_i386): Add got_irelative_ and rel_irelative_
504 fields. Update declarations.
505 (Target_i386::Target_i386): Initialize new fields.
506 (Target_i386::do_plt_address_for_global): New function replacing
507 do_plt_section_for_global.
508 (Target_i386::do_plt_address_for_local): New function replacing
509 do_plt_section_for_local.
510 (Target_i386::got_section): Create got_irelative_.
511 (Target_i386::rel_irelative_section): New function.
512 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
513 fields. Don't define __rel_iplt_{start,end}.
514 (Output_data_plt_i386::add_entry): Add symtab and layout
515 parameters. Change all callers. Use different PLT and GOT for
517 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
518 layout parameters. Change all callers. Use different PLT and
520 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
521 (Output_data_plt_i386::rel_irelative): New function.
522 (Output_data_plt_i386::address_for_global): New function.
523 (Output_data_plt_i386::address_for_local): New function.
524 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
525 IRELATIVE GOT when changing IFUNC GOT entries.
526 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
528 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
529 if we didn't create an IRELATIVE GOT.
530 (Target_i386::Relocate::relocate): Use plt_address_for_global and
531 plt_address_for_local.
532 (Target_i386::do_dynsym_value): Use plt_address_for_global.
533 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
534 got_irelative_, and irelative_count_ fields. Update
536 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
537 Initialize new fields. Remove symtab parameter. Change all
539 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
541 (Output_data_plt_x86_64::has_irelative_section): New function.
542 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
543 (class Target_x86_64): Add got_irelative_ and rel_irelative_
544 fields. Update declarations.
545 (Target_x86_64::Target_x86_64): Initialize new fields.
546 (Target_x86_64::do_plt_address_for_global): New function replacing
547 do_plt_section_for_global.
548 (Target_x86_64::do_plt_address_for_local): New function replacing
549 do_plt_section_for_local.
550 (Target_x86_64::got_section): Create got_irelative_.
551 (Target_x86_64::rela_irelative_section): New function.
552 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
553 all callers. Don't create __rel_iplt_{start,end}.
554 (Output_data_plt_x86_64::add_entry): Add symtab and layout
555 parameters. Change all callers. Use different PLT and GOT for
557 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
558 layout parameters. Change all callers. Use different PLT and
560 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
561 parameters. Change all callers. Use different PLT and GOT for
563 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
564 (Output_data_plt_x86_64::rela_irelative): New function.
565 (Output_data_plt_x86_64::address_for_global): New function.
566 (Output_data_plt_x86_64::address_for_local): New function.
567 (Output_data_plt_x86_64::set_final_data_size): Likewise.
568 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
569 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
570 (Target_x86_64::register_global_plt_entry): Add symtab and layout
572 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
574 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
575 symbols if we didn't create an IRELATIVE GOT.
576 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
577 plt_address_for_local.
578 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
579 * testsuite/ifuncvar1.c: New test file.
580 * testsuite/ifuncvar2.c: New test file.
581 * testsuite/ifuncvar3.c: New test file.
582 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
583 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
584 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
585 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
586 * testsuite/Makefile.in: Rebuild.
588 2011-07-07 Cary Coutant <ccoutant@google.com>
590 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
591 (two_file_test_1_ndebug.o): Likewise.
592 (two_file_test_1b_ndebug.o): Likewise.
593 (two_file_test_2_ndebug.o): Likewise.
594 (two_file_test_main_ndebug.o): Likewise.
595 (incremental_test_2): Link with no-debug versions.
597 2011-07-06 Cary Coutant <ccoutant@google.com>
599 * gold/incremental.cc
600 (Output_section_incremental_inputs::write_info_blocks): Check for
601 hidden and internal symbols.
603 2011-07-06 Cary Coutant <ccoutant@google.com>
605 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
606 Check disposition for startup file.
607 (Incremental_inputs::report_command_line): Ignore
608 --incremental-startup-unchanged option.
609 * options.cc (General_options::parse_incremental_startup_unchanged):
611 (General_options::General_options): Initialize new data member.
612 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
613 (General_options): Add --incremental-startup-unchanged option.
614 (General_options::incremental_startup_disposition): New function.
615 (General_options::incremental_startup_disposition_): New data member.
617 2011-07-06 Cary Coutant <ccoutant@google.com>
619 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
620 input file index to Script_info ctor.
621 (Sized_incremental_binary::do_file_has_changed): Find the
622 command-line argument for files named in scripts.
623 * incremental.h (Script_info::Script_info): New ctor
624 with input file index.
625 (Script_info::input_file_index): New function.
626 (Script_info::input_file_index_): New data member.
627 (Incremental_binary::get_library): Add const.
628 (Incremental_binary::get_script_info): Add const.
629 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
630 * testsuite/Makefile.am (incremental_test_5): New test case.
631 (incremental_test_6): New test case.
632 * testsuite/Makefile.in: Regenerate.
634 2011-07-06 Cary Coutant <ccoutant@google.com>
636 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
637 debug output when command lines differ.
639 2011-07-06 Cary Coutant <ccoutant@google.com>
641 * incremental.cc (Incremental_inputs::report_command_line): Ignore
642 --incremental-patch option.
643 * layout.cc (Free_list::allocate): Extend allocation beyond original
645 (Layout::make_output_section): Mark sections that should get
647 * options.cc (parse_percent): New function.
648 * options.h (parse_percent): New function.
649 (DEFINE_percent): New macro.
650 (General_options): Add --incremental-patch option.
651 * output.cc (Output_section::Output_section): Initialize new data
653 (Output_section::add_input_section): Print section name when out
655 (Output_section::add_output_section_data): Likewise.
656 (Output_section::set_final_data_size): Add patch space when
657 doing --incremental-full.
658 (Output_section::do_reset_address_and_file_offset): Remove patch
660 (Output_segment::set_section_list_addresses): Print debug output
661 only if --incremental-update.
662 * output.h (Output_section::set_is_patch_space_allowed): New function.
663 (Output_section::is_patch_space_allowed_): New data member.
664 (Output_section::patch_space_): New data member.
665 * parameters.cc (Parameters::incremental_full): New function.
666 * parameters.h (Parameters::incremental_full): New function
667 * testsuite/Makefile.am (incremental_test_2): Add test for
668 --incremental-patch option.
669 * testsuite/Makefile.in: Regenerate.
670 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
671 (t18): Remove function body.
673 2011-07-05 Doug Kwan <dougkwan@google.com>
676 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
677 Arm_Address type for relocation result.
678 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
680 (Arm_relocate_functions::abs32): Use unaligned access.
681 (Arm_relocate_functions::rel32): Ditto.
682 (Arm_relocate_functions::prel31): Ditto.
683 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
684 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
685 static data relocations.
686 * testsuite/Makefile.in: Regnerate.
687 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
689 2011-07-05 Ian Lance Taylor <iant@google.com>
692 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
693 symbols if necessary.
694 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
696 2011-07-05 Ian Lance Taylor <iant@google.com>
699 * resolve.cc (Symbol::override_base_with_special): Simply override
700 version with special symbol version, ignoring previous version.
702 2011-07-05 Ian Lance Taylor <iant@google.com>
704 * object.cc (Sized_relobj_file::include_section_group): Add
705 information to comment about signature location.
707 2011-07-02 Ian Lance Taylor <iant@google.com>
710 * options.h (class General_options): Add -f and -F.
711 * options.cc (General_options::finalize): Fatal error if -f/-F
712 are used without -shared.
713 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
715 2011-07-02 Ian Lance Taylor <iant@google.com>
717 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
719 2011-07-01 Ian Lance Taylor <iant@google.com>
723 * resolve.cc (Symbol::override_base_with_special): Don't override
724 the version if the overriding symbol has a different name.
725 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
726 all callers. If we give an error about an undefined version,
727 define the base version if necessary.
728 * dynobj.h (class Versions): Update declaration.
729 * testsuite/weak_alias_test_5.cc: New file.
730 * testsuite/weak_alias_test.script: New file.
731 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
732 and versioned_alias have the right value, and call t2.
733 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
734 weak_alias_test_5.so.
735 (weak_alias_test_LDADD): Likewise.
736 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
737 * testsuite/Makefile.in: Rebuild.
739 2011-07-01 Ian Lance Taylor <iant@google.com>
742 * options.h (class General_options): Support -z notext.
743 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
745 (two_file_shared_nonpic.so): Likewise.
746 (two_file_shared_mixed.so): Likewise.
747 (two_file_shared_mixed_1.so): Likewise.
748 (weak_undef_lib_nonpic.so): Likewise.
749 (alt/weak_undef_lib_nonpic.so): Likewise.
750 (tls_test_shared_nonpic.so): Likewise.
751 * testsuite/Makefile.in: Rebuild.
753 2011-07-01 Ian Lance Taylor <iant@google.com>
756 * configure.ac: Test whether static linking works, setting
757 the automake conditional HAVE_STATIC.
758 * testsuite/Makefile.am: Disable tests using -static if
759 HAVE_STATIC is not true.
760 * configure, testsuite/Makefile.in: Rebuild.
762 2011-07-01 Ian Lance Taylor <iant@google.com>
765 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
766 Assert if we see DW_EH_PE_indirect.
767 * target.h (Target::ehframe_datarel_base): New function.
768 (Target::do_ehframe_datarel_base): New target function.
769 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
770 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
773 2011-07-01 Ian Lance Taylor <iant@google.com>
776 * options.h (class General_options): Add
777 --ld-generated-unwind-info.
778 * ehframe.cc (Fde::write): Add address parameter. Change all
779 callers. If associated with PLT, fill in address and size.
780 (Cie::set_output_offset): Only add merge mapping if there is an
782 (Cie::write): Add address parameter. Change all callers.
783 (Eh_frame::add_ehframe_for_plt): New function.
784 * ehframe.h (class Fde): Update declarations. Move shndx_ and
785 input_offset_ fields into union u_, with new plt field.
786 (Fde::Fde): Adjust for new union field.
787 (Fde::Fde) [Output_data version]: New constructor.
788 (Fde::add_mapping): Only add merge mapping if there is an object.
789 (class Cie): Update declarations.
790 (class Eh_frame): Declare add_ehframe_for_plt.
791 * layout.cc (Layout::layout_eh_frame): Break out code into
792 make_eh_frame_section, and call it.
793 (Layout::make_eh_frame_section): New function.
794 (Layout::add_eh_frame_for_plt): New function.
795 * layout.h (class Layout): Update declarations.
796 * merge.cc (Merge_map::add_mapping): Add assertion.
797 * i386.cc: Include "dwarf.h".
798 (class Output_data_plt_i386): Make first_plt_entry,
799 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
800 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
801 and plt_eh_frame_fde.
802 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
803 boundary. Call add_eh_frame_for_plt if appropriate.
804 * x86_64.cc: Include "dwarf.h".
805 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
806 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
807 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
808 and plt_eh_frame_fde.
809 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
812 2011-06-29 Ian Lance Taylor <iant@google.com>
815 * object.cc (Sized_relobj_file::layout_section): Change shdr
816 parameter to be const.
817 (Sized_relobj_file::layout_eh_frame_section): New function, broken
819 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
820 appropriate. Call layout_eh_frame_section.
821 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
823 * object.h (class Sized_relobj_file): Update declarations.
825 2011-06-29 Ian Lance Taylor <iant@google.com>
828 * script.cc (Token::integer_value): Accept trailing M/m/K/k
830 (Lex::gather_token): Accept trailing M/m/K/k for integers.
832 2011-06-29 Ian Lance Taylor <iant@google.com>
835 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
837 * layout.cc (Layout::layout_eh_frame): Likewise.
839 2011-06-29 Ian Lance Taylor <iant@google.com>
842 * layout.cc (Layout::symtab_section_shndx): New function.
843 * layout.h (class Layout): Declare symtab_section_shndx.
844 * output.cc (Output_section::write_header): Call it.
846 2011-06-29 Ian Lance Taylor <iant@google.com>
849 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
850 symbols which are not used in a relocation.
852 2011-06-28 Ian Lance Taylor <iant@google.com>
855 * layout.cc (Layout::segment_precedes): Don't crash if a linker
856 script create indistinguishable segments.
857 (Layout::set_segment_offsets): Use stable_sort when sorting
858 segments. Pass this to Compare_segments constructor.
859 * layout.h (class Layout): Make segment_precedes non-static.
860 (class Compare_segments): Change from struct to class. Add
861 layout_ field. Add constructor.
863 (Script_sections::attach_sections_using_phdrs_clause): Rename
864 local orphan to is_orphan. Don't report failure to put empty
865 section in segment. On attachment failure, report name of
866 section, and attach to first PT_LOAD segment.
868 2011-06-28 Ian Lance Taylor <iant@google.com>
871 * target-select.cc (Target_selector::Target_selector): Add
872 emulation parameter. Change all callers.
873 (select_target_by_bfd_name): Rename from select_target_by_name.
875 (select_target_by_emulation): New function.
876 (supported_emulation_names): New function.
877 * target-select.h (class Target_selector): Add emulation_ field.
879 (Target_selector::recognize_by_bfd_name): Rename from
880 recognize_by_name. Change all callers.
881 (Target_selector::supported_bfd_names): Rename from
882 supported_names. Change all callers.
883 (Target_selector::recognize_by_emulation): New function.
884 (Target_selector::supported_emulations): New function.
885 (Target_selector::emulation): New function.
886 (Target_selector::do_recognize_by_bfd_name): Rename from
887 do_recognize_by_name. Change all callers.
888 (Target_selector::do_supported_bfd_names): Rename from
889 do_supported_names. Change all callers.
890 (Target_selector::do_recognize_by_emulation): New function.
891 (Target_selector::do_supported_emulations): New function.
892 (select_target_by_bfd_name): Change name in declaration.
893 (select_target_by_emulation): Declare.
894 (supported_emulation_names): Declare.
895 * parameters.cc (parameters_force_valid_target): Try to find
896 target based on emulation from -m option.
897 * options.h (class General_options): Change doc string for -m.
898 * options.cc (help): Print emulations.
899 (General_options::parse_V): Likewise.
900 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
901 Add emulation parameter. Change all callers.
903 2011-06-28 Ian Lance Taylor <iant@google.com>
905 * target.h (class Target): Add osabi_ field.
906 (Target::osabi): New function.
907 (Target::set_osabi): New function.
908 (Target::Target): Initialize osabi_.
909 (Target::do_adjust_elf_header): Make pure virtual.
910 (Sized_target::do_adjust_elf_header): Declare.
911 * target.cc (Sized_target::do_adjust_elf_header): New function.
912 (class Sized_target): Instantiate all versions.
913 * freebsd.h (class Target_freebsd): Remove.
914 (Target_selector_freebsd::do_recognize): Call set_osabi on
916 (Target_selector_freebsd::do_recognize_by_name): Likewise.
917 (Target_selector_freebsd::set_osabi): Remove.
918 * i386.cc (class Target_i386): Inherit from Sized_target rather
920 * x86_64.cc (class Target_x86_64): Likewise.
922 2011-06-28 Ian Lance Taylor <iant@google.com>
924 * target.h (Target::can_check_for_function_pointers): Rewrite.
926 (Target::can_icf_inline_merge_sections): Likewise.
927 (Target::section_may_have_icf_unsafe_poineters): Likewise.
928 (Target::Target_info): Add can_icf_inline_merge_sections field.
929 (Target::do_can_check_for_function_pointers): New virtual
931 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
932 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
933 from can_check_for_function_pointers, move in file.
934 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
935 section_may_have_icf_unsafe_poineters, move in file.
936 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
937 * i386.cc (Target_i386::do_can_check_for_function_pointers):
938 Rename from can_check_for_function_pointers, move in file.
939 (Target_i386::can_icf_inline_merge_sections): Remove.
940 (Target_i386::i386_info): Initialize
941 can_icf_inline_merge_sections.
942 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
943 Initialize can_icf_inline_merge_sections.
944 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
945 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
946 Rename from can_check_for_function_pointers, move in file.
947 (Target_x86_64::can_icf_inline_merge_sections): Remove.
948 (Target_x86_64::x86_64_info): Initialize
949 can_icf_inline_merge_sections.
950 * testsuite/testfile.cc (Target_test::test_target_info):
952 * icf.cc (get_section_contents): Correct formatting.
954 2011-06-27 Ian Lance Taylor <iant@google.com>
956 * symtab.cc (Symbol::versioned_name): New function.
957 (Symbol_table::add_to_final_symtab): Use versioned_name when
959 (Symbol_table::sized_write_symbol): Likewise.
960 * symtab.h (class Symbol): Declare versioned_name.
961 * stringpool.h (class Stringpool_template): Add variant of add
962 which takes a std::basic_string.
963 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
964 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
965 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
966 (ver_test_12.o): New target.
967 * testsuite/Makefile.in: Rebuild.
969 2011-06-27 Doug Kwan <dougkwan@google.com>
971 * arm.cc (Arm_relocate_functions::thm_jump8,
972 Arm_relocate_functions::thm_jump11): Use a wider signed
973 type to compute offset.
974 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
976 * testsuite/Makefile.in: Regenerate.
977 * testsuite/arm_branch_in_range.sh: Check test results of
978 arm_thm_jump11 and arm_thm_jump8.
979 * testsuite/arm_thm_jump11.s: New test source file.
980 * testsuite/arm_thm_jump11.t: New linker script.
981 * testsuite/arm_thm_jump8.s: New test source file.
982 * testsuite/arm_thm_jump8.t: New linker script.
984 2011-06-24 Ian Lance Taylor <iant@google.com>
986 * layout.cc: Include "object.h".
987 (ctors_sections_in_init_array): New static variable.
988 (Layout::is_ctors_in_init_array): New function.
989 (Layout::layout): Add entry to ctors_sections_in_init_array if
991 * layout.h (class Layout): Declare is_ctors_in_init_array.
992 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
993 is_ctors_reverse_view is set.
994 (Sized_relobj_file::write_sections): Add layout parameter. Change
995 all callers. Set is_ctors_reverse_view field of View_size.
996 (Sized_relobj_file::reverse_words): New function.
997 * object.h (Sized_relobj_file::View_size): Add
998 is_ctors_reverse_view field.
999 (class Sized_relobj_file): Update declarations.
1000 * testsuite/initpri3.c: New test.
1001 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1003 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1004 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1005 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1006 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1007 * testsuite/Makefile.in: Rebuild.
1009 2011-06-24 Cary Coutant <ccoutant@google.com>
1011 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1012 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1013 (debug_msg_cdebug.err): New targets.
1014 * testsuite/Makefile.in: Regenerate.
1015 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1016 Fix checks for link with shared library.
1018 2011-06-24 Doug Kwan <dougkwan@google.com>
1020 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1021 skip empty text sections.
1022 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1024 2011-06-22 Ian Lance Taylor <iant@google.com>
1027 * options.h (class General_options): Add --ctors-in-init-array.
1028 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1029 friends as SHT_PROGBITS for merging sections.
1030 (Layout::layout): Remove special handling of .init_array and
1031 friends. Don't sort if doing relocatable link. Sort for .ctors
1032 and .dtors if ctors_in_init_array.
1033 (Layout::make_output_section): Force correct section types for
1034 .init_array and friends. Don't sort if doing relocatable link,
1035 Don't sort .ctors and .dtors if ctors_in_init_array.
1036 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1037 (Layout::output_section_name): Add relobj parameter. Change all
1038 callers. Handle .ctors. and .dtors. in code rather than table.
1039 Handle .ctors and .dtors if ctors_in_init_array.
1040 (Layout::match_file_name): New function, moved from output.cc.
1041 * layout.h (class Layout): Update declarations.
1042 * output.cc: Include "layout.h".
1043 (Input_section_sort_entry::get_priority): New function.
1044 (Input_section_sort_entry::match_file_name): Just call
1045 Layout::match_file_name.
1046 (Output_section::Input_section_sort_init_fini_compare::operator()):
1047 Handle .ctors and .dtors. Sort by explicit priority rather than
1049 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1050 * testsuite/initpri2.c: New test.
1051 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1052 (check_PROGRAMS): Add initpri2.
1053 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1054 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1055 * configure, testsuite/Makefile.in: Rebuild.
1057 2011-06-19 Ian Lance Taylor <iant@google.com>
1060 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1061 .interp section to a PT_INTERP segment even if we have seen a
1062 --dynamic-linker option. Don't do it if we have seen a PHDRS
1063 clause in a linker script.
1064 (Layout::finalize): Don't create a .interp section if we've
1065 already create a PT_INTERP segment.
1066 (Layout::create_interp): Always call choose_output_section (revert
1067 patch of 2011-06-17). Don't create PT_INTERP segment.
1068 * script-sections.cc
1069 (Script_sections::create_note_and_tls_segments): Add a .interp
1070 section to a PT_INTERP segment even if we have seen a
1071 --dynamic-linker option.
1073 2011-06-18 Ian Lance Taylor <iant@google.com>
1075 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1076 merely because a non-PT_LOAD segment has a dynamic reloc.
1078 2011-06-18 Ian Lance Taylor <iant@google.com>
1080 * layout.cc (Layout::finish_dynamic_section): Don't create
1081 DT_FLAGS entry if not needed.
1083 2011-06-18 Ian Lance Taylor <iant@google.com>
1086 * layout.cc (Layout::layout_eh_frame): Correct handling of
1087 writable .eh_frame section.
1089 2011-06-17 Ian Lance Taylor <iant@google.com>
1092 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1093 symbol is redefined with the exact same object and value.
1095 2011-06-17 Ian Lance Taylor <iant@google.com>
1098 * layout.h (class Layout): Add interp_segment_ field.
1099 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1100 (Layout::attach_allocated_section_to_segment): If making shared
1101 library, put .interp section in PT_INTERP segment.
1102 (Layout::finalize): Also call create_interp if -dynamic-linker
1104 (Layout::create_interp): Assert that there is no PT_INTERP
1105 segment. If not using a SECTIONS clause, use make_output_section.
1106 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1107 * script-sections.cc
1108 (Script_sections::create_note_and_tls_segments): If making shared
1109 library, put .interp section in PT_INTERP segment.
1111 2011-06-17 Ian Lance Taylor <iant@google.com>
1113 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1114 when making a shared library.
1116 2011-06-17 Ian Lance Taylor <iant@google.com>
1118 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1119 parameter. Change all callers. Don't issue warning about PC32
1120 against locally defined symbol.
1122 2011-06-16 Ian Lance Taylor <iant@google.com>
1124 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1125 occurs in same object.
1127 2011-06-14 Alan Modra <amodra@gmail.com>
1129 * po/POTFILES.in: Regenerate.
1131 2011-06-09 Ian Lance Taylor <iant@google.com>
1133 * script-sections.cc
1134 (Orphan_output_section::set_section_addresses): For a relocatable
1135 link set address to 0.
1137 2011-06-09 Cary Coutant <ccoutant@google.com>
1140 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1141 used with --compress-debug-sections.
1142 * gold/object.cc (Sized_relobj_file::do_layout): Report
1143 uncompressed size of compressed input sections.
1145 2011-06-08 Cary Coutant <ccoutant@google.com>
1148 * testsuite/two_file_test_2_v1.cc: Change initialization of
1149 v2 to keep it in .data.
1151 2011-06-07 Cary Coutant <ccoutant@google.com>
1153 * common.cc (Symbol_table::do_allocate_commons_list): Call
1155 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1156 (Errors::fallback): New function.
1157 (gold_fallback): New function.
1158 * errors.h (Errors::fallback): New function.
1159 * gold.cc (gold_exit): Change status parameter to enum; adjust
1161 (queue_initial_tasks): Call gold_fallback.
1162 * gold.h: Include cstdlib.
1163 (Exit_status): New enum type.
1164 (gold_exit): Change status parameter to enum.
1165 (gold_fallback): New function.
1166 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1167 (Layout::create_symtab_sections): Likewise.
1168 (Layout::create_shdrs): Likewise.
1169 * main.cc (main): Adjust call to gold_exit.
1170 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1171 (Output_data_got::add_got_entry_pair): Likewise.
1172 (Output_section::add_input_section): Likewise.
1173 (Output_section::add_output_section_data): Likewise.
1174 (Output_segment::set_section_list_addresses): Likewise.
1175 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1177 2011-06-07 Cary Coutant <ccoutant@google.com>
1179 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1180 for incremental links.
1181 * output.cc (Output_segment::set_section_list_addresses): Remove
1182 FIXME and test for TLS or BSS.
1184 2011-06-07 Cary Coutant <ccoutant@google.com>
1186 * testsuite/Makefile.am: Add incremental_copy_test,
1187 incremental_common_test_1.
1188 * testsuite/Makefile.in: Regenerate.
1189 * testsuite/common_test_1_v1.c: New source file.
1190 * testsuite/common_test_1_v2.c: New source file.
1191 * testsuite/copy_test_v1.cc: New source file.
1193 2011-06-07 Cary Coutant <ccoutant@google.com>
1195 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1196 update, allocate common from bss section's free list.
1197 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1198 linker-defined symbols.
1199 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1200 Skip GOT and PLT entries that are no longer referenced.
1201 (Output_section_incremental_inputs::write_info_blocks): Mark
1202 linker-defined symbols.
1203 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1204 * output.cc (Output_section::allocate): New function.
1205 * output.h (Output_section::allocate): New function.
1206 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1207 linker-defined symbols.
1208 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1209 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1210 (Symbol::init_base_output_data): Likewise.
1211 (Symbol::init_base_output_segment): Likewise.
1212 (Symbol::init_base_constant): Likewise.
1213 (Sized_symbol::init_output_data): Likewise.
1214 (Sized_symbol::init_output_segment): Likewise.
1215 (Sized_symbol::init_constant): Likewise.
1216 (Symbol_table::do_define_in_output_data): Likewise.
1217 (Symbol_table::do_define_in_output_segment): Likewise.
1218 (Symbol_table::do_define_as_constant): Likewise.
1219 * symtab.h (Symbol::is_predefined): New function.
1220 (Symbol::init_base_output_data): Add is_predefined parameter.
1221 (Symbol::init_base_output_segment): Likewise.
1222 (Symbol::init_base_constant): Likewise.
1223 (Symbol::is_predefined_): New data member.
1224 (Sized_symbol::init_output_data): Add is_predefined parameter.
1225 (Sized_symbol::init_output_segment): Likewise.
1226 (Sized_symbol::init_constant): Likewise.
1227 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1229 2011-06-07 Cary Coutant <ccoutant@google.com>
1231 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1232 instead of emit_copy_reloc.
1233 (Copy_relocs::emit_copy_reloc): Refactor.
1234 (Copy_relocs::make_copy_reloc): New function.
1235 (Copy_relocs::add_copy_reloc): Remove.
1236 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1238 (Copy_relocs::make_copy_reloc): New function.
1239 (Copy_relocs::add_copy_reloc): Remove.
1240 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1241 unchanged input files.
1242 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1243 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1244 Reserve BSS space for COPY relocations.
1245 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1246 (Output_section_incremental_inputs::write_info_blocks): Record
1247 whether a symbol is copied from a shared object.
1248 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1249 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1250 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1251 (Incremental_input_entry_reader::get_output_symbol_index): Add
1253 (Incremental_binary::emit_copy_relocs): New function.
1254 (Incremental_binary::do_emit_copy_relocs): New function.
1255 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1257 (Sized_incremental_binary::add_copy_reloc): New function.
1258 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1259 (Sized_incremental_binary::Copy_reloc): New struct.
1260 (Sized_incremental_binary::Copy_relocs): New typedef.
1261 (Sized_incremental_binary::copy_relocs_): New data member.
1262 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1263 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1264 * target.h (Sized_target::emit_copy_reloc): New function.
1265 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1267 2011-06-02 Cary Coutant <ccoutant@google.com>
1270 * gold/archive.cc (Archive::Archive): Initialize new data member.
1271 (Archive::include_all_members): Return if archive has already been
1273 * gold/archive.h (Archive::include_all_members_): New data member.
1275 2011-06-02 Nick Clifton <nickc@redhat.com>
1277 * dynobj.h: Fix spelling mistake in comment.
1278 * output.cc: Likewise.
1280 2011-05-31 Doug Kwan <dougkwan@google.com>
1284 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
1285 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1286 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1287 redundant arm_exidx_test.so.
1288 * testsuite/Makefile.in: Regenerate.
1289 (check_SCRIPTS): Add pr12826.sh
1290 (check_DATA): Add pr12826.stdout
1291 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1292 * testsuite/pr12826.sh: New file.
1293 * testsuite/pr12826_1.s: Ditto.
1294 * testsuite/pr12826_1.s: Ditto.
1296 2011-05-30 Ian Lance Taylor <iant@google.com>
1298 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1301 2011-05-29 Ian Lance Taylor <iant@google.com>
1304 * testsuite/Makefile.am: Use different file name for two_file_test
1305 temporary file for each incremental test.
1306 * testsuite/Makefile.in: Rebuild.
1308 2011-05-29 Ian Lance Taylor <iant@google.com>
1310 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1311 binary input file is empty.
1313 2011-05-27 Ian Lance Taylor <iant@google.com>
1315 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1316 (ver_test_9.so): Likewise.
1317 * testsuite/Makefile.in: Rebuild.
1319 2011-05-26 Cary Coutant <ccoutant@google.com>
1321 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1322 * incremental.cc (Incremental_inputs::report_input_section): Fix
1323 comment, indentation.
1324 (Incremental_inputs::report_comdat_group): New function.
1325 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1326 of data for incremental input file entry.
1327 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1328 group count, COMDAT group signatures.
1329 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1330 an unchanged input file.
1331 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1332 Initialize new data member.
1333 (Incremental_object_entry::add_comdat_group): New function.
1334 (Incremental_object_entry::get_comdat_group_count): New function.
1335 (Incremental_object_entry::get_comdat_signature_key): New function.
1336 (Incremental_object_entry::groups_): New data member.
1337 (Incremental_inputs::report_comdat_group): New function.
1338 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1339 data for incremental input file entry.
1340 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1341 (Incremental_input_entry_reader::get_input_section): Adjust size of
1342 data for incremental input file entry.
1343 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1344 (Incremental_input_entry_reader::get_comdat_group_signature): New
1346 * object.cc (Sized_relobj::include_section_group): Report kept
1347 COMDAT groups for incremental links.
1349 2011-05-24 David Meyer <pdox@google.com>
1351 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1352 with name parameter. Add found_name parameter.
1353 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1354 * dirsearch.h (class Dirsearch): Update declaration.
1356 2011-05-24 Ian Lance Taylor <iant@google.com>
1358 * archive.cc (Library_base::should_include_member): Pull in object
1359 from archive if it defines the entry symbol.
1360 * parameters.cc (Parameters::entry): New function.
1361 * parameters.h (class Parameters): Declare entry.
1362 * output.h (class Output_file_header): Remove entry_ field.
1363 * output.cc (Output_file_header::Output_file_header): Remove entry
1364 parameter. Change all callers.
1365 (Output_file_header::entry): Use parameters->entry.
1366 * gold.cc (queue_middle_tasks): Likewise.
1367 * plugin.cc (Plugin_hook::run): Likewise.
1369 2011-05-24 Cary Coutant <ccoutant@google.com>
1371 * gold.cc (queue_initial_tasks): Pass incremental base filename
1372 to Output_file::open_base_file; don't print error message.
1373 * incremental-dump.cc (main): Adjust call to
1374 Output_file::open_for_modification.
1375 * incremental-dump.cc (main): Likewise.
1376 * incremental.cc (Incremental_inputs::report_command_line):
1377 Ignore --incremental-base option when comparing command lines.
1378 Ignore parameter when given as separate argument.
1379 * options.h (class General_options): Add --incremental-base.
1380 * output.cc (Output_file::Output_file):
1381 (Output_file::open_base_file): Add base_name and writable parameters;
1382 read base file into new file; print error message here.
1383 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1385 * output.h (Output_file::open_for_modification): Rename to...
1386 (Output_file::open_base_file): ...this; add base_name and
1387 writable parameters; adjust all callers.
1388 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1390 * testsuite/Makefile.am (incremental_test_4): Test
1392 * testsuite/Makefile.in: Regenerate.
1394 2011-05-24 Cary Coutant <ccoutant@google.com>
1396 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1398 * testsuite/Makefile.in: Regenerate.
1399 * testsuite/two_file_test_1_v1.cc: New test source file.
1400 * testsuite/two_file_test_1b_v1.cc: New test source file.
1401 * testsuite/two_file_test_2_v1.cc: New test source file.
1403 2011-05-24 Cary Coutant <ccoutant@google.com>
1405 * dynobj.h (Dynobj::do_dynobj): New function.
1406 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1407 flag and soname for shared objects.
1408 * incremental.cc (Incremental_inputs::report_object): Make
1409 either Incremental_object_entry or Incremental_dynobj_entry; add
1410 soname to string table.
1411 (Incremental_inputs::report_input_section): Add assertion.
1412 (Output_section_incremental_inputs::set_final_data_size): Adjust
1413 type of input file entry for shared libraries; adjust size of
1414 shared library info entry.
1415 (Output_section_incremental_inputs::write_input_files): Write
1416 as_needed flag for shared libraries.
1417 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1418 of input file entry for shared libraries; write soname.
1419 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1420 soname from incremental info.
1421 * incremental.h (enum Incremental_input_flags): Add
1422 INCREMENTAL_INPUT_AS_NEEDED.
1423 (Incremental_input_entry::Incremental_input_entry): Initialize new
1425 (Incremental_input_entry::set_as_needed): New function.
1426 (Incremental_input_entry::as_needed): New function.
1427 (Incremental_input_entry::do_dynobj_entry): New function.
1428 (Incremental_input_entry::as_needed_): New data member.
1429 (Incremental_object_entry::Incremental_object_entry): Don't check
1431 (Incremental_object_entry::do_type): Likewise.
1432 (class Incremental_dynobj_entry): New class.
1433 (Incremental_input_entry_reader::as_needed): New function.
1434 (Incremental_input_entry_reader::get_soname): New function.
1435 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1436 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1437 size of shared library info entry.
1438 * layout.cc (Layout::finish_dynamic_section): Don't test for
1439 incremental link when adding DT_NEEDED entries.
1440 * object.h (Object::Object): Initialize new data member.
1441 (Object::dynobj): New function.
1442 (Object::set_as_needed): New function.
1443 (Object::as_needed): New function.
1444 (Object::do_dynobj): New function.
1445 (Object::as_needed_): New data member.
1447 2011-05-24 Cary Coutant <ccoutant@google.com>
1449 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1450 info; adjust display of GOT entries.
1451 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1452 vector of input objects; remove file_status_.
1453 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1454 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1455 got_plt reader; call target hooks to reserve GOT entries.
1456 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1457 of input file info header and GOT info entry.
1458 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1460 (Got_plt_view_info::got_descriptor): Remove.
1461 (Got_plt_view_info::sym_index): New data member.
1462 (Got_plt_view_info::input_index): New data member.
1463 (Local_got_offset_visitor::visit): Write input file index.
1464 (Global_got_offset_visitor::visit): Write 0 for input file index.
1465 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1466 with sym_index and input_index.
1467 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1468 incremental info GOT entry; replace got_descriptor with input_index.
1469 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1470 map from input file index to object.
1471 (Sized_relobj_incr::do_layout): Replace direct data member reference
1472 with accessor function.
1473 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1474 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1475 Adjust size of input file info header.
1476 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1477 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1478 (Incremental_input_entry_reader::get_input_section): Adjust size of
1479 input file info header.
1480 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1481 of incremental info GOT entry.
1482 (Incremental_got_plt_reader::get_got_desc): Remove.
1483 (Incremental_got_plt_reader::get_got_symndx): New function.
1484 (Incremental_got_plt_reader::get_got_input_index): New function.
1485 (Sized_incremental_binary::Sized_incremental_binary): Remove
1486 file_status_; add input_objects_.
1487 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1488 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1489 (Sized_incremental_binary::file_is_unchanged): Remove.
1490 (Sized_incremental_binary::set_input_object): New function.
1491 (Sized_incremental_binary::input_object): New function.
1492 (Sized_incremental_binary::file_status_): Remove.
1493 (Sized_incremental_binary::input_objects_): New data member.
1494 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1496 (Sized_relobj_incr::invalid_address): Move to base class.
1497 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1499 (Sized_relobj_incr::do_output_section_offset): Likewise.
1500 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1501 (Sized_relobj_incr::section_offsets_): Likewise.
1502 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1504 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1505 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1506 with accessor function.
1507 (Sized_relobj_file::do_layout): Likewise.
1508 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1509 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1510 (Sized_relobj_file::compute_final_local_value): Replace refs to
1511 section_offsets_ with accessor function.
1512 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1513 * object.h (Relobj::Relobj): Initialize new data members.
1514 (Relobj::add_dyn_reloc): New function.
1515 (Relobj::first_dyn_reloc): New function.
1516 (Relobj::dyn_reloc_count): New function.
1517 (Relobj::first_dyn_reloc_): New data member.
1518 (Relobj::dyn_reloc_count_): New data member.
1519 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1521 (Sized_relobj::Address): New typedef.
1522 (Sized_relobj::invalid_address): Move here from child class.
1523 (Sized_relobj::Sized_relobj): Initialize new data members.
1524 (Sized_relobj::sized_relobj): New function.
1525 (Sized_relobj::is_output_section_offset_invalid): Move here from
1527 (Sized_relobj::get_output_section_offset): Likewise.
1528 (Sized_relobj::local_has_got_offset): Likewise.
1529 (Sized_relobj::local_got_offset): Likewise.
1530 (Sized_relobj::set_local_got_offset): Likewise.
1531 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1532 (Sized_relobj::clear_got_offsets): New function.
1533 (Sized_relobj::section_offsets): Move here from child class.
1534 (Sized_relobj::do_output_section_offset): Likewise.
1535 (Sized_relobj::do_set_section_offset): Likewise.
1536 (Sized_relobj::Local_got_offsets): Likewise.
1537 (Sized_relobj::local_got_offsets_): Likewise.
1538 (Sized_relobj::section_offsets_): Likewise.
1539 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1541 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1543 (Sized_relobj_file::sized_relobj): New function
1544 (Sized_relobj_file::local_has_got_offset): Move to base class.
1545 (Sized_relobj_file::local_got_offset): Likewise.
1546 (Sized_relobj_file::set_local_got_offset): Likewise.
1547 (Sized_relobj_file::get_output_section_offset): Likewise.
1548 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1549 (Sized_relobj_file::do_output_section_offset): Likewise.
1550 (Sized_relobj_file::do_set_section_offset): Likewise.
1551 (Sized_relobj_file::Local_got_offsets): Likewise.
1552 (Sized_relobj_file::local_got_offsets_): Likewise.
1553 (Sized_relobj_file::section_offsets_): Likewise.
1554 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1556 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1557 (Output_reloc::get_symbol_index): Likewise.
1558 (Output_reloc::local_section_offset): Likewise.
1559 (Output_reloc::get_address): Likewise.
1560 (Output_reloc::symbol_value): Likewise.
1561 (Output_data_got::reserve_slot): Move to class definition.
1562 (Output_data_got::reserve_local): New function.
1563 (Output_data_got::reserve_slot_for_global): Remove.
1564 (Output_data_got::reserve_global): New function.
1565 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1566 (all constructors, two instantiations).
1567 (Output_reloc::get_relobj): New function (two instantiations).
1568 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1569 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1570 (Output_data_reloc::add_global): Adjust type of relobj.
1571 (Output_data_reloc::add_global_relative): Likewise.
1572 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1573 (Output_data_reloc::add_local): Likewise.
1574 (Output_data_reloc::add_local_relative): Likewise.
1575 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1576 (Output_data_reloc::add_local_section): Likewise.
1577 (Output_data_reloc::add_output_section): Likewise.
1578 (Output_data_reloc::add_absolute): Likewise.
1579 (Output_data_reloc::add_target_specific): Likewise.
1580 (Output_data_got::reserve_slot): Move definition here.
1581 (Output_data_got::reserve_local): New function.
1582 (Output_data_got::reserve_global): New function.
1583 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1584 section_offsets_ with accessor function.
1585 (Sized_relobj_file::write_sections): Likewise.
1586 (Sized_relobj_file::do_relocate_sections): Likewise.
1587 * target.h (Sized_target::reserve_local_got_entry): New function.
1588 (Sized_target::reserve_global_got_entry): New function.
1589 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1590 (Target_x86_64::reserve_global_got_entry): New function.
1591 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1593 2011-05-23 Cary Coutant <ccoutant@google.com>
1595 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1596 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1597 bit when checking got_type.
1598 * incremental.cc (Sized_incremental_binary::setup_readers):
1599 Store symbol table and string table locations; initialize bit vector
1600 of file status flags.
1601 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1603 (Sized_incremental_binary::do_process_got_plt): New function.
1604 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1605 (Output_section_incremental_inputs::set_final_data_size): Record
1606 file index for each input file.
1607 (Output_section_incremental_inputs::write_got_plt): Store file index
1608 instead of input entry offset for each GOT entry.
1610 (Incremental_input_entry::Incremental_input_entry): Initialize new
1612 (Incremental_input_entry::set_offset): Store file index.
1613 (Incremental_input_entry::get_file_index): New function.
1614 (Incremental_input_entry::file_index_): New data member.
1615 (Incremental_binary::process_got_plt): New function.
1616 (Incremental_binary::do_process_got_plt): New function.
1617 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1619 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1620 (Sized_incremental_binary::set_file_is_unchanged): New function.
1621 (Sized_incremental_binary::file_is_unchanged): New function.
1622 (Sized_incremental_binary::do_process_got_plt): New function.
1623 (Sized_incremental_binary::file_status_): New data member.
1624 (Sized_incremental_binary::main_symtab_loc_): New data member.
1625 (Sized_incremental_binary::main_strtab_loc_): New data member.
1626 * output.cc (Output_data_got::Got_entry::write): Add case
1628 (Output_data_got::add_global): Call add_got_entry.
1629 (Output_data_got::add_global_plt): Likewise.
1630 (Output_data_got::add_global_with_rel): Likewise.
1631 (Output_data_got::add_global_with_rela): Likewise.
1632 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1633 (Output_data_got::add_global_pair_with_rela): Likewise.
1634 (Output_data_got::add_local): Call add_got_entry.
1635 (Output_data_got::add_local_plt): Likewise.
1636 (Output_data_got::add_local_with_rel): Likewise.
1637 (Output_data_got::add_local_with_rela): Likewise.
1638 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1639 (Output_data_got::add_local_pair_with_rela): Likewise.
1640 (Output_data_got::reserve_slot): New function.
1641 (Output_data_got::reserve_slot_for_global): New function.
1642 (Output_data_got::add_got_entry): New function.
1643 (Output_data_got::add_got_entry_pair): New function.
1644 (Output_section::add_output_section_data): Edit FIXME.
1646 (Output_section_data_build::Output_section_data_build): New
1647 constructor with size parameter.
1648 (Output_data_space::Output_data_space): Likewise.
1649 (Output_data_got::Output_data_got): Initialize new data member; new
1650 constructor with size parameter.
1651 (Output_data_got::add_constant): Call add_got_entry.
1652 (Output_data_got::reserve_slot): New function.
1653 (Output_data_got::reserve_slot_for_global): New function.
1654 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1655 (Output_data_got::add_got_entry): New function.
1656 (Output_data_got::add_got_entry_pair): New function.
1657 (Output_data_got::free_list_): New data member.
1658 * target.h (Sized_target::init_got_plt_for_update): New function.
1659 (Sized_target::register_global_plt_entry): New function.
1660 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1661 Initialize new data member; call init; add constructor with PLT count.
1662 (Output_data_plt_x86_64::init): New function.
1663 (Output_data_plt_x86_64::add_relocation): New function.
1664 (Output_data_plt_x86_64::reserve_slot): New function.
1665 (Output_data_plt_x86_64::free_list_): New data member.
1666 (Target_x86_64::init_got_plt_for_update): New function.
1667 (Target_x86_64::register_global_plt_entry): New function.
1668 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1669 incremental updates.
1670 (Output_data_plt_x86_64::add_relocation): New function.
1671 * testsuite/object_unittest.cc (Object_test): Set default options.
1673 2011-05-16 Ian Lance Taylor <iant@google.com>
1675 * options.h (class General_options): Make -i a synonym for -r.
1677 2011-05-16 Ian Lance Taylor <iant@google.com>
1679 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1681 2011-05-10 Cary Coutant <ccoutant@google.com>
1683 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1686 2011-05-06 Ian Lance Taylor <iant@google.com>
1688 * layout.cc (Layout::layout): If the output section flags change,
1689 update the ordering.
1691 2011-04-25 Cary Coutant <ccoutant@google.com>
1693 * incremental-dump.cc (dump_incremental_inputs): Print local
1694 symbol info for each input file.
1696 (Output_section_incremental_inputs::set_final_data_size): Add local
1697 symbol info to input file entries in incremental info.
1698 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1699 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1700 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1701 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1703 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1704 (Sized_incr_relobj::do_relocate): Write the local symbols.
1705 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1706 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1707 Adjust size of input file header.
1708 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1709 (Incremental_inputs_reader::get_local_symbol_count): New function.
1710 (Incremental_inputs_reader::get_input_section): Adjust size of input
1712 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1713 (Sized_incr_relobj::This): New typedef.
1714 (Sized_incr_relobj::sym_size): New const data member.
1715 (Sized_incr_relobj::Local_symbol): New struct.
1716 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1717 (Sized_incr_relobj::do_local_symbol_offset): New function.
1718 (Sized_incr_relobj::local_symbol_count_): New data member.
1719 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1720 (Sized_incr_relobj::local_symbol_index_): New data member.
1721 (Sized_incr_relobj::local_symbol_offset_): New data member.
1722 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1723 (Sized_incr_relobj::local_symbols_): New data member.
1724 * object.h (Relobj::output_local_symbol_count): New function.
1725 (Relobj::local_symbol_offset): New function.
1726 (Relobj::do_output_local_symbol_count): New function.
1727 (Relobj::do_local_symbol_offset): New function.
1728 (Sized_relobj::do_output_local_symbol_count): New function.
1729 (Sized_relobj::do_local_symbol_offset): New function.
1731 2011-04-22 Vladimir Simonov <sv@sw.ru>
1733 * descriptors.cc (set_close_on_exec): New function.
1734 (Descriptors::open): Use set_close_on_exec.
1735 * output.cc (S_ISLNK): Define if not defined.
1737 2011-04-22 Cary Coutant <ccoutant@google.com>
1739 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1741 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1742 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1743 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1745 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1746 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1747 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1749 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1751 (Incremental_binary::apply_incremental_relocs): New function.
1752 (Incremental_binary::do_apply_incremental_relocs): New function.
1753 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1755 (Sized_incremental_binary::add_global_symbol): New function.
1756 (Sized_incremental_binary::global_symbol): New function.
1757 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1758 (Sized_incremental_binary::symbol_map_): New data member.
1759 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1760 * target.h (Sized_target::apply_relocation): New function.
1761 * target-reloc.h (apply_relocation): New function.
1762 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1764 2011-04-22 Doug Kwan <dougkwan@google.com>
1766 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1767 flag of a SHT_ARM_EXIDX section.
1768 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1769 * testsuite/Makefile.in: Regenerate.
1770 * testsuite/arm_exidx_test.s: New file.
1771 * testsuite/arm_exidx_test.sh: Same.
1773 2011-04-20 Cary Coutant <ccoutant@google.com>
1776 * archive.h (Incremental_archive_entry::Archive_member):
1777 Initialize arg_serial_ (second constructor).
1779 2011-04-17 Ian Lance Taylor <iant@google.com>
1781 * object.cc (Relocate_info::location): Simplify location string.
1782 * errors.cc (Errors::error_at_location): Don't print program
1784 (Errors::warning_at_location): Likewise.
1785 (Errors::undefined_symbol): Likewise.
1786 * testsuite/debug_msg.sh: Update accordingly.
1788 2011-04-14 Cary Coutant <ccoutant@google.com>
1790 * gold/layout.cc (Layout::symtab_section_offset): New function.
1791 * gold/layout.h (Layout::symtab_section_offset): New function.
1792 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1794 2011-04-12 Ian Lance Taylor <iant@google.com>
1796 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1797 with MREMAP_MAYMOVE.
1798 * output.h (class Output_file): Add map_is_allocated_ field.
1799 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1800 not available, provide stubs. If mremap is not available, #define
1802 (MREMAP_MAYMOVE): Define if not defined.
1803 (Output_file::Output_file): Initialize map_is_allocated_.
1804 (Output_file::resize): Check map_is_allocated_.
1805 (Output_file::map_anonymous): If mmap fails, use malloc.
1806 (Output_file::unmap): Don't do anything for an anonymous map.
1807 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1808 is not available, provide stubs.
1809 (File_read::View::~View): Use free rather than delete[].
1810 (File_read::make_view): Use malloc rather than new[]. If mmap
1812 (File_read::find_or_make_view): Use malloc rather than new[].
1813 * gold.h: Remove HAVE_REMAP code.
1814 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1815 exists. Rename mremap to gold_mremap. If mmap is not available
1817 * configure, config.in: Rebuild.
1819 2011-04-11 Ian Lance Taylor <iant@google.com>
1821 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1822 initialize local variable v.
1824 2011-04-11 Cary Coutant <ccoutant@google.com>
1826 * archive.cc (Archive::include_member): Adjust call to
1828 (Add_archive_symbols::run): Track argument serial numbers.
1829 (Lib_group::include_member): Likewise.
1830 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1831 * archive.h (Incremental_archive_entry::Archive_member):
1832 Initialize arg_serial_.
1833 (Archive_member::arg_serial_): New data member.
1834 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1835 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1837 (Sized_dynobj::do_for_all_local_got_entries): New function.
1838 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1840 * fileread.cc (get_mtime): New function.
1841 * fileread.h (get_mtime): New function.
1842 * gold.cc (queue_initial_tasks): Check for incremental update.
1843 (process_incremental_input): New function.
1844 (queue_middle_tasks): Don't force valid target for incremental
1846 * incremental-dump.cc (find_input_containing_global): Adjust
1847 size of symbol info entry.
1848 (dump_incremental_inputs): Dump argument serial number and
1849 in_system_directory flag; bias shndx by 1; print symbol names
1850 when dumping per-file symbol lists; use new symbol info readers.
1852 (Output_section_incremental_inputs:update_data_size): New function.
1853 (Sized_incremental_binary::setup_readers): Setup input readers
1854 for each input file; build maps for files added from libraries
1856 (Sized_incremental_binary::check_input_args): New function.
1857 (Sized_incremental_binary::do_check_inputs): Build map of argument
1858 serial numbers to input arguments.
1859 (Sized_incremental_binary::do_file_has_changed): Rename
1860 do_file_is_unchanged to this; compare file modification times.
1861 (Sized_incremental_binary::do_init_layout): New function.
1862 (Sized_incremental_binary::do_reserve_layout): New function.
1863 (Sized_incremental_binary::do_get_input_reader): Remove.
1864 (Sized_incremental_binary::get_symtab_view): New function.
1865 (Incremental_checker::can_incrementally_link_output_file): Remove.
1866 (Incremental_inputs::report_command_line): Exclude --debug options.
1867 (Incremental_inputs::report_archive_begin): Add parameter; track
1868 argument serial numbers; don't put input file entry for archive
1869 before archive members.
1870 (Incremental_inputs::report_archive_end): Put input file entry
1871 for archive after archive members.
1872 (Incremental_inputs::report_object): Add parameter; track argument
1873 serial numbers and in_system_directory flag.
1874 (Incremental_inputs::report_script): Add parameter; track argument
1876 (Output_section_incremental_inputs::set_final_data_size): Adjust
1877 size of symbol info entry; check for forwarding symbols.
1878 (Output_section_incremental_inputs::write_input_files): Write
1879 in_system_directory flag and argument serial number.
1880 (Output_section_incremental_inputs::write_info_blocks): Map section
1881 indices between incremental info and original input file; store
1882 input section index for each symbol.
1883 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1884 change operator() to visit().
1885 (class Global_got_offset_visitor): Likewise.
1886 (class Global_symbol_visitor_got_plt):
1887 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1889 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1890 (Sized_incr_relobj::do_read_symbols): New function.
1891 (Sized_incr_relobj::do_layout): New function.
1892 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1893 (Sized_incr_relobj::do_add_symbols): New function.
1894 (Sized_incr_relobj::do_should_include_member): New function.
1895 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1896 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1897 (Sized_incr_relobj::do_section_size): New function.
1898 (Sized_incr_relobj::do_section_name): New function.
1899 (Sized_incr_relobj::do_section_contents): New function.
1900 (Sized_incr_relobj::do_section_flags): New function.
1901 (Sized_incr_relobj::do_section_entsize): New function.
1902 (Sized_incr_relobj::do_section_address): New function.
1903 (Sized_incr_relobj::do_section_type): New function.
1904 (Sized_incr_relobj::do_section_link): New function.
1905 (Sized_incr_relobj::do_section_info): New function.
1906 (Sized_incr_relobj::do_section_addralign): New function.
1907 (Sized_incr_relobj::do_initialize_xindex): New function.
1908 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1909 (Sized_incr_relobj::do_read_relocs): New function.
1910 (Sized_incr_relobj::do_gc_process_relocs): New function.
1911 (Sized_incr_relobj::do_scan_relocs): New function.
1912 (Sized_incr_relobj::do_count_local_symbols): New function.
1913 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1914 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1915 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1916 (Sized_incr_relobj::do_relocate): New function.
1917 (Sized_incr_relobj::do_set_section_offset): New function.
1918 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1919 (Sized_incr_dynobj::do_read_symbols): New function.
1920 (Sized_incr_dynobj::do_layout): New function.
1921 (Sized_incr_dynobj::do_add_symbols): New function.
1922 (Sized_incr_dynobj::do_should_include_member): New function.
1923 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1924 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1925 (Sized_incr_dynobj::do_section_size): New function.
1926 (Sized_incr_dynobj::do_section_name): New function.
1927 (Sized_incr_dynobj::do_section_contents): New function.
1928 (Sized_incr_dynobj::do_section_flags): New function.
1929 (Sized_incr_dynobj::do_section_entsize): New function.
1930 (Sized_incr_dynobj::do_section_address): New function.
1931 (Sized_incr_dynobj::do_section_type): New function.
1932 (Sized_incr_dynobj::do_section_link): New function.
1933 (Sized_incr_dynobj::do_section_info): New function.
1934 (Sized_incr_dynobj::do_section_addralign): New function.
1935 (Sized_incr_dynobj::do_initialize_xindex): New function.
1936 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1937 (make_sized_incremental_object): New function.
1938 (Incremental_library::copy_unused_symbols): New function.
1939 (Incremental_library::do_for_all_unused_symbols): New function.
1940 * incremental.h (enum Incremental_input_flags): New type.
1941 (class Incremental_checker): Remove.
1942 (Incremental_input_entry::Incremental_input_entry): Add argument
1944 (Incremental_input_entry::arg_serial): New function.
1945 (Incremental_input_entry::set_is_in_system_directory): New function.
1946 (Incremental_input_entry::is_in_system_directory): New function.
1947 (Incremental_input_entry::arg_serial_): New data member.
1948 (Incremental_input_entry::is_in_system_directory_): New data member.
1949 (class Script_info): Move here from script.h.
1950 (Script_info::Script_info): Add filename parameter.
1951 (Script_info::filename): New function.
1952 (Script_info::filename_): New data member.
1953 (Incremental_script_entry::Incremental_script_entry): Add argument
1955 (Incremental_object_entry::Incremental_object_entry): Likewise.
1956 (Incremental_object_entry::add_input_section): Build list of input
1957 sections with map to original shndx.
1958 (Incremental_object_entry::get_input_section_index): New function.
1959 (Incremental_object_entry::shndx_): New data member.
1960 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1961 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1962 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1964 (Incremental_inputs::report_archive_begin): Likewise.
1965 (Incremental_inputs::report_object): Likewise.
1966 (Incremental_inputs::report_script): Likewise.
1967 (class Incremental_global_symbol_reader): New class.
1968 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1969 and store flags and input file type.
1970 (Incremental_input_entry_reader::arg_serial): New function.
1971 (Incremental_input_entry_reader::type): Extract type from flags.
1972 (Incremental_input_entry_reader::is_in_system_directory): New function.
1973 (Incremental_input_entry_reader::get_input_section_count): Call
1974 accessor function for type.
1975 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1976 function for type; adjust size of global symbol entry.
1977 (Incremental_input_entry_reader::get_global_symbol_count): Call
1978 accessor function for type.
1979 (Incremental_input_entry_reader::get_object_count): Likewise.
1980 (Incremental_input_entry_reader::get_object_offset): Likewise.
1981 (Incremental_input_entry_reader::get_member_count): Likewise.
1982 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1983 (Incremental_input_entry_reader::get_member_offset): Likewise.
1984 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1985 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1986 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1987 (Incremental_input_entry_reader::get_global_symbol_reader): New
1989 (Incremental_input_entry_reader::get_output_symbol_index): New
1991 (Incremental_input_entry_reader::type_): Remove.
1992 (Incremental_input_entry_reader::flags_): New data member.
1993 (Incremental_inputs_reader::input_file_offset): New function.
1994 (Incremental_inputs_reader::input_file_index): New function.
1995 (Incremental_inputs_reader::input_file): Call input_file_offset.
1996 (Incremental_inputs_reader::input_file_at_offset): New function.
1997 (Incremental_relocs_reader::get_r_type): Reformat.
1998 (Incremental_relocs_reader::get_r_shndx): Reformat.
1999 (Incremental_relocs_reader::get_r_offset): Reformat.
2000 (Incremental_relocs_reader::data): New function.
2001 (Incremental_binary::Incremental_binary): Initialize new data members.
2002 (Incremental_binary::check_inputs): Add cmdline parameter.
2003 (Incremental_binary::file_is_unchanged): Remove.
2004 (Input_reader::arg_serial): New function.
2005 (Input_reader::get_unused_symbol_count): New function.
2006 (Input_reader::get_unused_symbol): New function.
2007 (Input_reader::do_arg_serial): New function.
2008 (Input_reader::do_get_unused_symbol_count): New function.
2009 (Input_reader::do_get_unused_symbol): New function.
2010 (Incremental_binary::input_file_count): New function.
2011 (Incremental_binary::get_input_reader): Change signature to use
2012 index instead of filename.
2013 (Incremental_binary::file_has_changed): New function.
2014 (Incremental_binary::get_input_argument): New function.
2015 (Incremental_binary::get_library): New function.
2016 (Incremental_binary::get_script_info): New function.
2017 (Incremental_binary::init_layout): New function.
2018 (Incremental_binary::reserve_layout): New function.
2019 (Incremental_binary::output_file): New function.
2020 (Incremental_binary::do_check_inputs): New function.
2021 (Incremental_binary::do_file_is_unchanged): Remove.
2022 (Incremental_binary::do_file_has_changed): New function.
2023 (Incremental_binary::do_init_layout): New function.
2024 (Incremental_binary::do_reserve_layout): New function.
2025 (Incremental_binary::do_input_file_count): New function.
2026 (Incremental_binary::do_get_input_reader): Change signature.
2027 (Incremental_binary::input_args_map_): New data member.
2028 (Incremental_binary::library_map_): New data member.
2029 (Incremental_binary::script_map_): New data member.
2030 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2032 (Sized_incremental_binary::output_section): New function.
2033 (Sized_incremental_binary::inputs_reader): Add const.
2034 (Sized_incremental_binary::symtab_reader): Add const.
2035 (Sized_incremental_binary::relocs_reader): Add const.
2036 (Sized_incremental_binary::got_plt_reader): Add const.
2037 (Sized_incremental_binary::get_symtab_view): New function.
2038 (Sized_incremental_binary::Inputs_reader): New typedef.
2039 (Sized_incremental_binary::Input_entry_reader): New typedef.
2040 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2041 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2042 (Sized_incremental_binary::do_file_has_changed): New function.
2043 (Sized_incremental_binary::do_init_layout): New function.
2044 (Sized_incremental_binary::do_reserve_layout): New function.
2045 (Sized_input_reader::Inputs_reader): Remove.
2046 (Sized_input_reader::Input_entry_reader): Remove.
2047 (Sized_input_reader::do_arg_serial): New function.
2048 (Sized_input_reader::do_get_unused_symbol_count): New function.
2049 (Sized_input_reader::do_get_unused_symbol): New function.
2050 (Sized_incremental_binary::do_input_file_count): New function.
2051 (Sized_incremental_binary::do_get_input_reader): Change signature;
2052 use index instead of filename.
2053 (Sized_incremental_binary::section_map_): New data member.
2054 (Sized_incremental_binary::input_entry_readers_): New data member.
2055 (class Sized_incr_relobj): New class.
2056 (class Sized_incr_dynobj): New class.
2057 (make_sized_incremental_object): New function.
2058 (class Incremental_library): New class.
2059 * layout.cc (Free_list::num_lists): New static data member.
2060 (Free_list::num_nodes): New static data member.
2061 (Free_list::num_removes): New static data member.
2062 (Free_list::num_remove_visits): New static data member.
2063 (Free_list::num_allocates): New static data member.
2064 (Free_list::num_allocate_visits): New static data member.
2065 (Free_list::init): New function.
2066 (Free_list::remove): New function.
2067 (Free_list::allocate): New function.
2068 (Free_list::dump): New function.
2069 (Free_list::print_stats): New function.
2070 (Layout_task_runner::run): Resize output file for incremental updates.
2071 (Layout::Layout): Initialize new data members.
2072 (Layout::set_incremental_base): New function.
2073 (Layout::init_fixed_output_section): New function.
2074 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2075 incremental updates.
2076 (Layout::create_gold_note): Do not create gold note section for
2077 incremental updates.
2078 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2079 for incremental updates.
2080 (Layout::set_section_offsets): For incremental updates, allocate space
2082 (Layout::create_symtab_sections): Layout with offsets relative to
2083 start of section; for incremental updates, allocate space from free
2085 (Layout::create_shdrs): For incremental updates, allocate space from
2087 (Layout::finish_dynamic_section): For incremental updates, do not
2088 check --as-needed (fixed in subsequent patch).
2089 * layout.h (class Free_list): New class.
2090 (Layout::set_incremental_base): New function.
2091 (Layout::incremental_base): New function.
2092 (Layout::init_fixed_output_section): New function.
2093 (Layout::allocate): New function.
2094 (Layout::incremental_base_): New data member.
2095 (Layout::free_list_): New data member.
2096 * main.cc (main): Print Free_list statistics.
2097 * object.cc (Relobj::finalize_incremental_relocs): Add
2098 clear_counts parameter; clear counts only when clear_counts is set.
2099 (Sized_relobj::Sized_relobj): Initialize new base class.
2100 (Sized_relobj::do_layout): Don't report special sections.
2101 (Sized_relobj::do_for_all_local_got_entries): New function.
2102 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2103 symtab_off to all symbol table offsets.
2104 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2105 * object.h (class Got_offset_list): Move to top of file.
2106 (Object::Object): Allow case where input_file == NULL.
2107 (Object::~Object): Likewise.
2108 (Object::input_file): Assert that input_file != NULL.
2109 (Object::lock): Allow case where input_file == NULL.
2110 (Object::unlock): Likewise.
2111 (Object::is_locked): Likewise.
2112 (Object::token): Likewise.
2113 (Object::release): Likewise.
2114 (Object::is_incremental): New function.
2115 (Object::get_mtime): New function.
2116 (Object::for_all_local_got_entries): New function.
2117 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2118 (Object::set_is_in_system_directory): New function.
2119 (Object::is_in_system_directory): New function.
2120 (Object::do_is_incremental): New function.
2121 (Object::do_get_mtime): New function.
2122 (Object::do_for_all_local_got_entries): New function.
2123 (Object::is_in_system_directory_): New data member.
2124 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2125 (class Sized_relobj_base): New class.
2126 (class Sized_relobj): Derive from Sized_relobj_base.
2127 (class Sized_relobj::Symbols): Redeclare from base class.
2128 (class Sized_relobj::local_got_offset_list): Remove.
2129 (class Sized_relobj::Output_sections): Redeclare from base class.
2130 (class Sized_relobj::do_for_all_local_got_entries): New function.
2131 (class Sized_relobj::write_local_symbols): Add offset parameter.
2132 (class Sized_relobj::local_symbol_offset_): Update comment.
2133 (class Sized_relobj::local_dynsym_offset_): Update comment.
2134 * options.cc (Input_arguments::add_file): Remove const.
2135 * options.h (Input_file_argument::Input_file_argument):
2136 Initialize arg_serial_ (all constructors).
2137 (Input_file_argument::set_arg_serial): New function.
2138 (Input_file_argument::arg_serial): New function.
2139 (Input_file_argument::arg_serial_): New data member.
2140 (Input_arguments::Input_arguments): Initialize file_count_.
2141 (Input_arguments::add_file): Remove const.
2142 (Input_arguments::number_of_input_files): New function.
2143 (Input_arguments::file_count_): New data member.
2144 (Command_line::number_of_input_files): Call
2145 Input_arguments::number_of_input_files.
2146 * output.cc (Output_segment_headers::Output_segment_headers):
2148 (Output_section::Input_section::current_data_size): New function.
2149 (Output_section::Output_section): Initialize new data members.
2150 (Output_section::add_input_section): Don't do merge sections for
2151 an incremental link; allocate space from free list for an
2153 (Output_section::add_output_section_data): Allocate space from
2154 free list for an incremental update.
2155 (Output_section::update_data_size): New function.
2156 (Output_section::set_fixed_layout): New function.
2157 (Output_section::reserve): New function.
2158 (Output_segment::set_section_addresses): Remove const.
2159 (Output_segment::set_section_list_addresses): Remove const; allocate
2160 space from free list for an incremental update.
2161 (Output_segment::set_offset): Adjust size of RELRO segment for an
2163 * output.h (Output_data::current_data_size): Move here from
2165 (Output_data::pre_finalize_data_size): New function.
2166 (Output_data::update_data_size): New function.
2167 (Output_section_headers::update_data_size): new function.
2168 (Output_section_data_build::current_data_size): Move to Output_data.
2169 (Output_data_strtab::update_data_size): New function.
2170 (Output_section::current_data_size): Move to Output_data.
2171 (Output_section::set_fixed_layout): New function.
2172 (Output_section::has_fixed_layout): New function.
2173 (Output_section::reserve): New function.
2174 (Output_section::update_data_size): New function.
2175 (Output_section::has_fixed_layout_): New data member.
2176 (Output_section::free_list_): New data member.
2177 (Output_segment::set_section_addresses): Remove const.
2178 (Output_segment::set_section_list_addresses): Remove const.
2179 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2181 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2183 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2184 parameter when calling Add_symbols constructor; store argument
2185 serial number for members of a lib group.
2186 (Add_symbols::locks): Allow case where token == NULL.
2187 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2188 (Read_member::~Read_member): New function.
2189 (Read_member::is_runnable): New function.
2190 (Read_member::locks): New function.
2191 (Read_member::run): New function.
2192 (Check_script::~Check_script): New function.
2193 (Check_script::is_runnable): New function.
2194 (Check_script::locks): New function.
2195 (Check_script::run): New function.
2196 (Check_library::~Check_library): New function.
2197 (Check_library::is_runnable): New function.
2198 (Check_library::locks): New function.
2199 (Check_library::run): New function.
2200 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2201 (Add_symbols::library_): New data member.
2202 (class Read_member): New class.
2203 (class Check_script): New class.
2204 (class Check_library): New class.
2205 * reloc.cc (Read_relocs::is_runnable): Allow case where
2207 (Read_relocs::locks): Likewise.
2208 (Scan_relocs::locks): Likewise.
2209 (Relocate_task::locks): Likewise.
2210 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2212 (Sized_relobj::incremental_relocs_scan): Fix comment.
2213 (Sized_relobj::do_relocate): Pass output file offset to
2214 write_local_symbols.
2215 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2216 from class declaration.
2217 * script.cc (read_input_script): Allocate Script_info; pass
2218 argument serial number to report_script.
2219 * script.h (class Script_info): Move to incremental.h.
2220 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2221 * symtab.h (Symbol_table::add_from_incrobj): New function.
2222 (Symbol_table::set_file_offset): New function.
2224 2011-04-05 Cary Coutant <ccoutant@google.com>
2226 * incremental-dump.cc (dump_incremental_inputs): Change signature
2227 to take a Sized_incremental_binary; change caller. Use readers
2228 in Sized_incremental_binary.
2230 (Sized_incremental_binary::find_incremental_inputs_sections):
2231 Rename do_find_incremental_inputs_sections to this.
2232 (Sized_incremental_binary::setup_readers): New function.
2233 (Sized_incremental_binary::do_check_inputs): Check
2234 has_incremental_info_ flag; move setup code to setup_readers;
2236 (Sized_incremental_binary::do_file_is_unchanged): New function.
2237 (Sized_incremental_binary::do_get_input_reader): New function.
2238 * incremental.h (class Incremental_binary): Move to end of file.
2239 (Incremental_binary::file_is_unchanged): New function.
2240 (Incremental_binary::do_file_is_unchanged): New function.
2241 (Incremental_binary::Input_reader): New class.
2242 (Incremental_binary::get_input_reader): New function.
2243 (class Sized_incremental_binary): Move to end of file.
2244 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2245 input section reader classes.
2246 (Sized_incremental_binary::has_incremental_info): New function.
2247 (Sized_incremental_binary::inputs_reader): New function.
2248 (Sized_incremental_binary::symtab_reader): New function.
2249 (Sized_incremental_binary::relocs_reader): New function.
2250 (Sized_incremental_binary::got_plt_reader): New function.
2251 (Sized_incremental_binary::do_file_is_unchanged): New function.
2252 (Sized_incremental_binary::Sized_input_reader): New class.
2253 (Sized_incremental_binary::get_input_reader): New function.
2254 (Sized_incremental_binary::find_incremental_inputs_sections):
2255 Rename do_find_incremental_inputs_sections to this.
2256 (Sized_incremental_binary::setup_readers): New function.
2257 (Sized_incremental_binary::has_incremental_info_): New data member.
2258 (Sized_incremental_binary::inputs_reader_): New data member.
2259 (Sized_incremental_binary::symtab_reader_): New data member.
2260 (Sized_incremental_binary::relocs_reader_): New data member.
2261 (Sized_incremental_binary::got_plt_reader_): New data member.
2262 (Sized_incremental_binary::current_input_file_): New data member.
2264 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2267 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2270 2011-03-30 Cary Coutant <ccoutant@google.com>
2272 * archive.cc (Archive::include_member): Adjust call to report_object.
2273 (Add_archive_symbols::run): Add script_info to call to
2274 report_archive_begin.
2275 (Lib_group::include_member): Adjust call to report_object.
2276 (Add_lib_group_symbols::run): Adjust call to report_object.
2277 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2278 blocks. Add object count for script input files.
2279 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2280 script_info parameter; change all callers.
2281 (Incremental_inputs::report_object): Add script_info parameter;
2283 (Incremental_inputs::report_script): Store backpointer to
2284 incremental info entry.
2285 (Output_section_incremental_inputs::set_final_data_size): Record
2286 additional information for scripts.
2287 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2288 * incremental.h (Incremental_script_entry::add_object): New function.
2289 (Incremental_script_entry::get_object_count): New function.
2290 (Incremental_script_entry::get_object): New function.
2291 (Incremental_script_entry::objects_): New data member; adjust
2293 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2294 (Incremental_inputs::report_object): Add script_info parameter.
2295 (Incremental_inputs_reader::get_object_count): New function.
2296 (Incremental_inputs_reader::get_object_offset): New function.
2297 * options.cc (Input_arguments::add_file): Return reference to
2299 * options.h (Input_argument::set_script_info): New function.
2300 (Input_argument::script_info): New function.
2301 (Input_argument::script_info_): New data member; adjust all
2303 (Input_file_group::add_file): Return reference to new input argument.
2304 (Input_file_lib::add_file): Likewise.
2305 (Input_arguments::add_file): Likewise.
2306 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2307 * script.cc (Parser_closure::Parser_closure): Add script_info
2308 parameter; adjust all callers.
2309 (Parser_closure::script_info): New function.
2310 (Parser_closure::script_info_): New data member.
2311 (read_input_script): Report scripts earlier to incremental info.
2312 (script_add_file): Set script_info in Input_argument.
2313 (script_add_library): Likewise.
2314 * script.h (Script_options::Script_info): Rewrite class.
2316 2011-03-29 Cary Coutant <ccoutant@google.com>
2318 * archive.cc (Library_base::should_include_member): Move
2319 method here from class Archive.
2320 (Archive::Archive): Initialize base class.
2321 (Archive::should_include_member): Move to base class.
2322 (Archive::do_for_all_unused_symbols): New function.
2323 (Add_archive_symbols::run): Remove redundant access to
2325 (Lib_group::Lib_group): Initialize base class.
2326 (Lib_group::do_filename): New function.
2327 (Lib_group::include_member): Pass pointer to Lib_group to
2329 (Lib_group::do_for_all_unused_symbols): New function.
2330 (Add_lib_group_symbols::run): Report archive information for
2332 * archive.h (class Library_base): New base class.
2333 (class Archive): Derive from Library_base.
2334 (Archive::filename): Move to base class.
2335 (Archive::set_incremental_info): Likewise.
2336 (Archive::incremental_info): Likewise.
2337 (Archive::Should_include): Likewise.
2338 (Archive::should_include_member): Likewise.
2339 (Archive::Armap_entry): Remove.
2340 (Archive::Unused_symbol_iterator): Remove.
2341 (Archive::unused_symbols_begin): Remove.
2342 (Archive::unused_symbols_end): Remove.
2343 (Archive::do_filename): New function.
2344 (Archive::do_get_mtime): New function.
2345 (Archive::do_for_all_unused_symbols): New function.
2346 (Archive::task_): Move to base class.
2347 (Archive::incremental_info_): Likewise.
2348 (class Lib_group): Derive from Library_base.
2349 (Lib_group::do_filename): New function.
2350 (Lib_group::do_get_mtime): New function.
2351 (Lib_group::do_for_all_unused_symbols): New function.
2352 (Lib_group::task_): Move to base class.
2353 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2355 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2357 * incremental.cc (Incremental_inputs::report_archive_begin):
2358 Use Library_base; call library's get_mtime; add incremental inputs
2359 entry before members.
2360 (class Unused_symbol_visitor): New class.
2361 (Incremental_inputs::report_archive_end): Use Library_base; use
2362 visitor class to record unused symbols; don't add incremental inputs
2363 entry after members.
2364 (Incremental_inputs::report_object): Use Library_base.
2366 (Incremental_archive_entry::Incremental_archive_entry): Remove
2367 unused Archive parameter.
2368 (Incremental_inputs::report_archive_begin): Use Library_base.
2369 (Incremental_inputs::report_archive_end): Likewise.
2370 (Incremental_inputs::report_object): Likewise.
2371 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2373 * object.h (Object::for_all_global_symbols): New function.
2374 (Object::do_for_all_global_symbols): New function.
2375 (Sized_relobj::do_for_all_global_symbols): New function.
2376 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2378 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2381 2011-03-27 Ian Lance Taylor <iant@google.com>
2383 * archive.cc (Archive::interpret_header): Return -1 if something
2384 goes wrong. Change callers accordingly.
2386 2011-03-25 Cary Coutant <ccoutant@google.com>
2388 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2389 * testsuite/Makefile.in: Regenerate.
2391 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
2393 * plugin.cc (get_view): New.
2394 (Plugin::load): Pass get_view to the plugin.
2395 (Plugin_manager::get_view): New.
2397 2011-03-21 Ian Lance Taylor <iant@google.com>
2399 * testsuite/final_layout.sh: Rewrite to not use dc.
2400 * testsuite/relro_test.sh: Fail if dc is not present.
2402 2011-03-21 Sriraman Tallam <tmsriram@google.com>
2404 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2406 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2407 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2409 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2410 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2412 2011-03-14 Ian Lance Taylor <iant@google.com>
2414 * script-sections.cc (Sort_output_sections::script_compare):
2415 Rename from is_before, change return type.
2416 (Sort_output_sections::operator()): Adjust accordingly.
2418 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2421 * testsuite/odr_violation2.cc: Add comment to make all error line
2422 numbers double digits.
2423 * testsuite/debug_msg.sh: Adjust expected errors.
2425 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2427 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2428 but mark earlier ones as non-canonical
2429 (offset_to_iterator): Update search target and example
2430 (do_addr2line): Return extra lines in a vector*
2431 (format_file_lineno): Extract from do_addr2line
2432 (one_addr2line): Add vector* out-param
2433 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2434 when a lineno entry appeared last for its instruction
2435 (Dwarf_line_info): Add vector* out-param
2436 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2437 * symtab.cc (Odr_violation_compare): Include the lineno in the
2439 (linenos_from_loc): New. Combine the canonical line for an
2440 address with its other lines.
2441 (True_if_intersect): New. Helper functor to make
2442 std::set_intersection a query.
2443 (detect_odr_violations): Compare sets of lines instead of just
2444 one line for each function. This became less deterministic, but
2445 has fewer false positives.
2446 * symtab.h: Declarations.
2447 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2448 mix an optimized and non-optimized object in the same binary
2449 (odr_violation2.so): Same.
2450 * testsuite/Makefile.in: Regenerate from Makefile.am.
2451 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2452 * testsuite/debug_msg.sh: Update line numbers and add
2454 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2455 non-optimized context.
2456 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2457 isn't inlined, and use OdrDerived in an optimized context.
2458 * testsuite/odr_header1.h: Defines OdrDerived, where
2459 optimization will change the
2460 first-instruction-in-the-destructor's file and line number.
2461 * testsuite/odr_header2.h: Defines OdrBase.
2463 2011-03-09 Ian Lance Taylor <iant@google.com>
2465 * fileread.cc (File_read::clear_views): Don't delete the whole
2468 2011-03-08 Ian Lance Taylor <iant@google.com>
2471 * fileread.cc: #include <climits>.
2472 (GOLD_IOV_MAX): Define.
2473 (File_read::read_multiple): Limit number of entries by iov_max.
2474 * fileread.h (class File_read): Always set max_readv_entries to
2477 2011-03-07 Ian Lance Taylor <iant@google.com>
2480 * options.h (class General_options): Add -dy and -dn.
2482 2011-03-02 Cary Coutant <ccoutant@google.com>
2484 * testsuite/script_test_9.t: Add TLS segment.
2486 2011-03-02 Simon Baldwin <simonb@google.com>
2488 * configure.ac: Add check for gnu_indirect_function support in
2489 the toolchain building binutils.
2490 * configure: Rebuild.
2492 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
2494 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2495 plugin only symbols.
2496 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2497 in plugin files as not needed in the symbol table.
2499 2011-02-11 Sriraman Tallam <tmsriram@google.com>
2501 * output.cc (Output_section::add_input_section): Delay fill
2502 generation for section ordering.
2504 2011-02-09 Ian Lance Taylor <iant@google.com>
2507 * object.h (class Sized_relobj): Remove clear_local_symbols.
2508 * reloc.cc (Sized_relobj::do_relocate): Don't call
2509 clear_local_symbols.
2511 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
2513 * plugin.cc (is_visible_from_outside): Return true for symbols
2516 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2518 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2521 2011-02-02 Sriraman Tallam <tmsriram@google.com>
2523 * icf.h (is_section_foldable_candidate): Change type of parameter
2525 * icf.cc (Icf::find_identical_sections): Change type of local variable
2526 section_name to be std::string.
2527 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2529 2011-01-25 Ian Lance Taylor <iant@google.com>
2531 * script.cc (script_add_extern): Rewrite to use
2532 add_symbol_reference.
2534 2011-01-25 Doug Kwan <dougkwan@google.com>
2536 * icf.cc (get_section_contents): Always lock section's object.
2538 2011-01-24 Ian Lance Taylor <iant@google.com>
2540 * options.h (class General_options): Accept
2541 --no-detect-odr-violations.
2543 2011-01-24 Ian Lance Taylor <iant@google.com>
2545 * version.cc (version_string): Bump to 1.11.
2547 2011-01-24 Ian Lance Taylor <iant@google.com>
2549 * plugin.cc (class Plugin_rescan): Define new class.
2550 (Plugin_manager::claim_file): Set any_claimed_.
2551 (Plugin_manager::save_archive): New function.
2552 (Plugin_manager::save_input_group): New function.
2553 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2555 (Plugin_manager::new_undefined_symbol): New function.
2556 (Plugin_manager::rescan): New function.
2557 (Plugin_manager::rescannable_defines): New function.
2558 (Plugin_manager::add_input_file): Set any_added_.
2559 * plugin.h (class Plugin_manager): define new fields rescannable_,
2560 undefined_symbols_, any_claimed_, and any_added_. Declare
2561 Plugin_rescan as friend. Declare new functions.
2562 (Plugin_manager::Rescannable): Define type.
2563 (Plugin_manager::Rescannable_list): Define type.
2564 (Plugin_manager::Undefined_symbol_list): Define type.
2565 (Plugin_manager::Plugin_manager): Initialize new fields.
2566 * archive.cc (Archive::defines_symbol): New function.
2567 (Add_archive_symbols::run): Pass archive to plugins if any.
2568 * archive.h (class Archive): Declare defines_symbol.
2569 * readsyms.cc (Input_group::~Input_group): New function.
2570 (Finish_group::run): Pass input_group to plugins if any.
2571 * readsyms.h (class Input_group): Declare destructor.
2572 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2575 2011-01-10 Ian Lance Taylor <iant@google.com>
2577 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2579 (Layout::set_segment_offsets): Reset increase_relro before calling
2580 set_section_addresses a second time.
2582 2011-01-04 Cary Coutant <ccoutant@google.com>
2584 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2585 sections before NOBITS sections.
2587 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2589 * version.cc (print_version): Update copyright to 2011.
2591 2010-12-23 Cary Coutant <ccoutant@google.com>
2593 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2594 of OS to this->add. Add OD parameter to second form of the function.
2596 2010-12-20 Ian Lance Taylor <iant@google.com>
2598 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2599 second of two consecutive entries with same offset.
2601 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2603 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2604 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2605 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2606 to avoid unneeded links against $(LDADD).
2607 * testsuite/Makefile.in: Regenerate.
2609 2010-12-15 Ian Lance Taylor <iant@google.com>
2612 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2613 for R_X86_64_32 and R_X86_64_PC32.
2614 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2615 ver_matching_def_pic.o.
2616 (ver_matching_def_pic.o): New target.
2618 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2620 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2621 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2622 Move definition before File_read::View member definitions.
2623 (File_read::View::~View): Initialize and hold lock before
2624 updating current_mapped_bytes.
2626 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2628 * dwarf_reader.cc: Remove outdated comment.
2629 * gold-threads.cc: Fix typo in error message.
2630 * archive.cc: Fix typos in comments.
2631 * archive.h: Likewise.
2632 * arm-reloc-property.cc: Likewise.
2633 * arm-reloc-property.h: Likewise.
2634 * arm-reloc.def: Likewise.
2636 * attributes.h: Likewise.
2637 * cref.cc: Likewise.
2638 * ehframe.cc: Likewise.
2639 * fileread.h: Likewise.
2641 * i386.cc: Likewise.
2643 * incremental.h: Likewise.
2644 * int_encoding.cc: Likewise.
2645 * layout.h: Likewise.
2646 * main.cc: Likewise.
2647 * merge.h: Likewise.
2648 * object.cc: Likewise.
2649 * object.h: Likewise.
2650 * options.cc: Likewise.
2651 * readsyms.cc: Likewise.
2652 * reduced_debug_output.cc: Likewise.
2653 * reloc.cc: Likewise.
2654 * script-sections.cc: Likewise.
2655 * sparc.cc: Likewise.
2656 * symtab.h: Likewise.
2657 * target-reloc.h: Likewise.
2658 * target.cc: Likewise.
2659 * target.h: Likewise.
2660 * timer.cc: Likewise.
2661 * timer.h: Likewise.
2662 * x86_64.cc: Likewise.
2664 2010-12-09 Cary Coutant <ccoutant@google.com>
2666 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2668 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2669 parameter; change all callers.
2670 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2671 * options.h (warn_execstack): New option.
2673 2010-12-07 Doug Kwan <dougkwan@google.com>
2675 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2676 like function call relocations.
2678 2010-12-07 Ian Lance Taylor <iant@google.com>
2680 * archive.cc (Archive::get_elf_object_for_member): Permit
2681 punconfigured to be NULL.
2682 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2683 (Archive::include_member): Pass NULL to get_elf_object_for_member
2684 if we searched for the archive and this is the first included
2687 2010-12-01 Ian Lance Taylor <iant@google.com>
2689 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2690 track_relocs_type_ field.
2691 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2692 Set track_relocs_type_.
2693 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2694 contents when using RELA relocs.
2695 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2697 * reloc.cc (Track_relocs::next_addend): New function.
2698 * reloc.h (class Track_relocs): Declare next_addend.
2700 2010-12-01 Ian Lance Taylor <iant@google.com>
2702 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2705 2010-12-01 Ian Lance Taylor <iant@google.com>
2707 * README: Update compilers known to work and fail.
2709 2010-11-23 Matthias Klose <doko@ubuntu.com>
2711 * configure.in: For --enable-gold, handle value `default' instead of
2712 `both*'. Always install ld as ld.bfd, install as ld if gold is
2714 * configure: Regenerate.
2716 2010-11-18 Doug Kwan <dougkwan@google.com>
2718 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2719 and right_alignment to be zero. Store result alignment only if it is
2720 greater than existing alignment.
2722 2010-11-16 Cary Coutant <ccoutant@google.com>
2725 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2726 Check for ".zdebug_line".
2728 2010-11-16 Doug Kwan <dougkwan@google.com>
2729 Cary Coutant <ccoutant@google.com>
2731 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2732 by reference; adjust all callers.
2733 * output.cc (Output_segment::set_section_addresses): Adjust references
2734 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2736 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2737 end at page boundary.
2739 2010-11-16 Cary Coutant <ccoutant@google.com>
2742 * layout.cc (Layout::choose_output_section): Transform names of
2743 compressed sections even when using a script with a SECTIONS clause.
2744 (Layout::output_section_name): Remove code to transform
2745 compressed debug section names.
2746 * output.cc (Output_section::add_input_section): Use uncompressed
2747 section size when tracking input sections.
2749 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2751 * symtab.h (Symbol::NON_PIC_REF): Remove.
2752 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2753 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2754 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2755 (Symbol::use_plt_offset): Take a flags argument and pass it
2756 directly to needs_dynamic_reloc. Restrict check for undefined
2757 weak symbols to function calls.
2758 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2759 (Target_arm::Scan::global): Use it.
2760 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2761 (Target_arm::Relocate::relocate): Likewise.
2762 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2763 parameter with an r_type parameter. Use get_reference_flags
2765 (Target_arm::Relocate::relocate): Update accordingly.
2766 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2767 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2768 (Target_i386::Scan::global): Likewise.
2769 (Target_i386::Relocate::relocate): Likewise.
2770 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2771 parameter with an r_type parameter. Use get_reference_flags
2773 (Target_i386::Relocate::relocate): Update accordingly.
2774 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2775 (Target_powerpc::Scan::global): Use it.
2776 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2777 (Target_powerpc::Relocate::relocate): Likewise.
2778 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2779 (Target_sparc::Scan::global): Use it.
2780 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2781 (Target_sparc::Relocate::relocate): Likewise.
2782 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2783 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2784 (Target_x86_64::Scan::global): Likewise.
2785 (Target_x86_64::Relocate::relocate): Likewise.
2787 2010-11-08 Doug Kwan <dougkwan@google.com>
2788 Cary Coutant <ccoutant@google.com>
2790 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2791 (Arm_exidx_merge_section::section_contents_): New data member.
2792 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2793 (Arm_input_section::~Arm_input_section): De-allocate memory.
2794 (Arm_input_section::original_contents_): New data member.
2795 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2796 in parameters instead of calling Object::section_contents without
2798 (Arm_output_section::group_section): New parameter TASK. Pass it
2799 to callees that need locking objects.
2800 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2801 to lock EXIDX input sections. Fix a formatting issue. Call
2802 Arm_exidx_merged_section::build_contents to create merged section
2804 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2805 to lock object of stub table owner.
2806 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2807 TEXT_SIZE to initialize data member TEXT_SIZE_.
2808 (Arm_exidx_input_section::addralign): Fix typo in comment.
2809 (Arm_exidx_input_section::text_size): New method.
2810 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2811 that require locking objects. Lock objects before scanning for stubs
2812 and updating local symbols.
2813 (Arm_input_section<big_endian>::init): Copy contents of original
2815 (Arm_input_section<big_endian>::do_write): Use saved contents of
2816 original input section instead of calling Object::section_contents
2818 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2819 size without calling Object::section_size().
2820 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2821 for size. Allocate a buffer for merged EXIDX entries.
2822 (Arm_exidx_merged_section::build_contents): New method.
2823 (Arm_exidx_merged_section::do_write): Move merge section contents
2824 building code to Arm_exidx_merged_section::build_contetns. Write
2825 out contetns in buffer instead of building it on the fly.
2826 (Arm_relobj::make_exidx_input_section): Also pass text section size
2827 to Arm_exidx_input_section constructor.
2828 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2829 (Arm_dynobj::do_read_symbols): Fix memory leak.
2830 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2831 * target.h: (class Task): Add forward declaration.
2832 (Target::relax): Add new parameter TASK and pass it to
2834 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2836 2010-11-05 Cary Coutant <ccoutant@google.com>
2839 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2840 object when reading from the file.
2841 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2843 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2844 when reading section contents.
2845 (get_section_contents): Likewise.
2846 (icf::find_identical_sections): Likewise.
2847 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2848 object when reading from the file.
2849 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2850 the object when doing deferred section layout.
2852 2010-11-03 Nick Clifton <nickc@redhat.com>
2855 * script.h (class Symbol_assignment: name): New member. Returns
2856 the name of the symbol.
2857 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2858 Returns true if the given symbol name is on the list of
2859 assignments wating to be processed.
2860 * archive.cc (should_incldue_member): If the symbol is undefined,
2861 check to see if it is on the list of symbols pending assignment.
2863 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2865 * script-sections.cc (Script_sections::find_memory_region): Check
2866 for a NULL output section pointer.
2868 2010-10-29 Doug Kwan <dougkwan@google.com>
2870 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2871 Output_section::add_relaxed_input_section.
2872 * output.cc (Output_section::add_relaxed_input_section): Add new
2873 arguments LAYOUT and NAME. Set section order index.
2874 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2875 Copy section order index.
2876 * output.h (Output_section::add_relaxed_input_section): Add new
2877 arguments LAYOUT and NAME.
2879 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2881 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2882 NATIVE_OR_CROSS_LINKER.
2883 * testsuite/Makefile.in: Regenerate.
2885 2010-10-20 Doug Kwan <dougkwan@google.com>
2887 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2888 without SHF_LINK_ORDER flags.
2889 * layout.cc (Layout::choose_output_section): Do not filter
2890 SHF_LINK_ORDER flag in a relocatable link.
2892 2010-10-17 Cary Coutant <ccoutant@google.com>
2894 * output.h (Output_segment::set_section_addresses): Change function
2895 signature. Update all callers.
2896 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2898 (Output_segment::set_section_addresses): Align after last TLS
2899 section. Add padding before last relro section instead of after.
2901 2010-10-17 Doug Kwan <dougkwan@google.com>
2903 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2904 GOT output section to be writable.
2906 2010-10-14 Cary Coutant <ccoutant@google.com>
2908 * debug.h (DEBUG_INCREMENTAL): New flag.
2909 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2910 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2912 * incremental.cc (report_command_line): Ignore all forms of
2914 * layout.cc (Layout::Layout): Check parameters for incremental link
2916 * options.cc (General_options::parse_incremental): New function.
2917 (General_options::parse_no_incremental): New function.
2918 (General_options::parse_incremental_full): New function.
2919 (General_options::parse_incremental_update): New function.
2920 (General_options::incremental_mode_): New data member.
2921 (General_options::finalize): Check incremental_mode_.
2922 * options.h (General_options): Update help text for --incremental.
2923 Add --no-incremental, --incremental-full, --incremental-update.
2924 (General_options::Incremental_mode): New enum type.
2925 (General_options::incremental_mode): New function.
2926 (General_options::incremental_mode_): New data member.
2927 * parameters.cc (Parameters::incremental_mode_): New data member.
2928 (Parameters::set_options): Set incremental_mode_.
2929 (Parameters::set_incremental_full): New function.
2930 (Parameters::incremental): New function.
2931 (Parameters::incremental_update): New function.
2932 (set_parameters_incremental_full): New function.
2933 * parameters.h (Parameters::set_incremental_full): New function.
2934 (Parameters::incremental): New function.
2935 (Parameters::incremental_update): New function.
2936 (Parameters::incremental_mode_): New data member.
2937 (set_parameters_incremental_full): New function.
2938 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2939 incremental link mode.
2940 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2941 (Sized_relobj::do_relocate_sections): Likewise.
2942 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2944 * testsuite/Makefile.in: Regenerate.
2945 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2947 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2949 * script-sections.h (class Script_sections): Make
2950 Sections_elements typedef public.
2951 * script-sections.cc (class Sort_output_sections): Add elements_
2952 field. Add constructor which sets it; change all callers.
2953 (Sort_output_sections::is_before): New function.
2954 (Sort_output_sections::operator()): Call is_before.
2955 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2957 * testsuite/script_test_10.sh: New test. Test script section
2959 * testsuite/script_test_10.t: Likewise.
2960 * testsuite/script_test_10.s: Likewise.
2961 * testsuite/Makefile.am: Wrap the cross linker tests and the
2962 common tests into NATIVE_OR_CROSS_LINKER.
2963 (check_SCRIPTS): Add script_test_10.sh.
2964 (check_DATA): Add script_test_10.stdout.
2965 (script_test_10.o, script_test_10): New targets.
2966 (script_test_10.stdout): New target.
2967 * configure, testsuite/Makefile.in: Regenerate.
2969 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2971 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2972 error for the deprecated relocations.
2973 (Target_arm::Scan::global): Likewise.
2974 (Target_arm::Relocate::relocate): Likewise.
2976 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2978 * fileread.cc (Input_file::find_file): Initialize *found_name
2979 and *namep when using the fallback search for case 4.
2981 2010-10-11 Cary Coutant <ccoutant@google.com>
2983 * options.h (class General_options): Redefine -z lazy as an alias for
2984 the negation of -z now.
2986 2010-10-11 Ian Lance Taylor <iant@google.com>
2988 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2991 2010-10-06 Nick Clifton <nickc@redhat.com>
2993 * script-sections.cc(class Memory_region): Remove
2994 current_lma_offset_ field. Rename current_vma_offset_ to
2995 current_offset_. Add last_section_ field.
2996 (Memory_region::get_current_vma_address): Rename to
2997 get_current_address.
2998 (Memory_region::get_current_lma_address): Delete.
2999 (Memory_region::increment_vma_offset): Rename to
3001 (Memory_region::increment_lma_offset): Delete.
3002 (Memory_region::attributes_compatible): New method. Returns
3003 true if the provided section is compatible with the region.
3004 (Memory_region::get_last_section): New method. Returns the last
3005 section to use the region.
3006 (Memory_region::set_last_section): New method. Stores the last
3007 section to use the region.
3008 (Script_sections::block_in_region): New method. Returns true if
3009 a block of memory is contained within a region.
3010 (Script_sections::find_memory_region): New method. Locates a
3011 memory region to be used to set a VMA or LMA address.
3012 (Output_section_definition::set_section_addresses): Add code to
3013 check for addresses set by memory regions.
3014 (Output_segment::set_section_addresses): Remove memory region
3016 (Script_sections::create_segment): Add a warning if a header
3017 segment is created outside of any region.
3018 * script-sections.h (class Script_sections): Add prototypes for
3019 find_memory_region and block_in_region methods.
3020 * testsuite/memory_test.s: Use .long instead of .word.
3021 * testsuite/memory_test.t: Add some more output sections.
3022 * testsuite/memory_test.sh: Update expected output.
3024 2010-10-02 Doug Kwan <dougkwan@google.com>
3026 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3027 defintion to symtab.h
3028 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3029 declaration to defintion.
3031 2010-10-01 Nick Clifton <nickc@redhat.com>
3033 * expression.cc (eval): Replace dummy argument with NULL.
3034 (eval_maybe_dot): Check for a NULL result section pointer.
3035 (Symbol_expression::value): Likewise.
3036 (Dot_expression::value): Likewise.
3037 (BINARY_EXPRESSION): Likewise.
3038 (Max_expression::value): Likewise.
3039 (Min_expression::value): Likewise.
3040 (Absolute_expression::value): Likewise.
3041 (Addr_expression::value_from_output_section): Likewise.
3042 (Loaddddr_expression::value_from_output_section): Likewise.
3043 (Segment_start_expression::value): Likewise.
3044 * script-sections.cc
3045 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3047 (Sections_elememt_dot_assignment::set_section_addresses):
3049 (Output_data_expression::do_write_to_buffer): Likewise.
3050 (Output_section_definition::finalize_symbols): Likewise.
3051 (Output_section_definition::set_section_addresses): Likewise.
3053 2010-09-30 Doug Kwan <dougkwan@google.com>
3055 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3057 2010-09-28 Sriraman Tallam <tmsriram@google.com>
3059 * target.h (Target::can_icf_inline_merge_sections): New virtual
3061 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3063 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3065 * icf.cc (get_section_contents): Inline merge sections only when
3068 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3070 * configure: Regenerate.
3072 2010-09-17 Ian Lance Taylor <iant@google.com>
3074 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
3075 * testsuite/Makefile.am (memory_test.o): New target.
3076 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3078 * testsuite/Makefile.in: Rebuild.
3080 2010-09-17 Doug Kwan <dougkwan@google.com>
3082 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3083 defintion if relocation uses GOT entries of the symbol.
3084 * testsuite/icf_safe_test.sh: Fix test.
3085 * testsuite/icf_safe_so_test.sh: Fix test.
3087 2010-09-16 Cary Coutant <ccoutant@google.com>
3089 * script_sections.cc (class Memory_region): Remove "NULL" from
3090 vector initializations.
3092 2010-09-15 Cary Coutant <ccoutant@google.com>
3094 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3095 Resolve forwarding symbols.
3097 2010-09-15 Doug Kwan <dougkwan@google.com>
3099 * gold/testsuite/script_test_3.t: Add ARM special sections.
3100 * gold/testsuite/script_test_4.t: Same.
3101 * gold/testsuite/script_test_5.t: Same.
3102 * gold/testsuite/script_test_6.t: Same.
3103 * gold/testsuite/script_test_7.t: Same.
3104 * gold/testsuite/script_test_7.t: Same.
3105 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3107 2010-09-14 Cary Coutant <ccoutant@google.com>
3109 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3110 (Target_x86_64::Relocate::relocate_tls): Replace check for
3111 saw_tls_block_reloc_ with test for executable section.
3113 2010-09-12 Cary Coutant <ccoutant@google.com>
3115 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3116 position-independent executables to shared libraries need dynamic
3118 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3119 position-independent executables.
3120 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3121 * testsuite/Makefile.in: Regenerate.
3123 2010-09-10 Nick Clifton <nickc@redhat.com>
3126 * testsuite/memory_test.t: Discard any sections that are not
3129 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3132 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3133 "This::" to work around a bug in gcc 4.2.
3135 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3137 2010-09-09 Rafael Espindola <espindola@google.com>
3139 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3140 sections with different PF_X flags in the same segment.
3141 (Layout::find_first_load_seg): Search all segments to find the first
3143 * options.h (rosegment): New.
3145 2010-09-08 Rafael Espindola <espindola@google.com>
3147 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
3149 2010-09-08 Doug Kwan <dougkwan@google.com>
3151 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3152 (Arm_relobj::do_relocate_sections): Add new parameter for output
3153 file to match the parent.
3154 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3155 of local symbols instead of input values. Update code to track
3156 changes in gold::relocate_section.
3157 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3158 (Sized_relobj::compute_final_local_value_internal): New methods.
3159 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3160 body into private version of Sized_relobj::compute_final_local_value.
3161 Call the inline method.
3162 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3163 merged symbol value if there is one.
3164 (Symbol_value::has_output_value): New method defintiion.
3165 (Sized_relobj::Compute_final_local_value_status): New enum type.
3166 (Sized_relobj::compute_final_local_value): New methods.
3167 (Sized_relobj::compute_final_local_value_internal): New methods.
3168 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3169 and arm_cortex_a8.sh.
3170 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3171 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3173 * Makefile.in: Regenerate.
3174 * testsuite/arm_bl_out_of_range.s: Update test.
3175 * testsuite/thumb_bl_out_of_range.s: Ditto.
3176 * testsuite/thumb_blx_out_of_range.s: Ditto.
3177 * testsuite/arm_branch_out_of_range.sh: New file.
3178 * testsuite/arm_cortex_a8.sh: Ditto.
3179 * testsuite/arm_cortex_a8_b.s: Ditto.
3180 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3181 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3182 * testsuite/arm_cortex_a8_bl.s: Ditto.
3183 * testsuite/arm_cortex_a8_blx.s: Ditto.
3184 * testsuite/arm_cortex_a8_local.s: Ditto.
3185 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3186 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3188 2010-09-08 Rafael Espindola <espindola@google.com>
3190 * Makefile.am (memory_test.stdout): Run readelf with -W.
3191 * Makefile.in: Regenerate.
3192 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3195 2010-09-08 Rafael Espindola <espindola@google.com>
3197 * script-sections.cc (Script_sections::add_memory_region): Convert
3198 field precision to int.
3199 * script.cc (script_set_section_region, script_set_section_region):
3200 Convert field precision to int.
3202 2010-09-08 Rafael Espindola <espindola@google.com>
3204 * arm.cc (do_finalize_sections): Create the __exidx_start and
3205 __exdix_end symbols even when the section is missing.
3207 2010-09-08 Nick Clifton <nickc@redhat.com>
3209 * README: Remove claim that MEMORY is not supported.
3210 * expression.cc (script_exp_function_origin)
3211 (script_exp_function_length): Move from here to ...
3212 * script.cc: ... here.
3213 (script_set_section_region, script_add_memory)
3214 (script_parse_memory_attr, script_include_directive): New
3216 * script-sections.cc
3217 (class Memory_region): New class.
3218 (class Output_section_definition): Add set_memory_region,
3219 set_section_vma, set_section_lma and get_section_name methods.
3220 (class Script_Sections): Add add_memory_region,
3221 find_memory_region, find_memory_region_origin,
3222 find_memory_region_length and set_memory_region methods.
3223 Have set_section_addresses method walk the list of set memory
3225 Extend the print methos to display memory regions.
3226 * script-sections.h: Add prototypes for new methods.
3227 Add enum for MEMORY region attributes.
3228 * yyscript.y: Add support for parsing MEMORY regions.
3229 * script-c.h: Add prototypes for new functions.
3230 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3231 * testsuite/Makefile.in: Regenerate.
3232 * testsuite/memory_test.sh: New script.
3233 * testsuite/memory_test.s: New assembler source file.
3234 * testsuite/memory_test.t: New linker script.
3236 2010-08-27 Doug Kwan <dougkwan@google.com>
3238 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3239 reference override an existing dynamic weak reference.
3240 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3241 * testsuite/Makefile.in: Regenerate.
3242 * testsuite/dyn_weak_ref.sh: New file.
3243 * testsuite/dyn_weak_ref_1.c: Ditto.
3244 * testsuite/dyn_weak_ref_2.c: Ditto.
3246 2010-08-27 Ian Lance Taylor <iant@google.com>
3248 * incremental.h (class Incremental_input_entry): Add virtual
3251 2010-08-27 Ian Lance Taylor <iant@google.com>
3253 * testsuite/start_lib_test_3.c: Mark t3 as used.
3255 2010-08-27 Nick Clifton <nickc@redhat.com>
3257 * options.cc (version_script): Fix small typo in previous
3260 2010-08-25 Nick Clifton <nickc@redhat.com>
3262 * archive.cc: Formatting fixes: Remove whitespace between
3263 typename and following asterisk. Remove whitespace between
3264 function name and opening parenthesis.
3265 * archive.h: Likewise.
3267 * attributes.cc: Likewise.
3268 * attributes.h: Likewise.
3269 * common.cc: Likewise.
3270 * copy-relocs.cc: Likewise.
3271 * dirsearch.h: Likewise.
3272 * dynobj.cc: Likewise.
3273 * ehframe.cc: Likewise.
3274 * ehframe.h: Likewise.
3275 * expression.cc: Likewise.
3276 * fileread.cc: Likewise.
3277 * fileread.h: Likewise.
3279 * gold-threads.cc: Likewise.
3280 * gold.cc: Likewise.
3281 * i386.cc: Likewise.
3283 * incremental-dump.cc: Likewise.
3284 * incremental.cc: Likewise.
3285 * layout.cc: Likewise.
3286 * layout.h: Likewise.
3287 * main.cc: Likewise.
3288 * merge.cc: Likewise.
3289 * merge.h: Likewise.
3290 * object.cc: Likewise.
3291 * object.h: Likewise.
3292 * options.cc: Likewise.
3293 * options.h: Likewise.
3294 * output.cc: Likewise.
3295 * output.h: Likewise.
3296 * plugin.cc: Likewise.
3297 * plugin.h: Likewise.
3298 * powerpc.cc: Likewise.
3299 * reloc.cc: Likewise.
3300 * script-c.h: Likewise.
3301 * script-sections.cc: Likewise.
3302 * script.cc: Likewise.
3303 * stringpool.cc: Likewise.
3304 * symtab.cc: Likewise.
3305 * symtab.h: Likewise.
3306 * target.cc: Likewise.
3307 * timer.cc: Likewise.
3308 * timer.h: Likewise.
3309 * version.cc: Likewise.
3310 * x86_64.cc: Likewise.
3312 2010-08-24 Nick Clifton <nickc@redhat.com>
3315 * layout.cc (segment_precedes): Sort segments by their physical
3316 addresses, if they have been set.
3318 2010-08-23 Cary Coutant <ccoutant@google.com>
3320 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3322 (Lib_group::include_member): Unlock object after deleting its
3324 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3327 2010-08-19 Neil Vachharajani <nvachhar@google.com>
3328 Cary Coutant <ccoutant@google.com>
3330 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3331 constructor, and set_blocker.
3332 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3334 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3335 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3336 * testsuite/Makefile.am (start_lib_test): New test case.
3337 * testsuite/Makefile.in: Regenerate.
3338 * testsuite/start_lib_test_main.c: New file.
3339 * testsuite/start_lib_test_1.c: New file.
3340 * testsuite/start_lib_test_2.c: New file.
3341 * testsuite/start_lib_test_3.c: New file.
3343 2010-08-19 Ian Lance Taylor <iant@google.com>
3345 * Makefile.in: Rebuild with automake 1.11.1.
3346 * aclocal.m4: Likewise.
3347 * testsuite/Makefile.in: Likewise.
3349 2010-08-19 Ian Lance Taylor <iant@google.com>
3352 * i386.cc (class Output_data_plt_i386): Update declarations.
3353 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3354 local_ifuncs_ fields.
3355 (Target_i386::do_plt_section_for_global): New function.
3356 (Target_i386::do_plt_section_for_local): New function.
3357 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3358 parameter; change all callers. Initialize global_ifuncs_ and
3359 local_ifuncs_. If doing a static link define __rel_iplt_start and
3361 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3362 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3363 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3365 (Target_i386::make_plt_section): New function, broken out of
3366 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3367 (Target_i386::make_plt_entry): Call make_plt_section.
3368 (Target_i386::make_local_ifunc_plt_entry): New function.
3369 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3370 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3371 R_386_IRELATIVE to switch.
3372 (Target_i386::Scan::global): Likewise.
3373 (Target_i386::Relocate::relocate): Likewise.
3374 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3376 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3377 (Target_x86_64::do_plt_section_for_global): New function.
3378 (Target_x86_64::do_plt_section_for_local): New function.
3379 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3380 parameter; change all callers. If doing a static link define
3381 __rela_iplt_start and __rela_iplt_end.
3382 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3383 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3384 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3386 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3387 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3389 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3390 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3391 R_X86_64_IRELATIVE to switch.
3392 (Target_x86_64::Scan::global): Likewise.
3393 (Target_x86_64::Relocate::relocate): Likewise.
3394 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3396 * target.h (class Target): Add plt_section_for_global and
3397 plt_section_for_local functions. Add do_plt_section_for_global
3398 and do_plt_section_for_local virtual functions.
3399 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3400 clarifying comments.
3401 (Symbol::use_plt_offset): Handle IFUNC symbol.
3402 * object.cc (Sized_relobj::Sized_relobj): Initialize
3404 (Sized_relobj::local_has_plt_offset): New function.
3405 (Sized_relobj::local_plt_offset): New function.
3406 (Sized_relobj::set_local_plt_offset): New function.
3407 (Sized_relobj::do_count): Handle IFUNC symbol.
3408 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3409 a bit away from input_shndx_ field. Add set_is_func_symbol and
3410 is_ifunc_symbol functions.
3411 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3412 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3413 local_plt_offsets_ field.
3414 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3415 * output.h (class Output_section_data): Add non-const
3416 output_section function.
3417 (class Output_data_got): Update declarations.
3418 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3419 Add use_plt_offset parameter to global and local constructors.
3420 Change all callers. Change local_sym_index_ field to 31 bits.
3421 Change GSYM_CODE and CONSTANT_CODE accordingly.
3422 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3423 doing a static link don't set sh_link field.
3424 (Output_data_got::Got_entry::write): Use PLT offset if
3426 (Output_data_got::add_global_plt): New function.
3427 (Output_data_got::add_local_plt): New function.
3428 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3429 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3430 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3431 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3432 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3434 * testsuite/ifunc-sel.h: New file.
3435 * testsuite/ifuncmain1.c: New file.
3436 * testsuite/ifuncmain1vis.c: New file.
3437 * testsuite/ifuncmod1.c: New file.
3438 * testsuite/ifuncdep2.c: New file.
3439 * testsuite/ifuncmain2.c: New file.
3440 * testsuite/ifuncmain3.c: New file.
3441 * testsuite/ifuncmod3.c: New file.
3442 * testsuite/ifuncmain4.c: New file.
3443 * testsuite/ifuncmain5.c: New file.
3444 * testsuite/ifuncmod5.c: New file.
3445 * testsuite/ifuncmain6pie.c: New file.
3446 * testsuite/ifuncmod6.c: New file.
3447 * testsuite/ifuncmain7.c: New file.
3448 * configure, testsuite/Makefile.in: Rebuild.
3450 2010-08-18 Ian Lance Taylor <iant@google.com>
3453 (Output_section_incremental_inputs::write_input_files): Add cast
3454 to avoid signed/unsigned comparison warning.
3455 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3457 2010-08-12 Cary Coutant <ccoutant@google.com>
3459 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3461 2010-08-13 Ian Lance Taylor <iant@google.com>
3463 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3465 2010-08-12 Cary Coutant <ccoutant@google.com>
3466 Doug Kwan <dougkwan@google.com>
3468 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3469 defintion overrides non-weak undef, remember that the original undef
3471 * symtab.cc (Symbol_table::sized_write_global): For undef without
3472 an original weak binding, set binding to global in output.
3473 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3474 * testsuite/Makefile.in: Regenerate.
3475 * testsuite/strong_ref_weak_def.sh: New file.
3476 * testsuite/strong_ref_weak_def_1.c: Ditto.
3477 * testsuite/strong_ref_weak_def_2.c: Ditto.
3479 2010-08-12 Cary Coutant <ccoutant@google.com>
3481 * testsuite/incremental_test.sh: Rewrite.
3482 * testsuite/incremental_test_1.c: Rewrite.
3483 * testsuite/incremental_test_2.c: Rewrite.
3485 2010-08-12 Cary Coutant <ccoutant@google.com>
3487 * arm.cc (Target_arm::got_size): Add const.
3488 (Target_arm::got_entry_count): New function.
3489 (Target_arm::plt_entry_count): New function.
3490 (Target_arm::first_plt_entry_offset): New function.
3491 (Target_arm::plt_entry_size): New function.
3492 (Output_data_plt_arm::entry_count): New function.
3493 (Output_data_plt_arm::first_plt_entry_offset): New function.
3494 (Output_data_plt_arm::get_plt_entry_size): New function.
3495 * i386.cc (Target_i386::got_size): Add const.
3496 (Target_i386::got_entry_count): New function.
3497 (Target_i386::plt_entry_count): New function.
3498 (Target_i386::first_plt_entry_offset): New function.
3499 (Target_i386::plt_entry_size): New function.
3500 (Output_data_plt_i386::entry_count): New function.
3501 (Output_data_plt_i386::first_plt_entry_offset): New function.
3502 (Output_data_plt_i386::get_plt_entry_size): New function.
3503 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3504 find_incremental_inputs_sections. Dump incremental_got_plt section.
3505 * incremental.cc: Include target.h.
3506 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3507 parameter. Adjust all callers. Find incremental_got_plt section.
3508 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3510 (Output_section_incremental_inputs::set_final_data_size): Calculate
3511 size of incremental_got_plt section.
3512 (Output_section_incremental_inputs::do_write): Write the
3513 incremental_got_plt section.
3514 (Got_plt_view_info): New struct.
3515 (Local_got_offset_visitor): New class.
3516 (Global_got_offset_visitor): New class.
3517 (Global_symbol_visitor_got_plt): New class.
3518 (Output_section_incremental_inputs::write_got_plt): New function.
3519 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3520 Add parameter. Adjust all callers.
3521 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3522 (Incremental_inputs::got_plt_section): New function.
3523 (Incremental_inputs::got_plt_section_): New data member.
3524 (Incremental_got_plt_reader): New class.
3525 * layout.cc (Layout::create_incremental_info_sections): Add the
3526 incremental_got_plt section.
3527 * object.h (Got_offset_list::get_list): New function.
3528 (Got offset_list::for_all_got_offsets): New function.
3529 (Sized_relobj::local_got_offset_list): New function.
3530 * powerpc.cc (Target_powerpc::got_size): Add const.
3531 (Target_powerpc::got_entry_count): New function.
3532 (Target_powerpc::plt_entry_count): New function.
3533 (Target_powerpc::first_plt_entry_offset): New function.
3534 (Target_powerpc::plt_entry_size): New function.
3535 (Output_data_plt_powerpc::entry_count): New function.
3536 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3537 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3538 * sparc.cc (Target_sparc::got_size): Add const.
3539 (Target_sparc::got_entry_count): New function.
3540 (Target_sparc::plt_entry_count): New function.
3541 (Target_sparc::first_plt_entry_offset): New function.
3542 (Target_sparc::plt_entry_size): New function.
3543 (Output_data_plt_sparc::entry_count): New function.
3544 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3545 (Output_data_plt_sparc::get_plt_entry_size): New function.
3546 * symtab.h (Symbol::got_offset_list): New function.
3547 (Symbol_table::for_all_symbols): New function.
3548 * target.h (Sized_target::got_entry_count): New function.
3549 (Sized_target::plt_entry_count): New function.
3550 (Sized_target::plt_entry_size): New function.
3551 * x86_64.cc (Target_x86_64::got_size): Add const.
3552 (Target_x86_64::got_entry_count): New function.
3553 (Target_x86_64::plt_entry_count): New function.
3554 (Target_x86_64::first_plt_entry_offset): New function.
3555 (Target_x86_64::plt_entry_size): New function.
3556 (Output_data_plt_x86_64::entry_count): New function.
3557 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3558 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3560 2010-08-12 Cary Coutant <ccoutant@google.com>
3562 * archive.cc: Include incremental.h.
3563 (Archive::Archive): Initialize incremental_info_.
3564 (Archive::include_member): Record archive members in incremental info.
3565 (Add_archive_symbols::run): Record begin and end of an archive in
3567 (Lib_group::include_member): Record objects in incremental info.
3568 * archive.h (Incremental_archive_entry): Forward declaration.
3569 (Archive::set_incremental_info): New member function.
3570 (Archive::incremental_info): New member function.
3571 (Archive::Unused_symbol_iterator): New class.
3572 (Archive::unused_symbols_begin): New member function.
3573 (Archive::unused_symbols_end): New member function.
3574 (Archive::incremental_info_): New data member.
3575 * incremental-dump.cc (find_input_containing_global): New function.
3576 (dump_incremental_inputs): Dump new incremental info sections.
3577 * incremental.cc: Include symtab.h.
3578 (Output_section_incremental_inputs): New class.
3579 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3580 new incremental info sections.
3581 (Sized_incremental_binary::do_check_inputs): Likewise.
3582 (Incremental_inputs::report_archive): Remove.
3583 (Incremental_inputs::report_archive_begin): New function.
3584 (Incremental_inputs::report_archive_end): New function.
3585 (Incremental_inputs::report_object): New function.
3586 (Incremental_inputs::finalize_inputs): Remove.
3587 (Incremental_inputs::report_input_section): New function.
3588 (Incremental_inputs::report_script): Rewrite.
3589 (Incremental_inputs::finalize): Do nothing but finalize string table.
3590 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3591 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3592 (Incremental_inputs::create_data_sections): New function.
3593 (Incremental_inputs::relocs_entsize): New function.
3594 (Output_section_incremental_inputs::set_final_data_size): New function.
3595 (Output_section_incremental_inputs::do_write): New function.
3596 (Output_section_incremental_inputs::write_header): New function.
3597 (Output_section_incremental_inputs::write_input_files): New function.
3598 (Output_section_incremental_inputs::write_info_blocks): New function.
3599 (Output_section_incremental_inputs::write_symtab): New function.
3600 * incremental.h (Incremental_script_entry): Forward declaration.
3601 (Incremental_object_entry): Forward declaration.
3602 (Incremental_archive_entry): Forward declaration.
3603 (Incremental_inputs): Forward declaration.
3604 (Incremental_inputs_header_data): Remove.
3605 (Incremental_inputs_header): Remove.
3606 (Incremental_inputs_header_write): Remove.
3607 (Incremental_inputs_entry_data): Remove.
3608 (Incremental_inputs_entry): Remove.
3609 (Incremental_inputs_entry_write): Remove.
3610 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3611 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3612 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3613 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3615 (Incremental_input_entry): New class.
3616 (Incremental_script_entry): New class.
3617 (Incremental_object_entry): New class.
3618 (Incremental_archive_entry): New class.
3619 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3620 (Incremental_inputs::report_inputs): Remove.
3621 (Incremental_inputs::report_archive): Remove.
3622 (Incremental_inputs::report_archive_begin): New function.
3623 (Incremental_inputs::report_archive_end): New function.
3624 (Incremental_inputs::report_object): Change prototype.
3625 (Incremental_inputs::report_input_section): New function.
3626 (Incremental_inputs::report_script): Change prototype.
3627 (Incremental_inputs::get_reloc_count): New function.
3628 (Incremental_inputs::set_reloc_count): New function.
3629 (Incremental_inputs::create_data_sections): New function.
3630 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3631 (Incremental_inputs::inputs_section): New function.
3632 (Incremental_inputs::symtab_section): New function.
3633 (Incremental_inputs::relocs_section): New function.
3634 (Incremental_inputs::get_stringpool): Add const.
3635 (Incremental_inputs::command_line): Add const.
3636 (Incremental_inputs::inputs): Remove.
3637 (Incremental_inputs::command_line_key): New function.
3638 (Incremental_inputs::input_file_count): New function.
3639 (Incremental_inputs::input_files): New function.
3640 (Incremental_inputs::relocs_entsize): New function.
3641 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3642 (Incremental_inputs::finalize_inputs): Remove.
3643 (Incremental_inputs::Input_info): Remove.
3644 (Incremental_inputs::lock_): Remove.
3645 (Incremental_inputs::inputs_): Change type.
3646 (Incremental_inputs::inputs_map_): Remove.
3647 (Incremental_inputs::current_object_entry_): New data member.
3648 (Incremental_inputs::inputs_section_): New data member.
3649 (Incremental_inputs::symtab_section_): New data member.
3650 (Incremental_inputs::relocs_section_): New data member.
3651 (Incremental_inputs::reloc_count_): New data member.
3652 (Incremental_inputs_reader): New class.
3653 (Incremental_symtab_reader): New class.
3654 (Incremental_relocs_reader): New class.
3655 * layout.cc (Layout::finalize): Move finalization of incremental info
3656 and creation of incremental info sections to follow finalization of
3657 symbol table. Set offsets for postprocessing sections.
3658 (Layout::create_incremental_info_sections): Call
3659 Incremental_inputs::create_data_sections. Add incremental symtab
3660 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3661 sections to layout after input sections.
3662 * layout.h (struct Timespec): Forward declaration.
3663 (Layout::incremental_inputs): Add const.
3664 (Layout::create_incremental_info_sections): Add parameter.
3665 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3666 * object.cc: Include incremental.h.
3667 (Relobj::finalize_incremental_relocs): New function.
3668 (Sized_relobj::do_layout): Record input sections in incremental info.
3669 * object.h (Object::output_section): New function.
3670 (Object::output_section_offset): Moved from Relobj.
3671 (Object::get_incremental_reloc_base): New function.
3672 (Object::get_incremental_reloc_count): New function.
3673 (Object::do_output_section): New function.
3674 (Object::do_output_section_offset): Moved from Relobj.
3675 (Object::do_get_incremental_reloc_base): New function.
3676 (Object::do_get_incremental_reloc_count): New function.
3677 (Object::Object): Initialize new data members.
3678 (Relobj::output_section): Renamed do_output_section and moved to
3680 (Relobj::output_section_offset): Moved to Object.
3681 (Relobj::do_get_incremental_reloc_base): New function.
3682 (Relobj::do_get_incremental_reloc_count): New function.
3683 (Relobj::allocate_incremental_reloc_counts): New function.
3684 (Relobj::count_incremental_reloc): New function.
3685 (Relobj::finalize_incremental_relocs): New function.
3686 (Relobj::next_incremental_reloc_index): New function.
3687 (Relobj::reloc_counts_): New data member.
3688 (Relobj::reloc_bases_): New data member.
3689 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3690 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3691 (Sized_relobj::incremental_relocs_scan): New function.
3692 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3693 (Sized_relobj::incremental_relocs_write): New function.
3694 (Sized_relobj::incremental_relocs_write_reltype): New function.
3695 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3697 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3698 archives and object files elsewhere.
3699 (Add_symbols::run): Report object files here.
3700 (Finish_group::run): Report end of archive at end of group.
3701 * reloc.cc: Include layout.h, incremental.h.
3702 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3703 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3704 (Sized_relobj::incremental_relocs_scan): New function.
3705 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3706 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3707 (Sized_relobj::incremental_relocs_write): New function.
3708 (Sized_relobj::incremental_relocs_write_reltype): New function.
3709 * script.cc (read_input_script): Rewrite test for incremental link.
3710 Change call to Incremental_inputs::report_script.
3711 * symtab.h (Symbol_table::first_global_index): New function.
3712 (Symbol_table::output_count): New function.
3714 2010-08-12 Doug Kwan <dougkwan@google.com>
3716 * arm.cc (Target_arm::merge_object_attributes): Check command line
3717 options --no-wchar-size-warning and --no-enum-size-warning.
3718 * options.h (General_options): Add ld-compatible options
3719 --no-enum-size-warning and --no-wchar-size-warning.
3721 2010-08-04 Ian Lance Taylor <iant@google.com>
3723 * x86_64.cc (Target_x86_64::Scan::local): Use
3724 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3725 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3726 (Target_x86_64::Scan::global): Likewise.
3727 (Target_x86_64::Relocate::relocate): Likewise.
3728 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3731 2010-08-03 Cary Coutant <ccoutant@google.com>
3733 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3734 to reserve space in merged_strings vector. Keep total input size
3736 (Output_merge_string::do_print_merge_stats): Print total input size.
3737 * merge.h (Output_merge_string): Add input_size_ field.
3738 * stringpool.cc (Stringpool_template::string_length): Move
3739 implementations out of Stringpool_template class and place in
3741 * stringpool.h (string_length): Move out of Stringpool_template.
3743 2010-08-03 Ian Lance Taylor <iant@google.com>
3746 * layout.cc (relaxation_loop_body): If address of load segment is
3747 set, adjust address to include headers if possible.
3749 2010-08-03 Ian Lance Taylor <iant@google.com>
3751 * version.cc (version_string): Bump to 1.10.
3753 2010-08-03 Ian Lance Taylor <iant@google.com>
3756 * layout.h (enum Output_section_order): Define.
3757 (class Layout): Update declarations.
3758 * layout.cc (Layout::get_output_section): Add order parameter.
3759 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3760 is_first_non_relro parameters. Change all callers.
3761 (Layout::choose_output_section): Likewise.
3762 (Layout::add_output_section_data): Likewise.
3763 (Layout::make_output_section): Likewise. Set order.
3764 (Layout::default_section_order): New function.
3765 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3766 * output.cc (Output_section::Output_section): Initialize order_.
3767 Don't initialize deleted fields.
3768 (Output_segment::Output_segment): Don't initialize deleted
3770 (Output_segment::add_output_section_to_load): New function
3771 replacing add_output_section. Change all callers to call this or
3772 add_output_section_to_nonload.
3773 (Output_segment::add_output_section_to_nonload): New function.
3774 (Output_segment::remove_output_section): Rewrite.
3775 (Output_segment::add_initial_output_data): Likewise.
3776 (Output_segment::has_any_data_sections): Likewise.
3777 (Output_segment::is_first_section_relro): Likewise.
3778 (Output_segment::maximum_alignment): Likewise.
3779 (Output_segment::has_dynamic_reloc): New function replacing
3780 dynamic_reloc_count. Change all callers.
3781 (Output_segment::has_dynamic_reloc_list): New function replacing
3782 dynamic_reloc_count_list. Change all callers.
3783 (Output_segment::set_section_addresses): Rewrite.
3784 (Output_segment::set_offset): Rewrite.
3785 (Output_segment::find_first_and_last_list): Remove.
3786 (Output_segment::set_tls_offsets): Rewrite.
3787 (Output_segment::first_section_load_address): Likewise.
3788 (Output_segment::output_section_count): Likewise.
3789 (Output_segment::section_with_lowest_load_address): Likewise.
3790 (Output_segment::write_section_headers): Likewise.
3791 (Output_segment::print_sections_to_map): Likewise.
3792 * output.h (class Output_data): Remove dynamic_reloc_count_
3793 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3794 (Output_data::add_dynamic_reloc): Rewrite.
3795 (Output_data::has_dynamic_reloc): New function.
3796 (Output_data::dynamic_reloc_count): Remove.
3797 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3798 is_last_relro_, is_first_non_relro_, is_interp_,
3799 is_dynamic_linker_section_ fields. Add order and set_order
3800 functions. Remove is_relro_local, set_is_relro_local,
3801 is_last_relro, set_is_last_relro, is_first_non_relro,
3802 set_is_first_non_relro functions, is_interp, set_is_interp,
3803 is_dynamic_linker_section, and set_is_dynamic_linker_section
3805 (class Output_segment): Change Output_data_list from std::list to
3806 std:;vector. Add output_lists_ field. Remove output_data_ and
3807 output_bss_ fields. Update declarations.
3809 2010-08-02 Ian Lance Taylor <iant@google.com>
3811 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3812 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3813 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3815 2010-08-02 Ian Lance Taylor <iant@google.com>
3818 * script.cc (Script_options::Script_options): Initialize
3819 symbol_definitions_ and symbol_references_.
3820 (Script_options::add_symbol_assignment): Update
3821 symbol_definitions_ and symbol_references_.
3822 (Script_options::add_symbol_reference): New function.
3823 (script_symbol): New function.
3824 * script.h (class Script_options): Add symbol_definitions_ and
3825 symbol_references_ fields.
3826 (Script_options::referenced_const_iterator): New type.
3827 (Script_options::referenced_begin): New function.
3828 (Script_options::referenced_end): New function.
3829 (Script_options::is_referenced): New function.
3830 (Script_options::any_unreferenced): New function.
3831 * script-c.h (script_symbol): Declare.
3832 * yyscript.y (exp): Call script_symbol.
3833 * symtab.cc: Include "script.h".
3834 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3835 Change all callers. Check symbols referenced by scripts.
3836 (Symbol_table::add_undefined_symbols_from_command_line): Add
3837 layout parameter. Change all callers.
3838 (Symbol_table::do_add_undefined_symbols_from_command_line):
3839 Likewise. Break out loop body. Check symbols referenced by
3841 (Symbol_table::add_undefined_symbol_from_command_line): New
3842 function broken out of
3843 do_add_undefined_symbols_from_command_line.
3844 * symtab.h (class Symbol_table): Update declarations.
3845 * archive.cc: Include "layout.h".
3846 (Archive::should_include_member): Add layout parameter. Change
3847 all callers. Check for symbol mentioned in expression.
3848 * archive.h (class Archive): Update declaration.
3849 * object.cc (Sized_relobj::do_should_include_member): Add layout
3851 * object.h (Object::should_include_member): Add layout parameter.
3853 (Object::do_should_include_member): Add layout parameter.
3854 (class Sized_relobj): Update declaration.
3855 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3857 * dynobj.h (class Sized_dynobj): Update declaration.
3858 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3860 * plugin.h (class Sized_pluginobj): Update declaration.
3862 2010-08-02 Ian Lance Taylor <iant@google.com>
3865 * output.cc (Output_segment::set_offset): Search for the first and
3866 last sections rather than assuming that the list is in order.
3867 (Output_segment::find_first_and_last_list): New function.
3868 * output.h (class Output_segment): Update declarations.
3869 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3870 (relro_strip_test_SOURCES): New variable.
3871 (relro_strip_test_DEPENDENCIES): New variable.
3872 (relro_strip_test_LDFLAGS): New variable.
3873 (relro_strip_test_LDADD): New variable.
3874 (relro_strip_test.so): New target.
3876 2010-08-02 Ian Lance Taylor <iant@google.com>
3878 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3879 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3880 (Target_i386::got_tlsdesc_section): New function.
3881 (Target_i386::got_section): Create space for GOT entries for
3882 TLSDESC relocations.
3883 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3885 (Target_i386::Scan::global): Likewise.
3886 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3888 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3889 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3890 (Target_x86_64::got_tlsdesc_section): New function.
3891 (Target_x86_64::got_section): Create space for GOT entries for
3892 TLSDESC relocations.
3893 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3895 (Target_x86_64::Scan::global): Likewise.
3896 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3899 2010-08-02 Ian Lance Taylor <iant@google.com>
3901 * testsuite/final_layout.sh: Use dc to convert from hex to
3904 2010-07-29 Sriraman Tallam <tmsriram@google.com>
3906 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3907 paramter to the call to gold::gc_process_relocs.
3908 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3909 paramter to the call to gold::gc_process_relocs.
3910 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3911 parameter to the call to gold::gc_process_relocs.
3912 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3913 template parameter to the call to gold::gc_process_relocs.
3914 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3915 paramter to the call to gold::gc_process_relocs.
3916 * gc.h (get_embedded_addend_size): New function.
3917 (gc_process_relocs): Save the size of the reloc for use by ICF.
3918 * icf.cc (get_section_contents): Get the addend from the text section
3919 for SHT_REL relocation sections.
3920 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3921 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3922 * int_encoding.h (read_from_pointer): New overloaded function.
3923 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3924 * testsuite/icf_sht_rel_addend_test.sh: New file.
3925 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3926 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3928 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3930 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3931 * Makefile.in: Regenerate.
3932 * testsuite/Makefile.in: Regenerate.
3934 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3936 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3937 * gold/testsuite/debug_msg.cc: Likewise.
3938 * gold/testsuite/odr_violation1.cc
3939 * gold/testsuite/odr_violation2.cc
3941 2010-07-21 Cary Coutant <ccoutant@google.com>
3943 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3944 string, and length fields.
3945 (Output_merge_string::Merged_strings_list): New type.
3946 (Output_merge_string::Merged_strings_lists): New typedef.
3947 (Output_merge_string): Replace merged_strings_ with
3948 merged_strings_lists_.
3949 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3950 Merged_strings_list per input object and section. Don't store pointer
3951 to the string. Don't store length with each merged string entry.
3952 (Output_merge_string::finalize_merged_data): Loop over list of merged
3953 strings lists. Recompute length of each merged string.
3955 2010-07-15 Cary Coutant <ccoutant@google.com>
3957 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3960 2010-07-14 Ian Lance Taylor <iant@google.com>
3962 * descriptors.cc (Descriptors::open): Report correct name in error
3965 2010-07-13 Doug Kwan <dougkwan@google.com>
3967 * arm.cc (Arm_input_section::Arm_input_section): For a
3968 SHT_ARM_EXIDX section, always keeps the input sections.
3969 (Arm_input_section::set_exidx_section_link): New method.
3970 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3971 has_errors_ to false.
3972 (Arm_exidx_input_section::has_errors,
3973 Arm_exidx_input_section::set_has_errors): New methods.
3974 (Arm_exidx_input_section::has_errors_): New data member.
3975 (Arm_relobj::get_exidx_shndx_list): New method.
3976 (Arm_output_section::append_text_sections_to_list): Do not skip
3977 section without SHF_EXECINSTR.
3978 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3980 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3981 section header. Make error messages more verbose. Check for
3982 a non-executable section linked to an EXIDX section.
3983 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3984 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3985 check that there is no deferred EXIDX section if we exit early.
3986 Instead of not making an EXIDX section in case of an error, make one
3987 and set the has_errors flag of it.
3988 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3989 in a relocatable link.
3990 (Target_arm::do_relax): Look for the EXIDX output section instead of
3991 assuming that it is called .ARM.exidx.
3992 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3993 section list. Do not check for SHF_EXECINSTR section flags but
3994 skip any input section with errors.
3995 * output.cc (Output_section::Output_section): Initialize
3996 always_keeps_input_sections_ to false.
3997 (Output_section::add_input_section): Check for
3998 always_keeps_input_sections_.
3999 * output.h (Output_section::always_keeps_input_sections,
4000 Output_section::set_always_keeps_input_sections): New methods.
4001 (Output_section::always_keeps_input_sections): New data member.
4003 2010-07-13 Rafael Espindola <espindola@google.com>
4005 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4006 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4008 2010-07-13 Philip Herron <herron.philip@googlemail.com>
4009 Ian Lance Taylor <iant@google.com>
4011 * output.h (Output_section_lookup_maps::add_merge_section):
4012 Correct check of whether value was inserted.
4013 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4014 (Output_section_lookup_maps::add_relaxed_input_section):
4016 * arm.cc (Target_arm::got_section): Remove used local os.
4017 * i386.cc (Target_i386::got_section): Likewise.
4018 * x86_64.cc (Target_x86_64::got_section): Likewise.
4019 * sparc.cc (Target_sparc::got_section): Likewise.
4020 (Target_sparc::relocate): Remove unused local have_got_offset.
4021 * powerpc.cc (Target_powerpc::relocate): Likewise.
4023 2010-07-13 Ian Lance Taylor <iant@google.com>
4025 * compressed_output.cc (zlib_decompress): Fix signature in
4028 * archive.cc (Archive::include_member): Unlock an external member
4029 of a thin archive. Don't bother to delete an object we know is
4032 2010-07-12 Cary Coutant <ccoutant@google.com>
4034 * compressed_output.cc (zlib_decompress): New function.
4035 (get_uncompressed_size): New function.
4036 (decompress_input_section): New function.
4037 * compressed_output.h (get_uncompressed_size): New function.
4038 (decompress_input_section): New function.
4039 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4040 Handle compressed debug sections.
4041 * layout.cc (is_compressed_debug_section): New function.
4042 (Layout::output_section_name): Map compressed section names to
4044 * layout.h (is_compressed_debug_section): New function.
4045 (is_debug_info_section): Recognize compressed debug sections.
4046 * merge.cc: Include compressed_output.h.
4047 (Output_merge_data::do_add_input_section): Handle compressed
4049 (Output_merge_string::do_add_input_section): Handle compressed
4051 * object.cc: Include compressed_output.h.
4052 (Sized_relobj::Sized_relobj): Initialize new data members.
4053 (build_compressed_section_map): New function.
4054 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4055 * object.h (Object::section_is_compressed): New method.
4056 (Object::do_section_is_compressed): New method.
4057 (Sized_relobj::Compressed_section_map): New type.
4058 (Sized_relobj::do_section_is_compressed): New method.
4059 (Sized_relobj::compressed_sections_): New data member.
4060 * output.cc (Output_section::add_input_section): Handle compressed
4062 * reloc.cc: Include compressed_output.h.
4063 (Sized_relobj::write_sections): Handle compressed debug sections.
4065 2010-07-08 Cary Coutant <ccoutant@google.com>
4067 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4068 weak when resolving to a dynamic def.
4069 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4070 for weak undef/dynamic def cases. Adjust callers.
4071 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4072 undef_binding_weak_.
4073 (Symbol_table::sized_write_globals): Adjust symbol binding.
4074 (Symbol_table::sized_write_symbol): Add binding parameter.
4075 * symtab.h (Symbol::set_undef_binding): New method.
4076 (Symbol::is_undef_binding_weak): New method.
4077 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4078 (Symbol_table::should_override): Add new parameter.
4079 (Symbol_table::sized_write_symbol): Add new parameter.
4081 * testsuite/weak_undef_file1.cc: Add new test case.
4082 * testsuite/weak_undef_file2.cc: Fix header comment.
4083 * testsuite/weak_undef_test.cc: Add new test case.
4085 2010-06-29 Doug Kwan <dougkwan@google.com>
4087 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4088 Initialize USE_SYMBOL_.
4089 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4091 (Arm_reloc_property::uses_symbol_): New data member declaration.
4092 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4093 uses symbol value and symbol is undefined but not weakly undefined.
4095 2010-06-28 Rafael Espindola <espindola@google.com>
4097 * plugin.cc (Plugin::load): Use dlerror.
4099 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4101 * symtab.cc (detect_odr_violations): When reporting an ODR
4102 violation, report an object where the symbol is defined.
4104 2010-06-25 Doug Kwan <dougkwan@google.com>
4106 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4107 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4109 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4110 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4111 target hook to detect function points.
4112 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4113 * icf.h (Icf::check_section_for_function_pointers): Change type of
4114 parameter SECTION_NAME to const reference to std::string. Use
4115 target hook to determine if section may have unsafe pointers.
4116 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4119 2010-06-21 Rafael Espindola <espindola@google.com>
4121 * fileread.cc (Input_file::find_fie): New
4122 (Input_file::open): Use Input_file::find_fie.
4123 * fileread.h (Input_file::find_fie): New
4124 * plugin.cc (set_extra_library_path): New.
4125 (Plugin::load): Add set_extra_library_path to the transfer vector.
4126 (Plugin_manager::set_extra_library_path): New.
4127 (Plugin_manager::add_input_file): Use the extra search path if set.
4128 (set_extra_library_path(): New.
4129 * plugin.h (Plugin_manager): Add set_extra_library_path and
4132 2010-06-19 Cary Coutant <ccoutant@google.com>
4134 * layout.cc (gdb_sections): Add .debug_types.
4135 (lines_only_debug_sections): Likewise.
4137 2010-06-18 Rafael Espindola <espindola@google.com>
4139 * plugin.cc (add_input_file,add_input_library)
4140 (Plugin_manager::add_input_file): Make filename arguments const.
4141 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4144 2010-06-16 Doug Kwan <dougkwan@google.com>
4146 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4147 .ARM.attributes section if we have not merged any input
4148 attributes sections.
4150 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4152 * arm.cc: Allow combining objects with no EABI version
4155 2010-06-15 Rafael Espindola <espindola@google.com>
4157 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4159 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4161 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4162 (struct iovec): Correct !HAVE_READV definition.
4164 2010-06-10 Cary Coutant <ccoutant@google.com>
4166 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4167 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4169 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4172 * symtab.h (Symbol::is_placeholder): New member function.
4173 * target-reloc.h (relocate_section): Check for placeholder symbols.
4175 * testsuite/Makefile.am (plugin_test_8): New test.
4176 (plugin_test_9): New test.
4177 * testsuite/Makefile.in: Regenerate.
4179 2010-06-09 Nick Clifton <nickc@redhat.com>
4181 * yyscript.y (input_list_element): Allow strings prefixed with
4182 the '-' character. Treat these as libraries.
4183 * script.cc (script_add_library): New function. Adds a library
4184 specified by "-l<name>" found in an input script.
4185 * script-c.h: Add prototype for script_add_library.
4187 2010-06-07 Doug Kwan <dougkwan@google.com>
4189 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4190 Restrict stub-group size to be within long conditional branch
4191 range when working around cortex-A8 erratum.
4193 2010-06-07 Damien Diederen <dd@crosstwine.com>
4195 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4198 2010-06-03 Sriraman Tallam <tmsriram@google.com>
4202 (Output_section::Input_section_sort_entry::compare_section_ordering):
4203 Change to return non-zero correctly.
4204 (Output_section::Input_section_sort_section_order_index_compare
4205 ::operator()): Change to fix ambiguity in comparisons.
4207 2010-06-01 Sriraman Tallam <tmsriram@google.com>
4209 * gold.h (is_wildcard_string): New function.
4210 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4211 (Layout::layout_eh_frame): Ditto.
4212 (Layout::find_section_order_index): New method.
4213 (Layout::read_layout_from_file): New method.
4214 * layout.h (Layout::find_section_order_index): New method.
4215 (Layout::read_layout_from_file): New method.
4216 (Layout::input_section_position_): New private member.
4217 (Layout::input_section_glob_): New private member.
4218 * main.cc (main): Call read_layout_from_file here.
4219 * options.h (--section-ordering-file): New option.
4220 * output.cc (Output_section::input_section_order_specified_): New
4222 (Output_section::Output_section): Initialize new member.
4223 (Output_section::add_input_section): Add new parameter.
4224 Keep input sections when --section-ordering-file is used.
4225 (Output_section::set_final_data_size): Sort input sections when
4226 section ordering file is specified.
4227 (Output_section::Input_section_sort_entry): Add new parameter.
4229 (Output_section::Input_section_sort_entry::compare_section_ordering):
4231 (Output_section::Input_section_sort_compare::operator()): Change to
4232 consider section_order_index.
4233 (Output_section::Input_section_sort_init_fini_compare::operator()):
4234 Change to consider section_order_index.
4235 (Output_section::Input_section_sort_section_order_index_compare
4236 ::operator()): New method.
4237 (Output_section::sort_attached_input_sections): Change to sort
4238 according to section order when specified.
4239 (Output_section::add_input_section<32, true>): Add new parameter.
4240 (Output_section::add_input_section<64, true>): Add new parameter.
4241 (Output_section::add_input_section<32, false>): Add new parameter.
4242 (Output_section::add_input_section<64, false>): Add new parameter.
4243 * output.h (Output_section::add_input_section): Add new parameter.
4244 (Output_section::input_section_order_specified): New
4246 (Output_section::set_input_section_order_specified): New method.
4247 (Input_section::Input_section): Initialize section_order_index_.
4248 (Input_section::section_order_index): New method.
4249 (Input_section::set_section_order_index): New method.
4250 (Input_section::section_order_index_): New member.
4251 (Input_section::Input_section_sort_section_order_index_compare): New
4253 (Output_section::input_section_order_specified_): New member.
4254 * script-sections.cc (is_wildcard_string): Delete and move modified
4256 (Output_section_element_input::Output_section_element_input): Modify
4257 call to is_wildcard_string.
4258 (Output_section_element_input::Input_section_pattern
4259 ::Input_section_pattern): Ditto.
4260 (Output_section_element_input::Output_section_element_input): Ditto.
4261 * testsuite/Makefile.am (final_layout): New test case.
4262 * testsuite/Makefile.in: Regenerate.
4263 * testsuite/final_layout.cc: New file.
4264 * testsuite/final_layout.sh: New file.
4266 2010-06-01 Rafael Espindola <espindola@google.com>
4268 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4270 2010-06-01 Rafael Espindola <espindola@google.com>
4272 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4273 visibility of symbols.
4275 2010-05-27 Doug Kwan <dougkwan@google.com>
4277 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4278 from start of output section instead of address for a local symbol
4279 in a merged or relaxed section when doing a relocatable link.
4281 2010-05-26 Rafael Espindola <espindola@google.com>
4284 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4285 adding sections the garbage collector removed.
4286 * gold/testsuite/Makefile.am: Add test.
4287 * gold/testsuite/Makefile.in: Regenerate.
4288 * gold/testsuite/plugin_test_7.sh: New.
4289 * gold/testsuite/plugin_test_7_1.c: New.
4290 * gold/testsuite/plugin_test_7_2.c: New.
4292 2010-05-26 Rafael Espindola <espindola@google.com>
4294 * script-sections.cc (Output_section_definition::set_section_addresses):
4295 Check for --section-start.
4297 2010-05-26 Doug Kwan <dougkwan@google.com>
4299 * arm.cc (Arm_scan_relocatable_relocs): New class.
4300 (Target_arm::relocate_special_relocatable): New method.
4301 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4302 (Arm_relocate_functions::thumb_branch_common): Same.
4303 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4304 instead of Default_scan_relocatable_relocs.
4305 * target-reloc.h (relocate_for_relocatable): Let target handle
4306 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4307 * target.h (Sized_target::relocate_special_relocatable): New method.
4309 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4311 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4313 2010-05-23 Doug Kwan <dougkwan@google.com>
4315 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4317 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4318 with a direct branch, not a conditional branch, to a stub.
4319 * merge.cc (Output_merge_base::record_input_section): New method
4321 (Output_merge_data::do_add_input_section): Record input section if
4322 keeps-input-sections flag is set.
4323 (Output_merge_string::do_add_input_section): Ditto.
4324 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4325 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4327 (Output_merge_base::keeps_input_sections,
4328 Output_merge_base::set_keeps_input_sections,
4329 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4331 (Output_merge_base::Input_sections): New type declaration.
4332 (Output_merge_base::input_sections_begin,
4333 Output_merge_base::input_sections_end,
4334 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4335 (Output_merge_base::bool keeps_input_sections_,
4336 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4337 Output_merge_base::input_sections_): New data members.
4338 (Output_merge_data::do_set_keeps_input_sections): New method
4340 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4341 * output.cc (Output_section::Input_section::relobj): Move method
4342 defintion from class declaration to here and handle merge sections.
4343 (Output_section::Input_section::shndx): Ditto.
4344 (Output_section::Output_section): Remove initializations of removed
4345 data members and initialize new data member LOOKUP_MAPS_.
4346 (Output_section::add_input_section): Set keeps-input-sections flag
4347 for a newly created merge output section as appropriate. Adjust code
4348 to use Output_section_lookup_maps class.
4349 (Output_section::add_relaxed_input_section): Adjst code for lookup
4350 maps code refactoring.
4351 (Output_section::add_merge_input_section): Add a new parameter
4352 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4353 class. If adding input section to a newly created merge output
4354 section fails, remove the new merge section.
4355 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
4356 Adjust code for use of the Output_section_lookup_maps class.
4357 (Output_section::find_merge_section): Ditto.
4358 (Output_section::build_lookup_maps): New method defintion.
4359 (Output_section::find_relaxed_input_section): Adjust code to use
4360 Output_section_lookup_maps class.
4361 (Output_section::get_input_sections): Export merge sections. Adjust
4362 code to use Output_section_lookup_maps class.
4363 (Output_section:::add_script_input_section): Adjust code to use
4364 Output_section_lookup_maps class. Update lookup maps for merge
4366 (Output_section::discard_states): Use Output_section_lookup_maps.
4367 (Output_section::restore_states): Same.
4368 * output.h (Merge_section_properties): Move class defintion out of
4370 (Output_section_lookup_maps): New class.
4371 (Output_section::Input_section::is_merge_section): New method
4373 (Output_section::Input_section::relobj): Move defintion out of class
4374 defintion. Declare method only.
4375 (Output_section::Input_section::shndx): Ditto.
4376 (Output_section::Input_section::output_merge_base): New method defintion.
4377 (Output_section::Input_section::u2_.pomb): New union field.
4378 (Output_section::Merge_section_by_properties_map,
4379 Output_section::Output_section_data_by_input_section_map,
4380 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4382 (Output_section::add_merge_input_section): Add new parameter
4383 KEEPS_INPUT_SECTIONS.
4384 (Output_section::build_lookup_maps): New method declaration.
4385 (Output_section::merge_section_map_,
4386 Output_section::merge_section_by_properties_map_,
4387 Output_section::relaxed_input_section_map_,
4388 Output_section::is_relaxed_input_section_map_valid_): Remove data
4390 (Output_section::lookup_maps_): New data member.
4392 2010-05-21 Doug Kwan <dougkwan@google.com>
4395 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4396 avoid a compilation error.
4398 2010-05-19 Rafael Espindola <espindola@google.com>
4400 * script-sections.cc (Output_section_definition::allocate_to_segment):
4401 Update the phdrs_list even when the output section is NULL.
4402 * testsuite/Makefile.am: Add test.
4403 * testsuite/Makefile.in: Regenerate.
4404 * testsuite/script_test_9.cc: New.
4405 * testsuite/script_test_9.sh: New.
4406 * testsuite/script_test_9.t: New.
4408 2010-05-19 Doug Kwan <dougkwan@google.com>
4410 * arm.cc (Arm_input_section::original_size): New method.
4411 (Arm_input_section::do_addralign): Add a cast.
4412 (Arm_input_section::do_output_offset): Remove static cast.
4413 (Arm_input_section::original_addralign,
4414 Arm_input_section::original_size_): Change type to uint32_t.
4415 (Arm_input_section::init): Add safe casts for section alignment
4417 (Arm_input_section::set_final_data_size): Do not set address and
4418 offset of stub table.
4419 (Arm_output_section::fix_exidx_coverage): Change use of of
4420 Output_section::Simple_input_section to that of
4421 Output_section::Input_section.
4422 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4423 except for the first pass.
4424 * output.cc (Output_section::get_input_sections): Change type of
4425 input_sections to std::list<Input_section>.
4426 (Output_section::add_script_input_section): Rename from
4427 Output_section::add_simple_input_section. Change type of SIS
4428 parameter from Simple_input_section to Input_section.
4429 * output.h (Output_section::Simple_input_section): Remove class.
4430 (Output_section::Input_section): Change class visibility to public.
4431 (Output_section::Input_section::addralign): Use stored alignments
4432 for special input sections if set.
4433 (Output_section::Input_section::set_addralign): New method.
4434 (Output_section::get_input_sections): Change parameter type from
4435 list of Simple_input_section to list of Input_section.
4436 (Output_section::add_script_input_section): Rename from
4437 Output_section::add_simple_input_section. Change first parameter's
4438 type from Simple_input_section to Input_section and remove the
4439 second and third parameters.
4440 * script-sections.cc (Input_section::Input_section_list): Change
4441 type to list of Output_section::Input_section/
4442 (Input_section_info::Input_section_info): Change parameter type of
4443 INPUT_SECTION to Output_section::Input_section.
4444 (Input_section_info::input_section): Change return type.
4445 (Input_section_info::input_section_): Change type to
4446 Output_section::Input_section.
4447 (Output_section_element_input::set_section_addresses): Adjust code
4448 to use Output_section::Input_section instead of
4449 Output_section::Simple_input_section. Adjust code for renaming
4450 of Output_section::add_simple_input_section.
4451 (Orphan_output_section::set_section_addresses): Ditto.
4453 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4455 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4456 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4458 2010-05-18 Rafael Espindola <espindola@google.com>
4460 * options.cc (General_options::finalize): Handle -nostdlib.
4461 * options.h (nostdlib): New option.
4462 * script.cc (script_add_search_dir): Handle -nostdlib.
4464 2010-05-12 Doug Kwan <dougkwan@google.com>
4466 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4467 attributes section only if there no attributes section after merging.
4468 (Target_arm::merge_object_attributes): Move value of
4469 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
4470 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4471 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4472 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4473 and arm_attr_merge_7.stdout.
4474 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4475 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4476 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4477 arm_attr_merge_7b.o): New rules.
4478 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4480 * testsuite/Makefile.in: Regenerate.
4481 * testsuite/arm_attr_merge.sh: New file.
4482 * testsuite/arm_attr_merge_[67][ab].s: Same.
4484 2010-05-05 Nick Clifton <nickc@redhat.com>
4486 * po/es.po: Updated Spanish translation.
4488 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4490 * Makefile.am (install-exec-local): Properly install gold as
4491 default cross linker.
4492 * Makefile.in: Regenerated.
4494 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4495 Nick Clifton <nickc@redhat.com>
4497 * configure.ac (install_as_default): Define and set to false
4498 unless --enable-gold or --enable-gold=both/gold has been
4500 * configure: Regenerate.
4502 * Makefile.am (install-exec-local): Install the executable as
4503 'ld.gold'. If install_as_default is true then also install it as
4505 * Makefile.in: Regenerated.
4507 2010-04-24 Ian Lance Taylor <iant@google.com>
4509 * layout.cc (Layout::layout_reloc): In relocatable link don't
4510 combine reloc sections for grouped sections.
4512 2010-04-23 Sriraman Tallam <tmsriram@google.com>
4514 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4515 sections that are not ordinary to icf.
4516 * icf.cc (get_section_contents): Handle relocation pointing to section
4517 with no object or shndx information.
4518 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4519 * testsuite/Makefile.in: Regenerate.
4520 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4521 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4523 2010-04-22 Ian Lance Taylor <iant@google.com>
4525 * expression.cc (Expression::Expression_eval_info): Add
4526 result_alignment_pointer field.
4527 (Expression::eval_with_dot): Add result_alignment_pointer
4528 parameter. Change all callers.
4529 (Expression::eval_maybe_dot): Likewise.
4530 (class Binary_expression): Add alignment_pointer parameter to
4531 left_value and right_value. Change all callers.
4532 (BINARY_EXPRESSION): Set result alignment.
4533 (class Trinary_expression): Add alignment_pointer parameter to
4534 arg2_value and arg3_value. Change all callers.
4535 (Trinary_cond::value): Set result alignment.
4536 (Max_expression::value, Min_expression::value): Likewise.
4537 (Align_expression::value): Likewise.
4538 * script-sections.cc (class Sections_element): Add dot_alignment
4539 parameter to set_section_addresses virtual function. Update
4541 (class Output_section_element): Likewise.
4542 (Script_sections::create_segments): Add dot_alignment parameter.
4544 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4545 (Script_sections::set_phdrs_clause_addresses): Likewise.
4546 * script-sections.h: Update declarations.
4547 * script.h: Update declarations.
4548 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4550 * testsuite/script_test_3.t: Set large alignment.
4551 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4552 segment has expected alignment.
4554 2010-04-22 Nick Clifton <nickc@redhat.com>
4556 * po/gold.pot: Updated by the Translation project.
4557 * po/vi.po: Updated Vietnamese translation.
4559 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4561 * testsuite/Makefile.am (check_PROGRAMS): Add
4562 icf_virtual_function_folding_test.
4563 * testsuite/Makefile.in: Regenerated.
4565 2010-04-15 Andrew Haley <aph@redhat.com>
4567 * options.h (merge_exidx_entries): New option.
4568 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4569 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4570 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4571 (Target_arm::merge_exidx_entries): New function.
4572 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4573 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4574 to Arm_exidx_fixup constructor.
4575 Add new arg, merge_exidx_entries.
4576 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4577 Arm_output_section::fix_exidx_coverage.
4579 2010-04-18 Sriraman Tallam <tmsriram@google.com>
4581 * icf.cc (get_section_contents): Check for preemptible functions.
4582 Ignore addend when appropriate.
4583 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4585 (add_from_relobj): Check for section folded.
4586 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4587 * symtab.h (should_add_dynsym_entry): Add new parameter.
4588 * target-reloc.h (scan_relocs): Check for section folded.
4589 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4590 Check reloc types for function pointers in shared objects.
4591 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4593 (icf_preemptible_functions_test): New test case.
4594 (icf_string_merge_test): New test case.
4595 * testsuite.Makefile.in: Regenerate.
4596 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4597 bar_glob. Refactor code.
4598 * testsuite/icf_preemptible_functions_test.cc: New file.
4599 * testsuite/icf_preemptible_functions_test.sh: New file.
4600 * testsuite/icf_string_merge_test.cc: New file.
4601 * testsuite/icf_string_merge_test.sh: New file.
4602 * testsuite/icf_virtual_function_folding_test.cc: New file.
4603 * testsuite/icf_virtual_function_folding_test.sh: New file.
4605 2010-04-14 Doug Kwan <dougkwan@google.com>
4607 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4608 for local symbol recounting if we remove a section due to ICF.
4609 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4610 there are no regular objects in input.
4612 2010-04-13 Doug Kwan <dougkwan@google.com>
4614 * arm.cc (Arm_input_section::set_final_data_size): Compute
4615 accurate final data size instead of using current data size.
4617 2010-04-09 Doug Kwan <dougkwan@google.com>
4619 * layout.cc (Layout::choose_output_section): Handle script section
4621 (Layout::make_output_section_for_script): Add section type parameter.
4622 Handle script section types.
4623 * layout.h (Layout::make_output_section_for_script): Add section
4625 * output.cc (Output_section::Output_section): Initialize data member
4627 (Output_section::do_reset_address_and_file_offset): Do not set address
4628 to 0 if section is a NOLOAD section.
4629 * output.h (Output_section::is_noload): New method.
4630 (Output_section::set_is_noload): Ditto.
4631 (Output_section::is_noload_): New data member.
4632 * script-c.h (Script_section_type): New enum type.
4633 (struct Parser_output_section_header): Add new file section_type.
4634 * script-sections.cc (Sections_element::output_section_name): Add
4635 parameter for returning script section type.
4636 (Output_section_definition::output_section_name): Ditto.
4637 (Output_section_definition::section_type)P; New method.
4638 (Output_section_definiton::script_section_type_name): Ditto.
4639 (Output_section_definition::script_section_type_): New data member.
4640 (Output_section_definition::Output_section_definition): Initialize
4641 data member Output_section_definition::script_section_type_.
4642 (Output_section_definition::create_sections): Pass script section type
4643 to Layout::make_output_section_for_script.
4644 (Output_section_definition::output_section_name): Return script
4645 section type to caller.
4646 (Output_section_definition::set_section_address): Do not advance
4647 dot value and load address if section type is NOLOAD. Set address
4648 of NOLOAD sections regardless of section flags.
4649 (Output_section_definition::print): Print section type if it is
4650 not SCRIPT_SECTION_TYPE_NONE.
4651 (Output_section_definition::section_type): New method.
4652 (Output_section_definition::script_section_type_name): Ditto.
4653 (Script_sections::output_section_name): Add new parameter
4654 PSECTION_TYPE for returning script section type. Pass it to
4655 section elements. Handle discard sections.
4656 (Sort_output_sections::operator()): Handle NOLOAD sections.
4657 * script-sections.h (Script_sections::Section_type): New enum type.
4658 (Script_sections::output_section_name): Add a new parameter for
4659 returning script section type.
4660 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4662 * yyscript.y (union): Add new field SECTION_TYPE.
4663 (COPY, DSECT, INFO, NOLOAD): New tokens.
4664 (opt_address_and_section_type): Change type to output_section_header.
4665 (section_type): New non-terminal
4666 (section_header): Handle section type.
4667 (opt_address_and_section_type): Return section type value.
4669 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4671 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4672 * testsuite/plugin_common_test_2.c (foo): Likewise.
4674 2010-04-08 Doug Kwan <dougkwan@google.com>
4676 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4678 * output.cc (Output_section::add_merge_input_section): Simplify
4679 code and return status of Output_merge_base::add_input_section.
4680 Update merge section map only if Output_merge_base::add_input_section
4683 2010-04-07 Doug Kwan <dougkwan@google.com>
4685 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4686 if section is marked as containing instructions but has no mapping
4688 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4689 correct section index.
4690 (Arm_relobj::find_linked_text_section): Ditto.
4692 2010-04-07 Cary Coutant <ccoutant@google.com>
4694 * archive.cc (include_member): Destroy Read_symbols_data object before
4696 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4697 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4698 (Read_symbols_data::~Read_symbols_data) New destructor.
4699 (Section_relocs::Section_relocs) New constructor.
4700 (Section_relocs::~Section_relocs) New destructor.
4701 (Read_relocs_data::Read_relocs_data) New constructor.
4702 (Read_relocs_data::~Read_relocs_data) New destructor.
4703 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4704 pointers to NULL after deleting.
4706 2010-04-07 Doug Kwan <dougkwan@google.com>
4708 * arm.cc: Replace "endianity" with "endianness" in comments.
4709 (Arm_exidx_cantunwind): Ditto.
4710 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4711 (Arm_relobj::merge_flags_and_attributes): New method.
4712 (Arm_relobj::merge_flags_and_attributes_): New data member.
4713 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4714 (Arm_relobj::scan_sections_for_stubs): Ditto.
4715 (Arm_relobj::do_read_symbols): Check to see if we really want to
4716 merge processor-specific flags and attributes. Exit early if
4717 an object is empty except for section names and the undefined symbol.
4718 (Target_arm::do_finalize_sections): Move check for ELF format to
4719 Arm_relobj::do_read_symbols. Merge processor specific flags and
4720 attributes from a regular object only when we have determined that
4721 it is aapropriate. Do not create an .ARM.attributes section in
4722 output if there is no regular input object.
4723 (Target_arm::merge_processor_specific_flags): Check
4724 --warn-mismatch before printing any error.
4725 (Target_arm::merge_object_attributes): Ditto.
4726 * gold.cc (queue_middle_tasks): Handle the case in which there is
4727 no regular object in input.
4728 * options.cc (General_options::parse_EB): New method.
4729 (General_options::parse_EL): Same.
4730 (General_options::General_options): Initialize endianness_.
4731 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4733 (General_options::Endianness): New enum.
4734 (General_options::endianness): New method.
4735 (General_options::endianness_): New data member.
4736 * parameters.cc (Parameters::set_options): Check target endianness.
4737 (Parameters::set_target_once): Ditto.
4738 (Parameters::check_target_endianness): New method.
4739 (parameters_force_valid_target): If either -EL or -EB is specified,
4740 use it to define endianness of default target.
4741 * parameters.h (Parameters::check_target_endianness): New method
4743 * target.h (class Target): Change "endianity" to "endianness"
4746 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4748 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4749 * configure: Regenerate.
4750 * Makefile.in: Regenerate.
4751 * testsuite/Makefile.in: Regenerate.
4753 2010-04-06 Cary Coutant <ccoutant@google.com>
4756 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4757 prevailing definitions of common symbols.
4758 * testsuite/plugin_test_6.sh: New test case.
4759 * testsuite/plugin_common_test_1.c: New test case.
4760 * testsuite/plugin_common_test_2.c: New test case.
4761 * testsuite/Makefile.am (plugin_test_6): New test case.
4762 * testsuite/Makefile.in: Regenerate.
4764 2010-04-06 Nick Clifton <nickc@redhat.com>
4766 * po/vi.po: New Vietnamese translation.
4768 2010-03-30 Doug Kwan <dougkwan@google.com>
4770 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4772 2010-03-25 Doug Kwan <dougkwan@google.com>
4774 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4775 to avoid a conversion warning on a 32-bit host.
4777 2010-03-24 Ian Lance Taylor <iant@google.com>
4779 * testsuite/script_test_3.t: Add a TLS segment.
4780 * testsuite/Makefile.am (check_PROGRAMS): Add
4781 tls_phdrs_script_test.
4782 (tls_phdrs_script_test_SOURCES): Define.
4783 (tls_phdrs_script_test_DEPENDENCIES): Define.
4784 (tls_phdrs_script_test_LDFLAGS): Define.
4785 (tls_phdrs_script_test_LDADD): Define.
4786 * testsuite/Makefile.in: Rebuild.
4788 2010-03-23 Cary Coutant <ccoutant@google.com>
4790 * fileread.cc (find_or_make_view): Fix comment.
4792 2010-03-23 Ian Lance Taylor <iant@google.com>
4794 * script-sections.cc (class Orphan_section_placement): Define
4795 PLACE_TLS and PLACE_TLS_BSS.
4796 (Orphan_section_placement::Orphan_section_placement): Initialize
4798 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4799 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4800 (tls_script_test_SOURCES): Define.
4801 (tls_script_test_DEPENDENCIES): Define.
4802 (tls_script_test_LDFLAGS): Define.
4803 (tls_script_test_LDADD): Define.
4804 * testsuite/Makefile.in: Rebuild.
4806 2010-03-22 Doug Kwan <dougkwan@google.com>
4808 * arm.cc (Arm_relocate_functions::abs8,
4809 Arm_relocate_functions::abs16): Use correct check for overflow
4810 specified in the ARM ELF specs.
4811 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4812 target of a BLX instruction specially.
4813 (Reloc_stub::stub_type_for_reloc): Ditto.
4814 (Relocate::relocate): Use symbolic names instead of numeric relocation
4815 codes to report error.
4816 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4818 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4819 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4820 thumb2_blx_out_of_range.stdout
4821 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4822 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4823 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4824 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4825 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4826 thumb2_blx_in_range, thumb2_blx_in_range.o,
4827 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4828 thumb2_blx_out_of_range.o): New rules.
4829 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4830 thumb2_blx_in_range and thumb2_blx_out_of_range.
4831 * testsuite/Makefile.in: Regenerate.
4832 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4833 * testsuite/thumb_blx_in_range.s: New file.
4834 * testsuite/thumb_blx_out_of_range.s: New file.
4836 2010-03-22 Rafael Espindola <espindola@google.com>
4838 * archive.cc (Should_include): Move to archive.h.
4839 (should_include_member): Make it a member of Archive.
4841 (Add_lib_group_symbols): New.
4842 * archive.h: Include options.h.
4843 (Archive_member): Moved from Archive.
4844 (Should_include): Moved from archive.cc.
4846 (Add_lib_group_symbols): New.
4847 * dynobj.cc (do_should_include_member): New.
4848 * dynobj.h (do_should_include_member): New.
4849 * gold.cc (queue_initial_tasks): Update call to queue.
4850 * main.cc (main): Print lib group stats.
4851 * object.cc (do_should_include_member): New.
4852 * object.h: Include archive.h.
4853 (Object::should_include_member): New.
4854 (Object::do_should_include_member): New.
4855 (Sized_relobj::do_should_include_member): New.
4856 * options.cc (General_options::parse_start_lib): New.
4857 (General_options::parse_end_lib): New.
4858 (Input_arguments::add_file): Handle lib groups.
4859 (Input_arguments::start_group): Check we are not in a lib.
4860 (Input_arguments::start_lib): New.
4861 (Input_arguments::end_lib): New.
4862 * options.h (General_options): Add start_lib and end_lib.
4863 (Input_argument::lib_): New.
4864 (Input_argument::lib): New.
4865 (Input_argument::is_lib): New.
4866 (Input_file_lib): New.
4867 (Input_arguments::in_lib_): New.
4868 (Input_arguments::in_lib): New.
4869 (Input_arguments::start_lib): New.
4870 (Input_arguments::end_lib_): New.
4871 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4872 in unused members as preempted.
4873 (Sized_pluginobj::do_should_include_member): New.
4874 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4875 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4877 (Read_symbols::do_whole_lib_group): New.
4878 (Read_symbols::do_lib_group): New.
4879 (Read_symbols::do_read_symbols): Handle lib groups.
4880 (Read_symbols::get_name): Handle lib groups.
4881 * readsyms.h (Read_symbols): Add an archive member pointer.
4882 (Read_symbols::do_whole_lib_group): New.
4883 (Read_symbols::do_lib_group): New.
4884 (Read_symbols::member_): New.
4885 * script.cc (read_input_script): Update call to queue_soon.
4887 2010-03-19 Doug Kwan <dougkwan@google.com>
4889 * arm.cc (Stub_table::Stub_table): Initialize new data members
4890 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4891 (Stub_table::add_reloc_stub): Assign stub offset and update
4892 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4893 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4895 (Stub_table::update_data_size_and_addralign): Use
4896 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4897 instead of going over all reloc stubs.
4898 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4899 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4900 Stringpool_template::offset_ to size of Stringpool_char.
4901 (Stringpool_template::new_key_offset): Remove code to initialize
4902 Stringpool_template::offset_.
4903 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4904 Stringpool_template::offset_ to zero.
4906 2010-03-15 Doug Kwan <dougkwan@google.com>
4908 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4910 (Stringpool_template::new_key_offset): New method.
4911 (Stringpool_template::add_string): Assign offsets when adding new
4913 (Stringpool_template::set_string_offsets): Do not set string offsets
4914 when not optimizing.
4915 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4917 (Chunked_vector::clear): Clear size_.
4918 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4919 (Chunked_vector::size): Return size_.
4920 (Chunked_vector::push_back): Use size_ to find insert position.
4921 (Chunked_vector::size_): New data member.
4922 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4923 (Stringpool_template::new_key_offset): New method declaration.
4924 (Stringpool_template::offset_): New data member.
4926 2010-03-15 Rafael Espindola <espindola@google.com>
4928 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4929 Add_symbols' constructor.
4930 * readsyms.h (Add_symbols): Remove the input_group member.
4932 2010-03-10 Ian Lance Taylor <iant@google.com>
4934 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4935 target to ask whether a reference to a symbol requires a stack
4937 * target.h (Target::is_call_to_non_split): New function.
4938 (Target::do_is_call_to_non_split): Declare virtual function.
4939 * target.cc: Include "symtab.h".
4940 (Target::do_is_call_to_non_split): New function.
4941 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4943 2010-03-10 Cary Coutant <ccoutant@google.com>
4945 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4946 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4947 (File_read::open[2]): Add whole_file_view_ to list of views.
4948 (File_read::make_view): Remove test of whole_file_view_.
4949 (File_read::find_or_make_view): Create whole_file_view_ if
4951 (File_read::clear_views): Replace bool parameter with enum;
4952 adjust all callers. Don't delete views with permanent data;
4953 do delete cached views and views from archives if
4954 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4955 if clearing the corresponding view.
4956 * fileread.h (File_read::Clear_views_mode): New enum.
4957 (File_read::View::is_permanent_view): New method.
4958 (File_read::clear_views): Replace bool parameter
4959 with enum; adjust all callers.
4960 * options.h (General_options): Change keep_files_mapped option;
4961 add map_whole_files.
4962 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4964 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4967 2010-03-10 David S. Miller <davem@davemloft.net>
4969 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4971 2010-03-09 Sriraman Tallam <tmsriram@google.com>
4973 * icf.cc (get_section_contents): Add '@' marker after processing the
4976 2010-03-08 Doug Kwan <dougkwan@google.com>
4978 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4979 due to a conversion warning.
4980 (Arm_relobj::update_output_local_symbol_count): Check for local
4981 symbol with unset output index.
4983 2010-03-05 Ian Lance Taylor <iant@google.com>
4985 * options.h (class General_options): Add --spare-dynamic-tags.
4986 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4987 --spare-dynamic-tags.
4989 2010-03-05 Ian Lance Taylor <iant@google.com>
4991 * incremental.cc: Include "libiberty.h".
4993 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4995 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4996 function, is_info_ member.
4997 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4998 (Versions::Versions): Update caller.
4999 (Versions::define_base_version): Likewise.
5000 (Versions::add_def): Likewise.
5002 2010-03-03 Sriraman Tallam <tmsriram@google.com>
5004 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5005 (Scan::possible_function_pointer_reloc): New function.
5006 (Scan::local_reloc_may_be_function_pointer): Change to call
5007 possible_function_pointer_reloc.
5008 (Scan::global_reloc_may_be_function_pointer): Ditto.
5009 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5010 relocations in ".data.rel.ro._ZTV" section.
5011 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5012 * testsuite/icf_safe_so_test.cc: Ditto.
5013 * testsuite/icf_safe_test.cc: Ditto.
5014 * testsuite/icf_safe_test.sh: Ditto.
5016 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5017 Ian Lance Taylor <iant@google.com>
5019 * target-reloc.h (relocate_section): Check the symbol table index
5020 for -1U before setting the local symbol index.
5021 (scan_relocatable_relocs): If copying the relocation, record that
5022 the local symbol is required.
5023 * object.h (Symbol_value::is_output_symtab_index_set): New
5025 (Symbol_value::may_be_discarded_from_output_symtab): New
5027 (Symbol_value::has_output_symtab_entry): New function.
5028 (Symbol_value::needs_output_symtab_entry): Remove.
5029 (Symbol_value::output_symtab_index): Make sure the symbol index is
5031 (Symbol_value::set_output_symtab_index): Make sure the symbol
5032 index is not set. Make sure the new index is valid.
5033 (Symbol_value::set_must_have_output_symtab_entry): New function.
5034 (Symbol_value::has_output_dynsym_entry): New function.
5035 (Symbol_value::set_output_dynsym_index): Make sure the new index
5037 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5038 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5039 local symbol if permitted.
5040 (Sized_relobj::do_finalize_local_symbols): Call
5041 is_output_symtab_index_set rather than needs_output_symtab_entry.
5042 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5043 rather than needs_output_symtab_entry. Call
5044 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5045 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5046 is_output_symtab_index_set rather than needs_output_symtab_entry.
5047 * testsuite/discard_locals_relocatable_test.c: New file.
5048 * testsuite/discard_locals_test.sh: Test -r.
5049 * testsuite/Makefile.am (check_DATA): Add
5050 discard_locals_relocatable_test1.syms,
5051 discard_local_relocatable_test2.syms.
5052 (MOSTLYCLEANFILES): Likewise. Also add
5053 discard_locals_relocatable_test1.lout and
5054 discard_locals_relocatable_test2.out.
5055 (discard_locals_relocatable_test1.syms): New target.
5056 (discard_locals_relocatable_test.o): New target.
5057 (discard_locals_relocatable_test1.out): New target.
5058 (discard_locals_relocatable_test2.syms): New target.
5059 (discard_locals_relocatable_test2.out): New target.
5060 (various): Add missing ../ld-new dependencies.
5061 * testsuite/Makefile.in: Rebuild.
5063 2010-03-03 Nick Clifton <nickc@redhat.com>
5065 * po/fi.po: New Finnish translation.
5067 2010-03-01 Doug Kwan <dougkwan@google.com>
5069 * layout.cc (Layout::Layout): Force section types of .init_array*,
5070 .preinit_array* and .fini_array* sections.
5071 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5072 Fix check of return value of std::string::find.().
5073 (Output_section::Input_section_sort_compare::operator()): Remove
5074 comment about .init_array.
5075 (Output_section::Input_section_sort_init_fini_compare::operator()):
5077 (Output_section::sort_attached_input_sections): Handle .init_array
5078 and .fini_array specially.
5079 * output.h (Output_section::Inut_section_sort_compare): Update
5081 (Output_section::Input_section_sort_init_fini_compare): New struct.
5083 2010-02-26 Doug Kwan <dougkwan@google.com>
5085 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5086 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5087 * testsuite/debug_msg.sh: Avoid matching source line number for
5088 use of global variable undef_int.
5090 2010-02-26 Doug Kwan <dougkwan@google.com>
5092 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5093 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5094 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5095 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5096 * options.cc (General_options::General_options): Initialize member
5098 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5099 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5100 and rm_no_fix_v4bx.stdout
5101 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5102 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5103 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5104 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5105 and arm_no_fix_v4bx.
5106 * Makefile.in: Regenerate.
5107 * testsuite/arm_fix_v4bx.s: New file.
5108 * testsuite/arm_fix_v4bx.sh: Ditto.
5110 2010-02-24 Doug Kwan <dougkwan@google.com>
5112 * arm.cc (Target_arm::got_section): Make the .got section the first
5113 non RELRO section in the data segment.
5114 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5115 suffixes of section names.
5117 2010-02-24 Doug Kwan <dougkwan@google.com>
5119 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5120 flags and attributes merging if an input file is a binary file.
5121 * fileread.cc (Input_file::open): Record format of original file.
5122 * fileread.h (Input_file::Format): New enum type.
5123 (Input_file::Input_file): Initialize data member format_.
5124 (Input_file::format): New method definition.
5125 (Input_file::format_):: New data member.
5127 2010-02-24 Doug Kwan <dougkwan@google.com>
5129 * arm.cc (Arm_output_data_got): New class.
5130 (ARM_TCB_SIZE): New constant
5131 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5132 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5133 If user uses a script with a SECTIONS clause, issue only a warning
5134 for a misplaced EXIDX input section. Otherwise, issue an error.
5135 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5137 (Target_arm::got_mode_index_entry): Handle static linking.
5138 (Target_arm::Scan::local): Ditto.
5139 (Target_arm::Scan::global): Ditto.
5140 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5141 all incorrectly implemented relocations.
5142 (Target_arm::fix_exidx_coverage): Pass layout to
5143 Arm_output_section::fix_exidx_coverage.
5144 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5145 from ".ARM.exidx." and ".ARM.extab.".
5147 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5149 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5150 section if it does not already exist.
5151 * attributes.cc (Attributes_section_data::Attributes_section_data):
5152 Don't crash if size is zero.
5154 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5155 Ian Lance Taylor <iant@google.com>
5157 * gold.cc (queue_middle_tasks): If no input files were opened,
5159 * workqueue.h (Task_function::Task_function): Assert that there is
5162 2010-02-22 Doug Kwan <dougkwan@google.com>
5164 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5165 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5166 types to avoid warnings due to different uint64_t implementations
5169 2010-02-21 Doug Kwan <dougkwan@google.com>
5171 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5172 handling of the maximum backward branch offset.
5173 (Arm_relocate_functions::thumb_branch_common): Ditto.
5174 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5175 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
5176 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
5177 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5178 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5179 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5180 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5181 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5182 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5183 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5184 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5185 thumb2_bl_out_of_range.o): New rules.
5186 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5187 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5188 thumb2_bl_out_of_range
5189 * testsuite/Makefile.in: Regenerate.
5190 * testsuite/arm_bl_in_range.s: New file.
5191 * testsuite/arm_bl_out_of_range.s: Ditto.
5192 * testsuite/arm_branch_in_range.sh: Ditto.
5193 * testsuite/arm_branch_range.t: Ditto.
5194 * testsuite/thumb2_branch_range.t: Ditto.
5195 * testsuite/thumb_bl_in_range.s: Ditto.
5196 * testsuite/thumb_bl_out_of_range.s: Ditto.
5197 * testsuite/thumb_branch_range.t: Ditto.
5199 2010-02-20 Sriraman Tallam <tmsriram@google.com>
5201 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5202 Add reloc offset information.
5203 * icf.cc (get_section_contents): Change iterators to point to the new
5204 vectors. Add reloc offset information to the contents.
5205 * icf.h (Icf::Sections_reachable_info): New typedef.
5206 (Icf::Sections_reachable_list): New typedef.
5207 (Icf::Offset_info): New typedef.
5208 (Icf::Reloc_info): New struct typedef.
5209 (Icf::Reloc_info_list): New typedef.
5210 (Icf::symbol_reloc_list): Delete method.
5211 (Icf::addend_reloc_list): Delete method.
5212 (Icf::section_reloc_list): Delete method.
5213 (Icf::reloc_info_list): New method.
5214 (Icf::reloc_info_list_): New member.
5216 2010-02-19 Doug Kwan <dougkwan@google.com>
5218 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5219 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5220 * arm.cc (Arm_relocation_functions): New forward declaration.
5221 (Target_arm::Target_arm): Initialize new data members
5222 got_mod_index_offset_ and tls_base_symbol_defined_.
5223 (Target_arm::Relocate::relocate_tls): New method.
5224 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5225 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5227 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5228 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5229 (Target_arm::got_mod_index_offset_,
5230 Target_arm::tls_base_symbol_defined_): New data members.
5231 (Target_arm::Scan::local, Target::Scan::global,
5232 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5235 2010-02-18 Doug Kwan <dougkwan@google.com>
5237 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5238 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5239 text section as a parameter becuase some broken tools may not set
5240 the link in section header.
5241 (Target_arm::has_got_section): New method.
5242 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5243 without any mapping symbol as data only. Remove warning.
5244 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5245 link in its section header, try to discover the link by inspecting the
5246 REL31 relocation at the beginning of the section.
5247 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5249 (Target_arm::Scan::global): Treat any reference to the symbol
5250 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5252 2010-02-12 Sriraman Tallam <tmsriram@google.com>
5254 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5255 (Scan::global_reloc_may_be_function_pointer): New function.
5256 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5257 (Scan::global_reloc_may_be_function_pointer): New function.
5258 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5259 (Scan::global_reloc_may_be_function_pointer): New function.
5260 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5261 (Scan::global_reloc_may_be_function_pointer): New function.
5262 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5263 (Scan::global_reloc_may_be_function_pointer): New function.
5264 (Scan::possible_function_pointer_reloc): New function.
5265 (Target_x86_64::can_check_for_function_pointers): New function.
5266 * gc.h (gc_process_relocs): Scan relocation types to determine if
5267 function pointers were taken for targets that support it.
5268 * icf.cc (Icf::find_identical_sections): Include functions for
5269 folding in safe ICF whose pointer is not taken.
5270 * icf.h (Secn_fptr_taken_set): New typedef.
5271 (fptr_section_id_): New member.
5272 (section_has_function_pointers): New function.
5273 (set_section_has_function_pointers): New function.
5274 (check_section_for_function_pointers): New function.
5275 * options.h: Fix comment for safe ICF option.
5276 * target.h (can_check_for_function_pointers): New function.
5277 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5278 Modify icf_safe_test for X86-64.
5279 * testsuite/Makefile.in: Regenerate.
5280 * testsuite/icf_safe_so_test.cc: New file.
5281 * testsuite/icf_safe_so_test.sh: New file.
5282 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5283 (main): Change to take pointer to function kept_func_3.
5284 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5285 folding is done correctly for X86-64.
5287 2010-02-12 David S. Miller <davem@davemloft.net>
5289 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5290 is_symbolless parameter.
5291 (Output_reloc<SHT_REL>::is_symbolless): New.
5292 (Output_reloc<SHT_REL>::is_symbolless_): New.
5293 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5294 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5295 (Output_reloc<SHT_RELA>::is_symbolless): New.
5296 (Output_data_reloc::add_global): Handle is_symbolless.
5297 (Output_data_reloc::add_global_relative): Likewise.
5298 (Output_data_reloc::add_local): Likewise.
5299 (Output_data_reloc::add_local_relative): Likewise.
5300 (Output_data_reloc::add_symbolless_global_addend): New.
5301 (Output_data_reloc::add_symbolless_local_addend): New.
5302 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5304 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5305 instead of ->is_relative_
5306 (Output_reloc::write): Likewise.
5307 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5308 (Output_reloc::write_rel): Simplify.
5310 * sparc.cc (Target_sparc::Scan::local): Use
5311 ->add_symbolless_local_addend as needed.
5312 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5313 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5314 based upon relocation offset.
5316 2010-02-11 Doug Kwan <dougkwan@google.com>
5318 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5319 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5320 beginning of function.
5321 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5322 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5323 parameter is_32bit in calls to should_apply_static_reloc.
5324 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5325 (check_DATA): Add arm_abs_global.stdout.
5326 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5327 arm_abs_global.stdout): New rules.
5328 (MOSTLLYCLEANFILES): Add arm_abs_global
5329 * Makefile.in: Regenerate.
5330 * testsuite/arm_abs_global.s: New file.
5331 * testsuite/arm_abs_global.sh: Ditto.
5332 * testsuite/arm_abs_lib.s: Ditto.
5334 2010-02-11 Ian Lance Taylor <iant@google.com>
5336 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5338 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5339 Allocate_commons_task first.
5340 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5341 task, rather than symtab_lock_.
5342 (Gc_process_relocs::~Gc_process_relocs): New function.
5343 (Gc_process_relocs::is_runnable): Check this_blocker_.
5344 (Gc_process_relocs::locks): Use next_blocker_ rather than
5346 (Scan_relocs::~Scan_relocs): New function.
5347 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5349 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5351 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5352 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5353 constructor accordingly.
5354 (class Gc_process_relocs): Likewise.
5355 (class Scan_relocs): Likewise.
5356 * common.h (class Allocate_commons_task): Remove symtab_lock_
5357 field, and corresponding constructor parameter.
5358 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5360 (Allocate_commons_task::locks): Likewise.
5362 2010-02-11 Ian Lance Taylor <iant@google.com>
5364 * gold-threads.h (class Once): Define.
5365 (class Initialize_lock): Rewrite as child of Once.
5366 * gold-threads.cc (class Once_initialize): Define.
5367 (once_pointer_control): New static variable.
5368 (once_pointer, once_arg): New static variables.
5369 (c_run_once): New static function.
5370 (Once::Once, Once::run_once, Once::internal_run): New functions.
5371 (class Initialize_lock_once): Remove.
5372 (initialize_lock_control): Remove.
5373 (initialize_lock_pointer): Remove.
5374 (initialize_lock_once): Remove.
5375 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5376 (Initialize_lock::initialize): Rewrite.
5377 (Initialize_lock::do_run_once): New function.
5378 * archive.cc (Archive::interpret_header): Only clear name if it is
5380 * fileread.cc: Include "gold-threads.h"
5381 (file_counts_lock): New static variable.
5382 (file_counts_initialize_lock): Likewise.
5383 (File_read::release): Only increment counts when using --stats.
5384 Use a lock around the increment.
5385 * parameters.cc (class Set_parameters_target_once): Define.
5386 (set_parameters_target_once): New static variable.
5387 (Parameters::Parameters): Move here from parameters.h.
5388 (Parameters::set_target): Rewrite.
5389 (Parameters::set_target_once): New function.
5390 (Parameters::clear_target): Move here and rewrite.
5391 * parameters.h (class Parameters): Update declarations. Add
5392 set_parameters_target_once_ field.
5393 (Parameters::Parameters): Move to parameters.cc.
5394 (Parameters::clear_target): Likewise.
5395 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5397 (Start_group::~Start_group): New function.
5398 (Start_group::is_runnable): New function.
5399 (Start_group::locks, Start_group::run): New functions.
5400 (Finish_group::run): Change saw_undefined to size_t.
5401 * readsyms.h (class Start_group): Define.
5402 (class Finish_group): Change saw_undefined_ field to size_t.
5403 (Finish_group::Finish_group): Remove saw_undefined and
5404 this_blocker parameters. Change all callers.
5405 (Finish_group::set_saw_undefined): New function.
5406 (Finish_group::set_blocker): New function.
5407 * symtab.h (class Symbol_table): Change saw_undefined to return
5408 size_t. Change saw_undefined_ field to size_t.
5409 * target-select.cc (Set_target_once::do_run_once): New function.
5410 (Target_selector::Target_selector): Initialize set_target_once_
5411 field. Don't initialize lock_ and initialize_lock_ fields.
5412 (Target_selector::instantiate_target): Rewrite.
5413 (Target_selector::set_target): New function.
5414 * target-select.h (class Set_target_once): Define.
5415 (class Target_selector): Update declarations. Make
5416 Set_target_once a friend. Remove lock_ and initialize_lock_
5417 fields. Add set_target_once_ field.
5419 2010-02-10 Ian Lance Taylor <iant@google.com>
5421 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5423 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5424 (queue_middle_tasks): Add all blockers before queueing any tasks.
5425 (queue_final_tasks): Likewise.
5426 * token.h (Task_token::add_blockers): New function.
5427 * object.h (Input_objects::number_of_relobjs): New function.
5429 2010-02-10 Ian Lance Taylor <iant@google.com>
5431 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5432 shared, not if not position independent.
5433 * x86_64.cc (Relocate::relocate_tls): Likewise.
5434 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5435 (tls_pie_pic_test): New target.
5436 * testsuite/Makefile.in: Rebuild.
5438 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5439 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5440 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5441 * testsuite/Makefile.in: Rebuild.
5443 2010-02-09 David S. Miller <davem@davemloft.net>
5445 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5446 R_SPARC_RELATIVE using ->add_local_relative().
5447 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5449 * output.h (Output_data_dynamic::add_section_size): New method
5450 that takes two Output_data objects.
5451 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5452 entry param. Handle it in initializers.
5453 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5454 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5455 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5457 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5458 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5459 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5460 for dynrel_includes_plt.
5461 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5462 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5463 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5465 (Target_sparc::do_finalize_sections): Update to pass true for
5466 dynrel_includes_plt.
5467 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5468 output before .rela.plt
5469 (Target_powerpc::do_finalize_sections): Update to pass true for
5470 dynrel_includes_plt when 32-bit.
5472 2010-02-08 Doug Kwan <dougkwan@google.com>
5474 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5476 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5477 Arm_relobj::scan_section_for_cortex_a8_stubs,
5478 Arm_relobj::do_relocation_section): Instead of calling
5479 Output_section::output_address, use faster
5480 Arm_relobj::simple_input_section_output_address.
5482 2010-02-08 David S. Miller <davem@davemloft.net>
5484 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5485 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5486 relocation helper function.
5488 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5489 just like R_SPARC_GOT{10,13,22}.
5490 (Target_sparc::Scan::local): Likewise.
5491 (Target_sparc::Relocate:relocate): Likewise.
5493 2010-02-06 Ian Lance Taylor <iant@google.com>
5495 * configure.ac: Rewrite targetobjs duplicate removal code to use
5496 only shell constructs.
5497 * configure: Rebuild.
5499 2010-02-05 Doug Kwan <dougkwan@google.com>
5502 * arm.cc (Arm_relobj::section_is_scannable): New method.
5503 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5504 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5506 2010-02-04 Doug Kwan <dougkwan@google.com>
5509 * arm-reloc-property.cc (cstdio): Include.
5510 * configure.ac (targetobjs): Remove duplicates.
5511 * configure: Regenerate.
5512 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5513 big and little endian version for a given address size.
5515 2010-02-03 Doug Kwan <dougkwan@google.com>
5517 * arm-reloc-property.cc
5518 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5520 * arm-reloc-property.h
5521 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5522 New method definition.
5523 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5525 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5527 (GOT_PREL): Change implemented to Y.
5528 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5529 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5530 (Arm_relocate_functions::movw_abs_nc): Remove method.
5531 (Arm_relocate_functions::movt_abs): Ditto.
5532 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5533 (Arm_relocate_functions::thm_movt_abs): Ditto.
5534 (Arm_relocate_functions::movw_rel_nc): Ditto.
5535 (Arm_relocate_functions::movw_rel): Ditto.
5536 (Arm_relocate_functions::movt_rel): Ditto.
5537 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5538 (Arm_relocate_functions:thm_movw_rel): Ditto.
5539 (Arm_relocate_functions:thm_movt_rel): Ditto.
5540 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5541 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5542 New method definitions.
5543 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5544 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5545 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5546 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5547 (Target_arm::Relocate::relocate): Check for non-static or
5548 unimplemented relocation code and exit early. Change calls to
5549 Target_arm::reloc_uses_thumb_bit and
5550 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5551 instead. Refactor code to handle similar relocations to increase
5552 code sharing. Remove check for unsupported relocation code in switch
5554 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5555 relocation property table to find out size. Change error message to
5556 print out the name of a relocation code instead of the numeric value.
5557 (Target_arm::scan_reloc_for_stub): Use relocation property table
5558 instead of calling Target_arm::reloc_uses_thumb_bit().
5560 2010-02-02 Doug Kwan <dougkwan@google.com>
5562 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5563 types of relaxed input section.
5565 2010-02-02 Doug Kwan <dougkwan@google.com>
5567 * Makefile.am (HFILES): Add arm-reloc-property.h.
5569 (TARGETSOURCES): Add arm-reloc-property.cc
5570 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5571 (libgold_a_SOURCES): $(DEFFILES)
5572 * Makefile.in: Regenerate.
5573 * arm-reloc-property.cc: New file.
5574 * arm-reloc-property.h: New file.
5575 * arm-reloc.def: New file.
5576 * arm.cc: Update comments.
5577 (arm-reloc-property.h): New included header.
5578 (arm_reloc_property_table): New global variable.
5579 (Target_arm::do_select_as_default_target): New method definition.
5580 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5581 arm-reloc-property to targ_extra_obj.
5582 * parameters.cc (set_parameters_target): Call
5583 Target::select_as_default_target().
5584 * target.h (Target::select_as_default_target): New method definition.
5585 (Target::do_select_as_default_target): Same.
5587 2010-02-01 Doug Kwan <dougkwan@google.com>
5589 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5590 first_output_text_section_.
5591 (Arm_exidx_fixup::first_output_text_section): New method definition.
5592 (Arm_exidx_fixup::first_output_text_section_): New data member.
5593 (Arm_exidx_fixup::process_exidx_section): Record the first text
5594 output section seen.
5595 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5596 and entsize in output section header.
5598 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5600 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5601 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5602 (Arm_relocate_functions::thm_alu11): New Method.
5603 (Arm_relocate_functions::thm_pc8): New Method.
5604 (Arm_relocate_functions::thm_pc12): New Method.
5605 (Target_arm::Scan::local): Handle the relocations.
5606 (Target_arm::Scan::global): Likewise.
5607 (Target_arm::Relocate::relocate): Likewise.
5608 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5610 2010-01-29 Doug Kwan <dougkwan@google.com>
5612 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5613 of relocation types as ld.
5615 2010-01-29 Doug Kwan <dougkwan@google.com>
5617 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5619 (Arm_relocate_functions::thumb_branch_common): Ditto.
5620 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5621 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5622 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5623 Arm_relocate_functions::jump24): Remove.
5624 (Target_arm::Relocate::relocate): Adjust code to call
5625 Arm_relocation_functions::arm_branch_common and
5626 Arm_relocation_functions::thumb_branch_common instead of their removed
5627 wrappers. Merge switch-cases together to reduce source code size.
5629 2010-01-29 Doug Kwan <dougkwan@google.com>
5631 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5632 output_local_symbol_count_needs_update_.
5633 (Arm_relobj::output_local_symbol_count_needs_update,
5634 Arm_relobj::set_output_local_symbol_count_needs_update,
5635 Arm_relobj::update_output_local_symbol_count): New methods.
5636 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5638 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5639 of pointed function as in a R_ARM_PREL31 relocation.
5640 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5641 for output local symbol count updating.
5642 (Target_arm::do_relax): Update output local symbol counts in objects
5644 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5646 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5648 * arm.cc: Added support for the ARM relocations:
5649 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5650 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5651 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5653 (Arm_relocate_functions::movw_rel): New method.
5654 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5655 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5657 (Arm_relocate_functions::thm_movw_rel): New method.
5658 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5660 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5662 (Target_arm::Scan::global): Likewise.
5663 (Target_arm::Relocate::relocate): Likewise.
5664 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5667 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5669 * arm.cc: Added support for ARM group relocations.
5670 (Target_arm::reloc_needs_sym_origin): New method.
5671 (Arm_relocate_functions::calc_grp_kn): New method.
5672 (Arm_relocate_functions::calc_grp_residual): New method.
5673 (Arm_relocate_functions::calc_grp_gn): New method.
5674 (Arm_relocate_functions::arm_grp_alu): New Method.
5675 (Arm_relocate_functions::arm_grp_ldr): New Method.
5676 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5677 (Arm_relocate_functions::arm_grp_ldc): New Method.
5678 (Target_arm::Scan::local): Handle the ARM group relocations.
5679 (Target_arm::Scan::global): Likewise.
5680 (Target_arm::Relocate::relocate): Likewise.
5681 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5684 2010-01-26 Doug Kwan <dougkwan@google.com>
5686 * arm.cc (set): Include.
5687 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5689 (Arm_output_section::Text_section_list): New type.
5690 (Arm_output_section::append_text_sections_to_list): New method.
5691 (Arm_output_section::fix_exidx_coverage): Ditto.
5692 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5693 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5694 Relobj::set_section_offset() instead of
5695 Sized_relobj::invalidate_section_offset().
5696 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5697 parameter for section headers. Ignore relocation sections for
5698 unallocated sections and EXIDX sections.
5699 (Target_arm::fix_exidx_coverage): New method.
5700 (Target_arm::output_section_address_less_than): New type.
5701 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5702 linked text section instead of the EXIDX section.
5703 (Arm_output_section::create_stub_group): Add an assertion to check
5704 that this is not an EXIDX output section.
5705 (Arm_output_section::append_text_sections_to_list): New method.
5706 (Arm_output_section::fix_exidx_coverage): Ditto.
5707 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5708 Arm_relobj::section_needs_reloc_stub_scanning.
5709 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5711 (Target_arm::fix_exidx_coverage): New method.
5712 * object.h (Relobj::set_output_section): New method.
5713 (Sized_relobj::invalidate_section_offset): Remove method.
5714 (Sized_relobj::do_invalidate_section_offset): Remove method.
5715 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5717 2010-01-25 Doug Kwan <dougkwan@google.com>
5719 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5720 Fix warning due to signed and unsigned comparison on a 32-bit host.
5722 2010-01-22 Doug Kwan <dougkwan@google.com>
5724 * arm.cc (Target_arm::do_relax): Record an output section for section
5725 offset adjustment it contains any stub table that has changed.
5726 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5727 offsets in an output section if necessary.
5728 * output.cc (Output_section::Output_section): Initialize
5729 section_offsets_need_adjustments_.
5730 (Output_section::add_input_section_for_script): Renamed to
5731 Output_section::add_simple_input_section.
5732 (Output_section::save_states): Add a comment.
5733 (Output_section::discard_states): New method defintion.
5734 (Output_section::adjust_section_offsets): Same.
5735 * output.h (Output_section::add_input_section_for_script): Renamed to
5736 Output_section::add_simple_input_section.
5737 (Output_section::discard_states): New method declaration.
5738 (Output_section::adjust_section_offsets): Same.
5739 (Output_section::section_offsets_need_adjustment,
5740 Output_section::set_section_offsets_need_adjustment): New method
5742 (Output_section::section_offsets_need_adjustment_): New data member.
5743 * script-sections.cc
5744 (Output_section_element_input::set_section_address): Adjust code for
5745 renaming of Output_section::add_input_section_for_script.
5746 (Orphan_output_section::set_section_address): Same.
5748 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5750 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5751 Fix_v4bx enum values .
5752 * gold/options.h (General_options): New option definitions.
5753 (General_options::fix_v4bx): New method.
5754 (General_options::Fix_v4bx): New enum.
5755 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5756 (General_options::parse_fix_v4bx_interworking): New method.
5758 2010-01-22 Doug Kwan <dougkwan@google.com>
5760 * arm.cc (Arm_exidx_fixup): New class.
5762 2010-01-21 Doug Kwan <dougkwan@google.com>
5764 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5766 (Arm_exidx_section_offset_map): New type.
5768 2010-01-21 Doug Kwan <dougkwan@google.com>
5770 * arm.cc (Arm_exidx_input_section): New class.
5771 (Arm_relobj::exidx_input_section_by_link,
5772 Arm_relobj::exidx_input_section_by_shndx,
5773 Arm_relobj::make_exidx_input_section): New methods.
5774 (read_arm_attributes_section): Remove.
5775 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5776 information about them.
5777 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5780 2010-01-20 Doug Kwan <dougkwan@google.com>
5782 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5783 Input_section_specifier to Section_id.
5784 (Target_arm::new_arm_input_section: Adjust code for change of key
5786 (Target_arm::find_arm_input_section): Ditto.
5787 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5788 (Section_id): Remove.
5789 (Garbage_collection::Section_id_hash): Remove.
5790 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5791 (Section_id): Remove.
5792 (Icf::Section_id_hash): Remove.
5793 * object.h (Section_id, Const_section_id, Section_id_hash,
5794 Const_section_id_hash): New type definitions.
5795 * output.cc (Output_section::add_relaxed_input_section): Change to
5796 use Const_section_id instead of Input_section_specifier as key type.
5797 (Output_section::add_merge_input_section): Ditto.
5798 (Output_section::build_relaxation_map): Change to use Section_id
5799 instead of Input_section_specifier as key type.
5800 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5802 (Output_section::convert_input_sections_to_relaxed_sections): Change
5803 to use Const_section_id instead of Input_section_specifier as key type.
5804 (Output_section::find_merge_section): Ditto.
5805 (Output_section::find_relaxed_input_section): Ditto.
5806 * output.h (Input_section_specifier): Remove class.
5807 (Output_section::Output_section_data_by_input_section_map): Change
5808 key type to Const_section_id.
5809 (Output_section::Output_relaxed_input_section_by_input_section_map):
5811 (Output_section::Relaxation_map): Change key type to Section_id.
5813 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5815 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5816 (class Arm_v4bx_stub): New class.
5817 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5818 (Stub_factory::make_arm_v4bx_stub): New method.
5819 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5820 (Stub_table::empty): Handle v4bx stubs.
5821 (Stub_table::add_arm_v4bx_stub): New method.
5822 (Stub_table::find_arm_v4bx_stub): New method.
5823 (Arm_relocate_functions::v4bx): New method.
5824 (Target_arm::fix_v4bx): New method.
5825 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5826 (Stub_table::relocate_stubs): Likewise.
5827 (Stub_table::do_write): Likewise.
5828 (Stub_table::update_data_size_and_addralign): Likewise.
5829 (Stub_table::finalize_stubs): Likewise.
5830 (Target_arm::Scan::local): Likewise.
5831 (Target_arm::Scan::global): Likewise.
5832 (Target_arm::do_finalize_sections): Likewise.
5833 (Target_arm::Relocate::relocate): Likewise.
5834 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5836 (Target_arm::scan_reloc_for_stub): Likewise.
5837 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5839 2010-01-19 Ian Lance Taylor <iant@google.com>
5841 * output.cc (Output_section_headers::do_sized_write): Write large
5842 segment count to sh_info field.
5843 (Output_file_header::do_sized_write): For large segment count,
5844 write PN_XNUM to e_phnum field.
5846 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5848 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5849 (Arm_relocate_functions::thm_jump8): New function.
5850 (Arm_relocate_functions::thm_jump11): New function.
5851 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5853 (Target_arm::Scan::global): Likewise.
5854 (Target_arm::Relocate::relocate): Likewise.
5855 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5858 2010-01-14 Doug Kwan <dougkwan@google.com>
5860 * arm.cc (map, utility): Include headers.
5861 (Target_arm::apply_cortex_a8_workaround): New method.
5862 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5863 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5864 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5865 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5866 the --[no-]fix-cortex-a8 command line options.
5867 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5868 (Target_arm::relocate_stub): Use addend in instruction template.
5869 * options.h (DEFINE_bool): Set the user-set flag.
5870 (General_options): Add --[no-]-fix-cortex options.
5871 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
5872 : Update fast look-up map after conversion.
5874 2010-01-14 Sriraman Tallam <tmsriram@google.com>
5876 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5877 in the first pass of do_layout.
5879 2010-01-13 Doug Kwan <dougkwan@google.com>
5881 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5882 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5883 apparent compiler problem of not folding static constant integral
5884 data members of elfcpp::Elf_sizes<32>.
5886 2010-01-13 Doug Kwan <dougkwan@google.com>
5888 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5889 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5890 Arm_relobj::scan_section_for_cortex_a8_erratum,
5891 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5892 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5893 sections to scan for relocation stubs into a new method
5894 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5895 relocation and Cortex-A8 stub scanning.
5896 (Target_arm::do_relax): Force stubs to be after stubbed sections
5897 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
5898 the beginning of a new relaxation pass. Update a comment.
5899 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5901 2010-01-12 Ian Lance Taylor <iant@google.com>
5903 * target-reloc.h (visibility_error): New inline function.
5904 (relocate_section): Call visibility_error.
5905 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5906 (MOSTLYCLEANFILES): Likewise.
5907 (protected_4_pic.o, protected_3.err): New targets.
5908 * testsuite/protected_4.cc: New file.
5910 2010-01-12 Doug Kwan <dougkwan@google.com>
5912 * arm.cc (Cortex_a8_reloc): New class.
5913 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5914 and cortex_a8_relocs_info_.
5915 (Target_arm::fix_cortex_a8): New method definition.
5916 (Target_arm::Cortex_a8_relocs_info): New type.
5917 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5918 New data member declarations.
5919 (Target_arm::scan_reloc_for_stub): Record information about
5920 relocations for THUMB branches that might be exempted from the
5921 Cortex-A8 workaround.
5922 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5923 at the beginning of a relaxation pass.
5925 2010-01-12 Doug Kwan <dougkwan@google.com>
5927 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5928 (Arm_relobj::Mapping_symbol_position,
5929 Arm_reloj::Mapping_symbol_position_less,
5930 Arm_relobj::Mapping_symbols_info): New types.
5931 (Target_arm::is_mapping_symbol_name): New method definition.
5932 (Arm_relobj::do_count_local_symbols): Save information about mapping
5935 2010-01-11 Doug Kwan <dougkwan@google.com>
5937 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5938 Arm_relocate_functions::thumb32_branch_upper,
5939 Arm_relocate_functions::thumb32_branch_lower,
5940 Arm_relocate_functions::thumb32_cond_branch_offset,
5941 Arm_relocate_functions::thumb32_cond_branch_upper,
5942 Arm_relocate_functions::thumb32_cond_branch_lower,
5943 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5944 branch offset encoding.
5945 (Arm_relocate_functions::thumb_branch_common): Use new branch
5946 offset encoding methods to avoid code duplication.
5947 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5948 (Stub_addend_reader::operator()): Use new branch encoding method
5949 to avoid code duplication.
5951 2010-01-11 Doug Kwan <dougkwan@google.com>
5953 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5954 (Target_arm::do_finalize_sections): Define special EXIDX section
5955 symbols only if referenced.
5956 * gc.h (Garbage_collection::add_reference): New method.
5957 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5960 2010-01-11 Ian Lance Taylor <iant@google.com>
5962 * script.cc (Version_script_info::build_expression_list_lookup):
5963 Change complaing about duplicate wildcard match from error to
5966 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5968 (Version_script_info::Version_script_info): Initialize globs_,
5969 default_version_, default_is_global_, and exact_. Don't
5970 initialize globals_ or locals_.
5971 (Version_script_info::build_lookup_tables): Build local symbols
5973 (Version_script_info::unquote): New function.
5974 (Version_script_info::add_exact_match): New function.
5975 (Version_script_info::build_expression_list_lookup): Remove lookup
5976 parameter. Add is_global parameter. Change all callers. Handle
5977 wildcard pattern specially. Unquote pattern. Call
5979 (Version_script_info::get_name_to_match): New function.
5980 (Version_script_info::get_symbol_version): New function.
5981 (Version_script_info::get_symbol_version_helper): Remove.
5982 (Version_script_info::check_unmatched_names): Call unquote.
5983 * script.h (class Version_script_info): Change get_symbol_version
5984 to be non-inline and add is_global parameter; change all callers.
5985 Rewrite symbol_is_local. Update declarations. Define struct
5986 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5987 Remove globals_ and locals_ members. Add exact_, globs_,
5988 default_version_, is_global_.
5989 (Version_script_info::Glob): Remove pattern, add expression and
5990 is_global. Update constructor. Change all callers.
5991 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5993 (Versions::symbol_section_contents): If a symbol is undefined, or
5994 defined in a dynamic object, set the version index to
5996 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5998 (Symbol_table::add_from_pluginobj): Likewise.
5999 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6001 2010-01-11 Doug Kwan <dougkwan@google.com>
6003 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6004 (incremental_dump_LDADD): Add linking option for libintl.
6005 * Makefile.in: Regenerate.
6007 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6010 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6012 * testsuite/Makefile.in: Regenerated.
6014 2010-01-10 Doug Kwan <dougkwan@google.com>
6016 * options.h (DEFINE_var): Use parentheses around argument varname__
6017 in macro body to avoid any unintended subsequent substitutions.
6019 2010-01-10 Ian Lance Taylor <iant@google.com>
6021 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6022 candidates before doing symbol resolution.
6024 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6025 ODR candidates if only one is weak.
6027 2010-01-08 Ian Lance Taylor <iant@google.com>
6029 * script.cc (Version_script_info::build_expression_list_lookup):
6030 Don't warn about ambiguous version, just record the ambiguity.
6031 (Version_script_info::get_symbol_version_helper): Give error if
6032 version is ambiguous.
6034 2010-01-08 Doug Kwan <dougkwan@google.com>
6036 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6037 prev_data_size_ and prev_addralign_. Remove initializer for
6038 deleted data member has_been_changed_.
6039 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6040 to determine if the table is empty.
6041 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6043 (Stub_table::add_reloc_stub): Define method in class definition
6044 instead of just declaring it there.
6045 (Stub_table::add_cortex_a8_stub): New method definition.
6046 (Stub_table::update_data_size_and_addralign): Ditto.
6047 (Stub_table::finalize_stubs): Ditto.
6048 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6049 (Stub_table::do_addralign_): Return address alignment in the
6050 (Stub_table::do_reset_address_and_file_offset): Define method in
6051 class definition instead of declaring it there. Set current data
6052 size to be the data size of the previous pass.
6053 (Stub_table::set_final_data_size): Use current data size as the
6055 (Stub_table::relocate_stub): Change parameter type of stub from
6056 Reloc_stub pointer to Stub pointer.
6057 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6058 (Stub_table::Cortex_a8_stub_list): New typedef.
6059 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6060 Stub_table::prev_addralign_): New data member.
6061 (Arm_relobj::Arm_relobj): Initialize data member
6062 section_has_cortex_a8_workaround_.
6063 (Arm_relobj::section_has_cortex_a8_workaround,
6064 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6066 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6068 (Target_arm::relocate_stub): Change parameter type of stub from
6069 Reloc_stub pointer to Stub pointer.
6070 (Insn_template::size, Insn_template::alignment): Handle
6071 THUMB16_SPECIAL_TYPE.
6072 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6073 Stub_table::update_data_size_and_addralign,
6074 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6076 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6077 (Stub_table::do_write): Ditto.
6078 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6080 2010-01-08 Ian Lance Taylor <iant@google.com>
6083 * symtab.h (class Symbol): Remove fields is_target_special_ and
6084 has_plt_offset_. Add field is_defined_in_discarded_section_.
6085 (Symbol::is_defined_in_discarded_section): New function.
6086 (Symbol::set_is_defined_in_discarded_section): New function.
6087 (Symbol::has_plt_offset): Rewrite.
6088 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6089 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6090 Don't initialize is_target_special_ or has_plt_offset_.
6091 Initialize is_defined_in_discarded_section_.
6092 (Symbol_table::add_from_relobj): If appropriate, set
6093 is_defined_in_discarded_section.
6094 * resolve.cc (Symbol::override_base_with_special): Don't test
6095 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6096 * target-reloc.h (relocate_section): Do special handling for
6097 symbols defined in discarded sections for global symbols as well
6100 2010-01-08 Ian Lance Taylor <iant@google.com>
6102 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6103 the SHT_SYMTAB case.
6105 2010-01-08 Ian Lance Taylor <iant@google.com>
6107 * object.cc (Sized_relobj::do_layout): Don't get confused if
6108 layout_eh_frame returns NULL.
6110 2010-01-08 Ian Lance Taylor <iant@google.com>
6113 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6114 dynamic symbol table, use the normal symbol table.
6115 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6118 2010-01-08 Ian Lance Taylor <iant@google.com>
6121 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6124 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6126 * version.cc (print_version): Change to "Copyright 2010".
6128 2010-01-08 Ian Lance Taylor <iant@google.com>
6132 * i386.cc (class Target_i386): Change return type of plt_section
6134 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6135 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6136 tls_desc_rel_ field.
6137 (Output_data_plt_i386::rel_tls_desc): New function.
6138 (Target_i386::rel_tls_desc_section): New function.
6139 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6140 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6141 R_386_TLS_DESC reloc in rel_tls_desc_section.
6142 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6143 Define struct Tlsdesc_info.
6144 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6145 (Target_x86_64::do_reloc_symbol_index): New function.
6146 (Target_x86_64::add_tlsdesc_info): New function.
6147 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6148 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6150 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6152 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6153 (Target_x86_64::rela_tlsdesc_section): New function.
6154 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6156 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6157 (Target_x86_64::do_reloc_addend): New function.
6158 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6159 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6160 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6161 (Output_reloc::type): New function.
6162 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6163 (Output_reloc::is_target_specific): New function.
6164 (Output_reloc::target_arg): New function.
6165 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6166 absolute relocs and target specific relocs.
6167 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6168 add_target_specific.
6169 (class Output_data_reloc) [SHT_RELA]: Likewise.
6170 * output.cc (Output_reloc::Output_reloc): Add four new versions
6171 for absolute relocs and target specific relocs.
6172 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6173 (Output_reloc::get_symbol_index): Likewise.
6174 (Output_reloc::local_section_offset): Check that local_sym_index_
6175 is not TARGET_CODE or 0.
6176 (Output_reloc::symbol_value): Likewise.
6177 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6179 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6180 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6182 * layout.cc (add_target_dynamic_tags): Use output section for
6183 DT_PLTRELSZ and DT_JMPREL.
6185 2010-01-07 Ian Lance Taylor <iant@google.com>
6188 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6190 (class Output_data_reloc_generic): Define.
6191 (class Output_data_reloc_base): Change base class to
6192 Output_data_reloc_generic. Change add() method to call
6193 bump_relative_reloc_count for a relative reloc. Remove
6195 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6197 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6198 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6200 * layout.h (class Layout): Update declaration.
6202 2010-01-07 Ian Lance Taylor <iant@google.com>
6204 * output.h (class Output_data): Add const version of
6205 output_section and do_output_section.
6206 (class Output_section_data): Add const version of
6208 (class Output_section): Likewise.
6209 * layout.cc (Layout::add_target_dynamic_tags): New function.
6210 * layout.h (class Layout): Update declarations.
6211 * arm.cc (Target_arm::do_finalize_sections): Use
6212 add_target_dynamic_tags.
6213 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6214 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6215 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6216 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6218 2010-01-07 Ian Lance Taylor <iant@google.com>
6221 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6224 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6225 Ian Lance Taylor <iant@google.com>
6228 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6229 Xindex::read_symtab_xindex.
6231 2010-01-07 Doug Kwan <dougkwan@google.com>
6233 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6234 (Insn_template::thumb16_bcond_insn): New method declaration.
6235 (Insn_template): Fix spelling.
6236 (Stub::thumb16_special): New method declaration.
6237 (Stub::do_write): Define virtual method which was previously pure
6239 (Stub::do_thumb16_special): New method declaration.
6240 (Stub::do_fixed_endian_write): New template member.
6241 (Reloc_stub::do_write): Remove.
6242 (Reloc_stub::do_fixed_endian_write): Remove.
6243 (Cortex_a8_stub): New class definition.
6244 (Stub_factory::make_cortex_a8_stub): New method definition.
6245 (Stub_factory::Stub_factory): Add missing static storage class
6246 qualifier for elf32_arm_stub_a8_veneer_blx.
6248 2010-01-07 Ian Lance Taylor <iant@google.com>
6251 * options.h (class General_options): Add --warn-unresolved-symbols
6252 and --error-unresolved-symbols.
6253 * errors.cc (Errors::undefined_symbol): Implement
6254 --warn-unresolved-symbols.
6256 * options.h (class General_options): Add -z text and -z textoff.
6257 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6259 2010-01-06 Sriraman Tallam <tmsriram@google.com>
6261 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6262 (Garbage_collection::cident_sections): New function.
6263 (Garbage_collection::add_cident_section): New function.
6264 (Garbage_collection::cident_sections_): New member.
6265 (gc_process_relocs): Add references to sections whose names are C
6267 * gold.h (cident_section_start_prefix): New constant.
6268 (cident_section_stop_prefix): New constant.
6269 (is_cident): New function.
6270 * layout.cc (Layout::define_section_symbols): Replace string constants
6271 with the newly defined constants.
6272 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6274 * testsuite/Makefile.am: Add gc_orphan_section_test.
6275 * testsuite/Makefile.in: Regenerate.
6276 * testsuite/gc_orphan_section_test.cc: New file.
6277 * testsuite/gc_orphan_section_test.sh: New file.
6279 2010-01-06 Ian Lance Taylor <iant@google.com>
6282 * options.h (class General_options): Add --warn-shared-textrel.
6283 * layout.cc (Layout::finish_dynamic_section): Implement
6284 --warn-shared-textrel.
6287 * options.h (class General_options): Add --warn-multiple-gp.
6289 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6291 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6292 $(THREADSLIB) and $(LIBDL).
6293 * Makefile.in: Rebuild.
6295 2010-01-06 Ian Lance Taylor <iant@google.com>
6298 * options.cc (General_options::parse_section_start): New function.
6299 (General_options::section_start): New function.
6300 (General_options::General_options): Initialize all members.
6301 * options.h: Include <map>
6302 (class General_options): Add --section-start. Add section_starts_
6304 * layout.cc (Layout::attach_allocated_section_to_segment): If
6305 --section-start was used, set the address of the segment. Remove
6306 local sort_sections.
6307 (Layout::relaxation_loop_body): If the address of the load segment
6308 has been set by --section-start, don't use it.
6309 * output.h (Output_segment::update_flags_for_output_section): New
6311 * output.cc (Output_segment::add_output_section): Call
6312 update_flags_for_output_section.
6314 2010-01-05 Ian Lance Taylor <iant@google.com>
6317 * options.h (class General_options): Add --undefined-version.
6318 * script.cc (struct Version_expression): Add was_matched_by_symbol
6320 (Version_script_info::matched_symbol): New function.
6321 (Version_script_info::get_symbol_version_helper): Call
6323 (Version_script_info::check_unmatched_names): New function.
6324 * script.h (class Version_script_info): Update declarations.
6325 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6327 * options.h (class General_options): Use DEFINE_bool_alias for
6328 allow_multiple_definition.
6329 * resolve.cc (Symbol_table::should_override): Don't test
6330 allow_multiple_definition.
6333 * options.h (class General_options): Add --cref.
6334 * main.cc (main): Print cref table if --cref. Don't close mapfile
6335 until after printing cref table.
6336 * cref.cc: Include "symtab.h".
6337 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6338 (Cref_table_compare::operator()): New function.
6339 (Cref_inputs::gather_cref): New function.
6340 (filecol): New static const.
6341 (Cref_inputs::print_cref): New function.
6342 (Cref::print_cref): New function.
6343 * cref.h: Include <cstdio>.
6344 (class Cref): Update declarations.
6345 * mapfile.h (Mapfile::file): New function.
6346 * object.h (class Object): Define Symbols. Declare virtual
6347 do_get_global_symbols.
6348 (Object::get_global_symbols): New function.
6349 * object.cc (Input_objects::add_object): Pass object to cref_ if
6351 (Input_objects::archive_start): Likewise.
6352 (Input_objects::archive_stop): Likewise.
6353 (Input_objects::print_cref): New function.
6354 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6355 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6357 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6359 * plugin.h (class Sized_pluginobj): Update declarations.
6361 2010-01-05 Ian Lance Taylor <iant@google.com>
6363 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6364 to is_default_version. Rename insdef to insdefault.
6365 (Symbol_table::add_from_relobj): Rename def to is_default_version
6366 and local to is_forced_local.
6367 (Symbol_table::add_from_pluginobj): Likewise.
6368 (Symbol_table::add_from_dynobj): Likewise.
6369 (Symbol_table::define_special_symbol): Rename insdef to
6372 2010-01-04 Ian Lance Taylor <iant@google.com>
6375 * options.h (class General_options): Add
6376 --allow-multiple-definition and -z muldefs.
6377 * resolve.cc (Symbol_table::should_override): Don't warn about a
6378 multiple symbol definition if --allow-multiple-definition or -z
6382 * options.h (class General_options): Add --add-needed and
6383 --copy-dt-needed-entries. Tweak --as-needed help entry.
6384 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6385 error if --copy-dt-needed-entries aka --add-needed is used and
6386 would cause a change in behaviour.
6389 * options.h (class General_options): Add -G as a short version of
6390 --shared. Add no-op options -assert, -g, and -i.
6392 2010-01-04 Sriraman Tallam <tmsriram@google.com>
6394 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6395 check for .text or .gnu.linkonce.t sections.
6396 * icf.cc (Icf::find_identical_sections): Ditto.
6397 Change the detection for mangled function name within the section
6399 * icf.h (is_section_foldable_candidate): New function.
6401 2009-12-30 Ian Lance Taylor <iant@google.com>
6404 * options.h (class General_options): Permit two dashes with
6405 --retain-symbols-file.
6407 2009-12-30 Ian Lance Taylor <iant@google.com>
6410 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6411 don't put the file header and segment headers in the text
6415 * common.cc (Sort_commons::operator()): Stabilize sort when both
6417 (Symbol_table::do_allocate_commons_list): When allocating common
6418 symbols, skip a symbol which is no longer common.
6419 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6420 an object before checking its type.
6421 * testsuite/common_test_2.c: New file.
6422 * testsuite/common_test_3.c: New file.
6423 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6424 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6425 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6426 (common_test_2_pic.o, common_test_2.so): New targets.
6427 (common_test_3_pic.o, common_test_3.so): New targets.
6428 * testsuite/Makefile.in: Rebuild.
6431 * script.cc (read_input_script): If we see a new SECTIONS clause,
6432 and we have added an input section, give an error.
6433 * layout.h (class Layout): Add have_added_input_section function.
6434 Add have_added_input_section_ field.
6435 * layout.cc (Layout::Layout): Initialize
6436 have_added_input_section_.
6437 (Layout::layout): Set have_added_input_section_.
6438 (Layout::layout_eh_frame): Likewise.
6440 2009-12-30 Ian Lance Taylor <iant@google.com>
6443 * options.h (class General_options): Add --sort-common option.
6444 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6445 * common.cc (Sort_common): Add sort_order parameter to
6446 constructor. Add sort_order_ field.
6447 (Sort_commons::operator): Check sort_order_.
6448 (Symbol_table::allocate_commons): Determine the sort order.
6449 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6451 (Symbol_table::do_allocate_commons_list): Likewise.
6453 2009-12-30 Ian Lance Taylor <iant@google.com>
6456 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6457 symbols from this object, don't change the visibility of an
6459 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6461 2009-12-30 Ian Lance Taylor <iant@google.com>
6464 * script.h (class Version_script_info): Define Language enum.
6465 Update declarations. Define Glob, Exact, and Lookup types. Add
6466 new fields globals_, locals_, and is_finalized_.
6467 * script.cc: Various formatting fixes.
6468 (class Parser_closure): Change language_stack_ from a vector of
6469 std::string to one of Version_script_info::Language. Adjust all
6471 (class Lazy_demangler): Remove.
6472 (struct Version_expression): Change language from std::string to
6473 Version_script_info::Language.
6474 (Version_script_info::Version_script_info): New function.
6475 (Version_script_info::~Version_script_info): Don't call clear.
6476 (Version_script_info::finalize): New function.
6477 (Version_script_info::build_lookup_tables): New function.
6478 (Version_script_info::build_expression_list_lookup): New
6480 (Version_script_info::get_symbol_version_helper): Rewrite to use
6482 (Version_script_info::print_expression_list): Adjust to use
6483 Version_script_info::Language.
6484 (script_push_lex_into_version_mode): Check that the version script
6485 has not been finalized.
6486 (version_script_push_lang): Change language string to
6487 Version_script_info::Language.
6488 * options.cc (Command_line::version_script): New function.
6489 * options.h (class General_options): Add finalize_dynamic_list
6490 function. Change version_script from declaration to definition.
6491 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6492 * testsuite/version_script.map: Remove duplicate def of foo.
6493 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6495 * testsuite/Makefile.in: Rebuild.
6497 2009-12-30 Ian Lance Taylor <iant@google.com>
6500 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6501 if the input symbol index is 0, make the output symbol index 0.
6503 2009-12-30 Ian Lance Taylor <iant@google.com>
6506 * options.h (class General_options): Add -x/--discard-all.
6507 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6508 --discard-all. If the local symbol needs a dynamic entry, check
6509 that before handling --discard-locals.
6511 2009-12-30 Ian Lance Taylor <iant@google.com>
6514 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6516 (Output_segment::add_output_section): Don't change the flags if
6520 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6521 GNU hash table if they need a dynamic value. Otherwise, don't add
6522 them if they are defined in a dynamic object or are forced local.
6524 2009-12-29 Ian Lance Taylor <iant@google.com>
6527 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6528 .gnu.hash table for a 32-bit target.
6531 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6532 regular and a dynamic object only needs a dynamic symbol table
6533 entry if it is externally visible.
6536 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6537 constructor. Add global_offset_table_ field.
6538 (Target_i386::got_section): Set global_offset_table_.
6539 (Target_i386::do_finalize_sections): Set global_offset_table_
6541 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6542 in constructor. Add global_offset_table_ field.
6543 (Target_x86_64::got_section): Set global_offset_table_.
6544 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6547 * layout.cc (Layout::Layout): Initialize increase_relro_.
6548 (Layout::get_output_section): Add is_relro, is_last_relro, and
6549 is_first_non_relro parameters. Change all callers.
6550 (Layout::choose_output_section): Likewise.
6551 (Layout::add_output_section_data): Likewise.
6552 (Layout::make_output_section): Likewise.
6553 (Layout::set_segment_offsets): Clear increase_relro when using a
6555 * layout.h (class Layout): Add increase_relro method. Add
6556 increase_relro_ field. Update declarations.
6557 * output.cc (Output_section::Output_section): Initialize
6558 is_last_relro_ and is_first_non_relro_.
6559 (Output_segment::add_output_section): Group relro sections is
6560 do_sort is true. Handle is_last_relro and is_first_non_relro.
6561 (Output_segment::maximum_alignment): Remove relro handling.
6562 (Output_segment::set_section_addresses): Add increase_relro
6563 parameter. Change all callers. Add initial alignment to align
6564 relro sections on separate page. Remove old relro handling.
6565 (Output_segment::set_section_list_addresses): Remove in_relro
6566 parameter. Change all callers.
6567 (Output_segment::set_offset): Add increase parameter. Change all
6568 callers. Remove old relro handling.
6569 * output.h (class Output_section): Add new methods: is_last_relro,
6570 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6571 Add is_last_relro_ and is_first_non_relro_ fields.
6572 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6573 Create separate .got.plt section. Call increase_relro.
6574 * x86_64.cc (Target_x86_64::got_section): Likewise.
6575 * testsuite/relro_script_test.t: Add .got.plt.
6578 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6579 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6580 (Layout::finalize): Call set_dynamic_symbol_size.
6581 (Layout::set_dynamic_symbol_size): New function.
6582 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6583 set_dynamic_symbol_size.
6586 * output.h (class Output_section): Add is_entsize_zero_ field.
6587 * output.cc (Output_section::Output_section): Initialize
6589 (Output_section::set_entsize): If two different entsizes are
6590 requested, force it to zero.
6591 (Output_section::add_input_section): Set flags for .debug_str
6592 before updating section flags. Set entsize.
6593 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6594 and SHF_STRING if all input sections have those flags.
6596 2009-12-29 Rafael Espindola <espindola@google.com>
6598 * main.cc (main): Fix the sys time reporting.
6599 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6602 2009-12-29 Sriraman Tallam <tmsriram@google.com>
6604 * options.cc (General_options::parse_version): Allow -v to exit
6605 without an error if there is nothing to link.
6607 2009-12-29 Ian Lance Taylor <iant@google.com>
6609 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6610 using a version of gcc before 4.1.
6611 * configure: Rebuild.
6613 2009-12-28 Chris Demetriou <cgd@google.com>
6615 * attributes.cc (Output_attributes_section_data::do_write): Use
6616 std::vector::front rather than std::vector::data.
6618 2009-12-28 Ian Lance Taylor <iant@google.com>
6620 * symtab.h (class Symbol_table): Add enum Defined.
6621 * resolve.cc (Symbol_table::should_override): Add defined
6622 parameter. Change all callers. Test whether object is NULL
6623 before calling a method on it.
6624 (Symbol_table::report_resolve_problem): Add defined parameter.
6626 (Symbol_table::should_override_with_special): Likewise.
6627 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6628 parameter. Change all callers.
6629 (Symbol_table::do_define_in_output_data): Likewise.
6630 (Symbol_table::define_in_output_segment): Likewise.
6631 (Symbol_table::do_define_in_output_segment): Likewise.
6632 (Symbol_table::define_as_constant): Likewise.
6633 (Symbol_table::do_define_as_constant): Likewise.
6634 * script.h (class Symbol_assignment): Add is_defsym parameter to
6635 constructor; change all callers.
6636 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6637 parameter. Change all callers. Add is_defsym_ field.
6638 (class Parser_closure): Add parsing_defsym parameter to
6639 constructor; change all callers. Add parsing_defsym accessor
6640 function. Add parsing_defsym_ field.
6642 2009-12-28 Ian Lance Taylor <iant@google.com>
6644 * gold.cc (queue_middle_tasks): Fix formatting.
6645 * object.cc (Relobj::is_section_name_included): Likewise.
6647 2009-12-23 Ian Lance Taylor <iant@google.com>
6649 * i386.cc (Target_i386::do_calls_non_split): Recognize
6650 -fsplit-stack prologue for a function with a static chain.
6651 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6652 -fsplit-stack prologue when using %r11.
6654 2009-12-21 Sriraman Tallam <tmsriram@google.com>
6656 * options.cc (General_options::parse_version): Make -v continue and do
6657 the link like GNU ld does.
6659 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
6661 * Makefile.am (CCFILES): Add timer.cc.
6662 (HFILES): Add timer.h.
6663 * configure.ac: Check for sysconf and times.
6664 * main.cc: include timer.h.
6665 (main): Use Timer instead of get_run_time.
6668 * workqueue.cc: include timer.h.
6669 (Workqueue::find_and_run_task):
6670 Report user, sys and wall time.
6671 * Makefile.in: Regenerate.
6672 * config.in: Regenerate.
6673 * configure: Regenerate.
6675 2009-12-16 Doug Kwan <dougkwan@google.com>
6677 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6679 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6680 relaxed input sections.
6681 * output.cc (Output_section::find_relaxed_input_section): Change
6682 return type to Output_relaxed_input_section pointer. Adjust code
6683 for new type of relaxed_input_section_map_.
6684 * output.h (Output_section::find_relaxed_input_section): Change
6685 return type to Output_relaxed_input_section pointer.
6686 (Output_section::Output_relaxed_input_section_by_input_section_map):
6688 (Output_section::relaxed_input_section_map_): Change type to
6689 Output_section::Output_relaxed_input_section_by_input_section_map.
6690 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6693 2009-12-15 Ian Lance Taylor <iant@google.com>
6695 * layout.cc (Layout::create_shstrtab): Only write out after input
6696 sections if we are compressing debug sections.
6698 2009-12-15 Ian Lance Taylor <iant@google.com>
6700 * archive.cc (Archive::add_symbols): Only look up a symbol without
6701 a version if there is, in fact, a version.
6703 2009-12-14 Ian Lance Taylor <iant@google.com>
6705 Revert -Wshadow changes, all changes from:
6706 2009-12-11 Doug Kwan <dougkwan@google.com>
6707 2009-12-11 Nick Clifton <nickc@redhat.com>
6708 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6710 2009-12-11 Doug Kwan <dougkwan@google.com>
6712 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6714 * attributes.cc (Object_attribute::size): Ditto.
6715 (Attributes_section_data::size): Ditto.
6716 (Attributes_section_data::Attributes_section_data): Ditto.
6717 (Output_attributes_section_data::do_write): Ditto.
6718 * attributes.h (Object_attribute::set_type): Ditto.
6719 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6721 2009-12-11 Nick Clifton <nickc@redhat.com>
6723 * archive.cc: Fix shadowed variable warnings.
6725 * compressed_output.cc: Likewise.
6726 * compressed_output.h: Likewise.
6727 * configure: Likewise.
6728 * dwarf_reader.cc: Likewise.
6729 * dynobj.cc: Likewise.
6730 * dynobj.h: Likewise.
6731 * ehframe.cc: Likewise.
6732 * ehframe.h: Likewise.
6733 * errors.cc: Likewise.
6734 * expression.cc: Likewise.
6735 * fileread.cc: Likewise.
6736 * fileread.h: Likewise.
6737 * freebsd.h: Likewise.
6738 * i386.cc: Likewise.
6740 * incremental.h: Likewise.
6741 * layout.cc: Likewise.
6742 * layout.h: Likewise.
6743 * mapfile.cc: Likewise.
6744 * merge.cc: Likewise.
6745 * merge.h: Likewise.
6746 * object.cc: Likewise.
6747 * object.h: Likewise.
6748 * options.h: Likewise.
6749 * output.cc: Likewise.
6750 * output.h: Likewise.
6751 * parameters.cc: Likewise.
6752 * plugin.cc: Likewise.
6753 * powerpc.cc: Likewise.
6754 * reduced_debug_output.cc: Likewise.
6755 * reduced_debug_output.h: Likewise.
6756 * reloc.cc: Likewise.
6757 * reloc.h: Likewise.
6758 * resolve.cc: Likewise.
6759 * script-sections.cc: Likewise.
6760 * script.cc: Likewise.
6761 * script.h: Likewise.
6762 * sparc.cc: Likewise.
6763 * symtab.cc: Likewise.
6764 * symtab.h: Likewise.
6765 * target-select.cc: Likewise.
6766 * target-select.h: Likewise.
6767 * token.h: Likewise.
6768 * workqueue.cc: Likewise.
6769 * workqueue.h: Likewise.
6770 * x86_64.cc: Likewise.
6772 2009-12-10 Doug Kwan <dougkwan@google.com>
6774 * arm.cc (attributes.h): New include.
6775 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6776 (Arm_relobj::~Arm_relobj): Delete object pointed by
6777 attributes_section_data_.
6778 (Arm_relobj::attributes_section_data): New method definition.
6779 (Arm_relobj::attributes_section_data_): New data member declaration.
6780 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6781 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6782 attributes_section_data_.
6783 (Arm_dynobj::attributes_section_data): New method definition.
6784 (Arm_dynobj::attributes_section_data_): New data member declaration.
6785 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6786 initialization value of may_use_blx_ to false.
6787 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6788 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6789 object attributes to compute results instead of hard-coding.
6790 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6791 Target_arm::get_secondary_compatible_arch,
6792 Target_arm::set_secondary_compatible_arch
6793 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6794 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6795 New method declarations.
6796 (Target_arm::get_aeabi_object_attribute): New method definition.
6797 (Target_arm::attributes_section_data_): New data member declaration.
6798 (read_arm_attributes_section): New template definition.
6799 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6800 (Arm_dynobj::do_read_symbols): Ditto.
6801 (Target_arm::do_finalize_sections): Merge attributes sections from
6802 input. Check for BLX use after attributes section merging.
6803 Fix __exidx_start and __exidx_end visibility. Create an
6804 .ARM.attributes section if necessary.
6805 (Target_arm::get_secondary_compatible_arch,
6806 Target_arm::set_secondary_compatible_arch,
6807 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6808 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
6809 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
6810 New method definitions.
6812 2009-12-09 Ian Lance Taylor <iant@google.com>
6814 * plugin.cc (Plugin::load): Don't cast from void* to a function
6817 2009-12-09 Ian Lance Taylor <iant@google.com>
6819 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6822 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6824 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6825 Replace two_file_shared_1.so with two_file_shared_2.so.
6826 * testsuite/Makefile.in: Regenerated.
6828 2009-12-08 Doug Kwan <dougkwan@google.com>
6830 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6831 (HFILES): Add attributes.h and int_encoding.h.
6832 * Makefile.in: Regenerate.
6833 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6834 function definitions to int_encoding.cc
6835 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6836 prototypes to int_encoding.h
6837 * reduced_debug_output.cc (int_encoding.h): New include.
6838 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6839 function definitions to int_encoding.cc
6840 (insert_into_vector, read_from_pointer): Move template definitions to
6842 * attributes.cc: New file.
6843 * attributes.h: New file.
6844 * int_encoding.cc: New file.
6845 * int_encoding.h: New file.
6847 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
6850 * incremental-dump.cc (dump_incremental_inputs): New.
6851 (main): Use dump_incremental_inputs.
6853 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6856 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6857 checking elfcpp::STT_FUNC.
6858 (Target_i386::Relocate::relocate): Likewise.
6859 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6861 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6862 symbols from shared libraries into normal FUNC symbols.
6864 * symtab.h (Symbol): Add is_func and use it.
6866 2009-12-05 Doug Kwan <dougkwan@google.com>
6868 * arm.cc (Target_arm::arm_info): Initialize new fields
6869 attributes_section and attributes_vendor.
6870 * i386.cc (Target_i386::i386_info): Same.
6871 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6872 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6873 fields attributes_section and attributes_vendor.
6874 * sparc.cc (Target_sparc::sparc_info): Same.
6875 * target.h (Target::attributes_section, Target::attributes_vendor,
6876 Target::is_attributes_section, Target::attribute_arg_type,
6877 Target::attributes_order): New method definitions.
6878 (Target::Target_info::attributes_section,
6879 Target::Target_info::attributes_vendor): New fields.
6880 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6881 virtual method definitions.
6882 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6883 attributes_section and attributes_vendor.
6884 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6886 2009-12-05 Doug Kwan <dougkwan@google.com>
6888 * arm.cc: Update comments about interworking and stub generation.
6889 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6890 considered as non-PIC.
6891 (Arm_relocate_functions::base_abs): Fix formatting.
6892 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6893 of function to use GOT entry address instead of offset.
6894 (Target_arm::Scan::global): Issue an error if a symbol would need a
6895 PLT does not get one because it is untyped. Remove code to create
6896 dynamic symbols for relative branches.
6897 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6898 takes unsigned integer instead of boolean.
6900 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6902 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6903 (two_file_test_LDADD): Likewise.
6904 (common_test_1_LDADD): Likewise.
6905 (exception_test_LDADD) Likewise.
6906 (weak_test_LDADD): Likewise.
6907 (many_sections_test_LDADD): Likewise.
6908 (initpri1_LDADD): Likewise.
6909 (script_test_1_LDADD): Likewise.
6910 (script_test_2_LDADD): Likewise.
6911 (justsyms_LDADD): Likewise.
6912 (binary_test_LDADD): Likewise.
6913 (large_LDADD): Likewise.
6914 * testsuite/Makefile.in: Regenerated.
6916 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
6918 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6919 (Symbol_table::override_with_special): Likewise.
6920 (Symbol_table::add_from_object): Likewise.
6922 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6924 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6925 Don't set the data_offset twice.
6927 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6929 * testsuite/Makefile.in: Regenerate.
6931 2009-12-03 Doug Kwan <dougkwan@google.com>
6933 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6934 (Target_arm::do_finalize_sections): Add parameter for symbol table
6935 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6936 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6937 parameter for symbol table pointer.
6938 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6939 an additional parameter for a pointer to symbol table.
6940 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6941 parameter for a symbol table pointer.
6942 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6943 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6945 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6946 parameter for a symbol table pointer.
6948 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
6950 * incremental.cc (Incremental_inputs_header)
6951 (Incremental_inputs_header_write, Incremental_inputs_entry)
6952 (Incremental_inputs_entry_write): Move ...
6953 * incremental.h (Incremental_inputs_header)
6954 (Incremental_inputs_header_write, Incremental_inputs_entry)
6955 (Incremental_inputs_entry_write): here.
6957 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6959 * incremental.cc (make_sized_incremental_binary): Set the target.
6960 Error if it is incompatible.
6961 * output.h (Output_file): Add filename method.
6963 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6965 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6966 from the get_* methods.
6968 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6970 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6971 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6972 Write 0 for the data_offset of scripts.
6974 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6976 * testsuite/Makefile.am: Add the incremental_test.sh test.
6977 * testsuite/incremental_test.sh: New.
6978 * testsuite/incremental_test_1.c: New.
6979 * testsuite/incremental_test_2.c: New.
6981 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
6983 * incremental-dump.cc (main): Fix typos.
6985 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
6988 * incremental-dump.cc (main): Use llu to print 64 bit values.
6990 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6991 H.J. Lu <hongjiu.lu@intel.com>
6993 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6995 (incremental_dump_LDADD): Likewise.
6996 * Makefile.in: Regenerated.
6998 2009-11-25 Doug Kwan <dougkwan@google.com>
7002 2009-11-25 Doug Kwan <dougkwan@google.com>
7004 * arm.cc (Target_arm::Target_arm): Move method definition
7005 outside of class definition. Add code to handle
7006 --target1-rel, --target1-abs and --target2= options.
7007 (Target_arm::get_reloc_reloc_type): Change method to be
7008 non-static and const.
7009 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7010 New data member declaration.
7011 (Target_arm::Scan::local, Target_arm::Scan::global,
7012 Target_arm::Relocate::relocate,
7013 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7014 Adjust call to Target_arm::get_real_reloc_type.
7015 (Target_arm::get_real_reloc_type): Use command line options
7016 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7017 * options.h (--target1-rel, --target1-abs, --target2): New
7020 2009-11-25 Doug Kwan <dougkwan@google.com>
7022 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7023 class definition. Add code to handle --target1-rel, --target1-abs
7024 and --target2= options.
7025 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7027 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7029 (Target_arm::Scan::local, Target_arm::Scan::global,
7030 Target_arm::Relocate::relocate,
7031 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7032 call to Target_arm::get_real_reloc_type.
7033 (Target_arm::get_real_reloc_type): Use command line options to
7034 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7035 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7038 2009-11-25 Doug Kwan <dougkwan@google.com>
7040 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7041 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7042 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7044 (Arm_relocate_functions::thm_call): Replace body with a call to
7045 Arm_relocate_functions::thumb_branch_common.
7046 (Arm_relocate_functions::thm_jump24,
7047 Arm_relocate_functions::thm_xpc22): New method definitions.
7048 (Arm_relocate_functions::thumb_branch_common): New method definition.
7049 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7051 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7052 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7054 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7056 * Makefile.am: Build incremental-dump
7057 * Makefile.in: Regenerate.
7058 * incremental-dump.cc: New.
7059 * incremental.cc (Incremental_inputs_header_data,
7060 Incremental_inputs_entry_data): Move to incremental.h
7061 * incremental.h: (Incremental_inputs_header_data,
7062 Incremental_inputs_entry_data): Move from incremental.cc
7064 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7066 * incremental.cc (Incremental_inputs_header,
7067 Incremental_inputs_header_write, Incremental_inputs_entry,
7068 Incremental_inputs_entry_write): Add a typedef with the data type.
7070 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7072 * incremental.cc (Incremental_inputs_header,
7073 Incremental_inputs_header_write, Incremental_inputs_entry,
7074 Incremental_inputs_entry_write): Update comment about which
7075 type has the filed descriptions.
7077 2009-11-15 Doug Kwan <dougkwan@google.com>
7079 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7080 (Arm_relocate_functions::arm_branch_common): Change method defintion
7081 in class definition to a method declaration and update list of formal
7083 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7084 Arm_relocation_functions::jump24): Adjust call to
7085 Arm_relocate_functions::arm_branch_common. Update list of formal
7087 (Arm_relocate_functions::xpc25): New method definition.
7088 (Arm_relocate_functions::arm_branch_common): Move method defintion
7089 out from class definition. Use stubs for mode-switching and extending
7091 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7092 specially. Change code to enable use of stubs in ARM branches.
7094 2009-11-10 Doug Kwan <dougkwan@google.com>
7096 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7097 in method declaration.
7098 (Target_arm::relocate_stub): New method declaration.
7099 (Target_arm::default_target): Change to return a pointer instead of
7101 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7102 Target_arm::default_target.
7103 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7105 (Target_arm::relocate_section): Adjust view.
7106 (Target_arm::relocate_stub): New method definition.
7108 2009-11-10 Doug Kwan <dougkwan@google.com>
7110 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7112 * incremental.cc (open_incremental_binary): Initialized local
7113 variables to avoid warnings.
7114 * object.cc (make_elf_object): Ditto.
7115 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7118 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7121 * testsuite/plugin_test.c: Include "config.h".
7123 2009-11-09 Doug Kwan <dougkwan@google.com>
7125 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7126 (arm_symbol_value): Remove.
7127 (Arm_relocate_functions::arm_branch_common,
7128 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7129 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7130 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7131 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7132 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7133 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7134 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7135 Arm_relocate_functions::thm_mobw_abs_nc,
7136 Arm_relocate_functions::thm_mov_abs,
7137 Arm_relocate_functions::movw_prel_nc,
7138 Arm_relocate_functions::thm_movt_abs,
7139 Arm_relocate_functions::movt_prel,
7140 Arm_relocate_functions::thm_movw_prel_nc,
7141 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7142 (Target_arm::Relocate::relocate): Only decompose address into two
7143 parts if relocation type uses the thumb-bit and pass the actual
7144 bit instead of a flag indicating that the thumb-bit is used. Adjust
7145 calls to methods in Arm_relocate_functions for this change.
7147 2009-11-08 Ian Lance Taylor <iant@google.com>
7150 * reloc.cc: Instantiate
7151 Sized_relobj::initialize_input_to_output_maps and
7152 Sized_relobj:free_input_to_output_maps.
7154 2009-11-06 Ian Lance Taylor <iant@google.com>
7157 * defstd.cc (in_segment): Set only_if_ref true for "end".
7159 2009-11-06 Doug Kwan <dougkwan@google.com>
7161 * arm.cc (class Reloc_stub): Correct a comment.
7162 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7163 (Target_arm::scan_section_for_stubs): New method declaration.
7164 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7165 Change methods from private to protected.
7166 (Target_arm::do_may_relax): New method definition.
7167 (Target_arm::do_relax, Target_arm::group_sections,
7168 Target_arm::scan_reloc_for_stub,
7169 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7170 (Target_arm::arm_input_section_map_): New data member declaration.
7171 (Target_arm::scan_reloc_for_stub,
7172 Target_arm::scan_reloc_section_for_stubs,
7173 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7174 Target_arm::do_relax): New method definitions.
7176 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7178 * configure.ac: Check for (struct stat)::st_mtim
7179 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7180 * config.in: Regenerate.
7181 * configure: Regenerate.
7183 2009-11-05 Ian Lance Taylor <iant@google.com>
7186 * output.cc (Output_segment::add_output_section): Add missing
7189 2009-11-04 Ian Lance Taylor <iant@google.com>
7192 * object.h (class Object): Add is_needed and set_is_needed
7193 methods. Add is_needed_ field. Make bool fields into bitfields.
7194 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7195 defined in a dynamic object and referenced by a regular object,
7196 set is_needed for the dynamic object.
7197 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7198 if the file is marked with as_needed and it is not needed.
7200 2009-11-04 Ian Lance Taylor <iant@google.com>
7203 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7204 tags if data is discarded by linker script.
7205 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7206 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7207 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7208 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7210 2009-11-04 Ian Lance Taylor <iant@google.com>
7212 * layout.cc (Layout::get_output_section): Add is_interp and
7213 is_dynamic_linker_section parameters. Change all callers.
7214 (Layout::choose_output_section): Likewise.
7215 (Layout::make_output_section): Likewise.
7216 (Layout::add_output_section_data): Add is_dynamic_linker_section
7217 parameter. Change all callers.
7218 * layout.h (class Layout): Update declarations.
7219 * output.h (class Output_section): Add is_interp, set_is_interp,
7220 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7221 Add is_interp_, is_dynamic_linker_section_ fields. Change
7222 generate_code_fills_at_write_ to a bitfield.
7223 * output.cc (Output_section::Output_sections): Initialize new
7225 (Output_segment::add_output_section): Add do_sort parameter.
7228 2009-11-03 Ian Lance Taylor <iant@google.com>
7231 * options.h (class General_options): Add --warn-common.
7232 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7233 merging two common symbols.
7234 (Symbol_table::should_override): Handle --warn-common when merging
7235 a common symbol with a defined symbol. Use report_resolve_problem
7236 for multiple definitions.
7237 (Symbol_table::report_resolve_problem): New function.
7238 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7240 2009-11-03 Doug Kwan <dougkwan@google.com>
7242 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7244 (Target_arm::stub_factory): New method definition.
7245 (Target_arm::new_arm_input_section,
7246 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7247 Target_arm::reloc_uses_thumb_bit): New method declarations.
7248 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
7249 New type definitions.
7250 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7251 member declarations.
7252 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7253 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7254 New method definitions.
7256 2009-11-03 Ian Lance Taylor <iant@google.com>
7258 * options.h (class General_options): Add --warn_constructors.
7260 2009-11-03 Ian Lance Taylor <iant@google.com>
7263 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7264 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7266 2009-11-03 Ian Lance Taylor <iant@google.com>
7269 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7270 --msgid-bugs-address.
7271 (install-pdf): New target.
7272 (install-data_yes): Look up one directory to find mkinstalldirs.
7274 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7276 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7279 2009-10-30 Doug Kwan <dougkwan@google.com>
7281 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7283 2009-10-30 Doug Kwan <dougkwan@google.com>
7285 * arm.cc (Stub_addend_reader): New struct template definition
7286 and partial specializations.
7287 (Stub_addend_reader::operator()): New method definition for a
7288 partially specialized template.
7290 2009-10-30 Doug Kwan <dougkwan@google.com>
7292 * arm.cc (Arm_relobj::processor_specific_flags): New method
7294 (Arm_relobj::do_read_symbols): New method declaration.
7295 (Arm_relobj::processor_specific_flags_): New data member declaration.
7296 (Arm_dynobj): New class definition.
7297 (Target_arm::do_finalize_sections): Add input_objects parameter.
7298 (Target_arm::do_adjust_elf_header): New method declaration.
7299 (Target_arm::are_eabi_versions_compatible,
7300 (Target_arm::merge_processor_specific_flags): New method declaration.
7301 (Target_arm::do_make_elf_object): New overloaded method definitions
7303 (Arm_relobj::do_read_symbols): New method definition.
7304 (Arm_dynobj::do_read_symbols): Ditto.
7305 (Target_arm::do_finalize_sections): Add input_objects parameters.
7306 Merge processor-specific flags from all input objects.
7307 (Target_arm::are_eabi_versions_compatible,
7308 Target_arm::merge_processor_specific_flags,
7309 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7310 New method definitions.
7311 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7312 Input_objects pointer type parameter.
7313 * layout.cc (Layout::finalize): Pass input objects to target's.
7314 finalize_sections function.
7315 * output.cc (Output_file_header::do_sized_write): Set ELF file
7316 header's processor-specific flags.
7317 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7318 Input_objects pointer type parameter.
7319 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7320 * target.h (Input_objects): New forward class declaration.
7321 (Target::processor_specific_flags,
7322 Target::are_processor_specific_flags_sect): New method definitions.
7323 (Target::finalize_sections): Add input_objects parameter.
7324 (Target::Target): Initialize processor_specific_flags_ and
7325 are_processor_specific_flags_set_.
7326 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7328 (Target::set_processor_specific_flags): New method definition.
7329 (Target::processor_specific_flags_,
7330 Target::are_processor_specific_flags_set_): New data member
7332 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7333 Input_objects pointer type parameter.
7335 2009-10-30 Doug Kwan <dougkwan@google.com>
7337 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7339 2009-10-28 Ian Lance Taylor <iant@google.com>
7341 * object.h (class Relobj): Drop options parameter from
7342 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7343 do_scan_relocs, do_relocate. Change all callers.
7344 (class Sized_relobj): Drop options parameters from
7345 do_gc_process_relocs, do_scan_relocs, do_relocate,
7346 do_relocate_sections, relocate_sections, emit_relocs_scan,
7347 emit_relocs_scan_reltype. Change all callers.
7348 (struct Relocate_info): Remove options field and all references to
7350 * reloc.h (class Read_relocs): Remove options constructor
7351 parameter and options_ field. Change all callers.
7352 (class Gc_process_relocs, class Scan_relocs): Likewise.
7353 (class Relocate_task): Likewise.
7354 * target-reloc.h (scan_relocs): Remove options parameter. Change
7356 (scan_relocatable_relocs): Likewise.
7357 * target.h (class Sized_target): Remove options parameter from
7358 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7360 * gc.h (gc_process_relocs): Remove options parameter. Change all
7362 * arm.cc: Update functions to remove options parameters.
7363 * i386.cc: Likewise.
7364 * powerpc.cc: Likewise.
7365 * sparc.cc: Likewise.
7366 * x86_64.cc: Likewise.
7367 * testsuite/testfile.cc: Likewise.
7369 2009-10-28 Doug Kwan <dougkwan@google.com>
7371 * arm.cc (Arm_relobj): New class definition.
7372 (Arm_relobj::scan_sections_for_stubs,
7373 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7374 New method definitions.
7376 2009-10-28 Cary Coutant <ccoutant@google.com>
7378 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7379 (Plugin::cleanup_done_): New member.
7380 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7381 (Plugin_manager::cleanup_done_): Remove.
7382 (Plugin_manager::add_input_file): Edit error message.
7383 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7384 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7386 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7388 * fileread.cc: (File_read::View::~View): Use the new
7389 data_ownership_ filed.
7390 (File_read::~File_read): Dispose the new whole_file_view_.
7391 (File_read::open): Mmap the whole file if needed.
7392 (File_read::open): Use whole_file_view_ instead of contents_.
7393 (File_read::find_view): Use whole_file_view_ if applicable.
7394 (File_read::do_read): Use whole_file_view_ instead of contents_.
7395 (File_read::make_view): Use whole_file_view_ instead of contents_,
7396 update File_read::View::View call.
7397 (File_read::find_or_make_view): Update File_read::View::View
7399 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7401 (File_read::View::Data_ownership): New enum.
7402 (File_read::View::View): Replace bool mapped_ with Data_ownership
7404 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7405 (File_read::View::data_ownership_): New field.
7406 (File_read::contents_): Remove (replaced by whole_file_view_).
7407 (File_read::whole_file_view_): New field.
7408 * options.h (class General_options): Add --keep-files-mapped.
7410 2009-10-27 Cary Coutant <ccoutant@google.com>
7412 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7413 * testsuite/Makefile.am (plugin_test_5): New test case.
7414 * testsuite/Makefile.in: Regenerate.
7416 2009-10-25 Doug Kwan <dougkwan@google.com>
7418 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7419 from private to protected to allow access by child class.
7420 (Sized_relobj::do_relocate_sections): New method declaration.
7421 (Sized_relobj::relocate_sections): Virtualize.
7422 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
7423 Sized_relobj::relocate_sections. Instantiate template explicitly
7424 for different target sizes and endianity.
7426 2009-10-24 Doug Kwan <dougkwan@google.com>
7428 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7429 (Arm_input_section::as_arm_input_section): New method.
7430 (Arm_output_section): New class definition.
7431 (Arm_output_section::create_stub_group,
7432 Arm_output_section::group_sections): New method definitions.
7434 2009-10-22 Doug Kwan <dougkwan@google.com>
7436 * arm.cc (Arm_input_section): New class definition.
7437 (Arm_input_section::init, Arm_input_section:do_write,
7438 Arm_input_section::set_final_data_size,
7439 Arm_input_section::do_reset_address_and_file_offset): New method
7442 2009-10-21 Doug Kwan <dougkwan@google.com>
7444 * arm.cc (Stub_table, Arm_input_section): New forward class
7446 (Stub_table): New class defintion.
7447 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7448 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7449 New method definition.
7451 2009-10-21 Doug Kwan <dougkwan@google.com>
7453 * arm.cc: Update copyright comments.
7454 (Target_arm): New forward class template declaration.
7455 (Arm_address): New type.
7456 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7457 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7458 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7460 (Insn_template): Same.
7461 (DEF_STUBS): New macro.
7462 (Stub_type): New enum type.
7463 (Stub_template): New class definition.
7466 (Stub_factory): Same.
7467 (Target_arm::Target_arm): Initialize may_use_blx_ and
7468 should_force_pic_veneer_.
7469 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7470 Target_arm::should_force_pic_veneer,
7471 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7472 Target_arm::using_thumb_only, Target_arm:;default_target): New
7474 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7475 New data member declarations.
7476 (Insn_template::size, Insn_template::alignment): New method defintions.
7477 (Stub_template::Stub_template): New method definition.
7478 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7479 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7480 (Stub_factory::Stub_factory): New method definition.
7481 * gold.h (string_hash): New template.
7482 * output.h (Input_section_specifier::hash_value): Use
7484 (Input_section_specifier::string_hash): Remove.
7485 * stringpool.cc (Stringpool_template::string_hash): Use
7488 2009-10-20 Doug Kwan <dougkwan@google.com>
7490 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7491 symbols of relaxed input sections.
7492 * output.h (Output_section::find_relaxed_input_section): Make
7495 2009-10-16 Doug Kwan <dougkwan@google.com>
7497 * dynobj.cc (Versions::Versions): Initialize version_script_.
7498 Only insert base version symbol definition for a shared object
7499 if version script defines any version versions.
7500 (Versions::define_base_version): New method definition.
7501 (Versions::add_def): Check that base version is not needed.
7502 (Versions::add_need): Define base version lazily.
7503 * dynobj.h (Versions::define_base_version): New method declaration.
7504 (Versions::needs_base_version_): New data member declaration.
7505 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7506 (check_DATA): Add no_version_test.stdout.
7507 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7509 * testsuite/Makefile.in: Regenerate.
7510 * testsuite/no_version_test.c: New file.
7511 * testsuite/no_version_test.sh: Ditto.
7513 2009-10-16 Doug Kwan <dougkwan@google.com>
7515 * expression.cc (class Segment_start_expression): New class definition.
7516 (Segment_start_expression::value): New method definition.
7517 (script_exp_function_segment_start): Return a new
7518 Segment_start_expression.
7519 * gold/script-c.h (script_saw_segment_start_expression): New function
7521 * script-sections.cc (Script_sections::Script_sections): Initialize
7522 SAW_SEGMENT_START_EXPRESSION_ to false.
7523 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7524 and -Tbbs options to specify section addresses if given in
7525 command line and no SEGMENT_START expression is seen in a script.
7526 * script-sections.h (Script_sections::saw_segment_start_expression,
7527 Script_sections::set_saw_segment_start_expression): New method
7529 (Script_sections::saw_segment_start_expression_): New data member
7531 * script.cc (script_saw_segment_start_expression): New function.
7532 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7533 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7534 script_test_7.sh and script_test_8.sh.
7535 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7536 script_test_8.stdout.
7537 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7538 (script_test_6, script_test_6.stdout, script_test_7,
7539 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7540 * Makefile.in: Regenerate.
7541 * testsuite/script_test_6.sh: New file.
7542 * testsuite/script_test_6.t: Same.
7543 * testsuite/script_test_7.sh: Same.
7544 * testsuite/script_test_7.t: Same.
7545 * testsuite/script_test_8.sh: Same.
7547 2009-10-16 Doug Kwan <dougkwan@google.com>
7549 * output.cc (Output_segment::set_section_list_address): Cast
7550 expressions to unsigned long long type to avoid format warnings.
7552 2009-10-15 Ian Lance Taylor <iant@google.com>
7554 * script.cc (Script_options::add_symbol_assignment): Always add a
7555 dot assignment to script_sections_.
7556 * script-sections.cc (Script_sections::add_dot_assignment):
7557 Initialize if necessary.
7559 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7560 program headers with no load segment if there is a linker script.
7562 * layout.cc (Layout::set_segment_offsets): Align the file offset
7563 to the segment aligment for -N or -n with no load segment.
7564 * output.cc (Output_segment::add_output_section): Don't crash if
7565 the first section is a TLS section.
7566 (Output_segment::set_section_list_addresses): Print an error
7567 message if the address moves backward in a linker script.
7568 * script-sections.cc
7569 (Output_section_element_input::set_section_addresses): Don't
7570 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7571 (Orphan_output_section::set_section_addresses): Likewise.
7573 2009-10-15 Doug Kwan <dougkwan@google.com>
7575 * layout.cc (Layout::finish_dynamic_section): Generate tags
7576 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7577 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7578 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7580 2009-10-14 Ian Lance Taylor <iant@google.com>
7582 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7584 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7585 data_shdr fields of relinfo.
7586 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7587 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7588 R_386_TLS_LDO_32, adjust based on section flags.
7589 (Target_i386::Relocate::fix_up_ldo): Remove.
7591 2009-10-13 Ian Lance Taylor <iant@google.com>
7593 Add support for -pie.
7594 * options.h (class General_options): Add -pie and
7596 (General_options::output_is_position_independent): Test -pie.
7597 (General_options::output_is_executable): Return true if not shared
7598 and not relocatable.
7599 (General_options::output_is_pie): Remove.
7600 * options.cc (General_options::finalize): Reject incompatible uses
7602 * gold.cc (queue_middle_tasks): A -pie link is not static.
7603 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7604 * symtab.cc (Symbol::final_value_is_known): Return false if
7605 output_is_position_independent.
7606 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7607 output_is_position_independent.
7608 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7609 output_is_position_independent.
7610 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7611 output_is_position_independent.
7612 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7614 (basic_pie_test.o, basic_pie_test): New targets.
7615 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7616 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7617 (two_file_pie_test): New target.
7618 * testsuite/Makefile.in: Rebuild.
7619 * README: Remove note saying that -pie is not supported.
7621 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7623 * options.h (class General_options): Add -init and -fini.
7624 * layout.cc (Layout::finish_dynamic_section): Emit
7625 given init and fini functions.
7627 2009-10-13 Sriraman Tallam <tmsriram@google.com>
7629 * gc.h (gc_process_relocs): Check if icf is enabled using new
7631 * gold.cc (queue_initial_tasks): Likewise.
7632 (queue_middle_tasks): Likewise.
7633 * object.cc (do_layout): Likewise.
7634 * symtab.cc (is_section_folded): Likewise.
7635 * main.cc (main): Likewise.
7636 * reloc.cc (Read_relocs::run): Likewise.
7637 (Sized_relobj::do_scan_relocs): Likewise.
7638 * icf.cc (is_function_ctor_or_dtor): New function.
7639 (Icf::find_identical_sections): Check if function is ctor or dtor when
7641 * options.h (General_options::icf): Change option to be an enum.
7642 (Icf_status): New enum.
7643 (icf_enabled): New method.
7644 (icf_safe_folding): New method.
7645 (set_icf_status): New method.
7646 (icf_status_): New variable.
7647 * (options.cc) (General_options::finalize): Set icf_status_.
7648 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7649 icf_test and icf_keep_unique_test to use the --icf enum flag.
7650 * testsuite/icf_safe_test.sh: New file.
7651 * testsuite/icf_safe_test.cc: New file.
7653 2009-10-12 Sriraman Tallam <tmsriram@google.com>
7655 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7656 includes to gc.h and icf.h.
7657 * arm.cc: Include gc.h.
7658 * gold.cc: Likewise.
7659 * i386.cc: Likewise.
7660 * powerpc.cc: Likewise.
7661 * sparc.cc: Likewise.
7662 * x86_64.cc: Likewise.
7663 * gc.h: Include icf.h.
7665 2009-10-11 Ian Lance Taylor <iant@google.com>
7667 * plugin.cc: Include "gold.h" before other header files.
7669 2009-10-10 Chris Demetriou <cgd@google.com>
7671 * options.h (Input_file_argument::Input_file_type): New enum.
7672 (Input_file_argument::is_lib_): Replace with...
7673 (Input_file_argument::type_): New member.
7674 (Input_file_argument::Input_file_argument): Take Input_file_type
7675 'type' rather than boolean 'is_lib' as second argument.
7676 (Input_file_argument::is_lib): Use type_.
7677 (Input_file_argument::is_searched_file): New function.
7678 (Input_file_argument::may_need_search): Handle is_searched_file.
7679 * options.cc (General_options::parse_library): Support -l:filename.
7680 (General_options::parse_just_symbols): Update for Input_file_argument
7682 (Command_line::process): Likewise.
7683 * archive.cc (Archive::get_file_and_offset): Likewise.
7684 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7685 * script.cc (read_script_file, script_add_file): Likewise.
7686 * fileread.cc (Input_file::Input_file): Likewise.
7687 (Input_file::will_search_for): Handle is_searched_file.
7688 (Input_file::open): Likewise.
7689 * readsyms.cc (Read_symbols::get_name): Likewise.
7690 * testsuite/Makefile.am (searched_file_test): New test.
7691 * testsuite/Makefile.in: Regenerate.
7692 * testsuite/searched_file_test.cc: New file.
7693 * testsuite/searched_file_test_lib.cc: New file.
7695 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7696 Ian Lance Taylor <iant@google.com>
7698 * descriptor.cc: Include <cstdio> and "binary-io.h".
7699 (Descriptors::open): Open the files in binary mode always.
7700 * script.cc (Lex::get_token): Treat \r as whitespace.
7702 2009-10-09 Ian Lance Taylor <iant@google.com>
7704 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7706 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7707 Ian Lance Taylor <iant@google.com>
7709 * configure.ac: Check for readv function also.
7710 * fileread.cc (readv): Define if not HAVE_READV.
7711 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7713 * config.in: Regenerate.
7714 * configure: Regenerate.
7716 2009-10-09 Doug Kwan <dougkwan@google.com>
7718 * layout.cc (Layout::make_output_section): Call target hook to make
7719 ordinary output section.
7720 (Layout::finalize): Adjust parameter list of call the
7721 Target::may_relax().
7722 * layout.h (class Layout::section_list): New method.
7723 * merge.h (Output_merge_base::entsize): Change visibility to public.
7724 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7726 (Output_merge_string::do_is_string): New method.
7727 * object.cc (Sized_relobj::do_setup): renamed from
7728 Sized_relobj::set_up.
7729 * object.h (Sized_relobj::adjust_shndx,
7730 Sized_relobj::initializ_input_to_output_maps,
7731 Sized_relobj::free_input_to_output_maps): Change visibilities to
7733 (Sized_relobj::setup): Virtualize.
7734 (Sized_relobj::do_setup): New method declaration.
7735 (Sized_relobj::invalidate_section_offset,
7736 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7737 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7738 * options.cc (parse_int): New function.
7739 * options.h (parse_int): New declaration.
7740 (DEFINE_int): New macro.
7741 (stub_group_size): New option.
7742 * output.cc (Output_section::Output_section): Initialize memebers
7743 merge_section_map_, merge_section_by_properties_map_,
7744 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7745 (Output_section::add_input_section): Handled deferred code-fill
7746 generation and remove an old comment.
7747 (Output_section::add_relaxed_input_section): New method definition.
7748 (Output_section::add_merge_input_section): Use merge section by
7749 properties map to speed to search. Update merge section maps
7751 (Output_section::build_relaxation_map): New method definition.
7752 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7754 (Output_section::relax_input_section): Renamed to
7755 Output_section::convert_input_sections_to_relaxed_sections and change
7756 interface to take a vector of pointers to relaxed sections.
7757 (Output_section::find_merge_section,
7758 Output_section::find_relaxed_input_section): New method definitions.
7759 (Output_section::is_input_address_mapped,
7760 Output_section::output_offset, Output_section::output_address):
7761 Use output section data maps to speed up searching.
7762 (Output_section::find_starting_output_address): Add comments.
7763 (Output_section::do_write,
7764 Output_section::write_to_postprocessing_buffer): Do code-fill
7765 generation as appropriate.
7766 (Output_section::get_input_sections): Invalidate relaxed input section
7768 (Output_section::restore_states): Adjust type of checkpoint .
7769 Invalidate relaxed input section map.
7770 * output.h (Output_merge_base): New class declaration.
7771 (Input_section_specifier): New class defintion.
7772 (class Output_relaxed_input_section) Change base class to
7773 Output_section_data_build.
7774 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7775 base class initializer.
7776 (Output_section::add_relaxed_input_section): New method declaration.
7777 (Output_section::Input_section): Change visibility to protected.
7778 (Output_section::Input_section::relobj,
7779 Output_section::Input_section::shndx): Handle relaxed input sections.
7780 Output_section::input_sections) Change visibility to protected. Also
7781 define overload to return a non-const pointer.
7782 (Output_section::Merge_section_properties): New class defintion.
7783 (Output_section::Merge_section_by_properties_map,
7784 Output_section::Output_section_data_by_input_section_map,
7785 Output_section::Relaxation_map): New types.
7786 (Output_section::relax_input_section): Rename method to
7787 Output_section::convert_input_sections_to_relaxed_sections and change
7788 interface to take a vector of relaxed section pointers.
7789 (Output_section::find_merge_section,
7790 Output_section::find_relaxed_input_section,
7791 Output_section::build_relaxation_map,
7792 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7793 New method declarations.
7794 (Output_section::merge_section_map_
7795 Output_section::merge_section_by_properties_map_,
7796 Output_section::relaxed_input_section_map_,
7797 Output_section::is_relaxed_input_section_map_valid_,
7798 Output_section::generate_code_fills_at_write_): New data members.
7799 * script-sections.cc
7800 (Output_section_element_input::set_section_addresses): Call
7801 current_data_size and addralign methods of relaxed input sections.
7802 (Orphan_output_section::set_section_addresses): Call current_data_size
7803 and addralign methods of relaxed input sections.
7804 * symtab.cc (Symbol_table::compute_final_value): Extract template
7805 from the body of Symbol_table::sized_finalize_symbol.
7806 (Symbol_table::sized_finalized_symbol): Call
7807 Symbol_table::compute_final_value.
7808 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7809 (Symbol_table::compute_final_value): New templated method declaration.
7810 * target.cc (Target::do_make_output_section): New method defintion.
7811 * target.h (Target::make_output_section): New method declaration.
7812 (Target::relax): Add more parameters for input objects, symbol table
7813 and layout. Adjust call to do_relax.
7814 (Target::do_make_output_section): New method declaration.
7815 (Target::do_relax): Add parameters for input objects, symbol table
7818 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7820 * pread.c: Include stdio.h.
7822 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7824 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7827 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7829 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7830 Change read_shndx type to unsigned int.
7831 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7833 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7834 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7835 Change read_shndx type to unsigned int.
7836 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7838 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7839 * layout.cc (Layout::create_symtab_sections): Cast the result of
7840 local_symcount * symsize to off_t in the gold_assert.
7842 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7844 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7845 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7847 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7848 (Arm_relocate_functions::thm_abs5): New function.
7849 (Arm_relocate_functions::abs12): New function.
7850 (Arm_relocate_functions::abs16): New function.
7851 (Arm_relocate_functions::base_abs): New function.
7852 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7853 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7854 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7856 (Scan::global): Likewise.
7857 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7858 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7859 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7860 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7863 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7865 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7866 (Arm_relocate_functions::movt_prel): New function.
7867 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7868 (Arm_relocate_functions::thm_movt_prel): New function.
7869 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7870 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7871 (Scan::global, Relocate::relocate): Likewise.
7872 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7874 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7876 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7877 Incremental_checker.
7878 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7880 (class Incremental_inputs_header): New class.
7881 (Incremental_inputs_header_writer): Edit comment.
7882 (Incremental_inputs_entry): New class.
7883 (Incremental_inputs_entry_writer): Edit comment.
7884 (Sized_incremental_binary::do_find_incremental_inputs_section):
7885 Add *strtab_shndx parameter, fill it.
7886 (Sized_incremental_binary::do_check_inputs): New method.
7887 (Incremental_checker::can_incrementally_link_output_file): Use
7888 Sized_incremental_binary::check_inputs.
7889 (Incremental_inputs::report_command_line): Save command line in
7892 (Incremental_binary::find_incremental_inputs_section): New
7894 (Incremental_binary::do_find_incremental_inputs_section): Add
7895 strtab_shndx parameter.
7896 (Incremental_binary::do_check_inputs): New pure virtual method.
7897 (Sized_incremental_binary::do_check_inputs): Declare.
7898 (Incremental_checker::Incremental_checker): Add incremental_inputs
7899 parameter, use it to initialize incremental_inputs_.
7900 (Incremental_checker::incremental_inputs_): New field.
7901 (Incremental_checker::command_line): New method.
7902 (Incremental_checker::inputs): New method.
7903 (Incremental_checker::command_line_): New field.
7905 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7907 * incremental.cc: Include <cstdarg> and "target-select.h".
7908 (vexplain_no_incremental): New function.
7909 (explain_no_incremental): New function.
7910 (Incremental_binary::error): New method.
7911 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7913 (make_sized_incremental_binary): New function.
7914 (open_incremental_binary): New function.
7915 (can_incrementally_link_file): Add checks if output is ELF and has
7917 * incremental.h: Include "elfcpp_file.h" and "output.h".
7918 (Incremental_binary): New class.
7919 (Sized_incremental_binary): New class.
7920 (open_incremental_binary): Declare.
7921 * object.cc (is_elf_object): Use
7922 elfcpp::Elf_recognizer::is_elf_file.
7923 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7924 * output.h (Output_file::filesize): New method.
7926 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7928 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7930 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7931 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7933 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7935 (Arm_relocate_functions::movw_abs_nc): New function.
7936 (Arm_relocate_functions::movt_abs): New function.
7937 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7938 (Arm_relocate_functions::thm_movt_abs): New function.
7939 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7940 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7941 (Scan::global): Likewise.
7942 (Relocate::relocate): Likewise.
7943 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7945 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7947 * arm.cc (Arm_relocate_functions::got_prel) New function.
7948 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7949 (Relocate::relocate): Likewise.
7950 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7952 2009-10-06 Ian Lance Taylor <iant@google.com>
7954 * options.h (class General_options): Define
7955 split_stack_adjust_size parameter.
7956 * object.h (class Object): Add uses_split_stack_ and
7957 has_no_split_stack_ fields. Add uses_split_stack and
7958 has_no_split_stack accessor functions. Declare
7959 handle_split_stack_section.
7960 (class Reloc_symbol_changes): Define.
7961 (class Sized_relobj): Define Function_offsets. Declare
7962 split_stack_adjust, split_stack_adjust_reltype, and
7964 * object.cc (Object::handle_split_stack_section): New function.
7965 (Sized_relobj::do_layout): Call handle_split_stack_section.
7966 * dynobj.cc (Sized_dynobj::do_layout): Call
7967 handle_split_stack_section.
7968 * reloc.cc (Sized_relobj::relocate_sections): Call
7969 split_stack_adjust for executable sections in split_stack
7970 objects. Pass reloc_map to relocate_section.
7971 (Sized_relobj::split_stack_adjust): New function.
7972 (Sized_relobj::split_stack_adjust_reltype): New function.
7973 (Sized_relobj::find_functions): New function.
7974 * target-reloc.h: Include "object.h".
7975 (relocate_section): Add reloc_symbol_changes parameter. Change
7977 * target.h (class Target): Add calls_non_split method. Declare
7978 do_calls_non_split virtual method. Declare match_view and
7980 * target.cc: Include "elfcpp.h".
7981 (Target::do_calls_non_split): New function.
7982 (Target::match_view): New function.
7983 (Target::set_view_to_nop): New function.
7984 * gold.cc (queue_middle_tasks): Give an error if mixing
7985 split-stack and non-split-stack objects with -r.
7986 * i386.cc (Target_i386::relocate_section): Add
7987 reloc_symbol_changes parameter.
7988 (Target_i386::do_calls_non_split): New function.
7989 * x86_64.cc (Target_x86_64::relocate_section): Add
7990 reloc_symbol_changes parameter.
7991 (Target_x86_64::do_calls_non_split): New function.
7992 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7994 * powerpc.cc (Target_powerpc::relocate_section): Add
7995 reloc_symbol_changes parameter.
7996 * sparc.cc (Target_sparc::relocate_section): Add
7997 reloc_symbol_changes parameter.
7998 * configure.ac: Call AM_CONDITIONAL for the default target.
7999 * configure: Rebuild.
8000 * testsuite/Makefile.am (TEST_AS): New variable.
8001 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8002 (check_DATA): Add split_i386 and split_x86_64 files.
8003 (SPLIT_DEFSYMS): Define.
8004 (split_i386_[1234n].o): New targets.
8005 (split_i386_[124]): New targets.
8006 (split_i386_[1234r].stdout): New targets.
8007 (split_x86_64_[1234n].o): New targets.
8008 (split_x86_64_[124]): New targets.
8009 (split_x86_64_[1234r].stdout): New targets.
8010 (MOSTLYCLEANFILES): Add new executables.
8011 * testsuite/split_i386.sh: New file.
8012 * testsuite/split_x86_64.sh: New file.
8013 * testsuite/split_i386_1.s: New file.
8014 * testsuite/split_i386_2.s: New file.
8015 * testsuite/split_i386_3.s: New file.
8016 * testsuite/split_i386_4.s: New file.
8017 * testsuite/split_i386_n.s: New file.
8018 * testsuite/split_x86_64_1.s: New file.
8019 * testsuite/split_x86_64_2.s: New file.
8020 * testsuite/split_x86_64_3.s: New file.
8021 * testsuite/split_x86_64_4.s: New file.
8022 * testsuite/split_x86_64_n.s: New file.
8023 * testsuite/testfile.cc (Target_test): Update relocation_section
8025 * testsuite/Makefile.in: Rebuild.
8027 2009-10-06 Ian Lance Taylor <iant@google.com>
8029 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8030 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8031 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8032 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8033 the address on ldo_addrs_.
8034 (Target_i386::Relocate::fix_up_ldo): New function.
8036 2009-10-06 Rafael Espindola <espindola@google.com>
8038 * plugin.cc (add_input_library): New.
8039 (Plugin::load): Add add_input_library to tv.
8040 (Plugin_manager::add_input_file): Add the is_lib argument.
8041 (add_input_file): Update call to Plugin_manager::add_input_file.
8042 (add_input_library): New.
8043 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8045 2009-09-30 Doug Kwan <dougkwan@google.com>
8047 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8048 symbol and call Symbol::may_need_copy_reloc to determine if
8049 a copy reloc is needed.
8050 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8051 nocopyreloc is given in command line.
8052 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8053 given in command line.
8054 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8055 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8056 of the removed Target_i386::may_need_copy_reloc.
8057 * options.h (copyreloc): New option with default value false.
8058 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8059 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8060 instead of the removed Target_powerpc::may_need_copy_reloc.
8061 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8062 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8063 instead of the removed Target_sparc::may_need_copy_reloc.
8064 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8065 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8066 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8067 instead of the removed Target_x86_64::may_need_copy_reloc.
8069 2009-09-30 Ian Lance Taylor <iant@google.com>
8071 * object.h (class Object): Remove target_ field, and target,
8072 sized_target, and set_target methods.
8073 (Object::sized_target): Remove.
8074 (class Sized_relobj): Update declarations. Remove sized_target.
8075 * object.cc (Sized_relobj::setup): Remove target parameter.
8077 (Input_objects::add_object): Don't do anything with the target.
8078 (make_elf_sized_object): Add punconfigured parameter. Change all
8079 callers. Set or test parameter target.
8080 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8082 * parameters.cc (Parameters::set_target): Change parameter type to
8084 (Parameters::default_target): Remove.
8085 (set_parameters_target): Change parameter type to be non-const.
8086 (parameters_force_valid_target): New function.
8087 (parameters_clear_target): New function.
8088 * parameters.h (class Parameters): Update declarations. Remove
8089 default_target method. Add sized_target and clear_target
8090 methods. Change target_ to be non-const.
8091 (set_parameters_target): Update declaration.
8092 (parameters_force_valid_target): Declare.
8093 (parameters_clear_target): Declare.
8094 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8095 as NULL if we aren't searching.
8096 (Add_symbols::run): Don't check for compatible target.
8097 * fileread.cc (Input_file::open_binary): Call
8098 parameters_force_valid_target.
8099 * gold.cc (queue_middle_tasks): Likewise.
8100 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8101 set_target on object.
8102 * dynobj.h (class Sized_dynobj): Update declarations.
8103 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8104 make_elf_object returns NULL.
8105 (Archive::include_member): Don't check whether object target is
8107 * output.cc (Output_section::add_input_section): Get target from
8109 (Output_section::relax_input_section): Likewise.
8110 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8112 (Sized_relobj::do_scan_relocs): Likewise.
8113 (Sized_relobj::relocate_sections): Likewise.
8114 * resolve.cc (Symbol_table::resolve): Likewise.
8115 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8116 parameter. Change all callers.
8117 (Symbol_table::add_from_object): Get target from parameters.
8118 (Symbol_table::add_from_relobj): Don't check object target.
8119 (Symbol_table::add_from_dynobj): Likewise.
8120 (Symbol_table::define_special_symbol): Get target from
8122 * symtab.h (class Symbol_table): Update declaration.
8123 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8124 parameter. Change all callers. Clear parameter target.
8125 (Binary_test): Test target here.
8126 * testsuite/object_unittest.cc (gold_testsuite): Remove
8127 target_test_pointer parameter. Change all callers.
8128 (Object_test): Test target here.
8130 2009-09-26 Ian Lance Taylor <iant@google.com>
8132 * testsuite/initpri1.c: Don't try to use constructor priorities if
8133 compiling with gcc before 4.3.
8135 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8137 * testsuite/retain_symbols_file_test.sh (check_present): Change
8138 output file name to retain_symbols_file_test.stdout.
8139 (check_absent): Likewise.
8141 2009-09-18 Craig Silverstein <csilvers@google.com>
8143 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8144 * options.cc: Include <cerrno> and <fstream>.
8145 (General_options::finalize): Parse -retain-symbols-file tag.
8146 * options.h: New flag.
8147 (General_options): New method should_retain_symbol, new
8148 variable symbols_to_retain.
8149 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8150 should_retain_symbol map.
8151 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8152 * testsuite/Makefile.in: Regenerate.
8153 * testsuite/retain_symbols_file_test.sh: New file.
8155 2009-09-18 Nick Clifton <nickc@redhat.com>
8157 * po/es.po: Updated Spanish translation.
8159 2009-09-17 Doug Kwan <dougkwan@google.com>
8161 * debug.h (DEBUG_RELAXATION): New constant.
8162 (DEBUG_ALL): Add DEBUG_RELAXATION.
8163 (debug_string_to_enum): Add relaxation debug option.
8165 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8166 Layout::Relaxation_debug_check::read_sections,
8167 Layout::Relaxation_debug_check::read_sections): New method definitions.
8168 (Layout::Layout): Initialize data members
8169 record_output_section_data_from_scrips_,
8170 script_output_section_data_list_ and relaxation_debug_check_.
8171 (Layout::save_segments, Layout::restore_segments,
8172 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8173 Layout::relaxation_loop_body): New method definitions.
8174 (Layout::finalize): Support relaxation. Move section layout code to
8175 Layout::relaxation_loop_body.
8176 (Layout::set_asection_address_from_script): Move code for orphan
8177 section placement out.
8178 (Layout::place_orphan_sections_in_script): New method definition.
8179 * layout.h (Output_segment_headers, Output_file_header):
8180 New forward class declarations.
8181 (Layout::~Layout): Define.
8182 (Layout::new_output_section_data_from_script): New method definition.
8183 (Layout::place_orphan_sections_in_script): New method declaration.
8184 (Layout::Segment_states): New type declaration.
8185 (Layout::save_segments, Layout::restore_segments,
8186 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8187 Layout::relaxation_loop_body): New method declarations.
8188 (Layout::Output_section_data_list): New type declaration.
8189 (Layout::Relaxation_debug_check): New class definition.
8190 (Layout::record_output_section_data_from_script_,
8191 Layout::script_output_section_data_list_, Layout::segment_states_,
8192 Layout::relaxation_debug_check_): New data members.
8193 * output.cc: (Output_section_headers::do_size): New method definition.
8194 (Output_section_headers::Output_section_headers): Move size
8195 computation to Output_section_headers::do_size.
8196 (Output_segment_headers::do_size): New method definition.
8197 (Output_file_header::Output_file_header): Move size computation to
8198 Output_file_header::do_size and call it.
8199 (Output_file_header::do_size): New method definition.
8200 (Output_data_group::Output_data_group): Adjust call to
8201 Output_section_data.
8202 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8203 (Output_symtab_xindex::do_write): Add array bound check.
8204 (Output_section::Input_section::print_to_mapfile): Handle
8205 RELAXED_INPUT_SECTION_CODE.
8206 (Output_section::Output_section): Initialize data member checkpoint_.
8207 (Output_section::~Output_section): Delete checkpoint object pointed
8209 (Output_section::add_input_section): Always add an Input_section if
8211 (Output_section::add_merge_input_section): Add assert.
8212 (Output_section::relax_input_section): New method definition.
8213 (Output_section::set_final_data_size): Set load address to zero for
8214 an unallocated section.
8215 (Output_section::do_address_and_file_offset_have_reset_values):
8216 New method definition.
8217 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8218 Handle relaxed input section.
8219 (Output_section::sort_attached_input_sections): Checkpoint input
8220 section list lazily.
8221 (Output_section::get_input_sections): Change type of input_sections to
8222 list of Simple_input_section pointers. Checkpoint input section list
8223 lazily. Also handle relaxed input sections.
8224 (Output_section::add_input_section_for_script): Take a reference to
8225 a Simple_input_section object instead of Relobj pointer and section
8226 index as parameter. Handle relaxed input sections.
8227 (Output_section::save_states, Output_section::restore_states): New
8229 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8230 (Output_data::is_data_size_fixed): New method definition.
8231 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8233 (Output_data::address_and_file_offset_have_reset_values): New method
8235 (Output_data::do_address_and_file_offset_have_reset_values): New method
8237 (Output_data::set_data_size): Check that data size is not fixed.
8238 (Output_data::fix_data_size): New method definition.
8239 (Output_data::is_data_size_fixed_): New data member.
8240 (Output_section_headers::set_final_data_size): New method definition.
8241 (Output_section_headers::do_size): New method declaration.
8242 (Output_segment_headers::set_final_data_size): New method definition.
8243 (Output_segment_headers::do_size): New method declaration.
8244 (Output_file_header::set_final_data_size)::New method definition.
8245 (Output_file_header::do_size)::New method declaration.
8246 (Output_section_data::Output_section_data): Add new parameter
8247 is_data_size_fixed and use it to fix data size.
8248 (Output_data_const::Output_data_const): Adjust call to base class
8249 constructor and fix data size.
8250 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8251 base class constructor and fix data size.
8252 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8253 base class constructor and fix data size.
8254 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8255 class constructor and fix data size.
8256 (Output_data_group::set_final_data_size): New method definition.
8257 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8258 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8259 class constructor and fix data size.
8260 (Output_relaxed_input_section): New class definition.
8261 (Output_section::Simple_input_section): New class definition.
8262 (Output_section::get_input_sections): Adjust parameter list.
8263 (Output_section::add_input_section_for_script): Same.
8264 (Output_section::save_states, Output_section::restore_states,
8265 Output_section::do_address_and_file_offset_have_reset_values,
8266 (Output_section::Input_section::Input_section): Handle
8267 RELAXED_INPUT_SECTION_CODE. Add new overload for
8268 Output_relaxed_input_section.
8269 (Output_section::Input_section::is_input_section,
8270 Output_section::Input_section::set_output_section): Handle relaxed
8272 (Output_section::Input_section::is_relaxed_input_section,
8273 Output_section::Input_section::output_section_data,
8274 Output_section::Input_section::relaxed_input_section): New method
8276 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8278 (Output_section::Input_section::u1_): Update comments.
8279 (Output_section::Input_section::u2_): Add new union member poris.
8280 (Output_section::Checkpoint_output_section): New classs definition.
8281 (Output_section::relax_input_section): New method declaration.
8282 (Output_section::checkpoint_): New data member.
8283 (Output_segment): Update comments.
8284 (Output_segment::Output_segment): Un-privatize copy constructor.
8285 (Output_segment::operator=): Un-privatize.
8286 * script-sections.cc (Output_section_element::Input_section_list):
8287 Change element type to Output_section::Simple_input_section.
8288 (Output_section_element_dot_assignment::set_section_addresses):
8289 Register output section data for relaxation clean up.
8290 (Output_data_exression::Output_data_expression): Adjust call to base
8291 constructor to fix data size.
8292 (Output_section_element_data::set_section_addresses): Register
8293 Output_data_expression object for relaxation clean up.
8294 (struct Input_section_info): Replace Relobj pointer and section index
8295 pair with Output_section::Simple_input_section and Convert struct to a
8297 (Input_section_sorter::operator()): Adjust access to
8298 Input_section_info data member to use accessors.
8299 (Output_section_element_input::set_section_addresses): Use layout
8300 parameter. Adjust code to use Output_section::Simple_input_section
8301 and Input_secction_info classes. Register filler for relaxation
8303 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8304 and section index pair with Output_section::Simple_input_section
8305 class. Adjust code accordingly.
8306 (Phdrs_element::release_segment): New method definition.
8307 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8309 (Script_sections::release_segments): New method definition.
8310 * gold/script-sections.h (Script_sections::release_segments): New
8312 * gold/target.h (Target::may_relax, Target::relax,
8313 Target::do_may_relax, Target::do_relax): New method definitions.
8315 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8317 * arm.cc (has_signed_unsigned_overflow): New function.
8318 (Arm_relocate_functions::abs8): New function.
8319 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8320 (Target_arm::Scan::global): Likewise.
8321 (Target_arm::relocate::relocate): Likewise.
8322 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8325 2009-09-16 Cary Coutant <ccoutant@google.com>
8327 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8328 * testsuite/Makefile.in: Regenerate.
8330 2009-09-11 Nick Clifton <nickc@redhat.com>
8332 * po/gold.pot: Updated by the Translation project.
8334 2009-09-08 Cary Coutant <ccoutant@google.com>
8336 * output.cc (Output_file::open): Add execute permission to empty file.
8337 * testsuite/Makefile.am (permission_test): New test.
8338 * testsuite/Makefile.in: Regenerate.
8340 2009-09-02 Ian Lance Taylor <iant@google.com>
8342 * output.cc (Output_file::resize): Call map_no_anonymous rather
8345 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8347 * gold.cc: Include "incremental.h".
8348 (queue_initial_tasks): Call Incremental_checker methods.
8349 * incremental.cc: Include "output.h".
8350 (Incremental_checker::can_incrementally_link_output_file): New
8352 * incremental.h (Incremental_checker): New class.
8354 * output.cc (Output_file::open_for_modification): New method.
8355 (Output_file::map_anonymous): Changed return type to bool. Record
8357 (Output_file::map_no_anonymous): New method, broken out of map.
8358 (Output_file::map): Use map_no_anonymous and map_anonymous.
8359 * output.h (class Output_file): Update declarations.
8361 2009-08-24 Cary Coutant <ccoutant@google.com>
8363 * options.h (Command_line::Pre_options): New class.
8364 (Command_line::pre_options): New member.
8365 * options.cc (gold::options::ready_to_register): New variable.
8366 (One_option::register_option): Do nothing if not registering options.
8367 Assert if same short option registered twice.
8368 (General_options::General_options): Turn off option registration when
8370 (Command_line::Pre_options::Pre_options): New constructor.
8372 2009-08-24 Cary Coutant <ccoutant@google.com>
8374 * options.h (General_options::no_keep_memory): Remove incorrect
8377 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8379 * Makefile.am (am__skiplex, am__skipyacc): New.
8380 * Makefile.in: Regenerate.
8382 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8384 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8385 (INCLUDES): ... this.
8386 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8387 (AM_CPPFLAGS): Renamed from ...
8388 (INCLUDE): ... this.
8389 * Makefile.in, testsuite/Makefile.in: Regenerate.
8391 * Makefile.in: Regenerate.
8392 * aclocal.m4: Likewise.
8393 * config.in: Likewise.
8394 * configure: Likewise.
8395 * testsuite/Makefile.in: Likewise.
8397 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8398 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8399 * Makefile.in: Regenerate.
8400 * testsuite/Makefile.in: Regenerate.
8402 2009-08-19 Cary Coutant <ccoutant@google.com>
8404 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8405 symbols in shared libraries overridden by hidden or internal symbols
8406 in the main program.
8408 2009-08-19 Chris Demetriou <cgd@google.com>
8410 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8411 checking source file names in error messages.
8413 2009-08-18 Doug Kwan <dougkwan@google.com>
8415 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8416 an elcpp::Ehdr as parameter. Adjust call to set_target.
8417 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8418 an elfcpp::Ehdr as parameter.
8419 * object.cc (Object::set_target): Remove the version that looks up
8420 a target and sets it.
8421 (Sized_relobj::setup): Take a Target object instead of
8422 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8423 (make_elf_sized_object): Find target and ask target to
8425 * object.h: (Object::set_target): Remove the version that looks up
8426 a target and sets it.
8427 (Sized_relobj::setup): Take a Target object instead of
8428 an elfcpp:Ehdr as parameter.
8429 * target.cc: Include dynobj.h.
8430 (Target::do_make_elf_object_implementation): New.
8431 (Target::do_make_elf_object): New.
8432 * target.h (Target::make_elf_object): New template declaration.
8433 (Target::do_make_elf_object): New method declarations.
8434 (Target::do_make_elf_object_implementation): New template declaration.
8436 2009-08-14 Ian Lance Taylor <iant@google.com>
8438 * gold.h (FUNCTION_NAME): Define.
8439 (gold_unreachable): Use FUNCTION_NAME.
8441 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8443 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8444 symbol in the --keep-unique list is not found.
8446 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8448 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8449 been maked as --keep-unique.
8450 (Icf::unfold_section): New function.
8451 * icf.h (Icf::unfold_section): New function.
8452 * options.h (General_options::keep_unique): New option.
8453 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8454 * testsuite/Makefile.in: Regenerate.
8455 * testsuite/icf_keep_unique_test.sh: New file.
8456 * testsuite/icf_keep_unique_test.cc: New file.
8458 2009-08-12 Cary Coutant <ccoutant@google.com>
8461 * resolve.cc (Symbol_table::resolve): Check for references from
8462 dynamic objects to hidden and internal symbols.
8463 * testsuite/Makefile.am (hidden_test.sh): New test.
8464 * testsuite/Makefile.in: Regenerate.
8465 * testsuite/hidden_test.sh: New script.
8466 * testsuite/hidden_test_1.c: New test source.
8467 * testsuite/hidden_test_main.c: New test source.
8469 2009-08-11 Doug Kwan <dougkwan@google.com>
8471 * arm.cc: Update comments.
8472 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8473 segment to locate the .ARM.exidx section if present.
8475 2009-08-09 Doug Kwan <dougkwan@google.com>
8477 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8480 2009-08-07 Sriraman Tallam <tmsriram@google.com>
8481 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8484 2009-08-06 Sriraman Tallam <tmsriram@google.com>
8486 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8487 valid tls_segment only for non-debug-section relocations.
8488 * testsuite/Makefile.am: Add gc_tls_test.
8489 * testsuite/Makefile.in: Regenerate.
8490 * testsuite/gc_tls_test.cc: New file.
8491 * testsuite/gc_tls_test.sh: New file.
8493 2009-08-05 Sriraman Tallam <tmsriram@google.com>
8497 * Makefile.am (CCFILES): Add icf.cc.
8499 * Makefile.in: Regenerate.
8500 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8501 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8502 section, symbol and addend information for the relocs.
8503 * gold.cc (queue_middle_tasks): Call identical code folding.
8504 * gold.h: Add defines for multimap.
8505 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8506 to the call of finalize_local_symbols.
8507 * main.cc (main): Create object of class Icf.
8508 * object.cc (Sized_relobj::do_layout): Allow this function to be
8509 called twice during icf.
8510 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8511 to sections marked as identical by icf.
8512 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8514 (Sized_relobj::do_section_entsize): New function.
8515 * object.h (Object::section_entsize): New function.
8516 (Object::do_section_entsize): New pure virtual function.
8517 (Relobj::finalize_local_symbols): Add new parameter.
8518 (Relobj::do_section_entsize): New function.
8519 * options.h (General_options::icf): New option.
8520 (General_options::icf_iterations): New option.
8521 (General_options::print_icf_sections): New option.
8522 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8523 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8524 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8526 * symtab.cc (Symbol_table::is_section_folded): New function.
8527 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8528 to sections marked as identical by icf.
8529 * symtab.h (Symbol_table::set_icf): New function.
8530 (Symbol_table::icf): New function.
8531 (Symbol_table::is_section_folded): New function.
8532 (Symbol_table::icf_): New data member.
8533 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8534 * testsuite/Makefile.am: Add commands to build icf_test.
8535 * testsuite/Makefile.in: Regenerate.
8536 * testsuite/icf_test.sh: New file.
8537 * testsuite/icf_test.cc: New file.
8539 2009-07-24 Chris Demetriou <cgd@google.com>
8541 * layout.cc (is_compressible_debug_section): Fix incorrect
8542 comment about compressed section names.
8544 2009-07-20 Ian Lance Taylor <ian@airs.com>
8547 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8549 2009-07-16 Ian Lance Taylor <iant@google.com>
8552 * layout.h: #include <map>.
8553 (class Kept_section): Change from struct to class. Add accessors
8554 and setters. Add section size to Comdat_group mapping. Change
8555 Comdat_group to std::map. Add is_comdat_ field. Add
8556 linkonce_size field in union.
8557 (class Layout): Update declaration of find_or_add_kept_section.
8558 Don't declare find_kept_object.
8559 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8560 parameter. Add object, shndx, is_comdat, and is_group_name
8561 parameters. Change all callers. Adjust for new Kept_section.
8562 (Layout::find_kept_object): Remove.
8563 * object.cc (Sized_relobj::include_section_group): Update use of
8564 Kept_section. Rename secnum to shndx. Only record
8565 Kept_comdat_section if sections are the same size.
8566 (Sized_relobj::include_linkonce_section): Update use of
8567 Kept_section. Only record Kept_comdat_section if sections are the
8568 same size. Set size of linkonce section.
8569 (Sized_relobj::map_to_kept_section): Update call to
8570 get_kept_comdat_section.
8571 * object.h (class Sized_relobj): Rename fields in
8572 Kept_comdat_section to drop trailing underscores; change object
8573 field to Relobj*. Change Kept_comdat_section_table to store
8574 struct rather than pointer.
8575 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8576 Add kept_object and kept_shndx parameters. Change all callers.
8577 (Sized_relobj::get_kept_comdat_section): Change return type to
8578 bool. Add kept_object and kept_shndx parameters. Change all
8580 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8581 Layout::find_or_add_kept_section.
8583 2009-07-09 Ian Lance Taylor <iant@google.com>
8585 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8586 Reserve space in the hash table.
8588 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8590 * fileread.cc (File_read::get_mtime): New method.
8591 * fileread.h (Timespec): New structure.
8592 (File_read::get_mtime): New method.
8593 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8594 Renamed from timestamp_nsec.
8595 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8597 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
8599 (Incremental_inputs::report_archive): Save mtime; style fix.
8600 (Incremental_inputs::report_obejct): Save mtime; style fix.
8601 (Incremental_inputs::report_script): Save mtime; style fix.
8602 (Incremental_inputs::finalize_inputs): Style fix.
8603 (Incremental_inputs::finalize): Style fix.
8604 (Incremental_inputs::create_input_section_data): Store inputs
8606 * incremental.h (Incremental_inputs::report_script): Add mtime
8608 (Incremental_inputs::Input_info::Input_info): Intialize only one
8610 (Incremental_inputs::Input_info::archive): Move to nameless
8612 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8613 (Incremental_inputs::Input_info::script): Move to nameless union.
8614 (Incremental_inputs::mtime): New field.
8615 * script.cc (read_input_script): Pass file mtime to
8617 * script.h (Script_info::inputs): Style fix.
8619 2009-07-01 Ian Lance Taylor <ian@airs.com>
8621 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8624 2009-06-24 Ian Lance Taylor <iant@google.com>
8627 * layout.cc (Layout::choose_output_section): If we find an
8628 existing section, update the flags.
8629 (Layout::create_notes): New function, broken out of
8631 (Layout::finalize): Don't create note sections.
8632 (Layout::create_note): Don't crash if linker script discards
8634 (Layout::create_gold_note): Likewise.
8635 (Layout::create_build_id): Likewise. Don't set
8636 after_input_sections on the section.
8637 (Layout::create_executable_stack_info): Remove target parameter.
8639 * layout.h (class Layout): Declare create_notes. Update
8640 declaration of create_executable_stack_info.
8641 * gold.cc (queue_middle_tasks): Call create_notes.
8642 * output.cc (Output_section::update_flags_for_input_section): Move
8643 here from output.h. If SHF_ALLOC flag is newly set, mark address
8645 * output.h (Output_data::mark_address_invalid): New function.
8646 (class Output_section): Only declare, not define,
8647 update_flags_for_input_section. Remove set_flags.
8649 2009-06-24 Ian Lance Taylor <iant@google.com>
8651 * script-sections.cc (Output_section_definition::
8652 set_section_addresses): Rename shadowing local load_address to
8655 2009-06-24 Ian Lance Taylor <iant@google.com>
8658 * reloc.cc (relocate_sections): Skip empty relocation sections.
8660 2009-06-23 Ian Lance Taylor <iant@google.com>
8663 * layout.cc (Layout::create_note): Use choose_output_section
8664 rather than make_output_section.
8666 2009-06-23 Ian Lance Taylor <iant@google.com>
8669 * options.cc (General_options::parse_V): Set printed_version_.
8670 (General_options::General_options): Initialize printed_version_.
8671 * options.h (class General_options): Add printed_version_ field.
8672 * gold.cc (queue_initial_tasks): If there are no input files,
8673 don't give a fatal error if we printed the version information.
8674 (queue_middle_tasks): If using -r with a shared object, give a
8675 fatal error rather than an ordinary error.
8677 2009-06-23 Ian Lance Taylor <iant@google.com>
8680 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8681 (Layout::make_output_section): Set have_stabstr_section_ if we see
8682 a .stab*str section.
8683 (Layout::finalize): Call link_stabs_sections.
8684 (Layout::link_stabs_sections): New file.
8685 * layout.h (class Layout): Add have_stabstr_section_ field.
8686 Declare link_stabs_sections.
8688 2009-06-23 Doug Kwan <dougkwan@google.com>
8690 * Makefile.am (libgold_a_LIBADD): New.
8691 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8692 * Makefile.in: Regenerate.
8693 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8694 * configure: Regenerate.
8695 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8696 * fileread.cc: Include sys/state.h
8697 * gold.h: Declare memmem and strndup if found missing.
8698 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8700 2009-06-23 Ian Lance Taylor <iant@google.com>
8702 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8703 * configure: Rebuild.
8705 2009-06-23 Ian Lance Taylor <iant@google.com>
8708 * object.cc (Object::section_contents): Don't try to get a view if
8709 the section has length zero.
8710 (Object::handle_gnu_warning_section): If the section is empty, use
8711 the name of the section as the warning.
8713 2009-06-23 Ian Lance Taylor <iant@google.com>
8716 * stringpool.h (class Stringpool_template): Add optimize_ field.
8717 (Stringpool_template::set_optimize): New function.
8718 * stringpool.cc (Stringpool_template::Stringpool_template):
8719 Initialize optimize_ field.
8720 (Stringpool_template::set_string_offsets): Test local optimize
8721 fild rather than parameter.
8722 * layout.cc (Layout::Layout): Call set_optimize on the section
8725 2009-06-22 Ian Lance Taylor <iant@google.com>
8728 * yyscript.y: Parse TARGET.
8729 * script.cc (script_set_target): New function.
8730 * script-c.h (script_set_target): Declare.
8731 * options.cc (General_options::string_to_object_format): Rename
8732 from string_to_object_format in anonymous namespace. Change
8734 * options.h (class General_options): Declare
8735 string_to_object_format.
8737 2009-06-22 Ian Lance Taylor <iant@google.com>
8739 * script-sections.cc (Script_sections::create_segments): Don't put
8740 program headers in a PT_LOAD segment if -n or -N.
8742 2009-06-22 Ian Lance Taylor <iant@google.com>
8745 * options.h (class General_options): Add -z lazy and -z now. Sort
8746 -z options into alphabetical order.
8747 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8749 2009-06-21 Ian Lance Taylor <iant@google.com>
8751 * layout.cc (Layout::make_output_section): Call
8752 Target::new_output_section.
8753 (Layout::attach_allocated_section_to_segment): Put large section
8754 sections in a separate load segment with the large segment flag
8756 (Layout::segment_precedes): Sort large data segments after other
8758 (align_file_offset): New static function.
8759 (Layout::set_segment_offsets): Use align_file_offset.
8760 * output.h (class Output_section): Add is_small_section_ and
8761 is_large_section_ fields.
8762 (Output_section::is_small_section): New function.
8763 (Output_section::set_is_small_section): New function.
8764 (Output_section::is_large_section): New function.
8765 (Output_section::set_is_large_section): New function.
8766 (Output_section::is_large_data_section): New function.
8767 (class Output_segment): Add is_large_data_segment_ field.
8768 (Output_segment::is_large_data_segment): New function.
8769 (Output_segment::set_is_large_data_segment): New function.
8770 * output.cc (Output_section::Output_section): Initialize new
8772 (Output_segment::Output_segment): Likewise.
8773 (Output_segment::add_output_section): Add assertion that large
8774 data sections always go in large data segments. Force small data
8775 sections to the end of the list of data sections. Force small BSS
8776 sections to the start of the list of BSS sections. For large BSS
8777 sections to the end of the list of BSS sections.
8778 * symtab.h (class Symbol): Declare is_common_shndx.
8779 (Symbol::is_defined): Check Symbol::is_common_shndx.
8780 (Symbol::is_common): Likewise.
8781 (class Symbol_table): Define enum Commons_section_type. Update
8782 declarations. Add small_commons_ and large_commons_ fields.
8783 * symtab.cc (Symbol::is_common_shndx): New function.
8784 (Symbol_table::Symbol_table): Initialize new fields.
8785 (Symbol_table::add_from_object): Put small and large common
8786 symbols in the right list.
8787 (Symbol_table::sized_finalized_symbol): Check
8788 Symbol::is_common_shndx.
8789 (Symbol_table::sized_write_globals): Likewise.
8790 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8791 common symbol lists. Don't call do_allocate_commons_list if the
8793 (Symbol_table::do_allocate_commons_list): Remove is_tls
8794 parameter. Add comons_section_type parameter. Change all
8795 callers. Handle small and large common symbols.
8796 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8797 Symbol::is_common_shndx.
8798 * resolve.cc (symbol_to_bits): Likewise.
8799 * target.h (Target::small_common_shndx): New function.
8800 (Target::small_common_section_flags): New function.
8801 (Target::large_common_shndx): New function.
8802 (Target::large_common_section_flags): New function.
8803 (Target::new_output_section): New function.
8804 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8805 small_common_section_flags, and large_common_section_flags
8807 (Target::do_new_output_section): New virtual function.
8808 * arm.cc (Target_arm::arm_info): Initialize new fields.
8809 * i386.cc (Target_i386::i386_info): Likewise.
8810 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8812 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8813 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8814 (Target_x86_64::do_new_output_section): New function.
8815 * configure.ac: Define conditional MCMODEL_MEDIUM.
8816 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8817 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8818 (large_LDFLAGS): Define.
8819 * testsuite/large.c: New file.
8820 * testsuite/testfile.cc (Target_test::test_target_info):
8821 Initialize new fields.
8822 * configure, testsuite/Makefile.in: Rebuild.
8824 2009-06-05 Doug Kwan <dougkwan@google.com>
8826 * Makefile.am (CCFILES): Add target.cc.
8827 * Makefile.in: Regenerate.
8828 * i386.cc (class Target_i386): Define new virtual method to
8829 override do_is_local_label_name in parent.
8830 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8831 local symbols if --discard-locals or -X is given.
8832 * options.h (class General_options): Declare new options
8833 '--discard-locals' and '-X' for discarding locals.
8834 * target.h (class Target): Define new methods is_local_label_name.
8835 Declare new virtual method do_is_local_label_name.
8836 * target.cc: New file.
8837 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8838 (check_SCRIPTS): Add discard_locals_test.sh.
8839 (check_DATA): Add discard_local_tests.syms.
8840 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8841 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8842 * testsuite/Makefile.in: Regenerate.
8843 * testsuite/discard_locals_test.c: New file.
8844 * testsuite/discard_locals_test.sh: Same.
8846 2009-06-05 Doug Kwan <dougkwan@google.com>
8848 * object.cc (Sized_relobj::Sized_relobj): Initialize
8849 discarded_eh_frame_shndx_ to -1U.
8850 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8852 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8853 a discarded .eh_frame section.
8854 (Sized_relobj::do_finalize_local_symbols): Ditto.
8855 * object.h (class Sized_relobj): Declare new member
8856 discarded_eh_frame_shndx_.
8857 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8858 (local_labels_test.o, local_labels_test): New rules.
8859 * testsuite/Makefile.in: Regenerate.
8861 2009-06-04 Doug Kwan <dougkwan@google.com>
8863 * layout.cc (Layout::section_name_mapping): Add mapping for
8864 special ARM sections.
8866 2009-06-03 Doug Kwan <dougkwan@google.com>
8868 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8869 (utils::has_overflow): Same.
8871 2009-06-03 Ian Lance Taylor <iant@google.com>
8873 * layout.cc (Layout::section_name_mapping): New array, replacing
8874 Layout::linkonce_mapping.
8875 (Layout::section_name_mapping_count): New variable, replacing
8876 Layout::linkonce_mapping_count.
8877 (Layout::linkonce_output_name): Remove.
8878 (Layout::output_section_name): Rewrite.
8879 * layout.h (class Layout): Rename Linkonce_mapping to
8880 Section_name_mapping, linkonce_mapping to section_name_mapping,
8881 linkonce_mapping_count to section_name_mapping_count. Don't
8882 declare linkonce_output_name.
8884 2009-06-03 Doug Kwan <dougkwan@google.com>
8886 * gold/arm.cc (namespace utils): New.
8887 (Target_arm::reloc_is_non_pic): Define new method.
8888 (class Arm_relocate_functions): New.
8889 (Target_arm::Relocate::relocate): Handle relocation types used by
8892 2009-06-03 Ian Lance Taylor <iant@google.com>
8894 * arm.cc (Target_arm::scan::global): Use || instead of |.
8896 2009-06-02 Doug Kwan <dougkwan@google.com>
8898 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8899 issued_non_pic_error_.
8900 (class Target_arm::Scan): Declare new method check_non_pic.
8901 Define new method symbol_needs_plt_entry.
8902 Declare new data member issued_non_pic_error_.
8903 (class Target_arm::Relocate): Declare new method
8904 should_apply_static_reloc.
8905 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8906 (Target_arm::Scan::check_non_pic): Define new method.
8907 (Target_arm::Scan::local): Handle a small subset of reloc types used
8909 (Target_arm::Scan::local): Same.
8910 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8912 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8914 * incremental.cc (Incremental_inputs::report_command_line): Filter
8915 out --incremental-* options.
8917 2009-05-29 Doug Kwan <dougkwan@google.com>
8919 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8921 (class Target_arm): Update comment.
8922 (Target_arm::Target_arm): Initialize new data members GOT_,
8923 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8924 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8925 and Target_arm::rel_dyn_section.
8926 Declare new_enum Target_arm::Got_type.
8927 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8929 Update commments for member do_dynsym_value.
8930 (Target_arm::got_size, Target_arm::plt_section,
8931 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8932 new methods inside class defintion.
8933 (Target_arm::got_section): Define new method.
8934 (Target_arm::rel_dyn_section): Same.
8935 (Output_data_plt_arm): New template class.
8936 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8937 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8938 (Output_data_plt_arm::add_entry): Same.
8939 (Output_data_plt_arm::first_plt_entry): Define new
8940 static data member for PLT instruction template.
8941 (Output_data_plt_arm::plt_entry): Same.
8942 (Output_data_plt_arm::do_write): Define new method.
8943 (Target_arm::make_plt_entry): Same.
8944 (Target_arm::do_finalize_sections): Same.
8945 (Target_arm::do_dynsym_value): Same.
8947 2009-05-28 Doug Kwan <dougkwan@google.com>
8949 * Makefile.am (TARGETSOURCES): Add arm.cc.
8950 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8951 * Makefile.in: Regenerate.
8953 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8955 2009-05-26 Doug Kwan <dougkwan@google.com>
8957 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8958 (General_options::check_excluded_libs): Strip off directories in
8959 archive name before matching like GNU ld does.
8960 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8961 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8962 (exclude_libs_test_LDFLAGS): Add linker option
8963 -Wl,--exclude-libs,libexclude_libs_test_3
8964 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8965 an explicit archive without using -l.
8966 (alt/libexclude_libs_test_3.a): New make rule.
8967 * testsuite/Makefile.in: Regenerate.
8968 * testsuite/exclude_libs_test.c : Declare lib3_default().
8970 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8971 * exclude_libs_test_3.c: New file.
8973 2009-05-26 Nick Clifton <nickc@redhat.com>
8975 * po/id.po: New Indonesian translation.
8976 * po/gold.pot: Updated template file.
8978 2009-05-22 Sriraman Tallam <tmsriram@google.com>
8980 * testsuite/Makefile.am: Add -ffunction-sections to compile
8981 gc_comdat_test files. Add -Wl,--gc-sections to build
8983 * testsuite/Makefile.in: Regenerate.
8984 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8986 2009-05-21 Sriraman Tallam <tmsriram@google.com>
8988 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8989 kept comdat section was garbage collected.
8990 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8991 * testsuite/Makefile.in: Regenerate.
8992 * testsuite/gc_comdat_test.sh: New file.
8993 * testsuite/gc_comdat_test_1.cc: New file.
8994 * testsuite/gc_comdat_test_2.cc: New file.
8996 2009-05-19 Doug Kwan <dougkwan@google.com>
8998 * archive.cc (Archive::Archive): Move constructor from archive.h
8999 to here. Initialize no_export_.
9000 (Archive::get_elf_object_for_member): Set no_export flag of object.
9001 * archive.h (Archive::Archive): Move constructor body to
9003 (Archive::no_export): New method.
9004 (Archive::no_export_): New field.
9005 * object.h (Object::Object): Initialize no_export_ to false.
9006 (Object::no_export, Object::set_no_export): New methods.
9007 (Object::no_export_): New field.
9008 * options.cc (General_options::parse_exclude_libs): New method.
9009 (General_options::check_excluded_libs) Same.
9010 * options.h (exclude_libs): New option.
9011 (General_options::check_excluded_libs): New method declaration.
9012 (General_options::excluded_libs_): New field.
9013 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9014 default or protected visibility if an object has no-export flag set.
9015 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9016 (check_SCRIPTS): Add exclude_libs_test.sh.
9017 (check_DATA): Add exclude_libs_test.syms.
9018 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9019 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9020 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9021 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9022 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9023 libexclude_libs_test_2.a): New rules.
9024 * testsuite/Makefile.in: Regenerate.
9025 * testsuite/exclude_libs_test.c: New file.
9026 * testsuite/exclude_libs_test.sh: Ditto.
9027 * testsuite/exclude_libs_test_1.c: Ditto.
9028 * testsuite/exclude_libs_test_2.c: Ditto.
9030 2009-05-15 Ian Lance Taylor <iant@google.com>
9032 * configure.ac: Check for declarations for cases where libiberty.h
9033 checks HAVE_DECL_xxx.
9034 * configure, config.in: Rebuild.
9036 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9038 * gold.h (Incremental_argument_list): Remove (invalid) forward
9040 * incremental.cc (Incremental_inputs::report_achive): New method.
9041 (Incremental_inputs::report_object): New method.
9042 (Incremental_inputs::report_script): New method.
9043 (Incremental_inputs::finalize_inputs): New method.
9044 (Incremental_inputs::finalize): Call finalize_inputs().
9045 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9046 Create inputs entries.
9047 * incremental.h (Incremental_input_type): New enum.
9048 (Incremental_inputs::Incremental_input): Initialize new fields.
9049 (Incremental_inputs::report_inputs): New method.
9050 (Incremental_inputs::report_achive): New method.
9051 (Incremental_inputs::report_object): New method.
9052 (Incremental_inputs::report_script): New method.
9053 (Incremental_inputs::finalize_inputs): New method.
9054 (Incremental_inputs::Input_info): New struct.
9055 (Incremental_inputs::Input_info_map): New typedef.
9056 (Incremental_inputs::lock_): New field.
9057 (Incremental_inputs::Inputs_): New field.
9058 (Incremental_inputs::Inputs_map): New field.
9059 * main.cc (main): Call Incremental_input::report_inputs.
9060 * options.h (Input_argument_list): Typedef moved from
9062 (Input_file_group::Files): Remove, use ::Input_argument_list.
9063 (Input_file_group::Input_argument_list): Remove, use
9064 ::Input_argument_list.
9065 * plugin.cc (Plugin_manager::add_input_file): Add error in
9067 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9069 * script.cc (read_input_script): Call
9070 Incremental_input::report_script.
9071 * script.h (Script_info): New class.
9073 2009-04-27 Ian Lance Taylor <iant@google.com>
9075 * x86_64.cc (do_adjust_output_section): Set entsize to
9078 2009-04-23 Elliott Hughes <enh@google.com>
9080 * output.cc (Output_file::close): After short writes, continue
9081 writing from the correct offset in the buffer being written.
9083 2009-04-23 Chris Demetriou <cgd@google.com>
9085 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9086 * configure: Regenerate.
9087 * config.in: Regenerate.
9088 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9089 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9091 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9093 * incremental.cc (Incremental_inputs_header_data): Renamed from
9094 Incremental_input_header_data.
9095 (Incremental_inputs_header_data::data_size): New field.
9096 (Incremental_inputs_header_data::put_input_file_count): Renamed
9097 from input_file_count.
9098 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9099 from command_line_offset.
9100 (Incremental_inputs_header_data::put_reserved): Renamed from
9102 (Incremental_inputs_entry_data): Renamed from
9103 Incremental_input_entry_data.
9104 (Incremental_inputs_entry_data::data_size): New field.
9105 (Incremental_inputs::report_command_line): New method.
9106 (Incremental_inputs::finalize): New method.
9107 (Incremental_inputs::create_incremental_inputs_data): New method.
9108 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9109 * incremental.h: New file.
9110 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9111 (Layout::finalize): Create incremental inputs section in
9113 (Layout::create_incremental_info_sections): New method.
9114 * layout.h (Layout::incremental_inputs): New method.
9115 (Layout::create_incremental_info_sections): New method.
9116 (Layout::incremental_inputs_): New field.
9117 * main.cc (main): Notify Incremental_input of the command line.
9119 2009-04-01 Ian Lance Taylor <iant@google.com>
9120 Mikolaj Zalewski <mikolajz@google.com>
9122 * gold.h (reserve_unordered_map): Define, three versions, one for
9123 each version of Unordered_map.
9124 * layout.cc (Layout::Layout): Remove options parameter. Add
9125 number_of_input_files parameter. Don't initialize options_.
9126 Initialize number_of_input_files_ and resized_signatures_. Move
9127 sections_are_attached_.
9128 (Layout::layout_group): Reserve space for group_signatures_.
9129 (Layout::find_or_add_kept_section): Change name parameter to be a
9130 reference. Resize signatures_ map when it gets large enough.
9131 (Layout::layout_eh_frame): Use parameters->options() instead of
9133 (Layout::make_output_section): Likewise.
9134 (Layout::attach_allocated_section_to_segment): Likewise.
9135 (Layout::finalize, Layout::create_executable_stack): Likewise.
9136 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9137 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9138 * layout.h (class Layout): Update declarations. Remove options_
9139 field. Add number_of_input_files_ and resized_signatures_
9140 fields. Move sections_are_attached_ field.
9141 * main.cc (main): Pass number of input files to Layout
9142 constructor. Don't pass options.
9144 2009-03-30 Ian Lance Taylor <iant@google.com>
9146 * ffsll.c (ffsll): Correct implementation.
9148 2009-03-27 Ian Lance Taylor <iant@google.com>
9150 * ffsll.c: New file.
9151 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9152 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9153 * ftruncate.c (ftruncate): Declare before definition.
9154 * mremap.c (mremap): Likewise.
9155 * pread.c (pread): Likewise.
9156 * configure, Makefile.in, config.in: Rebuild.
9158 * mremap.c: New file.
9159 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9160 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9161 (mremap): Declare if HAVE_MREMAP is not defined.
9162 * configure, Makefile.in, config.in: Rebuild.
9164 2009-03-27 Cary Coutant <ccoutant@google.com>
9166 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9167 position independent.
9168 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9169 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9171 2009-03-24 Cary Coutant <ccoutant@google.com>
9173 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9175 (needs_dynamic_reloc): Likewise.
9177 2009-03-24 Ian Lance Taylor <iant@google.com>
9179 * yyscript.y (file_cmd): Recognize EXTERN.
9180 (extern_name_list, extern_name_list_body): New nonterminals.
9181 * script.cc (script_add_extern): Define.
9182 * script-c.h (script_add_extern): Declare.
9184 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
9186 * object.cc (is_elf_object): Define.
9187 * object.h (is_elf_object): Declare.
9188 * archive.cc (Archive::get_elf_object_for_member): Call
9190 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
9192 2009-03-24 Elliott Hughes <enh@google.com>
9194 * output.cc (Output_file::map_anonymous): Define.
9195 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9196 try an anonymous one. Report the size if the mmap fails.
9197 * output.h (class Output_file): Declare map_anonymous.
9199 2009-03-24 Ian Lance Taylor <iant@google.com>
9201 * target-select.cc (instantiate_target): Don't acquire the lock if
9202 the instantiated_target_ field has already been set.
9204 2009-03-23 Ian Lance Taylor <iant@google.com>
9206 * gold-threads.h (class Initialize_lock): Define.
9207 * gold-threads.cc (class Initialize_lock_once): Define.
9208 (initialize_lock_control): New static variable.
9209 (initialize_lock_pointer): New static variable.
9210 (initialize_lock_once): New static function.
9211 (Initialize_lock::Initialize_lock): Define.
9212 (Initialize_lock::initialize): Define.
9213 * target-select.h: Include "gold-threads.h".
9214 (class Target_selector): Add lock_ and initialize_lock_ fields.
9215 Don't define instantiate_target, just declare it.
9216 * target-select.cc (Target_selector::Target_selector): Initialize
9218 (Target_selector::instantiate_target): Define.
9219 * descriptors.h: Include "gold-threads.h".
9220 (class Descriptors): Add initialize_lock_ field.
9221 * descriptors.cc (Descriptors::Descriptors): Initialize new
9223 (Descriptors::open): Use initialize_lock_ field
9224 * errors.h (class Errors): Add initialize_lock_ field.
9225 * errors.cc (Errors::Errors): Initialize new field.
9226 (Errors::initialize_lock): Use initialize_lock_ field.
9227 * powerpc.cc (class Target_selector_powerpc): Remove
9228 instantiated_target_ field. In do_recognize call
9229 instantiate_target rather than do_instantiate_target. In
9230 do_instantiate_target just allocate a new target.
9231 * sparc.cc (class Target_selector_sparc): Likewise.
9233 * freebsd.h: New file.
9234 * i386.cc: Include "freebsd.h".
9235 (Target_i386): Derive from Target_freebsd rather than
9237 (Target_selector_i386): Derive from Target_selector_freebsd rather
9238 than Target_selector.
9239 * x86_64.cc: Include "freebsd.h".
9240 (Target_x86_64): Derive from Target_freebsd rather than
9242 (Target_selector_x86_64): Derive from Target_selector_freebsd
9243 rather than Target_selector.
9244 * target.h (class Target): Add adjust_elf_header and
9245 do_adjust_elf_header.
9246 * output.cc (Output_file_header:: do_sized_write): Call target
9247 adjust_elf_header routine.
9248 * configure.tgt: Set targ_osabi.
9249 * configure.ac: Define GOLD_DEFAULT_OSABI.
9250 * parameters.cc (Parameters::default_target): Pass
9251 GOLD_DEFAULT_OSABI to select_target.
9252 * target-select.h (class Target_selector): Make instantiate_target
9253 protected rather than private.
9254 * Makefile.am (HFILES): Add freebsd.h.
9255 * configure, Makefile.in, config.in: Rebuild.
9257 * merge.cc (do_add_input_section): Correct pend value. Change
9258 message about last entry not being null terminated from error to
9261 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9263 * incremental.cc: New file.
9264 * Makefile.am (CCFILES): Add incremental.cc.
9265 * Makefile.in: Rebuild.
9267 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9269 * layout.cc (Layout::output_section_name): Preserve names
9270 of '.note.' sections.
9272 2009-03-19 Ian Lance Taylor <iant@google.com>
9274 * descriptors.cc (Descriptors::open): Check that the options are
9275 valid before using them.
9277 2009-03-18 Ian Lance Taylor <iant@google.com>
9279 * script-sections.h: Include <list>.
9280 (class Script_sections): Change Sections_elements from std::vector
9281 to std::list. Typedef public Elements_iterator. Add
9282 orphan_section_placement_, data_segment_align_start_, and
9283 saw_data_segment_align_ fields. Remove data_segment_align_index_
9285 * script-sections.cc (class Orphan_section_placement): New class.
9286 (class Sections_element): Add virtual functions is_relro and
9287 orphan_section_init. Remove virtual function place_orphan_here.
9288 (class Output_section_definition): Add is_relro and
9289 orphan_section_init. Remove place_orphan_here.
9290 (class Orphan_output_section): Likewise.
9291 (Script_sections::Script_sections): Update for field changes.
9292 (Script_sections::data_segment_align): Set saw_data_segment_align_
9293 and data_segment_align_start_, not data_segment_align_index.
9294 (Script_sections::data_segment_relro_end): Check
9295 saw_data_segment_align_. Use data_segment_align_start_ rather
9296 than data_segment_align_index_.
9297 (Script_sections::place_orphan): Rewrite to use
9298 Orphan_section_placement.
9300 2009-03-17 Ian Lance Taylor <iant@google.com>
9302 * archive.cc (Archive::add_symbols): Check for a version attached
9303 to the symbol name in the archive map.
9304 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9305 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9306 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9307 (ver_test_11.a): New target.
9308 * testsuite/Makefile.in: Rebuild.
9310 * configure.ac: Check for chsize and posix_fallocate. Replace
9312 * ftruncate.c: New file, from gnulib.
9313 * output.cc (posix_fallocate): Define dummy version if not
9314 HAVE_POSIX_FALLOCATE.
9315 (Output_file::map): Call posix_fallocate rather than lseek and
9317 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9318 * configure, Makefile.in, config.in: Rebuild.
9320 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
9322 * layout.h (Layout::create_note): Add section_name parameter.
9323 * layout.cc (Layout::create_note): Likewise.
9324 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
9326 2009-03-17 Ian Lance Taylor <iant@google.com>
9328 * descriptors.cc: Include "options.h".
9329 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9330 (Descriptors::open): Always use O_CLOEXEC when opening a new
9331 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9332 then set FD_CLOEXEC.
9334 * sparc.cc (class Target_sparc): Add has_got_section.
9335 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9336 make sure we have a GOT section.
9338 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9339 (Target_sparc::Scan::local): Likewise.
9340 (Target_sparc::Scan::global): Likewise.
9341 (Target_sparc::Relocate::relocate): Likewise.
9342 (Target_sparc::Relocate::relocate_tls): Likewise.
9344 * symtab.cc (Symbol_table::define_default_version): New function,
9345 broken out of add_from_object.
9346 (Symbol_table::add_from_object): Call define_default_version.
9347 (Symbol_table::define_special_symbol): Add resolve_oldsym
9348 parameter. Change all callers. If the version for a symbol comes
9349 from a version script, resolve it with the symbol with the same
9350 name with no version. Also add the symbol without a version if
9352 (do_define_in_output_data): If resolving with oldsym, don't delete
9354 (do_define_in_output_segment): Likewise.
9355 (do_define_as_constant): Likewise.
9356 * symtab.h (class Symbol_table): Update declarations.
9358 2009-03-13 Ian Lance Taylor <iant@google.com>
9360 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9361 (Read_symbols::requeue): New function.
9362 (Read_symbols::do_read_symbols): If make_elf_object fails because
9363 the target type is not configured, and the file was searched for,
9364 issue a warning and retry with the next directory.
9365 (Add_symbols::run): If the file has an incompatible format, and
9366 it was searched for, requeue the Read_symbols task. On error,
9368 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9369 dirindex parameter to constructor. Change all callers. Declare
9370 incompatible_warning and requeue.
9371 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9372 input_argument_ and input_group_ fields. Add them to
9373 constructor. Change all callers.
9374 (class Read_script): Add dirindex_ field. Add it to constructor.
9376 * archive.cc (Archive::setup): Remove input_objects parameter.
9378 (Archive::get_file_and_offset): Likewise.
9379 (Archive::read_all_symbols): Likewise.
9380 (Archive::read_symbols): Likewise.
9381 (Archive::get_elf_object_for_member): Remove input_objects
9382 parameter. Add punconfigured parameter. Change all callers.
9383 (Archive::add_symbols): Change return type to bool. Check return
9384 value of include_member.
9385 (Archive::include_all_members): Likewise.
9386 (Archive::include_member): Change return type to bool. Return
9387 false if first included object has incompatible target. Set
9388 included_member_ field.
9389 (Add_archive_symbols::run): If add_symbols returns false, requeue
9391 * archive.h (class Archive): Add included_member_ field.
9392 Initialize it in constructor. Add input_file and searched_for
9393 methods. Update declarations.
9394 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9395 input_argument_ fields. Add them to constructor. Change all
9397 * script.cc: Include "target-select.h".
9398 (class Parser_closure): Add skip_on_incompatible_target_ and
9399 found_incompatible_target_ fields. Add
9400 skip_on_incompatible_target parameter to constructor. Change all
9401 callers. Add methods skip_on_incompatible_target,
9402 clear_skip_on_incompatible_target, found_incompatible_target, and
9403 set_found_incompatible_target.
9404 (read_input_script): Add dirindex parameter. Change all callers.
9405 If parser finds an incompatible target, requeue Read_symbols
9407 (script_set_symbol): Clear skip_on_incompatible_target in
9409 (script_add_assertion, script_parse_option): Likewise.
9410 (script_start_sections, script_add_phdr): Likewise.
9411 (script_check_output_format): New function.
9412 * script.h (read_input_script): Update declaration.
9413 * script-c.h (script_check_output_format): Declare.
9414 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9415 (ignore_cmd): Remove OUTPUT_FORMAT.
9416 * fileread.cc (Input_file::Input_file): Add explicit this.
9417 (Input_file::will_search_for): New function.
9418 (Input_file::open): Add pindex parameter. Change all callers.
9419 * fileread.h (class Input_file): Add input_file_argument method.
9420 Declare will_search_for. Update declarations.
9421 * object.cc (make_elf_object): Add punconfigured parameter.
9423 * object.h (class Object): Make input_file public. Add
9424 searched_for method.
9425 (make_elf_object): Update declaration.
9426 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9428 * dirsearch.h (class Dirsearch): Update declaration.
9429 * options.h (class General_options): Add --warn-search-mismatch.
9430 * parameters.cc (Parameters::is_compatible_target): New function.
9431 * parameters.h (class Parameters): Declare is_compatible_target.
9432 * workqueue.cc (Workqueue::add_blocker): New function.
9433 * workqueue.h (class Workqueue): Declare add_blocker.
9435 * fileread.cc (Input_file::open): Remove options parameter.
9437 (Input_file::open_binary): Likewise.
9438 * script.cc (read_input_script): Likewise.
9439 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9440 options parameter from constructor. Change all callers.
9441 (class Read_script): Likewise.
9442 * fileread.h (class Input_file): Update declarations.
9443 * script.h (read_input_script): Update declaration.
9445 2009-03-10 Nick Clifton <nickc@redhat.com>
9447 * po/es.po: New Spanish translation.
9449 2009-03-06 Cary Coutant <ccoutant@google.com>
9451 * options.cc (parse_short_option): Keep dash_z from registering itself.
9453 2009-03-03 Ian Lance Taylor <iant@google.com>
9456 * target-reloc.h (relocate_section): Pass output_section to
9458 * i386.cc (Target_i386::should_apply_static_reloc): Add
9459 output_section parameter. Change all callers.
9460 (Target_i386::Relocate::relocate): Add output_section parameter.
9461 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9462 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9463 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9464 * testsuite/two_file_shared.sh: New script.
9465 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9466 (check_DATA): Add two_file_shared.dbg.
9467 (two_file_shared.dbg): New target.
9468 * testsuite/Makefile.in: Rebuild.
9470 2009-03-01 Ian Lance Taylor <iant@google.com>
9472 * configure.ac: Check for byteswap.h.
9473 * configure: Rebuild.
9474 * config.in: Rebuild.
9476 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9478 * layout.cc (Layout::find_or_add_kept_section): New function.
9479 (Layout::add_comdat): Removed.
9480 * layout.h (struct Kept_section): Move out of class Layout.
9481 Remove trailing underscores from field names. Add group_sections
9482 field. Rename group_ field to is_group. Change all uses.
9483 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9484 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9485 comdat_groups_ field.
9486 (Sized_relobj::include_section_group): Use
9487 find_or_add_kept_section and Kept_section::group_sections.
9488 (Sized_relobj::include_linkonce_section): Likewise.
9489 * object.cc (class Sized_relobj): Don't define Comdat_group or
9490 Comdat_group_table. Remove find_comdat_group and
9491 add_comdat_group. Remove comdat_groups_ field.
9492 * plugin.cc (include_comdat_group): Use
9493 Layout::find_or_add_kept_section.
9495 2009-02-28 Ian Lance Taylor <iant@google.com>
9497 * README: --gc-sections and map files are now supported. Document
9498 some build requirements.
9501 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9502 relocatable link set the value of the section symbol to zero.
9503 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9504 relocatable link don't include the section address in the local
9507 2009-02-27 Ian Lance Taylor <iant@google.com>
9510 * options.h (class Search_directory): Add is_system_directory.
9511 (class General_options): Declare is_in_system_directory.
9512 * options.cc (get_relative_sysroot): Make static.
9513 (get_default_sysroot): Make static.
9514 (General_optoins::is_in_system_directory): New function.
9515 * fileread.cc (Input_file::is_in_system_directory): New function.
9516 * fileread.h (class Input_file): Declare is_in_system_directory.
9517 * object.h (class Object): Add is_in_system_directory.
9518 (class Input_objects): Remove system_library_directory_ field.
9519 * object.cc (Input_objects::add_object): Don't set
9520 system_library_directory_.
9521 (input_objects::found_in_system_library_directory): Remove.
9522 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9523 parameter. Change all callers.
9524 (Symbol_table::sized_write_globals): Likewise.
9525 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9526 Call Object::is_in_system_directory.
9527 * symtab.h (class Symbol_table): Update declarations.
9530 * descriptors.h (Open_descriptor): Add is_on_stack field.
9531 * descriptors.cc (Descriptors::open): If the descriptor is on the
9532 top of the stack, remove it. Initialize is_on_stack field.
9533 (Descriptors::release): Only add pod to stack if it is not on the
9535 (Descriptors::close_some_descriptor): Clear stack_next and
9539 * output.cc (Output_section::find_starting_output_address): Rename
9540 from starting_output_address; add PADDR parameter; change return
9542 * output.h (class Output_section): Declare
9543 find_starting_output_address instead of starting_output_address.
9544 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9545 section symbol for which we can't find a merge section.
9548 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9549 hidden or internal, force the symbol to be local.
9550 * resolve.cc (Symbol::override_visibility): Define.
9551 (Symbol::override_base): Use override_visibility.
9552 (Symbol_table::resolve): Likewise.
9553 (Symbol::override_base_with_special): Likewise.
9554 (Symbol_table::override_with_special): If the visibility is hidden
9555 or internal, force the symbol to be local.
9556 * symtab.h (class Symbol): Add set_visibility and
9557 override_visibility.
9558 * testsuite/ver_test_1.sh: New file.
9559 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9560 (check_DATA): Add ver_test_1.syms.
9561 (ver_test_1.syms): New target.
9562 * testsuite/Makefile.in: Rebuild.
9564 2009-02-25 Cary Coutant <ccoutant@google.com>
9566 * layout.cc (Layout::choose_output_section): Don't rename sections
9567 when using a linker script that has a SECTIONS clause.
9568 * Makefile.in: Regenerate.
9570 * testsuite/Makefile.am (script_test_5.sh): New test case.
9571 * testsuite/Makefile.in: Regenerate.
9572 * testsuite/script_test_5.cc: New file.
9573 * testsuite/script_test_5.sh: New file.
9574 * testsuite/script_test_5.t: New file.
9576 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
9578 * archive.cc (Archive::include_member): Update calls to add_symbols.
9579 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9580 the Layout argument.
9581 * dynobj.h (do_add_symbols): Add the Layout argument.
9582 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9584 * object.h (Object::add_symbols): Add the Layout argument.
9585 (Object::do_add_symbols): Add the Layout argument.
9586 (Sized_relobj::do_add_symbols): Add the Layout argument.
9587 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9588 Unify the two versions.
9589 (Add_plugin_symbols): Remove.
9590 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9591 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9592 (Add_plugin_symbols): Remove.
9593 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9594 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9595 (Add_symbols::run): Make it work with Pulginobj.
9597 2009-02-06 Ian Lance Taylor <iant@google.com>
9599 * object.cc (Sized_relobj::do_layout): Make info message start
9600 with lower case letter.
9602 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9604 * binary.cc: Fix file comment.
9606 * options.h (enum Incremental_disposition): Define.
9607 (class General_options): Add new options: --incremental,
9608 --incremental_changed, --incremental_unchanged,
9609 --incremental_unknown. Add incremental_disposition_ and
9610 implicit_incremental_ fields.
9611 (General_options::incremental_disposition): New function.
9612 (class Position_dependent_options): Add incremental_disposition
9614 (Position_dependent_options::copy_from_options): Set incremental
9616 * options.cc (General_options::parse_incremental_changed): New
9618 (General_options::parse_incremental_unchanged): New function.
9619 (General_options::parse_incremental_unknown): New function.
9620 (General_options::General_options): Initialize new fields
9621 incremental_disposition_ and implicit_incremental_.
9622 (General_options::finalize): Check for uasge of --incremental-*
9623 without --incremental.
9625 2009-02-06 Chris Demetriou <cgd@google.com>
9627 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9628 pointer and to report location as the file name associated with
9630 (gold_undefined_symbol_at_location): New function to replace the
9631 old gold_undefined_symbol functionality.
9632 * target-reloc.h (relocate_section): Update to use
9633 gold_undefined_symbol_at_location.
9634 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9635 Call gold_undefined_symbol function rather than gold_error.
9636 * errors.h (Errors::undefined_symbol): Take location as a
9637 string, rather than calculating it from a relocation.
9638 * errors.cc (Errors::fatal): Print "fatal error:" before the
9640 (Errors::error, Errors::error_at_location): Print "error: "
9641 before the formatted message.
9642 (Errors::undefined_symbol): Take location as a string, rather
9643 than calculating it from a relocation.
9644 (gold_undefined_symbol_at_location): New function akin to
9645 old gold_undefined_symbol, calculates location from relocation.
9646 (gold_undefined_symbol): Change to take only a Symbol pointer
9647 and to report location as the file name associated with the symbol.
9648 * testsuite/debug_msg.sh: Update for changed error messages.
9649 * testsuite/undef_symbol.sh: Likewise.
9651 2009-02-04 Duncan Sands <baldrick@free.fr>
9654 * reduced_debug_output.h
9655 (Output_reduced_debug_abbrev_section::failed): Use format for
9657 (Output_reduced_debug_info_section::faild): Likewise.
9659 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9661 * script.cc (Lazy_demangler): New class.
9662 (Version_script_info::get_symbol_version_helper): Demangle a
9665 2009-01-29 Cary Coutant <ccoutant@google.com>
9667 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9669 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9671 2009-01-28 Ian Lance Taylor <iant@google.com>
9673 * version.cc (version_string): Bump to 1.9.
9675 * gold.h: Include <cstring> and <stdint.h>.
9676 * version.cc: Include <cstdio>.
9677 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9679 * reduced_debug_output.cc (insert_into_vector): Rename from
9680 Insert_into_vector; change all callers. Use Swap_unaligned to
9681 avoid aliasing issue; remove union since it is unnecessary.
9683 2009-01-27 Sriraman Tallam <tmsriram@google.com>
9685 * Makefile.am (CCFILES): Add gc.cc.
9687 * Makefile.in: Regenerate.
9688 * gold.cc (Gc_runner): New class.
9689 (queue_initial_tasks): Call garbage collection related tasks
9690 when corresponding options are invoked.
9691 (queue_middle_gc_tasks): New function.
9692 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9693 processed early before laying out sections during garbage collection.
9694 * gold.h (queue_middle_gc_tasks): New function.
9695 (is_prefix_of): Move from "layout.cc".
9696 * i386.cc (Target_i386::gc_process_relocs): New function.
9697 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9698 * main.cc (main): Create object of class "Garbage_collection".
9699 * object.cc (Relobj::copy_symbols_data): New function.
9700 (Relobj::is_section_name_included): New function.
9701 (Sized_relobj::do_layout): Allow this function to be called twice
9702 during garbage collection and defer layout of section during the
9704 * object.h (Relobj::get_symbols_data): New function.
9705 (Relobj::is_section_name_included): New function.
9706 (Relobj::copy_symbols_data): New function.
9707 (Relobj::set_symbols_data): New function.
9708 (Relobj::get_relocs_data): New function.
9709 (Relobj::set_relocs_data): New function.
9710 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9711 (Relobj::gc_process_relocs): New function.
9712 (Relobj::do_gc_process_relocs): New pure virtual function.
9713 (Relobj::sd_): New data member.
9714 (Sized_relobj::is_output_section_offset_invalid): New function.
9715 (Sized_relobj::do_gc_process_relocs): New function.
9716 * options.h (General_options::gc_sections): Modify to not be a no-op.
9717 (General_options::print_gc_sections): New option.
9718 * plugin.cc (Plugin_finish::run): Remove function call to
9719 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9720 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9721 * reloc.cc (Read_relocs::run): Add task to process relocs and
9722 determine unreferenced sections when doing garbage collection.
9723 (Gc_process_relocs): New class.
9724 (Sized_relobj::do_gc_process_relocs): New function.
9725 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9726 sections that are garbage collected.
9727 * reloc.h (Gc_process_relocs): New class.
9728 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9729 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9730 symbols whose corresponding sections are garbage collected.
9731 (Symbol_table::Symbol_table): Add new parameter for the garbage
9733 (Symbol_table::gc_mark_undef_symbols): New function.
9734 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9735 (Symbol_table::gc_mark_dyn_syms): New function.
9736 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9738 (Symbol_table::add_from_object): Likewise.
9739 (Symbol_table::add_from_relobj): When building shared objects, do not
9740 treat externally visible symbols as garbage.
9741 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9742 table information for static and relocatable links.
9743 * symtab.h (Symbol_table::set_gc): New function.
9744 (Symbol_table::gc): New function.
9745 (Symbol_table::gc_mark_undef_symbols): New function.
9746 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9747 (Symbol_table::gc_mark_dyn_syms): New function.
9748 (Symbol_table::gc_): New data member.
9749 * target.h (Sized_target::gc_process_relocs): New pure virtual
9751 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9752 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9754 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9756 * options.h (General_options::gc_sections): Define as a no-op for now.
9757 (General_options::no_keep_memory): Ditto.
9758 (General_options::Bshareable): Define.
9759 * options.cc (General_options::finalize): Honor -Bshareable.
9761 2009-01-20 Andreas Schwab <schwab@suse.de>
9763 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9764 read the value in the contents, since we don't use it. Use the
9765 template endianness when writing.
9766 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9768 2009-01-19 Andreas Schwab <schwab@suse.de>
9770 * configure.tgt (powerpc64-*): Fix targ_obj.
9772 2009-01-15 Ian Lance Taylor <iant@google.com>
9774 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9775 local symbols when stripping all symbols.
9777 2009-01-14 Cary Coutant <ccoutant@google.com>
9779 * output.cc (Output_reloc): Add explicit instantiations.
9781 2009-01-14 Cary Coutant <ccoutant@google.com>
9783 * archive.cc (Archive::get_elf_object_for_member): Remove call
9784 to File_read::claim_for_plugin.
9785 * descriptors.cc (Descriptors::open): Remove reference to
9787 (Descriptors::claim_for_plugin): Remove.
9788 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9789 (Descriptors::is_claimed): Remove.
9790 (claim_descriptor_for_plugin): Remove.
9791 * fileread.cc (File_read::claim_for_plugin): Remove.
9792 * fileread.h (File_read::claim_for_plugin): Remove.
9793 (File_read::descriptor): Reopen descriptor if necessary.
9794 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9795 (Plugin_manager::all_symbols_read): Add task parameter. Change
9797 (Plugin_manager::get_input_file): New function.
9798 (Plugin_manager::release_input_file): New function.
9799 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9800 corresponding data member.
9801 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9802 and pass to base constructor. Change all callers.
9803 (get_input_file, release_input_file): New functions.
9804 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9805 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9806 (Plugin_manager::all_symbols_read): Add task parameter.
9807 (Plugin_manager::get_input_file): New function.
9808 (Plugin_manager::release_input_file): New function.
9809 (Plugin_manager::task_): New data member.
9810 (Pluginobj::Pluginobj): Add filesize parameter.
9811 (Pluginobj::filename): New function.
9812 (Pluginobj::descriptor): New function.
9813 (Pluginobj::filesize): New function.
9814 (Pluginobj::filesize_): New data member.
9815 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9816 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9817 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9819 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9820 with archive libraries.
9821 * testsuite/Makefile.in: Regenerate.
9822 * testsuite/plugin_test.c (struct sym_info): New type.
9823 (get_input_file, release_input_file): New static variables.
9824 (onload): Capture new transfer vector entries.
9825 (claim_file_hook): Stop reading at end of file according to filesize.
9826 Factor out parsing of readelf output into separate function.
9827 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9828 APIs and get the source file name from the symbol table. Convert
9829 source file name to corresponding object file name. Print info
9830 message when adding new input files.
9831 (parse_readelf_line): New function.
9832 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9833 * testsuite/plugin_test_2.sh: Likewise.
9834 * testsuite/plugin_test_3.sh: Likewise.
9835 * testsuite/plugin_test_4.sh: New test case.
9837 2009-01-07 Ian Lance Taylor <iant@google.com>
9839 * version.cc (version_string): Bump to 1.8.
9841 2008-12-23 Cary Coutant <ccoutant@google.com>
9843 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9844 * plugin.cc (Plugin_manager::finish): Rename as
9845 layout_deferred_objects. Move cleanup to separate function.
9846 (Plugin_manager::cleanup): New function.
9847 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9849 * plugin.h (Plugin_manager::finish): Rename as
9850 layout_deferred_objects.
9851 (Plugin_manager::cleanup): New function.
9852 (Plugin_manager::cleanup_done): New field.
9854 2008-12-23 Cary Coutant <ccoutant@google.com>
9856 * plugin.cc (is_visible_from_outside): New function.
9857 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9858 so we don't return "IR only" status for exported symbols or -r links.
9860 * testsuite/Makefile.am (plugin_test_3): New test case.
9861 * testsuite/Makefile.in: Regenerate.
9862 * testsuite/plugin_test_3.sh: New file.
9864 2008-12-22 Cary Coutant <ccoutant@google.com>
9866 * object.cc (Sized_relobj::layout_section): New function.
9867 (Sized_relobj::do_layout): Defer layout of input sections until after
9868 plugin has provided replacement files.
9869 (Sized_relobj::do_layout_deferred_sections): New function.
9870 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9871 (Relobj::layout_deferred_sections): New function.
9872 (Relobj::do_layout_deferred_sections): New function.
9873 (Sized_relobj::do_layout_deferred_sections): New function.
9874 (Sized_relobj::layout_section): New function.
9875 (Sized_relobj::Deferred_layout): New structure.
9876 (Sized_relobj::deferred_layout_): New field.
9877 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9878 Change all callers. Layout deferred sections.
9879 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9881 (Plugin_hook::run): Move code from do_plugin_hook inline.
9882 (Plugin_hook::do_plugin_hook): Remove.
9883 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9884 (Plugin_manager::finish): Renamed, was cleanup.
9885 (Plugin_manager::should_defer_layout): New function.
9886 (Plugin_manager::add_deferred_layout_object): New function.
9887 (Plugin_manager::Deferred_layout_list): New type.
9888 (Plugin_manager::deferred_layout_objects_): New field.
9889 (Plugin_hook::do_plugin_hook): Remove.
9891 2008-12-17 Ian Lance Taylor <iant@google.com>
9893 * options.h (class General_options): Add --no case for
9896 2008-12-16 Cary Coutant <ccoutant@google.com>
9898 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9900 (Plugin_manager::claim_file): Create plugin object even if
9901 plugin did not call the add_symbols callback.
9902 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9903 asking for more symbols than were added.
9904 * testsuite/Makefile.am (plugin_test_1): Add test case with
9906 (empty.syms): New target.
9907 * testsuite/Makefile.in: Regenerate.
9908 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9909 message. Don't call add_symbols if no globals.
9910 (all_symbols_read_hook): Don't provide replacement for empty
9913 2008-12-12 Ian Lance Taylor <iant@google.com>
9915 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9916 r_type == 0 for a local symbol with r_sym == 0.
9917 (scan_relocatable_relocs): Pass r_sym to
9918 local_non_section_strategy.
9919 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9922 * configure.ac: Update test for TLS descriptors: they are
9923 supported as of glibc 2.9.
9924 * configure: Rebuild.
9926 2008-12-11 Ian Lance Taylor <iant@google.com>
9929 * target-reloc.h (Default_scan_relocatable_relocs): For each
9930 function, map r_type == 0 to RELOC_DISCARD.
9932 2008-12-10 Cary Coutant <ccoutant@google.com>
9934 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9935 object to override a kept COMDAT group from a plugin object.
9937 2008-12-09 Ian Lance Taylor <iant@google.com>
9940 * yyscript.y (file_cmd): Handle INPUT.
9942 * testsuite/initpri1.c: Change all declarations to be full
9943 prototypes by adding void, to avoid compiler warnings.
9945 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
9947 * options.cc (General_options::parse_plugin_opt): New.
9948 (General_options::add_plugin): The argument now is just the filename.
9949 (General_options::add_plugin_option): New.
9950 * options.h (plugin_opt): New.
9951 (add_plugin): Change argument name.
9952 (add_plugin_option): New.
9953 * plugin.cc (Plugin::load): Don't parse the plugin option.
9954 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9955 (Plugin::add_option): New.
9956 (Plugin::args_): Change type.
9957 (Plugin::filename_): New.
9958 (Plugin_manager::add_plugin_option): New.
9959 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9960 * testsuite/Makefile.in: Regenerate.
9962 2008-12-05 Cary Coutant <ccoutant@google.com>
9964 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9965 Handle --strip-lto-sections option.
9966 * options.h (strip_lto_sections): New option.
9968 2008-12-01 Cary Coutant <ccoutant@google.com>
9970 * plugin.cc (ld_plugin_message): Change format parameter to const.
9971 Fix mismatch between new[] and delete.
9973 2008-11-14 Cary Coutant <ccoutant@google.com>
9975 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9978 2008-11-05 Craig Silverstein <csilvers@google.com>
9980 * options.cc (General_options::parse_dynamic_list): New function.
9981 * options.h (General_options): New flags dynamic_list,
9982 dynamic_list_data, dynamic_list_cpp_new, and
9983 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9984 (General_options::in_dynamic_list): New function.
9985 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9986 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9987 (Lex::can_continue_name): Likewise.
9989 (read_script_file): New parameter script_options.
9990 (read_dynamic_list): New function.
9991 (Script_options::define_dynamic_list): New function.
9992 (dynamic_list_keyword_parsecodes): New variable.
9993 (dynamic_list_keywords): New variable.
9994 * script.h (Script_options::define_dynamic_list): New function
9996 (read_dynamic_list): New function prototype.
9997 * symtab.cc (strprefix): New macro.
9998 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9999 dynamic_list_data, dynamic_list_cpp_new, and
10000 dynamic_list_cpp_typeinfo.
10001 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10002 (dynamic_list_expr): New rule.
10003 (dynamic_list_nodes): Likewise.
10004 (dynamic_list_node): Likewise.
10005 * testsuite/Makefile.am (dynamic_list): New test.
10006 * testsuite/Makefile.in: Regenerated.
10007 * testsuite/dynamic_list.t: New file.
10008 * testsuite/dynamic_list.sh: New file.
10010 2008-11-05 Craig Silverstein <csilvers@google.com>
10012 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10013 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10014 (t11_last): Likewise.
10015 * testsuite/ver_test_6.c (main): Likewise.
10017 2008-10-07 Cary Coutant <ccoutant@google.com>
10019 * options.c (General_options::finalize): Add check for -static and
10021 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10024 2008-10-02 Cary Coutant <ccoutant@google.com>
10026 * plugin.cc (make_sized_plugin_object): Fix conditional
10027 compilation to work when not all targets are enabled.
10029 2008-09-29 Cary Coutant <ccoutant@google.com>
10031 * archive.cc (Archive::get_file_and_offset): Use filename instead
10032 of name to get library path.
10033 (Archive::include_member): Unlock external member of a thin archive.
10035 * testsuite/Makefile.am (TEST_AR): New variable.
10036 (thin_archive_test_1): New test.
10037 (thin_archive_test_2): New test.
10038 * testsuite/Makefile.in: Regenerate.
10039 * testsuite/thin_archive_main.cc: New file.
10040 * testsuite/thin_archive_test_1.cc: New file.
10041 * testsuite/thin_archive_test_2.cc: New file.
10042 * testsuite/thin_archive_test_3.cc: New file.
10043 * testsuite/thin_archive_test_4.cc: New file.
10045 2008-09-29 Cary Coutant <ccoutant@google.com>
10047 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10048 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10050 (Sized_relobj::do_finalize_local_symbols): Likewise.
10051 (Sized_relobj::map_to_kept_section): Likewise.
10052 * object.h (Sized_relobj::invalid_address): New constant.
10053 (Sized_relobj::do_output_section_offset): Check for invalid_address
10055 * output.cc (Output_reloc::local_section_offset): Use constant
10056 invalid_address instead of -1U.
10057 (Output_reloc::get_address): Likewise.
10058 (Output_section::output_address): Change -1U to -1ULL.
10059 * output.h (Output_reloc::invalid_address): New constant.
10060 * reloc.cc (Sized_relobj::write_sections): Use constant
10061 invalid_address instead of -1U.
10062 (Sized_relobj::relocate_sections): Likewise.
10063 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10064 values for merge sections.
10065 * target-reloc.h (relocate_for_relocatable): Use constant
10066 invalid_address instead of -1U.
10068 2008-09-19 Cary Coutant <ccoutant@google.com>
10070 Add plugin functionality for link-time optimization (LTO).
10071 * configure.ac (plugins): Add --enable-plugins option.
10072 * configure: Regenerate.
10073 * config.in: Regenerate.
10074 * Makefile.am (LIBDL): New variable.
10075 (CCFILES): Add plugin.cc.
10076 (HFILES): Add plugin.h.
10077 (ldadd_var): Add LIBDL.
10078 * Makefile.in: Regenerate.
10080 * archive.cc: Include "plugin.h".
10081 (Archive::setup): Don't preread archive symbols when using a plugin.
10082 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10083 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10085 (Archive::include_member): Add symbols from plugin objects.
10086 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10087 * descriptors.cc (Descriptors::open): Check for file descriptors
10088 abandoned by plugins.
10089 (Descriptors::claim_for_plugin): New function.
10090 * descriptors.h (Descriptors::claim_for_plugin): New function.
10091 (Open_descriptor::is_claimed): New field.
10092 (claim_descriptor_for_plugin): New function.
10093 * fileread.cc (File_read::claim_for_plugin): New function.
10094 * fileread.h (File_read::claim_for_plugin): New function.
10095 (File_read::descriptor): New function.
10096 * gold.cc: Include "plugin.h".
10097 (queue_initial_tasks): Add task to call plugin hooks for generating
10099 * main.cc: Include "plugin.h".
10100 (main): Load plugin libraries.
10101 * object.h (Pluginobj): Declare.
10102 (Object::pluginobj): New function.
10103 (Object::do_pluginobj): New function.
10104 (Object::set_target): New function.
10105 * options.cc: Include "plugin.h".
10106 (General_options::parse_plugin): New function.
10107 (General_options::General_options): Initialize plugins_ field.
10108 (General_options::add_plugin): New function.
10109 * options.h (Plugin_manager): Declare.
10110 (General_options): Add --plugin option.
10111 (General_options::has_plugins): New function.
10112 (General_options::plugins): New function.
10113 (General_options::add_plugin): New function.
10114 (General_options::plugins_): New field.
10115 * plugin.cc: New file.
10116 * plugin.h: New file.
10117 * readsyms.cc: Include "plugin.h".
10118 (Read_symbols::do_read_symbols): Check for archive before checking
10119 for ELF file. Call plugin hooks to claim files.
10120 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10121 from a real object file; force override when processing replacement
10123 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10124 (Symbol::init_base_object): Likewise.
10125 (Symbol::init_base_output_data): Likewise.
10126 (Symbol::init_base_output_segment): Likewise.
10127 (Symbol::init_base_constant): Likewise.
10128 (Symbol::init_base_undefined): Likewise.
10129 (Symbol::output_section): Assert that object is not a plugin.
10130 (Symbol_table::add_from_pluginobj): New function.
10131 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10133 (Symbol_table::sized_write_globals): Likewise.
10134 (Symbol_table::add_from_pluginobj): Instantiate template.
10135 * symtab.h (Sized_pluginobj): Declare.
10136 (Symbol::in_real_elf): New function.
10137 (Symbol::set_in_real_elf): New function.
10138 (Symbol::in_real_elf_): New field.
10139 (Symbol_table::add_from_pluginobj): New function.
10141 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10142 (LIBDL): New variable.
10143 (LDADD): Add LIBDL.
10144 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10145 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10146 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10147 (MOSTLYCLEANFILES): Likewise.
10148 * testsuite/Makefile.in: Regenerate.
10149 * testsuite/plugin_test.c: New file.
10150 * testsuite/plugin_test_1.sh: New file.
10151 * testsuite/plugin_test_2.sh: New file.
10153 2008-09-16 Ian Lance Taylor <iant@google.com>
10155 * target-reloc.h (relocate_section): Check whether a symbol is
10156 defined by the ABI before reporting an undefined symbol error.
10157 * target.h (Target::is_defined_by_abi): Make parameter const.
10158 (Target::do_is_defined_by_abi): Likewise.
10159 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10160 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10161 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10162 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10163 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10164 * testsuite/Makefile.in: Rebuild.
10166 * fileread.cc (make_view): Add casts to avoid warning.
10168 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10170 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10171 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10173 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10175 * options.h (General_options::output_is_executable): New.
10176 (General_options::output_is_pie): New.
10177 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10178 for shared libraries.
10179 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10181 2008-09-11 Chris Demetriou <cgd@google.com>
10183 * options.h (origin): New -z option.
10184 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10185 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10188 2008-09-05 Cary Coutant <ccoutant@google.com>
10190 * fileread.cc (File_read::make_view): Add check for attempt to map
10191 beyond end of file.
10193 2008-09-05 Cary Coutant <ccoutant@google.com>
10195 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10196 explicit instantiations.
10198 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10201 * options.cc (General_options::finalize): Allow undefined symbols
10202 in shlibs if linking -shared.
10205 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10206 symbols as not needing a dynsym entry.
10208 2008-08-20 Craig Silverstein <csilvers@google.com>
10210 * fileread.cc (File_read::open): Do not lock the file unless it
10211 was successfully opened.
10213 2008-08-14 Cary Coutant <ccoutant@google.com>
10215 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10216 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10217 * testsuite/tls_test.cc (struct int128): 128-bit struct
10218 for testing TLS relocs with non-zero addend.
10219 (v12): New TLS variable.
10221 (t_last): Add check for v12.
10222 * testsuite/tls_test.h (t12): New function.
10223 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10225 2008-08-13 Ian Lance Taylor <iant@google.com>
10227 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10228 set tls_segment_ or relro_segment_.
10229 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10231 * output.h (Output_section::clear_is_relro): New function.
10232 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10233 sections specially even when output_data_ is empty.
10234 (Output_segment::maximum_alignment): When first section is relro,
10235 only force alignment for PT_LOAD segments.
10236 * script.cc (script_data_segment_align): New function.
10237 (script_data_segment_relro_end): New function.
10238 * script-c.h (script_data_segment_align): Declare.
10239 (script_data_segment_relro_end): Declare.
10240 * script-sections.h (class Script_sections): Declare
10241 data_segment_align and data_segment_relro_end. Add fields
10242 segment_align_index_ and saw_relro_end_.
10243 * script-sections.cc (class Sections_element): Add set_is_relro
10244 virtual function. Add new bool* parameter to place_orphan_here.
10245 Add get_output_section virtual function.
10246 (class Output_section_definition): Add set_is_relro. Add new
10247 bool* parameter to place_orphan_here. Add get_output_section.
10248 Add is_relro_ field.
10249 (Output_section_definition::Output_section_definition): Initialize
10250 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10251 and is_relro_ fields.
10252 (Output_section_definition::place_orphan_here): Add is_relro
10254 (Output_section_definition::set_section_addresses): Set relro for
10256 (Output_section_definition::alternate_constraint): Likewise.
10257 (class Orphan_output_section): Add new bool* parameter to
10258 place_orphan_here. Add get_output_section.
10259 (Orphan_output_section::place_orphan_here): Add is_relro
10261 (Script_sections::Script_sections): Initialize
10262 data_segment_align_index_ and saw_relro_end_.
10263 (Script_sections::data_segment_align): New function.
10264 (Script_sections::data_segment_relro_end): New function.
10265 (Script_sections::place_orphan): Set or clear is_relro.
10266 (Script_sections::set_section_addresses): Force alignment of first
10268 * yyscript.y (exp): Call script_data_segment_align and
10269 script_data_segment_relro_end.
10270 * testsuite/relro_script_test.t: New file.
10271 * testsuite/relro_test.cc (using_script): Declare.
10272 (t1, t2): Test using_script.
10273 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10274 (relro_script_test_SOURCES): Define.
10275 (relro_script_test_DEPENDENCIES): Define.
10276 (relro_script_test_LDFLAGS): Define.
10277 (relro_script_test_LDADD): Define.
10278 (relro_script_test.so): New target.
10279 * testsuite/Makefile.in: Rebuild.
10281 2008-08-06 Cary Coutant <ccoutant@google.com>
10283 * archive.cc (Archive::total_archives, Archive::total_members)
10284 (Archive::total_members_loaded): New variables.
10285 (Archive::setup): Add parameter. Add option to preread
10287 (Archive::read_armap): Add counter.
10288 (Archive::get_file_and_offset): New function.
10289 (Archive::get_elf_object_for_member): New function.
10290 (Archive::read_all_symbols): New function.
10291 (Archive::read_symbols): New function.
10292 (Archive::add_symbols): Add counters.
10293 (Archive::include_all_members): Use armap to find members if it's
10295 (Archive::include_member): Skip reading symbols if already read.
10296 Factored code into Archive::get_file_and_offset and
10297 Archive::get_elf_object_for_member. Changed call to
10298 Mapfile::report_include_archive_member.
10299 (Archive::print_stats): New function.
10300 * archive.h: Declare Object and Read_symbols_data classes.
10301 (Archive::Archive): Add initializers for new members.
10302 (Archive::setup): Add parameter.
10303 (Archive::print_stats): New function.
10304 (Archive::total_archives, Archive::total_members)
10305 (Archive::total_members_loaded): New variables.
10306 (Archive::get_file_and_offset): New function.
10307 (Archive::get_elf_object_for_member): New function.
10308 (Archive::read_all_symbols): New function.
10309 (Archive::read_symbols): New function.
10310 (Archive::Archive_member): New class.
10311 (Archive::members_): New member.
10312 (Archive::num_members_): New member.
10313 * main.cc: Include archive.h.
10314 (main): Call Archive::print_stats.
10315 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10316 archive parameter; member_name is now the fully-decorated name.
10317 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10318 * options.h: (General_options): Add --preread-archive-symbols option.
10319 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10322 2008-08-04 Ian Lance Taylor <iant@google.com>
10324 * symtab.h (Symbol::use_plt_offset): New function.
10325 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10326 * powerpc.cc (Relocate::relocate): Likewise.
10327 * sparc.cc (Relocate::relocate): Likewise.
10328 * x86_64.cc (Relocate::relocate): Likewise.
10329 * testsuite/weak_plt.sh: New test.
10330 * testsuite/weak_plt_main.cc: New test.
10331 * testsuite/weak_plt_shared.cc: New test.
10332 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10333 (check_PROGRAMS): Add weak_plt.
10334 (check_DATA): Add weak_plt_shared.so.
10335 (weak_plt_main_pic.o, weak_plt): New targets.
10336 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10337 * testsuite/Makefile.in: Rebuild.
10339 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10341 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10342 * testsuite/Makefile.in: Rebuild.
10344 2008-08-04 Alan Modra <amodra@bigpond.net.au>
10346 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10347 * Makefile.in: Regenerate.
10348 * po/POTFILES.in: Regenerate.
10350 2008-07-29 Ian Lance Taylor <iant@google.com>
10352 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10353 symbols before other symbols.
10354 * testsuite/script_test_2.cc (test_addr): Declare.
10355 (test_addr_alias): Declare.
10356 (main): Check that test_addr and test_addr_alias have the right
10358 * testsuite/script_test_2.t: Define test_addr_alias and
10361 2008-07-24 Ian Lance Taylor <iant@google.com>
10364 * descriptors.cc: New file.
10365 * descriptors.h: New file.
10366 * gold-threads.h (class Hold_optional_lock): New class.
10367 * fileread.cc: Include "descriptors.h".
10368 (File_read::~File_read): Release descriptor rather than closing
10370 (File_read::open) [file]: Call open_descriptor rather than open.
10371 Set is_descriptor_opened_.
10372 (File_read::open) [memory]: Assert that descriptor is not open.
10373 (File_read::reopen_descriptor): New function.
10374 (File_read::release): Release descriptor.
10375 (File_read::do_read): Make non-const. Reopen descriptor.
10376 (File_read::read): Make non-const.
10377 (File_read::make_view): Reopen descriptor.
10378 (File_read::do_readv): Likewise.
10379 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10380 Update declarations.
10381 * layout.cc: Include "descriptors.h".
10382 (Layout::create_build_id): Use open_descriptor rather than open.
10383 * output.cc: Include "descriptors.h".
10384 (Output_file::open): Use open_descriptor rather than open.
10385 * archive.cc (Archive::const_iterator): Change Archive to be
10387 (Archive::begin, Archive::end): Make non-const.
10388 (Archive::count_members): Likewise.
10389 * archive.h (class Archive): Update declarations.
10390 * object.h (Object::read): Make non-const.
10391 * Makefile.am (CCFILES): Add descriptors.cc.
10392 (HFILES): Add descriptors.h.
10393 * Makefile.in: Rebuild.
10396 * gold.h: Always include <clocale>. Add Solaris workarounds
10397 following code in binutils/sysdep.h.
10400 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10401 this->eh_frame_hdr_ is NULL before using it.
10403 * dynobj.cc (Versions::Versions): Update comment.
10405 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10406 the base version name.
10408 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10409 array size plus one.
10410 (Stringpool_template::set_string_offsets): Subtract one from key
10411 before using it as an array index.
10412 (Stringpool_template::get_offset_with_length): Likewise.
10413 (Stringpool_template::write_to_buffer): Likewise.
10414 * stringpool.h (Stringpool_template::get_offset_from_key):
10417 2008-07-23 Ian Lance Taylor <iant@google.com>
10420 * object.h (Merged_symbol_value::value): Do our best to handle a
10424 * script.cc (Version_script_info::get_versions): Don't add empty
10425 version tag to return value.
10426 (Version_script_info::get_symbol_version_helper): Change return
10427 type to bool. Add pversion parameter. Change all callers.
10428 (script_register_vers_node): Don't require a non-NULL tag.
10429 * script.h (class Version_script_info): Update declarations.
10430 (Version_script_info::get_symbol_version): Change return type to
10431 bool. Add version parameter. Change all callers.
10432 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10433 handling. Handle an empty version from a version script.
10434 (Symbol_table::define_special_symbol): Likewise.
10435 * testsuite/ver_test_10.script: New file.
10436 * testsuite/ver_test_10.sh: New file.
10437 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10438 (check_DATA): Add ver_test_10.syms.
10439 (ver_test_10.syms, ver_test_10.so): New target.
10440 * testsuite/Makefile.in: Rebuild.
10442 2008-07-23 Simon Baldwin <simonb@google.com>
10444 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10445 to zero for undefined symbols from dynamic libraries.
10447 2008-07-23 Ian Lance Taylor <iant@google.com>
10449 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10450 Change all callers.
10451 * symtab.h (class Symbol_table): Update declaration.
10452 * testsuite/ver_test_9.cc: New file.
10453 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10454 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10455 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10456 (ver_test_9.so, ver_test_9.o): New targets.
10457 * testsuite/Makefile.in: Rebuild.
10459 2008-07-22 Ian Lance Taylor <iant@google.com>
10461 * options.h (class General_options): Define --check-sections.
10462 * layout.cc (Layout::set_segment_offsets): Handle
10465 * options.h (class General_options): Define -n/--nmagic and
10467 * options.cc (General_options::finalize): For -n/--nmagic or
10468 -N/--omagic, set -static.
10469 * layout.cc (Layout::attach_allocated_section_to_segment): If
10470 -N/--omagic, don't put read-only and read-write sections in
10471 different segments.
10472 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10473 finding a read-only segment.
10474 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10475 don't set the minimum segment alignment to the common page size,
10476 and don't set the file offset to the address modulo the page size.
10477 * script-sections.cc (Script_sections::create_segments): If
10478 -n/--omagic, don't put read-only and read-write sections in
10479 different segments.
10481 * cref.cc: New file.
10482 * cref.h: New file.
10483 * options.h (class General_options): Add --print-symbol-counts.
10484 * main.cc (main): Issue defined symbol report if requested.
10485 * archive.cc (Archive::interpret_header): Make into a const member
10487 (Archive::add_symbols): Call Input_objects::archive_start and
10489 (Archive::const_iterator): Define new class.
10490 (Archive::begin, Archive::end): New functions.
10491 (Archive::include_all_members): Rewrite to use iterator.
10492 (Archive::count_members): New function.
10493 * archive.h (class Archive): Update declarations.
10494 (Archive::filename): New function.
10495 * object.cc: Include "cref.h".
10496 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10497 (Sized_relobj::do_get_global_symbol_counts): New function.
10498 (Input_objects::add_object): Add object to cross-referencer.
10499 (Input_objects::archive_start): New function.
10500 (Input_objects::archive_stop): New function.
10501 (Input_objects::print_symbol_counts): New function.
10502 * object.h: Declare Cref and Archive.
10503 (Object::get_global_symbol_counts): New function.
10504 (Object::do_get_global_symbol_counts): New pure virtual function.
10505 (class Sized_relobj): Add defined_count_ field. Update
10507 (class Input_objects): Add cref_ field. Update constructor.
10508 Update declarations.
10509 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10511 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10513 (Sized_dynobj::do_get_global_symbol_counts): New function.
10514 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10515 defined_count_. Update declarations. Define Symbols typedef.
10516 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10517 parameter. Change all callers.
10518 (Symbol_table::add_from_dynobj): Add sympointers and defined
10519 parameters. Change all callers.
10520 * symtab.h (class Symbol_table): Update declarations.
10521 * Makefile.am (CCFILES): Add cref.cc.
10522 (HFILES): Add cref.h.
10523 * Makefile.in: Rebuild.
10525 2008-07-22 Simon Baldwin <simonb@google.com>
10527 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10528 to zero when writing undefined symbols.
10530 2008-07-22 Ian Lance Taylor <iant@google.com>
10532 * output.cc (Output_section::add_input_section): Don't try to
10533 merge empty merge sections.
10535 2008-07-21 Craig Silverstein <csilvers@google.com>
10537 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10538 Include symbol version in error message.
10540 2008-07-20 Chris Demetriou <cgd@google.com>
10542 * configure.ac (gold_cv_c_random_seed): New configured variable.
10543 (RANDOM_SEED_CFLAGS): New substituted variable.
10544 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10545 * configure: Rebuild.
10546 * Makefile.in: Likewise.
10547 * testsuite/Makefile.in: Likewise.
10549 2008-07-18 Ian Lance Taylor <iant@google.com>
10551 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10552 where we see NAME/NULL and NAME/VERSION as separate symbols.
10553 * testsuite/ver_test_main.cc (main): Call t4.
10554 (t4, t4_2a): Define.
10555 * testsuite/ver_test_2.cc (t4_2): Define.
10556 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10557 * testsuite/ver_test_4.cc (t4_2a): Define.
10558 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10559 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10561 2008-07-17 Ian Lance Taylor <iant@google.com>
10563 * dynobj.cc (Versions::add_def): If we give an error about a
10564 missing version, go ahead and create the version anyhow.
10566 2008-07-10 Ian Lance Taylor <iant@google.com>
10568 Handle output sections with more than 0x7fffffff bytes.
10569 * object.h (class Relobj): Change map_to_output_ to
10570 output_sections_, and just keep a section pointer. Change all
10571 uses. Move comdat group support to Sized_relobj.
10572 (Relobj::is_section_specially_mapped): Remove.
10573 (Relobj::output_section): Remove poff parameter. Change all
10575 (Relobj::output_section_offset): New function.
10576 (Relobj::set_section_offset): Rewrite.
10577 (Relobj::map_to_output): Remove.
10578 (Relobj::output_sections): New function.
10579 (Relobj::do_output_section_offset): New pure virtual function.
10580 (Relobj::do_set_section_offset): Likewise.
10581 (class Sized_relobj): Add section_offsets_ field. Add comdat
10582 group support from Relobj. Update declarations.
10583 (Sized_relobj::get_output_section_offset): New function.
10584 (Sized_relobj::do_output_section_offset): New function.
10585 (Sized_relobj::do_set_section_offset): New function.
10586 * object.cc (Relobj::output_section_address): Remove.
10587 (Sized_relobj::Sized_relobj): Initialize new fields.
10588 (Sized_relobj::include_section_group): Cast find_kept_object to
10590 (Sized_relobj::include_linkonce_section): Likewise.
10591 (Sized_relobj::do_layout): Use separate arrays for output section
10593 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10595 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10596 output_sections and section_offsets.
10597 (Sized_relobj::write_local_symbols): Likewise.
10598 (map_to_kept_section): Compute output address directly.
10599 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10600 output_sections and section_offsets.
10601 (Sized_relobj::write_sections): Likewise.
10602 (Sized_relobj::relocate_sections): Likewise.
10603 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10604 * output.h (class Output_reloc): Update declarations. Change
10605 u2_.relobj to Sized_relobj*.
10606 (class Output_data_reloc): Change add functions to use
10608 * output.cc (Output_reloc::Output_reloc): Change relobj to
10610 (Output_reloc::local_section_offset): Change return type to
10611 Elf_Addr. Use get_output_section_offset.
10612 (Output_reloc::get_address): Likewise.
10613 (Output_section::is_input_address_mapped): Don't call
10614 is_section_specially_mapped.
10615 (Output_section::output_offset): Likewise.
10616 (Output_section::output_address): Likewise.
10617 (Output_section::starting_output_address): Likewise.
10618 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10619 parameter to Sized_relobj*.
10620 (Copy_relocs::need_copy_reloc): Likewise.
10621 (Copy_relocs::save): Likewise.
10622 * copy-relocs.h (class Copy_relocs): Update declarations.
10623 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10624 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10625 * target-reloc.h (relocate_for_relocatable): Change
10626 offset_in_output_section type to Elf_Addr. Change code that uses
10628 * layout.cc (Layout::layout): Always set *off.
10629 * mapfile.cc (Mapfile::print_input_section): Use
10630 output_section_offset.
10631 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10633 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10634 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10635 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10637 2008-07-03 Ian Lance Taylor <iant@google.com>
10639 * layout.cc (Layout::include_section): Do not discard unrecognized
10640 SHT_STRTAB sections.
10642 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10644 * script.cc (Lex::can_continue_name): Make '?' allowable in
10645 version-script names.
10646 * testsuite/version_script.map: Change glob pattern to use '?'
10648 2008-06-30 Manish Singh <yosh@gimp.org>
10651 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10654 2008-06-30 Ian Lance Taylor <iant@google.com>
10658 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10659 versions]: Don't try to read the value in the contents, since we
10660 don't use it. Use the template endianness when writing.
10662 2008-06-25 Cary Coutant <ccoutant@google.com>
10664 * fileread.cc (File_read::make_view): Assert on zero-length view.
10665 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10666 symbol table when there are no symbols to read.
10668 2008-06-23 Craig Silverstein <csilvers@google.com>
10670 * version.cc (version_string): Bump to 1.7
10672 2008-06-18 Craig Silverstein <csilvers@google.com>
10674 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10675 constant 0xFFFF to type Valtype.
10676 (Powerpc_relocate_functions::rel16_ha): Likewise.
10678 2008-06-17 Ian Lance Taylor <iant@google.com>
10680 * output.h (Output_section::Input_section): Initialize p2align_ to
10681 zero for Output_section_data constructors.
10682 (Output_section::Input_section::addralign): If not an input
10683 section, return the alignment of the Output_section_data.
10684 * testsuite/copy_test.cc: New file.
10685 * testsuite/copy_test_1.cc: New file.
10686 * testsuite/copy_test_2.cc: New file.
10687 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10688 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10689 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10690 (copy_test_1_pic.o, copy_test_1.so): New targets.
10691 (copy_test_2_pic.o, copy_test_2.so): New targets.
10692 * testsuite/Makefile.in: Rebuild.
10694 * script-sections.cc (Script_sections::place_orphan): Initialize
10695 local variable exact.
10697 2008-06-13 David Edelsohn <edelsohn@gnu.org>
10699 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10701 2008-06-12 David Edelsohn <edelsohn@gnu.org>
10702 David S. Miller <davem@davemloft.net>
10704 * powerpc.cc: New file.
10705 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10706 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10707 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10708 * Makefile.in: Rebuild.
10710 2008-06-09 Ian Lance Taylor <iant@google.com>
10712 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10714 (throwing, orig_terminate): New static variables.
10715 (terminate_handler): New static function.
10716 (t2): Set terminate handler.
10718 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10721 * binary.cc (Binary_to_elf::sized_convert): Fix .data
10724 2008-05-30 Cary Coutant <ccoutant@google.com>
10726 * archive.cc (Archive::include_all_members) Correct to step
10727 over symbol table and extended name table in thin archives.
10729 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10732 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10735 2008-05-28 Caleb Howe <cshowe@google.com>
10737 * reduced_debug_output.cc: New file.
10738 * reduced_debug_output.h: New file.
10739 * options.h (class General_options): Add --strip-debug-non-line.
10740 * options.cc (General_options::finalize): Add strip_debug_non_line
10741 to the strip heirarchy.
10742 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10744 * layout.cc: Include "reduced_debug_output.h".
10745 (Layout::Layout): Initialize new fields.
10746 (line_only_debug_sections): New static array.
10747 (is_lines_only_debug_sections): New static inline function.
10748 (Layout::include_section): Handle --strip-debug-non-line.
10749 (Layout::make_output_section): If --strip-debug-non-line, build
10750 new output sections for .debug_abbrev and .debug_info.
10751 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10752 gold. Warn about possible overflow.
10753 (read_signed_LEB_128): Likewise.
10754 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10755 (read_signed_LEB_128): Declare.
10756 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10757 (HFILES): Add reduced_debug_output.h.
10758 * Makefile.in: Rebuild.
10760 2008-05-21 Ian Lance Taylor <iant@google.com>
10762 * mapfile.cc: New file.
10763 * mapfile.h: New file.
10764 * options.h (class General_options): Add -M/--print-map and -Map.
10765 * options.cc (General_options::finalize): Make -M equivalent to
10767 * main.cc: Include <cstdio> and "mapfile.h".
10768 (main): Open mapfile if requested.
10769 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10770 constructor. Change caller.
10771 (queue_initial_tasks): Add mapfile parameter. Change caller.
10772 (queue_middle_tasks): Likewise.
10773 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10775 * archive.cc: Include "mapfile.h".
10776 (Archive::add_symbols): Add mapfile parameter. Change all
10777 callers. Pass mapfile, symbol, and reason to include_member.
10778 (Archive::include_all_members): Add mapfile parameter. Change all
10780 (Archive::include_member): Add mapfile, sym, and why parameters.
10781 Change all callers. Report inclusion to map file.
10782 * archive.h: Include "fileread.h".
10783 (class Archive): Update declarations.
10784 (Archive::file): New const method.
10785 (class Add_archive_symbols): Add mapfile_ field. Update
10786 constructor. Change all callers.
10787 * readsyms.h (class Read_symbols): Likewise.
10788 (class Finish_group): Likewise.
10789 (class Read_script): Likewise.
10790 * common.cc: Include "mapfile.h".
10791 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10793 (Symbol_table::do_allocate_commons): Likewise.
10794 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10795 symbol allocation to mapfile.
10796 * common.h (class Allocate_commons_task): Add mapfile_ field.
10797 Update constructor. Change all callers.
10798 * symtab.h (class Symbol_table): Update declarations.
10799 * layout.cc: Include "mapfile.h".
10800 (Layout_task_runner::run): Print information to mapfile.
10801 (Layout::create_gold_note): Change Output_data_fixed_space to
10802 Output_data_zero_fill.
10803 (Layout::create_build_id): Likewise.
10804 (Layout::print_to_mapfile): New function.
10805 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10806 constructor. Change caller.
10807 (class Layout): Declare print_to_mapfile.
10808 * output.cc (Output_section::Input_section::print_to_mapfile): New
10810 (Output_section::add_input_section): If producing a map, always
10811 add to input_sections_ list.
10812 (Output_section::do_print_to_mapfile): New function.
10813 (Output_segment::print_sections_to_mapfile): New function.
10814 (Output_segment::print_section_list_to_mapfile): New function.
10815 * output.h: Include "mapfile.h".
10816 (Output_data::print_to_mapfile): New function.
10817 (Output_data::do_print_to_mapfile): New virtual function.
10818 (Output_segment_headers::do_print_to_mapfile): New function.
10819 (Output_file_header::do_print_to_mapfile): New function.
10820 (Output_data_const::do_print_to_mapfile): New function.
10821 (class Output_data_const_buffer): Add map_name_ field. Update
10822 constructor. Change all callers. Add do_print_to_mapfile
10824 (class Output_data_fixed_space): Likewise.
10825 (class Output_data_space): Likewise.
10826 (class Output_data_zero_fill): New class.
10827 (Output_data_strtab::do_print_to_mapfile): New function.
10828 (Output_data_reloc_base::do_print_to_mapfile): New function.
10829 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10830 (Output_data_group::do_print_to_mapfile): New function.
10831 (Output_data_got::do_print_to_mapfile): New function.
10832 (Output_data_dynamic::do_print_to_mapfile): New function.
10833 (Output_symtab_xindex::do_print_to_mapfile): New function.
10834 (class Output_section): Declare do_print_to_mapflie. Declare
10835 print_to_mapfile in Input_section.
10836 (class Output_segment): Declare new functions.
10837 * object.h (Sized_relobj::symbol_count): New function.
10838 * script-sections.cc
10839 (Output_section_element_dot_assignment::set_section_addresses):
10840 Change Output_data_fixed_space to Output_data_zero_fill.
10841 (Output_data_expression::do_print_to_mapfile): New function.
10842 * script.cc (read_input_script): Add mapfile parameter. Change
10844 * script.h (read_input_script): Update declaration.
10845 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10846 (Eh_frame::do_print_to_mapfile): New function.
10847 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10848 (Output_merge_string::do_print_to_mapfile): New function.
10849 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10851 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10853 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10855 * Makefile.am (CCFILES): Add mapfile.cc.
10856 (HFILES): Add mapfile.h.
10857 * Makefile.in: Rebuild.
10859 2008-05-19 Ian Lance Taylor <iant@google.com>
10861 * options.h (class General_options): Add -z relro.
10862 * layout.cc (Layout::Layout): Initialize relro_segment_.
10863 (Layout::add_output_section_data): Return the output section.
10864 (Layout::make_output_section): Rcognize relro sections and mark
10865 them appropriately.
10866 (Layout::attach_allocated_section_to_segment): Put relro sections
10867 in a PT_GNU_RELRO segment.
10868 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10870 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10872 (Layout::linkonce_mapping): Map d.rel.ro.local to
10873 .data.rel.ro.local.
10874 (Layout::output_section_name): Us .data.rel.ro.local for any
10875 section which begins with that.
10876 * layout.h (class Layout): Update add_output_section_data
10877 declaration. Add relro_segment_ field.
10878 * output.cc (Output_section::Output_section): Initialize is_relro_
10879 and is_relro_local_ fields.
10880 (Output_segment::add_output_section): Group relro sections.
10881 (Output_segment::is_first_section_relro): New function.
10882 (Output_segment::maximum_alignment): If there is a relro section,
10883 align the segment to the common page size.
10884 (Output_segment::set_section_addresses): Track whether we are
10885 looking at relro sections. If the last section is a relro
10886 section, align to the common page size.
10887 (Output_segment::set_section_list_addresses): Add in_relro
10888 parameter. Change all callers. Align to the page size when
10889 moving from relro to non-relro section.
10890 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10892 * output.h (class Output_section): Add is_relro_ and
10893 is_relro_local_ fields.
10894 (Output_section::is_relro): New function.
10895 (Output_section::set_is_relro): New function.
10896 (Output_section::is_relro_local): New function.
10897 (Output_section::set_is_relro_local): New function.
10898 (class Output_segment): Update declarations.
10899 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10900 * sparc.cc (Target_sparc::got_section): Likewise.
10901 * x86_64.cc (Target_x86_64::got_section): Likewise.
10902 * testsuite/relro_test_main.cc: New file.
10903 * testsuite/relro_test.cc: New file.
10904 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10905 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10906 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10907 (relro_test.so, relro_test_pic.o): New targets.
10908 * testsuite/Makefile.in: Rebuild.
10910 2008-05-16 Ian Lance Taylor <iant@google.com>
10912 * output.cc (Output_segment::add_output_section): Remove front
10914 * output.h (class Output_segment): Remove
10915 add_initial_output_section and overloaded add_output_section.
10916 Update declaration of remaining add_output_section.
10917 * layout.cc (Layout::create_interp): Call add_output_section
10918 rather than add_initial_output_section.
10919 (Layout::finish_dynamic_section): Likewise.
10921 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10922 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10923 know the dynamic type.
10924 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10925 field. Initialize it in constructor.
10926 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10927 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10928 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10931 * output.cc (Output_reloc::get_address): Change return type to
10933 * output.h (class Output_reloc): Update get_address declaration.
10934 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10935 for section addresses.
10937 2008-05-09 Ian Lance Taylor <iant@google.com>
10940 * gold.cc (gold_nomem): Use return value of write.
10942 2008-05-08 Ian Lance Taylor <iant@google.com>
10944 * symtab.c (Symbol::init_base_output_data): Add version
10945 parameter. Change all callers.
10946 (Symbol::init_base_output_segment): Likewise.
10947 (Symbol::init_base_constant): Likewise.
10948 (Symbol::init_base_undefined): Likewise.
10949 (Sized_symbol::init_output_data): Likewise.
10950 (Sized_symbol::init_output_segment): Likewise.
10951 (Sized_symbol::init_constant): Likewise.
10952 (Sized_symbol::init_undefined): Likewise.
10953 (Symbol_table::do_define_in_output_data): If the new symbol has a
10954 version, mark it as the default.
10955 (Symbol_table::do_define_in_output_segment): Likewise.
10956 (Symbol_table::do_define_as_constant): Likewise.
10957 * symtab.h (class Symbol): Update declarations.
10958 (class Sized_symbol): Likewise.
10959 * resolve.cc (Symbol::override_version): New function.
10960 (Symbol::override_base): Call override_version.
10961 (Symbol::override_base_with_special): Likewise.
10962 * testsuite/ver_script_8.script: New file.
10963 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10964 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10965 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10966 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10968 2008-05-06 Ian Lance Taylor <iant@google.com>
10971 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10973 (class General_options): Remove existing --undefined, and add
10974 --no-undefined instead. Add new --undefined as synonym for -u.
10975 * archive.cc (Archive::add_symbols): Check whether symbol was
10977 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10978 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10979 all uses. Add IS_UNDEFINED. Update declarations to split
10980 different versions of init_base. Declare init_base_undefined.
10981 (Symbol::is_defined): Handle IS_UNDEFINED.
10982 (Symbol::is_undefined): Likewise.
10983 (Symbol::is_weak_undefined): Call is_undefined.
10984 (Symbol::is_absolute): Handle IS_CONSTANT.
10985 (class Sized_symbol): Update declarations to split different
10986 versions of init. Declare init_undefined.
10987 (class Symbol_table): Declare new functions.
10988 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10989 Change all callers.
10990 (Symbol::init_base_output_data): Likewise.
10991 (Symbol::init_base_output_segment): Likewise.
10992 (Symbol::init_base_constant): Likewise.
10993 (Symbol::init_base_undefined): New function.
10994 (Sized_symbol::init_object): Rename from init. Change all
10996 (Sized_symbol::init_output_data): Likewise.
10997 (Sized_symbol::init_output_segment): Likewise.
10998 (Sized_symbol::init_constant): Likewise.
10999 (Sized_symbol::init_undefined): New function.
11000 (Symbol_table::add_undefined_symbols_from_command_line): New
11002 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11004 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11005 (Symbol::output_section): Likewise.
11006 (Symbol::set_output_section): Likewise.
11007 (Symbol_table::sized_finalize_symbol): Likewise.
11008 (Symbol_table::sized_write_globals): Likewise.
11009 * resolve.cc (Symbol_table::should_override): Likewise.
11010 (Symbol::override_base_with_special): Likewise.
11012 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11013 symbol, change it to have default visibility.
11014 * testsuite/protected_1.cc: New file.
11015 * testsuite/protected_2.cc: New file.
11016 * testsuite/protected_3.cc: New file.
11017 * testsuite/protected_main_1.cc: New file.
11018 * testsuite/protected_main_2.cc: New file.
11019 * testsuite/protected_main_3.cc: New file.
11020 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11021 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11022 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11023 (protected_1.so): New target.
11024 (protected_1_pic.o, protected_2_pic.o): New targets.
11025 (protected_3_pic.o): New target.
11026 (check_PROGRAMS): Add protected_2.
11027 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11028 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11029 * testsuite/Makefile.in: Rebuild.
11031 * options.h (DEFINE_var): Add set_user_set_##varname__.
11032 (DEFINE_bool_alias): New macro.
11033 (class General_options): Define -Bstatic using DEFINE_bool_alias
11034 rather than DEFINE_special. Add --undefined as an alias for -z
11036 * options.cc (General_options::parse_Bstatic): Remove.
11038 * options.h (class General_options): Add --fatal-warnings.
11039 * main.cc (main): Implement --fatal-warnings.
11040 * errors.h (Errors::warning_count): New function.
11042 * options.h (class General_options): Add -Bsymbolic-functions.
11043 * symtab.h (Symbol::is_preemptible): Check for
11044 -Bsymbolic-functions.
11046 2008-05-05 Ian Lance Taylor <iant@google.com>
11048 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11049 as noVARNAME rather than no-VARNAME.
11050 (class General_options): Add option -z combreloc.
11051 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11053 (Output_reloc::sort_before) [SHT_REL]: New function.
11054 (Output_reloc::sort_before) [SHT_RELA]: New function.
11055 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11056 Sort_relocs_comparison.
11057 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11058 parameter. Change all callers.
11059 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11060 sort_relocs parameter. Change all callers.
11061 * output.cc (Output_reloc::get_address): New function, broken out
11063 (Output_reloc::write_rel): Call it.
11064 (Output_reloc::compare): New function.
11065 (Output_data_reloc_base::do_write): Optionally sort relocs.
11067 * configure.ac: If targ_extra_obj is set, link it in.
11068 * configure.tgt: Initialize all variables.
11069 (x86_64*): Set targ_extra_obj and targ_extra_size.
11070 * configure: Rebuild.
11072 * object.cc (Sized_relobj::include_section_group): Adjust section
11073 indexes read from group data. Build vector to pass to
11075 * layout.cc (Layout::layout_group): Add flags and shndxes
11076 parameters. Remove contents parameter. Change caller. Update
11077 explicit instantiations.
11078 * layout.h (class Layout): Update layout_group declaration.
11079 * output.cc (Output_data_group::Output_data_group): Add flags and
11080 input_shndxes parameters. Remove contents parameter. Change
11082 (Output_data_group::do_write): Change input_sections_ to
11084 * output.h (class Output_data_group): Update constructor
11085 declaration. Rename input_sections_ to input_shndxes_.
11086 * testsuite/many_sections_test.cc: Add template.
11088 2008-04-30 Cary Coutant <ccoutant@google.com>
11090 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11092 * layout.cc (Layout::include_section): Refactored check for debug
11094 (Layout::add_comdat): Add new parameters. Change type
11095 of signature parameter. Add object and shndx to signatures table.
11096 (Layout::find_kept_object): New function.
11097 * layout.h: Include <cstring>.
11098 (Layout::is_debug_info_section): New function.
11099 (Layout::add_comdat): Add new parameters.
11100 (Layout::find_kept_object): New function.
11101 (Layout::Kept_section): New struct.
11102 (Layout::Signatures): Change type of map range.
11103 * object.cc (Relobj::output_section_address): New function.
11104 (Sized_relobj::include_section_group): Add new parameters. Change
11105 calls to Layout::add_comdat. Change to build table of kept comdat
11106 groups and table mapping discarded sections to kept sections.
11107 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11108 (Sized_relobj::do_layout): Change calls to include_section_group and
11109 include_linkonce_section.
11110 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11111 value to zero when section is discarded.
11112 (Sized_relobj::map_to_kept_section): New function.
11113 * object.h (Relobj::output_section_address): New function.
11114 (Relobj::Comdat_group): New type.
11115 (Relobj::find_comdat_group): New function.
11116 (Relobj::Comdat_group_table): New type.
11117 (Relobj::Kept_comdat_section): New type.
11118 (Relobj::Kept_comdat_section_table): New type.
11119 (Relobj::add_comdat_group): New function.
11120 (Relobj::set_kept_comdat_section): New function.
11121 (Relobj::get_kept_comdat_section): New function.
11122 (Relobj::comdat_groups_): New field.
11123 (Relobj::kept_comdat_sections_): New field.
11124 (Symbol_value::input_value): Update comment.
11125 (Sized_relobj::map_to_kept_section) New function.
11126 (Sized_relobj::include_linkonce_section): Add new parameter.
11127 * target-reloc.h (Comdat_behavior): New type.
11128 (get_comdat_behavior): New function.
11129 (relocate_section): Add code to map a discarded section to the
11130 corresponding kept section when applying a relocation.
11132 2008-04-30 Craig Silverstein <csilvers@google.com>
11134 * dwarf_reader.cc (next_generation_count): New static var.
11135 (Addr2line_cache_entry): New struct.
11136 (addr2line_cache): New static var.
11137 (Dwarf_line_info::one_addr2line): Added caching.
11138 (Dwarf_line_info::clear_addr2line_cache): New function.
11139 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11140 cache-size parameter.
11141 (Dwarf_line_info::one_addr2line_cache): New function.
11142 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11143 new cache-size argument to one_addr2line(), and clear cache.
11145 2008-04-28 Cary Coutant <ccoutant@google.com>
11147 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11148 R_386_PC8 relocations.
11150 2008-04-23 Ian Lance Taylor <iant@google.com>
11152 * object.cc (Sized_relobj::include_section_group): Check for
11153 invalid section group.
11155 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11158 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11159 than read for file header.
11160 * archive.cc (Archive::include_member): Likewise.
11162 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
11164 * aclocal.m4: Regenerate.
11165 * configure: Regenerate.
11167 2008-04-19 Ian Lance Taylor <iant@google.com>
11169 * version.cc (version_string): Bump to 1.6.
11171 * testsuite/Makefile.am (many_sections_r_test): New target.
11172 (many_sections_r_test_SOURCES): Remove.
11173 (many_sections_r_test_DEPENDENCIES): Remove.
11174 (many_sections_r_test_LDFLAGS): Remove.
11175 (many_sections_r_test_LDADD): Remove.
11177 * object.cc (Sized_relobj::do_add_symbols): Always pass
11178 local_symbol_count_ to add_from_relobj.
11180 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11181 every thousand variables.
11182 * testsuite/Makefile.in: Rebuild.
11184 * object.cc (Xindex::initialize_symtab_xindex): New function.
11185 (Xindex::read_symtab_xindex): New function.
11186 (Xindex::sym_xindex_to_shndx): New function.
11187 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11189 (Sized_relobj::do_initialize_xindex): New function.
11190 (Sized_relobj::do_read_symbols): Adjust section links.
11191 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11192 parameter. Change all callers.
11193 (Sized_relobj::include_section_group): Adjust section links and
11194 symbol section indexes.
11195 (Sized_relobj::do_layout): Adjust section links.
11196 (Sized_relobj::do_count_local_symbols): Adjust section links and
11197 symbol section indexes.
11198 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11199 ordinary and special symbols.
11200 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11201 dynsym_xindex parameters. Change all callers. Adjust section
11202 links. Use SHN_XINDEX when needed.
11203 (Sized_relobj::get_symbol_location_info): Adjust section links.
11204 Don't get fooled by special symbols.
11205 * object.h (class Xindex): Define.
11206 (class Object): Add xindex_ parameter. Declare virtual functoin
11207 do_initialize_xindex.
11208 (Object::adjust_sym_shndx): New function.
11209 (Object::set_xindex): New protected function.
11210 (class Symbol_value): Add is_ordinary_shndx_ field.
11211 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11212 (Symbol_value::value): Assert ordinary section.
11213 (Symbol_value::initialize_input_to_output_map): Likewise.
11214 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11215 Change all callers.
11216 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11218 (class Sized_relobj): Update declarations.
11219 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11220 parameter. Change all callers.
11221 (Sized_relobj::adjust_shndx): New function.
11222 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11224 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11225 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11226 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11227 (Sized_dynobj::read_dynsym_section): Adjust section links.
11228 (Sized_dynobj::read_dynamic): Likewise.
11229 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11231 (Sized_dynobj::do_initialize_xindex): New function.
11232 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11233 do_initialize_xindex.
11234 (Sized_dynobj::adjust_shndx): New function.
11235 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11236 dynsym_xindex_ fields.
11237 (Layout::finalize): Add a call to set_section_indexes before
11238 creating the symtab sections.
11239 (Layout::set_section_indexes): Don't do anything if the section
11240 already has a section index.
11241 (Layout::create_symtab_sections): Add shnum parameter. Change
11242 caller. Create .symtab_shndx section if needed.
11243 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11245 (Layout::allocated_output_section_count): New function.
11246 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11248 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11249 fields. Update declarations.
11250 (Layout::symtab_xindex): New function.
11251 (Layout::dynsym_xindex): New function.
11252 (class Write_symbols_task): Add layout_ field.
11253 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11255 * output.cc (Output_section_headers::Output_section_headers): Add
11256 shstrtab_section parameter. Change all callers.
11257 (Output_section_headers::do_sized_write): Store overflow values
11258 for section count and section string table section index in
11259 section header zero.
11260 (Output_file_header::do_sized_write): Check for overflow of
11261 section count and section string table section index.
11262 (Output_symtab_xindex::do_write): New function.
11263 (Output_symtab_xindex::endian_do_write): New function.
11264 * output.h (class Output_section_headers): Add shstrtab_section_.
11265 Update declarations.
11266 (class Output_symtab_xindex): Define.
11267 (Output_section::has_out_shndx): New function.
11268 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11270 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11271 Change all callers.
11272 (Sized_symbol::init): Likewise.
11273 (Symbol::output_section): Check for ordinary symbol.
11274 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11275 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11277 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11278 Change all callers. Simplify handling of symbols from sections
11279 not included in the link.
11280 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11282 (Weak_alias_sorter::operator()): Assert that symbols are
11284 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11286 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11287 parameters. Change all callers.
11288 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11289 symbol distinction. Use SHN_XINDEX when needed.
11290 (Symbol_table::write_section_symbol): Add symtab_xindex
11291 parameter. Change all callers.
11292 (Symbol_table::sized_write_section_symbol): Likewise. Use
11293 SHN_XINDEX when needed.
11294 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11296 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11297 (Symbol::is_defined): Check is_ordinary.
11298 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11299 (Symbol::is_absolute, Symbol::is_common): Likewise.
11300 (class Sized_symbol): Update declarations.
11301 (class Symbol_table): Update declarations.
11302 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11303 parameters. Change all callers.
11304 (Sized_symbol::override): Likewise.
11305 (Symbol_table::override): Likewise.
11306 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11307 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11308 is_ordinary, and orig_st_shndx parameters. Change all callers.
11309 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11310 to be in an ordinary section.
11311 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11312 object and is_ordinary parameters. Change all callers.
11313 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11314 Change all callers. Don't add undefined or non-ordinary symbols
11316 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11317 Change all callers.
11318 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11320 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11321 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11322 (Sized_relobj::relocate_sections): Likewise.
11323 * target-reloc.h (scan_relocs): Adjust section symbol index.
11324 (scan_relocatable_relocs): Likewise.
11325 * i386.cc (Scan::local): Check for ordinary symbols.
11326 * sparc.cc (Scan::local): Likewise.
11327 * x86_64.cc (Scan::local): Likewise.
11328 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11329 to symbol_section_and_value.
11330 * testsuite/many_sections_test.cc: New file.
11331 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11332 (check_PROGRAMS): Add many_sections_test.
11333 (many_sections_test_SOURCES): Define.
11334 (many_sections_test_DEPENDENCIES): Define.
11335 (many_sections_test_LDFLAGS): Define.
11336 (BUILT_SOURCES): Add many_sections_define.h.
11337 (many_sections_define.h): New target.
11338 (BUILT_SOURCES): Add many_sections_check.h.
11339 (many_sections_check.h): New target.
11340 (check_PROGRAMS): Add many_sections_r_test.
11341 (many_sections_r_test_SOURCES): Define.
11342 (many_sections_r_test_DEPENDENCIES): Define.
11343 (many_sections_r_test_LDFLAGS): Define.
11344 (many_sections_r_test_LDADD): Define.
11345 (many_sections_r_test.o): New target.
11346 * testsuite/Makefile.in: Rebuild.
11348 2008-04-17 Cary Coutant <ccoutant@google.com>
11350 * errors.cc (Errors::info): New function.
11351 (gold_info): New function.
11352 * errors.h (Errors::info): New function.
11353 * gold.h (gold_info): New function.
11354 * object.cc (Input_objects::add_object): Print trace output.
11355 * options.cc (options::parse_set): New function.
11356 (General_options::parse_wrap): Deleted.
11357 (General_options::General_options): Deleted initializer.
11358 * options.h (options::String_set): New typedef.
11359 (options::parse_set): New function.
11360 (DEFINE_set): New macro.
11361 (General_options::wrap): Changed to use DEFINE_set. Changed
11362 callers of any_wrap_symbols and is_wrap_symbol.
11363 (General_options::trace, General_options::trace_symbol):
11365 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11366 (General_options::wrap_symbols_): Deleted.
11367 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11369 2008-04-17 David S. Miller <davem@davemloft.net>
11371 * options.cc (General_options::parse_V): New function.
11372 * options.h: Add entries for -V and -Qy.
11374 2008-04-17 Ian Lance Taylor <iant@google.com>
11376 * common.cc (Symbol_table::allocate_commons): Remove options
11377 parameter. Change caller.
11378 (Symbol_table::do_allocate_commons): Remove options parameter.
11379 Change caller. Just call do_allocate_commons_list twice.
11380 (Symbol_table::do_allocate_commons_list): New function, broken out
11381 of do_allocate_commons.
11382 * common.h (class Allocate_commons_task): Remove options_ field.
11383 Update constructor.
11384 * symtab.cc (Symbol_table::Symbol_table): Initialize
11386 (Symbol_table::add_from_object): Put TLS common symbols on
11388 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11389 which are IN_OUTPUT_DATA.
11390 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11391 allocate_commons and do_allocate_commons declarations. Declare
11392 do_allocate_commons_list.
11393 * gold.cc (queue_middle_tasks): Update creation of
11394 Allocate_commons_task to not pass options.
11395 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11396 (TLS_TEST_C_FLAGS): New variable.
11397 (tls_test_c_pic.o): New target.
11398 (tls_test_shared.so): Link in tls_test_c_pic.o.
11399 (tls_test_c_pic_ie.o): New target.
11400 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11401 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11402 (tls_test_c.o): New target.
11403 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11404 (tls_pic_test_LDADD): Likewise.
11405 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11406 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11407 (tls_test_c_gnu2.o): New target.
11408 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11410 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11411 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11412 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11413 * testsuite/tls_test.cc: Include "config.h".
11414 (t_last): Call t11_last.
11415 * testsuite/tls_test.h (t11, t11_last): Declare.
11416 * testsuite/tls_test_c.c: New file.
11417 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11418 * configure.ac: Check for OpenMP support.
11419 * configure, config.in, Makefile.in: Rebuild.
11420 * testsuite/Makefile.in: Rebuild.
11422 2008-04-16 Cary Coutant <ccoutant@google.com>
11424 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11425 (Target_i386::tls_base_symbol_defined_): New field.
11426 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11427 (Target_i386::Scan::global): Likewise.
11428 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11429 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11430 (Target_x86_64::tls_base_symbol_defined_): New field.
11431 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11432 (Target_x86_64::Scan::global): Likewise.
11434 2008-04-16 Cary Coutant <ccoutant@google.com>
11436 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11437 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11438 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11439 building shared libraries.
11440 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11441 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11442 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11443 * testsuite/Makefile.in: Rebuild.
11444 * testsuite/weak_undef.h: New file.
11445 * testsuite/weak_undef_file1.cc: Add extra test cases.
11446 * testsuite/weak_undef_file2.cc: Likewise.
11447 * testsuite/weak_undef_test.cc: Likewise.
11449 2008-04-16 David S. Miller <davem@davemloft.net>
11451 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11452 Add issued_non_pic_error_ field. Declare check_non_pic.
11453 (Target_sparc::Scan::check_non_pic): New function.
11454 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11455 (Target_sparc::Scan::global): Likewise.
11457 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11458 * configure: Rebuild.
11460 * options.h (DEFINE_enable): New macro.
11461 (new_dtags): New enable option.
11462 (initfirst, interpose, loadfltr, nodefaultlib,
11463 nodelete, nodlopen, nodump): New -z options.
11464 * layout.cc (Layout:finish_dynamic_section): If new
11465 dtags enabled, emit DT_RUNPATH. Also, emit a
11466 DT_FLAGS_1 containing any specified -z flags.
11468 2008-04-16 Ian Lance Taylor <iant@google.com>
11470 * copy-relocs.cc: New file.
11471 * copy-relocs.h: New file.
11472 * reloc.cc: Remove Copy_relocs code.
11473 * reloc.h: Likewise.
11474 * reloc-types.h (struct Reloc_types) [both versions]: Add
11475 get_reloc_addend_noerror.
11476 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11477 variants of add_global which take an addend which must be zero.
11478 * i386.cc: Include "copy-relocs.h".
11479 (class Target_i386): Change type of copy_relocs_ to variable,
11480 update initializer.
11481 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11482 Change all callers.
11483 (Target_i386::do_finalize_sections): Change handling of
11485 * sparc.cc: Include "copy-relocs.h".
11486 (class Target_sparc): Change type of copy_relocs_ to variable,
11487 update initializer.
11488 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11489 Change all callers.
11490 (Target_sparc::do_finalize_sections): Change handling of
11492 * x86_64.cc: Include "copy-relocs.h".
11493 (class Target_x86_64): Change type of copy_relocs_ to variable,
11494 update initializer.
11495 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11496 class. Change all callers.
11497 (Target_x86_64::do_finalize_sections): Change handling of
11499 * Makefile.am (CCFILES): Add copy-relocs.cc.
11500 (HFILES): Add copy-relocs.h.
11502 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11504 * testsuite/script_test_4.sh: Permit leading zeroes.
11506 2008-04-15 Ian Lance Taylor <iant@google.com>
11508 * script-sections.cc (Script_sections::create_segments): Use
11509 header_size_adjustment even when there is enough room for the
11511 * testsuite/script_test_4.sh: New file.
11512 * testsuite/script_test_4.t: New file.
11513 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11514 (check_DATA): Add script_test_4.stdout.
11515 (MOSTLYCLEANFILES): Likewise.
11516 (script_test_4): New target.
11517 (script_test_4.stdout): New target.
11518 * testsuite/Makefile.in: Rebuild.
11520 * sparc.cc: Add definitions for Output_data_plt_sparc class
11523 2008-04-14 David S. Miller <davem@davemloft.net>
11525 * sparc.cc: New file.
11526 * Makefile.am (TARGETSOURCES): Add sparc.cc
11527 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11528 * configure.tgt: Document targ_extra_size and
11529 targ_extra_big_endian. Add entries for sparc-* and
11531 * configure.ac: Handle targ_extra_size and
11532 targ_extra_big_endian.
11533 * Makefile.in: Rebuild.
11534 * configure: Likewise.
11535 * po/POTFILES.in: Likewise.
11536 * po/gold.pot: Likewise.
11538 2008-04-14 Ian Lance Taylor <iant@google.com>
11540 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11541 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11542 in the name/type/flags to section mapping. Don't call
11543 allocate_output_section.
11544 (Layout::choose_output_section): Change parameter from adjust_name
11545 to is_input_section. Don't permit input sections after sections
11546 are attached to segments. Don't call allocate_output_section.
11547 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11548 not write_enable_output_section.
11549 (Layout::make_output_section): Don't push to
11550 unattached_section_list_ nor call attach_to_segment. Call
11551 attach_section_to_segment if sections are attached.
11552 (Layout::attach_sections_to_segments): New function.
11553 (Layout::attach_section_to_segment): New function.
11554 (Layout::attach_allocated_section_to_segment): Rename from
11555 attach_to_segment. Remove flags parameter.
11556 (Layout::allocate_output_section): Remove function.
11557 (Layout::write_enable_output_section): Remove function.
11558 * layout.h (class Layout): Update for above changes. Add new
11559 field sections_are_attached_.
11560 * output.h (Output_section::update_flags_for_input_section): New
11562 * output.cc (Output_section::add_input_section): Call
11563 update_flags_for_input_section.
11564 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11566 2008-04-11 Cary Coutant <ccoutant@google.com>
11568 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11569 thought unnecessary.
11570 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11572 2008-04-11 Ian Lance Taylor <iant@google.com>
11574 * output.h (class Output_section_data): Remove inline definition
11576 * output.cc (Output_section_data::set_addralign): New function.
11578 2008-04-11 Cary Coutant <ccoutant@google.com>
11580 Add support for TLS descriptors for i386 and x86_64.
11581 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11582 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11583 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11585 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11586 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11587 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11589 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11590 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11591 Fix problem with initial-exec relocations.
11592 (Target_i386::Relocate::relocate_tls): Likewise.
11593 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11595 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11596 support for section-plus-offset dynamic table entries.
11597 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11598 (Output_data_dynamic::Dynamic_entry): Add support for
11599 section-plus-offset dynamic table entries.
11600 (Output_data_dynamic::Classification): Likewise.
11601 (Output_data_dynamic::classification_): Renamed offset_.
11602 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11603 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11604 (Target_x86_64::make_plt_section): New function.
11605 (Target_x86_64::reserve_tlsdesc_entries): New function.
11606 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11607 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11608 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11609 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11610 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11611 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11612 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11613 add extra PLT entry for TLS descriptors.
11614 (Output_data_plt_x86_64::got_): New field.
11615 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11616 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11618 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11620 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11621 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11622 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11623 R_386_TLS_DESC_CALL relocations.
11624 (Target_x86_64::Scan::global): Likewise.
11625 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11626 for TLS descriptors.
11627 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11628 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11629 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11630 GD-to-IE relaxation.
11631 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11632 and TLS_DESCRIPTORS.
11633 * Makefile.in: Rebuild.
11634 * configure: Rebuild.
11635 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11636 (tls_test_shared2.so): New target.
11637 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11638 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11639 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11640 (tls_shared_gd_to_ie_test_LDADD): New variable.
11641 (tls_shared_gnu2_gd_to_ie_test): New target.
11642 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11644 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11645 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11646 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11647 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11648 (tls_shared_gnu2_test): New target.
11649 (tls_test_gnu2_shared.so): New target.
11650 (tls_shared_gnu2_test_SOURCES): New variable.
11651 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11652 (tls_shared_gnu2_test_LDFLAGS): New variable.
11653 (tls_shared_gnu2_test_LDADD): New variable.
11654 * testsuite/Makefile.in: Rebuild.
11655 * testsuite/Makefile.
11657 2008-04-11 Ian Lance Taylor <iant@google.com>
11659 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11661 * testsuite/Makefile.in: Rebuild.
11663 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11665 * testsuite/script_test_2.cc (main): Adjust test.
11667 2008-04-11 David S. Miller <davem@davemloft.net>
11668 Ian Lance Taylor <iant@google.com>
11670 * options.h (General_options): Add entries for '-Y' and
11672 * options.cc (General_options:finalize): If -Y was used, add those
11673 entries to the library path instead of the default "/lib" and
11676 2008-04-11 David S. Miller <davem@davemloft.net>
11678 * testsuite/justsyms.t: Start at 0x100.
11679 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
11680 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11682 * testsuite/script_test_2.cc: Adjust string and section length
11685 2008-04-09 Ian Lance Taylor <iant@google.com>
11688 * script-sections.cc (Sections_element::allocate_to_segment): Add
11690 (Output_section_definition::allocate_to_segment): Likewise.
11691 (Orphan_output_section::allocate_to_segment): Likewise.
11692 (Script_sections::attach_sections_using_phdrs_clause): Don't
11693 propagate non-PT_LOAD segments to orphan sections.
11694 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11695 readelf rather than objdump.
11696 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11697 .interp section and PT_INTERP segment are the same size.
11698 * testsuite/Makefile.in: Rebuild.
11700 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11701 aliases for symbols defined in the same object.
11702 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11703 (weak_alias_test_SOURCES): New variable.
11704 (weak_alias_test_DEPENDENCIES): New variable.
11705 (weak_alias_test_LDFLAGS): New variable.
11706 (weak_alias_test_LDADD): New variable.
11707 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11708 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11709 (weak_alias_test_3.o): New target.
11710 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11711 * testsuite/weak_alias_test_main.cc: New file.
11712 * testsuite/weak_alias_test_1.cc: New file.
11713 * testsuite/weak_alias_test_2.cc: New file.
11714 * testsuite/weak_alias_test_3.cc: New file.
11716 2008-04-08 Ian Lance Taylor <iant@google.com>
11718 * options.h (class General_options): Add --noinhibit-exec option.
11719 * main.cc (main): Check --noinhibit-exec.
11721 * options.h (class General_options): Define --wrap as a special
11722 option. Add wrap_symbols_ field.
11723 (General_options::any_wrap_symbols): New function.
11724 (General_options::is_wrap_symbol): New function.
11725 * options.cc (General_options::parse_wrap): New function.
11726 (General_options::General_options): Initialize wrap_symbols_.
11727 * symtab.cc (Symbol_table::wrap_symbol): New function.
11728 (Symbol_table::add_from_object): Handle --wrap.
11729 * symtab.h (class Symbol_table): Declare wrap_symbol.
11730 * target.h (Target::wrap_char): New function.
11731 (Target::Target_info): Add wrap_char field.
11732 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11733 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11734 * testsuite/testfile.cc (Target_test::test_target_info):
11737 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11740 * layout.h (class Layout): Add added_eh_frame_data_ field.
11741 * layout.cc (Layout::Layout): Initialize new field.
11742 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11743 output section until we find a section we merged successfully.
11744 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11745 that the size be non-zero.
11747 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11750 2008-04-08 Craig Silverstein <csilvers@google.com>
11752 * configure.ac: Export new conditional variable HAVE_ZLIB.
11753 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11755 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11756 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11758 2008-04-07 Ian Lance Taylor <iant@google.com>
11760 * version.cc (version_string): Set to "1.5".
11762 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11763 Add issued_non_pic_error_ field. Declare check_non_pic.
11764 (Target_x86_64::Scan::check_non_pic): New function.
11765 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11766 (Target_x86_64::Scan::global): Likewise.
11768 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11769 addend parameter. Change caller. Handle merge sections.
11770 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11771 Address to Addend. Don't add in the result of
11772 local_section_offset, pass down the addend and use the returned
11774 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11775 Update declarations of local_section_offset and symbol_value.
11776 * testsuite/two_file_test_1.cc (t18): New function.
11777 * testsuite/two_file_test_2.cc (f18): New function.
11778 * testsuite/two_file_test_main.cc (main): Call t18.
11779 * testsuite/two_file_test.h (t18, f18): Declare.
11781 * configure.ac: Don't test for objdump, c++filt, or readelf.
11782 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11784 (TEST_READELF): New variable.
11785 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11786 (check_PROGRAMS): Add two_file_strip_test.
11787 (two_file_strip_test): New target.
11788 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11789 (two_file_same_shared_strip_test_SOURCES): New variable.
11790 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11791 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11792 (two_file_same_shared_strip_test_LDADD): New variable.
11793 (two_file_shared_strip.so): New target.
11794 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11795 (ver_test_5.syms, ver_test_7.syms): Likewise.
11796 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11797 (strip_test_3.stdout): Use TEST_OBJDUMP.
11798 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11800 2008-04-04 Cary Coutant <ccoutant@google.com>
11802 * symtab.h (Symbol::is_weak_undefined): New function.
11803 (Symbol::is_strong_undefined): New function.
11804 (Symbol::is_absolute): New function.
11805 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11806 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11808 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11809 (weak_undef_test): New target.
11810 * testsuite/Makefile.in: Rebuild.
11811 * testsuite/weak_undef_file1.cc: New file.
11812 * testsuite/weak_undef_file2.cc: New file.
11813 * testsuite/weak_undef_test.cc: New file.
11815 2008-04-03 Craig Silverstein <csilvers@google.com>
11817 * compressed_output.h (class Output_compressed_section): Use
11819 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11821 (zlib_compressed_suffix): Removed.
11822 (Output_compressed_section::set_final_data_size): Use unsigned
11824 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11825 Fix linker invocation.
11826 (flagstest_o_specialfile_and_compress_debug_sections):
11828 * testsuite/Makefile.in: Regenerated.
11830 2008-04-02 David S. Miller <davem@davemloft.net>
11832 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11833 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11835 2008-04-02 Craig Silverstein <csilvers@google.com>
11839 2008-04-02 Ian Lance Taylor <iant@google.com>
11841 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11842 parameters. Update for new key type to views_. Change all
11844 (File_read::read): Adjust for byteshift in returned view.
11845 (File_read::add_view): New function, broken out of
11846 find_and_make_view.
11847 (File_read::make_view): New function, broken out of
11848 find_and_make_view.
11849 (File_read::find_or_make_view): Add offset and aligned
11850 parameters. Rewrite accordingly. Change all callers.
11851 (File_read::get_view): Add offset and aligned parameters. Adjust
11852 for byteshift in return value.
11853 (File_read::get_lasting_view): Likewise.
11854 * fileread.h (class File_read): Update declarations.
11855 (class File_read::View): Add byteshift_ field. Add byteshift to
11856 constructor. Add byteshift method.
11857 * archive.h (Archive::clear_uncached_views): New function.
11858 (Archive::get_view): Add aligned parameter. Change all callers.
11859 * object.h (Object::get_view): Add aligned parameter. Change all
11861 (Object::get_lasting_view): Likewise.
11863 * fileread.cc (File_read::release): Don't call clear_views if
11864 there are multiple objects.
11865 * fileread.h (File_read::clear_uncached_views): New function.
11866 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11869 2008-03-31 Cary Coutant <ccoutant@google.com>
11871 Add thin archive support.
11872 * archive.cc (Archive::armagt): New const.
11873 (Archive::setup): Remove task parameter and calls to unlock.
11874 (Archive::unlock_nested_archives): New function.
11875 (Archive::read_header): Add nested_off parameter. Change
11877 (Archive::interpret_header): Likewise.
11878 (Archive::include_all_members): Change to handle thin
11880 (Archive::include_member): Likewise.
11881 * archive.h (Archive::Archive): Add new parameters and
11883 (Archive::armagt): New const.
11884 (Archive::setup): Remove task parameter.
11885 (Archive::unlock_nested_archives): New function.
11886 (Archive::read_header): Add nested_off parameter.
11887 (Archive::interpret_header): Likewise.
11888 (Archive::Nested_archive_table): New typedef.
11889 (Archive::is_thin_archive_): New field.
11890 (Archive::nested_archives_): New field.
11891 (Archive::options_): New field.
11892 (Archive::dirpath_): New field.
11893 (Archive::task_): New field.
11894 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11895 for thin archives. Pass additional parameters to
11896 Archive::Archive. Unlock the archive file after calling
11899 2008-03-29 Ian Lance Taylor <iant@google.com>
11901 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11902 version symbol to be local.
11903 * testsuite/ver_test_4.sh: New file.
11904 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11905 (check_DATA): Add ver_test_4.syms.
11906 (ver_test_4.syms): New target.
11907 * testsuite/Makefile.in: Rebuild.
11910 (Output_section::Input_section_sort_entry::has_priority): New
11912 (Output_section::Input_section_sort_entry::match_file_name): New
11914 (Output_section::Input_section_sort_entry::match_section_name):
11916 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11918 (Output_section::Input_section_sort_entry::match_section_file):
11920 (Output_section::Input_section_sort_compare::operator()): Rewrite
11921 using new Input_section_sort_entry functions. Sort crtbegin and
11922 crtend first. Sort sections with no priority before sections with
11924 * testsuite/initpri1.c (d3): Check j != 4.
11925 (cd5): New constructor/destructor function.
11926 (main): Check j != 2.
11928 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11929 new symbol when resolving, don't call set_is_default.
11930 * testsuite/ver_test_7.cc: New file.
11931 * testsuite/ver_test_7.sh: New file.
11932 * testsuite/Makefile.am (ver_test_7.so): New target.
11933 (ver_test_7.o): New target.
11934 (check_SCRIPTS): Add ver_test_7.sh.
11935 (check_DATA): Add ver_test_7.syms.
11936 (ver_test_7.syms): New target.
11938 2008-03-28 Ian Lance Taylor <iant@google.com>
11940 * layout.cc (Layout::layout): If we see an input section with a
11941 name that needs sorting, set the must_sort flag for the output
11943 (Layout::make_output_section): If the name of the output section
11944 indicates that it might require sorting, set the may_sort flag.
11945 * output.h (Output_section::may_sort_attached_input_sections): New
11947 (Output_section::set_may_sort_attached_input_sections): New
11949 (Output_section::must_sort_attached_input_sections): New
11951 (Output_section::set_must_sort_attached_input_sections): New
11953 (class Output_section): Declare Input_section_sort_entry. Define
11954 Input_section_sort_compare. Declare
11955 sort_attached_input_sections. Add new fields:
11956 may_sort_attached_input_sections_,
11957 must_sort_attached_input_sections_,
11958 attached_input_sections_are_sorted_.
11959 * output.cc (Output_section::Output_section): Initialize new
11961 (Output_section::add_input_section): Add an entry to
11962 input_sections_ if may_sort or must_sort are true.
11963 (Output_section::set_final_data_size): Call
11964 sort_attached_input_sections if necessary.
11965 (Output_section::Input_section_sort_entry): Define new class.
11966 (Output_section::Input_section_sort_compare::operator()): New
11968 (Output_section::sort_attached_input_sections): New function.
11969 * configure.ac: Check whether the compiler supports constructor
11970 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11971 * testsuite/initpri1.c: New file.
11972 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11973 CONSTRUCTOR_PRIORITY.
11974 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11975 (initpri1_LDFLAGS): New variable.
11976 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11978 2008-03-27 Ian Lance Taylor <iant@google.com>
11980 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11981 * testsuite/common_test_1.c: New file.
11982 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11983 (common_test_1_SOURCES): New variable.
11984 (common_test_1_DEPENDENCIES): New variable.
11985 (common_test_1_LDFLAGS): New variable.
11987 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11988 and commons_ correctly when NAME/VERSION does not override
11990 * testsuite/ver_test_6.c: New file.
11991 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11992 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11993 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11995 2008-03-26 Ian Lance Taylor <iant@google.com>
11997 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11998 of an undefined symbol from a version script.
11999 * testsuite/Makefile.am (ver_test_5.so): New target.
12000 (ver_test_5.o): New target.
12001 (check_SCRIPTS): Add ver_test_5.sh.
12002 (check_DATA): Add ver_test_5.syms.
12003 (ver_test_5.syms): New target.
12004 * testsuite/ver_test_5.cc: New file.
12005 * testsuite/ver_test_5.script: New file.
12006 * testsuite/ver_test_5.sh: New file.
12007 * Makefile.in, testsuite/Makefile.in: Rebuild.
12010 Fix problems building gold with gcc 4.3.0.
12011 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12012 (gold_error_at_location, gold_warning_at_location): Use it.
12013 * configure.ac: Check whether we can compile and use a template
12014 function with a printf attribute.
12015 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12016 when jumping over bytes.
12017 * object.cc: Instantiate Object::read_section_data.
12018 * debug.h: Include <cstring>
12019 * dwarf_reader.cc: Include <algorithm>
12020 * main.cc: Include <cstring>.
12021 * options.cc: Include <cstring>.
12022 * output.cc: Include <cstring>.
12023 * script.cc: Include <cstring>.
12024 * script.h: Include <string>.
12025 * symtab.cc: Include <cstring> and <algorithm>.
12026 * target-select.cc: Include <cstring>.
12027 * version.cc: Include <string>.
12028 * testsuite/testmain.cc: Include <cstdlib>.
12029 * configure, config.in: Rebuild.
12031 2008-03-25 Ian Lance Taylor <iant@google.com>
12033 * options.cc: Include "../bfd/bfdver.h".
12034 (options::help): Print bug reporting address.
12036 * version.cc (print_version): Adjust output for current value of
12037 BFD_VERSION_STRING.
12041 * options.cc (options::help): Print list of supported targets.
12042 * target-select.h: Include <vector>.
12043 (class Target_selector): Make machine_, size_, and is_big_endian_
12044 fields const. Add bfd_name_ and instantiated_target_ fields.
12045 (Target_selector::Target_selector): Add bfd_name parameter.
12046 (Target_selector::recognize): Make non-virtual, call
12048 (Target_selector::recognize_by_name): Make non-virtual, call
12049 do_recognize_by_name.
12050 (Target_selector::supported_names): New function.
12051 (Target_selector::bfd_name): New function.
12052 (Target_selector::do_instantiate_target): New pure virtual
12054 (Target_selector::do_recognize): New virtual function.
12055 (Target_selector::do_recognize_by_name): New virtual function.
12056 (Target_selector::instantiate_target): New private function.
12057 (supported_target_names): Declare.
12058 * target-select.cc (Target_selector::Target_selector): Update for
12059 new parameter and fields.
12060 (select_target_by_name): Check that the name matches before
12061 calling recognize_by_name.
12062 (supported_target_names): New function.
12063 * i386.cc (class Target_selector_i386): Update Target_selector
12064 constructor call. Remove recognize and recognize_by_name. Add
12065 do_instantiate_target.
12066 * x86_64.cc (class Target_selector_x86_64): Likewise.
12067 * testsuite/testfile.cc (class Target_selector_test): Update for
12068 changes to Target_selector.
12070 * README: Rewrite, with some notes on unsupported features.
12072 2008-03-24 Cary Coutant <ccoutant@google.com>
12074 * i386.cc (Target_i386::Got_type): New enum declaration.
12075 (Target_i386::Scan::local): Updated callers of Output_data_got
12077 (Target_i386::Scan::global): Likewise.
12078 (Target_i386::Relocate::relocate): Likewise.
12079 (Target_i386::Relocate::relocate_tls): Likewise.
12080 * object.h (Got_offset_list): New class.
12081 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12082 (Sized_relobj::local_got_offset): Likewise.
12083 (Sized_relobj::set_local_got_offset): Likewise.
12084 (Sized_relobj::local_has_tls_got_offset): Removed.
12085 (Sized_relobj::local_tls_got_offset): Removed.
12086 (Sized_relobj::set_local_tls_got_offset): Removed.
12087 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12088 * output.cc (Output_data_got::add_global): Added got_type parameter.
12089 (Output_data_got::add_global_with_rel): Likewise.
12090 (Output_data_got::add_global_with_rela): Likewise.
12091 (Output_data_got::add_global_pair_with_rel): New function.
12092 (Output_data_got::add_global_pair_with_rela): New function.
12093 (Output_data_got::add_local): Added got_type parameter.
12094 (Output_data_got::add_local_with_rel): Likewise.
12095 (Output_data_got::add_local_with_rela): Likewise.
12096 (Output_data_got::add_local_pair_with_rel): New function.
12097 (Output_data_got::add_local_pair_with_rela): New function.
12098 (Output_data_got::add_global_tls): Removed.
12099 (Output_data_got::add_global_tls_with_rel): Removed.
12100 (Output_data_got::add_global_tls_with_rela): Removed.
12101 (Output_data_got::add_local_tls): Removed.
12102 (Output_data_got::add_local_tls_with_rel): Removed.
12103 (Output_data_got::add_local_tls_with_rela): Removed.
12104 * output.h (Output_data_got::add_global): Added got_type parameter.
12105 (Output_data_got::add_global_with_rel): Likewise.
12106 (Output_data_got::add_global_with_rela): Likewise.
12107 (Output_data_got::add_global_pair_with_rel): New function.
12108 (Output_data_got::add_global_pair_with_rela): New function.
12109 (Output_data_got::add_local): Added got_type parameter.
12110 (Output_data_got::add_local_with_rel): Likewise.
12111 (Output_data_got::add_local_with_rela): Likewise.
12112 (Output_data_got::add_local_pair_with_rel): New function.
12113 (Output_data_got::add_local_pair_with_rela): New function.
12114 (Output_data_got::add_global_tls): Removed.
12115 (Output_data_got::add_global_tls_with_rel): Removed.
12116 (Output_data_got::add_global_tls_with_rela): Removed.
12117 (Output_data_got::add_local_tls): Removed.
12118 (Output_data_got::add_local_tls_with_rel): Removed.
12119 (Output_data_got::add_local_tls_with_rela): Removed.
12120 * resolve.cc (Symbol::override_base_with_special): Removed
12121 reference to has_got_offset_ field.
12122 * symtab.cc (Symbol::init_fields): Replaced initialization
12123 of got_offset_ with got_offsets_. Removed initialization
12125 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
12126 (Symbol::got_offset): Likewise.
12127 (Symbol::set_got_offset): Likewise.
12128 (Symbol::has_tls_got_offset): Removed.
12129 (Symbol::tls_got_offset): Removed.
12130 (Symbol::set_tls_got_offset): Removed.
12131 (Symbol::got_offset_): Removed.
12132 (Symbol::tls_mod_got_offset_): Removed.
12133 (Symbol::tls_pair_got_offset_): Removed.
12134 (Symbol::got_offsets_): New field.
12135 (Symbol::has_got_offset): Removed.
12136 (Symbol::has_tls_mod_got_offset): Removed.
12137 (Symbol::has_tls_pair_got_offset): Removed.
12138 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12139 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12141 (Target_x86_64::Scan::global): Likewise.
12142 (Target_x86_64::Relocate::relocate): Likewise.
12143 (Target_x86_64::Relocate::relocate_tls): Likewise.
12145 2008-03-25 Ben Elliston <bje@au.ibm.com>
12147 * yyscript.y: Fix spelling error in comment.
12149 2008-03-24 Ian Lance Taylor <iant@google.com>
12151 * options.h (class General_options): Define build_id option.
12152 * layout.h (class Layout): Declare write_build_id, create_note,
12153 create_build_id. Add build_id_note_ member.
12154 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12155 "libiberty.h", "md5.h", "sha1.h".
12156 (Layout::Layout): Initialize eh_frame_data_,
12157 eh_frame_hdr_section_, and build_id_note_.
12158 (Layout::finalize): Call create_build_id.
12159 (Layout::create_note): New function, broken out of
12160 Layout::create_gold_note.
12161 (Layout::create_gold_note): Call create_note.
12162 (Layout::create_build_id): New function.
12163 (Layout::write_build_id): New function.
12164 (Close_task_runner::run): Call write_build_id.
12166 * x86_64.cc: Correct license to GPLv3.
12168 2008-03-23 Ian Lance Taylor <iant@google.com>
12170 * options.cc: Include "demangle.h".
12171 (parse_optional_string): New function.
12172 (parse_long_option): Handle takes_optional_argument.
12173 (parse_short_option): Update dash_z initializer. Handle
12174 takes_optional_argument.
12175 (General_options::General_options): Initialize do_demangle_.
12176 (General_options::finalize): Set do_demangle_. Handle demangling
12178 * options.h (parse_optional_string): Declare.
12179 (struct One_option): Add optional_arg field. Update constructor.
12180 Update call constructor calls. Add takes_optional_argument
12182 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12183 (DEFINE_optional_string): Define.
12184 (General_options::demangle): Change from DEFINE_bool to
12185 DEFINE_optional_string.
12186 (General_options::no_demangle): New function.
12187 (General_options::do_demangle): New function.
12188 (General_options::set_do_demangle): New function.
12189 (General_options::execstack_status_): Move definition to end of
12191 (General_options::static_): Likewise.
12192 (General_options::do_demangle_): New field.
12193 * object.cc (big_endian>::get_symbol_location_info): Call
12194 Options::do_demangle, not Options::demangle.
12195 * symtab.cc (demangle): Likewise.
12197 2008-03-22 Ian Lance Taylor <iant@google.com>
12199 * gold.h: Include <cstddef> and <sys/types.h>
12200 * options.h: Include <cstring>.
12202 2008-03-21 Ian Lance Taylor <iant@google.com>
12204 * Added source code to GNU binutils.