PR gold/13023
[binutils-gdb.git] / gold / ChangeLog
1 2011-10-31 Cary Coutant <ccoutant@google.com>
2
3 PR gold/13023
4 * expression.cc (Expression::eval_with_dot): Add
5 is_section_dot_assignment parameter.
6 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
7 absolute and assigning to dot within a section.
8 * script-sections.cc
9 (Output_section_element_assignment::set_section_addresses): Pass
10 dot_section to set_if_absolute.
11 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
12 as is_section_dot_assignment flag to eval_with_dot.
13 (Output_section_element_dot_assignment::set_section_addresses):
14 Likewise.
15 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
16 parameter. Also set value if relative to dot_section; set the
17 symbol's output_section.
18 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
19 parameter. Adjust all callers.
20 (Expression::eval_maybe_dot): Likewise.
21 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
22 Adjust all callers.
23 * testsuite/script_test_2.t: Test assignment of an absolute value
24 to dot within an output section element.
25
26 2011-10-31 Cary Coutant <ccoutant@google.com>
27
28 * options.h (class General_options): Add --[no-]gnu-unique options.
29 * symtab.cc (Symbol_table::sized_write_globals): Convert
30 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
31
32 2011-10-31 Cary Coutant <ccoutant@google.com>
33
34 PR gold/13359
35 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
36 unnecessary assertion.
37 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
38
39 2011-10-31 Sriraman Tallam <tmsriram@google.com>
40
41 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
42 gc_mark_symbol.
43 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
44 gc_mark_symbol.
45 Change to just keep the section associated with symbol.
46 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
47 they are externally visible and --export-dynamic is turned on.
48 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
49
50 2011-10-19 Ian Lance Taylor <iant@google.com>
51
52 PR gold/13163
53 * script-sections.cc
54 (Output_section_element_dot_assignment::needs_output_section): New
55 function.
56
57 2011-10-19 Ian Lance Taylor <iant@google.com>
58
59 PR gold/13204
60 * layout.cc (Layout::segment_precedes): Don't assert failure if a
61 --section-start option was seen.
62 * options.h (General_options::any_section_start): New function.
63
64 2011-10-18 David S. Miller <davem@davemloft.net>
65
66 PR binutils/13301
67 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
68 member to track relocation locations that have moved during TLS
69 reloc optimizations.
70 (Target_sparc::Relocate::Relocate): Initialize to NULL.
71 (Target_sparc::Relocate::relocate): Adjust view down by 4
72 bytes if it matches reloc_adjust_addr_.
73 (Target_sparc::Relocate::relocate_tls): Always move the
74 __tls_get_addr call delay slot instruction forward 4 bytes when
75 performing relaxation.
76
77 2011-10-18 Cary Coutant <ccoutant@google.com>
78
79 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
80 (Output_file::map_no_anonymous): Check for non-zero
81 return code from posix_fallocate.
82
83 2011-10-17 Cary Coutant <ccoutant@google.com>
84
85 PR gold/13245
86 * plugin.cc (is_visible_from_outside): Check for symbols
87 referenced from dynamic objects.
88 * resolve.cc (Symbol_table::resolve): Don't count references
89 from dynamic objects as references from real ELF files.
90 * testsuite/plugin_test_2.sh: Adjust expected result.
91
92 2011-10-17 Cary Coutant <ccoutant@google.com>
93
94 * gold.cc: Include timer.h.
95 (queue_middle_tasks): Stamp time.
96 (queue_final_tasks): Likewise.
97 * main.cc (main): Store timer in parameters. Print timers
98 for each pass.
99 * parameters.cc (Parameters::Parameters): Initialize timer_.
100 (Parameters::set_timer): New function.
101 (set_parameters_timer): New function.
102 * parameters.h (Parameters::set_timer): New function.
103 (Parameters::timer): New function.
104 (Parameters::timer_): New data member.
105 (set_parameters_timer): New function.
106 * timer.cc (Timer::stamp): New function.
107 (Timer::get_pass_time): New function.
108 * timer.h (Timer::stamp): New function.
109 (Timer::get_pass_time): New function.
110 (Timer::pass_times_): New data member.
111
112 2011-10-17 Cary Coutant <ccoutant@google.com>
113
114 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
115 task for members of lib groups.
116
117 2011-10-17 Cary Coutant <ccoutant@google.com>
118
119 PR gold/13288
120 * fileread.cc (File_read::find_view): Add assert.
121 (File_read::make_view): Move bounds check (replace with assert)...
122 (File_read::find_or_make_view): ... to here.
123
124 2011-10-12 Cary Coutant <ccoutant@google.com>
125
126 * output.cc (Output_file::open_base_file): Handle case where
127 ::read returns less than requested size.
128
129 2011-10-10 Cary Coutant <ccoutant@google.com>
130
131 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
132 Initialize defined_count_.
133 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
134 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
135 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
136 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
137 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
138 * incremental.h (Sized_relobj_incr::defined_count_): New data
139 member.
140 (Sized_incr_dynobj::defined_count_): New data member.
141 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
142 Return zeroes instead of internal error.
143
144 2011-10-10 Cary Coutant <ccoutant@google.com>
145
146 PR gold/13249
147 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
148 (Output_reloc::symbol_value): Return PLT offset if flag is set.
149 * output.h (class Output_reloc): Add use_plt_offset flag.
150 (Output_reloc::type_): Adjust size of bit field.
151 (Output_reloc::use_plt_offset_): New bit field.
152 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
153 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
154 flag. Adjust all callers.
155 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
156 creating RELATIVE relocations.
157
158 2011-10-10 Nick Clifton <nickc@redhat.com>
159
160 * po/es.po: Updated Spanish translation.
161 * po/fi.po: Updated Finnish translation.
162
163 2011-10-03 Diego Novillo <dnovillo@google.com>
164
165 * options.cc (parse_uint): Fix dereference of RETVAL.
166
167 2011-09-29 Sriraman Tallam <tmsriram@google.com>
168
169 * layout.h (section_order_map_): New member.
170 (get_section_order_map): New member function.
171 * output.cc (Output_section::add_input_section): Check for patterns
172 only when --section-ordering-file is specified.
173 * gold.cc (queue_middle_tasks): Delay updating order of sections till
174 output_sections have been formed.
175 * layout.cc (Layout_Layout): Initialize section_order_map_.
176 * plugin.cc (update_section_order): Store order in order_map. Do not
177 update the order.
178 * testsuite/Makefile.am: Add test case for plugin_final_layout.
179 * testsuite/Makefile.in: Regenerate.
180 * testsuite/plugin_section_order.c: New file.
181 * testsuite/plugin_final_layout.cc: New file.
182 * testsuite/plugin_final_layout.sh: New file.
183
184 2011-09-29 Cary Coutant <ccoutant@google.com>
185
186 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
187 Check for NULL.
188 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
189 symbols during incremental update.
190 (Symbol_table::add_from_dynobj): Likewise.
191
192 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
193 Ian Lance Taylor <iant@google.com>
194
195 * symtab.cc (Symbol_table::define_special_symbol): Always
196 canonicalize version string.
197
198 2011-09-26 Cary Coutant <ccoutant@google.com>
199
200 * gold.cc (queue_initial_tasks): Move option checks ...
201 * options.cc (General_options::finalize): ... to here. Disable
202 some options; make others fatal.
203
204 2011-09-26 Cary Coutant <ccoutant@google.com>
205
206 gcc PR lto/47247
207 * plugin.cc (get_symbols_v2): New function.
208 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
209 (is_referenced_from_outside): New function.
210 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
211 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
212 (get_symbols): Pass version parameter.
213 (get_symbols_v2): New function.
214 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
215 parameter.
216 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
217 (onload): Add LDPT_GET_SYMBOLS_V2.
218 (all_symbols_read_hook): Use get_symbols_v2; check for
219 LDPR_PREVAILING_DEF_IRONLY_EXP.
220 * testsuite/plugin_test_3.sh: Update expected results.
221
222 2011-09-23 Simon Baldwin <simonb@google.com>
223
224 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
225 configuration options.
226 * configure: Regenerate.
227 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
228 * Makefile.in: Regenerate.
229 * testsuite/Makefile.in: Regenerate.
230
231 2011-09-19 Sriraman Tallam <tmsriram@google.com>
232
233 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
234
235 2011-09-19 Cary Coutant <ccoutant@google.com>
236
237 * incremental.cc (can_incremental_update): Fix typo in comment.
238 * incremental.h (can_incremental_update): Likewise.
239
240 2011-09-18 Cary Coutant <ccoutant@google.com>
241
242 * incremental.cc (can_incremental_update): New function.
243 * incremental.h (can_incremental_update): New function.
244 * layout.cc (Layout::init_fixed_output_section): Call it.
245 (Layout::make_output_section): Don't allow patch space in .eh_frame.
246 * object.cc (Sized_relobj_file::do_layout): Call
247 can_incremental_update.
248
249 2011-09-13 Cary Coutant <ccoutant@google.com>
250
251 * configure.ac: Check for glibc support for gnu_indirect_function
252 support with static linking, setting automake conditional
253 IFUNC_STATIC.
254 * Makefile.in: Regenerate.
255 * configure: Regenerate.
256
257 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
258 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
259 for IFUNC_STATIC.
260 * testsuite/Makefile.in: Regenerate.
261
262 2011-09-13 Cary Coutant <ccoutant@google.com>
263
264 * incremental.cc (Sized_relobj_incr::do_layout): Call
265 report_comdat_group for kept comdat sections.
266 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
267 * testsuite/Makefile.in: Regenerate.
268 * testsuite/incr_comdat_test_1.cc: New source file.
269 * testsuite/incr_comdat_test_2_v1.cc: New source file.
270 * testsuite/incr_comdat_test_2_v2.cc: New source file.
271 * testsuite/incr_comdat_test_2_v3.cc: New source file.
272
273 2011-09-13 Ian Lance Taylor <iant@google.com>
274
275 * object.cc (Sized_relobj_file::do_layout): Remove unused local
276 variable external_symbols_offset.
277
278 2011-09-12 Ian Lance Taylor <iant@google.com>
279
280 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
281 triggered if object has no symbols.
282
283 2011-09-09 David S. Miller <davem@davemloft.net>
284
285 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
286 (Output_fill_debug_line::do_write): Likewise.
287
288 2011-08-29 Cary Coutant <ccoutant@google.com>
289
290 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
291 casts to match formatting specs.
292 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
293
294 2011-08-26 Cary Coutant <ccoutant@google.com>
295
296 * layout.cc (Free_list::allocate): Provide guarantee of minimum
297 remaining hole size when allocating.
298 (Layout::make_output_section): Set fill methods for debug sections.
299 * layout.h (Free_list::Free_list_node): Move from private to
300 public.
301 (Free_list::set_min_hole_size): New function.
302 (Free_list::begin, Free_list::end): New functions.
303 (Free_list::min_hole_): New data member.
304 * output.cc: Include dwarf.h.
305 (Output_fill_debug_info::do_minimum_hole_size): New function.
306 (Output_fill_debug_info::do_write): New function.
307 (Output_fill_debug_line::do_minimum_hole_size): New function.
308 (Output_fill_debug_line::do_write): New function.
309 (Output_section::Output_section): Initialize new data member.
310 (Output_section::set_final_data_size): Ensure patch space is larger
311 than minimum hole size.
312 (Output_section::do_write): Fill holes in debug sections.
313 * output.h (Output_fill): New class.
314 (Output_fill_debug_info): New class.
315 (Output_fill_debug_line): New class.
316 (Output_section::set_free_space_fill): New function.
317 (Output_section::free_space_fill_): New data member.
318 * testsuite/Makefile.am (incremental_test_3): Add
319 --incremental-patch option.
320 (incremental_test_4): Likewise.
321 (incremental_test_5): Likewise.
322 (incremental_test_6): Likewise.
323 (incremental_copy_test): Likewise.
324 (incremental_common_test_1): Likewise.
325 * testsuite/Makefile.in: Regenerate.
326
327 2011-08-26 Nick Clifton <nickc@redhat.com>
328
329 * po/es.po: Updated Spanish translation.
330
331 2011-08-01 Cary Coutant <ccoutant@google.com>
332
333 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
334 * gold/testsuite/Makefile.in: Regenerate.
335 * gold/testsuite/justsyms_exec.c: New source file.
336 * gold/testsuite/justsyms_lib.c: New source file.
337
338 2011-08-01 Cary Coutant <ccoutant@google.com>
339
340 * layout.cc (Layout::set_segment_offsets): Don't realign text
341 segment if -Ttext was specified.
342 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
343 file type.
344 * object.h (Sized_relobj_file::e_type): New function.
345 (Sized_relobj_file::e_type_): New data member.
346 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
347 base address for ET_EXEC files.
348 * target.cc (Target::do_make_elf_object_implementation): Allow
349 ET_EXEC files with --just-symbols option.
350
351 2011-07-28 Cary Coutant <ccoutant@google.com>
352
353 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
354 Add thread_number parameter.
355 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
356 * workqueue-threads.cc
357 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
358 current thread if its thread number is greater than desired thread
359 count.
360 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
361 Add thread_number parameter.
362 (Workqueue::should_cancel_thread): Likewise.
363 (Workqueue::find_runnable_or_wait): Pass thread_number to
364 should_cancel_thread.
365 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
366 parameter.
367
368 2011-07-22 Sriraman Tallam <tmsriram@google.com>
369
370 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
371 only after checking if it cannot be forced local.
372 * symtab.h (is_externally_visible): Check if the symbol is not forced
373 local.
374
375 2011-07-15 Ian Lance Taylor <iant@google.com>
376
377 * options.h (class General_options): Add --print-output-format.
378 Move -EL next to -EB, for better --help output.
379 * target-select.cc: Include <cstdio>, "options.h", and
380 "parameters.h".
381 (Target_selector::do_target_bfd_name): New function.
382 (print_output_format): New function.
383 * target-select.h (class Target_selector): Update declarations.
384 (Target_selector::target_bfd_name): New function.
385 (print_output_format): Declare.
386 * main.cc: Include "target-select.h".
387 (main): Handle --print-output-format.
388 * gold.cc: Include "target-select.h".
389 (queue_initial_tasks): Handle --print-output-format when there are
390 no input files.
391 * parameters.cc (parameters_force_valid_target): Give a better
392 error message if -EB/-EL does not match target.
393 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
394 function.
395
396 2011-07-15 Ian Lance Taylor <iant@google.com>
397
398 * i386.cc (class Output_data_plt_i386): Add layout_ field.
399 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
400 (Output_data_plt_i386::do_write): Write address of .dynamic
401 section to first entry in .got.plt section.
402 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
403 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
404 Initialize layout_.
405 (Output_data_plt_x86_64::do_write): Write address of .dynamic
406 section to first entry in .got.plt section.
407 * layout.h (Layout::dynamic_section): New function.
408
409 2011-07-13 Sriraman Tallam <tmsriram@google.com>
410
411 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
412 to claim_file call.
413 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
414 input_section_position_, and input_section_glob_.
415 (read_layout_from_file): Call function section_ordering_specified.
416 * layout.h (is_section_ordering_specified): New function.
417 (section_ordering_specified): New function.
418 (section_ordering_specified_): New boolean member.
419 * main.cc(main): Call load_plugins after layout object is defined.
420 * output.cc (Output_section::add_input_section): Use
421 function section_ordering_specified to check if section ordering is
422 needed.
423 * output.cc (Output_section::add_relaxed_input_section): Use
424 function section_ordering_specified to check if section ordering is
425 needed.
426 (Output_section::update_section_layout): New function.
427 (Output_section::sort_attached_input_sections): Check if input section
428 must be reordered.
429 * output.h (Output_section::update_section_layout): New function.
430 * plugin.cc (get_section_count): New function.
431 (get_section_type): New function.
432 (get_section_name): New function.
433 (get_section_contents): New function.
434 (update_section_order): New function.
435 (allow_section_ordering): New function.
436 (Plugin::load): Add the new interfaces to the transfer vector.
437 (Plugin_manager::load_plugins): New parameter.
438 (Plugin_manager::all_symbols_read): New parameter.
439 (Plugin_manager::claim_file): New parameter. Save the elf object for
440 unclaimed objects.
441 (Plugin_manager::get_elf_object): New function.
442 (Plugin_manager::get_view): Change to directly use the bool to check
443 if get_view is called from claim_file_hook.
444 * plugin.h (input_objects): New function
445 (Plugin__manager::load_plugins): New parameter.
446 (Plugin_manager::claim_file): New parameter.
447 (Plugin_manager::get_elf_object): New function.
448 (Plugin_manager::in_claim_file_handler): New function.
449 (Plugin_manager::in_claim_file_handler_): New member.
450 (layout): New function.
451 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
452 handler with an extra parameter. Make the elf object before calling
453 claim_file handler.
454 * testsuite/plugin_test.c (get_section_count): New function pointer.
455 (get_section_type): New function pointer.
456 (get_section_name): New function pointer.
457 (get_section_contents): New function pointer.
458 (update_section_order): New function pointer.
459 (allow_section_ordering): New function pointer.
460 (onload): Check if the new interfaces exist.
461
462 2011-07-13 Ian Lance Taylor <iant@google.com>
463
464 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
465 relro section.
466 * x86_64.cc (Target_x86_64::got_section): Likewise.
467 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
468 (relro_now_test_SOURCES): New variable.
469 (relro_now_test_DEPENDENCIES): New variable.
470 (relro_now_test_LDFLAGS): New variable.
471 (relro_now_test_LDADD): New variable.
472 (relro_now_test.so): New target.
473 * testsuite/Makefile.in: Rebuild.
474
475 2011-07-12 Ian Lance Taylor <iant@google.com>
476
477 PR gold/12980
478 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
479 GLOB_DAT relocation rather than a RELATIVE relocation for a
480 protected symbol when creating a shared library.
481 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
482 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
483 * testsuite/protected_main_1.cc (main): Test that protected
484 function has same address.
485
486 2011-07-11 Ian Lance Taylor <iant@google.com>
487
488 PR gold/12979
489 * options.h (class General_options): Add -Bgroup.
490 * options.cc (General_options::finalize): If -Bgroup is set,
491 default to --unresolved-symbols=report-all.
492 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
493 * target-reloc.h (issue_undefined_symbol_error): Handle
494 --unresolved-symbols=report-all.
495
496 2011-07-08 Ian Lance Taylor <iant@google.com>
497
498 PR gold/11985
499 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
500 if linker script discards key sections.
501 (Layout::create_dynamic_symtab): Likewise.
502 (Layout::assign_local_dynsym_offsets): Likewise.
503 (Layout::sized_create_version_sections): Likewise.
504 (Layout::create_interp): Likewise.
505 (Layout::finish_dynamic_section): Likewise.
506 (Layout::set_dynamic_symbol_size): Likewise.
507
508 2011-07-08 Ian Lance Taylor <iant@google.com>
509
510 PR gold/12386
511 * options.h (class General_options): Add --unresolved-symbols.
512 * target-reloc.h (issue_undefined_symbol_error): Check
513 --unresolved-symbols. Add comments.
514
515 2011-07-08 Ian Lance Taylor <iant@google.com>
516
517 * testsuite/odr_violation2.cc (Ordering::operator()): Make
518 expression more complex.
519
520 2011-07-08 Ian Lance Taylor <iant@google.com>
521
522 PR gold/11317
523 * target-reloc.h (issue_undefined_symbol_error): New inline
524 function, broken out of relocate_section.
525 (relocate_section): Call issue_undefined_symbol_error.
526 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
527 there is no TLS segment if we are about to issue an undefined
528 symbol error.
529 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
530
531 2011-07-08 Ian Lance Taylor <iant@google.com>
532
533 PR gold/12279
534 * resolve.cc (Symbol_table::should_override): Add fromtype
535 parameter. Change all callers. Give error when linking together
536 TLS and non-TLS symbol.
537 (Symbol_table::should_override_with_special): Add fromtype
538 parameter. Change all callers.
539 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
540 there is no TLS segment if we have reported some errors.
541 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
542
543 2011-07-08 Ian Lance Taylor <iant@google.com>
544
545 PR gold/12372
546 * target.h (Target::plt_address_for_global): New function.
547 (Target::plt_address_for_local): New function.
548 (Target::plt_section_for_global): Remove.
549 (Target::plt_section_for_local): Remove.
550 (Target::do_plt_address_for_global): New virtual function.
551 (Target::do_plt_address_for_local): New virtual function.
552 (Target::do_plt_section_for_global): Remove.
553 (Target::do_plt_section_for_local): Remove.
554 (Target::register_global_plt_entry): Add Symbol_table and Layout
555 parameters.
556 * output.cc (Output_data_got::Got_entry::write): Use
557 plt_address_for_global and plt_address_for_local.
558 * layout.cc (Layout::add_target_dynamic_tags): Use size and
559 address of output section.
560 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
561 got_irelative_, and irelative_count_ fields. Update
562 declarations.
563 (Output_data_plt_i386::has_irelative_section): New function.
564 (Output_data_plt_i386::entry_count): Add irelative_count_.
565 (Output_data_plt_i386::set_final_data_size): Likewise.
566 (class Target_i386): Add got_irelative_ and rel_irelative_
567 fields. Update declarations.
568 (Target_i386::Target_i386): Initialize new fields.
569 (Target_i386::do_plt_address_for_global): New function replacing
570 do_plt_section_for_global.
571 (Target_i386::do_plt_address_for_local): New function replacing
572 do_plt_section_for_local.
573 (Target_i386::got_section): Create got_irelative_.
574 (Target_i386::rel_irelative_section): New function.
575 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
576 fields. Don't define __rel_iplt_{start,end}.
577 (Output_data_plt_i386::add_entry): Add symtab and layout
578 parameters. Change all callers. Use different PLT and GOT for
579 IFUNC symbols.
580 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
581 layout parameters. Change all callers. Use different PLT and
582 GOT.
583 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
584 (Output_data_plt_i386::rel_irelative): New function.
585 (Output_data_plt_i386::address_for_global): New function.
586 (Output_data_plt_i386::address_for_local): New function.
587 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
588 IRELATIVE GOT when changing IFUNC GOT entries.
589 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
590 reloc.
591 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
592 if we didn't create an IRELATIVE GOT.
593 (Target_i386::Relocate::relocate): Use plt_address_for_global and
594 plt_address_for_local.
595 (Target_i386::do_dynsym_value): Use plt_address_for_global.
596 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
597 got_irelative_, and irelative_count_ fields. Update
598 declarations.
599 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
600 Initialize new fields. Remove symtab parameter. Change all
601 callers.
602 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
603 irelative_count_.
604 (Output_data_plt_x86_64::has_irelative_section): New function.
605 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
606 (class Target_x86_64): Add got_irelative_ and rel_irelative_
607 fields. Update declarations.
608 (Target_x86_64::Target_x86_64): Initialize new fields.
609 (Target_x86_64::do_plt_address_for_global): New function replacing
610 do_plt_section_for_global.
611 (Target_x86_64::do_plt_address_for_local): New function replacing
612 do_plt_section_for_local.
613 (Target_x86_64::got_section): Create got_irelative_.
614 (Target_x86_64::rela_irelative_section): New function.
615 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
616 all callers. Don't create __rel_iplt_{start,end}.
617 (Output_data_plt_x86_64::add_entry): Add symtab and layout
618 parameters. Change all callers. Use different PLT and GOT for
619 IFUNC symbols.
620 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
621 layout parameters. Change all callers. Use different PLT and
622 GOT.
623 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
624 parameters. Change all callers. Use different PLT and GOT for
625 IFUNC symbols.
626 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
627 (Output_data_plt_x86_64::rela_irelative): New function.
628 (Output_data_plt_x86_64::address_for_global): New function.
629 (Output_data_plt_x86_64::address_for_local): New function.
630 (Output_data_plt_x86_64::set_final_data_size): Likewise.
631 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
632 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
633 (Target_x86_64::register_global_plt_entry): Add symtab and layout
634 parameters.
635 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
636 reloc.
637 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
638 symbols if we didn't create an IRELATIVE GOT.
639 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
640 plt_address_for_local.
641 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
642 * testsuite/ifuncvar1.c: New test file.
643 * testsuite/ifuncvar2.c: New test file.
644 * testsuite/ifuncvar3.c: New test file.
645 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
646 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
647 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
648 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
649 * testsuite/Makefile.in: Rebuild.
650
651 2011-07-07 Cary Coutant <ccoutant@google.com>
652
653 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
654 (two_file_test_1_ndebug.o): Likewise.
655 (two_file_test_1b_ndebug.o): Likewise.
656 (two_file_test_2_ndebug.o): Likewise.
657 (two_file_test_main_ndebug.o): Likewise.
658 (incremental_test_2): Link with no-debug versions.
659
660 2011-07-06 Cary Coutant <ccoutant@google.com>
661
662 * gold/incremental.cc
663 (Output_section_incremental_inputs::write_info_blocks): Check for
664 hidden and internal symbols.
665
666 2011-07-06 Cary Coutant <ccoutant@google.com>
667
668 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
669 Check disposition for startup file.
670 (Incremental_inputs::report_command_line): Ignore
671 --incremental-startup-unchanged option.
672 * options.cc (General_options::parse_incremental_startup_unchanged):
673 New function.
674 (General_options::General_options): Initialize new data member.
675 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
676 (General_options): Add --incremental-startup-unchanged option.
677 (General_options::incremental_startup_disposition): New function.
678 (General_options::incremental_startup_disposition_): New data member.
679
680 2011-07-06 Cary Coutant <ccoutant@google.com>
681
682 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
683 input file index to Script_info ctor.
684 (Sized_incremental_binary::do_file_has_changed): Find the
685 command-line argument for files named in scripts.
686 * incremental.h (Script_info::Script_info): New ctor
687 with input file index.
688 (Script_info::input_file_index): New function.
689 (Script_info::input_file_index_): New data member.
690 (Incremental_binary::get_library): Add const.
691 (Incremental_binary::get_script_info): Add const.
692 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
693 * testsuite/Makefile.am (incremental_test_5): New test case.
694 (incremental_test_6): New test case.
695 * testsuite/Makefile.in: Regenerate.
696
697 2011-07-06 Cary Coutant <ccoutant@google.com>
698
699 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
700 debug output when command lines differ.
701
702 2011-07-06 Cary Coutant <ccoutant@google.com>
703
704 * incremental.cc (Incremental_inputs::report_command_line): Ignore
705 --incremental-patch option.
706 * layout.cc (Free_list::allocate): Extend allocation beyond original
707 end if enabled.
708 (Layout::make_output_section): Mark sections that should get
709 patch space.
710 * options.cc (parse_percent): New function.
711 * options.h (parse_percent): New function.
712 (DEFINE_percent): New macro.
713 (General_options): Add --incremental-patch option.
714 * output.cc (Output_section::Output_section): Initialize new data
715 members.
716 (Output_section::add_input_section): Print section name when out
717 of patch space.
718 (Output_section::add_output_section_data): Likewise.
719 (Output_section::set_final_data_size): Add patch space when
720 doing --incremental-full.
721 (Output_section::do_reset_address_and_file_offset): Remove patch
722 space.
723 (Output_segment::set_section_list_addresses): Print debug output
724 only if --incremental-update.
725 * output.h (Output_section::set_is_patch_space_allowed): New function.
726 (Output_section::is_patch_space_allowed_): New data member.
727 (Output_section::patch_space_): New data member.
728 * parameters.cc (Parameters::incremental_full): New function.
729 * parameters.h (Parameters::incremental_full): New function
730 * testsuite/Makefile.am (incremental_test_2): Add test for
731 --incremental-patch option.
732 * testsuite/Makefile.in: Regenerate.
733 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
734 (t18): Remove function body.
735
736 2011-07-05 Doug Kwan <dougkwan@google.com>
737
738 PR gold/12771
739 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
740 Arm_Address type for relocation result.
741 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
742 overflow check.
743 (Arm_relocate_functions::abs32): Use unaligned access.
744 (Arm_relocate_functions::rel32): Ditto.
745 (Arm_relocate_functions::prel31): Ditto.
746 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
747 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
748 static data relocations.
749 * testsuite/Makefile.in: Regnerate.
750 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
751
752 2011-07-05 Ian Lance Taylor <iant@google.com>
753
754 PR gold/12392
755 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
756 symbols if necessary.
757 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
758
759 2011-07-05 Ian Lance Taylor <iant@google.com>
760
761 PR gold/12952
762 * resolve.cc (Symbol::override_base_with_special): Simply override
763 version with special symbol version, ignoring previous version.
764
765 2011-07-05 Ian Lance Taylor <iant@google.com>
766
767 * object.cc (Sized_relobj_file::include_section_group): Add
768 information to comment about signature location.
769
770 2011-07-02 Ian Lance Taylor <iant@google.com>
771
772 PR gold/12957
773 * options.h (class General_options): Add -f and -F.
774 * options.cc (General_options::finalize): Fatal error if -f/-F
775 are used without -shared.
776 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
777
778 2011-07-02 Ian Lance Taylor <iant@google.com>
779
780 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
781
782 2011-07-01 Ian Lance Taylor <iant@google.com>
783
784 PR gold/12525
785 PR gold/12952
786 * resolve.cc (Symbol::override_base_with_special): Don't override
787 the version if the overriding symbol has a different name.
788 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
789 all callers. If we give an error about an undefined version,
790 define the base version if necessary.
791 * dynobj.h (class Versions): Update declaration.
792 * testsuite/weak_alias_test_5.cc: New file.
793 * testsuite/weak_alias_test.script: New file.
794 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
795 and versioned_alias have the right value, and call t2.
796 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
797 weak_alias_test_5.so.
798 (weak_alias_test_LDADD): Likewise.
799 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
800 * testsuite/Makefile.in: Rebuild.
801
802 2011-07-01 Ian Lance Taylor <iant@google.com>
803
804 PR gold/12525
805 * options.h (class General_options): Support -z notext.
806 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
807 -Wl,-z,notext.
808 (two_file_shared_nonpic.so): Likewise.
809 (two_file_shared_mixed.so): Likewise.
810 (two_file_shared_mixed_1.so): Likewise.
811 (weak_undef_lib_nonpic.so): Likewise.
812 (alt/weak_undef_lib_nonpic.so): Likewise.
813 (tls_test_shared_nonpic.so): Likewise.
814 * testsuite/Makefile.in: Rebuild.
815
816 2011-07-01 Ian Lance Taylor <iant@google.com>
817
818 PR gold/12525
819 * configure.ac: Test whether static linking works, setting
820 the automake conditional HAVE_STATIC.
821 * testsuite/Makefile.am: Disable tests using -static if
822 HAVE_STATIC is not true.
823 * configure, testsuite/Makefile.in: Rebuild.
824
825 2011-07-01 Ian Lance Taylor <iant@google.com>
826
827 PR gold/12525
828 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
829 Assert if we see DW_EH_PE_indirect.
830 * target.h (Target::ehframe_datarel_base): New function.
831 (Target::do_ehframe_datarel_base): New target function.
832 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
833 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
834 function.
835
836 2011-07-01 Ian Lance Taylor <iant@google.com>
837
838 PR gold/12571
839 * options.h (class General_options): Add
840 --ld-generated-unwind-info.
841 * ehframe.cc (Fde::write): Add address parameter. Change all
842 callers. If associated with PLT, fill in address and size.
843 (Cie::set_output_offset): Only add merge mapping if there is an
844 object.
845 (Cie::write): Add address parameter. Change all callers.
846 (Eh_frame::add_ehframe_for_plt): New function.
847 * ehframe.h (class Fde): Update declarations. Move shndx_ and
848 input_offset_ fields into union u_, with new plt field.
849 (Fde::Fde): Adjust for new union field.
850 (Fde::Fde) [Output_data version]: New constructor.
851 (Fde::add_mapping): Only add merge mapping if there is an object.
852 (class Cie): Update declarations.
853 (class Eh_frame): Declare add_ehframe_for_plt.
854 * layout.cc (Layout::layout_eh_frame): Break out code into
855 make_eh_frame_section, and call it.
856 (Layout::make_eh_frame_section): New function.
857 (Layout::add_eh_frame_for_plt): New function.
858 * layout.h (class Layout): Update declarations.
859 * merge.cc (Merge_map::add_mapping): Add assertion.
860 * i386.cc: Include "dwarf.h".
861 (class Output_data_plt_i386): Make first_plt_entry,
862 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
863 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
864 and plt_eh_frame_fde.
865 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
866 boundary. Call add_eh_frame_for_plt if appropriate.
867 * x86_64.cc: Include "dwarf.h".
868 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
869 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
870 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
871 and plt_eh_frame_fde.
872 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
873 appropriate.
874
875 2011-06-29 Ian Lance Taylor <iant@google.com>
876
877 PR gold/12629
878 * object.cc (Sized_relobj_file::layout_section): Change shdr
879 parameter to be const.
880 (Sized_relobj_file::layout_eh_frame_section): New function, broken
881 out of do_layout.
882 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
883 appropriate. Call layout_eh_frame_section.
884 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
885 sections.
886 * object.h (class Sized_relobj_file): Update declarations.
887
888 2011-06-29 Ian Lance Taylor <iant@google.com>
889
890 PR gold/12652
891 * script.cc (Token::integer_value): Accept trailing M/m/K/k
892 modifier.
893 (Lex::gather_token): Accept trailing M/m/K/k for integers.
894
895 2011-06-29 Ian Lance Taylor <iant@google.com>
896
897 PR gold/12675
898 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
899 SHT_X86_64_UNWIND.
900 * layout.cc (Layout::layout_eh_frame): Likewise.
901
902 2011-06-29 Ian Lance Taylor <iant@google.com>
903
904 PR gold/12695
905 * layout.cc (Layout::symtab_section_shndx): New function.
906 * layout.h (class Layout): Declare symtab_section_shndx.
907 * output.cc (Output_section::write_header): Call it.
908
909 2011-06-29 Ian Lance Taylor <iant@google.com>
910
911 PR gold/12818
912 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
913 symbols which are not used in a relocation.
914
915 2011-06-28 Ian Lance Taylor <iant@google.com>
916
917 PR gold/12898
918 * layout.cc (Layout::segment_precedes): Don't crash if a linker
919 script create indistinguishable segments.
920 (Layout::set_segment_offsets): Use stable_sort when sorting
921 segments. Pass this to Compare_segments constructor.
922 * layout.h (class Layout): Make segment_precedes non-static.
923 (class Compare_segments): Change from struct to class. Add
924 layout_ field. Add constructor.
925 * script-sections.cc
926 (Script_sections::attach_sections_using_phdrs_clause): Rename
927 local orphan to is_orphan. Don't report failure to put empty
928 section in segment. On attachment failure, report name of
929 section, and attach to first PT_LOAD segment.
930
931 2011-06-28 Ian Lance Taylor <iant@google.com>
932
933 PR gold/12934
934 * target-select.cc (Target_selector::Target_selector): Add
935 emulation parameter. Change all callers.
936 (select_target_by_bfd_name): Rename from select_target_by_name.
937 Change all callers.
938 (select_target_by_emulation): New function.
939 (supported_emulation_names): New function.
940 * target-select.h (class Target_selector): Add emulation_ field.
941 Update declarations.
942 (Target_selector::recognize_by_bfd_name): Rename from
943 recognize_by_name. Change all callers.
944 (Target_selector::supported_bfd_names): Rename from
945 supported_names. Change all callers.
946 (Target_selector::recognize_by_emulation): New function.
947 (Target_selector::supported_emulations): New function.
948 (Target_selector::emulation): New function.
949 (Target_selector::do_recognize_by_bfd_name): Rename from
950 do_recognize_by_name. Change all callers.
951 (Target_selector::do_supported_bfd_names): Rename from
952 do_supported_names. Change all callers.
953 (Target_selector::do_recognize_by_emulation): New function.
954 (Target_selector::do_supported_emulations): New function.
955 (select_target_by_bfd_name): Change name in declaration.
956 (select_target_by_emulation): Declare.
957 (supported_emulation_names): Declare.
958 * parameters.cc (parameters_force_valid_target): Try to find
959 target based on emulation from -m option.
960 * options.h (class General_options): Change doc string for -m.
961 * options.cc (help): Print emulations.
962 (General_options::parse_V): Likewise.
963 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
964 Add emulation parameter. Change all callers.
965
966 2011-06-28 Ian Lance Taylor <iant@google.com>
967
968 * target.h (class Target): Add osabi_ field.
969 (Target::osabi): New function.
970 (Target::set_osabi): New function.
971 (Target::Target): Initialize osabi_.
972 (Target::do_adjust_elf_header): Make pure virtual.
973 (Sized_target::do_adjust_elf_header): Declare.
974 * target.cc (Sized_target::do_adjust_elf_header): New function.
975 (class Sized_target): Instantiate all versions.
976 * freebsd.h (class Target_freebsd): Remove.
977 (Target_selector_freebsd::do_recognize): Call set_osabi on
978 Target.
979 (Target_selector_freebsd::do_recognize_by_name): Likewise.
980 (Target_selector_freebsd::set_osabi): Remove.
981 * i386.cc (class Target_i386): Inherit from Sized_target rather
982 than Target_freebsd.
983 * x86_64.cc (class Target_x86_64): Likewise.
984
985 2011-06-28 Ian Lance Taylor <iant@google.com>
986
987 * target.h (Target::can_check_for_function_pointers): Rewrite.
988 Make non-virtual.
989 (Target::can_icf_inline_merge_sections): Likewise.
990 (Target::section_may_have_icf_unsafe_poineters): Likewise.
991 (Target::Target_info): Add can_icf_inline_merge_sections field.
992 (Target::do_can_check_for_function_pointers): New virtual
993 function.
994 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
995 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
996 from can_check_for_function_pointers, move in file.
997 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
998 section_may_have_icf_unsafe_poineters, move in file.
999 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1000 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1001 Rename from can_check_for_function_pointers, move in file.
1002 (Target_i386::can_icf_inline_merge_sections): Remove.
1003 (Target_i386::i386_info): Initialize
1004 can_icf_inline_merge_sections.
1005 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1006 Initialize can_icf_inline_merge_sections.
1007 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1008 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1009 Rename from can_check_for_function_pointers, move in file.
1010 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1011 (Target_x86_64::x86_64_info): Initialize
1012 can_icf_inline_merge_sections.
1013 * testsuite/testfile.cc (Target_test::test_target_info):
1014 Likewise.
1015 * icf.cc (get_section_contents): Correct formatting.
1016
1017 2011-06-27 Ian Lance Taylor <iant@google.com>
1018
1019 * symtab.cc (Symbol::versioned_name): New function.
1020 (Symbol_table::add_to_final_symtab): Use versioned_name when
1021 appropriate.
1022 (Symbol_table::sized_write_symbol): Likewise.
1023 * symtab.h (class Symbol): Declare versioned_name.
1024 * stringpool.h (class Stringpool_template): Add variant of add
1025 which takes a std::basic_string.
1026 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1027 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1028 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1029 (ver_test_12.o): New target.
1030 * testsuite/Makefile.in: Rebuild.
1031
1032 2011-06-27 Doug Kwan <dougkwan@google.com>
1033
1034 * arm.cc (Arm_relocate_functions::thm_jump8,
1035 Arm_relocate_functions::thm_jump11): Use a wider signed
1036 type to compute offset.
1037 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1038 arm_thm_jump8.
1039 * testsuite/Makefile.in: Regenerate.
1040 * testsuite/arm_branch_in_range.sh: Check test results of
1041 arm_thm_jump11 and arm_thm_jump8.
1042 * testsuite/arm_thm_jump11.s: New test source file.
1043 * testsuite/arm_thm_jump11.t: New linker script.
1044 * testsuite/arm_thm_jump8.s: New test source file.
1045 * testsuite/arm_thm_jump8.t: New linker script.
1046
1047 2011-06-24 Ian Lance Taylor <iant@google.com>
1048
1049 * layout.cc: Include "object.h".
1050 (ctors_sections_in_init_array): New static variable.
1051 (Layout::is_ctors_in_init_array): New function.
1052 (Layout::layout): Add entry to ctors_sections_in_init_array if
1053 appropriate.
1054 * layout.h (class Layout): Declare is_ctors_in_init_array.
1055 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1056 is_ctors_reverse_view is set.
1057 (Sized_relobj_file::write_sections): Add layout parameter. Change
1058 all callers. Set is_ctors_reverse_view field of View_size.
1059 (Sized_relobj_file::reverse_words): New function.
1060 * object.h (Sized_relobj_file::View_size): Add
1061 is_ctors_reverse_view field.
1062 (class Sized_relobj_file): Update declarations.
1063 * testsuite/initpri3.c: New test.
1064 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1065 initpri3b.
1066 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1067 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1068 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1069 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1070 * testsuite/Makefile.in: Rebuild.
1071
1072 2011-06-24 Cary Coutant <ccoutant@google.com>
1073
1074 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1075 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1076 (debug_msg_cdebug.err): New targets.
1077 * testsuite/Makefile.in: Regenerate.
1078 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1079 Fix checks for link with shared library.
1080
1081 2011-06-24 Doug Kwan <dougkwan@google.com>
1082
1083 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1084 skip empty text sections.
1085 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1086
1087 2011-06-22 Ian Lance Taylor <iant@google.com>
1088
1089 PR gold/12910
1090 * options.h (class General_options): Add --ctors-in-init-array.
1091 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1092 friends as SHT_PROGBITS for merging sections.
1093 (Layout::layout): Remove special handling of .init_array and
1094 friends. Don't sort if doing relocatable link. Sort for .ctors
1095 and .dtors if ctors_in_init_array.
1096 (Layout::make_output_section): Force correct section types for
1097 .init_array and friends. Don't sort if doing relocatable link,
1098 Don't sort .ctors and .dtors if ctors_in_init_array.
1099 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1100 (Layout::output_section_name): Add relobj parameter. Change all
1101 callers. Handle .ctors. and .dtors. in code rather than table.
1102 Handle .ctors and .dtors if ctors_in_init_array.
1103 (Layout::match_file_name): New function, moved from output.cc.
1104 * layout.h (class Layout): Update declarations.
1105 * output.cc: Include "layout.h".
1106 (Input_section_sort_entry::get_priority): New function.
1107 (Input_section_sort_entry::match_file_name): Just call
1108 Layout::match_file_name.
1109 (Output_section::Input_section_sort_init_fini_compare::operator()):
1110 Handle .ctors and .dtors. Sort by explicit priority rather than
1111 by name.
1112 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1113 * testsuite/initpri2.c: New test.
1114 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1115 (check_PROGRAMS): Add initpri2.
1116 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1117 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1118 * configure, testsuite/Makefile.in: Rebuild.
1119
1120 2011-06-19 Ian Lance Taylor <iant@google.com>
1121
1122 PR gold/12880
1123 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1124 .interp section to a PT_INTERP segment even if we have seen a
1125 --dynamic-linker option. Don't do it if we have seen a PHDRS
1126 clause in a linker script.
1127 (Layout::finalize): Don't create a .interp section if we've
1128 already create a PT_INTERP segment.
1129 (Layout::create_interp): Always call choose_output_section (revert
1130 patch of 2011-06-17). Don't create PT_INTERP segment.
1131 * script-sections.cc
1132 (Script_sections::create_note_and_tls_segments): Add a .interp
1133 section to a PT_INTERP segment even if we have seen a
1134 --dynamic-linker option.
1135
1136 2011-06-18 Ian Lance Taylor <iant@google.com>
1137
1138 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1139 merely because a non-PT_LOAD segment has a dynamic reloc.
1140
1141 2011-06-18 Ian Lance Taylor <iant@google.com>
1142
1143 * layout.cc (Layout::finish_dynamic_section): Don't create
1144 DT_FLAGS entry if not needed.
1145
1146 2011-06-18 Ian Lance Taylor <iant@google.com>
1147
1148 PR gold/12745
1149 * layout.cc (Layout::layout_eh_frame): Correct handling of
1150 writable .eh_frame section.
1151
1152 2011-06-17 Ian Lance Taylor <iant@google.com>
1153
1154 PR gold/12893
1155 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1156 symbol is redefined with the exact same object and value.
1157
1158 2011-06-17 Ian Lance Taylor <iant@google.com>
1159
1160 PR gold/12880
1161 * layout.h (class Layout): Add interp_segment_ field.
1162 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1163 (Layout::attach_allocated_section_to_segment): If making shared
1164 library, put .interp section in PT_INTERP segment.
1165 (Layout::finalize): Also call create_interp if -dynamic-linker
1166 option was used.
1167 (Layout::create_interp): Assert that there is no PT_INTERP
1168 segment. If not using a SECTIONS clause, use make_output_section.
1169 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1170 * script-sections.cc
1171 (Script_sections::create_note_and_tls_segments): If making shared
1172 library, put .interp section in PT_INTERP segment.
1173
1174 2011-06-17 Ian Lance Taylor <iant@google.com>
1175
1176 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1177 when making a shared library.
1178
1179 2011-06-17 Ian Lance Taylor <iant@google.com>
1180
1181 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1182 parameter. Change all callers. Don't issue warning about PC32
1183 against locally defined symbol.
1184
1185 2011-06-16 Ian Lance Taylor <iant@google.com>
1186
1187 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1188 occurs in same object.
1189
1190 2011-06-14 Alan Modra <amodra@gmail.com>
1191
1192 * po/POTFILES.in: Regenerate.
1193
1194 2011-06-09 Ian Lance Taylor <iant@google.com>
1195
1196 * script-sections.cc
1197 (Orphan_output_section::set_section_addresses): For a relocatable
1198 link set address to 0.
1199
1200 2011-06-09 Cary Coutant <ccoutant@google.com>
1201
1202 PR gold/12804
1203 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1204 used with --compress-debug-sections.
1205 * gold/object.cc (Sized_relobj_file::do_layout): Report
1206 uncompressed size of compressed input sections.
1207
1208 2011-06-08 Cary Coutant <ccoutant@google.com>
1209
1210 PR gold/12804
1211 * testsuite/two_file_test_2_v1.cc: Change initialization of
1212 v2 to keep it in .data.
1213
1214 2011-06-07 Cary Coutant <ccoutant@google.com>
1215
1216 * common.cc (Symbol_table::do_allocate_commons_list): Call
1217 gold_fallback.
1218 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1219 (Errors::fallback): New function.
1220 (gold_fallback): New function.
1221 * errors.h (Errors::fallback): New function.
1222 * gold.cc (gold_exit): Change status parameter to enum; adjust
1223 all callers.
1224 (queue_initial_tasks): Call gold_fallback.
1225 * gold.h: Include cstdlib.
1226 (Exit_status): New enum type.
1227 (gold_exit): Change status parameter to enum.
1228 (gold_fallback): New function.
1229 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1230 (Layout::create_symtab_sections): Likewise.
1231 (Layout::create_shdrs): Likewise.
1232 * main.cc (main): Adjust call to gold_exit.
1233 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1234 (Output_data_got::add_got_entry_pair): Likewise.
1235 (Output_section::add_input_section): Likewise.
1236 (Output_section::add_output_section_data): Likewise.
1237 (Output_segment::set_section_list_addresses): Likewise.
1238 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1239
1240 2011-06-07 Cary Coutant <ccoutant@google.com>
1241
1242 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1243 for incremental links.
1244 * output.cc (Output_segment::set_section_list_addresses): Remove
1245 FIXME and test for TLS or BSS.
1246
1247 2011-06-07 Cary Coutant <ccoutant@google.com>
1248
1249 * testsuite/Makefile.am: Add incremental_copy_test,
1250 incremental_common_test_1.
1251 * testsuite/Makefile.in: Regenerate.
1252 * testsuite/common_test_1_v1.c: New source file.
1253 * testsuite/common_test_1_v2.c: New source file.
1254 * testsuite/copy_test_v1.cc: New source file.
1255
1256 2011-06-07 Cary Coutant <ccoutant@google.com>
1257
1258 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1259 update, allocate common from bss section's free list.
1260 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1261 linker-defined symbols.
1262 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1263 Skip GOT and PLT entries that are no longer referenced.
1264 (Output_section_incremental_inputs::write_info_blocks): Mark
1265 linker-defined symbols.
1266 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1267 * output.cc (Output_section::allocate): New function.
1268 * output.h (Output_section::allocate): New function.
1269 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1270 linker-defined symbols.
1271 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1272 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1273 (Symbol::init_base_output_data): Likewise.
1274 (Symbol::init_base_output_segment): Likewise.
1275 (Symbol::init_base_constant): Likewise.
1276 (Sized_symbol::init_output_data): Likewise.
1277 (Sized_symbol::init_output_segment): Likewise.
1278 (Sized_symbol::init_constant): Likewise.
1279 (Symbol_table::do_define_in_output_data): Likewise.
1280 (Symbol_table::do_define_in_output_segment): Likewise.
1281 (Symbol_table::do_define_as_constant): Likewise.
1282 * symtab.h (Symbol::is_predefined): New function.
1283 (Symbol::init_base_output_data): Add is_predefined parameter.
1284 (Symbol::init_base_output_segment): Likewise.
1285 (Symbol::init_base_constant): Likewise.
1286 (Symbol::is_predefined_): New data member.
1287 (Sized_symbol::init_output_data): Add is_predefined parameter.
1288 (Sized_symbol::init_output_segment): Likewise.
1289 (Sized_symbol::init_constant): Likewise.
1290 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1291
1292 2011-06-07 Cary Coutant <ccoutant@google.com>
1293
1294 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1295 instead of emit_copy_reloc.
1296 (Copy_relocs::emit_copy_reloc): Refactor.
1297 (Copy_relocs::make_copy_reloc): New function.
1298 (Copy_relocs::add_copy_reloc): Remove.
1299 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1300 section.
1301 (Copy_relocs::make_copy_reloc): New function.
1302 (Copy_relocs::add_copy_reloc): Remove.
1303 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1304 unchanged input files.
1305 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1306 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1307 Reserve BSS space for COPY relocations.
1308 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1309 (Output_section_incremental_inputs::write_info_blocks): Record
1310 whether a symbol is copied from a shared object.
1311 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1312 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1313 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1314 (Incremental_input_entry_reader::get_output_symbol_index): Add
1315 is_copy parameter.
1316 (Incremental_binary::emit_copy_relocs): New function.
1317 (Incremental_binary::do_emit_copy_relocs): New function.
1318 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1319 new data member.
1320 (Sized_incremental_binary::add_copy_reloc): New function.
1321 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1322 (Sized_incremental_binary::Copy_reloc): New struct.
1323 (Sized_incremental_binary::Copy_relocs): New typedef.
1324 (Sized_incremental_binary::copy_relocs_): New data member.
1325 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1326 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1327 * target.h (Sized_target::emit_copy_reloc): New function.
1328 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1329
1330 2011-06-02 Cary Coutant <ccoutant@google.com>
1331
1332 PR gold/12163
1333 * gold/archive.cc (Archive::Archive): Initialize new data member.
1334 (Archive::include_all_members): Return if archive has already been
1335 included.
1336 * gold/archive.h (Archive::include_all_members_): New data member.
1337
1338 2011-06-02 Nick Clifton <nickc@redhat.com>
1339
1340 * dynobj.h: Fix spelling mistake in comment.
1341 * output.cc: Likewise.
1342
1343 2011-05-31 Doug Kwan <dougkwan@google.com>
1344 Asier Llano
1345
1346 PR gold/12826
1347 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
1348 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1349 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1350 redundant arm_exidx_test.so.
1351 * testsuite/Makefile.in: Regenerate.
1352 (check_SCRIPTS): Add pr12826.sh
1353 (check_DATA): Add pr12826.stdout
1354 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1355 * testsuite/pr12826.sh: New file.
1356 * testsuite/pr12826_1.s: Ditto.
1357 * testsuite/pr12826_1.s: Ditto.
1358
1359 2011-05-30 Ian Lance Taylor <iant@google.com>
1360
1361 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1362 sections.
1363
1364 2011-05-29 Ian Lance Taylor <iant@google.com>
1365
1366 PR gold/12804
1367 * testsuite/Makefile.am: Use different file name for two_file_test
1368 temporary file for each incremental test.
1369 * testsuite/Makefile.in: Rebuild.
1370
1371 2011-05-29 Ian Lance Taylor <iant@google.com>
1372
1373 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1374 binary input file is empty.
1375
1376 2011-05-27 Ian Lance Taylor <iant@google.com>
1377
1378 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1379 (ver_test_9.so): Likewise.
1380 * testsuite/Makefile.in: Rebuild.
1381
1382 2011-05-26 Cary Coutant <ccoutant@google.com>
1383
1384 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1385 * incremental.cc (Incremental_inputs::report_input_section): Fix
1386 comment, indentation.
1387 (Incremental_inputs::report_comdat_group): New function.
1388 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1389 of data for incremental input file entry.
1390 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1391 group count, COMDAT group signatures.
1392 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1393 an unchanged input file.
1394 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1395 Initialize new data member.
1396 (Incremental_object_entry::add_comdat_group): New function.
1397 (Incremental_object_entry::get_comdat_group_count): New function.
1398 (Incremental_object_entry::get_comdat_signature_key): New function.
1399 (Incremental_object_entry::groups_): New data member.
1400 (Incremental_inputs::report_comdat_group): New function.
1401 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1402 data for incremental input file entry.
1403 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1404 (Incremental_input_entry_reader::get_input_section): Adjust size of
1405 data for incremental input file entry.
1406 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1407 (Incremental_input_entry_reader::get_comdat_group_signature): New
1408 function.
1409 * object.cc (Sized_relobj::include_section_group): Report kept
1410 COMDAT groups for incremental links.
1411
1412 2011-05-24 David Meyer <pdox@google.com>
1413
1414 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1415 with name parameter. Add found_name parameter.
1416 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1417 * dirsearch.h (class Dirsearch): Update declaration.
1418
1419 2011-05-24 Ian Lance Taylor <iant@google.com>
1420
1421 * archive.cc (Library_base::should_include_member): Pull in object
1422 from archive if it defines the entry symbol.
1423 * parameters.cc (Parameters::entry): New function.
1424 * parameters.h (class Parameters): Declare entry.
1425 * output.h (class Output_file_header): Remove entry_ field.
1426 * output.cc (Output_file_header::Output_file_header): Remove entry
1427 parameter. Change all callers.
1428 (Output_file_header::entry): Use parameters->entry.
1429 * gold.cc (queue_middle_tasks): Likewise.
1430 * plugin.cc (Plugin_hook::run): Likewise.
1431
1432 2011-05-24 Cary Coutant <ccoutant@google.com>
1433
1434 * gold.cc (queue_initial_tasks): Pass incremental base filename
1435 to Output_file::open_base_file; don't print error message.
1436 * incremental-dump.cc (main): Adjust call to
1437 Output_file::open_for_modification.
1438 * incremental-dump.cc (main): Likewise.
1439 * incremental.cc (Incremental_inputs::report_command_line):
1440 Ignore --incremental-base option when comparing command lines.
1441 Ignore parameter when given as separate argument.
1442 * options.h (class General_options): Add --incremental-base.
1443 * output.cc (Output_file::Output_file):
1444 (Output_file::open_base_file): Add base_name and writable parameters;
1445 read base file into new file; print error message here.
1446 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1447 callers.
1448 * output.h (Output_file::open_for_modification): Rename to...
1449 (Output_file::open_base_file): ...this; add base_name and
1450 writable parameters; adjust all callers.
1451 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1452 callers.
1453 * testsuite/Makefile.am (incremental_test_4): Test
1454 --incremental-base.
1455 * testsuite/Makefile.in: Regenerate.
1456
1457 2011-05-24 Cary Coutant <ccoutant@google.com>
1458
1459 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1460 incremental_test_4.
1461 * testsuite/Makefile.in: Regenerate.
1462 * testsuite/two_file_test_1_v1.cc: New test source file.
1463 * testsuite/two_file_test_1b_v1.cc: New test source file.
1464 * testsuite/two_file_test_2_v1.cc: New test source file.
1465
1466 2011-05-24 Cary Coutant <ccoutant@google.com>
1467
1468 * dynobj.h (Dynobj::do_dynobj): New function.
1469 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1470 flag and soname for shared objects.
1471 * incremental.cc (Incremental_inputs::report_object): Make
1472 either Incremental_object_entry or Incremental_dynobj_entry; add
1473 soname to string table.
1474 (Incremental_inputs::report_input_section): Add assertion.
1475 (Output_section_incremental_inputs::set_final_data_size): Adjust
1476 type of input file entry for shared libraries; adjust size of
1477 shared library info entry.
1478 (Output_section_incremental_inputs::write_input_files): Write
1479 as_needed flag for shared libraries.
1480 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1481 of input file entry for shared libraries; write soname.
1482 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1483 soname from incremental info.
1484 * incremental.h (enum Incremental_input_flags): Add
1485 INCREMENTAL_INPUT_AS_NEEDED.
1486 (Incremental_input_entry::Incremental_input_entry): Initialize new
1487 data member.
1488 (Incremental_input_entry::set_as_needed): New function.
1489 (Incremental_input_entry::as_needed): New function.
1490 (Incremental_input_entry::do_dynobj_entry): New function.
1491 (Incremental_input_entry::as_needed_): New data member.
1492 (Incremental_object_entry::Incremental_object_entry): Don't check
1493 for shared library.
1494 (Incremental_object_entry::do_type): Likewise.
1495 (class Incremental_dynobj_entry): New class.
1496 (Incremental_input_entry_reader::as_needed): New function.
1497 (Incremental_input_entry_reader::get_soname): New function.
1498 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1499 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1500 size of shared library info entry.
1501 * layout.cc (Layout::finish_dynamic_section): Don't test for
1502 incremental link when adding DT_NEEDED entries.
1503 * object.h (Object::Object): Initialize new data member.
1504 (Object::dynobj): New function.
1505 (Object::set_as_needed): New function.
1506 (Object::as_needed): New function.
1507 (Object::do_dynobj): New function.
1508 (Object::as_needed_): New data member.
1509
1510 2011-05-24 Cary Coutant <ccoutant@google.com>
1511
1512 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1513 info; adjust display of GOT entries.
1514 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1515 vector of input objects; remove file_status_.
1516 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1517 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1518 got_plt reader; call target hooks to reserve GOT entries.
1519 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1520 of input file info header and GOT info entry.
1521 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1522 relocation info.
1523 (Got_plt_view_info::got_descriptor): Remove.
1524 (Got_plt_view_info::sym_index): New data member.
1525 (Got_plt_view_info::input_index): New data member.
1526 (Local_got_offset_visitor::visit): Write input file index.
1527 (Global_got_offset_visitor::visit): Write 0 for input file index.
1528 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1529 with sym_index and input_index.
1530 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1531 incremental info GOT entry; replace got_descriptor with input_index.
1532 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1533 map from input file index to object.
1534 (Sized_relobj_incr::do_layout): Replace direct data member reference
1535 with accessor function.
1536 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1537 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1538 Adjust size of input file info header.
1539 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1540 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1541 (Incremental_input_entry_reader::get_input_section): Adjust size of
1542 input file info header.
1543 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1544 of incremental info GOT entry.
1545 (Incremental_got_plt_reader::get_got_desc): Remove.
1546 (Incremental_got_plt_reader::get_got_symndx): New function.
1547 (Incremental_got_plt_reader::get_got_input_index): New function.
1548 (Sized_incremental_binary::Sized_incremental_binary): Remove
1549 file_status_; add input_objects_.
1550 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1551 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1552 (Sized_incremental_binary::file_is_unchanged): Remove.
1553 (Sized_incremental_binary::set_input_object): New function.
1554 (Sized_incremental_binary::input_object): New function.
1555 (Sized_incremental_binary::file_status_): Remove.
1556 (Sized_incremental_binary::input_objects_): New data member.
1557 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1558 references.
1559 (Sized_relobj_incr::invalid_address): Move to base class.
1560 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1561 class.
1562 (Sized_relobj_incr::do_output_section_offset): Likewise.
1563 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1564 (Sized_relobj_incr::section_offsets_): Likewise.
1565 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1566 function.
1567 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1568 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1569 with accessor function.
1570 (Sized_relobj_file::do_layout): Likewise.
1571 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1572 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1573 (Sized_relobj_file::compute_final_local_value): Replace refs to
1574 section_offsets_ with accessor function.
1575 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1576 * object.h (Relobj::Relobj): Initialize new data members.
1577 (Relobj::add_dyn_reloc): New function.
1578 (Relobj::first_dyn_reloc): New function.
1579 (Relobj::dyn_reloc_count): New function.
1580 (Relobj::first_dyn_reloc_): New data member.
1581 (Relobj::dyn_reloc_count_): New data member.
1582 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1583 references.
1584 (Sized_relobj::Address): New typedef.
1585 (Sized_relobj::invalid_address): Move here from child class.
1586 (Sized_relobj::Sized_relobj): Initialize new data members.
1587 (Sized_relobj::sized_relobj): New function.
1588 (Sized_relobj::is_output_section_offset_invalid): Move here from
1589 child class.
1590 (Sized_relobj::get_output_section_offset): Likewise.
1591 (Sized_relobj::local_has_got_offset): Likewise.
1592 (Sized_relobj::local_got_offset): Likewise.
1593 (Sized_relobj::set_local_got_offset): Likewise.
1594 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1595 (Sized_relobj::clear_got_offsets): New function.
1596 (Sized_relobj::section_offsets): Move here from child class.
1597 (Sized_relobj::do_output_section_offset): Likewise.
1598 (Sized_relobj::do_set_section_offset): Likewise.
1599 (Sized_relobj::Local_got_offsets): Likewise.
1600 (Sized_relobj::local_got_offsets_): Likewise.
1601 (Sized_relobj::section_offsets_): Likewise.
1602 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1603 references.
1604 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1605 class.
1606 (Sized_relobj_file::sized_relobj): New function
1607 (Sized_relobj_file::local_has_got_offset): Move to base class.
1608 (Sized_relobj_file::local_got_offset): Likewise.
1609 (Sized_relobj_file::set_local_got_offset): Likewise.
1610 (Sized_relobj_file::get_output_section_offset): Likewise.
1611 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1612 (Sized_relobj_file::do_output_section_offset): Likewise.
1613 (Sized_relobj_file::do_set_section_offset): Likewise.
1614 (Sized_relobj_file::Local_got_offsets): Likewise.
1615 (Sized_relobj_file::local_got_offsets_): Likewise.
1616 (Sized_relobj_file::section_offsets_): Likewise.
1617 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1618 (all constructors).
1619 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1620 (Output_reloc::get_symbol_index): Likewise.
1621 (Output_reloc::local_section_offset): Likewise.
1622 (Output_reloc::get_address): Likewise.
1623 (Output_reloc::symbol_value): Likewise.
1624 (Output_data_got::reserve_slot): Move to class definition.
1625 (Output_data_got::reserve_local): New function.
1626 (Output_data_got::reserve_slot_for_global): Remove.
1627 (Output_data_got::reserve_global): New function.
1628 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1629 (all constructors, two instantiations).
1630 (Output_reloc::get_relobj): New function (two instantiations).
1631 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1632 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1633 (Output_data_reloc::add_global): Adjust type of relobj.
1634 (Output_data_reloc::add_global_relative): Likewise.
1635 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1636 (Output_data_reloc::add_local): Likewise.
1637 (Output_data_reloc::add_local_relative): Likewise.
1638 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1639 (Output_data_reloc::add_local_section): Likewise.
1640 (Output_data_reloc::add_output_section): Likewise.
1641 (Output_data_reloc::add_absolute): Likewise.
1642 (Output_data_reloc::add_target_specific): Likewise.
1643 (Output_data_got::reserve_slot): Move definition here.
1644 (Output_data_got::reserve_local): New function.
1645 (Output_data_got::reserve_global): New function.
1646 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1647 section_offsets_ with accessor function.
1648 (Sized_relobj_file::write_sections): Likewise.
1649 (Sized_relobj_file::do_relocate_sections): Likewise.
1650 * target.h (Sized_target::reserve_local_got_entry): New function.
1651 (Sized_target::reserve_global_got_entry): New function.
1652 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1653 (Target_x86_64::reserve_global_got_entry): New function.
1654 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1655
1656 2011-05-23 Cary Coutant <ccoutant@google.com>
1657
1658 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1659 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1660 bit when checking got_type.
1661 * incremental.cc (Sized_incremental_binary::setup_readers):
1662 Store symbol table and string table locations; initialize bit vector
1663 of file status flags.
1664 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1665 unchanged files.
1666 (Sized_incremental_binary::do_process_got_plt): New function.
1667 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1668 (Output_section_incremental_inputs::set_final_data_size): Record
1669 file index for each input file.
1670 (Output_section_incremental_inputs::write_got_plt): Store file index
1671 instead of input entry offset for each GOT entry.
1672 * incremental.h
1673 (Incremental_input_entry::Incremental_input_entry): Initialize new
1674 data member.
1675 (Incremental_input_entry::set_offset): Store file index.
1676 (Incremental_input_entry::get_file_index): New function.
1677 (Incremental_input_entry::file_index_): New data member.
1678 (Incremental_binary::process_got_plt): New function.
1679 (Incremental_binary::do_process_got_plt): New function.
1680 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1681 data members.
1682 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1683 (Sized_incremental_binary::set_file_is_unchanged): New function.
1684 (Sized_incremental_binary::file_is_unchanged): New function.
1685 (Sized_incremental_binary::do_process_got_plt): New function.
1686 (Sized_incremental_binary::file_status_): New data member.
1687 (Sized_incremental_binary::main_symtab_loc_): New data member.
1688 (Sized_incremental_binary::main_strtab_loc_): New data member.
1689 * output.cc (Output_data_got::Got_entry::write): Add case
1690 RESERVED_CODE.
1691 (Output_data_got::add_global): Call add_got_entry.
1692 (Output_data_got::add_global_plt): Likewise.
1693 (Output_data_got::add_global_with_rel): Likewise.
1694 (Output_data_got::add_global_with_rela): Likewise.
1695 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1696 (Output_data_got::add_global_pair_with_rela): Likewise.
1697 (Output_data_got::add_local): Call add_got_entry.
1698 (Output_data_got::add_local_plt): Likewise.
1699 (Output_data_got::add_local_with_rel): Likewise.
1700 (Output_data_got::add_local_with_rela): Likewise.
1701 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1702 (Output_data_got::add_local_pair_with_rela): Likewise.
1703 (Output_data_got::reserve_slot): New function.
1704 (Output_data_got::reserve_slot_for_global): New function.
1705 (Output_data_got::add_got_entry): New function.
1706 (Output_data_got::add_got_entry_pair): New function.
1707 (Output_section::add_output_section_data): Edit FIXME.
1708 * output.h
1709 (Output_section_data_build::Output_section_data_build): New
1710 constructor with size parameter.
1711 (Output_data_space::Output_data_space): Likewise.
1712 (Output_data_got::Output_data_got): Initialize new data member; new
1713 constructor with size parameter.
1714 (Output_data_got::add_constant): Call add_got_entry.
1715 (Output_data_got::reserve_slot): New function.
1716 (Output_data_got::reserve_slot_for_global): New function.
1717 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1718 (Output_data_got::add_got_entry): New function.
1719 (Output_data_got::add_got_entry_pair): New function.
1720 (Output_data_got::free_list_): New data member.
1721 * target.h (Sized_target::init_got_plt_for_update): New function.
1722 (Sized_target::register_global_plt_entry): New function.
1723 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1724 Initialize new data member; call init; add constructor with PLT count.
1725 (Output_data_plt_x86_64::init): New function.
1726 (Output_data_plt_x86_64::add_relocation): New function.
1727 (Output_data_plt_x86_64::reserve_slot): New function.
1728 (Output_data_plt_x86_64::free_list_): New data member.
1729 (Target_x86_64::init_got_plt_for_update): New function.
1730 (Target_x86_64::register_global_plt_entry): New function.
1731 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1732 incremental updates.
1733 (Output_data_plt_x86_64::add_relocation): New function.
1734 * testsuite/object_unittest.cc (Object_test): Set default options.
1735
1736 2011-05-16 Ian Lance Taylor <iant@google.com>
1737
1738 * options.h (class General_options): Make -i a synonym for -r.
1739
1740 2011-05-16 Ian Lance Taylor <iant@google.com>
1741
1742 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1743
1744 2011-05-10 Cary Coutant <ccoutant@google.com>
1745
1746 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1747 strip_all (-s).
1748
1749 2011-05-06 Ian Lance Taylor <iant@google.com>
1750
1751 * layout.cc (Layout::layout): If the output section flags change,
1752 update the ordering.
1753
1754 2011-04-25 Cary Coutant <ccoutant@google.com>
1755
1756 * incremental-dump.cc (dump_incremental_inputs): Print local
1757 symbol info for each input file.
1758 * incremental.cc
1759 (Output_section_incremental_inputs::set_final_data_size): Add local
1760 symbol info to input file entries in incremental info.
1761 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1762 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1763 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1764 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1765 implementation.
1766 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1767 (Sized_incr_relobj::do_relocate): Write the local symbols.
1768 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1769 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1770 Adjust size of input file header.
1771 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1772 (Incremental_inputs_reader::get_local_symbol_count): New function.
1773 (Incremental_inputs_reader::get_input_section): Adjust size of input
1774 file header.
1775 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1776 (Sized_incr_relobj::This): New typedef.
1777 (Sized_incr_relobj::sym_size): New const data member.
1778 (Sized_incr_relobj::Local_symbol): New struct.
1779 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1780 (Sized_incr_relobj::do_local_symbol_offset): New function.
1781 (Sized_incr_relobj::local_symbol_count_): New data member.
1782 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1783 (Sized_incr_relobj::local_symbol_index_): New data member.
1784 (Sized_incr_relobj::local_symbol_offset_): New data member.
1785 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1786 (Sized_incr_relobj::local_symbols_): New data member.
1787 * object.h (Relobj::output_local_symbol_count): New function.
1788 (Relobj::local_symbol_offset): New function.
1789 (Relobj::do_output_local_symbol_count): New function.
1790 (Relobj::do_local_symbol_offset): New function.
1791 (Sized_relobj::do_output_local_symbol_count): New function.
1792 (Sized_relobj::do_local_symbol_offset): New function.
1793
1794 2011-04-22 Vladimir Simonov <sv@sw.ru>
1795
1796 * descriptors.cc (set_close_on_exec): New function.
1797 (Descriptors::open): Use set_close_on_exec.
1798 * output.cc (S_ISLNK): Define if not defined.
1799
1800 2011-04-22 Cary Coutant <ccoutant@google.com>
1801
1802 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1803 global symbol map.
1804 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1805 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1806 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1807 relocations.
1808 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1809 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1810 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1811 * incremental.h
1812 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1813 function.
1814 (Incremental_binary::apply_incremental_relocs): New function.
1815 (Incremental_binary::do_apply_incremental_relocs): New function.
1816 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1817 data member.
1818 (Sized_incremental_binary::add_global_symbol): New function.
1819 (Sized_incremental_binary::global_symbol): New function.
1820 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1821 (Sized_incremental_binary::symbol_map_): New data member.
1822 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1823 * target.h (Sized_target::apply_relocation): New function.
1824 * target-reloc.h (apply_relocation): New function.
1825 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1826
1827 2011-04-22 Doug Kwan <dougkwan@google.com>
1828
1829 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1830 flag of a SHT_ARM_EXIDX section.
1831 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1832 * testsuite/Makefile.in: Regenerate.
1833 * testsuite/arm_exidx_test.s: New file.
1834 * testsuite/arm_exidx_test.sh: Same.
1835
1836 2011-04-20 Cary Coutant <ccoutant@google.com>
1837
1838 PR gold/12689
1839 * archive.h (Incremental_archive_entry::Archive_member):
1840 Initialize arg_serial_ (second constructor).
1841
1842 2011-04-17 Ian Lance Taylor <iant@google.com>
1843
1844 * object.cc (Relocate_info::location): Simplify location string.
1845 * errors.cc (Errors::error_at_location): Don't print program
1846 name.
1847 (Errors::warning_at_location): Likewise.
1848 (Errors::undefined_symbol): Likewise.
1849 * testsuite/debug_msg.sh: Update accordingly.
1850
1851 2011-04-14 Cary Coutant <ccoutant@google.com>
1852
1853 * gold/layout.cc (Layout::symtab_section_offset): New function.
1854 * gold/layout.h (Layout::symtab_section_offset): New function.
1855 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1856
1857 2011-04-12 Ian Lance Taylor <iant@google.com>
1858
1859 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1860 with MREMAP_MAYMOVE.
1861 * output.h (class Output_file): Add map_is_allocated_ field.
1862 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1863 not available, provide stubs. If mremap is not available, #define
1864 it to gold_mremap.
1865 (MREMAP_MAYMOVE): Define if not defined.
1866 (Output_file::Output_file): Initialize map_is_allocated_.
1867 (Output_file::resize): Check map_is_allocated_.
1868 (Output_file::map_anonymous): If mmap fails, use malloc.
1869 (Output_file::unmap): Don't do anything for an anonymous map.
1870 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1871 is not available, provide stubs.
1872 (File_read::View::~View): Use free rather than delete[].
1873 (File_read::make_view): Use malloc rather than new[]. If mmap
1874 fails, use malloc.
1875 (File_read::find_or_make_view): Use malloc rather than new[].
1876 * gold.h: Remove HAVE_REMAP code.
1877 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1878 exists. Rename mremap to gold_mremap. If mmap is not available
1879 don't do anything.
1880 * configure, config.in: Rebuild.
1881
1882 2011-04-11 Ian Lance Taylor <iant@google.com>
1883
1884 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1885 initialize local variable v.
1886
1887 2011-04-11 Cary Coutant <ccoutant@google.com>
1888
1889 * archive.cc (Archive::include_member): Adjust call to
1890 report_object.
1891 (Add_archive_symbols::run): Track argument serial numbers.
1892 (Lib_group::include_member): Likewise.
1893 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1894 * archive.h (Incremental_archive_entry::Archive_member):
1895 Initialize arg_serial_.
1896 (Archive_member::arg_serial_): New data member.
1897 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1898 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1899 incremental link.
1900 (Sized_dynobj::do_for_all_local_got_entries): New function.
1901 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1902 function.
1903 * fileread.cc (get_mtime): New function.
1904 * fileread.h (get_mtime): New function.
1905 * gold.cc (queue_initial_tasks): Check for incremental update.
1906 (process_incremental_input): New function.
1907 (queue_middle_tasks): Don't force valid target for incremental
1908 update.
1909 * incremental-dump.cc (find_input_containing_global): Adjust
1910 size of symbol info entry.
1911 (dump_incremental_inputs): Dump argument serial number and
1912 in_system_directory flag; bias shndx by 1; print symbol names
1913 when dumping per-file symbol lists; use new symbol info readers.
1914 * incremental.cc
1915 (Output_section_incremental_inputs:update_data_size): New function.
1916 (Sized_incremental_binary::setup_readers): Setup input readers
1917 for each input file; build maps for files added from libraries
1918 and scripts.
1919 (Sized_incremental_binary::check_input_args): New function.
1920 (Sized_incremental_binary::do_check_inputs): Build map of argument
1921 serial numbers to input arguments.
1922 (Sized_incremental_binary::do_file_has_changed): Rename
1923 do_file_is_unchanged to this; compare file modification times.
1924 (Sized_incremental_binary::do_init_layout): New function.
1925 (Sized_incremental_binary::do_reserve_layout): New function.
1926 (Sized_incremental_binary::do_get_input_reader): Remove.
1927 (Sized_incremental_binary::get_symtab_view): New function.
1928 (Incremental_checker::can_incrementally_link_output_file): Remove.
1929 (Incremental_inputs::report_command_line): Exclude --debug options.
1930 (Incremental_inputs::report_archive_begin): Add parameter; track
1931 argument serial numbers; don't put input file entry for archive
1932 before archive members.
1933 (Incremental_inputs::report_archive_end): Put input file entry
1934 for archive after archive members.
1935 (Incremental_inputs::report_object): Add parameter; track argument
1936 serial numbers and in_system_directory flag.
1937 (Incremental_inputs::report_script): Add parameter; track argument
1938 serial numbers.
1939 (Output_section_incremental_inputs::set_final_data_size): Adjust
1940 size of symbol info entry; check for forwarding symbols.
1941 (Output_section_incremental_inputs::write_input_files): Write
1942 in_system_directory flag and argument serial number.
1943 (Output_section_incremental_inputs::write_info_blocks): Map section
1944 indices between incremental info and original input file; store
1945 input section index for each symbol.
1946 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1947 change operator() to visit().
1948 (class Global_got_offset_visitor): Likewise.
1949 (class Global_symbol_visitor_got_plt):
1950 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1951 classes.
1952 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1953 (Sized_incr_relobj::do_read_symbols): New function.
1954 (Sized_incr_relobj::do_layout): New function.
1955 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1956 (Sized_incr_relobj::do_add_symbols): New function.
1957 (Sized_incr_relobj::do_should_include_member): New function.
1958 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1959 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1960 (Sized_incr_relobj::do_section_size): New function.
1961 (Sized_incr_relobj::do_section_name): New function.
1962 (Sized_incr_relobj::do_section_contents): New function.
1963 (Sized_incr_relobj::do_section_flags): New function.
1964 (Sized_incr_relobj::do_section_entsize): New function.
1965 (Sized_incr_relobj::do_section_address): New function.
1966 (Sized_incr_relobj::do_section_type): New function.
1967 (Sized_incr_relobj::do_section_link): New function.
1968 (Sized_incr_relobj::do_section_info): New function.
1969 (Sized_incr_relobj::do_section_addralign): New function.
1970 (Sized_incr_relobj::do_initialize_xindex): New function.
1971 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1972 (Sized_incr_relobj::do_read_relocs): New function.
1973 (Sized_incr_relobj::do_gc_process_relocs): New function.
1974 (Sized_incr_relobj::do_scan_relocs): New function.
1975 (Sized_incr_relobj::do_count_local_symbols): New function.
1976 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1977 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1978 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1979 (Sized_incr_relobj::do_relocate): New function.
1980 (Sized_incr_relobj::do_set_section_offset): New function.
1981 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1982 (Sized_incr_dynobj::do_read_symbols): New function.
1983 (Sized_incr_dynobj::do_layout): New function.
1984 (Sized_incr_dynobj::do_add_symbols): New function.
1985 (Sized_incr_dynobj::do_should_include_member): New function.
1986 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1987 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1988 (Sized_incr_dynobj::do_section_size): New function.
1989 (Sized_incr_dynobj::do_section_name): New function.
1990 (Sized_incr_dynobj::do_section_contents): New function.
1991 (Sized_incr_dynobj::do_section_flags): New function.
1992 (Sized_incr_dynobj::do_section_entsize): New function.
1993 (Sized_incr_dynobj::do_section_address): New function.
1994 (Sized_incr_dynobj::do_section_type): New function.
1995 (Sized_incr_dynobj::do_section_link): New function.
1996 (Sized_incr_dynobj::do_section_info): New function.
1997 (Sized_incr_dynobj::do_section_addralign): New function.
1998 (Sized_incr_dynobj::do_initialize_xindex): New function.
1999 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2000 (make_sized_incremental_object): New function.
2001 (Incremental_library::copy_unused_symbols): New function.
2002 (Incremental_library::do_for_all_unused_symbols): New function.
2003 * incremental.h (enum Incremental_input_flags): New type.
2004 (class Incremental_checker): Remove.
2005 (Incremental_input_entry::Incremental_input_entry): Add argument
2006 serial number.
2007 (Incremental_input_entry::arg_serial): New function.
2008 (Incremental_input_entry::set_is_in_system_directory): New function.
2009 (Incremental_input_entry::is_in_system_directory): New function.
2010 (Incremental_input_entry::arg_serial_): New data member.
2011 (Incremental_input_entry::is_in_system_directory_): New data member.
2012 (class Script_info): Move here from script.h.
2013 (Script_info::Script_info): Add filename parameter.
2014 (Script_info::filename): New function.
2015 (Script_info::filename_): New data member.
2016 (Incremental_script_entry::Incremental_script_entry): Add argument
2017 serial number.
2018 (Incremental_object_entry::Incremental_object_entry): Likewise.
2019 (Incremental_object_entry::add_input_section): Build list of input
2020 sections with map to original shndx.
2021 (Incremental_object_entry::get_input_section_index): New function.
2022 (Incremental_object_entry::shndx_): New data member.
2023 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2024 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2025 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2026 serial number.
2027 (Incremental_inputs::report_archive_begin): Likewise.
2028 (Incremental_inputs::report_object): Likewise.
2029 (Incremental_inputs::report_script): Likewise.
2030 (class Incremental_global_symbol_reader): New class.
2031 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2032 and store flags and input file type.
2033 (Incremental_input_entry_reader::arg_serial): New function.
2034 (Incremental_input_entry_reader::type): Extract type from flags.
2035 (Incremental_input_entry_reader::is_in_system_directory): New function.
2036 (Incremental_input_entry_reader::get_input_section_count): Call
2037 accessor function for type.
2038 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2039 function for type; adjust size of global symbol entry.
2040 (Incremental_input_entry_reader::get_global_symbol_count): Call
2041 accessor function for type.
2042 (Incremental_input_entry_reader::get_object_count): Likewise.
2043 (Incremental_input_entry_reader::get_object_offset): Likewise.
2044 (Incremental_input_entry_reader::get_member_count): Likewise.
2045 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2046 (Incremental_input_entry_reader::get_member_offset): Likewise.
2047 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2048 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2049 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2050 (Incremental_input_entry_reader::get_global_symbol_reader): New
2051 function.
2052 (Incremental_input_entry_reader::get_output_symbol_index): New
2053 function.
2054 (Incremental_input_entry_reader::type_): Remove.
2055 (Incremental_input_entry_reader::flags_): New data member.
2056 (Incremental_inputs_reader::input_file_offset): New function.
2057 (Incremental_inputs_reader::input_file_index): New function.
2058 (Incremental_inputs_reader::input_file): Call input_file_offset.
2059 (Incremental_inputs_reader::input_file_at_offset): New function.
2060 (Incremental_relocs_reader::get_r_type): Reformat.
2061 (Incremental_relocs_reader::get_r_shndx): Reformat.
2062 (Incremental_relocs_reader::get_r_offset): Reformat.
2063 (Incremental_relocs_reader::data): New function.
2064 (Incremental_binary::Incremental_binary): Initialize new data members.
2065 (Incremental_binary::check_inputs): Add cmdline parameter.
2066 (Incremental_binary::file_is_unchanged): Remove.
2067 (Input_reader::arg_serial): New function.
2068 (Input_reader::get_unused_symbol_count): New function.
2069 (Input_reader::get_unused_symbol): New function.
2070 (Input_reader::do_arg_serial): New function.
2071 (Input_reader::do_get_unused_symbol_count): New function.
2072 (Input_reader::do_get_unused_symbol): New function.
2073 (Incremental_binary::input_file_count): New function.
2074 (Incremental_binary::get_input_reader): Change signature to use
2075 index instead of filename.
2076 (Incremental_binary::file_has_changed): New function.
2077 (Incremental_binary::get_input_argument): New function.
2078 (Incremental_binary::get_library): New function.
2079 (Incremental_binary::get_script_info): New function.
2080 (Incremental_binary::init_layout): New function.
2081 (Incremental_binary::reserve_layout): New function.
2082 (Incremental_binary::output_file): New function.
2083 (Incremental_binary::do_check_inputs): New function.
2084 (Incremental_binary::do_file_is_unchanged): Remove.
2085 (Incremental_binary::do_file_has_changed): New function.
2086 (Incremental_binary::do_init_layout): New function.
2087 (Incremental_binary::do_reserve_layout): New function.
2088 (Incremental_binary::do_input_file_count): New function.
2089 (Incremental_binary::do_get_input_reader): Change signature.
2090 (Incremental_binary::input_args_map_): New data member.
2091 (Incremental_binary::library_map_): New data member.
2092 (Incremental_binary::script_map_): New data member.
2093 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2094 new data members.
2095 (Sized_incremental_binary::output_section): New function.
2096 (Sized_incremental_binary::inputs_reader): Add const.
2097 (Sized_incremental_binary::symtab_reader): Add const.
2098 (Sized_incremental_binary::relocs_reader): Add const.
2099 (Sized_incremental_binary::got_plt_reader): Add const.
2100 (Sized_incremental_binary::get_symtab_view): New function.
2101 (Sized_incremental_binary::Inputs_reader): New typedef.
2102 (Sized_incremental_binary::Input_entry_reader): New typedef.
2103 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2104 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2105 (Sized_incremental_binary::do_file_has_changed): New function.
2106 (Sized_incremental_binary::do_init_layout): New function.
2107 (Sized_incremental_binary::do_reserve_layout): New function.
2108 (Sized_input_reader::Inputs_reader): Remove.
2109 (Sized_input_reader::Input_entry_reader): Remove.
2110 (Sized_input_reader::do_arg_serial): New function.
2111 (Sized_input_reader::do_get_unused_symbol_count): New function.
2112 (Sized_input_reader::do_get_unused_symbol): New function.
2113 (Sized_incremental_binary::do_input_file_count): New function.
2114 (Sized_incremental_binary::do_get_input_reader): Change signature;
2115 use index instead of filename.
2116 (Sized_incremental_binary::section_map_): New data member.
2117 (Sized_incremental_binary::input_entry_readers_): New data member.
2118 (class Sized_incr_relobj): New class.
2119 (class Sized_incr_dynobj): New class.
2120 (make_sized_incremental_object): New function.
2121 (class Incremental_library): New class.
2122 * layout.cc (Free_list::num_lists): New static data member.
2123 (Free_list::num_nodes): New static data member.
2124 (Free_list::num_removes): New static data member.
2125 (Free_list::num_remove_visits): New static data member.
2126 (Free_list::num_allocates): New static data member.
2127 (Free_list::num_allocate_visits): New static data member.
2128 (Free_list::init): New function.
2129 (Free_list::remove): New function.
2130 (Free_list::allocate): New function.
2131 (Free_list::dump): New function.
2132 (Free_list::print_stats): New function.
2133 (Layout_task_runner::run): Resize output file for incremental updates.
2134 (Layout::Layout): Initialize new data members.
2135 (Layout::set_incremental_base): New function.
2136 (Layout::init_fixed_output_section): New function.
2137 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2138 incremental updates.
2139 (Layout::create_gold_note): Do not create gold note section for
2140 incremental updates.
2141 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2142 for incremental updates.
2143 (Layout::set_section_offsets): For incremental updates, allocate space
2144 from free list.
2145 (Layout::create_symtab_sections): Layout with offsets relative to
2146 start of section; for incremental updates, allocate space from free
2147 list.
2148 (Layout::create_shdrs): For incremental updates, allocate space from
2149 free list.
2150 (Layout::finish_dynamic_section): For incremental updates, do not
2151 check --as-needed (fixed in subsequent patch).
2152 * layout.h (class Free_list): New class.
2153 (Layout::set_incremental_base): New function.
2154 (Layout::incremental_base): New function.
2155 (Layout::init_fixed_output_section): New function.
2156 (Layout::allocate): New function.
2157 (Layout::incremental_base_): New data member.
2158 (Layout::free_list_): New data member.
2159 * main.cc (main): Print Free_list statistics.
2160 * object.cc (Relobj::finalize_incremental_relocs): Add
2161 clear_counts parameter; clear counts only when clear_counts is set.
2162 (Sized_relobj::Sized_relobj): Initialize new base class.
2163 (Sized_relobj::do_layout): Don't report special sections.
2164 (Sized_relobj::do_for_all_local_got_entries): New function.
2165 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2166 symtab_off to all symbol table offsets.
2167 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2168 * object.h (class Got_offset_list): Move to top of file.
2169 (Object::Object): Allow case where input_file == NULL.
2170 (Object::~Object): Likewise.
2171 (Object::input_file): Assert that input_file != NULL.
2172 (Object::lock): Allow case where input_file == NULL.
2173 (Object::unlock): Likewise.
2174 (Object::is_locked): Likewise.
2175 (Object::token): Likewise.
2176 (Object::release): Likewise.
2177 (Object::is_incremental): New function.
2178 (Object::get_mtime): New function.
2179 (Object::for_all_local_got_entries): New function.
2180 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2181 (Object::set_is_in_system_directory): New function.
2182 (Object::is_in_system_directory): New function.
2183 (Object::do_is_incremental): New function.
2184 (Object::do_get_mtime): New function.
2185 (Object::do_for_all_local_got_entries): New function.
2186 (Object::is_in_system_directory_): New data member.
2187 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2188 (class Sized_relobj_base): New class.
2189 (class Sized_relobj): Derive from Sized_relobj_base.
2190 (class Sized_relobj::Symbols): Redeclare from base class.
2191 (class Sized_relobj::local_got_offset_list): Remove.
2192 (class Sized_relobj::Output_sections): Redeclare from base class.
2193 (class Sized_relobj::do_for_all_local_got_entries): New function.
2194 (class Sized_relobj::write_local_symbols): Add offset parameter.
2195 (class Sized_relobj::local_symbol_offset_): Update comment.
2196 (class Sized_relobj::local_dynsym_offset_): Update comment.
2197 * options.cc (Input_arguments::add_file): Remove const.
2198 * options.h (Input_file_argument::Input_file_argument):
2199 Initialize arg_serial_ (all constructors).
2200 (Input_file_argument::set_arg_serial): New function.
2201 (Input_file_argument::arg_serial): New function.
2202 (Input_file_argument::arg_serial_): New data member.
2203 (Input_arguments::Input_arguments): Initialize file_count_.
2204 (Input_arguments::add_file): Remove const.
2205 (Input_arguments::number_of_input_files): New function.
2206 (Input_arguments::file_count_): New data member.
2207 (Command_line::number_of_input_files): Call
2208 Input_arguments::number_of_input_files.
2209 * output.cc (Output_segment_headers::Output_segment_headers):
2210 Set current size.
2211 (Output_section::Input_section::current_data_size): New function.
2212 (Output_section::Output_section): Initialize new data members.
2213 (Output_section::add_input_section): Don't do merge sections for
2214 an incremental link; allocate space from free list for an
2215 incremental update.
2216 (Output_section::add_output_section_data): Allocate space from
2217 free list for an incremental update.
2218 (Output_section::update_data_size): New function.
2219 (Output_section::set_fixed_layout): New function.
2220 (Output_section::reserve): New function.
2221 (Output_segment::set_section_addresses): Remove const.
2222 (Output_segment::set_section_list_addresses): Remove const; allocate
2223 space from free list for an incremental update.
2224 (Output_segment::set_offset): Adjust size of RELRO segment for an
2225 incremental update.
2226 * output.h (Output_data::current_data_size): Move here from
2227 child classes.
2228 (Output_data::pre_finalize_data_size): New function.
2229 (Output_data::update_data_size): New function.
2230 (Output_section_headers::update_data_size): new function.
2231 (Output_section_data_build::current_data_size): Move to Output_data.
2232 (Output_data_strtab::update_data_size): New function.
2233 (Output_section::current_data_size): Move to Output_data.
2234 (Output_section::set_fixed_layout): New function.
2235 (Output_section::has_fixed_layout): New function.
2236 (Output_section::reserve): New function.
2237 (Output_section::update_data_size): New function.
2238 (Output_section::has_fixed_layout_): New data member.
2239 (Output_section::free_list_): New data member.
2240 (Output_segment::set_section_addresses): Remove const.
2241 (Output_segment::set_section_list_addresses): Remove const.
2242 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2243 New function.
2244 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2245 New function.
2246 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2247 parameter when calling Add_symbols constructor; store argument
2248 serial number for members of a lib group.
2249 (Add_symbols::locks): Allow case where token == NULL.
2250 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2251 (Read_member::~Read_member): New function.
2252 (Read_member::is_runnable): New function.
2253 (Read_member::locks): New function.
2254 (Read_member::run): New function.
2255 (Check_script::~Check_script): New function.
2256 (Check_script::is_runnable): New function.
2257 (Check_script::locks): New function.
2258 (Check_script::run): New function.
2259 (Check_library::~Check_library): New function.
2260 (Check_library::is_runnable): New function.
2261 (Check_library::locks): New function.
2262 (Check_library::run): New function.
2263 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2264 (Add_symbols::library_): New data member.
2265 (class Read_member): New class.
2266 (class Check_script): New class.
2267 (class Check_library): New class.
2268 * reloc.cc (Read_relocs::is_runnable): Allow case where
2269 token == NULL.
2270 (Read_relocs::locks): Likewise.
2271 (Scan_relocs::locks): Likewise.
2272 (Relocate_task::locks): Likewise.
2273 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2274 to clear counters.
2275 (Sized_relobj::incremental_relocs_scan): Fix comment.
2276 (Sized_relobj::do_relocate): Pass output file offset to
2277 write_local_symbols.
2278 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2279 from class declaration.
2280 * script.cc (read_input_script): Allocate Script_info; pass
2281 argument serial number to report_script.
2282 * script.h (class Script_info): Move to incremental.h.
2283 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2284 * symtab.h (Symbol_table::add_from_incrobj): New function.
2285 (Symbol_table::set_file_offset): New function.
2286
2287 2011-04-05 Cary Coutant <ccoutant@google.com>
2288
2289 * incremental-dump.cc (dump_incremental_inputs): Change signature
2290 to take a Sized_incremental_binary; change caller. Use readers
2291 in Sized_incremental_binary.
2292 * incremental.cc
2293 (Sized_incremental_binary::find_incremental_inputs_sections):
2294 Rename do_find_incremental_inputs_sections to this.
2295 (Sized_incremental_binary::setup_readers): New function.
2296 (Sized_incremental_binary::do_check_inputs): Check
2297 has_incremental_info_ flag; move setup code to setup_readers;
2298 use input readers.
2299 (Sized_incremental_binary::do_file_is_unchanged): New function.
2300 (Sized_incremental_binary::do_get_input_reader): New function.
2301 * incremental.h (class Incremental_binary): Move to end of file.
2302 (Incremental_binary::file_is_unchanged): New function.
2303 (Incremental_binary::do_file_is_unchanged): New function.
2304 (Incremental_binary::Input_reader): New class.
2305 (Incremental_binary::get_input_reader): New function.
2306 (class Sized_incremental_binary): Move to end of file.
2307 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2308 input section reader classes.
2309 (Sized_incremental_binary::has_incremental_info): New function.
2310 (Sized_incremental_binary::inputs_reader): New function.
2311 (Sized_incremental_binary::symtab_reader): New function.
2312 (Sized_incremental_binary::relocs_reader): New function.
2313 (Sized_incremental_binary::got_plt_reader): New function.
2314 (Sized_incremental_binary::do_file_is_unchanged): New function.
2315 (Sized_incremental_binary::Sized_input_reader): New class.
2316 (Sized_incremental_binary::get_input_reader): New function.
2317 (Sized_incremental_binary::find_incremental_inputs_sections):
2318 Rename do_find_incremental_inputs_sections to this.
2319 (Sized_incremental_binary::setup_readers): New function.
2320 (Sized_incremental_binary::has_incremental_info_): New data member.
2321 (Sized_incremental_binary::inputs_reader_): New data member.
2322 (Sized_incremental_binary::symtab_reader_): New data member.
2323 (Sized_incremental_binary::relocs_reader_): New data member.
2324 (Sized_incremental_binary::got_plt_reader_): New data member.
2325 (Sized_incremental_binary::current_input_file_): New data member.
2326
2327 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2328
2329 PR gold/12640
2330 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2331 violation.
2332
2333 2011-03-30 Cary Coutant <ccoutant@google.com>
2334
2335 * archive.cc (Archive::include_member): Adjust call to report_object.
2336 (Add_archive_symbols::run): Add script_info to call to
2337 report_archive_begin.
2338 (Lib_group::include_member): Adjust call to report_object.
2339 (Add_lib_group_symbols::run): Adjust call to report_object.
2340 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2341 blocks. Add object count for script input files.
2342 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2343 script_info parameter; change all callers.
2344 (Incremental_inputs::report_object): Add script_info parameter;
2345 change all callers.
2346 (Incremental_inputs::report_script): Store backpointer to
2347 incremental info entry.
2348 (Output_section_incremental_inputs::set_final_data_size): Record
2349 additional information for scripts.
2350 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2351 * incremental.h (Incremental_script_entry::add_object): New function.
2352 (Incremental_script_entry::get_object_count): New function.
2353 (Incremental_script_entry::get_object): New function.
2354 (Incremental_script_entry::objects_): New data member; adjust
2355 constructor.
2356 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2357 (Incremental_inputs::report_object): Add script_info parameter.
2358 (Incremental_inputs_reader::get_object_count): New function.
2359 (Incremental_inputs_reader::get_object_offset): New function.
2360 * options.cc (Input_arguments::add_file): Return reference to
2361 new input argument.
2362 * options.h (Input_argument::set_script_info): New function.
2363 (Input_argument::script_info): New function.
2364 (Input_argument::script_info_): New data member; adjust all
2365 constructors.
2366 (Input_file_group::add_file): Return reference to new input argument.
2367 (Input_file_lib::add_file): Likewise.
2368 (Input_arguments::add_file): Likewise.
2369 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2370 * script.cc (Parser_closure::Parser_closure): Add script_info
2371 parameter; adjust all callers.
2372 (Parser_closure::script_info): New function.
2373 (Parser_closure::script_info_): New data member.
2374 (read_input_script): Report scripts earlier to incremental info.
2375 (script_add_file): Set script_info in Input_argument.
2376 (script_add_library): Likewise.
2377 * script.h (Script_options::Script_info): Rewrite class.
2378
2379 2011-03-29 Cary Coutant <ccoutant@google.com>
2380
2381 * archive.cc (Library_base::should_include_member): Move
2382 method here from class Archive.
2383 (Archive::Archive): Initialize base class.
2384 (Archive::should_include_member): Move to base class.
2385 (Archive::do_for_all_unused_symbols): New function.
2386 (Add_archive_symbols::run): Remove redundant access to
2387 incremental_inputs.
2388 (Lib_group::Lib_group): Initialize base class.
2389 (Lib_group::do_filename): New function.
2390 (Lib_group::include_member): Pass pointer to Lib_group to
2391 report_object.
2392 (Lib_group::do_for_all_unused_symbols): New function.
2393 (Add_lib_group_symbols::run): Report archive information for
2394 incremental links.
2395 * archive.h (class Library_base): New base class.
2396 (class Archive): Derive from Library_base.
2397 (Archive::filename): Move to base class.
2398 (Archive::set_incremental_info): Likewise.
2399 (Archive::incremental_info): Likewise.
2400 (Archive::Should_include): Likewise.
2401 (Archive::should_include_member): Likewise.
2402 (Archive::Armap_entry): Remove.
2403 (Archive::Unused_symbol_iterator): Remove.
2404 (Archive::unused_symbols_begin): Remove.
2405 (Archive::unused_symbols_end): Remove.
2406 (Archive::do_filename): New function.
2407 (Archive::do_get_mtime): New function.
2408 (Archive::do_for_all_unused_symbols): New function.
2409 (Archive::task_): Move to base class.
2410 (Archive::incremental_info_): Likewise.
2411 (class Lib_group): Derive from Library_base.
2412 (Lib_group::do_filename): New function.
2413 (Lib_group::do_get_mtime): New function.
2414 (Lib_group::do_for_all_unused_symbols): New function.
2415 (Lib_group::task_): Move to base class.
2416 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2417 function.
2418 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2419 function.
2420 * incremental.cc (Incremental_inputs::report_archive_begin):
2421 Use Library_base; call library's get_mtime; add incremental inputs
2422 entry before members.
2423 (class Unused_symbol_visitor): New class.
2424 (Incremental_inputs::report_archive_end): Use Library_base; use
2425 visitor class to record unused symbols; don't add incremental inputs
2426 entry after members.
2427 (Incremental_inputs::report_object): Use Library_base.
2428 * incremental.h
2429 (Incremental_archive_entry::Incremental_archive_entry): Remove
2430 unused Archive parameter.
2431 (Incremental_inputs::report_archive_begin): Use Library_base.
2432 (Incremental_inputs::report_archive_end): Likewise.
2433 (Incremental_inputs::report_object): Likewise.
2434 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2435 function.
2436 * object.h (Object::for_all_global_symbols): New function.
2437 (Object::do_for_all_global_symbols): New function.
2438 (Sized_relobj::do_for_all_global_symbols): New function.
2439 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2440 function.
2441 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2442 function.
2443
2444 2011-03-27 Ian Lance Taylor <iant@google.com>
2445
2446 * archive.cc (Archive::interpret_header): Return -1 if something
2447 goes wrong. Change callers accordingly.
2448
2449 2011-03-25 Cary Coutant <ccoutant@google.com>
2450
2451 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2452 * testsuite/Makefile.in: Regenerate.
2453
2454 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
2455
2456 * plugin.cc (get_view): New.
2457 (Plugin::load): Pass get_view to the plugin.
2458 (Plugin_manager::get_view): New.
2459
2460 2011-03-21 Ian Lance Taylor <iant@google.com>
2461
2462 * testsuite/final_layout.sh: Rewrite to not use dc.
2463 * testsuite/relro_test.sh: Fail if dc is not present.
2464
2465 2011-03-21 Sriraman Tallam <tmsriram@google.com>
2466
2467 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2468 Change == to -eq.
2469 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2470 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2471 Change == to -eq.
2472 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2473 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2474
2475 2011-03-14 Ian Lance Taylor <iant@google.com>
2476
2477 * script-sections.cc (Sort_output_sections::script_compare):
2478 Rename from is_before, change return type.
2479 (Sort_output_sections::operator()): Adjust accordingly.
2480
2481 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2482
2483 PR gold/12572
2484 * testsuite/odr_violation2.cc: Add comment to make all error line
2485 numbers double digits.
2486 * testsuite/debug_msg.sh: Adjust expected errors.
2487
2488 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2489
2490 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2491 but mark earlier ones as non-canonical
2492 (offset_to_iterator): Update search target and example
2493 (do_addr2line): Return extra lines in a vector*
2494 (format_file_lineno): Extract from do_addr2line
2495 (one_addr2line): Add vector* out-param
2496 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2497 when a lineno entry appeared last for its instruction
2498 (Dwarf_line_info): Add vector* out-param
2499 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2500 * symtab.cc (Odr_violation_compare): Include the lineno in the
2501 comparison again.
2502 (linenos_from_loc): New. Combine the canonical line for an
2503 address with its other lines.
2504 (True_if_intersect): New. Helper functor to make
2505 std::set_intersection a query.
2506 (detect_odr_violations): Compare sets of lines instead of just
2507 one line for each function. This became less deterministic, but
2508 has fewer false positives.
2509 * symtab.h: Declarations.
2510 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2511 mix an optimized and non-optimized object in the same binary
2512 (odr_violation2.so): Same.
2513 * testsuite/Makefile.in: Regenerate from Makefile.am.
2514 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2515 * testsuite/debug_msg.sh: Update line numbers and add
2516 assertions.
2517 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2518 non-optimized context.
2519 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2520 isn't inlined, and use OdrDerived in an optimized context.
2521 * testsuite/odr_header1.h: Defines OdrDerived, where
2522 optimization will change the
2523 first-instruction-in-the-destructor's file and line number.
2524 * testsuite/odr_header2.h: Defines OdrBase.
2525
2526 2011-03-09 Ian Lance Taylor <iant@google.com>
2527
2528 * fileread.cc (File_read::clear_views): Don't delete the whole
2529 file view.
2530
2531 2011-03-08 Ian Lance Taylor <iant@google.com>
2532
2533 PR gold/12525
2534 * fileread.cc: #include <climits>.
2535 (GOLD_IOV_MAX): Define.
2536 (File_read::read_multiple): Limit number of entries by iov_max.
2537 * fileread.h (class File_read): Always set max_readv_entries to
2538 128.
2539
2540 2011-03-07 Ian Lance Taylor <iant@google.com>
2541
2542 PR gold/12525
2543 * options.h (class General_options): Add -dy and -dn.
2544
2545 2011-03-02 Cary Coutant <ccoutant@google.com>
2546
2547 * testsuite/script_test_9.t: Add TLS segment.
2548
2549 2011-03-02 Simon Baldwin <simonb@google.com>
2550
2551 * configure.ac: Add check for gnu_indirect_function support in
2552 the toolchain building binutils.
2553 * configure: Rebuild.
2554
2555 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
2556
2557 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2558 plugin only symbols.
2559 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2560 in plugin files as not needed in the symbol table.
2561
2562 2011-02-11 Sriraman Tallam <tmsriram@google.com>
2563
2564 * output.cc (Output_section::add_input_section): Delay fill
2565 generation for section ordering.
2566
2567 2011-02-09 Ian Lance Taylor <iant@google.com>
2568
2569 PR gold/12316
2570 * object.h (class Sized_relobj): Remove clear_local_symbols.
2571 * reloc.cc (Sized_relobj::do_relocate): Don't call
2572 clear_local_symbols.
2573
2574 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
2575
2576 * plugin.cc (is_visible_from_outside): Return true for symbols
2577 in the -u option.
2578
2579 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2580
2581 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2582 filename.
2583
2584 2011-02-02 Sriraman Tallam <tmsriram@google.com>
2585
2586 * icf.h (is_section_foldable_candidate): Change type of parameter
2587 to std::string.
2588 * icf.cc (Icf::find_identical_sections): Change type of local variable
2589 section_name to be std::string.
2590 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2591
2592 2011-01-25 Ian Lance Taylor <iant@google.com>
2593
2594 * script.cc (script_add_extern): Rewrite to use
2595 add_symbol_reference.
2596
2597 2011-01-25 Doug Kwan <dougkwan@google.com>
2598
2599 * icf.cc (get_section_contents): Always lock section's object.
2600
2601 2011-01-24 Ian Lance Taylor <iant@google.com>
2602
2603 * options.h (class General_options): Accept
2604 --no-detect-odr-violations.
2605
2606 2011-01-24 Ian Lance Taylor <iant@google.com>
2607
2608 * version.cc (version_string): Bump to 1.11.
2609
2610 2011-01-24 Ian Lance Taylor <iant@google.com>
2611
2612 * plugin.cc (class Plugin_rescan): Define new class.
2613 (Plugin_manager::claim_file): Set any_claimed_.
2614 (Plugin_manager::save_archive): New function.
2615 (Plugin_manager::save_input_group): New function.
2616 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2617 necessary.
2618 (Plugin_manager::new_undefined_symbol): New function.
2619 (Plugin_manager::rescan): New function.
2620 (Plugin_manager::rescannable_defines): New function.
2621 (Plugin_manager::add_input_file): Set any_added_.
2622 * plugin.h (class Plugin_manager): define new fields rescannable_,
2623 undefined_symbols_, any_claimed_, and any_added_. Declare
2624 Plugin_rescan as friend. Declare new functions.
2625 (Plugin_manager::Rescannable): Define type.
2626 (Plugin_manager::Rescannable_list): Define type.
2627 (Plugin_manager::Undefined_symbol_list): Define type.
2628 (Plugin_manager::Plugin_manager): Initialize new fields.
2629 * archive.cc (Archive::defines_symbol): New function.
2630 (Add_archive_symbols::run): Pass archive to plugins if any.
2631 * archive.h (class Archive): Declare defines_symbol.
2632 * readsyms.cc (Input_group::~Input_group): New function.
2633 (Finish_group::run): Pass input_group to plugins if any.
2634 * readsyms.h (class Input_group): Declare destructor.
2635 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2636 any.
2637
2638 2011-01-10 Ian Lance Taylor <iant@google.com>
2639
2640 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2641 section as relro.
2642 (Layout::set_segment_offsets): Reset increase_relro before calling
2643 set_section_addresses a second time.
2644
2645 2011-01-04 Cary Coutant <ccoutant@google.com>
2646
2647 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2648 sections before NOBITS sections.
2649
2650 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2651
2652 * version.cc (print_version): Update copyright to 2011.
2653
2654 2010-12-23 Cary Coutant <ccoutant@google.com>
2655
2656 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2657 of OS to this->add. Add OD parameter to second form of the function.
2658
2659 2010-12-20 Ian Lance Taylor <iant@google.com>
2660
2661 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2662 second of two consecutive entries with same offset.
2663
2664 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2665
2666 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2667 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2668 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2669 to avoid unneeded links against $(LDADD).
2670 * testsuite/Makefile.in: Regenerate.
2671
2672 2010-12-15 Ian Lance Taylor <iant@google.com>
2673
2674 PR gold/12324
2675 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2676 for R_X86_64_32 and R_X86_64_PC32.
2677 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2678 ver_matching_def_pic.o.
2679 (ver_matching_def_pic.o): New target.
2680
2681 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2682
2683 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2684 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2685 Move definition before File_read::View member definitions.
2686 (File_read::View::~View): Initialize and hold lock before
2687 updating current_mapped_bytes.
2688
2689 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2690
2691 * dwarf_reader.cc: Remove outdated comment.
2692 * gold-threads.cc: Fix typo in error message.
2693 * archive.cc: Fix typos in comments.
2694 * archive.h: Likewise.
2695 * arm-reloc-property.cc: Likewise.
2696 * arm-reloc-property.h: Likewise.
2697 * arm-reloc.def: Likewise.
2698 * arm.cc: Likewise.
2699 * attributes.h: Likewise.
2700 * cref.cc: Likewise.
2701 * ehframe.cc: Likewise.
2702 * fileread.h: Likewise.
2703 * gold.h: Likewise.
2704 * i386.cc: Likewise.
2705 * icf.cc: Likewise.
2706 * incremental.h: Likewise.
2707 * int_encoding.cc: Likewise.
2708 * layout.h: Likewise.
2709 * main.cc: Likewise.
2710 * merge.h: Likewise.
2711 * object.cc: Likewise.
2712 * object.h: Likewise.
2713 * options.cc: Likewise.
2714 * readsyms.cc: Likewise.
2715 * reduced_debug_output.cc: Likewise.
2716 * reloc.cc: Likewise.
2717 * script-sections.cc: Likewise.
2718 * sparc.cc: Likewise.
2719 * symtab.h: Likewise.
2720 * target-reloc.h: Likewise.
2721 * target.cc: Likewise.
2722 * target.h: Likewise.
2723 * timer.cc: Likewise.
2724 * timer.h: Likewise.
2725 * x86_64.cc: Likewise.
2726
2727 2010-12-09 Cary Coutant <ccoutant@google.com>
2728
2729 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2730 stack.
2731 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2732 parameter; change all callers.
2733 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2734 * options.h (warn_execstack): New option.
2735
2736 2010-12-07 Doug Kwan <dougkwan@google.com>
2737
2738 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2739 like function call relocations.
2740
2741 2010-12-07 Ian Lance Taylor <iant@google.com>
2742
2743 * archive.cc (Archive::get_elf_object_for_member): Permit
2744 punconfigured to be NULL.
2745 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2746 (Archive::include_member): Pass NULL to get_elf_object_for_member
2747 if we searched for the archive and this is the first included
2748 object.
2749
2750 2010-12-01 Ian Lance Taylor <iant@google.com>
2751
2752 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2753 track_relocs_type_ field.
2754 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2755 Set track_relocs_type_.
2756 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2757 contents when using RELA relocs.
2758 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2759 reloc_map_.
2760 * reloc.cc (Track_relocs::next_addend): New function.
2761 * reloc.h (class Track_relocs): Declare next_addend.
2762
2763 2010-12-01 Ian Lance Taylor <iant@google.com>
2764
2765 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2766 virtual destructor.
2767
2768 2010-12-01 Ian Lance Taylor <iant@google.com>
2769
2770 * README: Update compilers known to work and fail.
2771
2772 2010-11-23 Matthias Klose <doko@ubuntu.com>
2773
2774 * configure.in: For --enable-gold, handle value `default' instead of
2775 `both*'. Always install ld as ld.bfd, install as ld if gold is
2776 not the default.
2777 * configure: Regenerate.
2778
2779 2010-11-18 Doug Kwan <dougkwan@google.com>
2780
2781 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2782 and right_alignment to be zero. Store result alignment only if it is
2783 greater than existing alignment.
2784
2785 2010-11-16 Cary Coutant <ccoutant@google.com>
2786
2787 PR gold/12220
2788 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2789 Check for ".zdebug_line".
2790
2791 2010-11-16 Doug Kwan <dougkwan@google.com>
2792 Cary Coutant <ccoutant@google.com>
2793
2794 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2795 by reference; adjust all callers.
2796 * output.cc (Output_segment::set_section_addresses): Adjust references
2797 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2798 list is empty.
2799 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2800 end at page boundary.
2801
2802 2010-11-16 Cary Coutant <ccoutant@google.com>
2803
2804 PR gold/12220
2805 * layout.cc (Layout::choose_output_section): Transform names of
2806 compressed sections even when using a script with a SECTIONS clause.
2807 (Layout::output_section_name): Remove code to transform
2808 compressed debug section names.
2809 * output.cc (Output_section::add_input_section): Use uncompressed
2810 section size when tracking input sections.
2811
2812 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2813
2814 * symtab.h (Symbol::NON_PIC_REF): Remove.
2815 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2816 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2817 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2818 (Symbol::use_plt_offset): Take a flags argument and pass it
2819 directly to needs_dynamic_reloc. Restrict check for undefined
2820 weak symbols to function calls.
2821 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2822 (Target_arm::Scan::global): Use it.
2823 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2824 (Target_arm::Relocate::relocate): Likewise.
2825 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2826 parameter with an r_type parameter. Use get_reference_flags
2827 to get the flags.
2828 (Target_arm::Relocate::relocate): Update accordingly.
2829 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2830 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2831 (Target_i386::Scan::global): Likewise.
2832 (Target_i386::Relocate::relocate): Likewise.
2833 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2834 parameter with an r_type parameter. Use get_reference_flags
2835 to get the flags.
2836 (Target_i386::Relocate::relocate): Update accordingly.
2837 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2838 (Target_powerpc::Scan::global): Use it.
2839 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2840 (Target_powerpc::Relocate::relocate): Likewise.
2841 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2842 (Target_sparc::Scan::global): Use it.
2843 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2844 (Target_sparc::Relocate::relocate): Likewise.
2845 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2846 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2847 (Target_x86_64::Scan::global): Likewise.
2848 (Target_x86_64::Relocate::relocate): Likewise.
2849
2850 2010-11-08 Doug Kwan <dougkwan@google.com>
2851 Cary Coutant <ccoutant@google.com>
2852
2853 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2854 (Arm_exidx_merge_section::section_contents_): New data member.
2855 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2856 (Arm_input_section::~Arm_input_section): De-allocate memory.
2857 (Arm_input_section::original_contents_): New data member.
2858 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2859 in parameters instead of calling Object::section_contents without
2860 locking.
2861 (Arm_output_section::group_section): New parameter TASK. Pass it
2862 to callees that need locking objects.
2863 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2864 to lock EXIDX input sections. Fix a formatting issue. Call
2865 Arm_exidx_merged_section::build_contents to create merged section
2866 contents.
2867 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2868 to lock object of stub table owner.
2869 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2870 TEXT_SIZE to initialize data member TEXT_SIZE_.
2871 (Arm_exidx_input_section::addralign): Fix typo in comment.
2872 (Arm_exidx_input_section::text_size): New method.
2873 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2874 that require locking objects. Lock objects before scanning for stubs
2875 and updating local symbols.
2876 (Arm_input_section<big_endian>::init): Copy contents of original
2877 input section.
2878 (Arm_input_section<big_endian>::do_write): Use saved contents of
2879 original input section instead of calling Object::section_contents
2880 without locking.
2881 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2882 size without calling Object::section_size().
2883 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2884 for size. Allocate a buffer for merged EXIDX entries.
2885 (Arm_exidx_merged_section::build_contents): New method.
2886 (Arm_exidx_merged_section::do_write): Move merge section contents
2887 building code to Arm_exidx_merged_section::build_contetns. Write
2888 out contetns in buffer instead of building it on the fly.
2889 (Arm_relobj::make_exidx_input_section): Also pass text section size
2890 to Arm_exidx_input_section constructor.
2891 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2892 (Arm_dynobj::do_read_symbols): Fix memory leak.
2893 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2894 * target.h: (class Task): Add forward declaration.
2895 (Target::relax): Add new parameter TASK and pass it to
2896 Target::do_relax().
2897 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2898
2899 2010-11-05 Cary Coutant <ccoutant@google.com>
2900
2901 PR gold/10708
2902 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2903 object when reading from the file.
2904 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2905 second layout pass.
2906 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2907 when reading section contents.
2908 (get_section_contents): Likewise.
2909 (icf::find_identical_sections): Likewise.
2910 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2911 object when reading from the file.
2912 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2913 the object when doing deferred section layout.
2914
2915 2010-11-03 Nick Clifton <nickc@redhat.com>
2916
2917 PR gold/12001
2918 * script.h (class Symbol_assignment: name): New member. Returns
2919 the name of the symbol.
2920 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2921 Returns true if the given symbol name is on the list of
2922 assignments wating to be processed.
2923 * archive.cc (should_incldue_member): If the symbol is undefined,
2924 check to see if it is on the list of symbols pending assignment.
2925
2926 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2927
2928 * script-sections.cc (Script_sections::find_memory_region): Check
2929 for a NULL output section pointer.
2930
2931 2010-10-29 Doug Kwan <dougkwan@google.com>
2932
2933 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2934 Output_section::add_relaxed_input_section.
2935 * output.cc (Output_section::add_relaxed_input_section): Add new
2936 arguments LAYOUT and NAME. Set section order index.
2937 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2938 Copy section order index.
2939 * output.h (Output_section::add_relaxed_input_section): Add new
2940 arguments LAYOUT and NAME.
2941
2942 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2943
2944 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2945 NATIVE_OR_CROSS_LINKER.
2946 * testsuite/Makefile.in: Regenerate.
2947
2948 2010-10-20 Doug Kwan <dougkwan@google.com>
2949
2950 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2951 without SHF_LINK_ORDER flags.
2952 * layout.cc (Layout::choose_output_section): Do not filter
2953 SHF_LINK_ORDER flag in a relocatable link.
2954
2955 2010-10-17 Cary Coutant <ccoutant@google.com>
2956
2957 * output.h (Output_segment::set_section_addresses): Change function
2958 signature. Update all callers.
2959 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2960 sections.
2961 (Output_segment::set_section_addresses): Align after last TLS
2962 section. Add padding before last relro section instead of after.
2963
2964 2010-10-17 Doug Kwan <dougkwan@google.com>
2965
2966 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2967 GOT output section to be writable.
2968
2969 2010-10-14 Cary Coutant <ccoutant@google.com>
2970
2971 * debug.h (DEBUG_INCREMENTAL): New flag.
2972 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2973 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2974 mode.
2975 * incremental.cc (report_command_line): Ignore all forms of
2976 --incremental.
2977 * layout.cc (Layout::Layout): Check parameters for incremental link
2978 mode.
2979 * options.cc (General_options::parse_incremental): New function.
2980 (General_options::parse_no_incremental): New function.
2981 (General_options::parse_incremental_full): New function.
2982 (General_options::parse_incremental_update): New function.
2983 (General_options::incremental_mode_): New data member.
2984 (General_options::finalize): Check incremental_mode_.
2985 * options.h (General_options): Update help text for --incremental.
2986 Add --no-incremental, --incremental-full, --incremental-update.
2987 (General_options::Incremental_mode): New enum type.
2988 (General_options::incremental_mode): New function.
2989 (General_options::incremental_mode_): New data member.
2990 * parameters.cc (Parameters::incremental_mode_): New data member.
2991 (Parameters::set_options): Set incremental_mode_.
2992 (Parameters::set_incremental_full): New function.
2993 (Parameters::incremental): New function.
2994 (Parameters::incremental_update): New function.
2995 (set_parameters_incremental_full): New function.
2996 * parameters.h (Parameters::set_incremental_full): New function.
2997 (Parameters::incremental): New function.
2998 (Parameters::incremental_update): New function.
2999 (Parameters::incremental_mode_): New data member.
3000 (set_parameters_incremental_full): New function.
3001 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3002 incremental link mode.
3003 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3004 (Sized_relobj::do_relocate_sections): Likewise.
3005 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3006 option.
3007 * testsuite/Makefile.in: Regenerate.
3008 * testsuite/incremental_test.sh: Filter all forms of --incremental.
3009
3010 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3011
3012 * script-sections.h (class Script_sections): Make
3013 Sections_elements typedef public.
3014 * script-sections.cc (class Sort_output_sections): Add elements_
3015 field. Add constructor which sets it; change all callers.
3016 (Sort_output_sections::is_before): New function.
3017 (Sort_output_sections::operator()): Call is_before.
3018 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3019 conditional.
3020 * testsuite/script_test_10.sh: New test. Test script section
3021 order.
3022 * testsuite/script_test_10.t: Likewise.
3023 * testsuite/script_test_10.s: Likewise.
3024 * testsuite/Makefile.am: Wrap the cross linker tests and the
3025 common tests into NATIVE_OR_CROSS_LINKER.
3026 (check_SCRIPTS): Add script_test_10.sh.
3027 (check_DATA): Add script_test_10.stdout.
3028 (script_test_10.o, script_test_10): New targets.
3029 (script_test_10.stdout): New target.
3030 * configure, testsuite/Makefile.in: Regenerate.
3031
3032 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3033
3034 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3035 error for the deprecated relocations.
3036 (Target_arm::Scan::global): Likewise.
3037 (Target_arm::Relocate::relocate): Likewise.
3038
3039 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3040
3041 * fileread.cc (Input_file::find_file): Initialize *found_name
3042 and *namep when using the fallback search for case 4.
3043
3044 2010-10-11 Cary Coutant <ccoutant@google.com>
3045
3046 * options.h (class General_options): Redefine -z lazy as an alias for
3047 the negation of -z now.
3048
3049 2010-10-11 Ian Lance Taylor <iant@google.com>
3050
3051 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3052 binding.
3053
3054 2010-10-06 Nick Clifton <nickc@redhat.com>
3055
3056 * script-sections.cc(class Memory_region): Remove
3057 current_lma_offset_ field. Rename current_vma_offset_ to
3058 current_offset_. Add last_section_ field.
3059 (Memory_region::get_current_vma_address): Rename to
3060 get_current_address.
3061 (Memory_region::get_current_lma_address): Delete.
3062 (Memory_region::increment_vma_offset): Rename to
3063 increment_offset.
3064 (Memory_region::increment_lma_offset): Delete.
3065 (Memory_region::attributes_compatible): New method. Returns
3066 true if the provided section is compatible with the region.
3067 (Memory_region::get_last_section): New method. Returns the last
3068 section to use the region.
3069 (Memory_region::set_last_section): New method. Stores the last
3070 section to use the region.
3071 (Script_sections::block_in_region): New method. Returns true if
3072 a block of memory is contained within a region.
3073 (Script_sections::find_memory_region): New method. Locates a
3074 memory region to be used to set a VMA or LMA address.
3075 (Output_section_definition::set_section_addresses): Add code to
3076 check for addresses set by memory regions.
3077 (Output_segment::set_section_addresses): Remove memory region
3078 walking code.
3079 (Script_sections::create_segment): Add a warning if a header
3080 segment is created outside of any region.
3081 * script-sections.h (class Script_sections): Add prototypes for
3082 find_memory_region and block_in_region methods.
3083 * testsuite/memory_test.s: Use .long instead of .word.
3084 * testsuite/memory_test.t: Add some more output sections.
3085 * testsuite/memory_test.sh: Update expected output.
3086
3087 2010-10-02 Doug Kwan <dougkwan@google.com>
3088
3089 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3090 defintion to symtab.h
3091 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3092 declaration to defintion.
3093
3094 2010-10-01 Nick Clifton <nickc@redhat.com>
3095
3096 * expression.cc (eval): Replace dummy argument with NULL.
3097 (eval_maybe_dot): Check for a NULL result section pointer.
3098 (Symbol_expression::value): Likewise.
3099 (Dot_expression::value): Likewise.
3100 (BINARY_EXPRESSION): Likewise.
3101 (Max_expression::value): Likewise.
3102 (Min_expression::value): Likewise.
3103 (Absolute_expression::value): Likewise.
3104 (Addr_expression::value_from_output_section): Likewise.
3105 (Loaddddr_expression::value_from_output_section): Likewise.
3106 (Segment_start_expression::value): Likewise.
3107 * script-sections.cc
3108 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3109 argument with NULL.
3110 (Sections_elememt_dot_assignment::set_section_addresses):
3111 Likewise.
3112 (Output_data_expression::do_write_to_buffer): Likewise.
3113 (Output_section_definition::finalize_symbols): Likewise.
3114 (Output_section_definition::set_section_addresses): Likewise.
3115
3116 2010-09-30 Doug Kwan <dougkwan@google.com>
3117
3118 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3119
3120 2010-09-28 Sriraman Tallam <tmsriram@google.com>
3121
3122 * target.h (Target::can_icf_inline_merge_sections): New virtual
3123 function.
3124 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3125 virtual function.
3126 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3127 virtual function.
3128 * icf.cc (get_section_contents): Inline merge sections only when
3129 target allows it.
3130
3131 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3132
3133 * configure: Regenerate.
3134
3135 2010-09-17 Ian Lance Taylor <iant@google.com>
3136
3137 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
3138 * testsuite/Makefile.am (memory_test.o): New target.
3139 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3140 memory_test.t.
3141 * testsuite/Makefile.in: Rebuild.
3142
3143 2010-09-17 Doug Kwan <dougkwan@google.com>
3144
3145 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3146 defintion if relocation uses GOT entries of the symbol.
3147 * testsuite/icf_safe_test.sh: Fix test.
3148 * testsuite/icf_safe_so_test.sh: Fix test.
3149
3150 2010-09-16 Cary Coutant <ccoutant@google.com>
3151
3152 * script_sections.cc (class Memory_region): Remove "NULL" from
3153 vector initializations.
3154
3155 2010-09-15 Cary Coutant <ccoutant@google.com>
3156
3157 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3158 Resolve forwarding symbols.
3159
3160 2010-09-15 Doug Kwan <dougkwan@google.com>
3161
3162 * gold/testsuite/script_test_3.t: Add ARM special sections.
3163 * gold/testsuite/script_test_4.t: Same.
3164 * gold/testsuite/script_test_5.t: Same.
3165 * gold/testsuite/script_test_6.t: Same.
3166 * gold/testsuite/script_test_7.t: Same.
3167 * gold/testsuite/script_test_7.t: Same.
3168 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3169
3170 2010-09-14 Cary Coutant <ccoutant@google.com>
3171
3172 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3173 (Target_x86_64::Relocate::relocate_tls): Replace check for
3174 saw_tls_block_reloc_ with test for executable section.
3175
3176 2010-09-12 Cary Coutant <ccoutant@google.com>
3177
3178 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3179 position-independent executables to shared libraries need dynamic
3180 relocations.
3181 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3182 position-independent executables.
3183 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3184 * testsuite/Makefile.in: Regenerate.
3185
3186 2010-09-10 Nick Clifton <nickc@redhat.com>
3187
3188 PR gold/11997
3189 * testsuite/memory_test.t: Discard any sections that are not
3190 needed.
3191
3192 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3193
3194 PR gold/11996
3195 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3196 "This::" to work around a bug in gcc 4.2.
3197
3198 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3199
3200 2010-09-09 Rafael Espindola <espindola@google.com>
3201
3202 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3203 sections with different PF_X flags in the same segment.
3204 (Layout::find_first_load_seg): Search all segments to find the first
3205 one.
3206 * options.h (rosegment): New.
3207
3208 2010-09-08 Rafael Espindola <espindola@google.com>
3209
3210 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
3211
3212 2010-09-08 Doug Kwan <dougkwan@google.com>
3213
3214 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3215 (Arm_relobj::do_relocate_sections): Add new parameter for output
3216 file to match the parent.
3217 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3218 of local symbols instead of input values. Update code to track
3219 changes in gold::relocate_section.
3220 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3221 (Sized_relobj::compute_final_local_value_internal): New methods.
3222 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3223 body into private version of Sized_relobj::compute_final_local_value.
3224 Call the inline method.
3225 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3226 merged symbol value if there is one.
3227 (Symbol_value::has_output_value): New method defintiion.
3228 (Sized_relobj::Compute_final_local_value_status): New enum type.
3229 (Sized_relobj::compute_final_local_value): New methods.
3230 (Sized_relobj::compute_final_local_value_internal): New methods.
3231 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3232 and arm_cortex_a8.sh.
3233 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3234 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3235 New tests.
3236 * Makefile.in: Regenerate.
3237 * testsuite/arm_bl_out_of_range.s: Update test.
3238 * testsuite/thumb_bl_out_of_range.s: Ditto.
3239 * testsuite/thumb_blx_out_of_range.s: Ditto.
3240 * testsuite/arm_branch_out_of_range.sh: New file.
3241 * testsuite/arm_cortex_a8.sh: Ditto.
3242 * testsuite/arm_cortex_a8_b.s: Ditto.
3243 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3244 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3245 * testsuite/arm_cortex_a8_bl.s: Ditto.
3246 * testsuite/arm_cortex_a8_blx.s: Ditto.
3247 * testsuite/arm_cortex_a8_local.s: Ditto.
3248 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3249 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3250
3251 2010-09-08 Rafael Espindola <espindola@google.com>
3252
3253 * Makefile.am (memory_test.stdout): Run readelf with -W.
3254 * Makefile.in: Regenerate.
3255 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3256 64 bit output.
3257
3258 2010-09-08 Rafael Espindola <espindola@google.com>
3259
3260 * script-sections.cc (Script_sections::add_memory_region): Convert
3261 field precision to int.
3262 * script.cc (script_set_section_region, script_set_section_region):
3263 Convert field precision to int.
3264
3265 2010-09-08 Rafael Espindola <espindola@google.com>
3266
3267 * arm.cc (do_finalize_sections): Create the __exidx_start and
3268 __exdix_end symbols even when the section is missing.
3269
3270 2010-09-08 Nick Clifton <nickc@redhat.com>
3271
3272 * README: Remove claim that MEMORY is not supported.
3273 * expression.cc (script_exp_function_origin)
3274 (script_exp_function_length): Move from here to ...
3275 * script.cc: ... here.
3276 (script_set_section_region, script_add_memory)
3277 (script_parse_memory_attr, script_include_directive): New
3278 functions.
3279 * script-sections.cc
3280 (class Memory_region): New class.
3281 (class Output_section_definition): Add set_memory_region,
3282 set_section_vma, set_section_lma and get_section_name methods.
3283 (class Script_Sections): Add add_memory_region,
3284 find_memory_region, find_memory_region_origin,
3285 find_memory_region_length and set_memory_region methods.
3286 Have set_section_addresses method walk the list of set memory
3287 regions.
3288 Extend the print methos to display memory regions.
3289 * script-sections.h: Add prototypes for new methods.
3290 Add enum for MEMORY region attributes.
3291 * yyscript.y: Add support for parsing MEMORY regions.
3292 * script-c.h: Add prototypes for new functions.
3293 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3294 * testsuite/Makefile.in: Regenerate.
3295 * testsuite/memory_test.sh: New script.
3296 * testsuite/memory_test.s: New assembler source file.
3297 * testsuite/memory_test.t: New linker script.
3298
3299 2010-08-27 Doug Kwan <dougkwan@google.com>
3300
3301 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3302 reference override an existing dynamic weak reference.
3303 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3304 * testsuite/Makefile.in: Regenerate.
3305 * testsuite/dyn_weak_ref.sh: New file.
3306 * testsuite/dyn_weak_ref_1.c: Ditto.
3307 * testsuite/dyn_weak_ref_2.c: Ditto.
3308
3309 2010-08-27 Ian Lance Taylor <iant@google.com>
3310
3311 * incremental.h (class Incremental_input_entry): Add virtual
3312 destructor.
3313
3314 2010-08-27 Ian Lance Taylor <iant@google.com>
3315
3316 * testsuite/start_lib_test_3.c: Mark t3 as used.
3317
3318 2010-08-27 Nick Clifton <nickc@redhat.com>
3319
3320 * options.cc (version_script): Fix small typo in previous
3321 whitespace tidyup.
3322
3323 2010-08-25 Nick Clifton <nickc@redhat.com>
3324
3325 * archive.cc: Formatting fixes: Remove whitespace between
3326 typename and following asterisk. Remove whitespace between
3327 function name and opening parenthesis.
3328 * archive.h: Likewise.
3329 * arm.cc: Likewise.
3330 * attributes.cc: Likewise.
3331 * attributes.h: Likewise.
3332 * common.cc: Likewise.
3333 * copy-relocs.cc: Likewise.
3334 * dirsearch.h: Likewise.
3335 * dynobj.cc: Likewise.
3336 * ehframe.cc: Likewise.
3337 * ehframe.h: Likewise.
3338 * expression.cc: Likewise.
3339 * fileread.cc: Likewise.
3340 * fileread.h: Likewise.
3341 * gc.h: Likewise.
3342 * gold-threads.cc: Likewise.
3343 * gold.cc: Likewise.
3344 * i386.cc: Likewise.
3345 * icf.h: Likewise.
3346 * incremental-dump.cc: Likewise.
3347 * incremental.cc: Likewise.
3348 * layout.cc: Likewise.
3349 * layout.h: Likewise.
3350 * main.cc: Likewise.
3351 * merge.cc: Likewise.
3352 * merge.h: Likewise.
3353 * object.cc: Likewise.
3354 * object.h: Likewise.
3355 * options.cc: Likewise.
3356 * options.h: Likewise.
3357 * output.cc: Likewise.
3358 * output.h: Likewise.
3359 * plugin.cc: Likewise.
3360 * plugin.h: Likewise.
3361 * powerpc.cc: Likewise.
3362 * reloc.cc: Likewise.
3363 * script-c.h: Likewise.
3364 * script-sections.cc: Likewise.
3365 * script.cc: Likewise.
3366 * stringpool.cc: Likewise.
3367 * symtab.cc: Likewise.
3368 * symtab.h: Likewise.
3369 * target.cc: Likewise.
3370 * timer.cc: Likewise.
3371 * timer.h: Likewise.
3372 * version.cc: Likewise.
3373 * x86_64.cc: Likewise.
3374
3375 2010-08-24 Nick Clifton <nickc@redhat.com>
3376
3377 PR 11899
3378 * layout.cc (segment_precedes): Sort segments by their physical
3379 addresses, if they have been set.
3380
3381 2010-08-23 Cary Coutant <ccoutant@google.com>
3382
3383 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3384 symbols data.
3385 (Lib_group::include_member): Unlock object after deleting its
3386 symbols data.
3387 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3388 the bug fixed here.
3389
3390 2010-08-19 Neil Vachharajani <nvachhar@google.com>
3391 Cary Coutant <ccoutant@google.com>
3392
3393 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3394 constructor, and set_blocker.
3395 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3396 readsyms_blocker_.
3397 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3398 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3399 * testsuite/Makefile.am (start_lib_test): New test case.
3400 * testsuite/Makefile.in: Regenerate.
3401 * testsuite/start_lib_test_main.c: New file.
3402 * testsuite/start_lib_test_1.c: New file.
3403 * testsuite/start_lib_test_2.c: New file.
3404 * testsuite/start_lib_test_3.c: New file.
3405
3406 2010-08-19 Ian Lance Taylor <iant@google.com>
3407
3408 * Makefile.in: Rebuild with automake 1.11.1.
3409 * aclocal.m4: Likewise.
3410 * testsuite/Makefile.in: Likewise.
3411
3412 2010-08-19 Ian Lance Taylor <iant@google.com>
3413
3414 PR 10893
3415 * i386.cc (class Output_data_plt_i386): Update declarations.
3416 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3417 local_ifuncs_ fields.
3418 (Target_i386::do_plt_section_for_global): New function.
3419 (Target_i386::do_plt_section_for_local): New function.
3420 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3421 parameter; change all callers. Initialize global_ifuncs_ and
3422 local_ifuncs_. If doing a static link define __rel_iplt_start and
3423 __rel_iplt_end.
3424 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3425 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3426 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3427 symbols.
3428 (Target_i386::make_plt_section): New function, broken out of
3429 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3430 (Target_i386::make_plt_entry): Call make_plt_section.
3431 (Target_i386::make_local_ifunc_plt_entry): New function.
3432 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3433 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3434 R_386_IRELATIVE to switch.
3435 (Target_i386::Scan::global): Likewise.
3436 (Target_i386::Relocate::relocate): Likewise.
3437 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3438 switch.
3439 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3440 (Target_x86_64::do_plt_section_for_global): New function.
3441 (Target_x86_64::do_plt_section_for_local): New function.
3442 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3443 parameter; change all callers. If doing a static link define
3444 __rela_iplt_start and __rela_iplt_end.
3445 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3446 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3447 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3448 to point to .plt.
3449 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3450 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3451 switch.
3452 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3453 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3454 R_X86_64_IRELATIVE to switch.
3455 (Target_x86_64::Scan::global): Likewise.
3456 (Target_x86_64::Relocate::relocate): Likewise.
3457 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3458 switch.
3459 * target.h (class Target): Add plt_section_for_global and
3460 plt_section_for_local functions. Add do_plt_section_for_global
3461 and do_plt_section_for_local virtual functions.
3462 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3463 clarifying comments.
3464 (Symbol::use_plt_offset): Handle IFUNC symbol.
3465 * object.cc (Sized_relobj::Sized_relobj): Initialize
3466 local_plt_offsets_.
3467 (Sized_relobj::local_has_plt_offset): New function.
3468 (Sized_relobj::local_plt_offset): New function.
3469 (Sized_relobj::set_local_plt_offset): New function.
3470 (Sized_relobj::do_count): Handle IFUNC symbol.
3471 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3472 a bit away from input_shndx_ field. Add set_is_func_symbol and
3473 is_ifunc_symbol functions.
3474 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3475 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3476 local_plt_offsets_ field.
3477 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3478 * output.h (class Output_section_data): Add non-const
3479 output_section function.
3480 (class Output_data_got): Update declarations.
3481 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3482 Add use_plt_offset parameter to global and local constructors.
3483 Change all callers. Change local_sym_index_ field to 31 bits.
3484 Change GSYM_CODE and CONSTANT_CODE accordingly.
3485 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3486 doing a static link don't set sh_link field.
3487 (Output_data_got::Got_entry::write): Use PLT offset if
3488 appropriate.
3489 (Output_data_got::add_global_plt): New function.
3490 (Output_data_got::add_local_plt): New function.
3491 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3492 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3493 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3494 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3495 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3496 IFUNC conditional.
3497 * testsuite/ifunc-sel.h: New file.
3498 * testsuite/ifuncmain1.c: New file.
3499 * testsuite/ifuncmain1vis.c: New file.
3500 * testsuite/ifuncmod1.c: New file.
3501 * testsuite/ifuncdep2.c: New file.
3502 * testsuite/ifuncmain2.c: New file.
3503 * testsuite/ifuncmain3.c: New file.
3504 * testsuite/ifuncmod3.c: New file.
3505 * testsuite/ifuncmain4.c: New file.
3506 * testsuite/ifuncmain5.c: New file.
3507 * testsuite/ifuncmod5.c: New file.
3508 * testsuite/ifuncmain6pie.c: New file.
3509 * testsuite/ifuncmod6.c: New file.
3510 * testsuite/ifuncmain7.c: New file.
3511 * configure, testsuite/Makefile.in: Rebuild.
3512
3513 2010-08-18 Ian Lance Taylor <iant@google.com>
3514
3515 * incremental.cc
3516 (Output_section_incremental_inputs::write_input_files): Add cast
3517 to avoid signed/unsigned comparison warning.
3518 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3519
3520 2010-08-12 Cary Coutant <ccoutant@google.com>
3521
3522 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3523
3524 2010-08-13 Ian Lance Taylor <iant@google.com>
3525
3526 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3527
3528 2010-08-12 Cary Coutant <ccoutant@google.com>
3529 Doug Kwan <dougkwan@google.com>
3530
3531 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3532 defintion overrides non-weak undef, remember that the original undef
3533 is not weak.
3534 * symtab.cc (Symbol_table::sized_write_global): For undef without
3535 an original weak binding, set binding to global in output.
3536 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3537 * testsuite/Makefile.in: Regenerate.
3538 * testsuite/strong_ref_weak_def.sh: New file.
3539 * testsuite/strong_ref_weak_def_1.c: Ditto.
3540 * testsuite/strong_ref_weak_def_2.c: Ditto.
3541
3542 2010-08-12 Cary Coutant <ccoutant@google.com>
3543
3544 * testsuite/incremental_test.sh: Rewrite.
3545 * testsuite/incremental_test_1.c: Rewrite.
3546 * testsuite/incremental_test_2.c: Rewrite.
3547
3548 2010-08-12 Cary Coutant <ccoutant@google.com>
3549
3550 * arm.cc (Target_arm::got_size): Add const.
3551 (Target_arm::got_entry_count): New function.
3552 (Target_arm::plt_entry_count): New function.
3553 (Target_arm::first_plt_entry_offset): New function.
3554 (Target_arm::plt_entry_size): New function.
3555 (Output_data_plt_arm::entry_count): New function.
3556 (Output_data_plt_arm::first_plt_entry_offset): New function.
3557 (Output_data_plt_arm::get_plt_entry_size): New function.
3558 * i386.cc (Target_i386::got_size): Add const.
3559 (Target_i386::got_entry_count): New function.
3560 (Target_i386::plt_entry_count): New function.
3561 (Target_i386::first_plt_entry_offset): New function.
3562 (Target_i386::plt_entry_size): New function.
3563 (Output_data_plt_i386::entry_count): New function.
3564 (Output_data_plt_i386::first_plt_entry_offset): New function.
3565 (Output_data_plt_i386::get_plt_entry_size): New function.
3566 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3567 find_incremental_inputs_sections. Dump incremental_got_plt section.
3568 * incremental.cc: Include target.h.
3569 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3570 parameter. Adjust all callers. Find incremental_got_plt section.
3571 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3572 section.
3573 (Output_section_incremental_inputs::set_final_data_size): Calculate
3574 size of incremental_got_plt section.
3575 (Output_section_incremental_inputs::do_write): Write the
3576 incremental_got_plt section.
3577 (Got_plt_view_info): New struct.
3578 (Local_got_offset_visitor): New class.
3579 (Global_got_offset_visitor): New class.
3580 (Global_symbol_visitor_got_plt): New class.
3581 (Output_section_incremental_inputs::write_got_plt): New function.
3582 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3583 Add parameter. Adjust all callers.
3584 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3585 (Incremental_inputs::got_plt_section): New function.
3586 (Incremental_inputs::got_plt_section_): New data member.
3587 (Incremental_got_plt_reader): New class.
3588 * layout.cc (Layout::create_incremental_info_sections): Add the
3589 incremental_got_plt section.
3590 * object.h (Got_offset_list::get_list): New function.
3591 (Got offset_list::for_all_got_offsets): New function.
3592 (Sized_relobj::local_got_offset_list): New function.
3593 * powerpc.cc (Target_powerpc::got_size): Add const.
3594 (Target_powerpc::got_entry_count): New function.
3595 (Target_powerpc::plt_entry_count): New function.
3596 (Target_powerpc::first_plt_entry_offset): New function.
3597 (Target_powerpc::plt_entry_size): New function.
3598 (Output_data_plt_powerpc::entry_count): New function.
3599 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3600 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3601 * sparc.cc (Target_sparc::got_size): Add const.
3602 (Target_sparc::got_entry_count): New function.
3603 (Target_sparc::plt_entry_count): New function.
3604 (Target_sparc::first_plt_entry_offset): New function.
3605 (Target_sparc::plt_entry_size): New function.
3606 (Output_data_plt_sparc::entry_count): New function.
3607 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3608 (Output_data_plt_sparc::get_plt_entry_size): New function.
3609 * symtab.h (Symbol::got_offset_list): New function.
3610 (Symbol_table::for_all_symbols): New function.
3611 * target.h (Sized_target::got_entry_count): New function.
3612 (Sized_target::plt_entry_count): New function.
3613 (Sized_target::plt_entry_size): New function.
3614 * x86_64.cc (Target_x86_64::got_size): Add const.
3615 (Target_x86_64::got_entry_count): New function.
3616 (Target_x86_64::plt_entry_count): New function.
3617 (Target_x86_64::first_plt_entry_offset): New function.
3618 (Target_x86_64::plt_entry_size): New function.
3619 (Output_data_plt_x86_64::entry_count): New function.
3620 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3621 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3622
3623 2010-08-12 Cary Coutant <ccoutant@google.com>
3624
3625 * archive.cc: Include incremental.h.
3626 (Archive::Archive): Initialize incremental_info_.
3627 (Archive::include_member): Record archive members in incremental info.
3628 (Add_archive_symbols::run): Record begin and end of an archive in
3629 incremental info.
3630 (Lib_group::include_member): Record objects in incremental info.
3631 * archive.h (Incremental_archive_entry): Forward declaration.
3632 (Archive::set_incremental_info): New member function.
3633 (Archive::incremental_info): New member function.
3634 (Archive::Unused_symbol_iterator): New class.
3635 (Archive::unused_symbols_begin): New member function.
3636 (Archive::unused_symbols_end): New member function.
3637 (Archive::incremental_info_): New data member.
3638 * incremental-dump.cc (find_input_containing_global): New function.
3639 (dump_incremental_inputs): Dump new incremental info sections.
3640 * incremental.cc: Include symtab.h.
3641 (Output_section_incremental_inputs): New class.
3642 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3643 new incremental info sections.
3644 (Sized_incremental_binary::do_check_inputs): Likewise.
3645 (Incremental_inputs::report_archive): Remove.
3646 (Incremental_inputs::report_archive_begin): New function.
3647 (Incremental_inputs::report_archive_end): New function.
3648 (Incremental_inputs::report_object): New function.
3649 (Incremental_inputs::finalize_inputs): Remove.
3650 (Incremental_inputs::report_input_section): New function.
3651 (Incremental_inputs::report_script): Rewrite.
3652 (Incremental_inputs::finalize): Do nothing but finalize string table.
3653 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3654 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3655 (Incremental_inputs::create_data_sections): New function.
3656 (Incremental_inputs::relocs_entsize): New function.
3657 (Output_section_incremental_inputs::set_final_data_size): New function.
3658 (Output_section_incremental_inputs::do_write): New function.
3659 (Output_section_incremental_inputs::write_header): New function.
3660 (Output_section_incremental_inputs::write_input_files): New function.
3661 (Output_section_incremental_inputs::write_info_blocks): New function.
3662 (Output_section_incremental_inputs::write_symtab): New function.
3663 * incremental.h (Incremental_script_entry): Forward declaration.
3664 (Incremental_object_entry): Forward declaration.
3665 (Incremental_archive_entry): Forward declaration.
3666 (Incremental_inputs): Forward declaration.
3667 (Incremental_inputs_header_data): Remove.
3668 (Incremental_inputs_header): Remove.
3669 (Incremental_inputs_header_write): Remove.
3670 (Incremental_inputs_entry_data): Remove.
3671 (Incremental_inputs_entry): Remove.
3672 (Incremental_inputs_entry_write): Remove.
3673 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3674 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3675 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3676 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3677 Likewise.
3678 (Incremental_input_entry): New class.
3679 (Incremental_script_entry): New class.
3680 (Incremental_object_entry): New class.
3681 (Incremental_archive_entry): New class.
3682 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3683 (Incremental_inputs::report_inputs): Remove.
3684 (Incremental_inputs::report_archive): Remove.
3685 (Incremental_inputs::report_archive_begin): New function.
3686 (Incremental_inputs::report_archive_end): New function.
3687 (Incremental_inputs::report_object): Change prototype.
3688 (Incremental_inputs::report_input_section): New function.
3689 (Incremental_inputs::report_script): Change prototype.
3690 (Incremental_inputs::get_reloc_count): New function.
3691 (Incremental_inputs::set_reloc_count): New function.
3692 (Incremental_inputs::create_data_sections): New function.
3693 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3694 (Incremental_inputs::inputs_section): New function.
3695 (Incremental_inputs::symtab_section): New function.
3696 (Incremental_inputs::relocs_section): New function.
3697 (Incremental_inputs::get_stringpool): Add const.
3698 (Incremental_inputs::command_line): Add const.
3699 (Incremental_inputs::inputs): Remove.
3700 (Incremental_inputs::command_line_key): New function.
3701 (Incremental_inputs::input_file_count): New function.
3702 (Incremental_inputs::input_files): New function.
3703 (Incremental_inputs::relocs_entsize): New function.
3704 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3705 (Incremental_inputs::finalize_inputs): Remove.
3706 (Incremental_inputs::Input_info): Remove.
3707 (Incremental_inputs::lock_): Remove.
3708 (Incremental_inputs::inputs_): Change type.
3709 (Incremental_inputs::inputs_map_): Remove.
3710 (Incremental_inputs::current_object_entry_): New data member.
3711 (Incremental_inputs::inputs_section_): New data member.
3712 (Incremental_inputs::symtab_section_): New data member.
3713 (Incremental_inputs::relocs_section_): New data member.
3714 (Incremental_inputs::reloc_count_): New data member.
3715 (Incremental_inputs_reader): New class.
3716 (Incremental_symtab_reader): New class.
3717 (Incremental_relocs_reader): New class.
3718 * layout.cc (Layout::finalize): Move finalization of incremental info
3719 and creation of incremental info sections to follow finalization of
3720 symbol table. Set offsets for postprocessing sections.
3721 (Layout::create_incremental_info_sections): Call
3722 Incremental_inputs::create_data_sections. Add incremental symtab
3723 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3724 sections to layout after input sections.
3725 * layout.h (struct Timespec): Forward declaration.
3726 (Layout::incremental_inputs): Add const.
3727 (Layout::create_incremental_info_sections): Add parameter.
3728 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3729 * object.cc: Include incremental.h.
3730 (Relobj::finalize_incremental_relocs): New function.
3731 (Sized_relobj::do_layout): Record input sections in incremental info.
3732 * object.h (Object::output_section): New function.
3733 (Object::output_section_offset): Moved from Relobj.
3734 (Object::get_incremental_reloc_base): New function.
3735 (Object::get_incremental_reloc_count): New function.
3736 (Object::do_output_section): New function.
3737 (Object::do_output_section_offset): Moved from Relobj.
3738 (Object::do_get_incremental_reloc_base): New function.
3739 (Object::do_get_incremental_reloc_count): New function.
3740 (Object::Object): Initialize new data members.
3741 (Relobj::output_section): Renamed do_output_section and moved to
3742 protected.
3743 (Relobj::output_section_offset): Moved to Object.
3744 (Relobj::do_get_incremental_reloc_base): New function.
3745 (Relobj::do_get_incremental_reloc_count): New function.
3746 (Relobj::allocate_incremental_reloc_counts): New function.
3747 (Relobj::count_incremental_reloc): New function.
3748 (Relobj::finalize_incremental_relocs): New function.
3749 (Relobj::next_incremental_reloc_index): New function.
3750 (Relobj::reloc_counts_): New data member.
3751 (Relobj::reloc_bases_): New data member.
3752 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3753 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3754 (Sized_relobj::incremental_relocs_scan): New function.
3755 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3756 (Sized_relobj::incremental_relocs_write): New function.
3757 (Sized_relobj::incremental_relocs_write_reltype): New function.
3758 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3759 incremental link.
3760 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3761 archives and object files elsewhere.
3762 (Add_symbols::run): Report object files here.
3763 (Finish_group::run): Report end of archive at end of group.
3764 * reloc.cc: Include layout.h, incremental.h.
3765 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3766 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3767 (Sized_relobj::incremental_relocs_scan): New function.
3768 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3769 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3770 (Sized_relobj::incremental_relocs_write): New function.
3771 (Sized_relobj::incremental_relocs_write_reltype): New function.
3772 * script.cc (read_input_script): Rewrite test for incremental link.
3773 Change call to Incremental_inputs::report_script.
3774 * symtab.h (Symbol_table::first_global_index): New function.
3775 (Symbol_table::output_count): New function.
3776
3777 2010-08-12 Doug Kwan <dougkwan@google.com>
3778
3779 * arm.cc (Target_arm::merge_object_attributes): Check command line
3780 options --no-wchar-size-warning and --no-enum-size-warning.
3781 * options.h (General_options): Add ld-compatible options
3782 --no-enum-size-warning and --no-wchar-size-warning.
3783
3784 2010-08-04 Ian Lance Taylor <iant@google.com>
3785
3786 * x86_64.cc (Target_x86_64::Scan::local): Use
3787 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3788 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3789 (Target_x86_64::Scan::global): Likewise.
3790 (Target_x86_64::Relocate::relocate): Likewise.
3791 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3792 Likewise.
3793
3794 2010-08-03 Cary Coutant <ccoutant@google.com>
3795
3796 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3797 to reserve space in merged_strings vector. Keep total input size
3798 for stats.
3799 (Output_merge_string::do_print_merge_stats): Print total input size.
3800 * merge.h (Output_merge_string): Add input_size_ field.
3801 * stringpool.cc (Stringpool_template::string_length): Move
3802 implementations out of Stringpool_template class and place in
3803 stringpool.h.
3804 * stringpool.h (string_length): Move out of Stringpool_template.
3805
3806 2010-08-03 Ian Lance Taylor <iant@google.com>
3807
3808 PR 11712
3809 * layout.cc (relaxation_loop_body): If address of load segment is
3810 set, adjust address to include headers if possible.
3811
3812 2010-08-03 Ian Lance Taylor <iant@google.com>
3813
3814 * version.cc (version_string): Bump to 1.10.
3815
3816 2010-08-03 Ian Lance Taylor <iant@google.com>
3817
3818 PR 11805
3819 * layout.h (enum Output_section_order): Define.
3820 (class Layout): Update declarations.
3821 * layout.cc (Layout::get_output_section): Add order parameter.
3822 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3823 is_first_non_relro parameters. Change all callers.
3824 (Layout::choose_output_section): Likewise.
3825 (Layout::add_output_section_data): Likewise.
3826 (Layout::make_output_section): Likewise. Set order.
3827 (Layout::default_section_order): New function.
3828 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3829 * output.cc (Output_section::Output_section): Initialize order_.
3830 Don't initialize deleted fields.
3831 (Output_segment::Output_segment): Don't initialize deleted
3832 fields.
3833 (Output_segment::add_output_section_to_load): New function
3834 replacing add_output_section. Change all callers to call this or
3835 add_output_section_to_nonload.
3836 (Output_segment::add_output_section_to_nonload): New function.
3837 (Output_segment::remove_output_section): Rewrite.
3838 (Output_segment::add_initial_output_data): Likewise.
3839 (Output_segment::has_any_data_sections): Likewise.
3840 (Output_segment::is_first_section_relro): Likewise.
3841 (Output_segment::maximum_alignment): Likewise.
3842 (Output_segment::has_dynamic_reloc): New function replacing
3843 dynamic_reloc_count. Change all callers.
3844 (Output_segment::has_dynamic_reloc_list): New function replacing
3845 dynamic_reloc_count_list. Change all callers.
3846 (Output_segment::set_section_addresses): Rewrite.
3847 (Output_segment::set_offset): Rewrite.
3848 (Output_segment::find_first_and_last_list): Remove.
3849 (Output_segment::set_tls_offsets): Rewrite.
3850 (Output_segment::first_section_load_address): Likewise.
3851 (Output_segment::output_section_count): Likewise.
3852 (Output_segment::section_with_lowest_load_address): Likewise.
3853 (Output_segment::write_section_headers): Likewise.
3854 (Output_segment::print_sections_to_map): Likewise.
3855 * output.h (class Output_data): Remove dynamic_reloc_count_
3856 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3857 (Output_data::add_dynamic_reloc): Rewrite.
3858 (Output_data::has_dynamic_reloc): New function.
3859 (Output_data::dynamic_reloc_count): Remove.
3860 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3861 is_last_relro_, is_first_non_relro_, is_interp_,
3862 is_dynamic_linker_section_ fields. Add order and set_order
3863 functions. Remove is_relro_local, set_is_relro_local,
3864 is_last_relro, set_is_last_relro, is_first_non_relro,
3865 set_is_first_non_relro functions, is_interp, set_is_interp,
3866 is_dynamic_linker_section, and set_is_dynamic_linker_section
3867 functions.
3868 (class Output_segment): Change Output_data_list from std::list to
3869 std:;vector. Add output_lists_ field. Remove output_data_ and
3870 output_bss_ fields. Update declarations.
3871
3872 2010-08-02 Ian Lance Taylor <iant@google.com>
3873
3874 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3875 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3876 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3877
3878 2010-08-02 Ian Lance Taylor <iant@google.com>
3879
3880 PR 11855
3881 * script.cc (Script_options::Script_options): Initialize
3882 symbol_definitions_ and symbol_references_.
3883 (Script_options::add_symbol_assignment): Update
3884 symbol_definitions_ and symbol_references_.
3885 (Script_options::add_symbol_reference): New function.
3886 (script_symbol): New function.
3887 * script.h (class Script_options): Add symbol_definitions_ and
3888 symbol_references_ fields.
3889 (Script_options::referenced_const_iterator): New type.
3890 (Script_options::referenced_begin): New function.
3891 (Script_options::referenced_end): New function.
3892 (Script_options::is_referenced): New function.
3893 (Script_options::any_unreferenced): New function.
3894 * script-c.h (script_symbol): Declare.
3895 * yyscript.y (exp): Call script_symbol.
3896 * symtab.cc: Include "script.h".
3897 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3898 Change all callers. Check symbols referenced by scripts.
3899 (Symbol_table::add_undefined_symbols_from_command_line): Add
3900 layout parameter. Change all callers.
3901 (Symbol_table::do_add_undefined_symbols_from_command_line):
3902 Likewise. Break out loop body. Check symbols referenced by
3903 scripts.
3904 (Symbol_table::add_undefined_symbol_from_command_line): New
3905 function broken out of
3906 do_add_undefined_symbols_from_command_line.
3907 * symtab.h (class Symbol_table): Update declarations.
3908 * archive.cc: Include "layout.h".
3909 (Archive::should_include_member): Add layout parameter. Change
3910 all callers. Check for symbol mentioned in expression.
3911 * archive.h (class Archive): Update declaration.
3912 * object.cc (Sized_relobj::do_should_include_member): Add layout
3913 parameter.
3914 * object.h (Object::should_include_member): Add layout parameter.
3915 Change all callers.
3916 (Object::do_should_include_member): Add layout parameter.
3917 (class Sized_relobj): Update declaration.
3918 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3919 parameter.
3920 * dynobj.h (class Sized_dynobj): Update declaration.
3921 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3922 layout parameter.
3923 * plugin.h (class Sized_pluginobj): Update declaration.
3924
3925 2010-08-02 Ian Lance Taylor <iant@google.com>
3926
3927 PR 11866
3928 * output.cc (Output_segment::set_offset): Search for the first and
3929 last sections rather than assuming that the list is in order.
3930 (Output_segment::find_first_and_last_list): New function.
3931 * output.h (class Output_segment): Update declarations.
3932 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3933 (relro_strip_test_SOURCES): New variable.
3934 (relro_strip_test_DEPENDENCIES): New variable.
3935 (relro_strip_test_LDFLAGS): New variable.
3936 (relro_strip_test_LDADD): New variable.
3937 (relro_strip_test.so): New target.
3938
3939 2010-08-02 Ian Lance Taylor <iant@google.com>
3940
3941 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3942 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3943 (Target_i386::got_tlsdesc_section): New function.
3944 (Target_i386::got_section): Create space for GOT entries for
3945 TLSDESC relocations.
3946 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3947 R_386_TLS_GOTDESC.
3948 (Target_i386::Scan::global): Likewise.
3949 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3950 using TLSDESC GOT.
3951 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3952 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3953 (Target_x86_64::got_tlsdesc_section): New function.
3954 (Target_x86_64::got_section): Create space for GOT entries for
3955 TLSDESC relocations.
3956 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3957 R_386_TLS_GOTDESC.
3958 (Target_x86_64::Scan::global): Likewise.
3959 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3960 using TLSDESC GOT.
3961
3962 2010-08-02 Ian Lance Taylor <iant@google.com>
3963
3964 * testsuite/final_layout.sh: Use dc to convert from hex to
3965 decimal.
3966
3967 2010-07-29 Sriraman Tallam <tmsriram@google.com>
3968
3969 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3970 paramter to the call to gold::gc_process_relocs.
3971 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3972 paramter to the call to gold::gc_process_relocs.
3973 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3974 parameter to the call to gold::gc_process_relocs.
3975 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3976 template parameter to the call to gold::gc_process_relocs.
3977 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3978 paramter to the call to gold::gc_process_relocs.
3979 * gc.h (get_embedded_addend_size): New function.
3980 (gc_process_relocs): Save the size of the reloc for use by ICF.
3981 * icf.cc (get_section_contents): Get the addend from the text section
3982 for SHT_REL relocation sections.
3983 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3984 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3985 * int_encoding.h (read_from_pointer): New overloaded function.
3986 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3987 * testsuite/icf_sht_rel_addend_test.sh: New file.
3988 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3989 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3990
3991 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3992
3993 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3994 * Makefile.in: Regenerate.
3995 * testsuite/Makefile.in: Regenerate.
3996
3997 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3998
3999 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4000 * gold/testsuite/debug_msg.cc: Likewise.
4001 * gold/testsuite/odr_violation1.cc
4002 * gold/testsuite/odr_violation2.cc
4003
4004 2010-07-21 Cary Coutant <ccoutant@google.com>
4005
4006 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4007 string, and length fields.
4008 (Output_merge_string::Merged_strings_list): New type.
4009 (Output_merge_string::Merged_strings_lists): New typedef.
4010 (Output_merge_string): Replace merged_strings_ with
4011 merged_strings_lists_.
4012 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4013 Merged_strings_list per input object and section. Don't store pointer
4014 to the string. Don't store length with each merged string entry.
4015 (Output_merge_string::finalize_merged_data): Loop over list of merged
4016 strings lists. Recompute length of each merged string.
4017
4018 2010-07-15 Cary Coutant <ccoutant@google.com>
4019
4020 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4021 here.
4022
4023 2010-07-14 Ian Lance Taylor <iant@google.com>
4024
4025 * descriptors.cc (Descriptors::open): Report correct name in error
4026 message.
4027
4028 2010-07-13 Doug Kwan <dougkwan@google.com>
4029
4030 * arm.cc (Arm_input_section::Arm_input_section): For a
4031 SHT_ARM_EXIDX section, always keeps the input sections.
4032 (Arm_input_section::set_exidx_section_link): New method.
4033 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4034 has_errors_ to false.
4035 (Arm_exidx_input_section::has_errors,
4036 Arm_exidx_input_section::set_has_errors): New methods.
4037 (Arm_exidx_input_section::has_errors_): New data member.
4038 (Arm_relobj::get_exidx_shndx_list): New method.
4039 (Arm_output_section::append_text_sections_to_list): Do not skip
4040 section without SHF_EXECINSTR.
4041 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4042 errors.
4043 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4044 section header. Make error messages more verbose. Check for
4045 a non-executable section linked to an EXIDX section.
4046 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4047 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4048 check that there is no deferred EXIDX section if we exit early.
4049 Instead of not making an EXIDX section in case of an error, make one
4050 and set the has_errors flag of it.
4051 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4052 in a relocatable link.
4053 (Target_arm::do_relax): Look for the EXIDX output section instead of
4054 assuming that it is called .ARM.exidx.
4055 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4056 section list. Do not check for SHF_EXECINSTR section flags but
4057 skip any input section with errors.
4058 * output.cc (Output_section::Output_section): Initialize
4059 always_keeps_input_sections_ to false.
4060 (Output_section::add_input_section): Check for
4061 always_keeps_input_sections_.
4062 * output.h (Output_section::always_keeps_input_sections,
4063 Output_section::set_always_keeps_input_sections): New methods.
4064 (Output_section::always_keeps_input_sections): New data member.
4065
4066 2010-07-13 Rafael Espindola <espindola@google.com>
4067
4068 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4069 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4070
4071 2010-07-13 Philip Herron <herron.philip@googlemail.com>
4072 Ian Lance Taylor <iant@google.com>
4073
4074 * output.h (Output_section_lookup_maps::add_merge_section):
4075 Correct check of whether value was inserted.
4076 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4077 (Output_section_lookup_maps::add_relaxed_input_section):
4078 Likewise.
4079 * arm.cc (Target_arm::got_section): Remove used local os.
4080 * i386.cc (Target_i386::got_section): Likewise.
4081 * x86_64.cc (Target_x86_64::got_section): Likewise.
4082 * sparc.cc (Target_sparc::got_section): Likewise.
4083 (Target_sparc::relocate): Remove unused local have_got_offset.
4084 * powerpc.cc (Target_powerpc::relocate): Likewise.
4085
4086 2010-07-13 Ian Lance Taylor <iant@google.com>
4087
4088 * compressed_output.cc (zlib_decompress): Fix signature in
4089 !HAVE_ZLIB_H case.
4090
4091 * archive.cc (Archive::include_member): Unlock an external member
4092 of a thin archive. Don't bother to delete an object we know is
4093 NULL.
4094
4095 2010-07-12 Cary Coutant <ccoutant@google.com>
4096
4097 * compressed_output.cc (zlib_decompress): New function.
4098 (get_uncompressed_size): New function.
4099 (decompress_input_section): New function.
4100 * compressed_output.h (get_uncompressed_size): New function.
4101 (decompress_input_section): New function.
4102 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4103 Handle compressed debug sections.
4104 * layout.cc (is_compressed_debug_section): New function.
4105 (Layout::output_section_name): Map compressed section names to
4106 canonical names.
4107 * layout.h (is_compressed_debug_section): New function.
4108 (is_debug_info_section): Recognize compressed debug sections.
4109 * merge.cc: Include compressed_output.h.
4110 (Output_merge_data::do_add_input_section): Handle compressed
4111 debug sections.
4112 (Output_merge_string::do_add_input_section): Handle compressed
4113 debug sections.
4114 * object.cc: Include compressed_output.h.
4115 (Sized_relobj::Sized_relobj): Initialize new data members.
4116 (build_compressed_section_map): New function.
4117 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4118 * object.h (Object::section_is_compressed): New method.
4119 (Object::do_section_is_compressed): New method.
4120 (Sized_relobj::Compressed_section_map): New type.
4121 (Sized_relobj::do_section_is_compressed): New method.
4122 (Sized_relobj::compressed_sections_): New data member.
4123 * output.cc (Output_section::add_input_section): Handle compressed
4124 debug sections.
4125 * reloc.cc: Include compressed_output.h.
4126 (Sized_relobj::write_sections): Handle compressed debug sections.
4127
4128 2010-07-08 Cary Coutant <ccoutant@google.com>
4129
4130 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4131 weak when resolving to a dynamic def.
4132 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4133 for weak undef/dynamic def cases. Adjust callers.
4134 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4135 undef_binding_weak_.
4136 (Symbol_table::sized_write_globals): Adjust symbol binding.
4137 (Symbol_table::sized_write_symbol): Add binding parameter.
4138 * symtab.h (Symbol::set_undef_binding): New method.
4139 (Symbol::is_undef_binding_weak): New method.
4140 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4141 (Symbol_table::should_override): Add new parameter.
4142 (Symbol_table::sized_write_symbol): Add new parameter.
4143
4144 * testsuite/weak_undef_file1.cc: Add new test case.
4145 * testsuite/weak_undef_file2.cc: Fix header comment.
4146 * testsuite/weak_undef_test.cc: Add new test case.
4147
4148 2010-06-29 Doug Kwan <dougkwan@google.com>
4149
4150 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4151 Initialize USE_SYMBOL_.
4152 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4153 definition.
4154 (Arm_reloc_property::uses_symbol_): New data member declaration.
4155 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4156 uses symbol value and symbol is undefined but not weakly undefined.
4157
4158 2010-06-28 Rafael Espindola <espindola@google.com>
4159
4160 * plugin.cc (Plugin::load): Use dlerror.
4161
4162 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4163
4164 * symtab.cc (detect_odr_violations): When reporting an ODR
4165 violation, report an object where the symbol is defined.
4166
4167 2010-06-25 Doug Kwan <dougkwan@google.com>
4168
4169 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4170 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4171 definition.
4172 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4173 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4174 target hook to detect function points.
4175 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4176 * icf.h (Icf::check_section_for_function_pointers): Change type of
4177 parameter SECTION_NAME to const reference to std::string. Use
4178 target hook to determine if section may have unsafe pointers.
4179 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4180 method definition.
4181
4182 2010-06-21 Rafael Espindola <espindola@google.com>
4183
4184 * fileread.cc (Input_file::find_fie): New
4185 (Input_file::open): Use Input_file::find_fie.
4186 * fileread.h (Input_file::find_fie): New
4187 * plugin.cc (set_extra_library_path): New.
4188 (Plugin::load): Add set_extra_library_path to the transfer vector.
4189 (Plugin_manager::set_extra_library_path): New.
4190 (Plugin_manager::add_input_file): Use the extra search path if set.
4191 (set_extra_library_path(): New.
4192 * plugin.h (Plugin_manager): Add set_extra_library_path and
4193 extra_search_path_.
4194
4195 2010-06-19 Cary Coutant <ccoutant@google.com>
4196
4197 * layout.cc (gdb_sections): Add .debug_types.
4198 (lines_only_debug_sections): Likewise.
4199
4200 2010-06-18 Rafael Espindola <espindola@google.com>
4201
4202 * plugin.cc (add_input_file,add_input_library)
4203 (Plugin_manager::add_input_file): Make filename arguments const.
4204 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4205 const.
4206
4207 2010-06-16 Doug Kwan <dougkwan@google.com>
4208
4209 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4210 .ARM.attributes section if we have not merged any input
4211 attributes sections.
4212
4213 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4214
4215 * arm.cc: Allow combining objects with no EABI version
4216 information.
4217
4218 2010-06-15 Rafael Espindola <espindola@google.com>
4219
4220 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4221
4222 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4223
4224 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4225 (struct iovec): Correct !HAVE_READV definition.
4226
4227 2010-06-10 Cary Coutant <ccoutant@google.com>
4228
4229 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4230 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4231 reloc sections.
4232 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4233
4234 PR 11683
4235 * symtab.h (Symbol::is_placeholder): New member function.
4236 * target-reloc.h (relocate_section): Check for placeholder symbols.
4237
4238 * testsuite/Makefile.am (plugin_test_8): New test.
4239 (plugin_test_9): New test.
4240 * testsuite/Makefile.in: Regenerate.
4241
4242 2010-06-09 Nick Clifton <nickc@redhat.com>
4243
4244 * yyscript.y (input_list_element): Allow strings prefixed with
4245 the '-' character. Treat these as libraries.
4246 * script.cc (script_add_library): New function. Adds a library
4247 specified by "-l<name>" found in an input script.
4248 * script-c.h: Add prototype for script_add_library.
4249
4250 2010-06-07 Doug Kwan <dougkwan@google.com>
4251
4252 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4253 Restrict stub-group size to be within long conditional branch
4254 range when working around cortex-A8 erratum.
4255
4256 2010-06-07 Damien Diederen <dd@crosstwine.com>
4257
4258 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4259 #ifdef typo.
4260
4261 2010-06-03 Sriraman Tallam <tmsriram@google.com>
4262
4263 PR gold/11658
4264 * output.cc
4265 (Output_section::Input_section_sort_entry::compare_section_ordering):
4266 Change to return non-zero correctly.
4267 (Output_section::Input_section_sort_section_order_index_compare
4268 ::operator()): Change to fix ambiguity in comparisons.
4269
4270 2010-06-01 Sriraman Tallam <tmsriram@google.com>
4271
4272 * gold.h (is_wildcard_string): New function.
4273 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4274 (Layout::layout_eh_frame): Ditto.
4275 (Layout::find_section_order_index): New method.
4276 (Layout::read_layout_from_file): New method.
4277 * layout.h (Layout::find_section_order_index): New method.
4278 (Layout::read_layout_from_file): New method.
4279 (Layout::input_section_position_): New private member.
4280 (Layout::input_section_glob_): New private member.
4281 * main.cc (main): Call read_layout_from_file here.
4282 * options.h (--section-ordering-file): New option.
4283 * output.cc (Output_section::input_section_order_specified_): New
4284 member.
4285 (Output_section::Output_section): Initialize new member.
4286 (Output_section::add_input_section): Add new parameter.
4287 Keep input sections when --section-ordering-file is used.
4288 (Output_section::set_final_data_size): Sort input sections when
4289 section ordering file is specified.
4290 (Output_section::Input_section_sort_entry): Add new parameter.
4291 Check sorting type.
4292 (Output_section::Input_section_sort_entry::compare_section_ordering):
4293 New method.
4294 (Output_section::Input_section_sort_compare::operator()): Change to
4295 consider section_order_index.
4296 (Output_section::Input_section_sort_init_fini_compare::operator()):
4297 Change to consider section_order_index.
4298 (Output_section::Input_section_sort_section_order_index_compare
4299 ::operator()): New method.
4300 (Output_section::sort_attached_input_sections): Change to sort
4301 according to section order when specified.
4302 (Output_section::add_input_section<32, true>): Add new parameter.
4303 (Output_section::add_input_section<64, true>): Add new parameter.
4304 (Output_section::add_input_section<32, false>): Add new parameter.
4305 (Output_section::add_input_section<64, false>): Add new parameter.
4306 * output.h (Output_section::add_input_section): Add new parameter.
4307 (Output_section::input_section_order_specified): New
4308 method.
4309 (Output_section::set_input_section_order_specified): New method.
4310 (Input_section::Input_section): Initialize section_order_index_.
4311 (Input_section::section_order_index): New method.
4312 (Input_section::set_section_order_index): New method.
4313 (Input_section::section_order_index_): New member.
4314 (Input_section::Input_section_sort_section_order_index_compare): New
4315 struct.
4316 (Output_section::input_section_order_specified_): New member.
4317 * script-sections.cc (is_wildcard_string): Delete and move modified
4318 method to gold.h.
4319 (Output_section_element_input::Output_section_element_input): Modify
4320 call to is_wildcard_string.
4321 (Output_section_element_input::Input_section_pattern
4322 ::Input_section_pattern): Ditto.
4323 (Output_section_element_input::Output_section_element_input): Ditto.
4324 * testsuite/Makefile.am (final_layout): New test case.
4325 * testsuite/Makefile.in: Regenerate.
4326 * testsuite/final_layout.cc: New file.
4327 * testsuite/final_layout.sh: New file.
4328
4329 2010-06-01 Rafael Espindola <espindola@google.com>
4330
4331 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4332
4333 2010-06-01 Rafael Espindola <espindola@google.com>
4334
4335 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4336 visibility of symbols.
4337
4338 2010-05-27 Doug Kwan <dougkwan@google.com>
4339
4340 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4341 from start of output section instead of address for a local symbol
4342 in a merged or relaxed section when doing a relocatable link.
4343
4344 2010-05-26 Rafael Espindola <espindola@google.com>
4345
4346 PR 11604
4347 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4348 adding sections the garbage collector removed.
4349 * gold/testsuite/Makefile.am: Add test.
4350 * gold/testsuite/Makefile.in: Regenerate.
4351 * gold/testsuite/plugin_test_7.sh: New.
4352 * gold/testsuite/plugin_test_7_1.c: New.
4353 * gold/testsuite/plugin_test_7_2.c: New.
4354
4355 2010-05-26 Rafael Espindola <espindola@google.com>
4356
4357 * script-sections.cc (Output_section_definition::set_section_addresses):
4358 Check for --section-start.
4359
4360 2010-05-26 Doug Kwan <dougkwan@google.com>
4361
4362 * arm.cc (Arm_scan_relocatable_relocs): New class.
4363 (Target_arm::relocate_special_relocatable): New method.
4364 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4365 (Arm_relocate_functions::thumb_branch_common): Same.
4366 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4367 instead of Default_scan_relocatable_relocs.
4368 * target-reloc.h (relocate_for_relocatable): Let target handle
4369 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4370 * target.h (Sized_target::relocate_special_relocatable): New method.
4371
4372 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4373
4374 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4375
4376 2010-05-23 Doug Kwan <dougkwan@google.com>
4377
4378 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4379 instead of a cast.
4380 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4381 with a direct branch, not a conditional branch, to a stub.
4382 * merge.cc (Output_merge_base::record_input_section): New method
4383 defintion.
4384 (Output_merge_data::do_add_input_section): Record input section if
4385 keeps-input-sections flag is set.
4386 (Output_merge_string::do_add_input_section): Ditto.
4387 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4388 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4389 INPUT_SECTIONS_.
4390 (Output_merge_base::keeps_input_sections,
4391 Output_merge_base::set_keeps_input_sections,
4392 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4393 method definitions.
4394 (Output_merge_base::Input_sections): New type declaration.
4395 (Output_merge_base::input_sections_begin,
4396 Output_merge_base::input_sections_end,
4397 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4398 (Output_merge_base::bool keeps_input_sections_,
4399 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4400 Output_merge_base::input_sections_): New data members.
4401 (Output_merge_data::do_set_keeps_input_sections): New method
4402 defintion.
4403 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4404 * output.cc (Output_section::Input_section::relobj): Move method
4405 defintion from class declaration to here and handle merge sections.
4406 (Output_section::Input_section::shndx): Ditto.
4407 (Output_section::Output_section): Remove initializations of removed
4408 data members and initialize new data member LOOKUP_MAPS_.
4409 (Output_section::add_input_section): Set keeps-input-sections flag
4410 for a newly created merge output section as appropriate. Adjust code
4411 to use Output_section_lookup_maps class.
4412 (Output_section::add_relaxed_input_section): Adjst code for lookup
4413 maps code refactoring.
4414 (Output_section::add_merge_input_section): Add a new parameter
4415 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4416 class. If adding input section to a newly created merge output
4417 section fails, remove the new merge section.
4418 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
4419 Adjust code for use of the Output_section_lookup_maps class.
4420 (Output_section::find_merge_section): Ditto.
4421 (Output_section::build_lookup_maps): New method defintion.
4422 (Output_section::find_relaxed_input_section): Adjust code to use
4423 Output_section_lookup_maps class.
4424 (Output_section::get_input_sections): Export merge sections. Adjust
4425 code to use Output_section_lookup_maps class.
4426 (Output_section:::add_script_input_section): Adjust code to use
4427 Output_section_lookup_maps class. Update lookup maps for merge
4428 sections also.
4429 (Output_section::discard_states): Use Output_section_lookup_maps.
4430 (Output_section::restore_states): Same.
4431 * output.h (Merge_section_properties): Move class defintion out of
4432 Output_section.
4433 (Output_section_lookup_maps): New class.
4434 (Output_section::Input_section::is_merge_section): New method
4435 defintion.
4436 (Output_section::Input_section::relobj): Move defintion out of class
4437 defintion. Declare method only.
4438 (Output_section::Input_section::shndx): Ditto.
4439 (Output_section::Input_section::output_merge_base): New method defintion.
4440 (Output_section::Input_section::u2_.pomb): New union field.
4441 (Output_section::Merge_section_by_properties_map,
4442 Output_section::Output_section_data_by_input_section_map,
4443 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4444 Remove types.
4445 (Output_section::add_merge_input_section): Add new parameter
4446 KEEPS_INPUT_SECTIONS.
4447 (Output_section::build_lookup_maps): New method declaration.
4448 (Output_section::merge_section_map_,
4449 Output_section::merge_section_by_properties_map_,
4450 Output_section::relaxed_input_section_map_,
4451 Output_section::is_relaxed_input_section_map_valid_): Remove data
4452 members.
4453 (Output_section::lookup_maps_): New data member.
4454
4455 2010-05-21 Doug Kwan <dougkwan@google.com>
4456
4457 PR gold/11619
4458 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4459 avoid a compilation error.
4460
4461 2010-05-19 Rafael Espindola <espindola@google.com>
4462
4463 * script-sections.cc (Output_section_definition::allocate_to_segment):
4464 Update the phdrs_list even when the output section is NULL.
4465 * testsuite/Makefile.am: Add test.
4466 * testsuite/Makefile.in: Regenerate.
4467 * testsuite/script_test_9.cc: New.
4468 * testsuite/script_test_9.sh: New.
4469 * testsuite/script_test_9.t: New.
4470
4471 2010-05-19 Doug Kwan <dougkwan@google.com>
4472
4473 * arm.cc (Arm_input_section::original_size): New method.
4474 (Arm_input_section::do_addralign): Add a cast.
4475 (Arm_input_section::do_output_offset): Remove static cast.
4476 (Arm_input_section::original_addralign,
4477 Arm_input_section::original_size_): Change type to uint32_t.
4478 (Arm_input_section::init): Add safe casts for section alignment
4479 and size.
4480 (Arm_input_section::set_final_data_size): Do not set address and
4481 offset of stub table.
4482 (Arm_output_section::fix_exidx_coverage): Change use of of
4483 Output_section::Simple_input_section to that of
4484 Output_section::Input_section.
4485 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4486 except for the first pass.
4487 * output.cc (Output_section::get_input_sections): Change type of
4488 input_sections to std::list<Input_section>.
4489 (Output_section::add_script_input_section): Rename from
4490 Output_section::add_simple_input_section. Change type of SIS
4491 parameter from Simple_input_section to Input_section.
4492 * output.h (Output_section::Simple_input_section): Remove class.
4493 (Output_section::Input_section): Change class visibility to public.
4494 (Output_section::Input_section::addralign): Use stored alignments
4495 for special input sections if set.
4496 (Output_section::Input_section::set_addralign): New method.
4497 (Output_section::get_input_sections): Change parameter type from
4498 list of Simple_input_section to list of Input_section.
4499 (Output_section::add_script_input_section): Rename from
4500 Output_section::add_simple_input_section. Change first parameter's
4501 type from Simple_input_section to Input_section and remove the
4502 second and third parameters.
4503 * script-sections.cc (Input_section::Input_section_list): Change
4504 type to list of Output_section::Input_section/
4505 (Input_section_info::Input_section_info): Change parameter type of
4506 INPUT_SECTION to Output_section::Input_section.
4507 (Input_section_info::input_section): Change return type.
4508 (Input_section_info::input_section_): Change type to
4509 Output_section::Input_section.
4510 (Output_section_element_input::set_section_addresses): Adjust code
4511 to use Output_section::Input_section instead of
4512 Output_section::Simple_input_section. Adjust code for renaming
4513 of Output_section::add_simple_input_section.
4514 (Orphan_output_section::set_section_addresses): Ditto.
4515
4516 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4517
4518 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4519 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4520
4521 2010-05-18 Rafael Espindola <espindola@google.com>
4522
4523 * options.cc (General_options::finalize): Handle -nostdlib.
4524 * options.h (nostdlib): New option.
4525 * script.cc (script_add_search_dir): Handle -nostdlib.
4526
4527 2010-05-12 Doug Kwan <dougkwan@google.com>
4528
4529 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4530 attributes section only if there no attributes section after merging.
4531 (Target_arm::merge_object_attributes): Move value of
4532 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
4533 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4534 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4535 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4536 and arm_attr_merge_7.stdout.
4537 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4538 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4539 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4540 arm_attr_merge_7b.o): New rules.
4541 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4542 arm_attr_merge_7
4543 * testsuite/Makefile.in: Regenerate.
4544 * testsuite/arm_attr_merge.sh: New file.
4545 * testsuite/arm_attr_merge_[67][ab].s: Same.
4546
4547 2010-05-05 Nick Clifton <nickc@redhat.com>
4548
4549 * po/es.po: Updated Spanish translation.
4550
4551 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4552
4553 * Makefile.am (install-exec-local): Properly install gold as
4554 default cross linker.
4555 * Makefile.in: Regenerated.
4556
4557 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4558 Nick Clifton <nickc@redhat.com>
4559
4560 * configure.ac (install_as_default): Define and set to false
4561 unless --enable-gold or --enable-gold=both/gold has been
4562 specified.
4563 * configure: Regenerate.
4564
4565 * Makefile.am (install-exec-local): Install the executable as
4566 'ld.gold'. If install_as_default is true then also install it as
4567 'ld'.
4568 * Makefile.in: Regenerated.
4569
4570 2010-04-24 Ian Lance Taylor <iant@google.com>
4571
4572 * layout.cc (Layout::layout_reloc): In relocatable link don't
4573 combine reloc sections for grouped sections.
4574
4575 2010-04-23 Sriraman Tallam <tmsriram@google.com>
4576
4577 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4578 sections that are not ordinary to icf.
4579 * icf.cc (get_section_contents): Handle relocation pointing to section
4580 with no object or shndx information.
4581 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4582 * testsuite/Makefile.in: Regenerate.
4583 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4584 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4585
4586 2010-04-22 Ian Lance Taylor <iant@google.com>
4587
4588 * expression.cc (Expression::Expression_eval_info): Add
4589 result_alignment_pointer field.
4590 (Expression::eval_with_dot): Add result_alignment_pointer
4591 parameter. Change all callers.
4592 (Expression::eval_maybe_dot): Likewise.
4593 (class Binary_expression): Add alignment_pointer parameter to
4594 left_value and right_value. Change all callers.
4595 (BINARY_EXPRESSION): Set result alignment.
4596 (class Trinary_expression): Add alignment_pointer parameter to
4597 arg2_value and arg3_value. Change all callers.
4598 (Trinary_cond::value): Set result alignment.
4599 (Max_expression::value, Min_expression::value): Likewise.
4600 (Align_expression::value): Likewise.
4601 * script-sections.cc (class Sections_element): Add dot_alignment
4602 parameter to set_section_addresses virtual function. Update
4603 instantiations.
4604 (class Output_section_element): Likewise.
4605 (Script_sections::create_segments): Add dot_alignment parameter.
4606 Change all callers.
4607 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4608 (Script_sections::set_phdrs_clause_addresses): Likewise.
4609 * script-sections.h: Update declarations.
4610 * script.h: Update declarations.
4611 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4612 min_p_align.
4613 * testsuite/script_test_3.t: Set large alignment.
4614 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4615 segment has expected alignment.
4616
4617 2010-04-22 Nick Clifton <nickc@redhat.com>
4618
4619 * po/gold.pot: Updated by the Translation project.
4620 * po/vi.po: Updated Vietnamese translation.
4621
4622 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4623
4624 * testsuite/Makefile.am (check_PROGRAMS): Add
4625 icf_virtual_function_folding_test.
4626 * testsuite/Makefile.in: Regenerated.
4627
4628 2010-04-15 Andrew Haley <aph@redhat.com>
4629
4630 * options.h (merge_exidx_entries): New option.
4631 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4632 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4633 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4634 (Target_arm::merge_exidx_entries): New function.
4635 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4636 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4637 to Arm_exidx_fixup constructor.
4638 Add new arg, merge_exidx_entries.
4639 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4640 Arm_output_section::fix_exidx_coverage.
4641
4642 2010-04-18 Sriraman Tallam <tmsriram@google.com>
4643
4644 * icf.cc (get_section_contents): Check for preemptible functions.
4645 Ignore addend when appropriate.
4646 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4647 section folded.
4648 (add_from_relobj): Check for section folded.
4649 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4650 * symtab.h (should_add_dynsym_entry): Add new parameter.
4651 * target-reloc.h (scan_relocs): Check for section folded.
4652 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4653 Check reloc types for function pointers in shared objects.
4654 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4655 case.
4656 (icf_preemptible_functions_test): New test case.
4657 (icf_string_merge_test): New test case.
4658 * testsuite.Makefile.in: Regenerate.
4659 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4660 bar_glob. Refactor code.
4661 * testsuite/icf_preemptible_functions_test.cc: New file.
4662 * testsuite/icf_preemptible_functions_test.sh: New file.
4663 * testsuite/icf_string_merge_test.cc: New file.
4664 * testsuite/icf_string_merge_test.sh: New file.
4665 * testsuite/icf_virtual_function_folding_test.cc: New file.
4666 * testsuite/icf_virtual_function_folding_test.sh: New file.
4667
4668 2010-04-14 Doug Kwan <dougkwan@google.com>
4669
4670 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4671 for local symbol recounting if we remove a section due to ICF.
4672 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4673 there are no regular objects in input.
4674
4675 2010-04-13 Doug Kwan <dougkwan@google.com>
4676
4677 * arm.cc (Arm_input_section::set_final_data_size): Compute
4678 accurate final data size instead of using current data size.
4679
4680 2010-04-09 Doug Kwan <dougkwan@google.com>
4681
4682 * layout.cc (Layout::choose_output_section): Handle script section
4683 types.
4684 (Layout::make_output_section_for_script): Add section type parameter.
4685 Handle script section types.
4686 * layout.h (Layout::make_output_section_for_script): Add section
4687 type parameter.
4688 * output.cc (Output_section::Output_section): Initialize data member
4689 is_noload_.
4690 (Output_section::do_reset_address_and_file_offset): Do not set address
4691 to 0 if section is a NOLOAD section.
4692 * output.h (Output_section::is_noload): New method.
4693 (Output_section::set_is_noload): Ditto.
4694 (Output_section::is_noload_): New data member.
4695 * script-c.h (Script_section_type): New enum type.
4696 (struct Parser_output_section_header): Add new file section_type.
4697 * script-sections.cc (Sections_element::output_section_name): Add
4698 parameter for returning script section type.
4699 (Output_section_definition::output_section_name): Ditto.
4700 (Output_section_definition::section_type)P; New method.
4701 (Output_section_definiton::script_section_type_name): Ditto.
4702 (Output_section_definition::script_section_type_): New data member.
4703 (Output_section_definition::Output_section_definition): Initialize
4704 data member Output_section_definition::script_section_type_.
4705 (Output_section_definition::create_sections): Pass script section type
4706 to Layout::make_output_section_for_script.
4707 (Output_section_definition::output_section_name): Return script
4708 section type to caller.
4709 (Output_section_definition::set_section_address): Do not advance
4710 dot value and load address if section type is NOLOAD. Set address
4711 of NOLOAD sections regardless of section flags.
4712 (Output_section_definition::print): Print section type if it is
4713 not SCRIPT_SECTION_TYPE_NONE.
4714 (Output_section_definition::section_type): New method.
4715 (Output_section_definition::script_section_type_name): Ditto.
4716 (Script_sections::output_section_name): Add new parameter
4717 PSECTION_TYPE for returning script section type. Pass it to
4718 section elements. Handle discard sections.
4719 (Sort_output_sections::operator()): Handle NOLOAD sections.
4720 * script-sections.h (Script_sections::Section_type): New enum type.
4721 (Script_sections::output_section_name): Add a new parameter for
4722 returning script section type.
4723 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4724 INFO and NOLOAD.
4725 * yyscript.y (union): Add new field SECTION_TYPE.
4726 (COPY, DSECT, INFO, NOLOAD): New tokens.
4727 (opt_address_and_section_type): Change type to output_section_header.
4728 (section_type): New non-terminal
4729 (section_header): Handle section type.
4730 (opt_address_and_section_type): Return section type value.
4731
4732 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4733
4734 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4735 * testsuite/plugin_common_test_2.c (foo): Likewise.
4736
4737 2010-04-08 Doug Kwan <dougkwan@google.com>
4738
4739 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4740 Output_merge_data.
4741 * output.cc (Output_section::add_merge_input_section): Simplify
4742 code and return status of Output_merge_base::add_input_section.
4743 Update merge section map only if Output_merge_base::add_input_section
4744 returns true.
4745
4746 2010-04-07 Doug Kwan <dougkwan@google.com>
4747
4748 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4749 if section is marked as containing instructions but has no mapping
4750 symbols.
4751 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4752 correct section index.
4753 (Arm_relobj::find_linked_text_section): Ditto.
4754
4755 2010-04-07 Cary Coutant <ccoutant@google.com>
4756
4757 * archive.cc (include_member): Destroy Read_symbols_data object before
4758 releasing file.
4759 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4760 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4761 (Read_symbols_data::~Read_symbols_data) New destructor.
4762 (Section_relocs::Section_relocs) New constructor.
4763 (Section_relocs::~Section_relocs) New destructor.
4764 (Read_relocs_data::Read_relocs_data) New constructor.
4765 (Read_relocs_data::~Read_relocs_data) New destructor.
4766 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4767 pointers to NULL after deleting.
4768
4769 2010-04-07 Doug Kwan <dougkwan@google.com>
4770
4771 * arm.cc: Replace "endianity" with "endianness" in comments.
4772 (Arm_exidx_cantunwind): Ditto.
4773 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4774 (Arm_relobj::merge_flags_and_attributes): New method.
4775 (Arm_relobj::merge_flags_and_attributes_): New data member.
4776 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4777 (Arm_relobj::scan_sections_for_stubs): Ditto.
4778 (Arm_relobj::do_read_symbols): Check to see if we really want to
4779 merge processor-specific flags and attributes. Exit early if
4780 an object is empty except for section names and the undefined symbol.
4781 (Target_arm::do_finalize_sections): Move check for ELF format to
4782 Arm_relobj::do_read_symbols. Merge processor specific flags and
4783 attributes from a regular object only when we have determined that
4784 it is aapropriate. Do not create an .ARM.attributes section in
4785 output if there is no regular input object.
4786 (Target_arm::merge_processor_specific_flags): Check
4787 --warn-mismatch before printing any error.
4788 (Target_arm::merge_object_attributes): Ditto.
4789 * gold.cc (queue_middle_tasks): Handle the case in which there is
4790 no regular object in input.
4791 * options.cc (General_options::parse_EB): New method.
4792 (General_options::parse_EL): Same.
4793 (General_options::General_options): Initialize endianness_.
4794 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4795 New options.
4796 (General_options::Endianness): New enum.
4797 (General_options::endianness): New method.
4798 (General_options::endianness_): New data member.
4799 * parameters.cc (Parameters::set_options): Check target endianness.
4800 (Parameters::set_target_once): Ditto.
4801 (Parameters::check_target_endianness): New method.
4802 (parameters_force_valid_target): If either -EL or -EB is specified,
4803 use it to define endianness of default target.
4804 * parameters.h (Parameters::check_target_endianness): New method
4805 declaration.
4806 * target.h (class Target): Change "endianity" to "endianness"
4807 in comments.
4808
4809 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4810
4811 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4812 * configure: Regenerate.
4813 * Makefile.in: Regenerate.
4814 * testsuite/Makefile.in: Regenerate.
4815
4816 2010-04-06 Cary Coutant <ccoutant@google.com>
4817
4818 gcc PR lto/42757
4819 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4820 prevailing definitions of common symbols.
4821 * testsuite/plugin_test_6.sh: New test case.
4822 * testsuite/plugin_common_test_1.c: New test case.
4823 * testsuite/plugin_common_test_2.c: New test case.
4824 * testsuite/Makefile.am (plugin_test_6): New test case.
4825 * testsuite/Makefile.in: Regenerate.
4826
4827 2010-04-06 Nick Clifton <nickc@redhat.com>
4828
4829 * po/vi.po: New Vietnamese translation.
4830
4831 2010-03-30 Doug Kwan <dougkwan@google.com>
4832
4833 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4834
4835 2010-03-25 Doug Kwan <dougkwan@google.com>
4836
4837 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4838 to avoid a conversion warning on a 32-bit host.
4839
4840 2010-03-24 Ian Lance Taylor <iant@google.com>
4841
4842 * testsuite/script_test_3.t: Add a TLS segment.
4843 * testsuite/Makefile.am (check_PROGRAMS): Add
4844 tls_phdrs_script_test.
4845 (tls_phdrs_script_test_SOURCES): Define.
4846 (tls_phdrs_script_test_DEPENDENCIES): Define.
4847 (tls_phdrs_script_test_LDFLAGS): Define.
4848 (tls_phdrs_script_test_LDADD): Define.
4849 * testsuite/Makefile.in: Rebuild.
4850
4851 2010-03-23 Cary Coutant <ccoutant@google.com>
4852
4853 * fileread.cc (find_or_make_view): Fix comment.
4854
4855 2010-03-23 Ian Lance Taylor <iant@google.com>
4856
4857 * script-sections.cc (class Orphan_section_placement): Define
4858 PLACE_TLS and PLACE_TLS_BSS.
4859 (Orphan_section_placement::Orphan_section_placement): Initialize
4860 new places.
4861 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4862 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4863 (tls_script_test_SOURCES): Define.
4864 (tls_script_test_DEPENDENCIES): Define.
4865 (tls_script_test_LDFLAGS): Define.
4866 (tls_script_test_LDADD): Define.
4867 * testsuite/Makefile.in: Rebuild.
4868
4869 2010-03-22 Doug Kwan <dougkwan@google.com>
4870
4871 * arm.cc (Arm_relocate_functions::abs8,
4872 Arm_relocate_functions::abs16): Use correct check for overflow
4873 specified in the ARM ELF specs.
4874 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4875 target of a BLX instruction specially.
4876 (Reloc_stub::stub_type_for_reloc): Ditto.
4877 (Relocate::relocate): Use symbolic names instead of numeric relocation
4878 codes to report error.
4879 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4880 workaround.
4881 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4882 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4883 thumb2_blx_out_of_range.stdout
4884 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4885 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4886 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4887 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4888 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4889 thumb2_blx_in_range, thumb2_blx_in_range.o,
4890 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4891 thumb2_blx_out_of_range.o): New rules.
4892 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4893 thumb2_blx_in_range and thumb2_blx_out_of_range.
4894 * testsuite/Makefile.in: Regenerate.
4895 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4896 * testsuite/thumb_blx_in_range.s: New file.
4897 * testsuite/thumb_blx_out_of_range.s: New file.
4898
4899 2010-03-22 Rafael Espindola <espindola@google.com>
4900
4901 * archive.cc (Should_include): Move to archive.h.
4902 (should_include_member): Make it a member of Archive.
4903 (Lib_group): New.
4904 (Add_lib_group_symbols): New.
4905 * archive.h: Include options.h.
4906 (Archive_member): Moved from Archive.
4907 (Should_include): Moved from archive.cc.
4908 (Lib_group): New.
4909 (Add_lib_group_symbols): New.
4910 * dynobj.cc (do_should_include_member): New.
4911 * dynobj.h (do_should_include_member): New.
4912 * gold.cc (queue_initial_tasks): Update call to queue.
4913 * main.cc (main): Print lib group stats.
4914 * object.cc (do_should_include_member): New.
4915 * object.h: Include archive.h.
4916 (Object::should_include_member): New.
4917 (Object::do_should_include_member): New.
4918 (Sized_relobj::do_should_include_member): New.
4919 * options.cc (General_options::parse_start_lib): New.
4920 (General_options::parse_end_lib): New.
4921 (Input_arguments::add_file): Handle lib groups.
4922 (Input_arguments::start_group): Check we are not in a lib.
4923 (Input_arguments::start_lib): New.
4924 (Input_arguments::end_lib): New.
4925 * options.h (General_options): Add start_lib and end_lib.
4926 (Input_argument::lib_): New.
4927 (Input_argument::lib): New.
4928 (Input_argument::is_lib): New.
4929 (Input_file_lib): New.
4930 (Input_arguments::in_lib_): New.
4931 (Input_arguments::in_lib): New.
4932 (Input_arguments::start_lib): New.
4933 (Input_arguments::end_lib_): New.
4934 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4935 in unused members as preempted.
4936 (Sized_pluginobj::do_should_include_member): New.
4937 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4938 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4939 return the blocker.
4940 (Read_symbols::do_whole_lib_group): New.
4941 (Read_symbols::do_lib_group): New.
4942 (Read_symbols::do_read_symbols): Handle lib groups.
4943 (Read_symbols::get_name): Handle lib groups.
4944 * readsyms.h (Read_symbols): Add an archive member pointer.
4945 (Read_symbols::do_whole_lib_group): New.
4946 (Read_symbols::do_lib_group): New.
4947 (Read_symbols::member_): New.
4948 * script.cc (read_input_script): Update call to queue_soon.
4949
4950 2010-03-19 Doug Kwan <dougkwan@google.com>
4951
4952 * arm.cc (Stub_table::Stub_table): Initialize new data members
4953 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4954 (Stub_table::add_reloc_stub): Assign stub offset and update
4955 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4956 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4957 New data members.
4958 (Stub_table::update_data_size_and_addralign): Use
4959 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4960 instead of going over all reloc stubs.
4961 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4962 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4963 Stringpool_template::offset_ to size of Stringpool_char.
4964 (Stringpool_template::new_key_offset): Remove code to initialize
4965 Stringpool_template::offset_.
4966 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4967 Stringpool_template::offset_ to zero.
4968
4969 2010-03-15 Doug Kwan <dougkwan@google.com>
4970
4971 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4972 offset_.
4973 (Stringpool_template::new_key_offset): New method.
4974 (Stringpool_template::add_string): Assign offsets when adding new
4975 strings.
4976 (Stringpool_template::set_string_offsets): Do not set string offsets
4977 when not optimizing.
4978 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4979 member size_.
4980 (Chunked_vector::clear): Clear size_.
4981 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4982 (Chunked_vector::size): Return size_.
4983 (Chunked_vector::push_back): Use size_ to find insert position.
4984 (Chunked_vector::size_): New data member.
4985 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4986 (Stringpool_template::new_key_offset): New method declaration.
4987 (Stringpool_template::offset_): New data member.
4988
4989 2010-03-15 Rafael Espindola <espindola@google.com>
4990
4991 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4992 Add_symbols' constructor.
4993 * readsyms.h (Add_symbols): Remove the input_group member.
4994
4995 2010-03-10 Ian Lance Taylor <iant@google.com>
4996
4997 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4998 target to ask whether a reference to a symbol requires a stack
4999 split.
5000 * target.h (Target::is_call_to_non_split): New function.
5001 (Target::do_is_call_to_non_split): Declare virtual function.
5002 * target.cc: Include "symtab.h".
5003 (Target::do_is_call_to_non_split): New function.
5004 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5005
5006 2010-03-10 Cary Coutant <ccoutant@google.com>
5007
5008 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5009 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5010 (File_read::open[2]): Add whole_file_view_ to list of views.
5011 (File_read::make_view): Remove test of whole_file_view_.
5012 (File_read::find_or_make_view): Create whole_file_view_ if
5013 necessary.
5014 (File_read::clear_views): Replace bool parameter with enum;
5015 adjust all callers. Don't delete views with permanent data;
5016 do delete cached views and views from archives if
5017 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5018 if clearing the corresponding view.
5019 * fileread.h (File_read::Clear_views_mode): New enum.
5020 (File_read::View::is_permanent_view): New method.
5021 (File_read::clear_views): Replace bool parameter
5022 with enum; adjust all callers.
5023 * options.h (General_options): Change keep_files_mapped option;
5024 add map_whole_files.
5025 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5026 releasing the file.
5027 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5028 the file.
5029
5030 2010-03-10 David S. Miller <davem@davemloft.net>
5031
5032 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5033
5034 2010-03-09 Sriraman Tallam <tmsriram@google.com>
5035
5036 * icf.cc (get_section_contents): Add '@' marker after processing the
5037 merge reloc.
5038
5039 2010-03-08 Doug Kwan <dougkwan@google.com>
5040
5041 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5042 due to a conversion warning.
5043 (Arm_relobj::update_output_local_symbol_count): Check for local
5044 symbol with unset output index.
5045
5046 2010-03-05 Ian Lance Taylor <iant@google.com>
5047
5048 * options.h (class General_options): Add --spare-dynamic-tags.
5049 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5050 --spare-dynamic-tags.
5051
5052 2010-03-05 Ian Lance Taylor <iant@google.com>
5053
5054 * incremental.cc: Include "libiberty.h".
5055
5056 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5057
5058 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5059 function, is_info_ member.
5060 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5061 (Versions::Versions): Update caller.
5062 (Versions::define_base_version): Likewise.
5063 (Versions::add_def): Likewise.
5064
5065 2010-03-03 Sriraman Tallam <tmsriram@google.com>
5066
5067 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5068 (Scan::possible_function_pointer_reloc): New function.
5069 (Scan::local_reloc_may_be_function_pointer): Change to call
5070 possible_function_pointer_reloc.
5071 (Scan::global_reloc_may_be_function_pointer): Ditto.
5072 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5073 relocations in ".data.rel.ro._ZTV" section.
5074 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5075 * testsuite/icf_safe_so_test.cc: Ditto.
5076 * testsuite/icf_safe_test.cc: Ditto.
5077 * testsuite/icf_safe_test.sh: Ditto.
5078
5079 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5080 Ian Lance Taylor <iant@google.com>
5081
5082 * target-reloc.h (relocate_section): Check the symbol table index
5083 for -1U before setting the local symbol index.
5084 (scan_relocatable_relocs): If copying the relocation, record that
5085 the local symbol is required.
5086 * object.h (Symbol_value::is_output_symtab_index_set): New
5087 function.
5088 (Symbol_value::may_be_discarded_from_output_symtab): New
5089 function.
5090 (Symbol_value::has_output_symtab_entry): New function.
5091 (Symbol_value::needs_output_symtab_entry): Remove.
5092 (Symbol_value::output_symtab_index): Make sure the symbol index is
5093 set.
5094 (Symbol_value::set_output_symtab_index): Make sure the symbol
5095 index is not set. Make sure the new index is valid.
5096 (Symbol_value::set_must_have_output_symtab_entry): New function.
5097 (Symbol_value::has_output_dynsym_entry): New function.
5098 (Symbol_value::set_output_dynsym_index): Make sure the new index
5099 is valid.
5100 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5101 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5102 local symbol if permitted.
5103 (Sized_relobj::do_finalize_local_symbols): Call
5104 is_output_symtab_index_set rather than needs_output_symtab_entry.
5105 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5106 rather than needs_output_symtab_entry. Call
5107 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5108 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5109 is_output_symtab_index_set rather than needs_output_symtab_entry.
5110 * testsuite/discard_locals_relocatable_test.c: New file.
5111 * testsuite/discard_locals_test.sh: Test -r.
5112 * testsuite/Makefile.am (check_DATA): Add
5113 discard_locals_relocatable_test1.syms,
5114 discard_local_relocatable_test2.syms.
5115 (MOSTLYCLEANFILES): Likewise. Also add
5116 discard_locals_relocatable_test1.lout and
5117 discard_locals_relocatable_test2.out.
5118 (discard_locals_relocatable_test1.syms): New target.
5119 (discard_locals_relocatable_test.o): New target.
5120 (discard_locals_relocatable_test1.out): New target.
5121 (discard_locals_relocatable_test2.syms): New target.
5122 (discard_locals_relocatable_test2.out): New target.
5123 (various): Add missing ../ld-new dependencies.
5124 * testsuite/Makefile.in: Rebuild.
5125
5126 2010-03-03 Nick Clifton <nickc@redhat.com>
5127
5128 * po/fi.po: New Finnish translation.
5129
5130 2010-03-01 Doug Kwan <dougkwan@google.com>
5131
5132 * layout.cc (Layout::Layout): Force section types of .init_array*,
5133 .preinit_array* and .fini_array* sections.
5134 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5135 Fix check of return value of std::string::find.().
5136 (Output_section::Input_section_sort_compare::operator()): Remove
5137 comment about .init_array.
5138 (Output_section::Input_section_sort_init_fini_compare::operator()):
5139 New method.
5140 (Output_section::sort_attached_input_sections): Handle .init_array
5141 and .fini_array specially.
5142 * output.h (Output_section::Inut_section_sort_compare): Update
5143 comment.
5144 (Output_section::Input_section_sort_init_fini_compare): New struct.
5145
5146 2010-02-26 Doug Kwan <dougkwan@google.com>
5147
5148 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5149 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5150 * testsuite/debug_msg.sh: Avoid matching source line number for
5151 use of global variable undef_int.
5152
5153 2010-02-26 Doug Kwan <dougkwan@google.com>
5154
5155 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5156 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5157 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5158 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5159 * options.cc (General_options::General_options): Initialize member
5160 fix_v4bx_.
5161 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5162 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5163 and rm_no_fix_v4bx.stdout
5164 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5165 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5166 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5167 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5168 and arm_no_fix_v4bx.
5169 * Makefile.in: Regenerate.
5170 * testsuite/arm_fix_v4bx.s: New file.
5171 * testsuite/arm_fix_v4bx.sh: Ditto.
5172
5173 2010-02-24 Doug Kwan <dougkwan@google.com>
5174
5175 * arm.cc (Target_arm::got_section): Make the .got section the first
5176 non RELRO section in the data segment.
5177 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5178 suffixes of section names.
5179
5180 2010-02-24 Doug Kwan <dougkwan@google.com>
5181
5182 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5183 flags and attributes merging if an input file is a binary file.
5184 * fileread.cc (Input_file::open): Record format of original file.
5185 * fileread.h (Input_file::Format): New enum type.
5186 (Input_file::Input_file): Initialize data member format_.
5187 (Input_file::format): New method definition.
5188 (Input_file::format_):: New data member.
5189
5190 2010-02-24 Doug Kwan <dougkwan@google.com>
5191
5192 * arm.cc (Arm_output_data_got): New class.
5193 (ARM_TCB_SIZE): New constant
5194 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5195 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5196 If user uses a script with a SECTIONS clause, issue only a warning
5197 for a misplaced EXIDX input section. Otherwise, issue an error.
5198 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5199 garbage collection.
5200 (Target_arm::got_mode_index_entry): Handle static linking.
5201 (Target_arm::Scan::local): Ditto.
5202 (Target_arm::Scan::global): Ditto.
5203 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5204 all incorrectly implemented relocations.
5205 (Target_arm::fix_exidx_coverage): Pass layout to
5206 Arm_output_section::fix_exidx_coverage.
5207 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5208 from ".ARM.exidx." and ".ARM.extab.".
5209
5210 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5211
5212 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5213 section if it does not already exist.
5214 * attributes.cc (Attributes_section_data::Attributes_section_data):
5215 Don't crash if size is zero.
5216
5217 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5218 Ian Lance Taylor <iant@google.com>
5219
5220 * gold.cc (queue_middle_tasks): If no input files were opened,
5221 exit.
5222 * workqueue.h (Task_function::Task_function): Assert that there is
5223 a blocker.
5224
5225 2010-02-22 Doug Kwan <dougkwan@google.com>
5226
5227 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5228 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5229 types to avoid warnings due to different uint64_t implementations
5230 on different hosts.
5231
5232 2010-02-21 Doug Kwan <dougkwan@google.com>
5233
5234 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5235 handling of the maximum backward branch offset.
5236 (Arm_relocate_functions::thumb_branch_common): Ditto.
5237 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5238 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
5239 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
5240 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5241 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5242 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5243 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5244 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5245 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5246 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5247 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5248 thumb2_bl_out_of_range.o): New rules.
5249 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5250 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5251 thumb2_bl_out_of_range
5252 * testsuite/Makefile.in: Regenerate.
5253 * testsuite/arm_bl_in_range.s: New file.
5254 * testsuite/arm_bl_out_of_range.s: Ditto.
5255 * testsuite/arm_branch_in_range.sh: Ditto.
5256 * testsuite/arm_branch_range.t: Ditto.
5257 * testsuite/thumb2_branch_range.t: Ditto.
5258 * testsuite/thumb_bl_in_range.s: Ditto.
5259 * testsuite/thumb_bl_out_of_range.s: Ditto.
5260 * testsuite/thumb_branch_range.t: Ditto.
5261
5262 2010-02-20 Sriraman Tallam <tmsriram@google.com>
5263
5264 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5265 Add reloc offset information.
5266 * icf.cc (get_section_contents): Change iterators to point to the new
5267 vectors. Add reloc offset information to the contents.
5268 * icf.h (Icf::Sections_reachable_info): New typedef.
5269 (Icf::Sections_reachable_list): New typedef.
5270 (Icf::Offset_info): New typedef.
5271 (Icf::Reloc_info): New struct typedef.
5272 (Icf::Reloc_info_list): New typedef.
5273 (Icf::symbol_reloc_list): Delete method.
5274 (Icf::addend_reloc_list): Delete method.
5275 (Icf::section_reloc_list): Delete method.
5276 (Icf::reloc_info_list): New method.
5277 (Icf::reloc_info_list_): New member.
5278
5279 2010-02-19 Doug Kwan <dougkwan@google.com>
5280
5281 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5282 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5283 * arm.cc (Arm_relocation_functions): New forward declaration.
5284 (Target_arm::Target_arm): Initialize new data members
5285 got_mod_index_offset_ and tls_base_symbol_defined_.
5286 (Target_arm::Relocate::relocate_tls): New method.
5287 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5288 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5289 New methods.
5290 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5291 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5292 (Target_arm::got_mod_index_offset_,
5293 Target_arm::tls_base_symbol_defined_): New data members.
5294 (Target_arm::Scan::local, Target::Scan::global,
5295 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5296 relocations.
5297
5298 2010-02-18 Doug Kwan <dougkwan@google.com>
5299
5300 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5301 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5302 text section as a parameter becuase some broken tools may not set
5303 the link in section header.
5304 (Target_arm::has_got_section): New method.
5305 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5306 without any mapping symbol as data only. Remove warning.
5307 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5308 link in its section header, try to discover the link by inspecting the
5309 REL31 relocation at the beginning of the section.
5310 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5311 in error message.
5312 (Target_arm::Scan::global): Treat any reference to the symbol
5313 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5314
5315 2010-02-12 Sriraman Tallam <tmsriram@google.com>
5316
5317 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5318 (Scan::global_reloc_may_be_function_pointer): New function.
5319 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5320 (Scan::global_reloc_may_be_function_pointer): New function.
5321 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5322 (Scan::global_reloc_may_be_function_pointer): New function.
5323 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5324 (Scan::global_reloc_may_be_function_pointer): New function.
5325 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5326 (Scan::global_reloc_may_be_function_pointer): New function.
5327 (Scan::possible_function_pointer_reloc): New function.
5328 (Target_x86_64::can_check_for_function_pointers): New function.
5329 * gc.h (gc_process_relocs): Scan relocation types to determine if
5330 function pointers were taken for targets that support it.
5331 * icf.cc (Icf::find_identical_sections): Include functions for
5332 folding in safe ICF whose pointer is not taken.
5333 * icf.h (Secn_fptr_taken_set): New typedef.
5334 (fptr_section_id_): New member.
5335 (section_has_function_pointers): New function.
5336 (set_section_has_function_pointers): New function.
5337 (check_section_for_function_pointers): New function.
5338 * options.h: Fix comment for safe ICF option.
5339 * target.h (can_check_for_function_pointers): New function.
5340 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5341 Modify icf_safe_test for X86-64.
5342 * testsuite/Makefile.in: Regenerate.
5343 * testsuite/icf_safe_so_test.cc: New file.
5344 * testsuite/icf_safe_so_test.sh: New file.
5345 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5346 (main): Change to take pointer to function kept_func_3.
5347 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5348 folding is done correctly for X86-64.
5349
5350 2010-02-12 David S. Miller <davem@davemloft.net>
5351
5352 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5353 is_symbolless parameter.
5354 (Output_reloc<SHT_REL>::is_symbolless): New.
5355 (Output_reloc<SHT_REL>::is_symbolless_): New.
5356 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5357 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5358 (Output_reloc<SHT_RELA>::is_symbolless): New.
5359 (Output_data_reloc::add_global): Handle is_symbolless.
5360 (Output_data_reloc::add_global_relative): Likewise.
5361 (Output_data_reloc::add_local): Likewise.
5362 (Output_data_reloc::add_local_relative): Likewise.
5363 (Output_data_reloc::add_symbolless_global_addend): New.
5364 (Output_data_reloc::add_symbolless_local_addend): New.
5365 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5366 is_symbolless.
5367 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5368 instead of ->is_relative_
5369 (Output_reloc::write): Likewise.
5370 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5371 (Output_reloc::write_rel): Simplify.
5372
5373 * sparc.cc (Target_sparc::Scan::local): Use
5374 ->add_symbolless_local_addend as needed.
5375 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5376 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5377 based upon relocation offset.
5378
5379 2010-02-11 Doug Kwan <dougkwan@google.com>
5380
5381 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5382 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5383 beginning of function.
5384 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5385 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5386 parameter is_32bit in calls to should_apply_static_reloc.
5387 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5388 (check_DATA): Add arm_abs_global.stdout.
5389 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5390 arm_abs_global.stdout): New rules.
5391 (MOSTLLYCLEANFILES): Add arm_abs_global
5392 * Makefile.in: Regenerate.
5393 * testsuite/arm_abs_global.s: New file.
5394 * testsuite/arm_abs_global.sh: Ditto.
5395 * testsuite/arm_abs_lib.s: Ditto.
5396
5397 2010-02-11 Ian Lance Taylor <iant@google.com>
5398
5399 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5400 Read_relocs task.
5401 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5402 Allocate_commons_task first.
5403 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5404 task, rather than symtab_lock_.
5405 (Gc_process_relocs::~Gc_process_relocs): New function.
5406 (Gc_process_relocs::is_runnable): Check this_blocker_.
5407 (Gc_process_relocs::locks): Use next_blocker_ rather than
5408 blocker_.
5409 (Scan_relocs::~Scan_relocs): New function.
5410 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5411 symtab_lock_.
5412 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5413 next_blocker_.
5414 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5415 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5416 constructor accordingly.
5417 (class Gc_process_relocs): Likewise.
5418 (class Scan_relocs): Likewise.
5419 * common.h (class Allocate_commons_task): Remove symtab_lock_
5420 field, and corresponding constructor parameter.
5421 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5422 symtab_lock_.
5423 (Allocate_commons_task::locks): Likewise.
5424
5425 2010-02-11 Ian Lance Taylor <iant@google.com>
5426
5427 * gold-threads.h (class Once): Define.
5428 (class Initialize_lock): Rewrite as child of Once.
5429 * gold-threads.cc (class Once_initialize): Define.
5430 (once_pointer_control): New static variable.
5431 (once_pointer, once_arg): New static variables.
5432 (c_run_once): New static function.
5433 (Once::Once, Once::run_once, Once::internal_run): New functions.
5434 (class Initialize_lock_once): Remove.
5435 (initialize_lock_control): Remove.
5436 (initialize_lock_pointer): Remove.
5437 (initialize_lock_once): Remove.
5438 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5439 (Initialize_lock::initialize): Rewrite.
5440 (Initialize_lock::do_run_once): New function.
5441 * archive.cc (Archive::interpret_header): Only clear name if it is
5442 not already empty.
5443 * fileread.cc: Include "gold-threads.h"
5444 (file_counts_lock): New static variable.
5445 (file_counts_initialize_lock): Likewise.
5446 (File_read::release): Only increment counts when using --stats.
5447 Use a lock around the increment.
5448 * parameters.cc (class Set_parameters_target_once): Define.
5449 (set_parameters_target_once): New static variable.
5450 (Parameters::Parameters): Move here from parameters.h.
5451 (Parameters::set_target): Rewrite.
5452 (Parameters::set_target_once): New function.
5453 (Parameters::clear_target): Move here and rewrite.
5454 * parameters.h (class Parameters): Update declarations. Add
5455 set_parameters_target_once_ field.
5456 (Parameters::Parameters): Move to parameters.cc.
5457 (Parameters::clear_target): Likewise.
5458 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5459 task.
5460 (Start_group::~Start_group): New function.
5461 (Start_group::is_runnable): New function.
5462 (Start_group::locks, Start_group::run): New functions.
5463 (Finish_group::run): Change saw_undefined to size_t.
5464 * readsyms.h (class Start_group): Define.
5465 (class Finish_group): Change saw_undefined_ field to size_t.
5466 (Finish_group::Finish_group): Remove saw_undefined and
5467 this_blocker parameters. Change all callers.
5468 (Finish_group::set_saw_undefined): New function.
5469 (Finish_group::set_blocker): New function.
5470 * symtab.h (class Symbol_table): Change saw_undefined to return
5471 size_t. Change saw_undefined_ field to size_t.
5472 * target-select.cc (Set_target_once::do_run_once): New function.
5473 (Target_selector::Target_selector): Initialize set_target_once_
5474 field. Don't initialize lock_ and initialize_lock_ fields.
5475 (Target_selector::instantiate_target): Rewrite.
5476 (Target_selector::set_target): New function.
5477 * target-select.h (class Set_target_once): Define.
5478 (class Target_selector): Update declarations. Make
5479 Set_target_once a friend. Remove lock_ and initialize_lock_
5480 fields. Add set_target_once_ field.
5481
5482 2010-02-10 Ian Lance Taylor <iant@google.com>
5483
5484 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5485 queueing any tasks.
5486 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5487 (queue_middle_tasks): Add all blockers before queueing any tasks.
5488 (queue_final_tasks): Likewise.
5489 * token.h (Task_token::add_blockers): New function.
5490 * object.h (Input_objects::number_of_relobjs): New function.
5491
5492 2010-02-10 Ian Lance Taylor <iant@google.com>
5493
5494 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5495 shared, not if not position independent.
5496 * x86_64.cc (Relocate::relocate_tls): Likewise.
5497 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5498 (tls_pie_pic_test): New target.
5499 * testsuite/Makefile.in: Rebuild.
5500
5501 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5502 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5503 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5504 * testsuite/Makefile.in: Rebuild.
5505
5506 2010-02-09 David S. Miller <davem@davemloft.net>
5507
5508 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5509 R_SPARC_RELATIVE using ->add_local_relative().
5510 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5511
5512 * output.h (Output_data_dynamic::add_section_size): New method
5513 that takes two Output_data objects.
5514 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5515 entry param. Handle it in initializers.
5516 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5517 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5518 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5519 arg.
5520 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5521 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5522 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5523 for dynrel_includes_plt.
5524 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5525 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5526 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5527 before .rela.plt
5528 (Target_sparc::do_finalize_sections): Update to pass true for
5529 dynrel_includes_plt.
5530 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5531 output before .rela.plt
5532 (Target_powerpc::do_finalize_sections): Update to pass true for
5533 dynrel_includes_plt when 32-bit.
5534
5535 2010-02-08 Doug Kwan <dougkwan@google.com>
5536
5537 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5538 method.
5539 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5540 Arm_relobj::scan_section_for_cortex_a8_stubs,
5541 Arm_relobj::do_relocation_section): Instead of calling
5542 Output_section::output_address, use faster
5543 Arm_relobj::simple_input_section_output_address.
5544
5545 2010-02-08 David S. Miller <davem@davemloft.net>
5546
5547 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5548 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5549 relocation helper function.
5550
5551 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5552 just like R_SPARC_GOT{10,13,22}.
5553 (Target_sparc::Scan::local): Likewise.
5554 (Target_sparc::Relocate:relocate): Likewise.
5555
5556 2010-02-06 Ian Lance Taylor <iant@google.com>
5557
5558 * configure.ac: Rewrite targetobjs duplicate removal code to use
5559 only shell constructs.
5560 * configure: Rebuild.
5561
5562 2010-02-05 Doug Kwan <dougkwan@google.com>
5563
5564 PR 11247
5565 * arm.cc (Arm_relobj::section_is_scannable): New method.
5566 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5567 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5568
5569 2010-02-04 Doug Kwan <dougkwan@google.com>
5570
5571 PR 11247
5572 * arm-reloc-property.cc (cstdio): Include.
5573 * configure.ac (targetobjs): Remove duplicates.
5574 * configure: Regenerate.
5575 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5576 big and little endian version for a given address size.
5577
5578 2010-02-03 Doug Kwan <dougkwan@google.com>
5579
5580 * arm-reloc-property.cc
5581 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5582 definition.
5583 * arm-reloc-property.h
5584 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5585 New method definition.
5586 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5587 declaration.
5588 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5589 overflow to N.
5590 (GOT_PREL): Change implemented to Y.
5591 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5592 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5593 (Arm_relocate_functions::movw_abs_nc): Remove method.
5594 (Arm_relocate_functions::movt_abs): Ditto.
5595 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5596 (Arm_relocate_functions::thm_movt_abs): Ditto.
5597 (Arm_relocate_functions::movw_rel_nc): Ditto.
5598 (Arm_relocate_functions::movw_rel): Ditto.
5599 (Arm_relocate_functions::movt_rel): Ditto.
5600 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5601 (Arm_relocate_functions:thm_movw_rel): Ditto.
5602 (Arm_relocate_functions:thm_movt_rel): Ditto.
5603 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5604 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5605 New method definitions.
5606 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5607 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5608 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5609 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5610 (Target_arm::Relocate::relocate): Check for non-static or
5611 unimplemented relocation code and exit early. Change calls to
5612 Target_arm::reloc_uses_thumb_bit and
5613 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5614 instead. Refactor code to handle similar relocations to increase
5615 code sharing. Remove check for unsupported relocation code in switch
5616 statement.
5617 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5618 relocation property table to find out size. Change error message to
5619 print out the name of a relocation code instead of the numeric value.
5620 (Target_arm::scan_reloc_for_stub): Use relocation property table
5621 instead of calling Target_arm::reloc_uses_thumb_bit().
5622
5623 2010-02-02 Doug Kwan <dougkwan@google.com>
5624
5625 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5626 types of relaxed input section.
5627
5628 2010-02-02 Doug Kwan <dougkwan@google.com>
5629
5630 * Makefile.am (HFILES): Add arm-reloc-property.h.
5631 (DEFFILES): New.
5632 (TARGETSOURCES): Add arm-reloc-property.cc
5633 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5634 (libgold_a_SOURCES): $(DEFFILES)
5635 * Makefile.in: Regenerate.
5636 * arm-reloc-property.cc: New file.
5637 * arm-reloc-property.h: New file.
5638 * arm-reloc.def: New file.
5639 * arm.cc: Update comments.
5640 (arm-reloc-property.h): New included header.
5641 (arm_reloc_property_table): New global variable.
5642 (Target_arm::do_select_as_default_target): New method definition.
5643 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5644 arm-reloc-property to targ_extra_obj.
5645 * parameters.cc (set_parameters_target): Call
5646 Target::select_as_default_target().
5647 * target.h (Target::select_as_default_target): New method definition.
5648 (Target::do_select_as_default_target): Same.
5649
5650 2010-02-01 Doug Kwan <dougkwan@google.com>
5651
5652 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5653 first_output_text_section_.
5654 (Arm_exidx_fixup::first_output_text_section): New method definition.
5655 (Arm_exidx_fixup::first_output_text_section_): New data member.
5656 (Arm_exidx_fixup::process_exidx_section): Record the first text
5657 output section seen.
5658 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5659 and entsize in output section header.
5660
5661 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5662
5663 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5664 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5665 (Arm_relocate_functions::thm_alu11): New Method.
5666 (Arm_relocate_functions::thm_pc8): New Method.
5667 (Arm_relocate_functions::thm_pc12): New Method.
5668 (Target_arm::Scan::local): Handle the relocations.
5669 (Target_arm::Scan::global): Likewise.
5670 (Target_arm::Relocate::relocate): Likewise.
5671 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5672
5673 2010-01-29 Doug Kwan <dougkwan@google.com>
5674
5675 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5676 of relocation types as ld.
5677
5678 2010-01-29 Doug Kwan <dougkwan@google.com>
5679
5680 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5681 to public.
5682 (Arm_relocate_functions::thumb_branch_common): Ditto.
5683 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5684 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5685 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5686 Arm_relocate_functions::jump24): Remove.
5687 (Target_arm::Relocate::relocate): Adjust code to call
5688 Arm_relocation_functions::arm_branch_common and
5689 Arm_relocation_functions::thumb_branch_common instead of their removed
5690 wrappers. Merge switch-cases together to reduce source code size.
5691
5692 2010-01-29 Doug Kwan <dougkwan@google.com>
5693
5694 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5695 output_local_symbol_count_needs_update_.
5696 (Arm_relobj::output_local_symbol_count_needs_update,
5697 Arm_relobj::set_output_local_symbol_count_needs_update,
5698 Arm_relobj::update_output_local_symbol_count): New methods.
5699 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5700 member.
5701 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5702 of pointed function as in a R_ARM_PREL31 relocation.
5703 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5704 for output local symbol count updating.
5705 (Target_arm::do_relax): Update output local symbol counts in objects
5706 if necessary.
5707 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5708
5709 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5710
5711 * arm.cc: Added support for the ARM relocations:
5712 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5713 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5714 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5715 movw_prel_nc).
5716 (Arm_relocate_functions::movw_rel): New method.
5717 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5718 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5719 thm_movw_prel_nc).
5720 (Arm_relocate_functions::thm_movw_rel): New method.
5721 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5722 thm_movt_prel).
5723 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5724 relocations.
5725 (Target_arm::Scan::global): Likewise.
5726 (Target_arm::Relocate::relocate): Likewise.
5727 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5728 Likewise.
5729
5730 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5731
5732 * arm.cc: Added support for ARM group relocations.
5733 (Target_arm::reloc_needs_sym_origin): New method.
5734 (Arm_relocate_functions::calc_grp_kn): New method.
5735 (Arm_relocate_functions::calc_grp_residual): New method.
5736 (Arm_relocate_functions::calc_grp_gn): New method.
5737 (Arm_relocate_functions::arm_grp_alu): New Method.
5738 (Arm_relocate_functions::arm_grp_ldr): New Method.
5739 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5740 (Arm_relocate_functions::arm_grp_ldc): New Method.
5741 (Target_arm::Scan::local): Handle the ARM group relocations.
5742 (Target_arm::Scan::global): Likewise.
5743 (Target_arm::Relocate::relocate): Likewise.
5744 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5745 Likewise.
5746
5747 2010-01-26 Doug Kwan <dougkwan@google.com>
5748
5749 * arm.cc (set): Include.
5750 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5751 pointer type.
5752 (Arm_output_section::Text_section_list): New type.
5753 (Arm_output_section::append_text_sections_to_list): New method.
5754 (Arm_output_section::fix_exidx_coverage): Ditto.
5755 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5756 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5757 Relobj::set_section_offset() instead of
5758 Sized_relobj::invalidate_section_offset().
5759 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5760 parameter for section headers. Ignore relocation sections for
5761 unallocated sections and EXIDX sections.
5762 (Target_arm::fix_exidx_coverage): New method.
5763 (Target_arm::output_section_address_less_than): New type.
5764 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5765 linked text section instead of the EXIDX section.
5766 (Arm_output_section::create_stub_group): Add an assertion to check
5767 that this is not an EXIDX output section.
5768 (Arm_output_section::append_text_sections_to_list): New method.
5769 (Arm_output_section::fix_exidx_coverage): Ditto.
5770 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5771 Arm_relobj::section_needs_reloc_stub_scanning.
5772 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5773 first pass.
5774 (Target_arm::fix_exidx_coverage): New method.
5775 * object.h (Relobj::set_output_section): New method.
5776 (Sized_relobj::invalidate_section_offset): Remove method.
5777 (Sized_relobj::do_invalidate_section_offset): Remove method.
5778 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5779
5780 2010-01-25 Doug Kwan <dougkwan@google.com>
5781
5782 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5783 Fix warning due to signed and unsigned comparison on a 32-bit host.
5784
5785 2010-01-22 Doug Kwan <dougkwan@google.com>
5786
5787 * arm.cc (Target_arm::do_relax): Record an output section for section
5788 offset adjustment it contains any stub table that has changed.
5789 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5790 offsets in an output section if necessary.
5791 * output.cc (Output_section::Output_section): Initialize
5792 section_offsets_need_adjustments_.
5793 (Output_section::add_input_section_for_script): Renamed to
5794 Output_section::add_simple_input_section.
5795 (Output_section::save_states): Add a comment.
5796 (Output_section::discard_states): New method defintion.
5797 (Output_section::adjust_section_offsets): Same.
5798 * output.h (Output_section::add_input_section_for_script): Renamed to
5799 Output_section::add_simple_input_section.
5800 (Output_section::discard_states): New method declaration.
5801 (Output_section::adjust_section_offsets): Same.
5802 (Output_section::section_offsets_need_adjustment,
5803 Output_section::set_section_offsets_need_adjustment): New method
5804 definitions.
5805 (Output_section::section_offsets_need_adjustment_): New data member.
5806 * script-sections.cc
5807 (Output_section_element_input::set_section_address): Adjust code for
5808 renaming of Output_section::add_input_section_for_script.
5809 (Orphan_output_section::set_section_address): Same.
5810
5811 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5812
5813 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5814 Fix_v4bx enum values .
5815 * gold/options.h (General_options): New option definitions.
5816 (General_options::fix_v4bx): New method.
5817 (General_options::Fix_v4bx): New enum.
5818 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5819 (General_options::parse_fix_v4bx_interworking): New method.
5820
5821 2010-01-22 Doug Kwan <dougkwan@google.com>
5822
5823 * arm.cc (Arm_exidx_fixup): New class.
5824
5825 2010-01-21 Doug Kwan <dougkwan@google.com>
5826
5827 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5828 classes.
5829 (Arm_exidx_section_offset_map): New type.
5830
5831 2010-01-21 Doug Kwan <dougkwan@google.com>
5832
5833 * arm.cc (Arm_exidx_input_section): New class.
5834 (Arm_relobj::exidx_input_section_by_link,
5835 Arm_relobj::exidx_input_section_by_shndx,
5836 Arm_relobj::make_exidx_input_section): New methods.
5837 (read_arm_attributes_section): Remove.
5838 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5839 information about them.
5840 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5841 to here.
5842
5843 2010-01-20 Doug Kwan <dougkwan@google.com>
5844
5845 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5846 Input_section_specifier to Section_id.
5847 (Target_arm::new_arm_input_section: Adjust code for change of key
5848 type.
5849 (Target_arm::find_arm_input_section): Ditto.
5850 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5851 (Section_id): Remove.
5852 (Garbage_collection::Section_id_hash): Remove.
5853 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5854 (Section_id): Remove.
5855 (Icf::Section_id_hash): Remove.
5856 * object.h (Section_id, Const_section_id, Section_id_hash,
5857 Const_section_id_hash): New type definitions.
5858 * output.cc (Output_section::add_relaxed_input_section): Change to
5859 use Const_section_id instead of Input_section_specifier as key type.
5860 (Output_section::add_merge_input_section): Ditto.
5861 (Output_section::build_relaxation_map): Change to use Section_id
5862 instead of Input_section_specifier as key type.
5863 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5864 Ditto.
5865 (Output_section::convert_input_sections_to_relaxed_sections): Change
5866 to use Const_section_id instead of Input_section_specifier as key type.
5867 (Output_section::find_merge_section): Ditto.
5868 (Output_section::find_relaxed_input_section): Ditto.
5869 * output.h (Input_section_specifier): Remove class.
5870 (Output_section::Output_section_data_by_input_section_map): Change
5871 key type to Const_section_id.
5872 (Output_section::Output_relaxed_input_section_by_input_section_map):
5873 Ditto.
5874 (Output_section::Relaxation_map): Change key type to Section_id.
5875
5876 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5877
5878 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5879 (class Arm_v4bx_stub): New class.
5880 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5881 (Stub_factory::make_arm_v4bx_stub): New method.
5882 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5883 (Stub_table::empty): Handle v4bx stubs.
5884 (Stub_table::add_arm_v4bx_stub): New method.
5885 (Stub_table::find_arm_v4bx_stub): New method.
5886 (Arm_relocate_functions::v4bx): New method.
5887 (Target_arm::fix_v4bx): New method.
5888 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5889 (Stub_table::relocate_stubs): Likewise.
5890 (Stub_table::do_write): Likewise.
5891 (Stub_table::update_data_size_and_addralign): Likewise.
5892 (Stub_table::finalize_stubs): Likewise.
5893 (Target_arm::Scan::local): Likewise.
5894 (Target_arm::Scan::global): Likewise.
5895 (Target_arm::do_finalize_sections): Likewise.
5896 (Target_arm::Relocate::relocate): Likewise.
5897 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5898 Likewise.
5899 (Target_arm::scan_reloc_for_stub): Likewise.
5900 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5901
5902 2010-01-19 Ian Lance Taylor <iant@google.com>
5903
5904 * output.cc (Output_section_headers::do_sized_write): Write large
5905 segment count to sh_info field.
5906 (Output_file_header::do_sized_write): For large segment count,
5907 write PN_XNUM to e_phnum field.
5908
5909 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5910
5911 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5912 (Arm_relocate_functions::thm_jump8): New function.
5913 (Arm_relocate_functions::thm_jump11): New function.
5914 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5915 R_ARM_THM_JUMP11.
5916 (Target_arm::Scan::global): Likewise.
5917 (Target_arm::Relocate::relocate): Likewise.
5918 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5919 Likewise.
5920
5921 2010-01-14 Doug Kwan <dougkwan@google.com>
5922
5923 * arm.cc (map, utility): Include headers.
5924 (Target_arm::apply_cortex_a8_workaround): New method.
5925 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5926 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5927 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5928 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5929 the --[no-]fix-cortex-a8 command line options.
5930 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5931 (Target_arm::relocate_stub): Use addend in instruction template.
5932 * options.h (DEFINE_bool): Set the user-set flag.
5933 (General_options): Add --[no-]-fix-cortex options.
5934 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
5935 : Update fast look-up map after conversion.
5936
5937 2010-01-14 Sriraman Tallam <tmsriram@google.com>
5938
5939 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5940 in the first pass of do_layout.
5941
5942 2010-01-13 Doug Kwan <dougkwan@google.com>
5943
5944 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5945 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5946 apparent compiler problem of not folding static constant integral
5947 data members of elfcpp::Elf_sizes<32>.
5948
5949 2010-01-13 Doug Kwan <dougkwan@google.com>
5950
5951 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5952 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5953 Arm_relobj::scan_section_for_cortex_a8_erratum,
5954 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5955 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5956 sections to scan for relocation stubs into a new method
5957 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5958 relocation and Cortex-A8 stub scanning.
5959 (Target_arm::do_relax): Force stubs to be after stubbed sections
5960 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
5961 the beginning of a new relaxation pass. Update a comment.
5962 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5963
5964 2010-01-12 Ian Lance Taylor <iant@google.com>
5965
5966 * target-reloc.h (visibility_error): New inline function.
5967 (relocate_section): Call visibility_error.
5968 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5969 (MOSTLYCLEANFILES): Likewise.
5970 (protected_4_pic.o, protected_3.err): New targets.
5971 * testsuite/protected_4.cc: New file.
5972
5973 2010-01-12 Doug Kwan <dougkwan@google.com>
5974
5975 * arm.cc (Cortex_a8_reloc): New class.
5976 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5977 and cortex_a8_relocs_info_.
5978 (Target_arm::fix_cortex_a8): New method definition.
5979 (Target_arm::Cortex_a8_relocs_info): New type.
5980 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5981 New data member declarations.
5982 (Target_arm::scan_reloc_for_stub): Record information about
5983 relocations for THUMB branches that might be exempted from the
5984 Cortex-A8 workaround.
5985 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5986 at the beginning of a relaxation pass.
5987
5988 2010-01-12 Doug Kwan <dougkwan@google.com>
5989
5990 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5991 (Arm_relobj::Mapping_symbol_position,
5992 Arm_reloj::Mapping_symbol_position_less,
5993 Arm_relobj::Mapping_symbols_info): New types.
5994 (Target_arm::is_mapping_symbol_name): New method definition.
5995 (Arm_relobj::do_count_local_symbols): Save information about mapping
5996 symbols.
5997
5998 2010-01-11 Doug Kwan <dougkwan@google.com>
5999
6000 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6001 Arm_relocate_functions::thumb32_branch_upper,
6002 Arm_relocate_functions::thumb32_branch_lower,
6003 Arm_relocate_functions::thumb32_cond_branch_offset,
6004 Arm_relocate_functions::thumb32_cond_branch_upper,
6005 Arm_relocate_functions::thumb32_cond_branch_lower,
6006 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6007 branch offset encoding.
6008 (Arm_relocate_functions::thumb_branch_common): Use new branch
6009 offset encoding methods to avoid code duplication.
6010 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6011 (Stub_addend_reader::operator()): Use new branch encoding method
6012 to avoid code duplication.
6013
6014 2010-01-11 Doug Kwan <dougkwan@google.com>
6015
6016 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6017 (Target_arm::do_finalize_sections): Define special EXIDX section
6018 symbols only if referenced.
6019 * gc.h (Garbage_collection::add_reference): New method.
6020 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6021 code duplication.
6022
6023 2010-01-11 Ian Lance Taylor <iant@google.com>
6024
6025 * script.cc (Version_script_info::build_expression_list_lookup):
6026 Change complaing about duplicate wildcard match from error to
6027 warning.
6028
6029 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6030 of 2009-12-30.
6031 (Version_script_info::Version_script_info): Initialize globs_,
6032 default_version_, default_is_global_, and exact_. Don't
6033 initialize globals_ or locals_.
6034 (Version_script_info::build_lookup_tables): Build local symbols
6035 first.
6036 (Version_script_info::unquote): New function.
6037 (Version_script_info::add_exact_match): New function.
6038 (Version_script_info::build_expression_list_lookup): Remove lookup
6039 parameter. Add is_global parameter. Change all callers. Handle
6040 wildcard pattern specially. Unquote pattern. Call
6041 add_exact_match.
6042 (Version_script_info::get_name_to_match): New function.
6043 (Version_script_info::get_symbol_version): New function.
6044 (Version_script_info::get_symbol_version_helper): Remove.
6045 (Version_script_info::check_unmatched_names): Call unquote.
6046 * script.h (class Version_script_info): Change get_symbol_version
6047 to be non-inline and add is_global parameter; change all callers.
6048 Rewrite symbol_is_local. Update declarations. Define struct
6049 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6050 Remove globals_ and locals_ members. Add exact_, globs_,
6051 default_version_, is_global_.
6052 (Version_script_info::Glob): Remove pattern, add expression and
6053 is_global. Update constructor. Change all callers.
6054 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6055 default version.
6056 (Versions::symbol_section_contents): If a symbol is undefined, or
6057 defined in a dynamic object, set the version index to
6058 VER_NDX_LOCAL.
6059 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6060 symbol_is_local.
6061 (Symbol_table::add_from_pluginobj): Likewise.
6062 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6063
6064 2010-01-11 Doug Kwan <dougkwan@google.com>
6065
6066 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6067 (incremental_dump_LDADD): Add linking option for libintl.
6068 * Makefile.in: Regenerate.
6069
6070 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6071
6072 PR gold/11144
6073 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6074 instead of -Ds.
6075 * testsuite/Makefile.in: Regenerated.
6076
6077 2010-01-10 Doug Kwan <dougkwan@google.com>
6078
6079 * options.h (DEFINE_var): Use parentheses around argument varname__
6080 in macro body to avoid any unintended subsequent substitutions.
6081
6082 2010-01-10 Ian Lance Taylor <iant@google.com>
6083
6084 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6085 candidates before doing symbol resolution.
6086
6087 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6088 ODR candidates if only one is weak.
6089
6090 2010-01-08 Ian Lance Taylor <iant@google.com>
6091
6092 * script.cc (Version_script_info::build_expression_list_lookup):
6093 Don't warn about ambiguous version, just record the ambiguity.
6094 (Version_script_info::get_symbol_version_helper): Give error if
6095 version is ambiguous.
6096
6097 2010-01-08 Doug Kwan <dougkwan@google.com>
6098
6099 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6100 prev_data_size_ and prev_addralign_. Remove initializer for
6101 deleted data member has_been_changed_.
6102 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6103 to determine if the table is empty.
6104 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6105 Remove.
6106 (Stub_table::add_reloc_stub): Define method in class definition
6107 instead of just declaring it there.
6108 (Stub_table::add_cortex_a8_stub): New method definition.
6109 (Stub_table::update_data_size_and_addralign): Ditto.
6110 (Stub_table::finalize_stubs): Ditto.
6111 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6112 (Stub_table::do_addralign_): Return address alignment in the
6113 (Stub_table::do_reset_address_and_file_offset): Define method in
6114 class definition instead of declaring it there. Set current data
6115 size to be the data size of the previous pass.
6116 (Stub_table::set_final_data_size): Use current data size as the
6117 final data size.
6118 (Stub_table::relocate_stub): Change parameter type of stub from
6119 Reloc_stub pointer to Stub pointer.
6120 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6121 (Stub_table::Cortex_a8_stub_list): New typedef.
6122 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6123 Stub_table::prev_addralign_): New data member.
6124 (Arm_relobj::Arm_relobj): Initialize data member
6125 section_has_cortex_a8_workaround_.
6126 (Arm_relobj::section_has_cortex_a8_workaround,
6127 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6128 definitions.
6129 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6130 declarations.
6131 (Target_arm::relocate_stub): Change parameter type of stub from
6132 Reloc_stub pointer to Stub pointer.
6133 (Insn_template::size, Insn_template::alignment): Handle
6134 THUMB16_SPECIAL_TYPE.
6135 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6136 Stub_table::update_data_size_and_addralign,
6137 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6138 definitions.
6139 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6140 (Stub_table::do_write): Ditto.
6141 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6142
6143 2010-01-08 Ian Lance Taylor <iant@google.com>
6144
6145 PR 11108
6146 * symtab.h (class Symbol): Remove fields is_target_special_ and
6147 has_plt_offset_. Add field is_defined_in_discarded_section_.
6148 (Symbol::is_defined_in_discarded_section): New function.
6149 (Symbol::set_is_defined_in_discarded_section): New function.
6150 (Symbol::has_plt_offset): Rewrite.
6151 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6152 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6153 Don't initialize is_target_special_ or has_plt_offset_.
6154 Initialize is_defined_in_discarded_section_.
6155 (Symbol_table::add_from_relobj): If appropriate, set
6156 is_defined_in_discarded_section.
6157 * resolve.cc (Symbol::override_base_with_special): Don't test
6158 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6159 * target-reloc.h (relocate_section): Do special handling for
6160 symbols defined in discarded sections for global symbols as well
6161 as local symbols.
6162
6163 2010-01-08 Ian Lance Taylor <iant@google.com>
6164
6165 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6166 the SHT_SYMTAB case.
6167
6168 2010-01-08 Ian Lance Taylor <iant@google.com>
6169
6170 * object.cc (Sized_relobj::do_layout): Don't get confused if
6171 layout_eh_frame returns NULL.
6172
6173 2010-01-08 Ian Lance Taylor <iant@google.com>
6174
6175 PR 11084
6176 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6177 dynamic symbol table, use the normal symbol table.
6178 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6179 symbol table.
6180
6181 2010-01-08 Ian Lance Taylor <iant@google.com>
6182
6183 PR 11072
6184 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6185 sections.
6186
6187 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6188
6189 * version.cc (print_version): Change to "Copyright 2010".
6190
6191 2010-01-08 Ian Lance Taylor <iant@google.com>
6192
6193 PR 10287
6194 PR 11063
6195 * i386.cc (class Target_i386): Change return type of plt_section
6196 to be non-const.
6197 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6198 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6199 tls_desc_rel_ field.
6200 (Output_data_plt_i386::rel_tls_desc): New function.
6201 (Target_i386::rel_tls_desc_section): New function.
6202 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6203 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6204 R_386_TLS_DESC reloc in rel_tls_desc_section.
6205 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6206 Define struct Tlsdesc_info.
6207 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6208 (Target_x86_64::do_reloc_symbol_index): New function.
6209 (Target_x86_64::add_tlsdesc_info): New function.
6210 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6211 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6212 tlsdesc_rel_ field.
6213 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6214 all callers.
6215 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6216 (Target_x86_64::rela_tlsdesc_section): New function.
6217 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6218 handling.
6219 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6220 (Target_x86_64::do_reloc_addend): New function.
6221 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6222 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6223 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6224 (Output_reloc::type): New function.
6225 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6226 (Output_reloc::is_target_specific): New function.
6227 (Output_reloc::target_arg): New function.
6228 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6229 absolute relocs and target specific relocs.
6230 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6231 add_target_specific.
6232 (class Output_data_reloc) [SHT_RELA]: Likewise.
6233 * output.cc (Output_reloc::Output_reloc): Add four new versions
6234 for absolute relocs and target specific relocs.
6235 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6236 (Output_reloc::get_symbol_index): Likewise.
6237 (Output_reloc::local_section_offset): Check that local_sym_index_
6238 is not TARGET_CODE or 0.
6239 (Output_reloc::symbol_value): Likewise.
6240 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6241 reloc.
6242 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6243 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6244 functions.
6245 * layout.cc (add_target_dynamic_tags): Use output section for
6246 DT_PLTRELSZ and DT_JMPREL.
6247
6248 2010-01-07 Ian Lance Taylor <iant@google.com>
6249
6250 PR 11061
6251 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6252 function.
6253 (class Output_data_reloc_generic): Define.
6254 (class Output_data_reloc_base): Change base class to
6255 Output_data_reloc_generic. Change add() method to call
6256 bump_relative_reloc_count for a relative reloc. Remove
6257 sort_relocs_ field.
6258 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6259 to sort_relocs().
6260 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6261 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6262 appropriate.
6263 * layout.h (class Layout): Update declaration.
6264
6265 2010-01-07 Ian Lance Taylor <iant@google.com>
6266
6267 * output.h (class Output_data): Add const version of
6268 output_section and do_output_section.
6269 (class Output_section_data): Add const version of
6270 do_output_section.
6271 (class Output_section): Likewise.
6272 * layout.cc (Layout::add_target_dynamic_tags): New function.
6273 * layout.h (class Layout): Update declarations.
6274 * arm.cc (Target_arm::do_finalize_sections): Use
6275 add_target_dynamic_tags.
6276 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6277 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6278 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6279 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6280
6281 2010-01-07 Ian Lance Taylor <iant@google.com>
6282
6283 PR 11042
6284 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6285 object as needed.
6286
6287 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6288 Ian Lance Taylor <iant@google.com>
6289
6290 PR 11019
6291 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6292 Xindex::read_symtab_xindex.
6293
6294 2010-01-07 Doug Kwan <dougkwan@google.com>
6295
6296 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6297 (Insn_template::thumb16_bcond_insn): New method declaration.
6298 (Insn_template): Fix spelling.
6299 (Stub::thumb16_special): New method declaration.
6300 (Stub::do_write): Define virtual method which was previously pure
6301 virtual.
6302 (Stub::do_thumb16_special): New method declaration.
6303 (Stub::do_fixed_endian_write): New template member.
6304 (Reloc_stub::do_write): Remove.
6305 (Reloc_stub::do_fixed_endian_write): Remove.
6306 (Cortex_a8_stub): New class definition.
6307 (Stub_factory::make_cortex_a8_stub): New method definition.
6308 (Stub_factory::Stub_factory): Add missing static storage class
6309 qualifier for elf32_arm_stub_a8_veneer_blx.
6310
6311 2010-01-07 Ian Lance Taylor <iant@google.com>
6312
6313 PR 10980
6314 * options.h (class General_options): Add --warn-unresolved-symbols
6315 and --error-unresolved-symbols.
6316 * errors.cc (Errors::undefined_symbol): Implement
6317 --warn-unresolved-symbols.
6318
6319 * options.h (class General_options): Add -z text and -z textoff.
6320 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6321
6322 2010-01-06 Sriraman Tallam <tmsriram@google.com>
6323
6324 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6325 (Garbage_collection::cident_sections): New function.
6326 (Garbage_collection::add_cident_section): New function.
6327 (Garbage_collection::cident_sections_): New member.
6328 (gc_process_relocs): Add references to sections whose names are C
6329 identifiers.
6330 * gold.h (cident_section_start_prefix): New constant.
6331 (cident_section_stop_prefix): New constant.
6332 (is_cident): New function.
6333 * layout.cc (Layout::define_section_symbols): Replace string constants
6334 with the newly defined constants.
6335 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6336 C identifiers.
6337 * testsuite/Makefile.am: Add gc_orphan_section_test.
6338 * testsuite/Makefile.in: Regenerate.
6339 * testsuite/gc_orphan_section_test.cc: New file.
6340 * testsuite/gc_orphan_section_test.sh: New file.
6341
6342 2010-01-06 Ian Lance Taylor <iant@google.com>
6343
6344 PR 10980
6345 * options.h (class General_options): Add --warn-shared-textrel.
6346 * layout.cc (Layout::finish_dynamic_section): Implement
6347 --warn-shared-textrel.
6348
6349 PR 10980
6350 * options.h (class General_options): Add --warn-multiple-gp.
6351
6352 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6353
6354 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6355 $(THREADSLIB) and $(LIBDL).
6356 * Makefile.in: Rebuild.
6357
6358 2010-01-06 Ian Lance Taylor <iant@google.com>
6359
6360 PR 10980
6361 * options.cc (General_options::parse_section_start): New function.
6362 (General_options::section_start): New function.
6363 (General_options::General_options): Initialize all members.
6364 * options.h: Include <map>
6365 (class General_options): Add --section-start. Add section_starts_
6366 member.
6367 * layout.cc (Layout::attach_allocated_section_to_segment): If
6368 --section-start was used, set the address of the segment. Remove
6369 local sort_sections.
6370 (Layout::relaxation_loop_body): If the address of the load segment
6371 has been set by --section-start, don't use it.
6372 * output.h (Output_segment::update_flags_for_output_section): New
6373 function.
6374 * output.cc (Output_segment::add_output_section): Call
6375 update_flags_for_output_section.
6376
6377 2010-01-05 Ian Lance Taylor <iant@google.com>
6378
6379 PR 10980
6380 * options.h (class General_options): Add --undefined-version.
6381 * script.cc (struct Version_expression): Add was_matched_by_symbol
6382 field.
6383 (Version_script_info::matched_symbol): New function.
6384 (Version_script_info::get_symbol_version_helper): Call
6385 matched_symbol.
6386 (Version_script_info::check_unmatched_names): New function.
6387 * script.h (class Version_script_info): Update declarations.
6388 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6389
6390 * options.h (class General_options): Use DEFINE_bool_alias for
6391 allow_multiple_definition.
6392 * resolve.cc (Symbol_table::should_override): Don't test
6393 allow_multiple_definition.
6394
6395 PR 10980
6396 * options.h (class General_options): Add --cref.
6397 * main.cc (main): Print cref table if --cref. Don't close mapfile
6398 until after printing cref table.
6399 * cref.cc: Include "symtab.h".
6400 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6401 (Cref_table_compare::operator()): New function.
6402 (Cref_inputs::gather_cref): New function.
6403 (filecol): New static const.
6404 (Cref_inputs::print_cref): New function.
6405 (Cref::print_cref): New function.
6406 * cref.h: Include <cstdio>.
6407 (class Cref): Update declarations.
6408 * mapfile.h (Mapfile::file): New function.
6409 * object.h (class Object): Define Symbols. Declare virtual
6410 do_get_global_symbols.
6411 (Object::get_global_symbols): New function.
6412 * object.cc (Input_objects::add_object): Pass object to cref_ if
6413 --cref.
6414 (Input_objects::archive_start): Likewise.
6415 (Input_objects::archive_stop): Likewise.
6416 (Input_objects::print_cref): New function.
6417 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6418 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6419 --cref.
6420 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6421 function.
6422 * plugin.h (class Sized_pluginobj): Update declarations.
6423
6424 2010-01-05 Ian Lance Taylor <iant@google.com>
6425
6426 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6427 to is_default_version. Rename insdef to insdefault.
6428 (Symbol_table::add_from_relobj): Rename def to is_default_version
6429 and local to is_forced_local.
6430 (Symbol_table::add_from_pluginobj): Likewise.
6431 (Symbol_table::add_from_dynobj): Likewise.
6432 (Symbol_table::define_special_symbol): Rename insdef to
6433 insdefault.
6434
6435 2010-01-04 Ian Lance Taylor <iant@google.com>
6436
6437 PR 10980
6438 * options.h (class General_options): Add
6439 --allow-multiple-definition and -z muldefs.
6440 * resolve.cc (Symbol_table::should_override): Don't warn about a
6441 multiple symbol definition if --allow-multiple-definition or -z
6442 muldefs.
6443
6444 PR 10980
6445 * options.h (class General_options): Add --add-needed and
6446 --copy-dt-needed-entries. Tweak --as-needed help entry.
6447 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6448 error if --copy-dt-needed-entries aka --add-needed is used and
6449 would cause a change in behaviour.
6450
6451 PR 10980
6452 * options.h (class General_options): Add -G as a short version of
6453 --shared. Add no-op options -assert, -g, and -i.
6454
6455 2010-01-04 Sriraman Tallam <tmsriram@google.com>
6456
6457 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6458 check for .text or .gnu.linkonce.t sections.
6459 * icf.cc (Icf::find_identical_sections): Ditto.
6460 Change the detection for mangled function name within the section
6461 name.
6462 * icf.h (is_section_foldable_candidate): New function.
6463
6464 2009-12-30 Ian Lance Taylor <iant@google.com>
6465
6466 PR 10980
6467 * options.h (class General_options): Permit two dashes with
6468 --retain-symbols-file.
6469
6470 2009-12-30 Ian Lance Taylor <iant@google.com>
6471
6472 PR 10979
6473 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6474 don't put the file header and segment headers in the text
6475 segment.
6476
6477 PR 10979
6478 * common.cc (Sort_commons::operator()): Stabilize sort when both
6479 entries are NULL.
6480 (Symbol_table::do_allocate_commons_list): When allocating common
6481 symbols, skip a symbol which is no longer common.
6482 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6483 an object before checking its type.
6484 * testsuite/common_test_2.c: New file.
6485 * testsuite/common_test_3.c: New file.
6486 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6487 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6488 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6489 (common_test_2_pic.o, common_test_2.so): New targets.
6490 (common_test_3_pic.o, common_test_3.so): New targets.
6491 * testsuite/Makefile.in: Rebuild.
6492
6493 PR 10979
6494 * script.cc (read_input_script): If we see a new SECTIONS clause,
6495 and we have added an input section, give an error.
6496 * layout.h (class Layout): Add have_added_input_section function.
6497 Add have_added_input_section_ field.
6498 * layout.cc (Layout::Layout): Initialize
6499 have_added_input_section_.
6500 (Layout::layout): Set have_added_input_section_.
6501 (Layout::layout_eh_frame): Likewise.
6502
6503 2009-12-30 Ian Lance Taylor <iant@google.com>
6504
6505 PR 10931
6506 * options.h (class General_options): Add --sort-common option.
6507 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6508 * common.cc (Sort_common): Add sort_order parameter to
6509 constructor. Add sort_order_ field.
6510 (Sort_commons::operator): Check sort_order_.
6511 (Symbol_table::allocate_commons): Determine the sort order.
6512 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6513 Change all callers.
6514 (Symbol_table::do_allocate_commons_list): Likewise.
6515
6516 2009-12-30 Ian Lance Taylor <iant@google.com>
6517
6518 PR 10916
6519 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6520 symbols from this object, don't change the visibility of an
6521 undefined symbol.
6522 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6523
6524 2009-12-30 Ian Lance Taylor <iant@google.com>
6525
6526 PR 10861
6527 * script.h (class Version_script_info): Define Language enum.
6528 Update declarations. Define Glob, Exact, and Lookup types. Add
6529 new fields globals_, locals_, and is_finalized_.
6530 * script.cc: Various formatting fixes.
6531 (class Parser_closure): Change language_stack_ from a vector of
6532 std::string to one of Version_script_info::Language. Adjust all
6533 uses accordingly.
6534 (class Lazy_demangler): Remove.
6535 (struct Version_expression): Change language from std::string to
6536 Version_script_info::Language.
6537 (Version_script_info::Version_script_info): New function.
6538 (Version_script_info::~Version_script_info): Don't call clear.
6539 (Version_script_info::finalize): New function.
6540 (Version_script_info::build_lookup_tables): New function.
6541 (Version_script_info::build_expression_list_lookup): New
6542 function.
6543 (Version_script_info::get_symbol_version_helper): Rewrite to use
6544 lookup tables.
6545 (Version_script_info::print_expression_list): Adjust to use
6546 Version_script_info::Language.
6547 (script_push_lex_into_version_mode): Check that the version script
6548 has not been finalized.
6549 (version_script_push_lang): Change language string to
6550 Version_script_info::Language.
6551 * options.cc (Command_line::version_script): New function.
6552 * options.h (class General_options): Add finalize_dynamic_list
6553 function. Change version_script from declaration to definition.
6554 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6555 * testsuite/version_script.map: Remove duplicate def of foo.
6556 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6557 version_script.map.
6558 * testsuite/Makefile.in: Rebuild.
6559
6560 2009-12-30 Ian Lance Taylor <iant@google.com>
6561
6562 PR 10843
6563 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6564 if the input symbol index is 0, make the output symbol index 0.
6565
6566 2009-12-30 Ian Lance Taylor <iant@google.com>
6567
6568 PR 10670
6569 * options.h (class General_options): Add -x/--discard-all.
6570 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6571 --discard-all. If the local symbol needs a dynamic entry, check
6572 that before handling --discard-locals.
6573
6574 2009-12-30 Ian Lance Taylor <iant@google.com>
6575
6576 PR 10450
6577 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6578 flags to PF_R.
6579 (Output_segment::add_output_section): Don't change the flags if
6580 the type is PT_TLS.
6581
6582 PR 10450
6583 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6584 GNU hash table if they need a dynamic value. Otherwise, don't add
6585 them if they are defined in a dynamic object or are forced local.
6586
6587 2009-12-29 Ian Lance Taylor <iant@google.com>
6588
6589 PR 10450
6590 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6591 .gnu.hash table for a 32-bit target.
6592
6593 PR 10450
6594 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6595 regular and a dynamic object only needs a dynamic symbol table
6596 entry if it is externally visible.
6597
6598 PR 10450
6599 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6600 constructor. Add global_offset_table_ field.
6601 (Target_i386::got_section): Set global_offset_table_.
6602 (Target_i386::do_finalize_sections): Set global_offset_table_
6603 size.
6604 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6605 in constructor. Add global_offset_table_ field.
6606 (Target_x86_64::got_section): Set global_offset_table_.
6607 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6608 size.
6609
6610 * layout.cc (Layout::Layout): Initialize increase_relro_.
6611 (Layout::get_output_section): Add is_relro, is_last_relro, and
6612 is_first_non_relro parameters. Change all callers.
6613 (Layout::choose_output_section): Likewise.
6614 (Layout::add_output_section_data): Likewise.
6615 (Layout::make_output_section): Likewise.
6616 (Layout::set_segment_offsets): Clear increase_relro when using a
6617 linker script.
6618 * layout.h (class Layout): Add increase_relro method. Add
6619 increase_relro_ field. Update declarations.
6620 * output.cc (Output_section::Output_section): Initialize
6621 is_last_relro_ and is_first_non_relro_.
6622 (Output_segment::add_output_section): Group relro sections is
6623 do_sort is true. Handle is_last_relro and is_first_non_relro.
6624 (Output_segment::maximum_alignment): Remove relro handling.
6625 (Output_segment::set_section_addresses): Add increase_relro
6626 parameter. Change all callers. Add initial alignment to align
6627 relro sections on separate page. Remove old relro handling.
6628 (Output_segment::set_section_list_addresses): Remove in_relro
6629 parameter. Change all callers.
6630 (Output_segment::set_offset): Add increase parameter. Change all
6631 callers. Remove old relro handling.
6632 * output.h (class Output_section): Add new methods: is_last_relro,
6633 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6634 Add is_last_relro_ and is_first_non_relro_ fields.
6635 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6636 Create separate .got.plt section. Call increase_relro.
6637 * x86_64.cc (Target_x86_64::got_section): Likewise.
6638 * testsuite/relro_script_test.t: Add .got.plt.
6639
6640 PR 10450
6641 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6642 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6643 (Layout::finalize): Call set_dynamic_symbol_size.
6644 (Layout::set_dynamic_symbol_size): New function.
6645 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6646 set_dynamic_symbol_size.
6647
6648 PR 10450
6649 * output.h (class Output_section): Add is_entsize_zero_ field.
6650 * output.cc (Output_section::Output_section): Initialize
6651 is_entsize_zero_.
6652 (Output_section::set_entsize): If two different entsizes are
6653 requested, force it to zero.
6654 (Output_section::add_input_section): Set flags for .debug_str
6655 before updating section flags. Set entsize.
6656 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6657 and SHF_STRING if all input sections have those flags.
6658
6659 2009-12-29 Rafael Espindola <espindola@google.com>
6660
6661 * main.cc (main): Fix the sys time reporting.
6662 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6663 reporting.
6664
6665 2009-12-29 Sriraman Tallam <tmsriram@google.com>
6666
6667 * options.cc (General_options::parse_version): Allow -v to exit
6668 without an error if there is nothing to link.
6669
6670 2009-12-29 Ian Lance Taylor <iant@google.com>
6671
6672 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6673 using a version of gcc before 4.1.
6674 * configure: Rebuild.
6675
6676 2009-12-28 Chris Demetriou <cgd@google.com>
6677
6678 * attributes.cc (Output_attributes_section_data::do_write): Use
6679 std::vector::front rather than std::vector::data.
6680
6681 2009-12-28 Ian Lance Taylor <iant@google.com>
6682
6683 * symtab.h (class Symbol_table): Add enum Defined.
6684 * resolve.cc (Symbol_table::should_override): Add defined
6685 parameter. Change all callers. Test whether object is NULL
6686 before calling a method on it.
6687 (Symbol_table::report_resolve_problem): Add defined parameter.
6688 Change all callers.
6689 (Symbol_table::should_override_with_special): Likewise.
6690 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6691 parameter. Change all callers.
6692 (Symbol_table::do_define_in_output_data): Likewise.
6693 (Symbol_table::define_in_output_segment): Likewise.
6694 (Symbol_table::do_define_in_output_segment): Likewise.
6695 (Symbol_table::define_as_constant): Likewise.
6696 (Symbol_table::do_define_as_constant): Likewise.
6697 * script.h (class Symbol_assignment): Add is_defsym parameter to
6698 constructor; change all callers.
6699 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6700 parameter. Change all callers. Add is_defsym_ field.
6701 (class Parser_closure): Add parsing_defsym parameter to
6702 constructor; change all callers. Add parsing_defsym accessor
6703 function. Add parsing_defsym_ field.
6704
6705 2009-12-28 Ian Lance Taylor <iant@google.com>
6706
6707 * gold.cc (queue_middle_tasks): Fix formatting.
6708 * object.cc (Relobj::is_section_name_included): Likewise.
6709
6710 2009-12-23 Ian Lance Taylor <iant@google.com>
6711
6712 * i386.cc (Target_i386::do_calls_non_split): Recognize
6713 -fsplit-stack prologue for a function with a static chain.
6714 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6715 -fsplit-stack prologue when using %r11.
6716
6717 2009-12-21 Sriraman Tallam <tmsriram@google.com>
6718
6719 * options.cc (General_options::parse_version): Make -v continue and do
6720 the link like GNU ld does.
6721
6722 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
6723
6724 * Makefile.am (CCFILES): Add timer.cc.
6725 (HFILES): Add timer.h.
6726 * configure.ac: Check for sysconf and times.
6727 * main.cc: include timer.h.
6728 (main): Use Timer instead of get_run_time.
6729 * timer.cc: New.
6730 * timer.h: New.
6731 * workqueue.cc: include timer.h.
6732 (Workqueue::find_and_run_task):
6733 Report user, sys and wall time.
6734 * Makefile.in: Regenerate.
6735 * config.in: Regenerate.
6736 * configure: Regenerate.
6737
6738 2009-12-16 Doug Kwan <dougkwan@google.com>
6739
6740 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6741 sections.
6742 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6743 relaxed input sections.
6744 * output.cc (Output_section::find_relaxed_input_section): Change
6745 return type to Output_relaxed_input_section pointer. Adjust code
6746 for new type of relaxed_input_section_map_.
6747 * output.h (Output_section::find_relaxed_input_section): Change
6748 return type to Output_relaxed_input_section pointer.
6749 (Output_section::Output_relaxed_input_section_by_input_section_map):
6750 New type.
6751 (Output_section::relaxed_input_section_map_): Change type to
6752 Output_section::Output_relaxed_input_section_by_input_section_map.
6753 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6754 input section.
6755
6756 2009-12-15 Ian Lance Taylor <iant@google.com>
6757
6758 * layout.cc (Layout::create_shstrtab): Only write out after input
6759 sections if we are compressing debug sections.
6760
6761 2009-12-15 Ian Lance Taylor <iant@google.com>
6762
6763 * archive.cc (Archive::add_symbols): Only look up a symbol without
6764 a version if there is, in fact, a version.
6765
6766 2009-12-14 Ian Lance Taylor <iant@google.com>
6767
6768 Revert -Wshadow changes, all changes from:
6769 2009-12-11 Doug Kwan <dougkwan@google.com>
6770 2009-12-11 Nick Clifton <nickc@redhat.com>
6771 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6772
6773 2009-12-11 Doug Kwan <dougkwan@google.com>
6774
6775 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6776 due to -Wshadow.
6777 * attributes.cc (Object_attribute::size): Ditto.
6778 (Attributes_section_data::size): Ditto.
6779 (Attributes_section_data::Attributes_section_data): Ditto.
6780 (Output_attributes_section_data::do_write): Ditto.
6781 * attributes.h (Object_attribute::set_type): Ditto.
6782 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6783
6784 2009-12-11 Nick Clifton <nickc@redhat.com>
6785
6786 * archive.cc: Fix shadowed variable warnings.
6787 * arm.cc: Likewise.
6788 * compressed_output.cc: Likewise.
6789 * compressed_output.h: Likewise.
6790 * configure: Likewise.
6791 * dwarf_reader.cc: Likewise.
6792 * dynobj.cc: Likewise.
6793 * dynobj.h: Likewise.
6794 * ehframe.cc: Likewise.
6795 * ehframe.h: Likewise.
6796 * errors.cc: Likewise.
6797 * expression.cc: Likewise.
6798 * fileread.cc: Likewise.
6799 * fileread.h: Likewise.
6800 * freebsd.h: Likewise.
6801 * i386.cc: Likewise.
6802 * icf.cc: Likewise.
6803 * incremental.h: Likewise.
6804 * layout.cc: Likewise.
6805 * layout.h: Likewise.
6806 * mapfile.cc: Likewise.
6807 * merge.cc: Likewise.
6808 * merge.h: Likewise.
6809 * object.cc: Likewise.
6810 * object.h: Likewise.
6811 * options.h: Likewise.
6812 * output.cc: Likewise.
6813 * output.h: Likewise.
6814 * parameters.cc: Likewise.
6815 * plugin.cc: Likewise.
6816 * powerpc.cc: Likewise.
6817 * reduced_debug_output.cc: Likewise.
6818 * reduced_debug_output.h: Likewise.
6819 * reloc.cc: Likewise.
6820 * reloc.h: Likewise.
6821 * resolve.cc: Likewise.
6822 * script-sections.cc: Likewise.
6823 * script.cc: Likewise.
6824 * script.h: Likewise.
6825 * sparc.cc: Likewise.
6826 * symtab.cc: Likewise.
6827 * symtab.h: Likewise.
6828 * target-select.cc: Likewise.
6829 * target-select.h: Likewise.
6830 * token.h: Likewise.
6831 * workqueue.cc: Likewise.
6832 * workqueue.h: Likewise.
6833 * x86_64.cc: Likewise.
6834
6835 2009-12-10 Doug Kwan <dougkwan@google.com>
6836
6837 * arm.cc (attributes.h): New include.
6838 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6839 (Arm_relobj::~Arm_relobj): Delete object pointed by
6840 attributes_section_data_.
6841 (Arm_relobj::attributes_section_data): New method definition.
6842 (Arm_relobj::attributes_section_data_): New data member declaration.
6843 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6844 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6845 attributes_section_data_.
6846 (Arm_dynobj::attributes_section_data): New method definition.
6847 (Arm_dynobj::attributes_section_data_): New data member declaration.
6848 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6849 initialization value of may_use_blx_ to false.
6850 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6851 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6852 object attributes to compute results instead of hard-coding.
6853 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6854 Target_arm::get_secondary_compatible_arch,
6855 Target_arm::set_secondary_compatible_arch
6856 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6857 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6858 New method declarations.
6859 (Target_arm::get_aeabi_object_attribute): New method definition.
6860 (Target_arm::attributes_section_data_): New data member declaration.
6861 (read_arm_attributes_section): New template definition.
6862 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6863 (Arm_dynobj::do_read_symbols): Ditto.
6864 (Target_arm::do_finalize_sections): Merge attributes sections from
6865 input. Check for BLX use after attributes section merging.
6866 Fix __exidx_start and __exidx_end visibility. Create an
6867 .ARM.attributes section if necessary.
6868 (Target_arm::get_secondary_compatible_arch,
6869 Target_arm::set_secondary_compatible_arch,
6870 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6871 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
6872 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
6873 New method definitions.
6874
6875 2009-12-09 Ian Lance Taylor <iant@google.com>
6876
6877 * plugin.cc (Plugin::load): Don't cast from void* to a function
6878 pointer.
6879
6880 2009-12-09 Ian Lance Taylor <iant@google.com>
6881
6882 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6883 information fields.
6884
6885 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6886
6887 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6888 Replace two_file_shared_1.so with two_file_shared_2.so.
6889 * testsuite/Makefile.in: Regenerated.
6890
6891 2009-12-08 Doug Kwan <dougkwan@google.com>
6892
6893 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6894 (HFILES): Add attributes.h and int_encoding.h.
6895 * Makefile.in: Regenerate.
6896 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6897 function definitions to int_encoding.cc
6898 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6899 prototypes to int_encoding.h
6900 * reduced_debug_output.cc (int_encoding.h): New include.
6901 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6902 function definitions to int_encoding.cc
6903 (insert_into_vector, read_from_pointer): Move template definitions to
6904 int_encoding.h
6905 * attributes.cc: New file.
6906 * attributes.h: New file.
6907 * int_encoding.cc: New file.
6908 * int_encoding.h: New file.
6909
6910 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
6911
6912 PR gold/11055
6913 * incremental-dump.cc (dump_incremental_inputs): New.
6914 (main): Use dump_incremental_inputs.
6915
6916 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6917
6918 PR gold/10893
6919 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6920 checking elfcpp::STT_FUNC.
6921 (Target_i386::Relocate::relocate): Likewise.
6922 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6923
6924 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6925 symbols from shared libraries into normal FUNC symbols.
6926
6927 * symtab.h (Symbol): Add is_func and use it.
6928
6929 2009-12-05 Doug Kwan <dougkwan@google.com>
6930
6931 * arm.cc (Target_arm::arm_info): Initialize new fields
6932 attributes_section and attributes_vendor.
6933 * i386.cc (Target_i386::i386_info): Same.
6934 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6935 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6936 fields attributes_section and attributes_vendor.
6937 * sparc.cc (Target_sparc::sparc_info): Same.
6938 * target.h (Target::attributes_section, Target::attributes_vendor,
6939 Target::is_attributes_section, Target::attribute_arg_type,
6940 Target::attributes_order): New method definitions.
6941 (Target::Target_info::attributes_section,
6942 Target::Target_info::attributes_vendor): New fields.
6943 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6944 virtual method definitions.
6945 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6946 attributes_section and attributes_vendor.
6947 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6948
6949 2009-12-05 Doug Kwan <dougkwan@google.com>
6950
6951 * arm.cc: Update comments about interworking and stub generation.
6952 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6953 considered as non-PIC.
6954 (Arm_relocate_functions::base_abs): Fix formatting.
6955 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6956 of function to use GOT entry address instead of offset.
6957 (Target_arm::Scan::global): Issue an error if a symbol would need a
6958 PLT does not get one because it is untyped. Remove code to create
6959 dynamic symbols for relative branches.
6960 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6961 takes unsigned integer instead of boolean.
6962
6963 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6964
6965 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6966 (two_file_test_LDADD): Likewise.
6967 (common_test_1_LDADD): Likewise.
6968 (exception_test_LDADD) Likewise.
6969 (weak_test_LDADD): Likewise.
6970 (many_sections_test_LDADD): Likewise.
6971 (initpri1_LDADD): Likewise.
6972 (script_test_1_LDADD): Likewise.
6973 (script_test_2_LDADD): Likewise.
6974 (justsyms_LDADD): Likewise.
6975 (binary_test_LDADD): Likewise.
6976 (large_LDADD): Likewise.
6977 * testsuite/Makefile.in: Regenerated.
6978
6979 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
6980
6981 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6982 (Symbol_table::override_with_special): Likewise.
6983 (Symbol_table::add_from_object): Likewise.
6984
6985 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6986
6987 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6988 Don't set the data_offset twice.
6989
6990 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6991
6992 * testsuite/Makefile.in: Regenerate.
6993
6994 2009-12-03 Doug Kwan <dougkwan@google.com>
6995
6996 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6997 (Target_arm::do_finalize_sections): Add parameter for symbol table
6998 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6999 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7000 parameter for symbol table pointer.
7001 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7002 an additional parameter for a pointer to symbol table.
7003 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7004 parameter for a symbol table pointer.
7005 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7006 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7007 Ditto.
7008 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7009 parameter for a symbol table pointer.
7010
7011 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
7012
7013 * incremental.cc (Incremental_inputs_header)
7014 (Incremental_inputs_header_write, Incremental_inputs_entry)
7015 (Incremental_inputs_entry_write): Move ...
7016 * incremental.h (Incremental_inputs_header)
7017 (Incremental_inputs_header_write, Incremental_inputs_entry)
7018 (Incremental_inputs_entry_write): here.
7019
7020 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7021
7022 * incremental.cc (make_sized_incremental_binary): Set the target.
7023 Error if it is incompatible.
7024 * output.h (Output_file): Add filename method.
7025
7026 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7027
7028 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7029 from the get_* methods.
7030
7031 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7032
7033 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7034 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7035 Write 0 for the data_offset of scripts.
7036
7037 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
7038
7039 * testsuite/Makefile.am: Add the incremental_test.sh test.
7040 * testsuite/incremental_test.sh: New.
7041 * testsuite/incremental_test_1.c: New.
7042 * testsuite/incremental_test_2.c: New.
7043
7044 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
7045
7046 * incremental-dump.cc (main): Fix typos.
7047
7048 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
7049
7050 PR gold/11025
7051 * incremental-dump.cc (main): Use llu to print 64 bit values.
7052
7053 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7054 H.J. Lu <hongjiu.lu@intel.com>
7055
7056 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7057 $(LIBDL).
7058 (incremental_dump_LDADD): Likewise.
7059 * Makefile.in: Regenerated.
7060
7061 2009-11-25 Doug Kwan <dougkwan@google.com>
7062
7063 Revert:
7064
7065 2009-11-25 Doug Kwan <dougkwan@google.com>
7066
7067 * arm.cc (Target_arm::Target_arm): Move method definition
7068 outside of class definition. Add code to handle
7069 --target1-rel, --target1-abs and --target2= options.
7070 (Target_arm::get_reloc_reloc_type): Change method to be
7071 non-static and const.
7072 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7073 New data member declaration.
7074 (Target_arm::Scan::local, Target_arm::Scan::global,
7075 Target_arm::Relocate::relocate,
7076 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7077 Adjust call to Target_arm::get_real_reloc_type.
7078 (Target_arm::get_real_reloc_type): Use command line options
7079 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7080 * options.h (--target1-rel, --target1-abs, --target2): New
7081 ARM-only options.
7082
7083 2009-11-25 Doug Kwan <dougkwan@google.com>
7084
7085 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7086 class definition. Add code to handle --target1-rel, --target1-abs
7087 and --target2= options.
7088 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7089 and const.
7090 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7091 member declaration.
7092 (Target_arm::Scan::local, Target_arm::Scan::global,
7093 Target_arm::Relocate::relocate,
7094 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7095 call to Target_arm::get_real_reloc_type.
7096 (Target_arm::get_real_reloc_type): Use command line options to
7097 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7098 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7099 options.
7100
7101 2009-11-25 Doug Kwan <dougkwan@google.com>
7102
7103 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7104 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7105 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7106 formatting.
7107 (Arm_relocate_functions::thm_call): Replace body with a call to
7108 Arm_relocate_functions::thumb_branch_common.
7109 (Arm_relocate_functions::thm_jump24,
7110 Arm_relocate_functions::thm_xpc22): New method definitions.
7111 (Arm_relocate_functions::thumb_branch_common): New method definition.
7112 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7113 operator.
7114 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7115 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7116
7117 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7118
7119 * Makefile.am: Build incremental-dump
7120 * Makefile.in: Regenerate.
7121 * incremental-dump.cc: New.
7122 * incremental.cc (Incremental_inputs_header_data,
7123 Incremental_inputs_entry_data): Move to incremental.h
7124 * incremental.h: (Incremental_inputs_header_data,
7125 Incremental_inputs_entry_data): Move from incremental.cc
7126
7127 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7128
7129 * incremental.cc (Incremental_inputs_header,
7130 Incremental_inputs_header_write, Incremental_inputs_entry,
7131 Incremental_inputs_entry_write): Add a typedef with the data type.
7132
7133 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7134
7135 * incremental.cc (Incremental_inputs_header,
7136 Incremental_inputs_header_write, Incremental_inputs_entry,
7137 Incremental_inputs_entry_write): Update comment about which
7138 type has the filed descriptions.
7139
7140 2009-11-15 Doug Kwan <dougkwan@google.com>
7141
7142 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7143 (Arm_relocate_functions::arm_branch_common): Change method defintion
7144 in class definition to a method declaration and update list of formal
7145 parameters.
7146 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7147 Arm_relocation_functions::jump24): Adjust call to
7148 Arm_relocate_functions::arm_branch_common. Update list of formal
7149 parameters.
7150 (Arm_relocate_functions::xpc25): New method definition.
7151 (Arm_relocate_functions::arm_branch_common): Move method defintion
7152 out from class definition. Use stubs for mode-switching and extending
7153 branch ranges.
7154 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7155 specially. Change code to enable use of stubs in ARM branches.
7156
7157 2009-11-10 Doug Kwan <dougkwan@google.com>
7158
7159 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7160 in method declaration.
7161 (Target_arm::relocate_stub): New method declaration.
7162 (Target_arm::default_target): Change to return a pointer instead of
7163 a const reference.
7164 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7165 Target_arm::default_target.
7166 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7167 method definition.
7168 (Target_arm::relocate_section): Adjust view.
7169 (Target_arm::relocate_stub): New method definition.
7170
7171 2009-11-10 Doug Kwan <dougkwan@google.com>
7172
7173 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7174 a format warning.
7175 * incremental.cc (open_incremental_binary): Initialized local
7176 variables to avoid warnings.
7177 * object.cc (make_elf_object): Ditto.
7178 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7179 a format warning.
7180
7181 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7182
7183 PR gold/10930
7184 * testsuite/plugin_test.c: Include "config.h".
7185
7186 2009-11-09 Doug Kwan <dougkwan@google.com>
7187
7188 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7189 (arm_symbol_value): Remove.
7190 (Arm_relocate_functions::arm_branch_common,
7191 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7192 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7193 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7194 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7195 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7196 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7197 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7198 Arm_relocate_functions::thm_mobw_abs_nc,
7199 Arm_relocate_functions::thm_mov_abs,
7200 Arm_relocate_functions::movw_prel_nc,
7201 Arm_relocate_functions::thm_movt_abs,
7202 Arm_relocate_functions::movt_prel,
7203 Arm_relocate_functions::thm_movw_prel_nc,
7204 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7205 (Target_arm::Relocate::relocate): Only decompose address into two
7206 parts if relocation type uses the thumb-bit and pass the actual
7207 bit instead of a flag indicating that the thumb-bit is used. Adjust
7208 calls to methods in Arm_relocate_functions for this change.
7209
7210 2009-11-08 Ian Lance Taylor <iant@google.com>
7211
7212 PR 10925
7213 * reloc.cc: Instantiate
7214 Sized_relobj::initialize_input_to_output_maps and
7215 Sized_relobj:free_input_to_output_maps.
7216
7217 2009-11-06 Ian Lance Taylor <iant@google.com>
7218
7219 PR 10876
7220 * defstd.cc (in_segment): Set only_if_ref true for "end".
7221
7222 2009-11-06 Doug Kwan <dougkwan@google.com>
7223
7224 * arm.cc (class Reloc_stub): Correct a comment.
7225 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7226 (Target_arm::scan_section_for_stubs): New method declaration.
7227 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7228 Change methods from private to protected.
7229 (Target_arm::do_may_relax): New method definition.
7230 (Target_arm::do_relax, Target_arm::group_sections,
7231 Target_arm::scan_reloc_for_stub,
7232 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7233 (Target_arm::arm_input_section_map_): New data member declaration.
7234 (Target_arm::scan_reloc_for_stub,
7235 Target_arm::scan_reloc_section_for_stubs,
7236 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7237 Target_arm::do_relax): New method definitions.
7238
7239 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7240
7241 * configure.ac: Check for (struct stat)::st_mtim
7242 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7243 * config.in: Regenerate.
7244 * configure: Regenerate.
7245
7246 2009-11-05 Ian Lance Taylor <iant@google.com>
7247
7248 PR 10910
7249 * output.cc (Output_segment::add_output_section): Add missing
7250 return statement.
7251
7252 2009-11-04 Ian Lance Taylor <iant@google.com>
7253
7254 PR 10880
7255 * object.h (class Object): Add is_needed and set_is_needed
7256 methods. Add is_needed_ field. Make bool fields into bitfields.
7257 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7258 defined in a dynamic object and referenced by a regular object,
7259 set is_needed for the dynamic object.
7260 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7261 if the file is marked with as_needed and it is not needed.
7262
7263 2009-11-04 Ian Lance Taylor <iant@google.com>
7264
7265 PR 10887
7266 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7267 tags if data is discarded by linker script.
7268 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7269 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7270 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7271 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7272
7273 2009-11-04 Ian Lance Taylor <iant@google.com>
7274
7275 * layout.cc (Layout::get_output_section): Add is_interp and
7276 is_dynamic_linker_section parameters. Change all callers.
7277 (Layout::choose_output_section): Likewise.
7278 (Layout::make_output_section): Likewise.
7279 (Layout::add_output_section_data): Add is_dynamic_linker_section
7280 parameter. Change all callers.
7281 * layout.h (class Layout): Update declarations.
7282 * output.h (class Output_section): Add is_interp, set_is_interp,
7283 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7284 Add is_interp_, is_dynamic_linker_section_ fields. Change
7285 generate_code_fills_at_write_ to a bitfield.
7286 * output.cc (Output_section::Output_sections): Initialize new
7287 fields.
7288 (Output_segment::add_output_section): Add do_sort parameter.
7289 Change all callers.
7290
7291 2009-11-03 Ian Lance Taylor <iant@google.com>
7292
7293 PR 10860
7294 * options.h (class General_options): Add --warn-common.
7295 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7296 merging two common symbols.
7297 (Symbol_table::should_override): Handle --warn-common when merging
7298 a common symbol with a defined symbol. Use report_resolve_problem
7299 for multiple definitions.
7300 (Symbol_table::report_resolve_problem): New function.
7301 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7302
7303 2009-11-03 Doug Kwan <dougkwan@google.com>
7304
7305 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7306 stub_factory_.
7307 (Target_arm::stub_factory): New method definition.
7308 (Target_arm::new_arm_input_section,
7309 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7310 Target_arm::reloc_uses_thumb_bit): New method declarations.
7311 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
7312 New type definitions.
7313 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7314 member declarations.
7315 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7316 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7317 New method definitions.
7318
7319 2009-11-03 Ian Lance Taylor <iant@google.com>
7320
7321 * options.h (class General_options): Add --warn_constructors.
7322
7323 2009-11-03 Ian Lance Taylor <iant@google.com>
7324
7325 PR 10893
7326 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7327 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7328
7329 2009-11-03 Ian Lance Taylor <iant@google.com>
7330
7331 PR 10895
7332 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7333 --msgid-bugs-address.
7334 (install-pdf): New target.
7335 (install-data_yes): Look up one directory to find mkinstalldirs.
7336
7337 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7338
7339 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7340 tree.
7341
7342 2009-10-30 Doug Kwan <dougkwan@google.com>
7343
7344 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7345
7346 2009-10-30 Doug Kwan <dougkwan@google.com>
7347
7348 * arm.cc (Stub_addend_reader): New struct template definition
7349 and partial specializations.
7350 (Stub_addend_reader::operator()): New method definition for a
7351 partially specialized template.
7352
7353 2009-10-30 Doug Kwan <dougkwan@google.com>
7354
7355 * arm.cc (Arm_relobj::processor_specific_flags): New method
7356 definition.
7357 (Arm_relobj::do_read_symbols): New method declaration.
7358 (Arm_relobj::processor_specific_flags_): New data member declaration.
7359 (Arm_dynobj): New class definition.
7360 (Target_arm::do_finalize_sections): Add input_objects parameter.
7361 (Target_arm::do_adjust_elf_header): New method declaration.
7362 (Target_arm::are_eabi_versions_compatible,
7363 (Target_arm::merge_processor_specific_flags): New method declaration.
7364 (Target_arm::do_make_elf_object): New overloaded method definitions
7365 and declaration.
7366 (Arm_relobj::do_read_symbols): New method definition.
7367 (Arm_dynobj::do_read_symbols): Ditto.
7368 (Target_arm::do_finalize_sections): Add input_objects parameters.
7369 Merge processor-specific flags from all input objects.
7370 (Target_arm::are_eabi_versions_compatible,
7371 Target_arm::merge_processor_specific_flags,
7372 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7373 New method definitions.
7374 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7375 Input_objects pointer type parameter.
7376 * layout.cc (Layout::finalize): Pass input objects to target's.
7377 finalize_sections function.
7378 * output.cc (Output_file_header::do_sized_write): Set ELF file
7379 header's processor-specific flags.
7380 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7381 Input_objects pointer type parameter.
7382 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7383 * target.h (Input_objects): New forward class declaration.
7384 (Target::processor_specific_flags,
7385 Target::are_processor_specific_flags_sect): New method definitions.
7386 (Target::finalize_sections): Add input_objects parameter.
7387 (Target::Target): Initialize processor_specific_flags_ and
7388 are_processor_specific_flags_set_.
7389 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7390 parameter.
7391 (Target::set_processor_specific_flags): New method definition.
7392 (Target::processor_specific_flags_,
7393 Target::are_processor_specific_flags_set_): New data member
7394 declarations.
7395 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7396 Input_objects pointer type parameter.
7397
7398 2009-10-30 Doug Kwan <dougkwan@google.com>
7399
7400 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7401
7402 2009-10-28 Ian Lance Taylor <iant@google.com>
7403
7404 * object.h (class Relobj): Drop options parameter from
7405 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7406 do_scan_relocs, do_relocate. Change all callers.
7407 (class Sized_relobj): Drop options parameters from
7408 do_gc_process_relocs, do_scan_relocs, do_relocate,
7409 do_relocate_sections, relocate_sections, emit_relocs_scan,
7410 emit_relocs_scan_reltype. Change all callers.
7411 (struct Relocate_info): Remove options field and all references to
7412 it.
7413 * reloc.h (class Read_relocs): Remove options constructor
7414 parameter and options_ field. Change all callers.
7415 (class Gc_process_relocs, class Scan_relocs): Likewise.
7416 (class Relocate_task): Likewise.
7417 * target-reloc.h (scan_relocs): Remove options parameter. Change
7418 all callers.
7419 (scan_relocatable_relocs): Likewise.
7420 * target.h (class Sized_target): Remove options parameter from
7421 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7422 all callers.
7423 * gc.h (gc_process_relocs): Remove options parameter. Change all
7424 callers.
7425 * arm.cc: Update functions to remove options parameters.
7426 * i386.cc: Likewise.
7427 * powerpc.cc: Likewise.
7428 * sparc.cc: Likewise.
7429 * x86_64.cc: Likewise.
7430 * testsuite/testfile.cc: Likewise.
7431
7432 2009-10-28 Doug Kwan <dougkwan@google.com>
7433
7434 * arm.cc (Arm_relobj): New class definition.
7435 (Arm_relobj::scan_sections_for_stubs,
7436 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7437 New method definitions.
7438
7439 2009-10-28 Cary Coutant <ccoutant@google.com>
7440
7441 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7442 (Plugin::cleanup_done_): New member.
7443 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7444 (Plugin_manager::cleanup_done_): Remove.
7445 (Plugin_manager::add_input_file): Edit error message.
7446 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7447 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7448
7449 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7450
7451 * fileread.cc: (File_read::View::~View): Use the new
7452 data_ownership_ filed.
7453 (File_read::~File_read): Dispose the new whole_file_view_.
7454 (File_read::open): Mmap the whole file if needed.
7455 (File_read::open): Use whole_file_view_ instead of contents_.
7456 (File_read::find_view): Use whole_file_view_ if applicable.
7457 (File_read::do_read): Use whole_file_view_ instead of contents_.
7458 (File_read::make_view): Use whole_file_view_ instead of contents_,
7459 update File_read::View::View call.
7460 (File_read::find_or_make_view): Update File_read::View::View
7461 call.
7462 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7463 remove contents_
7464 (File_read::View::Data_ownership): New enum.
7465 (File_read::View::View): Replace bool mapped_ with Data_ownership
7466 argument.
7467 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7468 (File_read::View::data_ownership_): New field.
7469 (File_read::contents_): Remove (replaced by whole_file_view_).
7470 (File_read::whole_file_view_): New field.
7471 * options.h (class General_options): Add --keep-files-mapped.
7472
7473 2009-10-27 Cary Coutant <ccoutant@google.com>
7474
7475 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7476 * testsuite/Makefile.am (plugin_test_5): New test case.
7477 * testsuite/Makefile.in: Regenerate.
7478
7479 2009-10-25 Doug Kwan <dougkwan@google.com>
7480
7481 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7482 from private to protected to allow access by child class.
7483 (Sized_relobj::do_relocate_sections): New method declaration.
7484 (Sized_relobj::relocate_sections): Virtualize.
7485 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
7486 Sized_relobj::relocate_sections. Instantiate template explicitly
7487 for different target sizes and endianity.
7488
7489 2009-10-24 Doug Kwan <dougkwan@google.com>
7490
7491 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7492 (Arm_input_section::as_arm_input_section): New method.
7493 (Arm_output_section): New class definition.
7494 (Arm_output_section::create_stub_group,
7495 Arm_output_section::group_sections): New method definitions.
7496
7497 2009-10-22 Doug Kwan <dougkwan@google.com>
7498
7499 * arm.cc (Arm_input_section): New class definition.
7500 (Arm_input_section::init, Arm_input_section:do_write,
7501 Arm_input_section::set_final_data_size,
7502 Arm_input_section::do_reset_address_and_file_offset): New method
7503 definitions.
7504
7505 2009-10-21 Doug Kwan <dougkwan@google.com>
7506
7507 * arm.cc (Stub_table, Arm_input_section): New forward class
7508 declarations.
7509 (Stub_table): New class defintion.
7510 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7511 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7512 New method definition.
7513
7514 2009-10-21 Doug Kwan <dougkwan@google.com>
7515
7516 * arm.cc: Update copyright comments.
7517 (Target_arm): New forward class template declaration.
7518 (Arm_address): New type.
7519 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7520 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7521 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7522 constants.
7523 (Insn_template): Same.
7524 (DEF_STUBS): New macro.
7525 (Stub_type): New enum type.
7526 (Stub_template): New class definition.
7527 (Stub): Same.
7528 (Reloc_stub): Same.
7529 (Stub_factory): Same.
7530 (Target_arm::Target_arm): Initialize may_use_blx_ and
7531 should_force_pic_veneer_.
7532 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7533 Target_arm::should_force_pic_veneer,
7534 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7535 Target_arm::using_thumb_only, Target_arm:;default_target): New
7536 method defintions.
7537 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7538 New data member declarations.
7539 (Insn_template::size, Insn_template::alignment): New method defintions.
7540 (Stub_template::Stub_template): New method definition.
7541 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7542 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7543 (Stub_factory::Stub_factory): New method definition.
7544 * gold.h (string_hash): New template.
7545 * output.h (Input_section_specifier::hash_value): Use
7546 gold::string_hash.
7547 (Input_section_specifier::string_hash): Remove.
7548 * stringpool.cc (Stringpool_template::string_hash): Use
7549 gold::string_hash.
7550
7551 2009-10-20 Doug Kwan <dougkwan@google.com>
7552
7553 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7554 symbols of relaxed input sections.
7555 * output.h (Output_section::find_relaxed_input_section): Make
7556 method public.
7557
7558 2009-10-16 Doug Kwan <dougkwan@google.com>
7559
7560 * dynobj.cc (Versions::Versions): Initialize version_script_.
7561 Only insert base version symbol definition for a shared object
7562 if version script defines any version versions.
7563 (Versions::define_base_version): New method definition.
7564 (Versions::add_def): Check that base version is not needed.
7565 (Versions::add_need): Define base version lazily.
7566 * dynobj.h (Versions::define_base_version): New method declaration.
7567 (Versions::needs_base_version_): New data member declaration.
7568 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7569 (check_DATA): Add no_version_test.stdout.
7570 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7571 New make rules.
7572 * testsuite/Makefile.in: Regenerate.
7573 * testsuite/no_version_test.c: New file.
7574 * testsuite/no_version_test.sh: Ditto.
7575
7576 2009-10-16 Doug Kwan <dougkwan@google.com>
7577
7578 * expression.cc (class Segment_start_expression): New class definition.
7579 (Segment_start_expression::value): New method definition.
7580 (script_exp_function_segment_start): Return a new
7581 Segment_start_expression.
7582 * gold/script-c.h (script_saw_segment_start_expression): New function
7583 prototype.
7584 * script-sections.cc (Script_sections::Script_sections): Initialize
7585 SAW_SEGMENT_START_EXPRESSION_ to false.
7586 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7587 and -Tbbs options to specify section addresses if given in
7588 command line and no SEGMENT_START expression is seen in a script.
7589 * script-sections.h (Script_sections::saw_segment_start_expression,
7590 Script_sections::set_saw_segment_start_expression): New method
7591 definition.
7592 (Script_sections::saw_segment_start_expression_): New data member
7593 declaration.
7594 * script.cc (script_saw_segment_start_expression): New function.
7595 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7596 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7597 script_test_7.sh and script_test_8.sh.
7598 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7599 script_test_8.stdout.
7600 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7601 (script_test_6, script_test_6.stdout, script_test_7,
7602 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7603 * Makefile.in: Regenerate.
7604 * testsuite/script_test_6.sh: New file.
7605 * testsuite/script_test_6.t: Same.
7606 * testsuite/script_test_7.sh: Same.
7607 * testsuite/script_test_7.t: Same.
7608 * testsuite/script_test_8.sh: Same.
7609
7610 2009-10-16 Doug Kwan <dougkwan@google.com>
7611
7612 * output.cc (Output_segment::set_section_list_address): Cast
7613 expressions to unsigned long long type to avoid format warnings.
7614
7615 2009-10-15 Ian Lance Taylor <iant@google.com>
7616
7617 * script.cc (Script_options::add_symbol_assignment): Always add a
7618 dot assignment to script_sections_.
7619 * script-sections.cc (Script_sections::add_dot_assignment):
7620 Initialize if necessary.
7621
7622 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7623 program headers with no load segment if there is a linker script.
7624
7625 * layout.cc (Layout::set_segment_offsets): Align the file offset
7626 to the segment aligment for -N or -n with no load segment.
7627 * output.cc (Output_segment::add_output_section): Don't crash if
7628 the first section is a TLS section.
7629 (Output_segment::set_section_list_addresses): Print an error
7630 message if the address moves backward in a linker script.
7631 * script-sections.cc
7632 (Output_section_element_input::set_section_addresses): Don't
7633 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7634 (Orphan_output_section::set_section_addresses): Likewise.
7635
7636 2009-10-15 Doug Kwan <dougkwan@google.com>
7637
7638 * layout.cc (Layout::finish_dynamic_section): Generate tags
7639 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7640 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7641 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7642
7643 2009-10-14 Ian Lance Taylor <iant@google.com>
7644
7645 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7646 fields.
7647 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7648 data_shdr fields of relinfo.
7649 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7650 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7651 R_386_TLS_LDO_32, adjust based on section flags.
7652 (Target_i386::Relocate::fix_up_ldo): Remove.
7653
7654 2009-10-13 Ian Lance Taylor <iant@google.com>
7655
7656 Add support for -pie.
7657 * options.h (class General_options): Add -pie and
7658 --pic-executable.
7659 (General_options::output_is_position_independent): Test -pie.
7660 (General_options::output_is_executable): Return true if not shared
7661 and not relocatable.
7662 (General_options::output_is_pie): Remove.
7663 * options.cc (General_options::finalize): Reject incompatible uses
7664 of -pie.
7665 * gold.cc (queue_middle_tasks): A -pie link is not static.
7666 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7667 * symtab.cc (Symbol::final_value_is_known): Return false if
7668 output_is_position_independent.
7669 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7670 output_is_position_independent.
7671 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7672 output_is_position_independent.
7673 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7674 output_is_position_independent.
7675 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7676 two_file_pie_test.
7677 (basic_pie_test.o, basic_pie_test): New targets.
7678 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7679 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7680 (two_file_pie_test): New target.
7681 * testsuite/Makefile.in: Rebuild.
7682 * README: Remove note saying that -pie is not supported.
7683
7684 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7685
7686 * options.h (class General_options): Add -init and -fini.
7687 * layout.cc (Layout::finish_dynamic_section): Emit
7688 given init and fini functions.
7689
7690 2009-10-13 Sriraman Tallam <tmsriram@google.com>
7691
7692 * gc.h (gc_process_relocs): Check if icf is enabled using new
7693 function.
7694 * gold.cc (queue_initial_tasks): Likewise.
7695 (queue_middle_tasks): Likewise.
7696 * object.cc (do_layout): Likewise.
7697 * symtab.cc (is_section_folded): Likewise.
7698 * main.cc (main): Likewise.
7699 * reloc.cc (Read_relocs::run): Likewise.
7700 (Sized_relobj::do_scan_relocs): Likewise.
7701 * icf.cc (is_function_ctor_or_dtor): New function.
7702 (Icf::find_identical_sections): Check if function is ctor or dtor when
7703 safe icf is chosen.
7704 * options.h (General_options::icf): Change option to be an enum.
7705 (Icf_status): New enum.
7706 (icf_enabled): New method.
7707 (icf_safe_folding): New method.
7708 (set_icf_status): New method.
7709 (icf_status_): New variable.
7710 * (options.cc) (General_options::finalize): Set icf_status_.
7711 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7712 icf_test and icf_keep_unique_test to use the --icf enum flag.
7713 * testsuite/icf_safe_test.sh: New file.
7714 * testsuite/icf_safe_test.cc: New file.
7715
7716 2009-10-12 Sriraman Tallam <tmsriram@google.com>
7717
7718 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7719 includes to gc.h and icf.h.
7720 * arm.cc: Include gc.h.
7721 * gold.cc: Likewise.
7722 * i386.cc: Likewise.
7723 * powerpc.cc: Likewise.
7724 * sparc.cc: Likewise.
7725 * x86_64.cc: Likewise.
7726 * gc.h: Include icf.h.
7727
7728 2009-10-11 Ian Lance Taylor <iant@google.com>
7729
7730 * plugin.cc: Include "gold.h" before other header files.
7731
7732 2009-10-10 Chris Demetriou <cgd@google.com>
7733
7734 * options.h (Input_file_argument::Input_file_type): New enum.
7735 (Input_file_argument::is_lib_): Replace with...
7736 (Input_file_argument::type_): New member.
7737 (Input_file_argument::Input_file_argument): Take Input_file_type
7738 'type' rather than boolean 'is_lib' as second argument.
7739 (Input_file_argument::is_lib): Use type_.
7740 (Input_file_argument::is_searched_file): New function.
7741 (Input_file_argument::may_need_search): Handle is_searched_file.
7742 * options.cc (General_options::parse_library): Support -l:filename.
7743 (General_options::parse_just_symbols): Update for Input_file_argument
7744 changes.
7745 (Command_line::process): Likewise.
7746 * archive.cc (Archive::get_file_and_offset): Likewise.
7747 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7748 * script.cc (read_script_file, script_add_file): Likewise.
7749 * fileread.cc (Input_file::Input_file): Likewise.
7750 (Input_file::will_search_for): Handle is_searched_file.
7751 (Input_file::open): Likewise.
7752 * readsyms.cc (Read_symbols::get_name): Likewise.
7753 * testsuite/Makefile.am (searched_file_test): New test.
7754 * testsuite/Makefile.in: Regenerate.
7755 * testsuite/searched_file_test.cc: New file.
7756 * testsuite/searched_file_test_lib.cc: New file.
7757
7758 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7759 Ian Lance Taylor <iant@google.com>
7760
7761 * descriptor.cc: Include <cstdio> and "binary-io.h".
7762 (Descriptors::open): Open the files in binary mode always.
7763 * script.cc (Lex::get_token): Treat \r as whitespace.
7764
7765 2009-10-09 Ian Lance Taylor <iant@google.com>
7766
7767 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7768
7769 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7770 Ian Lance Taylor <iant@google.com>
7771
7772 * configure.ac: Check for readv function also.
7773 * fileread.cc (readv): Define if not HAVE_READV.
7774 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7775 does not exist.
7776 * config.in: Regenerate.
7777 * configure: Regenerate.
7778
7779 2009-10-09 Doug Kwan <dougkwan@google.com>
7780
7781 * layout.cc (Layout::make_output_section): Call target hook to make
7782 ordinary output section.
7783 (Layout::finalize): Adjust parameter list of call the
7784 Target::may_relax().
7785 * layout.h (class Layout::section_list): New method.
7786 * merge.h (Output_merge_base::entsize): Change visibility to public.
7787 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7788 New methods.
7789 (Output_merge_string::do_is_string): New method.
7790 * object.cc (Sized_relobj::do_setup): renamed from
7791 Sized_relobj::set_up.
7792 * object.h (Sized_relobj::adjust_shndx,
7793 Sized_relobj::initializ_input_to_output_maps,
7794 Sized_relobj::free_input_to_output_maps): Change visibilities to
7795 protected.
7796 (Sized_relobj::setup): Virtualize.
7797 (Sized_relobj::do_setup): New method declaration.
7798 (Sized_relobj::invalidate_section_offset,
7799 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7800 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7801 * options.cc (parse_int): New function.
7802 * options.h (parse_int): New declaration.
7803 (DEFINE_int): New macro.
7804 (stub_group_size): New option.
7805 * output.cc (Output_section::Output_section): Initialize memebers
7806 merge_section_map_, merge_section_by_properties_map_,
7807 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7808 (Output_section::add_input_section): Handled deferred code-fill
7809 generation and remove an old comment.
7810 (Output_section::add_relaxed_input_section): New method definition.
7811 (Output_section::add_merge_input_section): Use merge section by
7812 properties map to speed to search. Update merge section maps
7813 as appropriate.
7814 (Output_section::build_relaxation_map): New method definition.
7815 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7816 Same.
7817 (Output_section::relax_input_section): Renamed to
7818 Output_section::convert_input_sections_to_relaxed_sections and change
7819 interface to take a vector of pointers to relaxed sections.
7820 (Output_section::find_merge_section,
7821 Output_section::find_relaxed_input_section): New method definitions.
7822 (Output_section::is_input_address_mapped,
7823 Output_section::output_offset, Output_section::output_address):
7824 Use output section data maps to speed up searching.
7825 (Output_section::find_starting_output_address): Add comments.
7826 (Output_section::do_write,
7827 Output_section::write_to_postprocessing_buffer): Do code-fill
7828 generation as appropriate.
7829 (Output_section::get_input_sections): Invalidate relaxed input section
7830 map.
7831 (Output_section::restore_states): Adjust type of checkpoint .
7832 Invalidate relaxed input section map.
7833 * output.h (Output_merge_base): New class declaration.
7834 (Input_section_specifier): New class defintion.
7835 (class Output_relaxed_input_section) Change base class to
7836 Output_section_data_build.
7837 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7838 base class initializer.
7839 (Output_section::add_relaxed_input_section): New method declaration.
7840 (Output_section::Input_section): Change visibility to protected.
7841 (Output_section::Input_section::relobj,
7842 Output_section::Input_section::shndx): Handle relaxed input sections.
7843 Output_section::input_sections) Change visibility to protected. Also
7844 define overload to return a non-const pointer.
7845 (Output_section::Merge_section_properties): New class defintion.
7846 (Output_section::Merge_section_by_properties_map,
7847 Output_section::Output_section_data_by_input_section_map,
7848 Output_section::Relaxation_map): New types.
7849 (Output_section::relax_input_section): Rename method to
7850 Output_section::convert_input_sections_to_relaxed_sections and change
7851 interface to take a vector of relaxed section pointers.
7852 (Output_section::find_merge_section,
7853 Output_section::find_relaxed_input_section,
7854 Output_section::build_relaxation_map,
7855 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7856 New method declarations.
7857 (Output_section::merge_section_map_
7858 Output_section::merge_section_by_properties_map_,
7859 Output_section::relaxed_input_section_map_,
7860 Output_section::is_relaxed_input_section_map_valid_,
7861 Output_section::generate_code_fills_at_write_): New data members.
7862 * script-sections.cc
7863 (Output_section_element_input::set_section_addresses): Call
7864 current_data_size and addralign methods of relaxed input sections.
7865 (Orphan_output_section::set_section_addresses): Call current_data_size
7866 and addralign methods of relaxed input sections.
7867 * symtab.cc (Symbol_table::compute_final_value): Extract template
7868 from the body of Symbol_table::sized_finalize_symbol.
7869 (Symbol_table::sized_finalized_symbol): Call
7870 Symbol_table::compute_final_value.
7871 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7872 (Symbol_table::compute_final_value): New templated method declaration.
7873 * target.cc (Target::do_make_output_section): New method defintion.
7874 * target.h (Target::make_output_section): New method declaration.
7875 (Target::relax): Add more parameters for input objects, symbol table
7876 and layout. Adjust call to do_relax.
7877 (Target::do_make_output_section): New method declaration.
7878 (Target::do_relax): Add parameters for input objects, symbol table
7879 and layout.
7880
7881 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7882
7883 * pread.c: Include stdio.h.
7884
7885 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7886
7887 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7888 defined.
7889
7890 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7891
7892 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7893 Change read_shndx type to unsigned int.
7894 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7895 int.
7896 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7897 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7898 Change read_shndx type to unsigned int.
7899 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7900 int.
7901 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7902 * layout.cc (Layout::create_symtab_sections): Cast the result of
7903 local_symcount * symsize to off_t in the gold_assert.
7904
7905 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7906
7907 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7908 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7909 R_ARM_BASE_ABS.
7910 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7911 (Arm_relocate_functions::thm_abs5): New function.
7912 (Arm_relocate_functions::abs12): New function.
7913 (Arm_relocate_functions::abs16): New function.
7914 (Arm_relocate_functions::base_abs): New function.
7915 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7916 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7917 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7918 R_ARM_BASE_ABS.
7919 (Scan::global): Likewise.
7920 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7921 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7922 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7923 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7924 R_ARM_BASE_ABS.
7925
7926 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7927
7928 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7929 (Arm_relocate_functions::movt_prel): New function.
7930 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7931 (Arm_relocate_functions::thm_movt_prel): New function.
7932 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7933 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7934 (Scan::global, Relocate::relocate): Likewise.
7935 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7936
7937 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7938
7939 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7940 Incremental_checker.
7941 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7942 unsigned int.
7943 (class Incremental_inputs_header): New class.
7944 (Incremental_inputs_header_writer): Edit comment.
7945 (Incremental_inputs_entry): New class.
7946 (Incremental_inputs_entry_writer): Edit comment.
7947 (Sized_incremental_binary::do_find_incremental_inputs_section):
7948 Add *strtab_shndx parameter, fill it.
7949 (Sized_incremental_binary::do_check_inputs): New method.
7950 (Incremental_checker::can_incrementally_link_output_file): Use
7951 Sized_incremental_binary::check_inputs.
7952 (Incremental_inputs::report_command_line): Save command line in
7953 command_line_.
7954 * incremental.h:
7955 (Incremental_binary::find_incremental_inputs_section): New
7956 method.
7957 (Incremental_binary::do_find_incremental_inputs_section): Add
7958 strtab_shndx parameter.
7959 (Incremental_binary::do_check_inputs): New pure virtual method.
7960 (Sized_incremental_binary::do_check_inputs): Declare.
7961 (Incremental_checker::Incremental_checker): Add incremental_inputs
7962 parameter, use it to initialize incremental_inputs_.
7963 (Incremental_checker::incremental_inputs_): New field.
7964 (Incremental_checker::command_line): New method.
7965 (Incremental_checker::inputs): New method.
7966 (Incremental_checker::command_line_): New field.
7967
7968 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7969
7970 * incremental.cc: Include <cstdarg> and "target-select.h".
7971 (vexplain_no_incremental): New function.
7972 (explain_no_incremental): New function.
7973 (Incremental_binary::error): New method.
7974 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7975 method.
7976 (make_sized_incremental_binary): New function.
7977 (open_incremental_binary): New function.
7978 (can_incrementally_link_file): Add checks if output is ELF and has
7979 inputs section.
7980 * incremental.h: Include "elfcpp_file.h" and "output.h".
7981 (Incremental_binary): New class.
7982 (Sized_incremental_binary): New class.
7983 (open_incremental_binary): Declare.
7984 * object.cc (is_elf_object): Use
7985 elfcpp::Elf_recognizer::is_elf_file.
7986 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7987 * output.h (Output_file::filesize): New method.
7988
7989 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7990
7991 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7992 New function.
7993 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7994 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7995 function.
7996 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7997 function.
7998 (Arm_relocate_functions::movw_abs_nc): New function.
7999 (Arm_relocate_functions::movt_abs): New function.
8000 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8001 (Arm_relocate_functions::thm_movt_abs): New function.
8002 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8003 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8004 (Scan::global): Likewise.
8005 (Relocate::relocate): Likewise.
8006 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8007
8008 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8009
8010 * arm.cc (Arm_relocate_functions::got_prel) New function.
8011 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8012 (Relocate::relocate): Likewise.
8013 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8014
8015 2009-10-06 Ian Lance Taylor <iant@google.com>
8016
8017 * options.h (class General_options): Define
8018 split_stack_adjust_size parameter.
8019 * object.h (class Object): Add uses_split_stack_ and
8020 has_no_split_stack_ fields. Add uses_split_stack and
8021 has_no_split_stack accessor functions. Declare
8022 handle_split_stack_section.
8023 (class Reloc_symbol_changes): Define.
8024 (class Sized_relobj): Define Function_offsets. Declare
8025 split_stack_adjust, split_stack_adjust_reltype, and
8026 find_functions.
8027 * object.cc (Object::handle_split_stack_section): New function.
8028 (Sized_relobj::do_layout): Call handle_split_stack_section.
8029 * dynobj.cc (Sized_dynobj::do_layout): Call
8030 handle_split_stack_section.
8031 * reloc.cc (Sized_relobj::relocate_sections): Call
8032 split_stack_adjust for executable sections in split_stack
8033 objects. Pass reloc_map to relocate_section.
8034 (Sized_relobj::split_stack_adjust): New function.
8035 (Sized_relobj::split_stack_adjust_reltype): New function.
8036 (Sized_relobj::find_functions): New function.
8037 * target-reloc.h: Include "object.h".
8038 (relocate_section): Add reloc_symbol_changes parameter. Change
8039 all callers.
8040 * target.h (class Target): Add calls_non_split method. Declare
8041 do_calls_non_split virtual method. Declare match_view and
8042 set_view_to_nop.
8043 * target.cc: Include "elfcpp.h".
8044 (Target::do_calls_non_split): New function.
8045 (Target::match_view): New function.
8046 (Target::set_view_to_nop): New function.
8047 * gold.cc (queue_middle_tasks): Give an error if mixing
8048 split-stack and non-split-stack objects with -r.
8049 * i386.cc (Target_i386::relocate_section): Add
8050 reloc_symbol_changes parameter.
8051 (Target_i386::do_calls_non_split): New function.
8052 * x86_64.cc (Target_x86_64::relocate_section): Add
8053 reloc_symbol_changes parameter.
8054 (Target_x86_64::do_calls_non_split): New function.
8055 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8056 parameter.
8057 * powerpc.cc (Target_powerpc::relocate_section): Add
8058 reloc_symbol_changes parameter.
8059 * sparc.cc (Target_sparc::relocate_section): Add
8060 reloc_symbol_changes parameter.
8061 * configure.ac: Call AM_CONDITIONAL for the default target.
8062 * configure: Rebuild.
8063 * testsuite/Makefile.am (TEST_AS): New variable.
8064 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8065 (check_DATA): Add split_i386 and split_x86_64 files.
8066 (SPLIT_DEFSYMS): Define.
8067 (split_i386_[1234n].o): New targets.
8068 (split_i386_[124]): New targets.
8069 (split_i386_[1234r].stdout): New targets.
8070 (split_x86_64_[1234n].o): New targets.
8071 (split_x86_64_[124]): New targets.
8072 (split_x86_64_[1234r].stdout): New targets.
8073 (MOSTLYCLEANFILES): Add new executables.
8074 * testsuite/split_i386.sh: New file.
8075 * testsuite/split_x86_64.sh: New file.
8076 * testsuite/split_i386_1.s: New file.
8077 * testsuite/split_i386_2.s: New file.
8078 * testsuite/split_i386_3.s: New file.
8079 * testsuite/split_i386_4.s: New file.
8080 * testsuite/split_i386_n.s: New file.
8081 * testsuite/split_x86_64_1.s: New file.
8082 * testsuite/split_x86_64_2.s: New file.
8083 * testsuite/split_x86_64_3.s: New file.
8084 * testsuite/split_x86_64_4.s: New file.
8085 * testsuite/split_x86_64_n.s: New file.
8086 * testsuite/testfile.cc (Target_test): Update relocation_section
8087 function.
8088 * testsuite/Makefile.in: Rebuild.
8089
8090 2009-10-06 Ian Lance Taylor <iant@google.com>
8091
8092 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8093 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8094 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8095 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8096 the address on ldo_addrs_.
8097 (Target_i386::Relocate::fix_up_ldo): New function.
8098
8099 2009-10-06 Rafael Espindola <espindola@google.com>
8100
8101 * plugin.cc (add_input_library): New.
8102 (Plugin::load): Add add_input_library to tv.
8103 (Plugin_manager::add_input_file): Add the is_lib argument.
8104 (add_input_file): Update call to Plugin_manager::add_input_file.
8105 (add_input_library): New.
8106 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8107
8108 2009-09-30 Doug Kwan <dougkwan@google.com>
8109
8110 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8111 symbol and call Symbol::may_need_copy_reloc to determine if
8112 a copy reloc is needed.
8113 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8114 nocopyreloc is given in command line.
8115 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8116 given in command line.
8117 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8118 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8119 of the removed Target_i386::may_need_copy_reloc.
8120 * options.h (copyreloc): New option with default value false.
8121 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8122 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8123 instead of the removed Target_powerpc::may_need_copy_reloc.
8124 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8125 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8126 instead of the removed Target_sparc::may_need_copy_reloc.
8127 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8128 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8129 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8130 instead of the removed Target_x86_64::may_need_copy_reloc.
8131
8132 2009-09-30 Ian Lance Taylor <iant@google.com>
8133
8134 * object.h (class Object): Remove target_ field, and target,
8135 sized_target, and set_target methods.
8136 (Object::sized_target): Remove.
8137 (class Sized_relobj): Update declarations. Remove sized_target.
8138 * object.cc (Sized_relobj::setup): Remove target parameter.
8139 Change all callers.
8140 (Input_objects::add_object): Don't do anything with the target.
8141 (make_elf_sized_object): Add punconfigured parameter. Change all
8142 callers. Set or test parameter target.
8143 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8144 Change all callers.
8145 * parameters.cc (Parameters::set_target): Change parameter type to
8146 be non-const.
8147 (Parameters::default_target): Remove.
8148 (set_parameters_target): Change parameter type to be non-const.
8149 (parameters_force_valid_target): New function.
8150 (parameters_clear_target): New function.
8151 * parameters.h (class Parameters): Update declarations. Remove
8152 default_target method. Add sized_target and clear_target
8153 methods. Change target_ to be non-const.
8154 (set_parameters_target): Update declaration.
8155 (parameters_force_valid_target): Declare.
8156 (parameters_clear_target): Declare.
8157 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8158 as NULL if we aren't searching.
8159 (Add_symbols::run): Don't check for compatible target.
8160 * fileread.cc (Input_file::open_binary): Call
8161 parameters_force_valid_target.
8162 * gold.cc (queue_middle_tasks): Likewise.
8163 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8164 set_target on object.
8165 * dynobj.h (class Sized_dynobj): Update declarations.
8166 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8167 make_elf_object returns NULL.
8168 (Archive::include_member): Don't check whether object target is
8169 compatible.
8170 * output.cc (Output_section::add_input_section): Get target from
8171 parameters.
8172 (Output_section::relax_input_section): Likewise.
8173 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8174 parameters.
8175 (Sized_relobj::do_scan_relocs): Likewise.
8176 (Sized_relobj::relocate_sections): Likewise.
8177 * resolve.cc (Symbol_table::resolve): Likewise.
8178 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8179 parameter. Change all callers.
8180 (Symbol_table::add_from_object): Get target from parameters.
8181 (Symbol_table::add_from_relobj): Don't check object target.
8182 (Symbol_table::add_from_dynobj): Likewise.
8183 (Symbol_table::define_special_symbol): Get target from
8184 parameters.
8185 * symtab.h (class Symbol_table): Update declaration.
8186 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8187 parameter. Change all callers. Clear parameter target.
8188 (Binary_test): Test target here.
8189 * testsuite/object_unittest.cc (gold_testsuite): Remove
8190 target_test_pointer parameter. Change all callers.
8191 (Object_test): Test target here.
8192
8193 2009-09-26 Ian Lance Taylor <iant@google.com>
8194
8195 * testsuite/initpri1.c: Don't try to use constructor priorities if
8196 compiling with gcc before 4.3.
8197
8198 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8199
8200 * testsuite/retain_symbols_file_test.sh (check_present): Change
8201 output file name to retain_symbols_file_test.stdout.
8202 (check_absent): Likewise.
8203
8204 2009-09-18 Craig Silverstein <csilvers@google.com>
8205
8206 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8207 * options.cc: Include <cerrno> and <fstream>.
8208 (General_options::finalize): Parse -retain-symbols-file tag.
8209 * options.h: New flag.
8210 (General_options): New method should_retain_symbol, new
8211 variable symbols_to_retain.
8212 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8213 should_retain_symbol map.
8214 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8215 * testsuite/Makefile.in: Regenerate.
8216 * testsuite/retain_symbols_file_test.sh: New file.
8217
8218 2009-09-18 Nick Clifton <nickc@redhat.com>
8219
8220 * po/es.po: Updated Spanish translation.
8221
8222 2009-09-17 Doug Kwan <dougkwan@google.com>
8223
8224 * debug.h (DEBUG_RELAXATION): New constant.
8225 (DEBUG_ALL): Add DEBUG_RELAXATION.
8226 (debug_string_to_enum): Add relaxation debug option.
8227 * layout.cc
8228 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8229 Layout::Relaxation_debug_check::read_sections,
8230 Layout::Relaxation_debug_check::read_sections): New method definitions.
8231 (Layout::Layout): Initialize data members
8232 record_output_section_data_from_scrips_,
8233 script_output_section_data_list_ and relaxation_debug_check_.
8234 (Layout::save_segments, Layout::restore_segments,
8235 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8236 Layout::relaxation_loop_body): New method definitions.
8237 (Layout::finalize): Support relaxation. Move section layout code to
8238 Layout::relaxation_loop_body.
8239 (Layout::set_asection_address_from_script): Move code for orphan
8240 section placement out.
8241 (Layout::place_orphan_sections_in_script): New method definition.
8242 * layout.h (Output_segment_headers, Output_file_header):
8243 New forward class declarations.
8244 (Layout::~Layout): Define.
8245 (Layout::new_output_section_data_from_script): New method definition.
8246 (Layout::place_orphan_sections_in_script): New method declaration.
8247 (Layout::Segment_states): New type declaration.
8248 (Layout::save_segments, Layout::restore_segments,
8249 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8250 Layout::relaxation_loop_body): New method declarations.
8251 (Layout::Output_section_data_list): New type declaration.
8252 (Layout::Relaxation_debug_check): New class definition.
8253 (Layout::record_output_section_data_from_script_,
8254 Layout::script_output_section_data_list_, Layout::segment_states_,
8255 Layout::relaxation_debug_check_): New data members.
8256 * output.cc: (Output_section_headers::do_size): New method definition.
8257 (Output_section_headers::Output_section_headers): Move size
8258 computation to Output_section_headers::do_size.
8259 (Output_segment_headers::do_size): New method definition.
8260 (Output_file_header::Output_file_header): Move size computation to
8261 Output_file_header::do_size and call it.
8262 (Output_file_header::do_size): New method definition.
8263 (Output_data_group::Output_data_group): Adjust call to
8264 Output_section_data.
8265 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8266 (Output_symtab_xindex::do_write): Add array bound check.
8267 (Output_section::Input_section::print_to_mapfile): Handle
8268 RELAXED_INPUT_SECTION_CODE.
8269 (Output_section::Output_section): Initialize data member checkpoint_.
8270 (Output_section::~Output_section): Delete checkpoint object pointed
8271 by checkpoint_.
8272 (Output_section::add_input_section): Always add an Input_section if
8273 relaxing.
8274 (Output_section::add_merge_input_section): Add assert.
8275 (Output_section::relax_input_section): New method definition.
8276 (Output_section::set_final_data_size): Set load address to zero for
8277 an unallocated section.
8278 (Output_section::do_address_and_file_offset_have_reset_values):
8279 New method definition.
8280 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8281 Handle relaxed input section.
8282 (Output_section::sort_attached_input_sections): Checkpoint input
8283 section list lazily.
8284 (Output_section::get_input_sections): Change type of input_sections to
8285 list of Simple_input_section pointers. Checkpoint input section list
8286 lazily. Also handle relaxed input sections.
8287 (Output_section::add_input_section_for_script): Take a reference to
8288 a Simple_input_section object instead of Relobj pointer and section
8289 index as parameter. Handle relaxed input sections.
8290 (Output_section::save_states, Output_section::restore_states): New
8291 method definitions.
8292 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8293 (Output_data::is_data_size_fixed): New method definition.
8294 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8295 if it is fixed.
8296 (Output_data::address_and_file_offset_have_reset_values): New method
8297 definition.
8298 (Output_data::do_address_and_file_offset_have_reset_values): New method
8299 definition.
8300 (Output_data::set_data_size): Check that data size is not fixed.
8301 (Output_data::fix_data_size): New method definition.
8302 (Output_data::is_data_size_fixed_): New data member.
8303 (Output_section_headers::set_final_data_size): New method definition.
8304 (Output_section_headers::do_size): New method declaration.
8305 (Output_segment_headers::set_final_data_size): New method definition.
8306 (Output_segment_headers::do_size): New method declaration.
8307 (Output_file_header::set_final_data_size)::New method definition.
8308 (Output_file_header::do_size)::New method declaration.
8309 (Output_section_data::Output_section_data): Add new parameter
8310 is_data_size_fixed and use it to fix data size.
8311 (Output_data_const::Output_data_const): Adjust call to base class
8312 constructor and fix data size.
8313 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8314 base class constructor and fix data size.
8315 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8316 base class constructor and fix data size.
8317 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8318 class constructor and fix data size.
8319 (Output_data_group::set_final_data_size): New method definition.
8320 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8321 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8322 class constructor and fix data size.
8323 (Output_relaxed_input_section): New class definition.
8324 (Output_section::Simple_input_section): New class definition.
8325 (Output_section::get_input_sections): Adjust parameter list.
8326 (Output_section::add_input_section_for_script): Same.
8327 (Output_section::save_states, Output_section::restore_states,
8328 Output_section::do_address_and_file_offset_have_reset_values,
8329 (Output_section::Input_section::Input_section): Handle
8330 RELAXED_INPUT_SECTION_CODE. Add new overload for
8331 Output_relaxed_input_section.
8332 (Output_section::Input_section::is_input_section,
8333 Output_section::Input_section::set_output_section): Handle relaxed
8334 input section.
8335 (Output_section::Input_section::is_relaxed_input_section,
8336 Output_section::Input_section::output_section_data,
8337 Output_section::Input_section::relaxed_input_section): New method
8338 definitions.
8339 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8340 value.
8341 (Output_section::Input_section::u1_): Update comments.
8342 (Output_section::Input_section::u2_): Add new union member poris.
8343 (Output_section::Checkpoint_output_section): New classs definition.
8344 (Output_section::relax_input_section): New method declaration.
8345 (Output_section::checkpoint_): New data member.
8346 (Output_segment): Update comments.
8347 (Output_segment::Output_segment): Un-privatize copy constructor.
8348 (Output_segment::operator=): Un-privatize.
8349 * script-sections.cc (Output_section_element::Input_section_list):
8350 Change element type to Output_section::Simple_input_section.
8351 (Output_section_element_dot_assignment::set_section_addresses):
8352 Register output section data for relaxation clean up.
8353 (Output_data_exression::Output_data_expression): Adjust call to base
8354 constructor to fix data size.
8355 (Output_section_element_data::set_section_addresses): Register
8356 Output_data_expression object for relaxation clean up.
8357 (struct Input_section_info): Replace Relobj pointer and section index
8358 pair with Output_section::Simple_input_section and Convert struct to a
8359 class.
8360 (Input_section_sorter::operator()): Adjust access to
8361 Input_section_info data member to use accessors.
8362 (Output_section_element_input::set_section_addresses): Use layout
8363 parameter. Adjust code to use Output_section::Simple_input_section
8364 and Input_secction_info classes. Register filler for relaxation
8365 clean up.
8366 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8367 and section index pair with Output_section::Simple_input_section
8368 class. Adjust code accordingly.
8369 (Phdrs_element::release_segment): New method definition.
8370 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8371 segment list.
8372 (Script_sections::release_segments): New method definition.
8373 * gold/script-sections.h (Script_sections::release_segments): New
8374 method declaration.
8375 * gold/target.h (Target::may_relax, Target::relax,
8376 Target::do_may_relax, Target::do_relax): New method definitions.
8377
8378 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8379
8380 * arm.cc (has_signed_unsigned_overflow): New function.
8381 (Arm_relocate_functions::abs8): New function.
8382 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8383 (Target_arm::Scan::global): Likewise.
8384 (Target_arm::relocate::relocate): Likewise.
8385 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8386 Likewise.
8387
8388 2009-09-16 Cary Coutant <ccoutant@google.com>
8389
8390 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8391 * testsuite/Makefile.in: Regenerate.
8392
8393 2009-09-11 Nick Clifton <nickc@redhat.com>
8394
8395 * po/gold.pot: Updated by the Translation project.
8396
8397 2009-09-08 Cary Coutant <ccoutant@google.com>
8398
8399 * output.cc (Output_file::open): Add execute permission to empty file.
8400 * testsuite/Makefile.am (permission_test): New test.
8401 * testsuite/Makefile.in: Regenerate.
8402
8403 2009-09-02 Ian Lance Taylor <iant@google.com>
8404
8405 * output.cc (Output_file::resize): Call map_no_anonymous rather
8406 than map.
8407
8408 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8409
8410 * gold.cc: Include "incremental.h".
8411 (queue_initial_tasks): Call Incremental_checker methods.
8412 * incremental.cc: Include "output.h".
8413 (Incremental_checker::can_incrementally_link_output_file): New
8414 method.
8415 * incremental.h (Incremental_checker): New class.
8416
8417 * output.cc (Output_file::open_for_modification): New method.
8418 (Output_file::map_anonymous): Changed return type to bool. Record
8419 map in base_ field.
8420 (Output_file::map_no_anonymous): New method, broken out of map.
8421 (Output_file::map): Use map_no_anonymous and map_anonymous.
8422 * output.h (class Output_file): Update declarations.
8423
8424 2009-08-24 Cary Coutant <ccoutant@google.com>
8425
8426 * options.h (Command_line::Pre_options): New class.
8427 (Command_line::pre_options): New member.
8428 * options.cc (gold::options::ready_to_register): New variable.
8429 (One_option::register_option): Do nothing if not registering options.
8430 Assert if same short option registered twice.
8431 (General_options::General_options): Turn off option registration when
8432 done constructing.
8433 (Command_line::Pre_options::Pre_options): New constructor.
8434
8435 2009-08-24 Cary Coutant <ccoutant@google.com>
8436
8437 * options.h (General_options::no_keep_memory): Remove incorrect
8438 short option.
8439
8440 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8441
8442 * Makefile.am (am__skiplex, am__skipyacc): New.
8443 * Makefile.in: Regenerate.
8444
8445 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8446
8447 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8448 (INCLUDES): ... this.
8449 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8450 (AM_CPPFLAGS): Renamed from ...
8451 (INCLUDE): ... this.
8452 * Makefile.in, testsuite/Makefile.in: Regenerate.
8453
8454 * Makefile.in: Regenerate.
8455 * aclocal.m4: Likewise.
8456 * config.in: Likewise.
8457 * configure: Likewise.
8458 * testsuite/Makefile.in: Likewise.
8459
8460 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8461 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8462 * Makefile.in: Regenerate.
8463 * testsuite/Makefile.in: Regenerate.
8464
8465 2009-08-19 Cary Coutant <ccoutant@google.com>
8466
8467 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8468 symbols in shared libraries overridden by hidden or internal symbols
8469 in the main program.
8470
8471 2009-08-19 Chris Demetriou <cgd@google.com>
8472
8473 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8474 checking source file names in error messages.
8475
8476 2009-08-18 Doug Kwan <dougkwan@google.com>
8477
8478 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8479 an elcpp::Ehdr as parameter. Adjust call to set_target.
8480 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8481 an elfcpp::Ehdr as parameter.
8482 * object.cc (Object::set_target): Remove the version that looks up
8483 a target and sets it.
8484 (Sized_relobj::setup): Take a Target object instead of
8485 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8486 (make_elf_sized_object): Find target and ask target to
8487 make an ELF object.
8488 * object.h: (Object::set_target): Remove the version that looks up
8489 a target and sets it.
8490 (Sized_relobj::setup): Take a Target object instead of
8491 an elfcpp:Ehdr as parameter.
8492 * target.cc: Include dynobj.h.
8493 (Target::do_make_elf_object_implementation): New.
8494 (Target::do_make_elf_object): New.
8495 * target.h (Target::make_elf_object): New template declaration.
8496 (Target::do_make_elf_object): New method declarations.
8497 (Target::do_make_elf_object_implementation): New template declaration.
8498
8499 2009-08-14 Ian Lance Taylor <iant@google.com>
8500
8501 * gold.h (FUNCTION_NAME): Define.
8502 (gold_unreachable): Use FUNCTION_NAME.
8503
8504 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8505
8506 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8507 symbol in the --keep-unique list is not found.
8508
8509 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8510
8511 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8512 been maked as --keep-unique.
8513 (Icf::unfold_section): New function.
8514 * icf.h (Icf::unfold_section): New function.
8515 * options.h (General_options::keep_unique): New option.
8516 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8517 * testsuite/Makefile.in: Regenerate.
8518 * testsuite/icf_keep_unique_test.sh: New file.
8519 * testsuite/icf_keep_unique_test.cc: New file.
8520
8521 2009-08-12 Cary Coutant <ccoutant@google.com>
8522
8523 PR 10471
8524 * resolve.cc (Symbol_table::resolve): Check for references from
8525 dynamic objects to hidden and internal symbols.
8526 * testsuite/Makefile.am (hidden_test.sh): New test.
8527 * testsuite/Makefile.in: Regenerate.
8528 * testsuite/hidden_test.sh: New script.
8529 * testsuite/hidden_test_1.c: New test source.
8530 * testsuite/hidden_test_main.c: New test source.
8531
8532 2009-08-11 Doug Kwan <dougkwan@google.com>
8533
8534 * arm.cc: Update comments.
8535 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8536 segment to locate the .ARM.exidx section if present.
8537
8538 2009-08-09 Doug Kwan <dougkwan@google.com>
8539
8540 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8541 patch.
8542
8543 2009-08-07 Sriraman Tallam <tmsriram@google.com>
8544 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8545 compiler warnings.
8546
8547 2009-08-06 Sriraman Tallam <tmsriram@google.com>
8548
8549 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8550 valid tls_segment only for non-debug-section relocations.
8551 * testsuite/Makefile.am: Add gc_tls_test.
8552 * testsuite/Makefile.in: Regenerate.
8553 * testsuite/gc_tls_test.cc: New file.
8554 * testsuite/gc_tls_test.sh: New file.
8555
8556 2009-08-05 Sriraman Tallam <tmsriram@google.com>
8557
8558 * icf.cc: New file.
8559 * icf.h: New file.
8560 * Makefile.am (CCFILES): Add icf.cc.
8561 (HFILES): Add icf.h
8562 * Makefile.in: Regenerate.
8563 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8564 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8565 section, symbol and addend information for the relocs.
8566 * gold.cc (queue_middle_tasks): Call identical code folding.
8567 * gold.h: Add defines for multimap.
8568 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8569 to the call of finalize_local_symbols.
8570 * main.cc (main): Create object of class Icf.
8571 * object.cc (Sized_relobj::do_layout): Allow this function to be
8572 called twice during icf.
8573 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8574 to sections marked as identical by icf.
8575 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8576 when available.
8577 (Sized_relobj::do_section_entsize): New function.
8578 * object.h (Object::section_entsize): New function.
8579 (Object::do_section_entsize): New pure virtual function.
8580 (Relobj::finalize_local_symbols): Add new parameter.
8581 (Relobj::do_section_entsize): New function.
8582 * options.h (General_options::icf): New option.
8583 (General_options::icf_iterations): New option.
8584 (General_options::print_icf_sections): New option.
8585 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8586 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8587 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8588 icf.
8589 * symtab.cc (Symbol_table::is_section_folded): New function.
8590 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8591 to sections marked as identical by icf.
8592 * symtab.h (Symbol_table::set_icf): New function.
8593 (Symbol_table::icf): New function.
8594 (Symbol_table::is_section_folded): New function.
8595 (Symbol_table::icf_): New data member.
8596 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8597 * testsuite/Makefile.am: Add commands to build icf_test.
8598 * testsuite/Makefile.in: Regenerate.
8599 * testsuite/icf_test.sh: New file.
8600 * testsuite/icf_test.cc: New file.
8601
8602 2009-07-24 Chris Demetriou <cgd@google.com>
8603
8604 * layout.cc (is_compressible_debug_section): Fix incorrect
8605 comment about compressed section names.
8606
8607 2009-07-20 Ian Lance Taylor <ian@airs.com>
8608
8609 PR 10419
8610 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8611
8612 2009-07-16 Ian Lance Taylor <iant@google.com>
8613
8614 PR 10400
8615 * layout.h: #include <map>.
8616 (class Kept_section): Change from struct to class. Add accessors
8617 and setters. Add section size to Comdat_group mapping. Change
8618 Comdat_group to std::map. Add is_comdat_ field. Add
8619 linkonce_size field in union.
8620 (class Layout): Update declaration of find_or_add_kept_section.
8621 Don't declare find_kept_object.
8622 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8623 parameter. Add object, shndx, is_comdat, and is_group_name
8624 parameters. Change all callers. Adjust for new Kept_section.
8625 (Layout::find_kept_object): Remove.
8626 * object.cc (Sized_relobj::include_section_group): Update use of
8627 Kept_section. Rename secnum to shndx. Only record
8628 Kept_comdat_section if sections are the same size.
8629 (Sized_relobj::include_linkonce_section): Update use of
8630 Kept_section. Only record Kept_comdat_section if sections are the
8631 same size. Set size of linkonce section.
8632 (Sized_relobj::map_to_kept_section): Update call to
8633 get_kept_comdat_section.
8634 * object.h (class Sized_relobj): Rename fields in
8635 Kept_comdat_section to drop trailing underscores; change object
8636 field to Relobj*. Change Kept_comdat_section_table to store
8637 struct rather than pointer.
8638 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8639 Add kept_object and kept_shndx parameters. Change all callers.
8640 (Sized_relobj::get_kept_comdat_section): Change return type to
8641 bool. Add kept_object and kept_shndx parameters. Change all
8642 callers.
8643 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8644 Layout::find_or_add_kept_section.
8645
8646 2009-07-09 Ian Lance Taylor <iant@google.com>
8647
8648 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8649 Reserve space in the hash table.
8650
8651 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8652
8653 * fileread.cc (File_read::get_mtime): New method.
8654 * fileread.h (Timespec): New structure.
8655 (File_read::get_mtime): New method.
8656 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8657 Renamed from timestamp_nsec.
8658 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8659 Elf_Xword.
8660 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
8661 timestamp_nsec.
8662 (Incremental_inputs::report_archive): Save mtime; style fix.
8663 (Incremental_inputs::report_obejct): Save mtime; style fix.
8664 (Incremental_inputs::report_script): Save mtime; style fix.
8665 (Incremental_inputs::finalize_inputs): Style fix.
8666 (Incremental_inputs::finalize): Style fix.
8667 (Incremental_inputs::create_input_section_data): Store inputs
8668 mtime.
8669 * incremental.h (Incremental_inputs::report_script): Add mtime
8670 argument.
8671 (Incremental_inputs::Input_info::Input_info): Intialize only one
8672 union member.
8673 (Incremental_inputs::Input_info::archive): Move to nameless
8674 union.
8675 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8676 (Incremental_inputs::Input_info::script): Move to nameless union.
8677 (Incremental_inputs::mtime): New field.
8678 * script.cc (read_input_script): Pass file mtime to
8679 Incremental_input.
8680 * script.h (Script_info::inputs): Style fix.
8681
8682 2009-07-01 Ian Lance Taylor <ian@airs.com>
8683
8684 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8685 instead of 32.
8686
8687 2009-06-24 Ian Lance Taylor <iant@google.com>
8688
8689 PR 10156
8690 * layout.cc (Layout::choose_output_section): If we find an
8691 existing section, update the flags.
8692 (Layout::create_notes): New function, broken out of
8693 Layout::finalize.
8694 (Layout::finalize): Don't create note sections.
8695 (Layout::create_note): Don't crash if linker script discards
8696 section.
8697 (Layout::create_gold_note): Likewise.
8698 (Layout::create_build_id): Likewise. Don't set
8699 after_input_sections on the section.
8700 (Layout::create_executable_stack_info): Remove target parameter.
8701 Change caller.
8702 * layout.h (class Layout): Declare create_notes. Update
8703 declaration of create_executable_stack_info.
8704 * gold.cc (queue_middle_tasks): Call create_notes.
8705 * output.cc (Output_section::update_flags_for_input_section): Move
8706 here from output.h. If SHF_ALLOC flag is newly set, mark address
8707 invalid.
8708 * output.h (Output_data::mark_address_invalid): New function.
8709 (class Output_section): Only declare, not define,
8710 update_flags_for_input_section. Remove set_flags.
8711
8712 2009-06-24 Ian Lance Taylor <iant@google.com>
8713
8714 * script-sections.cc (Output_section_definition::
8715 set_section_addresses): Rename shadowing local load_address to
8716 laddr.
8717
8718 2009-06-24 Ian Lance Taylor <iant@google.com>
8719
8720 PR 10244
8721 * reloc.cc (relocate_sections): Skip empty relocation sections.
8722
8723 2009-06-23 Ian Lance Taylor <iant@google.com>
8724
8725 PR 10156
8726 * layout.cc (Layout::create_note): Use choose_output_section
8727 rather than make_output_section.
8728
8729 2009-06-23 Ian Lance Taylor <iant@google.com>
8730
8731 PR 10237
8732 * options.cc (General_options::parse_V): Set printed_version_.
8733 (General_options::General_options): Initialize printed_version_.
8734 * options.h (class General_options): Add printed_version_ field.
8735 * gold.cc (queue_initial_tasks): If there are no input files,
8736 don't give a fatal error if we printed the version information.
8737 (queue_middle_tasks): If using -r with a shared object, give a
8738 fatal error rather than an ordinary error.
8739
8740 2009-06-23 Ian Lance Taylor <iant@google.com>
8741
8742 PR 10219
8743 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8744 (Layout::make_output_section): Set have_stabstr_section_ if we see
8745 a .stab*str section.
8746 (Layout::finalize): Call link_stabs_sections.
8747 (Layout::link_stabs_sections): New file.
8748 * layout.h (class Layout): Add have_stabstr_section_ field.
8749 Declare link_stabs_sections.
8750
8751 2009-06-23 Doug Kwan <dougkwan@google.com>
8752
8753 * Makefile.am (libgold_a_LIBADD): New.
8754 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8755 * Makefile.in: Regenerate.
8756 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8757 * configure: Regenerate.
8758 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8759 * fileread.cc: Include sys/state.h
8760 * gold.h: Declare memmem and strndup if found missing.
8761 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8762
8763 2009-06-23 Ian Lance Taylor <iant@google.com>
8764
8765 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8766 * configure: Rebuild.
8767
8768 2009-06-23 Ian Lance Taylor <iant@google.com>
8769
8770 PR 10147
8771 * object.cc (Object::section_contents): Don't try to get a view if
8772 the section has length zero.
8773 (Object::handle_gnu_warning_section): If the section is empty, use
8774 the name of the section as the warning.
8775
8776 2009-06-23 Ian Lance Taylor <iant@google.com>
8777
8778 PR 10133
8779 * stringpool.h (class Stringpool_template): Add optimize_ field.
8780 (Stringpool_template::set_optimize): New function.
8781 * stringpool.cc (Stringpool_template::Stringpool_template):
8782 Initialize optimize_ field.
8783 (Stringpool_template::set_string_offsets): Test local optimize
8784 fild rather than parameter.
8785 * layout.cc (Layout::Layout): Call set_optimize on the section
8786 name stringpool.
8787
8788 2009-06-22 Ian Lance Taylor <iant@google.com>
8789
8790 PR 10030
8791 * yyscript.y: Parse TARGET.
8792 * script.cc (script_set_target): New function.
8793 * script-c.h (script_set_target): Declare.
8794 * options.cc (General_options::string_to_object_format): Rename
8795 from string_to_object_format in anonymous namespace. Change
8796 callers.
8797 * options.h (class General_options): Declare
8798 string_to_object_format.
8799
8800 2009-06-22 Ian Lance Taylor <iant@google.com>
8801
8802 * script-sections.cc (Script_sections::create_segments): Don't put
8803 program headers in a PT_LOAD segment if -n or -N.
8804
8805 2009-06-22 Ian Lance Taylor <iant@google.com>
8806
8807 PR 10141
8808 * options.h (class General_options): Add -z lazy and -z now. Sort
8809 -z options into alphabetical order.
8810 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8811
8812 2009-06-21 Ian Lance Taylor <iant@google.com>
8813
8814 * layout.cc (Layout::make_output_section): Call
8815 Target::new_output_section.
8816 (Layout::attach_allocated_section_to_segment): Put large section
8817 sections in a separate load segment with the large segment flag
8818 set.
8819 (Layout::segment_precedes): Sort large data segments after other
8820 load segments.
8821 (align_file_offset): New static function.
8822 (Layout::set_segment_offsets): Use align_file_offset.
8823 * output.h (class Output_section): Add is_small_section_ and
8824 is_large_section_ fields.
8825 (Output_section::is_small_section): New function.
8826 (Output_section::set_is_small_section): New function.
8827 (Output_section::is_large_section): New function.
8828 (Output_section::set_is_large_section): New function.
8829 (Output_section::is_large_data_section): New function.
8830 (class Output_segment): Add is_large_data_segment_ field.
8831 (Output_segment::is_large_data_segment): New function.
8832 (Output_segment::set_is_large_data_segment): New function.
8833 * output.cc (Output_section::Output_section): Initialize new
8834 fields.
8835 (Output_segment::Output_segment): Likewise.
8836 (Output_segment::add_output_section): Add assertion that large
8837 data sections always go in large data segments. Force small data
8838 sections to the end of the list of data sections. Force small BSS
8839 sections to the start of the list of BSS sections. For large BSS
8840 sections to the end of the list of BSS sections.
8841 * symtab.h (class Symbol): Declare is_common_shndx.
8842 (Symbol::is_defined): Check Symbol::is_common_shndx.
8843 (Symbol::is_common): Likewise.
8844 (class Symbol_table): Define enum Commons_section_type. Update
8845 declarations. Add small_commons_ and large_commons_ fields.
8846 * symtab.cc (Symbol::is_common_shndx): New function.
8847 (Symbol_table::Symbol_table): Initialize new fields.
8848 (Symbol_table::add_from_object): Put small and large common
8849 symbols in the right list.
8850 (Symbol_table::sized_finalized_symbol): Check
8851 Symbol::is_common_shndx.
8852 (Symbol_table::sized_write_globals): Likewise.
8853 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8854 common symbol lists. Don't call do_allocate_commons_list if the
8855 list is empty.
8856 (Symbol_table::do_allocate_commons_list): Remove is_tls
8857 parameter. Add comons_section_type parameter. Change all
8858 callers. Handle small and large common symbols.
8859 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8860 Symbol::is_common_shndx.
8861 * resolve.cc (symbol_to_bits): Likewise.
8862 * target.h (Target::small_common_shndx): New function.
8863 (Target::small_common_section_flags): New function.
8864 (Target::large_common_shndx): New function.
8865 (Target::large_common_section_flags): New function.
8866 (Target::new_output_section): New function.
8867 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8868 small_common_section_flags, and large_common_section_flags
8869 fields.
8870 (Target::do_new_output_section): New virtual function.
8871 * arm.cc (Target_arm::arm_info): Initialize new fields.
8872 * i386.cc (Target_i386::i386_info): Likewise.
8873 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8874 Likewise.
8875 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8876 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8877 (Target_x86_64::do_new_output_section): New function.
8878 * configure.ac: Define conditional MCMODEL_MEDIUM.
8879 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8880 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8881 (large_LDFLAGS): Define.
8882 * testsuite/large.c: New file.
8883 * testsuite/testfile.cc (Target_test::test_target_info):
8884 Initialize new fields.
8885 * configure, testsuite/Makefile.in: Rebuild.
8886
8887 2009-06-05 Doug Kwan <dougkwan@google.com>
8888
8889 * Makefile.am (CCFILES): Add target.cc.
8890 * Makefile.in: Regenerate.
8891 * i386.cc (class Target_i386): Define new virtual method to
8892 override do_is_local_label_name in parent.
8893 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8894 local symbols if --discard-locals or -X is given.
8895 * options.h (class General_options): Declare new options
8896 '--discard-locals' and '-X' for discarding locals.
8897 * target.h (class Target): Define new methods is_local_label_name.
8898 Declare new virtual method do_is_local_label_name.
8899 * target.cc: New file.
8900 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8901 (check_SCRIPTS): Add discard_locals_test.sh.
8902 (check_DATA): Add discard_local_tests.syms.
8903 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8904 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8905 * testsuite/Makefile.in: Regenerate.
8906 * testsuite/discard_locals_test.c: New file.
8907 * testsuite/discard_locals_test.sh: Same.
8908
8909 2009-06-05 Doug Kwan <dougkwan@google.com>
8910
8911 * object.cc (Sized_relobj::Sized_relobj): Initialize
8912 discarded_eh_frame_shndx_ to -1U.
8913 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8914 section.
8915 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8916 a discarded .eh_frame section.
8917 (Sized_relobj::do_finalize_local_symbols): Ditto.
8918 * object.h (class Sized_relobj): Declare new member
8919 discarded_eh_frame_shndx_.
8920 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8921 (local_labels_test.o, local_labels_test): New rules.
8922 * testsuite/Makefile.in: Regenerate.
8923
8924 2009-06-04 Doug Kwan <dougkwan@google.com>
8925
8926 * layout.cc (Layout::section_name_mapping): Add mapping for
8927 special ARM sections.
8928
8929 2009-06-03 Doug Kwan <dougkwan@google.com>
8930
8931 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8932 (utils::has_overflow): Same.
8933
8934 2009-06-03 Ian Lance Taylor <iant@google.com>
8935
8936 * layout.cc (Layout::section_name_mapping): New array, replacing
8937 Layout::linkonce_mapping.
8938 (Layout::section_name_mapping_count): New variable, replacing
8939 Layout::linkonce_mapping_count.
8940 (Layout::linkonce_output_name): Remove.
8941 (Layout::output_section_name): Rewrite.
8942 * layout.h (class Layout): Rename Linkonce_mapping to
8943 Section_name_mapping, linkonce_mapping to section_name_mapping,
8944 linkonce_mapping_count to section_name_mapping_count. Don't
8945 declare linkonce_output_name.
8946
8947 2009-06-03 Doug Kwan <dougkwan@google.com>
8948
8949 * gold/arm.cc (namespace utils): New.
8950 (Target_arm::reloc_is_non_pic): Define new method.
8951 (class Arm_relocate_functions): New.
8952 (Target_arm::Relocate::relocate): Handle relocation types used by
8953 Android.
8954
8955 2009-06-03 Ian Lance Taylor <iant@google.com>
8956
8957 * arm.cc (Target_arm::scan::global): Use || instead of |.
8958
8959 2009-06-02 Doug Kwan <dougkwan@google.com>
8960
8961 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8962 issued_non_pic_error_.
8963 (class Target_arm::Scan): Declare new method check_non_pic.
8964 Define new method symbol_needs_plt_entry.
8965 Declare new data member issued_non_pic_error_.
8966 (class Target_arm::Relocate): Declare new method
8967 should_apply_static_reloc.
8968 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8969 (Target_arm::Scan::check_non_pic): Define new method.
8970 (Target_arm::Scan::local): Handle a small subset of reloc types used
8971 by Android.
8972 (Target_arm::Scan::local): Same.
8973 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8974
8975 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8976
8977 * incremental.cc (Incremental_inputs::report_command_line): Filter
8978 out --incremental-* options.
8979
8980 2009-05-29 Doug Kwan <dougkwan@google.com>
8981
8982 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8983 template class.
8984 (class Target_arm): Update comment.
8985 (Target_arm::Target_arm): Initialize new data members GOT_,
8986 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8987 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8988 and Target_arm::rel_dyn_section.
8989 Declare new_enum Target_arm::Got_type.
8990 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8991 and DYNBSS_.
8992 Update commments for member do_dynsym_value.
8993 (Target_arm::got_size, Target_arm::plt_section,
8994 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8995 new methods inside class defintion.
8996 (Target_arm::got_section): Define new method.
8997 (Target_arm::rel_dyn_section): Same.
8998 (Output_data_plt_arm): New template class.
8999 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9000 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9001 (Output_data_plt_arm::add_entry): Same.
9002 (Output_data_plt_arm::first_plt_entry): Define new
9003 static data member for PLT instruction template.
9004 (Output_data_plt_arm::plt_entry): Same.
9005 (Output_data_plt_arm::do_write): Define new method.
9006 (Target_arm::make_plt_entry): Same.
9007 (Target_arm::do_finalize_sections): Same.
9008 (Target_arm::do_dynsym_value): Same.
9009
9010 2009-05-28 Doug Kwan <dougkwan@google.com>
9011
9012 * Makefile.am (TARGETSOURCES): Add arm.cc.
9013 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9014 * Makefile.in: Regenerate.
9015 * arm.cc: New file.
9016 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9017
9018 2009-05-26 Doug Kwan <dougkwan@google.com>
9019
9020 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9021 (General_options::check_excluded_libs): Strip off directories in
9022 archive name before matching like GNU ld does.
9023 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9024 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9025 (exclude_libs_test_LDFLAGS): Add linker option
9026 -Wl,--exclude-libs,libexclude_libs_test_3
9027 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9028 an explicit archive without using -l.
9029 (alt/libexclude_libs_test_3.a): New make rule.
9030 * testsuite/Makefile.in: Regenerate.
9031 * testsuite/exclude_libs_test.c : Declare lib3_default().
9032 (main): Call it.
9033 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9034 * exclude_libs_test_3.c: New file.
9035
9036 2009-05-26 Nick Clifton <nickc@redhat.com>
9037
9038 * po/id.po: New Indonesian translation.
9039 * po/gold.pot: Updated template file.
9040
9041 2009-05-22 Sriraman Tallam <tmsriram@google.com>
9042
9043 * testsuite/Makefile.am: Add -ffunction-sections to compile
9044 gc_comdat_test files. Add -Wl,--gc-sections to build
9045 gc_comdat_test.
9046 * testsuite/Makefile.in: Regenerate.
9047 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9048
9049 2009-05-21 Sriraman Tallam <tmsriram@google.com>
9050
9051 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9052 kept comdat section was garbage collected.
9053 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9054 * testsuite/Makefile.in: Regenerate.
9055 * testsuite/gc_comdat_test.sh: New file.
9056 * testsuite/gc_comdat_test_1.cc: New file.
9057 * testsuite/gc_comdat_test_2.cc: New file.
9058
9059 2009-05-19 Doug Kwan <dougkwan@google.com>
9060
9061 * archive.cc (Archive::Archive): Move constructor from archive.h
9062 to here. Initialize no_export_.
9063 (Archive::get_elf_object_for_member): Set no_export flag of object.
9064 * archive.h (Archive::Archive): Move constructor body to
9065 archive.cc.
9066 (Archive::no_export): New method.
9067 (Archive::no_export_): New field.
9068 * object.h (Object::Object): Initialize no_export_ to false.
9069 (Object::no_export, Object::set_no_export): New methods.
9070 (Object::no_export_): New field.
9071 * options.cc (General_options::parse_exclude_libs): New method.
9072 (General_options::check_excluded_libs) Same.
9073 * options.h (exclude_libs): New option.
9074 (General_options::check_excluded_libs): New method declaration.
9075 (General_options::excluded_libs_): New field.
9076 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9077 default or protected visibility if an object has no-export flag set.
9078 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9079 (check_SCRIPTS): Add exclude_libs_test.sh.
9080 (check_DATA): Add exclude_libs_test.syms.
9081 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9082 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9083 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9084 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9085 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9086 libexclude_libs_test_2.a): New rules.
9087 * testsuite/Makefile.in: Regenerate.
9088 * testsuite/exclude_libs_test.c: New file.
9089 * testsuite/exclude_libs_test.sh: Ditto.
9090 * testsuite/exclude_libs_test_1.c: Ditto.
9091 * testsuite/exclude_libs_test_2.c: Ditto.
9092
9093 2009-05-15 Ian Lance Taylor <iant@google.com>
9094
9095 * configure.ac: Check for declarations for cases where libiberty.h
9096 checks HAVE_DECL_xxx.
9097 * configure, config.in: Rebuild.
9098
9099 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9100
9101 * gold.h (Incremental_argument_list): Remove (invalid) forward
9102 declaration.
9103 * incremental.cc (Incremental_inputs::report_achive): New method.
9104 (Incremental_inputs::report_object): New method.
9105 (Incremental_inputs::report_script): New method.
9106 (Incremental_inputs::finalize_inputs): New method.
9107 (Incremental_inputs::finalize): Call finalize_inputs().
9108 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9109 Create inputs entries.
9110 * incremental.h (Incremental_input_type): New enum.
9111 (Incremental_inputs::Incremental_input): Initialize new fields.
9112 (Incremental_inputs::report_inputs): New method.
9113 (Incremental_inputs::report_achive): New method.
9114 (Incremental_inputs::report_object): New method.
9115 (Incremental_inputs::report_script): New method.
9116 (Incremental_inputs::finalize_inputs): New method.
9117 (Incremental_inputs::Input_info): New struct.
9118 (Incremental_inputs::Input_info_map): New typedef.
9119 (Incremental_inputs::lock_): New field.
9120 (Incremental_inputs::Inputs_): New field.
9121 (Incremental_inputs::Inputs_map): New field.
9122 * main.cc (main): Call Incremental_input::report_inputs.
9123 * options.h (Input_argument_list): Typedef moved from
9124 Input_arguments.
9125 (Input_file_group::Files): Remove, use ::Input_argument_list.
9126 (Input_file_group::Input_argument_list): Remove, use
9127 ::Input_argument_list.
9128 * plugin.cc (Plugin_manager::add_input_file): Add error in
9129 incremental build.
9130 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9131 functions.
9132 * script.cc (read_input_script): Call
9133 Incremental_input::report_script.
9134 * script.h (Script_info): New class.
9135
9136 2009-04-27 Ian Lance Taylor <iant@google.com>
9137
9138 * x86_64.cc (do_adjust_output_section): Set entsize to
9139 plt_entry_size.
9140
9141 2009-04-23 Elliott Hughes <enh@google.com>
9142
9143 * output.cc (Output_file::close): After short writes, continue
9144 writing from the correct offset in the buffer being written.
9145
9146 2009-04-23 Chris Demetriou <cgd@google.com>
9147
9148 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9149 * configure: Regenerate.
9150 * config.in: Regenerate.
9151 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9152 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9153
9154 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9155
9156 * incremental.cc (Incremental_inputs_header_data): Renamed from
9157 Incremental_input_header_data.
9158 (Incremental_inputs_header_data::data_size): New field.
9159 (Incremental_inputs_header_data::put_input_file_count): Renamed
9160 from input_file_count.
9161 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9162 from command_line_offset.
9163 (Incremental_inputs_header_data::put_reserved): Renamed from
9164 put_reserved.
9165 (Incremental_inputs_entry_data): Renamed from
9166 Incremental_input_entry_data.
9167 (Incremental_inputs_entry_data::data_size): New field.
9168 (Incremental_inputs::report_command_line): New method.
9169 (Incremental_inputs::finalize): New method.
9170 (Incremental_inputs::create_incremental_inputs_data): New method.
9171 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9172 * incremental.h: New file.
9173 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9174 (Layout::finalize): Create incremental inputs section in
9175 incremental builds.
9176 (Layout::create_incremental_info_sections): New method.
9177 * layout.h (Layout::incremental_inputs): New method.
9178 (Layout::create_incremental_info_sections): New method.
9179 (Layout::incremental_inputs_): New field.
9180 * main.cc (main): Notify Incremental_input of the command line.
9181
9182 2009-04-01 Ian Lance Taylor <iant@google.com>
9183 Mikolaj Zalewski <mikolajz@google.com>
9184
9185 * gold.h (reserve_unordered_map): Define, three versions, one for
9186 each version of Unordered_map.
9187 * layout.cc (Layout::Layout): Remove options parameter. Add
9188 number_of_input_files parameter. Don't initialize options_.
9189 Initialize number_of_input_files_ and resized_signatures_. Move
9190 sections_are_attached_.
9191 (Layout::layout_group): Reserve space for group_signatures_.
9192 (Layout::find_or_add_kept_section): Change name parameter to be a
9193 reference. Resize signatures_ map when it gets large enough.
9194 (Layout::layout_eh_frame): Use parameters->options() instead of
9195 this->options_.
9196 (Layout::make_output_section): Likewise.
9197 (Layout::attach_allocated_section_to_segment): Likewise.
9198 (Layout::finalize, Layout::create_executable_stack): Likewise.
9199 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9200 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9201 * layout.h (class Layout): Update declarations. Remove options_
9202 field. Add number_of_input_files_ and resized_signatures_
9203 fields. Move sections_are_attached_ field.
9204 * main.cc (main): Pass number of input files to Layout
9205 constructor. Don't pass options.
9206
9207 2009-03-30 Ian Lance Taylor <iant@google.com>
9208
9209 * ffsll.c (ffsll): Correct implementation.
9210
9211 2009-03-27 Ian Lance Taylor <iant@google.com>
9212
9213 * ffsll.c: New file.
9214 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9215 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9216 * ftruncate.c (ftruncate): Declare before definition.
9217 * mremap.c (mremap): Likewise.
9218 * pread.c (pread): Likewise.
9219 * configure, Makefile.in, config.in: Rebuild.
9220
9221 * mremap.c: New file.
9222 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9223 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9224 (mremap): Declare if HAVE_MREMAP is not defined.
9225 * configure, Makefile.in, config.in: Rebuild.
9226
9227 2009-03-27 Cary Coutant <ccoutant@google.com>
9228
9229 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9230 position independent.
9231 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9232 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9233
9234 2009-03-24 Cary Coutant <ccoutant@google.com>
9235
9236 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9237 an executable.
9238 (needs_dynamic_reloc): Likewise.
9239
9240 2009-03-24 Ian Lance Taylor <iant@google.com>
9241
9242 * yyscript.y (file_cmd): Recognize EXTERN.
9243 (extern_name_list, extern_name_list_body): New nonterminals.
9244 * script.cc (script_add_extern): Define.
9245 * script-c.h (script_add_extern): Declare.
9246
9247 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
9248
9249 * object.cc (is_elf_object): Define.
9250 * object.h (is_elf_object): Declare.
9251 * archive.cc (Archive::get_elf_object_for_member): Call
9252 is_elf_object.
9253 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
9254
9255 2009-03-24 Elliott Hughes <enh@google.com>
9256
9257 * output.cc (Output_file::map_anonymous): Define.
9258 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9259 try an anonymous one. Report the size if the mmap fails.
9260 * output.h (class Output_file): Declare map_anonymous.
9261
9262 2009-03-24 Ian Lance Taylor <iant@google.com>
9263
9264 * target-select.cc (instantiate_target): Don't acquire the lock if
9265 the instantiated_target_ field has already been set.
9266
9267 2009-03-23 Ian Lance Taylor <iant@google.com>
9268
9269 * gold-threads.h (class Initialize_lock): Define.
9270 * gold-threads.cc (class Initialize_lock_once): Define.
9271 (initialize_lock_control): New static variable.
9272 (initialize_lock_pointer): New static variable.
9273 (initialize_lock_once): New static function.
9274 (Initialize_lock::Initialize_lock): Define.
9275 (Initialize_lock::initialize): Define.
9276 * target-select.h: Include "gold-threads.h".
9277 (class Target_selector): Add lock_ and initialize_lock_ fields.
9278 Don't define instantiate_target, just declare it.
9279 * target-select.cc (Target_selector::Target_selector): Initialize
9280 new fields.
9281 (Target_selector::instantiate_target): Define.
9282 * descriptors.h: Include "gold-threads.h".
9283 (class Descriptors): Add initialize_lock_ field.
9284 * descriptors.cc (Descriptors::Descriptors): Initialize new
9285 field.
9286 (Descriptors::open): Use initialize_lock_ field
9287 * errors.h (class Errors): Add initialize_lock_ field.
9288 * errors.cc (Errors::Errors): Initialize new field.
9289 (Errors::initialize_lock): Use initialize_lock_ field.
9290 * powerpc.cc (class Target_selector_powerpc): Remove
9291 instantiated_target_ field. In do_recognize call
9292 instantiate_target rather than do_instantiate_target. In
9293 do_instantiate_target just allocate a new target.
9294 * sparc.cc (class Target_selector_sparc): Likewise.
9295
9296 * freebsd.h: New file.
9297 * i386.cc: Include "freebsd.h".
9298 (Target_i386): Derive from Target_freebsd rather than
9299 Sized_target.
9300 (Target_selector_i386): Derive from Target_selector_freebsd rather
9301 than Target_selector.
9302 * x86_64.cc: Include "freebsd.h".
9303 (Target_x86_64): Derive from Target_freebsd rather than
9304 Sized_target.
9305 (Target_selector_x86_64): Derive from Target_selector_freebsd
9306 rather than Target_selector.
9307 * target.h (class Target): Add adjust_elf_header and
9308 do_adjust_elf_header.
9309 * output.cc (Output_file_header:: do_sized_write): Call target
9310 adjust_elf_header routine.
9311 * configure.tgt: Set targ_osabi.
9312 * configure.ac: Define GOLD_DEFAULT_OSABI.
9313 * parameters.cc (Parameters::default_target): Pass
9314 GOLD_DEFAULT_OSABI to select_target.
9315 * target-select.h (class Target_selector): Make instantiate_target
9316 protected rather than private.
9317 * Makefile.am (HFILES): Add freebsd.h.
9318 * configure, Makefile.in, config.in: Rebuild.
9319
9320 * merge.cc (do_add_input_section): Correct pend value. Change
9321 message about last entry not being null terminated from error to
9322 warning.
9323
9324 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9325
9326 * incremental.cc: New file.
9327 * Makefile.am (CCFILES): Add incremental.cc.
9328 * Makefile.in: Rebuild.
9329
9330 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9331
9332 * layout.cc (Layout::output_section_name): Preserve names
9333 of '.note.' sections.
9334
9335 2009-03-19 Ian Lance Taylor <iant@google.com>
9336
9337 * descriptors.cc (Descriptors::open): Check that the options are
9338 valid before using them.
9339
9340 2009-03-18 Ian Lance Taylor <iant@google.com>
9341
9342 * script-sections.h: Include <list>.
9343 (class Script_sections): Change Sections_elements from std::vector
9344 to std::list. Typedef public Elements_iterator. Add
9345 orphan_section_placement_, data_segment_align_start_, and
9346 saw_data_segment_align_ fields. Remove data_segment_align_index_
9347 field.
9348 * script-sections.cc (class Orphan_section_placement): New class.
9349 (class Sections_element): Add virtual functions is_relro and
9350 orphan_section_init. Remove virtual function place_orphan_here.
9351 (class Output_section_definition): Add is_relro and
9352 orphan_section_init. Remove place_orphan_here.
9353 (class Orphan_output_section): Likewise.
9354 (Script_sections::Script_sections): Update for field changes.
9355 (Script_sections::data_segment_align): Set saw_data_segment_align_
9356 and data_segment_align_start_, not data_segment_align_index.
9357 (Script_sections::data_segment_relro_end): Check
9358 saw_data_segment_align_. Use data_segment_align_start_ rather
9359 than data_segment_align_index_.
9360 (Script_sections::place_orphan): Rewrite to use
9361 Orphan_section_placement.
9362
9363 2009-03-17 Ian Lance Taylor <iant@google.com>
9364
9365 * archive.cc (Archive::add_symbols): Check for a version attached
9366 to the symbol name in the archive map.
9367 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9368 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9369 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9370 (ver_test_11.a): New target.
9371 * testsuite/Makefile.in: Rebuild.
9372
9373 * configure.ac: Check for chsize and posix_fallocate. Replace
9374 ftruncate.
9375 * ftruncate.c: New file, from gnulib.
9376 * output.cc (posix_fallocate): Define dummy version if not
9377 HAVE_POSIX_FALLOCATE.
9378 (Output_file::map): Call posix_fallocate rather than lseek and
9379 write.
9380 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9381 * configure, Makefile.in, config.in: Rebuild.
9382
9383 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
9384
9385 * layout.h (Layout::create_note): Add section_name parameter.
9386 * layout.cc (Layout::create_note): Likewise.
9387 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
9388
9389 2009-03-17 Ian Lance Taylor <iant@google.com>
9390
9391 * descriptors.cc: Include "options.h".
9392 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9393 (Descriptors::open): Always use O_CLOEXEC when opening a new
9394 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9395 then set FD_CLOEXEC.
9396
9397 * sparc.cc (class Target_sparc): Add has_got_section.
9398 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9399 make sure we have a GOT section.
9400
9401 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9402 (Target_sparc::Scan::local): Likewise.
9403 (Target_sparc::Scan::global): Likewise.
9404 (Target_sparc::Relocate::relocate): Likewise.
9405 (Target_sparc::Relocate::relocate_tls): Likewise.
9406
9407 * symtab.cc (Symbol_table::define_default_version): New function,
9408 broken out of add_from_object.
9409 (Symbol_table::add_from_object): Call define_default_version.
9410 (Symbol_table::define_special_symbol): Add resolve_oldsym
9411 parameter. Change all callers. If the version for a symbol comes
9412 from a version script, resolve it with the symbol with the same
9413 name with no version. Also add the symbol without a version if
9414 appropriate.
9415 (do_define_in_output_data): If resolving with oldsym, don't delete
9416 sym.
9417 (do_define_in_output_segment): Likewise.
9418 (do_define_as_constant): Likewise.
9419 * symtab.h (class Symbol_table): Update declarations.
9420
9421 2009-03-13 Ian Lance Taylor <iant@google.com>
9422
9423 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9424 (Read_symbols::requeue): New function.
9425 (Read_symbols::do_read_symbols): If make_elf_object fails because
9426 the target type is not configured, and the file was searched for,
9427 issue a warning and retry with the next directory.
9428 (Add_symbols::run): If the file has an incompatible format, and
9429 it was searched for, requeue the Read_symbols task. On error,
9430 release the object.
9431 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9432 dirindex parameter to constructor. Change all callers. Declare
9433 incompatible_warning and requeue.
9434 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9435 input_argument_ and input_group_ fields. Add them to
9436 constructor. Change all callers.
9437 (class Read_script): Add dirindex_ field. Add it to constructor.
9438 Change all callers.
9439 * archive.cc (Archive::setup): Remove input_objects parameter.
9440 Change all callers.
9441 (Archive::get_file_and_offset): Likewise.
9442 (Archive::read_all_symbols): Likewise.
9443 (Archive::read_symbols): Likewise.
9444 (Archive::get_elf_object_for_member): Remove input_objects
9445 parameter. Add punconfigured parameter. Change all callers.
9446 (Archive::add_symbols): Change return type to bool. Check return
9447 value of include_member.
9448 (Archive::include_all_members): Likewise.
9449 (Archive::include_member): Change return type to bool. Return
9450 false if first included object has incompatible target. Set
9451 included_member_ field.
9452 (Add_archive_symbols::run): If add_symbols returns false, requeue
9453 Read_symbols task.
9454 * archive.h (class Archive): Add included_member_ field.
9455 Initialize it in constructor. Add input_file and searched_for
9456 methods. Update declarations.
9457 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9458 input_argument_ fields. Add them to constructor. Change all
9459 callers.
9460 * script.cc: Include "target-select.h".
9461 (class Parser_closure): Add skip_on_incompatible_target_ and
9462 found_incompatible_target_ fields. Add
9463 skip_on_incompatible_target parameter to constructor. Change all
9464 callers. Add methods skip_on_incompatible_target,
9465 clear_skip_on_incompatible_target, found_incompatible_target, and
9466 set_found_incompatible_target.
9467 (read_input_script): Add dirindex parameter. Change all callers.
9468 If parser finds an incompatible target, requeue Read_symbols
9469 task.
9470 (script_set_symbol): Clear skip_on_incompatible_target in
9471 closure.
9472 (script_add_assertion, script_parse_option): Likewise.
9473 (script_start_sections, script_add_phdr): Likewise.
9474 (script_check_output_format): New function.
9475 * script.h (read_input_script): Update declaration.
9476 * script-c.h (script_check_output_format): Declare.
9477 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9478 (ignore_cmd): Remove OUTPUT_FORMAT.
9479 * fileread.cc (Input_file::Input_file): Add explicit this.
9480 (Input_file::will_search_for): New function.
9481 (Input_file::open): Add pindex parameter. Change all callers.
9482 * fileread.h (class Input_file): Add input_file_argument method.
9483 Declare will_search_for. Update declarations.
9484 * object.cc (make_elf_object): Add punconfigured parameter.
9485 Change all callers.
9486 * object.h (class Object): Make input_file public. Add
9487 searched_for method.
9488 (make_elf_object): Update declaration.
9489 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9490 restart search.
9491 * dirsearch.h (class Dirsearch): Update declaration.
9492 * options.h (class General_options): Add --warn-search-mismatch.
9493 * parameters.cc (Parameters::is_compatible_target): New function.
9494 * parameters.h (class Parameters): Declare is_compatible_target.
9495 * workqueue.cc (Workqueue::add_blocker): New function.
9496 * workqueue.h (class Workqueue): Declare add_blocker.
9497
9498 * fileread.cc (Input_file::open): Remove options parameter.
9499 Change all callers.
9500 (Input_file::open_binary): Likewise.
9501 * script.cc (read_input_script): Likewise.
9502 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9503 options parameter from constructor. Change all callers.
9504 (class Read_script): Likewise.
9505 * fileread.h (class Input_file): Update declarations.
9506 * script.h (read_input_script): Update declaration.
9507
9508 2009-03-10 Nick Clifton <nickc@redhat.com>
9509
9510 * po/es.po: New Spanish translation.
9511
9512 2009-03-06 Cary Coutant <ccoutant@google.com>
9513
9514 * options.cc (parse_short_option): Keep dash_z from registering itself.
9515
9516 2009-03-03 Ian Lance Taylor <iant@google.com>
9517
9518 PR 9918
9519 * target-reloc.h (relocate_section): Pass output_section to
9520 relocate.
9521 * i386.cc (Target_i386::should_apply_static_reloc): Add
9522 output_section parameter. Change all callers.
9523 (Target_i386::Relocate::relocate): Add output_section parameter.
9524 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9525 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9526 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9527 * testsuite/two_file_shared.sh: New script.
9528 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9529 (check_DATA): Add two_file_shared.dbg.
9530 (two_file_shared.dbg): New target.
9531 * testsuite/Makefile.in: Rebuild.
9532
9533 2009-03-01 Ian Lance Taylor <iant@google.com>
9534
9535 * configure.ac: Check for byteswap.h.
9536 * configure: Rebuild.
9537 * config.in: Rebuild.
9538
9539 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9540
9541 * layout.cc (Layout::find_or_add_kept_section): New function.
9542 (Layout::add_comdat): Removed.
9543 * layout.h (struct Kept_section): Move out of class Layout.
9544 Remove trailing underscores from field names. Add group_sections
9545 field. Rename group_ field to is_group. Change all uses.
9546 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9547 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9548 comdat_groups_ field.
9549 (Sized_relobj::include_section_group): Use
9550 find_or_add_kept_section and Kept_section::group_sections.
9551 (Sized_relobj::include_linkonce_section): Likewise.
9552 * object.cc (class Sized_relobj): Don't define Comdat_group or
9553 Comdat_group_table. Remove find_comdat_group and
9554 add_comdat_group. Remove comdat_groups_ field.
9555 * plugin.cc (include_comdat_group): Use
9556 Layout::find_or_add_kept_section.
9557
9558 2009-02-28 Ian Lance Taylor <iant@google.com>
9559
9560 * README: --gc-sections and map files are now supported. Document
9561 some build requirements.
9562
9563 PR 6992
9564 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9565 relocatable link set the value of the section symbol to zero.
9566 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9567 relocatable link don't include the section address in the local
9568 symbol value.
9569
9570 2009-02-27 Ian Lance Taylor <iant@google.com>
9571
9572 PR 6811
9573 * options.h (class Search_directory): Add is_system_directory.
9574 (class General_options): Declare is_in_system_directory.
9575 * options.cc (get_relative_sysroot): Make static.
9576 (get_default_sysroot): Make static.
9577 (General_optoins::is_in_system_directory): New function.
9578 * fileread.cc (Input_file::is_in_system_directory): New function.
9579 * fileread.h (class Input_file): Declare is_in_system_directory.
9580 * object.h (class Object): Add is_in_system_directory.
9581 (class Input_objects): Remove system_library_directory_ field.
9582 * object.cc (Input_objects::add_object): Don't set
9583 system_library_directory_.
9584 (input_objects::found_in_system_library_directory): Remove.
9585 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9586 parameter. Change all callers.
9587 (Symbol_table::sized_write_globals): Likewise.
9588 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9589 Call Object::is_in_system_directory.
9590 * symtab.h (class Symbol_table): Update declarations.
9591
9592 PR 5990
9593 * descriptors.h (Open_descriptor): Add is_on_stack field.
9594 * descriptors.cc (Descriptors::open): If the descriptor is on the
9595 top of the stack, remove it. Initialize is_on_stack field.
9596 (Descriptors::release): Only add pod to stack if it is not on the
9597 stack already.
9598 (Descriptors::close_some_descriptor): Clear stack_next and
9599 is_on_stack fields.
9600
9601 PR 7091
9602 * output.cc (Output_section::find_starting_output_address): Rename
9603 from starting_output_address; add PADDR parameter; change return
9604 type.
9605 * output.h (class Output_section): Declare
9606 find_starting_output_address instead of starting_output_address.
9607 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9608 section symbol for which we can't find a merge section.
9609
9610 PR 9836
9611 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9612 hidden or internal, force the symbol to be local.
9613 * resolve.cc (Symbol::override_visibility): Define.
9614 (Symbol::override_base): Use override_visibility.
9615 (Symbol_table::resolve): Likewise.
9616 (Symbol::override_base_with_special): Likewise.
9617 (Symbol_table::override_with_special): If the visibility is hidden
9618 or internal, force the symbol to be local.
9619 * symtab.h (class Symbol): Add set_visibility and
9620 override_visibility.
9621 * testsuite/ver_test_1.sh: New file.
9622 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9623 (check_DATA): Add ver_test_1.syms.
9624 (ver_test_1.syms): New target.
9625 * testsuite/Makefile.in: Rebuild.
9626
9627 2009-02-25 Cary Coutant <ccoutant@google.com>
9628
9629 * layout.cc (Layout::choose_output_section): Don't rename sections
9630 when using a linker script that has a SECTIONS clause.
9631 * Makefile.in: Regenerate.
9632
9633 * testsuite/Makefile.am (script_test_5.sh): New test case.
9634 * testsuite/Makefile.in: Regenerate.
9635 * testsuite/script_test_5.cc: New file.
9636 * testsuite/script_test_5.sh: New file.
9637 * testsuite/script_test_5.t: New file.
9638
9639 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
9640
9641 * archive.cc (Archive::include_member): Update calls to add_symbols.
9642 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9643 the Layout argument.
9644 * dynobj.h (do_add_symbols): Add the Layout argument.
9645 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9646 Layout argument.
9647 * object.h (Object::add_symbols): Add the Layout argument.
9648 (Object::do_add_symbols): Add the Layout argument.
9649 (Sized_relobj::do_add_symbols): Add the Layout argument.
9650 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9651 Unify the two versions.
9652 (Add_plugin_symbols): Remove.
9653 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9654 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9655 (Add_plugin_symbols): Remove.
9656 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9657 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9658 (Add_symbols::run): Make it work with Pulginobj.
9659
9660 2009-02-06 Ian Lance Taylor <iant@google.com>
9661
9662 * object.cc (Sized_relobj::do_layout): Make info message start
9663 with lower case letter.
9664
9665 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9666
9667 * binary.cc: Fix file comment.
9668
9669 * options.h (enum Incremental_disposition): Define.
9670 (class General_options): Add new options: --incremental,
9671 --incremental_changed, --incremental_unchanged,
9672 --incremental_unknown. Add incremental_disposition_ and
9673 implicit_incremental_ fields.
9674 (General_options::incremental_disposition): New function.
9675 (class Position_dependent_options): Add incremental_disposition
9676 option.
9677 (Position_dependent_options::copy_from_options): Set incremental
9678 dispositions.
9679 * options.cc (General_options::parse_incremental_changed): New
9680 function.
9681 (General_options::parse_incremental_unchanged): New function.
9682 (General_options::parse_incremental_unknown): New function.
9683 (General_options::General_options): Initialize new fields
9684 incremental_disposition_ and implicit_incremental_.
9685 (General_options::finalize): Check for uasge of --incremental-*
9686 without --incremental.
9687
9688 2009-02-06 Chris Demetriou <cgd@google.com>
9689
9690 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9691 pointer and to report location as the file name associated with
9692 the symbol.
9693 (gold_undefined_symbol_at_location): New function to replace the
9694 old gold_undefined_symbol functionality.
9695 * target-reloc.h (relocate_section): Update to use
9696 gold_undefined_symbol_at_location.
9697 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9698 Call gold_undefined_symbol function rather than gold_error.
9699 * errors.h (Errors::undefined_symbol): Take location as a
9700 string, rather than calculating it from a relocation.
9701 * errors.cc (Errors::fatal): Print "fatal error:" before the
9702 formatted message.
9703 (Errors::error, Errors::error_at_location): Print "error: "
9704 before the formatted message.
9705 (Errors::undefined_symbol): Take location as a string, rather
9706 than calculating it from a relocation.
9707 (gold_undefined_symbol_at_location): New function akin to
9708 old gold_undefined_symbol, calculates location from relocation.
9709 (gold_undefined_symbol): Change to take only a Symbol pointer
9710 and to report location as the file name associated with the symbol.
9711 * testsuite/debug_msg.sh: Update for changed error messages.
9712 * testsuite/undef_symbol.sh: Likewise.
9713
9714 2009-02-04 Duncan Sands <baldrick@free.fr>
9715
9716 PR 9812
9717 * reduced_debug_output.h
9718 (Output_reduced_debug_abbrev_section::failed): Use format for
9719 gold_warning.
9720 (Output_reduced_debug_info_section::faild): Likewise.
9721
9722 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9723
9724 * script.cc (Lazy_demangler): New class.
9725 (Version_script_info::get_symbol_version_helper): Demangle a
9726 symbol only once.
9727
9728 2009-01-29 Cary Coutant <ccoutant@google.com>
9729
9730 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9731 to __tls_get_addr.
9732 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9733
9734 2009-01-28 Ian Lance Taylor <iant@google.com>
9735
9736 * version.cc (version_string): Bump to 1.9.
9737
9738 * gold.h: Include <cstring> and <stdint.h>.
9739 * version.cc: Include <cstdio>.
9740 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9741 warning.
9742 * reduced_debug_output.cc (insert_into_vector): Rename from
9743 Insert_into_vector; change all callers. Use Swap_unaligned to
9744 avoid aliasing issue; remove union since it is unnecessary.
9745
9746 2009-01-27 Sriraman Tallam <tmsriram@google.com>
9747
9748 * Makefile.am (CCFILES): Add gc.cc.
9749 (HFILES): Add gc.h.
9750 * Makefile.in: Regenerate.
9751 * gold.cc (Gc_runner): New class.
9752 (queue_initial_tasks): Call garbage collection related tasks
9753 when corresponding options are invoked.
9754 (queue_middle_gc_tasks): New function.
9755 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9756 processed early before laying out sections during garbage collection.
9757 * gold.h (queue_middle_gc_tasks): New function.
9758 (is_prefix_of): Move from "layout.cc".
9759 * i386.cc (Target_i386::gc_process_relocs): New function.
9760 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9761 * main.cc (main): Create object of class "Garbage_collection".
9762 * object.cc (Relobj::copy_symbols_data): New function.
9763 (Relobj::is_section_name_included): New function.
9764 (Sized_relobj::do_layout): Allow this function to be called twice
9765 during garbage collection and defer layout of section during the
9766 first call.
9767 * object.h (Relobj::get_symbols_data): New function.
9768 (Relobj::is_section_name_included): New function.
9769 (Relobj::copy_symbols_data): New function.
9770 (Relobj::set_symbols_data): New function.
9771 (Relobj::get_relocs_data): New function.
9772 (Relobj::set_relocs_data): New function.
9773 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9774 (Relobj::gc_process_relocs): New function.
9775 (Relobj::do_gc_process_relocs): New pure virtual function.
9776 (Relobj::sd_): New data member.
9777 (Sized_relobj::is_output_section_offset_invalid): New function.
9778 (Sized_relobj::do_gc_process_relocs): New function.
9779 * options.h (General_options::gc_sections): Modify to not be a no-op.
9780 (General_options::print_gc_sections): New option.
9781 * plugin.cc (Plugin_finish::run): Remove function call to
9782 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9783 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9784 * reloc.cc (Read_relocs::run): Add task to process relocs and
9785 determine unreferenced sections when doing garbage collection.
9786 (Gc_process_relocs): New class.
9787 (Sized_relobj::do_gc_process_relocs): New function.
9788 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9789 sections that are garbage collected.
9790 * reloc.h (Gc_process_relocs): New class.
9791 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9792 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9793 symbols whose corresponding sections are garbage collected.
9794 (Symbol_table::Symbol_table): Add new parameter for the garbage
9795 collection object.
9796 (Symbol_table::gc_mark_undef_symbols): New function.
9797 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9798 (Symbol_table::gc_mark_dyn_syms): New function.
9799 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9800 as garbage.
9801 (Symbol_table::add_from_object): Likewise.
9802 (Symbol_table::add_from_relobj): When building shared objects, do not
9803 treat externally visible symbols as garbage.
9804 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9805 table information for static and relocatable links.
9806 * symtab.h (Symbol_table::set_gc): New function.
9807 (Symbol_table::gc): New function.
9808 (Symbol_table::gc_mark_undef_symbols): New function.
9809 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9810 (Symbol_table::gc_mark_dyn_syms): New function.
9811 (Symbol_table::gc_): New data member.
9812 * target.h (Sized_target::gc_process_relocs): New pure virtual
9813 function.
9814 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9815 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9816
9817 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9818
9819 * options.h (General_options::gc_sections): Define as a no-op for now.
9820 (General_options::no_keep_memory): Ditto.
9821 (General_options::Bshareable): Define.
9822 * options.cc (General_options::finalize): Honor -Bshareable.
9823
9824 2009-01-20 Andreas Schwab <schwab@suse.de>
9825
9826 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9827 read the value in the contents, since we don't use it. Use the
9828 template endianness when writing.
9829 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9830
9831 2009-01-19 Andreas Schwab <schwab@suse.de>
9832
9833 * configure.tgt (powerpc64-*): Fix targ_obj.
9834
9835 2009-01-15 Ian Lance Taylor <iant@google.com>
9836
9837 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9838 local symbols when stripping all symbols.
9839
9840 2009-01-14 Cary Coutant <ccoutant@google.com>
9841
9842 * output.cc (Output_reloc): Add explicit instantiations.
9843
9844 2009-01-14 Cary Coutant <ccoutant@google.com>
9845
9846 * archive.cc (Archive::get_elf_object_for_member): Remove call
9847 to File_read::claim_for_plugin.
9848 * descriptors.cc (Descriptors::open): Remove reference to
9849 is_claimed.
9850 (Descriptors::claim_for_plugin): Remove.
9851 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9852 (Descriptors::is_claimed): Remove.
9853 (claim_descriptor_for_plugin): Remove.
9854 * fileread.cc (File_read::claim_for_plugin): Remove.
9855 * fileread.h (File_read::claim_for_plugin): Remove.
9856 (File_read::descriptor): Reopen descriptor if necessary.
9857 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9858 (Plugin_manager::all_symbols_read): Add task parameter. Change
9859 all callers.
9860 (Plugin_manager::get_input_file): New function.
9861 (Plugin_manager::release_input_file): New function.
9862 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9863 corresponding data member.
9864 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9865 and pass to base constructor. Change all callers.
9866 (get_input_file, release_input_file): New functions.
9867 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9868 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9869 (Plugin_manager::all_symbols_read): Add task parameter.
9870 (Plugin_manager::get_input_file): New function.
9871 (Plugin_manager::release_input_file): New function.
9872 (Plugin_manager::task_): New data member.
9873 (Pluginobj::Pluginobj): Add filesize parameter.
9874 (Pluginobj::filename): New function.
9875 (Pluginobj::descriptor): New function.
9876 (Pluginobj::filesize): New function.
9877 (Pluginobj::filesize_): New data member.
9878 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9879 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9880 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9881
9882 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9883 with archive libraries.
9884 * testsuite/Makefile.in: Regenerate.
9885 * testsuite/plugin_test.c (struct sym_info): New type.
9886 (get_input_file, release_input_file): New static variables.
9887 (onload): Capture new transfer vector entries.
9888 (claim_file_hook): Stop reading at end of file according to filesize.
9889 Factor out parsing of readelf output into separate function.
9890 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9891 APIs and get the source file name from the symbol table. Convert
9892 source file name to corresponding object file name. Print info
9893 message when adding new input files.
9894 (parse_readelf_line): New function.
9895 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9896 * testsuite/plugin_test_2.sh: Likewise.
9897 * testsuite/plugin_test_3.sh: Likewise.
9898 * testsuite/plugin_test_4.sh: New test case.
9899
9900 2009-01-07 Ian Lance Taylor <iant@google.com>
9901
9902 * version.cc (version_string): Bump to 1.8.
9903
9904 2008-12-23 Cary Coutant <ccoutant@google.com>
9905
9906 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9907 * plugin.cc (Plugin_manager::finish): Rename as
9908 layout_deferred_objects. Move cleanup to separate function.
9909 (Plugin_manager::cleanup): New function.
9910 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9911 separately.
9912 * plugin.h (Plugin_manager::finish): Rename as
9913 layout_deferred_objects.
9914 (Plugin_manager::cleanup): New function.
9915 (Plugin_manager::cleanup_done): New field.
9916
9917 2008-12-23 Cary Coutant <ccoutant@google.com>
9918
9919 * plugin.cc (is_visible_from_outside): New function.
9920 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9921 so we don't return "IR only" status for exported symbols or -r links.
9922
9923 * testsuite/Makefile.am (plugin_test_3): New test case.
9924 * testsuite/Makefile.in: Regenerate.
9925 * testsuite/plugin_test_3.sh: New file.
9926
9927 2008-12-22 Cary Coutant <ccoutant@google.com>
9928
9929 * object.cc (Sized_relobj::layout_section): New function.
9930 (Sized_relobj::do_layout): Defer layout of input sections until after
9931 plugin has provided replacement files.
9932 (Sized_relobj::do_layout_deferred_sections): New function.
9933 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9934 (Relobj::layout_deferred_sections): New function.
9935 (Relobj::do_layout_deferred_sections): New function.
9936 (Sized_relobj::do_layout_deferred_sections): New function.
9937 (Sized_relobj::layout_section): New function.
9938 (Sized_relobj::Deferred_layout): New structure.
9939 (Sized_relobj::deferred_layout_): New field.
9940 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9941 Change all callers. Layout deferred sections.
9942 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9943 references.
9944 (Plugin_hook::run): Move code from do_plugin_hook inline.
9945 (Plugin_hook::do_plugin_hook): Remove.
9946 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9947 (Plugin_manager::finish): Renamed, was cleanup.
9948 (Plugin_manager::should_defer_layout): New function.
9949 (Plugin_manager::add_deferred_layout_object): New function.
9950 (Plugin_manager::Deferred_layout_list): New type.
9951 (Plugin_manager::deferred_layout_objects_): New field.
9952 (Plugin_hook::do_plugin_hook): Remove.
9953
9954 2008-12-17 Ian Lance Taylor <iant@google.com>
9955
9956 * options.h (class General_options): Add --no case for
9957 --export-dynamic.
9958
9959 2008-12-16 Cary Coutant <ccoutant@google.com>
9960
9961 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9962 vector.
9963 (Plugin_manager::claim_file): Create plugin object even if
9964 plugin did not call the add_symbols callback.
9965 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9966 asking for more symbols than were added.
9967 * testsuite/Makefile.am (plugin_test_1): Add test case with
9968 no global symbols.
9969 (empty.syms): New target.
9970 * testsuite/Makefile.in: Regenerate.
9971 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9972 message. Don't call add_symbols if no globals.
9973 (all_symbols_read_hook): Don't provide replacement for empty
9974 claimed file.
9975
9976 2008-12-12 Ian Lance Taylor <iant@google.com>
9977
9978 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9979 r_type == 0 for a local symbol with r_sym == 0.
9980 (scan_relocatable_relocs): Pass r_sym to
9981 local_non_section_strategy.
9982 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9983 r_sym parameter.
9984
9985 * configure.ac: Update test for TLS descriptors: they are
9986 supported as of glibc 2.9.
9987 * configure: Rebuild.
9988
9989 2008-12-11 Ian Lance Taylor <iant@google.com>
9990
9991 PR 7091
9992 * target-reloc.h (Default_scan_relocatable_relocs): For each
9993 function, map r_type == 0 to RELOC_DISCARD.
9994
9995 2008-12-10 Cary Coutant <ccoutant@google.com>
9996
9997 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9998 object to override a kept COMDAT group from a plugin object.
9999
10000 2008-12-09 Ian Lance Taylor <iant@google.com>
10001
10002 PR 7088
10003 * yyscript.y (file_cmd): Handle INPUT.
10004
10005 * testsuite/initpri1.c: Change all declarations to be full
10006 prototypes by adding void, to avoid compiler warnings.
10007
10008 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
10009
10010 * options.cc (General_options::parse_plugin_opt): New.
10011 (General_options::add_plugin): The argument now is just the filename.
10012 (General_options::add_plugin_option): New.
10013 * options.h (plugin_opt): New.
10014 (add_plugin): Change argument name.
10015 (add_plugin_option): New.
10016 * plugin.cc (Plugin::load): Don't parse the plugin option.
10017 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10018 (Plugin::add_option): New.
10019 (Plugin::args_): Change type.
10020 (Plugin::filename_): New.
10021 (Plugin_manager::add_plugin_option): New.
10022 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10023 * testsuite/Makefile.in: Regenerate.
10024
10025 2008-12-05 Cary Coutant <ccoutant@google.com>
10026
10027 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10028 Handle --strip-lto-sections option.
10029 * options.h (strip_lto_sections): New option.
10030
10031 2008-12-01 Cary Coutant <ccoutant@google.com>
10032
10033 * plugin.cc (ld_plugin_message): Change format parameter to const.
10034 Fix mismatch between new[] and delete.
10035
10036 2008-11-14 Cary Coutant <ccoutant@google.com>
10037
10038 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10039 instead of -1U.
10040
10041 2008-11-05 Craig Silverstein <csilvers@google.com>
10042
10043 * options.cc (General_options::parse_dynamic_list): New function.
10044 * options.h (General_options): New flags dynamic_list,
10045 dynamic_list_data, dynamic_list_cpp_new, and
10046 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10047 (General_options::in_dynamic_list): New function.
10048 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10049 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10050 (Lex::can_continue_name): Likewise.
10051 (yylex): Likewise.
10052 (read_script_file): New parameter script_options.
10053 (read_dynamic_list): New function.
10054 (Script_options::define_dynamic_list): New function.
10055 (dynamic_list_keyword_parsecodes): New variable.
10056 (dynamic_list_keywords): New variable.
10057 * script.h (Script_options::define_dynamic_list): New function
10058 prototype.
10059 (read_dynamic_list): New function prototype.
10060 * symtab.cc (strprefix): New macro.
10061 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10062 dynamic_list_data, dynamic_list_cpp_new, and
10063 dynamic_list_cpp_typeinfo.
10064 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10065 (dynamic_list_expr): New rule.
10066 (dynamic_list_nodes): Likewise.
10067 (dynamic_list_node): Likewise.
10068 * testsuite/Makefile.am (dynamic_list): New test.
10069 * testsuite/Makefile.in: Regenerated.
10070 * testsuite/dynamic_list.t: New file.
10071 * testsuite/dynamic_list.sh: New file.
10072
10073 2008-11-05 Craig Silverstein <csilvers@google.com>
10074
10075 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10076 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10077 (t11_last): Likewise.
10078 * testsuite/ver_test_6.c (main): Likewise.
10079
10080 2008-10-07 Cary Coutant <ccoutant@google.com>
10081
10082 * options.c (General_options::finalize): Add check for -static and
10083 -shared.
10084 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10085 is not empty.
10086
10087 2008-10-02 Cary Coutant <ccoutant@google.com>
10088
10089 * plugin.cc (make_sized_plugin_object): Fix conditional
10090 compilation to work when not all targets are enabled.
10091
10092 2008-09-29 Cary Coutant <ccoutant@google.com>
10093
10094 * archive.cc (Archive::get_file_and_offset): Use filename instead
10095 of name to get library path.
10096 (Archive::include_member): Unlock external member of a thin archive.
10097
10098 * testsuite/Makefile.am (TEST_AR): New variable.
10099 (thin_archive_test_1): New test.
10100 (thin_archive_test_2): New test.
10101 * testsuite/Makefile.in: Regenerate.
10102 * testsuite/thin_archive_main.cc: New file.
10103 * testsuite/thin_archive_test_1.cc: New file.
10104 * testsuite/thin_archive_test_2.cc: New file.
10105 * testsuite/thin_archive_test_3.cc: New file.
10106 * testsuite/thin_archive_test_4.cc: New file.
10107
10108 2008-09-29 Cary Coutant <ccoutant@google.com>
10109
10110 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10111 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10112 instead of -1U.
10113 (Sized_relobj::do_finalize_local_symbols): Likewise.
10114 (Sized_relobj::map_to_kept_section): Likewise.
10115 * object.h (Sized_relobj::invalid_address): New constant.
10116 (Sized_relobj::do_output_section_offset): Check for invalid_address
10117 and return -1ULL.
10118 * output.cc (Output_reloc::local_section_offset): Use constant
10119 invalid_address instead of -1U.
10120 (Output_reloc::get_address): Likewise.
10121 (Output_section::output_address): Change -1U to -1ULL.
10122 * output.h (Output_reloc::invalid_address): New constant.
10123 * reloc.cc (Sized_relobj::write_sections): Use constant
10124 invalid_address instead of -1U.
10125 (Sized_relobj::relocate_sections): Likewise.
10126 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10127 values for merge sections.
10128 * target-reloc.h (relocate_for_relocatable): Use constant
10129 invalid_address instead of -1U.
10130
10131 2008-09-19 Cary Coutant <ccoutant@google.com>
10132
10133 Add plugin functionality for link-time optimization (LTO).
10134 * configure.ac (plugins): Add --enable-plugins option.
10135 * configure: Regenerate.
10136 * config.in: Regenerate.
10137 * Makefile.am (LIBDL): New variable.
10138 (CCFILES): Add plugin.cc.
10139 (HFILES): Add plugin.h.
10140 (ldadd_var): Add LIBDL.
10141 * Makefile.in: Regenerate.
10142
10143 * archive.cc: Include "plugin.h".
10144 (Archive::setup): Don't preread archive symbols when using a plugin.
10145 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10146 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10147 files.
10148 (Archive::include_member): Add symbols from plugin objects.
10149 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10150 * descriptors.cc (Descriptors::open): Check for file descriptors
10151 abandoned by plugins.
10152 (Descriptors::claim_for_plugin): New function.
10153 * descriptors.h (Descriptors::claim_for_plugin): New function.
10154 (Open_descriptor::is_claimed): New field.
10155 (claim_descriptor_for_plugin): New function.
10156 * fileread.cc (File_read::claim_for_plugin): New function.
10157 * fileread.h (File_read::claim_for_plugin): New function.
10158 (File_read::descriptor): New function.
10159 * gold.cc: Include "plugin.h".
10160 (queue_initial_tasks): Add task to call plugin hooks for generating
10161 new object files.
10162 * main.cc: Include "plugin.h".
10163 (main): Load plugin libraries.
10164 * object.h (Pluginobj): Declare.
10165 (Object::pluginobj): New function.
10166 (Object::do_pluginobj): New function.
10167 (Object::set_target): New function.
10168 * options.cc: Include "plugin.h".
10169 (General_options::parse_plugin): New function.
10170 (General_options::General_options): Initialize plugins_ field.
10171 (General_options::add_plugin): New function.
10172 * options.h (Plugin_manager): Declare.
10173 (General_options): Add --plugin option.
10174 (General_options::has_plugins): New function.
10175 (General_options::plugins): New function.
10176 (General_options::add_plugin): New function.
10177 (General_options::plugins_): New field.
10178 * plugin.cc: New file.
10179 * plugin.h: New file.
10180 * readsyms.cc: Include "plugin.h".
10181 (Read_symbols::do_read_symbols): Check for archive before checking
10182 for ELF file. Call plugin hooks to claim files.
10183 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10184 from a real object file; force override when processing replacement
10185 files.
10186 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10187 (Symbol::init_base_object): Likewise.
10188 (Symbol::init_base_output_data): Likewise.
10189 (Symbol::init_base_output_segment): Likewise.
10190 (Symbol::init_base_constant): Likewise.
10191 (Symbol::init_base_undefined): Likewise.
10192 (Symbol::output_section): Assert that object is not a plugin.
10193 (Symbol_table::add_from_pluginobj): New function.
10194 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10195 undefined.
10196 (Symbol_table::sized_write_globals): Likewise.
10197 (Symbol_table::add_from_pluginobj): Instantiate template.
10198 * symtab.h (Sized_pluginobj): Declare.
10199 (Symbol::in_real_elf): New function.
10200 (Symbol::set_in_real_elf): New function.
10201 (Symbol::in_real_elf_): New field.
10202 (Symbol_table::add_from_pluginobj): New function.
10203
10204 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10205 (LIBDL): New variable.
10206 (LDADD): Add LIBDL.
10207 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10208 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10209 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10210 (MOSTLYCLEANFILES): Likewise.
10211 * testsuite/Makefile.in: Regenerate.
10212 * testsuite/plugin_test.c: New file.
10213 * testsuite/plugin_test_1.sh: New file.
10214 * testsuite/plugin_test_2.sh: New file.
10215
10216 2008-09-16 Ian Lance Taylor <iant@google.com>
10217
10218 * target-reloc.h (relocate_section): Check whether a symbol is
10219 defined by the ABI before reporting an undefined symbol error.
10220 * target.h (Target::is_defined_by_abi): Make parameter const.
10221 (Target::do_is_defined_by_abi): Likewise.
10222 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10223 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10224 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10225 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10226 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10227 * testsuite/Makefile.in: Rebuild.
10228
10229 * fileread.cc (make_view): Add casts to avoid warning.
10230
10231 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10232
10233 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10234 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10235
10236 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10237
10238 * options.h (General_options::output_is_executable): New.
10239 (General_options::output_is_pie): New.
10240 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10241 for shared libraries.
10242 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10243
10244 2008-09-11 Chris Demetriou <cgd@google.com>
10245
10246 * options.h (origin): New -z option.
10247 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10248 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10249 in DT_FLAGS_1.
10250
10251 2008-09-05 Cary Coutant <ccoutant@google.com>
10252
10253 * fileread.cc (File_read::make_view): Add check for attempt to map
10254 beyond end of file.
10255
10256 2008-09-05 Cary Coutant <ccoutant@google.com>
10257
10258 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10259 explicit instantiations.
10260
10261 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10262
10263 PR gold/6858
10264 * options.cc (General_options::finalize): Allow undefined symbols
10265 in shlibs if linking -shared.
10266
10267 PR gold/6859
10268 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10269 symbols as not needing a dynsym entry.
10270
10271 2008-08-20 Craig Silverstein <csilvers@google.com>
10272
10273 * fileread.cc (File_read::open): Do not lock the file unless it
10274 was successfully opened.
10275
10276 2008-08-14 Cary Coutant <ccoutant@google.com>
10277
10278 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10279 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10280 * testsuite/tls_test.cc (struct int128): 128-bit struct
10281 for testing TLS relocs with non-zero addend.
10282 (v12): New TLS variable.
10283 (t12): New test.
10284 (t_last): Add check for v12.
10285 * testsuite/tls_test.h (t12): New function.
10286 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10287
10288 2008-08-13 Ian Lance Taylor <iant@google.com>
10289
10290 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10291 set tls_segment_ or relro_segment_.
10292 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10293 when appropriate.
10294 * output.h (Output_section::clear_is_relro): New function.
10295 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10296 sections specially even when output_data_ is empty.
10297 (Output_segment::maximum_alignment): When first section is relro,
10298 only force alignment for PT_LOAD segments.
10299 * script.cc (script_data_segment_align): New function.
10300 (script_data_segment_relro_end): New function.
10301 * script-c.h (script_data_segment_align): Declare.
10302 (script_data_segment_relro_end): Declare.
10303 * script-sections.h (class Script_sections): Declare
10304 data_segment_align and data_segment_relro_end. Add fields
10305 segment_align_index_ and saw_relro_end_.
10306 * script-sections.cc (class Sections_element): Add set_is_relro
10307 virtual function. Add new bool* parameter to place_orphan_here.
10308 Add get_output_section virtual function.
10309 (class Output_section_definition): Add set_is_relro. Add new
10310 bool* parameter to place_orphan_here. Add get_output_section.
10311 Add is_relro_ field.
10312 (Output_section_definition::Output_section_definition): Initialize
10313 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10314 and is_relro_ fields.
10315 (Output_section_definition::place_orphan_here): Add is_relro
10316 parameter.
10317 (Output_section_definition::set_section_addresses): Set relro for
10318 output section.
10319 (Output_section_definition::alternate_constraint): Likewise.
10320 (class Orphan_output_section): Add new bool* parameter to
10321 place_orphan_here. Add get_output_section.
10322 (Orphan_output_section::place_orphan_here): Add is_relro
10323 parameter.
10324 (Script_sections::Script_sections): Initialize
10325 data_segment_align_index_ and saw_relro_end_.
10326 (Script_sections::data_segment_align): New function.
10327 (Script_sections::data_segment_relro_end): New function.
10328 (Script_sections::place_orphan): Set or clear is_relro.
10329 (Script_sections::set_section_addresses): Force alignment of first
10330 TLS section.
10331 * yyscript.y (exp): Call script_data_segment_align and
10332 script_data_segment_relro_end.
10333 * testsuite/relro_script_test.t: New file.
10334 * testsuite/relro_test.cc (using_script): Declare.
10335 (t1, t2): Test using_script.
10336 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10337 (relro_script_test_SOURCES): Define.
10338 (relro_script_test_DEPENDENCIES): Define.
10339 (relro_script_test_LDFLAGS): Define.
10340 (relro_script_test_LDADD): Define.
10341 (relro_script_test.so): New target.
10342 * testsuite/Makefile.in: Rebuild.
10343
10344 2008-08-06 Cary Coutant <ccoutant@google.com>
10345
10346 * archive.cc (Archive::total_archives, Archive::total_members)
10347 (Archive::total_members_loaded): New variables.
10348 (Archive::setup): Add parameter. Add option to preread
10349 archive symbols.
10350 (Archive::read_armap): Add counter.
10351 (Archive::get_file_and_offset): New function.
10352 (Archive::get_elf_object_for_member): New function.
10353 (Archive::read_all_symbols): New function.
10354 (Archive::read_symbols): New function.
10355 (Archive::add_symbols): Add counters.
10356 (Archive::include_all_members): Use armap to find members if it's
10357 already built.
10358 (Archive::include_member): Skip reading symbols if already read.
10359 Factored code into Archive::get_file_and_offset and
10360 Archive::get_elf_object_for_member. Changed call to
10361 Mapfile::report_include_archive_member.
10362 (Archive::print_stats): New function.
10363 * archive.h: Declare Object and Read_symbols_data classes.
10364 (Archive::Archive): Add initializers for new members.
10365 (Archive::setup): Add parameter.
10366 (Archive::print_stats): New function.
10367 (Archive::total_archives, Archive::total_members)
10368 (Archive::total_members_loaded): New variables.
10369 (Archive::get_file_and_offset): New function.
10370 (Archive::get_elf_object_for_member): New function.
10371 (Archive::read_all_symbols): New function.
10372 (Archive::read_symbols): New function.
10373 (Archive::Archive_member): New class.
10374 (Archive::members_): New member.
10375 (Archive::num_members_): New member.
10376 * main.cc: Include archive.h.
10377 (main): Call Archive::print_stats.
10378 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10379 archive parameter; member_name is now the fully-decorated name.
10380 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10381 * options.h: (General_options): Add --preread-archive-symbols option.
10382 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10383 Archive::setup.
10384
10385 2008-08-04 Ian Lance Taylor <iant@google.com>
10386
10387 * symtab.h (Symbol::use_plt_offset): New function.
10388 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10389 * powerpc.cc (Relocate::relocate): Likewise.
10390 * sparc.cc (Relocate::relocate): Likewise.
10391 * x86_64.cc (Relocate::relocate): Likewise.
10392 * testsuite/weak_plt.sh: New test.
10393 * testsuite/weak_plt_main.cc: New test.
10394 * testsuite/weak_plt_shared.cc: New test.
10395 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10396 (check_PROGRAMS): Add weak_plt.
10397 (check_DATA): Add weak_plt_shared.so.
10398 (weak_plt_main_pic.o, weak_plt): New targets.
10399 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10400 * testsuite/Makefile.in: Rebuild.
10401
10402 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10403 gcctestdir/ld.
10404 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10405 * testsuite/Makefile.in: Rebuild.
10406
10407 2008-08-04 Alan Modra <amodra@bigpond.net.au>
10408
10409 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10410 * Makefile.in: Regenerate.
10411 * po/POTFILES.in: Regenerate.
10412
10413 2008-07-29 Ian Lance Taylor <iant@google.com>
10414
10415 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10416 symbols before other symbols.
10417 * testsuite/script_test_2.cc (test_addr): Declare.
10418 (test_addr_alias): Declare.
10419 (main): Check that test_addr and test_addr_alias have the right
10420 values.
10421 * testsuite/script_test_2.t: Define test_addr_alias and
10422 test_addr.
10423
10424 2008-07-24 Ian Lance Taylor <iant@google.com>
10425
10426 PR 5990
10427 * descriptors.cc: New file.
10428 * descriptors.h: New file.
10429 * gold-threads.h (class Hold_optional_lock): New class.
10430 * fileread.cc: Include "descriptors.h".
10431 (File_read::~File_read): Release descriptor rather than closing
10432 it.
10433 (File_read::open) [file]: Call open_descriptor rather than open.
10434 Set is_descriptor_opened_.
10435 (File_read::open) [memory]: Assert that descriptor is not open.
10436 (File_read::reopen_descriptor): New function.
10437 (File_read::release): Release descriptor.
10438 (File_read::do_read): Make non-const. Reopen descriptor.
10439 (File_read::read): Make non-const.
10440 (File_read::make_view): Reopen descriptor.
10441 (File_read::do_readv): Likewise.
10442 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10443 Update declarations.
10444 * layout.cc: Include "descriptors.h".
10445 (Layout::create_build_id): Use open_descriptor rather than open.
10446 * output.cc: Include "descriptors.h".
10447 (Output_file::open): Use open_descriptor rather than open.
10448 * archive.cc (Archive::const_iterator): Change Archive to be
10449 non-const.
10450 (Archive::begin, Archive::end): Make non-const.
10451 (Archive::count_members): Likewise.
10452 * archive.h (class Archive): Update declarations.
10453 * object.h (Object::read): Make non-const.
10454 * Makefile.am (CCFILES): Add descriptors.cc.
10455 (HFILES): Add descriptors.h.
10456 * Makefile.in: Rebuild.
10457
10458 PR 6716
10459 * gold.h: Always include <clocale>. Add Solaris workarounds
10460 following code in binutils/sysdep.h.
10461
10462 PR 6048
10463 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10464 this->eh_frame_hdr_ is NULL before using it.
10465
10466 * dynobj.cc (Versions::Versions): Update comment.
10467
10468 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10469 the base version name.
10470
10471 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10472 array size plus one.
10473 (Stringpool_template::set_string_offsets): Subtract one from key
10474 before using it as an array index.
10475 (Stringpool_template::get_offset_with_length): Likewise.
10476 (Stringpool_template::write_to_buffer): Likewise.
10477 * stringpool.h (Stringpool_template::get_offset_from_key):
10478 Likewise.
10479
10480 2008-07-23 Ian Lance Taylor <iant@google.com>
10481
10482 PR 6658
10483 * object.h (Merged_symbol_value::value): Do our best to handle a
10484 negative addend.
10485
10486 PR 6647
10487 * script.cc (Version_script_info::get_versions): Don't add empty
10488 version tag to return value.
10489 (Version_script_info::get_symbol_version_helper): Change return
10490 type to bool. Add pversion parameter. Change all callers.
10491 (script_register_vers_node): Don't require a non-NULL tag.
10492 * script.h (class Version_script_info): Update declarations.
10493 (Version_script_info::get_symbol_version): Change return type to
10494 bool. Add version parameter. Change all callers.
10495 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10496 handling. Handle an empty version from a version script.
10497 (Symbol_table::define_special_symbol): Likewise.
10498 * testsuite/ver_test_10.script: New file.
10499 * testsuite/ver_test_10.sh: New file.
10500 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10501 (check_DATA): Add ver_test_10.syms.
10502 (ver_test_10.syms, ver_test_10.so): New target.
10503 * testsuite/Makefile.in: Rebuild.
10504
10505 2008-07-23 Simon Baldwin <simonb@google.com>
10506
10507 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10508 to zero for undefined symbols from dynamic libraries.
10509
10510 2008-07-23 Ian Lance Taylor <iant@google.com>
10511
10512 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10513 Change all callers.
10514 * symtab.h (class Symbol_table): Update declaration.
10515 * testsuite/ver_test_9.cc: New file.
10516 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10517 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10518 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10519 (ver_test_9.so, ver_test_9.o): New targets.
10520 * testsuite/Makefile.in: Rebuild.
10521
10522 2008-07-22 Ian Lance Taylor <iant@google.com>
10523
10524 * options.h (class General_options): Define --check-sections.
10525 * layout.cc (Layout::set_segment_offsets): Handle
10526 --check-sections.
10527
10528 * options.h (class General_options): Define -n/--nmagic and
10529 -N/--omagic.
10530 * options.cc (General_options::finalize): For -n/--nmagic or
10531 -N/--omagic, set -static.
10532 * layout.cc (Layout::attach_allocated_section_to_segment): If
10533 -N/--omagic, don't put read-only and read-write sections in
10534 different segments.
10535 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10536 finding a read-only segment.
10537 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10538 don't set the minimum segment alignment to the common page size,
10539 and don't set the file offset to the address modulo the page size.
10540 * script-sections.cc (Script_sections::create_segments): If
10541 -n/--omagic, don't put read-only and read-write sections in
10542 different segments.
10543
10544 * cref.cc: New file.
10545 * cref.h: New file.
10546 * options.h (class General_options): Add --print-symbol-counts.
10547 * main.cc (main): Issue defined symbol report if requested.
10548 * archive.cc (Archive::interpret_header): Make into a const member
10549 function.
10550 (Archive::add_symbols): Call Input_objects::archive_start and
10551 archive_stop.
10552 (Archive::const_iterator): Define new class.
10553 (Archive::begin, Archive::end): New functions.
10554 (Archive::include_all_members): Rewrite to use iterator.
10555 (Archive::count_members): New function.
10556 * archive.h (class Archive): Update declarations.
10557 (Archive::filename): New function.
10558 * object.cc: Include "cref.h".
10559 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10560 (Sized_relobj::do_get_global_symbol_counts): New function.
10561 (Input_objects::add_object): Add object to cross-referencer.
10562 (Input_objects::archive_start): New function.
10563 (Input_objects::archive_stop): New function.
10564 (Input_objects::print_symbol_counts): New function.
10565 * object.h: Declare Cref and Archive.
10566 (Object::get_global_symbol_counts): New function.
10567 (Object::do_get_global_symbol_counts): New pure virtual function.
10568 (class Sized_relobj): Add defined_count_ field. Update
10569 declarations.
10570 (class Input_objects): Add cref_ field. Update constructor.
10571 Update declarations.
10572 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10573 defined_count_.
10574 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10575 symbol counts.
10576 (Sized_dynobj::do_get_global_symbol_counts): New function.
10577 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10578 defined_count_. Update declarations. Define Symbols typedef.
10579 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10580 parameter. Change all callers.
10581 (Symbol_table::add_from_dynobj): Add sympointers and defined
10582 parameters. Change all callers.
10583 * symtab.h (class Symbol_table): Update declarations.
10584 * Makefile.am (CCFILES): Add cref.cc.
10585 (HFILES): Add cref.h.
10586 * Makefile.in: Rebuild.
10587
10588 2008-07-22 Simon Baldwin <simonb@google.com>
10589
10590 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10591 to zero when writing undefined symbols.
10592
10593 2008-07-22 Ian Lance Taylor <iant@google.com>
10594
10595 * output.cc (Output_section::add_input_section): Don't try to
10596 merge empty merge sections.
10597
10598 2008-07-21 Craig Silverstein <csilvers@google.com>
10599
10600 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10601 Include symbol version in error message.
10602
10603 2008-07-20 Chris Demetriou <cgd@google.com>
10604
10605 * configure.ac (gold_cv_c_random_seed): New configured variable.
10606 (RANDOM_SEED_CFLAGS): New substituted variable.
10607 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10608 * configure: Rebuild.
10609 * Makefile.in: Likewise.
10610 * testsuite/Makefile.in: Likewise.
10611
10612 2008-07-18 Ian Lance Taylor <iant@google.com>
10613
10614 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10615 where we see NAME/NULL and NAME/VERSION as separate symbols.
10616 * testsuite/ver_test_main.cc (main): Call t4.
10617 (t4, t4_2a): Define.
10618 * testsuite/ver_test_2.cc (t4_2): Define.
10619 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10620 * testsuite/ver_test_4.cc (t4_2a): Define.
10621 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10622 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10623
10624 2008-07-17 Ian Lance Taylor <iant@google.com>
10625
10626 * dynobj.cc (Versions::add_def): If we give an error about a
10627 missing version, go ahead and create the version anyhow.
10628
10629 2008-07-10 Ian Lance Taylor <iant@google.com>
10630
10631 Handle output sections with more than 0x7fffffff bytes.
10632 * object.h (class Relobj): Change map_to_output_ to
10633 output_sections_, and just keep a section pointer. Change all
10634 uses. Move comdat group support to Sized_relobj.
10635 (Relobj::is_section_specially_mapped): Remove.
10636 (Relobj::output_section): Remove poff parameter. Change all
10637 callers.
10638 (Relobj::output_section_offset): New function.
10639 (Relobj::set_section_offset): Rewrite.
10640 (Relobj::map_to_output): Remove.
10641 (Relobj::output_sections): New function.
10642 (Relobj::do_output_section_offset): New pure virtual function.
10643 (Relobj::do_set_section_offset): Likewise.
10644 (class Sized_relobj): Add section_offsets_ field. Add comdat
10645 group support from Relobj. Update declarations.
10646 (Sized_relobj::get_output_section_offset): New function.
10647 (Sized_relobj::do_output_section_offset): New function.
10648 (Sized_relobj::do_set_section_offset): New function.
10649 * object.cc (Relobj::output_section_address): Remove.
10650 (Sized_relobj::Sized_relobj): Initialize new fields.
10651 (Sized_relobj::include_section_group): Cast find_kept_object to
10652 Sized_relobj.
10653 (Sized_relobj::include_linkonce_section): Likewise.
10654 (Sized_relobj::do_layout): Use separate arrays for output section
10655 and output offset.
10656 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10657 output_sections.
10658 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10659 output_sections and section_offsets.
10660 (Sized_relobj::write_local_symbols): Likewise.
10661 (map_to_kept_section): Compute output address directly.
10662 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10663 output_sections and section_offsets.
10664 (Sized_relobj::write_sections): Likewise.
10665 (Sized_relobj::relocate_sections): Likewise.
10666 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10667 * output.h (class Output_reloc): Update declarations. Change
10668 u2_.relobj to Sized_relobj*.
10669 (class Output_data_reloc): Change add functions to use
10670 Sized_relobj*.
10671 * output.cc (Output_reloc::Output_reloc): Change relobj to
10672 Sized_relobj*.
10673 (Output_reloc::local_section_offset): Change return type to
10674 Elf_Addr. Use get_output_section_offset.
10675 (Output_reloc::get_address): Likewise.
10676 (Output_section::is_input_address_mapped): Don't call
10677 is_section_specially_mapped.
10678 (Output_section::output_offset): Likewise.
10679 (Output_section::output_address): Likewise.
10680 (Output_section::starting_output_address): Likewise.
10681 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10682 parameter to Sized_relobj*.
10683 (Copy_relocs::need_copy_reloc): Likewise.
10684 (Copy_relocs::save): Likewise.
10685 * copy-relocs.h (class Copy_relocs): Update declarations.
10686 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10687 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10688 * target-reloc.h (relocate_for_relocatable): Change
10689 offset_in_output_section type to Elf_Addr. Change code that uses
10690 it as well.
10691 * layout.cc (Layout::layout): Always set *off.
10692 * mapfile.cc (Mapfile::print_input_section): Use
10693 output_section_offset.
10694 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10695 Sized_relobj*.
10696 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10697 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10698 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10699
10700 2008-07-03 Ian Lance Taylor <iant@google.com>
10701
10702 * layout.cc (Layout::include_section): Do not discard unrecognized
10703 SHT_STRTAB sections.
10704
10705 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10706
10707 * script.cc (Lex::can_continue_name): Make '?' allowable in
10708 version-script names.
10709 * testsuite/version_script.map: Change glob pattern to use '?'
10710
10711 2008-06-30 Manish Singh <yosh@gimp.org>
10712
10713 PR 6585
10714 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10715 Correct typo.
10716
10717 2008-06-30 Ian Lance Taylor <iant@google.com>
10718
10719 PR 6660
10720 PR 6682
10721 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10722 versions]: Don't try to read the value in the contents, since we
10723 don't use it. Use the template endianness when writing.
10724
10725 2008-06-25 Cary Coutant <ccoutant@google.com>
10726
10727 * fileread.cc (File_read::make_view): Assert on zero-length view.
10728 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10729 symbol table when there are no symbols to read.
10730
10731 2008-06-23 Craig Silverstein <csilvers@google.com>
10732
10733 * version.cc (version_string): Bump to 1.7
10734
10735 2008-06-18 Craig Silverstein <csilvers@google.com>
10736
10737 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10738 constant 0xFFFF to type Valtype.
10739 (Powerpc_relocate_functions::rel16_ha): Likewise.
10740
10741 2008-06-17 Ian Lance Taylor <iant@google.com>
10742
10743 * output.h (Output_section::Input_section): Initialize p2align_ to
10744 zero for Output_section_data constructors.
10745 (Output_section::Input_section::addralign): If not an input
10746 section, return the alignment of the Output_section_data.
10747 * testsuite/copy_test.cc: New file.
10748 * testsuite/copy_test_1.cc: New file.
10749 * testsuite/copy_test_2.cc: New file.
10750 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10751 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10752 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10753 (copy_test_1_pic.o, copy_test_1.so): New targets.
10754 (copy_test_2_pic.o, copy_test_2.so): New targets.
10755 * testsuite/Makefile.in: Rebuild.
10756
10757 * script-sections.cc (Script_sections::place_orphan): Initialize
10758 local variable exact.
10759
10760 2008-06-13 David Edelsohn <edelsohn@gnu.org>
10761
10762 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10763
10764 2008-06-12 David Edelsohn <edelsohn@gnu.org>
10765 David S. Miller <davem@davemloft.net>
10766
10767 * powerpc.cc: New file.
10768 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10769 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10770 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10771 * Makefile.in: Rebuild.
10772
10773 2008-06-09 Ian Lance Taylor <iant@google.com>
10774
10775 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10776 <exception>.
10777 (throwing, orig_terminate): New static variables.
10778 (terminate_handler): New static function.
10779 (t2): Set terminate handler.
10780
10781 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10782
10783 PR 6584
10784 * binary.cc (Binary_to_elf::sized_convert): Fix .data
10785 alignment.
10786
10787 2008-05-30 Cary Coutant <ccoutant@google.com>
10788
10789 * archive.cc (Archive::include_all_members) Correct to step
10790 over symbol table and extended name table in thin archives.
10791
10792 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10793
10794 PR 6407
10795 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10796 calculation.
10797
10798 2008-05-28 Caleb Howe <cshowe@google.com>
10799
10800 * reduced_debug_output.cc: New file.
10801 * reduced_debug_output.h: New file.
10802 * options.h (class General_options): Add --strip-debug-non-line.
10803 * options.cc (General_options::finalize): Add strip_debug_non_line
10804 to the strip heirarchy.
10805 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10806 fields.
10807 * layout.cc: Include "reduced_debug_output.h".
10808 (Layout::Layout): Initialize new fields.
10809 (line_only_debug_sections): New static array.
10810 (is_lines_only_debug_sections): New static inline function.
10811 (Layout::include_section): Handle --strip-debug-non-line.
10812 (Layout::make_output_section): If --strip-debug-non-line, build
10813 new output sections for .debug_abbrev and .debug_info.
10814 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10815 gold. Warn about possible overflow.
10816 (read_signed_LEB_128): Likewise.
10817 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10818 (read_signed_LEB_128): Declare.
10819 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10820 (HFILES): Add reduced_debug_output.h.
10821 * Makefile.in: Rebuild.
10822
10823 2008-05-21 Ian Lance Taylor <iant@google.com>
10824
10825 * mapfile.cc: New file.
10826 * mapfile.h: New file.
10827 * options.h (class General_options): Add -M/--print-map and -Map.
10828 * options.cc (General_options::finalize): Make -M equivalent to
10829 -Map -.
10830 * main.cc: Include <cstdio> and "mapfile.h".
10831 (main): Open mapfile if requested.
10832 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10833 constructor. Change caller.
10834 (queue_initial_tasks): Add mapfile parameter. Change caller.
10835 (queue_middle_tasks): Likewise.
10836 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10837 declarations.
10838 * archive.cc: Include "mapfile.h".
10839 (Archive::add_symbols): Add mapfile parameter. Change all
10840 callers. Pass mapfile, symbol, and reason to include_member.
10841 (Archive::include_all_members): Add mapfile parameter. Change all
10842 callers.
10843 (Archive::include_member): Add mapfile, sym, and why parameters.
10844 Change all callers. Report inclusion to map file.
10845 * archive.h: Include "fileread.h".
10846 (class Archive): Update declarations.
10847 (Archive::file): New const method.
10848 (class Add_archive_symbols): Add mapfile_ field. Update
10849 constructor. Change all callers.
10850 * readsyms.h (class Read_symbols): Likewise.
10851 (class Finish_group): Likewise.
10852 (class Read_script): Likewise.
10853 * common.cc: Include "mapfile.h".
10854 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10855 all callers.
10856 (Symbol_table::do_allocate_commons): Likewise.
10857 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10858 symbol allocation to mapfile.
10859 * common.h (class Allocate_commons_task): Add mapfile_ field.
10860 Update constructor. Change all callers.
10861 * symtab.h (class Symbol_table): Update declarations.
10862 * layout.cc: Include "mapfile.h".
10863 (Layout_task_runner::run): Print information to mapfile.
10864 (Layout::create_gold_note): Change Output_data_fixed_space to
10865 Output_data_zero_fill.
10866 (Layout::create_build_id): Likewise.
10867 (Layout::print_to_mapfile): New function.
10868 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10869 constructor. Change caller.
10870 (class Layout): Declare print_to_mapfile.
10871 * output.cc (Output_section::Input_section::print_to_mapfile): New
10872 function.
10873 (Output_section::add_input_section): If producing a map, always
10874 add to input_sections_ list.
10875 (Output_section::do_print_to_mapfile): New function.
10876 (Output_segment::print_sections_to_mapfile): New function.
10877 (Output_segment::print_section_list_to_mapfile): New function.
10878 * output.h: Include "mapfile.h".
10879 (Output_data::print_to_mapfile): New function.
10880 (Output_data::do_print_to_mapfile): New virtual function.
10881 (Output_segment_headers::do_print_to_mapfile): New function.
10882 (Output_file_header::do_print_to_mapfile): New function.
10883 (Output_data_const::do_print_to_mapfile): New function.
10884 (class Output_data_const_buffer): Add map_name_ field. Update
10885 constructor. Change all callers. Add do_print_to_mapfile
10886 function.
10887 (class Output_data_fixed_space): Likewise.
10888 (class Output_data_space): Likewise.
10889 (class Output_data_zero_fill): New class.
10890 (Output_data_strtab::do_print_to_mapfile): New function.
10891 (Output_data_reloc_base::do_print_to_mapfile): New function.
10892 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10893 (Output_data_group::do_print_to_mapfile): New function.
10894 (Output_data_got::do_print_to_mapfile): New function.
10895 (Output_data_dynamic::do_print_to_mapfile): New function.
10896 (Output_symtab_xindex::do_print_to_mapfile): New function.
10897 (class Output_section): Declare do_print_to_mapflie. Declare
10898 print_to_mapfile in Input_section.
10899 (class Output_segment): Declare new functions.
10900 * object.h (Sized_relobj::symbol_count): New function.
10901 * script-sections.cc
10902 (Output_section_element_dot_assignment::set_section_addresses):
10903 Change Output_data_fixed_space to Output_data_zero_fill.
10904 (Output_data_expression::do_print_to_mapfile): New function.
10905 * script.cc (read_input_script): Add mapfile parameter. Change
10906 all callers.
10907 * script.h (read_input_script): Update declaration.
10908 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10909 (Eh_frame::do_print_to_mapfile): New function.
10910 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10911 (Output_merge_string::do_print_to_mapfile): New function.
10912 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10913 function.
10914 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10915 function.
10916 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10917 function.
10918 * Makefile.am (CCFILES): Add mapfile.cc.
10919 (HFILES): Add mapfile.h.
10920 * Makefile.in: Rebuild.
10921
10922 2008-05-19 Ian Lance Taylor <iant@google.com>
10923
10924 * options.h (class General_options): Add -z relro.
10925 * layout.cc (Layout::Layout): Initialize relro_segment_.
10926 (Layout::add_output_section_data): Return the output section.
10927 (Layout::make_output_section): Rcognize relro sections and mark
10928 them appropriately.
10929 (Layout::attach_allocated_section_to_segment): Put relro sections
10930 in a PT_GNU_RELRO segment.
10931 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10932 section as relro.
10933 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10934 PT_TLS segments.
10935 (Layout::linkonce_mapping): Map d.rel.ro.local to
10936 .data.rel.ro.local.
10937 (Layout::output_section_name): Us .data.rel.ro.local for any
10938 section which begins with that.
10939 * layout.h (class Layout): Update add_output_section_data
10940 declaration. Add relro_segment_ field.
10941 * output.cc (Output_section::Output_section): Initialize is_relro_
10942 and is_relro_local_ fields.
10943 (Output_segment::add_output_section): Group relro sections.
10944 (Output_segment::is_first_section_relro): New function.
10945 (Output_segment::maximum_alignment): If there is a relro section,
10946 align the segment to the common page size.
10947 (Output_segment::set_section_addresses): Track whether we are
10948 looking at relro sections. If the last section is a relro
10949 section, align to the common page size.
10950 (Output_segment::set_section_list_addresses): Add in_relro
10951 parameter. Change all callers. Align to the page size when
10952 moving from relro to non-relro section.
10953 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10954 segment.
10955 * output.h (class Output_section): Add is_relro_ and
10956 is_relro_local_ fields.
10957 (Output_section::is_relro): New function.
10958 (Output_section::set_is_relro): New function.
10959 (Output_section::is_relro_local): New function.
10960 (Output_section::set_is_relro_local): New function.
10961 (class Output_segment): Update declarations.
10962 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10963 * sparc.cc (Target_sparc::got_section): Likewise.
10964 * x86_64.cc (Target_x86_64::got_section): Likewise.
10965 * testsuite/relro_test_main.cc: New file.
10966 * testsuite/relro_test.cc: New file.
10967 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10968 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10969 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10970 (relro_test.so, relro_test_pic.o): New targets.
10971 * testsuite/Makefile.in: Rebuild.
10972
10973 2008-05-16 Ian Lance Taylor <iant@google.com>
10974
10975 * output.cc (Output_segment::add_output_section): Remove front
10976 parameter.
10977 * output.h (class Output_segment): Remove
10978 add_initial_output_section and overloaded add_output_section.
10979 Update declaration of remaining add_output_section.
10980 * layout.cc (Layout::create_interp): Call add_output_section
10981 rather than add_initial_output_section.
10982 (Layout::finish_dynamic_section): Likewise.
10983
10984 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10985 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10986 know the dynamic type.
10987 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10988 field. Initialize it in constructor.
10989 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10990 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10991 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10992 reloc.
10993
10994 * output.cc (Output_reloc::get_address): Change return type to
10995 Elf_Addr.
10996 * output.h (class Output_reloc): Update get_address declaration.
10997 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10998 for section addresses.
10999
11000 2008-05-09 Ian Lance Taylor <iant@google.com>
11001
11002 PR 6493
11003 * gold.cc (gold_nomem): Use return value of write.
11004
11005 2008-05-08 Ian Lance Taylor <iant@google.com>
11006
11007 * symtab.c (Symbol::init_base_output_data): Add version
11008 parameter. Change all callers.
11009 (Symbol::init_base_output_segment): Likewise.
11010 (Symbol::init_base_constant): Likewise.
11011 (Symbol::init_base_undefined): Likewise.
11012 (Sized_symbol::init_output_data): Likewise.
11013 (Sized_symbol::init_output_segment): Likewise.
11014 (Sized_symbol::init_constant): Likewise.
11015 (Sized_symbol::init_undefined): Likewise.
11016 (Symbol_table::do_define_in_output_data): If the new symbol has a
11017 version, mark it as the default.
11018 (Symbol_table::do_define_in_output_segment): Likewise.
11019 (Symbol_table::do_define_as_constant): Likewise.
11020 * symtab.h (class Symbol): Update declarations.
11021 (class Sized_symbol): Likewise.
11022 * resolve.cc (Symbol::override_version): New function.
11023 (Symbol::override_base): Call override_version.
11024 (Symbol::override_base_with_special): Likewise.
11025 * testsuite/ver_script_8.script: New file.
11026 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11027 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11028 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11029 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11030
11031 2008-05-06 Ian Lance Taylor <iant@google.com>
11032
11033 PR 6049
11034 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11035 functions.
11036 (class General_options): Remove existing --undefined, and add
11037 --no-undefined instead. Add new --undefined as synonym for -u.
11038 * archive.cc (Archive::add_symbols): Check whether symbol was
11039 named with -u.
11040 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11041 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11042 all uses. Add IS_UNDEFINED. Update declarations to split
11043 different versions of init_base. Declare init_base_undefined.
11044 (Symbol::is_defined): Handle IS_UNDEFINED.
11045 (Symbol::is_undefined): Likewise.
11046 (Symbol::is_weak_undefined): Call is_undefined.
11047 (Symbol::is_absolute): Handle IS_CONSTANT.
11048 (class Sized_symbol): Update declarations to split different
11049 versions of init. Declare init_undefined.
11050 (class Symbol_table): Declare new functions.
11051 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11052 Change all callers.
11053 (Symbol::init_base_output_data): Likewise.
11054 (Symbol::init_base_output_segment): Likewise.
11055 (Symbol::init_base_constant): Likewise.
11056 (Symbol::init_base_undefined): New function.
11057 (Sized_symbol::init_object): Rename from init. Change all
11058 callers.
11059 (Sized_symbol::init_output_data): Likewise.
11060 (Sized_symbol::init_output_segment): Likewise.
11061 (Sized_symbol::init_constant): Likewise.
11062 (Sized_symbol::init_undefined): New function.
11063 (Symbol_table::add_undefined_symbols_from_command_line): New
11064 function.
11065 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11066 function.
11067 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11068 (Symbol::output_section): Likewise.
11069 (Symbol::set_output_section): Likewise.
11070 (Symbol_table::sized_finalize_symbol): Likewise.
11071 (Symbol_table::sized_write_globals): Likewise.
11072 * resolve.cc (Symbol_table::should_override): Likewise.
11073 (Symbol::override_base_with_special): Likewise.
11074
11075 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11076 symbol, change it to have default visibility.
11077 * testsuite/protected_1.cc: New file.
11078 * testsuite/protected_2.cc: New file.
11079 * testsuite/protected_3.cc: New file.
11080 * testsuite/protected_main_1.cc: New file.
11081 * testsuite/protected_main_2.cc: New file.
11082 * testsuite/protected_main_3.cc: New file.
11083 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11084 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11085 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11086 (protected_1.so): New target.
11087 (protected_1_pic.o, protected_2_pic.o): New targets.
11088 (protected_3_pic.o): New target.
11089 (check_PROGRAMS): Add protected_2.
11090 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11091 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11092 * testsuite/Makefile.in: Rebuild.
11093
11094 * options.h (DEFINE_var): Add set_user_set_##varname__.
11095 (DEFINE_bool_alias): New macro.
11096 (class General_options): Define -Bstatic using DEFINE_bool_alias
11097 rather than DEFINE_special. Add --undefined as an alias for -z
11098 defs.
11099 * options.cc (General_options::parse_Bstatic): Remove.
11100
11101 * options.h (class General_options): Add --fatal-warnings.
11102 * main.cc (main): Implement --fatal-warnings.
11103 * errors.h (Errors::warning_count): New function.
11104
11105 * options.h (class General_options): Add -Bsymbolic-functions.
11106 * symtab.h (Symbol::is_preemptible): Check for
11107 -Bsymbolic-functions.
11108
11109 2008-05-05 Ian Lance Taylor <iant@google.com>
11110
11111 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11112 as noVARNAME rather than no-VARNAME.
11113 (class General_options): Add option -z combreloc.
11114 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11115 get_address.
11116 (Output_reloc::sort_before) [SHT_REL]: New function.
11117 (Output_reloc::sort_before) [SHT_RELA]: New function.
11118 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11119 Sort_relocs_comparison.
11120 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11121 parameter. Change all callers.
11122 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11123 sort_relocs parameter. Change all callers.
11124 * output.cc (Output_reloc::get_address): New function, broken out
11125 of write_rel.
11126 (Output_reloc::write_rel): Call it.
11127 (Output_reloc::compare): New function.
11128 (Output_data_reloc_base::do_write): Optionally sort relocs.
11129
11130 * configure.ac: If targ_extra_obj is set, link it in.
11131 * configure.tgt: Initialize all variables.
11132 (x86_64*): Set targ_extra_obj and targ_extra_size.
11133 * configure: Rebuild.
11134
11135 * object.cc (Sized_relobj::include_section_group): Adjust section
11136 indexes read from group data. Build vector to pass to
11137 layout_group.
11138 * layout.cc (Layout::layout_group): Add flags and shndxes
11139 parameters. Remove contents parameter. Change caller. Update
11140 explicit instantiations.
11141 * layout.h (class Layout): Update layout_group declaration.
11142 * output.cc (Output_data_group::Output_data_group): Add flags and
11143 input_shndxes parameters. Remove contents parameter. Change
11144 caller.
11145 (Output_data_group::do_write): Change input_sections_ to
11146 input_shndxes_.
11147 * output.h (class Output_data_group): Update constructor
11148 declaration. Rename input_sections_ to input_shndxes_.
11149 * testsuite/many_sections_test.cc: Add template.
11150
11151 2008-04-30 Cary Coutant <ccoutant@google.com>
11152
11153 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11154
11155 * layout.cc (Layout::include_section): Refactored check for debug
11156 info section.
11157 (Layout::add_comdat): Add new parameters. Change type
11158 of signature parameter. Add object and shndx to signatures table.
11159 (Layout::find_kept_object): New function.
11160 * layout.h: Include <cstring>.
11161 (Layout::is_debug_info_section): New function.
11162 (Layout::add_comdat): Add new parameters.
11163 (Layout::find_kept_object): New function.
11164 (Layout::Kept_section): New struct.
11165 (Layout::Signatures): Change type of map range.
11166 * object.cc (Relobj::output_section_address): New function.
11167 (Sized_relobj::include_section_group): Add new parameters. Change
11168 calls to Layout::add_comdat. Change to build table of kept comdat
11169 groups and table mapping discarded sections to kept sections.
11170 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11171 (Sized_relobj::do_layout): Change calls to include_section_group and
11172 include_linkonce_section.
11173 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11174 value to zero when section is discarded.
11175 (Sized_relobj::map_to_kept_section): New function.
11176 * object.h (Relobj::output_section_address): New function.
11177 (Relobj::Comdat_group): New type.
11178 (Relobj::find_comdat_group): New function.
11179 (Relobj::Comdat_group_table): New type.
11180 (Relobj::Kept_comdat_section): New type.
11181 (Relobj::Kept_comdat_section_table): New type.
11182 (Relobj::add_comdat_group): New function.
11183 (Relobj::set_kept_comdat_section): New function.
11184 (Relobj::get_kept_comdat_section): New function.
11185 (Relobj::comdat_groups_): New field.
11186 (Relobj::kept_comdat_sections_): New field.
11187 (Symbol_value::input_value): Update comment.
11188 (Sized_relobj::map_to_kept_section) New function.
11189 (Sized_relobj::include_linkonce_section): Add new parameter.
11190 * target-reloc.h (Comdat_behavior): New type.
11191 (get_comdat_behavior): New function.
11192 (relocate_section): Add code to map a discarded section to the
11193 corresponding kept section when applying a relocation.
11194
11195 2008-04-30 Craig Silverstein <csilvers@google.com>
11196
11197 * dwarf_reader.cc (next_generation_count): New static var.
11198 (Addr2line_cache_entry): New struct.
11199 (addr2line_cache): New static var.
11200 (Dwarf_line_info::one_addr2line): Added caching.
11201 (Dwarf_line_info::clear_addr2line_cache): New function.
11202 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11203 cache-size parameter.
11204 (Dwarf_line_info::one_addr2line_cache): New function.
11205 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11206 new cache-size argument to one_addr2line(), and clear cache.
11207
11208 2008-04-28 Cary Coutant <ccoutant@google.com>
11209
11210 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11211 R_386_PC8 relocations.
11212
11213 2008-04-23 Ian Lance Taylor <iant@google.com>
11214
11215 * object.cc (Sized_relobj::include_section_group): Check for
11216 invalid section group.
11217
11218 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11219 header size.
11220
11221 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11222 than read for file header.
11223 * archive.cc (Archive::include_member): Likewise.
11224
11225 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
11226
11227 * aclocal.m4: Regenerate.
11228 * configure: Regenerate.
11229
11230 2008-04-19 Ian Lance Taylor <iant@google.com>
11231
11232 * version.cc (version_string): Bump to 1.6.
11233
11234 * testsuite/Makefile.am (many_sections_r_test): New target.
11235 (many_sections_r_test_SOURCES): Remove.
11236 (many_sections_r_test_DEPENDENCIES): Remove.
11237 (many_sections_r_test_LDFLAGS): Remove.
11238 (many_sections_r_test_LDADD): Remove.
11239
11240 * object.cc (Sized_relobj::do_add_symbols): Always pass
11241 local_symbol_count_ to add_from_relobj.
11242
11243 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11244 every thousand variables.
11245 * testsuite/Makefile.in: Rebuild.
11246
11247 * object.cc (Xindex::initialize_symtab_xindex): New function.
11248 (Xindex::read_symtab_xindex): New function.
11249 (Xindex::sym_xindex_to_shndx): New function.
11250 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11251 available.
11252 (Sized_relobj::do_initialize_xindex): New function.
11253 (Sized_relobj::do_read_symbols): Adjust section links.
11254 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11255 parameter. Change all callers.
11256 (Sized_relobj::include_section_group): Adjust section links and
11257 symbol section indexes.
11258 (Sized_relobj::do_layout): Adjust section links.
11259 (Sized_relobj::do_count_local_symbols): Adjust section links and
11260 symbol section indexes.
11261 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11262 ordinary and special symbols.
11263 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11264 dynsym_xindex parameters. Change all callers. Adjust section
11265 links. Use SHN_XINDEX when needed.
11266 (Sized_relobj::get_symbol_location_info): Adjust section links.
11267 Don't get fooled by special symbols.
11268 * object.h (class Xindex): Define.
11269 (class Object): Add xindex_ parameter. Declare virtual functoin
11270 do_initialize_xindex.
11271 (Object::adjust_sym_shndx): New function.
11272 (Object::set_xindex): New protected function.
11273 (class Symbol_value): Add is_ordinary_shndx_ field.
11274 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11275 (Symbol_value::value): Assert ordinary section.
11276 (Symbol_value::initialize_input_to_output_map): Likewise.
11277 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11278 Change all callers.
11279 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11280 all callers.
11281 (class Sized_relobj): Update declarations.
11282 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11283 parameter. Change all callers.
11284 (Sized_relobj::adjust_shndx): New function.
11285 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11286 field.
11287 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11288 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11289 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11290 (Sized_dynobj::read_dynsym_section): Adjust section links.
11291 (Sized_dynobj::read_dynamic): Likewise.
11292 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11293 section links.
11294 (Sized_dynobj::do_initialize_xindex): New function.
11295 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11296 do_initialize_xindex.
11297 (Sized_dynobj::adjust_shndx): New function.
11298 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11299 dynsym_xindex_ fields.
11300 (Layout::finalize): Add a call to set_section_indexes before
11301 creating the symtab sections.
11302 (Layout::set_section_indexes): Don't do anything if the section
11303 already has a section index.
11304 (Layout::create_symtab_sections): Add shnum parameter. Change
11305 caller. Create .symtab_shndx section if needed.
11306 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11307 caller.
11308 (Layout::allocated_output_section_count): New function.
11309 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11310 needed.
11311 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11312 fields. Update declarations.
11313 (Layout::symtab_xindex): New function.
11314 (Layout::dynsym_xindex): New function.
11315 (class Write_symbols_task): Add layout_ field.
11316 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11317 Change caller.
11318 * output.cc (Output_section_headers::Output_section_headers): Add
11319 shstrtab_section parameter. Change all callers.
11320 (Output_section_headers::do_sized_write): Store overflow values
11321 for section count and section string table section index in
11322 section header zero.
11323 (Output_file_header::do_sized_write): Check for overflow of
11324 section count and section string table section index.
11325 (Output_symtab_xindex::do_write): New function.
11326 (Output_symtab_xindex::endian_do_write): New function.
11327 * output.h (class Output_section_headers): Add shstrtab_section_.
11328 Update declarations.
11329 (class Output_symtab_xindex): Define.
11330 (Output_section::has_out_shndx): New function.
11331 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11332 field.
11333 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11334 Change all callers.
11335 (Sized_symbol::init): Likewise.
11336 (Symbol::output_section): Check for ordinary symbol.
11337 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11338 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11339 callers.
11340 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11341 Change all callers. Simplify handling of symbols from sections
11342 not included in the link.
11343 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11344 distinction.
11345 (Weak_alias_sorter::operator()): Assert that symbols are
11346 ordinary.
11347 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11348 distinction.
11349 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11350 parameters. Change all callers.
11351 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11352 symbol distinction. Use SHN_XINDEX when needed.
11353 (Symbol_table::write_section_symbol): Add symtab_xindex
11354 parameter. Change all callers.
11355 (Symbol_table::sized_write_section_symbol): Likewise. Use
11356 SHN_XINDEX when needed.
11357 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11358 declarations.
11359 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11360 (Symbol::is_defined): Check is_ordinary.
11361 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11362 (Symbol::is_absolute, Symbol::is_common): Likewise.
11363 (class Sized_symbol): Update declarations.
11364 (class Symbol_table): Update declarations.
11365 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11366 parameters. Change all callers.
11367 (Sized_symbol::override): Likewise.
11368 (Symbol_table::override): Likewise.
11369 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11370 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11371 is_ordinary, and orig_st_shndx parameters. Change all callers.
11372 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11373 to be in an ordinary section.
11374 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11375 object and is_ordinary parameters. Change all callers.
11376 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11377 Change all callers. Don't add undefined or non-ordinary symbols
11378 to reloc_map_.
11379 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11380 Change all callers.
11381 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11382 declarations.
11383 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11384 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11385 (Sized_relobj::relocate_sections): Likewise.
11386 * target-reloc.h (scan_relocs): Adjust section symbol index.
11387 (scan_relocatable_relocs): Likewise.
11388 * i386.cc (Scan::local): Check for ordinary symbols.
11389 * sparc.cc (Scan::local): Likewise.
11390 * x86_64.cc (Scan::local): Likewise.
11391 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11392 to symbol_section_and_value.
11393 * testsuite/many_sections_test.cc: New file.
11394 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11395 (check_PROGRAMS): Add many_sections_test.
11396 (many_sections_test_SOURCES): Define.
11397 (many_sections_test_DEPENDENCIES): Define.
11398 (many_sections_test_LDFLAGS): Define.
11399 (BUILT_SOURCES): Add many_sections_define.h.
11400 (many_sections_define.h): New target.
11401 (BUILT_SOURCES): Add many_sections_check.h.
11402 (many_sections_check.h): New target.
11403 (check_PROGRAMS): Add many_sections_r_test.
11404 (many_sections_r_test_SOURCES): Define.
11405 (many_sections_r_test_DEPENDENCIES): Define.
11406 (many_sections_r_test_LDFLAGS): Define.
11407 (many_sections_r_test_LDADD): Define.
11408 (many_sections_r_test.o): New target.
11409 * testsuite/Makefile.in: Rebuild.
11410
11411 2008-04-17 Cary Coutant <ccoutant@google.com>
11412
11413 * errors.cc (Errors::info): New function.
11414 (gold_info): New function.
11415 * errors.h (Errors::info): New function.
11416 * gold.h (gold_info): New function.
11417 * object.cc (Input_objects::add_object): Print trace output.
11418 * options.cc (options::parse_set): New function.
11419 (General_options::parse_wrap): Deleted.
11420 (General_options::General_options): Deleted initializer.
11421 * options.h (options::String_set): New typedef.
11422 (options::parse_set): New function.
11423 (DEFINE_set): New macro.
11424 (General_options::wrap): Changed to use DEFINE_set. Changed
11425 callers of any_wrap_symbols and is_wrap_symbol.
11426 (General_options::trace, General_options::trace_symbol):
11427 New options.
11428 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11429 (General_options::wrap_symbols_): Deleted.
11430 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11431
11432 2008-04-17 David S. Miller <davem@davemloft.net>
11433
11434 * options.cc (General_options::parse_V): New function.
11435 * options.h: Add entries for -V and -Qy.
11436
11437 2008-04-17 Ian Lance Taylor <iant@google.com>
11438
11439 * common.cc (Symbol_table::allocate_commons): Remove options
11440 parameter. Change caller.
11441 (Symbol_table::do_allocate_commons): Remove options parameter.
11442 Change caller. Just call do_allocate_commons_list twice.
11443 (Symbol_table::do_allocate_commons_list): New function, broken out
11444 of do_allocate_commons.
11445 * common.h (class Allocate_commons_task): Remove options_ field.
11446 Update constructor.
11447 * symtab.cc (Symbol_table::Symbol_table): Initialize
11448 tls_commons_.
11449 (Symbol_table::add_from_object): Put TLS common symbols on
11450 tls_commons_ list.
11451 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11452 which are IN_OUTPUT_DATA.
11453 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11454 allocate_commons and do_allocate_commons declarations. Declare
11455 do_allocate_commons_list.
11456 * gold.cc (queue_middle_tasks): Update creation of
11457 Allocate_commons_task to not pass options.
11458 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11459 (TLS_TEST_C_FLAGS): New variable.
11460 (tls_test_c_pic.o): New target.
11461 (tls_test_shared.so): Link in tls_test_c_pic.o.
11462 (tls_test_c_pic_ie.o): New target.
11463 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11464 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11465 (tls_test_c.o): New target.
11466 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11467 (tls_pic_test_LDADD): Likewise.
11468 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11469 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11470 (tls_test_c_gnu2.o): New target.
11471 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11472 tls_test_c_gnu2.o.
11473 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11474 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11475 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11476 * testsuite/tls_test.cc: Include "config.h".
11477 (t_last): Call t11_last.
11478 * testsuite/tls_test.h (t11, t11_last): Declare.
11479 * testsuite/tls_test_c.c: New file.
11480 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11481 * configure.ac: Check for OpenMP support.
11482 * configure, config.in, Makefile.in: Rebuild.
11483 * testsuite/Makefile.in: Rebuild.
11484
11485 2008-04-16 Cary Coutant <ccoutant@google.com>
11486
11487 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11488 (Target_i386::tls_base_symbol_defined_): New field.
11489 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11490 (Target_i386::Scan::global): Likewise.
11491 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11492 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11493 (Target_x86_64::tls_base_symbol_defined_): New field.
11494 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11495 (Target_x86_64::Scan::global): Likewise.
11496
11497 2008-04-16 Cary Coutant <ccoutant@google.com>
11498
11499 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11500 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11501 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11502 building shared libraries.
11503 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11504 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11505 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11506 * testsuite/Makefile.in: Rebuild.
11507 * testsuite/weak_undef.h: New file.
11508 * testsuite/weak_undef_file1.cc: Add extra test cases.
11509 * testsuite/weak_undef_file2.cc: Likewise.
11510 * testsuite/weak_undef_test.cc: Likewise.
11511
11512 2008-04-16 David S. Miller <davem@davemloft.net>
11513
11514 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11515 Add issued_non_pic_error_ field. Declare check_non_pic.
11516 (Target_sparc::Scan::check_non_pic): New function.
11517 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11518 (Target_sparc::Scan::global): Likewise.
11519
11520 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11521 * configure: Rebuild.
11522
11523 * options.h (DEFINE_enable): New macro.
11524 (new_dtags): New enable option.
11525 (initfirst, interpose, loadfltr, nodefaultlib,
11526 nodelete, nodlopen, nodump): New -z options.
11527 * layout.cc (Layout:finish_dynamic_section): If new
11528 dtags enabled, emit DT_RUNPATH. Also, emit a
11529 DT_FLAGS_1 containing any specified -z flags.
11530
11531 2008-04-16 Ian Lance Taylor <iant@google.com>
11532
11533 * copy-relocs.cc: New file.
11534 * copy-relocs.h: New file.
11535 * reloc.cc: Remove Copy_relocs code.
11536 * reloc.h: Likewise.
11537 * reloc-types.h (struct Reloc_types) [both versions]: Add
11538 get_reloc_addend_noerror.
11539 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11540 variants of add_global which take an addend which must be zero.
11541 * i386.cc: Include "copy-relocs.h".
11542 (class Target_i386): Change type of copy_relocs_ to variable,
11543 update initializer.
11544 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11545 Change all callers.
11546 (Target_i386::do_finalize_sections): Change handling of
11547 copy_relocs_.
11548 * sparc.cc: Include "copy-relocs.h".
11549 (class Target_sparc): Change type of copy_relocs_ to variable,
11550 update initializer.
11551 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11552 Change all callers.
11553 (Target_sparc::do_finalize_sections): Change handling of
11554 copy_relocs_.
11555 * x86_64.cc: Include "copy-relocs.h".
11556 (class Target_x86_64): Change type of copy_relocs_ to variable,
11557 update initializer.
11558 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11559 class. Change all callers.
11560 (Target_x86_64::do_finalize_sections): Change handling of
11561 copy_relocs_.
11562 * Makefile.am (CCFILES): Add copy-relocs.cc.
11563 (HFILES): Add copy-relocs.h.
11564
11565 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11566
11567 * testsuite/script_test_4.sh: Permit leading zeroes.
11568
11569 2008-04-15 Ian Lance Taylor <iant@google.com>
11570
11571 * script-sections.cc (Script_sections::create_segments): Use
11572 header_size_adjustment even when there is enough room for the
11573 headers.
11574 * testsuite/script_test_4.sh: New file.
11575 * testsuite/script_test_4.t: New file.
11576 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11577 (check_DATA): Add script_test_4.stdout.
11578 (MOSTLYCLEANFILES): Likewise.
11579 (script_test_4): New target.
11580 (script_test_4.stdout): New target.
11581 * testsuite/Makefile.in: Rebuild.
11582
11583 * sparc.cc: Add definitions for Output_data_plt_sparc class
11584 constants.
11585
11586 2008-04-14 David S. Miller <davem@davemloft.net>
11587
11588 * sparc.cc: New file.
11589 * Makefile.am (TARGETSOURCES): Add sparc.cc
11590 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11591 * configure.tgt: Document targ_extra_size and
11592 targ_extra_big_endian. Add entries for sparc-* and
11593 sparc64-*.
11594 * configure.ac: Handle targ_extra_size and
11595 targ_extra_big_endian.
11596 * Makefile.in: Rebuild.
11597 * configure: Likewise.
11598 * po/POTFILES.in: Likewise.
11599 * po/gold.pot: Likewise.
11600
11601 2008-04-14 Ian Lance Taylor <iant@google.com>
11602
11603 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11604 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11605 in the name/type/flags to section mapping. Don't call
11606 allocate_output_section.
11607 (Layout::choose_output_section): Change parameter from adjust_name
11608 to is_input_section. Don't permit input sections after sections
11609 are attached to segments. Don't call allocate_output_section.
11610 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11611 not write_enable_output_section.
11612 (Layout::make_output_section): Don't push to
11613 unattached_section_list_ nor call attach_to_segment. Call
11614 attach_section_to_segment if sections are attached.
11615 (Layout::attach_sections_to_segments): New function.
11616 (Layout::attach_section_to_segment): New function.
11617 (Layout::attach_allocated_section_to_segment): Rename from
11618 attach_to_segment. Remove flags parameter.
11619 (Layout::allocate_output_section): Remove function.
11620 (Layout::write_enable_output_section): Remove function.
11621 * layout.h (class Layout): Update for above changes. Add new
11622 field sections_are_attached_.
11623 * output.h (Output_section::update_flags_for_input_section): New
11624 function.
11625 * output.cc (Output_section::add_input_section): Call
11626 update_flags_for_input_section.
11627 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11628
11629 2008-04-11 Cary Coutant <ccoutant@google.com>
11630
11631 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11632 thought unnecessary.
11633 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11634
11635 2008-04-11 Ian Lance Taylor <iant@google.com>
11636
11637 * output.h (class Output_section_data): Remove inline definition
11638 of set_addralign.
11639 * output.cc (Output_section_data::set_addralign): New function.
11640
11641 2008-04-11 Cary Coutant <ccoutant@google.com>
11642
11643 Add support for TLS descriptors for i386 and x86_64.
11644 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11645 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11646 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11647 GOT_TYPE_TLS_DESC.
11648 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11649 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11650 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11651 relocations.
11652 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11653 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11654 Fix problem with initial-exec relocations.
11655 (Target_i386::Relocate::relocate_tls): Likewise.
11656 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11657 relaxation.
11658 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11659 support for section-plus-offset dynamic table entries.
11660 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11661 (Output_data_dynamic::Dynamic_entry): Add support for
11662 section-plus-offset dynamic table entries.
11663 (Output_data_dynamic::Classification): Likewise.
11664 (Output_data_dynamic::classification_): Renamed offset_.
11665 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11666 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11667 (Target_x86_64::make_plt_section): New function.
11668 (Target_x86_64::reserve_tlsdesc_entries): New function.
11669 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11670 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11671 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11672 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11673 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11674 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11675 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11676 add extra PLT entry for TLS descriptors.
11677 (Output_data_plt_x86_64::got_): New field.
11678 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11679 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11680 fields.
11681 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11682 descriptors.
11683 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11684 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11685 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11686 R_386_TLS_DESC_CALL relocations.
11687 (Target_x86_64::Scan::global): Likewise.
11688 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11689 for TLS descriptors.
11690 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11691 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11692 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11693 GD-to-IE relaxation.
11694 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11695 and TLS_DESCRIPTORS.
11696 * Makefile.in: Rebuild.
11697 * configure: Rebuild.
11698 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11699 (tls_test_shared2.so): New target.
11700 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11701 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11702 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11703 (tls_shared_gd_to_ie_test_LDADD): New variable.
11704 (tls_shared_gnu2_gd_to_ie_test): New target.
11705 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11706 New targets.
11707 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11708 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11709 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11710 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11711 (tls_shared_gnu2_test): New target.
11712 (tls_test_gnu2_shared.so): New target.
11713 (tls_shared_gnu2_test_SOURCES): New variable.
11714 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11715 (tls_shared_gnu2_test_LDFLAGS): New variable.
11716 (tls_shared_gnu2_test_LDADD): New variable.
11717 * testsuite/Makefile.in: Rebuild.
11718 * testsuite/Makefile.
11719
11720 2008-04-11 Ian Lance Taylor <iant@google.com>
11721
11722 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11723 justsyms.t.
11724 * testsuite/Makefile.in: Rebuild.
11725
11726 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11727 long.
11728 * testsuite/script_test_2.cc (main): Adjust test.
11729
11730 2008-04-11 David S. Miller <davem@davemloft.net>
11731 Ian Lance Taylor <iant@google.com>
11732
11733 * options.h (General_options): Add entries for '-Y' and
11734 '-relax'.
11735 * options.cc (General_options:finalize): If -Y was used, add those
11736 entries to the library path instead of the default "/lib" and
11737 "/usr/lib".
11738
11739 2008-04-11 David S. Miller <davem@davemloft.net>
11740
11741 * testsuite/justsyms.t: Start at 0x100.
11742 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
11743 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11744 long.
11745 * testsuite/script_test_2.cc: Adjust string and section length
11746 checks.
11747
11748 2008-04-09 Ian Lance Taylor <iant@google.com>
11749
11750 PR gold/5996
11751 * script-sections.cc (Sections_element::allocate_to_segment): Add
11752 orphan parameter.
11753 (Output_section_definition::allocate_to_segment): Likewise.
11754 (Orphan_output_section::allocate_to_segment): Likewise.
11755 (Script_sections::attach_sections_using_phdrs_clause): Don't
11756 propagate non-PT_LOAD segments to orphan sections.
11757 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11758 readelf rather than objdump.
11759 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11760 .interp section and PT_INTERP segment are the same size.
11761 * testsuite/Makefile.in: Rebuild.
11762
11763 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11764 aliases for symbols defined in the same object.
11765 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11766 (weak_alias_test_SOURCES): New variable.
11767 (weak_alias_test_DEPENDENCIES): New variable.
11768 (weak_alias_test_LDFLAGS): New variable.
11769 (weak_alias_test_LDADD): New variable.
11770 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11771 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11772 (weak_alias_test_3.o): New target.
11773 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11774 * testsuite/weak_alias_test_main.cc: New file.
11775 * testsuite/weak_alias_test_1.cc: New file.
11776 * testsuite/weak_alias_test_2.cc: New file.
11777 * testsuite/weak_alias_test_3.cc: New file.
11778
11779 2008-04-08 Ian Lance Taylor <iant@google.com>
11780
11781 * options.h (class General_options): Add --noinhibit-exec option.
11782 * main.cc (main): Check --noinhibit-exec.
11783
11784 * options.h (class General_options): Define --wrap as a special
11785 option. Add wrap_symbols_ field.
11786 (General_options::any_wrap_symbols): New function.
11787 (General_options::is_wrap_symbol): New function.
11788 * options.cc (General_options::parse_wrap): New function.
11789 (General_options::General_options): Initialize wrap_symbols_.
11790 * symtab.cc (Symbol_table::wrap_symbol): New function.
11791 (Symbol_table::add_from_object): Handle --wrap.
11792 * symtab.h (class Symbol_table): Declare wrap_symbol.
11793 * target.h (Target::wrap_char): New function.
11794 (Target::Target_info): Add wrap_char field.
11795 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11796 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11797 * testsuite/testfile.cc (Target_test::test_target_info):
11798 Likewise.
11799
11800 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11801 there is one.
11802
11803 * layout.h (class Layout): Add added_eh_frame_data_ field.
11804 * layout.cc (Layout::Layout): Initialize new field.
11805 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11806 output section until we find a section we merged successfully.
11807 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11808 that the size be non-zero.
11809
11810 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11811 qualifier.
11812
11813 2008-04-08 Craig Silverstein <csilvers@google.com>
11814
11815 * configure.ac: Export new conditional variable HAVE_ZLIB.
11816 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11817 on HAVE_ZLIB.
11818 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11819 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11820
11821 2008-04-07 Ian Lance Taylor <iant@google.com>
11822
11823 * version.cc (version_string): Set to "1.5".
11824
11825 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11826 Add issued_non_pic_error_ field. Declare check_non_pic.
11827 (Target_x86_64::Scan::check_non_pic): New function.
11828 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11829 (Target_x86_64::Scan::global): Likewise.
11830
11831 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11832 addend parameter. Change caller. Handle merge sections.
11833 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11834 Address to Addend. Don't add in the result of
11835 local_section_offset, pass down the addend and use the returned
11836 value.
11837 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11838 Update declarations of local_section_offset and symbol_value.
11839 * testsuite/two_file_test_1.cc (t18): New function.
11840 * testsuite/two_file_test_2.cc (f18): New function.
11841 * testsuite/two_file_test_main.cc (main): Call t18.
11842 * testsuite/two_file_test.h (t18, f18): Declare.
11843
11844 * configure.ac: Don't test for objdump, c++filt, or readelf.
11845 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11846 conditionals.
11847 (TEST_READELF): New variable.
11848 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11849 (check_PROGRAMS): Add two_file_strip_test.
11850 (two_file_strip_test): New target.
11851 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11852 (two_file_same_shared_strip_test_SOURCES): New variable.
11853 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11854 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11855 (two_file_same_shared_strip_test_LDADD): New variable.
11856 (two_file_shared_strip.so): New target.
11857 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11858 (ver_test_5.syms, ver_test_7.syms): Likewise.
11859 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11860 (strip_test_3.stdout): Use TEST_OBJDUMP.
11861 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11862
11863 2008-04-04 Cary Coutant <ccoutant@google.com>
11864
11865 * symtab.h (Symbol::is_weak_undefined): New function.
11866 (Symbol::is_strong_undefined): New function.
11867 (Symbol::is_absolute): New function.
11868 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11869 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11870 absolute symbols.
11871 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11872 (weak_undef_test): New target.
11873 * testsuite/Makefile.in: Rebuild.
11874 * testsuite/weak_undef_file1.cc: New file.
11875 * testsuite/weak_undef_file2.cc: New file.
11876 * testsuite/weak_undef_test.cc: New file.
11877
11878 2008-04-03 Craig Silverstein <csilvers@google.com>
11879
11880 * compressed_output.h (class Output_compressed_section): Use
11881 unsigned buffer.
11882 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11883 add zlib header.
11884 (zlib_compressed_suffix): Removed.
11885 (Output_compressed_section::set_final_data_size): Use unsigned
11886 buffers.
11887 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11888 Fix linker invocation.
11889 (flagstest_o_specialfile_and_compress_debug_sections):
11890 Likewise.
11891 * testsuite/Makefile.in: Regenerated.
11892
11893 2008-04-02 David S. Miller <davem@davemloft.net>
11894
11895 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11896 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11897
11898 2008-04-02 Craig Silverstein <csilvers@google.com>
11899
11900 * TODO: New file.
11901
11902 2008-04-02 Ian Lance Taylor <iant@google.com>
11903
11904 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11905 parameters. Update for new key type to views_. Change all
11906 callers.
11907 (File_read::read): Adjust for byteshift in returned view.
11908 (File_read::add_view): New function, broken out of
11909 find_and_make_view.
11910 (File_read::make_view): New function, broken out of
11911 find_and_make_view.
11912 (File_read::find_or_make_view): Add offset and aligned
11913 parameters. Rewrite accordingly. Change all callers.
11914 (File_read::get_view): Add offset and aligned parameters. Adjust
11915 for byteshift in return value.
11916 (File_read::get_lasting_view): Likewise.
11917 * fileread.h (class File_read): Update declarations.
11918 (class File_read::View): Add byteshift_ field. Add byteshift to
11919 constructor. Add byteshift method.
11920 * archive.h (Archive::clear_uncached_views): New function.
11921 (Archive::get_view): Add aligned parameter. Change all callers.
11922 * object.h (Object::get_view): Add aligned parameter. Change all
11923 callers.
11924 (Object::get_lasting_view): Likewise.
11925
11926 * fileread.cc (File_read::release): Don't call clear_views if
11927 there are multiple objects.
11928 * fileread.h (File_read::clear_uncached_views): New function.
11929 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11930 on the archive.
11931
11932 2008-03-31 Cary Coutant <ccoutant@google.com>
11933
11934 Add thin archive support.
11935 * archive.cc (Archive::armagt): New const.
11936 (Archive::setup): Remove task parameter and calls to unlock.
11937 (Archive::unlock_nested_archives): New function.
11938 (Archive::read_header): Add nested_off parameter. Change
11939 all callers.
11940 (Archive::interpret_header): Likewise.
11941 (Archive::include_all_members): Change to handle thin
11942 archives.
11943 (Archive::include_member): Likewise.
11944 * archive.h (Archive::Archive): Add new parameters and
11945 initializers.
11946 (Archive::armagt): New const.
11947 (Archive::setup): Remove task parameter.
11948 (Archive::unlock_nested_archives): New function.
11949 (Archive::read_header): Add nested_off parameter.
11950 (Archive::interpret_header): Likewise.
11951 (Archive::Nested_archive_table): New typedef.
11952 (Archive::is_thin_archive_): New field.
11953 (Archive::nested_archives_): New field.
11954 (Archive::options_): New field.
11955 (Archive::dirpath_): New field.
11956 (Archive::task_): New field.
11957 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11958 for thin archives. Pass additional parameters to
11959 Archive::Archive. Unlock the archive file after calling
11960 Archive::setup.
11961
11962 2008-03-29 Ian Lance Taylor <iant@google.com>
11963
11964 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11965 version symbol to be local.
11966 * testsuite/ver_test_4.sh: New file.
11967 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11968 (check_DATA): Add ver_test_4.syms.
11969 (ver_test_4.syms): New target.
11970 * testsuite/Makefile.in: Rebuild.
11971
11972 * output.cc
11973 (Output_section::Input_section_sort_entry::has_priority): New
11974 function.
11975 (Output_section::Input_section_sort_entry::match_file_name): New
11976 function.
11977 (Output_section::Input_section_sort_entry::match_section_name):
11978 Remove.
11979 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11980 Remove.
11981 (Output_section::Input_section_sort_entry::match_section_file):
11982 Remove.
11983 (Output_section::Input_section_sort_compare::operator()): Rewrite
11984 using new Input_section_sort_entry functions. Sort crtbegin and
11985 crtend first. Sort sections with no priority before sections with
11986 a priority.
11987 * testsuite/initpri1.c (d3): Check j != 4.
11988 (cd5): New constructor/destructor function.
11989 (main): Check j != 2.
11990
11991 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11992 new symbol when resolving, don't call set_is_default.
11993 * testsuite/ver_test_7.cc: New file.
11994 * testsuite/ver_test_7.sh: New file.
11995 * testsuite/Makefile.am (ver_test_7.so): New target.
11996 (ver_test_7.o): New target.
11997 (check_SCRIPTS): Add ver_test_7.sh.
11998 (check_DATA): Add ver_test_7.syms.
11999 (ver_test_7.syms): New target.
12000
12001 2008-03-28 Ian Lance Taylor <iant@google.com>
12002
12003 * layout.cc (Layout::layout): If we see an input section with a
12004 name that needs sorting, set the must_sort flag for the output
12005 section.
12006 (Layout::make_output_section): If the name of the output section
12007 indicates that it might require sorting, set the may_sort flag.
12008 * output.h (Output_section::may_sort_attached_input_sections): New
12009 function.
12010 (Output_section::set_may_sort_attached_input_sections): New
12011 function.
12012 (Output_section::must_sort_attached_input_sections): New
12013 function.
12014 (Output_section::set_must_sort_attached_input_sections): New
12015 function.
12016 (class Output_section): Declare Input_section_sort_entry. Define
12017 Input_section_sort_compare. Declare
12018 sort_attached_input_sections. Add new fields:
12019 may_sort_attached_input_sections_,
12020 must_sort_attached_input_sections_,
12021 attached_input_sections_are_sorted_.
12022 * output.cc (Output_section::Output_section): Initialize new
12023 fields.
12024 (Output_section::add_input_section): Add an entry to
12025 input_sections_ if may_sort or must_sort are true.
12026 (Output_section::set_final_data_size): Call
12027 sort_attached_input_sections if necessary.
12028 (Output_section::Input_section_sort_entry): Define new class.
12029 (Output_section::Input_section_sort_compare::operator()): New
12030 function.
12031 (Output_section::sort_attached_input_sections): New function.
12032 * configure.ac: Check whether the compiler supports constructor
12033 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12034 * testsuite/initpri1.c: New file.
12035 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12036 CONSTRUCTOR_PRIORITY.
12037 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12038 (initpri1_LDFLAGS): New variable.
12039 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12040
12041 2008-03-27 Ian Lance Taylor <iant@google.com>
12042
12043 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12044 * testsuite/common_test_1.c: New file.
12045 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12046 (common_test_1_SOURCES): New variable.
12047 (common_test_1_DEPENDENCIES): New variable.
12048 (common_test_1_LDFLAGS): New variable.
12049
12050 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12051 and commons_ correctly when NAME/VERSION does not override
12052 NAME/NULL.
12053 * testsuite/ver_test_6.c: New file.
12054 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12055 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12056 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12057
12058 2008-03-26 Ian Lance Taylor <iant@google.com>
12059
12060 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12061 of an undefined symbol from a version script.
12062 * testsuite/Makefile.am (ver_test_5.so): New target.
12063 (ver_test_5.o): New target.
12064 (check_SCRIPTS): Add ver_test_5.sh.
12065 (check_DATA): Add ver_test_5.syms.
12066 (ver_test_5.syms): New target.
12067 * testsuite/ver_test_5.cc: New file.
12068 * testsuite/ver_test_5.script: New file.
12069 * testsuite/ver_test_5.sh: New file.
12070 * Makefile.in, testsuite/Makefile.in: Rebuild.
12071
12072 PR gold/5986
12073 Fix problems building gold with gcc 4.3.0.
12074 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12075 (gold_error_at_location, gold_warning_at_location): Use it.
12076 * configure.ac: Check whether we can compile and use a template
12077 function with a printf attribute.
12078 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12079 when jumping over bytes.
12080 * object.cc: Instantiate Object::read_section_data.
12081 * debug.h: Include <cstring>
12082 * dwarf_reader.cc: Include <algorithm>
12083 * main.cc: Include <cstring>.
12084 * options.cc: Include <cstring>.
12085 * output.cc: Include <cstring>.
12086 * script.cc: Include <cstring>.
12087 * script.h: Include <string>.
12088 * symtab.cc: Include <cstring> and <algorithm>.
12089 * target-select.cc: Include <cstring>.
12090 * version.cc: Include <string>.
12091 * testsuite/testmain.cc: Include <cstdlib>.
12092 * configure, config.in: Rebuild.
12093
12094 2008-03-25 Ian Lance Taylor <iant@google.com>
12095
12096 * options.cc: Include "../bfd/bfdver.h".
12097 (options::help): Print bug reporting address.
12098
12099 * version.cc (print_version): Adjust output for current value of
12100 BFD_VERSION_STRING.
12101
12102 * NEWS: New file.
12103
12104 * options.cc (options::help): Print list of supported targets.
12105 * target-select.h: Include <vector>.
12106 (class Target_selector): Make machine_, size_, and is_big_endian_
12107 fields const. Add bfd_name_ and instantiated_target_ fields.
12108 (Target_selector::Target_selector): Add bfd_name parameter.
12109 (Target_selector::recognize): Make non-virtual, call
12110 do_recognize.
12111 (Target_selector::recognize_by_name): Make non-virtual, call
12112 do_recognize_by_name.
12113 (Target_selector::supported_names): New function.
12114 (Target_selector::bfd_name): New function.
12115 (Target_selector::do_instantiate_target): New pure virtual
12116 function.
12117 (Target_selector::do_recognize): New virtual function.
12118 (Target_selector::do_recognize_by_name): New virtual function.
12119 (Target_selector::instantiate_target): New private function.
12120 (supported_target_names): Declare.
12121 * target-select.cc (Target_selector::Target_selector): Update for
12122 new parameter and fields.
12123 (select_target_by_name): Check that the name matches before
12124 calling recognize_by_name.
12125 (supported_target_names): New function.
12126 * i386.cc (class Target_selector_i386): Update Target_selector
12127 constructor call. Remove recognize and recognize_by_name. Add
12128 do_instantiate_target.
12129 * x86_64.cc (class Target_selector_x86_64): Likewise.
12130 * testsuite/testfile.cc (class Target_selector_test): Update for
12131 changes to Target_selector.
12132
12133 * README: Rewrite, with some notes on unsupported features.
12134
12135 2008-03-24 Cary Coutant <ccoutant@google.com>
12136
12137 * i386.cc (Target_i386::Got_type): New enum declaration.
12138 (Target_i386::Scan::local): Updated callers of Output_data_got
12139 member functions.
12140 (Target_i386::Scan::global): Likewise.
12141 (Target_i386::Relocate::relocate): Likewise.
12142 (Target_i386::Relocate::relocate_tls): Likewise.
12143 * object.h (Got_offset_list): New class.
12144 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12145 (Sized_relobj::local_got_offset): Likewise.
12146 (Sized_relobj::set_local_got_offset): Likewise.
12147 (Sized_relobj::local_has_tls_got_offset): Removed.
12148 (Sized_relobj::local_tls_got_offset): Removed.
12149 (Sized_relobj::set_local_tls_got_offset): Removed.
12150 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12151 * output.cc (Output_data_got::add_global): Added got_type parameter.
12152 (Output_data_got::add_global_with_rel): Likewise.
12153 (Output_data_got::add_global_with_rela): Likewise.
12154 (Output_data_got::add_global_pair_with_rel): New function.
12155 (Output_data_got::add_global_pair_with_rela): New function.
12156 (Output_data_got::add_local): Added got_type parameter.
12157 (Output_data_got::add_local_with_rel): Likewise.
12158 (Output_data_got::add_local_with_rela): Likewise.
12159 (Output_data_got::add_local_pair_with_rel): New function.
12160 (Output_data_got::add_local_pair_with_rela): New function.
12161 (Output_data_got::add_global_tls): Removed.
12162 (Output_data_got::add_global_tls_with_rel): Removed.
12163 (Output_data_got::add_global_tls_with_rela): Removed.
12164 (Output_data_got::add_local_tls): Removed.
12165 (Output_data_got::add_local_tls_with_rel): Removed.
12166 (Output_data_got::add_local_tls_with_rela): Removed.
12167 * output.h (Output_data_got::add_global): Added got_type parameter.
12168 (Output_data_got::add_global_with_rel): Likewise.
12169 (Output_data_got::add_global_with_rela): Likewise.
12170 (Output_data_got::add_global_pair_with_rel): New function.
12171 (Output_data_got::add_global_pair_with_rela): New function.
12172 (Output_data_got::add_local): Added got_type parameter.
12173 (Output_data_got::add_local_with_rel): Likewise.
12174 (Output_data_got::add_local_with_rela): Likewise.
12175 (Output_data_got::add_local_pair_with_rel): New function.
12176 (Output_data_got::add_local_pair_with_rela): New function.
12177 (Output_data_got::add_global_tls): Removed.
12178 (Output_data_got::add_global_tls_with_rel): Removed.
12179 (Output_data_got::add_global_tls_with_rela): Removed.
12180 (Output_data_got::add_local_tls): Removed.
12181 (Output_data_got::add_local_tls_with_rel): Removed.
12182 (Output_data_got::add_local_tls_with_rela): Removed.
12183 * resolve.cc (Symbol::override_base_with_special): Removed
12184 reference to has_got_offset_ field.
12185 * symtab.cc (Symbol::init_fields): Replaced initialization
12186 of got_offset_ with got_offsets_. Removed initialization
12187 of has_got_offset_
12188 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
12189 (Symbol::got_offset): Likewise.
12190 (Symbol::set_got_offset): Likewise.
12191 (Symbol::has_tls_got_offset): Removed.
12192 (Symbol::tls_got_offset): Removed.
12193 (Symbol::set_tls_got_offset): Removed.
12194 (Symbol::got_offset_): Removed.
12195 (Symbol::tls_mod_got_offset_): Removed.
12196 (Symbol::tls_pair_got_offset_): Removed.
12197 (Symbol::got_offsets_): New field.
12198 (Symbol::has_got_offset): Removed.
12199 (Symbol::has_tls_mod_got_offset): Removed.
12200 (Symbol::has_tls_pair_got_offset): Removed.
12201 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12202 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12203 member functions.
12204 (Target_x86_64::Scan::global): Likewise.
12205 (Target_x86_64::Relocate::relocate): Likewise.
12206 (Target_x86_64::Relocate::relocate_tls): Likewise.
12207
12208 2008-03-25 Ben Elliston <bje@au.ibm.com>
12209
12210 * yyscript.y: Fix spelling error in comment.
12211
12212 2008-03-24 Ian Lance Taylor <iant@google.com>
12213
12214 * options.h (class General_options): Define build_id option.
12215 * layout.h (class Layout): Declare write_build_id, create_note,
12216 create_build_id. Add build_id_note_ member.
12217 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12218 "libiberty.h", "md5.h", "sha1.h".
12219 (Layout::Layout): Initialize eh_frame_data_,
12220 eh_frame_hdr_section_, and build_id_note_.
12221 (Layout::finalize): Call create_build_id.
12222 (Layout::create_note): New function, broken out of
12223 Layout::create_gold_note.
12224 (Layout::create_gold_note): Call create_note.
12225 (Layout::create_build_id): New function.
12226 (Layout::write_build_id): New function.
12227 (Close_task_runner::run): Call write_build_id.
12228
12229 * x86_64.cc: Correct license to GPLv3.
12230
12231 2008-03-23 Ian Lance Taylor <iant@google.com>
12232
12233 * options.cc: Include "demangle.h".
12234 (parse_optional_string): New function.
12235 (parse_long_option): Handle takes_optional_argument.
12236 (parse_short_option): Update dash_z initializer. Handle
12237 takes_optional_argument.
12238 (General_options::General_options): Initialize do_demangle_.
12239 (General_options::finalize): Set do_demangle_. Handle demangling
12240 style.
12241 * options.h (parse_optional_string): Declare.
12242 (struct One_option): Add optional_arg field. Update constructor.
12243 Update call constructor calls. Add takes_optional_argument
12244 function.
12245 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12246 (DEFINE_optional_string): Define.
12247 (General_options::demangle): Change from DEFINE_bool to
12248 DEFINE_optional_string.
12249 (General_options::no_demangle): New function.
12250 (General_options::do_demangle): New function.
12251 (General_options::set_do_demangle): New function.
12252 (General_options::execstack_status_): Move definition to end of
12253 class definition.
12254 (General_options::static_): Likewise.
12255 (General_options::do_demangle_): New field.
12256 * object.cc (big_endian>::get_symbol_location_info): Call
12257 Options::do_demangle, not Options::demangle.
12258 * symtab.cc (demangle): Likewise.
12259
12260 2008-03-22 Ian Lance Taylor <iant@google.com>
12261
12262 * gold.h: Include <cstddef> and <sys/types.h>
12263 * options.h: Include <cstring>.
12264
12265 2008-03-21 Ian Lance Taylor <iant@google.com>
12266
12267 * Added source code to GNU binutils.