include/ChangeLog
[binutils-gdb.git] / gold / ChangeLog
1 2011-09-26 Cary Coutant <ccoutant@google.com>
2
3 gcc PR lto/47247
4 * plugin.cc (get_symbols_v2): New function.
5 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6 (is_referenced_from_outside): New function.
7 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
8 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
9 (get_symbols): Pass version parameter.
10 (get_symbols_v2): New function.
11 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
12 parameter.
13 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
14 (onload): Add LDPT_GET_SYMBOLS_V2.
15 (all_symbols_read_hook): Use get_symbols_v2; check for
16 LDPR_PREVAILING_DEF_IRONLY_EXP.
17 * testsuite/plugin_test_3.sh: Update expected results.
18
19 2011-09-23 Simon Baldwin <simonb@google.com>
20
21 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
22 configuration options.
23 * configure: Regenerate.
24 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
25 * Makefile.in: Regenerate.
26 * testsuite/Makefile.in: Regenerate.
27
28 2011-09-19 Sriraman Tallam <tmsriram@google.com>
29
30 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
31
32 2011-09-19 Cary Coutant <ccoutant@google.com>
33
34 * incremental.cc (can_incremental_update): Fix typo in comment.
35 * incremental.h (can_incremental_update): Likewise.
36
37 2011-09-18 Cary Coutant <ccoutant@google.com>
38
39 * incremental.cc (can_incremental_update): New function.
40 * incremental.h (can_incremental_update): New function.
41 * layout.cc (Layout::init_fixed_output_section): Call it.
42 (Layout::make_output_section): Don't allow patch space in .eh_frame.
43 * object.cc (Sized_relobj_file::do_layout): Call
44 can_incremental_update.
45
46 2011-09-13 Cary Coutant <ccoutant@google.com>
47
48 * configure.ac: Check for glibc support for gnu_indirect_function
49 support with static linking, setting automake conditional
50 IFUNC_STATIC.
51 * Makefile.in: Regenerate.
52 * configure: Regenerate.
53
54 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
55 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
56 for IFUNC_STATIC.
57 * testsuite/Makefile.in: Regenerate.
58
59 2011-09-13 Cary Coutant <ccoutant@google.com>
60
61 * incremental.cc (Sized_relobj_incr::do_layout): Call
62 report_comdat_group for kept comdat sections.
63 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
64 * testsuite/Makefile.in: Regenerate.
65 * testsuite/incr_comdat_test_1.cc: New source file.
66 * testsuite/incr_comdat_test_2_v1.cc: New source file.
67 * testsuite/incr_comdat_test_2_v2.cc: New source file.
68 * testsuite/incr_comdat_test_2_v3.cc: New source file.
69
70 2011-09-13 Ian Lance Taylor <iant@google.com>
71
72 * object.cc (Sized_relobj_file::do_layout): Remove unused local
73 variable external_symbols_offset.
74
75 2011-09-12 Ian Lance Taylor <iant@google.com>
76
77 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
78 triggered if object has no symbols.
79
80 2011-09-09 David S. Miller <davem@davemloft.net>
81
82 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
83 (Output_fill_debug_line::do_write): Likewise.
84
85 2011-08-29 Cary Coutant <ccoutant@google.com>
86
87 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
88 casts to match formatting specs.
89 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
90
91 2011-08-26 Cary Coutant <ccoutant@google.com>
92
93 * layout.cc (Free_list::allocate): Provide guarantee of minimum
94 remaining hole size when allocating.
95 (Layout::make_output_section): Set fill methods for debug sections.
96 * layout.h (Free_list::Free_list_node): Move from private to
97 public.
98 (Free_list::set_min_hole_size): New function.
99 (Free_list::begin, Free_list::end): New functions.
100 (Free_list::min_hole_): New data member.
101 * output.cc: Include dwarf.h.
102 (Output_fill_debug_info::do_minimum_hole_size): New function.
103 (Output_fill_debug_info::do_write): New function.
104 (Output_fill_debug_line::do_minimum_hole_size): New function.
105 (Output_fill_debug_line::do_write): New function.
106 (Output_section::Output_section): Initialize new data member.
107 (Output_section::set_final_data_size): Ensure patch space is larger
108 than minimum hole size.
109 (Output_section::do_write): Fill holes in debug sections.
110 * output.h (Output_fill): New class.
111 (Output_fill_debug_info): New class.
112 (Output_fill_debug_line): New class.
113 (Output_section::set_free_space_fill): New function.
114 (Output_section::free_space_fill_): New data member.
115 * testsuite/Makefile.am (incremental_test_3): Add
116 --incremental-patch option.
117 (incremental_test_4): Likewise.
118 (incremental_test_5): Likewise.
119 (incremental_test_6): Likewise.
120 (incremental_copy_test): Likewise.
121 (incremental_common_test_1): Likewise.
122 * testsuite/Makefile.in: Regenerate.
123
124 2011-08-26 Nick Clifton <nickc@redhat.com>
125
126 * po/es.po: Updated Spanish translation.
127
128 2011-08-01 Cary Coutant <ccoutant@google.com>
129
130 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
131 * gold/testsuite/Makefile.in: Regenerate.
132 * gold/testsuite/justsyms_exec.c: New source file.
133 * gold/testsuite/justsyms_lib.c: New source file.
134
135 2011-08-01 Cary Coutant <ccoutant@google.com>
136
137 * layout.cc (Layout::set_segment_offsets): Don't realign text
138 segment if -Ttext was specified.
139 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
140 file type.
141 * object.h (Sized_relobj_file::e_type): New function.
142 (Sized_relobj_file::e_type_): New data member.
143 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
144 base address for ET_EXEC files.
145 * target.cc (Target::do_make_elf_object_implementation): Allow
146 ET_EXEC files with --just-symbols option.
147
148 2011-07-28 Cary Coutant <ccoutant@google.com>
149
150 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
151 Add thread_number parameter.
152 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
153 * workqueue-threads.cc
154 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
155 current thread if its thread number is greater than desired thread
156 count.
157 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
158 Add thread_number parameter.
159 (Workqueue::should_cancel_thread): Likewise.
160 (Workqueue::find_runnable_or_wait): Pass thread_number to
161 should_cancel_thread.
162 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
163 parameter.
164
165 2011-07-22 Sriraman Tallam <tmsriram@google.com>
166
167 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
168 only after checking if it cannot be forced local.
169 * symtab.h (is_externally_visible): Check if the symbol is not forced
170 local.
171
172 2011-07-15 Ian Lance Taylor <iant@google.com>
173
174 * options.h (class General_options): Add --print-output-format.
175 Move -EL next to -EB, for better --help output.
176 * target-select.cc: Include <cstdio>, "options.h", and
177 "parameters.h".
178 (Target_selector::do_target_bfd_name): New function.
179 (print_output_format): New function.
180 * target-select.h (class Target_selector): Update declarations.
181 (Target_selector::target_bfd_name): New function.
182 (print_output_format): Declare.
183 * main.cc: Include "target-select.h".
184 (main): Handle --print-output-format.
185 * gold.cc: Include "target-select.h".
186 (queue_initial_tasks): Handle --print-output-format when there are
187 no input files.
188 * parameters.cc (parameters_force_valid_target): Give a better
189 error message if -EB/-EL does not match target.
190 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
191 function.
192
193 2011-07-15 Ian Lance Taylor <iant@google.com>
194
195 * i386.cc (class Output_data_plt_i386): Add layout_ field.
196 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
197 (Output_data_plt_i386::do_write): Write address of .dynamic
198 section to first entry in .got.plt section.
199 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
200 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
201 Initialize layout_.
202 (Output_data_plt_x86_64::do_write): Write address of .dynamic
203 section to first entry in .got.plt section.
204 * layout.h (Layout::dynamic_section): New function.
205
206 2011-07-13 Sriraman Tallam <tmsriram@google.com>
207
208 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
209 to claim_file call.
210 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
211 input_section_position_, and input_section_glob_.
212 (read_layout_from_file): Call function section_ordering_specified.
213 * layout.h (is_section_ordering_specified): New function.
214 (section_ordering_specified): New function.
215 (section_ordering_specified_): New boolean member.
216 * main.cc(main): Call load_plugins after layout object is defined.
217 * output.cc (Output_section::add_input_section): Use
218 function section_ordering_specified to check if section ordering is
219 needed.
220 * output.cc (Output_section::add_relaxed_input_section): Use
221 function section_ordering_specified to check if section ordering is
222 needed.
223 (Output_section::update_section_layout): New function.
224 (Output_section::sort_attached_input_sections): Check if input section
225 must be reordered.
226 * output.h (Output_section::update_section_layout): New function.
227 * plugin.cc (get_section_count): New function.
228 (get_section_type): New function.
229 (get_section_name): New function.
230 (get_section_contents): New function.
231 (update_section_order): New function.
232 (allow_section_ordering): New function.
233 (Plugin::load): Add the new interfaces to the transfer vector.
234 (Plugin_manager::load_plugins): New parameter.
235 (Plugin_manager::all_symbols_read): New parameter.
236 (Plugin_manager::claim_file): New parameter. Save the elf object for
237 unclaimed objects.
238 (Plugin_manager::get_elf_object): New function.
239 (Plugin_manager::get_view): Change to directly use the bool to check
240 if get_view is called from claim_file_hook.
241 * plugin.h (input_objects): New function
242 (Plugin__manager::load_plugins): New parameter.
243 (Plugin_manager::claim_file): New parameter.
244 (Plugin_manager::get_elf_object): New function.
245 (Plugin_manager::in_claim_file_handler): New function.
246 (Plugin_manager::in_claim_file_handler_): New member.
247 (layout): New function.
248 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
249 handler with an extra parameter. Make the elf object before calling
250 claim_file handler.
251 * testsuite/plugin_test.c (get_section_count): New function pointer.
252 (get_section_type): New function pointer.
253 (get_section_name): New function pointer.
254 (get_section_contents): New function pointer.
255 (update_section_order): New function pointer.
256 (allow_section_ordering): New function pointer.
257 (onload): Check if the new interfaces exist.
258
259 2011-07-13 Ian Lance Taylor <iant@google.com>
260
261 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
262 relro section.
263 * x86_64.cc (Target_x86_64::got_section): Likewise.
264 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
265 (relro_now_test_SOURCES): New variable.
266 (relro_now_test_DEPENDENCIES): New variable.
267 (relro_now_test_LDFLAGS): New variable.
268 (relro_now_test_LDADD): New variable.
269 (relro_now_test.so): New target.
270 * testsuite/Makefile.in: Rebuild.
271
272 2011-07-12 Ian Lance Taylor <iant@google.com>
273
274 PR gold/12980
275 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
276 GLOB_DAT relocation rather than a RELATIVE relocation for a
277 protected symbol when creating a shared library.
278 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
279 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
280 * testsuite/protected_main_1.cc (main): Test that protected
281 function has same address.
282
283 2011-07-11 Ian Lance Taylor <iant@google.com>
284
285 PR gold/12979
286 * options.h (class General_options): Add -Bgroup.
287 * options.cc (General_options::finalize): If -Bgroup is set,
288 default to --unresolved-symbols=report-all.
289 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
290 * target-reloc.h (issue_undefined_symbol_error): Handle
291 --unresolved-symbols=report-all.
292
293 2011-07-08 Ian Lance Taylor <iant@google.com>
294
295 PR gold/11985
296 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
297 if linker script discards key sections.
298 (Layout::create_dynamic_symtab): Likewise.
299 (Layout::assign_local_dynsym_offsets): Likewise.
300 (Layout::sized_create_version_sections): Likewise.
301 (Layout::create_interp): Likewise.
302 (Layout::finish_dynamic_section): Likewise.
303 (Layout::set_dynamic_symbol_size): Likewise.
304
305 2011-07-08 Ian Lance Taylor <iant@google.com>
306
307 PR gold/12386
308 * options.h (class General_options): Add --unresolved-symbols.
309 * target-reloc.h (issue_undefined_symbol_error): Check
310 --unresolved-symbols. Add comments.
311
312 2011-07-08 Ian Lance Taylor <iant@google.com>
313
314 * testsuite/odr_violation2.cc (Ordering::operator()): Make
315 expression more complex.
316
317 2011-07-08 Ian Lance Taylor <iant@google.com>
318
319 PR gold/11317
320 * target-reloc.h (issue_undefined_symbol_error): New inline
321 function, broken out of relocate_section.
322 (relocate_section): Call issue_undefined_symbol_error.
323 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
324 there is no TLS segment if we are about to issue an undefined
325 symbol error.
326 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
327
328 2011-07-08 Ian Lance Taylor <iant@google.com>
329
330 PR gold/12279
331 * resolve.cc (Symbol_table::should_override): Add fromtype
332 parameter. Change all callers. Give error when linking together
333 TLS and non-TLS symbol.
334 (Symbol_table::should_override_with_special): Add fromtype
335 parameter. Change all callers.
336 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
337 there is no TLS segment if we have reported some errors.
338 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
339
340 2011-07-08 Ian Lance Taylor <iant@google.com>
341
342 PR gold/12372
343 * target.h (Target::plt_address_for_global): New function.
344 (Target::plt_address_for_local): New function.
345 (Target::plt_section_for_global): Remove.
346 (Target::plt_section_for_local): Remove.
347 (Target::do_plt_address_for_global): New virtual function.
348 (Target::do_plt_address_for_local): New virtual function.
349 (Target::do_plt_section_for_global): Remove.
350 (Target::do_plt_section_for_local): Remove.
351 (Target::register_global_plt_entry): Add Symbol_table and Layout
352 parameters.
353 * output.cc (Output_data_got::Got_entry::write): Use
354 plt_address_for_global and plt_address_for_local.
355 * layout.cc (Layout::add_target_dynamic_tags): Use size and
356 address of output section.
357 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
358 got_irelative_, and irelative_count_ fields. Update
359 declarations.
360 (Output_data_plt_i386::has_irelative_section): New function.
361 (Output_data_plt_i386::entry_count): Add irelative_count_.
362 (Output_data_plt_i386::set_final_data_size): Likewise.
363 (class Target_i386): Add got_irelative_ and rel_irelative_
364 fields. Update declarations.
365 (Target_i386::Target_i386): Initialize new fields.
366 (Target_i386::do_plt_address_for_global): New function replacing
367 do_plt_section_for_global.
368 (Target_i386::do_plt_address_for_local): New function replacing
369 do_plt_section_for_local.
370 (Target_i386::got_section): Create got_irelative_.
371 (Target_i386::rel_irelative_section): New function.
372 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
373 fields. Don't define __rel_iplt_{start,end}.
374 (Output_data_plt_i386::add_entry): Add symtab and layout
375 parameters. Change all callers. Use different PLT and GOT for
376 IFUNC symbols.
377 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
378 layout parameters. Change all callers. Use different PLT and
379 GOT.
380 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
381 (Output_data_plt_i386::rel_irelative): New function.
382 (Output_data_plt_i386::address_for_global): New function.
383 (Output_data_plt_i386::address_for_local): New function.
384 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
385 IRELATIVE GOT when changing IFUNC GOT entries.
386 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
387 reloc.
388 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
389 if we didn't create an IRELATIVE GOT.
390 (Target_i386::Relocate::relocate): Use plt_address_for_global and
391 plt_address_for_local.
392 (Target_i386::do_dynsym_value): Use plt_address_for_global.
393 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
394 got_irelative_, and irelative_count_ fields. Update
395 declarations.
396 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
397 Initialize new fields. Remove symtab parameter. Change all
398 callers.
399 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
400 irelative_count_.
401 (Output_data_plt_x86_64::has_irelative_section): New function.
402 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
403 (class Target_x86_64): Add got_irelative_ and rel_irelative_
404 fields. Update declarations.
405 (Target_x86_64::Target_x86_64): Initialize new fields.
406 (Target_x86_64::do_plt_address_for_global): New function replacing
407 do_plt_section_for_global.
408 (Target_x86_64::do_plt_address_for_local): New function replacing
409 do_plt_section_for_local.
410 (Target_x86_64::got_section): Create got_irelative_.
411 (Target_x86_64::rela_irelative_section): New function.
412 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
413 all callers. Don't create __rel_iplt_{start,end}.
414 (Output_data_plt_x86_64::add_entry): Add symtab and layout
415 parameters. Change all callers. Use different PLT and GOT for
416 IFUNC symbols.
417 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
418 layout parameters. Change all callers. Use different PLT and
419 GOT.
420 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
421 parameters. Change all callers. Use different PLT and GOT for
422 IFUNC symbols.
423 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
424 (Output_data_plt_x86_64::rela_irelative): New function.
425 (Output_data_plt_x86_64::address_for_global): New function.
426 (Output_data_plt_x86_64::address_for_local): New function.
427 (Output_data_plt_x86_64::set_final_data_size): Likewise.
428 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
429 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
430 (Target_x86_64::register_global_plt_entry): Add symtab and layout
431 parameters.
432 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
433 reloc.
434 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
435 symbols if we didn't create an IRELATIVE GOT.
436 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
437 plt_address_for_local.
438 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
439 * testsuite/ifuncvar1.c: New test file.
440 * testsuite/ifuncvar2.c: New test file.
441 * testsuite/ifuncvar3.c: New test file.
442 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
443 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
444 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
445 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
446 * testsuite/Makefile.in: Rebuild.
447
448 2011-07-07 Cary Coutant <ccoutant@google.com>
449
450 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
451 (two_file_test_1_ndebug.o): Likewise.
452 (two_file_test_1b_ndebug.o): Likewise.
453 (two_file_test_2_ndebug.o): Likewise.
454 (two_file_test_main_ndebug.o): Likewise.
455 (incremental_test_2): Link with no-debug versions.
456
457 2011-07-06 Cary Coutant <ccoutant@google.com>
458
459 * gold/incremental.cc
460 (Output_section_incremental_inputs::write_info_blocks): Check for
461 hidden and internal symbols.
462
463 2011-07-06 Cary Coutant <ccoutant@google.com>
464
465 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
466 Check disposition for startup file.
467 (Incremental_inputs::report_command_line): Ignore
468 --incremental-startup-unchanged option.
469 * options.cc (General_options::parse_incremental_startup_unchanged):
470 New function.
471 (General_options::General_options): Initialize new data member.
472 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
473 (General_options): Add --incremental-startup-unchanged option.
474 (General_options::incremental_startup_disposition): New function.
475 (General_options::incremental_startup_disposition_): New data member.
476
477 2011-07-06 Cary Coutant <ccoutant@google.com>
478
479 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
480 input file index to Script_info ctor.
481 (Sized_incremental_binary::do_file_has_changed): Find the
482 command-line argument for files named in scripts.
483 * incremental.h (Script_info::Script_info): New ctor
484 with input file index.
485 (Script_info::input_file_index): New function.
486 (Script_info::input_file_index_): New data member.
487 (Incremental_binary::get_library): Add const.
488 (Incremental_binary::get_script_info): Add const.
489 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
490 * testsuite/Makefile.am (incremental_test_5): New test case.
491 (incremental_test_6): New test case.
492 * testsuite/Makefile.in: Regenerate.
493
494 2011-07-06 Cary Coutant <ccoutant@google.com>
495
496 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
497 debug output when command lines differ.
498
499 2011-07-06 Cary Coutant <ccoutant@google.com>
500
501 * incremental.cc (Incremental_inputs::report_command_line): Ignore
502 --incremental-patch option.
503 * layout.cc (Free_list::allocate): Extend allocation beyond original
504 end if enabled.
505 (Layout::make_output_section): Mark sections that should get
506 patch space.
507 * options.cc (parse_percent): New function.
508 * options.h (parse_percent): New function.
509 (DEFINE_percent): New macro.
510 (General_options): Add --incremental-patch option.
511 * output.cc (Output_section::Output_section): Initialize new data
512 members.
513 (Output_section::add_input_section): Print section name when out
514 of patch space.
515 (Output_section::add_output_section_data): Likewise.
516 (Output_section::set_final_data_size): Add patch space when
517 doing --incremental-full.
518 (Output_section::do_reset_address_and_file_offset): Remove patch
519 space.
520 (Output_segment::set_section_list_addresses): Print debug output
521 only if --incremental-update.
522 * output.h (Output_section::set_is_patch_space_allowed): New function.
523 (Output_section::is_patch_space_allowed_): New data member.
524 (Output_section::patch_space_): New data member.
525 * parameters.cc (Parameters::incremental_full): New function.
526 * parameters.h (Parameters::incremental_full): New function
527 * testsuite/Makefile.am (incremental_test_2): Add test for
528 --incremental-patch option.
529 * testsuite/Makefile.in: Regenerate.
530 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
531 (t18): Remove function body.
532
533 2011-07-05 Doug Kwan <dougkwan@google.com>
534
535 PR gold/12771
536 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
537 Arm_Address type for relocation result.
538 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
539 overflow check.
540 (Arm_relocate_functions::abs32): Use unaligned access.
541 (Arm_relocate_functions::rel32): Ditto.
542 (Arm_relocate_functions::prel31): Ditto.
543 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
544 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
545 static data relocations.
546 * testsuite/Makefile.in: Regnerate.
547 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
548
549 2011-07-05 Ian Lance Taylor <iant@google.com>
550
551 PR gold/12392
552 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
553 symbols if necessary.
554 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
555
556 2011-07-05 Ian Lance Taylor <iant@google.com>
557
558 PR gold/12952
559 * resolve.cc (Symbol::override_base_with_special): Simply override
560 version with special symbol version, ignoring previous version.
561
562 2011-07-05 Ian Lance Taylor <iant@google.com>
563
564 * object.cc (Sized_relobj_file::include_section_group): Add
565 information to comment about signature location.
566
567 2011-07-02 Ian Lance Taylor <iant@google.com>
568
569 PR gold/12957
570 * options.h (class General_options): Add -f and -F.
571 * options.cc (General_options::finalize): Fatal error if -f/-F
572 are used without -shared.
573 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
574
575 2011-07-02 Ian Lance Taylor <iant@google.com>
576
577 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
578
579 2011-07-01 Ian Lance Taylor <iant@google.com>
580
581 PR gold/12525
582 PR gold/12952
583 * resolve.cc (Symbol::override_base_with_special): Don't override
584 the version if the overriding symbol has a different name.
585 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
586 all callers. If we give an error about an undefined version,
587 define the base version if necessary.
588 * dynobj.h (class Versions): Update declaration.
589 * testsuite/weak_alias_test_5.cc: New file.
590 * testsuite/weak_alias_test.script: New file.
591 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
592 and versioned_alias have the right value, and call t2.
593 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
594 weak_alias_test_5.so.
595 (weak_alias_test_LDADD): Likewise.
596 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
597 * testsuite/Makefile.in: Rebuild.
598
599 2011-07-01 Ian Lance Taylor <iant@google.com>
600
601 PR gold/12525
602 * options.h (class General_options): Support -z notext.
603 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
604 -Wl,-z,notext.
605 (two_file_shared_nonpic.so): Likewise.
606 (two_file_shared_mixed.so): Likewise.
607 (two_file_shared_mixed_1.so): Likewise.
608 (weak_undef_lib_nonpic.so): Likewise.
609 (alt/weak_undef_lib_nonpic.so): Likewise.
610 (tls_test_shared_nonpic.so): Likewise.
611 * testsuite/Makefile.in: Rebuild.
612
613 2011-07-01 Ian Lance Taylor <iant@google.com>
614
615 PR gold/12525
616 * configure.ac: Test whether static linking works, setting
617 the automake conditional HAVE_STATIC.
618 * testsuite/Makefile.am: Disable tests using -static if
619 HAVE_STATIC is not true.
620 * configure, testsuite/Makefile.in: Rebuild.
621
622 2011-07-01 Ian Lance Taylor <iant@google.com>
623
624 PR gold/12525
625 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
626 Assert if we see DW_EH_PE_indirect.
627 * target.h (Target::ehframe_datarel_base): New function.
628 (Target::do_ehframe_datarel_base): New target function.
629 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
630 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
631 function.
632
633 2011-07-01 Ian Lance Taylor <iant@google.com>
634
635 PR gold/12571
636 * options.h (class General_options): Add
637 --ld-generated-unwind-info.
638 * ehframe.cc (Fde::write): Add address parameter. Change all
639 callers. If associated with PLT, fill in address and size.
640 (Cie::set_output_offset): Only add merge mapping if there is an
641 object.
642 (Cie::write): Add address parameter. Change all callers.
643 (Eh_frame::add_ehframe_for_plt): New function.
644 * ehframe.h (class Fde): Update declarations. Move shndx_ and
645 input_offset_ fields into union u_, with new plt field.
646 (Fde::Fde): Adjust for new union field.
647 (Fde::Fde) [Output_data version]: New constructor.
648 (Fde::add_mapping): Only add merge mapping if there is an object.
649 (class Cie): Update declarations.
650 (class Eh_frame): Declare add_ehframe_for_plt.
651 * layout.cc (Layout::layout_eh_frame): Break out code into
652 make_eh_frame_section, and call it.
653 (Layout::make_eh_frame_section): New function.
654 (Layout::add_eh_frame_for_plt): New function.
655 * layout.h (class Layout): Update declarations.
656 * merge.cc (Merge_map::add_mapping): Add assertion.
657 * i386.cc: Include "dwarf.h".
658 (class Output_data_plt_i386): Make first_plt_entry,
659 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
660 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
661 and plt_eh_frame_fde.
662 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
663 boundary. Call add_eh_frame_for_plt if appropriate.
664 * x86_64.cc: Include "dwarf.h".
665 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
666 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
667 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
668 and plt_eh_frame_fde.
669 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
670 appropriate.
671
672 2011-06-29 Ian Lance Taylor <iant@google.com>
673
674 PR gold/12629
675 * object.cc (Sized_relobj_file::layout_section): Change shdr
676 parameter to be const.
677 (Sized_relobj_file::layout_eh_frame_section): New function, broken
678 out of do_layout.
679 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
680 appropriate. Call layout_eh_frame_section.
681 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
682 sections.
683 * object.h (class Sized_relobj_file): Update declarations.
684
685 2011-06-29 Ian Lance Taylor <iant@google.com>
686
687 PR gold/12652
688 * script.cc (Token::integer_value): Accept trailing M/m/K/k
689 modifier.
690 (Lex::gather_token): Accept trailing M/m/K/k for integers.
691
692 2011-06-29 Ian Lance Taylor <iant@google.com>
693
694 PR gold/12675
695 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
696 SHT_X86_64_UNWIND.
697 * layout.cc (Layout::layout_eh_frame): Likewise.
698
699 2011-06-29 Ian Lance Taylor <iant@google.com>
700
701 PR gold/12695
702 * layout.cc (Layout::symtab_section_shndx): New function.
703 * layout.h (class Layout): Declare symtab_section_shndx.
704 * output.cc (Output_section::write_header): Call it.
705
706 2011-06-29 Ian Lance Taylor <iant@google.com>
707
708 PR gold/12818
709 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
710 symbols which are not used in a relocation.
711
712 2011-06-28 Ian Lance Taylor <iant@google.com>
713
714 PR gold/12898
715 * layout.cc (Layout::segment_precedes): Don't crash if a linker
716 script create indistinguishable segments.
717 (Layout::set_segment_offsets): Use stable_sort when sorting
718 segments. Pass this to Compare_segments constructor.
719 * layout.h (class Layout): Make segment_precedes non-static.
720 (class Compare_segments): Change from struct to class. Add
721 layout_ field. Add constructor.
722 * script-sections.cc
723 (Script_sections::attach_sections_using_phdrs_clause): Rename
724 local orphan to is_orphan. Don't report failure to put empty
725 section in segment. On attachment failure, report name of
726 section, and attach to first PT_LOAD segment.
727
728 2011-06-28 Ian Lance Taylor <iant@google.com>
729
730 PR gold/12934
731 * target-select.cc (Target_selector::Target_selector): Add
732 emulation parameter. Change all callers.
733 (select_target_by_bfd_name): Rename from select_target_by_name.
734 Change all callers.
735 (select_target_by_emulation): New function.
736 (supported_emulation_names): New function.
737 * target-select.h (class Target_selector): Add emulation_ field.
738 Update declarations.
739 (Target_selector::recognize_by_bfd_name): Rename from
740 recognize_by_name. Change all callers.
741 (Target_selector::supported_bfd_names): Rename from
742 supported_names. Change all callers.
743 (Target_selector::recognize_by_emulation): New function.
744 (Target_selector::supported_emulations): New function.
745 (Target_selector::emulation): New function.
746 (Target_selector::do_recognize_by_bfd_name): Rename from
747 do_recognize_by_name. Change all callers.
748 (Target_selector::do_supported_bfd_names): Rename from
749 do_supported_names. Change all callers.
750 (Target_selector::do_recognize_by_emulation): New function.
751 (Target_selector::do_supported_emulations): New function.
752 (select_target_by_bfd_name): Change name in declaration.
753 (select_target_by_emulation): Declare.
754 (supported_emulation_names): Declare.
755 * parameters.cc (parameters_force_valid_target): Try to find
756 target based on emulation from -m option.
757 * options.h (class General_options): Change doc string for -m.
758 * options.cc (help): Print emulations.
759 (General_options::parse_V): Likewise.
760 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
761 Add emulation parameter. Change all callers.
762
763 2011-06-28 Ian Lance Taylor <iant@google.com>
764
765 * target.h (class Target): Add osabi_ field.
766 (Target::osabi): New function.
767 (Target::set_osabi): New function.
768 (Target::Target): Initialize osabi_.
769 (Target::do_adjust_elf_header): Make pure virtual.
770 (Sized_target::do_adjust_elf_header): Declare.
771 * target.cc (Sized_target::do_adjust_elf_header): New function.
772 (class Sized_target): Instantiate all versions.
773 * freebsd.h (class Target_freebsd): Remove.
774 (Target_selector_freebsd::do_recognize): Call set_osabi on
775 Target.
776 (Target_selector_freebsd::do_recognize_by_name): Likewise.
777 (Target_selector_freebsd::set_osabi): Remove.
778 * i386.cc (class Target_i386): Inherit from Sized_target rather
779 than Target_freebsd.
780 * x86_64.cc (class Target_x86_64): Likewise.
781
782 2011-06-28 Ian Lance Taylor <iant@google.com>
783
784 * target.h (Target::can_check_for_function_pointers): Rewrite.
785 Make non-virtual.
786 (Target::can_icf_inline_merge_sections): Likewise.
787 (Target::section_may_have_icf_unsafe_poineters): Likewise.
788 (Target::Target_info): Add can_icf_inline_merge_sections field.
789 (Target::do_can_check_for_function_pointers): New virtual
790 function.
791 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
792 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
793 from can_check_for_function_pointers, move in file.
794 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
795 section_may_have_icf_unsafe_poineters, move in file.
796 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
797 * i386.cc (Target_i386::do_can_check_for_function_pointers):
798 Rename from can_check_for_function_pointers, move in file.
799 (Target_i386::can_icf_inline_merge_sections): Remove.
800 (Target_i386::i386_info): Initialize
801 can_icf_inline_merge_sections.
802 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
803 Initialize can_icf_inline_merge_sections.
804 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
805 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
806 Rename from can_check_for_function_pointers, move in file.
807 (Target_x86_64::can_icf_inline_merge_sections): Remove.
808 (Target_x86_64::x86_64_info): Initialize
809 can_icf_inline_merge_sections.
810 * testsuite/testfile.cc (Target_test::test_target_info):
811 Likewise.
812 * icf.cc (get_section_contents): Correct formatting.
813
814 2011-06-27 Ian Lance Taylor <iant@google.com>
815
816 * symtab.cc (Symbol::versioned_name): New function.
817 (Symbol_table::add_to_final_symtab): Use versioned_name when
818 appropriate.
819 (Symbol_table::sized_write_symbol): Likewise.
820 * symtab.h (class Symbol): Declare versioned_name.
821 * stringpool.h (class Stringpool_template): Add variant of add
822 which takes a std::basic_string.
823 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
824 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
825 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
826 (ver_test_12.o): New target.
827 * testsuite/Makefile.in: Rebuild.
828
829 2011-06-27 Doug Kwan <dougkwan@google.com>
830
831 * arm.cc (Arm_relocate_functions::thm_jump8,
832 Arm_relocate_functions::thm_jump11): Use a wider signed
833 type to compute offset.
834 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
835 arm_thm_jump8.
836 * testsuite/Makefile.in: Regenerate.
837 * testsuite/arm_branch_in_range.sh: Check test results of
838 arm_thm_jump11 and arm_thm_jump8.
839 * testsuite/arm_thm_jump11.s: New test source file.
840 * testsuite/arm_thm_jump11.t: New linker script.
841 * testsuite/arm_thm_jump8.s: New test source file.
842 * testsuite/arm_thm_jump8.t: New linker script.
843
844 2011-06-24 Ian Lance Taylor <iant@google.com>
845
846 * layout.cc: Include "object.h".
847 (ctors_sections_in_init_array): New static variable.
848 (Layout::is_ctors_in_init_array): New function.
849 (Layout::layout): Add entry to ctors_sections_in_init_array if
850 appropriate.
851 * layout.h (class Layout): Declare is_ctors_in_init_array.
852 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
853 is_ctors_reverse_view is set.
854 (Sized_relobj_file::write_sections): Add layout parameter. Change
855 all callers. Set is_ctors_reverse_view field of View_size.
856 (Sized_relobj_file::reverse_words): New function.
857 * object.h (Sized_relobj_file::View_size): Add
858 is_ctors_reverse_view field.
859 (class Sized_relobj_file): Update declarations.
860 * testsuite/initpri3.c: New test.
861 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
862 initpri3b.
863 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
864 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
865 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
866 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
867 * testsuite/Makefile.in: Rebuild.
868
869 2011-06-24 Cary Coutant <ccoutant@google.com>
870
871 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
872 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
873 (debug_msg_cdebug.err): New targets.
874 * testsuite/Makefile.in: Regenerate.
875 * testsuite/debug_msg.sh: Check output of link with compressed debug.
876 Fix checks for link with shared library.
877
878 2011-06-24 Doug Kwan <dougkwan@google.com>
879
880 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
881 skip empty text sections.
882 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
883
884 2011-06-22 Ian Lance Taylor <iant@google.com>
885
886 PR gold/12910
887 * options.h (class General_options): Add --ctors-in-init-array.
888 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
889 friends as SHT_PROGBITS for merging sections.
890 (Layout::layout): Remove special handling of .init_array and
891 friends. Don't sort if doing relocatable link. Sort for .ctors
892 and .dtors if ctors_in_init_array.
893 (Layout::make_output_section): Force correct section types for
894 .init_array and friends. Don't sort if doing relocatable link,
895 Don't sort .ctors and .dtors if ctors_in_init_array.
896 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
897 (Layout::output_section_name): Add relobj parameter. Change all
898 callers. Handle .ctors. and .dtors. in code rather than table.
899 Handle .ctors and .dtors if ctors_in_init_array.
900 (Layout::match_file_name): New function, moved from output.cc.
901 * layout.h (class Layout): Update declarations.
902 * output.cc: Include "layout.h".
903 (Input_section_sort_entry::get_priority): New function.
904 (Input_section_sort_entry::match_file_name): Just call
905 Layout::match_file_name.
906 (Output_section::Input_section_sort_init_fini_compare::operator()):
907 Handle .ctors and .dtors. Sort by explicit priority rather than
908 by name.
909 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
910 * testsuite/initpri2.c: New test.
911 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
912 (check_PROGRAMS): Add initpri2.
913 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
914 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
915 * configure, testsuite/Makefile.in: Rebuild.
916
917 2011-06-19 Ian Lance Taylor <iant@google.com>
918
919 PR gold/12880
920 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
921 .interp section to a PT_INTERP segment even if we have seen a
922 --dynamic-linker option. Don't do it if we have seen a PHDRS
923 clause in a linker script.
924 (Layout::finalize): Don't create a .interp section if we've
925 already create a PT_INTERP segment.
926 (Layout::create_interp): Always call choose_output_section (revert
927 patch of 2011-06-17). Don't create PT_INTERP segment.
928 * script-sections.cc
929 (Script_sections::create_note_and_tls_segments): Add a .interp
930 section to a PT_INTERP segment even if we have seen a
931 --dynamic-linker option.
932
933 2011-06-18 Ian Lance Taylor <iant@google.com>
934
935 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
936 merely because a non-PT_LOAD segment has a dynamic reloc.
937
938 2011-06-18 Ian Lance Taylor <iant@google.com>
939
940 * layout.cc (Layout::finish_dynamic_section): Don't create
941 DT_FLAGS entry if not needed.
942
943 2011-06-18 Ian Lance Taylor <iant@google.com>
944
945 PR gold/12745
946 * layout.cc (Layout::layout_eh_frame): Correct handling of
947 writable .eh_frame section.
948
949 2011-06-17 Ian Lance Taylor <iant@google.com>
950
951 PR gold/12893
952 * resolve.cc (Symbol_table::resolve): Don't give an error if a
953 symbol is redefined with the exact same object and value.
954
955 2011-06-17 Ian Lance Taylor <iant@google.com>
956
957 PR gold/12880
958 * layout.h (class Layout): Add interp_segment_ field.
959 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
960 (Layout::attach_allocated_section_to_segment): If making shared
961 library, put .interp section in PT_INTERP segment.
962 (Layout::finalize): Also call create_interp if -dynamic-linker
963 option was used.
964 (Layout::create_interp): Assert that there is no PT_INTERP
965 segment. If not using a SECTIONS clause, use make_output_section.
966 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
967 * script-sections.cc
968 (Script_sections::create_note_and_tls_segments): If making shared
969 library, put .interp section in PT_INTERP segment.
970
971 2011-06-17 Ian Lance Taylor <iant@google.com>
972
973 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
974 when making a shared library.
975
976 2011-06-17 Ian Lance Taylor <iant@google.com>
977
978 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
979 parameter. Change all callers. Don't issue warning about PC32
980 against locally defined symbol.
981
982 2011-06-16 Ian Lance Taylor <iant@google.com>
983
984 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
985 occurs in same object.
986
987 2011-06-14 Alan Modra <amodra@gmail.com>
988
989 * po/POTFILES.in: Regenerate.
990
991 2011-06-09 Ian Lance Taylor <iant@google.com>
992
993 * script-sections.cc
994 (Orphan_output_section::set_section_addresses): For a relocatable
995 link set address to 0.
996
997 2011-06-09 Cary Coutant <ccoutant@google.com>
998
999 PR gold/12804
1000 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1001 used with --compress-debug-sections.
1002 * gold/object.cc (Sized_relobj_file::do_layout): Report
1003 uncompressed size of compressed input sections.
1004
1005 2011-06-08 Cary Coutant <ccoutant@google.com>
1006
1007 PR gold/12804
1008 * testsuite/two_file_test_2_v1.cc: Change initialization of
1009 v2 to keep it in .data.
1010
1011 2011-06-07 Cary Coutant <ccoutant@google.com>
1012
1013 * common.cc (Symbol_table::do_allocate_commons_list): Call
1014 gold_fallback.
1015 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1016 (Errors::fallback): New function.
1017 (gold_fallback): New function.
1018 * errors.h (Errors::fallback): New function.
1019 * gold.cc (gold_exit): Change status parameter to enum; adjust
1020 all callers.
1021 (queue_initial_tasks): Call gold_fallback.
1022 * gold.h: Include cstdlib.
1023 (Exit_status): New enum type.
1024 (gold_exit): Change status parameter to enum.
1025 (gold_fallback): New function.
1026 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1027 (Layout::create_symtab_sections): Likewise.
1028 (Layout::create_shdrs): Likewise.
1029 * main.cc (main): Adjust call to gold_exit.
1030 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1031 (Output_data_got::add_got_entry_pair): Likewise.
1032 (Output_section::add_input_section): Likewise.
1033 (Output_section::add_output_section_data): Likewise.
1034 (Output_segment::set_section_list_addresses): Likewise.
1035 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1036
1037 2011-06-07 Cary Coutant <ccoutant@google.com>
1038
1039 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1040 for incremental links.
1041 * output.cc (Output_segment::set_section_list_addresses): Remove
1042 FIXME and test for TLS or BSS.
1043
1044 2011-06-07 Cary Coutant <ccoutant@google.com>
1045
1046 * testsuite/Makefile.am: Add incremental_copy_test,
1047 incremental_common_test_1.
1048 * testsuite/Makefile.in: Regenerate.
1049 * testsuite/common_test_1_v1.c: New source file.
1050 * testsuite/common_test_1_v2.c: New source file.
1051 * testsuite/copy_test_v1.cc: New source file.
1052
1053 2011-06-07 Cary Coutant <ccoutant@google.com>
1054
1055 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1056 update, allocate common from bss section's free list.
1057 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1058 linker-defined symbols.
1059 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1060 Skip GOT and PLT entries that are no longer referenced.
1061 (Output_section_incremental_inputs::write_info_blocks): Mark
1062 linker-defined symbols.
1063 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1064 * output.cc (Output_section::allocate): New function.
1065 * output.h (Output_section::allocate): New function.
1066 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1067 linker-defined symbols.
1068 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1069 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1070 (Symbol::init_base_output_data): Likewise.
1071 (Symbol::init_base_output_segment): Likewise.
1072 (Symbol::init_base_constant): Likewise.
1073 (Sized_symbol::init_output_data): Likewise.
1074 (Sized_symbol::init_output_segment): Likewise.
1075 (Sized_symbol::init_constant): Likewise.
1076 (Symbol_table::do_define_in_output_data): Likewise.
1077 (Symbol_table::do_define_in_output_segment): Likewise.
1078 (Symbol_table::do_define_as_constant): Likewise.
1079 * symtab.h (Symbol::is_predefined): New function.
1080 (Symbol::init_base_output_data): Add is_predefined parameter.
1081 (Symbol::init_base_output_segment): Likewise.
1082 (Symbol::init_base_constant): Likewise.
1083 (Symbol::is_predefined_): New data member.
1084 (Sized_symbol::init_output_data): Add is_predefined parameter.
1085 (Sized_symbol::init_output_segment): Likewise.
1086 (Sized_symbol::init_constant): Likewise.
1087 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1088
1089 2011-06-07 Cary Coutant <ccoutant@google.com>
1090
1091 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1092 instead of emit_copy_reloc.
1093 (Copy_relocs::emit_copy_reloc): Refactor.
1094 (Copy_relocs::make_copy_reloc): New function.
1095 (Copy_relocs::add_copy_reloc): Remove.
1096 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1097 section.
1098 (Copy_relocs::make_copy_reloc): New function.
1099 (Copy_relocs::add_copy_reloc): Remove.
1100 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1101 unchanged input files.
1102 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1103 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1104 Reserve BSS space for COPY relocations.
1105 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1106 (Output_section_incremental_inputs::write_info_blocks): Record
1107 whether a symbol is copied from a shared object.
1108 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1109 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1110 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1111 (Incremental_input_entry_reader::get_output_symbol_index): Add
1112 is_copy parameter.
1113 (Incremental_binary::emit_copy_relocs): New function.
1114 (Incremental_binary::do_emit_copy_relocs): New function.
1115 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1116 new data member.
1117 (Sized_incremental_binary::add_copy_reloc): New function.
1118 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1119 (Sized_incremental_binary::Copy_reloc): New struct.
1120 (Sized_incremental_binary::Copy_relocs): New typedef.
1121 (Sized_incremental_binary::copy_relocs_): New data member.
1122 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1123 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1124 * target.h (Sized_target::emit_copy_reloc): New function.
1125 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1126
1127 2011-06-02 Cary Coutant <ccoutant@google.com>
1128
1129 PR gold/12163
1130 * gold/archive.cc (Archive::Archive): Initialize new data member.
1131 (Archive::include_all_members): Return if archive has already been
1132 included.
1133 * gold/archive.h (Archive::include_all_members_): New data member.
1134
1135 2011-06-02 Nick Clifton <nickc@redhat.com>
1136
1137 * dynobj.h: Fix spelling mistake in comment.
1138 * output.cc: Likewise.
1139
1140 2011-05-31 Doug Kwan <dougkwan@google.com>
1141 Asier Llano
1142
1143 PR gold/12826
1144 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
1145 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1146 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1147 redundant arm_exidx_test.so.
1148 * testsuite/Makefile.in: Regenerate.
1149 (check_SCRIPTS): Add pr12826.sh
1150 (check_DATA): Add pr12826.stdout
1151 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1152 * testsuite/pr12826.sh: New file.
1153 * testsuite/pr12826_1.s: Ditto.
1154 * testsuite/pr12826_1.s: Ditto.
1155
1156 2011-05-30 Ian Lance Taylor <iant@google.com>
1157
1158 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1159 sections.
1160
1161 2011-05-29 Ian Lance Taylor <iant@google.com>
1162
1163 PR gold/12804
1164 * testsuite/Makefile.am: Use different file name for two_file_test
1165 temporary file for each incremental test.
1166 * testsuite/Makefile.in: Rebuild.
1167
1168 2011-05-29 Ian Lance Taylor <iant@google.com>
1169
1170 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1171 binary input file is empty.
1172
1173 2011-05-27 Ian Lance Taylor <iant@google.com>
1174
1175 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1176 (ver_test_9.so): Likewise.
1177 * testsuite/Makefile.in: Rebuild.
1178
1179 2011-05-26 Cary Coutant <ccoutant@google.com>
1180
1181 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1182 * incremental.cc (Incremental_inputs::report_input_section): Fix
1183 comment, indentation.
1184 (Incremental_inputs::report_comdat_group): New function.
1185 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1186 of data for incremental input file entry.
1187 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1188 group count, COMDAT group signatures.
1189 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1190 an unchanged input file.
1191 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1192 Initialize new data member.
1193 (Incremental_object_entry::add_comdat_group): New function.
1194 (Incremental_object_entry::get_comdat_group_count): New function.
1195 (Incremental_object_entry::get_comdat_signature_key): New function.
1196 (Incremental_object_entry::groups_): New data member.
1197 (Incremental_inputs::report_comdat_group): New function.
1198 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1199 data for incremental input file entry.
1200 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1201 (Incremental_input_entry_reader::get_input_section): Adjust size of
1202 data for incremental input file entry.
1203 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1204 (Incremental_input_entry_reader::get_comdat_group_signature): New
1205 function.
1206 * object.cc (Sized_relobj::include_section_group): Report kept
1207 COMDAT groups for incremental links.
1208
1209 2011-05-24 David Meyer <pdox@google.com>
1210
1211 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1212 with name parameter. Add found_name parameter.
1213 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1214 * dirsearch.h (class Dirsearch): Update declaration.
1215
1216 2011-05-24 Ian Lance Taylor <iant@google.com>
1217
1218 * archive.cc (Library_base::should_include_member): Pull in object
1219 from archive if it defines the entry symbol.
1220 * parameters.cc (Parameters::entry): New function.
1221 * parameters.h (class Parameters): Declare entry.
1222 * output.h (class Output_file_header): Remove entry_ field.
1223 * output.cc (Output_file_header::Output_file_header): Remove entry
1224 parameter. Change all callers.
1225 (Output_file_header::entry): Use parameters->entry.
1226 * gold.cc (queue_middle_tasks): Likewise.
1227 * plugin.cc (Plugin_hook::run): Likewise.
1228
1229 2011-05-24 Cary Coutant <ccoutant@google.com>
1230
1231 * gold.cc (queue_initial_tasks): Pass incremental base filename
1232 to Output_file::open_base_file; don't print error message.
1233 * incremental-dump.cc (main): Adjust call to
1234 Output_file::open_for_modification.
1235 * incremental-dump.cc (main): Likewise.
1236 * incremental.cc (Incremental_inputs::report_command_line):
1237 Ignore --incremental-base option when comparing command lines.
1238 Ignore parameter when given as separate argument.
1239 * options.h (class General_options): Add --incremental-base.
1240 * output.cc (Output_file::Output_file):
1241 (Output_file::open_base_file): Add base_name and writable parameters;
1242 read base file into new file; print error message here.
1243 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1244 callers.
1245 * output.h (Output_file::open_for_modification): Rename to...
1246 (Output_file::open_base_file): ...this; add base_name and
1247 writable parameters; adjust all callers.
1248 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1249 callers.
1250 * testsuite/Makefile.am (incremental_test_4): Test
1251 --incremental-base.
1252 * testsuite/Makefile.in: Regenerate.
1253
1254 2011-05-24 Cary Coutant <ccoutant@google.com>
1255
1256 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1257 incremental_test_4.
1258 * testsuite/Makefile.in: Regenerate.
1259 * testsuite/two_file_test_1_v1.cc: New test source file.
1260 * testsuite/two_file_test_1b_v1.cc: New test source file.
1261 * testsuite/two_file_test_2_v1.cc: New test source file.
1262
1263 2011-05-24 Cary Coutant <ccoutant@google.com>
1264
1265 * dynobj.h (Dynobj::do_dynobj): New function.
1266 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1267 flag and soname for shared objects.
1268 * incremental.cc (Incremental_inputs::report_object): Make
1269 either Incremental_object_entry or Incremental_dynobj_entry; add
1270 soname to string table.
1271 (Incremental_inputs::report_input_section): Add assertion.
1272 (Output_section_incremental_inputs::set_final_data_size): Adjust
1273 type of input file entry for shared libraries; adjust size of
1274 shared library info entry.
1275 (Output_section_incremental_inputs::write_input_files): Write
1276 as_needed flag for shared libraries.
1277 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1278 of input file entry for shared libraries; write soname.
1279 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1280 soname from incremental info.
1281 * incremental.h (enum Incremental_input_flags): Add
1282 INCREMENTAL_INPUT_AS_NEEDED.
1283 (Incremental_input_entry::Incremental_input_entry): Initialize new
1284 data member.
1285 (Incremental_input_entry::set_as_needed): New function.
1286 (Incremental_input_entry::as_needed): New function.
1287 (Incremental_input_entry::do_dynobj_entry): New function.
1288 (Incremental_input_entry::as_needed_): New data member.
1289 (Incremental_object_entry::Incremental_object_entry): Don't check
1290 for shared library.
1291 (Incremental_object_entry::do_type): Likewise.
1292 (class Incremental_dynobj_entry): New class.
1293 (Incremental_input_entry_reader::as_needed): New function.
1294 (Incremental_input_entry_reader::get_soname): New function.
1295 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1296 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1297 size of shared library info entry.
1298 * layout.cc (Layout::finish_dynamic_section): Don't test for
1299 incremental link when adding DT_NEEDED entries.
1300 * object.h (Object::Object): Initialize new data member.
1301 (Object::dynobj): New function.
1302 (Object::set_as_needed): New function.
1303 (Object::as_needed): New function.
1304 (Object::do_dynobj): New function.
1305 (Object::as_needed_): New data member.
1306
1307 2011-05-24 Cary Coutant <ccoutant@google.com>
1308
1309 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1310 info; adjust display of GOT entries.
1311 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1312 vector of input objects; remove file_status_.
1313 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1314 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1315 got_plt reader; call target hooks to reserve GOT entries.
1316 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1317 of input file info header and GOT info entry.
1318 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1319 relocation info.
1320 (Got_plt_view_info::got_descriptor): Remove.
1321 (Got_plt_view_info::sym_index): New data member.
1322 (Got_plt_view_info::input_index): New data member.
1323 (Local_got_offset_visitor::visit): Write input file index.
1324 (Global_got_offset_visitor::visit): Write 0 for input file index.
1325 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1326 with sym_index and input_index.
1327 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1328 incremental info GOT entry; replace got_descriptor with input_index.
1329 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1330 map from input file index to object.
1331 (Sized_relobj_incr::do_layout): Replace direct data member reference
1332 with accessor function.
1333 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1334 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1335 Adjust size of input file info header.
1336 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1337 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1338 (Incremental_input_entry_reader::get_input_section): Adjust size of
1339 input file info header.
1340 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1341 of incremental info GOT entry.
1342 (Incremental_got_plt_reader::get_got_desc): Remove.
1343 (Incremental_got_plt_reader::get_got_symndx): New function.
1344 (Incremental_got_plt_reader::get_got_input_index): New function.
1345 (Sized_incremental_binary::Sized_incremental_binary): Remove
1346 file_status_; add input_objects_.
1347 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1348 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1349 (Sized_incremental_binary::file_is_unchanged): Remove.
1350 (Sized_incremental_binary::set_input_object): New function.
1351 (Sized_incremental_binary::input_object): New function.
1352 (Sized_incremental_binary::file_status_): Remove.
1353 (Sized_incremental_binary::input_objects_): New data member.
1354 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1355 references.
1356 (Sized_relobj_incr::invalid_address): Move to base class.
1357 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1358 class.
1359 (Sized_relobj_incr::do_output_section_offset): Likewise.
1360 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1361 (Sized_relobj_incr::section_offsets_): Likewise.
1362 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1363 function.
1364 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1365 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1366 with accessor function.
1367 (Sized_relobj_file::do_layout): Likewise.
1368 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1369 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1370 (Sized_relobj_file::compute_final_local_value): Replace refs to
1371 section_offsets_ with accessor function.
1372 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1373 * object.h (Relobj::Relobj): Initialize new data members.
1374 (Relobj::add_dyn_reloc): New function.
1375 (Relobj::first_dyn_reloc): New function.
1376 (Relobj::dyn_reloc_count): New function.
1377 (Relobj::first_dyn_reloc_): New data member.
1378 (Relobj::dyn_reloc_count_): New data member.
1379 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1380 references.
1381 (Sized_relobj::Address): New typedef.
1382 (Sized_relobj::invalid_address): Move here from child class.
1383 (Sized_relobj::Sized_relobj): Initialize new data members.
1384 (Sized_relobj::sized_relobj): New function.
1385 (Sized_relobj::is_output_section_offset_invalid): Move here from
1386 child class.
1387 (Sized_relobj::get_output_section_offset): Likewise.
1388 (Sized_relobj::local_has_got_offset): Likewise.
1389 (Sized_relobj::local_got_offset): Likewise.
1390 (Sized_relobj::set_local_got_offset): Likewise.
1391 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1392 (Sized_relobj::clear_got_offsets): New function.
1393 (Sized_relobj::section_offsets): Move here from child class.
1394 (Sized_relobj::do_output_section_offset): Likewise.
1395 (Sized_relobj::do_set_section_offset): Likewise.
1396 (Sized_relobj::Local_got_offsets): Likewise.
1397 (Sized_relobj::local_got_offsets_): Likewise.
1398 (Sized_relobj::section_offsets_): Likewise.
1399 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1400 references.
1401 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1402 class.
1403 (Sized_relobj_file::sized_relobj): New function
1404 (Sized_relobj_file::local_has_got_offset): Move to base class.
1405 (Sized_relobj_file::local_got_offset): Likewise.
1406 (Sized_relobj_file::set_local_got_offset): Likewise.
1407 (Sized_relobj_file::get_output_section_offset): Likewise.
1408 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1409 (Sized_relobj_file::do_output_section_offset): Likewise.
1410 (Sized_relobj_file::do_set_section_offset): Likewise.
1411 (Sized_relobj_file::Local_got_offsets): Likewise.
1412 (Sized_relobj_file::local_got_offsets_): Likewise.
1413 (Sized_relobj_file::section_offsets_): Likewise.
1414 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1415 (all constructors).
1416 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1417 (Output_reloc::get_symbol_index): Likewise.
1418 (Output_reloc::local_section_offset): Likewise.
1419 (Output_reloc::get_address): Likewise.
1420 (Output_reloc::symbol_value): Likewise.
1421 (Output_data_got::reserve_slot): Move to class definition.
1422 (Output_data_got::reserve_local): New function.
1423 (Output_data_got::reserve_slot_for_global): Remove.
1424 (Output_data_got::reserve_global): New function.
1425 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1426 (all constructors, two instantiations).
1427 (Output_reloc::get_relobj): New function (two instantiations).
1428 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1429 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1430 (Output_data_reloc::add_global): Adjust type of relobj.
1431 (Output_data_reloc::add_global_relative): Likewise.
1432 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1433 (Output_data_reloc::add_local): Likewise.
1434 (Output_data_reloc::add_local_relative): Likewise.
1435 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1436 (Output_data_reloc::add_local_section): Likewise.
1437 (Output_data_reloc::add_output_section): Likewise.
1438 (Output_data_reloc::add_absolute): Likewise.
1439 (Output_data_reloc::add_target_specific): Likewise.
1440 (Output_data_got::reserve_slot): Move definition here.
1441 (Output_data_got::reserve_local): New function.
1442 (Output_data_got::reserve_global): New function.
1443 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1444 section_offsets_ with accessor function.
1445 (Sized_relobj_file::write_sections): Likewise.
1446 (Sized_relobj_file::do_relocate_sections): Likewise.
1447 * target.h (Sized_target::reserve_local_got_entry): New function.
1448 (Sized_target::reserve_global_got_entry): New function.
1449 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1450 (Target_x86_64::reserve_global_got_entry): New function.
1451 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1452
1453 2011-05-23 Cary Coutant <ccoutant@google.com>
1454
1455 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1456 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1457 bit when checking got_type.
1458 * incremental.cc (Sized_incremental_binary::setup_readers):
1459 Store symbol table and string table locations; initialize bit vector
1460 of file status flags.
1461 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1462 unchanged files.
1463 (Sized_incremental_binary::do_process_got_plt): New function.
1464 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1465 (Output_section_incremental_inputs::set_final_data_size): Record
1466 file index for each input file.
1467 (Output_section_incremental_inputs::write_got_plt): Store file index
1468 instead of input entry offset for each GOT entry.
1469 * incremental.h
1470 (Incremental_input_entry::Incremental_input_entry): Initialize new
1471 data member.
1472 (Incremental_input_entry::set_offset): Store file index.
1473 (Incremental_input_entry::get_file_index): New function.
1474 (Incremental_input_entry::file_index_): New data member.
1475 (Incremental_binary::process_got_plt): New function.
1476 (Incremental_binary::do_process_got_plt): New function.
1477 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1478 data members.
1479 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1480 (Sized_incremental_binary::set_file_is_unchanged): New function.
1481 (Sized_incremental_binary::file_is_unchanged): New function.
1482 (Sized_incremental_binary::do_process_got_plt): New function.
1483 (Sized_incremental_binary::file_status_): New data member.
1484 (Sized_incremental_binary::main_symtab_loc_): New data member.
1485 (Sized_incremental_binary::main_strtab_loc_): New data member.
1486 * output.cc (Output_data_got::Got_entry::write): Add case
1487 RESERVED_CODE.
1488 (Output_data_got::add_global): Call add_got_entry.
1489 (Output_data_got::add_global_plt): Likewise.
1490 (Output_data_got::add_global_with_rel): Likewise.
1491 (Output_data_got::add_global_with_rela): Likewise.
1492 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1493 (Output_data_got::add_global_pair_with_rela): Likewise.
1494 (Output_data_got::add_local): Call add_got_entry.
1495 (Output_data_got::add_local_plt): Likewise.
1496 (Output_data_got::add_local_with_rel): Likewise.
1497 (Output_data_got::add_local_with_rela): Likewise.
1498 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1499 (Output_data_got::add_local_pair_with_rela): Likewise.
1500 (Output_data_got::reserve_slot): New function.
1501 (Output_data_got::reserve_slot_for_global): New function.
1502 (Output_data_got::add_got_entry): New function.
1503 (Output_data_got::add_got_entry_pair): New function.
1504 (Output_section::add_output_section_data): Edit FIXME.
1505 * output.h
1506 (Output_section_data_build::Output_section_data_build): New
1507 constructor with size parameter.
1508 (Output_data_space::Output_data_space): Likewise.
1509 (Output_data_got::Output_data_got): Initialize new data member; new
1510 constructor with size parameter.
1511 (Output_data_got::add_constant): Call add_got_entry.
1512 (Output_data_got::reserve_slot): New function.
1513 (Output_data_got::reserve_slot_for_global): New function.
1514 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1515 (Output_data_got::add_got_entry): New function.
1516 (Output_data_got::add_got_entry_pair): New function.
1517 (Output_data_got::free_list_): New data member.
1518 * target.h (Sized_target::init_got_plt_for_update): New function.
1519 (Sized_target::register_global_plt_entry): New function.
1520 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1521 Initialize new data member; call init; add constructor with PLT count.
1522 (Output_data_plt_x86_64::init): New function.
1523 (Output_data_plt_x86_64::add_relocation): New function.
1524 (Output_data_plt_x86_64::reserve_slot): New function.
1525 (Output_data_plt_x86_64::free_list_): New data member.
1526 (Target_x86_64::init_got_plt_for_update): New function.
1527 (Target_x86_64::register_global_plt_entry): New function.
1528 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1529 incremental updates.
1530 (Output_data_plt_x86_64::add_relocation): New function.
1531 * testsuite/object_unittest.cc (Object_test): Set default options.
1532
1533 2011-05-16 Ian Lance Taylor <iant@google.com>
1534
1535 * options.h (class General_options): Make -i a synonym for -r.
1536
1537 2011-05-16 Ian Lance Taylor <iant@google.com>
1538
1539 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1540
1541 2011-05-10 Cary Coutant <ccoutant@google.com>
1542
1543 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1544 strip_all (-s).
1545
1546 2011-05-06 Ian Lance Taylor <iant@google.com>
1547
1548 * layout.cc (Layout::layout): If the output section flags change,
1549 update the ordering.
1550
1551 2011-04-25 Cary Coutant <ccoutant@google.com>
1552
1553 * incremental-dump.cc (dump_incremental_inputs): Print local
1554 symbol info for each input file.
1555 * incremental.cc
1556 (Output_section_incremental_inputs::set_final_data_size): Add local
1557 symbol info to input file entries in incremental info.
1558 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1559 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1560 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1561 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1562 implementation.
1563 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1564 (Sized_incr_relobj::do_relocate): Write the local symbols.
1565 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1566 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1567 Adjust size of input file header.
1568 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1569 (Incremental_inputs_reader::get_local_symbol_count): New function.
1570 (Incremental_inputs_reader::get_input_section): Adjust size of input
1571 file header.
1572 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1573 (Sized_incr_relobj::This): New typedef.
1574 (Sized_incr_relobj::sym_size): New const data member.
1575 (Sized_incr_relobj::Local_symbol): New struct.
1576 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1577 (Sized_incr_relobj::do_local_symbol_offset): New function.
1578 (Sized_incr_relobj::local_symbol_count_): New data member.
1579 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1580 (Sized_incr_relobj::local_symbol_index_): New data member.
1581 (Sized_incr_relobj::local_symbol_offset_): New data member.
1582 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1583 (Sized_incr_relobj::local_symbols_): New data member.
1584 * object.h (Relobj::output_local_symbol_count): New function.
1585 (Relobj::local_symbol_offset): New function.
1586 (Relobj::do_output_local_symbol_count): New function.
1587 (Relobj::do_local_symbol_offset): New function.
1588 (Sized_relobj::do_output_local_symbol_count): New function.
1589 (Sized_relobj::do_local_symbol_offset): New function.
1590
1591 2011-04-22 Vladimir Simonov <sv@sw.ru>
1592
1593 * descriptors.cc (set_close_on_exec): New function.
1594 (Descriptors::open): Use set_close_on_exec.
1595 * output.cc (S_ISLNK): Define if not defined.
1596
1597 2011-04-22 Cary Coutant <ccoutant@google.com>
1598
1599 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1600 global symbol map.
1601 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1602 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1603 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1604 relocations.
1605 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1606 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1607 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1608 * incremental.h
1609 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1610 function.
1611 (Incremental_binary::apply_incremental_relocs): New function.
1612 (Incremental_binary::do_apply_incremental_relocs): New function.
1613 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1614 data member.
1615 (Sized_incremental_binary::add_global_symbol): New function.
1616 (Sized_incremental_binary::global_symbol): New function.
1617 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1618 (Sized_incremental_binary::symbol_map_): New data member.
1619 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1620 * target.h (Sized_target::apply_relocation): New function.
1621 * target-reloc.h (apply_relocation): New function.
1622 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1623
1624 2011-04-22 Doug Kwan <dougkwan@google.com>
1625
1626 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1627 flag of a SHT_ARM_EXIDX section.
1628 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1629 * testsuite/Makefile.in: Regenerate.
1630 * testsuite/arm_exidx_test.s: New file.
1631 * testsuite/arm_exidx_test.sh: Same.
1632
1633 2011-04-20 Cary Coutant <ccoutant@google.com>
1634
1635 PR gold/12689
1636 * archive.h (Incremental_archive_entry::Archive_member):
1637 Initialize arg_serial_ (second constructor).
1638
1639 2011-04-17 Ian Lance Taylor <iant@google.com>
1640
1641 * object.cc (Relocate_info::location): Simplify location string.
1642 * errors.cc (Errors::error_at_location): Don't print program
1643 name.
1644 (Errors::warning_at_location): Likewise.
1645 (Errors::undefined_symbol): Likewise.
1646 * testsuite/debug_msg.sh: Update accordingly.
1647
1648 2011-04-14 Cary Coutant <ccoutant@google.com>
1649
1650 * gold/layout.cc (Layout::symtab_section_offset): New function.
1651 * gold/layout.h (Layout::symtab_section_offset): New function.
1652 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1653
1654 2011-04-12 Ian Lance Taylor <iant@google.com>
1655
1656 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1657 with MREMAP_MAYMOVE.
1658 * output.h (class Output_file): Add map_is_allocated_ field.
1659 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1660 not available, provide stubs. If mremap is not available, #define
1661 it to gold_mremap.
1662 (MREMAP_MAYMOVE): Define if not defined.
1663 (Output_file::Output_file): Initialize map_is_allocated_.
1664 (Output_file::resize): Check map_is_allocated_.
1665 (Output_file::map_anonymous): If mmap fails, use malloc.
1666 (Output_file::unmap): Don't do anything for an anonymous map.
1667 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1668 is not available, provide stubs.
1669 (File_read::View::~View): Use free rather than delete[].
1670 (File_read::make_view): Use malloc rather than new[]. If mmap
1671 fails, use malloc.
1672 (File_read::find_or_make_view): Use malloc rather than new[].
1673 * gold.h: Remove HAVE_REMAP code.
1674 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1675 exists. Rename mremap to gold_mremap. If mmap is not available
1676 don't do anything.
1677 * configure, config.in: Rebuild.
1678
1679 2011-04-11 Ian Lance Taylor <iant@google.com>
1680
1681 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1682 initialize local variable v.
1683
1684 2011-04-11 Cary Coutant <ccoutant@google.com>
1685
1686 * archive.cc (Archive::include_member): Adjust call to
1687 report_object.
1688 (Add_archive_symbols::run): Track argument serial numbers.
1689 (Lib_group::include_member): Likewise.
1690 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1691 * archive.h (Incremental_archive_entry::Archive_member):
1692 Initialize arg_serial_.
1693 (Archive_member::arg_serial_): New data member.
1694 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1695 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1696 incremental link.
1697 (Sized_dynobj::do_for_all_local_got_entries): New function.
1698 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1699 function.
1700 * fileread.cc (get_mtime): New function.
1701 * fileread.h (get_mtime): New function.
1702 * gold.cc (queue_initial_tasks): Check for incremental update.
1703 (process_incremental_input): New function.
1704 (queue_middle_tasks): Don't force valid target for incremental
1705 update.
1706 * incremental-dump.cc (find_input_containing_global): Adjust
1707 size of symbol info entry.
1708 (dump_incremental_inputs): Dump argument serial number and
1709 in_system_directory flag; bias shndx by 1; print symbol names
1710 when dumping per-file symbol lists; use new symbol info readers.
1711 * incremental.cc
1712 (Output_section_incremental_inputs:update_data_size): New function.
1713 (Sized_incremental_binary::setup_readers): Setup input readers
1714 for each input file; build maps for files added from libraries
1715 and scripts.
1716 (Sized_incremental_binary::check_input_args): New function.
1717 (Sized_incremental_binary::do_check_inputs): Build map of argument
1718 serial numbers to input arguments.
1719 (Sized_incremental_binary::do_file_has_changed): Rename
1720 do_file_is_unchanged to this; compare file modification times.
1721 (Sized_incremental_binary::do_init_layout): New function.
1722 (Sized_incremental_binary::do_reserve_layout): New function.
1723 (Sized_incremental_binary::do_get_input_reader): Remove.
1724 (Sized_incremental_binary::get_symtab_view): New function.
1725 (Incremental_checker::can_incrementally_link_output_file): Remove.
1726 (Incremental_inputs::report_command_line): Exclude --debug options.
1727 (Incremental_inputs::report_archive_begin): Add parameter; track
1728 argument serial numbers; don't put input file entry for archive
1729 before archive members.
1730 (Incremental_inputs::report_archive_end): Put input file entry
1731 for archive after archive members.
1732 (Incremental_inputs::report_object): Add parameter; track argument
1733 serial numbers and in_system_directory flag.
1734 (Incremental_inputs::report_script): Add parameter; track argument
1735 serial numbers.
1736 (Output_section_incremental_inputs::set_final_data_size): Adjust
1737 size of symbol info entry; check for forwarding symbols.
1738 (Output_section_incremental_inputs::write_input_files): Write
1739 in_system_directory flag and argument serial number.
1740 (Output_section_incremental_inputs::write_info_blocks): Map section
1741 indices between incremental info and original input file; store
1742 input section index for each symbol.
1743 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1744 change operator() to visit().
1745 (class Global_got_offset_visitor): Likewise.
1746 (class Global_symbol_visitor_got_plt):
1747 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1748 classes.
1749 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1750 (Sized_incr_relobj::do_read_symbols): New function.
1751 (Sized_incr_relobj::do_layout): New function.
1752 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1753 (Sized_incr_relobj::do_add_symbols): New function.
1754 (Sized_incr_relobj::do_should_include_member): New function.
1755 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1756 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1757 (Sized_incr_relobj::do_section_size): New function.
1758 (Sized_incr_relobj::do_section_name): New function.
1759 (Sized_incr_relobj::do_section_contents): New function.
1760 (Sized_incr_relobj::do_section_flags): New function.
1761 (Sized_incr_relobj::do_section_entsize): New function.
1762 (Sized_incr_relobj::do_section_address): New function.
1763 (Sized_incr_relobj::do_section_type): New function.
1764 (Sized_incr_relobj::do_section_link): New function.
1765 (Sized_incr_relobj::do_section_info): New function.
1766 (Sized_incr_relobj::do_section_addralign): New function.
1767 (Sized_incr_relobj::do_initialize_xindex): New function.
1768 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1769 (Sized_incr_relobj::do_read_relocs): New function.
1770 (Sized_incr_relobj::do_gc_process_relocs): New function.
1771 (Sized_incr_relobj::do_scan_relocs): New function.
1772 (Sized_incr_relobj::do_count_local_symbols): New function.
1773 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1774 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1775 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1776 (Sized_incr_relobj::do_relocate): New function.
1777 (Sized_incr_relobj::do_set_section_offset): New function.
1778 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1779 (Sized_incr_dynobj::do_read_symbols): New function.
1780 (Sized_incr_dynobj::do_layout): New function.
1781 (Sized_incr_dynobj::do_add_symbols): New function.
1782 (Sized_incr_dynobj::do_should_include_member): New function.
1783 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1784 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1785 (Sized_incr_dynobj::do_section_size): New function.
1786 (Sized_incr_dynobj::do_section_name): New function.
1787 (Sized_incr_dynobj::do_section_contents): New function.
1788 (Sized_incr_dynobj::do_section_flags): New function.
1789 (Sized_incr_dynobj::do_section_entsize): New function.
1790 (Sized_incr_dynobj::do_section_address): New function.
1791 (Sized_incr_dynobj::do_section_type): New function.
1792 (Sized_incr_dynobj::do_section_link): New function.
1793 (Sized_incr_dynobj::do_section_info): New function.
1794 (Sized_incr_dynobj::do_section_addralign): New function.
1795 (Sized_incr_dynobj::do_initialize_xindex): New function.
1796 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1797 (make_sized_incremental_object): New function.
1798 (Incremental_library::copy_unused_symbols): New function.
1799 (Incremental_library::do_for_all_unused_symbols): New function.
1800 * incremental.h (enum Incremental_input_flags): New type.
1801 (class Incremental_checker): Remove.
1802 (Incremental_input_entry::Incremental_input_entry): Add argument
1803 serial number.
1804 (Incremental_input_entry::arg_serial): New function.
1805 (Incremental_input_entry::set_is_in_system_directory): New function.
1806 (Incremental_input_entry::is_in_system_directory): New function.
1807 (Incremental_input_entry::arg_serial_): New data member.
1808 (Incremental_input_entry::is_in_system_directory_): New data member.
1809 (class Script_info): Move here from script.h.
1810 (Script_info::Script_info): Add filename parameter.
1811 (Script_info::filename): New function.
1812 (Script_info::filename_): New data member.
1813 (Incremental_script_entry::Incremental_script_entry): Add argument
1814 serial number.
1815 (Incremental_object_entry::Incremental_object_entry): Likewise.
1816 (Incremental_object_entry::add_input_section): Build list of input
1817 sections with map to original shndx.
1818 (Incremental_object_entry::get_input_section_index): New function.
1819 (Incremental_object_entry::shndx_): New data member.
1820 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1821 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1822 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1823 serial number.
1824 (Incremental_inputs::report_archive_begin): Likewise.
1825 (Incremental_inputs::report_object): Likewise.
1826 (Incremental_inputs::report_script): Likewise.
1827 (class Incremental_global_symbol_reader): New class.
1828 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1829 and store flags and input file type.
1830 (Incremental_input_entry_reader::arg_serial): New function.
1831 (Incremental_input_entry_reader::type): Extract type from flags.
1832 (Incremental_input_entry_reader::is_in_system_directory): New function.
1833 (Incremental_input_entry_reader::get_input_section_count): Call
1834 accessor function for type.
1835 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1836 function for type; adjust size of global symbol entry.
1837 (Incremental_input_entry_reader::get_global_symbol_count): Call
1838 accessor function for type.
1839 (Incremental_input_entry_reader::get_object_count): Likewise.
1840 (Incremental_input_entry_reader::get_object_offset): Likewise.
1841 (Incremental_input_entry_reader::get_member_count): Likewise.
1842 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1843 (Incremental_input_entry_reader::get_member_offset): Likewise.
1844 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1845 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1846 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1847 (Incremental_input_entry_reader::get_global_symbol_reader): New
1848 function.
1849 (Incremental_input_entry_reader::get_output_symbol_index): New
1850 function.
1851 (Incremental_input_entry_reader::type_): Remove.
1852 (Incremental_input_entry_reader::flags_): New data member.
1853 (Incremental_inputs_reader::input_file_offset): New function.
1854 (Incremental_inputs_reader::input_file_index): New function.
1855 (Incremental_inputs_reader::input_file): Call input_file_offset.
1856 (Incremental_inputs_reader::input_file_at_offset): New function.
1857 (Incremental_relocs_reader::get_r_type): Reformat.
1858 (Incremental_relocs_reader::get_r_shndx): Reformat.
1859 (Incremental_relocs_reader::get_r_offset): Reformat.
1860 (Incremental_relocs_reader::data): New function.
1861 (Incremental_binary::Incremental_binary): Initialize new data members.
1862 (Incremental_binary::check_inputs): Add cmdline parameter.
1863 (Incremental_binary::file_is_unchanged): Remove.
1864 (Input_reader::arg_serial): New function.
1865 (Input_reader::get_unused_symbol_count): New function.
1866 (Input_reader::get_unused_symbol): New function.
1867 (Input_reader::do_arg_serial): New function.
1868 (Input_reader::do_get_unused_symbol_count): New function.
1869 (Input_reader::do_get_unused_symbol): New function.
1870 (Incremental_binary::input_file_count): New function.
1871 (Incremental_binary::get_input_reader): Change signature to use
1872 index instead of filename.
1873 (Incremental_binary::file_has_changed): New function.
1874 (Incremental_binary::get_input_argument): New function.
1875 (Incremental_binary::get_library): New function.
1876 (Incremental_binary::get_script_info): New function.
1877 (Incremental_binary::init_layout): New function.
1878 (Incremental_binary::reserve_layout): New function.
1879 (Incremental_binary::output_file): New function.
1880 (Incremental_binary::do_check_inputs): New function.
1881 (Incremental_binary::do_file_is_unchanged): Remove.
1882 (Incremental_binary::do_file_has_changed): New function.
1883 (Incremental_binary::do_init_layout): New function.
1884 (Incremental_binary::do_reserve_layout): New function.
1885 (Incremental_binary::do_input_file_count): New function.
1886 (Incremental_binary::do_get_input_reader): Change signature.
1887 (Incremental_binary::input_args_map_): New data member.
1888 (Incremental_binary::library_map_): New data member.
1889 (Incremental_binary::script_map_): New data member.
1890 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1891 new data members.
1892 (Sized_incremental_binary::output_section): New function.
1893 (Sized_incremental_binary::inputs_reader): Add const.
1894 (Sized_incremental_binary::symtab_reader): Add const.
1895 (Sized_incremental_binary::relocs_reader): Add const.
1896 (Sized_incremental_binary::got_plt_reader): Add const.
1897 (Sized_incremental_binary::get_symtab_view): New function.
1898 (Sized_incremental_binary::Inputs_reader): New typedef.
1899 (Sized_incremental_binary::Input_entry_reader): New typedef.
1900 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1901 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1902 (Sized_incremental_binary::do_file_has_changed): New function.
1903 (Sized_incremental_binary::do_init_layout): New function.
1904 (Sized_incremental_binary::do_reserve_layout): New function.
1905 (Sized_input_reader::Inputs_reader): Remove.
1906 (Sized_input_reader::Input_entry_reader): Remove.
1907 (Sized_input_reader::do_arg_serial): New function.
1908 (Sized_input_reader::do_get_unused_symbol_count): New function.
1909 (Sized_input_reader::do_get_unused_symbol): New function.
1910 (Sized_incremental_binary::do_input_file_count): New function.
1911 (Sized_incremental_binary::do_get_input_reader): Change signature;
1912 use index instead of filename.
1913 (Sized_incremental_binary::section_map_): New data member.
1914 (Sized_incremental_binary::input_entry_readers_): New data member.
1915 (class Sized_incr_relobj): New class.
1916 (class Sized_incr_dynobj): New class.
1917 (make_sized_incremental_object): New function.
1918 (class Incremental_library): New class.
1919 * layout.cc (Free_list::num_lists): New static data member.
1920 (Free_list::num_nodes): New static data member.
1921 (Free_list::num_removes): New static data member.
1922 (Free_list::num_remove_visits): New static data member.
1923 (Free_list::num_allocates): New static data member.
1924 (Free_list::num_allocate_visits): New static data member.
1925 (Free_list::init): New function.
1926 (Free_list::remove): New function.
1927 (Free_list::allocate): New function.
1928 (Free_list::dump): New function.
1929 (Free_list::print_stats): New function.
1930 (Layout_task_runner::run): Resize output file for incremental updates.
1931 (Layout::Layout): Initialize new data members.
1932 (Layout::set_incremental_base): New function.
1933 (Layout::init_fixed_output_section): New function.
1934 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1935 incremental updates.
1936 (Layout::create_gold_note): Do not create gold note section for
1937 incremental updates.
1938 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1939 for incremental updates.
1940 (Layout::set_section_offsets): For incremental updates, allocate space
1941 from free list.
1942 (Layout::create_symtab_sections): Layout with offsets relative to
1943 start of section; for incremental updates, allocate space from free
1944 list.
1945 (Layout::create_shdrs): For incremental updates, allocate space from
1946 free list.
1947 (Layout::finish_dynamic_section): For incremental updates, do not
1948 check --as-needed (fixed in subsequent patch).
1949 * layout.h (class Free_list): New class.
1950 (Layout::set_incremental_base): New function.
1951 (Layout::incremental_base): New function.
1952 (Layout::init_fixed_output_section): New function.
1953 (Layout::allocate): New function.
1954 (Layout::incremental_base_): New data member.
1955 (Layout::free_list_): New data member.
1956 * main.cc (main): Print Free_list statistics.
1957 * object.cc (Relobj::finalize_incremental_relocs): Add
1958 clear_counts parameter; clear counts only when clear_counts is set.
1959 (Sized_relobj::Sized_relobj): Initialize new base class.
1960 (Sized_relobj::do_layout): Don't report special sections.
1961 (Sized_relobj::do_for_all_local_got_entries): New function.
1962 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1963 symtab_off to all symbol table offsets.
1964 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1965 * object.h (class Got_offset_list): Move to top of file.
1966 (Object::Object): Allow case where input_file == NULL.
1967 (Object::~Object): Likewise.
1968 (Object::input_file): Assert that input_file != NULL.
1969 (Object::lock): Allow case where input_file == NULL.
1970 (Object::unlock): Likewise.
1971 (Object::is_locked): Likewise.
1972 (Object::token): Likewise.
1973 (Object::release): Likewise.
1974 (Object::is_incremental): New function.
1975 (Object::get_mtime): New function.
1976 (Object::for_all_local_got_entries): New function.
1977 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1978 (Object::set_is_in_system_directory): New function.
1979 (Object::is_in_system_directory): New function.
1980 (Object::do_is_incremental): New function.
1981 (Object::do_get_mtime): New function.
1982 (Object::do_for_all_local_got_entries): New function.
1983 (Object::is_in_system_directory_): New data member.
1984 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1985 (class Sized_relobj_base): New class.
1986 (class Sized_relobj): Derive from Sized_relobj_base.
1987 (class Sized_relobj::Symbols): Redeclare from base class.
1988 (class Sized_relobj::local_got_offset_list): Remove.
1989 (class Sized_relobj::Output_sections): Redeclare from base class.
1990 (class Sized_relobj::do_for_all_local_got_entries): New function.
1991 (class Sized_relobj::write_local_symbols): Add offset parameter.
1992 (class Sized_relobj::local_symbol_offset_): Update comment.
1993 (class Sized_relobj::local_dynsym_offset_): Update comment.
1994 * options.cc (Input_arguments::add_file): Remove const.
1995 * options.h (Input_file_argument::Input_file_argument):
1996 Initialize arg_serial_ (all constructors).
1997 (Input_file_argument::set_arg_serial): New function.
1998 (Input_file_argument::arg_serial): New function.
1999 (Input_file_argument::arg_serial_): New data member.
2000 (Input_arguments::Input_arguments): Initialize file_count_.
2001 (Input_arguments::add_file): Remove const.
2002 (Input_arguments::number_of_input_files): New function.
2003 (Input_arguments::file_count_): New data member.
2004 (Command_line::number_of_input_files): Call
2005 Input_arguments::number_of_input_files.
2006 * output.cc (Output_segment_headers::Output_segment_headers):
2007 Set current size.
2008 (Output_section::Input_section::current_data_size): New function.
2009 (Output_section::Output_section): Initialize new data members.
2010 (Output_section::add_input_section): Don't do merge sections for
2011 an incremental link; allocate space from free list for an
2012 incremental update.
2013 (Output_section::add_output_section_data): Allocate space from
2014 free list for an incremental update.
2015 (Output_section::update_data_size): New function.
2016 (Output_section::set_fixed_layout): New function.
2017 (Output_section::reserve): New function.
2018 (Output_segment::set_section_addresses): Remove const.
2019 (Output_segment::set_section_list_addresses): Remove const; allocate
2020 space from free list for an incremental update.
2021 (Output_segment::set_offset): Adjust size of RELRO segment for an
2022 incremental update.
2023 * output.h (Output_data::current_data_size): Move here from
2024 child classes.
2025 (Output_data::pre_finalize_data_size): New function.
2026 (Output_data::update_data_size): New function.
2027 (Output_section_headers::update_data_size): new function.
2028 (Output_section_data_build::current_data_size): Move to Output_data.
2029 (Output_data_strtab::update_data_size): New function.
2030 (Output_section::current_data_size): Move to Output_data.
2031 (Output_section::set_fixed_layout): New function.
2032 (Output_section::has_fixed_layout): New function.
2033 (Output_section::reserve): New function.
2034 (Output_section::update_data_size): New function.
2035 (Output_section::has_fixed_layout_): New data member.
2036 (Output_section::free_list_): New data member.
2037 (Output_segment::set_section_addresses): Remove const.
2038 (Output_segment::set_section_list_addresses): Remove const.
2039 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2040 New function.
2041 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2042 New function.
2043 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2044 parameter when calling Add_symbols constructor; store argument
2045 serial number for members of a lib group.
2046 (Add_symbols::locks): Allow case where token == NULL.
2047 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2048 (Read_member::~Read_member): New function.
2049 (Read_member::is_runnable): New function.
2050 (Read_member::locks): New function.
2051 (Read_member::run): New function.
2052 (Check_script::~Check_script): New function.
2053 (Check_script::is_runnable): New function.
2054 (Check_script::locks): New function.
2055 (Check_script::run): New function.
2056 (Check_library::~Check_library): New function.
2057 (Check_library::is_runnable): New function.
2058 (Check_library::locks): New function.
2059 (Check_library::run): New function.
2060 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2061 (Add_symbols::library_): New data member.
2062 (class Read_member): New class.
2063 (class Check_script): New class.
2064 (class Check_library): New class.
2065 * reloc.cc (Read_relocs::is_runnable): Allow case where
2066 token == NULL.
2067 (Read_relocs::locks): Likewise.
2068 (Scan_relocs::locks): Likewise.
2069 (Relocate_task::locks): Likewise.
2070 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2071 to clear counters.
2072 (Sized_relobj::incremental_relocs_scan): Fix comment.
2073 (Sized_relobj::do_relocate): Pass output file offset to
2074 write_local_symbols.
2075 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2076 from class declaration.
2077 * script.cc (read_input_script): Allocate Script_info; pass
2078 argument serial number to report_script.
2079 * script.h (class Script_info): Move to incremental.h.
2080 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2081 * symtab.h (Symbol_table::add_from_incrobj): New function.
2082 (Symbol_table::set_file_offset): New function.
2083
2084 2011-04-05 Cary Coutant <ccoutant@google.com>
2085
2086 * incremental-dump.cc (dump_incremental_inputs): Change signature
2087 to take a Sized_incremental_binary; change caller. Use readers
2088 in Sized_incremental_binary.
2089 * incremental.cc
2090 (Sized_incremental_binary::find_incremental_inputs_sections):
2091 Rename do_find_incremental_inputs_sections to this.
2092 (Sized_incremental_binary::setup_readers): New function.
2093 (Sized_incremental_binary::do_check_inputs): Check
2094 has_incremental_info_ flag; move setup code to setup_readers;
2095 use input readers.
2096 (Sized_incremental_binary::do_file_is_unchanged): New function.
2097 (Sized_incremental_binary::do_get_input_reader): New function.
2098 * incremental.h (class Incremental_binary): Move to end of file.
2099 (Incremental_binary::file_is_unchanged): New function.
2100 (Incremental_binary::do_file_is_unchanged): New function.
2101 (Incremental_binary::Input_reader): New class.
2102 (Incremental_binary::get_input_reader): New function.
2103 (class Sized_incremental_binary): Move to end of file.
2104 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2105 input section reader classes.
2106 (Sized_incremental_binary::has_incremental_info): New function.
2107 (Sized_incremental_binary::inputs_reader): New function.
2108 (Sized_incremental_binary::symtab_reader): New function.
2109 (Sized_incremental_binary::relocs_reader): New function.
2110 (Sized_incremental_binary::got_plt_reader): New function.
2111 (Sized_incremental_binary::do_file_is_unchanged): New function.
2112 (Sized_incremental_binary::Sized_input_reader): New class.
2113 (Sized_incremental_binary::get_input_reader): New function.
2114 (Sized_incremental_binary::find_incremental_inputs_sections):
2115 Rename do_find_incremental_inputs_sections to this.
2116 (Sized_incremental_binary::setup_readers): New function.
2117 (Sized_incremental_binary::has_incremental_info_): New data member.
2118 (Sized_incremental_binary::inputs_reader_): New data member.
2119 (Sized_incremental_binary::symtab_reader_): New data member.
2120 (Sized_incremental_binary::relocs_reader_): New data member.
2121 (Sized_incremental_binary::got_plt_reader_): New data member.
2122 (Sized_incremental_binary::current_input_file_): New data member.
2123
2124 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2125
2126 PR gold/12640
2127 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2128 violation.
2129
2130 2011-03-30 Cary Coutant <ccoutant@google.com>
2131
2132 * archive.cc (Archive::include_member): Adjust call to report_object.
2133 (Add_archive_symbols::run): Add script_info to call to
2134 report_archive_begin.
2135 (Lib_group::include_member): Adjust call to report_object.
2136 (Add_lib_group_symbols::run): Adjust call to report_object.
2137 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2138 blocks. Add object count for script input files.
2139 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2140 script_info parameter; change all callers.
2141 (Incremental_inputs::report_object): Add script_info parameter;
2142 change all callers.
2143 (Incremental_inputs::report_script): Store backpointer to
2144 incremental info entry.
2145 (Output_section_incremental_inputs::set_final_data_size): Record
2146 additional information for scripts.
2147 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2148 * incremental.h (Incremental_script_entry::add_object): New function.
2149 (Incremental_script_entry::get_object_count): New function.
2150 (Incremental_script_entry::get_object): New function.
2151 (Incremental_script_entry::objects_): New data member; adjust
2152 constructor.
2153 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2154 (Incremental_inputs::report_object): Add script_info parameter.
2155 (Incremental_inputs_reader::get_object_count): New function.
2156 (Incremental_inputs_reader::get_object_offset): New function.
2157 * options.cc (Input_arguments::add_file): Return reference to
2158 new input argument.
2159 * options.h (Input_argument::set_script_info): New function.
2160 (Input_argument::script_info): New function.
2161 (Input_argument::script_info_): New data member; adjust all
2162 constructors.
2163 (Input_file_group::add_file): Return reference to new input argument.
2164 (Input_file_lib::add_file): Likewise.
2165 (Input_arguments::add_file): Likewise.
2166 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2167 * script.cc (Parser_closure::Parser_closure): Add script_info
2168 parameter; adjust all callers.
2169 (Parser_closure::script_info): New function.
2170 (Parser_closure::script_info_): New data member.
2171 (read_input_script): Report scripts earlier to incremental info.
2172 (script_add_file): Set script_info in Input_argument.
2173 (script_add_library): Likewise.
2174 * script.h (Script_options::Script_info): Rewrite class.
2175
2176 2011-03-29 Cary Coutant <ccoutant@google.com>
2177
2178 * archive.cc (Library_base::should_include_member): Move
2179 method here from class Archive.
2180 (Archive::Archive): Initialize base class.
2181 (Archive::should_include_member): Move to base class.
2182 (Archive::do_for_all_unused_symbols): New function.
2183 (Add_archive_symbols::run): Remove redundant access to
2184 incremental_inputs.
2185 (Lib_group::Lib_group): Initialize base class.
2186 (Lib_group::do_filename): New function.
2187 (Lib_group::include_member): Pass pointer to Lib_group to
2188 report_object.
2189 (Lib_group::do_for_all_unused_symbols): New function.
2190 (Add_lib_group_symbols::run): Report archive information for
2191 incremental links.
2192 * archive.h (class Library_base): New base class.
2193 (class Archive): Derive from Library_base.
2194 (Archive::filename): Move to base class.
2195 (Archive::set_incremental_info): Likewise.
2196 (Archive::incremental_info): Likewise.
2197 (Archive::Should_include): Likewise.
2198 (Archive::should_include_member): Likewise.
2199 (Archive::Armap_entry): Remove.
2200 (Archive::Unused_symbol_iterator): Remove.
2201 (Archive::unused_symbols_begin): Remove.
2202 (Archive::unused_symbols_end): Remove.
2203 (Archive::do_filename): New function.
2204 (Archive::do_get_mtime): New function.
2205 (Archive::do_for_all_unused_symbols): New function.
2206 (Archive::task_): Move to base class.
2207 (Archive::incremental_info_): Likewise.
2208 (class Lib_group): Derive from Library_base.
2209 (Lib_group::do_filename): New function.
2210 (Lib_group::do_get_mtime): New function.
2211 (Lib_group::do_for_all_unused_symbols): New function.
2212 (Lib_group::task_): Move to base class.
2213 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2214 function.
2215 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2216 function.
2217 * incremental.cc (Incremental_inputs::report_archive_begin):
2218 Use Library_base; call library's get_mtime; add incremental inputs
2219 entry before members.
2220 (class Unused_symbol_visitor): New class.
2221 (Incremental_inputs::report_archive_end): Use Library_base; use
2222 visitor class to record unused symbols; don't add incremental inputs
2223 entry after members.
2224 (Incremental_inputs::report_object): Use Library_base.
2225 * incremental.h
2226 (Incremental_archive_entry::Incremental_archive_entry): Remove
2227 unused Archive parameter.
2228 (Incremental_inputs::report_archive_begin): Use Library_base.
2229 (Incremental_inputs::report_archive_end): Likewise.
2230 (Incremental_inputs::report_object): Likewise.
2231 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2232 function.
2233 * object.h (Object::for_all_global_symbols): New function.
2234 (Object::do_for_all_global_symbols): New function.
2235 (Sized_relobj::do_for_all_global_symbols): New function.
2236 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2237 function.
2238 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2239 function.
2240
2241 2011-03-27 Ian Lance Taylor <iant@google.com>
2242
2243 * archive.cc (Archive::interpret_header): Return -1 if something
2244 goes wrong. Change callers accordingly.
2245
2246 2011-03-25 Cary Coutant <ccoutant@google.com>
2247
2248 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2249 * testsuite/Makefile.in: Regenerate.
2250
2251 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
2252
2253 * plugin.cc (get_view): New.
2254 (Plugin::load): Pass get_view to the plugin.
2255 (Plugin_manager::get_view): New.
2256
2257 2011-03-21 Ian Lance Taylor <iant@google.com>
2258
2259 * testsuite/final_layout.sh: Rewrite to not use dc.
2260 * testsuite/relro_test.sh: Fail if dc is not present.
2261
2262 2011-03-21 Sriraman Tallam <tmsriram@google.com>
2263
2264 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2265 Change == to -eq.
2266 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2267 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2268 Change == to -eq.
2269 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2270 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2271
2272 2011-03-14 Ian Lance Taylor <iant@google.com>
2273
2274 * script-sections.cc (Sort_output_sections::script_compare):
2275 Rename from is_before, change return type.
2276 (Sort_output_sections::operator()): Adjust accordingly.
2277
2278 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2279
2280 PR gold/12572
2281 * testsuite/odr_violation2.cc: Add comment to make all error line
2282 numbers double digits.
2283 * testsuite/debug_msg.sh: Adjust expected errors.
2284
2285 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2286
2287 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2288 but mark earlier ones as non-canonical
2289 (offset_to_iterator): Update search target and example
2290 (do_addr2line): Return extra lines in a vector*
2291 (format_file_lineno): Extract from do_addr2line
2292 (one_addr2line): Add vector* out-param
2293 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2294 when a lineno entry appeared last for its instruction
2295 (Dwarf_line_info): Add vector* out-param
2296 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2297 * symtab.cc (Odr_violation_compare): Include the lineno in the
2298 comparison again.
2299 (linenos_from_loc): New. Combine the canonical line for an
2300 address with its other lines.
2301 (True_if_intersect): New. Helper functor to make
2302 std::set_intersection a query.
2303 (detect_odr_violations): Compare sets of lines instead of just
2304 one line for each function. This became less deterministic, but
2305 has fewer false positives.
2306 * symtab.h: Declarations.
2307 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2308 mix an optimized and non-optimized object in the same binary
2309 (odr_violation2.so): Same.
2310 * testsuite/Makefile.in: Regenerate from Makefile.am.
2311 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2312 * testsuite/debug_msg.sh: Update line numbers and add
2313 assertions.
2314 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2315 non-optimized context.
2316 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2317 isn't inlined, and use OdrDerived in an optimized context.
2318 * testsuite/odr_header1.h: Defines OdrDerived, where
2319 optimization will change the
2320 first-instruction-in-the-destructor's file and line number.
2321 * testsuite/odr_header2.h: Defines OdrBase.
2322
2323 2011-03-09 Ian Lance Taylor <iant@google.com>
2324
2325 * fileread.cc (File_read::clear_views): Don't delete the whole
2326 file view.
2327
2328 2011-03-08 Ian Lance Taylor <iant@google.com>
2329
2330 PR gold/12525
2331 * fileread.cc: #include <climits>.
2332 (GOLD_IOV_MAX): Define.
2333 (File_read::read_multiple): Limit number of entries by iov_max.
2334 * fileread.h (class File_read): Always set max_readv_entries to
2335 128.
2336
2337 2011-03-07 Ian Lance Taylor <iant@google.com>
2338
2339 PR gold/12525
2340 * options.h (class General_options): Add -dy and -dn.
2341
2342 2011-03-02 Cary Coutant <ccoutant@google.com>
2343
2344 * testsuite/script_test_9.t: Add TLS segment.
2345
2346 2011-03-02 Simon Baldwin <simonb@google.com>
2347
2348 * configure.ac: Add check for gnu_indirect_function support in
2349 the toolchain building binutils.
2350 * configure: Rebuild.
2351
2352 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
2353
2354 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2355 plugin only symbols.
2356 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2357 in plugin files as not needed in the symbol table.
2358
2359 2011-02-11 Sriraman Tallam <tmsriram@google.com>
2360
2361 * output.cc (Output_section::add_input_section): Delay fill
2362 generation for section ordering.
2363
2364 2011-02-09 Ian Lance Taylor <iant@google.com>
2365
2366 PR gold/12316
2367 * object.h (class Sized_relobj): Remove clear_local_symbols.
2368 * reloc.cc (Sized_relobj::do_relocate): Don't call
2369 clear_local_symbols.
2370
2371 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
2372
2373 * plugin.cc (is_visible_from_outside): Return true for symbols
2374 in the -u option.
2375
2376 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2377
2378 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2379 filename.
2380
2381 2011-02-02 Sriraman Tallam <tmsriram@google.com>
2382
2383 * icf.h (is_section_foldable_candidate): Change type of parameter
2384 to std::string.
2385 * icf.cc (Icf::find_identical_sections): Change type of local variable
2386 section_name to be std::string.
2387 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2388
2389 2011-01-25 Ian Lance Taylor <iant@google.com>
2390
2391 * script.cc (script_add_extern): Rewrite to use
2392 add_symbol_reference.
2393
2394 2011-01-25 Doug Kwan <dougkwan@google.com>
2395
2396 * icf.cc (get_section_contents): Always lock section's object.
2397
2398 2011-01-24 Ian Lance Taylor <iant@google.com>
2399
2400 * options.h (class General_options): Accept
2401 --no-detect-odr-violations.
2402
2403 2011-01-24 Ian Lance Taylor <iant@google.com>
2404
2405 * version.cc (version_string): Bump to 1.11.
2406
2407 2011-01-24 Ian Lance Taylor <iant@google.com>
2408
2409 * plugin.cc (class Plugin_rescan): Define new class.
2410 (Plugin_manager::claim_file): Set any_claimed_.
2411 (Plugin_manager::save_archive): New function.
2412 (Plugin_manager::save_input_group): New function.
2413 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2414 necessary.
2415 (Plugin_manager::new_undefined_symbol): New function.
2416 (Plugin_manager::rescan): New function.
2417 (Plugin_manager::rescannable_defines): New function.
2418 (Plugin_manager::add_input_file): Set any_added_.
2419 * plugin.h (class Plugin_manager): define new fields rescannable_,
2420 undefined_symbols_, any_claimed_, and any_added_. Declare
2421 Plugin_rescan as friend. Declare new functions.
2422 (Plugin_manager::Rescannable): Define type.
2423 (Plugin_manager::Rescannable_list): Define type.
2424 (Plugin_manager::Undefined_symbol_list): Define type.
2425 (Plugin_manager::Plugin_manager): Initialize new fields.
2426 * archive.cc (Archive::defines_symbol): New function.
2427 (Add_archive_symbols::run): Pass archive to plugins if any.
2428 * archive.h (class Archive): Declare defines_symbol.
2429 * readsyms.cc (Input_group::~Input_group): New function.
2430 (Finish_group::run): Pass input_group to plugins if any.
2431 * readsyms.h (class Input_group): Declare destructor.
2432 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2433 any.
2434
2435 2011-01-10 Ian Lance Taylor <iant@google.com>
2436
2437 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2438 section as relro.
2439 (Layout::set_segment_offsets): Reset increase_relro before calling
2440 set_section_addresses a second time.
2441
2442 2011-01-04 Cary Coutant <ccoutant@google.com>
2443
2444 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2445 sections before NOBITS sections.
2446
2447 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2448
2449 * version.cc (print_version): Update copyright to 2011.
2450
2451 2010-12-23 Cary Coutant <ccoutant@google.com>
2452
2453 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2454 of OS to this->add. Add OD parameter to second form of the function.
2455
2456 2010-12-20 Ian Lance Taylor <iant@google.com>
2457
2458 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2459 second of two consecutive entries with same offset.
2460
2461 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2462
2463 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2464 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2465 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2466 to avoid unneeded links against $(LDADD).
2467 * testsuite/Makefile.in: Regenerate.
2468
2469 2010-12-15 Ian Lance Taylor <iant@google.com>
2470
2471 PR gold/12324
2472 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2473 for R_X86_64_32 and R_X86_64_PC32.
2474 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2475 ver_matching_def_pic.o.
2476 (ver_matching_def_pic.o): New target.
2477
2478 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2479
2480 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2481 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2482 Move definition before File_read::View member definitions.
2483 (File_read::View::~View): Initialize and hold lock before
2484 updating current_mapped_bytes.
2485
2486 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2487
2488 * dwarf_reader.cc: Remove outdated comment.
2489 * gold-threads.cc: Fix typo in error message.
2490 * archive.cc: Fix typos in comments.
2491 * archive.h: Likewise.
2492 * arm-reloc-property.cc: Likewise.
2493 * arm-reloc-property.h: Likewise.
2494 * arm-reloc.def: Likewise.
2495 * arm.cc: Likewise.
2496 * attributes.h: Likewise.
2497 * cref.cc: Likewise.
2498 * ehframe.cc: Likewise.
2499 * fileread.h: Likewise.
2500 * gold.h: Likewise.
2501 * i386.cc: Likewise.
2502 * icf.cc: Likewise.
2503 * incremental.h: Likewise.
2504 * int_encoding.cc: Likewise.
2505 * layout.h: Likewise.
2506 * main.cc: Likewise.
2507 * merge.h: Likewise.
2508 * object.cc: Likewise.
2509 * object.h: Likewise.
2510 * options.cc: Likewise.
2511 * readsyms.cc: Likewise.
2512 * reduced_debug_output.cc: Likewise.
2513 * reloc.cc: Likewise.
2514 * script-sections.cc: Likewise.
2515 * sparc.cc: Likewise.
2516 * symtab.h: Likewise.
2517 * target-reloc.h: Likewise.
2518 * target.cc: Likewise.
2519 * target.h: Likewise.
2520 * timer.cc: Likewise.
2521 * timer.h: Likewise.
2522 * x86_64.cc: Likewise.
2523
2524 2010-12-09 Cary Coutant <ccoutant@google.com>
2525
2526 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2527 stack.
2528 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2529 parameter; change all callers.
2530 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2531 * options.h (warn_execstack): New option.
2532
2533 2010-12-07 Doug Kwan <dougkwan@google.com>
2534
2535 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2536 like function call relocations.
2537
2538 2010-12-07 Ian Lance Taylor <iant@google.com>
2539
2540 * archive.cc (Archive::get_elf_object_for_member): Permit
2541 punconfigured to be NULL.
2542 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2543 (Archive::include_member): Pass NULL to get_elf_object_for_member
2544 if we searched for the archive and this is the first included
2545 object.
2546
2547 2010-12-01 Ian Lance Taylor <iant@google.com>
2548
2549 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2550 track_relocs_type_ field.
2551 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2552 Set track_relocs_type_.
2553 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2554 contents when using RELA relocs.
2555 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2556 reloc_map_.
2557 * reloc.cc (Track_relocs::next_addend): New function.
2558 * reloc.h (class Track_relocs): Declare next_addend.
2559
2560 2010-12-01 Ian Lance Taylor <iant@google.com>
2561
2562 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2563 virtual destructor.
2564
2565 2010-12-01 Ian Lance Taylor <iant@google.com>
2566
2567 * README: Update compilers known to work and fail.
2568
2569 2010-11-23 Matthias Klose <doko@ubuntu.com>
2570
2571 * configure.in: For --enable-gold, handle value `default' instead of
2572 `both*'. Always install ld as ld.bfd, install as ld if gold is
2573 not the default.
2574 * configure: Regenerate.
2575
2576 2010-11-18 Doug Kwan <dougkwan@google.com>
2577
2578 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2579 and right_alignment to be zero. Store result alignment only if it is
2580 greater than existing alignment.
2581
2582 2010-11-16 Cary Coutant <ccoutant@google.com>
2583
2584 PR gold/12220
2585 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2586 Check for ".zdebug_line".
2587
2588 2010-11-16 Doug Kwan <dougkwan@google.com>
2589 Cary Coutant <ccoutant@google.com>
2590
2591 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2592 by reference; adjust all callers.
2593 * output.cc (Output_segment::set_section_addresses): Adjust references
2594 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2595 list is empty.
2596 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2597 end at page boundary.
2598
2599 2010-11-16 Cary Coutant <ccoutant@google.com>
2600
2601 PR gold/12220
2602 * layout.cc (Layout::choose_output_section): Transform names of
2603 compressed sections even when using a script with a SECTIONS clause.
2604 (Layout::output_section_name): Remove code to transform
2605 compressed debug section names.
2606 * output.cc (Output_section::add_input_section): Use uncompressed
2607 section size when tracking input sections.
2608
2609 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2610
2611 * symtab.h (Symbol::NON_PIC_REF): Remove.
2612 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2613 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2614 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2615 (Symbol::use_plt_offset): Take a flags argument and pass it
2616 directly to needs_dynamic_reloc. Restrict check for undefined
2617 weak symbols to function calls.
2618 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2619 (Target_arm::Scan::global): Use it.
2620 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2621 (Target_arm::Relocate::relocate): Likewise.
2622 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2623 parameter with an r_type parameter. Use get_reference_flags
2624 to get the flags.
2625 (Target_arm::Relocate::relocate): Update accordingly.
2626 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2627 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2628 (Target_i386::Scan::global): Likewise.
2629 (Target_i386::Relocate::relocate): Likewise.
2630 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2631 parameter with an r_type parameter. Use get_reference_flags
2632 to get the flags.
2633 (Target_i386::Relocate::relocate): Update accordingly.
2634 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2635 (Target_powerpc::Scan::global): Use it.
2636 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2637 (Target_powerpc::Relocate::relocate): Likewise.
2638 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2639 (Target_sparc::Scan::global): Use it.
2640 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2641 (Target_sparc::Relocate::relocate): Likewise.
2642 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2643 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2644 (Target_x86_64::Scan::global): Likewise.
2645 (Target_x86_64::Relocate::relocate): Likewise.
2646
2647 2010-11-08 Doug Kwan <dougkwan@google.com>
2648 Cary Coutant <ccoutant@google.com>
2649
2650 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2651 (Arm_exidx_merge_section::section_contents_): New data member.
2652 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2653 (Arm_input_section::~Arm_input_section): De-allocate memory.
2654 (Arm_input_section::original_contents_): New data member.
2655 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2656 in parameters instead of calling Object::section_contents without
2657 locking.
2658 (Arm_output_section::group_section): New parameter TASK. Pass it
2659 to callees that need locking objects.
2660 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2661 to lock EXIDX input sections. Fix a formatting issue. Call
2662 Arm_exidx_merged_section::build_contents to create merged section
2663 contents.
2664 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2665 to lock object of stub table owner.
2666 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2667 TEXT_SIZE to initialize data member TEXT_SIZE_.
2668 (Arm_exidx_input_section::addralign): Fix typo in comment.
2669 (Arm_exidx_input_section::text_size): New method.
2670 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2671 that require locking objects. Lock objects before scanning for stubs
2672 and updating local symbols.
2673 (Arm_input_section<big_endian>::init): Copy contents of original
2674 input section.
2675 (Arm_input_section<big_endian>::do_write): Use saved contents of
2676 original input section instead of calling Object::section_contents
2677 without locking.
2678 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2679 size without calling Object::section_size().
2680 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2681 for size. Allocate a buffer for merged EXIDX entries.
2682 (Arm_exidx_merged_section::build_contents): New method.
2683 (Arm_exidx_merged_section::do_write): Move merge section contents
2684 building code to Arm_exidx_merged_section::build_contetns. Write
2685 out contetns in buffer instead of building it on the fly.
2686 (Arm_relobj::make_exidx_input_section): Also pass text section size
2687 to Arm_exidx_input_section constructor.
2688 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2689 (Arm_dynobj::do_read_symbols): Fix memory leak.
2690 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2691 * target.h: (class Task): Add forward declaration.
2692 (Target::relax): Add new parameter TASK and pass it to
2693 Target::do_relax().
2694 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2695
2696 2010-11-05 Cary Coutant <ccoutant@google.com>
2697
2698 PR gold/10708
2699 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2700 object when reading from the file.
2701 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2702 second layout pass.
2703 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2704 when reading section contents.
2705 (get_section_contents): Likewise.
2706 (icf::find_identical_sections): Likewise.
2707 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2708 object when reading from the file.
2709 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2710 the object when doing deferred section layout.
2711
2712 2010-11-03 Nick Clifton <nickc@redhat.com>
2713
2714 PR gold/12001
2715 * script.h (class Symbol_assignment: name): New member. Returns
2716 the name of the symbol.
2717 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2718 Returns true if the given symbol name is on the list of
2719 assignments wating to be processed.
2720 * archive.cc (should_incldue_member): If the symbol is undefined,
2721 check to see if it is on the list of symbols pending assignment.
2722
2723 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2724
2725 * script-sections.cc (Script_sections::find_memory_region): Check
2726 for a NULL output section pointer.
2727
2728 2010-10-29 Doug Kwan <dougkwan@google.com>
2729
2730 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2731 Output_section::add_relaxed_input_section.
2732 * output.cc (Output_section::add_relaxed_input_section): Add new
2733 arguments LAYOUT and NAME. Set section order index.
2734 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2735 Copy section order index.
2736 * output.h (Output_section::add_relaxed_input_section): Add new
2737 arguments LAYOUT and NAME.
2738
2739 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2740
2741 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2742 NATIVE_OR_CROSS_LINKER.
2743 * testsuite/Makefile.in: Regenerate.
2744
2745 2010-10-20 Doug Kwan <dougkwan@google.com>
2746
2747 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2748 without SHF_LINK_ORDER flags.
2749 * layout.cc (Layout::choose_output_section): Do not filter
2750 SHF_LINK_ORDER flag in a relocatable link.
2751
2752 2010-10-17 Cary Coutant <ccoutant@google.com>
2753
2754 * output.h (Output_segment::set_section_addresses): Change function
2755 signature. Update all callers.
2756 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2757 sections.
2758 (Output_segment::set_section_addresses): Align after last TLS
2759 section. Add padding before last relro section instead of after.
2760
2761 2010-10-17 Doug Kwan <dougkwan@google.com>
2762
2763 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2764 GOT output section to be writable.
2765
2766 2010-10-14 Cary Coutant <ccoutant@google.com>
2767
2768 * debug.h (DEBUG_INCREMENTAL): New flag.
2769 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2770 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2771 mode.
2772 * incremental.cc (report_command_line): Ignore all forms of
2773 --incremental.
2774 * layout.cc (Layout::Layout): Check parameters for incremental link
2775 mode.
2776 * options.cc (General_options::parse_incremental): New function.
2777 (General_options::parse_no_incremental): New function.
2778 (General_options::parse_incremental_full): New function.
2779 (General_options::parse_incremental_update): New function.
2780 (General_options::incremental_mode_): New data member.
2781 (General_options::finalize): Check incremental_mode_.
2782 * options.h (General_options): Update help text for --incremental.
2783 Add --no-incremental, --incremental-full, --incremental-update.
2784 (General_options::Incremental_mode): New enum type.
2785 (General_options::incremental_mode): New function.
2786 (General_options::incremental_mode_): New data member.
2787 * parameters.cc (Parameters::incremental_mode_): New data member.
2788 (Parameters::set_options): Set incremental_mode_.
2789 (Parameters::set_incremental_full): New function.
2790 (Parameters::incremental): New function.
2791 (Parameters::incremental_update): New function.
2792 (set_parameters_incremental_full): New function.
2793 * parameters.h (Parameters::set_incremental_full): New function.
2794 (Parameters::incremental): New function.
2795 (Parameters::incremental_update): New function.
2796 (Parameters::incremental_mode_): New data member.
2797 (set_parameters_incremental_full): New function.
2798 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2799 incremental link mode.
2800 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2801 (Sized_relobj::do_relocate_sections): Likewise.
2802 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2803 option.
2804 * testsuite/Makefile.in: Regenerate.
2805 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2806
2807 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2808
2809 * script-sections.h (class Script_sections): Make
2810 Sections_elements typedef public.
2811 * script-sections.cc (class Sort_output_sections): Add elements_
2812 field. Add constructor which sets it; change all callers.
2813 (Sort_output_sections::is_before): New function.
2814 (Sort_output_sections::operator()): Call is_before.
2815 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2816 conditional.
2817 * testsuite/script_test_10.sh: New test. Test script section
2818 order.
2819 * testsuite/script_test_10.t: Likewise.
2820 * testsuite/script_test_10.s: Likewise.
2821 * testsuite/Makefile.am: Wrap the cross linker tests and the
2822 common tests into NATIVE_OR_CROSS_LINKER.
2823 (check_SCRIPTS): Add script_test_10.sh.
2824 (check_DATA): Add script_test_10.stdout.
2825 (script_test_10.o, script_test_10): New targets.
2826 (script_test_10.stdout): New target.
2827 * configure, testsuite/Makefile.in: Regenerate.
2828
2829 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2830
2831 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2832 error for the deprecated relocations.
2833 (Target_arm::Scan::global): Likewise.
2834 (Target_arm::Relocate::relocate): Likewise.
2835
2836 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2837
2838 * fileread.cc (Input_file::find_file): Initialize *found_name
2839 and *namep when using the fallback search for case 4.
2840
2841 2010-10-11 Cary Coutant <ccoutant@google.com>
2842
2843 * options.h (class General_options): Redefine -z lazy as an alias for
2844 the negation of -z now.
2845
2846 2010-10-11 Ian Lance Taylor <iant@google.com>
2847
2848 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2849 binding.
2850
2851 2010-10-06 Nick Clifton <nickc@redhat.com>
2852
2853 * script-sections.cc(class Memory_region): Remove
2854 current_lma_offset_ field. Rename current_vma_offset_ to
2855 current_offset_. Add last_section_ field.
2856 (Memory_region::get_current_vma_address): Rename to
2857 get_current_address.
2858 (Memory_region::get_current_lma_address): Delete.
2859 (Memory_region::increment_vma_offset): Rename to
2860 increment_offset.
2861 (Memory_region::increment_lma_offset): Delete.
2862 (Memory_region::attributes_compatible): New method. Returns
2863 true if the provided section is compatible with the region.
2864 (Memory_region::get_last_section): New method. Returns the last
2865 section to use the region.
2866 (Memory_region::set_last_section): New method. Stores the last
2867 section to use the region.
2868 (Script_sections::block_in_region): New method. Returns true if
2869 a block of memory is contained within a region.
2870 (Script_sections::find_memory_region): New method. Locates a
2871 memory region to be used to set a VMA or LMA address.
2872 (Output_section_definition::set_section_addresses): Add code to
2873 check for addresses set by memory regions.
2874 (Output_segment::set_section_addresses): Remove memory region
2875 walking code.
2876 (Script_sections::create_segment): Add a warning if a header
2877 segment is created outside of any region.
2878 * script-sections.h (class Script_sections): Add prototypes for
2879 find_memory_region and block_in_region methods.
2880 * testsuite/memory_test.s: Use .long instead of .word.
2881 * testsuite/memory_test.t: Add some more output sections.
2882 * testsuite/memory_test.sh: Update expected output.
2883
2884 2010-10-02 Doug Kwan <dougkwan@google.com>
2885
2886 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2887 defintion to symtab.h
2888 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2889 declaration to defintion.
2890
2891 2010-10-01 Nick Clifton <nickc@redhat.com>
2892
2893 * expression.cc (eval): Replace dummy argument with NULL.
2894 (eval_maybe_dot): Check for a NULL result section pointer.
2895 (Symbol_expression::value): Likewise.
2896 (Dot_expression::value): Likewise.
2897 (BINARY_EXPRESSION): Likewise.
2898 (Max_expression::value): Likewise.
2899 (Min_expression::value): Likewise.
2900 (Absolute_expression::value): Likewise.
2901 (Addr_expression::value_from_output_section): Likewise.
2902 (Loaddddr_expression::value_from_output_section): Likewise.
2903 (Segment_start_expression::value): Likewise.
2904 * script-sections.cc
2905 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2906 argument with NULL.
2907 (Sections_elememt_dot_assignment::set_section_addresses):
2908 Likewise.
2909 (Output_data_expression::do_write_to_buffer): Likewise.
2910 (Output_section_definition::finalize_symbols): Likewise.
2911 (Output_section_definition::set_section_addresses): Likewise.
2912
2913 2010-09-30 Doug Kwan <dougkwan@google.com>
2914
2915 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2916
2917 2010-09-28 Sriraman Tallam <tmsriram@google.com>
2918
2919 * target.h (Target::can_icf_inline_merge_sections): New virtual
2920 function.
2921 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2922 virtual function.
2923 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2924 virtual function.
2925 * icf.cc (get_section_contents): Inline merge sections only when
2926 target allows it.
2927
2928 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2929
2930 * configure: Regenerate.
2931
2932 2010-09-17 Ian Lance Taylor <iant@google.com>
2933
2934 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
2935 * testsuite/Makefile.am (memory_test.o): New target.
2936 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2937 memory_test.t.
2938 * testsuite/Makefile.in: Rebuild.
2939
2940 2010-09-17 Doug Kwan <dougkwan@google.com>
2941
2942 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2943 defintion if relocation uses GOT entries of the symbol.
2944 * testsuite/icf_safe_test.sh: Fix test.
2945 * testsuite/icf_safe_so_test.sh: Fix test.
2946
2947 2010-09-16 Cary Coutant <ccoutant@google.com>
2948
2949 * script_sections.cc (class Memory_region): Remove "NULL" from
2950 vector initializations.
2951
2952 2010-09-15 Cary Coutant <ccoutant@google.com>
2953
2954 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2955 Resolve forwarding symbols.
2956
2957 2010-09-15 Doug Kwan <dougkwan@google.com>
2958
2959 * gold/testsuite/script_test_3.t: Add ARM special sections.
2960 * gold/testsuite/script_test_4.t: Same.
2961 * gold/testsuite/script_test_5.t: Same.
2962 * gold/testsuite/script_test_6.t: Same.
2963 * gold/testsuite/script_test_7.t: Same.
2964 * gold/testsuite/script_test_7.t: Same.
2965 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2966
2967 2010-09-14 Cary Coutant <ccoutant@google.com>
2968
2969 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2970 (Target_x86_64::Relocate::relocate_tls): Replace check for
2971 saw_tls_block_reloc_ with test for executable section.
2972
2973 2010-09-12 Cary Coutant <ccoutant@google.com>
2974
2975 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2976 position-independent executables to shared libraries need dynamic
2977 relocations.
2978 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2979 position-independent executables.
2980 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2981 * testsuite/Makefile.in: Regenerate.
2982
2983 2010-09-10 Nick Clifton <nickc@redhat.com>
2984
2985 PR gold/11997
2986 * testsuite/memory_test.t: Discard any sections that are not
2987 needed.
2988
2989 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2990
2991 PR gold/11996
2992 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2993 "This::" to work around a bug in gcc 4.2.
2994
2995 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2996
2997 2010-09-09 Rafael Espindola <espindola@google.com>
2998
2999 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3000 sections with different PF_X flags in the same segment.
3001 (Layout::find_first_load_seg): Search all segments to find the first
3002 one.
3003 * options.h (rosegment): New.
3004
3005 2010-09-08 Rafael Espindola <espindola@google.com>
3006
3007 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
3008
3009 2010-09-08 Doug Kwan <dougkwan@google.com>
3010
3011 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3012 (Arm_relobj::do_relocate_sections): Add new parameter for output
3013 file to match the parent.
3014 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3015 of local symbols instead of input values. Update code to track
3016 changes in gold::relocate_section.
3017 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3018 (Sized_relobj::compute_final_local_value_internal): New methods.
3019 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3020 body into private version of Sized_relobj::compute_final_local_value.
3021 Call the inline method.
3022 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3023 merged symbol value if there is one.
3024 (Symbol_value::has_output_value): New method defintiion.
3025 (Sized_relobj::Compute_final_local_value_status): New enum type.
3026 (Sized_relobj::compute_final_local_value): New methods.
3027 (Sized_relobj::compute_final_local_value_internal): New methods.
3028 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3029 and arm_cortex_a8.sh.
3030 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3031 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3032 New tests.
3033 * Makefile.in: Regenerate.
3034 * testsuite/arm_bl_out_of_range.s: Update test.
3035 * testsuite/thumb_bl_out_of_range.s: Ditto.
3036 * testsuite/thumb_blx_out_of_range.s: Ditto.
3037 * testsuite/arm_branch_out_of_range.sh: New file.
3038 * testsuite/arm_cortex_a8.sh: Ditto.
3039 * testsuite/arm_cortex_a8_b.s: Ditto.
3040 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3041 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3042 * testsuite/arm_cortex_a8_bl.s: Ditto.
3043 * testsuite/arm_cortex_a8_blx.s: Ditto.
3044 * testsuite/arm_cortex_a8_local.s: Ditto.
3045 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3046 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3047
3048 2010-09-08 Rafael Espindola <espindola@google.com>
3049
3050 * Makefile.am (memory_test.stdout): Run readelf with -W.
3051 * Makefile.in: Regenerate.
3052 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3053 64 bit output.
3054
3055 2010-09-08 Rafael Espindola <espindola@google.com>
3056
3057 * script-sections.cc (Script_sections::add_memory_region): Convert
3058 field precision to int.
3059 * script.cc (script_set_section_region, script_set_section_region):
3060 Convert field precision to int.
3061
3062 2010-09-08 Rafael Espindola <espindola@google.com>
3063
3064 * arm.cc (do_finalize_sections): Create the __exidx_start and
3065 __exdix_end symbols even when the section is missing.
3066
3067 2010-09-08 Nick Clifton <nickc@redhat.com>
3068
3069 * README: Remove claim that MEMORY is not supported.
3070 * expression.cc (script_exp_function_origin)
3071 (script_exp_function_length): Move from here to ...
3072 * script.cc: ... here.
3073 (script_set_section_region, script_add_memory)
3074 (script_parse_memory_attr, script_include_directive): New
3075 functions.
3076 * script-sections.cc
3077 (class Memory_region): New class.
3078 (class Output_section_definition): Add set_memory_region,
3079 set_section_vma, set_section_lma and get_section_name methods.
3080 (class Script_Sections): Add add_memory_region,
3081 find_memory_region, find_memory_region_origin,
3082 find_memory_region_length and set_memory_region methods.
3083 Have set_section_addresses method walk the list of set memory
3084 regions.
3085 Extend the print methos to display memory regions.
3086 * script-sections.h: Add prototypes for new methods.
3087 Add enum for MEMORY region attributes.
3088 * yyscript.y: Add support for parsing MEMORY regions.
3089 * script-c.h: Add prototypes for new functions.
3090 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3091 * testsuite/Makefile.in: Regenerate.
3092 * testsuite/memory_test.sh: New script.
3093 * testsuite/memory_test.s: New assembler source file.
3094 * testsuite/memory_test.t: New linker script.
3095
3096 2010-08-27 Doug Kwan <dougkwan@google.com>
3097
3098 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3099 reference override an existing dynamic weak reference.
3100 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3101 * testsuite/Makefile.in: Regenerate.
3102 * testsuite/dyn_weak_ref.sh: New file.
3103 * testsuite/dyn_weak_ref_1.c: Ditto.
3104 * testsuite/dyn_weak_ref_2.c: Ditto.
3105
3106 2010-08-27 Ian Lance Taylor <iant@google.com>
3107
3108 * incremental.h (class Incremental_input_entry): Add virtual
3109 destructor.
3110
3111 2010-08-27 Ian Lance Taylor <iant@google.com>
3112
3113 * testsuite/start_lib_test_3.c: Mark t3 as used.
3114
3115 2010-08-27 Nick Clifton <nickc@redhat.com>
3116
3117 * options.cc (version_script): Fix small typo in previous
3118 whitespace tidyup.
3119
3120 2010-08-25 Nick Clifton <nickc@redhat.com>
3121
3122 * archive.cc: Formatting fixes: Remove whitespace between
3123 typename and following asterisk. Remove whitespace between
3124 function name and opening parenthesis.
3125 * archive.h: Likewise.
3126 * arm.cc: Likewise.
3127 * attributes.cc: Likewise.
3128 * attributes.h: Likewise.
3129 * common.cc: Likewise.
3130 * copy-relocs.cc: Likewise.
3131 * dirsearch.h: Likewise.
3132 * dynobj.cc: Likewise.
3133 * ehframe.cc: Likewise.
3134 * ehframe.h: Likewise.
3135 * expression.cc: Likewise.
3136 * fileread.cc: Likewise.
3137 * fileread.h: Likewise.
3138 * gc.h: Likewise.
3139 * gold-threads.cc: Likewise.
3140 * gold.cc: Likewise.
3141 * i386.cc: Likewise.
3142 * icf.h: Likewise.
3143 * incremental-dump.cc: Likewise.
3144 * incremental.cc: Likewise.
3145 * layout.cc: Likewise.
3146 * layout.h: Likewise.
3147 * main.cc: Likewise.
3148 * merge.cc: Likewise.
3149 * merge.h: Likewise.
3150 * object.cc: Likewise.
3151 * object.h: Likewise.
3152 * options.cc: Likewise.
3153 * options.h: Likewise.
3154 * output.cc: Likewise.
3155 * output.h: Likewise.
3156 * plugin.cc: Likewise.
3157 * plugin.h: Likewise.
3158 * powerpc.cc: Likewise.
3159 * reloc.cc: Likewise.
3160 * script-c.h: Likewise.
3161 * script-sections.cc: Likewise.
3162 * script.cc: Likewise.
3163 * stringpool.cc: Likewise.
3164 * symtab.cc: Likewise.
3165 * symtab.h: Likewise.
3166 * target.cc: Likewise.
3167 * timer.cc: Likewise.
3168 * timer.h: Likewise.
3169 * version.cc: Likewise.
3170 * x86_64.cc: Likewise.
3171
3172 2010-08-24 Nick Clifton <nickc@redhat.com>
3173
3174 PR 11899
3175 * layout.cc (segment_precedes): Sort segments by their physical
3176 addresses, if they have been set.
3177
3178 2010-08-23 Cary Coutant <ccoutant@google.com>
3179
3180 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3181 symbols data.
3182 (Lib_group::include_member): Unlock object after deleting its
3183 symbols data.
3184 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3185 the bug fixed here.
3186
3187 2010-08-19 Neil Vachharajani <nvachhar@google.com>
3188 Cary Coutant <ccoutant@google.com>
3189
3190 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3191 constructor, and set_blocker.
3192 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3193 readsyms_blocker_.
3194 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3195 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3196 * testsuite/Makefile.am (start_lib_test): New test case.
3197 * testsuite/Makefile.in: Regenerate.
3198 * testsuite/start_lib_test_main.c: New file.
3199 * testsuite/start_lib_test_1.c: New file.
3200 * testsuite/start_lib_test_2.c: New file.
3201 * testsuite/start_lib_test_3.c: New file.
3202
3203 2010-08-19 Ian Lance Taylor <iant@google.com>
3204
3205 * Makefile.in: Rebuild with automake 1.11.1.
3206 * aclocal.m4: Likewise.
3207 * testsuite/Makefile.in: Likewise.
3208
3209 2010-08-19 Ian Lance Taylor <iant@google.com>
3210
3211 PR 10893
3212 * i386.cc (class Output_data_plt_i386): Update declarations.
3213 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3214 local_ifuncs_ fields.
3215 (Target_i386::do_plt_section_for_global): New function.
3216 (Target_i386::do_plt_section_for_local): New function.
3217 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3218 parameter; change all callers. Initialize global_ifuncs_ and
3219 local_ifuncs_. If doing a static link define __rel_iplt_start and
3220 __rel_iplt_end.
3221 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3222 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3223 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3224 symbols.
3225 (Target_i386::make_plt_section): New function, broken out of
3226 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3227 (Target_i386::make_plt_entry): Call make_plt_section.
3228 (Target_i386::make_local_ifunc_plt_entry): New function.
3229 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3230 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3231 R_386_IRELATIVE to switch.
3232 (Target_i386::Scan::global): Likewise.
3233 (Target_i386::Relocate::relocate): Likewise.
3234 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3235 switch.
3236 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3237 (Target_x86_64::do_plt_section_for_global): New function.
3238 (Target_x86_64::do_plt_section_for_local): New function.
3239 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3240 parameter; change all callers. If doing a static link define
3241 __rela_iplt_start and __rela_iplt_end.
3242 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3243 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3244 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3245 to point to .plt.
3246 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3247 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3248 switch.
3249 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3250 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3251 R_X86_64_IRELATIVE to switch.
3252 (Target_x86_64::Scan::global): Likewise.
3253 (Target_x86_64::Relocate::relocate): Likewise.
3254 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3255 switch.
3256 * target.h (class Target): Add plt_section_for_global and
3257 plt_section_for_local functions. Add do_plt_section_for_global
3258 and do_plt_section_for_local virtual functions.
3259 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3260 clarifying comments.
3261 (Symbol::use_plt_offset): Handle IFUNC symbol.
3262 * object.cc (Sized_relobj::Sized_relobj): Initialize
3263 local_plt_offsets_.
3264 (Sized_relobj::local_has_plt_offset): New function.
3265 (Sized_relobj::local_plt_offset): New function.
3266 (Sized_relobj::set_local_plt_offset): New function.
3267 (Sized_relobj::do_count): Handle IFUNC symbol.
3268 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3269 a bit away from input_shndx_ field. Add set_is_func_symbol and
3270 is_ifunc_symbol functions.
3271 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3272 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3273 local_plt_offsets_ field.
3274 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3275 * output.h (class Output_section_data): Add non-const
3276 output_section function.
3277 (class Output_data_got): Update declarations.
3278 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3279 Add use_plt_offset parameter to global and local constructors.
3280 Change all callers. Change local_sym_index_ field to 31 bits.
3281 Change GSYM_CODE and CONSTANT_CODE accordingly.
3282 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3283 doing a static link don't set sh_link field.
3284 (Output_data_got::Got_entry::write): Use PLT offset if
3285 appropriate.
3286 (Output_data_got::add_global_plt): New function.
3287 (Output_data_got::add_local_plt): New function.
3288 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3289 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3290 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3291 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3292 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3293 IFUNC conditional.
3294 * testsuite/ifunc-sel.h: New file.
3295 * testsuite/ifuncmain1.c: New file.
3296 * testsuite/ifuncmain1vis.c: New file.
3297 * testsuite/ifuncmod1.c: New file.
3298 * testsuite/ifuncdep2.c: New file.
3299 * testsuite/ifuncmain2.c: New file.
3300 * testsuite/ifuncmain3.c: New file.
3301 * testsuite/ifuncmod3.c: New file.
3302 * testsuite/ifuncmain4.c: New file.
3303 * testsuite/ifuncmain5.c: New file.
3304 * testsuite/ifuncmod5.c: New file.
3305 * testsuite/ifuncmain6pie.c: New file.
3306 * testsuite/ifuncmod6.c: New file.
3307 * testsuite/ifuncmain7.c: New file.
3308 * configure, testsuite/Makefile.in: Rebuild.
3309
3310 2010-08-18 Ian Lance Taylor <iant@google.com>
3311
3312 * incremental.cc
3313 (Output_section_incremental_inputs::write_input_files): Add cast
3314 to avoid signed/unsigned comparison warning.
3315 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3316
3317 2010-08-12 Cary Coutant <ccoutant@google.com>
3318
3319 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3320
3321 2010-08-13 Ian Lance Taylor <iant@google.com>
3322
3323 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3324
3325 2010-08-12 Cary Coutant <ccoutant@google.com>
3326 Doug Kwan <dougkwan@google.com>
3327
3328 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3329 defintion overrides non-weak undef, remember that the original undef
3330 is not weak.
3331 * symtab.cc (Symbol_table::sized_write_global): For undef without
3332 an original weak binding, set binding to global in output.
3333 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3334 * testsuite/Makefile.in: Regenerate.
3335 * testsuite/strong_ref_weak_def.sh: New file.
3336 * testsuite/strong_ref_weak_def_1.c: Ditto.
3337 * testsuite/strong_ref_weak_def_2.c: Ditto.
3338
3339 2010-08-12 Cary Coutant <ccoutant@google.com>
3340
3341 * testsuite/incremental_test.sh: Rewrite.
3342 * testsuite/incremental_test_1.c: Rewrite.
3343 * testsuite/incremental_test_2.c: Rewrite.
3344
3345 2010-08-12 Cary Coutant <ccoutant@google.com>
3346
3347 * arm.cc (Target_arm::got_size): Add const.
3348 (Target_arm::got_entry_count): New function.
3349 (Target_arm::plt_entry_count): New function.
3350 (Target_arm::first_plt_entry_offset): New function.
3351 (Target_arm::plt_entry_size): New function.
3352 (Output_data_plt_arm::entry_count): New function.
3353 (Output_data_plt_arm::first_plt_entry_offset): New function.
3354 (Output_data_plt_arm::get_plt_entry_size): New function.
3355 * i386.cc (Target_i386::got_size): Add const.
3356 (Target_i386::got_entry_count): New function.
3357 (Target_i386::plt_entry_count): New function.
3358 (Target_i386::first_plt_entry_offset): New function.
3359 (Target_i386::plt_entry_size): New function.
3360 (Output_data_plt_i386::entry_count): New function.
3361 (Output_data_plt_i386::first_plt_entry_offset): New function.
3362 (Output_data_plt_i386::get_plt_entry_size): New function.
3363 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3364 find_incremental_inputs_sections. Dump incremental_got_plt section.
3365 * incremental.cc: Include target.h.
3366 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3367 parameter. Adjust all callers. Find incremental_got_plt section.
3368 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3369 section.
3370 (Output_section_incremental_inputs::set_final_data_size): Calculate
3371 size of incremental_got_plt section.
3372 (Output_section_incremental_inputs::do_write): Write the
3373 incremental_got_plt section.
3374 (Got_plt_view_info): New struct.
3375 (Local_got_offset_visitor): New class.
3376 (Global_got_offset_visitor): New class.
3377 (Global_symbol_visitor_got_plt): New class.
3378 (Output_section_incremental_inputs::write_got_plt): New function.
3379 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3380 Add parameter. Adjust all callers.
3381 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3382 (Incremental_inputs::got_plt_section): New function.
3383 (Incremental_inputs::got_plt_section_): New data member.
3384 (Incremental_got_plt_reader): New class.
3385 * layout.cc (Layout::create_incremental_info_sections): Add the
3386 incremental_got_plt section.
3387 * object.h (Got_offset_list::get_list): New function.
3388 (Got offset_list::for_all_got_offsets): New function.
3389 (Sized_relobj::local_got_offset_list): New function.
3390 * powerpc.cc (Target_powerpc::got_size): Add const.
3391 (Target_powerpc::got_entry_count): New function.
3392 (Target_powerpc::plt_entry_count): New function.
3393 (Target_powerpc::first_plt_entry_offset): New function.
3394 (Target_powerpc::plt_entry_size): New function.
3395 (Output_data_plt_powerpc::entry_count): New function.
3396 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3397 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3398 * sparc.cc (Target_sparc::got_size): Add const.
3399 (Target_sparc::got_entry_count): New function.
3400 (Target_sparc::plt_entry_count): New function.
3401 (Target_sparc::first_plt_entry_offset): New function.
3402 (Target_sparc::plt_entry_size): New function.
3403 (Output_data_plt_sparc::entry_count): New function.
3404 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3405 (Output_data_plt_sparc::get_plt_entry_size): New function.
3406 * symtab.h (Symbol::got_offset_list): New function.
3407 (Symbol_table::for_all_symbols): New function.
3408 * target.h (Sized_target::got_entry_count): New function.
3409 (Sized_target::plt_entry_count): New function.
3410 (Sized_target::plt_entry_size): New function.
3411 * x86_64.cc (Target_x86_64::got_size): Add const.
3412 (Target_x86_64::got_entry_count): New function.
3413 (Target_x86_64::plt_entry_count): New function.
3414 (Target_x86_64::first_plt_entry_offset): New function.
3415 (Target_x86_64::plt_entry_size): New function.
3416 (Output_data_plt_x86_64::entry_count): New function.
3417 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3418 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3419
3420 2010-08-12 Cary Coutant <ccoutant@google.com>
3421
3422 * archive.cc: Include incremental.h.
3423 (Archive::Archive): Initialize incremental_info_.
3424 (Archive::include_member): Record archive members in incremental info.
3425 (Add_archive_symbols::run): Record begin and end of an archive in
3426 incremental info.
3427 (Lib_group::include_member): Record objects in incremental info.
3428 * archive.h (Incremental_archive_entry): Forward declaration.
3429 (Archive::set_incremental_info): New member function.
3430 (Archive::incremental_info): New member function.
3431 (Archive::Unused_symbol_iterator): New class.
3432 (Archive::unused_symbols_begin): New member function.
3433 (Archive::unused_symbols_end): New member function.
3434 (Archive::incremental_info_): New data member.
3435 * incremental-dump.cc (find_input_containing_global): New function.
3436 (dump_incremental_inputs): Dump new incremental info sections.
3437 * incremental.cc: Include symtab.h.
3438 (Output_section_incremental_inputs): New class.
3439 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3440 new incremental info sections.
3441 (Sized_incremental_binary::do_check_inputs): Likewise.
3442 (Incremental_inputs::report_archive): Remove.
3443 (Incremental_inputs::report_archive_begin): New function.
3444 (Incremental_inputs::report_archive_end): New function.
3445 (Incremental_inputs::report_object): New function.
3446 (Incremental_inputs::finalize_inputs): Remove.
3447 (Incremental_inputs::report_input_section): New function.
3448 (Incremental_inputs::report_script): Rewrite.
3449 (Incremental_inputs::finalize): Do nothing but finalize string table.
3450 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3451 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3452 (Incremental_inputs::create_data_sections): New function.
3453 (Incremental_inputs::relocs_entsize): New function.
3454 (Output_section_incremental_inputs::set_final_data_size): New function.
3455 (Output_section_incremental_inputs::do_write): New function.
3456 (Output_section_incremental_inputs::write_header): New function.
3457 (Output_section_incremental_inputs::write_input_files): New function.
3458 (Output_section_incremental_inputs::write_info_blocks): New function.
3459 (Output_section_incremental_inputs::write_symtab): New function.
3460 * incremental.h (Incremental_script_entry): Forward declaration.
3461 (Incremental_object_entry): Forward declaration.
3462 (Incremental_archive_entry): Forward declaration.
3463 (Incremental_inputs): Forward declaration.
3464 (Incremental_inputs_header_data): Remove.
3465 (Incremental_inputs_header): Remove.
3466 (Incremental_inputs_header_write): Remove.
3467 (Incremental_inputs_entry_data): Remove.
3468 (Incremental_inputs_entry): Remove.
3469 (Incremental_inputs_entry_write): Remove.
3470 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3471 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3472 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3473 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3474 Likewise.
3475 (Incremental_input_entry): New class.
3476 (Incremental_script_entry): New class.
3477 (Incremental_object_entry): New class.
3478 (Incremental_archive_entry): New class.
3479 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3480 (Incremental_inputs::report_inputs): Remove.
3481 (Incremental_inputs::report_archive): Remove.
3482 (Incremental_inputs::report_archive_begin): New function.
3483 (Incremental_inputs::report_archive_end): New function.
3484 (Incremental_inputs::report_object): Change prototype.
3485 (Incremental_inputs::report_input_section): New function.
3486 (Incremental_inputs::report_script): Change prototype.
3487 (Incremental_inputs::get_reloc_count): New function.
3488 (Incremental_inputs::set_reloc_count): New function.
3489 (Incremental_inputs::create_data_sections): New function.
3490 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3491 (Incremental_inputs::inputs_section): New function.
3492 (Incremental_inputs::symtab_section): New function.
3493 (Incremental_inputs::relocs_section): New function.
3494 (Incremental_inputs::get_stringpool): Add const.
3495 (Incremental_inputs::command_line): Add const.
3496 (Incremental_inputs::inputs): Remove.
3497 (Incremental_inputs::command_line_key): New function.
3498 (Incremental_inputs::input_file_count): New function.
3499 (Incremental_inputs::input_files): New function.
3500 (Incremental_inputs::relocs_entsize): New function.
3501 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3502 (Incremental_inputs::finalize_inputs): Remove.
3503 (Incremental_inputs::Input_info): Remove.
3504 (Incremental_inputs::lock_): Remove.
3505 (Incremental_inputs::inputs_): Change type.
3506 (Incremental_inputs::inputs_map_): Remove.
3507 (Incremental_inputs::current_object_entry_): New data member.
3508 (Incremental_inputs::inputs_section_): New data member.
3509 (Incremental_inputs::symtab_section_): New data member.
3510 (Incremental_inputs::relocs_section_): New data member.
3511 (Incremental_inputs::reloc_count_): New data member.
3512 (Incremental_inputs_reader): New class.
3513 (Incremental_symtab_reader): New class.
3514 (Incremental_relocs_reader): New class.
3515 * layout.cc (Layout::finalize): Move finalization of incremental info
3516 and creation of incremental info sections to follow finalization of
3517 symbol table. Set offsets for postprocessing sections.
3518 (Layout::create_incremental_info_sections): Call
3519 Incremental_inputs::create_data_sections. Add incremental symtab
3520 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3521 sections to layout after input sections.
3522 * layout.h (struct Timespec): Forward declaration.
3523 (Layout::incremental_inputs): Add const.
3524 (Layout::create_incremental_info_sections): Add parameter.
3525 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3526 * object.cc: Include incremental.h.
3527 (Relobj::finalize_incremental_relocs): New function.
3528 (Sized_relobj::do_layout): Record input sections in incremental info.
3529 * object.h (Object::output_section): New function.
3530 (Object::output_section_offset): Moved from Relobj.
3531 (Object::get_incremental_reloc_base): New function.
3532 (Object::get_incremental_reloc_count): New function.
3533 (Object::do_output_section): New function.
3534 (Object::do_output_section_offset): Moved from Relobj.
3535 (Object::do_get_incremental_reloc_base): New function.
3536 (Object::do_get_incremental_reloc_count): New function.
3537 (Object::Object): Initialize new data members.
3538 (Relobj::output_section): Renamed do_output_section and moved to
3539 protected.
3540 (Relobj::output_section_offset): Moved to Object.
3541 (Relobj::do_get_incremental_reloc_base): New function.
3542 (Relobj::do_get_incremental_reloc_count): New function.
3543 (Relobj::allocate_incremental_reloc_counts): New function.
3544 (Relobj::count_incremental_reloc): New function.
3545 (Relobj::finalize_incremental_relocs): New function.
3546 (Relobj::next_incremental_reloc_index): New function.
3547 (Relobj::reloc_counts_): New data member.
3548 (Relobj::reloc_bases_): New data member.
3549 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3550 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3551 (Sized_relobj::incremental_relocs_scan): New function.
3552 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3553 (Sized_relobj::incremental_relocs_write): New function.
3554 (Sized_relobj::incremental_relocs_write_reltype): New function.
3555 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3556 incremental link.
3557 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3558 archives and object files elsewhere.
3559 (Add_symbols::run): Report object files here.
3560 (Finish_group::run): Report end of archive at end of group.
3561 * reloc.cc: Include layout.h, incremental.h.
3562 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3563 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3564 (Sized_relobj::incremental_relocs_scan): New function.
3565 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3566 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3567 (Sized_relobj::incremental_relocs_write): New function.
3568 (Sized_relobj::incremental_relocs_write_reltype): New function.
3569 * script.cc (read_input_script): Rewrite test for incremental link.
3570 Change call to Incremental_inputs::report_script.
3571 * symtab.h (Symbol_table::first_global_index): New function.
3572 (Symbol_table::output_count): New function.
3573
3574 2010-08-12 Doug Kwan <dougkwan@google.com>
3575
3576 * arm.cc (Target_arm::merge_object_attributes): Check command line
3577 options --no-wchar-size-warning and --no-enum-size-warning.
3578 * options.h (General_options): Add ld-compatible options
3579 --no-enum-size-warning and --no-wchar-size-warning.
3580
3581 2010-08-04 Ian Lance Taylor <iant@google.com>
3582
3583 * x86_64.cc (Target_x86_64::Scan::local): Use
3584 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3585 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3586 (Target_x86_64::Scan::global): Likewise.
3587 (Target_x86_64::Relocate::relocate): Likewise.
3588 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3589 Likewise.
3590
3591 2010-08-03 Cary Coutant <ccoutant@google.com>
3592
3593 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3594 to reserve space in merged_strings vector. Keep total input size
3595 for stats.
3596 (Output_merge_string::do_print_merge_stats): Print total input size.
3597 * merge.h (Output_merge_string): Add input_size_ field.
3598 * stringpool.cc (Stringpool_template::string_length): Move
3599 implementations out of Stringpool_template class and place in
3600 stringpool.h.
3601 * stringpool.h (string_length): Move out of Stringpool_template.
3602
3603 2010-08-03 Ian Lance Taylor <iant@google.com>
3604
3605 PR 11712
3606 * layout.cc (relaxation_loop_body): If address of load segment is
3607 set, adjust address to include headers if possible.
3608
3609 2010-08-03 Ian Lance Taylor <iant@google.com>
3610
3611 * version.cc (version_string): Bump to 1.10.
3612
3613 2010-08-03 Ian Lance Taylor <iant@google.com>
3614
3615 PR 11805
3616 * layout.h (enum Output_section_order): Define.
3617 (class Layout): Update declarations.
3618 * layout.cc (Layout::get_output_section): Add order parameter.
3619 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3620 is_first_non_relro parameters. Change all callers.
3621 (Layout::choose_output_section): Likewise.
3622 (Layout::add_output_section_data): Likewise.
3623 (Layout::make_output_section): Likewise. Set order.
3624 (Layout::default_section_order): New function.
3625 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3626 * output.cc (Output_section::Output_section): Initialize order_.
3627 Don't initialize deleted fields.
3628 (Output_segment::Output_segment): Don't initialize deleted
3629 fields.
3630 (Output_segment::add_output_section_to_load): New function
3631 replacing add_output_section. Change all callers to call this or
3632 add_output_section_to_nonload.
3633 (Output_segment::add_output_section_to_nonload): New function.
3634 (Output_segment::remove_output_section): Rewrite.
3635 (Output_segment::add_initial_output_data): Likewise.
3636 (Output_segment::has_any_data_sections): Likewise.
3637 (Output_segment::is_first_section_relro): Likewise.
3638 (Output_segment::maximum_alignment): Likewise.
3639 (Output_segment::has_dynamic_reloc): New function replacing
3640 dynamic_reloc_count. Change all callers.
3641 (Output_segment::has_dynamic_reloc_list): New function replacing
3642 dynamic_reloc_count_list. Change all callers.
3643 (Output_segment::set_section_addresses): Rewrite.
3644 (Output_segment::set_offset): Rewrite.
3645 (Output_segment::find_first_and_last_list): Remove.
3646 (Output_segment::set_tls_offsets): Rewrite.
3647 (Output_segment::first_section_load_address): Likewise.
3648 (Output_segment::output_section_count): Likewise.
3649 (Output_segment::section_with_lowest_load_address): Likewise.
3650 (Output_segment::write_section_headers): Likewise.
3651 (Output_segment::print_sections_to_map): Likewise.
3652 * output.h (class Output_data): Remove dynamic_reloc_count_
3653 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3654 (Output_data::add_dynamic_reloc): Rewrite.
3655 (Output_data::has_dynamic_reloc): New function.
3656 (Output_data::dynamic_reloc_count): Remove.
3657 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3658 is_last_relro_, is_first_non_relro_, is_interp_,
3659 is_dynamic_linker_section_ fields. Add order and set_order
3660 functions. Remove is_relro_local, set_is_relro_local,
3661 is_last_relro, set_is_last_relro, is_first_non_relro,
3662 set_is_first_non_relro functions, is_interp, set_is_interp,
3663 is_dynamic_linker_section, and set_is_dynamic_linker_section
3664 functions.
3665 (class Output_segment): Change Output_data_list from std::list to
3666 std:;vector. Add output_lists_ field. Remove output_data_ and
3667 output_bss_ fields. Update declarations.
3668
3669 2010-08-02 Ian Lance Taylor <iant@google.com>
3670
3671 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3672 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3673 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3674
3675 2010-08-02 Ian Lance Taylor <iant@google.com>
3676
3677 PR 11855
3678 * script.cc (Script_options::Script_options): Initialize
3679 symbol_definitions_ and symbol_references_.
3680 (Script_options::add_symbol_assignment): Update
3681 symbol_definitions_ and symbol_references_.
3682 (Script_options::add_symbol_reference): New function.
3683 (script_symbol): New function.
3684 * script.h (class Script_options): Add symbol_definitions_ and
3685 symbol_references_ fields.
3686 (Script_options::referenced_const_iterator): New type.
3687 (Script_options::referenced_begin): New function.
3688 (Script_options::referenced_end): New function.
3689 (Script_options::is_referenced): New function.
3690 (Script_options::any_unreferenced): New function.
3691 * script-c.h (script_symbol): Declare.
3692 * yyscript.y (exp): Call script_symbol.
3693 * symtab.cc: Include "script.h".
3694 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3695 Change all callers. Check symbols referenced by scripts.
3696 (Symbol_table::add_undefined_symbols_from_command_line): Add
3697 layout parameter. Change all callers.
3698 (Symbol_table::do_add_undefined_symbols_from_command_line):
3699 Likewise. Break out loop body. Check symbols referenced by
3700 scripts.
3701 (Symbol_table::add_undefined_symbol_from_command_line): New
3702 function broken out of
3703 do_add_undefined_symbols_from_command_line.
3704 * symtab.h (class Symbol_table): Update declarations.
3705 * archive.cc: Include "layout.h".
3706 (Archive::should_include_member): Add layout parameter. Change
3707 all callers. Check for symbol mentioned in expression.
3708 * archive.h (class Archive): Update declaration.
3709 * object.cc (Sized_relobj::do_should_include_member): Add layout
3710 parameter.
3711 * object.h (Object::should_include_member): Add layout parameter.
3712 Change all callers.
3713 (Object::do_should_include_member): Add layout parameter.
3714 (class Sized_relobj): Update declaration.
3715 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3716 parameter.
3717 * dynobj.h (class Sized_dynobj): Update declaration.
3718 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3719 layout parameter.
3720 * plugin.h (class Sized_pluginobj): Update declaration.
3721
3722 2010-08-02 Ian Lance Taylor <iant@google.com>
3723
3724 PR 11866
3725 * output.cc (Output_segment::set_offset): Search for the first and
3726 last sections rather than assuming that the list is in order.
3727 (Output_segment::find_first_and_last_list): New function.
3728 * output.h (class Output_segment): Update declarations.
3729 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3730 (relro_strip_test_SOURCES): New variable.
3731 (relro_strip_test_DEPENDENCIES): New variable.
3732 (relro_strip_test_LDFLAGS): New variable.
3733 (relro_strip_test_LDADD): New variable.
3734 (relro_strip_test.so): New target.
3735
3736 2010-08-02 Ian Lance Taylor <iant@google.com>
3737
3738 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3739 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3740 (Target_i386::got_tlsdesc_section): New function.
3741 (Target_i386::got_section): Create space for GOT entries for
3742 TLSDESC relocations.
3743 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3744 R_386_TLS_GOTDESC.
3745 (Target_i386::Scan::global): Likewise.
3746 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3747 using TLSDESC GOT.
3748 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3749 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3750 (Target_x86_64::got_tlsdesc_section): New function.
3751 (Target_x86_64::got_section): Create space for GOT entries for
3752 TLSDESC relocations.
3753 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3754 R_386_TLS_GOTDESC.
3755 (Target_x86_64::Scan::global): Likewise.
3756 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3757 using TLSDESC GOT.
3758
3759 2010-08-02 Ian Lance Taylor <iant@google.com>
3760
3761 * testsuite/final_layout.sh: Use dc to convert from hex to
3762 decimal.
3763
3764 2010-07-29 Sriraman Tallam <tmsriram@google.com>
3765
3766 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3767 paramter to the call to gold::gc_process_relocs.
3768 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3769 paramter to the call to gold::gc_process_relocs.
3770 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3771 parameter to the call to gold::gc_process_relocs.
3772 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3773 template parameter to the call to gold::gc_process_relocs.
3774 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3775 paramter to the call to gold::gc_process_relocs.
3776 * gc.h (get_embedded_addend_size): New function.
3777 (gc_process_relocs): Save the size of the reloc for use by ICF.
3778 * icf.cc (get_section_contents): Get the addend from the text section
3779 for SHT_REL relocation sections.
3780 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3781 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3782 * int_encoding.h (read_from_pointer): New overloaded function.
3783 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3784 * testsuite/icf_sht_rel_addend_test.sh: New file.
3785 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3786 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3787
3788 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3789
3790 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3791 * Makefile.in: Regenerate.
3792 * testsuite/Makefile.in: Regenerate.
3793
3794 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3795
3796 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3797 * gold/testsuite/debug_msg.cc: Likewise.
3798 * gold/testsuite/odr_violation1.cc
3799 * gold/testsuite/odr_violation2.cc
3800
3801 2010-07-21 Cary Coutant <ccoutant@google.com>
3802
3803 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3804 string, and length fields.
3805 (Output_merge_string::Merged_strings_list): New type.
3806 (Output_merge_string::Merged_strings_lists): New typedef.
3807 (Output_merge_string): Replace merged_strings_ with
3808 merged_strings_lists_.
3809 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3810 Merged_strings_list per input object and section. Don't store pointer
3811 to the string. Don't store length with each merged string entry.
3812 (Output_merge_string::finalize_merged_data): Loop over list of merged
3813 strings lists. Recompute length of each merged string.
3814
3815 2010-07-15 Cary Coutant <ccoutant@google.com>
3816
3817 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3818 here.
3819
3820 2010-07-14 Ian Lance Taylor <iant@google.com>
3821
3822 * descriptors.cc (Descriptors::open): Report correct name in error
3823 message.
3824
3825 2010-07-13 Doug Kwan <dougkwan@google.com>
3826
3827 * arm.cc (Arm_input_section::Arm_input_section): For a
3828 SHT_ARM_EXIDX section, always keeps the input sections.
3829 (Arm_input_section::set_exidx_section_link): New method.
3830 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3831 has_errors_ to false.
3832 (Arm_exidx_input_section::has_errors,
3833 Arm_exidx_input_section::set_has_errors): New methods.
3834 (Arm_exidx_input_section::has_errors_): New data member.
3835 (Arm_relobj::get_exidx_shndx_list): New method.
3836 (Arm_output_section::append_text_sections_to_list): Do not skip
3837 section without SHF_EXECINSTR.
3838 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3839 errors.
3840 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3841 section header. Make error messages more verbose. Check for
3842 a non-executable section linked to an EXIDX section.
3843 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3844 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3845 check that there is no deferred EXIDX section if we exit early.
3846 Instead of not making an EXIDX section in case of an error, make one
3847 and set the has_errors flag of it.
3848 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3849 in a relocatable link.
3850 (Target_arm::do_relax): Look for the EXIDX output section instead of
3851 assuming that it is called .ARM.exidx.
3852 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3853 section list. Do not check for SHF_EXECINSTR section flags but
3854 skip any input section with errors.
3855 * output.cc (Output_section::Output_section): Initialize
3856 always_keeps_input_sections_ to false.
3857 (Output_section::add_input_section): Check for
3858 always_keeps_input_sections_.
3859 * output.h (Output_section::always_keeps_input_sections,
3860 Output_section::set_always_keeps_input_sections): New methods.
3861 (Output_section::always_keeps_input_sections): New data member.
3862
3863 2010-07-13 Rafael Espindola <espindola@google.com>
3864
3865 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3866 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3867
3868 2010-07-13 Philip Herron <herron.philip@googlemail.com>
3869 Ian Lance Taylor <iant@google.com>
3870
3871 * output.h (Output_section_lookup_maps::add_merge_section):
3872 Correct check of whether value was inserted.
3873 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3874 (Output_section_lookup_maps::add_relaxed_input_section):
3875 Likewise.
3876 * arm.cc (Target_arm::got_section): Remove used local os.
3877 * i386.cc (Target_i386::got_section): Likewise.
3878 * x86_64.cc (Target_x86_64::got_section): Likewise.
3879 * sparc.cc (Target_sparc::got_section): Likewise.
3880 (Target_sparc::relocate): Remove unused local have_got_offset.
3881 * powerpc.cc (Target_powerpc::relocate): Likewise.
3882
3883 2010-07-13 Ian Lance Taylor <iant@google.com>
3884
3885 * compressed_output.cc (zlib_decompress): Fix signature in
3886 !HAVE_ZLIB_H case.
3887
3888 * archive.cc (Archive::include_member): Unlock an external member
3889 of a thin archive. Don't bother to delete an object we know is
3890 NULL.
3891
3892 2010-07-12 Cary Coutant <ccoutant@google.com>
3893
3894 * compressed_output.cc (zlib_decompress): New function.
3895 (get_uncompressed_size): New function.
3896 (decompress_input_section): New function.
3897 * compressed_output.h (get_uncompressed_size): New function.
3898 (decompress_input_section): New function.
3899 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3900 Handle compressed debug sections.
3901 * layout.cc (is_compressed_debug_section): New function.
3902 (Layout::output_section_name): Map compressed section names to
3903 canonical names.
3904 * layout.h (is_compressed_debug_section): New function.
3905 (is_debug_info_section): Recognize compressed debug sections.
3906 * merge.cc: Include compressed_output.h.
3907 (Output_merge_data::do_add_input_section): Handle compressed
3908 debug sections.
3909 (Output_merge_string::do_add_input_section): Handle compressed
3910 debug sections.
3911 * object.cc: Include compressed_output.h.
3912 (Sized_relobj::Sized_relobj): Initialize new data members.
3913 (build_compressed_section_map): New function.
3914 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3915 * object.h (Object::section_is_compressed): New method.
3916 (Object::do_section_is_compressed): New method.
3917 (Sized_relobj::Compressed_section_map): New type.
3918 (Sized_relobj::do_section_is_compressed): New method.
3919 (Sized_relobj::compressed_sections_): New data member.
3920 * output.cc (Output_section::add_input_section): Handle compressed
3921 debug sections.
3922 * reloc.cc: Include compressed_output.h.
3923 (Sized_relobj::write_sections): Handle compressed debug sections.
3924
3925 2010-07-08 Cary Coutant <ccoutant@google.com>
3926
3927 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3928 weak when resolving to a dynamic def.
3929 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3930 for weak undef/dynamic def cases. Adjust callers.
3931 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3932 undef_binding_weak_.
3933 (Symbol_table::sized_write_globals): Adjust symbol binding.
3934 (Symbol_table::sized_write_symbol): Add binding parameter.
3935 * symtab.h (Symbol::set_undef_binding): New method.
3936 (Symbol::is_undef_binding_weak): New method.
3937 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3938 (Symbol_table::should_override): Add new parameter.
3939 (Symbol_table::sized_write_symbol): Add new parameter.
3940
3941 * testsuite/weak_undef_file1.cc: Add new test case.
3942 * testsuite/weak_undef_file2.cc: Fix header comment.
3943 * testsuite/weak_undef_test.cc: Add new test case.
3944
3945 2010-06-29 Doug Kwan <dougkwan@google.com>
3946
3947 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3948 Initialize USE_SYMBOL_.
3949 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3950 definition.
3951 (Arm_reloc_property::uses_symbol_): New data member declaration.
3952 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3953 uses symbol value and symbol is undefined but not weakly undefined.
3954
3955 2010-06-28 Rafael Espindola <espindola@google.com>
3956
3957 * plugin.cc (Plugin::load): Use dlerror.
3958
3959 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3960
3961 * symtab.cc (detect_odr_violations): When reporting an ODR
3962 violation, report an object where the symbol is defined.
3963
3964 2010-06-25 Doug Kwan <dougkwan@google.com>
3965
3966 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3967 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3968 definition.
3969 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3970 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3971 target hook to detect function points.
3972 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3973 * icf.h (Icf::check_section_for_function_pointers): Change type of
3974 parameter SECTION_NAME to const reference to std::string. Use
3975 target hook to determine if section may have unsafe pointers.
3976 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3977 method definition.
3978
3979 2010-06-21 Rafael Espindola <espindola@google.com>
3980
3981 * fileread.cc (Input_file::find_fie): New
3982 (Input_file::open): Use Input_file::find_fie.
3983 * fileread.h (Input_file::find_fie): New
3984 * plugin.cc (set_extra_library_path): New.
3985 (Plugin::load): Add set_extra_library_path to the transfer vector.
3986 (Plugin_manager::set_extra_library_path): New.
3987 (Plugin_manager::add_input_file): Use the extra search path if set.
3988 (set_extra_library_path(): New.
3989 * plugin.h (Plugin_manager): Add set_extra_library_path and
3990 extra_search_path_.
3991
3992 2010-06-19 Cary Coutant <ccoutant@google.com>
3993
3994 * layout.cc (gdb_sections): Add .debug_types.
3995 (lines_only_debug_sections): Likewise.
3996
3997 2010-06-18 Rafael Espindola <espindola@google.com>
3998
3999 * plugin.cc (add_input_file,add_input_library)
4000 (Plugin_manager::add_input_file): Make filename arguments const.
4001 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4002 const.
4003
4004 2010-06-16 Doug Kwan <dougkwan@google.com>
4005
4006 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4007 .ARM.attributes section if we have not merged any input
4008 attributes sections.
4009
4010 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4011
4012 * arm.cc: Allow combining objects with no EABI version
4013 information.
4014
4015 2010-06-15 Rafael Espindola <espindola@google.com>
4016
4017 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4018
4019 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4020
4021 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4022 (struct iovec): Correct !HAVE_READV definition.
4023
4024 2010-06-10 Cary Coutant <ccoutant@google.com>
4025
4026 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4027 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4028 reloc sections.
4029 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4030
4031 PR 11683
4032 * symtab.h (Symbol::is_placeholder): New member function.
4033 * target-reloc.h (relocate_section): Check for placeholder symbols.
4034
4035 * testsuite/Makefile.am (plugin_test_8): New test.
4036 (plugin_test_9): New test.
4037 * testsuite/Makefile.in: Regenerate.
4038
4039 2010-06-09 Nick Clifton <nickc@redhat.com>
4040
4041 * yyscript.y (input_list_element): Allow strings prefixed with
4042 the '-' character. Treat these as libraries.
4043 * script.cc (script_add_library): New function. Adds a library
4044 specified by "-l<name>" found in an input script.
4045 * script-c.h: Add prototype for script_add_library.
4046
4047 2010-06-07 Doug Kwan <dougkwan@google.com>
4048
4049 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4050 Restrict stub-group size to be within long conditional branch
4051 range when working around cortex-A8 erratum.
4052
4053 2010-06-07 Damien Diederen <dd@crosstwine.com>
4054
4055 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4056 #ifdef typo.
4057
4058 2010-06-03 Sriraman Tallam <tmsriram@google.com>
4059
4060 PR gold/11658
4061 * output.cc
4062 (Output_section::Input_section_sort_entry::compare_section_ordering):
4063 Change to return non-zero correctly.
4064 (Output_section::Input_section_sort_section_order_index_compare
4065 ::operator()): Change to fix ambiguity in comparisons.
4066
4067 2010-06-01 Sriraman Tallam <tmsriram@google.com>
4068
4069 * gold.h (is_wildcard_string): New function.
4070 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4071 (Layout::layout_eh_frame): Ditto.
4072 (Layout::find_section_order_index): New method.
4073 (Layout::read_layout_from_file): New method.
4074 * layout.h (Layout::find_section_order_index): New method.
4075 (Layout::read_layout_from_file): New method.
4076 (Layout::input_section_position_): New private member.
4077 (Layout::input_section_glob_): New private member.
4078 * main.cc (main): Call read_layout_from_file here.
4079 * options.h (--section-ordering-file): New option.
4080 * output.cc (Output_section::input_section_order_specified_): New
4081 member.
4082 (Output_section::Output_section): Initialize new member.
4083 (Output_section::add_input_section): Add new parameter.
4084 Keep input sections when --section-ordering-file is used.
4085 (Output_section::set_final_data_size): Sort input sections when
4086 section ordering file is specified.
4087 (Output_section::Input_section_sort_entry): Add new parameter.
4088 Check sorting type.
4089 (Output_section::Input_section_sort_entry::compare_section_ordering):
4090 New method.
4091 (Output_section::Input_section_sort_compare::operator()): Change to
4092 consider section_order_index.
4093 (Output_section::Input_section_sort_init_fini_compare::operator()):
4094 Change to consider section_order_index.
4095 (Output_section::Input_section_sort_section_order_index_compare
4096 ::operator()): New method.
4097 (Output_section::sort_attached_input_sections): Change to sort
4098 according to section order when specified.
4099 (Output_section::add_input_section<32, true>): Add new parameter.
4100 (Output_section::add_input_section<64, true>): Add new parameter.
4101 (Output_section::add_input_section<32, false>): Add new parameter.
4102 (Output_section::add_input_section<64, false>): Add new parameter.
4103 * output.h (Output_section::add_input_section): Add new parameter.
4104 (Output_section::input_section_order_specified): New
4105 method.
4106 (Output_section::set_input_section_order_specified): New method.
4107 (Input_section::Input_section): Initialize section_order_index_.
4108 (Input_section::section_order_index): New method.
4109 (Input_section::set_section_order_index): New method.
4110 (Input_section::section_order_index_): New member.
4111 (Input_section::Input_section_sort_section_order_index_compare): New
4112 struct.
4113 (Output_section::input_section_order_specified_): New member.
4114 * script-sections.cc (is_wildcard_string): Delete and move modified
4115 method to gold.h.
4116 (Output_section_element_input::Output_section_element_input): Modify
4117 call to is_wildcard_string.
4118 (Output_section_element_input::Input_section_pattern
4119 ::Input_section_pattern): Ditto.
4120 (Output_section_element_input::Output_section_element_input): Ditto.
4121 * testsuite/Makefile.am (final_layout): New test case.
4122 * testsuite/Makefile.in: Regenerate.
4123 * testsuite/final_layout.cc: New file.
4124 * testsuite/final_layout.sh: New file.
4125
4126 2010-06-01 Rafael Espindola <espindola@google.com>
4127
4128 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4129
4130 2010-06-01 Rafael Espindola <espindola@google.com>
4131
4132 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4133 visibility of symbols.
4134
4135 2010-05-27 Doug Kwan <dougkwan@google.com>
4136
4137 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4138 from start of output section instead of address for a local symbol
4139 in a merged or relaxed section when doing a relocatable link.
4140
4141 2010-05-26 Rafael Espindola <espindola@google.com>
4142
4143 PR 11604
4144 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4145 adding sections the garbage collector removed.
4146 * gold/testsuite/Makefile.am: Add test.
4147 * gold/testsuite/Makefile.in: Regenerate.
4148 * gold/testsuite/plugin_test_7.sh: New.
4149 * gold/testsuite/plugin_test_7_1.c: New.
4150 * gold/testsuite/plugin_test_7_2.c: New.
4151
4152 2010-05-26 Rafael Espindola <espindola@google.com>
4153
4154 * script-sections.cc (Output_section_definition::set_section_addresses):
4155 Check for --section-start.
4156
4157 2010-05-26 Doug Kwan <dougkwan@google.com>
4158
4159 * arm.cc (Arm_scan_relocatable_relocs): New class.
4160 (Target_arm::relocate_special_relocatable): New method.
4161 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4162 (Arm_relocate_functions::thumb_branch_common): Same.
4163 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4164 instead of Default_scan_relocatable_relocs.
4165 * target-reloc.h (relocate_for_relocatable): Let target handle
4166 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4167 * target.h (Sized_target::relocate_special_relocatable): New method.
4168
4169 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4170
4171 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4172
4173 2010-05-23 Doug Kwan <dougkwan@google.com>
4174
4175 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4176 instead of a cast.
4177 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4178 with a direct branch, not a conditional branch, to a stub.
4179 * merge.cc (Output_merge_base::record_input_section): New method
4180 defintion.
4181 (Output_merge_data::do_add_input_section): Record input section if
4182 keeps-input-sections flag is set.
4183 (Output_merge_string::do_add_input_section): Ditto.
4184 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4185 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4186 INPUT_SECTIONS_.
4187 (Output_merge_base::keeps_input_sections,
4188 Output_merge_base::set_keeps_input_sections,
4189 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4190 method definitions.
4191 (Output_merge_base::Input_sections): New type declaration.
4192 (Output_merge_base::input_sections_begin,
4193 Output_merge_base::input_sections_end,
4194 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4195 (Output_merge_base::bool keeps_input_sections_,
4196 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4197 Output_merge_base::input_sections_): New data members.
4198 (Output_merge_data::do_set_keeps_input_sections): New method
4199 defintion.
4200 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4201 * output.cc (Output_section::Input_section::relobj): Move method
4202 defintion from class declaration to here and handle merge sections.
4203 (Output_section::Input_section::shndx): Ditto.
4204 (Output_section::Output_section): Remove initializations of removed
4205 data members and initialize new data member LOOKUP_MAPS_.
4206 (Output_section::add_input_section): Set keeps-input-sections flag
4207 for a newly created merge output section as appropriate. Adjust code
4208 to use Output_section_lookup_maps class.
4209 (Output_section::add_relaxed_input_section): Adjst code for lookup
4210 maps code refactoring.
4211 (Output_section::add_merge_input_section): Add a new parameter
4212 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4213 class. If adding input section to a newly created merge output
4214 section fails, remove the new merge section.
4215 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
4216 Adjust code for use of the Output_section_lookup_maps class.
4217 (Output_section::find_merge_section): Ditto.
4218 (Output_section::build_lookup_maps): New method defintion.
4219 (Output_section::find_relaxed_input_section): Adjust code to use
4220 Output_section_lookup_maps class.
4221 (Output_section::get_input_sections): Export merge sections. Adjust
4222 code to use Output_section_lookup_maps class.
4223 (Output_section:::add_script_input_section): Adjust code to use
4224 Output_section_lookup_maps class. Update lookup maps for merge
4225 sections also.
4226 (Output_section::discard_states): Use Output_section_lookup_maps.
4227 (Output_section::restore_states): Same.
4228 * output.h (Merge_section_properties): Move class defintion out of
4229 Output_section.
4230 (Output_section_lookup_maps): New class.
4231 (Output_section::Input_section::is_merge_section): New method
4232 defintion.
4233 (Output_section::Input_section::relobj): Move defintion out of class
4234 defintion. Declare method only.
4235 (Output_section::Input_section::shndx): Ditto.
4236 (Output_section::Input_section::output_merge_base): New method defintion.
4237 (Output_section::Input_section::u2_.pomb): New union field.
4238 (Output_section::Merge_section_by_properties_map,
4239 Output_section::Output_section_data_by_input_section_map,
4240 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4241 Remove types.
4242 (Output_section::add_merge_input_section): Add new parameter
4243 KEEPS_INPUT_SECTIONS.
4244 (Output_section::build_lookup_maps): New method declaration.
4245 (Output_section::merge_section_map_,
4246 Output_section::merge_section_by_properties_map_,
4247 Output_section::relaxed_input_section_map_,
4248 Output_section::is_relaxed_input_section_map_valid_): Remove data
4249 members.
4250 (Output_section::lookup_maps_): New data member.
4251
4252 2010-05-21 Doug Kwan <dougkwan@google.com>
4253
4254 PR gold/11619
4255 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4256 avoid a compilation error.
4257
4258 2010-05-19 Rafael Espindola <espindola@google.com>
4259
4260 * script-sections.cc (Output_section_definition::allocate_to_segment):
4261 Update the phdrs_list even when the output section is NULL.
4262 * testsuite/Makefile.am: Add test.
4263 * testsuite/Makefile.in: Regenerate.
4264 * testsuite/script_test_9.cc: New.
4265 * testsuite/script_test_9.sh: New.
4266 * testsuite/script_test_9.t: New.
4267
4268 2010-05-19 Doug Kwan <dougkwan@google.com>
4269
4270 * arm.cc (Arm_input_section::original_size): New method.
4271 (Arm_input_section::do_addralign): Add a cast.
4272 (Arm_input_section::do_output_offset): Remove static cast.
4273 (Arm_input_section::original_addralign,
4274 Arm_input_section::original_size_): Change type to uint32_t.
4275 (Arm_input_section::init): Add safe casts for section alignment
4276 and size.
4277 (Arm_input_section::set_final_data_size): Do not set address and
4278 offset of stub table.
4279 (Arm_output_section::fix_exidx_coverage): Change use of of
4280 Output_section::Simple_input_section to that of
4281 Output_section::Input_section.
4282 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4283 except for the first pass.
4284 * output.cc (Output_section::get_input_sections): Change type of
4285 input_sections to std::list<Input_section>.
4286 (Output_section::add_script_input_section): Rename from
4287 Output_section::add_simple_input_section. Change type of SIS
4288 parameter from Simple_input_section to Input_section.
4289 * output.h (Output_section::Simple_input_section): Remove class.
4290 (Output_section::Input_section): Change class visibility to public.
4291 (Output_section::Input_section::addralign): Use stored alignments
4292 for special input sections if set.
4293 (Output_section::Input_section::set_addralign): New method.
4294 (Output_section::get_input_sections): Change parameter type from
4295 list of Simple_input_section to list of Input_section.
4296 (Output_section::add_script_input_section): Rename from
4297 Output_section::add_simple_input_section. Change first parameter's
4298 type from Simple_input_section to Input_section and remove the
4299 second and third parameters.
4300 * script-sections.cc (Input_section::Input_section_list): Change
4301 type to list of Output_section::Input_section/
4302 (Input_section_info::Input_section_info): Change parameter type of
4303 INPUT_SECTION to Output_section::Input_section.
4304 (Input_section_info::input_section): Change return type.
4305 (Input_section_info::input_section_): Change type to
4306 Output_section::Input_section.
4307 (Output_section_element_input::set_section_addresses): Adjust code
4308 to use Output_section::Input_section instead of
4309 Output_section::Simple_input_section. Adjust code for renaming
4310 of Output_section::add_simple_input_section.
4311 (Orphan_output_section::set_section_addresses): Ditto.
4312
4313 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4314
4315 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4316 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4317
4318 2010-05-18 Rafael Espindola <espindola@google.com>
4319
4320 * options.cc (General_options::finalize): Handle -nostdlib.
4321 * options.h (nostdlib): New option.
4322 * script.cc (script_add_search_dir): Handle -nostdlib.
4323
4324 2010-05-12 Doug Kwan <dougkwan@google.com>
4325
4326 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4327 attributes section only if there no attributes section after merging.
4328 (Target_arm::merge_object_attributes): Move value of
4329 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
4330 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4331 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4332 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4333 and arm_attr_merge_7.stdout.
4334 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4335 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4336 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4337 arm_attr_merge_7b.o): New rules.
4338 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4339 arm_attr_merge_7
4340 * testsuite/Makefile.in: Regenerate.
4341 * testsuite/arm_attr_merge.sh: New file.
4342 * testsuite/arm_attr_merge_[67][ab].s: Same.
4343
4344 2010-05-05 Nick Clifton <nickc@redhat.com>
4345
4346 * po/es.po: Updated Spanish translation.
4347
4348 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4349
4350 * Makefile.am (install-exec-local): Properly install gold as
4351 default cross linker.
4352 * Makefile.in: Regenerated.
4353
4354 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4355 Nick Clifton <nickc@redhat.com>
4356
4357 * configure.ac (install_as_default): Define and set to false
4358 unless --enable-gold or --enable-gold=both/gold has been
4359 specified.
4360 * configure: Regenerate.
4361
4362 * Makefile.am (install-exec-local): Install the executable as
4363 'ld.gold'. If install_as_default is true then also install it as
4364 'ld'.
4365 * Makefile.in: Regenerated.
4366
4367 2010-04-24 Ian Lance Taylor <iant@google.com>
4368
4369 * layout.cc (Layout::layout_reloc): In relocatable link don't
4370 combine reloc sections for grouped sections.
4371
4372 2010-04-23 Sriraman Tallam <tmsriram@google.com>
4373
4374 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4375 sections that are not ordinary to icf.
4376 * icf.cc (get_section_contents): Handle relocation pointing to section
4377 with no object or shndx information.
4378 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4379 * testsuite/Makefile.in: Regenerate.
4380 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4381 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4382
4383 2010-04-22 Ian Lance Taylor <iant@google.com>
4384
4385 * expression.cc (Expression::Expression_eval_info): Add
4386 result_alignment_pointer field.
4387 (Expression::eval_with_dot): Add result_alignment_pointer
4388 parameter. Change all callers.
4389 (Expression::eval_maybe_dot): Likewise.
4390 (class Binary_expression): Add alignment_pointer parameter to
4391 left_value and right_value. Change all callers.
4392 (BINARY_EXPRESSION): Set result alignment.
4393 (class Trinary_expression): Add alignment_pointer parameter to
4394 arg2_value and arg3_value. Change all callers.
4395 (Trinary_cond::value): Set result alignment.
4396 (Max_expression::value, Min_expression::value): Likewise.
4397 (Align_expression::value): Likewise.
4398 * script-sections.cc (class Sections_element): Add dot_alignment
4399 parameter to set_section_addresses virtual function. Update
4400 instantiations.
4401 (class Output_section_element): Likewise.
4402 (Script_sections::create_segments): Add dot_alignment parameter.
4403 Change all callers.
4404 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4405 (Script_sections::set_phdrs_clause_addresses): Likewise.
4406 * script-sections.h: Update declarations.
4407 * script.h: Update declarations.
4408 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4409 min_p_align.
4410 * testsuite/script_test_3.t: Set large alignment.
4411 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4412 segment has expected alignment.
4413
4414 2010-04-22 Nick Clifton <nickc@redhat.com>
4415
4416 * po/gold.pot: Updated by the Translation project.
4417 * po/vi.po: Updated Vietnamese translation.
4418
4419 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4420
4421 * testsuite/Makefile.am (check_PROGRAMS): Add
4422 icf_virtual_function_folding_test.
4423 * testsuite/Makefile.in: Regenerated.
4424
4425 2010-04-15 Andrew Haley <aph@redhat.com>
4426
4427 * options.h (merge_exidx_entries): New option.
4428 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4429 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4430 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4431 (Target_arm::merge_exidx_entries): New function.
4432 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4433 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4434 to Arm_exidx_fixup constructor.
4435 Add new arg, merge_exidx_entries.
4436 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4437 Arm_output_section::fix_exidx_coverage.
4438
4439 2010-04-18 Sriraman Tallam <tmsriram@google.com>
4440
4441 * icf.cc (get_section_contents): Check for preemptible functions.
4442 Ignore addend when appropriate.
4443 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4444 section folded.
4445 (add_from_relobj): Check for section folded.
4446 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4447 * symtab.h (should_add_dynsym_entry): Add new parameter.
4448 * target-reloc.h (scan_relocs): Check for section folded.
4449 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4450 Check reloc types for function pointers in shared objects.
4451 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4452 case.
4453 (icf_preemptible_functions_test): New test case.
4454 (icf_string_merge_test): New test case.
4455 * testsuite.Makefile.in: Regenerate.
4456 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4457 bar_glob. Refactor code.
4458 * testsuite/icf_preemptible_functions_test.cc: New file.
4459 * testsuite/icf_preemptible_functions_test.sh: New file.
4460 * testsuite/icf_string_merge_test.cc: New file.
4461 * testsuite/icf_string_merge_test.sh: New file.
4462 * testsuite/icf_virtual_function_folding_test.cc: New file.
4463 * testsuite/icf_virtual_function_folding_test.sh: New file.
4464
4465 2010-04-14 Doug Kwan <dougkwan@google.com>
4466
4467 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4468 for local symbol recounting if we remove a section due to ICF.
4469 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4470 there are no regular objects in input.
4471
4472 2010-04-13 Doug Kwan <dougkwan@google.com>
4473
4474 * arm.cc (Arm_input_section::set_final_data_size): Compute
4475 accurate final data size instead of using current data size.
4476
4477 2010-04-09 Doug Kwan <dougkwan@google.com>
4478
4479 * layout.cc (Layout::choose_output_section): Handle script section
4480 types.
4481 (Layout::make_output_section_for_script): Add section type parameter.
4482 Handle script section types.
4483 * layout.h (Layout::make_output_section_for_script): Add section
4484 type parameter.
4485 * output.cc (Output_section::Output_section): Initialize data member
4486 is_noload_.
4487 (Output_section::do_reset_address_and_file_offset): Do not set address
4488 to 0 if section is a NOLOAD section.
4489 * output.h (Output_section::is_noload): New method.
4490 (Output_section::set_is_noload): Ditto.
4491 (Output_section::is_noload_): New data member.
4492 * script-c.h (Script_section_type): New enum type.
4493 (struct Parser_output_section_header): Add new file section_type.
4494 * script-sections.cc (Sections_element::output_section_name): Add
4495 parameter for returning script section type.
4496 (Output_section_definition::output_section_name): Ditto.
4497 (Output_section_definition::section_type)P; New method.
4498 (Output_section_definiton::script_section_type_name): Ditto.
4499 (Output_section_definition::script_section_type_): New data member.
4500 (Output_section_definition::Output_section_definition): Initialize
4501 data member Output_section_definition::script_section_type_.
4502 (Output_section_definition::create_sections): Pass script section type
4503 to Layout::make_output_section_for_script.
4504 (Output_section_definition::output_section_name): Return script
4505 section type to caller.
4506 (Output_section_definition::set_section_address): Do not advance
4507 dot value and load address if section type is NOLOAD. Set address
4508 of NOLOAD sections regardless of section flags.
4509 (Output_section_definition::print): Print section type if it is
4510 not SCRIPT_SECTION_TYPE_NONE.
4511 (Output_section_definition::section_type): New method.
4512 (Output_section_definition::script_section_type_name): Ditto.
4513 (Script_sections::output_section_name): Add new parameter
4514 PSECTION_TYPE for returning script section type. Pass it to
4515 section elements. Handle discard sections.
4516 (Sort_output_sections::operator()): Handle NOLOAD sections.
4517 * script-sections.h (Script_sections::Section_type): New enum type.
4518 (Script_sections::output_section_name): Add a new parameter for
4519 returning script section type.
4520 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4521 INFO and NOLOAD.
4522 * yyscript.y (union): Add new field SECTION_TYPE.
4523 (COPY, DSECT, INFO, NOLOAD): New tokens.
4524 (opt_address_and_section_type): Change type to output_section_header.
4525 (section_type): New non-terminal
4526 (section_header): Handle section type.
4527 (opt_address_and_section_type): Return section type value.
4528
4529 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4530
4531 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4532 * testsuite/plugin_common_test_2.c (foo): Likewise.
4533
4534 2010-04-08 Doug Kwan <dougkwan@google.com>
4535
4536 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4537 Output_merge_data.
4538 * output.cc (Output_section::add_merge_input_section): Simplify
4539 code and return status of Output_merge_base::add_input_section.
4540 Update merge section map only if Output_merge_base::add_input_section
4541 returns true.
4542
4543 2010-04-07 Doug Kwan <dougkwan@google.com>
4544
4545 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4546 if section is marked as containing instructions but has no mapping
4547 symbols.
4548 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4549 correct section index.
4550 (Arm_relobj::find_linked_text_section): Ditto.
4551
4552 2010-04-07 Cary Coutant <ccoutant@google.com>
4553
4554 * archive.cc (include_member): Destroy Read_symbols_data object before
4555 releasing file.
4556 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4557 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4558 (Read_symbols_data::~Read_symbols_data) New destructor.
4559 (Section_relocs::Section_relocs) New constructor.
4560 (Section_relocs::~Section_relocs) New destructor.
4561 (Read_relocs_data::Read_relocs_data) New constructor.
4562 (Read_relocs_data::~Read_relocs_data) New destructor.
4563 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4564 pointers to NULL after deleting.
4565
4566 2010-04-07 Doug Kwan <dougkwan@google.com>
4567
4568 * arm.cc: Replace "endianity" with "endianness" in comments.
4569 (Arm_exidx_cantunwind): Ditto.
4570 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4571 (Arm_relobj::merge_flags_and_attributes): New method.
4572 (Arm_relobj::merge_flags_and_attributes_): New data member.
4573 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4574 (Arm_relobj::scan_sections_for_stubs): Ditto.
4575 (Arm_relobj::do_read_symbols): Check to see if we really want to
4576 merge processor-specific flags and attributes. Exit early if
4577 an object is empty except for section names and the undefined symbol.
4578 (Target_arm::do_finalize_sections): Move check for ELF format to
4579 Arm_relobj::do_read_symbols. Merge processor specific flags and
4580 attributes from a regular object only when we have determined that
4581 it is aapropriate. Do not create an .ARM.attributes section in
4582 output if there is no regular input object.
4583 (Target_arm::merge_processor_specific_flags): Check
4584 --warn-mismatch before printing any error.
4585 (Target_arm::merge_object_attributes): Ditto.
4586 * gold.cc (queue_middle_tasks): Handle the case in which there is
4587 no regular object in input.
4588 * options.cc (General_options::parse_EB): New method.
4589 (General_options::parse_EL): Same.
4590 (General_options::General_options): Initialize endianness_.
4591 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4592 New options.
4593 (General_options::Endianness): New enum.
4594 (General_options::endianness): New method.
4595 (General_options::endianness_): New data member.
4596 * parameters.cc (Parameters::set_options): Check target endianness.
4597 (Parameters::set_target_once): Ditto.
4598 (Parameters::check_target_endianness): New method.
4599 (parameters_force_valid_target): If either -EL or -EB is specified,
4600 use it to define endianness of default target.
4601 * parameters.h (Parameters::check_target_endianness): New method
4602 declaration.
4603 * target.h (class Target): Change "endianity" to "endianness"
4604 in comments.
4605
4606 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4607
4608 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4609 * configure: Regenerate.
4610 * Makefile.in: Regenerate.
4611 * testsuite/Makefile.in: Regenerate.
4612
4613 2010-04-06 Cary Coutant <ccoutant@google.com>
4614
4615 gcc PR lto/42757
4616 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4617 prevailing definitions of common symbols.
4618 * testsuite/plugin_test_6.sh: New test case.
4619 * testsuite/plugin_common_test_1.c: New test case.
4620 * testsuite/plugin_common_test_2.c: New test case.
4621 * testsuite/Makefile.am (plugin_test_6): New test case.
4622 * testsuite/Makefile.in: Regenerate.
4623
4624 2010-04-06 Nick Clifton <nickc@redhat.com>
4625
4626 * po/vi.po: New Vietnamese translation.
4627
4628 2010-03-30 Doug Kwan <dougkwan@google.com>
4629
4630 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4631
4632 2010-03-25 Doug Kwan <dougkwan@google.com>
4633
4634 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4635 to avoid a conversion warning on a 32-bit host.
4636
4637 2010-03-24 Ian Lance Taylor <iant@google.com>
4638
4639 * testsuite/script_test_3.t: Add a TLS segment.
4640 * testsuite/Makefile.am (check_PROGRAMS): Add
4641 tls_phdrs_script_test.
4642 (tls_phdrs_script_test_SOURCES): Define.
4643 (tls_phdrs_script_test_DEPENDENCIES): Define.
4644 (tls_phdrs_script_test_LDFLAGS): Define.
4645 (tls_phdrs_script_test_LDADD): Define.
4646 * testsuite/Makefile.in: Rebuild.
4647
4648 2010-03-23 Cary Coutant <ccoutant@google.com>
4649
4650 * fileread.cc (find_or_make_view): Fix comment.
4651
4652 2010-03-23 Ian Lance Taylor <iant@google.com>
4653
4654 * script-sections.cc (class Orphan_section_placement): Define
4655 PLACE_TLS and PLACE_TLS_BSS.
4656 (Orphan_section_placement::Orphan_section_placement): Initialize
4657 new places.
4658 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4659 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4660 (tls_script_test_SOURCES): Define.
4661 (tls_script_test_DEPENDENCIES): Define.
4662 (tls_script_test_LDFLAGS): Define.
4663 (tls_script_test_LDADD): Define.
4664 * testsuite/Makefile.in: Rebuild.
4665
4666 2010-03-22 Doug Kwan <dougkwan@google.com>
4667
4668 * arm.cc (Arm_relocate_functions::abs8,
4669 Arm_relocate_functions::abs16): Use correct check for overflow
4670 specified in the ARM ELF specs.
4671 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4672 target of a BLX instruction specially.
4673 (Reloc_stub::stub_type_for_reloc): Ditto.
4674 (Relocate::relocate): Use symbolic names instead of numeric relocation
4675 codes to report error.
4676 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4677 workaround.
4678 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4679 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4680 thumb2_blx_out_of_range.stdout
4681 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4682 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4683 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4684 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4685 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4686 thumb2_blx_in_range, thumb2_blx_in_range.o,
4687 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4688 thumb2_blx_out_of_range.o): New rules.
4689 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4690 thumb2_blx_in_range and thumb2_blx_out_of_range.
4691 * testsuite/Makefile.in: Regenerate.
4692 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4693 * testsuite/thumb_blx_in_range.s: New file.
4694 * testsuite/thumb_blx_out_of_range.s: New file.
4695
4696 2010-03-22 Rafael Espindola <espindola@google.com>
4697
4698 * archive.cc (Should_include): Move to archive.h.
4699 (should_include_member): Make it a member of Archive.
4700 (Lib_group): New.
4701 (Add_lib_group_symbols): New.
4702 * archive.h: Include options.h.
4703 (Archive_member): Moved from Archive.
4704 (Should_include): Moved from archive.cc.
4705 (Lib_group): New.
4706 (Add_lib_group_symbols): New.
4707 * dynobj.cc (do_should_include_member): New.
4708 * dynobj.h (do_should_include_member): New.
4709 * gold.cc (queue_initial_tasks): Update call to queue.
4710 * main.cc (main): Print lib group stats.
4711 * object.cc (do_should_include_member): New.
4712 * object.h: Include archive.h.
4713 (Object::should_include_member): New.
4714 (Object::do_should_include_member): New.
4715 (Sized_relobj::do_should_include_member): New.
4716 * options.cc (General_options::parse_start_lib): New.
4717 (General_options::parse_end_lib): New.
4718 (Input_arguments::add_file): Handle lib groups.
4719 (Input_arguments::start_group): Check we are not in a lib.
4720 (Input_arguments::start_lib): New.
4721 (Input_arguments::end_lib): New.
4722 * options.h (General_options): Add start_lib and end_lib.
4723 (Input_argument::lib_): New.
4724 (Input_argument::lib): New.
4725 (Input_argument::is_lib): New.
4726 (Input_file_lib): New.
4727 (Input_arguments::in_lib_): New.
4728 (Input_arguments::in_lib): New.
4729 (Input_arguments::start_lib): New.
4730 (Input_arguments::end_lib_): New.
4731 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4732 in unused members as preempted.
4733 (Sized_pluginobj::do_should_include_member): New.
4734 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4735 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4736 return the blocker.
4737 (Read_symbols::do_whole_lib_group): New.
4738 (Read_symbols::do_lib_group): New.
4739 (Read_symbols::do_read_symbols): Handle lib groups.
4740 (Read_symbols::get_name): Handle lib groups.
4741 * readsyms.h (Read_symbols): Add an archive member pointer.
4742 (Read_symbols::do_whole_lib_group): New.
4743 (Read_symbols::do_lib_group): New.
4744 (Read_symbols::member_): New.
4745 * script.cc (read_input_script): Update call to queue_soon.
4746
4747 2010-03-19 Doug Kwan <dougkwan@google.com>
4748
4749 * arm.cc (Stub_table::Stub_table): Initialize new data members
4750 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4751 (Stub_table::add_reloc_stub): Assign stub offset and update
4752 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4753 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4754 New data members.
4755 (Stub_table::update_data_size_and_addralign): Use
4756 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4757 instead of going over all reloc stubs.
4758 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4759 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4760 Stringpool_template::offset_ to size of Stringpool_char.
4761 (Stringpool_template::new_key_offset): Remove code to initialize
4762 Stringpool_template::offset_.
4763 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4764 Stringpool_template::offset_ to zero.
4765
4766 2010-03-15 Doug Kwan <dougkwan@google.com>
4767
4768 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4769 offset_.
4770 (Stringpool_template::new_key_offset): New method.
4771 (Stringpool_template::add_string): Assign offsets when adding new
4772 strings.
4773 (Stringpool_template::set_string_offsets): Do not set string offsets
4774 when not optimizing.
4775 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4776 member size_.
4777 (Chunked_vector::clear): Clear size_.
4778 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4779 (Chunked_vector::size): Return size_.
4780 (Chunked_vector::push_back): Use size_ to find insert position.
4781 (Chunked_vector::size_): New data member.
4782 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4783 (Stringpool_template::new_key_offset): New method declaration.
4784 (Stringpool_template::offset_): New data member.
4785
4786 2010-03-15 Rafael Espindola <espindola@google.com>
4787
4788 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4789 Add_symbols' constructor.
4790 * readsyms.h (Add_symbols): Remove the input_group member.
4791
4792 2010-03-10 Ian Lance Taylor <iant@google.com>
4793
4794 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4795 target to ask whether a reference to a symbol requires a stack
4796 split.
4797 * target.h (Target::is_call_to_non_split): New function.
4798 (Target::do_is_call_to_non_split): Declare virtual function.
4799 * target.cc: Include "symtab.h".
4800 (Target::do_is_call_to_non_split): New function.
4801 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4802
4803 2010-03-10 Cary Coutant <ccoutant@google.com>
4804
4805 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4806 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4807 (File_read::open[2]): Add whole_file_view_ to list of views.
4808 (File_read::make_view): Remove test of whole_file_view_.
4809 (File_read::find_or_make_view): Create whole_file_view_ if
4810 necessary.
4811 (File_read::clear_views): Replace bool parameter with enum;
4812 adjust all callers. Don't delete views with permanent data;
4813 do delete cached views and views from archives if
4814 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4815 if clearing the corresponding view.
4816 * fileread.h (File_read::Clear_views_mode): New enum.
4817 (File_read::View::is_permanent_view): New method.
4818 (File_read::clear_views): Replace bool parameter
4819 with enum; adjust all callers.
4820 * options.h (General_options): Change keep_files_mapped option;
4821 add map_whole_files.
4822 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4823 releasing the file.
4824 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4825 the file.
4826
4827 2010-03-10 David S. Miller <davem@davemloft.net>
4828
4829 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4830
4831 2010-03-09 Sriraman Tallam <tmsriram@google.com>
4832
4833 * icf.cc (get_section_contents): Add '@' marker after processing the
4834 merge reloc.
4835
4836 2010-03-08 Doug Kwan <dougkwan@google.com>
4837
4838 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4839 due to a conversion warning.
4840 (Arm_relobj::update_output_local_symbol_count): Check for local
4841 symbol with unset output index.
4842
4843 2010-03-05 Ian Lance Taylor <iant@google.com>
4844
4845 * options.h (class General_options): Add --spare-dynamic-tags.
4846 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4847 --spare-dynamic-tags.
4848
4849 2010-03-05 Ian Lance Taylor <iant@google.com>
4850
4851 * incremental.cc: Include "libiberty.h".
4852
4853 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4854
4855 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4856 function, is_info_ member.
4857 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4858 (Versions::Versions): Update caller.
4859 (Versions::define_base_version): Likewise.
4860 (Versions::add_def): Likewise.
4861
4862 2010-03-03 Sriraman Tallam <tmsriram@google.com>
4863
4864 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4865 (Scan::possible_function_pointer_reloc): New function.
4866 (Scan::local_reloc_may_be_function_pointer): Change to call
4867 possible_function_pointer_reloc.
4868 (Scan::global_reloc_may_be_function_pointer): Ditto.
4869 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4870 relocations in ".data.rel.ro._ZTV" section.
4871 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4872 * testsuite/icf_safe_so_test.cc: Ditto.
4873 * testsuite/icf_safe_test.cc: Ditto.
4874 * testsuite/icf_safe_test.sh: Ditto.
4875
4876 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4877 Ian Lance Taylor <iant@google.com>
4878
4879 * target-reloc.h (relocate_section): Check the symbol table index
4880 for -1U before setting the local symbol index.
4881 (scan_relocatable_relocs): If copying the relocation, record that
4882 the local symbol is required.
4883 * object.h (Symbol_value::is_output_symtab_index_set): New
4884 function.
4885 (Symbol_value::may_be_discarded_from_output_symtab): New
4886 function.
4887 (Symbol_value::has_output_symtab_entry): New function.
4888 (Symbol_value::needs_output_symtab_entry): Remove.
4889 (Symbol_value::output_symtab_index): Make sure the symbol index is
4890 set.
4891 (Symbol_value::set_output_symtab_index): Make sure the symbol
4892 index is not set. Make sure the new index is valid.
4893 (Symbol_value::set_must_have_output_symtab_entry): New function.
4894 (Symbol_value::has_output_dynsym_entry): New function.
4895 (Symbol_value::set_output_dynsym_index): Make sure the new index
4896 is valid.
4897 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4898 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4899 local symbol if permitted.
4900 (Sized_relobj::do_finalize_local_symbols): Call
4901 is_output_symtab_index_set rather than needs_output_symtab_entry.
4902 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4903 rather than needs_output_symtab_entry. Call
4904 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4905 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4906 is_output_symtab_index_set rather than needs_output_symtab_entry.
4907 * testsuite/discard_locals_relocatable_test.c: New file.
4908 * testsuite/discard_locals_test.sh: Test -r.
4909 * testsuite/Makefile.am (check_DATA): Add
4910 discard_locals_relocatable_test1.syms,
4911 discard_local_relocatable_test2.syms.
4912 (MOSTLYCLEANFILES): Likewise. Also add
4913 discard_locals_relocatable_test1.lout and
4914 discard_locals_relocatable_test2.out.
4915 (discard_locals_relocatable_test1.syms): New target.
4916 (discard_locals_relocatable_test.o): New target.
4917 (discard_locals_relocatable_test1.out): New target.
4918 (discard_locals_relocatable_test2.syms): New target.
4919 (discard_locals_relocatable_test2.out): New target.
4920 (various): Add missing ../ld-new dependencies.
4921 * testsuite/Makefile.in: Rebuild.
4922
4923 2010-03-03 Nick Clifton <nickc@redhat.com>
4924
4925 * po/fi.po: New Finnish translation.
4926
4927 2010-03-01 Doug Kwan <dougkwan@google.com>
4928
4929 * layout.cc (Layout::Layout): Force section types of .init_array*,
4930 .preinit_array* and .fini_array* sections.
4931 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4932 Fix check of return value of std::string::find.().
4933 (Output_section::Input_section_sort_compare::operator()): Remove
4934 comment about .init_array.
4935 (Output_section::Input_section_sort_init_fini_compare::operator()):
4936 New method.
4937 (Output_section::sort_attached_input_sections): Handle .init_array
4938 and .fini_array specially.
4939 * output.h (Output_section::Inut_section_sort_compare): Update
4940 comment.
4941 (Output_section::Input_section_sort_init_fini_compare): New struct.
4942
4943 2010-02-26 Doug Kwan <dougkwan@google.com>
4944
4945 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4946 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4947 * testsuite/debug_msg.sh: Avoid matching source line number for
4948 use of global variable undef_int.
4949
4950 2010-02-26 Doug Kwan <dougkwan@google.com>
4951
4952 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4953 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4954 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4955 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4956 * options.cc (General_options::General_options): Initialize member
4957 fix_v4bx_.
4958 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4959 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4960 and rm_no_fix_v4bx.stdout
4961 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4962 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4963 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4964 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4965 and arm_no_fix_v4bx.
4966 * Makefile.in: Regenerate.
4967 * testsuite/arm_fix_v4bx.s: New file.
4968 * testsuite/arm_fix_v4bx.sh: Ditto.
4969
4970 2010-02-24 Doug Kwan <dougkwan@google.com>
4971
4972 * arm.cc (Target_arm::got_section): Make the .got section the first
4973 non RELRO section in the data segment.
4974 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4975 suffixes of section names.
4976
4977 2010-02-24 Doug Kwan <dougkwan@google.com>
4978
4979 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4980 flags and attributes merging if an input file is a binary file.
4981 * fileread.cc (Input_file::open): Record format of original file.
4982 * fileread.h (Input_file::Format): New enum type.
4983 (Input_file::Input_file): Initialize data member format_.
4984 (Input_file::format): New method definition.
4985 (Input_file::format_):: New data member.
4986
4987 2010-02-24 Doug Kwan <dougkwan@google.com>
4988
4989 * arm.cc (Arm_output_data_got): New class.
4990 (ARM_TCB_SIZE): New constant
4991 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4992 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4993 If user uses a script with a SECTIONS clause, issue only a warning
4994 for a misplaced EXIDX input section. Otherwise, issue an error.
4995 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4996 garbage collection.
4997 (Target_arm::got_mode_index_entry): Handle static linking.
4998 (Target_arm::Scan::local): Ditto.
4999 (Target_arm::Scan::global): Ditto.
5000 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5001 all incorrectly implemented relocations.
5002 (Target_arm::fix_exidx_coverage): Pass layout to
5003 Arm_output_section::fix_exidx_coverage.
5004 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5005 from ".ARM.exidx." and ".ARM.extab.".
5006
5007 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5008
5009 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5010 section if it does not already exist.
5011 * attributes.cc (Attributes_section_data::Attributes_section_data):
5012 Don't crash if size is zero.
5013
5014 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5015 Ian Lance Taylor <iant@google.com>
5016
5017 * gold.cc (queue_middle_tasks): If no input files were opened,
5018 exit.
5019 * workqueue.h (Task_function::Task_function): Assert that there is
5020 a blocker.
5021
5022 2010-02-22 Doug Kwan <dougkwan@google.com>
5023
5024 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5025 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5026 types to avoid warnings due to different uint64_t implementations
5027 on different hosts.
5028
5029 2010-02-21 Doug Kwan <dougkwan@google.com>
5030
5031 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5032 handling of the maximum backward branch offset.
5033 (Arm_relocate_functions::thumb_branch_common): Ditto.
5034 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5035 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
5036 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
5037 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5038 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5039 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5040 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5041 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5042 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5043 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5044 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5045 thumb2_bl_out_of_range.o): New rules.
5046 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5047 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5048 thumb2_bl_out_of_range
5049 * testsuite/Makefile.in: Regenerate.
5050 * testsuite/arm_bl_in_range.s: New file.
5051 * testsuite/arm_bl_out_of_range.s: Ditto.
5052 * testsuite/arm_branch_in_range.sh: Ditto.
5053 * testsuite/arm_branch_range.t: Ditto.
5054 * testsuite/thumb2_branch_range.t: Ditto.
5055 * testsuite/thumb_bl_in_range.s: Ditto.
5056 * testsuite/thumb_bl_out_of_range.s: Ditto.
5057 * testsuite/thumb_branch_range.t: Ditto.
5058
5059 2010-02-20 Sriraman Tallam <tmsriram@google.com>
5060
5061 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5062 Add reloc offset information.
5063 * icf.cc (get_section_contents): Change iterators to point to the new
5064 vectors. Add reloc offset information to the contents.
5065 * icf.h (Icf::Sections_reachable_info): New typedef.
5066 (Icf::Sections_reachable_list): New typedef.
5067 (Icf::Offset_info): New typedef.
5068 (Icf::Reloc_info): New struct typedef.
5069 (Icf::Reloc_info_list): New typedef.
5070 (Icf::symbol_reloc_list): Delete method.
5071 (Icf::addend_reloc_list): Delete method.
5072 (Icf::section_reloc_list): Delete method.
5073 (Icf::reloc_info_list): New method.
5074 (Icf::reloc_info_list_): New member.
5075
5076 2010-02-19 Doug Kwan <dougkwan@google.com>
5077
5078 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5079 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5080 * arm.cc (Arm_relocation_functions): New forward declaration.
5081 (Target_arm::Target_arm): Initialize new data members
5082 got_mod_index_offset_ and tls_base_symbol_defined_.
5083 (Target_arm::Relocate::relocate_tls): New method.
5084 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5085 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5086 New methods.
5087 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5088 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5089 (Target_arm::got_mod_index_offset_,
5090 Target_arm::tls_base_symbol_defined_): New data members.
5091 (Target_arm::Scan::local, Target::Scan::global,
5092 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5093 relocations.
5094
5095 2010-02-18 Doug Kwan <dougkwan@google.com>
5096
5097 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5098 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5099 text section as a parameter becuase some broken tools may not set
5100 the link in section header.
5101 (Target_arm::has_got_section): New method.
5102 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5103 without any mapping symbol as data only. Remove warning.
5104 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5105 link in its section header, try to discover the link by inspecting the
5106 REL31 relocation at the beginning of the section.
5107 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5108 in error message.
5109 (Target_arm::Scan::global): Treat any reference to the symbol
5110 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5111
5112 2010-02-12 Sriraman Tallam <tmsriram@google.com>
5113
5114 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5115 (Scan::global_reloc_may_be_function_pointer): New function.
5116 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5117 (Scan::global_reloc_may_be_function_pointer): New function.
5118 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5119 (Scan::global_reloc_may_be_function_pointer): New function.
5120 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5121 (Scan::global_reloc_may_be_function_pointer): New function.
5122 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5123 (Scan::global_reloc_may_be_function_pointer): New function.
5124 (Scan::possible_function_pointer_reloc): New function.
5125 (Target_x86_64::can_check_for_function_pointers): New function.
5126 * gc.h (gc_process_relocs): Scan relocation types to determine if
5127 function pointers were taken for targets that support it.
5128 * icf.cc (Icf::find_identical_sections): Include functions for
5129 folding in safe ICF whose pointer is not taken.
5130 * icf.h (Secn_fptr_taken_set): New typedef.
5131 (fptr_section_id_): New member.
5132 (section_has_function_pointers): New function.
5133 (set_section_has_function_pointers): New function.
5134 (check_section_for_function_pointers): New function.
5135 * options.h: Fix comment for safe ICF option.
5136 * target.h (can_check_for_function_pointers): New function.
5137 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5138 Modify icf_safe_test for X86-64.
5139 * testsuite/Makefile.in: Regenerate.
5140 * testsuite/icf_safe_so_test.cc: New file.
5141 * testsuite/icf_safe_so_test.sh: New file.
5142 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5143 (main): Change to take pointer to function kept_func_3.
5144 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5145 folding is done correctly for X86-64.
5146
5147 2010-02-12 David S. Miller <davem@davemloft.net>
5148
5149 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5150 is_symbolless parameter.
5151 (Output_reloc<SHT_REL>::is_symbolless): New.
5152 (Output_reloc<SHT_REL>::is_symbolless_): New.
5153 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5154 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5155 (Output_reloc<SHT_RELA>::is_symbolless): New.
5156 (Output_data_reloc::add_global): Handle is_symbolless.
5157 (Output_data_reloc::add_global_relative): Likewise.
5158 (Output_data_reloc::add_local): Likewise.
5159 (Output_data_reloc::add_local_relative): Likewise.
5160 (Output_data_reloc::add_symbolless_global_addend): New.
5161 (Output_data_reloc::add_symbolless_local_addend): New.
5162 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5163 is_symbolless.
5164 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5165 instead of ->is_relative_
5166 (Output_reloc::write): Likewise.
5167 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5168 (Output_reloc::write_rel): Simplify.
5169
5170 * sparc.cc (Target_sparc::Scan::local): Use
5171 ->add_symbolless_local_addend as needed.
5172 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5173 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5174 based upon relocation offset.
5175
5176 2010-02-11 Doug Kwan <dougkwan@google.com>
5177
5178 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5179 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5180 beginning of function.
5181 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5182 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5183 parameter is_32bit in calls to should_apply_static_reloc.
5184 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5185 (check_DATA): Add arm_abs_global.stdout.
5186 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5187 arm_abs_global.stdout): New rules.
5188 (MOSTLLYCLEANFILES): Add arm_abs_global
5189 * Makefile.in: Regenerate.
5190 * testsuite/arm_abs_global.s: New file.
5191 * testsuite/arm_abs_global.sh: Ditto.
5192 * testsuite/arm_abs_lib.s: Ditto.
5193
5194 2010-02-11 Ian Lance Taylor <iant@google.com>
5195
5196 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5197 Read_relocs task.
5198 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5199 Allocate_commons_task first.
5200 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5201 task, rather than symtab_lock_.
5202 (Gc_process_relocs::~Gc_process_relocs): New function.
5203 (Gc_process_relocs::is_runnable): Check this_blocker_.
5204 (Gc_process_relocs::locks): Use next_blocker_ rather than
5205 blocker_.
5206 (Scan_relocs::~Scan_relocs): New function.
5207 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5208 symtab_lock_.
5209 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5210 next_blocker_.
5211 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5212 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5213 constructor accordingly.
5214 (class Gc_process_relocs): Likewise.
5215 (class Scan_relocs): Likewise.
5216 * common.h (class Allocate_commons_task): Remove symtab_lock_
5217 field, and corresponding constructor parameter.
5218 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5219 symtab_lock_.
5220 (Allocate_commons_task::locks): Likewise.
5221
5222 2010-02-11 Ian Lance Taylor <iant@google.com>
5223
5224 * gold-threads.h (class Once): Define.
5225 (class Initialize_lock): Rewrite as child of Once.
5226 * gold-threads.cc (class Once_initialize): Define.
5227 (once_pointer_control): New static variable.
5228 (once_pointer, once_arg): New static variables.
5229 (c_run_once): New static function.
5230 (Once::Once, Once::run_once, Once::internal_run): New functions.
5231 (class Initialize_lock_once): Remove.
5232 (initialize_lock_control): Remove.
5233 (initialize_lock_pointer): Remove.
5234 (initialize_lock_once): Remove.
5235 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5236 (Initialize_lock::initialize): Rewrite.
5237 (Initialize_lock::do_run_once): New function.
5238 * archive.cc (Archive::interpret_header): Only clear name if it is
5239 not already empty.
5240 * fileread.cc: Include "gold-threads.h"
5241 (file_counts_lock): New static variable.
5242 (file_counts_initialize_lock): Likewise.
5243 (File_read::release): Only increment counts when using --stats.
5244 Use a lock around the increment.
5245 * parameters.cc (class Set_parameters_target_once): Define.
5246 (set_parameters_target_once): New static variable.
5247 (Parameters::Parameters): Move here from parameters.h.
5248 (Parameters::set_target): Rewrite.
5249 (Parameters::set_target_once): New function.
5250 (Parameters::clear_target): Move here and rewrite.
5251 * parameters.h (class Parameters): Update declarations. Add
5252 set_parameters_target_once_ field.
5253 (Parameters::Parameters): Move to parameters.cc.
5254 (Parameters::clear_target): Likewise.
5255 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5256 task.
5257 (Start_group::~Start_group): New function.
5258 (Start_group::is_runnable): New function.
5259 (Start_group::locks, Start_group::run): New functions.
5260 (Finish_group::run): Change saw_undefined to size_t.
5261 * readsyms.h (class Start_group): Define.
5262 (class Finish_group): Change saw_undefined_ field to size_t.
5263 (Finish_group::Finish_group): Remove saw_undefined and
5264 this_blocker parameters. Change all callers.
5265 (Finish_group::set_saw_undefined): New function.
5266 (Finish_group::set_blocker): New function.
5267 * symtab.h (class Symbol_table): Change saw_undefined to return
5268 size_t. Change saw_undefined_ field to size_t.
5269 * target-select.cc (Set_target_once::do_run_once): New function.
5270 (Target_selector::Target_selector): Initialize set_target_once_
5271 field. Don't initialize lock_ and initialize_lock_ fields.
5272 (Target_selector::instantiate_target): Rewrite.
5273 (Target_selector::set_target): New function.
5274 * target-select.h (class Set_target_once): Define.
5275 (class Target_selector): Update declarations. Make
5276 Set_target_once a friend. Remove lock_ and initialize_lock_
5277 fields. Add set_target_once_ field.
5278
5279 2010-02-10 Ian Lance Taylor <iant@google.com>
5280
5281 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5282 queueing any tasks.
5283 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5284 (queue_middle_tasks): Add all blockers before queueing any tasks.
5285 (queue_final_tasks): Likewise.
5286 * token.h (Task_token::add_blockers): New function.
5287 * object.h (Input_objects::number_of_relobjs): New function.
5288
5289 2010-02-10 Ian Lance Taylor <iant@google.com>
5290
5291 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5292 shared, not if not position independent.
5293 * x86_64.cc (Relocate::relocate_tls): Likewise.
5294 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5295 (tls_pie_pic_test): New target.
5296 * testsuite/Makefile.in: Rebuild.
5297
5298 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5299 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5300 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5301 * testsuite/Makefile.in: Rebuild.
5302
5303 2010-02-09 David S. Miller <davem@davemloft.net>
5304
5305 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5306 R_SPARC_RELATIVE using ->add_local_relative().
5307 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5308
5309 * output.h (Output_data_dynamic::add_section_size): New method
5310 that takes two Output_data objects.
5311 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5312 entry param. Handle it in initializers.
5313 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5314 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5315 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5316 arg.
5317 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5318 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5319 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5320 for dynrel_includes_plt.
5321 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5322 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5323 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5324 before .rela.plt
5325 (Target_sparc::do_finalize_sections): Update to pass true for
5326 dynrel_includes_plt.
5327 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5328 output before .rela.plt
5329 (Target_powerpc::do_finalize_sections): Update to pass true for
5330 dynrel_includes_plt when 32-bit.
5331
5332 2010-02-08 Doug Kwan <dougkwan@google.com>
5333
5334 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5335 method.
5336 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5337 Arm_relobj::scan_section_for_cortex_a8_stubs,
5338 Arm_relobj::do_relocation_section): Instead of calling
5339 Output_section::output_address, use faster
5340 Arm_relobj::simple_input_section_output_address.
5341
5342 2010-02-08 David S. Miller <davem@davemloft.net>
5343
5344 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5345 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5346 relocation helper function.
5347
5348 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5349 just like R_SPARC_GOT{10,13,22}.
5350 (Target_sparc::Scan::local): Likewise.
5351 (Target_sparc::Relocate:relocate): Likewise.
5352
5353 2010-02-06 Ian Lance Taylor <iant@google.com>
5354
5355 * configure.ac: Rewrite targetobjs duplicate removal code to use
5356 only shell constructs.
5357 * configure: Rebuild.
5358
5359 2010-02-05 Doug Kwan <dougkwan@google.com>
5360
5361 PR 11247
5362 * arm.cc (Arm_relobj::section_is_scannable): New method.
5363 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5364 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5365
5366 2010-02-04 Doug Kwan <dougkwan@google.com>
5367
5368 PR 11247
5369 * arm-reloc-property.cc (cstdio): Include.
5370 * configure.ac (targetobjs): Remove duplicates.
5371 * configure: Regenerate.
5372 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5373 big and little endian version for a given address size.
5374
5375 2010-02-03 Doug Kwan <dougkwan@google.com>
5376
5377 * arm-reloc-property.cc
5378 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5379 definition.
5380 * arm-reloc-property.h
5381 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5382 New method definition.
5383 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5384 declaration.
5385 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5386 overflow to N.
5387 (GOT_PREL): Change implemented to Y.
5388 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5389 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5390 (Arm_relocate_functions::movw_abs_nc): Remove method.
5391 (Arm_relocate_functions::movt_abs): Ditto.
5392 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5393 (Arm_relocate_functions::thm_movt_abs): Ditto.
5394 (Arm_relocate_functions::movw_rel_nc): Ditto.
5395 (Arm_relocate_functions::movw_rel): Ditto.
5396 (Arm_relocate_functions::movt_rel): Ditto.
5397 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5398 (Arm_relocate_functions:thm_movw_rel): Ditto.
5399 (Arm_relocate_functions:thm_movt_rel): Ditto.
5400 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5401 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5402 New method definitions.
5403 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5404 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5405 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5406 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5407 (Target_arm::Relocate::relocate): Check for non-static or
5408 unimplemented relocation code and exit early. Change calls to
5409 Target_arm::reloc_uses_thumb_bit and
5410 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5411 instead. Refactor code to handle similar relocations to increase
5412 code sharing. Remove check for unsupported relocation code in switch
5413 statement.
5414 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5415 relocation property table to find out size. Change error message to
5416 print out the name of a relocation code instead of the numeric value.
5417 (Target_arm::scan_reloc_for_stub): Use relocation property table
5418 instead of calling Target_arm::reloc_uses_thumb_bit().
5419
5420 2010-02-02 Doug Kwan <dougkwan@google.com>
5421
5422 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5423 types of relaxed input section.
5424
5425 2010-02-02 Doug Kwan <dougkwan@google.com>
5426
5427 * Makefile.am (HFILES): Add arm-reloc-property.h.
5428 (DEFFILES): New.
5429 (TARGETSOURCES): Add arm-reloc-property.cc
5430 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5431 (libgold_a_SOURCES): $(DEFFILES)
5432 * Makefile.in: Regenerate.
5433 * arm-reloc-property.cc: New file.
5434 * arm-reloc-property.h: New file.
5435 * arm-reloc.def: New file.
5436 * arm.cc: Update comments.
5437 (arm-reloc-property.h): New included header.
5438 (arm_reloc_property_table): New global variable.
5439 (Target_arm::do_select_as_default_target): New method definition.
5440 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5441 arm-reloc-property to targ_extra_obj.
5442 * parameters.cc (set_parameters_target): Call
5443 Target::select_as_default_target().
5444 * target.h (Target::select_as_default_target): New method definition.
5445 (Target::do_select_as_default_target): Same.
5446
5447 2010-02-01 Doug Kwan <dougkwan@google.com>
5448
5449 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5450 first_output_text_section_.
5451 (Arm_exidx_fixup::first_output_text_section): New method definition.
5452 (Arm_exidx_fixup::first_output_text_section_): New data member.
5453 (Arm_exidx_fixup::process_exidx_section): Record the first text
5454 output section seen.
5455 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5456 and entsize in output section header.
5457
5458 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5459
5460 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5461 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5462 (Arm_relocate_functions::thm_alu11): New Method.
5463 (Arm_relocate_functions::thm_pc8): New Method.
5464 (Arm_relocate_functions::thm_pc12): New Method.
5465 (Target_arm::Scan::local): Handle the relocations.
5466 (Target_arm::Scan::global): Likewise.
5467 (Target_arm::Relocate::relocate): Likewise.
5468 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5469
5470 2010-01-29 Doug Kwan <dougkwan@google.com>
5471
5472 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5473 of relocation types as ld.
5474
5475 2010-01-29 Doug Kwan <dougkwan@google.com>
5476
5477 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5478 to public.
5479 (Arm_relocate_functions::thumb_branch_common): Ditto.
5480 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5481 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5482 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5483 Arm_relocate_functions::jump24): Remove.
5484 (Target_arm::Relocate::relocate): Adjust code to call
5485 Arm_relocation_functions::arm_branch_common and
5486 Arm_relocation_functions::thumb_branch_common instead of their removed
5487 wrappers. Merge switch-cases together to reduce source code size.
5488
5489 2010-01-29 Doug Kwan <dougkwan@google.com>
5490
5491 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5492 output_local_symbol_count_needs_update_.
5493 (Arm_relobj::output_local_symbol_count_needs_update,
5494 Arm_relobj::set_output_local_symbol_count_needs_update,
5495 Arm_relobj::update_output_local_symbol_count): New methods.
5496 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5497 member.
5498 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5499 of pointed function as in a R_ARM_PREL31 relocation.
5500 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5501 for output local symbol count updating.
5502 (Target_arm::do_relax): Update output local symbol counts in objects
5503 if necessary.
5504 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5505
5506 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5507
5508 * arm.cc: Added support for the ARM relocations:
5509 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5510 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5511 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5512 movw_prel_nc).
5513 (Arm_relocate_functions::movw_rel): New method.
5514 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5515 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5516 thm_movw_prel_nc).
5517 (Arm_relocate_functions::thm_movw_rel): New method.
5518 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5519 thm_movt_prel).
5520 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5521 relocations.
5522 (Target_arm::Scan::global): Likewise.
5523 (Target_arm::Relocate::relocate): Likewise.
5524 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5525 Likewise.
5526
5527 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5528
5529 * arm.cc: Added support for ARM group relocations.
5530 (Target_arm::reloc_needs_sym_origin): New method.
5531 (Arm_relocate_functions::calc_grp_kn): New method.
5532 (Arm_relocate_functions::calc_grp_residual): New method.
5533 (Arm_relocate_functions::calc_grp_gn): New method.
5534 (Arm_relocate_functions::arm_grp_alu): New Method.
5535 (Arm_relocate_functions::arm_grp_ldr): New Method.
5536 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5537 (Arm_relocate_functions::arm_grp_ldc): New Method.
5538 (Target_arm::Scan::local): Handle the ARM group relocations.
5539 (Target_arm::Scan::global): Likewise.
5540 (Target_arm::Relocate::relocate): Likewise.
5541 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5542 Likewise.
5543
5544 2010-01-26 Doug Kwan <dougkwan@google.com>
5545
5546 * arm.cc (set): Include.
5547 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5548 pointer type.
5549 (Arm_output_section::Text_section_list): New type.
5550 (Arm_output_section::append_text_sections_to_list): New method.
5551 (Arm_output_section::fix_exidx_coverage): Ditto.
5552 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5553 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5554 Relobj::set_section_offset() instead of
5555 Sized_relobj::invalidate_section_offset().
5556 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5557 parameter for section headers. Ignore relocation sections for
5558 unallocated sections and EXIDX sections.
5559 (Target_arm::fix_exidx_coverage): New method.
5560 (Target_arm::output_section_address_less_than): New type.
5561 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5562 linked text section instead of the EXIDX section.
5563 (Arm_output_section::create_stub_group): Add an assertion to check
5564 that this is not an EXIDX output section.
5565 (Arm_output_section::append_text_sections_to_list): New method.
5566 (Arm_output_section::fix_exidx_coverage): Ditto.
5567 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5568 Arm_relobj::section_needs_reloc_stub_scanning.
5569 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5570 first pass.
5571 (Target_arm::fix_exidx_coverage): New method.
5572 * object.h (Relobj::set_output_section): New method.
5573 (Sized_relobj::invalidate_section_offset): Remove method.
5574 (Sized_relobj::do_invalidate_section_offset): Remove method.
5575 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5576
5577 2010-01-25 Doug Kwan <dougkwan@google.com>
5578
5579 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5580 Fix warning due to signed and unsigned comparison on a 32-bit host.
5581
5582 2010-01-22 Doug Kwan <dougkwan@google.com>
5583
5584 * arm.cc (Target_arm::do_relax): Record an output section for section
5585 offset adjustment it contains any stub table that has changed.
5586 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5587 offsets in an output section if necessary.
5588 * output.cc (Output_section::Output_section): Initialize
5589 section_offsets_need_adjustments_.
5590 (Output_section::add_input_section_for_script): Renamed to
5591 Output_section::add_simple_input_section.
5592 (Output_section::save_states): Add a comment.
5593 (Output_section::discard_states): New method defintion.
5594 (Output_section::adjust_section_offsets): Same.
5595 * output.h (Output_section::add_input_section_for_script): Renamed to
5596 Output_section::add_simple_input_section.
5597 (Output_section::discard_states): New method declaration.
5598 (Output_section::adjust_section_offsets): Same.
5599 (Output_section::section_offsets_need_adjustment,
5600 Output_section::set_section_offsets_need_adjustment): New method
5601 definitions.
5602 (Output_section::section_offsets_need_adjustment_): New data member.
5603 * script-sections.cc
5604 (Output_section_element_input::set_section_address): Adjust code for
5605 renaming of Output_section::add_input_section_for_script.
5606 (Orphan_output_section::set_section_address): Same.
5607
5608 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5609
5610 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5611 Fix_v4bx enum values .
5612 * gold/options.h (General_options): New option definitions.
5613 (General_options::fix_v4bx): New method.
5614 (General_options::Fix_v4bx): New enum.
5615 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5616 (General_options::parse_fix_v4bx_interworking): New method.
5617
5618 2010-01-22 Doug Kwan <dougkwan@google.com>
5619
5620 * arm.cc (Arm_exidx_fixup): New class.
5621
5622 2010-01-21 Doug Kwan <dougkwan@google.com>
5623
5624 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5625 classes.
5626 (Arm_exidx_section_offset_map): New type.
5627
5628 2010-01-21 Doug Kwan <dougkwan@google.com>
5629
5630 * arm.cc (Arm_exidx_input_section): New class.
5631 (Arm_relobj::exidx_input_section_by_link,
5632 Arm_relobj::exidx_input_section_by_shndx,
5633 Arm_relobj::make_exidx_input_section): New methods.
5634 (read_arm_attributes_section): Remove.
5635 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5636 information about them.
5637 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5638 to here.
5639
5640 2010-01-20 Doug Kwan <dougkwan@google.com>
5641
5642 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5643 Input_section_specifier to Section_id.
5644 (Target_arm::new_arm_input_section: Adjust code for change of key
5645 type.
5646 (Target_arm::find_arm_input_section): Ditto.
5647 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5648 (Section_id): Remove.
5649 (Garbage_collection::Section_id_hash): Remove.
5650 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5651 (Section_id): Remove.
5652 (Icf::Section_id_hash): Remove.
5653 * object.h (Section_id, Const_section_id, Section_id_hash,
5654 Const_section_id_hash): New type definitions.
5655 * output.cc (Output_section::add_relaxed_input_section): Change to
5656 use Const_section_id instead of Input_section_specifier as key type.
5657 (Output_section::add_merge_input_section): Ditto.
5658 (Output_section::build_relaxation_map): Change to use Section_id
5659 instead of Input_section_specifier as key type.
5660 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5661 Ditto.
5662 (Output_section::convert_input_sections_to_relaxed_sections): Change
5663 to use Const_section_id instead of Input_section_specifier as key type.
5664 (Output_section::find_merge_section): Ditto.
5665 (Output_section::find_relaxed_input_section): Ditto.
5666 * output.h (Input_section_specifier): Remove class.
5667 (Output_section::Output_section_data_by_input_section_map): Change
5668 key type to Const_section_id.
5669 (Output_section::Output_relaxed_input_section_by_input_section_map):
5670 Ditto.
5671 (Output_section::Relaxation_map): Change key type to Section_id.
5672
5673 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5674
5675 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5676 (class Arm_v4bx_stub): New class.
5677 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5678 (Stub_factory::make_arm_v4bx_stub): New method.
5679 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5680 (Stub_table::empty): Handle v4bx stubs.
5681 (Stub_table::add_arm_v4bx_stub): New method.
5682 (Stub_table::find_arm_v4bx_stub): New method.
5683 (Arm_relocate_functions::v4bx): New method.
5684 (Target_arm::fix_v4bx): New method.
5685 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5686 (Stub_table::relocate_stubs): Likewise.
5687 (Stub_table::do_write): Likewise.
5688 (Stub_table::update_data_size_and_addralign): Likewise.
5689 (Stub_table::finalize_stubs): Likewise.
5690 (Target_arm::Scan::local): Likewise.
5691 (Target_arm::Scan::global): Likewise.
5692 (Target_arm::do_finalize_sections): Likewise.
5693 (Target_arm::Relocate::relocate): Likewise.
5694 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5695 Likewise.
5696 (Target_arm::scan_reloc_for_stub): Likewise.
5697 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5698
5699 2010-01-19 Ian Lance Taylor <iant@google.com>
5700
5701 * output.cc (Output_section_headers::do_sized_write): Write large
5702 segment count to sh_info field.
5703 (Output_file_header::do_sized_write): For large segment count,
5704 write PN_XNUM to e_phnum field.
5705
5706 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5707
5708 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5709 (Arm_relocate_functions::thm_jump8): New function.
5710 (Arm_relocate_functions::thm_jump11): New function.
5711 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5712 R_ARM_THM_JUMP11.
5713 (Target_arm::Scan::global): Likewise.
5714 (Target_arm::Relocate::relocate): Likewise.
5715 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5716 Likewise.
5717
5718 2010-01-14 Doug Kwan <dougkwan@google.com>
5719
5720 * arm.cc (map, utility): Include headers.
5721 (Target_arm::apply_cortex_a8_workaround): New method.
5722 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5723 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5724 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5725 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5726 the --[no-]fix-cortex-a8 command line options.
5727 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5728 (Target_arm::relocate_stub): Use addend in instruction template.
5729 * options.h (DEFINE_bool): Set the user-set flag.
5730 (General_options): Add --[no-]-fix-cortex options.
5731 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
5732 : Update fast look-up map after conversion.
5733
5734 2010-01-14 Sriraman Tallam <tmsriram@google.com>
5735
5736 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5737 in the first pass of do_layout.
5738
5739 2010-01-13 Doug Kwan <dougkwan@google.com>
5740
5741 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5742 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5743 apparent compiler problem of not folding static constant integral
5744 data members of elfcpp::Elf_sizes<32>.
5745
5746 2010-01-13 Doug Kwan <dougkwan@google.com>
5747
5748 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5749 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5750 Arm_relobj::scan_section_for_cortex_a8_erratum,
5751 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5752 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5753 sections to scan for relocation stubs into a new method
5754 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5755 relocation and Cortex-A8 stub scanning.
5756 (Target_arm::do_relax): Force stubs to be after stubbed sections
5757 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
5758 the beginning of a new relaxation pass. Update a comment.
5759 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5760
5761 2010-01-12 Ian Lance Taylor <iant@google.com>
5762
5763 * target-reloc.h (visibility_error): New inline function.
5764 (relocate_section): Call visibility_error.
5765 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5766 (MOSTLYCLEANFILES): Likewise.
5767 (protected_4_pic.o, protected_3.err): New targets.
5768 * testsuite/protected_4.cc: New file.
5769
5770 2010-01-12 Doug Kwan <dougkwan@google.com>
5771
5772 * arm.cc (Cortex_a8_reloc): New class.
5773 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5774 and cortex_a8_relocs_info_.
5775 (Target_arm::fix_cortex_a8): New method definition.
5776 (Target_arm::Cortex_a8_relocs_info): New type.
5777 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5778 New data member declarations.
5779 (Target_arm::scan_reloc_for_stub): Record information about
5780 relocations for THUMB branches that might be exempted from the
5781 Cortex-A8 workaround.
5782 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5783 at the beginning of a relaxation pass.
5784
5785 2010-01-12 Doug Kwan <dougkwan@google.com>
5786
5787 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5788 (Arm_relobj::Mapping_symbol_position,
5789 Arm_reloj::Mapping_symbol_position_less,
5790 Arm_relobj::Mapping_symbols_info): New types.
5791 (Target_arm::is_mapping_symbol_name): New method definition.
5792 (Arm_relobj::do_count_local_symbols): Save information about mapping
5793 symbols.
5794
5795 2010-01-11 Doug Kwan <dougkwan@google.com>
5796
5797 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5798 Arm_relocate_functions::thumb32_branch_upper,
5799 Arm_relocate_functions::thumb32_branch_lower,
5800 Arm_relocate_functions::thumb32_cond_branch_offset,
5801 Arm_relocate_functions::thumb32_cond_branch_upper,
5802 Arm_relocate_functions::thumb32_cond_branch_lower,
5803 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5804 branch offset encoding.
5805 (Arm_relocate_functions::thumb_branch_common): Use new branch
5806 offset encoding methods to avoid code duplication.
5807 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5808 (Stub_addend_reader::operator()): Use new branch encoding method
5809 to avoid code duplication.
5810
5811 2010-01-11 Doug Kwan <dougkwan@google.com>
5812
5813 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5814 (Target_arm::do_finalize_sections): Define special EXIDX section
5815 symbols only if referenced.
5816 * gc.h (Garbage_collection::add_reference): New method.
5817 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5818 code duplication.
5819
5820 2010-01-11 Ian Lance Taylor <iant@google.com>
5821
5822 * script.cc (Version_script_info::build_expression_list_lookup):
5823 Change complaing about duplicate wildcard match from error to
5824 warning.
5825
5826 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5827 of 2009-12-30.
5828 (Version_script_info::Version_script_info): Initialize globs_,
5829 default_version_, default_is_global_, and exact_. Don't
5830 initialize globals_ or locals_.
5831 (Version_script_info::build_lookup_tables): Build local symbols
5832 first.
5833 (Version_script_info::unquote): New function.
5834 (Version_script_info::add_exact_match): New function.
5835 (Version_script_info::build_expression_list_lookup): Remove lookup
5836 parameter. Add is_global parameter. Change all callers. Handle
5837 wildcard pattern specially. Unquote pattern. Call
5838 add_exact_match.
5839 (Version_script_info::get_name_to_match): New function.
5840 (Version_script_info::get_symbol_version): New function.
5841 (Version_script_info::get_symbol_version_helper): Remove.
5842 (Version_script_info::check_unmatched_names): Call unquote.
5843 * script.h (class Version_script_info): Change get_symbol_version
5844 to be non-inline and add is_global parameter; change all callers.
5845 Rewrite symbol_is_local. Update declarations. Define struct
5846 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5847 Remove globals_ and locals_ members. Add exact_, globs_,
5848 default_version_, is_global_.
5849 (Version_script_info::Glob): Remove pattern, add expression and
5850 is_global. Update constructor. Change all callers.
5851 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5852 default version.
5853 (Versions::symbol_section_contents): If a symbol is undefined, or
5854 defined in a dynamic object, set the version index to
5855 VER_NDX_LOCAL.
5856 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5857 symbol_is_local.
5858 (Symbol_table::add_from_pluginobj): Likewise.
5859 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5860
5861 2010-01-11 Doug Kwan <dougkwan@google.com>
5862
5863 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5864 (incremental_dump_LDADD): Add linking option for libintl.
5865 * Makefile.in: Regenerate.
5866
5867 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5868
5869 PR gold/11144
5870 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5871 instead of -Ds.
5872 * testsuite/Makefile.in: Regenerated.
5873
5874 2010-01-10 Doug Kwan <dougkwan@google.com>
5875
5876 * options.h (DEFINE_var): Use parentheses around argument varname__
5877 in macro body to avoid any unintended subsequent substitutions.
5878
5879 2010-01-10 Ian Lance Taylor <iant@google.com>
5880
5881 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5882 candidates before doing symbol resolution.
5883
5884 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5885 ODR candidates if only one is weak.
5886
5887 2010-01-08 Ian Lance Taylor <iant@google.com>
5888
5889 * script.cc (Version_script_info::build_expression_list_lookup):
5890 Don't warn about ambiguous version, just record the ambiguity.
5891 (Version_script_info::get_symbol_version_helper): Give error if
5892 version is ambiguous.
5893
5894 2010-01-08 Doug Kwan <dougkwan@google.com>
5895
5896 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5897 prev_data_size_ and prev_addralign_. Remove initializer for
5898 deleted data member has_been_changed_.
5899 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5900 to determine if the table is empty.
5901 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5902 Remove.
5903 (Stub_table::add_reloc_stub): Define method in class definition
5904 instead of just declaring it there.
5905 (Stub_table::add_cortex_a8_stub): New method definition.
5906 (Stub_table::update_data_size_and_addralign): Ditto.
5907 (Stub_table::finalize_stubs): Ditto.
5908 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5909 (Stub_table::do_addralign_): Return address alignment in the
5910 (Stub_table::do_reset_address_and_file_offset): Define method in
5911 class definition instead of declaring it there. Set current data
5912 size to be the data size of the previous pass.
5913 (Stub_table::set_final_data_size): Use current data size as the
5914 final data size.
5915 (Stub_table::relocate_stub): Change parameter type of stub from
5916 Reloc_stub pointer to Stub pointer.
5917 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5918 (Stub_table::Cortex_a8_stub_list): New typedef.
5919 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5920 Stub_table::prev_addralign_): New data member.
5921 (Arm_relobj::Arm_relobj): Initialize data member
5922 section_has_cortex_a8_workaround_.
5923 (Arm_relobj::section_has_cortex_a8_workaround,
5924 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5925 definitions.
5926 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5927 declarations.
5928 (Target_arm::relocate_stub): Change parameter type of stub from
5929 Reloc_stub pointer to Stub pointer.
5930 (Insn_template::size, Insn_template::alignment): Handle
5931 THUMB16_SPECIAL_TYPE.
5932 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5933 Stub_table::update_data_size_and_addralign,
5934 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5935 definitions.
5936 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5937 (Stub_table::do_write): Ditto.
5938 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5939
5940 2010-01-08 Ian Lance Taylor <iant@google.com>
5941
5942 PR 11108
5943 * symtab.h (class Symbol): Remove fields is_target_special_ and
5944 has_plt_offset_. Add field is_defined_in_discarded_section_.
5945 (Symbol::is_defined_in_discarded_section): New function.
5946 (Symbol::set_is_defined_in_discarded_section): New function.
5947 (Symbol::has_plt_offset): Rewrite.
5948 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5949 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5950 Don't initialize is_target_special_ or has_plt_offset_.
5951 Initialize is_defined_in_discarded_section_.
5952 (Symbol_table::add_from_relobj): If appropriate, set
5953 is_defined_in_discarded_section.
5954 * resolve.cc (Symbol::override_base_with_special): Don't test
5955 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5956 * target-reloc.h (relocate_section): Do special handling for
5957 symbols defined in discarded sections for global symbols as well
5958 as local symbols.
5959
5960 2010-01-08 Ian Lance Taylor <iant@google.com>
5961
5962 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5963 the SHT_SYMTAB case.
5964
5965 2010-01-08 Ian Lance Taylor <iant@google.com>
5966
5967 * object.cc (Sized_relobj::do_layout): Don't get confused if
5968 layout_eh_frame returns NULL.
5969
5970 2010-01-08 Ian Lance Taylor <iant@google.com>
5971
5972 PR 11084
5973 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5974 dynamic symbol table, use the normal symbol table.
5975 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5976 symbol table.
5977
5978 2010-01-08 Ian Lance Taylor <iant@google.com>
5979
5980 PR 11072
5981 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5982 sections.
5983
5984 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5985
5986 * version.cc (print_version): Change to "Copyright 2010".
5987
5988 2010-01-08 Ian Lance Taylor <iant@google.com>
5989
5990 PR 10287
5991 PR 11063
5992 * i386.cc (class Target_i386): Change return type of plt_section
5993 to be non-const.
5994 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5995 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5996 tls_desc_rel_ field.
5997 (Output_data_plt_i386::rel_tls_desc): New function.
5998 (Target_i386::rel_tls_desc_section): New function.
5999 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6000 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6001 R_386_TLS_DESC reloc in rel_tls_desc_section.
6002 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6003 Define struct Tlsdesc_info.
6004 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6005 (Target_x86_64::do_reloc_symbol_index): New function.
6006 (Target_x86_64::add_tlsdesc_info): New function.
6007 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6008 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6009 tlsdesc_rel_ field.
6010 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6011 all callers.
6012 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6013 (Target_x86_64::rela_tlsdesc_section): New function.
6014 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6015 handling.
6016 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6017 (Target_x86_64::do_reloc_addend): New function.
6018 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6019 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6020 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6021 (Output_reloc::type): New function.
6022 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6023 (Output_reloc::is_target_specific): New function.
6024 (Output_reloc::target_arg): New function.
6025 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6026 absolute relocs and target specific relocs.
6027 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6028 add_target_specific.
6029 (class Output_data_reloc) [SHT_RELA]: Likewise.
6030 * output.cc (Output_reloc::Output_reloc): Add four new versions
6031 for absolute relocs and target specific relocs.
6032 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6033 (Output_reloc::get_symbol_index): Likewise.
6034 (Output_reloc::local_section_offset): Check that local_sym_index_
6035 is not TARGET_CODE or 0.
6036 (Output_reloc::symbol_value): Likewise.
6037 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6038 reloc.
6039 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6040 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6041 functions.
6042 * layout.cc (add_target_dynamic_tags): Use output section for
6043 DT_PLTRELSZ and DT_JMPREL.
6044
6045 2010-01-07 Ian Lance Taylor <iant@google.com>
6046
6047 PR 11061
6048 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6049 function.
6050 (class Output_data_reloc_generic): Define.
6051 (class Output_data_reloc_base): Change base class to
6052 Output_data_reloc_generic. Change add() method to call
6053 bump_relative_reloc_count for a relative reloc. Remove
6054 sort_relocs_ field.
6055 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6056 to sort_relocs().
6057 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6058 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6059 appropriate.
6060 * layout.h (class Layout): Update declaration.
6061
6062 2010-01-07 Ian Lance Taylor <iant@google.com>
6063
6064 * output.h (class Output_data): Add const version of
6065 output_section and do_output_section.
6066 (class Output_section_data): Add const version of
6067 do_output_section.
6068 (class Output_section): Likewise.
6069 * layout.cc (Layout::add_target_dynamic_tags): New function.
6070 * layout.h (class Layout): Update declarations.
6071 * arm.cc (Target_arm::do_finalize_sections): Use
6072 add_target_dynamic_tags.
6073 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6074 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6075 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6076 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6077
6078 2010-01-07 Ian Lance Taylor <iant@google.com>
6079
6080 PR 11042
6081 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6082 object as needed.
6083
6084 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6085 Ian Lance Taylor <iant@google.com>
6086
6087 PR 11019
6088 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6089 Xindex::read_symtab_xindex.
6090
6091 2010-01-07 Doug Kwan <dougkwan@google.com>
6092
6093 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6094 (Insn_template::thumb16_bcond_insn): New method declaration.
6095 (Insn_template): Fix spelling.
6096 (Stub::thumb16_special): New method declaration.
6097 (Stub::do_write): Define virtual method which was previously pure
6098 virtual.
6099 (Stub::do_thumb16_special): New method declaration.
6100 (Stub::do_fixed_endian_write): New template member.
6101 (Reloc_stub::do_write): Remove.
6102 (Reloc_stub::do_fixed_endian_write): Remove.
6103 (Cortex_a8_stub): New class definition.
6104 (Stub_factory::make_cortex_a8_stub): New method definition.
6105 (Stub_factory::Stub_factory): Add missing static storage class
6106 qualifier for elf32_arm_stub_a8_veneer_blx.
6107
6108 2010-01-07 Ian Lance Taylor <iant@google.com>
6109
6110 PR 10980
6111 * options.h (class General_options): Add --warn-unresolved-symbols
6112 and --error-unresolved-symbols.
6113 * errors.cc (Errors::undefined_symbol): Implement
6114 --warn-unresolved-symbols.
6115
6116 * options.h (class General_options): Add -z text and -z textoff.
6117 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6118
6119 2010-01-06 Sriraman Tallam <tmsriram@google.com>
6120
6121 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6122 (Garbage_collection::cident_sections): New function.
6123 (Garbage_collection::add_cident_section): New function.
6124 (Garbage_collection::cident_sections_): New member.
6125 (gc_process_relocs): Add references to sections whose names are C
6126 identifiers.
6127 * gold.h (cident_section_start_prefix): New constant.
6128 (cident_section_stop_prefix): New constant.
6129 (is_cident): New function.
6130 * layout.cc (Layout::define_section_symbols): Replace string constants
6131 with the newly defined constants.
6132 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6133 C identifiers.
6134 * testsuite/Makefile.am: Add gc_orphan_section_test.
6135 * testsuite/Makefile.in: Regenerate.
6136 * testsuite/gc_orphan_section_test.cc: New file.
6137 * testsuite/gc_orphan_section_test.sh: New file.
6138
6139 2010-01-06 Ian Lance Taylor <iant@google.com>
6140
6141 PR 10980
6142 * options.h (class General_options): Add --warn-shared-textrel.
6143 * layout.cc (Layout::finish_dynamic_section): Implement
6144 --warn-shared-textrel.
6145
6146 PR 10980
6147 * options.h (class General_options): Add --warn-multiple-gp.
6148
6149 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6150
6151 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6152 $(THREADSLIB) and $(LIBDL).
6153 * Makefile.in: Rebuild.
6154
6155 2010-01-06 Ian Lance Taylor <iant@google.com>
6156
6157 PR 10980
6158 * options.cc (General_options::parse_section_start): New function.
6159 (General_options::section_start): New function.
6160 (General_options::General_options): Initialize all members.
6161 * options.h: Include <map>
6162 (class General_options): Add --section-start. Add section_starts_
6163 member.
6164 * layout.cc (Layout::attach_allocated_section_to_segment): If
6165 --section-start was used, set the address of the segment. Remove
6166 local sort_sections.
6167 (Layout::relaxation_loop_body): If the address of the load segment
6168 has been set by --section-start, don't use it.
6169 * output.h (Output_segment::update_flags_for_output_section): New
6170 function.
6171 * output.cc (Output_segment::add_output_section): Call
6172 update_flags_for_output_section.
6173
6174 2010-01-05 Ian Lance Taylor <iant@google.com>
6175
6176 PR 10980
6177 * options.h (class General_options): Add --undefined-version.
6178 * script.cc (struct Version_expression): Add was_matched_by_symbol
6179 field.
6180 (Version_script_info::matched_symbol): New function.
6181 (Version_script_info::get_symbol_version_helper): Call
6182 matched_symbol.
6183 (Version_script_info::check_unmatched_names): New function.
6184 * script.h (class Version_script_info): Update declarations.
6185 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6186
6187 * options.h (class General_options): Use DEFINE_bool_alias for
6188 allow_multiple_definition.
6189 * resolve.cc (Symbol_table::should_override): Don't test
6190 allow_multiple_definition.
6191
6192 PR 10980
6193 * options.h (class General_options): Add --cref.
6194 * main.cc (main): Print cref table if --cref. Don't close mapfile
6195 until after printing cref table.
6196 * cref.cc: Include "symtab.h".
6197 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6198 (Cref_table_compare::operator()): New function.
6199 (Cref_inputs::gather_cref): New function.
6200 (filecol): New static const.
6201 (Cref_inputs::print_cref): New function.
6202 (Cref::print_cref): New function.
6203 * cref.h: Include <cstdio>.
6204 (class Cref): Update declarations.
6205 * mapfile.h (Mapfile::file): New function.
6206 * object.h (class Object): Define Symbols. Declare virtual
6207 do_get_global_symbols.
6208 (Object::get_global_symbols): New function.
6209 * object.cc (Input_objects::add_object): Pass object to cref_ if
6210 --cref.
6211 (Input_objects::archive_start): Likewise.
6212 (Input_objects::archive_stop): Likewise.
6213 (Input_objects::print_cref): New function.
6214 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6215 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6216 --cref.
6217 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6218 function.
6219 * plugin.h (class Sized_pluginobj): Update declarations.
6220
6221 2010-01-05 Ian Lance Taylor <iant@google.com>
6222
6223 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6224 to is_default_version. Rename insdef to insdefault.
6225 (Symbol_table::add_from_relobj): Rename def to is_default_version
6226 and local to is_forced_local.
6227 (Symbol_table::add_from_pluginobj): Likewise.
6228 (Symbol_table::add_from_dynobj): Likewise.
6229 (Symbol_table::define_special_symbol): Rename insdef to
6230 insdefault.
6231
6232 2010-01-04 Ian Lance Taylor <iant@google.com>
6233
6234 PR 10980
6235 * options.h (class General_options): Add
6236 --allow-multiple-definition and -z muldefs.
6237 * resolve.cc (Symbol_table::should_override): Don't warn about a
6238 multiple symbol definition if --allow-multiple-definition or -z
6239 muldefs.
6240
6241 PR 10980
6242 * options.h (class General_options): Add --add-needed and
6243 --copy-dt-needed-entries. Tweak --as-needed help entry.
6244 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6245 error if --copy-dt-needed-entries aka --add-needed is used and
6246 would cause a change in behaviour.
6247
6248 PR 10980
6249 * options.h (class General_options): Add -G as a short version of
6250 --shared. Add no-op options -assert, -g, and -i.
6251
6252 2010-01-04 Sriraman Tallam <tmsriram@google.com>
6253
6254 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6255 check for .text or .gnu.linkonce.t sections.
6256 * icf.cc (Icf::find_identical_sections): Ditto.
6257 Change the detection for mangled function name within the section
6258 name.
6259 * icf.h (is_section_foldable_candidate): New function.
6260
6261 2009-12-30 Ian Lance Taylor <iant@google.com>
6262
6263 PR 10980
6264 * options.h (class General_options): Permit two dashes with
6265 --retain-symbols-file.
6266
6267 2009-12-30 Ian Lance Taylor <iant@google.com>
6268
6269 PR 10979
6270 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6271 don't put the file header and segment headers in the text
6272 segment.
6273
6274 PR 10979
6275 * common.cc (Sort_commons::operator()): Stabilize sort when both
6276 entries are NULL.
6277 (Symbol_table::do_allocate_commons_list): When allocating common
6278 symbols, skip a symbol which is no longer common.
6279 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6280 an object before checking its type.
6281 * testsuite/common_test_2.c: New file.
6282 * testsuite/common_test_3.c: New file.
6283 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6284 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6285 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6286 (common_test_2_pic.o, common_test_2.so): New targets.
6287 (common_test_3_pic.o, common_test_3.so): New targets.
6288 * testsuite/Makefile.in: Rebuild.
6289
6290 PR 10979
6291 * script.cc (read_input_script): If we see a new SECTIONS clause,
6292 and we have added an input section, give an error.
6293 * layout.h (class Layout): Add have_added_input_section function.
6294 Add have_added_input_section_ field.
6295 * layout.cc (Layout::Layout): Initialize
6296 have_added_input_section_.
6297 (Layout::layout): Set have_added_input_section_.
6298 (Layout::layout_eh_frame): Likewise.
6299
6300 2009-12-30 Ian Lance Taylor <iant@google.com>
6301
6302 PR 10931
6303 * options.h (class General_options): Add --sort-common option.
6304 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6305 * common.cc (Sort_common): Add sort_order parameter to
6306 constructor. Add sort_order_ field.
6307 (Sort_commons::operator): Check sort_order_.
6308 (Symbol_table::allocate_commons): Determine the sort order.
6309 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6310 Change all callers.
6311 (Symbol_table::do_allocate_commons_list): Likewise.
6312
6313 2009-12-30 Ian Lance Taylor <iant@google.com>
6314
6315 PR 10916
6316 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6317 symbols from this object, don't change the visibility of an
6318 undefined symbol.
6319 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6320
6321 2009-12-30 Ian Lance Taylor <iant@google.com>
6322
6323 PR 10861
6324 * script.h (class Version_script_info): Define Language enum.
6325 Update declarations. Define Glob, Exact, and Lookup types. Add
6326 new fields globals_, locals_, and is_finalized_.
6327 * script.cc: Various formatting fixes.
6328 (class Parser_closure): Change language_stack_ from a vector of
6329 std::string to one of Version_script_info::Language. Adjust all
6330 uses accordingly.
6331 (class Lazy_demangler): Remove.
6332 (struct Version_expression): Change language from std::string to
6333 Version_script_info::Language.
6334 (Version_script_info::Version_script_info): New function.
6335 (Version_script_info::~Version_script_info): Don't call clear.
6336 (Version_script_info::finalize): New function.
6337 (Version_script_info::build_lookup_tables): New function.
6338 (Version_script_info::build_expression_list_lookup): New
6339 function.
6340 (Version_script_info::get_symbol_version_helper): Rewrite to use
6341 lookup tables.
6342 (Version_script_info::print_expression_list): Adjust to use
6343 Version_script_info::Language.
6344 (script_push_lex_into_version_mode): Check that the version script
6345 has not been finalized.
6346 (version_script_push_lang): Change language string to
6347 Version_script_info::Language.
6348 * options.cc (Command_line::version_script): New function.
6349 * options.h (class General_options): Add finalize_dynamic_list
6350 function. Change version_script from declaration to definition.
6351 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6352 * testsuite/version_script.map: Remove duplicate def of foo.
6353 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6354 version_script.map.
6355 * testsuite/Makefile.in: Rebuild.
6356
6357 2009-12-30 Ian Lance Taylor <iant@google.com>
6358
6359 PR 10843
6360 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6361 if the input symbol index is 0, make the output symbol index 0.
6362
6363 2009-12-30 Ian Lance Taylor <iant@google.com>
6364
6365 PR 10670
6366 * options.h (class General_options): Add -x/--discard-all.
6367 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6368 --discard-all. If the local symbol needs a dynamic entry, check
6369 that before handling --discard-locals.
6370
6371 2009-12-30 Ian Lance Taylor <iant@google.com>
6372
6373 PR 10450
6374 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6375 flags to PF_R.
6376 (Output_segment::add_output_section): Don't change the flags if
6377 the type is PT_TLS.
6378
6379 PR 10450
6380 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6381 GNU hash table if they need a dynamic value. Otherwise, don't add
6382 them if they are defined in a dynamic object or are forced local.
6383
6384 2009-12-29 Ian Lance Taylor <iant@google.com>
6385
6386 PR 10450
6387 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6388 .gnu.hash table for a 32-bit target.
6389
6390 PR 10450
6391 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6392 regular and a dynamic object only needs a dynamic symbol table
6393 entry if it is externally visible.
6394
6395 PR 10450
6396 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6397 constructor. Add global_offset_table_ field.
6398 (Target_i386::got_section): Set global_offset_table_.
6399 (Target_i386::do_finalize_sections): Set global_offset_table_
6400 size.
6401 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6402 in constructor. Add global_offset_table_ field.
6403 (Target_x86_64::got_section): Set global_offset_table_.
6404 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6405 size.
6406
6407 * layout.cc (Layout::Layout): Initialize increase_relro_.
6408 (Layout::get_output_section): Add is_relro, is_last_relro, and
6409 is_first_non_relro parameters. Change all callers.
6410 (Layout::choose_output_section): Likewise.
6411 (Layout::add_output_section_data): Likewise.
6412 (Layout::make_output_section): Likewise.
6413 (Layout::set_segment_offsets): Clear increase_relro when using a
6414 linker script.
6415 * layout.h (class Layout): Add increase_relro method. Add
6416 increase_relro_ field. Update declarations.
6417 * output.cc (Output_section::Output_section): Initialize
6418 is_last_relro_ and is_first_non_relro_.
6419 (Output_segment::add_output_section): Group relro sections is
6420 do_sort is true. Handle is_last_relro and is_first_non_relro.
6421 (Output_segment::maximum_alignment): Remove relro handling.
6422 (Output_segment::set_section_addresses): Add increase_relro
6423 parameter. Change all callers. Add initial alignment to align
6424 relro sections on separate page. Remove old relro handling.
6425 (Output_segment::set_section_list_addresses): Remove in_relro
6426 parameter. Change all callers.
6427 (Output_segment::set_offset): Add increase parameter. Change all
6428 callers. Remove old relro handling.
6429 * output.h (class Output_section): Add new methods: is_last_relro,
6430 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6431 Add is_last_relro_ and is_first_non_relro_ fields.
6432 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6433 Create separate .got.plt section. Call increase_relro.
6434 * x86_64.cc (Target_x86_64::got_section): Likewise.
6435 * testsuite/relro_script_test.t: Add .got.plt.
6436
6437 PR 10450
6438 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6439 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6440 (Layout::finalize): Call set_dynamic_symbol_size.
6441 (Layout::set_dynamic_symbol_size): New function.
6442 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6443 set_dynamic_symbol_size.
6444
6445 PR 10450
6446 * output.h (class Output_section): Add is_entsize_zero_ field.
6447 * output.cc (Output_section::Output_section): Initialize
6448 is_entsize_zero_.
6449 (Output_section::set_entsize): If two different entsizes are
6450 requested, force it to zero.
6451 (Output_section::add_input_section): Set flags for .debug_str
6452 before updating section flags. Set entsize.
6453 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6454 and SHF_STRING if all input sections have those flags.
6455
6456 2009-12-29 Rafael Espindola <espindola@google.com>
6457
6458 * main.cc (main): Fix the sys time reporting.
6459 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6460 reporting.
6461
6462 2009-12-29 Sriraman Tallam <tmsriram@google.com>
6463
6464 * options.cc (General_options::parse_version): Allow -v to exit
6465 without an error if there is nothing to link.
6466
6467 2009-12-29 Ian Lance Taylor <iant@google.com>
6468
6469 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6470 using a version of gcc before 4.1.
6471 * configure: Rebuild.
6472
6473 2009-12-28 Chris Demetriou <cgd@google.com>
6474
6475 * attributes.cc (Output_attributes_section_data::do_write): Use
6476 std::vector::front rather than std::vector::data.
6477
6478 2009-12-28 Ian Lance Taylor <iant@google.com>
6479
6480 * symtab.h (class Symbol_table): Add enum Defined.
6481 * resolve.cc (Symbol_table::should_override): Add defined
6482 parameter. Change all callers. Test whether object is NULL
6483 before calling a method on it.
6484 (Symbol_table::report_resolve_problem): Add defined parameter.
6485 Change all callers.
6486 (Symbol_table::should_override_with_special): Likewise.
6487 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6488 parameter. Change all callers.
6489 (Symbol_table::do_define_in_output_data): Likewise.
6490 (Symbol_table::define_in_output_segment): Likewise.
6491 (Symbol_table::do_define_in_output_segment): Likewise.
6492 (Symbol_table::define_as_constant): Likewise.
6493 (Symbol_table::do_define_as_constant): Likewise.
6494 * script.h (class Symbol_assignment): Add is_defsym parameter to
6495 constructor; change all callers.
6496 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6497 parameter. Change all callers. Add is_defsym_ field.
6498 (class Parser_closure): Add parsing_defsym parameter to
6499 constructor; change all callers. Add parsing_defsym accessor
6500 function. Add parsing_defsym_ field.
6501
6502 2009-12-28 Ian Lance Taylor <iant@google.com>
6503
6504 * gold.cc (queue_middle_tasks): Fix formatting.
6505 * object.cc (Relobj::is_section_name_included): Likewise.
6506
6507 2009-12-23 Ian Lance Taylor <iant@google.com>
6508
6509 * i386.cc (Target_i386::do_calls_non_split): Recognize
6510 -fsplit-stack prologue for a function with a static chain.
6511 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6512 -fsplit-stack prologue when using %r11.
6513
6514 2009-12-21 Sriraman Tallam <tmsriram@google.com>
6515
6516 * options.cc (General_options::parse_version): Make -v continue and do
6517 the link like GNU ld does.
6518
6519 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
6520
6521 * Makefile.am (CCFILES): Add timer.cc.
6522 (HFILES): Add timer.h.
6523 * configure.ac: Check for sysconf and times.
6524 * main.cc: include timer.h.
6525 (main): Use Timer instead of get_run_time.
6526 * timer.cc: New.
6527 * timer.h: New.
6528 * workqueue.cc: include timer.h.
6529 (Workqueue::find_and_run_task):
6530 Report user, sys and wall time.
6531 * Makefile.in: Regenerate.
6532 * config.in: Regenerate.
6533 * configure: Regenerate.
6534
6535 2009-12-16 Doug Kwan <dougkwan@google.com>
6536
6537 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6538 sections.
6539 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6540 relaxed input sections.
6541 * output.cc (Output_section::find_relaxed_input_section): Change
6542 return type to Output_relaxed_input_section pointer. Adjust code
6543 for new type of relaxed_input_section_map_.
6544 * output.h (Output_section::find_relaxed_input_section): Change
6545 return type to Output_relaxed_input_section pointer.
6546 (Output_section::Output_relaxed_input_section_by_input_section_map):
6547 New type.
6548 (Output_section::relaxed_input_section_map_): Change type to
6549 Output_section::Output_relaxed_input_section_by_input_section_map.
6550 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6551 input section.
6552
6553 2009-12-15 Ian Lance Taylor <iant@google.com>
6554
6555 * layout.cc (Layout::create_shstrtab): Only write out after input
6556 sections if we are compressing debug sections.
6557
6558 2009-12-15 Ian Lance Taylor <iant@google.com>
6559
6560 * archive.cc (Archive::add_symbols): Only look up a symbol without
6561 a version if there is, in fact, a version.
6562
6563 2009-12-14 Ian Lance Taylor <iant@google.com>
6564
6565 Revert -Wshadow changes, all changes from:
6566 2009-12-11 Doug Kwan <dougkwan@google.com>
6567 2009-12-11 Nick Clifton <nickc@redhat.com>
6568 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6569
6570 2009-12-11 Doug Kwan <dougkwan@google.com>
6571
6572 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6573 due to -Wshadow.
6574 * attributes.cc (Object_attribute::size): Ditto.
6575 (Attributes_section_data::size): Ditto.
6576 (Attributes_section_data::Attributes_section_data): Ditto.
6577 (Output_attributes_section_data::do_write): Ditto.
6578 * attributes.h (Object_attribute::set_type): Ditto.
6579 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6580
6581 2009-12-11 Nick Clifton <nickc@redhat.com>
6582
6583 * archive.cc: Fix shadowed variable warnings.
6584 * arm.cc: Likewise.
6585 * compressed_output.cc: Likewise.
6586 * compressed_output.h: Likewise.
6587 * configure: Likewise.
6588 * dwarf_reader.cc: Likewise.
6589 * dynobj.cc: Likewise.
6590 * dynobj.h: Likewise.
6591 * ehframe.cc: Likewise.
6592 * ehframe.h: Likewise.
6593 * errors.cc: Likewise.
6594 * expression.cc: Likewise.
6595 * fileread.cc: Likewise.
6596 * fileread.h: Likewise.
6597 * freebsd.h: Likewise.
6598 * i386.cc: Likewise.
6599 * icf.cc: Likewise.
6600 * incremental.h: Likewise.
6601 * layout.cc: Likewise.
6602 * layout.h: Likewise.
6603 * mapfile.cc: Likewise.
6604 * merge.cc: Likewise.
6605 * merge.h: Likewise.
6606 * object.cc: Likewise.
6607 * object.h: Likewise.
6608 * options.h: Likewise.
6609 * output.cc: Likewise.
6610 * output.h: Likewise.
6611 * parameters.cc: Likewise.
6612 * plugin.cc: Likewise.
6613 * powerpc.cc: Likewise.
6614 * reduced_debug_output.cc: Likewise.
6615 * reduced_debug_output.h: Likewise.
6616 * reloc.cc: Likewise.
6617 * reloc.h: Likewise.
6618 * resolve.cc: Likewise.
6619 * script-sections.cc: Likewise.
6620 * script.cc: Likewise.
6621 * script.h: Likewise.
6622 * sparc.cc: Likewise.
6623 * symtab.cc: Likewise.
6624 * symtab.h: Likewise.
6625 * target-select.cc: Likewise.
6626 * target-select.h: Likewise.
6627 * token.h: Likewise.
6628 * workqueue.cc: Likewise.
6629 * workqueue.h: Likewise.
6630 * x86_64.cc: Likewise.
6631
6632 2009-12-10 Doug Kwan <dougkwan@google.com>
6633
6634 * arm.cc (attributes.h): New include.
6635 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6636 (Arm_relobj::~Arm_relobj): Delete object pointed by
6637 attributes_section_data_.
6638 (Arm_relobj::attributes_section_data): New method definition.
6639 (Arm_relobj::attributes_section_data_): New data member declaration.
6640 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6641 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6642 attributes_section_data_.
6643 (Arm_dynobj::attributes_section_data): New method definition.
6644 (Arm_dynobj::attributes_section_data_): New data member declaration.
6645 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6646 initialization value of may_use_blx_ to false.
6647 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6648 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6649 object attributes to compute results instead of hard-coding.
6650 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6651 Target_arm::get_secondary_compatible_arch,
6652 Target_arm::set_secondary_compatible_arch
6653 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6654 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6655 New method declarations.
6656 (Target_arm::get_aeabi_object_attribute): New method definition.
6657 (Target_arm::attributes_section_data_): New data member declaration.
6658 (read_arm_attributes_section): New template definition.
6659 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6660 (Arm_dynobj::do_read_symbols): Ditto.
6661 (Target_arm::do_finalize_sections): Merge attributes sections from
6662 input. Check for BLX use after attributes section merging.
6663 Fix __exidx_start and __exidx_end visibility. Create an
6664 .ARM.attributes section if necessary.
6665 (Target_arm::get_secondary_compatible_arch,
6666 Target_arm::set_secondary_compatible_arch,
6667 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6668 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
6669 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
6670 New method definitions.
6671
6672 2009-12-09 Ian Lance Taylor <iant@google.com>
6673
6674 * plugin.cc (Plugin::load): Don't cast from void* to a function
6675 pointer.
6676
6677 2009-12-09 Ian Lance Taylor <iant@google.com>
6678
6679 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6680 information fields.
6681
6682 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6683
6684 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6685 Replace two_file_shared_1.so with two_file_shared_2.so.
6686 * testsuite/Makefile.in: Regenerated.
6687
6688 2009-12-08 Doug Kwan <dougkwan@google.com>
6689
6690 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6691 (HFILES): Add attributes.h and int_encoding.h.
6692 * Makefile.in: Regenerate.
6693 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6694 function definitions to int_encoding.cc
6695 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6696 prototypes to int_encoding.h
6697 * reduced_debug_output.cc (int_encoding.h): New include.
6698 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6699 function definitions to int_encoding.cc
6700 (insert_into_vector, read_from_pointer): Move template definitions to
6701 int_encoding.h
6702 * attributes.cc: New file.
6703 * attributes.h: New file.
6704 * int_encoding.cc: New file.
6705 * int_encoding.h: New file.
6706
6707 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
6708
6709 PR gold/11055
6710 * incremental-dump.cc (dump_incremental_inputs): New.
6711 (main): Use dump_incremental_inputs.
6712
6713 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6714
6715 PR gold/10893
6716 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6717 checking elfcpp::STT_FUNC.
6718 (Target_i386::Relocate::relocate): Likewise.
6719 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6720
6721 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6722 symbols from shared libraries into normal FUNC symbols.
6723
6724 * symtab.h (Symbol): Add is_func and use it.
6725
6726 2009-12-05 Doug Kwan <dougkwan@google.com>
6727
6728 * arm.cc (Target_arm::arm_info): Initialize new fields
6729 attributes_section and attributes_vendor.
6730 * i386.cc (Target_i386::i386_info): Same.
6731 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6732 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6733 fields attributes_section and attributes_vendor.
6734 * sparc.cc (Target_sparc::sparc_info): Same.
6735 * target.h (Target::attributes_section, Target::attributes_vendor,
6736 Target::is_attributes_section, Target::attribute_arg_type,
6737 Target::attributes_order): New method definitions.
6738 (Target::Target_info::attributes_section,
6739 Target::Target_info::attributes_vendor): New fields.
6740 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6741 virtual method definitions.
6742 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6743 attributes_section and attributes_vendor.
6744 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6745
6746 2009-12-05 Doug Kwan <dougkwan@google.com>
6747
6748 * arm.cc: Update comments about interworking and stub generation.
6749 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6750 considered as non-PIC.
6751 (Arm_relocate_functions::base_abs): Fix formatting.
6752 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6753 of function to use GOT entry address instead of offset.
6754 (Target_arm::Scan::global): Issue an error if a symbol would need a
6755 PLT does not get one because it is untyped. Remove code to create
6756 dynamic symbols for relative branches.
6757 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6758 takes unsigned integer instead of boolean.
6759
6760 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6761
6762 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6763 (two_file_test_LDADD): Likewise.
6764 (common_test_1_LDADD): Likewise.
6765 (exception_test_LDADD) Likewise.
6766 (weak_test_LDADD): Likewise.
6767 (many_sections_test_LDADD): Likewise.
6768 (initpri1_LDADD): Likewise.
6769 (script_test_1_LDADD): Likewise.
6770 (script_test_2_LDADD): Likewise.
6771 (justsyms_LDADD): Likewise.
6772 (binary_test_LDADD): Likewise.
6773 (large_LDADD): Likewise.
6774 * testsuite/Makefile.in: Regenerated.
6775
6776 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
6777
6778 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6779 (Symbol_table::override_with_special): Likewise.
6780 (Symbol_table::add_from_object): Likewise.
6781
6782 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6783
6784 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6785 Don't set the data_offset twice.
6786
6787 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6788
6789 * testsuite/Makefile.in: Regenerate.
6790
6791 2009-12-03 Doug Kwan <dougkwan@google.com>
6792
6793 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6794 (Target_arm::do_finalize_sections): Add parameter for symbol table
6795 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6796 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6797 parameter for symbol table pointer.
6798 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6799 an additional parameter for a pointer to symbol table.
6800 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6801 parameter for a symbol table pointer.
6802 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6803 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6804 Ditto.
6805 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6806 parameter for a symbol table pointer.
6807
6808 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
6809
6810 * incremental.cc (Incremental_inputs_header)
6811 (Incremental_inputs_header_write, Incremental_inputs_entry)
6812 (Incremental_inputs_entry_write): Move ...
6813 * incremental.h (Incremental_inputs_header)
6814 (Incremental_inputs_header_write, Incremental_inputs_entry)
6815 (Incremental_inputs_entry_write): here.
6816
6817 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6818
6819 * incremental.cc (make_sized_incremental_binary): Set the target.
6820 Error if it is incompatible.
6821 * output.h (Output_file): Add filename method.
6822
6823 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6824
6825 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6826 from the get_* methods.
6827
6828 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6829
6830 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6831 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6832 Write 0 for the data_offset of scripts.
6833
6834 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6835
6836 * testsuite/Makefile.am: Add the incremental_test.sh test.
6837 * testsuite/incremental_test.sh: New.
6838 * testsuite/incremental_test_1.c: New.
6839 * testsuite/incremental_test_2.c: New.
6840
6841 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
6842
6843 * incremental-dump.cc (main): Fix typos.
6844
6845 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
6846
6847 PR gold/11025
6848 * incremental-dump.cc (main): Use llu to print 64 bit values.
6849
6850 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6851 H.J. Lu <hongjiu.lu@intel.com>
6852
6853 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6854 $(LIBDL).
6855 (incremental_dump_LDADD): Likewise.
6856 * Makefile.in: Regenerated.
6857
6858 2009-11-25 Doug Kwan <dougkwan@google.com>
6859
6860 Revert:
6861
6862 2009-11-25 Doug Kwan <dougkwan@google.com>
6863
6864 * arm.cc (Target_arm::Target_arm): Move method definition
6865 outside of class definition. Add code to handle
6866 --target1-rel, --target1-abs and --target2= options.
6867 (Target_arm::get_reloc_reloc_type): Change method to be
6868 non-static and const.
6869 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6870 New data member declaration.
6871 (Target_arm::Scan::local, Target_arm::Scan::global,
6872 Target_arm::Relocate::relocate,
6873 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6874 Adjust call to Target_arm::get_real_reloc_type.
6875 (Target_arm::get_real_reloc_type): Use command line options
6876 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6877 * options.h (--target1-rel, --target1-abs, --target2): New
6878 ARM-only options.
6879
6880 2009-11-25 Doug Kwan <dougkwan@google.com>
6881
6882 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6883 class definition. Add code to handle --target1-rel, --target1-abs
6884 and --target2= options.
6885 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6886 and const.
6887 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6888 member declaration.
6889 (Target_arm::Scan::local, Target_arm::Scan::global,
6890 Target_arm::Relocate::relocate,
6891 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6892 call to Target_arm::get_real_reloc_type.
6893 (Target_arm::get_real_reloc_type): Use command line options to
6894 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6895 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6896 options.
6897
6898 2009-11-25 Doug Kwan <dougkwan@google.com>
6899
6900 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6901 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6902 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6903 formatting.
6904 (Arm_relocate_functions::thm_call): Replace body with a call to
6905 Arm_relocate_functions::thumb_branch_common.
6906 (Arm_relocate_functions::thm_jump24,
6907 Arm_relocate_functions::thm_xpc22): New method definitions.
6908 (Arm_relocate_functions::thumb_branch_common): New method definition.
6909 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6910 operator.
6911 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6912 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6913
6914 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
6915
6916 * Makefile.am: Build incremental-dump
6917 * Makefile.in: Regenerate.
6918 * incremental-dump.cc: New.
6919 * incremental.cc (Incremental_inputs_header_data,
6920 Incremental_inputs_entry_data): Move to incremental.h
6921 * incremental.h: (Incremental_inputs_header_data,
6922 Incremental_inputs_entry_data): Move from incremental.cc
6923
6924 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
6925
6926 * incremental.cc (Incremental_inputs_header,
6927 Incremental_inputs_header_write, Incremental_inputs_entry,
6928 Incremental_inputs_entry_write): Add a typedef with the data type.
6929
6930 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
6931
6932 * incremental.cc (Incremental_inputs_header,
6933 Incremental_inputs_header_write, Incremental_inputs_entry,
6934 Incremental_inputs_entry_write): Update comment about which
6935 type has the filed descriptions.
6936
6937 2009-11-15 Doug Kwan <dougkwan@google.com>
6938
6939 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6940 (Arm_relocate_functions::arm_branch_common): Change method defintion
6941 in class definition to a method declaration and update list of formal
6942 parameters.
6943 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6944 Arm_relocation_functions::jump24): Adjust call to
6945 Arm_relocate_functions::arm_branch_common. Update list of formal
6946 parameters.
6947 (Arm_relocate_functions::xpc25): New method definition.
6948 (Arm_relocate_functions::arm_branch_common): Move method defintion
6949 out from class definition. Use stubs for mode-switching and extending
6950 branch ranges.
6951 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6952 specially. Change code to enable use of stubs in ARM branches.
6953
6954 2009-11-10 Doug Kwan <dougkwan@google.com>
6955
6956 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6957 in method declaration.
6958 (Target_arm::relocate_stub): New method declaration.
6959 (Target_arm::default_target): Change to return a pointer instead of
6960 a const reference.
6961 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6962 Target_arm::default_target.
6963 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6964 method definition.
6965 (Target_arm::relocate_section): Adjust view.
6966 (Target_arm::relocate_stub): New method definition.
6967
6968 2009-11-10 Doug Kwan <dougkwan@google.com>
6969
6970 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6971 a format warning.
6972 * incremental.cc (open_incremental_binary): Initialized local
6973 variables to avoid warnings.
6974 * object.cc (make_elf_object): Ditto.
6975 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6976 a format warning.
6977
6978 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6979
6980 PR gold/10930
6981 * testsuite/plugin_test.c: Include "config.h".
6982
6983 2009-11-09 Doug Kwan <dougkwan@google.com>
6984
6985 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6986 (arm_symbol_value): Remove.
6987 (Arm_relocate_functions::arm_branch_common,
6988 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6989 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6990 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6991 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6992 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6993 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6994 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6995 Arm_relocate_functions::thm_mobw_abs_nc,
6996 Arm_relocate_functions::thm_mov_abs,
6997 Arm_relocate_functions::movw_prel_nc,
6998 Arm_relocate_functions::thm_movt_abs,
6999 Arm_relocate_functions::movt_prel,
7000 Arm_relocate_functions::thm_movw_prel_nc,
7001 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7002 (Target_arm::Relocate::relocate): Only decompose address into two
7003 parts if relocation type uses the thumb-bit and pass the actual
7004 bit instead of a flag indicating that the thumb-bit is used. Adjust
7005 calls to methods in Arm_relocate_functions for this change.
7006
7007 2009-11-08 Ian Lance Taylor <iant@google.com>
7008
7009 PR 10925
7010 * reloc.cc: Instantiate
7011 Sized_relobj::initialize_input_to_output_maps and
7012 Sized_relobj:free_input_to_output_maps.
7013
7014 2009-11-06 Ian Lance Taylor <iant@google.com>
7015
7016 PR 10876
7017 * defstd.cc (in_segment): Set only_if_ref true for "end".
7018
7019 2009-11-06 Doug Kwan <dougkwan@google.com>
7020
7021 * arm.cc (class Reloc_stub): Correct a comment.
7022 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7023 (Target_arm::scan_section_for_stubs): New method declaration.
7024 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7025 Change methods from private to protected.
7026 (Target_arm::do_may_relax): New method definition.
7027 (Target_arm::do_relax, Target_arm::group_sections,
7028 Target_arm::scan_reloc_for_stub,
7029 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7030 (Target_arm::arm_input_section_map_): New data member declaration.
7031 (Target_arm::scan_reloc_for_stub,
7032 Target_arm::scan_reloc_section_for_stubs,
7033 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7034 Target_arm::do_relax): New method definitions.
7035
7036 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7037
7038 * configure.ac: Check for (struct stat)::st_mtim
7039 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7040 * config.in: Regenerate.
7041 * configure: Regenerate.
7042
7043 2009-11-05 Ian Lance Taylor <iant@google.com>
7044
7045 PR 10910
7046 * output.cc (Output_segment::add_output_section): Add missing
7047 return statement.
7048
7049 2009-11-04 Ian Lance Taylor <iant@google.com>
7050
7051 PR 10880
7052 * object.h (class Object): Add is_needed and set_is_needed
7053 methods. Add is_needed_ field. Make bool fields into bitfields.
7054 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7055 defined in a dynamic object and referenced by a regular object,
7056 set is_needed for the dynamic object.
7057 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7058 if the file is marked with as_needed and it is not needed.
7059
7060 2009-11-04 Ian Lance Taylor <iant@google.com>
7061
7062 PR 10887
7063 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7064 tags if data is discarded by linker script.
7065 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7066 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7067 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7068 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7069
7070 2009-11-04 Ian Lance Taylor <iant@google.com>
7071
7072 * layout.cc (Layout::get_output_section): Add is_interp and
7073 is_dynamic_linker_section parameters. Change all callers.
7074 (Layout::choose_output_section): Likewise.
7075 (Layout::make_output_section): Likewise.
7076 (Layout::add_output_section_data): Add is_dynamic_linker_section
7077 parameter. Change all callers.
7078 * layout.h (class Layout): Update declarations.
7079 * output.h (class Output_section): Add is_interp, set_is_interp,
7080 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7081 Add is_interp_, is_dynamic_linker_section_ fields. Change
7082 generate_code_fills_at_write_ to a bitfield.
7083 * output.cc (Output_section::Output_sections): Initialize new
7084 fields.
7085 (Output_segment::add_output_section): Add do_sort parameter.
7086 Change all callers.
7087
7088 2009-11-03 Ian Lance Taylor <iant@google.com>
7089
7090 PR 10860
7091 * options.h (class General_options): Add --warn-common.
7092 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7093 merging two common symbols.
7094 (Symbol_table::should_override): Handle --warn-common when merging
7095 a common symbol with a defined symbol. Use report_resolve_problem
7096 for multiple definitions.
7097 (Symbol_table::report_resolve_problem): New function.
7098 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7099
7100 2009-11-03 Doug Kwan <dougkwan@google.com>
7101
7102 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7103 stub_factory_.
7104 (Target_arm::stub_factory): New method definition.
7105 (Target_arm::new_arm_input_section,
7106 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7107 Target_arm::reloc_uses_thumb_bit): New method declarations.
7108 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
7109 New type definitions.
7110 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7111 member declarations.
7112 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7113 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7114 New method definitions.
7115
7116 2009-11-03 Ian Lance Taylor <iant@google.com>
7117
7118 * options.h (class General_options): Add --warn_constructors.
7119
7120 2009-11-03 Ian Lance Taylor <iant@google.com>
7121
7122 PR 10893
7123 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7124 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7125
7126 2009-11-03 Ian Lance Taylor <iant@google.com>
7127
7128 PR 10895
7129 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7130 --msgid-bugs-address.
7131 (install-pdf): New target.
7132 (install-data_yes): Look up one directory to find mkinstalldirs.
7133
7134 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7135
7136 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7137 tree.
7138
7139 2009-10-30 Doug Kwan <dougkwan@google.com>
7140
7141 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7142
7143 2009-10-30 Doug Kwan <dougkwan@google.com>
7144
7145 * arm.cc (Stub_addend_reader): New struct template definition
7146 and partial specializations.
7147 (Stub_addend_reader::operator()): New method definition for a
7148 partially specialized template.
7149
7150 2009-10-30 Doug Kwan <dougkwan@google.com>
7151
7152 * arm.cc (Arm_relobj::processor_specific_flags): New method
7153 definition.
7154 (Arm_relobj::do_read_symbols): New method declaration.
7155 (Arm_relobj::processor_specific_flags_): New data member declaration.
7156 (Arm_dynobj): New class definition.
7157 (Target_arm::do_finalize_sections): Add input_objects parameter.
7158 (Target_arm::do_adjust_elf_header): New method declaration.
7159 (Target_arm::are_eabi_versions_compatible,
7160 (Target_arm::merge_processor_specific_flags): New method declaration.
7161 (Target_arm::do_make_elf_object): New overloaded method definitions
7162 and declaration.
7163 (Arm_relobj::do_read_symbols): New method definition.
7164 (Arm_dynobj::do_read_symbols): Ditto.
7165 (Target_arm::do_finalize_sections): Add input_objects parameters.
7166 Merge processor-specific flags from all input objects.
7167 (Target_arm::are_eabi_versions_compatible,
7168 Target_arm::merge_processor_specific_flags,
7169 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7170 New method definitions.
7171 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7172 Input_objects pointer type parameter.
7173 * layout.cc (Layout::finalize): Pass input objects to target's.
7174 finalize_sections function.
7175 * output.cc (Output_file_header::do_sized_write): Set ELF file
7176 header's processor-specific flags.
7177 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7178 Input_objects pointer type parameter.
7179 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7180 * target.h (Input_objects): New forward class declaration.
7181 (Target::processor_specific_flags,
7182 Target::are_processor_specific_flags_sect): New method definitions.
7183 (Target::finalize_sections): Add input_objects parameter.
7184 (Target::Target): Initialize processor_specific_flags_ and
7185 are_processor_specific_flags_set_.
7186 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7187 parameter.
7188 (Target::set_processor_specific_flags): New method definition.
7189 (Target::processor_specific_flags_,
7190 Target::are_processor_specific_flags_set_): New data member
7191 declarations.
7192 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7193 Input_objects pointer type parameter.
7194
7195 2009-10-30 Doug Kwan <dougkwan@google.com>
7196
7197 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7198
7199 2009-10-28 Ian Lance Taylor <iant@google.com>
7200
7201 * object.h (class Relobj): Drop options parameter from
7202 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7203 do_scan_relocs, do_relocate. Change all callers.
7204 (class Sized_relobj): Drop options parameters from
7205 do_gc_process_relocs, do_scan_relocs, do_relocate,
7206 do_relocate_sections, relocate_sections, emit_relocs_scan,
7207 emit_relocs_scan_reltype. Change all callers.
7208 (struct Relocate_info): Remove options field and all references to
7209 it.
7210 * reloc.h (class Read_relocs): Remove options constructor
7211 parameter and options_ field. Change all callers.
7212 (class Gc_process_relocs, class Scan_relocs): Likewise.
7213 (class Relocate_task): Likewise.
7214 * target-reloc.h (scan_relocs): Remove options parameter. Change
7215 all callers.
7216 (scan_relocatable_relocs): Likewise.
7217 * target.h (class Sized_target): Remove options parameter from
7218 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7219 all callers.
7220 * gc.h (gc_process_relocs): Remove options parameter. Change all
7221 callers.
7222 * arm.cc: Update functions to remove options parameters.
7223 * i386.cc: Likewise.
7224 * powerpc.cc: Likewise.
7225 * sparc.cc: Likewise.
7226 * x86_64.cc: Likewise.
7227 * testsuite/testfile.cc: Likewise.
7228
7229 2009-10-28 Doug Kwan <dougkwan@google.com>
7230
7231 * arm.cc (Arm_relobj): New class definition.
7232 (Arm_relobj::scan_sections_for_stubs,
7233 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7234 New method definitions.
7235
7236 2009-10-28 Cary Coutant <ccoutant@google.com>
7237
7238 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7239 (Plugin::cleanup_done_): New member.
7240 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7241 (Plugin_manager::cleanup_done_): Remove.
7242 (Plugin_manager::add_input_file): Edit error message.
7243 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7244 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7245
7246 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7247
7248 * fileread.cc: (File_read::View::~View): Use the new
7249 data_ownership_ filed.
7250 (File_read::~File_read): Dispose the new whole_file_view_.
7251 (File_read::open): Mmap the whole file if needed.
7252 (File_read::open): Use whole_file_view_ instead of contents_.
7253 (File_read::find_view): Use whole_file_view_ if applicable.
7254 (File_read::do_read): Use whole_file_view_ instead of contents_.
7255 (File_read::make_view): Use whole_file_view_ instead of contents_,
7256 update File_read::View::View call.
7257 (File_read::find_or_make_view): Update File_read::View::View
7258 call.
7259 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7260 remove contents_
7261 (File_read::View::Data_ownership): New enum.
7262 (File_read::View::View): Replace bool mapped_ with Data_ownership
7263 argument.
7264 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7265 (File_read::View::data_ownership_): New field.
7266 (File_read::contents_): Remove (replaced by whole_file_view_).
7267 (File_read::whole_file_view_): New field.
7268 * options.h (class General_options): Add --keep-files-mapped.
7269
7270 2009-10-27 Cary Coutant <ccoutant@google.com>
7271
7272 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7273 * testsuite/Makefile.am (plugin_test_5): New test case.
7274 * testsuite/Makefile.in: Regenerate.
7275
7276 2009-10-25 Doug Kwan <dougkwan@google.com>
7277
7278 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7279 from private to protected to allow access by child class.
7280 (Sized_relobj::do_relocate_sections): New method declaration.
7281 (Sized_relobj::relocate_sections): Virtualize.
7282 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
7283 Sized_relobj::relocate_sections. Instantiate template explicitly
7284 for different target sizes and endianity.
7285
7286 2009-10-24 Doug Kwan <dougkwan@google.com>
7287
7288 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7289 (Arm_input_section::as_arm_input_section): New method.
7290 (Arm_output_section): New class definition.
7291 (Arm_output_section::create_stub_group,
7292 Arm_output_section::group_sections): New method definitions.
7293
7294 2009-10-22 Doug Kwan <dougkwan@google.com>
7295
7296 * arm.cc (Arm_input_section): New class definition.
7297 (Arm_input_section::init, Arm_input_section:do_write,
7298 Arm_input_section::set_final_data_size,
7299 Arm_input_section::do_reset_address_and_file_offset): New method
7300 definitions.
7301
7302 2009-10-21 Doug Kwan <dougkwan@google.com>
7303
7304 * arm.cc (Stub_table, Arm_input_section): New forward class
7305 declarations.
7306 (Stub_table): New class defintion.
7307 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7308 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7309 New method definition.
7310
7311 2009-10-21 Doug Kwan <dougkwan@google.com>
7312
7313 * arm.cc: Update copyright comments.
7314 (Target_arm): New forward class template declaration.
7315 (Arm_address): New type.
7316 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7317 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7318 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7319 constants.
7320 (Insn_template): Same.
7321 (DEF_STUBS): New macro.
7322 (Stub_type): New enum type.
7323 (Stub_template): New class definition.
7324 (Stub): Same.
7325 (Reloc_stub): Same.
7326 (Stub_factory): Same.
7327 (Target_arm::Target_arm): Initialize may_use_blx_ and
7328 should_force_pic_veneer_.
7329 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7330 Target_arm::should_force_pic_veneer,
7331 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7332 Target_arm::using_thumb_only, Target_arm:;default_target): New
7333 method defintions.
7334 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7335 New data member declarations.
7336 (Insn_template::size, Insn_template::alignment): New method defintions.
7337 (Stub_template::Stub_template): New method definition.
7338 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7339 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7340 (Stub_factory::Stub_factory): New method definition.
7341 * gold.h (string_hash): New template.
7342 * output.h (Input_section_specifier::hash_value): Use
7343 gold::string_hash.
7344 (Input_section_specifier::string_hash): Remove.
7345 * stringpool.cc (Stringpool_template::string_hash): Use
7346 gold::string_hash.
7347
7348 2009-10-20 Doug Kwan <dougkwan@google.com>
7349
7350 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7351 symbols of relaxed input sections.
7352 * output.h (Output_section::find_relaxed_input_section): Make
7353 method public.
7354
7355 2009-10-16 Doug Kwan <dougkwan@google.com>
7356
7357 * dynobj.cc (Versions::Versions): Initialize version_script_.
7358 Only insert base version symbol definition for a shared object
7359 if version script defines any version versions.
7360 (Versions::define_base_version): New method definition.
7361 (Versions::add_def): Check that base version is not needed.
7362 (Versions::add_need): Define base version lazily.
7363 * dynobj.h (Versions::define_base_version): New method declaration.
7364 (Versions::needs_base_version_): New data member declaration.
7365 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7366 (check_DATA): Add no_version_test.stdout.
7367 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7368 New make rules.
7369 * testsuite/Makefile.in: Regenerate.
7370 * testsuite/no_version_test.c: New file.
7371 * testsuite/no_version_test.sh: Ditto.
7372
7373 2009-10-16 Doug Kwan <dougkwan@google.com>
7374
7375 * expression.cc (class Segment_start_expression): New class definition.
7376 (Segment_start_expression::value): New method definition.
7377 (script_exp_function_segment_start): Return a new
7378 Segment_start_expression.
7379 * gold/script-c.h (script_saw_segment_start_expression): New function
7380 prototype.
7381 * script-sections.cc (Script_sections::Script_sections): Initialize
7382 SAW_SEGMENT_START_EXPRESSION_ to false.
7383 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7384 and -Tbbs options to specify section addresses if given in
7385 command line and no SEGMENT_START expression is seen in a script.
7386 * script-sections.h (Script_sections::saw_segment_start_expression,
7387 Script_sections::set_saw_segment_start_expression): New method
7388 definition.
7389 (Script_sections::saw_segment_start_expression_): New data member
7390 declaration.
7391 * script.cc (script_saw_segment_start_expression): New function.
7392 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7393 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7394 script_test_7.sh and script_test_8.sh.
7395 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7396 script_test_8.stdout.
7397 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7398 (script_test_6, script_test_6.stdout, script_test_7,
7399 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7400 * Makefile.in: Regenerate.
7401 * testsuite/script_test_6.sh: New file.
7402 * testsuite/script_test_6.t: Same.
7403 * testsuite/script_test_7.sh: Same.
7404 * testsuite/script_test_7.t: Same.
7405 * testsuite/script_test_8.sh: Same.
7406
7407 2009-10-16 Doug Kwan <dougkwan@google.com>
7408
7409 * output.cc (Output_segment::set_section_list_address): Cast
7410 expressions to unsigned long long type to avoid format warnings.
7411
7412 2009-10-15 Ian Lance Taylor <iant@google.com>
7413
7414 * script.cc (Script_options::add_symbol_assignment): Always add a
7415 dot assignment to script_sections_.
7416 * script-sections.cc (Script_sections::add_dot_assignment):
7417 Initialize if necessary.
7418
7419 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7420 program headers with no load segment if there is a linker script.
7421
7422 * layout.cc (Layout::set_segment_offsets): Align the file offset
7423 to the segment aligment for -N or -n with no load segment.
7424 * output.cc (Output_segment::add_output_section): Don't crash if
7425 the first section is a TLS section.
7426 (Output_segment::set_section_list_addresses): Print an error
7427 message if the address moves backward in a linker script.
7428 * script-sections.cc
7429 (Output_section_element_input::set_section_addresses): Don't
7430 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7431 (Orphan_output_section::set_section_addresses): Likewise.
7432
7433 2009-10-15 Doug Kwan <dougkwan@google.com>
7434
7435 * layout.cc (Layout::finish_dynamic_section): Generate tags
7436 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7437 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7438 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7439
7440 2009-10-14 Ian Lance Taylor <iant@google.com>
7441
7442 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7443 fields.
7444 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7445 data_shdr fields of relinfo.
7446 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7447 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7448 R_386_TLS_LDO_32, adjust based on section flags.
7449 (Target_i386::Relocate::fix_up_ldo): Remove.
7450
7451 2009-10-13 Ian Lance Taylor <iant@google.com>
7452
7453 Add support for -pie.
7454 * options.h (class General_options): Add -pie and
7455 --pic-executable.
7456 (General_options::output_is_position_independent): Test -pie.
7457 (General_options::output_is_executable): Return true if not shared
7458 and not relocatable.
7459 (General_options::output_is_pie): Remove.
7460 * options.cc (General_options::finalize): Reject incompatible uses
7461 of -pie.
7462 * gold.cc (queue_middle_tasks): A -pie link is not static.
7463 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7464 * symtab.cc (Symbol::final_value_is_known): Return false if
7465 output_is_position_independent.
7466 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7467 output_is_position_independent.
7468 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7469 output_is_position_independent.
7470 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7471 output_is_position_independent.
7472 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7473 two_file_pie_test.
7474 (basic_pie_test.o, basic_pie_test): New targets.
7475 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7476 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7477 (two_file_pie_test): New target.
7478 * testsuite/Makefile.in: Rebuild.
7479 * README: Remove note saying that -pie is not supported.
7480
7481 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7482
7483 * options.h (class General_options): Add -init and -fini.
7484 * layout.cc (Layout::finish_dynamic_section): Emit
7485 given init and fini functions.
7486
7487 2009-10-13 Sriraman Tallam <tmsriram@google.com>
7488
7489 * gc.h (gc_process_relocs): Check if icf is enabled using new
7490 function.
7491 * gold.cc (queue_initial_tasks): Likewise.
7492 (queue_middle_tasks): Likewise.
7493 * object.cc (do_layout): Likewise.
7494 * symtab.cc (is_section_folded): Likewise.
7495 * main.cc (main): Likewise.
7496 * reloc.cc (Read_relocs::run): Likewise.
7497 (Sized_relobj::do_scan_relocs): Likewise.
7498 * icf.cc (is_function_ctor_or_dtor): New function.
7499 (Icf::find_identical_sections): Check if function is ctor or dtor when
7500 safe icf is chosen.
7501 * options.h (General_options::icf): Change option to be an enum.
7502 (Icf_status): New enum.
7503 (icf_enabled): New method.
7504 (icf_safe_folding): New method.
7505 (set_icf_status): New method.
7506 (icf_status_): New variable.
7507 * (options.cc) (General_options::finalize): Set icf_status_.
7508 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7509 icf_test and icf_keep_unique_test to use the --icf enum flag.
7510 * testsuite/icf_safe_test.sh: New file.
7511 * testsuite/icf_safe_test.cc: New file.
7512
7513 2009-10-12 Sriraman Tallam <tmsriram@google.com>
7514
7515 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7516 includes to gc.h and icf.h.
7517 * arm.cc: Include gc.h.
7518 * gold.cc: Likewise.
7519 * i386.cc: Likewise.
7520 * powerpc.cc: Likewise.
7521 * sparc.cc: Likewise.
7522 * x86_64.cc: Likewise.
7523 * gc.h: Include icf.h.
7524
7525 2009-10-11 Ian Lance Taylor <iant@google.com>
7526
7527 * plugin.cc: Include "gold.h" before other header files.
7528
7529 2009-10-10 Chris Demetriou <cgd@google.com>
7530
7531 * options.h (Input_file_argument::Input_file_type): New enum.
7532 (Input_file_argument::is_lib_): Replace with...
7533 (Input_file_argument::type_): New member.
7534 (Input_file_argument::Input_file_argument): Take Input_file_type
7535 'type' rather than boolean 'is_lib' as second argument.
7536 (Input_file_argument::is_lib): Use type_.
7537 (Input_file_argument::is_searched_file): New function.
7538 (Input_file_argument::may_need_search): Handle is_searched_file.
7539 * options.cc (General_options::parse_library): Support -l:filename.
7540 (General_options::parse_just_symbols): Update for Input_file_argument
7541 changes.
7542 (Command_line::process): Likewise.
7543 * archive.cc (Archive::get_file_and_offset): Likewise.
7544 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7545 * script.cc (read_script_file, script_add_file): Likewise.
7546 * fileread.cc (Input_file::Input_file): Likewise.
7547 (Input_file::will_search_for): Handle is_searched_file.
7548 (Input_file::open): Likewise.
7549 * readsyms.cc (Read_symbols::get_name): Likewise.
7550 * testsuite/Makefile.am (searched_file_test): New test.
7551 * testsuite/Makefile.in: Regenerate.
7552 * testsuite/searched_file_test.cc: New file.
7553 * testsuite/searched_file_test_lib.cc: New file.
7554
7555 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7556 Ian Lance Taylor <iant@google.com>
7557
7558 * descriptor.cc: Include <cstdio> and "binary-io.h".
7559 (Descriptors::open): Open the files in binary mode always.
7560 * script.cc (Lex::get_token): Treat \r as whitespace.
7561
7562 2009-10-09 Ian Lance Taylor <iant@google.com>
7563
7564 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7565
7566 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7567 Ian Lance Taylor <iant@google.com>
7568
7569 * configure.ac: Check for readv function also.
7570 * fileread.cc (readv): Define if not HAVE_READV.
7571 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7572 does not exist.
7573 * config.in: Regenerate.
7574 * configure: Regenerate.
7575
7576 2009-10-09 Doug Kwan <dougkwan@google.com>
7577
7578 * layout.cc (Layout::make_output_section): Call target hook to make
7579 ordinary output section.
7580 (Layout::finalize): Adjust parameter list of call the
7581 Target::may_relax().
7582 * layout.h (class Layout::section_list): New method.
7583 * merge.h (Output_merge_base::entsize): Change visibility to public.
7584 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7585 New methods.
7586 (Output_merge_string::do_is_string): New method.
7587 * object.cc (Sized_relobj::do_setup): renamed from
7588 Sized_relobj::set_up.
7589 * object.h (Sized_relobj::adjust_shndx,
7590 Sized_relobj::initializ_input_to_output_maps,
7591 Sized_relobj::free_input_to_output_maps): Change visibilities to
7592 protected.
7593 (Sized_relobj::setup): Virtualize.
7594 (Sized_relobj::do_setup): New method declaration.
7595 (Sized_relobj::invalidate_section_offset,
7596 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7597 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7598 * options.cc (parse_int): New function.
7599 * options.h (parse_int): New declaration.
7600 (DEFINE_int): New macro.
7601 (stub_group_size): New option.
7602 * output.cc (Output_section::Output_section): Initialize memebers
7603 merge_section_map_, merge_section_by_properties_map_,
7604 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7605 (Output_section::add_input_section): Handled deferred code-fill
7606 generation and remove an old comment.
7607 (Output_section::add_relaxed_input_section): New method definition.
7608 (Output_section::add_merge_input_section): Use merge section by
7609 properties map to speed to search. Update merge section maps
7610 as appropriate.
7611 (Output_section::build_relaxation_map): New method definition.
7612 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7613 Same.
7614 (Output_section::relax_input_section): Renamed to
7615 Output_section::convert_input_sections_to_relaxed_sections and change
7616 interface to take a vector of pointers to relaxed sections.
7617 (Output_section::find_merge_section,
7618 Output_section::find_relaxed_input_section): New method definitions.
7619 (Output_section::is_input_address_mapped,
7620 Output_section::output_offset, Output_section::output_address):
7621 Use output section data maps to speed up searching.
7622 (Output_section::find_starting_output_address): Add comments.
7623 (Output_section::do_write,
7624 Output_section::write_to_postprocessing_buffer): Do code-fill
7625 generation as appropriate.
7626 (Output_section::get_input_sections): Invalidate relaxed input section
7627 map.
7628 (Output_section::restore_states): Adjust type of checkpoint .
7629 Invalidate relaxed input section map.
7630 * output.h (Output_merge_base): New class declaration.
7631 (Input_section_specifier): New class defintion.
7632 (class Output_relaxed_input_section) Change base class to
7633 Output_section_data_build.
7634 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7635 base class initializer.
7636 (Output_section::add_relaxed_input_section): New method declaration.
7637 (Output_section::Input_section): Change visibility to protected.
7638 (Output_section::Input_section::relobj,
7639 Output_section::Input_section::shndx): Handle relaxed input sections.
7640 Output_section::input_sections) Change visibility to protected. Also
7641 define overload to return a non-const pointer.
7642 (Output_section::Merge_section_properties): New class defintion.
7643 (Output_section::Merge_section_by_properties_map,
7644 Output_section::Output_section_data_by_input_section_map,
7645 Output_section::Relaxation_map): New types.
7646 (Output_section::relax_input_section): Rename method to
7647 Output_section::convert_input_sections_to_relaxed_sections and change
7648 interface to take a vector of relaxed section pointers.
7649 (Output_section::find_merge_section,
7650 Output_section::find_relaxed_input_section,
7651 Output_section::build_relaxation_map,
7652 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7653 New method declarations.
7654 (Output_section::merge_section_map_
7655 Output_section::merge_section_by_properties_map_,
7656 Output_section::relaxed_input_section_map_,
7657 Output_section::is_relaxed_input_section_map_valid_,
7658 Output_section::generate_code_fills_at_write_): New data members.
7659 * script-sections.cc
7660 (Output_section_element_input::set_section_addresses): Call
7661 current_data_size and addralign methods of relaxed input sections.
7662 (Orphan_output_section::set_section_addresses): Call current_data_size
7663 and addralign methods of relaxed input sections.
7664 * symtab.cc (Symbol_table::compute_final_value): Extract template
7665 from the body of Symbol_table::sized_finalize_symbol.
7666 (Symbol_table::sized_finalized_symbol): Call
7667 Symbol_table::compute_final_value.
7668 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7669 (Symbol_table::compute_final_value): New templated method declaration.
7670 * target.cc (Target::do_make_output_section): New method defintion.
7671 * target.h (Target::make_output_section): New method declaration.
7672 (Target::relax): Add more parameters for input objects, symbol table
7673 and layout. Adjust call to do_relax.
7674 (Target::do_make_output_section): New method declaration.
7675 (Target::do_relax): Add parameters for input objects, symbol table
7676 and layout.
7677
7678 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7679
7680 * pread.c: Include stdio.h.
7681
7682 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7683
7684 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7685 defined.
7686
7687 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7688
7689 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7690 Change read_shndx type to unsigned int.
7691 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7692 int.
7693 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7694 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7695 Change read_shndx type to unsigned int.
7696 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7697 int.
7698 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7699 * layout.cc (Layout::create_symtab_sections): Cast the result of
7700 local_symcount * symsize to off_t in the gold_assert.
7701
7702 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7703
7704 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7705 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7706 R_ARM_BASE_ABS.
7707 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7708 (Arm_relocate_functions::thm_abs5): New function.
7709 (Arm_relocate_functions::abs12): New function.
7710 (Arm_relocate_functions::abs16): New function.
7711 (Arm_relocate_functions::base_abs): New function.
7712 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7713 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7714 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7715 R_ARM_BASE_ABS.
7716 (Scan::global): Likewise.
7717 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7718 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7719 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7720 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7721 R_ARM_BASE_ABS.
7722
7723 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7724
7725 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7726 (Arm_relocate_functions::movt_prel): New function.
7727 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7728 (Arm_relocate_functions::thm_movt_prel): New function.
7729 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7730 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7731 (Scan::global, Relocate::relocate): Likewise.
7732 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7733
7734 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7735
7736 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7737 Incremental_checker.
7738 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7739 unsigned int.
7740 (class Incremental_inputs_header): New class.
7741 (Incremental_inputs_header_writer): Edit comment.
7742 (Incremental_inputs_entry): New class.
7743 (Incremental_inputs_entry_writer): Edit comment.
7744 (Sized_incremental_binary::do_find_incremental_inputs_section):
7745 Add *strtab_shndx parameter, fill it.
7746 (Sized_incremental_binary::do_check_inputs): New method.
7747 (Incremental_checker::can_incrementally_link_output_file): Use
7748 Sized_incremental_binary::check_inputs.
7749 (Incremental_inputs::report_command_line): Save command line in
7750 command_line_.
7751 * incremental.h:
7752 (Incremental_binary::find_incremental_inputs_section): New
7753 method.
7754 (Incremental_binary::do_find_incremental_inputs_section): Add
7755 strtab_shndx parameter.
7756 (Incremental_binary::do_check_inputs): New pure virtual method.
7757 (Sized_incremental_binary::do_check_inputs): Declare.
7758 (Incremental_checker::Incremental_checker): Add incremental_inputs
7759 parameter, use it to initialize incremental_inputs_.
7760 (Incremental_checker::incremental_inputs_): New field.
7761 (Incremental_checker::command_line): New method.
7762 (Incremental_checker::inputs): New method.
7763 (Incremental_checker::command_line_): New field.
7764
7765 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7766
7767 * incremental.cc: Include <cstdarg> and "target-select.h".
7768 (vexplain_no_incremental): New function.
7769 (explain_no_incremental): New function.
7770 (Incremental_binary::error): New method.
7771 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7772 method.
7773 (make_sized_incremental_binary): New function.
7774 (open_incremental_binary): New function.
7775 (can_incrementally_link_file): Add checks if output is ELF and has
7776 inputs section.
7777 * incremental.h: Include "elfcpp_file.h" and "output.h".
7778 (Incremental_binary): New class.
7779 (Sized_incremental_binary): New class.
7780 (open_incremental_binary): Declare.
7781 * object.cc (is_elf_object): Use
7782 elfcpp::Elf_recognizer::is_elf_file.
7783 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7784 * output.h (Output_file::filesize): New method.
7785
7786 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7787
7788 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7789 New function.
7790 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7791 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7792 function.
7793 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7794 function.
7795 (Arm_relocate_functions::movw_abs_nc): New function.
7796 (Arm_relocate_functions::movt_abs): New function.
7797 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7798 (Arm_relocate_functions::thm_movt_abs): New function.
7799 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7800 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7801 (Scan::global): Likewise.
7802 (Relocate::relocate): Likewise.
7803 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7804
7805 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7806
7807 * arm.cc (Arm_relocate_functions::got_prel) New function.
7808 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7809 (Relocate::relocate): Likewise.
7810 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7811
7812 2009-10-06 Ian Lance Taylor <iant@google.com>
7813
7814 * options.h (class General_options): Define
7815 split_stack_adjust_size parameter.
7816 * object.h (class Object): Add uses_split_stack_ and
7817 has_no_split_stack_ fields. Add uses_split_stack and
7818 has_no_split_stack accessor functions. Declare
7819 handle_split_stack_section.
7820 (class Reloc_symbol_changes): Define.
7821 (class Sized_relobj): Define Function_offsets. Declare
7822 split_stack_adjust, split_stack_adjust_reltype, and
7823 find_functions.
7824 * object.cc (Object::handle_split_stack_section): New function.
7825 (Sized_relobj::do_layout): Call handle_split_stack_section.
7826 * dynobj.cc (Sized_dynobj::do_layout): Call
7827 handle_split_stack_section.
7828 * reloc.cc (Sized_relobj::relocate_sections): Call
7829 split_stack_adjust for executable sections in split_stack
7830 objects. Pass reloc_map to relocate_section.
7831 (Sized_relobj::split_stack_adjust): New function.
7832 (Sized_relobj::split_stack_adjust_reltype): New function.
7833 (Sized_relobj::find_functions): New function.
7834 * target-reloc.h: Include "object.h".
7835 (relocate_section): Add reloc_symbol_changes parameter. Change
7836 all callers.
7837 * target.h (class Target): Add calls_non_split method. Declare
7838 do_calls_non_split virtual method. Declare match_view and
7839 set_view_to_nop.
7840 * target.cc: Include "elfcpp.h".
7841 (Target::do_calls_non_split): New function.
7842 (Target::match_view): New function.
7843 (Target::set_view_to_nop): New function.
7844 * gold.cc (queue_middle_tasks): Give an error if mixing
7845 split-stack and non-split-stack objects with -r.
7846 * i386.cc (Target_i386::relocate_section): Add
7847 reloc_symbol_changes parameter.
7848 (Target_i386::do_calls_non_split): New function.
7849 * x86_64.cc (Target_x86_64::relocate_section): Add
7850 reloc_symbol_changes parameter.
7851 (Target_x86_64::do_calls_non_split): New function.
7852 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7853 parameter.
7854 * powerpc.cc (Target_powerpc::relocate_section): Add
7855 reloc_symbol_changes parameter.
7856 * sparc.cc (Target_sparc::relocate_section): Add
7857 reloc_symbol_changes parameter.
7858 * configure.ac: Call AM_CONDITIONAL for the default target.
7859 * configure: Rebuild.
7860 * testsuite/Makefile.am (TEST_AS): New variable.
7861 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7862 (check_DATA): Add split_i386 and split_x86_64 files.
7863 (SPLIT_DEFSYMS): Define.
7864 (split_i386_[1234n].o): New targets.
7865 (split_i386_[124]): New targets.
7866 (split_i386_[1234r].stdout): New targets.
7867 (split_x86_64_[1234n].o): New targets.
7868 (split_x86_64_[124]): New targets.
7869 (split_x86_64_[1234r].stdout): New targets.
7870 (MOSTLYCLEANFILES): Add new executables.
7871 * testsuite/split_i386.sh: New file.
7872 * testsuite/split_x86_64.sh: New file.
7873 * testsuite/split_i386_1.s: New file.
7874 * testsuite/split_i386_2.s: New file.
7875 * testsuite/split_i386_3.s: New file.
7876 * testsuite/split_i386_4.s: New file.
7877 * testsuite/split_i386_n.s: New file.
7878 * testsuite/split_x86_64_1.s: New file.
7879 * testsuite/split_x86_64_2.s: New file.
7880 * testsuite/split_x86_64_3.s: New file.
7881 * testsuite/split_x86_64_4.s: New file.
7882 * testsuite/split_x86_64_n.s: New file.
7883 * testsuite/testfile.cc (Target_test): Update relocation_section
7884 function.
7885 * testsuite/Makefile.in: Rebuild.
7886
7887 2009-10-06 Ian Lance Taylor <iant@google.com>
7888
7889 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7890 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7891 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7892 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7893 the address on ldo_addrs_.
7894 (Target_i386::Relocate::fix_up_ldo): New function.
7895
7896 2009-10-06 Rafael Espindola <espindola@google.com>
7897
7898 * plugin.cc (add_input_library): New.
7899 (Plugin::load): Add add_input_library to tv.
7900 (Plugin_manager::add_input_file): Add the is_lib argument.
7901 (add_input_file): Update call to Plugin_manager::add_input_file.
7902 (add_input_library): New.
7903 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7904
7905 2009-09-30 Doug Kwan <dougkwan@google.com>
7906
7907 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7908 symbol and call Symbol::may_need_copy_reloc to determine if
7909 a copy reloc is needed.
7910 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7911 nocopyreloc is given in command line.
7912 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7913 given in command line.
7914 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7915 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7916 of the removed Target_i386::may_need_copy_reloc.
7917 * options.h (copyreloc): New option with default value false.
7918 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7919 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7920 instead of the removed Target_powerpc::may_need_copy_reloc.
7921 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7922 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7923 instead of the removed Target_sparc::may_need_copy_reloc.
7924 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7925 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7926 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7927 instead of the removed Target_x86_64::may_need_copy_reloc.
7928
7929 2009-09-30 Ian Lance Taylor <iant@google.com>
7930
7931 * object.h (class Object): Remove target_ field, and target,
7932 sized_target, and set_target methods.
7933 (Object::sized_target): Remove.
7934 (class Sized_relobj): Update declarations. Remove sized_target.
7935 * object.cc (Sized_relobj::setup): Remove target parameter.
7936 Change all callers.
7937 (Input_objects::add_object): Don't do anything with the target.
7938 (make_elf_sized_object): Add punconfigured parameter. Change all
7939 callers. Set or test parameter target.
7940 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7941 Change all callers.
7942 * parameters.cc (Parameters::set_target): Change parameter type to
7943 be non-const.
7944 (Parameters::default_target): Remove.
7945 (set_parameters_target): Change parameter type to be non-const.
7946 (parameters_force_valid_target): New function.
7947 (parameters_clear_target): New function.
7948 * parameters.h (class Parameters): Update declarations. Remove
7949 default_target method. Add sized_target and clear_target
7950 methods. Change target_ to be non-const.
7951 (set_parameters_target): Update declaration.
7952 (parameters_force_valid_target): Declare.
7953 (parameters_clear_target): Declare.
7954 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7955 as NULL if we aren't searching.
7956 (Add_symbols::run): Don't check for compatible target.
7957 * fileread.cc (Input_file::open_binary): Call
7958 parameters_force_valid_target.
7959 * gold.cc (queue_middle_tasks): Likewise.
7960 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7961 set_target on object.
7962 * dynobj.h (class Sized_dynobj): Update declarations.
7963 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7964 make_elf_object returns NULL.
7965 (Archive::include_member): Don't check whether object target is
7966 compatible.
7967 * output.cc (Output_section::add_input_section): Get target from
7968 parameters.
7969 (Output_section::relax_input_section): Likewise.
7970 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7971 parameters.
7972 (Sized_relobj::do_scan_relocs): Likewise.
7973 (Sized_relobj::relocate_sections): Likewise.
7974 * resolve.cc (Symbol_table::resolve): Likewise.
7975 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7976 parameter. Change all callers.
7977 (Symbol_table::add_from_object): Get target from parameters.
7978 (Symbol_table::add_from_relobj): Don't check object target.
7979 (Symbol_table::add_from_dynobj): Likewise.
7980 (Symbol_table::define_special_symbol): Get target from
7981 parameters.
7982 * symtab.h (class Symbol_table): Update declaration.
7983 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7984 parameter. Change all callers. Clear parameter target.
7985 (Binary_test): Test target here.
7986 * testsuite/object_unittest.cc (gold_testsuite): Remove
7987 target_test_pointer parameter. Change all callers.
7988 (Object_test): Test target here.
7989
7990 2009-09-26 Ian Lance Taylor <iant@google.com>
7991
7992 * testsuite/initpri1.c: Don't try to use constructor priorities if
7993 compiling with gcc before 4.3.
7994
7995 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7996
7997 * testsuite/retain_symbols_file_test.sh (check_present): Change
7998 output file name to retain_symbols_file_test.stdout.
7999 (check_absent): Likewise.
8000
8001 2009-09-18 Craig Silverstein <csilvers@google.com>
8002
8003 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8004 * options.cc: Include <cerrno> and <fstream>.
8005 (General_options::finalize): Parse -retain-symbols-file tag.
8006 * options.h: New flag.
8007 (General_options): New method should_retain_symbol, new
8008 variable symbols_to_retain.
8009 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8010 should_retain_symbol map.
8011 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8012 * testsuite/Makefile.in: Regenerate.
8013 * testsuite/retain_symbols_file_test.sh: New file.
8014
8015 2009-09-18 Nick Clifton <nickc@redhat.com>
8016
8017 * po/es.po: Updated Spanish translation.
8018
8019 2009-09-17 Doug Kwan <dougkwan@google.com>
8020
8021 * debug.h (DEBUG_RELAXATION): New constant.
8022 (DEBUG_ALL): Add DEBUG_RELAXATION.
8023 (debug_string_to_enum): Add relaxation debug option.
8024 * layout.cc
8025 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8026 Layout::Relaxation_debug_check::read_sections,
8027 Layout::Relaxation_debug_check::read_sections): New method definitions.
8028 (Layout::Layout): Initialize data members
8029 record_output_section_data_from_scrips_,
8030 script_output_section_data_list_ and relaxation_debug_check_.
8031 (Layout::save_segments, Layout::restore_segments,
8032 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8033 Layout::relaxation_loop_body): New method definitions.
8034 (Layout::finalize): Support relaxation. Move section layout code to
8035 Layout::relaxation_loop_body.
8036 (Layout::set_asection_address_from_script): Move code for orphan
8037 section placement out.
8038 (Layout::place_orphan_sections_in_script): New method definition.
8039 * layout.h (Output_segment_headers, Output_file_header):
8040 New forward class declarations.
8041 (Layout::~Layout): Define.
8042 (Layout::new_output_section_data_from_script): New method definition.
8043 (Layout::place_orphan_sections_in_script): New method declaration.
8044 (Layout::Segment_states): New type declaration.
8045 (Layout::save_segments, Layout::restore_segments,
8046 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8047 Layout::relaxation_loop_body): New method declarations.
8048 (Layout::Output_section_data_list): New type declaration.
8049 (Layout::Relaxation_debug_check): New class definition.
8050 (Layout::record_output_section_data_from_script_,
8051 Layout::script_output_section_data_list_, Layout::segment_states_,
8052 Layout::relaxation_debug_check_): New data members.
8053 * output.cc: (Output_section_headers::do_size): New method definition.
8054 (Output_section_headers::Output_section_headers): Move size
8055 computation to Output_section_headers::do_size.
8056 (Output_segment_headers::do_size): New method definition.
8057 (Output_file_header::Output_file_header): Move size computation to
8058 Output_file_header::do_size and call it.
8059 (Output_file_header::do_size): New method definition.
8060 (Output_data_group::Output_data_group): Adjust call to
8061 Output_section_data.
8062 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8063 (Output_symtab_xindex::do_write): Add array bound check.
8064 (Output_section::Input_section::print_to_mapfile): Handle
8065 RELAXED_INPUT_SECTION_CODE.
8066 (Output_section::Output_section): Initialize data member checkpoint_.
8067 (Output_section::~Output_section): Delete checkpoint object pointed
8068 by checkpoint_.
8069 (Output_section::add_input_section): Always add an Input_section if
8070 relaxing.
8071 (Output_section::add_merge_input_section): Add assert.
8072 (Output_section::relax_input_section): New method definition.
8073 (Output_section::set_final_data_size): Set load address to zero for
8074 an unallocated section.
8075 (Output_section::do_address_and_file_offset_have_reset_values):
8076 New method definition.
8077 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8078 Handle relaxed input section.
8079 (Output_section::sort_attached_input_sections): Checkpoint input
8080 section list lazily.
8081 (Output_section::get_input_sections): Change type of input_sections to
8082 list of Simple_input_section pointers. Checkpoint input section list
8083 lazily. Also handle relaxed input sections.
8084 (Output_section::add_input_section_for_script): Take a reference to
8085 a Simple_input_section object instead of Relobj pointer and section
8086 index as parameter. Handle relaxed input sections.
8087 (Output_section::save_states, Output_section::restore_states): New
8088 method definitions.
8089 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8090 (Output_data::is_data_size_fixed): New method definition.
8091 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8092 if it is fixed.
8093 (Output_data::address_and_file_offset_have_reset_values): New method
8094 definition.
8095 (Output_data::do_address_and_file_offset_have_reset_values): New method
8096 definition.
8097 (Output_data::set_data_size): Check that data size is not fixed.
8098 (Output_data::fix_data_size): New method definition.
8099 (Output_data::is_data_size_fixed_): New data member.
8100 (Output_section_headers::set_final_data_size): New method definition.
8101 (Output_section_headers::do_size): New method declaration.
8102 (Output_segment_headers::set_final_data_size): New method definition.
8103 (Output_segment_headers::do_size): New method declaration.
8104 (Output_file_header::set_final_data_size)::New method definition.
8105 (Output_file_header::do_size)::New method declaration.
8106 (Output_section_data::Output_section_data): Add new parameter
8107 is_data_size_fixed and use it to fix data size.
8108 (Output_data_const::Output_data_const): Adjust call to base class
8109 constructor and fix data size.
8110 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8111 base class constructor and fix data size.
8112 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8113 base class constructor and fix data size.
8114 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8115 class constructor and fix data size.
8116 (Output_data_group::set_final_data_size): New method definition.
8117 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8118 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8119 class constructor and fix data size.
8120 (Output_relaxed_input_section): New class definition.
8121 (Output_section::Simple_input_section): New class definition.
8122 (Output_section::get_input_sections): Adjust parameter list.
8123 (Output_section::add_input_section_for_script): Same.
8124 (Output_section::save_states, Output_section::restore_states,
8125 Output_section::do_address_and_file_offset_have_reset_values,
8126 (Output_section::Input_section::Input_section): Handle
8127 RELAXED_INPUT_SECTION_CODE. Add new overload for
8128 Output_relaxed_input_section.
8129 (Output_section::Input_section::is_input_section,
8130 Output_section::Input_section::set_output_section): Handle relaxed
8131 input section.
8132 (Output_section::Input_section::is_relaxed_input_section,
8133 Output_section::Input_section::output_section_data,
8134 Output_section::Input_section::relaxed_input_section): New method
8135 definitions.
8136 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8137 value.
8138 (Output_section::Input_section::u1_): Update comments.
8139 (Output_section::Input_section::u2_): Add new union member poris.
8140 (Output_section::Checkpoint_output_section): New classs definition.
8141 (Output_section::relax_input_section): New method declaration.
8142 (Output_section::checkpoint_): New data member.
8143 (Output_segment): Update comments.
8144 (Output_segment::Output_segment): Un-privatize copy constructor.
8145 (Output_segment::operator=): Un-privatize.
8146 * script-sections.cc (Output_section_element::Input_section_list):
8147 Change element type to Output_section::Simple_input_section.
8148 (Output_section_element_dot_assignment::set_section_addresses):
8149 Register output section data for relaxation clean up.
8150 (Output_data_exression::Output_data_expression): Adjust call to base
8151 constructor to fix data size.
8152 (Output_section_element_data::set_section_addresses): Register
8153 Output_data_expression object for relaxation clean up.
8154 (struct Input_section_info): Replace Relobj pointer and section index
8155 pair with Output_section::Simple_input_section and Convert struct to a
8156 class.
8157 (Input_section_sorter::operator()): Adjust access to
8158 Input_section_info data member to use accessors.
8159 (Output_section_element_input::set_section_addresses): Use layout
8160 parameter. Adjust code to use Output_section::Simple_input_section
8161 and Input_secction_info classes. Register filler for relaxation
8162 clean up.
8163 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8164 and section index pair with Output_section::Simple_input_section
8165 class. Adjust code accordingly.
8166 (Phdrs_element::release_segment): New method definition.
8167 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8168 segment list.
8169 (Script_sections::release_segments): New method definition.
8170 * gold/script-sections.h (Script_sections::release_segments): New
8171 method declaration.
8172 * gold/target.h (Target::may_relax, Target::relax,
8173 Target::do_may_relax, Target::do_relax): New method definitions.
8174
8175 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8176
8177 * arm.cc (has_signed_unsigned_overflow): New function.
8178 (Arm_relocate_functions::abs8): New function.
8179 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8180 (Target_arm::Scan::global): Likewise.
8181 (Target_arm::relocate::relocate): Likewise.
8182 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8183 Likewise.
8184
8185 2009-09-16 Cary Coutant <ccoutant@google.com>
8186
8187 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8188 * testsuite/Makefile.in: Regenerate.
8189
8190 2009-09-11 Nick Clifton <nickc@redhat.com>
8191
8192 * po/gold.pot: Updated by the Translation project.
8193
8194 2009-09-08 Cary Coutant <ccoutant@google.com>
8195
8196 * output.cc (Output_file::open): Add execute permission to empty file.
8197 * testsuite/Makefile.am (permission_test): New test.
8198 * testsuite/Makefile.in: Regenerate.
8199
8200 2009-09-02 Ian Lance Taylor <iant@google.com>
8201
8202 * output.cc (Output_file::resize): Call map_no_anonymous rather
8203 than map.
8204
8205 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8206
8207 * gold.cc: Include "incremental.h".
8208 (queue_initial_tasks): Call Incremental_checker methods.
8209 * incremental.cc: Include "output.h".
8210 (Incremental_checker::can_incrementally_link_output_file): New
8211 method.
8212 * incremental.h (Incremental_checker): New class.
8213
8214 * output.cc (Output_file::open_for_modification): New method.
8215 (Output_file::map_anonymous): Changed return type to bool. Record
8216 map in base_ field.
8217 (Output_file::map_no_anonymous): New method, broken out of map.
8218 (Output_file::map): Use map_no_anonymous and map_anonymous.
8219 * output.h (class Output_file): Update declarations.
8220
8221 2009-08-24 Cary Coutant <ccoutant@google.com>
8222
8223 * options.h (Command_line::Pre_options): New class.
8224 (Command_line::pre_options): New member.
8225 * options.cc (gold::options::ready_to_register): New variable.
8226 (One_option::register_option): Do nothing if not registering options.
8227 Assert if same short option registered twice.
8228 (General_options::General_options): Turn off option registration when
8229 done constructing.
8230 (Command_line::Pre_options::Pre_options): New constructor.
8231
8232 2009-08-24 Cary Coutant <ccoutant@google.com>
8233
8234 * options.h (General_options::no_keep_memory): Remove incorrect
8235 short option.
8236
8237 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8238
8239 * Makefile.am (am__skiplex, am__skipyacc): New.
8240 * Makefile.in: Regenerate.
8241
8242 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8243
8244 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8245 (INCLUDES): ... this.
8246 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8247 (AM_CPPFLAGS): Renamed from ...
8248 (INCLUDE): ... this.
8249 * Makefile.in, testsuite/Makefile.in: Regenerate.
8250
8251 * Makefile.in: Regenerate.
8252 * aclocal.m4: Likewise.
8253 * config.in: Likewise.
8254 * configure: Likewise.
8255 * testsuite/Makefile.in: Likewise.
8256
8257 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8258 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8259 * Makefile.in: Regenerate.
8260 * testsuite/Makefile.in: Regenerate.
8261
8262 2009-08-19 Cary Coutant <ccoutant@google.com>
8263
8264 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8265 symbols in shared libraries overridden by hidden or internal symbols
8266 in the main program.
8267
8268 2009-08-19 Chris Demetriou <cgd@google.com>
8269
8270 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8271 checking source file names in error messages.
8272
8273 2009-08-18 Doug Kwan <dougkwan@google.com>
8274
8275 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8276 an elcpp::Ehdr as parameter. Adjust call to set_target.
8277 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8278 an elfcpp::Ehdr as parameter.
8279 * object.cc (Object::set_target): Remove the version that looks up
8280 a target and sets it.
8281 (Sized_relobj::setup): Take a Target object instead of
8282 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8283 (make_elf_sized_object): Find target and ask target to
8284 make an ELF object.
8285 * object.h: (Object::set_target): Remove the version that looks up
8286 a target and sets it.
8287 (Sized_relobj::setup): Take a Target object instead of
8288 an elfcpp:Ehdr as parameter.
8289 * target.cc: Include dynobj.h.
8290 (Target::do_make_elf_object_implementation): New.
8291 (Target::do_make_elf_object): New.
8292 * target.h (Target::make_elf_object): New template declaration.
8293 (Target::do_make_elf_object): New method declarations.
8294 (Target::do_make_elf_object_implementation): New template declaration.
8295
8296 2009-08-14 Ian Lance Taylor <iant@google.com>
8297
8298 * gold.h (FUNCTION_NAME): Define.
8299 (gold_unreachable): Use FUNCTION_NAME.
8300
8301 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8302
8303 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8304 symbol in the --keep-unique list is not found.
8305
8306 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8307
8308 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8309 been maked as --keep-unique.
8310 (Icf::unfold_section): New function.
8311 * icf.h (Icf::unfold_section): New function.
8312 * options.h (General_options::keep_unique): New option.
8313 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8314 * testsuite/Makefile.in: Regenerate.
8315 * testsuite/icf_keep_unique_test.sh: New file.
8316 * testsuite/icf_keep_unique_test.cc: New file.
8317
8318 2009-08-12 Cary Coutant <ccoutant@google.com>
8319
8320 PR 10471
8321 * resolve.cc (Symbol_table::resolve): Check for references from
8322 dynamic objects to hidden and internal symbols.
8323 * testsuite/Makefile.am (hidden_test.sh): New test.
8324 * testsuite/Makefile.in: Regenerate.
8325 * testsuite/hidden_test.sh: New script.
8326 * testsuite/hidden_test_1.c: New test source.
8327 * testsuite/hidden_test_main.c: New test source.
8328
8329 2009-08-11 Doug Kwan <dougkwan@google.com>
8330
8331 * arm.cc: Update comments.
8332 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8333 segment to locate the .ARM.exidx section if present.
8334
8335 2009-08-09 Doug Kwan <dougkwan@google.com>
8336
8337 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8338 patch.
8339
8340 2009-08-07 Sriraman Tallam <tmsriram@google.com>
8341 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8342 compiler warnings.
8343
8344 2009-08-06 Sriraman Tallam <tmsriram@google.com>
8345
8346 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8347 valid tls_segment only for non-debug-section relocations.
8348 * testsuite/Makefile.am: Add gc_tls_test.
8349 * testsuite/Makefile.in: Regenerate.
8350 * testsuite/gc_tls_test.cc: New file.
8351 * testsuite/gc_tls_test.sh: New file.
8352
8353 2009-08-05 Sriraman Tallam <tmsriram@google.com>
8354
8355 * icf.cc: New file.
8356 * icf.h: New file.
8357 * Makefile.am (CCFILES): Add icf.cc.
8358 (HFILES): Add icf.h
8359 * Makefile.in: Regenerate.
8360 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8361 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8362 section, symbol and addend information for the relocs.
8363 * gold.cc (queue_middle_tasks): Call identical code folding.
8364 * gold.h: Add defines for multimap.
8365 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8366 to the call of finalize_local_symbols.
8367 * main.cc (main): Create object of class Icf.
8368 * object.cc (Sized_relobj::do_layout): Allow this function to be
8369 called twice during icf.
8370 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8371 to sections marked as identical by icf.
8372 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8373 when available.
8374 (Sized_relobj::do_section_entsize): New function.
8375 * object.h (Object::section_entsize): New function.
8376 (Object::do_section_entsize): New pure virtual function.
8377 (Relobj::finalize_local_symbols): Add new parameter.
8378 (Relobj::do_section_entsize): New function.
8379 * options.h (General_options::icf): New option.
8380 (General_options::icf_iterations): New option.
8381 (General_options::print_icf_sections): New option.
8382 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8383 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8384 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8385 icf.
8386 * symtab.cc (Symbol_table::is_section_folded): New function.
8387 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8388 to sections marked as identical by icf.
8389 * symtab.h (Symbol_table::set_icf): New function.
8390 (Symbol_table::icf): New function.
8391 (Symbol_table::is_section_folded): New function.
8392 (Symbol_table::icf_): New data member.
8393 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8394 * testsuite/Makefile.am: Add commands to build icf_test.
8395 * testsuite/Makefile.in: Regenerate.
8396 * testsuite/icf_test.sh: New file.
8397 * testsuite/icf_test.cc: New file.
8398
8399 2009-07-24 Chris Demetriou <cgd@google.com>
8400
8401 * layout.cc (is_compressible_debug_section): Fix incorrect
8402 comment about compressed section names.
8403
8404 2009-07-20 Ian Lance Taylor <ian@airs.com>
8405
8406 PR 10419
8407 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8408
8409 2009-07-16 Ian Lance Taylor <iant@google.com>
8410
8411 PR 10400
8412 * layout.h: #include <map>.
8413 (class Kept_section): Change from struct to class. Add accessors
8414 and setters. Add section size to Comdat_group mapping. Change
8415 Comdat_group to std::map. Add is_comdat_ field. Add
8416 linkonce_size field in union.
8417 (class Layout): Update declaration of find_or_add_kept_section.
8418 Don't declare find_kept_object.
8419 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8420 parameter. Add object, shndx, is_comdat, and is_group_name
8421 parameters. Change all callers. Adjust for new Kept_section.
8422 (Layout::find_kept_object): Remove.
8423 * object.cc (Sized_relobj::include_section_group): Update use of
8424 Kept_section. Rename secnum to shndx. Only record
8425 Kept_comdat_section if sections are the same size.
8426 (Sized_relobj::include_linkonce_section): Update use of
8427 Kept_section. Only record Kept_comdat_section if sections are the
8428 same size. Set size of linkonce section.
8429 (Sized_relobj::map_to_kept_section): Update call to
8430 get_kept_comdat_section.
8431 * object.h (class Sized_relobj): Rename fields in
8432 Kept_comdat_section to drop trailing underscores; change object
8433 field to Relobj*. Change Kept_comdat_section_table to store
8434 struct rather than pointer.
8435 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8436 Add kept_object and kept_shndx parameters. Change all callers.
8437 (Sized_relobj::get_kept_comdat_section): Change return type to
8438 bool. Add kept_object and kept_shndx parameters. Change all
8439 callers.
8440 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8441 Layout::find_or_add_kept_section.
8442
8443 2009-07-09 Ian Lance Taylor <iant@google.com>
8444
8445 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8446 Reserve space in the hash table.
8447
8448 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8449
8450 * fileread.cc (File_read::get_mtime): New method.
8451 * fileread.h (Timespec): New structure.
8452 (File_read::get_mtime): New method.
8453 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8454 Renamed from timestamp_nsec.
8455 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8456 Elf_Xword.
8457 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
8458 timestamp_nsec.
8459 (Incremental_inputs::report_archive): Save mtime; style fix.
8460 (Incremental_inputs::report_obejct): Save mtime; style fix.
8461 (Incremental_inputs::report_script): Save mtime; style fix.
8462 (Incremental_inputs::finalize_inputs): Style fix.
8463 (Incremental_inputs::finalize): Style fix.
8464 (Incremental_inputs::create_input_section_data): Store inputs
8465 mtime.
8466 * incremental.h (Incremental_inputs::report_script): Add mtime
8467 argument.
8468 (Incremental_inputs::Input_info::Input_info): Intialize only one
8469 union member.
8470 (Incremental_inputs::Input_info::archive): Move to nameless
8471 union.
8472 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8473 (Incremental_inputs::Input_info::script): Move to nameless union.
8474 (Incremental_inputs::mtime): New field.
8475 * script.cc (read_input_script): Pass file mtime to
8476 Incremental_input.
8477 * script.h (Script_info::inputs): Style fix.
8478
8479 2009-07-01 Ian Lance Taylor <ian@airs.com>
8480
8481 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8482 instead of 32.
8483
8484 2009-06-24 Ian Lance Taylor <iant@google.com>
8485
8486 PR 10156
8487 * layout.cc (Layout::choose_output_section): If we find an
8488 existing section, update the flags.
8489 (Layout::create_notes): New function, broken out of
8490 Layout::finalize.
8491 (Layout::finalize): Don't create note sections.
8492 (Layout::create_note): Don't crash if linker script discards
8493 section.
8494 (Layout::create_gold_note): Likewise.
8495 (Layout::create_build_id): Likewise. Don't set
8496 after_input_sections on the section.
8497 (Layout::create_executable_stack_info): Remove target parameter.
8498 Change caller.
8499 * layout.h (class Layout): Declare create_notes. Update
8500 declaration of create_executable_stack_info.
8501 * gold.cc (queue_middle_tasks): Call create_notes.
8502 * output.cc (Output_section::update_flags_for_input_section): Move
8503 here from output.h. If SHF_ALLOC flag is newly set, mark address
8504 invalid.
8505 * output.h (Output_data::mark_address_invalid): New function.
8506 (class Output_section): Only declare, not define,
8507 update_flags_for_input_section. Remove set_flags.
8508
8509 2009-06-24 Ian Lance Taylor <iant@google.com>
8510
8511 * script-sections.cc (Output_section_definition::
8512 set_section_addresses): Rename shadowing local load_address to
8513 laddr.
8514
8515 2009-06-24 Ian Lance Taylor <iant@google.com>
8516
8517 PR 10244
8518 * reloc.cc (relocate_sections): Skip empty relocation sections.
8519
8520 2009-06-23 Ian Lance Taylor <iant@google.com>
8521
8522 PR 10156
8523 * layout.cc (Layout::create_note): Use choose_output_section
8524 rather than make_output_section.
8525
8526 2009-06-23 Ian Lance Taylor <iant@google.com>
8527
8528 PR 10237
8529 * options.cc (General_options::parse_V): Set printed_version_.
8530 (General_options::General_options): Initialize printed_version_.
8531 * options.h (class General_options): Add printed_version_ field.
8532 * gold.cc (queue_initial_tasks): If there are no input files,
8533 don't give a fatal error if we printed the version information.
8534 (queue_middle_tasks): If using -r with a shared object, give a
8535 fatal error rather than an ordinary error.
8536
8537 2009-06-23 Ian Lance Taylor <iant@google.com>
8538
8539 PR 10219
8540 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8541 (Layout::make_output_section): Set have_stabstr_section_ if we see
8542 a .stab*str section.
8543 (Layout::finalize): Call link_stabs_sections.
8544 (Layout::link_stabs_sections): New file.
8545 * layout.h (class Layout): Add have_stabstr_section_ field.
8546 Declare link_stabs_sections.
8547
8548 2009-06-23 Doug Kwan <dougkwan@google.com>
8549
8550 * Makefile.am (libgold_a_LIBADD): New.
8551 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8552 * Makefile.in: Regenerate.
8553 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8554 * configure: Regenerate.
8555 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8556 * fileread.cc: Include sys/state.h
8557 * gold.h: Declare memmem and strndup if found missing.
8558 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8559
8560 2009-06-23 Ian Lance Taylor <iant@google.com>
8561
8562 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8563 * configure: Rebuild.
8564
8565 2009-06-23 Ian Lance Taylor <iant@google.com>
8566
8567 PR 10147
8568 * object.cc (Object::section_contents): Don't try to get a view if
8569 the section has length zero.
8570 (Object::handle_gnu_warning_section): If the section is empty, use
8571 the name of the section as the warning.
8572
8573 2009-06-23 Ian Lance Taylor <iant@google.com>
8574
8575 PR 10133
8576 * stringpool.h (class Stringpool_template): Add optimize_ field.
8577 (Stringpool_template::set_optimize): New function.
8578 * stringpool.cc (Stringpool_template::Stringpool_template):
8579 Initialize optimize_ field.
8580 (Stringpool_template::set_string_offsets): Test local optimize
8581 fild rather than parameter.
8582 * layout.cc (Layout::Layout): Call set_optimize on the section
8583 name stringpool.
8584
8585 2009-06-22 Ian Lance Taylor <iant@google.com>
8586
8587 PR 10030
8588 * yyscript.y: Parse TARGET.
8589 * script.cc (script_set_target): New function.
8590 * script-c.h (script_set_target): Declare.
8591 * options.cc (General_options::string_to_object_format): Rename
8592 from string_to_object_format in anonymous namespace. Change
8593 callers.
8594 * options.h (class General_options): Declare
8595 string_to_object_format.
8596
8597 2009-06-22 Ian Lance Taylor <iant@google.com>
8598
8599 * script-sections.cc (Script_sections::create_segments): Don't put
8600 program headers in a PT_LOAD segment if -n or -N.
8601
8602 2009-06-22 Ian Lance Taylor <iant@google.com>
8603
8604 PR 10141
8605 * options.h (class General_options): Add -z lazy and -z now. Sort
8606 -z options into alphabetical order.
8607 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8608
8609 2009-06-21 Ian Lance Taylor <iant@google.com>
8610
8611 * layout.cc (Layout::make_output_section): Call
8612 Target::new_output_section.
8613 (Layout::attach_allocated_section_to_segment): Put large section
8614 sections in a separate load segment with the large segment flag
8615 set.
8616 (Layout::segment_precedes): Sort large data segments after other
8617 load segments.
8618 (align_file_offset): New static function.
8619 (Layout::set_segment_offsets): Use align_file_offset.
8620 * output.h (class Output_section): Add is_small_section_ and
8621 is_large_section_ fields.
8622 (Output_section::is_small_section): New function.
8623 (Output_section::set_is_small_section): New function.
8624 (Output_section::is_large_section): New function.
8625 (Output_section::set_is_large_section): New function.
8626 (Output_section::is_large_data_section): New function.
8627 (class Output_segment): Add is_large_data_segment_ field.
8628 (Output_segment::is_large_data_segment): New function.
8629 (Output_segment::set_is_large_data_segment): New function.
8630 * output.cc (Output_section::Output_section): Initialize new
8631 fields.
8632 (Output_segment::Output_segment): Likewise.
8633 (Output_segment::add_output_section): Add assertion that large
8634 data sections always go in large data segments. Force small data
8635 sections to the end of the list of data sections. Force small BSS
8636 sections to the start of the list of BSS sections. For large BSS
8637 sections to the end of the list of BSS sections.
8638 * symtab.h (class Symbol): Declare is_common_shndx.
8639 (Symbol::is_defined): Check Symbol::is_common_shndx.
8640 (Symbol::is_common): Likewise.
8641 (class Symbol_table): Define enum Commons_section_type. Update
8642 declarations. Add small_commons_ and large_commons_ fields.
8643 * symtab.cc (Symbol::is_common_shndx): New function.
8644 (Symbol_table::Symbol_table): Initialize new fields.
8645 (Symbol_table::add_from_object): Put small and large common
8646 symbols in the right list.
8647 (Symbol_table::sized_finalized_symbol): Check
8648 Symbol::is_common_shndx.
8649 (Symbol_table::sized_write_globals): Likewise.
8650 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8651 common symbol lists. Don't call do_allocate_commons_list if the
8652 list is empty.
8653 (Symbol_table::do_allocate_commons_list): Remove is_tls
8654 parameter. Add comons_section_type parameter. Change all
8655 callers. Handle small and large common symbols.
8656 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8657 Symbol::is_common_shndx.
8658 * resolve.cc (symbol_to_bits): Likewise.
8659 * target.h (Target::small_common_shndx): New function.
8660 (Target::small_common_section_flags): New function.
8661 (Target::large_common_shndx): New function.
8662 (Target::large_common_section_flags): New function.
8663 (Target::new_output_section): New function.
8664 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8665 small_common_section_flags, and large_common_section_flags
8666 fields.
8667 (Target::do_new_output_section): New virtual function.
8668 * arm.cc (Target_arm::arm_info): Initialize new fields.
8669 * i386.cc (Target_i386::i386_info): Likewise.
8670 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8671 Likewise.
8672 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8673 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8674 (Target_x86_64::do_new_output_section): New function.
8675 * configure.ac: Define conditional MCMODEL_MEDIUM.
8676 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8677 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8678 (large_LDFLAGS): Define.
8679 * testsuite/large.c: New file.
8680 * testsuite/testfile.cc (Target_test::test_target_info):
8681 Initialize new fields.
8682 * configure, testsuite/Makefile.in: Rebuild.
8683
8684 2009-06-05 Doug Kwan <dougkwan@google.com>
8685
8686 * Makefile.am (CCFILES): Add target.cc.
8687 * Makefile.in: Regenerate.
8688 * i386.cc (class Target_i386): Define new virtual method to
8689 override do_is_local_label_name in parent.
8690 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8691 local symbols if --discard-locals or -X is given.
8692 * options.h (class General_options): Declare new options
8693 '--discard-locals' and '-X' for discarding locals.
8694 * target.h (class Target): Define new methods is_local_label_name.
8695 Declare new virtual method do_is_local_label_name.
8696 * target.cc: New file.
8697 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8698 (check_SCRIPTS): Add discard_locals_test.sh.
8699 (check_DATA): Add discard_local_tests.syms.
8700 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8701 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8702 * testsuite/Makefile.in: Regenerate.
8703 * testsuite/discard_locals_test.c: New file.
8704 * testsuite/discard_locals_test.sh: Same.
8705
8706 2009-06-05 Doug Kwan <dougkwan@google.com>
8707
8708 * object.cc (Sized_relobj::Sized_relobj): Initialize
8709 discarded_eh_frame_shndx_ to -1U.
8710 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8711 section.
8712 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8713 a discarded .eh_frame section.
8714 (Sized_relobj::do_finalize_local_symbols): Ditto.
8715 * object.h (class Sized_relobj): Declare new member
8716 discarded_eh_frame_shndx_.
8717 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8718 (local_labels_test.o, local_labels_test): New rules.
8719 * testsuite/Makefile.in: Regenerate.
8720
8721 2009-06-04 Doug Kwan <dougkwan@google.com>
8722
8723 * layout.cc (Layout::section_name_mapping): Add mapping for
8724 special ARM sections.
8725
8726 2009-06-03 Doug Kwan <dougkwan@google.com>
8727
8728 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8729 (utils::has_overflow): Same.
8730
8731 2009-06-03 Ian Lance Taylor <iant@google.com>
8732
8733 * layout.cc (Layout::section_name_mapping): New array, replacing
8734 Layout::linkonce_mapping.
8735 (Layout::section_name_mapping_count): New variable, replacing
8736 Layout::linkonce_mapping_count.
8737 (Layout::linkonce_output_name): Remove.
8738 (Layout::output_section_name): Rewrite.
8739 * layout.h (class Layout): Rename Linkonce_mapping to
8740 Section_name_mapping, linkonce_mapping to section_name_mapping,
8741 linkonce_mapping_count to section_name_mapping_count. Don't
8742 declare linkonce_output_name.
8743
8744 2009-06-03 Doug Kwan <dougkwan@google.com>
8745
8746 * gold/arm.cc (namespace utils): New.
8747 (Target_arm::reloc_is_non_pic): Define new method.
8748 (class Arm_relocate_functions): New.
8749 (Target_arm::Relocate::relocate): Handle relocation types used by
8750 Android.
8751
8752 2009-06-03 Ian Lance Taylor <iant@google.com>
8753
8754 * arm.cc (Target_arm::scan::global): Use || instead of |.
8755
8756 2009-06-02 Doug Kwan <dougkwan@google.com>
8757
8758 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8759 issued_non_pic_error_.
8760 (class Target_arm::Scan): Declare new method check_non_pic.
8761 Define new method symbol_needs_plt_entry.
8762 Declare new data member issued_non_pic_error_.
8763 (class Target_arm::Relocate): Declare new method
8764 should_apply_static_reloc.
8765 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8766 (Target_arm::Scan::check_non_pic): Define new method.
8767 (Target_arm::Scan::local): Handle a small subset of reloc types used
8768 by Android.
8769 (Target_arm::Scan::local): Same.
8770 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8771
8772 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8773
8774 * incremental.cc (Incremental_inputs::report_command_line): Filter
8775 out --incremental-* options.
8776
8777 2009-05-29 Doug Kwan <dougkwan@google.com>
8778
8779 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8780 template class.
8781 (class Target_arm): Update comment.
8782 (Target_arm::Target_arm): Initialize new data members GOT_,
8783 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8784 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8785 and Target_arm::rel_dyn_section.
8786 Declare new_enum Target_arm::Got_type.
8787 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8788 and DYNBSS_.
8789 Update commments for member do_dynsym_value.
8790 (Target_arm::got_size, Target_arm::plt_section,
8791 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8792 new methods inside class defintion.
8793 (Target_arm::got_section): Define new method.
8794 (Target_arm::rel_dyn_section): Same.
8795 (Output_data_plt_arm): New template class.
8796 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8797 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8798 (Output_data_plt_arm::add_entry): Same.
8799 (Output_data_plt_arm::first_plt_entry): Define new
8800 static data member for PLT instruction template.
8801 (Output_data_plt_arm::plt_entry): Same.
8802 (Output_data_plt_arm::do_write): Define new method.
8803 (Target_arm::make_plt_entry): Same.
8804 (Target_arm::do_finalize_sections): Same.
8805 (Target_arm::do_dynsym_value): Same.
8806
8807 2009-05-28 Doug Kwan <dougkwan@google.com>
8808
8809 * Makefile.am (TARGETSOURCES): Add arm.cc.
8810 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8811 * Makefile.in: Regenerate.
8812 * arm.cc: New file.
8813 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8814
8815 2009-05-26 Doug Kwan <dougkwan@google.com>
8816
8817 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8818 (General_options::check_excluded_libs): Strip off directories in
8819 archive name before matching like GNU ld does.
8820 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8821 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8822 (exclude_libs_test_LDFLAGS): Add linker option
8823 -Wl,--exclude-libs,libexclude_libs_test_3
8824 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8825 an explicit archive without using -l.
8826 (alt/libexclude_libs_test_3.a): New make rule.
8827 * testsuite/Makefile.in: Regenerate.
8828 * testsuite/exclude_libs_test.c : Declare lib3_default().
8829 (main): Call it.
8830 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8831 * exclude_libs_test_3.c: New file.
8832
8833 2009-05-26 Nick Clifton <nickc@redhat.com>
8834
8835 * po/id.po: New Indonesian translation.
8836 * po/gold.pot: Updated template file.
8837
8838 2009-05-22 Sriraman Tallam <tmsriram@google.com>
8839
8840 * testsuite/Makefile.am: Add -ffunction-sections to compile
8841 gc_comdat_test files. Add -Wl,--gc-sections to build
8842 gc_comdat_test.
8843 * testsuite/Makefile.in: Regenerate.
8844 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8845
8846 2009-05-21 Sriraman Tallam <tmsriram@google.com>
8847
8848 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8849 kept comdat section was garbage collected.
8850 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8851 * testsuite/Makefile.in: Regenerate.
8852 * testsuite/gc_comdat_test.sh: New file.
8853 * testsuite/gc_comdat_test_1.cc: New file.
8854 * testsuite/gc_comdat_test_2.cc: New file.
8855
8856 2009-05-19 Doug Kwan <dougkwan@google.com>
8857
8858 * archive.cc (Archive::Archive): Move constructor from archive.h
8859 to here. Initialize no_export_.
8860 (Archive::get_elf_object_for_member): Set no_export flag of object.
8861 * archive.h (Archive::Archive): Move constructor body to
8862 archive.cc.
8863 (Archive::no_export): New method.
8864 (Archive::no_export_): New field.
8865 * object.h (Object::Object): Initialize no_export_ to false.
8866 (Object::no_export, Object::set_no_export): New methods.
8867 (Object::no_export_): New field.
8868 * options.cc (General_options::parse_exclude_libs): New method.
8869 (General_options::check_excluded_libs) Same.
8870 * options.h (exclude_libs): New option.
8871 (General_options::check_excluded_libs): New method declaration.
8872 (General_options::excluded_libs_): New field.
8873 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8874 default or protected visibility if an object has no-export flag set.
8875 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8876 (check_SCRIPTS): Add exclude_libs_test.sh.
8877 (check_DATA): Add exclude_libs_test.syms.
8878 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8879 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8880 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8881 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8882 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8883 libexclude_libs_test_2.a): New rules.
8884 * testsuite/Makefile.in: Regenerate.
8885 * testsuite/exclude_libs_test.c: New file.
8886 * testsuite/exclude_libs_test.sh: Ditto.
8887 * testsuite/exclude_libs_test_1.c: Ditto.
8888 * testsuite/exclude_libs_test_2.c: Ditto.
8889
8890 2009-05-15 Ian Lance Taylor <iant@google.com>
8891
8892 * configure.ac: Check for declarations for cases where libiberty.h
8893 checks HAVE_DECL_xxx.
8894 * configure, config.in: Rebuild.
8895
8896 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8897
8898 * gold.h (Incremental_argument_list): Remove (invalid) forward
8899 declaration.
8900 * incremental.cc (Incremental_inputs::report_achive): New method.
8901 (Incremental_inputs::report_object): New method.
8902 (Incremental_inputs::report_script): New method.
8903 (Incremental_inputs::finalize_inputs): New method.
8904 (Incremental_inputs::finalize): Call finalize_inputs().
8905 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8906 Create inputs entries.
8907 * incremental.h (Incremental_input_type): New enum.
8908 (Incremental_inputs::Incremental_input): Initialize new fields.
8909 (Incremental_inputs::report_inputs): New method.
8910 (Incremental_inputs::report_achive): New method.
8911 (Incremental_inputs::report_object): New method.
8912 (Incremental_inputs::report_script): New method.
8913 (Incremental_inputs::finalize_inputs): New method.
8914 (Incremental_inputs::Input_info): New struct.
8915 (Incremental_inputs::Input_info_map): New typedef.
8916 (Incremental_inputs::lock_): New field.
8917 (Incremental_inputs::Inputs_): New field.
8918 (Incremental_inputs::Inputs_map): New field.
8919 * main.cc (main): Call Incremental_input::report_inputs.
8920 * options.h (Input_argument_list): Typedef moved from
8921 Input_arguments.
8922 (Input_file_group::Files): Remove, use ::Input_argument_list.
8923 (Input_file_group::Input_argument_list): Remove, use
8924 ::Input_argument_list.
8925 * plugin.cc (Plugin_manager::add_input_file): Add error in
8926 incremental build.
8927 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8928 functions.
8929 * script.cc (read_input_script): Call
8930 Incremental_input::report_script.
8931 * script.h (Script_info): New class.
8932
8933 2009-04-27 Ian Lance Taylor <iant@google.com>
8934
8935 * x86_64.cc (do_adjust_output_section): Set entsize to
8936 plt_entry_size.
8937
8938 2009-04-23 Elliott Hughes <enh@google.com>
8939
8940 * output.cc (Output_file::close): After short writes, continue
8941 writing from the correct offset in the buffer being written.
8942
8943 2009-04-23 Chris Demetriou <cgd@google.com>
8944
8945 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8946 * configure: Regenerate.
8947 * config.in: Regenerate.
8948 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8949 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8950
8951 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8952
8953 * incremental.cc (Incremental_inputs_header_data): Renamed from
8954 Incremental_input_header_data.
8955 (Incremental_inputs_header_data::data_size): New field.
8956 (Incremental_inputs_header_data::put_input_file_count): Renamed
8957 from input_file_count.
8958 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8959 from command_line_offset.
8960 (Incremental_inputs_header_data::put_reserved): Renamed from
8961 put_reserved.
8962 (Incremental_inputs_entry_data): Renamed from
8963 Incremental_input_entry_data.
8964 (Incremental_inputs_entry_data::data_size): New field.
8965 (Incremental_inputs::report_command_line): New method.
8966 (Incremental_inputs::finalize): New method.
8967 (Incremental_inputs::create_incremental_inputs_data): New method.
8968 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8969 * incremental.h: New file.
8970 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8971 (Layout::finalize): Create incremental inputs section in
8972 incremental builds.
8973 (Layout::create_incremental_info_sections): New method.
8974 * layout.h (Layout::incremental_inputs): New method.
8975 (Layout::create_incremental_info_sections): New method.
8976 (Layout::incremental_inputs_): New field.
8977 * main.cc (main): Notify Incremental_input of the command line.
8978
8979 2009-04-01 Ian Lance Taylor <iant@google.com>
8980 Mikolaj Zalewski <mikolajz@google.com>
8981
8982 * gold.h (reserve_unordered_map): Define, three versions, one for
8983 each version of Unordered_map.
8984 * layout.cc (Layout::Layout): Remove options parameter. Add
8985 number_of_input_files parameter. Don't initialize options_.
8986 Initialize number_of_input_files_ and resized_signatures_. Move
8987 sections_are_attached_.
8988 (Layout::layout_group): Reserve space for group_signatures_.
8989 (Layout::find_or_add_kept_section): Change name parameter to be a
8990 reference. Resize signatures_ map when it gets large enough.
8991 (Layout::layout_eh_frame): Use parameters->options() instead of
8992 this->options_.
8993 (Layout::make_output_section): Likewise.
8994 (Layout::attach_allocated_section_to_segment): Likewise.
8995 (Layout::finalize, Layout::create_executable_stack): Likewise.
8996 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8997 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8998 * layout.h (class Layout): Update declarations. Remove options_
8999 field. Add number_of_input_files_ and resized_signatures_
9000 fields. Move sections_are_attached_ field.
9001 * main.cc (main): Pass number of input files to Layout
9002 constructor. Don't pass options.
9003
9004 2009-03-30 Ian Lance Taylor <iant@google.com>
9005
9006 * ffsll.c (ffsll): Correct implementation.
9007
9008 2009-03-27 Ian Lance Taylor <iant@google.com>
9009
9010 * ffsll.c: New file.
9011 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9012 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9013 * ftruncate.c (ftruncate): Declare before definition.
9014 * mremap.c (mremap): Likewise.
9015 * pread.c (pread): Likewise.
9016 * configure, Makefile.in, config.in: Rebuild.
9017
9018 * mremap.c: New file.
9019 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9020 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9021 (mremap): Declare if HAVE_MREMAP is not defined.
9022 * configure, Makefile.in, config.in: Rebuild.
9023
9024 2009-03-27 Cary Coutant <ccoutant@google.com>
9025
9026 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9027 position independent.
9028 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9029 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9030
9031 2009-03-24 Cary Coutant <ccoutant@google.com>
9032
9033 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9034 an executable.
9035 (needs_dynamic_reloc): Likewise.
9036
9037 2009-03-24 Ian Lance Taylor <iant@google.com>
9038
9039 * yyscript.y (file_cmd): Recognize EXTERN.
9040 (extern_name_list, extern_name_list_body): New nonterminals.
9041 * script.cc (script_add_extern): Define.
9042 * script-c.h (script_add_extern): Declare.
9043
9044 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
9045
9046 * object.cc (is_elf_object): Define.
9047 * object.h (is_elf_object): Declare.
9048 * archive.cc (Archive::get_elf_object_for_member): Call
9049 is_elf_object.
9050 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
9051
9052 2009-03-24 Elliott Hughes <enh@google.com>
9053
9054 * output.cc (Output_file::map_anonymous): Define.
9055 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9056 try an anonymous one. Report the size if the mmap fails.
9057 * output.h (class Output_file): Declare map_anonymous.
9058
9059 2009-03-24 Ian Lance Taylor <iant@google.com>
9060
9061 * target-select.cc (instantiate_target): Don't acquire the lock if
9062 the instantiated_target_ field has already been set.
9063
9064 2009-03-23 Ian Lance Taylor <iant@google.com>
9065
9066 * gold-threads.h (class Initialize_lock): Define.
9067 * gold-threads.cc (class Initialize_lock_once): Define.
9068 (initialize_lock_control): New static variable.
9069 (initialize_lock_pointer): New static variable.
9070 (initialize_lock_once): New static function.
9071 (Initialize_lock::Initialize_lock): Define.
9072 (Initialize_lock::initialize): Define.
9073 * target-select.h: Include "gold-threads.h".
9074 (class Target_selector): Add lock_ and initialize_lock_ fields.
9075 Don't define instantiate_target, just declare it.
9076 * target-select.cc (Target_selector::Target_selector): Initialize
9077 new fields.
9078 (Target_selector::instantiate_target): Define.
9079 * descriptors.h: Include "gold-threads.h".
9080 (class Descriptors): Add initialize_lock_ field.
9081 * descriptors.cc (Descriptors::Descriptors): Initialize new
9082 field.
9083 (Descriptors::open): Use initialize_lock_ field
9084 * errors.h (class Errors): Add initialize_lock_ field.
9085 * errors.cc (Errors::Errors): Initialize new field.
9086 (Errors::initialize_lock): Use initialize_lock_ field.
9087 * powerpc.cc (class Target_selector_powerpc): Remove
9088 instantiated_target_ field. In do_recognize call
9089 instantiate_target rather than do_instantiate_target. In
9090 do_instantiate_target just allocate a new target.
9091 * sparc.cc (class Target_selector_sparc): Likewise.
9092
9093 * freebsd.h: New file.
9094 * i386.cc: Include "freebsd.h".
9095 (Target_i386): Derive from Target_freebsd rather than
9096 Sized_target.
9097 (Target_selector_i386): Derive from Target_selector_freebsd rather
9098 than Target_selector.
9099 * x86_64.cc: Include "freebsd.h".
9100 (Target_x86_64): Derive from Target_freebsd rather than
9101 Sized_target.
9102 (Target_selector_x86_64): Derive from Target_selector_freebsd
9103 rather than Target_selector.
9104 * target.h (class Target): Add adjust_elf_header and
9105 do_adjust_elf_header.
9106 * output.cc (Output_file_header:: do_sized_write): Call target
9107 adjust_elf_header routine.
9108 * configure.tgt: Set targ_osabi.
9109 * configure.ac: Define GOLD_DEFAULT_OSABI.
9110 * parameters.cc (Parameters::default_target): Pass
9111 GOLD_DEFAULT_OSABI to select_target.
9112 * target-select.h (class Target_selector): Make instantiate_target
9113 protected rather than private.
9114 * Makefile.am (HFILES): Add freebsd.h.
9115 * configure, Makefile.in, config.in: Rebuild.
9116
9117 * merge.cc (do_add_input_section): Correct pend value. Change
9118 message about last entry not being null terminated from error to
9119 warning.
9120
9121 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9122
9123 * incremental.cc: New file.
9124 * Makefile.am (CCFILES): Add incremental.cc.
9125 * Makefile.in: Rebuild.
9126
9127 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9128
9129 * layout.cc (Layout::output_section_name): Preserve names
9130 of '.note.' sections.
9131
9132 2009-03-19 Ian Lance Taylor <iant@google.com>
9133
9134 * descriptors.cc (Descriptors::open): Check that the options are
9135 valid before using them.
9136
9137 2009-03-18 Ian Lance Taylor <iant@google.com>
9138
9139 * script-sections.h: Include <list>.
9140 (class Script_sections): Change Sections_elements from std::vector
9141 to std::list. Typedef public Elements_iterator. Add
9142 orphan_section_placement_, data_segment_align_start_, and
9143 saw_data_segment_align_ fields. Remove data_segment_align_index_
9144 field.
9145 * script-sections.cc (class Orphan_section_placement): New class.
9146 (class Sections_element): Add virtual functions is_relro and
9147 orphan_section_init. Remove virtual function place_orphan_here.
9148 (class Output_section_definition): Add is_relro and
9149 orphan_section_init. Remove place_orphan_here.
9150 (class Orphan_output_section): Likewise.
9151 (Script_sections::Script_sections): Update for field changes.
9152 (Script_sections::data_segment_align): Set saw_data_segment_align_
9153 and data_segment_align_start_, not data_segment_align_index.
9154 (Script_sections::data_segment_relro_end): Check
9155 saw_data_segment_align_. Use data_segment_align_start_ rather
9156 than data_segment_align_index_.
9157 (Script_sections::place_orphan): Rewrite to use
9158 Orphan_section_placement.
9159
9160 2009-03-17 Ian Lance Taylor <iant@google.com>
9161
9162 * archive.cc (Archive::add_symbols): Check for a version attached
9163 to the symbol name in the archive map.
9164 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9165 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9166 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9167 (ver_test_11.a): New target.
9168 * testsuite/Makefile.in: Rebuild.
9169
9170 * configure.ac: Check for chsize and posix_fallocate. Replace
9171 ftruncate.
9172 * ftruncate.c: New file, from gnulib.
9173 * output.cc (posix_fallocate): Define dummy version if not
9174 HAVE_POSIX_FALLOCATE.
9175 (Output_file::map): Call posix_fallocate rather than lseek and
9176 write.
9177 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9178 * configure, Makefile.in, config.in: Rebuild.
9179
9180 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
9181
9182 * layout.h (Layout::create_note): Add section_name parameter.
9183 * layout.cc (Layout::create_note): Likewise.
9184 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
9185
9186 2009-03-17 Ian Lance Taylor <iant@google.com>
9187
9188 * descriptors.cc: Include "options.h".
9189 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9190 (Descriptors::open): Always use O_CLOEXEC when opening a new
9191 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9192 then set FD_CLOEXEC.
9193
9194 * sparc.cc (class Target_sparc): Add has_got_section.
9195 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9196 make sure we have a GOT section.
9197
9198 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9199 (Target_sparc::Scan::local): Likewise.
9200 (Target_sparc::Scan::global): Likewise.
9201 (Target_sparc::Relocate::relocate): Likewise.
9202 (Target_sparc::Relocate::relocate_tls): Likewise.
9203
9204 * symtab.cc (Symbol_table::define_default_version): New function,
9205 broken out of add_from_object.
9206 (Symbol_table::add_from_object): Call define_default_version.
9207 (Symbol_table::define_special_symbol): Add resolve_oldsym
9208 parameter. Change all callers. If the version for a symbol comes
9209 from a version script, resolve it with the symbol with the same
9210 name with no version. Also add the symbol without a version if
9211 appropriate.
9212 (do_define_in_output_data): If resolving with oldsym, don't delete
9213 sym.
9214 (do_define_in_output_segment): Likewise.
9215 (do_define_as_constant): Likewise.
9216 * symtab.h (class Symbol_table): Update declarations.
9217
9218 2009-03-13 Ian Lance Taylor <iant@google.com>
9219
9220 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9221 (Read_symbols::requeue): New function.
9222 (Read_symbols::do_read_symbols): If make_elf_object fails because
9223 the target type is not configured, and the file was searched for,
9224 issue a warning and retry with the next directory.
9225 (Add_symbols::run): If the file has an incompatible format, and
9226 it was searched for, requeue the Read_symbols task. On error,
9227 release the object.
9228 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9229 dirindex parameter to constructor. Change all callers. Declare
9230 incompatible_warning and requeue.
9231 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9232 input_argument_ and input_group_ fields. Add them to
9233 constructor. Change all callers.
9234 (class Read_script): Add dirindex_ field. Add it to constructor.
9235 Change all callers.
9236 * archive.cc (Archive::setup): Remove input_objects parameter.
9237 Change all callers.
9238 (Archive::get_file_and_offset): Likewise.
9239 (Archive::read_all_symbols): Likewise.
9240 (Archive::read_symbols): Likewise.
9241 (Archive::get_elf_object_for_member): Remove input_objects
9242 parameter. Add punconfigured parameter. Change all callers.
9243 (Archive::add_symbols): Change return type to bool. Check return
9244 value of include_member.
9245 (Archive::include_all_members): Likewise.
9246 (Archive::include_member): Change return type to bool. Return
9247 false if first included object has incompatible target. Set
9248 included_member_ field.
9249 (Add_archive_symbols::run): If add_symbols returns false, requeue
9250 Read_symbols task.
9251 * archive.h (class Archive): Add included_member_ field.
9252 Initialize it in constructor. Add input_file and searched_for
9253 methods. Update declarations.
9254 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9255 input_argument_ fields. Add them to constructor. Change all
9256 callers.
9257 * script.cc: Include "target-select.h".
9258 (class Parser_closure): Add skip_on_incompatible_target_ and
9259 found_incompatible_target_ fields. Add
9260 skip_on_incompatible_target parameter to constructor. Change all
9261 callers. Add methods skip_on_incompatible_target,
9262 clear_skip_on_incompatible_target, found_incompatible_target, and
9263 set_found_incompatible_target.
9264 (read_input_script): Add dirindex parameter. Change all callers.
9265 If parser finds an incompatible target, requeue Read_symbols
9266 task.
9267 (script_set_symbol): Clear skip_on_incompatible_target in
9268 closure.
9269 (script_add_assertion, script_parse_option): Likewise.
9270 (script_start_sections, script_add_phdr): Likewise.
9271 (script_check_output_format): New function.
9272 * script.h (read_input_script): Update declaration.
9273 * script-c.h (script_check_output_format): Declare.
9274 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9275 (ignore_cmd): Remove OUTPUT_FORMAT.
9276 * fileread.cc (Input_file::Input_file): Add explicit this.
9277 (Input_file::will_search_for): New function.
9278 (Input_file::open): Add pindex parameter. Change all callers.
9279 * fileread.h (class Input_file): Add input_file_argument method.
9280 Declare will_search_for. Update declarations.
9281 * object.cc (make_elf_object): Add punconfigured parameter.
9282 Change all callers.
9283 * object.h (class Object): Make input_file public. Add
9284 searched_for method.
9285 (make_elf_object): Update declaration.
9286 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9287 restart search.
9288 * dirsearch.h (class Dirsearch): Update declaration.
9289 * options.h (class General_options): Add --warn-search-mismatch.
9290 * parameters.cc (Parameters::is_compatible_target): New function.
9291 * parameters.h (class Parameters): Declare is_compatible_target.
9292 * workqueue.cc (Workqueue::add_blocker): New function.
9293 * workqueue.h (class Workqueue): Declare add_blocker.
9294
9295 * fileread.cc (Input_file::open): Remove options parameter.
9296 Change all callers.
9297 (Input_file::open_binary): Likewise.
9298 * script.cc (read_input_script): Likewise.
9299 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9300 options parameter from constructor. Change all callers.
9301 (class Read_script): Likewise.
9302 * fileread.h (class Input_file): Update declarations.
9303 * script.h (read_input_script): Update declaration.
9304
9305 2009-03-10 Nick Clifton <nickc@redhat.com>
9306
9307 * po/es.po: New Spanish translation.
9308
9309 2009-03-06 Cary Coutant <ccoutant@google.com>
9310
9311 * options.cc (parse_short_option): Keep dash_z from registering itself.
9312
9313 2009-03-03 Ian Lance Taylor <iant@google.com>
9314
9315 PR 9918
9316 * target-reloc.h (relocate_section): Pass output_section to
9317 relocate.
9318 * i386.cc (Target_i386::should_apply_static_reloc): Add
9319 output_section parameter. Change all callers.
9320 (Target_i386::Relocate::relocate): Add output_section parameter.
9321 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9322 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9323 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9324 * testsuite/two_file_shared.sh: New script.
9325 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9326 (check_DATA): Add two_file_shared.dbg.
9327 (two_file_shared.dbg): New target.
9328 * testsuite/Makefile.in: Rebuild.
9329
9330 2009-03-01 Ian Lance Taylor <iant@google.com>
9331
9332 * configure.ac: Check for byteswap.h.
9333 * configure: Rebuild.
9334 * config.in: Rebuild.
9335
9336 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9337
9338 * layout.cc (Layout::find_or_add_kept_section): New function.
9339 (Layout::add_comdat): Removed.
9340 * layout.h (struct Kept_section): Move out of class Layout.
9341 Remove trailing underscores from field names. Add group_sections
9342 field. Rename group_ field to is_group. Change all uses.
9343 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9344 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9345 comdat_groups_ field.
9346 (Sized_relobj::include_section_group): Use
9347 find_or_add_kept_section and Kept_section::group_sections.
9348 (Sized_relobj::include_linkonce_section): Likewise.
9349 * object.cc (class Sized_relobj): Don't define Comdat_group or
9350 Comdat_group_table. Remove find_comdat_group and
9351 add_comdat_group. Remove comdat_groups_ field.
9352 * plugin.cc (include_comdat_group): Use
9353 Layout::find_or_add_kept_section.
9354
9355 2009-02-28 Ian Lance Taylor <iant@google.com>
9356
9357 * README: --gc-sections and map files are now supported. Document
9358 some build requirements.
9359
9360 PR 6992
9361 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9362 relocatable link set the value of the section symbol to zero.
9363 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9364 relocatable link don't include the section address in the local
9365 symbol value.
9366
9367 2009-02-27 Ian Lance Taylor <iant@google.com>
9368
9369 PR 6811
9370 * options.h (class Search_directory): Add is_system_directory.
9371 (class General_options): Declare is_in_system_directory.
9372 * options.cc (get_relative_sysroot): Make static.
9373 (get_default_sysroot): Make static.
9374 (General_optoins::is_in_system_directory): New function.
9375 * fileread.cc (Input_file::is_in_system_directory): New function.
9376 * fileread.h (class Input_file): Declare is_in_system_directory.
9377 * object.h (class Object): Add is_in_system_directory.
9378 (class Input_objects): Remove system_library_directory_ field.
9379 * object.cc (Input_objects::add_object): Don't set
9380 system_library_directory_.
9381 (input_objects::found_in_system_library_directory): Remove.
9382 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9383 parameter. Change all callers.
9384 (Symbol_table::sized_write_globals): Likewise.
9385 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9386 Call Object::is_in_system_directory.
9387 * symtab.h (class Symbol_table): Update declarations.
9388
9389 PR 5990
9390 * descriptors.h (Open_descriptor): Add is_on_stack field.
9391 * descriptors.cc (Descriptors::open): If the descriptor is on the
9392 top of the stack, remove it. Initialize is_on_stack field.
9393 (Descriptors::release): Only add pod to stack if it is not on the
9394 stack already.
9395 (Descriptors::close_some_descriptor): Clear stack_next and
9396 is_on_stack fields.
9397
9398 PR 7091
9399 * output.cc (Output_section::find_starting_output_address): Rename
9400 from starting_output_address; add PADDR parameter; change return
9401 type.
9402 * output.h (class Output_section): Declare
9403 find_starting_output_address instead of starting_output_address.
9404 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9405 section symbol for which we can't find a merge section.
9406
9407 PR 9836
9408 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9409 hidden or internal, force the symbol to be local.
9410 * resolve.cc (Symbol::override_visibility): Define.
9411 (Symbol::override_base): Use override_visibility.
9412 (Symbol_table::resolve): Likewise.
9413 (Symbol::override_base_with_special): Likewise.
9414 (Symbol_table::override_with_special): If the visibility is hidden
9415 or internal, force the symbol to be local.
9416 * symtab.h (class Symbol): Add set_visibility and
9417 override_visibility.
9418 * testsuite/ver_test_1.sh: New file.
9419 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9420 (check_DATA): Add ver_test_1.syms.
9421 (ver_test_1.syms): New target.
9422 * testsuite/Makefile.in: Rebuild.
9423
9424 2009-02-25 Cary Coutant <ccoutant@google.com>
9425
9426 * layout.cc (Layout::choose_output_section): Don't rename sections
9427 when using a linker script that has a SECTIONS clause.
9428 * Makefile.in: Regenerate.
9429
9430 * testsuite/Makefile.am (script_test_5.sh): New test case.
9431 * testsuite/Makefile.in: Regenerate.
9432 * testsuite/script_test_5.cc: New file.
9433 * testsuite/script_test_5.sh: New file.
9434 * testsuite/script_test_5.t: New file.
9435
9436 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
9437
9438 * archive.cc (Archive::include_member): Update calls to add_symbols.
9439 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9440 the Layout argument.
9441 * dynobj.h (do_add_symbols): Add the Layout argument.
9442 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9443 Layout argument.
9444 * object.h (Object::add_symbols): Add the Layout argument.
9445 (Object::do_add_symbols): Add the Layout argument.
9446 (Sized_relobj::do_add_symbols): Add the Layout argument.
9447 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9448 Unify the two versions.
9449 (Add_plugin_symbols): Remove.
9450 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9451 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9452 (Add_plugin_symbols): Remove.
9453 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9454 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9455 (Add_symbols::run): Make it work with Pulginobj.
9456
9457 2009-02-06 Ian Lance Taylor <iant@google.com>
9458
9459 * object.cc (Sized_relobj::do_layout): Make info message start
9460 with lower case letter.
9461
9462 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9463
9464 * binary.cc: Fix file comment.
9465
9466 * options.h (enum Incremental_disposition): Define.
9467 (class General_options): Add new options: --incremental,
9468 --incremental_changed, --incremental_unchanged,
9469 --incremental_unknown. Add incremental_disposition_ and
9470 implicit_incremental_ fields.
9471 (General_options::incremental_disposition): New function.
9472 (class Position_dependent_options): Add incremental_disposition
9473 option.
9474 (Position_dependent_options::copy_from_options): Set incremental
9475 dispositions.
9476 * options.cc (General_options::parse_incremental_changed): New
9477 function.
9478 (General_options::parse_incremental_unchanged): New function.
9479 (General_options::parse_incremental_unknown): New function.
9480 (General_options::General_options): Initialize new fields
9481 incremental_disposition_ and implicit_incremental_.
9482 (General_options::finalize): Check for uasge of --incremental-*
9483 without --incremental.
9484
9485 2009-02-06 Chris Demetriou <cgd@google.com>
9486
9487 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9488 pointer and to report location as the file name associated with
9489 the symbol.
9490 (gold_undefined_symbol_at_location): New function to replace the
9491 old gold_undefined_symbol functionality.
9492 * target-reloc.h (relocate_section): Update to use
9493 gold_undefined_symbol_at_location.
9494 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9495 Call gold_undefined_symbol function rather than gold_error.
9496 * errors.h (Errors::undefined_symbol): Take location as a
9497 string, rather than calculating it from a relocation.
9498 * errors.cc (Errors::fatal): Print "fatal error:" before the
9499 formatted message.
9500 (Errors::error, Errors::error_at_location): Print "error: "
9501 before the formatted message.
9502 (Errors::undefined_symbol): Take location as a string, rather
9503 than calculating it from a relocation.
9504 (gold_undefined_symbol_at_location): New function akin to
9505 old gold_undefined_symbol, calculates location from relocation.
9506 (gold_undefined_symbol): Change to take only a Symbol pointer
9507 and to report location as the file name associated with the symbol.
9508 * testsuite/debug_msg.sh: Update for changed error messages.
9509 * testsuite/undef_symbol.sh: Likewise.
9510
9511 2009-02-04 Duncan Sands <baldrick@free.fr>
9512
9513 PR 9812
9514 * reduced_debug_output.h
9515 (Output_reduced_debug_abbrev_section::failed): Use format for
9516 gold_warning.
9517 (Output_reduced_debug_info_section::faild): Likewise.
9518
9519 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9520
9521 * script.cc (Lazy_demangler): New class.
9522 (Version_script_info::get_symbol_version_helper): Demangle a
9523 symbol only once.
9524
9525 2009-01-29 Cary Coutant <ccoutant@google.com>
9526
9527 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9528 to __tls_get_addr.
9529 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9530
9531 2009-01-28 Ian Lance Taylor <iant@google.com>
9532
9533 * version.cc (version_string): Bump to 1.9.
9534
9535 * gold.h: Include <cstring> and <stdint.h>.
9536 * version.cc: Include <cstdio>.
9537 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9538 warning.
9539 * reduced_debug_output.cc (insert_into_vector): Rename from
9540 Insert_into_vector; change all callers. Use Swap_unaligned to
9541 avoid aliasing issue; remove union since it is unnecessary.
9542
9543 2009-01-27 Sriraman Tallam <tmsriram@google.com>
9544
9545 * Makefile.am (CCFILES): Add gc.cc.
9546 (HFILES): Add gc.h.
9547 * Makefile.in: Regenerate.
9548 * gold.cc (Gc_runner): New class.
9549 (queue_initial_tasks): Call garbage collection related tasks
9550 when corresponding options are invoked.
9551 (queue_middle_gc_tasks): New function.
9552 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9553 processed early before laying out sections during garbage collection.
9554 * gold.h (queue_middle_gc_tasks): New function.
9555 (is_prefix_of): Move from "layout.cc".
9556 * i386.cc (Target_i386::gc_process_relocs): New function.
9557 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9558 * main.cc (main): Create object of class "Garbage_collection".
9559 * object.cc (Relobj::copy_symbols_data): New function.
9560 (Relobj::is_section_name_included): New function.
9561 (Sized_relobj::do_layout): Allow this function to be called twice
9562 during garbage collection and defer layout of section during the
9563 first call.
9564 * object.h (Relobj::get_symbols_data): New function.
9565 (Relobj::is_section_name_included): New function.
9566 (Relobj::copy_symbols_data): New function.
9567 (Relobj::set_symbols_data): New function.
9568 (Relobj::get_relocs_data): New function.
9569 (Relobj::set_relocs_data): New function.
9570 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9571 (Relobj::gc_process_relocs): New function.
9572 (Relobj::do_gc_process_relocs): New pure virtual function.
9573 (Relobj::sd_): New data member.
9574 (Sized_relobj::is_output_section_offset_invalid): New function.
9575 (Sized_relobj::do_gc_process_relocs): New function.
9576 * options.h (General_options::gc_sections): Modify to not be a no-op.
9577 (General_options::print_gc_sections): New option.
9578 * plugin.cc (Plugin_finish::run): Remove function call to
9579 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9580 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9581 * reloc.cc (Read_relocs::run): Add task to process relocs and
9582 determine unreferenced sections when doing garbage collection.
9583 (Gc_process_relocs): New class.
9584 (Sized_relobj::do_gc_process_relocs): New function.
9585 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9586 sections that are garbage collected.
9587 * reloc.h (Gc_process_relocs): New class.
9588 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9589 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9590 symbols whose corresponding sections are garbage collected.
9591 (Symbol_table::Symbol_table): Add new parameter for the garbage
9592 collection object.
9593 (Symbol_table::gc_mark_undef_symbols): New function.
9594 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9595 (Symbol_table::gc_mark_dyn_syms): New function.
9596 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9597 as garbage.
9598 (Symbol_table::add_from_object): Likewise.
9599 (Symbol_table::add_from_relobj): When building shared objects, do not
9600 treat externally visible symbols as garbage.
9601 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9602 table information for static and relocatable links.
9603 * symtab.h (Symbol_table::set_gc): New function.
9604 (Symbol_table::gc): New function.
9605 (Symbol_table::gc_mark_undef_symbols): New function.
9606 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9607 (Symbol_table::gc_mark_dyn_syms): New function.
9608 (Symbol_table::gc_): New data member.
9609 * target.h (Sized_target::gc_process_relocs): New pure virtual
9610 function.
9611 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9612 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9613
9614 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9615
9616 * options.h (General_options::gc_sections): Define as a no-op for now.
9617 (General_options::no_keep_memory): Ditto.
9618 (General_options::Bshareable): Define.
9619 * options.cc (General_options::finalize): Honor -Bshareable.
9620
9621 2009-01-20 Andreas Schwab <schwab@suse.de>
9622
9623 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9624 read the value in the contents, since we don't use it. Use the
9625 template endianness when writing.
9626 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9627
9628 2009-01-19 Andreas Schwab <schwab@suse.de>
9629
9630 * configure.tgt (powerpc64-*): Fix targ_obj.
9631
9632 2009-01-15 Ian Lance Taylor <iant@google.com>
9633
9634 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9635 local symbols when stripping all symbols.
9636
9637 2009-01-14 Cary Coutant <ccoutant@google.com>
9638
9639 * output.cc (Output_reloc): Add explicit instantiations.
9640
9641 2009-01-14 Cary Coutant <ccoutant@google.com>
9642
9643 * archive.cc (Archive::get_elf_object_for_member): Remove call
9644 to File_read::claim_for_plugin.
9645 * descriptors.cc (Descriptors::open): Remove reference to
9646 is_claimed.
9647 (Descriptors::claim_for_plugin): Remove.
9648 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9649 (Descriptors::is_claimed): Remove.
9650 (claim_descriptor_for_plugin): Remove.
9651 * fileread.cc (File_read::claim_for_plugin): Remove.
9652 * fileread.h (File_read::claim_for_plugin): Remove.
9653 (File_read::descriptor): Reopen descriptor if necessary.
9654 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9655 (Plugin_manager::all_symbols_read): Add task parameter. Change
9656 all callers.
9657 (Plugin_manager::get_input_file): New function.
9658 (Plugin_manager::release_input_file): New function.
9659 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9660 corresponding data member.
9661 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9662 and pass to base constructor. Change all callers.
9663 (get_input_file, release_input_file): New functions.
9664 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9665 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9666 (Plugin_manager::all_symbols_read): Add task parameter.
9667 (Plugin_manager::get_input_file): New function.
9668 (Plugin_manager::release_input_file): New function.
9669 (Plugin_manager::task_): New data member.
9670 (Pluginobj::Pluginobj): Add filesize parameter.
9671 (Pluginobj::filename): New function.
9672 (Pluginobj::descriptor): New function.
9673 (Pluginobj::filesize): New function.
9674 (Pluginobj::filesize_): New data member.
9675 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9676 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9677 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9678
9679 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9680 with archive libraries.
9681 * testsuite/Makefile.in: Regenerate.
9682 * testsuite/plugin_test.c (struct sym_info): New type.
9683 (get_input_file, release_input_file): New static variables.
9684 (onload): Capture new transfer vector entries.
9685 (claim_file_hook): Stop reading at end of file according to filesize.
9686 Factor out parsing of readelf output into separate function.
9687 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9688 APIs and get the source file name from the symbol table. Convert
9689 source file name to corresponding object file name. Print info
9690 message when adding new input files.
9691 (parse_readelf_line): New function.
9692 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9693 * testsuite/plugin_test_2.sh: Likewise.
9694 * testsuite/plugin_test_3.sh: Likewise.
9695 * testsuite/plugin_test_4.sh: New test case.
9696
9697 2009-01-07 Ian Lance Taylor <iant@google.com>
9698
9699 * version.cc (version_string): Bump to 1.8.
9700
9701 2008-12-23 Cary Coutant <ccoutant@google.com>
9702
9703 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9704 * plugin.cc (Plugin_manager::finish): Rename as
9705 layout_deferred_objects. Move cleanup to separate function.
9706 (Plugin_manager::cleanup): New function.
9707 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9708 separately.
9709 * plugin.h (Plugin_manager::finish): Rename as
9710 layout_deferred_objects.
9711 (Plugin_manager::cleanup): New function.
9712 (Plugin_manager::cleanup_done): New field.
9713
9714 2008-12-23 Cary Coutant <ccoutant@google.com>
9715
9716 * plugin.cc (is_visible_from_outside): New function.
9717 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9718 so we don't return "IR only" status for exported symbols or -r links.
9719
9720 * testsuite/Makefile.am (plugin_test_3): New test case.
9721 * testsuite/Makefile.in: Regenerate.
9722 * testsuite/plugin_test_3.sh: New file.
9723
9724 2008-12-22 Cary Coutant <ccoutant@google.com>
9725
9726 * object.cc (Sized_relobj::layout_section): New function.
9727 (Sized_relobj::do_layout): Defer layout of input sections until after
9728 plugin has provided replacement files.
9729 (Sized_relobj::do_layout_deferred_sections): New function.
9730 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9731 (Relobj::layout_deferred_sections): New function.
9732 (Relobj::do_layout_deferred_sections): New function.
9733 (Sized_relobj::do_layout_deferred_sections): New function.
9734 (Sized_relobj::layout_section): New function.
9735 (Sized_relobj::Deferred_layout): New structure.
9736 (Sized_relobj::deferred_layout_): New field.
9737 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9738 Change all callers. Layout deferred sections.
9739 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9740 references.
9741 (Plugin_hook::run): Move code from do_plugin_hook inline.
9742 (Plugin_hook::do_plugin_hook): Remove.
9743 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9744 (Plugin_manager::finish): Renamed, was cleanup.
9745 (Plugin_manager::should_defer_layout): New function.
9746 (Plugin_manager::add_deferred_layout_object): New function.
9747 (Plugin_manager::Deferred_layout_list): New type.
9748 (Plugin_manager::deferred_layout_objects_): New field.
9749 (Plugin_hook::do_plugin_hook): Remove.
9750
9751 2008-12-17 Ian Lance Taylor <iant@google.com>
9752
9753 * options.h (class General_options): Add --no case for
9754 --export-dynamic.
9755
9756 2008-12-16 Cary Coutant <ccoutant@google.com>
9757
9758 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9759 vector.
9760 (Plugin_manager::claim_file): Create plugin object even if
9761 plugin did not call the add_symbols callback.
9762 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9763 asking for more symbols than were added.
9764 * testsuite/Makefile.am (plugin_test_1): Add test case with
9765 no global symbols.
9766 (empty.syms): New target.
9767 * testsuite/Makefile.in: Regenerate.
9768 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9769 message. Don't call add_symbols if no globals.
9770 (all_symbols_read_hook): Don't provide replacement for empty
9771 claimed file.
9772
9773 2008-12-12 Ian Lance Taylor <iant@google.com>
9774
9775 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9776 r_type == 0 for a local symbol with r_sym == 0.
9777 (scan_relocatable_relocs): Pass r_sym to
9778 local_non_section_strategy.
9779 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9780 r_sym parameter.
9781
9782 * configure.ac: Update test for TLS descriptors: they are
9783 supported as of glibc 2.9.
9784 * configure: Rebuild.
9785
9786 2008-12-11 Ian Lance Taylor <iant@google.com>
9787
9788 PR 7091
9789 * target-reloc.h (Default_scan_relocatable_relocs): For each
9790 function, map r_type == 0 to RELOC_DISCARD.
9791
9792 2008-12-10 Cary Coutant <ccoutant@google.com>
9793
9794 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9795 object to override a kept COMDAT group from a plugin object.
9796
9797 2008-12-09 Ian Lance Taylor <iant@google.com>
9798
9799 PR 7088
9800 * yyscript.y (file_cmd): Handle INPUT.
9801
9802 * testsuite/initpri1.c: Change all declarations to be full
9803 prototypes by adding void, to avoid compiler warnings.
9804
9805 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
9806
9807 * options.cc (General_options::parse_plugin_opt): New.
9808 (General_options::add_plugin): The argument now is just the filename.
9809 (General_options::add_plugin_option): New.
9810 * options.h (plugin_opt): New.
9811 (add_plugin): Change argument name.
9812 (add_plugin_option): New.
9813 * plugin.cc (Plugin::load): Don't parse the plugin option.
9814 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9815 (Plugin::add_option): New.
9816 (Plugin::args_): Change type.
9817 (Plugin::filename_): New.
9818 (Plugin_manager::add_plugin_option): New.
9819 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9820 * testsuite/Makefile.in: Regenerate.
9821
9822 2008-12-05 Cary Coutant <ccoutant@google.com>
9823
9824 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9825 Handle --strip-lto-sections option.
9826 * options.h (strip_lto_sections): New option.
9827
9828 2008-12-01 Cary Coutant <ccoutant@google.com>
9829
9830 * plugin.cc (ld_plugin_message): Change format parameter to const.
9831 Fix mismatch between new[] and delete.
9832
9833 2008-11-14 Cary Coutant <ccoutant@google.com>
9834
9835 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9836 instead of -1U.
9837
9838 2008-11-05 Craig Silverstein <csilvers@google.com>
9839
9840 * options.cc (General_options::parse_dynamic_list): New function.
9841 * options.h (General_options): New flags dynamic_list,
9842 dynamic_list_data, dynamic_list_cpp_new, and
9843 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9844 (General_options::in_dynamic_list): New function.
9845 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9846 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9847 (Lex::can_continue_name): Likewise.
9848 (yylex): Likewise.
9849 (read_script_file): New parameter script_options.
9850 (read_dynamic_list): New function.
9851 (Script_options::define_dynamic_list): New function.
9852 (dynamic_list_keyword_parsecodes): New variable.
9853 (dynamic_list_keywords): New variable.
9854 * script.h (Script_options::define_dynamic_list): New function
9855 prototype.
9856 (read_dynamic_list): New function prototype.
9857 * symtab.cc (strprefix): New macro.
9858 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9859 dynamic_list_data, dynamic_list_cpp_new, and
9860 dynamic_list_cpp_typeinfo.
9861 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9862 (dynamic_list_expr): New rule.
9863 (dynamic_list_nodes): Likewise.
9864 (dynamic_list_node): Likewise.
9865 * testsuite/Makefile.am (dynamic_list): New test.
9866 * testsuite/Makefile.in: Regenerated.
9867 * testsuite/dynamic_list.t: New file.
9868 * testsuite/dynamic_list.sh: New file.
9869
9870 2008-11-05 Craig Silverstein <csilvers@google.com>
9871
9872 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9873 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9874 (t11_last): Likewise.
9875 * testsuite/ver_test_6.c (main): Likewise.
9876
9877 2008-10-07 Cary Coutant <ccoutant@google.com>
9878
9879 * options.c (General_options::finalize): Add check for -static and
9880 -shared.
9881 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9882 is not empty.
9883
9884 2008-10-02 Cary Coutant <ccoutant@google.com>
9885
9886 * plugin.cc (make_sized_plugin_object): Fix conditional
9887 compilation to work when not all targets are enabled.
9888
9889 2008-09-29 Cary Coutant <ccoutant@google.com>
9890
9891 * archive.cc (Archive::get_file_and_offset): Use filename instead
9892 of name to get library path.
9893 (Archive::include_member): Unlock external member of a thin archive.
9894
9895 * testsuite/Makefile.am (TEST_AR): New variable.
9896 (thin_archive_test_1): New test.
9897 (thin_archive_test_2): New test.
9898 * testsuite/Makefile.in: Regenerate.
9899 * testsuite/thin_archive_main.cc: New file.
9900 * testsuite/thin_archive_test_1.cc: New file.
9901 * testsuite/thin_archive_test_2.cc: New file.
9902 * testsuite/thin_archive_test_3.cc: New file.
9903 * testsuite/thin_archive_test_4.cc: New file.
9904
9905 2008-09-29 Cary Coutant <ccoutant@google.com>
9906
9907 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9908 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9909 instead of -1U.
9910 (Sized_relobj::do_finalize_local_symbols): Likewise.
9911 (Sized_relobj::map_to_kept_section): Likewise.
9912 * object.h (Sized_relobj::invalid_address): New constant.
9913 (Sized_relobj::do_output_section_offset): Check for invalid_address
9914 and return -1ULL.
9915 * output.cc (Output_reloc::local_section_offset): Use constant
9916 invalid_address instead of -1U.
9917 (Output_reloc::get_address): Likewise.
9918 (Output_section::output_address): Change -1U to -1ULL.
9919 * output.h (Output_reloc::invalid_address): New constant.
9920 * reloc.cc (Sized_relobj::write_sections): Use constant
9921 invalid_address instead of -1U.
9922 (Sized_relobj::relocate_sections): Likewise.
9923 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9924 values for merge sections.
9925 * target-reloc.h (relocate_for_relocatable): Use constant
9926 invalid_address instead of -1U.
9927
9928 2008-09-19 Cary Coutant <ccoutant@google.com>
9929
9930 Add plugin functionality for link-time optimization (LTO).
9931 * configure.ac (plugins): Add --enable-plugins option.
9932 * configure: Regenerate.
9933 * config.in: Regenerate.
9934 * Makefile.am (LIBDL): New variable.
9935 (CCFILES): Add plugin.cc.
9936 (HFILES): Add plugin.h.
9937 (ldadd_var): Add LIBDL.
9938 * Makefile.in: Regenerate.
9939
9940 * archive.cc: Include "plugin.h".
9941 (Archive::setup): Don't preread archive symbols when using a plugin.
9942 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9943 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9944 files.
9945 (Archive::include_member): Add symbols from plugin objects.
9946 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9947 * descriptors.cc (Descriptors::open): Check for file descriptors
9948 abandoned by plugins.
9949 (Descriptors::claim_for_plugin): New function.
9950 * descriptors.h (Descriptors::claim_for_plugin): New function.
9951 (Open_descriptor::is_claimed): New field.
9952 (claim_descriptor_for_plugin): New function.
9953 * fileread.cc (File_read::claim_for_plugin): New function.
9954 * fileread.h (File_read::claim_for_plugin): New function.
9955 (File_read::descriptor): New function.
9956 * gold.cc: Include "plugin.h".
9957 (queue_initial_tasks): Add task to call plugin hooks for generating
9958 new object files.
9959 * main.cc: Include "plugin.h".
9960 (main): Load plugin libraries.
9961 * object.h (Pluginobj): Declare.
9962 (Object::pluginobj): New function.
9963 (Object::do_pluginobj): New function.
9964 (Object::set_target): New function.
9965 * options.cc: Include "plugin.h".
9966 (General_options::parse_plugin): New function.
9967 (General_options::General_options): Initialize plugins_ field.
9968 (General_options::add_plugin): New function.
9969 * options.h (Plugin_manager): Declare.
9970 (General_options): Add --plugin option.
9971 (General_options::has_plugins): New function.
9972 (General_options::plugins): New function.
9973 (General_options::add_plugin): New function.
9974 (General_options::plugins_): New field.
9975 * plugin.cc: New file.
9976 * plugin.h: New file.
9977 * readsyms.cc: Include "plugin.h".
9978 (Read_symbols::do_read_symbols): Check for archive before checking
9979 for ELF file. Call plugin hooks to claim files.
9980 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9981 from a real object file; force override when processing replacement
9982 files.
9983 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9984 (Symbol::init_base_object): Likewise.
9985 (Symbol::init_base_output_data): Likewise.
9986 (Symbol::init_base_output_segment): Likewise.
9987 (Symbol::init_base_constant): Likewise.
9988 (Symbol::init_base_undefined): Likewise.
9989 (Symbol::output_section): Assert that object is not a plugin.
9990 (Symbol_table::add_from_pluginobj): New function.
9991 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9992 undefined.
9993 (Symbol_table::sized_write_globals): Likewise.
9994 (Symbol_table::add_from_pluginobj): Instantiate template.
9995 * symtab.h (Sized_pluginobj): Declare.
9996 (Symbol::in_real_elf): New function.
9997 (Symbol::set_in_real_elf): New function.
9998 (Symbol::in_real_elf_): New field.
9999 (Symbol_table::add_from_pluginobj): New function.
10000
10001 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10002 (LIBDL): New variable.
10003 (LDADD): Add LIBDL.
10004 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10005 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10006 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10007 (MOSTLYCLEANFILES): Likewise.
10008 * testsuite/Makefile.in: Regenerate.
10009 * testsuite/plugin_test.c: New file.
10010 * testsuite/plugin_test_1.sh: New file.
10011 * testsuite/plugin_test_2.sh: New file.
10012
10013 2008-09-16 Ian Lance Taylor <iant@google.com>
10014
10015 * target-reloc.h (relocate_section): Check whether a symbol is
10016 defined by the ABI before reporting an undefined symbol error.
10017 * target.h (Target::is_defined_by_abi): Make parameter const.
10018 (Target::do_is_defined_by_abi): Likewise.
10019 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10020 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10021 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10022 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10023 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10024 * testsuite/Makefile.in: Rebuild.
10025
10026 * fileread.cc (make_view): Add casts to avoid warning.
10027
10028 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10029
10030 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10031 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10032
10033 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10034
10035 * options.h (General_options::output_is_executable): New.
10036 (General_options::output_is_pie): New.
10037 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10038 for shared libraries.
10039 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10040
10041 2008-09-11 Chris Demetriou <cgd@google.com>
10042
10043 * options.h (origin): New -z option.
10044 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10045 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10046 in DT_FLAGS_1.
10047
10048 2008-09-05 Cary Coutant <ccoutant@google.com>
10049
10050 * fileread.cc (File_read::make_view): Add check for attempt to map
10051 beyond end of file.
10052
10053 2008-09-05 Cary Coutant <ccoutant@google.com>
10054
10055 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10056 explicit instantiations.
10057
10058 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10059
10060 PR gold/6858
10061 * options.cc (General_options::finalize): Allow undefined symbols
10062 in shlibs if linking -shared.
10063
10064 PR gold/6859
10065 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10066 symbols as not needing a dynsym entry.
10067
10068 2008-08-20 Craig Silverstein <csilvers@google.com>
10069
10070 * fileread.cc (File_read::open): Do not lock the file unless it
10071 was successfully opened.
10072
10073 2008-08-14 Cary Coutant <ccoutant@google.com>
10074
10075 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10076 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10077 * testsuite/tls_test.cc (struct int128): 128-bit struct
10078 for testing TLS relocs with non-zero addend.
10079 (v12): New TLS variable.
10080 (t12): New test.
10081 (t_last): Add check for v12.
10082 * testsuite/tls_test.h (t12): New function.
10083 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10084
10085 2008-08-13 Ian Lance Taylor <iant@google.com>
10086
10087 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10088 set tls_segment_ or relro_segment_.
10089 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10090 when appropriate.
10091 * output.h (Output_section::clear_is_relro): New function.
10092 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10093 sections specially even when output_data_ is empty.
10094 (Output_segment::maximum_alignment): When first section is relro,
10095 only force alignment for PT_LOAD segments.
10096 * script.cc (script_data_segment_align): New function.
10097 (script_data_segment_relro_end): New function.
10098 * script-c.h (script_data_segment_align): Declare.
10099 (script_data_segment_relro_end): Declare.
10100 * script-sections.h (class Script_sections): Declare
10101 data_segment_align and data_segment_relro_end. Add fields
10102 segment_align_index_ and saw_relro_end_.
10103 * script-sections.cc (class Sections_element): Add set_is_relro
10104 virtual function. Add new bool* parameter to place_orphan_here.
10105 Add get_output_section virtual function.
10106 (class Output_section_definition): Add set_is_relro. Add new
10107 bool* parameter to place_orphan_here. Add get_output_section.
10108 Add is_relro_ field.
10109 (Output_section_definition::Output_section_definition): Initialize
10110 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10111 and is_relro_ fields.
10112 (Output_section_definition::place_orphan_here): Add is_relro
10113 parameter.
10114 (Output_section_definition::set_section_addresses): Set relro for
10115 output section.
10116 (Output_section_definition::alternate_constraint): Likewise.
10117 (class Orphan_output_section): Add new bool* parameter to
10118 place_orphan_here. Add get_output_section.
10119 (Orphan_output_section::place_orphan_here): Add is_relro
10120 parameter.
10121 (Script_sections::Script_sections): Initialize
10122 data_segment_align_index_ and saw_relro_end_.
10123 (Script_sections::data_segment_align): New function.
10124 (Script_sections::data_segment_relro_end): New function.
10125 (Script_sections::place_orphan): Set or clear is_relro.
10126 (Script_sections::set_section_addresses): Force alignment of first
10127 TLS section.
10128 * yyscript.y (exp): Call script_data_segment_align and
10129 script_data_segment_relro_end.
10130 * testsuite/relro_script_test.t: New file.
10131 * testsuite/relro_test.cc (using_script): Declare.
10132 (t1, t2): Test using_script.
10133 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10134 (relro_script_test_SOURCES): Define.
10135 (relro_script_test_DEPENDENCIES): Define.
10136 (relro_script_test_LDFLAGS): Define.
10137 (relro_script_test_LDADD): Define.
10138 (relro_script_test.so): New target.
10139 * testsuite/Makefile.in: Rebuild.
10140
10141 2008-08-06 Cary Coutant <ccoutant@google.com>
10142
10143 * archive.cc (Archive::total_archives, Archive::total_members)
10144 (Archive::total_members_loaded): New variables.
10145 (Archive::setup): Add parameter. Add option to preread
10146 archive symbols.
10147 (Archive::read_armap): Add counter.
10148 (Archive::get_file_and_offset): New function.
10149 (Archive::get_elf_object_for_member): New function.
10150 (Archive::read_all_symbols): New function.
10151 (Archive::read_symbols): New function.
10152 (Archive::add_symbols): Add counters.
10153 (Archive::include_all_members): Use armap to find members if it's
10154 already built.
10155 (Archive::include_member): Skip reading symbols if already read.
10156 Factored code into Archive::get_file_and_offset and
10157 Archive::get_elf_object_for_member. Changed call to
10158 Mapfile::report_include_archive_member.
10159 (Archive::print_stats): New function.
10160 * archive.h: Declare Object and Read_symbols_data classes.
10161 (Archive::Archive): Add initializers for new members.
10162 (Archive::setup): Add parameter.
10163 (Archive::print_stats): New function.
10164 (Archive::total_archives, Archive::total_members)
10165 (Archive::total_members_loaded): New variables.
10166 (Archive::get_file_and_offset): New function.
10167 (Archive::get_elf_object_for_member): New function.
10168 (Archive::read_all_symbols): New function.
10169 (Archive::read_symbols): New function.
10170 (Archive::Archive_member): New class.
10171 (Archive::members_): New member.
10172 (Archive::num_members_): New member.
10173 * main.cc: Include archive.h.
10174 (main): Call Archive::print_stats.
10175 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10176 archive parameter; member_name is now the fully-decorated name.
10177 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10178 * options.h: (General_options): Add --preread-archive-symbols option.
10179 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10180 Archive::setup.
10181
10182 2008-08-04 Ian Lance Taylor <iant@google.com>
10183
10184 * symtab.h (Symbol::use_plt_offset): New function.
10185 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10186 * powerpc.cc (Relocate::relocate): Likewise.
10187 * sparc.cc (Relocate::relocate): Likewise.
10188 * x86_64.cc (Relocate::relocate): Likewise.
10189 * testsuite/weak_plt.sh: New test.
10190 * testsuite/weak_plt_main.cc: New test.
10191 * testsuite/weak_plt_shared.cc: New test.
10192 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10193 (check_PROGRAMS): Add weak_plt.
10194 (check_DATA): Add weak_plt_shared.so.
10195 (weak_plt_main_pic.o, weak_plt): New targets.
10196 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10197 * testsuite/Makefile.in: Rebuild.
10198
10199 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10200 gcctestdir/ld.
10201 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10202 * testsuite/Makefile.in: Rebuild.
10203
10204 2008-08-04 Alan Modra <amodra@bigpond.net.au>
10205
10206 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10207 * Makefile.in: Regenerate.
10208 * po/POTFILES.in: Regenerate.
10209
10210 2008-07-29 Ian Lance Taylor <iant@google.com>
10211
10212 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10213 symbols before other symbols.
10214 * testsuite/script_test_2.cc (test_addr): Declare.
10215 (test_addr_alias): Declare.
10216 (main): Check that test_addr and test_addr_alias have the right
10217 values.
10218 * testsuite/script_test_2.t: Define test_addr_alias and
10219 test_addr.
10220
10221 2008-07-24 Ian Lance Taylor <iant@google.com>
10222
10223 PR 5990
10224 * descriptors.cc: New file.
10225 * descriptors.h: New file.
10226 * gold-threads.h (class Hold_optional_lock): New class.
10227 * fileread.cc: Include "descriptors.h".
10228 (File_read::~File_read): Release descriptor rather than closing
10229 it.
10230 (File_read::open) [file]: Call open_descriptor rather than open.
10231 Set is_descriptor_opened_.
10232 (File_read::open) [memory]: Assert that descriptor is not open.
10233 (File_read::reopen_descriptor): New function.
10234 (File_read::release): Release descriptor.
10235 (File_read::do_read): Make non-const. Reopen descriptor.
10236 (File_read::read): Make non-const.
10237 (File_read::make_view): Reopen descriptor.
10238 (File_read::do_readv): Likewise.
10239 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10240 Update declarations.
10241 * layout.cc: Include "descriptors.h".
10242 (Layout::create_build_id): Use open_descriptor rather than open.
10243 * output.cc: Include "descriptors.h".
10244 (Output_file::open): Use open_descriptor rather than open.
10245 * archive.cc (Archive::const_iterator): Change Archive to be
10246 non-const.
10247 (Archive::begin, Archive::end): Make non-const.
10248 (Archive::count_members): Likewise.
10249 * archive.h (class Archive): Update declarations.
10250 * object.h (Object::read): Make non-const.
10251 * Makefile.am (CCFILES): Add descriptors.cc.
10252 (HFILES): Add descriptors.h.
10253 * Makefile.in: Rebuild.
10254
10255 PR 6716
10256 * gold.h: Always include <clocale>. Add Solaris workarounds
10257 following code in binutils/sysdep.h.
10258
10259 PR 6048
10260 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10261 this->eh_frame_hdr_ is NULL before using it.
10262
10263 * dynobj.cc (Versions::Versions): Update comment.
10264
10265 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10266 the base version name.
10267
10268 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10269 array size plus one.
10270 (Stringpool_template::set_string_offsets): Subtract one from key
10271 before using it as an array index.
10272 (Stringpool_template::get_offset_with_length): Likewise.
10273 (Stringpool_template::write_to_buffer): Likewise.
10274 * stringpool.h (Stringpool_template::get_offset_from_key):
10275 Likewise.
10276
10277 2008-07-23 Ian Lance Taylor <iant@google.com>
10278
10279 PR 6658
10280 * object.h (Merged_symbol_value::value): Do our best to handle a
10281 negative addend.
10282
10283 PR 6647
10284 * script.cc (Version_script_info::get_versions): Don't add empty
10285 version tag to return value.
10286 (Version_script_info::get_symbol_version_helper): Change return
10287 type to bool. Add pversion parameter. Change all callers.
10288 (script_register_vers_node): Don't require a non-NULL tag.
10289 * script.h (class Version_script_info): Update declarations.
10290 (Version_script_info::get_symbol_version): Change return type to
10291 bool. Add version parameter. Change all callers.
10292 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10293 handling. Handle an empty version from a version script.
10294 (Symbol_table::define_special_symbol): Likewise.
10295 * testsuite/ver_test_10.script: New file.
10296 * testsuite/ver_test_10.sh: New file.
10297 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10298 (check_DATA): Add ver_test_10.syms.
10299 (ver_test_10.syms, ver_test_10.so): New target.
10300 * testsuite/Makefile.in: Rebuild.
10301
10302 2008-07-23 Simon Baldwin <simonb@google.com>
10303
10304 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10305 to zero for undefined symbols from dynamic libraries.
10306
10307 2008-07-23 Ian Lance Taylor <iant@google.com>
10308
10309 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10310 Change all callers.
10311 * symtab.h (class Symbol_table): Update declaration.
10312 * testsuite/ver_test_9.cc: New file.
10313 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10314 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10315 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10316 (ver_test_9.so, ver_test_9.o): New targets.
10317 * testsuite/Makefile.in: Rebuild.
10318
10319 2008-07-22 Ian Lance Taylor <iant@google.com>
10320
10321 * options.h (class General_options): Define --check-sections.
10322 * layout.cc (Layout::set_segment_offsets): Handle
10323 --check-sections.
10324
10325 * options.h (class General_options): Define -n/--nmagic and
10326 -N/--omagic.
10327 * options.cc (General_options::finalize): For -n/--nmagic or
10328 -N/--omagic, set -static.
10329 * layout.cc (Layout::attach_allocated_section_to_segment): If
10330 -N/--omagic, don't put read-only and read-write sections in
10331 different segments.
10332 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10333 finding a read-only segment.
10334 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10335 don't set the minimum segment alignment to the common page size,
10336 and don't set the file offset to the address modulo the page size.
10337 * script-sections.cc (Script_sections::create_segments): If
10338 -n/--omagic, don't put read-only and read-write sections in
10339 different segments.
10340
10341 * cref.cc: New file.
10342 * cref.h: New file.
10343 * options.h (class General_options): Add --print-symbol-counts.
10344 * main.cc (main): Issue defined symbol report if requested.
10345 * archive.cc (Archive::interpret_header): Make into a const member
10346 function.
10347 (Archive::add_symbols): Call Input_objects::archive_start and
10348 archive_stop.
10349 (Archive::const_iterator): Define new class.
10350 (Archive::begin, Archive::end): New functions.
10351 (Archive::include_all_members): Rewrite to use iterator.
10352 (Archive::count_members): New function.
10353 * archive.h (class Archive): Update declarations.
10354 (Archive::filename): New function.
10355 * object.cc: Include "cref.h".
10356 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10357 (Sized_relobj::do_get_global_symbol_counts): New function.
10358 (Input_objects::add_object): Add object to cross-referencer.
10359 (Input_objects::archive_start): New function.
10360 (Input_objects::archive_stop): New function.
10361 (Input_objects::print_symbol_counts): New function.
10362 * object.h: Declare Cref and Archive.
10363 (Object::get_global_symbol_counts): New function.
10364 (Object::do_get_global_symbol_counts): New pure virtual function.
10365 (class Sized_relobj): Add defined_count_ field. Update
10366 declarations.
10367 (class Input_objects): Add cref_ field. Update constructor.
10368 Update declarations.
10369 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10370 defined_count_.
10371 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10372 symbol counts.
10373 (Sized_dynobj::do_get_global_symbol_counts): New function.
10374 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10375 defined_count_. Update declarations. Define Symbols typedef.
10376 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10377 parameter. Change all callers.
10378 (Symbol_table::add_from_dynobj): Add sympointers and defined
10379 parameters. Change all callers.
10380 * symtab.h (class Symbol_table): Update declarations.
10381 * Makefile.am (CCFILES): Add cref.cc.
10382 (HFILES): Add cref.h.
10383 * Makefile.in: Rebuild.
10384
10385 2008-07-22 Simon Baldwin <simonb@google.com>
10386
10387 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10388 to zero when writing undefined symbols.
10389
10390 2008-07-22 Ian Lance Taylor <iant@google.com>
10391
10392 * output.cc (Output_section::add_input_section): Don't try to
10393 merge empty merge sections.
10394
10395 2008-07-21 Craig Silverstein <csilvers@google.com>
10396
10397 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10398 Include symbol version in error message.
10399
10400 2008-07-20 Chris Demetriou <cgd@google.com>
10401
10402 * configure.ac (gold_cv_c_random_seed): New configured variable.
10403 (RANDOM_SEED_CFLAGS): New substituted variable.
10404 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10405 * configure: Rebuild.
10406 * Makefile.in: Likewise.
10407 * testsuite/Makefile.in: Likewise.
10408
10409 2008-07-18 Ian Lance Taylor <iant@google.com>
10410
10411 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10412 where we see NAME/NULL and NAME/VERSION as separate symbols.
10413 * testsuite/ver_test_main.cc (main): Call t4.
10414 (t4, t4_2a): Define.
10415 * testsuite/ver_test_2.cc (t4_2): Define.
10416 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10417 * testsuite/ver_test_4.cc (t4_2a): Define.
10418 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10419 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10420
10421 2008-07-17 Ian Lance Taylor <iant@google.com>
10422
10423 * dynobj.cc (Versions::add_def): If we give an error about a
10424 missing version, go ahead and create the version anyhow.
10425
10426 2008-07-10 Ian Lance Taylor <iant@google.com>
10427
10428 Handle output sections with more than 0x7fffffff bytes.
10429 * object.h (class Relobj): Change map_to_output_ to
10430 output_sections_, and just keep a section pointer. Change all
10431 uses. Move comdat group support to Sized_relobj.
10432 (Relobj::is_section_specially_mapped): Remove.
10433 (Relobj::output_section): Remove poff parameter. Change all
10434 callers.
10435 (Relobj::output_section_offset): New function.
10436 (Relobj::set_section_offset): Rewrite.
10437 (Relobj::map_to_output): Remove.
10438 (Relobj::output_sections): New function.
10439 (Relobj::do_output_section_offset): New pure virtual function.
10440 (Relobj::do_set_section_offset): Likewise.
10441 (class Sized_relobj): Add section_offsets_ field. Add comdat
10442 group support from Relobj. Update declarations.
10443 (Sized_relobj::get_output_section_offset): New function.
10444 (Sized_relobj::do_output_section_offset): New function.
10445 (Sized_relobj::do_set_section_offset): New function.
10446 * object.cc (Relobj::output_section_address): Remove.
10447 (Sized_relobj::Sized_relobj): Initialize new fields.
10448 (Sized_relobj::include_section_group): Cast find_kept_object to
10449 Sized_relobj.
10450 (Sized_relobj::include_linkonce_section): Likewise.
10451 (Sized_relobj::do_layout): Use separate arrays for output section
10452 and output offset.
10453 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10454 output_sections.
10455 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10456 output_sections and section_offsets.
10457 (Sized_relobj::write_local_symbols): Likewise.
10458 (map_to_kept_section): Compute output address directly.
10459 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10460 output_sections and section_offsets.
10461 (Sized_relobj::write_sections): Likewise.
10462 (Sized_relobj::relocate_sections): Likewise.
10463 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10464 * output.h (class Output_reloc): Update declarations. Change
10465 u2_.relobj to Sized_relobj*.
10466 (class Output_data_reloc): Change add functions to use
10467 Sized_relobj*.
10468 * output.cc (Output_reloc::Output_reloc): Change relobj to
10469 Sized_relobj*.
10470 (Output_reloc::local_section_offset): Change return type to
10471 Elf_Addr. Use get_output_section_offset.
10472 (Output_reloc::get_address): Likewise.
10473 (Output_section::is_input_address_mapped): Don't call
10474 is_section_specially_mapped.
10475 (Output_section::output_offset): Likewise.
10476 (Output_section::output_address): Likewise.
10477 (Output_section::starting_output_address): Likewise.
10478 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10479 parameter to Sized_relobj*.
10480 (Copy_relocs::need_copy_reloc): Likewise.
10481 (Copy_relocs::save): Likewise.
10482 * copy-relocs.h (class Copy_relocs): Update declarations.
10483 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10484 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10485 * target-reloc.h (relocate_for_relocatable): Change
10486 offset_in_output_section type to Elf_Addr. Change code that uses
10487 it as well.
10488 * layout.cc (Layout::layout): Always set *off.
10489 * mapfile.cc (Mapfile::print_input_section): Use
10490 output_section_offset.
10491 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10492 Sized_relobj*.
10493 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10494 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10495 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10496
10497 2008-07-03 Ian Lance Taylor <iant@google.com>
10498
10499 * layout.cc (Layout::include_section): Do not discard unrecognized
10500 SHT_STRTAB sections.
10501
10502 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10503
10504 * script.cc (Lex::can_continue_name): Make '?' allowable in
10505 version-script names.
10506 * testsuite/version_script.map: Change glob pattern to use '?'
10507
10508 2008-06-30 Manish Singh <yosh@gimp.org>
10509
10510 PR 6585
10511 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10512 Correct typo.
10513
10514 2008-06-30 Ian Lance Taylor <iant@google.com>
10515
10516 PR 6660
10517 PR 6682
10518 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10519 versions]: Don't try to read the value in the contents, since we
10520 don't use it. Use the template endianness when writing.
10521
10522 2008-06-25 Cary Coutant <ccoutant@google.com>
10523
10524 * fileread.cc (File_read::make_view): Assert on zero-length view.
10525 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10526 symbol table when there are no symbols to read.
10527
10528 2008-06-23 Craig Silverstein <csilvers@google.com>
10529
10530 * version.cc (version_string): Bump to 1.7
10531
10532 2008-06-18 Craig Silverstein <csilvers@google.com>
10533
10534 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10535 constant 0xFFFF to type Valtype.
10536 (Powerpc_relocate_functions::rel16_ha): Likewise.
10537
10538 2008-06-17 Ian Lance Taylor <iant@google.com>
10539
10540 * output.h (Output_section::Input_section): Initialize p2align_ to
10541 zero for Output_section_data constructors.
10542 (Output_section::Input_section::addralign): If not an input
10543 section, return the alignment of the Output_section_data.
10544 * testsuite/copy_test.cc: New file.
10545 * testsuite/copy_test_1.cc: New file.
10546 * testsuite/copy_test_2.cc: New file.
10547 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10548 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10549 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10550 (copy_test_1_pic.o, copy_test_1.so): New targets.
10551 (copy_test_2_pic.o, copy_test_2.so): New targets.
10552 * testsuite/Makefile.in: Rebuild.
10553
10554 * script-sections.cc (Script_sections::place_orphan): Initialize
10555 local variable exact.
10556
10557 2008-06-13 David Edelsohn <edelsohn@gnu.org>
10558
10559 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10560
10561 2008-06-12 David Edelsohn <edelsohn@gnu.org>
10562 David S. Miller <davem@davemloft.net>
10563
10564 * powerpc.cc: New file.
10565 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10566 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10567 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10568 * Makefile.in: Rebuild.
10569
10570 2008-06-09 Ian Lance Taylor <iant@google.com>
10571
10572 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10573 <exception>.
10574 (throwing, orig_terminate): New static variables.
10575 (terminate_handler): New static function.
10576 (t2): Set terminate handler.
10577
10578 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10579
10580 PR 6584
10581 * binary.cc (Binary_to_elf::sized_convert): Fix .data
10582 alignment.
10583
10584 2008-05-30 Cary Coutant <ccoutant@google.com>
10585
10586 * archive.cc (Archive::include_all_members) Correct to step
10587 over symbol table and extended name table in thin archives.
10588
10589 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10590
10591 PR 6407
10592 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10593 calculation.
10594
10595 2008-05-28 Caleb Howe <cshowe@google.com>
10596
10597 * reduced_debug_output.cc: New file.
10598 * reduced_debug_output.h: New file.
10599 * options.h (class General_options): Add --strip-debug-non-line.
10600 * options.cc (General_options::finalize): Add strip_debug_non_line
10601 to the strip heirarchy.
10602 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10603 fields.
10604 * layout.cc: Include "reduced_debug_output.h".
10605 (Layout::Layout): Initialize new fields.
10606 (line_only_debug_sections): New static array.
10607 (is_lines_only_debug_sections): New static inline function.
10608 (Layout::include_section): Handle --strip-debug-non-line.
10609 (Layout::make_output_section): If --strip-debug-non-line, build
10610 new output sections for .debug_abbrev and .debug_info.
10611 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10612 gold. Warn about possible overflow.
10613 (read_signed_LEB_128): Likewise.
10614 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10615 (read_signed_LEB_128): Declare.
10616 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10617 (HFILES): Add reduced_debug_output.h.
10618 * Makefile.in: Rebuild.
10619
10620 2008-05-21 Ian Lance Taylor <iant@google.com>
10621
10622 * mapfile.cc: New file.
10623 * mapfile.h: New file.
10624 * options.h (class General_options): Add -M/--print-map and -Map.
10625 * options.cc (General_options::finalize): Make -M equivalent to
10626 -Map -.
10627 * main.cc: Include <cstdio> and "mapfile.h".
10628 (main): Open mapfile if requested.
10629 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10630 constructor. Change caller.
10631 (queue_initial_tasks): Add mapfile parameter. Change caller.
10632 (queue_middle_tasks): Likewise.
10633 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10634 declarations.
10635 * archive.cc: Include "mapfile.h".
10636 (Archive::add_symbols): Add mapfile parameter. Change all
10637 callers. Pass mapfile, symbol, and reason to include_member.
10638 (Archive::include_all_members): Add mapfile parameter. Change all
10639 callers.
10640 (Archive::include_member): Add mapfile, sym, and why parameters.
10641 Change all callers. Report inclusion to map file.
10642 * archive.h: Include "fileread.h".
10643 (class Archive): Update declarations.
10644 (Archive::file): New const method.
10645 (class Add_archive_symbols): Add mapfile_ field. Update
10646 constructor. Change all callers.
10647 * readsyms.h (class Read_symbols): Likewise.
10648 (class Finish_group): Likewise.
10649 (class Read_script): Likewise.
10650 * common.cc: Include "mapfile.h".
10651 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10652 all callers.
10653 (Symbol_table::do_allocate_commons): Likewise.
10654 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10655 symbol allocation to mapfile.
10656 * common.h (class Allocate_commons_task): Add mapfile_ field.
10657 Update constructor. Change all callers.
10658 * symtab.h (class Symbol_table): Update declarations.
10659 * layout.cc: Include "mapfile.h".
10660 (Layout_task_runner::run): Print information to mapfile.
10661 (Layout::create_gold_note): Change Output_data_fixed_space to
10662 Output_data_zero_fill.
10663 (Layout::create_build_id): Likewise.
10664 (Layout::print_to_mapfile): New function.
10665 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10666 constructor. Change caller.
10667 (class Layout): Declare print_to_mapfile.
10668 * output.cc (Output_section::Input_section::print_to_mapfile): New
10669 function.
10670 (Output_section::add_input_section): If producing a map, always
10671 add to input_sections_ list.
10672 (Output_section::do_print_to_mapfile): New function.
10673 (Output_segment::print_sections_to_mapfile): New function.
10674 (Output_segment::print_section_list_to_mapfile): New function.
10675 * output.h: Include "mapfile.h".
10676 (Output_data::print_to_mapfile): New function.
10677 (Output_data::do_print_to_mapfile): New virtual function.
10678 (Output_segment_headers::do_print_to_mapfile): New function.
10679 (Output_file_header::do_print_to_mapfile): New function.
10680 (Output_data_const::do_print_to_mapfile): New function.
10681 (class Output_data_const_buffer): Add map_name_ field. Update
10682 constructor. Change all callers. Add do_print_to_mapfile
10683 function.
10684 (class Output_data_fixed_space): Likewise.
10685 (class Output_data_space): Likewise.
10686 (class Output_data_zero_fill): New class.
10687 (Output_data_strtab::do_print_to_mapfile): New function.
10688 (Output_data_reloc_base::do_print_to_mapfile): New function.
10689 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10690 (Output_data_group::do_print_to_mapfile): New function.
10691 (Output_data_got::do_print_to_mapfile): New function.
10692 (Output_data_dynamic::do_print_to_mapfile): New function.
10693 (Output_symtab_xindex::do_print_to_mapfile): New function.
10694 (class Output_section): Declare do_print_to_mapflie. Declare
10695 print_to_mapfile in Input_section.
10696 (class Output_segment): Declare new functions.
10697 * object.h (Sized_relobj::symbol_count): New function.
10698 * script-sections.cc
10699 (Output_section_element_dot_assignment::set_section_addresses):
10700 Change Output_data_fixed_space to Output_data_zero_fill.
10701 (Output_data_expression::do_print_to_mapfile): New function.
10702 * script.cc (read_input_script): Add mapfile parameter. Change
10703 all callers.
10704 * script.h (read_input_script): Update declaration.
10705 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10706 (Eh_frame::do_print_to_mapfile): New function.
10707 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10708 (Output_merge_string::do_print_to_mapfile): New function.
10709 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10710 function.
10711 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10712 function.
10713 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10714 function.
10715 * Makefile.am (CCFILES): Add mapfile.cc.
10716 (HFILES): Add mapfile.h.
10717 * Makefile.in: Rebuild.
10718
10719 2008-05-19 Ian Lance Taylor <iant@google.com>
10720
10721 * options.h (class General_options): Add -z relro.
10722 * layout.cc (Layout::Layout): Initialize relro_segment_.
10723 (Layout::add_output_section_data): Return the output section.
10724 (Layout::make_output_section): Rcognize relro sections and mark
10725 them appropriately.
10726 (Layout::attach_allocated_section_to_segment): Put relro sections
10727 in a PT_GNU_RELRO segment.
10728 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10729 section as relro.
10730 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10731 PT_TLS segments.
10732 (Layout::linkonce_mapping): Map d.rel.ro.local to
10733 .data.rel.ro.local.
10734 (Layout::output_section_name): Us .data.rel.ro.local for any
10735 section which begins with that.
10736 * layout.h (class Layout): Update add_output_section_data
10737 declaration. Add relro_segment_ field.
10738 * output.cc (Output_section::Output_section): Initialize is_relro_
10739 and is_relro_local_ fields.
10740 (Output_segment::add_output_section): Group relro sections.
10741 (Output_segment::is_first_section_relro): New function.
10742 (Output_segment::maximum_alignment): If there is a relro section,
10743 align the segment to the common page size.
10744 (Output_segment::set_section_addresses): Track whether we are
10745 looking at relro sections. If the last section is a relro
10746 section, align to the common page size.
10747 (Output_segment::set_section_list_addresses): Add in_relro
10748 parameter. Change all callers. Align to the page size when
10749 moving from relro to non-relro section.
10750 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10751 segment.
10752 * output.h (class Output_section): Add is_relro_ and
10753 is_relro_local_ fields.
10754 (Output_section::is_relro): New function.
10755 (Output_section::set_is_relro): New function.
10756 (Output_section::is_relro_local): New function.
10757 (Output_section::set_is_relro_local): New function.
10758 (class Output_segment): Update declarations.
10759 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10760 * sparc.cc (Target_sparc::got_section): Likewise.
10761 * x86_64.cc (Target_x86_64::got_section): Likewise.
10762 * testsuite/relro_test_main.cc: New file.
10763 * testsuite/relro_test.cc: New file.
10764 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10765 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10766 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10767 (relro_test.so, relro_test_pic.o): New targets.
10768 * testsuite/Makefile.in: Rebuild.
10769
10770 2008-05-16 Ian Lance Taylor <iant@google.com>
10771
10772 * output.cc (Output_segment::add_output_section): Remove front
10773 parameter.
10774 * output.h (class Output_segment): Remove
10775 add_initial_output_section and overloaded add_output_section.
10776 Update declaration of remaining add_output_section.
10777 * layout.cc (Layout::create_interp): Call add_output_section
10778 rather than add_initial_output_section.
10779 (Layout::finish_dynamic_section): Likewise.
10780
10781 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10782 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10783 know the dynamic type.
10784 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10785 field. Initialize it in constructor.
10786 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10787 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10788 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10789 reloc.
10790
10791 * output.cc (Output_reloc::get_address): Change return type to
10792 Elf_Addr.
10793 * output.h (class Output_reloc): Update get_address declaration.
10794 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10795 for section addresses.
10796
10797 2008-05-09 Ian Lance Taylor <iant@google.com>
10798
10799 PR 6493
10800 * gold.cc (gold_nomem): Use return value of write.
10801
10802 2008-05-08 Ian Lance Taylor <iant@google.com>
10803
10804 * symtab.c (Symbol::init_base_output_data): Add version
10805 parameter. Change all callers.
10806 (Symbol::init_base_output_segment): Likewise.
10807 (Symbol::init_base_constant): Likewise.
10808 (Symbol::init_base_undefined): Likewise.
10809 (Sized_symbol::init_output_data): Likewise.
10810 (Sized_symbol::init_output_segment): Likewise.
10811 (Sized_symbol::init_constant): Likewise.
10812 (Sized_symbol::init_undefined): Likewise.
10813 (Symbol_table::do_define_in_output_data): If the new symbol has a
10814 version, mark it as the default.
10815 (Symbol_table::do_define_in_output_segment): Likewise.
10816 (Symbol_table::do_define_as_constant): Likewise.
10817 * symtab.h (class Symbol): Update declarations.
10818 (class Sized_symbol): Likewise.
10819 * resolve.cc (Symbol::override_version): New function.
10820 (Symbol::override_base): Call override_version.
10821 (Symbol::override_base_with_special): Likewise.
10822 * testsuite/ver_script_8.script: New file.
10823 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10824 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10825 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10826 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10827
10828 2008-05-06 Ian Lance Taylor <iant@google.com>
10829
10830 PR 6049
10831 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10832 functions.
10833 (class General_options): Remove existing --undefined, and add
10834 --no-undefined instead. Add new --undefined as synonym for -u.
10835 * archive.cc (Archive::add_symbols): Check whether symbol was
10836 named with -u.
10837 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10838 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10839 all uses. Add IS_UNDEFINED. Update declarations to split
10840 different versions of init_base. Declare init_base_undefined.
10841 (Symbol::is_defined): Handle IS_UNDEFINED.
10842 (Symbol::is_undefined): Likewise.
10843 (Symbol::is_weak_undefined): Call is_undefined.
10844 (Symbol::is_absolute): Handle IS_CONSTANT.
10845 (class Sized_symbol): Update declarations to split different
10846 versions of init. Declare init_undefined.
10847 (class Symbol_table): Declare new functions.
10848 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10849 Change all callers.
10850 (Symbol::init_base_output_data): Likewise.
10851 (Symbol::init_base_output_segment): Likewise.
10852 (Symbol::init_base_constant): Likewise.
10853 (Symbol::init_base_undefined): New function.
10854 (Sized_symbol::init_object): Rename from init. Change all
10855 callers.
10856 (Sized_symbol::init_output_data): Likewise.
10857 (Sized_symbol::init_output_segment): Likewise.
10858 (Sized_symbol::init_constant): Likewise.
10859 (Sized_symbol::init_undefined): New function.
10860 (Symbol_table::add_undefined_symbols_from_command_line): New
10861 function.
10862 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10863 function.
10864 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10865 (Symbol::output_section): Likewise.
10866 (Symbol::set_output_section): Likewise.
10867 (Symbol_table::sized_finalize_symbol): Likewise.
10868 (Symbol_table::sized_write_globals): Likewise.
10869 * resolve.cc (Symbol_table::should_override): Likewise.
10870 (Symbol::override_base_with_special): Likewise.
10871
10872 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10873 symbol, change it to have default visibility.
10874 * testsuite/protected_1.cc: New file.
10875 * testsuite/protected_2.cc: New file.
10876 * testsuite/protected_3.cc: New file.
10877 * testsuite/protected_main_1.cc: New file.
10878 * testsuite/protected_main_2.cc: New file.
10879 * testsuite/protected_main_3.cc: New file.
10880 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10881 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10882 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10883 (protected_1.so): New target.
10884 (protected_1_pic.o, protected_2_pic.o): New targets.
10885 (protected_3_pic.o): New target.
10886 (check_PROGRAMS): Add protected_2.
10887 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10888 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10889 * testsuite/Makefile.in: Rebuild.
10890
10891 * options.h (DEFINE_var): Add set_user_set_##varname__.
10892 (DEFINE_bool_alias): New macro.
10893 (class General_options): Define -Bstatic using DEFINE_bool_alias
10894 rather than DEFINE_special. Add --undefined as an alias for -z
10895 defs.
10896 * options.cc (General_options::parse_Bstatic): Remove.
10897
10898 * options.h (class General_options): Add --fatal-warnings.
10899 * main.cc (main): Implement --fatal-warnings.
10900 * errors.h (Errors::warning_count): New function.
10901
10902 * options.h (class General_options): Add -Bsymbolic-functions.
10903 * symtab.h (Symbol::is_preemptible): Check for
10904 -Bsymbolic-functions.
10905
10906 2008-05-05 Ian Lance Taylor <iant@google.com>
10907
10908 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10909 as noVARNAME rather than no-VARNAME.
10910 (class General_options): Add option -z combreloc.
10911 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10912 get_address.
10913 (Output_reloc::sort_before) [SHT_REL]: New function.
10914 (Output_reloc::sort_before) [SHT_RELA]: New function.
10915 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10916 Sort_relocs_comparison.
10917 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10918 parameter. Change all callers.
10919 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10920 sort_relocs parameter. Change all callers.
10921 * output.cc (Output_reloc::get_address): New function, broken out
10922 of write_rel.
10923 (Output_reloc::write_rel): Call it.
10924 (Output_reloc::compare): New function.
10925 (Output_data_reloc_base::do_write): Optionally sort relocs.
10926
10927 * configure.ac: If targ_extra_obj is set, link it in.
10928 * configure.tgt: Initialize all variables.
10929 (x86_64*): Set targ_extra_obj and targ_extra_size.
10930 * configure: Rebuild.
10931
10932 * object.cc (Sized_relobj::include_section_group): Adjust section
10933 indexes read from group data. Build vector to pass to
10934 layout_group.
10935 * layout.cc (Layout::layout_group): Add flags and shndxes
10936 parameters. Remove contents parameter. Change caller. Update
10937 explicit instantiations.
10938 * layout.h (class Layout): Update layout_group declaration.
10939 * output.cc (Output_data_group::Output_data_group): Add flags and
10940 input_shndxes parameters. Remove contents parameter. Change
10941 caller.
10942 (Output_data_group::do_write): Change input_sections_ to
10943 input_shndxes_.
10944 * output.h (class Output_data_group): Update constructor
10945 declaration. Rename input_sections_ to input_shndxes_.
10946 * testsuite/many_sections_test.cc: Add template.
10947
10948 2008-04-30 Cary Coutant <ccoutant@google.com>
10949
10950 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10951
10952 * layout.cc (Layout::include_section): Refactored check for debug
10953 info section.
10954 (Layout::add_comdat): Add new parameters. Change type
10955 of signature parameter. Add object and shndx to signatures table.
10956 (Layout::find_kept_object): New function.
10957 * layout.h: Include <cstring>.
10958 (Layout::is_debug_info_section): New function.
10959 (Layout::add_comdat): Add new parameters.
10960 (Layout::find_kept_object): New function.
10961 (Layout::Kept_section): New struct.
10962 (Layout::Signatures): Change type of map range.
10963 * object.cc (Relobj::output_section_address): New function.
10964 (Sized_relobj::include_section_group): Add new parameters. Change
10965 calls to Layout::add_comdat. Change to build table of kept comdat
10966 groups and table mapping discarded sections to kept sections.
10967 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10968 (Sized_relobj::do_layout): Change calls to include_section_group and
10969 include_linkonce_section.
10970 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10971 value to zero when section is discarded.
10972 (Sized_relobj::map_to_kept_section): New function.
10973 * object.h (Relobj::output_section_address): New function.
10974 (Relobj::Comdat_group): New type.
10975 (Relobj::find_comdat_group): New function.
10976 (Relobj::Comdat_group_table): New type.
10977 (Relobj::Kept_comdat_section): New type.
10978 (Relobj::Kept_comdat_section_table): New type.
10979 (Relobj::add_comdat_group): New function.
10980 (Relobj::set_kept_comdat_section): New function.
10981 (Relobj::get_kept_comdat_section): New function.
10982 (Relobj::comdat_groups_): New field.
10983 (Relobj::kept_comdat_sections_): New field.
10984 (Symbol_value::input_value): Update comment.
10985 (Sized_relobj::map_to_kept_section) New function.
10986 (Sized_relobj::include_linkonce_section): Add new parameter.
10987 * target-reloc.h (Comdat_behavior): New type.
10988 (get_comdat_behavior): New function.
10989 (relocate_section): Add code to map a discarded section to the
10990 corresponding kept section when applying a relocation.
10991
10992 2008-04-30 Craig Silverstein <csilvers@google.com>
10993
10994 * dwarf_reader.cc (next_generation_count): New static var.
10995 (Addr2line_cache_entry): New struct.
10996 (addr2line_cache): New static var.
10997 (Dwarf_line_info::one_addr2line): Added caching.
10998 (Dwarf_line_info::clear_addr2line_cache): New function.
10999 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11000 cache-size parameter.
11001 (Dwarf_line_info::one_addr2line_cache): New function.
11002 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11003 new cache-size argument to one_addr2line(), and clear cache.
11004
11005 2008-04-28 Cary Coutant <ccoutant@google.com>
11006
11007 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11008 R_386_PC8 relocations.
11009
11010 2008-04-23 Ian Lance Taylor <iant@google.com>
11011
11012 * object.cc (Sized_relobj::include_section_group): Check for
11013 invalid section group.
11014
11015 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11016 header size.
11017
11018 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11019 than read for file header.
11020 * archive.cc (Archive::include_member): Likewise.
11021
11022 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
11023
11024 * aclocal.m4: Regenerate.
11025 * configure: Regenerate.
11026
11027 2008-04-19 Ian Lance Taylor <iant@google.com>
11028
11029 * version.cc (version_string): Bump to 1.6.
11030
11031 * testsuite/Makefile.am (many_sections_r_test): New target.
11032 (many_sections_r_test_SOURCES): Remove.
11033 (many_sections_r_test_DEPENDENCIES): Remove.
11034 (many_sections_r_test_LDFLAGS): Remove.
11035 (many_sections_r_test_LDADD): Remove.
11036
11037 * object.cc (Sized_relobj::do_add_symbols): Always pass
11038 local_symbol_count_ to add_from_relobj.
11039
11040 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11041 every thousand variables.
11042 * testsuite/Makefile.in: Rebuild.
11043
11044 * object.cc (Xindex::initialize_symtab_xindex): New function.
11045 (Xindex::read_symtab_xindex): New function.
11046 (Xindex::sym_xindex_to_shndx): New function.
11047 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11048 available.
11049 (Sized_relobj::do_initialize_xindex): New function.
11050 (Sized_relobj::do_read_symbols): Adjust section links.
11051 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11052 parameter. Change all callers.
11053 (Sized_relobj::include_section_group): Adjust section links and
11054 symbol section indexes.
11055 (Sized_relobj::do_layout): Adjust section links.
11056 (Sized_relobj::do_count_local_symbols): Adjust section links and
11057 symbol section indexes.
11058 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11059 ordinary and special symbols.
11060 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11061 dynsym_xindex parameters. Change all callers. Adjust section
11062 links. Use SHN_XINDEX when needed.
11063 (Sized_relobj::get_symbol_location_info): Adjust section links.
11064 Don't get fooled by special symbols.
11065 * object.h (class Xindex): Define.
11066 (class Object): Add xindex_ parameter. Declare virtual functoin
11067 do_initialize_xindex.
11068 (Object::adjust_sym_shndx): New function.
11069 (Object::set_xindex): New protected function.
11070 (class Symbol_value): Add is_ordinary_shndx_ field.
11071 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11072 (Symbol_value::value): Assert ordinary section.
11073 (Symbol_value::initialize_input_to_output_map): Likewise.
11074 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11075 Change all callers.
11076 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11077 all callers.
11078 (class Sized_relobj): Update declarations.
11079 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11080 parameter. Change all callers.
11081 (Sized_relobj::adjust_shndx): New function.
11082 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11083 field.
11084 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11085 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11086 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11087 (Sized_dynobj::read_dynsym_section): Adjust section links.
11088 (Sized_dynobj::read_dynamic): Likewise.
11089 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11090 section links.
11091 (Sized_dynobj::do_initialize_xindex): New function.
11092 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11093 do_initialize_xindex.
11094 (Sized_dynobj::adjust_shndx): New function.
11095 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11096 dynsym_xindex_ fields.
11097 (Layout::finalize): Add a call to set_section_indexes before
11098 creating the symtab sections.
11099 (Layout::set_section_indexes): Don't do anything if the section
11100 already has a section index.
11101 (Layout::create_symtab_sections): Add shnum parameter. Change
11102 caller. Create .symtab_shndx section if needed.
11103 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11104 caller.
11105 (Layout::allocated_output_section_count): New function.
11106 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11107 needed.
11108 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11109 fields. Update declarations.
11110 (Layout::symtab_xindex): New function.
11111 (Layout::dynsym_xindex): New function.
11112 (class Write_symbols_task): Add layout_ field.
11113 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11114 Change caller.
11115 * output.cc (Output_section_headers::Output_section_headers): Add
11116 shstrtab_section parameter. Change all callers.
11117 (Output_section_headers::do_sized_write): Store overflow values
11118 for section count and section string table section index in
11119 section header zero.
11120 (Output_file_header::do_sized_write): Check for overflow of
11121 section count and section string table section index.
11122 (Output_symtab_xindex::do_write): New function.
11123 (Output_symtab_xindex::endian_do_write): New function.
11124 * output.h (class Output_section_headers): Add shstrtab_section_.
11125 Update declarations.
11126 (class Output_symtab_xindex): Define.
11127 (Output_section::has_out_shndx): New function.
11128 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11129 field.
11130 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11131 Change all callers.
11132 (Sized_symbol::init): Likewise.
11133 (Symbol::output_section): Check for ordinary symbol.
11134 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11135 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11136 callers.
11137 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11138 Change all callers. Simplify handling of symbols from sections
11139 not included in the link.
11140 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11141 distinction.
11142 (Weak_alias_sorter::operator()): Assert that symbols are
11143 ordinary.
11144 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11145 distinction.
11146 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11147 parameters. Change all callers.
11148 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11149 symbol distinction. Use SHN_XINDEX when needed.
11150 (Symbol_table::write_section_symbol): Add symtab_xindex
11151 parameter. Change all callers.
11152 (Symbol_table::sized_write_section_symbol): Likewise. Use
11153 SHN_XINDEX when needed.
11154 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11155 declarations.
11156 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11157 (Symbol::is_defined): Check is_ordinary.
11158 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11159 (Symbol::is_absolute, Symbol::is_common): Likewise.
11160 (class Sized_symbol): Update declarations.
11161 (class Symbol_table): Update declarations.
11162 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11163 parameters. Change all callers.
11164 (Sized_symbol::override): Likewise.
11165 (Symbol_table::override): Likewise.
11166 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11167 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11168 is_ordinary, and orig_st_shndx parameters. Change all callers.
11169 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11170 to be in an ordinary section.
11171 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11172 object and is_ordinary parameters. Change all callers.
11173 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11174 Change all callers. Don't add undefined or non-ordinary symbols
11175 to reloc_map_.
11176 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11177 Change all callers.
11178 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11179 declarations.
11180 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11181 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11182 (Sized_relobj::relocate_sections): Likewise.
11183 * target-reloc.h (scan_relocs): Adjust section symbol index.
11184 (scan_relocatable_relocs): Likewise.
11185 * i386.cc (Scan::local): Check for ordinary symbols.
11186 * sparc.cc (Scan::local): Likewise.
11187 * x86_64.cc (Scan::local): Likewise.
11188 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11189 to symbol_section_and_value.
11190 * testsuite/many_sections_test.cc: New file.
11191 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11192 (check_PROGRAMS): Add many_sections_test.
11193 (many_sections_test_SOURCES): Define.
11194 (many_sections_test_DEPENDENCIES): Define.
11195 (many_sections_test_LDFLAGS): Define.
11196 (BUILT_SOURCES): Add many_sections_define.h.
11197 (many_sections_define.h): New target.
11198 (BUILT_SOURCES): Add many_sections_check.h.
11199 (many_sections_check.h): New target.
11200 (check_PROGRAMS): Add many_sections_r_test.
11201 (many_sections_r_test_SOURCES): Define.
11202 (many_sections_r_test_DEPENDENCIES): Define.
11203 (many_sections_r_test_LDFLAGS): Define.
11204 (many_sections_r_test_LDADD): Define.
11205 (many_sections_r_test.o): New target.
11206 * testsuite/Makefile.in: Rebuild.
11207
11208 2008-04-17 Cary Coutant <ccoutant@google.com>
11209
11210 * errors.cc (Errors::info): New function.
11211 (gold_info): New function.
11212 * errors.h (Errors::info): New function.
11213 * gold.h (gold_info): New function.
11214 * object.cc (Input_objects::add_object): Print trace output.
11215 * options.cc (options::parse_set): New function.
11216 (General_options::parse_wrap): Deleted.
11217 (General_options::General_options): Deleted initializer.
11218 * options.h (options::String_set): New typedef.
11219 (options::parse_set): New function.
11220 (DEFINE_set): New macro.
11221 (General_options::wrap): Changed to use DEFINE_set. Changed
11222 callers of any_wrap_symbols and is_wrap_symbol.
11223 (General_options::trace, General_options::trace_symbol):
11224 New options.
11225 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11226 (General_options::wrap_symbols_): Deleted.
11227 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11228
11229 2008-04-17 David S. Miller <davem@davemloft.net>
11230
11231 * options.cc (General_options::parse_V): New function.
11232 * options.h: Add entries for -V and -Qy.
11233
11234 2008-04-17 Ian Lance Taylor <iant@google.com>
11235
11236 * common.cc (Symbol_table::allocate_commons): Remove options
11237 parameter. Change caller.
11238 (Symbol_table::do_allocate_commons): Remove options parameter.
11239 Change caller. Just call do_allocate_commons_list twice.
11240 (Symbol_table::do_allocate_commons_list): New function, broken out
11241 of do_allocate_commons.
11242 * common.h (class Allocate_commons_task): Remove options_ field.
11243 Update constructor.
11244 * symtab.cc (Symbol_table::Symbol_table): Initialize
11245 tls_commons_.
11246 (Symbol_table::add_from_object): Put TLS common symbols on
11247 tls_commons_ list.
11248 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11249 which are IN_OUTPUT_DATA.
11250 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11251 allocate_commons and do_allocate_commons declarations. Declare
11252 do_allocate_commons_list.
11253 * gold.cc (queue_middle_tasks): Update creation of
11254 Allocate_commons_task to not pass options.
11255 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11256 (TLS_TEST_C_FLAGS): New variable.
11257 (tls_test_c_pic.o): New target.
11258 (tls_test_shared.so): Link in tls_test_c_pic.o.
11259 (tls_test_c_pic_ie.o): New target.
11260 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11261 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11262 (tls_test_c.o): New target.
11263 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11264 (tls_pic_test_LDADD): Likewise.
11265 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11266 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11267 (tls_test_c_gnu2.o): New target.
11268 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11269 tls_test_c_gnu2.o.
11270 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11271 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11272 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11273 * testsuite/tls_test.cc: Include "config.h".
11274 (t_last): Call t11_last.
11275 * testsuite/tls_test.h (t11, t11_last): Declare.
11276 * testsuite/tls_test_c.c: New file.
11277 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11278 * configure.ac: Check for OpenMP support.
11279 * configure, config.in, Makefile.in: Rebuild.
11280 * testsuite/Makefile.in: Rebuild.
11281
11282 2008-04-16 Cary Coutant <ccoutant@google.com>
11283
11284 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11285 (Target_i386::tls_base_symbol_defined_): New field.
11286 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11287 (Target_i386::Scan::global): Likewise.
11288 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11289 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11290 (Target_x86_64::tls_base_symbol_defined_): New field.
11291 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11292 (Target_x86_64::Scan::global): Likewise.
11293
11294 2008-04-16 Cary Coutant <ccoutant@google.com>
11295
11296 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11297 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11298 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11299 building shared libraries.
11300 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11301 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11302 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11303 * testsuite/Makefile.in: Rebuild.
11304 * testsuite/weak_undef.h: New file.
11305 * testsuite/weak_undef_file1.cc: Add extra test cases.
11306 * testsuite/weak_undef_file2.cc: Likewise.
11307 * testsuite/weak_undef_test.cc: Likewise.
11308
11309 2008-04-16 David S. Miller <davem@davemloft.net>
11310
11311 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11312 Add issued_non_pic_error_ field. Declare check_non_pic.
11313 (Target_sparc::Scan::check_non_pic): New function.
11314 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11315 (Target_sparc::Scan::global): Likewise.
11316
11317 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11318 * configure: Rebuild.
11319
11320 * options.h (DEFINE_enable): New macro.
11321 (new_dtags): New enable option.
11322 (initfirst, interpose, loadfltr, nodefaultlib,
11323 nodelete, nodlopen, nodump): New -z options.
11324 * layout.cc (Layout:finish_dynamic_section): If new
11325 dtags enabled, emit DT_RUNPATH. Also, emit a
11326 DT_FLAGS_1 containing any specified -z flags.
11327
11328 2008-04-16 Ian Lance Taylor <iant@google.com>
11329
11330 * copy-relocs.cc: New file.
11331 * copy-relocs.h: New file.
11332 * reloc.cc: Remove Copy_relocs code.
11333 * reloc.h: Likewise.
11334 * reloc-types.h (struct Reloc_types) [both versions]: Add
11335 get_reloc_addend_noerror.
11336 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11337 variants of add_global which take an addend which must be zero.
11338 * i386.cc: Include "copy-relocs.h".
11339 (class Target_i386): Change type of copy_relocs_ to variable,
11340 update initializer.
11341 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11342 Change all callers.
11343 (Target_i386::do_finalize_sections): Change handling of
11344 copy_relocs_.
11345 * sparc.cc: Include "copy-relocs.h".
11346 (class Target_sparc): Change type of copy_relocs_ to variable,
11347 update initializer.
11348 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11349 Change all callers.
11350 (Target_sparc::do_finalize_sections): Change handling of
11351 copy_relocs_.
11352 * x86_64.cc: Include "copy-relocs.h".
11353 (class Target_x86_64): Change type of copy_relocs_ to variable,
11354 update initializer.
11355 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11356 class. Change all callers.
11357 (Target_x86_64::do_finalize_sections): Change handling of
11358 copy_relocs_.
11359 * Makefile.am (CCFILES): Add copy-relocs.cc.
11360 (HFILES): Add copy-relocs.h.
11361
11362 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11363
11364 * testsuite/script_test_4.sh: Permit leading zeroes.
11365
11366 2008-04-15 Ian Lance Taylor <iant@google.com>
11367
11368 * script-sections.cc (Script_sections::create_segments): Use
11369 header_size_adjustment even when there is enough room for the
11370 headers.
11371 * testsuite/script_test_4.sh: New file.
11372 * testsuite/script_test_4.t: New file.
11373 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11374 (check_DATA): Add script_test_4.stdout.
11375 (MOSTLYCLEANFILES): Likewise.
11376 (script_test_4): New target.
11377 (script_test_4.stdout): New target.
11378 * testsuite/Makefile.in: Rebuild.
11379
11380 * sparc.cc: Add definitions for Output_data_plt_sparc class
11381 constants.
11382
11383 2008-04-14 David S. Miller <davem@davemloft.net>
11384
11385 * sparc.cc: New file.
11386 * Makefile.am (TARGETSOURCES): Add sparc.cc
11387 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11388 * configure.tgt: Document targ_extra_size and
11389 targ_extra_big_endian. Add entries for sparc-* and
11390 sparc64-*.
11391 * configure.ac: Handle targ_extra_size and
11392 targ_extra_big_endian.
11393 * Makefile.in: Rebuild.
11394 * configure: Likewise.
11395 * po/POTFILES.in: Likewise.
11396 * po/gold.pot: Likewise.
11397
11398 2008-04-14 Ian Lance Taylor <iant@google.com>
11399
11400 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11401 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11402 in the name/type/flags to section mapping. Don't call
11403 allocate_output_section.
11404 (Layout::choose_output_section): Change parameter from adjust_name
11405 to is_input_section. Don't permit input sections after sections
11406 are attached to segments. Don't call allocate_output_section.
11407 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11408 not write_enable_output_section.
11409 (Layout::make_output_section): Don't push to
11410 unattached_section_list_ nor call attach_to_segment. Call
11411 attach_section_to_segment if sections are attached.
11412 (Layout::attach_sections_to_segments): New function.
11413 (Layout::attach_section_to_segment): New function.
11414 (Layout::attach_allocated_section_to_segment): Rename from
11415 attach_to_segment. Remove flags parameter.
11416 (Layout::allocate_output_section): Remove function.
11417 (Layout::write_enable_output_section): Remove function.
11418 * layout.h (class Layout): Update for above changes. Add new
11419 field sections_are_attached_.
11420 * output.h (Output_section::update_flags_for_input_section): New
11421 function.
11422 * output.cc (Output_section::add_input_section): Call
11423 update_flags_for_input_section.
11424 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11425
11426 2008-04-11 Cary Coutant <ccoutant@google.com>
11427
11428 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11429 thought unnecessary.
11430 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11431
11432 2008-04-11 Ian Lance Taylor <iant@google.com>
11433
11434 * output.h (class Output_section_data): Remove inline definition
11435 of set_addralign.
11436 * output.cc (Output_section_data::set_addralign): New function.
11437
11438 2008-04-11 Cary Coutant <ccoutant@google.com>
11439
11440 Add support for TLS descriptors for i386 and x86_64.
11441 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11442 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11443 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11444 GOT_TYPE_TLS_DESC.
11445 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11446 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11447 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11448 relocations.
11449 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11450 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11451 Fix problem with initial-exec relocations.
11452 (Target_i386::Relocate::relocate_tls): Likewise.
11453 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11454 relaxation.
11455 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11456 support for section-plus-offset dynamic table entries.
11457 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11458 (Output_data_dynamic::Dynamic_entry): Add support for
11459 section-plus-offset dynamic table entries.
11460 (Output_data_dynamic::Classification): Likewise.
11461 (Output_data_dynamic::classification_): Renamed offset_.
11462 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11463 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11464 (Target_x86_64::make_plt_section): New function.
11465 (Target_x86_64::reserve_tlsdesc_entries): New function.
11466 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11467 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11468 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11469 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11470 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11471 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11472 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11473 add extra PLT entry for TLS descriptors.
11474 (Output_data_plt_x86_64::got_): New field.
11475 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11476 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11477 fields.
11478 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11479 descriptors.
11480 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11481 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11482 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11483 R_386_TLS_DESC_CALL relocations.
11484 (Target_x86_64::Scan::global): Likewise.
11485 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11486 for TLS descriptors.
11487 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11488 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11489 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11490 GD-to-IE relaxation.
11491 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11492 and TLS_DESCRIPTORS.
11493 * Makefile.in: Rebuild.
11494 * configure: Rebuild.
11495 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11496 (tls_test_shared2.so): New target.
11497 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11498 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11499 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11500 (tls_shared_gd_to_ie_test_LDADD): New variable.
11501 (tls_shared_gnu2_gd_to_ie_test): New target.
11502 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11503 New targets.
11504 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11505 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11506 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11507 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11508 (tls_shared_gnu2_test): New target.
11509 (tls_test_gnu2_shared.so): New target.
11510 (tls_shared_gnu2_test_SOURCES): New variable.
11511 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11512 (tls_shared_gnu2_test_LDFLAGS): New variable.
11513 (tls_shared_gnu2_test_LDADD): New variable.
11514 * testsuite/Makefile.in: Rebuild.
11515 * testsuite/Makefile.
11516
11517 2008-04-11 Ian Lance Taylor <iant@google.com>
11518
11519 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11520 justsyms.t.
11521 * testsuite/Makefile.in: Rebuild.
11522
11523 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11524 long.
11525 * testsuite/script_test_2.cc (main): Adjust test.
11526
11527 2008-04-11 David S. Miller <davem@davemloft.net>
11528 Ian Lance Taylor <iant@google.com>
11529
11530 * options.h (General_options): Add entries for '-Y' and
11531 '-relax'.
11532 * options.cc (General_options:finalize): If -Y was used, add those
11533 entries to the library path instead of the default "/lib" and
11534 "/usr/lib".
11535
11536 2008-04-11 David S. Miller <davem@davemloft.net>
11537
11538 * testsuite/justsyms.t: Start at 0x100.
11539 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
11540 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11541 long.
11542 * testsuite/script_test_2.cc: Adjust string and section length
11543 checks.
11544
11545 2008-04-09 Ian Lance Taylor <iant@google.com>
11546
11547 PR gold/5996
11548 * script-sections.cc (Sections_element::allocate_to_segment): Add
11549 orphan parameter.
11550 (Output_section_definition::allocate_to_segment): Likewise.
11551 (Orphan_output_section::allocate_to_segment): Likewise.
11552 (Script_sections::attach_sections_using_phdrs_clause): Don't
11553 propagate non-PT_LOAD segments to orphan sections.
11554 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11555 readelf rather than objdump.
11556 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11557 .interp section and PT_INTERP segment are the same size.
11558 * testsuite/Makefile.in: Rebuild.
11559
11560 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11561 aliases for symbols defined in the same object.
11562 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11563 (weak_alias_test_SOURCES): New variable.
11564 (weak_alias_test_DEPENDENCIES): New variable.
11565 (weak_alias_test_LDFLAGS): New variable.
11566 (weak_alias_test_LDADD): New variable.
11567 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11568 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11569 (weak_alias_test_3.o): New target.
11570 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11571 * testsuite/weak_alias_test_main.cc: New file.
11572 * testsuite/weak_alias_test_1.cc: New file.
11573 * testsuite/weak_alias_test_2.cc: New file.
11574 * testsuite/weak_alias_test_3.cc: New file.
11575
11576 2008-04-08 Ian Lance Taylor <iant@google.com>
11577
11578 * options.h (class General_options): Add --noinhibit-exec option.
11579 * main.cc (main): Check --noinhibit-exec.
11580
11581 * options.h (class General_options): Define --wrap as a special
11582 option. Add wrap_symbols_ field.
11583 (General_options::any_wrap_symbols): New function.
11584 (General_options::is_wrap_symbol): New function.
11585 * options.cc (General_options::parse_wrap): New function.
11586 (General_options::General_options): Initialize wrap_symbols_.
11587 * symtab.cc (Symbol_table::wrap_symbol): New function.
11588 (Symbol_table::add_from_object): Handle --wrap.
11589 * symtab.h (class Symbol_table): Declare wrap_symbol.
11590 * target.h (Target::wrap_char): New function.
11591 (Target::Target_info): Add wrap_char field.
11592 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11593 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11594 * testsuite/testfile.cc (Target_test::test_target_info):
11595 Likewise.
11596
11597 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11598 there is one.
11599
11600 * layout.h (class Layout): Add added_eh_frame_data_ field.
11601 * layout.cc (Layout::Layout): Initialize new field.
11602 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11603 output section until we find a section we merged successfully.
11604 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11605 that the size be non-zero.
11606
11607 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11608 qualifier.
11609
11610 2008-04-08 Craig Silverstein <csilvers@google.com>
11611
11612 * configure.ac: Export new conditional variable HAVE_ZLIB.
11613 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11614 on HAVE_ZLIB.
11615 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11616 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11617
11618 2008-04-07 Ian Lance Taylor <iant@google.com>
11619
11620 * version.cc (version_string): Set to "1.5".
11621
11622 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11623 Add issued_non_pic_error_ field. Declare check_non_pic.
11624 (Target_x86_64::Scan::check_non_pic): New function.
11625 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11626 (Target_x86_64::Scan::global): Likewise.
11627
11628 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11629 addend parameter. Change caller. Handle merge sections.
11630 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11631 Address to Addend. Don't add in the result of
11632 local_section_offset, pass down the addend and use the returned
11633 value.
11634 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11635 Update declarations of local_section_offset and symbol_value.
11636 * testsuite/two_file_test_1.cc (t18): New function.
11637 * testsuite/two_file_test_2.cc (f18): New function.
11638 * testsuite/two_file_test_main.cc (main): Call t18.
11639 * testsuite/two_file_test.h (t18, f18): Declare.
11640
11641 * configure.ac: Don't test for objdump, c++filt, or readelf.
11642 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11643 conditionals.
11644 (TEST_READELF): New variable.
11645 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11646 (check_PROGRAMS): Add two_file_strip_test.
11647 (two_file_strip_test): New target.
11648 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11649 (two_file_same_shared_strip_test_SOURCES): New variable.
11650 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11651 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11652 (two_file_same_shared_strip_test_LDADD): New variable.
11653 (two_file_shared_strip.so): New target.
11654 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11655 (ver_test_5.syms, ver_test_7.syms): Likewise.
11656 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11657 (strip_test_3.stdout): Use TEST_OBJDUMP.
11658 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11659
11660 2008-04-04 Cary Coutant <ccoutant@google.com>
11661
11662 * symtab.h (Symbol::is_weak_undefined): New function.
11663 (Symbol::is_strong_undefined): New function.
11664 (Symbol::is_absolute): New function.
11665 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11666 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11667 absolute symbols.
11668 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11669 (weak_undef_test): New target.
11670 * testsuite/Makefile.in: Rebuild.
11671 * testsuite/weak_undef_file1.cc: New file.
11672 * testsuite/weak_undef_file2.cc: New file.
11673 * testsuite/weak_undef_test.cc: New file.
11674
11675 2008-04-03 Craig Silverstein <csilvers@google.com>
11676
11677 * compressed_output.h (class Output_compressed_section): Use
11678 unsigned buffer.
11679 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11680 add zlib header.
11681 (zlib_compressed_suffix): Removed.
11682 (Output_compressed_section::set_final_data_size): Use unsigned
11683 buffers.
11684 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11685 Fix linker invocation.
11686 (flagstest_o_specialfile_and_compress_debug_sections):
11687 Likewise.
11688 * testsuite/Makefile.in: Regenerated.
11689
11690 2008-04-02 David S. Miller <davem@davemloft.net>
11691
11692 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11693 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11694
11695 2008-04-02 Craig Silverstein <csilvers@google.com>
11696
11697 * TODO: New file.
11698
11699 2008-04-02 Ian Lance Taylor <iant@google.com>
11700
11701 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11702 parameters. Update for new key type to views_. Change all
11703 callers.
11704 (File_read::read): Adjust for byteshift in returned view.
11705 (File_read::add_view): New function, broken out of
11706 find_and_make_view.
11707 (File_read::make_view): New function, broken out of
11708 find_and_make_view.
11709 (File_read::find_or_make_view): Add offset and aligned
11710 parameters. Rewrite accordingly. Change all callers.
11711 (File_read::get_view): Add offset and aligned parameters. Adjust
11712 for byteshift in return value.
11713 (File_read::get_lasting_view): Likewise.
11714 * fileread.h (class File_read): Update declarations.
11715 (class File_read::View): Add byteshift_ field. Add byteshift to
11716 constructor. Add byteshift method.
11717 * archive.h (Archive::clear_uncached_views): New function.
11718 (Archive::get_view): Add aligned parameter. Change all callers.
11719 * object.h (Object::get_view): Add aligned parameter. Change all
11720 callers.
11721 (Object::get_lasting_view): Likewise.
11722
11723 * fileread.cc (File_read::release): Don't call clear_views if
11724 there are multiple objects.
11725 * fileread.h (File_read::clear_uncached_views): New function.
11726 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11727 on the archive.
11728
11729 2008-03-31 Cary Coutant <ccoutant@google.com>
11730
11731 Add thin archive support.
11732 * archive.cc (Archive::armagt): New const.
11733 (Archive::setup): Remove task parameter and calls to unlock.
11734 (Archive::unlock_nested_archives): New function.
11735 (Archive::read_header): Add nested_off parameter. Change
11736 all callers.
11737 (Archive::interpret_header): Likewise.
11738 (Archive::include_all_members): Change to handle thin
11739 archives.
11740 (Archive::include_member): Likewise.
11741 * archive.h (Archive::Archive): Add new parameters and
11742 initializers.
11743 (Archive::armagt): New const.
11744 (Archive::setup): Remove task parameter.
11745 (Archive::unlock_nested_archives): New function.
11746 (Archive::read_header): Add nested_off parameter.
11747 (Archive::interpret_header): Likewise.
11748 (Archive::Nested_archive_table): New typedef.
11749 (Archive::is_thin_archive_): New field.
11750 (Archive::nested_archives_): New field.
11751 (Archive::options_): New field.
11752 (Archive::dirpath_): New field.
11753 (Archive::task_): New field.
11754 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11755 for thin archives. Pass additional parameters to
11756 Archive::Archive. Unlock the archive file after calling
11757 Archive::setup.
11758
11759 2008-03-29 Ian Lance Taylor <iant@google.com>
11760
11761 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11762 version symbol to be local.
11763 * testsuite/ver_test_4.sh: New file.
11764 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11765 (check_DATA): Add ver_test_4.syms.
11766 (ver_test_4.syms): New target.
11767 * testsuite/Makefile.in: Rebuild.
11768
11769 * output.cc
11770 (Output_section::Input_section_sort_entry::has_priority): New
11771 function.
11772 (Output_section::Input_section_sort_entry::match_file_name): New
11773 function.
11774 (Output_section::Input_section_sort_entry::match_section_name):
11775 Remove.
11776 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11777 Remove.
11778 (Output_section::Input_section_sort_entry::match_section_file):
11779 Remove.
11780 (Output_section::Input_section_sort_compare::operator()): Rewrite
11781 using new Input_section_sort_entry functions. Sort crtbegin and
11782 crtend first. Sort sections with no priority before sections with
11783 a priority.
11784 * testsuite/initpri1.c (d3): Check j != 4.
11785 (cd5): New constructor/destructor function.
11786 (main): Check j != 2.
11787
11788 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11789 new symbol when resolving, don't call set_is_default.
11790 * testsuite/ver_test_7.cc: New file.
11791 * testsuite/ver_test_7.sh: New file.
11792 * testsuite/Makefile.am (ver_test_7.so): New target.
11793 (ver_test_7.o): New target.
11794 (check_SCRIPTS): Add ver_test_7.sh.
11795 (check_DATA): Add ver_test_7.syms.
11796 (ver_test_7.syms): New target.
11797
11798 2008-03-28 Ian Lance Taylor <iant@google.com>
11799
11800 * layout.cc (Layout::layout): If we see an input section with a
11801 name that needs sorting, set the must_sort flag for the output
11802 section.
11803 (Layout::make_output_section): If the name of the output section
11804 indicates that it might require sorting, set the may_sort flag.
11805 * output.h (Output_section::may_sort_attached_input_sections): New
11806 function.
11807 (Output_section::set_may_sort_attached_input_sections): New
11808 function.
11809 (Output_section::must_sort_attached_input_sections): New
11810 function.
11811 (Output_section::set_must_sort_attached_input_sections): New
11812 function.
11813 (class Output_section): Declare Input_section_sort_entry. Define
11814 Input_section_sort_compare. Declare
11815 sort_attached_input_sections. Add new fields:
11816 may_sort_attached_input_sections_,
11817 must_sort_attached_input_sections_,
11818 attached_input_sections_are_sorted_.
11819 * output.cc (Output_section::Output_section): Initialize new
11820 fields.
11821 (Output_section::add_input_section): Add an entry to
11822 input_sections_ if may_sort or must_sort are true.
11823 (Output_section::set_final_data_size): Call
11824 sort_attached_input_sections if necessary.
11825 (Output_section::Input_section_sort_entry): Define new class.
11826 (Output_section::Input_section_sort_compare::operator()): New
11827 function.
11828 (Output_section::sort_attached_input_sections): New function.
11829 * configure.ac: Check whether the compiler supports constructor
11830 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11831 * testsuite/initpri1.c: New file.
11832 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11833 CONSTRUCTOR_PRIORITY.
11834 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11835 (initpri1_LDFLAGS): New variable.
11836 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11837
11838 2008-03-27 Ian Lance Taylor <iant@google.com>
11839
11840 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11841 * testsuite/common_test_1.c: New file.
11842 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11843 (common_test_1_SOURCES): New variable.
11844 (common_test_1_DEPENDENCIES): New variable.
11845 (common_test_1_LDFLAGS): New variable.
11846
11847 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11848 and commons_ correctly when NAME/VERSION does not override
11849 NAME/NULL.
11850 * testsuite/ver_test_6.c: New file.
11851 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11852 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11853 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11854
11855 2008-03-26 Ian Lance Taylor <iant@google.com>
11856
11857 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11858 of an undefined symbol from a version script.
11859 * testsuite/Makefile.am (ver_test_5.so): New target.
11860 (ver_test_5.o): New target.
11861 (check_SCRIPTS): Add ver_test_5.sh.
11862 (check_DATA): Add ver_test_5.syms.
11863 (ver_test_5.syms): New target.
11864 * testsuite/ver_test_5.cc: New file.
11865 * testsuite/ver_test_5.script: New file.
11866 * testsuite/ver_test_5.sh: New file.
11867 * Makefile.in, testsuite/Makefile.in: Rebuild.
11868
11869 PR gold/5986
11870 Fix problems building gold with gcc 4.3.0.
11871 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11872 (gold_error_at_location, gold_warning_at_location): Use it.
11873 * configure.ac: Check whether we can compile and use a template
11874 function with a printf attribute.
11875 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11876 when jumping over bytes.
11877 * object.cc: Instantiate Object::read_section_data.
11878 * debug.h: Include <cstring>
11879 * dwarf_reader.cc: Include <algorithm>
11880 * main.cc: Include <cstring>.
11881 * options.cc: Include <cstring>.
11882 * output.cc: Include <cstring>.
11883 * script.cc: Include <cstring>.
11884 * script.h: Include <string>.
11885 * symtab.cc: Include <cstring> and <algorithm>.
11886 * target-select.cc: Include <cstring>.
11887 * version.cc: Include <string>.
11888 * testsuite/testmain.cc: Include <cstdlib>.
11889 * configure, config.in: Rebuild.
11890
11891 2008-03-25 Ian Lance Taylor <iant@google.com>
11892
11893 * options.cc: Include "../bfd/bfdver.h".
11894 (options::help): Print bug reporting address.
11895
11896 * version.cc (print_version): Adjust output for current value of
11897 BFD_VERSION_STRING.
11898
11899 * NEWS: New file.
11900
11901 * options.cc (options::help): Print list of supported targets.
11902 * target-select.h: Include <vector>.
11903 (class Target_selector): Make machine_, size_, and is_big_endian_
11904 fields const. Add bfd_name_ and instantiated_target_ fields.
11905 (Target_selector::Target_selector): Add bfd_name parameter.
11906 (Target_selector::recognize): Make non-virtual, call
11907 do_recognize.
11908 (Target_selector::recognize_by_name): Make non-virtual, call
11909 do_recognize_by_name.
11910 (Target_selector::supported_names): New function.
11911 (Target_selector::bfd_name): New function.
11912 (Target_selector::do_instantiate_target): New pure virtual
11913 function.
11914 (Target_selector::do_recognize): New virtual function.
11915 (Target_selector::do_recognize_by_name): New virtual function.
11916 (Target_selector::instantiate_target): New private function.
11917 (supported_target_names): Declare.
11918 * target-select.cc (Target_selector::Target_selector): Update for
11919 new parameter and fields.
11920 (select_target_by_name): Check that the name matches before
11921 calling recognize_by_name.
11922 (supported_target_names): New function.
11923 * i386.cc (class Target_selector_i386): Update Target_selector
11924 constructor call. Remove recognize and recognize_by_name. Add
11925 do_instantiate_target.
11926 * x86_64.cc (class Target_selector_x86_64): Likewise.
11927 * testsuite/testfile.cc (class Target_selector_test): Update for
11928 changes to Target_selector.
11929
11930 * README: Rewrite, with some notes on unsupported features.
11931
11932 2008-03-24 Cary Coutant <ccoutant@google.com>
11933
11934 * i386.cc (Target_i386::Got_type): New enum declaration.
11935 (Target_i386::Scan::local): Updated callers of Output_data_got
11936 member functions.
11937 (Target_i386::Scan::global): Likewise.
11938 (Target_i386::Relocate::relocate): Likewise.
11939 (Target_i386::Relocate::relocate_tls): Likewise.
11940 * object.h (Got_offset_list): New class.
11941 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11942 (Sized_relobj::local_got_offset): Likewise.
11943 (Sized_relobj::set_local_got_offset): Likewise.
11944 (Sized_relobj::local_has_tls_got_offset): Removed.
11945 (Sized_relobj::local_tls_got_offset): Removed.
11946 (Sized_relobj::set_local_tls_got_offset): Removed.
11947 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11948 * output.cc (Output_data_got::add_global): Added got_type parameter.
11949 (Output_data_got::add_global_with_rel): Likewise.
11950 (Output_data_got::add_global_with_rela): Likewise.
11951 (Output_data_got::add_global_pair_with_rel): New function.
11952 (Output_data_got::add_global_pair_with_rela): New function.
11953 (Output_data_got::add_local): Added got_type parameter.
11954 (Output_data_got::add_local_with_rel): Likewise.
11955 (Output_data_got::add_local_with_rela): Likewise.
11956 (Output_data_got::add_local_pair_with_rel): New function.
11957 (Output_data_got::add_local_pair_with_rela): New function.
11958 (Output_data_got::add_global_tls): Removed.
11959 (Output_data_got::add_global_tls_with_rel): Removed.
11960 (Output_data_got::add_global_tls_with_rela): Removed.
11961 (Output_data_got::add_local_tls): Removed.
11962 (Output_data_got::add_local_tls_with_rel): Removed.
11963 (Output_data_got::add_local_tls_with_rela): Removed.
11964 * output.h (Output_data_got::add_global): Added got_type parameter.
11965 (Output_data_got::add_global_with_rel): Likewise.
11966 (Output_data_got::add_global_with_rela): Likewise.
11967 (Output_data_got::add_global_pair_with_rel): New function.
11968 (Output_data_got::add_global_pair_with_rela): New function.
11969 (Output_data_got::add_local): Added got_type parameter.
11970 (Output_data_got::add_local_with_rel): Likewise.
11971 (Output_data_got::add_local_with_rela): Likewise.
11972 (Output_data_got::add_local_pair_with_rel): New function.
11973 (Output_data_got::add_local_pair_with_rela): New function.
11974 (Output_data_got::add_global_tls): Removed.
11975 (Output_data_got::add_global_tls_with_rel): Removed.
11976 (Output_data_got::add_global_tls_with_rela): Removed.
11977 (Output_data_got::add_local_tls): Removed.
11978 (Output_data_got::add_local_tls_with_rel): Removed.
11979 (Output_data_got::add_local_tls_with_rela): Removed.
11980 * resolve.cc (Symbol::override_base_with_special): Removed
11981 reference to has_got_offset_ field.
11982 * symtab.cc (Symbol::init_fields): Replaced initialization
11983 of got_offset_ with got_offsets_. Removed initialization
11984 of has_got_offset_
11985 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
11986 (Symbol::got_offset): Likewise.
11987 (Symbol::set_got_offset): Likewise.
11988 (Symbol::has_tls_got_offset): Removed.
11989 (Symbol::tls_got_offset): Removed.
11990 (Symbol::set_tls_got_offset): Removed.
11991 (Symbol::got_offset_): Removed.
11992 (Symbol::tls_mod_got_offset_): Removed.
11993 (Symbol::tls_pair_got_offset_): Removed.
11994 (Symbol::got_offsets_): New field.
11995 (Symbol::has_got_offset): Removed.
11996 (Symbol::has_tls_mod_got_offset): Removed.
11997 (Symbol::has_tls_pair_got_offset): Removed.
11998 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11999 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12000 member functions.
12001 (Target_x86_64::Scan::global): Likewise.
12002 (Target_x86_64::Relocate::relocate): Likewise.
12003 (Target_x86_64::Relocate::relocate_tls): Likewise.
12004
12005 2008-03-25 Ben Elliston <bje@au.ibm.com>
12006
12007 * yyscript.y: Fix spelling error in comment.
12008
12009 2008-03-24 Ian Lance Taylor <iant@google.com>
12010
12011 * options.h (class General_options): Define build_id option.
12012 * layout.h (class Layout): Declare write_build_id, create_note,
12013 create_build_id. Add build_id_note_ member.
12014 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12015 "libiberty.h", "md5.h", "sha1.h".
12016 (Layout::Layout): Initialize eh_frame_data_,
12017 eh_frame_hdr_section_, and build_id_note_.
12018 (Layout::finalize): Call create_build_id.
12019 (Layout::create_note): New function, broken out of
12020 Layout::create_gold_note.
12021 (Layout::create_gold_note): Call create_note.
12022 (Layout::create_build_id): New function.
12023 (Layout::write_build_id): New function.
12024 (Close_task_runner::run): Call write_build_id.
12025
12026 * x86_64.cc: Correct license to GPLv3.
12027
12028 2008-03-23 Ian Lance Taylor <iant@google.com>
12029
12030 * options.cc: Include "demangle.h".
12031 (parse_optional_string): New function.
12032 (parse_long_option): Handle takes_optional_argument.
12033 (parse_short_option): Update dash_z initializer. Handle
12034 takes_optional_argument.
12035 (General_options::General_options): Initialize do_demangle_.
12036 (General_options::finalize): Set do_demangle_. Handle demangling
12037 style.
12038 * options.h (parse_optional_string): Declare.
12039 (struct One_option): Add optional_arg field. Update constructor.
12040 Update call constructor calls. Add takes_optional_argument
12041 function.
12042 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12043 (DEFINE_optional_string): Define.
12044 (General_options::demangle): Change from DEFINE_bool to
12045 DEFINE_optional_string.
12046 (General_options::no_demangle): New function.
12047 (General_options::do_demangle): New function.
12048 (General_options::set_do_demangle): New function.
12049 (General_options::execstack_status_): Move definition to end of
12050 class definition.
12051 (General_options::static_): Likewise.
12052 (General_options::do_demangle_): New field.
12053 * object.cc (big_endian>::get_symbol_location_info): Call
12054 Options::do_demangle, not Options::demangle.
12055 * symtab.cc (demangle): Likewise.
12056
12057 2008-03-22 Ian Lance Taylor <iant@google.com>
12058
12059 * gold.h: Include <cstddef> and <sys/types.h>
12060 * options.h: Include <cstring>.
12061
12062 2008-03-21 Ian Lance Taylor <iant@google.com>
12063
12064 * Added source code to GNU binutils.