* options.cc (parse_uint): Fix dereference of RETVAL.
[binutils-gdb.git] / gold / ChangeLog
1 2011-10-03 Diego Novillo <dnovillo@google.com>
2
3 * options.cc (parse_uint): Fix dereference of RETVAL.
4
5 2011-09-29 Sriraman Tallam <tmsriram@google.com>
6
7 * layout.h (section_order_map_): New member.
8 (get_section_order_map): New member function.
9 * output.cc (Output_section::add_input_section): Check for patterns
10 only when --section-ordering-file is specified.
11 * gold.cc (queue_middle_tasks): Delay updating order of sections till
12 output_sections have been formed.
13 * layout.cc (Layout_Layout): Initialize section_order_map_.
14 * plugin.cc (update_section_order): Store order in order_map. Do not
15 update the order.
16 * testsuite/Makefile.am: Add test case for plugin_final_layout.
17 * testsuite/Makefile.in: Regenerate.
18 * testsuite/plugin_section_order.c: New file.
19 * testsuite/plugin_final_layout.cc: New file.
20 * testsuite/plugin_final_layout.sh: New file.
21
22 2011-09-29 Cary Coutant <ccoutant@google.com>
23
24 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
25 Check for NULL.
26 * gold/symtab.cc (Symbol_table::add_from_relobj): Ignore version
27 symbols during incremental update.
28 (Symbol_table::add_from_dynobj): Likewise.
29
30 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
31 Ian Lance Taylor <iant@google.com>
32
33 * symtab.cc (Symbol_table::define_special_symbol): Always
34 canonicalize version string.
35
36 2011-09-26 Cary Coutant <ccoutant@google.com>
37
38 * gold/gold.cc (queue_initial_tasks): Move option checks ...
39 * gold/options.cc (General_options::finalize): ... to here. Disable
40 some options; make others fatal.
41
42 2011-09-26 Cary Coutant <ccoutant@google.com>
43
44 gcc PR lto/47247
45 * plugin.cc (get_symbols_v2): New function.
46 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
47 (is_referenced_from_outside): New function.
48 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
49 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
50 (get_symbols): Pass version parameter.
51 (get_symbols_v2): New function.
52 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
53 parameter.
54 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
55 (onload): Add LDPT_GET_SYMBOLS_V2.
56 (all_symbols_read_hook): Use get_symbols_v2; check for
57 LDPR_PREVAILING_DEF_IRONLY_EXP.
58 * testsuite/plugin_test_3.sh: Update expected results.
59
60 2011-09-23 Simon Baldwin <simonb@google.com>
61
62 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
63 configuration options.
64 * configure: Regenerate.
65 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
66 * Makefile.in: Regenerate.
67 * testsuite/Makefile.in: Regenerate.
68
69 2011-09-19 Sriraman Tallam <tmsriram@google.com>
70
71 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
72
73 2011-09-19 Cary Coutant <ccoutant@google.com>
74
75 * incremental.cc (can_incremental_update): Fix typo in comment.
76 * incremental.h (can_incremental_update): Likewise.
77
78 2011-09-18 Cary Coutant <ccoutant@google.com>
79
80 * incremental.cc (can_incremental_update): New function.
81 * incremental.h (can_incremental_update): New function.
82 * layout.cc (Layout::init_fixed_output_section): Call it.
83 (Layout::make_output_section): Don't allow patch space in .eh_frame.
84 * object.cc (Sized_relobj_file::do_layout): Call
85 can_incremental_update.
86
87 2011-09-13 Cary Coutant <ccoutant@google.com>
88
89 * configure.ac: Check for glibc support for gnu_indirect_function
90 support with static linking, setting automake conditional
91 IFUNC_STATIC.
92 * Makefile.in: Regenerate.
93 * configure: Regenerate.
94
95 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
96 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
97 for IFUNC_STATIC.
98 * testsuite/Makefile.in: Regenerate.
99
100 2011-09-13 Cary Coutant <ccoutant@google.com>
101
102 * incremental.cc (Sized_relobj_incr::do_layout): Call
103 report_comdat_group for kept comdat sections.
104 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
105 * testsuite/Makefile.in: Regenerate.
106 * testsuite/incr_comdat_test_1.cc: New source file.
107 * testsuite/incr_comdat_test_2_v1.cc: New source file.
108 * testsuite/incr_comdat_test_2_v2.cc: New source file.
109 * testsuite/incr_comdat_test_2_v3.cc: New source file.
110
111 2011-09-13 Ian Lance Taylor <iant@google.com>
112
113 * object.cc (Sized_relobj_file::do_layout): Remove unused local
114 variable external_symbols_offset.
115
116 2011-09-12 Ian Lance Taylor <iant@google.com>
117
118 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
119 triggered if object has no symbols.
120
121 2011-09-09 David S. Miller <davem@davemloft.net>
122
123 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
124 (Output_fill_debug_line::do_write): Likewise.
125
126 2011-08-29 Cary Coutant <ccoutant@google.com>
127
128 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
129 casts to match formatting specs.
130 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
131
132 2011-08-26 Cary Coutant <ccoutant@google.com>
133
134 * layout.cc (Free_list::allocate): Provide guarantee of minimum
135 remaining hole size when allocating.
136 (Layout::make_output_section): Set fill methods for debug sections.
137 * layout.h (Free_list::Free_list_node): Move from private to
138 public.
139 (Free_list::set_min_hole_size): New function.
140 (Free_list::begin, Free_list::end): New functions.
141 (Free_list::min_hole_): New data member.
142 * output.cc: Include dwarf.h.
143 (Output_fill_debug_info::do_minimum_hole_size): New function.
144 (Output_fill_debug_info::do_write): New function.
145 (Output_fill_debug_line::do_minimum_hole_size): New function.
146 (Output_fill_debug_line::do_write): New function.
147 (Output_section::Output_section): Initialize new data member.
148 (Output_section::set_final_data_size): Ensure patch space is larger
149 than minimum hole size.
150 (Output_section::do_write): Fill holes in debug sections.
151 * output.h (Output_fill): New class.
152 (Output_fill_debug_info): New class.
153 (Output_fill_debug_line): New class.
154 (Output_section::set_free_space_fill): New function.
155 (Output_section::free_space_fill_): New data member.
156 * testsuite/Makefile.am (incremental_test_3): Add
157 --incremental-patch option.
158 (incremental_test_4): Likewise.
159 (incremental_test_5): Likewise.
160 (incremental_test_6): Likewise.
161 (incremental_copy_test): Likewise.
162 (incremental_common_test_1): Likewise.
163 * testsuite/Makefile.in: Regenerate.
164
165 2011-08-26 Nick Clifton <nickc@redhat.com>
166
167 * po/es.po: Updated Spanish translation.
168
169 2011-08-01 Cary Coutant <ccoutant@google.com>
170
171 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
172 * gold/testsuite/Makefile.in: Regenerate.
173 * gold/testsuite/justsyms_exec.c: New source file.
174 * gold/testsuite/justsyms_lib.c: New source file.
175
176 2011-08-01 Cary Coutant <ccoutant@google.com>
177
178 * layout.cc (Layout::set_segment_offsets): Don't realign text
179 segment if -Ttext was specified.
180 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
181 file type.
182 * object.h (Sized_relobj_file::e_type): New function.
183 (Sized_relobj_file::e_type_): New data member.
184 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
185 base address for ET_EXEC files.
186 * target.cc (Target::do_make_elf_object_implementation): Allow
187 ET_EXEC files with --just-symbols option.
188
189 2011-07-28 Cary Coutant <ccoutant@google.com>
190
191 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
192 Add thread_number parameter.
193 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
194 * workqueue-threads.cc
195 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
196 current thread if its thread number is greater than desired thread
197 count.
198 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
199 Add thread_number parameter.
200 (Workqueue::should_cancel_thread): Likewise.
201 (Workqueue::find_runnable_or_wait): Pass thread_number to
202 should_cancel_thread.
203 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
204 parameter.
205
206 2011-07-22 Sriraman Tallam <tmsriram@google.com>
207
208 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
209 only after checking if it cannot be forced local.
210 * symtab.h (is_externally_visible): Check if the symbol is not forced
211 local.
212
213 2011-07-15 Ian Lance Taylor <iant@google.com>
214
215 * options.h (class General_options): Add --print-output-format.
216 Move -EL next to -EB, for better --help output.
217 * target-select.cc: Include <cstdio>, "options.h", and
218 "parameters.h".
219 (Target_selector::do_target_bfd_name): New function.
220 (print_output_format): New function.
221 * target-select.h (class Target_selector): Update declarations.
222 (Target_selector::target_bfd_name): New function.
223 (print_output_format): Declare.
224 * main.cc: Include "target-select.h".
225 (main): Handle --print-output-format.
226 * gold.cc: Include "target-select.h".
227 (queue_initial_tasks): Handle --print-output-format when there are
228 no input files.
229 * parameters.cc (parameters_force_valid_target): Give a better
230 error message if -EB/-EL does not match target.
231 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
232 function.
233
234 2011-07-15 Ian Lance Taylor <iant@google.com>
235
236 * i386.cc (class Output_data_plt_i386): Add layout_ field.
237 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
238 (Output_data_plt_i386::do_write): Write address of .dynamic
239 section to first entry in .got.plt section.
240 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
241 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
242 Initialize layout_.
243 (Output_data_plt_x86_64::do_write): Write address of .dynamic
244 section to first entry in .got.plt section.
245 * layout.h (Layout::dynamic_section): New function.
246
247 2011-07-13 Sriraman Tallam <tmsriram@google.com>
248
249 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
250 to claim_file call.
251 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
252 input_section_position_, and input_section_glob_.
253 (read_layout_from_file): Call function section_ordering_specified.
254 * layout.h (is_section_ordering_specified): New function.
255 (section_ordering_specified): New function.
256 (section_ordering_specified_): New boolean member.
257 * main.cc(main): Call load_plugins after layout object is defined.
258 * output.cc (Output_section::add_input_section): Use
259 function section_ordering_specified to check if section ordering is
260 needed.
261 * output.cc (Output_section::add_relaxed_input_section): Use
262 function section_ordering_specified to check if section ordering is
263 needed.
264 (Output_section::update_section_layout): New function.
265 (Output_section::sort_attached_input_sections): Check if input section
266 must be reordered.
267 * output.h (Output_section::update_section_layout): New function.
268 * plugin.cc (get_section_count): New function.
269 (get_section_type): New function.
270 (get_section_name): New function.
271 (get_section_contents): New function.
272 (update_section_order): New function.
273 (allow_section_ordering): New function.
274 (Plugin::load): Add the new interfaces to the transfer vector.
275 (Plugin_manager::load_plugins): New parameter.
276 (Plugin_manager::all_symbols_read): New parameter.
277 (Plugin_manager::claim_file): New parameter. Save the elf object for
278 unclaimed objects.
279 (Plugin_manager::get_elf_object): New function.
280 (Plugin_manager::get_view): Change to directly use the bool to check
281 if get_view is called from claim_file_hook.
282 * plugin.h (input_objects): New function
283 (Plugin__manager::load_plugins): New parameter.
284 (Plugin_manager::claim_file): New parameter.
285 (Plugin_manager::get_elf_object): New function.
286 (Plugin_manager::in_claim_file_handler): New function.
287 (Plugin_manager::in_claim_file_handler_): New member.
288 (layout): New function.
289 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
290 handler with an extra parameter. Make the elf object before calling
291 claim_file handler.
292 * testsuite/plugin_test.c (get_section_count): New function pointer.
293 (get_section_type): New function pointer.
294 (get_section_name): New function pointer.
295 (get_section_contents): New function pointer.
296 (update_section_order): New function pointer.
297 (allow_section_ordering): New function pointer.
298 (onload): Check if the new interfaces exist.
299
300 2011-07-13 Ian Lance Taylor <iant@google.com>
301
302 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
303 relro section.
304 * x86_64.cc (Target_x86_64::got_section): Likewise.
305 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
306 (relro_now_test_SOURCES): New variable.
307 (relro_now_test_DEPENDENCIES): New variable.
308 (relro_now_test_LDFLAGS): New variable.
309 (relro_now_test_LDADD): New variable.
310 (relro_now_test.so): New target.
311 * testsuite/Makefile.in: Rebuild.
312
313 2011-07-12 Ian Lance Taylor <iant@google.com>
314
315 PR gold/12980
316 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
317 GLOB_DAT relocation rather than a RELATIVE relocation for a
318 protected symbol when creating a shared library.
319 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
320 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
321 * testsuite/protected_main_1.cc (main): Test that protected
322 function has same address.
323
324 2011-07-11 Ian Lance Taylor <iant@google.com>
325
326 PR gold/12979
327 * options.h (class General_options): Add -Bgroup.
328 * options.cc (General_options::finalize): If -Bgroup is set,
329 default to --unresolved-symbols=report-all.
330 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
331 * target-reloc.h (issue_undefined_symbol_error): Handle
332 --unresolved-symbols=report-all.
333
334 2011-07-08 Ian Lance Taylor <iant@google.com>
335
336 PR gold/11985
337 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
338 if linker script discards key sections.
339 (Layout::create_dynamic_symtab): Likewise.
340 (Layout::assign_local_dynsym_offsets): Likewise.
341 (Layout::sized_create_version_sections): Likewise.
342 (Layout::create_interp): Likewise.
343 (Layout::finish_dynamic_section): Likewise.
344 (Layout::set_dynamic_symbol_size): Likewise.
345
346 2011-07-08 Ian Lance Taylor <iant@google.com>
347
348 PR gold/12386
349 * options.h (class General_options): Add --unresolved-symbols.
350 * target-reloc.h (issue_undefined_symbol_error): Check
351 --unresolved-symbols. Add comments.
352
353 2011-07-08 Ian Lance Taylor <iant@google.com>
354
355 * testsuite/odr_violation2.cc (Ordering::operator()): Make
356 expression more complex.
357
358 2011-07-08 Ian Lance Taylor <iant@google.com>
359
360 PR gold/11317
361 * target-reloc.h (issue_undefined_symbol_error): New inline
362 function, broken out of relocate_section.
363 (relocate_section): Call issue_undefined_symbol_error.
364 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
365 there is no TLS segment if we are about to issue an undefined
366 symbol error.
367 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
368
369 2011-07-08 Ian Lance Taylor <iant@google.com>
370
371 PR gold/12279
372 * resolve.cc (Symbol_table::should_override): Add fromtype
373 parameter. Change all callers. Give error when linking together
374 TLS and non-TLS symbol.
375 (Symbol_table::should_override_with_special): Add fromtype
376 parameter. Change all callers.
377 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
378 there is no TLS segment if we have reported some errors.
379 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
380
381 2011-07-08 Ian Lance Taylor <iant@google.com>
382
383 PR gold/12372
384 * target.h (Target::plt_address_for_global): New function.
385 (Target::plt_address_for_local): New function.
386 (Target::plt_section_for_global): Remove.
387 (Target::plt_section_for_local): Remove.
388 (Target::do_plt_address_for_global): New virtual function.
389 (Target::do_plt_address_for_local): New virtual function.
390 (Target::do_plt_section_for_global): Remove.
391 (Target::do_plt_section_for_local): Remove.
392 (Target::register_global_plt_entry): Add Symbol_table and Layout
393 parameters.
394 * output.cc (Output_data_got::Got_entry::write): Use
395 plt_address_for_global and plt_address_for_local.
396 * layout.cc (Layout::add_target_dynamic_tags): Use size and
397 address of output section.
398 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
399 got_irelative_, and irelative_count_ fields. Update
400 declarations.
401 (Output_data_plt_i386::has_irelative_section): New function.
402 (Output_data_plt_i386::entry_count): Add irelative_count_.
403 (Output_data_plt_i386::set_final_data_size): Likewise.
404 (class Target_i386): Add got_irelative_ and rel_irelative_
405 fields. Update declarations.
406 (Target_i386::Target_i386): Initialize new fields.
407 (Target_i386::do_plt_address_for_global): New function replacing
408 do_plt_section_for_global.
409 (Target_i386::do_plt_address_for_local): New function replacing
410 do_plt_section_for_local.
411 (Target_i386::got_section): Create got_irelative_.
412 (Target_i386::rel_irelative_section): New function.
413 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
414 fields. Don't define __rel_iplt_{start,end}.
415 (Output_data_plt_i386::add_entry): Add symtab and layout
416 parameters. Change all callers. Use different PLT and GOT for
417 IFUNC symbols.
418 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
419 layout parameters. Change all callers. Use different PLT and
420 GOT.
421 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
422 (Output_data_plt_i386::rel_irelative): New function.
423 (Output_data_plt_i386::address_for_global): New function.
424 (Output_data_plt_i386::address_for_local): New function.
425 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
426 IRELATIVE GOT when changing IFUNC GOT entries.
427 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
428 reloc.
429 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
430 if we didn't create an IRELATIVE GOT.
431 (Target_i386::Relocate::relocate): Use plt_address_for_global and
432 plt_address_for_local.
433 (Target_i386::do_dynsym_value): Use plt_address_for_global.
434 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
435 got_irelative_, and irelative_count_ fields. Update
436 declarations.
437 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
438 Initialize new fields. Remove symtab parameter. Change all
439 callers.
440 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
441 irelative_count_.
442 (Output_data_plt_x86_64::has_irelative_section): New function.
443 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
444 (class Target_x86_64): Add got_irelative_ and rel_irelative_
445 fields. Update declarations.
446 (Target_x86_64::Target_x86_64): Initialize new fields.
447 (Target_x86_64::do_plt_address_for_global): New function replacing
448 do_plt_section_for_global.
449 (Target_x86_64::do_plt_address_for_local): New function replacing
450 do_plt_section_for_local.
451 (Target_x86_64::got_section): Create got_irelative_.
452 (Target_x86_64::rela_irelative_section): New function.
453 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
454 all callers. Don't create __rel_iplt_{start,end}.
455 (Output_data_plt_x86_64::add_entry): Add symtab and layout
456 parameters. Change all callers. Use different PLT and GOT for
457 IFUNC symbols.
458 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
459 layout parameters. Change all callers. Use different PLT and
460 GOT.
461 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
462 parameters. Change all callers. Use different PLT and GOT for
463 IFUNC symbols.
464 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
465 (Output_data_plt_x86_64::rela_irelative): New function.
466 (Output_data_plt_x86_64::address_for_global): New function.
467 (Output_data_plt_x86_64::address_for_local): New function.
468 (Output_data_plt_x86_64::set_final_data_size): Likewise.
469 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
470 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
471 (Target_x86_64::register_global_plt_entry): Add symtab and layout
472 parameters.
473 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
474 reloc.
475 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
476 symbols if we didn't create an IRELATIVE GOT.
477 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
478 plt_address_for_local.
479 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
480 * testsuite/ifuncvar1.c: New test file.
481 * testsuite/ifuncvar2.c: New test file.
482 * testsuite/ifuncvar3.c: New test file.
483 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
484 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
485 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
486 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
487 * testsuite/Makefile.in: Rebuild.
488
489 2011-07-07 Cary Coutant <ccoutant@google.com>
490
491 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
492 (two_file_test_1_ndebug.o): Likewise.
493 (two_file_test_1b_ndebug.o): Likewise.
494 (two_file_test_2_ndebug.o): Likewise.
495 (two_file_test_main_ndebug.o): Likewise.
496 (incremental_test_2): Link with no-debug versions.
497
498 2011-07-06 Cary Coutant <ccoutant@google.com>
499
500 * gold/incremental.cc
501 (Output_section_incremental_inputs::write_info_blocks): Check for
502 hidden and internal symbols.
503
504 2011-07-06 Cary Coutant <ccoutant@google.com>
505
506 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
507 Check disposition for startup file.
508 (Incremental_inputs::report_command_line): Ignore
509 --incremental-startup-unchanged option.
510 * options.cc (General_options::parse_incremental_startup_unchanged):
511 New function.
512 (General_options::General_options): Initialize new data member.
513 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
514 (General_options): Add --incremental-startup-unchanged option.
515 (General_options::incremental_startup_disposition): New function.
516 (General_options::incremental_startup_disposition_): New data member.
517
518 2011-07-06 Cary Coutant <ccoutant@google.com>
519
520 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
521 input file index to Script_info ctor.
522 (Sized_incremental_binary::do_file_has_changed): Find the
523 command-line argument for files named in scripts.
524 * incremental.h (Script_info::Script_info): New ctor
525 with input file index.
526 (Script_info::input_file_index): New function.
527 (Script_info::input_file_index_): New data member.
528 (Incremental_binary::get_library): Add const.
529 (Incremental_binary::get_script_info): Add const.
530 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
531 * testsuite/Makefile.am (incremental_test_5): New test case.
532 (incremental_test_6): New test case.
533 * testsuite/Makefile.in: Regenerate.
534
535 2011-07-06 Cary Coutant <ccoutant@google.com>
536
537 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
538 debug output when command lines differ.
539
540 2011-07-06 Cary Coutant <ccoutant@google.com>
541
542 * incremental.cc (Incremental_inputs::report_command_line): Ignore
543 --incremental-patch option.
544 * layout.cc (Free_list::allocate): Extend allocation beyond original
545 end if enabled.
546 (Layout::make_output_section): Mark sections that should get
547 patch space.
548 * options.cc (parse_percent): New function.
549 * options.h (parse_percent): New function.
550 (DEFINE_percent): New macro.
551 (General_options): Add --incremental-patch option.
552 * output.cc (Output_section::Output_section): Initialize new data
553 members.
554 (Output_section::add_input_section): Print section name when out
555 of patch space.
556 (Output_section::add_output_section_data): Likewise.
557 (Output_section::set_final_data_size): Add patch space when
558 doing --incremental-full.
559 (Output_section::do_reset_address_and_file_offset): Remove patch
560 space.
561 (Output_segment::set_section_list_addresses): Print debug output
562 only if --incremental-update.
563 * output.h (Output_section::set_is_patch_space_allowed): New function.
564 (Output_section::is_patch_space_allowed_): New data member.
565 (Output_section::patch_space_): New data member.
566 * parameters.cc (Parameters::incremental_full): New function.
567 * parameters.h (Parameters::incremental_full): New function
568 * testsuite/Makefile.am (incremental_test_2): Add test for
569 --incremental-patch option.
570 * testsuite/Makefile.in: Regenerate.
571 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
572 (t18): Remove function body.
573
574 2011-07-05 Doug Kwan <dougkwan@google.com>
575
576 PR gold/12771
577 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
578 Arm_Address type for relocation result.
579 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
580 overflow check.
581 (Arm_relocate_functions::abs32): Use unaligned access.
582 (Arm_relocate_functions::rel32): Ditto.
583 (Arm_relocate_functions::prel31): Ditto.
584 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
585 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
586 static data relocations.
587 * testsuite/Makefile.in: Regnerate.
588 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
589
590 2011-07-05 Ian Lance Taylor <iant@google.com>
591
592 PR gold/12392
593 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
594 symbols if necessary.
595 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
596
597 2011-07-05 Ian Lance Taylor <iant@google.com>
598
599 PR gold/12952
600 * resolve.cc (Symbol::override_base_with_special): Simply override
601 version with special symbol version, ignoring previous version.
602
603 2011-07-05 Ian Lance Taylor <iant@google.com>
604
605 * object.cc (Sized_relobj_file::include_section_group): Add
606 information to comment about signature location.
607
608 2011-07-02 Ian Lance Taylor <iant@google.com>
609
610 PR gold/12957
611 * options.h (class General_options): Add -f and -F.
612 * options.cc (General_options::finalize): Fatal error if -f/-F
613 are used without -shared.
614 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
615
616 2011-07-02 Ian Lance Taylor <iant@google.com>
617
618 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
619
620 2011-07-01 Ian Lance Taylor <iant@google.com>
621
622 PR gold/12525
623 PR gold/12952
624 * resolve.cc (Symbol::override_base_with_special): Don't override
625 the version if the overriding symbol has a different name.
626 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
627 all callers. If we give an error about an undefined version,
628 define the base version if necessary.
629 * dynobj.h (class Versions): Update declaration.
630 * testsuite/weak_alias_test_5.cc: New file.
631 * testsuite/weak_alias_test.script: New file.
632 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
633 and versioned_alias have the right value, and call t2.
634 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
635 weak_alias_test_5.so.
636 (weak_alias_test_LDADD): Likewise.
637 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
638 * testsuite/Makefile.in: Rebuild.
639
640 2011-07-01 Ian Lance Taylor <iant@google.com>
641
642 PR gold/12525
643 * options.h (class General_options): Support -z notext.
644 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
645 -Wl,-z,notext.
646 (two_file_shared_nonpic.so): Likewise.
647 (two_file_shared_mixed.so): Likewise.
648 (two_file_shared_mixed_1.so): Likewise.
649 (weak_undef_lib_nonpic.so): Likewise.
650 (alt/weak_undef_lib_nonpic.so): Likewise.
651 (tls_test_shared_nonpic.so): Likewise.
652 * testsuite/Makefile.in: Rebuild.
653
654 2011-07-01 Ian Lance Taylor <iant@google.com>
655
656 PR gold/12525
657 * configure.ac: Test whether static linking works, setting
658 the automake conditional HAVE_STATIC.
659 * testsuite/Makefile.am: Disable tests using -static if
660 HAVE_STATIC is not true.
661 * configure, testsuite/Makefile.in: Rebuild.
662
663 2011-07-01 Ian Lance Taylor <iant@google.com>
664
665 PR gold/12525
666 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
667 Assert if we see DW_EH_PE_indirect.
668 * target.h (Target::ehframe_datarel_base): New function.
669 (Target::do_ehframe_datarel_base): New target function.
670 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
671 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
672 function.
673
674 2011-07-01 Ian Lance Taylor <iant@google.com>
675
676 PR gold/12571
677 * options.h (class General_options): Add
678 --ld-generated-unwind-info.
679 * ehframe.cc (Fde::write): Add address parameter. Change all
680 callers. If associated with PLT, fill in address and size.
681 (Cie::set_output_offset): Only add merge mapping if there is an
682 object.
683 (Cie::write): Add address parameter. Change all callers.
684 (Eh_frame::add_ehframe_for_plt): New function.
685 * ehframe.h (class Fde): Update declarations. Move shndx_ and
686 input_offset_ fields into union u_, with new plt field.
687 (Fde::Fde): Adjust for new union field.
688 (Fde::Fde) [Output_data version]: New constructor.
689 (Fde::add_mapping): Only add merge mapping if there is an object.
690 (class Cie): Update declarations.
691 (class Eh_frame): Declare add_ehframe_for_plt.
692 * layout.cc (Layout::layout_eh_frame): Break out code into
693 make_eh_frame_section, and call it.
694 (Layout::make_eh_frame_section): New function.
695 (Layout::add_eh_frame_for_plt): New function.
696 * layout.h (class Layout): Update declarations.
697 * merge.cc (Merge_map::add_mapping): Add assertion.
698 * i386.cc: Include "dwarf.h".
699 (class Output_data_plt_i386): Make first_plt_entry,
700 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
701 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
702 and plt_eh_frame_fde.
703 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
704 boundary. Call add_eh_frame_for_plt if appropriate.
705 * x86_64.cc: Include "dwarf.h".
706 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
707 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
708 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
709 and plt_eh_frame_fde.
710 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
711 appropriate.
712
713 2011-06-29 Ian Lance Taylor <iant@google.com>
714
715 PR gold/12629
716 * object.cc (Sized_relobj_file::layout_section): Change shdr
717 parameter to be const.
718 (Sized_relobj_file::layout_eh_frame_section): New function, broken
719 out of do_layout.
720 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
721 appropriate. Call layout_eh_frame_section.
722 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
723 sections.
724 * object.h (class Sized_relobj_file): Update declarations.
725
726 2011-06-29 Ian Lance Taylor <iant@google.com>
727
728 PR gold/12652
729 * script.cc (Token::integer_value): Accept trailing M/m/K/k
730 modifier.
731 (Lex::gather_token): Accept trailing M/m/K/k for integers.
732
733 2011-06-29 Ian Lance Taylor <iant@google.com>
734
735 PR gold/12675
736 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
737 SHT_X86_64_UNWIND.
738 * layout.cc (Layout::layout_eh_frame): Likewise.
739
740 2011-06-29 Ian Lance Taylor <iant@google.com>
741
742 PR gold/12695
743 * layout.cc (Layout::symtab_section_shndx): New function.
744 * layout.h (class Layout): Declare symtab_section_shndx.
745 * output.cc (Output_section::write_header): Call it.
746
747 2011-06-29 Ian Lance Taylor <iant@google.com>
748
749 PR gold/12818
750 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
751 symbols which are not used in a relocation.
752
753 2011-06-28 Ian Lance Taylor <iant@google.com>
754
755 PR gold/12898
756 * layout.cc (Layout::segment_precedes): Don't crash if a linker
757 script create indistinguishable segments.
758 (Layout::set_segment_offsets): Use stable_sort when sorting
759 segments. Pass this to Compare_segments constructor.
760 * layout.h (class Layout): Make segment_precedes non-static.
761 (class Compare_segments): Change from struct to class. Add
762 layout_ field. Add constructor.
763 * script-sections.cc
764 (Script_sections::attach_sections_using_phdrs_clause): Rename
765 local orphan to is_orphan. Don't report failure to put empty
766 section in segment. On attachment failure, report name of
767 section, and attach to first PT_LOAD segment.
768
769 2011-06-28 Ian Lance Taylor <iant@google.com>
770
771 PR gold/12934
772 * target-select.cc (Target_selector::Target_selector): Add
773 emulation parameter. Change all callers.
774 (select_target_by_bfd_name): Rename from select_target_by_name.
775 Change all callers.
776 (select_target_by_emulation): New function.
777 (supported_emulation_names): New function.
778 * target-select.h (class Target_selector): Add emulation_ field.
779 Update declarations.
780 (Target_selector::recognize_by_bfd_name): Rename from
781 recognize_by_name. Change all callers.
782 (Target_selector::supported_bfd_names): Rename from
783 supported_names. Change all callers.
784 (Target_selector::recognize_by_emulation): New function.
785 (Target_selector::supported_emulations): New function.
786 (Target_selector::emulation): New function.
787 (Target_selector::do_recognize_by_bfd_name): Rename from
788 do_recognize_by_name. Change all callers.
789 (Target_selector::do_supported_bfd_names): Rename from
790 do_supported_names. Change all callers.
791 (Target_selector::do_recognize_by_emulation): New function.
792 (Target_selector::do_supported_emulations): New function.
793 (select_target_by_bfd_name): Change name in declaration.
794 (select_target_by_emulation): Declare.
795 (supported_emulation_names): Declare.
796 * parameters.cc (parameters_force_valid_target): Try to find
797 target based on emulation from -m option.
798 * options.h (class General_options): Change doc string for -m.
799 * options.cc (help): Print emulations.
800 (General_options::parse_V): Likewise.
801 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
802 Add emulation parameter. Change all callers.
803
804 2011-06-28 Ian Lance Taylor <iant@google.com>
805
806 * target.h (class Target): Add osabi_ field.
807 (Target::osabi): New function.
808 (Target::set_osabi): New function.
809 (Target::Target): Initialize osabi_.
810 (Target::do_adjust_elf_header): Make pure virtual.
811 (Sized_target::do_adjust_elf_header): Declare.
812 * target.cc (Sized_target::do_adjust_elf_header): New function.
813 (class Sized_target): Instantiate all versions.
814 * freebsd.h (class Target_freebsd): Remove.
815 (Target_selector_freebsd::do_recognize): Call set_osabi on
816 Target.
817 (Target_selector_freebsd::do_recognize_by_name): Likewise.
818 (Target_selector_freebsd::set_osabi): Remove.
819 * i386.cc (class Target_i386): Inherit from Sized_target rather
820 than Target_freebsd.
821 * x86_64.cc (class Target_x86_64): Likewise.
822
823 2011-06-28 Ian Lance Taylor <iant@google.com>
824
825 * target.h (Target::can_check_for_function_pointers): Rewrite.
826 Make non-virtual.
827 (Target::can_icf_inline_merge_sections): Likewise.
828 (Target::section_may_have_icf_unsafe_poineters): Likewise.
829 (Target::Target_info): Add can_icf_inline_merge_sections field.
830 (Target::do_can_check_for_function_pointers): New virtual
831 function.
832 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
833 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
834 from can_check_for_function_pointers, move in file.
835 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
836 section_may_have_icf_unsafe_poineters, move in file.
837 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
838 * i386.cc (Target_i386::do_can_check_for_function_pointers):
839 Rename from can_check_for_function_pointers, move in file.
840 (Target_i386::can_icf_inline_merge_sections): Remove.
841 (Target_i386::i386_info): Initialize
842 can_icf_inline_merge_sections.
843 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
844 Initialize can_icf_inline_merge_sections.
845 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
846 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
847 Rename from can_check_for_function_pointers, move in file.
848 (Target_x86_64::can_icf_inline_merge_sections): Remove.
849 (Target_x86_64::x86_64_info): Initialize
850 can_icf_inline_merge_sections.
851 * testsuite/testfile.cc (Target_test::test_target_info):
852 Likewise.
853 * icf.cc (get_section_contents): Correct formatting.
854
855 2011-06-27 Ian Lance Taylor <iant@google.com>
856
857 * symtab.cc (Symbol::versioned_name): New function.
858 (Symbol_table::add_to_final_symtab): Use versioned_name when
859 appropriate.
860 (Symbol_table::sized_write_symbol): Likewise.
861 * symtab.h (class Symbol): Declare versioned_name.
862 * stringpool.h (class Stringpool_template): Add variant of add
863 which takes a std::basic_string.
864 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
865 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
866 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
867 (ver_test_12.o): New target.
868 * testsuite/Makefile.in: Rebuild.
869
870 2011-06-27 Doug Kwan <dougkwan@google.com>
871
872 * arm.cc (Arm_relocate_functions::thm_jump8,
873 Arm_relocate_functions::thm_jump11): Use a wider signed
874 type to compute offset.
875 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
876 arm_thm_jump8.
877 * testsuite/Makefile.in: Regenerate.
878 * testsuite/arm_branch_in_range.sh: Check test results of
879 arm_thm_jump11 and arm_thm_jump8.
880 * testsuite/arm_thm_jump11.s: New test source file.
881 * testsuite/arm_thm_jump11.t: New linker script.
882 * testsuite/arm_thm_jump8.s: New test source file.
883 * testsuite/arm_thm_jump8.t: New linker script.
884
885 2011-06-24 Ian Lance Taylor <iant@google.com>
886
887 * layout.cc: Include "object.h".
888 (ctors_sections_in_init_array): New static variable.
889 (Layout::is_ctors_in_init_array): New function.
890 (Layout::layout): Add entry to ctors_sections_in_init_array if
891 appropriate.
892 * layout.h (class Layout): Declare is_ctors_in_init_array.
893 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
894 is_ctors_reverse_view is set.
895 (Sized_relobj_file::write_sections): Add layout parameter. Change
896 all callers. Set is_ctors_reverse_view field of View_size.
897 (Sized_relobj_file::reverse_words): New function.
898 * object.h (Sized_relobj_file::View_size): Add
899 is_ctors_reverse_view field.
900 (class Sized_relobj_file): Update declarations.
901 * testsuite/initpri3.c: New test.
902 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
903 initpri3b.
904 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
905 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
906 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
907 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
908 * testsuite/Makefile.in: Rebuild.
909
910 2011-06-24 Cary Coutant <ccoutant@google.com>
911
912 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
913 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
914 (debug_msg_cdebug.err): New targets.
915 * testsuite/Makefile.in: Regenerate.
916 * testsuite/debug_msg.sh: Check output of link with compressed debug.
917 Fix checks for link with shared library.
918
919 2011-06-24 Doug Kwan <dougkwan@google.com>
920
921 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
922 skip empty text sections.
923 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
924
925 2011-06-22 Ian Lance Taylor <iant@google.com>
926
927 PR gold/12910
928 * options.h (class General_options): Add --ctors-in-init-array.
929 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
930 friends as SHT_PROGBITS for merging sections.
931 (Layout::layout): Remove special handling of .init_array and
932 friends. Don't sort if doing relocatable link. Sort for .ctors
933 and .dtors if ctors_in_init_array.
934 (Layout::make_output_section): Force correct section types for
935 .init_array and friends. Don't sort if doing relocatable link,
936 Don't sort .ctors and .dtors if ctors_in_init_array.
937 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
938 (Layout::output_section_name): Add relobj parameter. Change all
939 callers. Handle .ctors. and .dtors. in code rather than table.
940 Handle .ctors and .dtors if ctors_in_init_array.
941 (Layout::match_file_name): New function, moved from output.cc.
942 * layout.h (class Layout): Update declarations.
943 * output.cc: Include "layout.h".
944 (Input_section_sort_entry::get_priority): New function.
945 (Input_section_sort_entry::match_file_name): Just call
946 Layout::match_file_name.
947 (Output_section::Input_section_sort_init_fini_compare::operator()):
948 Handle .ctors and .dtors. Sort by explicit priority rather than
949 by name.
950 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
951 * testsuite/initpri2.c: New test.
952 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
953 (check_PROGRAMS): Add initpri2.
954 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
955 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
956 * configure, testsuite/Makefile.in: Rebuild.
957
958 2011-06-19 Ian Lance Taylor <iant@google.com>
959
960 PR gold/12880
961 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
962 .interp section to a PT_INTERP segment even if we have seen a
963 --dynamic-linker option. Don't do it if we have seen a PHDRS
964 clause in a linker script.
965 (Layout::finalize): Don't create a .interp section if we've
966 already create a PT_INTERP segment.
967 (Layout::create_interp): Always call choose_output_section (revert
968 patch of 2011-06-17). Don't create PT_INTERP segment.
969 * script-sections.cc
970 (Script_sections::create_note_and_tls_segments): Add a .interp
971 section to a PT_INTERP segment even if we have seen a
972 --dynamic-linker option.
973
974 2011-06-18 Ian Lance Taylor <iant@google.com>
975
976 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
977 merely because a non-PT_LOAD segment has a dynamic reloc.
978
979 2011-06-18 Ian Lance Taylor <iant@google.com>
980
981 * layout.cc (Layout::finish_dynamic_section): Don't create
982 DT_FLAGS entry if not needed.
983
984 2011-06-18 Ian Lance Taylor <iant@google.com>
985
986 PR gold/12745
987 * layout.cc (Layout::layout_eh_frame): Correct handling of
988 writable .eh_frame section.
989
990 2011-06-17 Ian Lance Taylor <iant@google.com>
991
992 PR gold/12893
993 * resolve.cc (Symbol_table::resolve): Don't give an error if a
994 symbol is redefined with the exact same object and value.
995
996 2011-06-17 Ian Lance Taylor <iant@google.com>
997
998 PR gold/12880
999 * layout.h (class Layout): Add interp_segment_ field.
1000 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1001 (Layout::attach_allocated_section_to_segment): If making shared
1002 library, put .interp section in PT_INTERP segment.
1003 (Layout::finalize): Also call create_interp if -dynamic-linker
1004 option was used.
1005 (Layout::create_interp): Assert that there is no PT_INTERP
1006 segment. If not using a SECTIONS clause, use make_output_section.
1007 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1008 * script-sections.cc
1009 (Script_sections::create_note_and_tls_segments): If making shared
1010 library, put .interp section in PT_INTERP segment.
1011
1012 2011-06-17 Ian Lance Taylor <iant@google.com>
1013
1014 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1015 when making a shared library.
1016
1017 2011-06-17 Ian Lance Taylor <iant@google.com>
1018
1019 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1020 parameter. Change all callers. Don't issue warning about PC32
1021 against locally defined symbol.
1022
1023 2011-06-16 Ian Lance Taylor <iant@google.com>
1024
1025 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1026 occurs in same object.
1027
1028 2011-06-14 Alan Modra <amodra@gmail.com>
1029
1030 * po/POTFILES.in: Regenerate.
1031
1032 2011-06-09 Ian Lance Taylor <iant@google.com>
1033
1034 * script-sections.cc
1035 (Orphan_output_section::set_section_addresses): For a relocatable
1036 link set address to 0.
1037
1038 2011-06-09 Cary Coutant <ccoutant@google.com>
1039
1040 PR gold/12804
1041 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1042 used with --compress-debug-sections.
1043 * gold/object.cc (Sized_relobj_file::do_layout): Report
1044 uncompressed size of compressed input sections.
1045
1046 2011-06-08 Cary Coutant <ccoutant@google.com>
1047
1048 PR gold/12804
1049 * testsuite/two_file_test_2_v1.cc: Change initialization of
1050 v2 to keep it in .data.
1051
1052 2011-06-07 Cary Coutant <ccoutant@google.com>
1053
1054 * common.cc (Symbol_table::do_allocate_commons_list): Call
1055 gold_fallback.
1056 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1057 (Errors::fallback): New function.
1058 (gold_fallback): New function.
1059 * errors.h (Errors::fallback): New function.
1060 * gold.cc (gold_exit): Change status parameter to enum; adjust
1061 all callers.
1062 (queue_initial_tasks): Call gold_fallback.
1063 * gold.h: Include cstdlib.
1064 (Exit_status): New enum type.
1065 (gold_exit): Change status parameter to enum.
1066 (gold_fallback): New function.
1067 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1068 (Layout::create_symtab_sections): Likewise.
1069 (Layout::create_shdrs): Likewise.
1070 * main.cc (main): Adjust call to gold_exit.
1071 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1072 (Output_data_got::add_got_entry_pair): Likewise.
1073 (Output_section::add_input_section): Likewise.
1074 (Output_section::add_output_section_data): Likewise.
1075 (Output_segment::set_section_list_addresses): Likewise.
1076 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1077
1078 2011-06-07 Cary Coutant <ccoutant@google.com>
1079
1080 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1081 for incremental links.
1082 * output.cc (Output_segment::set_section_list_addresses): Remove
1083 FIXME and test for TLS or BSS.
1084
1085 2011-06-07 Cary Coutant <ccoutant@google.com>
1086
1087 * testsuite/Makefile.am: Add incremental_copy_test,
1088 incremental_common_test_1.
1089 * testsuite/Makefile.in: Regenerate.
1090 * testsuite/common_test_1_v1.c: New source file.
1091 * testsuite/common_test_1_v2.c: New source file.
1092 * testsuite/copy_test_v1.cc: New source file.
1093
1094 2011-06-07 Cary Coutant <ccoutant@google.com>
1095
1096 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1097 update, allocate common from bss section's free list.
1098 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1099 linker-defined symbols.
1100 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1101 Skip GOT and PLT entries that are no longer referenced.
1102 (Output_section_incremental_inputs::write_info_blocks): Mark
1103 linker-defined symbols.
1104 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1105 * output.cc (Output_section::allocate): New function.
1106 * output.h (Output_section::allocate): New function.
1107 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1108 linker-defined symbols.
1109 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1110 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1111 (Symbol::init_base_output_data): Likewise.
1112 (Symbol::init_base_output_segment): Likewise.
1113 (Symbol::init_base_constant): Likewise.
1114 (Sized_symbol::init_output_data): Likewise.
1115 (Sized_symbol::init_output_segment): Likewise.
1116 (Sized_symbol::init_constant): Likewise.
1117 (Symbol_table::do_define_in_output_data): Likewise.
1118 (Symbol_table::do_define_in_output_segment): Likewise.
1119 (Symbol_table::do_define_as_constant): Likewise.
1120 * symtab.h (Symbol::is_predefined): New function.
1121 (Symbol::init_base_output_data): Add is_predefined parameter.
1122 (Symbol::init_base_output_segment): Likewise.
1123 (Symbol::init_base_constant): Likewise.
1124 (Symbol::is_predefined_): New data member.
1125 (Sized_symbol::init_output_data): Add is_predefined parameter.
1126 (Sized_symbol::init_output_segment): Likewise.
1127 (Sized_symbol::init_constant): Likewise.
1128 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1129
1130 2011-06-07 Cary Coutant <ccoutant@google.com>
1131
1132 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1133 instead of emit_copy_reloc.
1134 (Copy_relocs::emit_copy_reloc): Refactor.
1135 (Copy_relocs::make_copy_reloc): New function.
1136 (Copy_relocs::add_copy_reloc): Remove.
1137 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1138 section.
1139 (Copy_relocs::make_copy_reloc): New function.
1140 (Copy_relocs::add_copy_reloc): Remove.
1141 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1142 unchanged input files.
1143 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1144 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1145 Reserve BSS space for COPY relocations.
1146 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1147 (Output_section_incremental_inputs::write_info_blocks): Record
1148 whether a symbol is copied from a shared object.
1149 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1150 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1151 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1152 (Incremental_input_entry_reader::get_output_symbol_index): Add
1153 is_copy parameter.
1154 (Incremental_binary::emit_copy_relocs): New function.
1155 (Incremental_binary::do_emit_copy_relocs): New function.
1156 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1157 new data member.
1158 (Sized_incremental_binary::add_copy_reloc): New function.
1159 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1160 (Sized_incremental_binary::Copy_reloc): New struct.
1161 (Sized_incremental_binary::Copy_relocs): New typedef.
1162 (Sized_incremental_binary::copy_relocs_): New data member.
1163 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1164 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1165 * target.h (Sized_target::emit_copy_reloc): New function.
1166 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1167
1168 2011-06-02 Cary Coutant <ccoutant@google.com>
1169
1170 PR gold/12163
1171 * gold/archive.cc (Archive::Archive): Initialize new data member.
1172 (Archive::include_all_members): Return if archive has already been
1173 included.
1174 * gold/archive.h (Archive::include_all_members_): New data member.
1175
1176 2011-06-02 Nick Clifton <nickc@redhat.com>
1177
1178 * dynobj.h: Fix spelling mistake in comment.
1179 * output.cc: Likewise.
1180
1181 2011-05-31 Doug Kwan <dougkwan@google.com>
1182 Asier Llano
1183
1184 PR gold/12826
1185 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
1186 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1187 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1188 redundant arm_exidx_test.so.
1189 * testsuite/Makefile.in: Regenerate.
1190 (check_SCRIPTS): Add pr12826.sh
1191 (check_DATA): Add pr12826.stdout
1192 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1193 * testsuite/pr12826.sh: New file.
1194 * testsuite/pr12826_1.s: Ditto.
1195 * testsuite/pr12826_1.s: Ditto.
1196
1197 2011-05-30 Ian Lance Taylor <iant@google.com>
1198
1199 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1200 sections.
1201
1202 2011-05-29 Ian Lance Taylor <iant@google.com>
1203
1204 PR gold/12804
1205 * testsuite/Makefile.am: Use different file name for two_file_test
1206 temporary file for each incremental test.
1207 * testsuite/Makefile.in: Rebuild.
1208
1209 2011-05-29 Ian Lance Taylor <iant@google.com>
1210
1211 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1212 binary input file is empty.
1213
1214 2011-05-27 Ian Lance Taylor <iant@google.com>
1215
1216 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1217 (ver_test_9.so): Likewise.
1218 * testsuite/Makefile.in: Rebuild.
1219
1220 2011-05-26 Cary Coutant <ccoutant@google.com>
1221
1222 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1223 * incremental.cc (Incremental_inputs::report_input_section): Fix
1224 comment, indentation.
1225 (Incremental_inputs::report_comdat_group): New function.
1226 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1227 of data for incremental input file entry.
1228 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1229 group count, COMDAT group signatures.
1230 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1231 an unchanged input file.
1232 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1233 Initialize new data member.
1234 (Incremental_object_entry::add_comdat_group): New function.
1235 (Incremental_object_entry::get_comdat_group_count): New function.
1236 (Incremental_object_entry::get_comdat_signature_key): New function.
1237 (Incremental_object_entry::groups_): New data member.
1238 (Incremental_inputs::report_comdat_group): New function.
1239 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1240 data for incremental input file entry.
1241 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1242 (Incremental_input_entry_reader::get_input_section): Adjust size of
1243 data for incremental input file entry.
1244 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1245 (Incremental_input_entry_reader::get_comdat_group_signature): New
1246 function.
1247 * object.cc (Sized_relobj::include_section_group): Report kept
1248 COMDAT groups for incremental links.
1249
1250 2011-05-24 David Meyer <pdox@google.com>
1251
1252 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1253 with name parameter. Add found_name parameter.
1254 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1255 * dirsearch.h (class Dirsearch): Update declaration.
1256
1257 2011-05-24 Ian Lance Taylor <iant@google.com>
1258
1259 * archive.cc (Library_base::should_include_member): Pull in object
1260 from archive if it defines the entry symbol.
1261 * parameters.cc (Parameters::entry): New function.
1262 * parameters.h (class Parameters): Declare entry.
1263 * output.h (class Output_file_header): Remove entry_ field.
1264 * output.cc (Output_file_header::Output_file_header): Remove entry
1265 parameter. Change all callers.
1266 (Output_file_header::entry): Use parameters->entry.
1267 * gold.cc (queue_middle_tasks): Likewise.
1268 * plugin.cc (Plugin_hook::run): Likewise.
1269
1270 2011-05-24 Cary Coutant <ccoutant@google.com>
1271
1272 * gold.cc (queue_initial_tasks): Pass incremental base filename
1273 to Output_file::open_base_file; don't print error message.
1274 * incremental-dump.cc (main): Adjust call to
1275 Output_file::open_for_modification.
1276 * incremental-dump.cc (main): Likewise.
1277 * incremental.cc (Incremental_inputs::report_command_line):
1278 Ignore --incremental-base option when comparing command lines.
1279 Ignore parameter when given as separate argument.
1280 * options.h (class General_options): Add --incremental-base.
1281 * output.cc (Output_file::Output_file):
1282 (Output_file::open_base_file): Add base_name and writable parameters;
1283 read base file into new file; print error message here.
1284 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1285 callers.
1286 * output.h (Output_file::open_for_modification): Rename to...
1287 (Output_file::open_base_file): ...this; add base_name and
1288 writable parameters; adjust all callers.
1289 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1290 callers.
1291 * testsuite/Makefile.am (incremental_test_4): Test
1292 --incremental-base.
1293 * testsuite/Makefile.in: Regenerate.
1294
1295 2011-05-24 Cary Coutant <ccoutant@google.com>
1296
1297 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1298 incremental_test_4.
1299 * testsuite/Makefile.in: Regenerate.
1300 * testsuite/two_file_test_1_v1.cc: New test source file.
1301 * testsuite/two_file_test_1b_v1.cc: New test source file.
1302 * testsuite/two_file_test_2_v1.cc: New test source file.
1303
1304 2011-05-24 Cary Coutant <ccoutant@google.com>
1305
1306 * dynobj.h (Dynobj::do_dynobj): New function.
1307 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1308 flag and soname for shared objects.
1309 * incremental.cc (Incremental_inputs::report_object): Make
1310 either Incremental_object_entry or Incremental_dynobj_entry; add
1311 soname to string table.
1312 (Incremental_inputs::report_input_section): Add assertion.
1313 (Output_section_incremental_inputs::set_final_data_size): Adjust
1314 type of input file entry for shared libraries; adjust size of
1315 shared library info entry.
1316 (Output_section_incremental_inputs::write_input_files): Write
1317 as_needed flag for shared libraries.
1318 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1319 of input file entry for shared libraries; write soname.
1320 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1321 soname from incremental info.
1322 * incremental.h (enum Incremental_input_flags): Add
1323 INCREMENTAL_INPUT_AS_NEEDED.
1324 (Incremental_input_entry::Incremental_input_entry): Initialize new
1325 data member.
1326 (Incremental_input_entry::set_as_needed): New function.
1327 (Incremental_input_entry::as_needed): New function.
1328 (Incremental_input_entry::do_dynobj_entry): New function.
1329 (Incremental_input_entry::as_needed_): New data member.
1330 (Incremental_object_entry::Incremental_object_entry): Don't check
1331 for shared library.
1332 (Incremental_object_entry::do_type): Likewise.
1333 (class Incremental_dynobj_entry): New class.
1334 (Incremental_input_entry_reader::as_needed): New function.
1335 (Incremental_input_entry_reader::get_soname): New function.
1336 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1337 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1338 size of shared library info entry.
1339 * layout.cc (Layout::finish_dynamic_section): Don't test for
1340 incremental link when adding DT_NEEDED entries.
1341 * object.h (Object::Object): Initialize new data member.
1342 (Object::dynobj): New function.
1343 (Object::set_as_needed): New function.
1344 (Object::as_needed): New function.
1345 (Object::do_dynobj): New function.
1346 (Object::as_needed_): New data member.
1347
1348 2011-05-24 Cary Coutant <ccoutant@google.com>
1349
1350 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1351 info; adjust display of GOT entries.
1352 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1353 vector of input objects; remove file_status_.
1354 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1355 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1356 got_plt reader; call target hooks to reserve GOT entries.
1357 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1358 of input file info header and GOT info entry.
1359 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1360 relocation info.
1361 (Got_plt_view_info::got_descriptor): Remove.
1362 (Got_plt_view_info::sym_index): New data member.
1363 (Got_plt_view_info::input_index): New data member.
1364 (Local_got_offset_visitor::visit): Write input file index.
1365 (Global_got_offset_visitor::visit): Write 0 for input file index.
1366 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1367 with sym_index and input_index.
1368 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1369 incremental info GOT entry; replace got_descriptor with input_index.
1370 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1371 map from input file index to object.
1372 (Sized_relobj_incr::do_layout): Replace direct data member reference
1373 with accessor function.
1374 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1375 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1376 Adjust size of input file info header.
1377 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1378 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1379 (Incremental_input_entry_reader::get_input_section): Adjust size of
1380 input file info header.
1381 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1382 of incremental info GOT entry.
1383 (Incremental_got_plt_reader::get_got_desc): Remove.
1384 (Incremental_got_plt_reader::get_got_symndx): New function.
1385 (Incremental_got_plt_reader::get_got_input_index): New function.
1386 (Sized_incremental_binary::Sized_incremental_binary): Remove
1387 file_status_; add input_objects_.
1388 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1389 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1390 (Sized_incremental_binary::file_is_unchanged): Remove.
1391 (Sized_incremental_binary::set_input_object): New function.
1392 (Sized_incremental_binary::input_object): New function.
1393 (Sized_incremental_binary::file_status_): Remove.
1394 (Sized_incremental_binary::input_objects_): New data member.
1395 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1396 references.
1397 (Sized_relobj_incr::invalid_address): Move to base class.
1398 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1399 class.
1400 (Sized_relobj_incr::do_output_section_offset): Likewise.
1401 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1402 (Sized_relobj_incr::section_offsets_): Likewise.
1403 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1404 function.
1405 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1406 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1407 with accessor function.
1408 (Sized_relobj_file::do_layout): Likewise.
1409 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1410 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1411 (Sized_relobj_file::compute_final_local_value): Replace refs to
1412 section_offsets_ with accessor function.
1413 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1414 * object.h (Relobj::Relobj): Initialize new data members.
1415 (Relobj::add_dyn_reloc): New function.
1416 (Relobj::first_dyn_reloc): New function.
1417 (Relobj::dyn_reloc_count): New function.
1418 (Relobj::first_dyn_reloc_): New data member.
1419 (Relobj::dyn_reloc_count_): New data member.
1420 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1421 references.
1422 (Sized_relobj::Address): New typedef.
1423 (Sized_relobj::invalid_address): Move here from child class.
1424 (Sized_relobj::Sized_relobj): Initialize new data members.
1425 (Sized_relobj::sized_relobj): New function.
1426 (Sized_relobj::is_output_section_offset_invalid): Move here from
1427 child class.
1428 (Sized_relobj::get_output_section_offset): Likewise.
1429 (Sized_relobj::local_has_got_offset): Likewise.
1430 (Sized_relobj::local_got_offset): Likewise.
1431 (Sized_relobj::set_local_got_offset): Likewise.
1432 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1433 (Sized_relobj::clear_got_offsets): New function.
1434 (Sized_relobj::section_offsets): Move here from child class.
1435 (Sized_relobj::do_output_section_offset): Likewise.
1436 (Sized_relobj::do_set_section_offset): Likewise.
1437 (Sized_relobj::Local_got_offsets): Likewise.
1438 (Sized_relobj::local_got_offsets_): Likewise.
1439 (Sized_relobj::section_offsets_): Likewise.
1440 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1441 references.
1442 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1443 class.
1444 (Sized_relobj_file::sized_relobj): New function
1445 (Sized_relobj_file::local_has_got_offset): Move to base class.
1446 (Sized_relobj_file::local_got_offset): Likewise.
1447 (Sized_relobj_file::set_local_got_offset): Likewise.
1448 (Sized_relobj_file::get_output_section_offset): Likewise.
1449 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1450 (Sized_relobj_file::do_output_section_offset): Likewise.
1451 (Sized_relobj_file::do_set_section_offset): Likewise.
1452 (Sized_relobj_file::Local_got_offsets): Likewise.
1453 (Sized_relobj_file::local_got_offsets_): Likewise.
1454 (Sized_relobj_file::section_offsets_): Likewise.
1455 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1456 (all constructors).
1457 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1458 (Output_reloc::get_symbol_index): Likewise.
1459 (Output_reloc::local_section_offset): Likewise.
1460 (Output_reloc::get_address): Likewise.
1461 (Output_reloc::symbol_value): Likewise.
1462 (Output_data_got::reserve_slot): Move to class definition.
1463 (Output_data_got::reserve_local): New function.
1464 (Output_data_got::reserve_slot_for_global): Remove.
1465 (Output_data_got::reserve_global): New function.
1466 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1467 (all constructors, two instantiations).
1468 (Output_reloc::get_relobj): New function (two instantiations).
1469 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1470 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1471 (Output_data_reloc::add_global): Adjust type of relobj.
1472 (Output_data_reloc::add_global_relative): Likewise.
1473 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1474 (Output_data_reloc::add_local): Likewise.
1475 (Output_data_reloc::add_local_relative): Likewise.
1476 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1477 (Output_data_reloc::add_local_section): Likewise.
1478 (Output_data_reloc::add_output_section): Likewise.
1479 (Output_data_reloc::add_absolute): Likewise.
1480 (Output_data_reloc::add_target_specific): Likewise.
1481 (Output_data_got::reserve_slot): Move definition here.
1482 (Output_data_got::reserve_local): New function.
1483 (Output_data_got::reserve_global): New function.
1484 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1485 section_offsets_ with accessor function.
1486 (Sized_relobj_file::write_sections): Likewise.
1487 (Sized_relobj_file::do_relocate_sections): Likewise.
1488 * target.h (Sized_target::reserve_local_got_entry): New function.
1489 (Sized_target::reserve_global_got_entry): New function.
1490 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1491 (Target_x86_64::reserve_global_got_entry): New function.
1492 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1493
1494 2011-05-23 Cary Coutant <ccoutant@google.com>
1495
1496 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1497 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1498 bit when checking got_type.
1499 * incremental.cc (Sized_incremental_binary::setup_readers):
1500 Store symbol table and string table locations; initialize bit vector
1501 of file status flags.
1502 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1503 unchanged files.
1504 (Sized_incremental_binary::do_process_got_plt): New function.
1505 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1506 (Output_section_incremental_inputs::set_final_data_size): Record
1507 file index for each input file.
1508 (Output_section_incremental_inputs::write_got_plt): Store file index
1509 instead of input entry offset for each GOT entry.
1510 * incremental.h
1511 (Incremental_input_entry::Incremental_input_entry): Initialize new
1512 data member.
1513 (Incremental_input_entry::set_offset): Store file index.
1514 (Incremental_input_entry::get_file_index): New function.
1515 (Incremental_input_entry::file_index_): New data member.
1516 (Incremental_binary::process_got_plt): New function.
1517 (Incremental_binary::do_process_got_plt): New function.
1518 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1519 data members.
1520 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1521 (Sized_incremental_binary::set_file_is_unchanged): New function.
1522 (Sized_incremental_binary::file_is_unchanged): New function.
1523 (Sized_incremental_binary::do_process_got_plt): New function.
1524 (Sized_incremental_binary::file_status_): New data member.
1525 (Sized_incremental_binary::main_symtab_loc_): New data member.
1526 (Sized_incremental_binary::main_strtab_loc_): New data member.
1527 * output.cc (Output_data_got::Got_entry::write): Add case
1528 RESERVED_CODE.
1529 (Output_data_got::add_global): Call add_got_entry.
1530 (Output_data_got::add_global_plt): Likewise.
1531 (Output_data_got::add_global_with_rel): Likewise.
1532 (Output_data_got::add_global_with_rela): Likewise.
1533 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1534 (Output_data_got::add_global_pair_with_rela): Likewise.
1535 (Output_data_got::add_local): Call add_got_entry.
1536 (Output_data_got::add_local_plt): Likewise.
1537 (Output_data_got::add_local_with_rel): Likewise.
1538 (Output_data_got::add_local_with_rela): Likewise.
1539 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1540 (Output_data_got::add_local_pair_with_rela): Likewise.
1541 (Output_data_got::reserve_slot): New function.
1542 (Output_data_got::reserve_slot_for_global): New function.
1543 (Output_data_got::add_got_entry): New function.
1544 (Output_data_got::add_got_entry_pair): New function.
1545 (Output_section::add_output_section_data): Edit FIXME.
1546 * output.h
1547 (Output_section_data_build::Output_section_data_build): New
1548 constructor with size parameter.
1549 (Output_data_space::Output_data_space): Likewise.
1550 (Output_data_got::Output_data_got): Initialize new data member; new
1551 constructor with size parameter.
1552 (Output_data_got::add_constant): Call add_got_entry.
1553 (Output_data_got::reserve_slot): New function.
1554 (Output_data_got::reserve_slot_for_global): New function.
1555 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1556 (Output_data_got::add_got_entry): New function.
1557 (Output_data_got::add_got_entry_pair): New function.
1558 (Output_data_got::free_list_): New data member.
1559 * target.h (Sized_target::init_got_plt_for_update): New function.
1560 (Sized_target::register_global_plt_entry): New function.
1561 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1562 Initialize new data member; call init; add constructor with PLT count.
1563 (Output_data_plt_x86_64::init): New function.
1564 (Output_data_plt_x86_64::add_relocation): New function.
1565 (Output_data_plt_x86_64::reserve_slot): New function.
1566 (Output_data_plt_x86_64::free_list_): New data member.
1567 (Target_x86_64::init_got_plt_for_update): New function.
1568 (Target_x86_64::register_global_plt_entry): New function.
1569 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1570 incremental updates.
1571 (Output_data_plt_x86_64::add_relocation): New function.
1572 * testsuite/object_unittest.cc (Object_test): Set default options.
1573
1574 2011-05-16 Ian Lance Taylor <iant@google.com>
1575
1576 * options.h (class General_options): Make -i a synonym for -r.
1577
1578 2011-05-16 Ian Lance Taylor <iant@google.com>
1579
1580 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1581
1582 2011-05-10 Cary Coutant <ccoutant@google.com>
1583
1584 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1585 strip_all (-s).
1586
1587 2011-05-06 Ian Lance Taylor <iant@google.com>
1588
1589 * layout.cc (Layout::layout): If the output section flags change,
1590 update the ordering.
1591
1592 2011-04-25 Cary Coutant <ccoutant@google.com>
1593
1594 * incremental-dump.cc (dump_incremental_inputs): Print local
1595 symbol info for each input file.
1596 * incremental.cc
1597 (Output_section_incremental_inputs::set_final_data_size): Add local
1598 symbol info to input file entries in incremental info.
1599 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1600 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1601 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1602 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1603 implementation.
1604 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1605 (Sized_incr_relobj::do_relocate): Write the local symbols.
1606 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1607 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1608 Adjust size of input file header.
1609 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1610 (Incremental_inputs_reader::get_local_symbol_count): New function.
1611 (Incremental_inputs_reader::get_input_section): Adjust size of input
1612 file header.
1613 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1614 (Sized_incr_relobj::This): New typedef.
1615 (Sized_incr_relobj::sym_size): New const data member.
1616 (Sized_incr_relobj::Local_symbol): New struct.
1617 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1618 (Sized_incr_relobj::do_local_symbol_offset): New function.
1619 (Sized_incr_relobj::local_symbol_count_): New data member.
1620 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1621 (Sized_incr_relobj::local_symbol_index_): New data member.
1622 (Sized_incr_relobj::local_symbol_offset_): New data member.
1623 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1624 (Sized_incr_relobj::local_symbols_): New data member.
1625 * object.h (Relobj::output_local_symbol_count): New function.
1626 (Relobj::local_symbol_offset): New function.
1627 (Relobj::do_output_local_symbol_count): New function.
1628 (Relobj::do_local_symbol_offset): New function.
1629 (Sized_relobj::do_output_local_symbol_count): New function.
1630 (Sized_relobj::do_local_symbol_offset): New function.
1631
1632 2011-04-22 Vladimir Simonov <sv@sw.ru>
1633
1634 * descriptors.cc (set_close_on_exec): New function.
1635 (Descriptors::open): Use set_close_on_exec.
1636 * output.cc (S_ISLNK): Define if not defined.
1637
1638 2011-04-22 Cary Coutant <ccoutant@google.com>
1639
1640 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1641 global symbol map.
1642 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1643 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1644 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1645 relocations.
1646 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1647 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1648 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1649 * incremental.h
1650 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1651 function.
1652 (Incremental_binary::apply_incremental_relocs): New function.
1653 (Incremental_binary::do_apply_incremental_relocs): New function.
1654 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1655 data member.
1656 (Sized_incremental_binary::add_global_symbol): New function.
1657 (Sized_incremental_binary::global_symbol): New function.
1658 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1659 (Sized_incremental_binary::symbol_map_): New data member.
1660 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1661 * target.h (Sized_target::apply_relocation): New function.
1662 * target-reloc.h (apply_relocation): New function.
1663 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1664
1665 2011-04-22 Doug Kwan <dougkwan@google.com>
1666
1667 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1668 flag of a SHT_ARM_EXIDX section.
1669 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1670 * testsuite/Makefile.in: Regenerate.
1671 * testsuite/arm_exidx_test.s: New file.
1672 * testsuite/arm_exidx_test.sh: Same.
1673
1674 2011-04-20 Cary Coutant <ccoutant@google.com>
1675
1676 PR gold/12689
1677 * archive.h (Incremental_archive_entry::Archive_member):
1678 Initialize arg_serial_ (second constructor).
1679
1680 2011-04-17 Ian Lance Taylor <iant@google.com>
1681
1682 * object.cc (Relocate_info::location): Simplify location string.
1683 * errors.cc (Errors::error_at_location): Don't print program
1684 name.
1685 (Errors::warning_at_location): Likewise.
1686 (Errors::undefined_symbol): Likewise.
1687 * testsuite/debug_msg.sh: Update accordingly.
1688
1689 2011-04-14 Cary Coutant <ccoutant@google.com>
1690
1691 * gold/layout.cc (Layout::symtab_section_offset): New function.
1692 * gold/layout.h (Layout::symtab_section_offset): New function.
1693 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1694
1695 2011-04-12 Ian Lance Taylor <iant@google.com>
1696
1697 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1698 with MREMAP_MAYMOVE.
1699 * output.h (class Output_file): Add map_is_allocated_ field.
1700 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1701 not available, provide stubs. If mremap is not available, #define
1702 it to gold_mremap.
1703 (MREMAP_MAYMOVE): Define if not defined.
1704 (Output_file::Output_file): Initialize map_is_allocated_.
1705 (Output_file::resize): Check map_is_allocated_.
1706 (Output_file::map_anonymous): If mmap fails, use malloc.
1707 (Output_file::unmap): Don't do anything for an anonymous map.
1708 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1709 is not available, provide stubs.
1710 (File_read::View::~View): Use free rather than delete[].
1711 (File_read::make_view): Use malloc rather than new[]. If mmap
1712 fails, use malloc.
1713 (File_read::find_or_make_view): Use malloc rather than new[].
1714 * gold.h: Remove HAVE_REMAP code.
1715 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1716 exists. Rename mremap to gold_mremap. If mmap is not available
1717 don't do anything.
1718 * configure, config.in: Rebuild.
1719
1720 2011-04-11 Ian Lance Taylor <iant@google.com>
1721
1722 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1723 initialize local variable v.
1724
1725 2011-04-11 Cary Coutant <ccoutant@google.com>
1726
1727 * archive.cc (Archive::include_member): Adjust call to
1728 report_object.
1729 (Add_archive_symbols::run): Track argument serial numbers.
1730 (Lib_group::include_member): Likewise.
1731 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1732 * archive.h (Incremental_archive_entry::Archive_member):
1733 Initialize arg_serial_.
1734 (Archive_member::arg_serial_): New data member.
1735 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1736 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1737 incremental link.
1738 (Sized_dynobj::do_for_all_local_got_entries): New function.
1739 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1740 function.
1741 * fileread.cc (get_mtime): New function.
1742 * fileread.h (get_mtime): New function.
1743 * gold.cc (queue_initial_tasks): Check for incremental update.
1744 (process_incremental_input): New function.
1745 (queue_middle_tasks): Don't force valid target for incremental
1746 update.
1747 * incremental-dump.cc (find_input_containing_global): Adjust
1748 size of symbol info entry.
1749 (dump_incremental_inputs): Dump argument serial number and
1750 in_system_directory flag; bias shndx by 1; print symbol names
1751 when dumping per-file symbol lists; use new symbol info readers.
1752 * incremental.cc
1753 (Output_section_incremental_inputs:update_data_size): New function.
1754 (Sized_incremental_binary::setup_readers): Setup input readers
1755 for each input file; build maps for files added from libraries
1756 and scripts.
1757 (Sized_incremental_binary::check_input_args): New function.
1758 (Sized_incremental_binary::do_check_inputs): Build map of argument
1759 serial numbers to input arguments.
1760 (Sized_incremental_binary::do_file_has_changed): Rename
1761 do_file_is_unchanged to this; compare file modification times.
1762 (Sized_incremental_binary::do_init_layout): New function.
1763 (Sized_incremental_binary::do_reserve_layout): New function.
1764 (Sized_incremental_binary::do_get_input_reader): Remove.
1765 (Sized_incremental_binary::get_symtab_view): New function.
1766 (Incremental_checker::can_incrementally_link_output_file): Remove.
1767 (Incremental_inputs::report_command_line): Exclude --debug options.
1768 (Incremental_inputs::report_archive_begin): Add parameter; track
1769 argument serial numbers; don't put input file entry for archive
1770 before archive members.
1771 (Incremental_inputs::report_archive_end): Put input file entry
1772 for archive after archive members.
1773 (Incremental_inputs::report_object): Add parameter; track argument
1774 serial numbers and in_system_directory flag.
1775 (Incremental_inputs::report_script): Add parameter; track argument
1776 serial numbers.
1777 (Output_section_incremental_inputs::set_final_data_size): Adjust
1778 size of symbol info entry; check for forwarding symbols.
1779 (Output_section_incremental_inputs::write_input_files): Write
1780 in_system_directory flag and argument serial number.
1781 (Output_section_incremental_inputs::write_info_blocks): Map section
1782 indices between incremental info and original input file; store
1783 input section index for each symbol.
1784 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1785 change operator() to visit().
1786 (class Global_got_offset_visitor): Likewise.
1787 (class Global_symbol_visitor_got_plt):
1788 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1789 classes.
1790 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1791 (Sized_incr_relobj::do_read_symbols): New function.
1792 (Sized_incr_relobj::do_layout): New function.
1793 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1794 (Sized_incr_relobj::do_add_symbols): New function.
1795 (Sized_incr_relobj::do_should_include_member): New function.
1796 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1797 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1798 (Sized_incr_relobj::do_section_size): New function.
1799 (Sized_incr_relobj::do_section_name): New function.
1800 (Sized_incr_relobj::do_section_contents): New function.
1801 (Sized_incr_relobj::do_section_flags): New function.
1802 (Sized_incr_relobj::do_section_entsize): New function.
1803 (Sized_incr_relobj::do_section_address): New function.
1804 (Sized_incr_relobj::do_section_type): New function.
1805 (Sized_incr_relobj::do_section_link): New function.
1806 (Sized_incr_relobj::do_section_info): New function.
1807 (Sized_incr_relobj::do_section_addralign): New function.
1808 (Sized_incr_relobj::do_initialize_xindex): New function.
1809 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1810 (Sized_incr_relobj::do_read_relocs): New function.
1811 (Sized_incr_relobj::do_gc_process_relocs): New function.
1812 (Sized_incr_relobj::do_scan_relocs): New function.
1813 (Sized_incr_relobj::do_count_local_symbols): New function.
1814 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1815 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1816 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1817 (Sized_incr_relobj::do_relocate): New function.
1818 (Sized_incr_relobj::do_set_section_offset): New function.
1819 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1820 (Sized_incr_dynobj::do_read_symbols): New function.
1821 (Sized_incr_dynobj::do_layout): New function.
1822 (Sized_incr_dynobj::do_add_symbols): New function.
1823 (Sized_incr_dynobj::do_should_include_member): New function.
1824 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1825 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1826 (Sized_incr_dynobj::do_section_size): New function.
1827 (Sized_incr_dynobj::do_section_name): New function.
1828 (Sized_incr_dynobj::do_section_contents): New function.
1829 (Sized_incr_dynobj::do_section_flags): New function.
1830 (Sized_incr_dynobj::do_section_entsize): New function.
1831 (Sized_incr_dynobj::do_section_address): New function.
1832 (Sized_incr_dynobj::do_section_type): New function.
1833 (Sized_incr_dynobj::do_section_link): New function.
1834 (Sized_incr_dynobj::do_section_info): New function.
1835 (Sized_incr_dynobj::do_section_addralign): New function.
1836 (Sized_incr_dynobj::do_initialize_xindex): New function.
1837 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1838 (make_sized_incremental_object): New function.
1839 (Incremental_library::copy_unused_symbols): New function.
1840 (Incremental_library::do_for_all_unused_symbols): New function.
1841 * incremental.h (enum Incremental_input_flags): New type.
1842 (class Incremental_checker): Remove.
1843 (Incremental_input_entry::Incremental_input_entry): Add argument
1844 serial number.
1845 (Incremental_input_entry::arg_serial): New function.
1846 (Incremental_input_entry::set_is_in_system_directory): New function.
1847 (Incremental_input_entry::is_in_system_directory): New function.
1848 (Incremental_input_entry::arg_serial_): New data member.
1849 (Incremental_input_entry::is_in_system_directory_): New data member.
1850 (class Script_info): Move here from script.h.
1851 (Script_info::Script_info): Add filename parameter.
1852 (Script_info::filename): New function.
1853 (Script_info::filename_): New data member.
1854 (Incremental_script_entry::Incremental_script_entry): Add argument
1855 serial number.
1856 (Incremental_object_entry::Incremental_object_entry): Likewise.
1857 (Incremental_object_entry::add_input_section): Build list of input
1858 sections with map to original shndx.
1859 (Incremental_object_entry::get_input_section_index): New function.
1860 (Incremental_object_entry::shndx_): New data member.
1861 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1862 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1863 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1864 serial number.
1865 (Incremental_inputs::report_archive_begin): Likewise.
1866 (Incremental_inputs::report_object): Likewise.
1867 (Incremental_inputs::report_script): Likewise.
1868 (class Incremental_global_symbol_reader): New class.
1869 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1870 and store flags and input file type.
1871 (Incremental_input_entry_reader::arg_serial): New function.
1872 (Incremental_input_entry_reader::type): Extract type from flags.
1873 (Incremental_input_entry_reader::is_in_system_directory): New function.
1874 (Incremental_input_entry_reader::get_input_section_count): Call
1875 accessor function for type.
1876 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1877 function for type; adjust size of global symbol entry.
1878 (Incremental_input_entry_reader::get_global_symbol_count): Call
1879 accessor function for type.
1880 (Incremental_input_entry_reader::get_object_count): Likewise.
1881 (Incremental_input_entry_reader::get_object_offset): Likewise.
1882 (Incremental_input_entry_reader::get_member_count): Likewise.
1883 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1884 (Incremental_input_entry_reader::get_member_offset): Likewise.
1885 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1886 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1887 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1888 (Incremental_input_entry_reader::get_global_symbol_reader): New
1889 function.
1890 (Incremental_input_entry_reader::get_output_symbol_index): New
1891 function.
1892 (Incremental_input_entry_reader::type_): Remove.
1893 (Incremental_input_entry_reader::flags_): New data member.
1894 (Incremental_inputs_reader::input_file_offset): New function.
1895 (Incremental_inputs_reader::input_file_index): New function.
1896 (Incremental_inputs_reader::input_file): Call input_file_offset.
1897 (Incremental_inputs_reader::input_file_at_offset): New function.
1898 (Incremental_relocs_reader::get_r_type): Reformat.
1899 (Incremental_relocs_reader::get_r_shndx): Reformat.
1900 (Incremental_relocs_reader::get_r_offset): Reformat.
1901 (Incremental_relocs_reader::data): New function.
1902 (Incremental_binary::Incremental_binary): Initialize new data members.
1903 (Incremental_binary::check_inputs): Add cmdline parameter.
1904 (Incremental_binary::file_is_unchanged): Remove.
1905 (Input_reader::arg_serial): New function.
1906 (Input_reader::get_unused_symbol_count): New function.
1907 (Input_reader::get_unused_symbol): New function.
1908 (Input_reader::do_arg_serial): New function.
1909 (Input_reader::do_get_unused_symbol_count): New function.
1910 (Input_reader::do_get_unused_symbol): New function.
1911 (Incremental_binary::input_file_count): New function.
1912 (Incremental_binary::get_input_reader): Change signature to use
1913 index instead of filename.
1914 (Incremental_binary::file_has_changed): New function.
1915 (Incremental_binary::get_input_argument): New function.
1916 (Incremental_binary::get_library): New function.
1917 (Incremental_binary::get_script_info): New function.
1918 (Incremental_binary::init_layout): New function.
1919 (Incremental_binary::reserve_layout): New function.
1920 (Incremental_binary::output_file): New function.
1921 (Incremental_binary::do_check_inputs): New function.
1922 (Incremental_binary::do_file_is_unchanged): Remove.
1923 (Incremental_binary::do_file_has_changed): New function.
1924 (Incremental_binary::do_init_layout): New function.
1925 (Incremental_binary::do_reserve_layout): New function.
1926 (Incremental_binary::do_input_file_count): New function.
1927 (Incremental_binary::do_get_input_reader): Change signature.
1928 (Incremental_binary::input_args_map_): New data member.
1929 (Incremental_binary::library_map_): New data member.
1930 (Incremental_binary::script_map_): New data member.
1931 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1932 new data members.
1933 (Sized_incremental_binary::output_section): New function.
1934 (Sized_incremental_binary::inputs_reader): Add const.
1935 (Sized_incremental_binary::symtab_reader): Add const.
1936 (Sized_incremental_binary::relocs_reader): Add const.
1937 (Sized_incremental_binary::got_plt_reader): Add const.
1938 (Sized_incremental_binary::get_symtab_view): New function.
1939 (Sized_incremental_binary::Inputs_reader): New typedef.
1940 (Sized_incremental_binary::Input_entry_reader): New typedef.
1941 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1942 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1943 (Sized_incremental_binary::do_file_has_changed): New function.
1944 (Sized_incremental_binary::do_init_layout): New function.
1945 (Sized_incremental_binary::do_reserve_layout): New function.
1946 (Sized_input_reader::Inputs_reader): Remove.
1947 (Sized_input_reader::Input_entry_reader): Remove.
1948 (Sized_input_reader::do_arg_serial): New function.
1949 (Sized_input_reader::do_get_unused_symbol_count): New function.
1950 (Sized_input_reader::do_get_unused_symbol): New function.
1951 (Sized_incremental_binary::do_input_file_count): New function.
1952 (Sized_incremental_binary::do_get_input_reader): Change signature;
1953 use index instead of filename.
1954 (Sized_incremental_binary::section_map_): New data member.
1955 (Sized_incremental_binary::input_entry_readers_): New data member.
1956 (class Sized_incr_relobj): New class.
1957 (class Sized_incr_dynobj): New class.
1958 (make_sized_incremental_object): New function.
1959 (class Incremental_library): New class.
1960 * layout.cc (Free_list::num_lists): New static data member.
1961 (Free_list::num_nodes): New static data member.
1962 (Free_list::num_removes): New static data member.
1963 (Free_list::num_remove_visits): New static data member.
1964 (Free_list::num_allocates): New static data member.
1965 (Free_list::num_allocate_visits): New static data member.
1966 (Free_list::init): New function.
1967 (Free_list::remove): New function.
1968 (Free_list::allocate): New function.
1969 (Free_list::dump): New function.
1970 (Free_list::print_stats): New function.
1971 (Layout_task_runner::run): Resize output file for incremental updates.
1972 (Layout::Layout): Initialize new data members.
1973 (Layout::set_incremental_base): New function.
1974 (Layout::init_fixed_output_section): New function.
1975 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1976 incremental updates.
1977 (Layout::create_gold_note): Do not create gold note section for
1978 incremental updates.
1979 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1980 for incremental updates.
1981 (Layout::set_section_offsets): For incremental updates, allocate space
1982 from free list.
1983 (Layout::create_symtab_sections): Layout with offsets relative to
1984 start of section; for incremental updates, allocate space from free
1985 list.
1986 (Layout::create_shdrs): For incremental updates, allocate space from
1987 free list.
1988 (Layout::finish_dynamic_section): For incremental updates, do not
1989 check --as-needed (fixed in subsequent patch).
1990 * layout.h (class Free_list): New class.
1991 (Layout::set_incremental_base): New function.
1992 (Layout::incremental_base): New function.
1993 (Layout::init_fixed_output_section): New function.
1994 (Layout::allocate): New function.
1995 (Layout::incremental_base_): New data member.
1996 (Layout::free_list_): New data member.
1997 * main.cc (main): Print Free_list statistics.
1998 * object.cc (Relobj::finalize_incremental_relocs): Add
1999 clear_counts parameter; clear counts only when clear_counts is set.
2000 (Sized_relobj::Sized_relobj): Initialize new base class.
2001 (Sized_relobj::do_layout): Don't report special sections.
2002 (Sized_relobj::do_for_all_local_got_entries): New function.
2003 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2004 symtab_off to all symbol table offsets.
2005 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2006 * object.h (class Got_offset_list): Move to top of file.
2007 (Object::Object): Allow case where input_file == NULL.
2008 (Object::~Object): Likewise.
2009 (Object::input_file): Assert that input_file != NULL.
2010 (Object::lock): Allow case where input_file == NULL.
2011 (Object::unlock): Likewise.
2012 (Object::is_locked): Likewise.
2013 (Object::token): Likewise.
2014 (Object::release): Likewise.
2015 (Object::is_incremental): New function.
2016 (Object::get_mtime): New function.
2017 (Object::for_all_local_got_entries): New function.
2018 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2019 (Object::set_is_in_system_directory): New function.
2020 (Object::is_in_system_directory): New function.
2021 (Object::do_is_incremental): New function.
2022 (Object::do_get_mtime): New function.
2023 (Object::do_for_all_local_got_entries): New function.
2024 (Object::is_in_system_directory_): New data member.
2025 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2026 (class Sized_relobj_base): New class.
2027 (class Sized_relobj): Derive from Sized_relobj_base.
2028 (class Sized_relobj::Symbols): Redeclare from base class.
2029 (class Sized_relobj::local_got_offset_list): Remove.
2030 (class Sized_relobj::Output_sections): Redeclare from base class.
2031 (class Sized_relobj::do_for_all_local_got_entries): New function.
2032 (class Sized_relobj::write_local_symbols): Add offset parameter.
2033 (class Sized_relobj::local_symbol_offset_): Update comment.
2034 (class Sized_relobj::local_dynsym_offset_): Update comment.
2035 * options.cc (Input_arguments::add_file): Remove const.
2036 * options.h (Input_file_argument::Input_file_argument):
2037 Initialize arg_serial_ (all constructors).
2038 (Input_file_argument::set_arg_serial): New function.
2039 (Input_file_argument::arg_serial): New function.
2040 (Input_file_argument::arg_serial_): New data member.
2041 (Input_arguments::Input_arguments): Initialize file_count_.
2042 (Input_arguments::add_file): Remove const.
2043 (Input_arguments::number_of_input_files): New function.
2044 (Input_arguments::file_count_): New data member.
2045 (Command_line::number_of_input_files): Call
2046 Input_arguments::number_of_input_files.
2047 * output.cc (Output_segment_headers::Output_segment_headers):
2048 Set current size.
2049 (Output_section::Input_section::current_data_size): New function.
2050 (Output_section::Output_section): Initialize new data members.
2051 (Output_section::add_input_section): Don't do merge sections for
2052 an incremental link; allocate space from free list for an
2053 incremental update.
2054 (Output_section::add_output_section_data): Allocate space from
2055 free list for an incremental update.
2056 (Output_section::update_data_size): New function.
2057 (Output_section::set_fixed_layout): New function.
2058 (Output_section::reserve): New function.
2059 (Output_segment::set_section_addresses): Remove const.
2060 (Output_segment::set_section_list_addresses): Remove const; allocate
2061 space from free list for an incremental update.
2062 (Output_segment::set_offset): Adjust size of RELRO segment for an
2063 incremental update.
2064 * output.h (Output_data::current_data_size): Move here from
2065 child classes.
2066 (Output_data::pre_finalize_data_size): New function.
2067 (Output_data::update_data_size): New function.
2068 (Output_section_headers::update_data_size): new function.
2069 (Output_section_data_build::current_data_size): Move to Output_data.
2070 (Output_data_strtab::update_data_size): New function.
2071 (Output_section::current_data_size): Move to Output_data.
2072 (Output_section::set_fixed_layout): New function.
2073 (Output_section::has_fixed_layout): New function.
2074 (Output_section::reserve): New function.
2075 (Output_section::update_data_size): New function.
2076 (Output_section::has_fixed_layout_): New data member.
2077 (Output_section::free_list_): New data member.
2078 (Output_segment::set_section_addresses): Remove const.
2079 (Output_segment::set_section_list_addresses): Remove const.
2080 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2081 New function.
2082 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2083 New function.
2084 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2085 parameter when calling Add_symbols constructor; store argument
2086 serial number for members of a lib group.
2087 (Add_symbols::locks): Allow case where token == NULL.
2088 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2089 (Read_member::~Read_member): New function.
2090 (Read_member::is_runnable): New function.
2091 (Read_member::locks): New function.
2092 (Read_member::run): New function.
2093 (Check_script::~Check_script): New function.
2094 (Check_script::is_runnable): New function.
2095 (Check_script::locks): New function.
2096 (Check_script::run): New function.
2097 (Check_library::~Check_library): New function.
2098 (Check_library::is_runnable): New function.
2099 (Check_library::locks): New function.
2100 (Check_library::run): New function.
2101 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2102 (Add_symbols::library_): New data member.
2103 (class Read_member): New class.
2104 (class Check_script): New class.
2105 (class Check_library): New class.
2106 * reloc.cc (Read_relocs::is_runnable): Allow case where
2107 token == NULL.
2108 (Read_relocs::locks): Likewise.
2109 (Scan_relocs::locks): Likewise.
2110 (Relocate_task::locks): Likewise.
2111 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2112 to clear counters.
2113 (Sized_relobj::incremental_relocs_scan): Fix comment.
2114 (Sized_relobj::do_relocate): Pass output file offset to
2115 write_local_symbols.
2116 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2117 from class declaration.
2118 * script.cc (read_input_script): Allocate Script_info; pass
2119 argument serial number to report_script.
2120 * script.h (class Script_info): Move to incremental.h.
2121 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2122 * symtab.h (Symbol_table::add_from_incrobj): New function.
2123 (Symbol_table::set_file_offset): New function.
2124
2125 2011-04-05 Cary Coutant <ccoutant@google.com>
2126
2127 * incremental-dump.cc (dump_incremental_inputs): Change signature
2128 to take a Sized_incremental_binary; change caller. Use readers
2129 in Sized_incremental_binary.
2130 * incremental.cc
2131 (Sized_incremental_binary::find_incremental_inputs_sections):
2132 Rename do_find_incremental_inputs_sections to this.
2133 (Sized_incremental_binary::setup_readers): New function.
2134 (Sized_incremental_binary::do_check_inputs): Check
2135 has_incremental_info_ flag; move setup code to setup_readers;
2136 use input readers.
2137 (Sized_incremental_binary::do_file_is_unchanged): New function.
2138 (Sized_incremental_binary::do_get_input_reader): New function.
2139 * incremental.h (class Incremental_binary): Move to end of file.
2140 (Incremental_binary::file_is_unchanged): New function.
2141 (Incremental_binary::do_file_is_unchanged): New function.
2142 (Incremental_binary::Input_reader): New class.
2143 (Incremental_binary::get_input_reader): New function.
2144 (class Sized_incremental_binary): Move to end of file.
2145 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2146 input section reader classes.
2147 (Sized_incremental_binary::has_incremental_info): New function.
2148 (Sized_incremental_binary::inputs_reader): New function.
2149 (Sized_incremental_binary::symtab_reader): New function.
2150 (Sized_incremental_binary::relocs_reader): New function.
2151 (Sized_incremental_binary::got_plt_reader): New function.
2152 (Sized_incremental_binary::do_file_is_unchanged): New function.
2153 (Sized_incremental_binary::Sized_input_reader): New class.
2154 (Sized_incremental_binary::get_input_reader): New function.
2155 (Sized_incremental_binary::find_incremental_inputs_sections):
2156 Rename do_find_incremental_inputs_sections to this.
2157 (Sized_incremental_binary::setup_readers): New function.
2158 (Sized_incremental_binary::has_incremental_info_): New data member.
2159 (Sized_incremental_binary::inputs_reader_): New data member.
2160 (Sized_incremental_binary::symtab_reader_): New data member.
2161 (Sized_incremental_binary::relocs_reader_): New data member.
2162 (Sized_incremental_binary::got_plt_reader_): New data member.
2163 (Sized_incremental_binary::current_input_file_): New data member.
2164
2165 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2166
2167 PR gold/12640
2168 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2169 violation.
2170
2171 2011-03-30 Cary Coutant <ccoutant@google.com>
2172
2173 * archive.cc (Archive::include_member): Adjust call to report_object.
2174 (Add_archive_symbols::run): Add script_info to call to
2175 report_archive_begin.
2176 (Lib_group::include_member): Adjust call to report_object.
2177 (Add_lib_group_symbols::run): Adjust call to report_object.
2178 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2179 blocks. Add object count for script input files.
2180 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2181 script_info parameter; change all callers.
2182 (Incremental_inputs::report_object): Add script_info parameter;
2183 change all callers.
2184 (Incremental_inputs::report_script): Store backpointer to
2185 incremental info entry.
2186 (Output_section_incremental_inputs::set_final_data_size): Record
2187 additional information for scripts.
2188 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2189 * incremental.h (Incremental_script_entry::add_object): New function.
2190 (Incremental_script_entry::get_object_count): New function.
2191 (Incremental_script_entry::get_object): New function.
2192 (Incremental_script_entry::objects_): New data member; adjust
2193 constructor.
2194 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2195 (Incremental_inputs::report_object): Add script_info parameter.
2196 (Incremental_inputs_reader::get_object_count): New function.
2197 (Incremental_inputs_reader::get_object_offset): New function.
2198 * options.cc (Input_arguments::add_file): Return reference to
2199 new input argument.
2200 * options.h (Input_argument::set_script_info): New function.
2201 (Input_argument::script_info): New function.
2202 (Input_argument::script_info_): New data member; adjust all
2203 constructors.
2204 (Input_file_group::add_file): Return reference to new input argument.
2205 (Input_file_lib::add_file): Likewise.
2206 (Input_arguments::add_file): Likewise.
2207 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2208 * script.cc (Parser_closure::Parser_closure): Add script_info
2209 parameter; adjust all callers.
2210 (Parser_closure::script_info): New function.
2211 (Parser_closure::script_info_): New data member.
2212 (read_input_script): Report scripts earlier to incremental info.
2213 (script_add_file): Set script_info in Input_argument.
2214 (script_add_library): Likewise.
2215 * script.h (Script_options::Script_info): Rewrite class.
2216
2217 2011-03-29 Cary Coutant <ccoutant@google.com>
2218
2219 * archive.cc (Library_base::should_include_member): Move
2220 method here from class Archive.
2221 (Archive::Archive): Initialize base class.
2222 (Archive::should_include_member): Move to base class.
2223 (Archive::do_for_all_unused_symbols): New function.
2224 (Add_archive_symbols::run): Remove redundant access to
2225 incremental_inputs.
2226 (Lib_group::Lib_group): Initialize base class.
2227 (Lib_group::do_filename): New function.
2228 (Lib_group::include_member): Pass pointer to Lib_group to
2229 report_object.
2230 (Lib_group::do_for_all_unused_symbols): New function.
2231 (Add_lib_group_symbols::run): Report archive information for
2232 incremental links.
2233 * archive.h (class Library_base): New base class.
2234 (class Archive): Derive from Library_base.
2235 (Archive::filename): Move to base class.
2236 (Archive::set_incremental_info): Likewise.
2237 (Archive::incremental_info): Likewise.
2238 (Archive::Should_include): Likewise.
2239 (Archive::should_include_member): Likewise.
2240 (Archive::Armap_entry): Remove.
2241 (Archive::Unused_symbol_iterator): Remove.
2242 (Archive::unused_symbols_begin): Remove.
2243 (Archive::unused_symbols_end): Remove.
2244 (Archive::do_filename): New function.
2245 (Archive::do_get_mtime): New function.
2246 (Archive::do_for_all_unused_symbols): New function.
2247 (Archive::task_): Move to base class.
2248 (Archive::incremental_info_): Likewise.
2249 (class Lib_group): Derive from Library_base.
2250 (Lib_group::do_filename): New function.
2251 (Lib_group::do_get_mtime): New function.
2252 (Lib_group::do_for_all_unused_symbols): New function.
2253 (Lib_group::task_): Move to base class.
2254 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2255 function.
2256 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2257 function.
2258 * incremental.cc (Incremental_inputs::report_archive_begin):
2259 Use Library_base; call library's get_mtime; add incremental inputs
2260 entry before members.
2261 (class Unused_symbol_visitor): New class.
2262 (Incremental_inputs::report_archive_end): Use Library_base; use
2263 visitor class to record unused symbols; don't add incremental inputs
2264 entry after members.
2265 (Incremental_inputs::report_object): Use Library_base.
2266 * incremental.h
2267 (Incremental_archive_entry::Incremental_archive_entry): Remove
2268 unused Archive parameter.
2269 (Incremental_inputs::report_archive_begin): Use Library_base.
2270 (Incremental_inputs::report_archive_end): Likewise.
2271 (Incremental_inputs::report_object): Likewise.
2272 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2273 function.
2274 * object.h (Object::for_all_global_symbols): New function.
2275 (Object::do_for_all_global_symbols): New function.
2276 (Sized_relobj::do_for_all_global_symbols): New function.
2277 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2278 function.
2279 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2280 function.
2281
2282 2011-03-27 Ian Lance Taylor <iant@google.com>
2283
2284 * archive.cc (Archive::interpret_header): Return -1 if something
2285 goes wrong. Change callers accordingly.
2286
2287 2011-03-25 Cary Coutant <ccoutant@google.com>
2288
2289 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2290 * testsuite/Makefile.in: Regenerate.
2291
2292 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
2293
2294 * plugin.cc (get_view): New.
2295 (Plugin::load): Pass get_view to the plugin.
2296 (Plugin_manager::get_view): New.
2297
2298 2011-03-21 Ian Lance Taylor <iant@google.com>
2299
2300 * testsuite/final_layout.sh: Rewrite to not use dc.
2301 * testsuite/relro_test.sh: Fail if dc is not present.
2302
2303 2011-03-21 Sriraman Tallam <tmsriram@google.com>
2304
2305 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2306 Change == to -eq.
2307 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2308 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2309 Change == to -eq.
2310 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2311 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2312
2313 2011-03-14 Ian Lance Taylor <iant@google.com>
2314
2315 * script-sections.cc (Sort_output_sections::script_compare):
2316 Rename from is_before, change return type.
2317 (Sort_output_sections::operator()): Adjust accordingly.
2318
2319 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2320
2321 PR gold/12572
2322 * testsuite/odr_violation2.cc: Add comment to make all error line
2323 numbers double digits.
2324 * testsuite/debug_msg.sh: Adjust expected errors.
2325
2326 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2327
2328 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2329 but mark earlier ones as non-canonical
2330 (offset_to_iterator): Update search target and example
2331 (do_addr2line): Return extra lines in a vector*
2332 (format_file_lineno): Extract from do_addr2line
2333 (one_addr2line): Add vector* out-param
2334 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2335 when a lineno entry appeared last for its instruction
2336 (Dwarf_line_info): Add vector* out-param
2337 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2338 * symtab.cc (Odr_violation_compare): Include the lineno in the
2339 comparison again.
2340 (linenos_from_loc): New. Combine the canonical line for an
2341 address with its other lines.
2342 (True_if_intersect): New. Helper functor to make
2343 std::set_intersection a query.
2344 (detect_odr_violations): Compare sets of lines instead of just
2345 one line for each function. This became less deterministic, but
2346 has fewer false positives.
2347 * symtab.h: Declarations.
2348 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2349 mix an optimized and non-optimized object in the same binary
2350 (odr_violation2.so): Same.
2351 * testsuite/Makefile.in: Regenerate from Makefile.am.
2352 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2353 * testsuite/debug_msg.sh: Update line numbers and add
2354 assertions.
2355 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2356 non-optimized context.
2357 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2358 isn't inlined, and use OdrDerived in an optimized context.
2359 * testsuite/odr_header1.h: Defines OdrDerived, where
2360 optimization will change the
2361 first-instruction-in-the-destructor's file and line number.
2362 * testsuite/odr_header2.h: Defines OdrBase.
2363
2364 2011-03-09 Ian Lance Taylor <iant@google.com>
2365
2366 * fileread.cc (File_read::clear_views): Don't delete the whole
2367 file view.
2368
2369 2011-03-08 Ian Lance Taylor <iant@google.com>
2370
2371 PR gold/12525
2372 * fileread.cc: #include <climits>.
2373 (GOLD_IOV_MAX): Define.
2374 (File_read::read_multiple): Limit number of entries by iov_max.
2375 * fileread.h (class File_read): Always set max_readv_entries to
2376 128.
2377
2378 2011-03-07 Ian Lance Taylor <iant@google.com>
2379
2380 PR gold/12525
2381 * options.h (class General_options): Add -dy and -dn.
2382
2383 2011-03-02 Cary Coutant <ccoutant@google.com>
2384
2385 * testsuite/script_test_9.t: Add TLS segment.
2386
2387 2011-03-02 Simon Baldwin <simonb@google.com>
2388
2389 * configure.ac: Add check for gnu_indirect_function support in
2390 the toolchain building binutils.
2391 * configure: Rebuild.
2392
2393 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
2394
2395 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2396 plugin only symbols.
2397 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2398 in plugin files as not needed in the symbol table.
2399
2400 2011-02-11 Sriraman Tallam <tmsriram@google.com>
2401
2402 * output.cc (Output_section::add_input_section): Delay fill
2403 generation for section ordering.
2404
2405 2011-02-09 Ian Lance Taylor <iant@google.com>
2406
2407 PR gold/12316
2408 * object.h (class Sized_relobj): Remove clear_local_symbols.
2409 * reloc.cc (Sized_relobj::do_relocate): Don't call
2410 clear_local_symbols.
2411
2412 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
2413
2414 * plugin.cc (is_visible_from_outside): Return true for symbols
2415 in the -u option.
2416
2417 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2418
2419 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2420 filename.
2421
2422 2011-02-02 Sriraman Tallam <tmsriram@google.com>
2423
2424 * icf.h (is_section_foldable_candidate): Change type of parameter
2425 to std::string.
2426 * icf.cc (Icf::find_identical_sections): Change type of local variable
2427 section_name to be std::string.
2428 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2429
2430 2011-01-25 Ian Lance Taylor <iant@google.com>
2431
2432 * script.cc (script_add_extern): Rewrite to use
2433 add_symbol_reference.
2434
2435 2011-01-25 Doug Kwan <dougkwan@google.com>
2436
2437 * icf.cc (get_section_contents): Always lock section's object.
2438
2439 2011-01-24 Ian Lance Taylor <iant@google.com>
2440
2441 * options.h (class General_options): Accept
2442 --no-detect-odr-violations.
2443
2444 2011-01-24 Ian Lance Taylor <iant@google.com>
2445
2446 * version.cc (version_string): Bump to 1.11.
2447
2448 2011-01-24 Ian Lance Taylor <iant@google.com>
2449
2450 * plugin.cc (class Plugin_rescan): Define new class.
2451 (Plugin_manager::claim_file): Set any_claimed_.
2452 (Plugin_manager::save_archive): New function.
2453 (Plugin_manager::save_input_group): New function.
2454 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2455 necessary.
2456 (Plugin_manager::new_undefined_symbol): New function.
2457 (Plugin_manager::rescan): New function.
2458 (Plugin_manager::rescannable_defines): New function.
2459 (Plugin_manager::add_input_file): Set any_added_.
2460 * plugin.h (class Plugin_manager): define new fields rescannable_,
2461 undefined_symbols_, any_claimed_, and any_added_. Declare
2462 Plugin_rescan as friend. Declare new functions.
2463 (Plugin_manager::Rescannable): Define type.
2464 (Plugin_manager::Rescannable_list): Define type.
2465 (Plugin_manager::Undefined_symbol_list): Define type.
2466 (Plugin_manager::Plugin_manager): Initialize new fields.
2467 * archive.cc (Archive::defines_symbol): New function.
2468 (Add_archive_symbols::run): Pass archive to plugins if any.
2469 * archive.h (class Archive): Declare defines_symbol.
2470 * readsyms.cc (Input_group::~Input_group): New function.
2471 (Finish_group::run): Pass input_group to plugins if any.
2472 * readsyms.h (class Input_group): Declare destructor.
2473 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2474 any.
2475
2476 2011-01-10 Ian Lance Taylor <iant@google.com>
2477
2478 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2479 section as relro.
2480 (Layout::set_segment_offsets): Reset increase_relro before calling
2481 set_section_addresses a second time.
2482
2483 2011-01-04 Cary Coutant <ccoutant@google.com>
2484
2485 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2486 sections before NOBITS sections.
2487
2488 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2489
2490 * version.cc (print_version): Update copyright to 2011.
2491
2492 2010-12-23 Cary Coutant <ccoutant@google.com>
2493
2494 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2495 of OS to this->add. Add OD parameter to second form of the function.
2496
2497 2010-12-20 Ian Lance Taylor <iant@google.com>
2498
2499 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2500 second of two consecutive entries with same offset.
2501
2502 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2503
2504 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2505 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2506 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2507 to avoid unneeded links against $(LDADD).
2508 * testsuite/Makefile.in: Regenerate.
2509
2510 2010-12-15 Ian Lance Taylor <iant@google.com>
2511
2512 PR gold/12324
2513 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2514 for R_X86_64_32 and R_X86_64_PC32.
2515 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2516 ver_matching_def_pic.o.
2517 (ver_matching_def_pic.o): New target.
2518
2519 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2520
2521 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2522 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2523 Move definition before File_read::View member definitions.
2524 (File_read::View::~View): Initialize and hold lock before
2525 updating current_mapped_bytes.
2526
2527 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2528
2529 * dwarf_reader.cc: Remove outdated comment.
2530 * gold-threads.cc: Fix typo in error message.
2531 * archive.cc: Fix typos in comments.
2532 * archive.h: Likewise.
2533 * arm-reloc-property.cc: Likewise.
2534 * arm-reloc-property.h: Likewise.
2535 * arm-reloc.def: Likewise.
2536 * arm.cc: Likewise.
2537 * attributes.h: Likewise.
2538 * cref.cc: Likewise.
2539 * ehframe.cc: Likewise.
2540 * fileread.h: Likewise.
2541 * gold.h: Likewise.
2542 * i386.cc: Likewise.
2543 * icf.cc: Likewise.
2544 * incremental.h: Likewise.
2545 * int_encoding.cc: Likewise.
2546 * layout.h: Likewise.
2547 * main.cc: Likewise.
2548 * merge.h: Likewise.
2549 * object.cc: Likewise.
2550 * object.h: Likewise.
2551 * options.cc: Likewise.
2552 * readsyms.cc: Likewise.
2553 * reduced_debug_output.cc: Likewise.
2554 * reloc.cc: Likewise.
2555 * script-sections.cc: Likewise.
2556 * sparc.cc: Likewise.
2557 * symtab.h: Likewise.
2558 * target-reloc.h: Likewise.
2559 * target.cc: Likewise.
2560 * target.h: Likewise.
2561 * timer.cc: Likewise.
2562 * timer.h: Likewise.
2563 * x86_64.cc: Likewise.
2564
2565 2010-12-09 Cary Coutant <ccoutant@google.com>
2566
2567 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2568 stack.
2569 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2570 parameter; change all callers.
2571 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2572 * options.h (warn_execstack): New option.
2573
2574 2010-12-07 Doug Kwan <dougkwan@google.com>
2575
2576 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2577 like function call relocations.
2578
2579 2010-12-07 Ian Lance Taylor <iant@google.com>
2580
2581 * archive.cc (Archive::get_elf_object_for_member): Permit
2582 punconfigured to be NULL.
2583 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2584 (Archive::include_member): Pass NULL to get_elf_object_for_member
2585 if we searched for the archive and this is the first included
2586 object.
2587
2588 2010-12-01 Ian Lance Taylor <iant@google.com>
2589
2590 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2591 track_relocs_type_ field.
2592 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2593 Set track_relocs_type_.
2594 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2595 contents when using RELA relocs.
2596 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2597 reloc_map_.
2598 * reloc.cc (Track_relocs::next_addend): New function.
2599 * reloc.h (class Track_relocs): Declare next_addend.
2600
2601 2010-12-01 Ian Lance Taylor <iant@google.com>
2602
2603 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2604 virtual destructor.
2605
2606 2010-12-01 Ian Lance Taylor <iant@google.com>
2607
2608 * README: Update compilers known to work and fail.
2609
2610 2010-11-23 Matthias Klose <doko@ubuntu.com>
2611
2612 * configure.in: For --enable-gold, handle value `default' instead of
2613 `both*'. Always install ld as ld.bfd, install as ld if gold is
2614 not the default.
2615 * configure: Regenerate.
2616
2617 2010-11-18 Doug Kwan <dougkwan@google.com>
2618
2619 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2620 and right_alignment to be zero. Store result alignment only if it is
2621 greater than existing alignment.
2622
2623 2010-11-16 Cary Coutant <ccoutant@google.com>
2624
2625 PR gold/12220
2626 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2627 Check for ".zdebug_line".
2628
2629 2010-11-16 Doug Kwan <dougkwan@google.com>
2630 Cary Coutant <ccoutant@google.com>
2631
2632 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2633 by reference; adjust all callers.
2634 * output.cc (Output_segment::set_section_addresses): Adjust references
2635 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2636 list is empty.
2637 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2638 end at page boundary.
2639
2640 2010-11-16 Cary Coutant <ccoutant@google.com>
2641
2642 PR gold/12220
2643 * layout.cc (Layout::choose_output_section): Transform names of
2644 compressed sections even when using a script with a SECTIONS clause.
2645 (Layout::output_section_name): Remove code to transform
2646 compressed debug section names.
2647 * output.cc (Output_section::add_input_section): Use uncompressed
2648 section size when tracking input sections.
2649
2650 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2651
2652 * symtab.h (Symbol::NON_PIC_REF): Remove.
2653 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2654 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2655 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2656 (Symbol::use_plt_offset): Take a flags argument and pass it
2657 directly to needs_dynamic_reloc. Restrict check for undefined
2658 weak symbols to function calls.
2659 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2660 (Target_arm::Scan::global): Use it.
2661 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2662 (Target_arm::Relocate::relocate): Likewise.
2663 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2664 parameter with an r_type parameter. Use get_reference_flags
2665 to get the flags.
2666 (Target_arm::Relocate::relocate): Update accordingly.
2667 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2668 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2669 (Target_i386::Scan::global): Likewise.
2670 (Target_i386::Relocate::relocate): Likewise.
2671 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2672 parameter with an r_type parameter. Use get_reference_flags
2673 to get the flags.
2674 (Target_i386::Relocate::relocate): Update accordingly.
2675 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2676 (Target_powerpc::Scan::global): Use it.
2677 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2678 (Target_powerpc::Relocate::relocate): Likewise.
2679 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2680 (Target_sparc::Scan::global): Use it.
2681 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2682 (Target_sparc::Relocate::relocate): Likewise.
2683 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2684 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2685 (Target_x86_64::Scan::global): Likewise.
2686 (Target_x86_64::Relocate::relocate): Likewise.
2687
2688 2010-11-08 Doug Kwan <dougkwan@google.com>
2689 Cary Coutant <ccoutant@google.com>
2690
2691 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2692 (Arm_exidx_merge_section::section_contents_): New data member.
2693 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2694 (Arm_input_section::~Arm_input_section): De-allocate memory.
2695 (Arm_input_section::original_contents_): New data member.
2696 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2697 in parameters instead of calling Object::section_contents without
2698 locking.
2699 (Arm_output_section::group_section): New parameter TASK. Pass it
2700 to callees that need locking objects.
2701 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2702 to lock EXIDX input sections. Fix a formatting issue. Call
2703 Arm_exidx_merged_section::build_contents to create merged section
2704 contents.
2705 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2706 to lock object of stub table owner.
2707 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2708 TEXT_SIZE to initialize data member TEXT_SIZE_.
2709 (Arm_exidx_input_section::addralign): Fix typo in comment.
2710 (Arm_exidx_input_section::text_size): New method.
2711 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2712 that require locking objects. Lock objects before scanning for stubs
2713 and updating local symbols.
2714 (Arm_input_section<big_endian>::init): Copy contents of original
2715 input section.
2716 (Arm_input_section<big_endian>::do_write): Use saved contents of
2717 original input section instead of calling Object::section_contents
2718 without locking.
2719 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2720 size without calling Object::section_size().
2721 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2722 for size. Allocate a buffer for merged EXIDX entries.
2723 (Arm_exidx_merged_section::build_contents): New method.
2724 (Arm_exidx_merged_section::do_write): Move merge section contents
2725 building code to Arm_exidx_merged_section::build_contetns. Write
2726 out contetns in buffer instead of building it on the fly.
2727 (Arm_relobj::make_exidx_input_section): Also pass text section size
2728 to Arm_exidx_input_section constructor.
2729 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2730 (Arm_dynobj::do_read_symbols): Fix memory leak.
2731 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2732 * target.h: (class Task): Add forward declaration.
2733 (Target::relax): Add new parameter TASK and pass it to
2734 Target::do_relax().
2735 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2736
2737 2010-11-05 Cary Coutant <ccoutant@google.com>
2738
2739 PR gold/10708
2740 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2741 object when reading from the file.
2742 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2743 second layout pass.
2744 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2745 when reading section contents.
2746 (get_section_contents): Likewise.
2747 (icf::find_identical_sections): Likewise.
2748 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2749 object when reading from the file.
2750 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2751 the object when doing deferred section layout.
2752
2753 2010-11-03 Nick Clifton <nickc@redhat.com>
2754
2755 PR gold/12001
2756 * script.h (class Symbol_assignment: name): New member. Returns
2757 the name of the symbol.
2758 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2759 Returns true if the given symbol name is on the list of
2760 assignments wating to be processed.
2761 * archive.cc (should_incldue_member): If the symbol is undefined,
2762 check to see if it is on the list of symbols pending assignment.
2763
2764 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2765
2766 * script-sections.cc (Script_sections::find_memory_region): Check
2767 for a NULL output section pointer.
2768
2769 2010-10-29 Doug Kwan <dougkwan@google.com>
2770
2771 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2772 Output_section::add_relaxed_input_section.
2773 * output.cc (Output_section::add_relaxed_input_section): Add new
2774 arguments LAYOUT and NAME. Set section order index.
2775 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2776 Copy section order index.
2777 * output.h (Output_section::add_relaxed_input_section): Add new
2778 arguments LAYOUT and NAME.
2779
2780 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2781
2782 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2783 NATIVE_OR_CROSS_LINKER.
2784 * testsuite/Makefile.in: Regenerate.
2785
2786 2010-10-20 Doug Kwan <dougkwan@google.com>
2787
2788 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2789 without SHF_LINK_ORDER flags.
2790 * layout.cc (Layout::choose_output_section): Do not filter
2791 SHF_LINK_ORDER flag in a relocatable link.
2792
2793 2010-10-17 Cary Coutant <ccoutant@google.com>
2794
2795 * output.h (Output_segment::set_section_addresses): Change function
2796 signature. Update all callers.
2797 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2798 sections.
2799 (Output_segment::set_section_addresses): Align after last TLS
2800 section. Add padding before last relro section instead of after.
2801
2802 2010-10-17 Doug Kwan <dougkwan@google.com>
2803
2804 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2805 GOT output section to be writable.
2806
2807 2010-10-14 Cary Coutant <ccoutant@google.com>
2808
2809 * debug.h (DEBUG_INCREMENTAL): New flag.
2810 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2811 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2812 mode.
2813 * incremental.cc (report_command_line): Ignore all forms of
2814 --incremental.
2815 * layout.cc (Layout::Layout): Check parameters for incremental link
2816 mode.
2817 * options.cc (General_options::parse_incremental): New function.
2818 (General_options::parse_no_incremental): New function.
2819 (General_options::parse_incremental_full): New function.
2820 (General_options::parse_incremental_update): New function.
2821 (General_options::incremental_mode_): New data member.
2822 (General_options::finalize): Check incremental_mode_.
2823 * options.h (General_options): Update help text for --incremental.
2824 Add --no-incremental, --incremental-full, --incremental-update.
2825 (General_options::Incremental_mode): New enum type.
2826 (General_options::incremental_mode): New function.
2827 (General_options::incremental_mode_): New data member.
2828 * parameters.cc (Parameters::incremental_mode_): New data member.
2829 (Parameters::set_options): Set incremental_mode_.
2830 (Parameters::set_incremental_full): New function.
2831 (Parameters::incremental): New function.
2832 (Parameters::incremental_update): New function.
2833 (set_parameters_incremental_full): New function.
2834 * parameters.h (Parameters::set_incremental_full): New function.
2835 (Parameters::incremental): New function.
2836 (Parameters::incremental_update): New function.
2837 (Parameters::incremental_mode_): New data member.
2838 (set_parameters_incremental_full): New function.
2839 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2840 incremental link mode.
2841 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2842 (Sized_relobj::do_relocate_sections): Likewise.
2843 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2844 option.
2845 * testsuite/Makefile.in: Regenerate.
2846 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2847
2848 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2849
2850 * script-sections.h (class Script_sections): Make
2851 Sections_elements typedef public.
2852 * script-sections.cc (class Sort_output_sections): Add elements_
2853 field. Add constructor which sets it; change all callers.
2854 (Sort_output_sections::is_before): New function.
2855 (Sort_output_sections::operator()): Call is_before.
2856 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2857 conditional.
2858 * testsuite/script_test_10.sh: New test. Test script section
2859 order.
2860 * testsuite/script_test_10.t: Likewise.
2861 * testsuite/script_test_10.s: Likewise.
2862 * testsuite/Makefile.am: Wrap the cross linker tests and the
2863 common tests into NATIVE_OR_CROSS_LINKER.
2864 (check_SCRIPTS): Add script_test_10.sh.
2865 (check_DATA): Add script_test_10.stdout.
2866 (script_test_10.o, script_test_10): New targets.
2867 (script_test_10.stdout): New target.
2868 * configure, testsuite/Makefile.in: Regenerate.
2869
2870 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2871
2872 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2873 error for the deprecated relocations.
2874 (Target_arm::Scan::global): Likewise.
2875 (Target_arm::Relocate::relocate): Likewise.
2876
2877 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2878
2879 * fileread.cc (Input_file::find_file): Initialize *found_name
2880 and *namep when using the fallback search for case 4.
2881
2882 2010-10-11 Cary Coutant <ccoutant@google.com>
2883
2884 * options.h (class General_options): Redefine -z lazy as an alias for
2885 the negation of -z now.
2886
2887 2010-10-11 Ian Lance Taylor <iant@google.com>
2888
2889 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2890 binding.
2891
2892 2010-10-06 Nick Clifton <nickc@redhat.com>
2893
2894 * script-sections.cc(class Memory_region): Remove
2895 current_lma_offset_ field. Rename current_vma_offset_ to
2896 current_offset_. Add last_section_ field.
2897 (Memory_region::get_current_vma_address): Rename to
2898 get_current_address.
2899 (Memory_region::get_current_lma_address): Delete.
2900 (Memory_region::increment_vma_offset): Rename to
2901 increment_offset.
2902 (Memory_region::increment_lma_offset): Delete.
2903 (Memory_region::attributes_compatible): New method. Returns
2904 true if the provided section is compatible with the region.
2905 (Memory_region::get_last_section): New method. Returns the last
2906 section to use the region.
2907 (Memory_region::set_last_section): New method. Stores the last
2908 section to use the region.
2909 (Script_sections::block_in_region): New method. Returns true if
2910 a block of memory is contained within a region.
2911 (Script_sections::find_memory_region): New method. Locates a
2912 memory region to be used to set a VMA or LMA address.
2913 (Output_section_definition::set_section_addresses): Add code to
2914 check for addresses set by memory regions.
2915 (Output_segment::set_section_addresses): Remove memory region
2916 walking code.
2917 (Script_sections::create_segment): Add a warning if a header
2918 segment is created outside of any region.
2919 * script-sections.h (class Script_sections): Add prototypes for
2920 find_memory_region and block_in_region methods.
2921 * testsuite/memory_test.s: Use .long instead of .word.
2922 * testsuite/memory_test.t: Add some more output sections.
2923 * testsuite/memory_test.sh: Update expected output.
2924
2925 2010-10-02 Doug Kwan <dougkwan@google.com>
2926
2927 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2928 defintion to symtab.h
2929 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2930 declaration to defintion.
2931
2932 2010-10-01 Nick Clifton <nickc@redhat.com>
2933
2934 * expression.cc (eval): Replace dummy argument with NULL.
2935 (eval_maybe_dot): Check for a NULL result section pointer.
2936 (Symbol_expression::value): Likewise.
2937 (Dot_expression::value): Likewise.
2938 (BINARY_EXPRESSION): Likewise.
2939 (Max_expression::value): Likewise.
2940 (Min_expression::value): Likewise.
2941 (Absolute_expression::value): Likewise.
2942 (Addr_expression::value_from_output_section): Likewise.
2943 (Loaddddr_expression::value_from_output_section): Likewise.
2944 (Segment_start_expression::value): Likewise.
2945 * script-sections.cc
2946 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2947 argument with NULL.
2948 (Sections_elememt_dot_assignment::set_section_addresses):
2949 Likewise.
2950 (Output_data_expression::do_write_to_buffer): Likewise.
2951 (Output_section_definition::finalize_symbols): Likewise.
2952 (Output_section_definition::set_section_addresses): Likewise.
2953
2954 2010-09-30 Doug Kwan <dougkwan@google.com>
2955
2956 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2957
2958 2010-09-28 Sriraman Tallam <tmsriram@google.com>
2959
2960 * target.h (Target::can_icf_inline_merge_sections): New virtual
2961 function.
2962 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2963 virtual function.
2964 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2965 virtual function.
2966 * icf.cc (get_section_contents): Inline merge sections only when
2967 target allows it.
2968
2969 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2970
2971 * configure: Regenerate.
2972
2973 2010-09-17 Ian Lance Taylor <iant@google.com>
2974
2975 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
2976 * testsuite/Makefile.am (memory_test.o): New target.
2977 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2978 memory_test.t.
2979 * testsuite/Makefile.in: Rebuild.
2980
2981 2010-09-17 Doug Kwan <dougkwan@google.com>
2982
2983 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2984 defintion if relocation uses GOT entries of the symbol.
2985 * testsuite/icf_safe_test.sh: Fix test.
2986 * testsuite/icf_safe_so_test.sh: Fix test.
2987
2988 2010-09-16 Cary Coutant <ccoutant@google.com>
2989
2990 * script_sections.cc (class Memory_region): Remove "NULL" from
2991 vector initializations.
2992
2993 2010-09-15 Cary Coutant <ccoutant@google.com>
2994
2995 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2996 Resolve forwarding symbols.
2997
2998 2010-09-15 Doug Kwan <dougkwan@google.com>
2999
3000 * gold/testsuite/script_test_3.t: Add ARM special sections.
3001 * gold/testsuite/script_test_4.t: Same.
3002 * gold/testsuite/script_test_5.t: Same.
3003 * gold/testsuite/script_test_6.t: Same.
3004 * gold/testsuite/script_test_7.t: Same.
3005 * gold/testsuite/script_test_7.t: Same.
3006 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3007
3008 2010-09-14 Cary Coutant <ccoutant@google.com>
3009
3010 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3011 (Target_x86_64::Relocate::relocate_tls): Replace check for
3012 saw_tls_block_reloc_ with test for executable section.
3013
3014 2010-09-12 Cary Coutant <ccoutant@google.com>
3015
3016 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3017 position-independent executables to shared libraries need dynamic
3018 relocations.
3019 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3020 position-independent executables.
3021 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3022 * testsuite/Makefile.in: Regenerate.
3023
3024 2010-09-10 Nick Clifton <nickc@redhat.com>
3025
3026 PR gold/11997
3027 * testsuite/memory_test.t: Discard any sections that are not
3028 needed.
3029
3030 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3031
3032 PR gold/11996
3033 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3034 "This::" to work around a bug in gcc 4.2.
3035
3036 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3037
3038 2010-09-09 Rafael Espindola <espindola@google.com>
3039
3040 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3041 sections with different PF_X flags in the same segment.
3042 (Layout::find_first_load_seg): Search all segments to find the first
3043 one.
3044 * options.h (rosegment): New.
3045
3046 2010-09-08 Rafael Espindola <espindola@google.com>
3047
3048 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
3049
3050 2010-09-08 Doug Kwan <dougkwan@google.com>
3051
3052 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3053 (Arm_relobj::do_relocate_sections): Add new parameter for output
3054 file to match the parent.
3055 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3056 of local symbols instead of input values. Update code to track
3057 changes in gold::relocate_section.
3058 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3059 (Sized_relobj::compute_final_local_value_internal): New methods.
3060 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3061 body into private version of Sized_relobj::compute_final_local_value.
3062 Call the inline method.
3063 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3064 merged symbol value if there is one.
3065 (Symbol_value::has_output_value): New method defintiion.
3066 (Sized_relobj::Compute_final_local_value_status): New enum type.
3067 (Sized_relobj::compute_final_local_value): New methods.
3068 (Sized_relobj::compute_final_local_value_internal): New methods.
3069 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3070 and arm_cortex_a8.sh.
3071 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3072 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3073 New tests.
3074 * Makefile.in: Regenerate.
3075 * testsuite/arm_bl_out_of_range.s: Update test.
3076 * testsuite/thumb_bl_out_of_range.s: Ditto.
3077 * testsuite/thumb_blx_out_of_range.s: Ditto.
3078 * testsuite/arm_branch_out_of_range.sh: New file.
3079 * testsuite/arm_cortex_a8.sh: Ditto.
3080 * testsuite/arm_cortex_a8_b.s: Ditto.
3081 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3082 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3083 * testsuite/arm_cortex_a8_bl.s: Ditto.
3084 * testsuite/arm_cortex_a8_blx.s: Ditto.
3085 * testsuite/arm_cortex_a8_local.s: Ditto.
3086 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3087 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3088
3089 2010-09-08 Rafael Espindola <espindola@google.com>
3090
3091 * Makefile.am (memory_test.stdout): Run readelf with -W.
3092 * Makefile.in: Regenerate.
3093 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3094 64 bit output.
3095
3096 2010-09-08 Rafael Espindola <espindola@google.com>
3097
3098 * script-sections.cc (Script_sections::add_memory_region): Convert
3099 field precision to int.
3100 * script.cc (script_set_section_region, script_set_section_region):
3101 Convert field precision to int.
3102
3103 2010-09-08 Rafael Espindola <espindola@google.com>
3104
3105 * arm.cc (do_finalize_sections): Create the __exidx_start and
3106 __exdix_end symbols even when the section is missing.
3107
3108 2010-09-08 Nick Clifton <nickc@redhat.com>
3109
3110 * README: Remove claim that MEMORY is not supported.
3111 * expression.cc (script_exp_function_origin)
3112 (script_exp_function_length): Move from here to ...
3113 * script.cc: ... here.
3114 (script_set_section_region, script_add_memory)
3115 (script_parse_memory_attr, script_include_directive): New
3116 functions.
3117 * script-sections.cc
3118 (class Memory_region): New class.
3119 (class Output_section_definition): Add set_memory_region,
3120 set_section_vma, set_section_lma and get_section_name methods.
3121 (class Script_Sections): Add add_memory_region,
3122 find_memory_region, find_memory_region_origin,
3123 find_memory_region_length and set_memory_region methods.
3124 Have set_section_addresses method walk the list of set memory
3125 regions.
3126 Extend the print methos to display memory regions.
3127 * script-sections.h: Add prototypes for new methods.
3128 Add enum for MEMORY region attributes.
3129 * yyscript.y: Add support for parsing MEMORY regions.
3130 * script-c.h: Add prototypes for new functions.
3131 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3132 * testsuite/Makefile.in: Regenerate.
3133 * testsuite/memory_test.sh: New script.
3134 * testsuite/memory_test.s: New assembler source file.
3135 * testsuite/memory_test.t: New linker script.
3136
3137 2010-08-27 Doug Kwan <dougkwan@google.com>
3138
3139 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3140 reference override an existing dynamic weak reference.
3141 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3142 * testsuite/Makefile.in: Regenerate.
3143 * testsuite/dyn_weak_ref.sh: New file.
3144 * testsuite/dyn_weak_ref_1.c: Ditto.
3145 * testsuite/dyn_weak_ref_2.c: Ditto.
3146
3147 2010-08-27 Ian Lance Taylor <iant@google.com>
3148
3149 * incremental.h (class Incremental_input_entry): Add virtual
3150 destructor.
3151
3152 2010-08-27 Ian Lance Taylor <iant@google.com>
3153
3154 * testsuite/start_lib_test_3.c: Mark t3 as used.
3155
3156 2010-08-27 Nick Clifton <nickc@redhat.com>
3157
3158 * options.cc (version_script): Fix small typo in previous
3159 whitespace tidyup.
3160
3161 2010-08-25 Nick Clifton <nickc@redhat.com>
3162
3163 * archive.cc: Formatting fixes: Remove whitespace between
3164 typename and following asterisk. Remove whitespace between
3165 function name and opening parenthesis.
3166 * archive.h: Likewise.
3167 * arm.cc: Likewise.
3168 * attributes.cc: Likewise.
3169 * attributes.h: Likewise.
3170 * common.cc: Likewise.
3171 * copy-relocs.cc: Likewise.
3172 * dirsearch.h: Likewise.
3173 * dynobj.cc: Likewise.
3174 * ehframe.cc: Likewise.
3175 * ehframe.h: Likewise.
3176 * expression.cc: Likewise.
3177 * fileread.cc: Likewise.
3178 * fileread.h: Likewise.
3179 * gc.h: Likewise.
3180 * gold-threads.cc: Likewise.
3181 * gold.cc: Likewise.
3182 * i386.cc: Likewise.
3183 * icf.h: Likewise.
3184 * incremental-dump.cc: Likewise.
3185 * incremental.cc: Likewise.
3186 * layout.cc: Likewise.
3187 * layout.h: Likewise.
3188 * main.cc: Likewise.
3189 * merge.cc: Likewise.
3190 * merge.h: Likewise.
3191 * object.cc: Likewise.
3192 * object.h: Likewise.
3193 * options.cc: Likewise.
3194 * options.h: Likewise.
3195 * output.cc: Likewise.
3196 * output.h: Likewise.
3197 * plugin.cc: Likewise.
3198 * plugin.h: Likewise.
3199 * powerpc.cc: Likewise.
3200 * reloc.cc: Likewise.
3201 * script-c.h: Likewise.
3202 * script-sections.cc: Likewise.
3203 * script.cc: Likewise.
3204 * stringpool.cc: Likewise.
3205 * symtab.cc: Likewise.
3206 * symtab.h: Likewise.
3207 * target.cc: Likewise.
3208 * timer.cc: Likewise.
3209 * timer.h: Likewise.
3210 * version.cc: Likewise.
3211 * x86_64.cc: Likewise.
3212
3213 2010-08-24 Nick Clifton <nickc@redhat.com>
3214
3215 PR 11899
3216 * layout.cc (segment_precedes): Sort segments by their physical
3217 addresses, if they have been set.
3218
3219 2010-08-23 Cary Coutant <ccoutant@google.com>
3220
3221 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3222 symbols data.
3223 (Lib_group::include_member): Unlock object after deleting its
3224 symbols data.
3225 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3226 the bug fixed here.
3227
3228 2010-08-19 Neil Vachharajani <nvachhar@google.com>
3229 Cary Coutant <ccoutant@google.com>
3230
3231 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3232 constructor, and set_blocker.
3233 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3234 readsyms_blocker_.
3235 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3236 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3237 * testsuite/Makefile.am (start_lib_test): New test case.
3238 * testsuite/Makefile.in: Regenerate.
3239 * testsuite/start_lib_test_main.c: New file.
3240 * testsuite/start_lib_test_1.c: New file.
3241 * testsuite/start_lib_test_2.c: New file.
3242 * testsuite/start_lib_test_3.c: New file.
3243
3244 2010-08-19 Ian Lance Taylor <iant@google.com>
3245
3246 * Makefile.in: Rebuild with automake 1.11.1.
3247 * aclocal.m4: Likewise.
3248 * testsuite/Makefile.in: Likewise.
3249
3250 2010-08-19 Ian Lance Taylor <iant@google.com>
3251
3252 PR 10893
3253 * i386.cc (class Output_data_plt_i386): Update declarations.
3254 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3255 local_ifuncs_ fields.
3256 (Target_i386::do_plt_section_for_global): New function.
3257 (Target_i386::do_plt_section_for_local): New function.
3258 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3259 parameter; change all callers. Initialize global_ifuncs_ and
3260 local_ifuncs_. If doing a static link define __rel_iplt_start and
3261 __rel_iplt_end.
3262 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3263 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3264 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3265 symbols.
3266 (Target_i386::make_plt_section): New function, broken out of
3267 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3268 (Target_i386::make_plt_entry): Call make_plt_section.
3269 (Target_i386::make_local_ifunc_plt_entry): New function.
3270 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3271 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3272 R_386_IRELATIVE to switch.
3273 (Target_i386::Scan::global): Likewise.
3274 (Target_i386::Relocate::relocate): Likewise.
3275 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3276 switch.
3277 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3278 (Target_x86_64::do_plt_section_for_global): New function.
3279 (Target_x86_64::do_plt_section_for_local): New function.
3280 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3281 parameter; change all callers. If doing a static link define
3282 __rela_iplt_start and __rela_iplt_end.
3283 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3284 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3285 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3286 to point to .plt.
3287 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3288 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3289 switch.
3290 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3291 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3292 R_X86_64_IRELATIVE to switch.
3293 (Target_x86_64::Scan::global): Likewise.
3294 (Target_x86_64::Relocate::relocate): Likewise.
3295 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3296 switch.
3297 * target.h (class Target): Add plt_section_for_global and
3298 plt_section_for_local functions. Add do_plt_section_for_global
3299 and do_plt_section_for_local virtual functions.
3300 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3301 clarifying comments.
3302 (Symbol::use_plt_offset): Handle IFUNC symbol.
3303 * object.cc (Sized_relobj::Sized_relobj): Initialize
3304 local_plt_offsets_.
3305 (Sized_relobj::local_has_plt_offset): New function.
3306 (Sized_relobj::local_plt_offset): New function.
3307 (Sized_relobj::set_local_plt_offset): New function.
3308 (Sized_relobj::do_count): Handle IFUNC symbol.
3309 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3310 a bit away from input_shndx_ field. Add set_is_func_symbol and
3311 is_ifunc_symbol functions.
3312 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3313 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3314 local_plt_offsets_ field.
3315 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3316 * output.h (class Output_section_data): Add non-const
3317 output_section function.
3318 (class Output_data_got): Update declarations.
3319 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3320 Add use_plt_offset parameter to global and local constructors.
3321 Change all callers. Change local_sym_index_ field to 31 bits.
3322 Change GSYM_CODE and CONSTANT_CODE accordingly.
3323 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3324 doing a static link don't set sh_link field.
3325 (Output_data_got::Got_entry::write): Use PLT offset if
3326 appropriate.
3327 (Output_data_got::add_global_plt): New function.
3328 (Output_data_got::add_local_plt): New function.
3329 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3330 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3331 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3332 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3333 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3334 IFUNC conditional.
3335 * testsuite/ifunc-sel.h: New file.
3336 * testsuite/ifuncmain1.c: New file.
3337 * testsuite/ifuncmain1vis.c: New file.
3338 * testsuite/ifuncmod1.c: New file.
3339 * testsuite/ifuncdep2.c: New file.
3340 * testsuite/ifuncmain2.c: New file.
3341 * testsuite/ifuncmain3.c: New file.
3342 * testsuite/ifuncmod3.c: New file.
3343 * testsuite/ifuncmain4.c: New file.
3344 * testsuite/ifuncmain5.c: New file.
3345 * testsuite/ifuncmod5.c: New file.
3346 * testsuite/ifuncmain6pie.c: New file.
3347 * testsuite/ifuncmod6.c: New file.
3348 * testsuite/ifuncmain7.c: New file.
3349 * configure, testsuite/Makefile.in: Rebuild.
3350
3351 2010-08-18 Ian Lance Taylor <iant@google.com>
3352
3353 * incremental.cc
3354 (Output_section_incremental_inputs::write_input_files): Add cast
3355 to avoid signed/unsigned comparison warning.
3356 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3357
3358 2010-08-12 Cary Coutant <ccoutant@google.com>
3359
3360 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3361
3362 2010-08-13 Ian Lance Taylor <iant@google.com>
3363
3364 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3365
3366 2010-08-12 Cary Coutant <ccoutant@google.com>
3367 Doug Kwan <dougkwan@google.com>
3368
3369 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3370 defintion overrides non-weak undef, remember that the original undef
3371 is not weak.
3372 * symtab.cc (Symbol_table::sized_write_global): For undef without
3373 an original weak binding, set binding to global in output.
3374 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3375 * testsuite/Makefile.in: Regenerate.
3376 * testsuite/strong_ref_weak_def.sh: New file.
3377 * testsuite/strong_ref_weak_def_1.c: Ditto.
3378 * testsuite/strong_ref_weak_def_2.c: Ditto.
3379
3380 2010-08-12 Cary Coutant <ccoutant@google.com>
3381
3382 * testsuite/incremental_test.sh: Rewrite.
3383 * testsuite/incremental_test_1.c: Rewrite.
3384 * testsuite/incremental_test_2.c: Rewrite.
3385
3386 2010-08-12 Cary Coutant <ccoutant@google.com>
3387
3388 * arm.cc (Target_arm::got_size): Add const.
3389 (Target_arm::got_entry_count): New function.
3390 (Target_arm::plt_entry_count): New function.
3391 (Target_arm::first_plt_entry_offset): New function.
3392 (Target_arm::plt_entry_size): New function.
3393 (Output_data_plt_arm::entry_count): New function.
3394 (Output_data_plt_arm::first_plt_entry_offset): New function.
3395 (Output_data_plt_arm::get_plt_entry_size): New function.
3396 * i386.cc (Target_i386::got_size): Add const.
3397 (Target_i386::got_entry_count): New function.
3398 (Target_i386::plt_entry_count): New function.
3399 (Target_i386::first_plt_entry_offset): New function.
3400 (Target_i386::plt_entry_size): New function.
3401 (Output_data_plt_i386::entry_count): New function.
3402 (Output_data_plt_i386::first_plt_entry_offset): New function.
3403 (Output_data_plt_i386::get_plt_entry_size): New function.
3404 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3405 find_incremental_inputs_sections. Dump incremental_got_plt section.
3406 * incremental.cc: Include target.h.
3407 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3408 parameter. Adjust all callers. Find incremental_got_plt section.
3409 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3410 section.
3411 (Output_section_incremental_inputs::set_final_data_size): Calculate
3412 size of incremental_got_plt section.
3413 (Output_section_incremental_inputs::do_write): Write the
3414 incremental_got_plt section.
3415 (Got_plt_view_info): New struct.
3416 (Local_got_offset_visitor): New class.
3417 (Global_got_offset_visitor): New class.
3418 (Global_symbol_visitor_got_plt): New class.
3419 (Output_section_incremental_inputs::write_got_plt): New function.
3420 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3421 Add parameter. Adjust all callers.
3422 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3423 (Incremental_inputs::got_plt_section): New function.
3424 (Incremental_inputs::got_plt_section_): New data member.
3425 (Incremental_got_plt_reader): New class.
3426 * layout.cc (Layout::create_incremental_info_sections): Add the
3427 incremental_got_plt section.
3428 * object.h (Got_offset_list::get_list): New function.
3429 (Got offset_list::for_all_got_offsets): New function.
3430 (Sized_relobj::local_got_offset_list): New function.
3431 * powerpc.cc (Target_powerpc::got_size): Add const.
3432 (Target_powerpc::got_entry_count): New function.
3433 (Target_powerpc::plt_entry_count): New function.
3434 (Target_powerpc::first_plt_entry_offset): New function.
3435 (Target_powerpc::plt_entry_size): New function.
3436 (Output_data_plt_powerpc::entry_count): New function.
3437 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3438 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3439 * sparc.cc (Target_sparc::got_size): Add const.
3440 (Target_sparc::got_entry_count): New function.
3441 (Target_sparc::plt_entry_count): New function.
3442 (Target_sparc::first_plt_entry_offset): New function.
3443 (Target_sparc::plt_entry_size): New function.
3444 (Output_data_plt_sparc::entry_count): New function.
3445 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3446 (Output_data_plt_sparc::get_plt_entry_size): New function.
3447 * symtab.h (Symbol::got_offset_list): New function.
3448 (Symbol_table::for_all_symbols): New function.
3449 * target.h (Sized_target::got_entry_count): New function.
3450 (Sized_target::plt_entry_count): New function.
3451 (Sized_target::plt_entry_size): New function.
3452 * x86_64.cc (Target_x86_64::got_size): Add const.
3453 (Target_x86_64::got_entry_count): New function.
3454 (Target_x86_64::plt_entry_count): New function.
3455 (Target_x86_64::first_plt_entry_offset): New function.
3456 (Target_x86_64::plt_entry_size): New function.
3457 (Output_data_plt_x86_64::entry_count): New function.
3458 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3459 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3460
3461 2010-08-12 Cary Coutant <ccoutant@google.com>
3462
3463 * archive.cc: Include incremental.h.
3464 (Archive::Archive): Initialize incremental_info_.
3465 (Archive::include_member): Record archive members in incremental info.
3466 (Add_archive_symbols::run): Record begin and end of an archive in
3467 incremental info.
3468 (Lib_group::include_member): Record objects in incremental info.
3469 * archive.h (Incremental_archive_entry): Forward declaration.
3470 (Archive::set_incremental_info): New member function.
3471 (Archive::incremental_info): New member function.
3472 (Archive::Unused_symbol_iterator): New class.
3473 (Archive::unused_symbols_begin): New member function.
3474 (Archive::unused_symbols_end): New member function.
3475 (Archive::incremental_info_): New data member.
3476 * incremental-dump.cc (find_input_containing_global): New function.
3477 (dump_incremental_inputs): Dump new incremental info sections.
3478 * incremental.cc: Include symtab.h.
3479 (Output_section_incremental_inputs): New class.
3480 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3481 new incremental info sections.
3482 (Sized_incremental_binary::do_check_inputs): Likewise.
3483 (Incremental_inputs::report_archive): Remove.
3484 (Incremental_inputs::report_archive_begin): New function.
3485 (Incremental_inputs::report_archive_end): New function.
3486 (Incremental_inputs::report_object): New function.
3487 (Incremental_inputs::finalize_inputs): Remove.
3488 (Incremental_inputs::report_input_section): New function.
3489 (Incremental_inputs::report_script): Rewrite.
3490 (Incremental_inputs::finalize): Do nothing but finalize string table.
3491 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3492 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3493 (Incremental_inputs::create_data_sections): New function.
3494 (Incremental_inputs::relocs_entsize): New function.
3495 (Output_section_incremental_inputs::set_final_data_size): New function.
3496 (Output_section_incremental_inputs::do_write): New function.
3497 (Output_section_incremental_inputs::write_header): New function.
3498 (Output_section_incremental_inputs::write_input_files): New function.
3499 (Output_section_incremental_inputs::write_info_blocks): New function.
3500 (Output_section_incremental_inputs::write_symtab): New function.
3501 * incremental.h (Incremental_script_entry): Forward declaration.
3502 (Incremental_object_entry): Forward declaration.
3503 (Incremental_archive_entry): Forward declaration.
3504 (Incremental_inputs): Forward declaration.
3505 (Incremental_inputs_header_data): Remove.
3506 (Incremental_inputs_header): Remove.
3507 (Incremental_inputs_header_write): Remove.
3508 (Incremental_inputs_entry_data): Remove.
3509 (Incremental_inputs_entry): Remove.
3510 (Incremental_inputs_entry_write): Remove.
3511 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3512 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3513 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3514 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3515 Likewise.
3516 (Incremental_input_entry): New class.
3517 (Incremental_script_entry): New class.
3518 (Incremental_object_entry): New class.
3519 (Incremental_archive_entry): New class.
3520 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3521 (Incremental_inputs::report_inputs): Remove.
3522 (Incremental_inputs::report_archive): Remove.
3523 (Incremental_inputs::report_archive_begin): New function.
3524 (Incremental_inputs::report_archive_end): New function.
3525 (Incremental_inputs::report_object): Change prototype.
3526 (Incremental_inputs::report_input_section): New function.
3527 (Incremental_inputs::report_script): Change prototype.
3528 (Incremental_inputs::get_reloc_count): New function.
3529 (Incremental_inputs::set_reloc_count): New function.
3530 (Incremental_inputs::create_data_sections): New function.
3531 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3532 (Incremental_inputs::inputs_section): New function.
3533 (Incremental_inputs::symtab_section): New function.
3534 (Incremental_inputs::relocs_section): New function.
3535 (Incremental_inputs::get_stringpool): Add const.
3536 (Incremental_inputs::command_line): Add const.
3537 (Incremental_inputs::inputs): Remove.
3538 (Incremental_inputs::command_line_key): New function.
3539 (Incremental_inputs::input_file_count): New function.
3540 (Incremental_inputs::input_files): New function.
3541 (Incremental_inputs::relocs_entsize): New function.
3542 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3543 (Incremental_inputs::finalize_inputs): Remove.
3544 (Incremental_inputs::Input_info): Remove.
3545 (Incremental_inputs::lock_): Remove.
3546 (Incremental_inputs::inputs_): Change type.
3547 (Incremental_inputs::inputs_map_): Remove.
3548 (Incremental_inputs::current_object_entry_): New data member.
3549 (Incremental_inputs::inputs_section_): New data member.
3550 (Incremental_inputs::symtab_section_): New data member.
3551 (Incremental_inputs::relocs_section_): New data member.
3552 (Incremental_inputs::reloc_count_): New data member.
3553 (Incremental_inputs_reader): New class.
3554 (Incremental_symtab_reader): New class.
3555 (Incremental_relocs_reader): New class.
3556 * layout.cc (Layout::finalize): Move finalization of incremental info
3557 and creation of incremental info sections to follow finalization of
3558 symbol table. Set offsets for postprocessing sections.
3559 (Layout::create_incremental_info_sections): Call
3560 Incremental_inputs::create_data_sections. Add incremental symtab
3561 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3562 sections to layout after input sections.
3563 * layout.h (struct Timespec): Forward declaration.
3564 (Layout::incremental_inputs): Add const.
3565 (Layout::create_incremental_info_sections): Add parameter.
3566 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3567 * object.cc: Include incremental.h.
3568 (Relobj::finalize_incremental_relocs): New function.
3569 (Sized_relobj::do_layout): Record input sections in incremental info.
3570 * object.h (Object::output_section): New function.
3571 (Object::output_section_offset): Moved from Relobj.
3572 (Object::get_incremental_reloc_base): New function.
3573 (Object::get_incremental_reloc_count): New function.
3574 (Object::do_output_section): New function.
3575 (Object::do_output_section_offset): Moved from Relobj.
3576 (Object::do_get_incremental_reloc_base): New function.
3577 (Object::do_get_incremental_reloc_count): New function.
3578 (Object::Object): Initialize new data members.
3579 (Relobj::output_section): Renamed do_output_section and moved to
3580 protected.
3581 (Relobj::output_section_offset): Moved to Object.
3582 (Relobj::do_get_incremental_reloc_base): New function.
3583 (Relobj::do_get_incremental_reloc_count): New function.
3584 (Relobj::allocate_incremental_reloc_counts): New function.
3585 (Relobj::count_incremental_reloc): New function.
3586 (Relobj::finalize_incremental_relocs): New function.
3587 (Relobj::next_incremental_reloc_index): New function.
3588 (Relobj::reloc_counts_): New data member.
3589 (Relobj::reloc_bases_): New data member.
3590 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3591 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3592 (Sized_relobj::incremental_relocs_scan): New function.
3593 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3594 (Sized_relobj::incremental_relocs_write): New function.
3595 (Sized_relobj::incremental_relocs_write_reltype): New function.
3596 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3597 incremental link.
3598 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3599 archives and object files elsewhere.
3600 (Add_symbols::run): Report object files here.
3601 (Finish_group::run): Report end of archive at end of group.
3602 * reloc.cc: Include layout.h, incremental.h.
3603 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3604 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3605 (Sized_relobj::incremental_relocs_scan): New function.
3606 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3607 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3608 (Sized_relobj::incremental_relocs_write): New function.
3609 (Sized_relobj::incremental_relocs_write_reltype): New function.
3610 * script.cc (read_input_script): Rewrite test for incremental link.
3611 Change call to Incremental_inputs::report_script.
3612 * symtab.h (Symbol_table::first_global_index): New function.
3613 (Symbol_table::output_count): New function.
3614
3615 2010-08-12 Doug Kwan <dougkwan@google.com>
3616
3617 * arm.cc (Target_arm::merge_object_attributes): Check command line
3618 options --no-wchar-size-warning and --no-enum-size-warning.
3619 * options.h (General_options): Add ld-compatible options
3620 --no-enum-size-warning and --no-wchar-size-warning.
3621
3622 2010-08-04 Ian Lance Taylor <iant@google.com>
3623
3624 * x86_64.cc (Target_x86_64::Scan::local): Use
3625 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3626 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3627 (Target_x86_64::Scan::global): Likewise.
3628 (Target_x86_64::Relocate::relocate): Likewise.
3629 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3630 Likewise.
3631
3632 2010-08-03 Cary Coutant <ccoutant@google.com>
3633
3634 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3635 to reserve space in merged_strings vector. Keep total input size
3636 for stats.
3637 (Output_merge_string::do_print_merge_stats): Print total input size.
3638 * merge.h (Output_merge_string): Add input_size_ field.
3639 * stringpool.cc (Stringpool_template::string_length): Move
3640 implementations out of Stringpool_template class and place in
3641 stringpool.h.
3642 * stringpool.h (string_length): Move out of Stringpool_template.
3643
3644 2010-08-03 Ian Lance Taylor <iant@google.com>
3645
3646 PR 11712
3647 * layout.cc (relaxation_loop_body): If address of load segment is
3648 set, adjust address to include headers if possible.
3649
3650 2010-08-03 Ian Lance Taylor <iant@google.com>
3651
3652 * version.cc (version_string): Bump to 1.10.
3653
3654 2010-08-03 Ian Lance Taylor <iant@google.com>
3655
3656 PR 11805
3657 * layout.h (enum Output_section_order): Define.
3658 (class Layout): Update declarations.
3659 * layout.cc (Layout::get_output_section): Add order parameter.
3660 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3661 is_first_non_relro parameters. Change all callers.
3662 (Layout::choose_output_section): Likewise.
3663 (Layout::add_output_section_data): Likewise.
3664 (Layout::make_output_section): Likewise. Set order.
3665 (Layout::default_section_order): New function.
3666 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3667 * output.cc (Output_section::Output_section): Initialize order_.
3668 Don't initialize deleted fields.
3669 (Output_segment::Output_segment): Don't initialize deleted
3670 fields.
3671 (Output_segment::add_output_section_to_load): New function
3672 replacing add_output_section. Change all callers to call this or
3673 add_output_section_to_nonload.
3674 (Output_segment::add_output_section_to_nonload): New function.
3675 (Output_segment::remove_output_section): Rewrite.
3676 (Output_segment::add_initial_output_data): Likewise.
3677 (Output_segment::has_any_data_sections): Likewise.
3678 (Output_segment::is_first_section_relro): Likewise.
3679 (Output_segment::maximum_alignment): Likewise.
3680 (Output_segment::has_dynamic_reloc): New function replacing
3681 dynamic_reloc_count. Change all callers.
3682 (Output_segment::has_dynamic_reloc_list): New function replacing
3683 dynamic_reloc_count_list. Change all callers.
3684 (Output_segment::set_section_addresses): Rewrite.
3685 (Output_segment::set_offset): Rewrite.
3686 (Output_segment::find_first_and_last_list): Remove.
3687 (Output_segment::set_tls_offsets): Rewrite.
3688 (Output_segment::first_section_load_address): Likewise.
3689 (Output_segment::output_section_count): Likewise.
3690 (Output_segment::section_with_lowest_load_address): Likewise.
3691 (Output_segment::write_section_headers): Likewise.
3692 (Output_segment::print_sections_to_map): Likewise.
3693 * output.h (class Output_data): Remove dynamic_reloc_count_
3694 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3695 (Output_data::add_dynamic_reloc): Rewrite.
3696 (Output_data::has_dynamic_reloc): New function.
3697 (Output_data::dynamic_reloc_count): Remove.
3698 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3699 is_last_relro_, is_first_non_relro_, is_interp_,
3700 is_dynamic_linker_section_ fields. Add order and set_order
3701 functions. Remove is_relro_local, set_is_relro_local,
3702 is_last_relro, set_is_last_relro, is_first_non_relro,
3703 set_is_first_non_relro functions, is_interp, set_is_interp,
3704 is_dynamic_linker_section, and set_is_dynamic_linker_section
3705 functions.
3706 (class Output_segment): Change Output_data_list from std::list to
3707 std:;vector. Add output_lists_ field. Remove output_data_ and
3708 output_bss_ fields. Update declarations.
3709
3710 2010-08-02 Ian Lance Taylor <iant@google.com>
3711
3712 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3713 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3714 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3715
3716 2010-08-02 Ian Lance Taylor <iant@google.com>
3717
3718 PR 11855
3719 * script.cc (Script_options::Script_options): Initialize
3720 symbol_definitions_ and symbol_references_.
3721 (Script_options::add_symbol_assignment): Update
3722 symbol_definitions_ and symbol_references_.
3723 (Script_options::add_symbol_reference): New function.
3724 (script_symbol): New function.
3725 * script.h (class Script_options): Add symbol_definitions_ and
3726 symbol_references_ fields.
3727 (Script_options::referenced_const_iterator): New type.
3728 (Script_options::referenced_begin): New function.
3729 (Script_options::referenced_end): New function.
3730 (Script_options::is_referenced): New function.
3731 (Script_options::any_unreferenced): New function.
3732 * script-c.h (script_symbol): Declare.
3733 * yyscript.y (exp): Call script_symbol.
3734 * symtab.cc: Include "script.h".
3735 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3736 Change all callers. Check symbols referenced by scripts.
3737 (Symbol_table::add_undefined_symbols_from_command_line): Add
3738 layout parameter. Change all callers.
3739 (Symbol_table::do_add_undefined_symbols_from_command_line):
3740 Likewise. Break out loop body. Check symbols referenced by
3741 scripts.
3742 (Symbol_table::add_undefined_symbol_from_command_line): New
3743 function broken out of
3744 do_add_undefined_symbols_from_command_line.
3745 * symtab.h (class Symbol_table): Update declarations.
3746 * archive.cc: Include "layout.h".
3747 (Archive::should_include_member): Add layout parameter. Change
3748 all callers. Check for symbol mentioned in expression.
3749 * archive.h (class Archive): Update declaration.
3750 * object.cc (Sized_relobj::do_should_include_member): Add layout
3751 parameter.
3752 * object.h (Object::should_include_member): Add layout parameter.
3753 Change all callers.
3754 (Object::do_should_include_member): Add layout parameter.
3755 (class Sized_relobj): Update declaration.
3756 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3757 parameter.
3758 * dynobj.h (class Sized_dynobj): Update declaration.
3759 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3760 layout parameter.
3761 * plugin.h (class Sized_pluginobj): Update declaration.
3762
3763 2010-08-02 Ian Lance Taylor <iant@google.com>
3764
3765 PR 11866
3766 * output.cc (Output_segment::set_offset): Search for the first and
3767 last sections rather than assuming that the list is in order.
3768 (Output_segment::find_first_and_last_list): New function.
3769 * output.h (class Output_segment): Update declarations.
3770 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3771 (relro_strip_test_SOURCES): New variable.
3772 (relro_strip_test_DEPENDENCIES): New variable.
3773 (relro_strip_test_LDFLAGS): New variable.
3774 (relro_strip_test_LDADD): New variable.
3775 (relro_strip_test.so): New target.
3776
3777 2010-08-02 Ian Lance Taylor <iant@google.com>
3778
3779 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3780 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3781 (Target_i386::got_tlsdesc_section): New function.
3782 (Target_i386::got_section): Create space for GOT entries for
3783 TLSDESC relocations.
3784 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3785 R_386_TLS_GOTDESC.
3786 (Target_i386::Scan::global): Likewise.
3787 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3788 using TLSDESC GOT.
3789 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3790 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3791 (Target_x86_64::got_tlsdesc_section): New function.
3792 (Target_x86_64::got_section): Create space for GOT entries for
3793 TLSDESC relocations.
3794 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3795 R_386_TLS_GOTDESC.
3796 (Target_x86_64::Scan::global): Likewise.
3797 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3798 using TLSDESC GOT.
3799
3800 2010-08-02 Ian Lance Taylor <iant@google.com>
3801
3802 * testsuite/final_layout.sh: Use dc to convert from hex to
3803 decimal.
3804
3805 2010-07-29 Sriraman Tallam <tmsriram@google.com>
3806
3807 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3808 paramter to the call to gold::gc_process_relocs.
3809 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3810 paramter to the call to gold::gc_process_relocs.
3811 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3812 parameter to the call to gold::gc_process_relocs.
3813 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3814 template parameter to the call to gold::gc_process_relocs.
3815 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3816 paramter to the call to gold::gc_process_relocs.
3817 * gc.h (get_embedded_addend_size): New function.
3818 (gc_process_relocs): Save the size of the reloc for use by ICF.
3819 * icf.cc (get_section_contents): Get the addend from the text section
3820 for SHT_REL relocation sections.
3821 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3822 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3823 * int_encoding.h (read_from_pointer): New overloaded function.
3824 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3825 * testsuite/icf_sht_rel_addend_test.sh: New file.
3826 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3827 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3828
3829 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3830
3831 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3832 * Makefile.in: Regenerate.
3833 * testsuite/Makefile.in: Regenerate.
3834
3835 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3836
3837 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3838 * gold/testsuite/debug_msg.cc: Likewise.
3839 * gold/testsuite/odr_violation1.cc
3840 * gold/testsuite/odr_violation2.cc
3841
3842 2010-07-21 Cary Coutant <ccoutant@google.com>
3843
3844 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3845 string, and length fields.
3846 (Output_merge_string::Merged_strings_list): New type.
3847 (Output_merge_string::Merged_strings_lists): New typedef.
3848 (Output_merge_string): Replace merged_strings_ with
3849 merged_strings_lists_.
3850 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3851 Merged_strings_list per input object and section. Don't store pointer
3852 to the string. Don't store length with each merged string entry.
3853 (Output_merge_string::finalize_merged_data): Loop over list of merged
3854 strings lists. Recompute length of each merged string.
3855
3856 2010-07-15 Cary Coutant <ccoutant@google.com>
3857
3858 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3859 here.
3860
3861 2010-07-14 Ian Lance Taylor <iant@google.com>
3862
3863 * descriptors.cc (Descriptors::open): Report correct name in error
3864 message.
3865
3866 2010-07-13 Doug Kwan <dougkwan@google.com>
3867
3868 * arm.cc (Arm_input_section::Arm_input_section): For a
3869 SHT_ARM_EXIDX section, always keeps the input sections.
3870 (Arm_input_section::set_exidx_section_link): New method.
3871 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3872 has_errors_ to false.
3873 (Arm_exidx_input_section::has_errors,
3874 Arm_exidx_input_section::set_has_errors): New methods.
3875 (Arm_exidx_input_section::has_errors_): New data member.
3876 (Arm_relobj::get_exidx_shndx_list): New method.
3877 (Arm_output_section::append_text_sections_to_list): Do not skip
3878 section without SHF_EXECINSTR.
3879 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3880 errors.
3881 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3882 section header. Make error messages more verbose. Check for
3883 a non-executable section linked to an EXIDX section.
3884 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3885 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3886 check that there is no deferred EXIDX section if we exit early.
3887 Instead of not making an EXIDX section in case of an error, make one
3888 and set the has_errors flag of it.
3889 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3890 in a relocatable link.
3891 (Target_arm::do_relax): Look for the EXIDX output section instead of
3892 assuming that it is called .ARM.exidx.
3893 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3894 section list. Do not check for SHF_EXECINSTR section flags but
3895 skip any input section with errors.
3896 * output.cc (Output_section::Output_section): Initialize
3897 always_keeps_input_sections_ to false.
3898 (Output_section::add_input_section): Check for
3899 always_keeps_input_sections_.
3900 * output.h (Output_section::always_keeps_input_sections,
3901 Output_section::set_always_keeps_input_sections): New methods.
3902 (Output_section::always_keeps_input_sections): New data member.
3903
3904 2010-07-13 Rafael Espindola <espindola@google.com>
3905
3906 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3907 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3908
3909 2010-07-13 Philip Herron <herron.philip@googlemail.com>
3910 Ian Lance Taylor <iant@google.com>
3911
3912 * output.h (Output_section_lookup_maps::add_merge_section):
3913 Correct check of whether value was inserted.
3914 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3915 (Output_section_lookup_maps::add_relaxed_input_section):
3916 Likewise.
3917 * arm.cc (Target_arm::got_section): Remove used local os.
3918 * i386.cc (Target_i386::got_section): Likewise.
3919 * x86_64.cc (Target_x86_64::got_section): Likewise.
3920 * sparc.cc (Target_sparc::got_section): Likewise.
3921 (Target_sparc::relocate): Remove unused local have_got_offset.
3922 * powerpc.cc (Target_powerpc::relocate): Likewise.
3923
3924 2010-07-13 Ian Lance Taylor <iant@google.com>
3925
3926 * compressed_output.cc (zlib_decompress): Fix signature in
3927 !HAVE_ZLIB_H case.
3928
3929 * archive.cc (Archive::include_member): Unlock an external member
3930 of a thin archive. Don't bother to delete an object we know is
3931 NULL.
3932
3933 2010-07-12 Cary Coutant <ccoutant@google.com>
3934
3935 * compressed_output.cc (zlib_decompress): New function.
3936 (get_uncompressed_size): New function.
3937 (decompress_input_section): New function.
3938 * compressed_output.h (get_uncompressed_size): New function.
3939 (decompress_input_section): New function.
3940 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3941 Handle compressed debug sections.
3942 * layout.cc (is_compressed_debug_section): New function.
3943 (Layout::output_section_name): Map compressed section names to
3944 canonical names.
3945 * layout.h (is_compressed_debug_section): New function.
3946 (is_debug_info_section): Recognize compressed debug sections.
3947 * merge.cc: Include compressed_output.h.
3948 (Output_merge_data::do_add_input_section): Handle compressed
3949 debug sections.
3950 (Output_merge_string::do_add_input_section): Handle compressed
3951 debug sections.
3952 * object.cc: Include compressed_output.h.
3953 (Sized_relobj::Sized_relobj): Initialize new data members.
3954 (build_compressed_section_map): New function.
3955 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3956 * object.h (Object::section_is_compressed): New method.
3957 (Object::do_section_is_compressed): New method.
3958 (Sized_relobj::Compressed_section_map): New type.
3959 (Sized_relobj::do_section_is_compressed): New method.
3960 (Sized_relobj::compressed_sections_): New data member.
3961 * output.cc (Output_section::add_input_section): Handle compressed
3962 debug sections.
3963 * reloc.cc: Include compressed_output.h.
3964 (Sized_relobj::write_sections): Handle compressed debug sections.
3965
3966 2010-07-08 Cary Coutant <ccoutant@google.com>
3967
3968 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3969 weak when resolving to a dynamic def.
3970 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3971 for weak undef/dynamic def cases. Adjust callers.
3972 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3973 undef_binding_weak_.
3974 (Symbol_table::sized_write_globals): Adjust symbol binding.
3975 (Symbol_table::sized_write_symbol): Add binding parameter.
3976 * symtab.h (Symbol::set_undef_binding): New method.
3977 (Symbol::is_undef_binding_weak): New method.
3978 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3979 (Symbol_table::should_override): Add new parameter.
3980 (Symbol_table::sized_write_symbol): Add new parameter.
3981
3982 * testsuite/weak_undef_file1.cc: Add new test case.
3983 * testsuite/weak_undef_file2.cc: Fix header comment.
3984 * testsuite/weak_undef_test.cc: Add new test case.
3985
3986 2010-06-29 Doug Kwan <dougkwan@google.com>
3987
3988 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3989 Initialize USE_SYMBOL_.
3990 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3991 definition.
3992 (Arm_reloc_property::uses_symbol_): New data member declaration.
3993 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3994 uses symbol value and symbol is undefined but not weakly undefined.
3995
3996 2010-06-28 Rafael Espindola <espindola@google.com>
3997
3998 * plugin.cc (Plugin::load): Use dlerror.
3999
4000 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4001
4002 * symtab.cc (detect_odr_violations): When reporting an ODR
4003 violation, report an object where the symbol is defined.
4004
4005 2010-06-25 Doug Kwan <dougkwan@google.com>
4006
4007 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4008 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4009 definition.
4010 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4011 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4012 target hook to detect function points.
4013 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4014 * icf.h (Icf::check_section_for_function_pointers): Change type of
4015 parameter SECTION_NAME to const reference to std::string. Use
4016 target hook to determine if section may have unsafe pointers.
4017 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4018 method definition.
4019
4020 2010-06-21 Rafael Espindola <espindola@google.com>
4021
4022 * fileread.cc (Input_file::find_fie): New
4023 (Input_file::open): Use Input_file::find_fie.
4024 * fileread.h (Input_file::find_fie): New
4025 * plugin.cc (set_extra_library_path): New.
4026 (Plugin::load): Add set_extra_library_path to the transfer vector.
4027 (Plugin_manager::set_extra_library_path): New.
4028 (Plugin_manager::add_input_file): Use the extra search path if set.
4029 (set_extra_library_path(): New.
4030 * plugin.h (Plugin_manager): Add set_extra_library_path and
4031 extra_search_path_.
4032
4033 2010-06-19 Cary Coutant <ccoutant@google.com>
4034
4035 * layout.cc (gdb_sections): Add .debug_types.
4036 (lines_only_debug_sections): Likewise.
4037
4038 2010-06-18 Rafael Espindola <espindola@google.com>
4039
4040 * plugin.cc (add_input_file,add_input_library)
4041 (Plugin_manager::add_input_file): Make filename arguments const.
4042 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4043 const.
4044
4045 2010-06-16 Doug Kwan <dougkwan@google.com>
4046
4047 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4048 .ARM.attributes section if we have not merged any input
4049 attributes sections.
4050
4051 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4052
4053 * arm.cc: Allow combining objects with no EABI version
4054 information.
4055
4056 2010-06-15 Rafael Espindola <espindola@google.com>
4057
4058 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4059
4060 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4061
4062 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4063 (struct iovec): Correct !HAVE_READV definition.
4064
4065 2010-06-10 Cary Coutant <ccoutant@google.com>
4066
4067 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4068 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4069 reloc sections.
4070 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4071
4072 PR 11683
4073 * symtab.h (Symbol::is_placeholder): New member function.
4074 * target-reloc.h (relocate_section): Check for placeholder symbols.
4075
4076 * testsuite/Makefile.am (plugin_test_8): New test.
4077 (plugin_test_9): New test.
4078 * testsuite/Makefile.in: Regenerate.
4079
4080 2010-06-09 Nick Clifton <nickc@redhat.com>
4081
4082 * yyscript.y (input_list_element): Allow strings prefixed with
4083 the '-' character. Treat these as libraries.
4084 * script.cc (script_add_library): New function. Adds a library
4085 specified by "-l<name>" found in an input script.
4086 * script-c.h: Add prototype for script_add_library.
4087
4088 2010-06-07 Doug Kwan <dougkwan@google.com>
4089
4090 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4091 Restrict stub-group size to be within long conditional branch
4092 range when working around cortex-A8 erratum.
4093
4094 2010-06-07 Damien Diederen <dd@crosstwine.com>
4095
4096 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4097 #ifdef typo.
4098
4099 2010-06-03 Sriraman Tallam <tmsriram@google.com>
4100
4101 PR gold/11658
4102 * output.cc
4103 (Output_section::Input_section_sort_entry::compare_section_ordering):
4104 Change to return non-zero correctly.
4105 (Output_section::Input_section_sort_section_order_index_compare
4106 ::operator()): Change to fix ambiguity in comparisons.
4107
4108 2010-06-01 Sriraman Tallam <tmsriram@google.com>
4109
4110 * gold.h (is_wildcard_string): New function.
4111 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4112 (Layout::layout_eh_frame): Ditto.
4113 (Layout::find_section_order_index): New method.
4114 (Layout::read_layout_from_file): New method.
4115 * layout.h (Layout::find_section_order_index): New method.
4116 (Layout::read_layout_from_file): New method.
4117 (Layout::input_section_position_): New private member.
4118 (Layout::input_section_glob_): New private member.
4119 * main.cc (main): Call read_layout_from_file here.
4120 * options.h (--section-ordering-file): New option.
4121 * output.cc (Output_section::input_section_order_specified_): New
4122 member.
4123 (Output_section::Output_section): Initialize new member.
4124 (Output_section::add_input_section): Add new parameter.
4125 Keep input sections when --section-ordering-file is used.
4126 (Output_section::set_final_data_size): Sort input sections when
4127 section ordering file is specified.
4128 (Output_section::Input_section_sort_entry): Add new parameter.
4129 Check sorting type.
4130 (Output_section::Input_section_sort_entry::compare_section_ordering):
4131 New method.
4132 (Output_section::Input_section_sort_compare::operator()): Change to
4133 consider section_order_index.
4134 (Output_section::Input_section_sort_init_fini_compare::operator()):
4135 Change to consider section_order_index.
4136 (Output_section::Input_section_sort_section_order_index_compare
4137 ::operator()): New method.
4138 (Output_section::sort_attached_input_sections): Change to sort
4139 according to section order when specified.
4140 (Output_section::add_input_section<32, true>): Add new parameter.
4141 (Output_section::add_input_section<64, true>): Add new parameter.
4142 (Output_section::add_input_section<32, false>): Add new parameter.
4143 (Output_section::add_input_section<64, false>): Add new parameter.
4144 * output.h (Output_section::add_input_section): Add new parameter.
4145 (Output_section::input_section_order_specified): New
4146 method.
4147 (Output_section::set_input_section_order_specified): New method.
4148 (Input_section::Input_section): Initialize section_order_index_.
4149 (Input_section::section_order_index): New method.
4150 (Input_section::set_section_order_index): New method.
4151 (Input_section::section_order_index_): New member.
4152 (Input_section::Input_section_sort_section_order_index_compare): New
4153 struct.
4154 (Output_section::input_section_order_specified_): New member.
4155 * script-sections.cc (is_wildcard_string): Delete and move modified
4156 method to gold.h.
4157 (Output_section_element_input::Output_section_element_input): Modify
4158 call to is_wildcard_string.
4159 (Output_section_element_input::Input_section_pattern
4160 ::Input_section_pattern): Ditto.
4161 (Output_section_element_input::Output_section_element_input): Ditto.
4162 * testsuite/Makefile.am (final_layout): New test case.
4163 * testsuite/Makefile.in: Regenerate.
4164 * testsuite/final_layout.cc: New file.
4165 * testsuite/final_layout.sh: New file.
4166
4167 2010-06-01 Rafael Espindola <espindola@google.com>
4168
4169 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4170
4171 2010-06-01 Rafael Espindola <espindola@google.com>
4172
4173 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4174 visibility of symbols.
4175
4176 2010-05-27 Doug Kwan <dougkwan@google.com>
4177
4178 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4179 from start of output section instead of address for a local symbol
4180 in a merged or relaxed section when doing a relocatable link.
4181
4182 2010-05-26 Rafael Espindola <espindola@google.com>
4183
4184 PR 11604
4185 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4186 adding sections the garbage collector removed.
4187 * gold/testsuite/Makefile.am: Add test.
4188 * gold/testsuite/Makefile.in: Regenerate.
4189 * gold/testsuite/plugin_test_7.sh: New.
4190 * gold/testsuite/plugin_test_7_1.c: New.
4191 * gold/testsuite/plugin_test_7_2.c: New.
4192
4193 2010-05-26 Rafael Espindola <espindola@google.com>
4194
4195 * script-sections.cc (Output_section_definition::set_section_addresses):
4196 Check for --section-start.
4197
4198 2010-05-26 Doug Kwan <dougkwan@google.com>
4199
4200 * arm.cc (Arm_scan_relocatable_relocs): New class.
4201 (Target_arm::relocate_special_relocatable): New method.
4202 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4203 (Arm_relocate_functions::thumb_branch_common): Same.
4204 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4205 instead of Default_scan_relocatable_relocs.
4206 * target-reloc.h (relocate_for_relocatable): Let target handle
4207 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4208 * target.h (Sized_target::relocate_special_relocatable): New method.
4209
4210 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4211
4212 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4213
4214 2010-05-23 Doug Kwan <dougkwan@google.com>
4215
4216 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4217 instead of a cast.
4218 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4219 with a direct branch, not a conditional branch, to a stub.
4220 * merge.cc (Output_merge_base::record_input_section): New method
4221 defintion.
4222 (Output_merge_data::do_add_input_section): Record input section if
4223 keeps-input-sections flag is set.
4224 (Output_merge_string::do_add_input_section): Ditto.
4225 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4226 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4227 INPUT_SECTIONS_.
4228 (Output_merge_base::keeps_input_sections,
4229 Output_merge_base::set_keeps_input_sections,
4230 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4231 method definitions.
4232 (Output_merge_base::Input_sections): New type declaration.
4233 (Output_merge_base::input_sections_begin,
4234 Output_merge_base::input_sections_end,
4235 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4236 (Output_merge_base::bool keeps_input_sections_,
4237 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4238 Output_merge_base::input_sections_): New data members.
4239 (Output_merge_data::do_set_keeps_input_sections): New method
4240 defintion.
4241 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4242 * output.cc (Output_section::Input_section::relobj): Move method
4243 defintion from class declaration to here and handle merge sections.
4244 (Output_section::Input_section::shndx): Ditto.
4245 (Output_section::Output_section): Remove initializations of removed
4246 data members and initialize new data member LOOKUP_MAPS_.
4247 (Output_section::add_input_section): Set keeps-input-sections flag
4248 for a newly created merge output section as appropriate. Adjust code
4249 to use Output_section_lookup_maps class.
4250 (Output_section::add_relaxed_input_section): Adjst code for lookup
4251 maps code refactoring.
4252 (Output_section::add_merge_input_section): Add a new parameter
4253 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4254 class. If adding input section to a newly created merge output
4255 section fails, remove the new merge section.
4256 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
4257 Adjust code for use of the Output_section_lookup_maps class.
4258 (Output_section::find_merge_section): Ditto.
4259 (Output_section::build_lookup_maps): New method defintion.
4260 (Output_section::find_relaxed_input_section): Adjust code to use
4261 Output_section_lookup_maps class.
4262 (Output_section::get_input_sections): Export merge sections. Adjust
4263 code to use Output_section_lookup_maps class.
4264 (Output_section:::add_script_input_section): Adjust code to use
4265 Output_section_lookup_maps class. Update lookup maps for merge
4266 sections also.
4267 (Output_section::discard_states): Use Output_section_lookup_maps.
4268 (Output_section::restore_states): Same.
4269 * output.h (Merge_section_properties): Move class defintion out of
4270 Output_section.
4271 (Output_section_lookup_maps): New class.
4272 (Output_section::Input_section::is_merge_section): New method
4273 defintion.
4274 (Output_section::Input_section::relobj): Move defintion out of class
4275 defintion. Declare method only.
4276 (Output_section::Input_section::shndx): Ditto.
4277 (Output_section::Input_section::output_merge_base): New method defintion.
4278 (Output_section::Input_section::u2_.pomb): New union field.
4279 (Output_section::Merge_section_by_properties_map,
4280 Output_section::Output_section_data_by_input_section_map,
4281 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4282 Remove types.
4283 (Output_section::add_merge_input_section): Add new parameter
4284 KEEPS_INPUT_SECTIONS.
4285 (Output_section::build_lookup_maps): New method declaration.
4286 (Output_section::merge_section_map_,
4287 Output_section::merge_section_by_properties_map_,
4288 Output_section::relaxed_input_section_map_,
4289 Output_section::is_relaxed_input_section_map_valid_): Remove data
4290 members.
4291 (Output_section::lookup_maps_): New data member.
4292
4293 2010-05-21 Doug Kwan <dougkwan@google.com>
4294
4295 PR gold/11619
4296 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4297 avoid a compilation error.
4298
4299 2010-05-19 Rafael Espindola <espindola@google.com>
4300
4301 * script-sections.cc (Output_section_definition::allocate_to_segment):
4302 Update the phdrs_list even when the output section is NULL.
4303 * testsuite/Makefile.am: Add test.
4304 * testsuite/Makefile.in: Regenerate.
4305 * testsuite/script_test_9.cc: New.
4306 * testsuite/script_test_9.sh: New.
4307 * testsuite/script_test_9.t: New.
4308
4309 2010-05-19 Doug Kwan <dougkwan@google.com>
4310
4311 * arm.cc (Arm_input_section::original_size): New method.
4312 (Arm_input_section::do_addralign): Add a cast.
4313 (Arm_input_section::do_output_offset): Remove static cast.
4314 (Arm_input_section::original_addralign,
4315 Arm_input_section::original_size_): Change type to uint32_t.
4316 (Arm_input_section::init): Add safe casts for section alignment
4317 and size.
4318 (Arm_input_section::set_final_data_size): Do not set address and
4319 offset of stub table.
4320 (Arm_output_section::fix_exidx_coverage): Change use of of
4321 Output_section::Simple_input_section to that of
4322 Output_section::Input_section.
4323 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4324 except for the first pass.
4325 * output.cc (Output_section::get_input_sections): Change type of
4326 input_sections to std::list<Input_section>.
4327 (Output_section::add_script_input_section): Rename from
4328 Output_section::add_simple_input_section. Change type of SIS
4329 parameter from Simple_input_section to Input_section.
4330 * output.h (Output_section::Simple_input_section): Remove class.
4331 (Output_section::Input_section): Change class visibility to public.
4332 (Output_section::Input_section::addralign): Use stored alignments
4333 for special input sections if set.
4334 (Output_section::Input_section::set_addralign): New method.
4335 (Output_section::get_input_sections): Change parameter type from
4336 list of Simple_input_section to list of Input_section.
4337 (Output_section::add_script_input_section): Rename from
4338 Output_section::add_simple_input_section. Change first parameter's
4339 type from Simple_input_section to Input_section and remove the
4340 second and third parameters.
4341 * script-sections.cc (Input_section::Input_section_list): Change
4342 type to list of Output_section::Input_section/
4343 (Input_section_info::Input_section_info): Change parameter type of
4344 INPUT_SECTION to Output_section::Input_section.
4345 (Input_section_info::input_section): Change return type.
4346 (Input_section_info::input_section_): Change type to
4347 Output_section::Input_section.
4348 (Output_section_element_input::set_section_addresses): Adjust code
4349 to use Output_section::Input_section instead of
4350 Output_section::Simple_input_section. Adjust code for renaming
4351 of Output_section::add_simple_input_section.
4352 (Orphan_output_section::set_section_addresses): Ditto.
4353
4354 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4355
4356 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4357 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4358
4359 2010-05-18 Rafael Espindola <espindola@google.com>
4360
4361 * options.cc (General_options::finalize): Handle -nostdlib.
4362 * options.h (nostdlib): New option.
4363 * script.cc (script_add_search_dir): Handle -nostdlib.
4364
4365 2010-05-12 Doug Kwan <dougkwan@google.com>
4366
4367 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4368 attributes section only if there no attributes section after merging.
4369 (Target_arm::merge_object_attributes): Move value of
4370 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
4371 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4372 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4373 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4374 and arm_attr_merge_7.stdout.
4375 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4376 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4377 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4378 arm_attr_merge_7b.o): New rules.
4379 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4380 arm_attr_merge_7
4381 * testsuite/Makefile.in: Regenerate.
4382 * testsuite/arm_attr_merge.sh: New file.
4383 * testsuite/arm_attr_merge_[67][ab].s: Same.
4384
4385 2010-05-05 Nick Clifton <nickc@redhat.com>
4386
4387 * po/es.po: Updated Spanish translation.
4388
4389 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4390
4391 * Makefile.am (install-exec-local): Properly install gold as
4392 default cross linker.
4393 * Makefile.in: Regenerated.
4394
4395 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4396 Nick Clifton <nickc@redhat.com>
4397
4398 * configure.ac (install_as_default): Define and set to false
4399 unless --enable-gold or --enable-gold=both/gold has been
4400 specified.
4401 * configure: Regenerate.
4402
4403 * Makefile.am (install-exec-local): Install the executable as
4404 'ld.gold'. If install_as_default is true then also install it as
4405 'ld'.
4406 * Makefile.in: Regenerated.
4407
4408 2010-04-24 Ian Lance Taylor <iant@google.com>
4409
4410 * layout.cc (Layout::layout_reloc): In relocatable link don't
4411 combine reloc sections for grouped sections.
4412
4413 2010-04-23 Sriraman Tallam <tmsriram@google.com>
4414
4415 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4416 sections that are not ordinary to icf.
4417 * icf.cc (get_section_contents): Handle relocation pointing to section
4418 with no object or shndx information.
4419 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4420 * testsuite/Makefile.in: Regenerate.
4421 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4422 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4423
4424 2010-04-22 Ian Lance Taylor <iant@google.com>
4425
4426 * expression.cc (Expression::Expression_eval_info): Add
4427 result_alignment_pointer field.
4428 (Expression::eval_with_dot): Add result_alignment_pointer
4429 parameter. Change all callers.
4430 (Expression::eval_maybe_dot): Likewise.
4431 (class Binary_expression): Add alignment_pointer parameter to
4432 left_value and right_value. Change all callers.
4433 (BINARY_EXPRESSION): Set result alignment.
4434 (class Trinary_expression): Add alignment_pointer parameter to
4435 arg2_value and arg3_value. Change all callers.
4436 (Trinary_cond::value): Set result alignment.
4437 (Max_expression::value, Min_expression::value): Likewise.
4438 (Align_expression::value): Likewise.
4439 * script-sections.cc (class Sections_element): Add dot_alignment
4440 parameter to set_section_addresses virtual function. Update
4441 instantiations.
4442 (class Output_section_element): Likewise.
4443 (Script_sections::create_segments): Add dot_alignment parameter.
4444 Change all callers.
4445 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4446 (Script_sections::set_phdrs_clause_addresses): Likewise.
4447 * script-sections.h: Update declarations.
4448 * script.h: Update declarations.
4449 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4450 min_p_align.
4451 * testsuite/script_test_3.t: Set large alignment.
4452 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4453 segment has expected alignment.
4454
4455 2010-04-22 Nick Clifton <nickc@redhat.com>
4456
4457 * po/gold.pot: Updated by the Translation project.
4458 * po/vi.po: Updated Vietnamese translation.
4459
4460 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4461
4462 * testsuite/Makefile.am (check_PROGRAMS): Add
4463 icf_virtual_function_folding_test.
4464 * testsuite/Makefile.in: Regenerated.
4465
4466 2010-04-15 Andrew Haley <aph@redhat.com>
4467
4468 * options.h (merge_exidx_entries): New option.
4469 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4470 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4471 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4472 (Target_arm::merge_exidx_entries): New function.
4473 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4474 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4475 to Arm_exidx_fixup constructor.
4476 Add new arg, merge_exidx_entries.
4477 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4478 Arm_output_section::fix_exidx_coverage.
4479
4480 2010-04-18 Sriraman Tallam <tmsriram@google.com>
4481
4482 * icf.cc (get_section_contents): Check for preemptible functions.
4483 Ignore addend when appropriate.
4484 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4485 section folded.
4486 (add_from_relobj): Check for section folded.
4487 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4488 * symtab.h (should_add_dynsym_entry): Add new parameter.
4489 * target-reloc.h (scan_relocs): Check for section folded.
4490 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4491 Check reloc types for function pointers in shared objects.
4492 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4493 case.
4494 (icf_preemptible_functions_test): New test case.
4495 (icf_string_merge_test): New test case.
4496 * testsuite.Makefile.in: Regenerate.
4497 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4498 bar_glob. Refactor code.
4499 * testsuite/icf_preemptible_functions_test.cc: New file.
4500 * testsuite/icf_preemptible_functions_test.sh: New file.
4501 * testsuite/icf_string_merge_test.cc: New file.
4502 * testsuite/icf_string_merge_test.sh: New file.
4503 * testsuite/icf_virtual_function_folding_test.cc: New file.
4504 * testsuite/icf_virtual_function_folding_test.sh: New file.
4505
4506 2010-04-14 Doug Kwan <dougkwan@google.com>
4507
4508 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4509 for local symbol recounting if we remove a section due to ICF.
4510 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4511 there are no regular objects in input.
4512
4513 2010-04-13 Doug Kwan <dougkwan@google.com>
4514
4515 * arm.cc (Arm_input_section::set_final_data_size): Compute
4516 accurate final data size instead of using current data size.
4517
4518 2010-04-09 Doug Kwan <dougkwan@google.com>
4519
4520 * layout.cc (Layout::choose_output_section): Handle script section
4521 types.
4522 (Layout::make_output_section_for_script): Add section type parameter.
4523 Handle script section types.
4524 * layout.h (Layout::make_output_section_for_script): Add section
4525 type parameter.
4526 * output.cc (Output_section::Output_section): Initialize data member
4527 is_noload_.
4528 (Output_section::do_reset_address_and_file_offset): Do not set address
4529 to 0 if section is a NOLOAD section.
4530 * output.h (Output_section::is_noload): New method.
4531 (Output_section::set_is_noload): Ditto.
4532 (Output_section::is_noload_): New data member.
4533 * script-c.h (Script_section_type): New enum type.
4534 (struct Parser_output_section_header): Add new file section_type.
4535 * script-sections.cc (Sections_element::output_section_name): Add
4536 parameter for returning script section type.
4537 (Output_section_definition::output_section_name): Ditto.
4538 (Output_section_definition::section_type)P; New method.
4539 (Output_section_definiton::script_section_type_name): Ditto.
4540 (Output_section_definition::script_section_type_): New data member.
4541 (Output_section_definition::Output_section_definition): Initialize
4542 data member Output_section_definition::script_section_type_.
4543 (Output_section_definition::create_sections): Pass script section type
4544 to Layout::make_output_section_for_script.
4545 (Output_section_definition::output_section_name): Return script
4546 section type to caller.
4547 (Output_section_definition::set_section_address): Do not advance
4548 dot value and load address if section type is NOLOAD. Set address
4549 of NOLOAD sections regardless of section flags.
4550 (Output_section_definition::print): Print section type if it is
4551 not SCRIPT_SECTION_TYPE_NONE.
4552 (Output_section_definition::section_type): New method.
4553 (Output_section_definition::script_section_type_name): Ditto.
4554 (Script_sections::output_section_name): Add new parameter
4555 PSECTION_TYPE for returning script section type. Pass it to
4556 section elements. Handle discard sections.
4557 (Sort_output_sections::operator()): Handle NOLOAD sections.
4558 * script-sections.h (Script_sections::Section_type): New enum type.
4559 (Script_sections::output_section_name): Add a new parameter for
4560 returning script section type.
4561 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4562 INFO and NOLOAD.
4563 * yyscript.y (union): Add new field SECTION_TYPE.
4564 (COPY, DSECT, INFO, NOLOAD): New tokens.
4565 (opt_address_and_section_type): Change type to output_section_header.
4566 (section_type): New non-terminal
4567 (section_header): Handle section type.
4568 (opt_address_and_section_type): Return section type value.
4569
4570 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4571
4572 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4573 * testsuite/plugin_common_test_2.c (foo): Likewise.
4574
4575 2010-04-08 Doug Kwan <dougkwan@google.com>
4576
4577 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4578 Output_merge_data.
4579 * output.cc (Output_section::add_merge_input_section): Simplify
4580 code and return status of Output_merge_base::add_input_section.
4581 Update merge section map only if Output_merge_base::add_input_section
4582 returns true.
4583
4584 2010-04-07 Doug Kwan <dougkwan@google.com>
4585
4586 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4587 if section is marked as containing instructions but has no mapping
4588 symbols.
4589 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4590 correct section index.
4591 (Arm_relobj::find_linked_text_section): Ditto.
4592
4593 2010-04-07 Cary Coutant <ccoutant@google.com>
4594
4595 * archive.cc (include_member): Destroy Read_symbols_data object before
4596 releasing file.
4597 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4598 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4599 (Read_symbols_data::~Read_symbols_data) New destructor.
4600 (Section_relocs::Section_relocs) New constructor.
4601 (Section_relocs::~Section_relocs) New destructor.
4602 (Read_relocs_data::Read_relocs_data) New constructor.
4603 (Read_relocs_data::~Read_relocs_data) New destructor.
4604 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4605 pointers to NULL after deleting.
4606
4607 2010-04-07 Doug Kwan <dougkwan@google.com>
4608
4609 * arm.cc: Replace "endianity" with "endianness" in comments.
4610 (Arm_exidx_cantunwind): Ditto.
4611 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4612 (Arm_relobj::merge_flags_and_attributes): New method.
4613 (Arm_relobj::merge_flags_and_attributes_): New data member.
4614 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4615 (Arm_relobj::scan_sections_for_stubs): Ditto.
4616 (Arm_relobj::do_read_symbols): Check to see if we really want to
4617 merge processor-specific flags and attributes. Exit early if
4618 an object is empty except for section names and the undefined symbol.
4619 (Target_arm::do_finalize_sections): Move check for ELF format to
4620 Arm_relobj::do_read_symbols. Merge processor specific flags and
4621 attributes from a regular object only when we have determined that
4622 it is aapropriate. Do not create an .ARM.attributes section in
4623 output if there is no regular input object.
4624 (Target_arm::merge_processor_specific_flags): Check
4625 --warn-mismatch before printing any error.
4626 (Target_arm::merge_object_attributes): Ditto.
4627 * gold.cc (queue_middle_tasks): Handle the case in which there is
4628 no regular object in input.
4629 * options.cc (General_options::parse_EB): New method.
4630 (General_options::parse_EL): Same.
4631 (General_options::General_options): Initialize endianness_.
4632 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4633 New options.
4634 (General_options::Endianness): New enum.
4635 (General_options::endianness): New method.
4636 (General_options::endianness_): New data member.
4637 * parameters.cc (Parameters::set_options): Check target endianness.
4638 (Parameters::set_target_once): Ditto.
4639 (Parameters::check_target_endianness): New method.
4640 (parameters_force_valid_target): If either -EL or -EB is specified,
4641 use it to define endianness of default target.
4642 * parameters.h (Parameters::check_target_endianness): New method
4643 declaration.
4644 * target.h (class Target): Change "endianity" to "endianness"
4645 in comments.
4646
4647 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4648
4649 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4650 * configure: Regenerate.
4651 * Makefile.in: Regenerate.
4652 * testsuite/Makefile.in: Regenerate.
4653
4654 2010-04-06 Cary Coutant <ccoutant@google.com>
4655
4656 gcc PR lto/42757
4657 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4658 prevailing definitions of common symbols.
4659 * testsuite/plugin_test_6.sh: New test case.
4660 * testsuite/plugin_common_test_1.c: New test case.
4661 * testsuite/plugin_common_test_2.c: New test case.
4662 * testsuite/Makefile.am (plugin_test_6): New test case.
4663 * testsuite/Makefile.in: Regenerate.
4664
4665 2010-04-06 Nick Clifton <nickc@redhat.com>
4666
4667 * po/vi.po: New Vietnamese translation.
4668
4669 2010-03-30 Doug Kwan <dougkwan@google.com>
4670
4671 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4672
4673 2010-03-25 Doug Kwan <dougkwan@google.com>
4674
4675 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4676 to avoid a conversion warning on a 32-bit host.
4677
4678 2010-03-24 Ian Lance Taylor <iant@google.com>
4679
4680 * testsuite/script_test_3.t: Add a TLS segment.
4681 * testsuite/Makefile.am (check_PROGRAMS): Add
4682 tls_phdrs_script_test.
4683 (tls_phdrs_script_test_SOURCES): Define.
4684 (tls_phdrs_script_test_DEPENDENCIES): Define.
4685 (tls_phdrs_script_test_LDFLAGS): Define.
4686 (tls_phdrs_script_test_LDADD): Define.
4687 * testsuite/Makefile.in: Rebuild.
4688
4689 2010-03-23 Cary Coutant <ccoutant@google.com>
4690
4691 * fileread.cc (find_or_make_view): Fix comment.
4692
4693 2010-03-23 Ian Lance Taylor <iant@google.com>
4694
4695 * script-sections.cc (class Orphan_section_placement): Define
4696 PLACE_TLS and PLACE_TLS_BSS.
4697 (Orphan_section_placement::Orphan_section_placement): Initialize
4698 new places.
4699 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4700 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4701 (tls_script_test_SOURCES): Define.
4702 (tls_script_test_DEPENDENCIES): Define.
4703 (tls_script_test_LDFLAGS): Define.
4704 (tls_script_test_LDADD): Define.
4705 * testsuite/Makefile.in: Rebuild.
4706
4707 2010-03-22 Doug Kwan <dougkwan@google.com>
4708
4709 * arm.cc (Arm_relocate_functions::abs8,
4710 Arm_relocate_functions::abs16): Use correct check for overflow
4711 specified in the ARM ELF specs.
4712 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4713 target of a BLX instruction specially.
4714 (Reloc_stub::stub_type_for_reloc): Ditto.
4715 (Relocate::relocate): Use symbolic names instead of numeric relocation
4716 codes to report error.
4717 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4718 workaround.
4719 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4720 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4721 thumb2_blx_out_of_range.stdout
4722 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4723 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4724 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4725 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4726 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4727 thumb2_blx_in_range, thumb2_blx_in_range.o,
4728 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4729 thumb2_blx_out_of_range.o): New rules.
4730 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4731 thumb2_blx_in_range and thumb2_blx_out_of_range.
4732 * testsuite/Makefile.in: Regenerate.
4733 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4734 * testsuite/thumb_blx_in_range.s: New file.
4735 * testsuite/thumb_blx_out_of_range.s: New file.
4736
4737 2010-03-22 Rafael Espindola <espindola@google.com>
4738
4739 * archive.cc (Should_include): Move to archive.h.
4740 (should_include_member): Make it a member of Archive.
4741 (Lib_group): New.
4742 (Add_lib_group_symbols): New.
4743 * archive.h: Include options.h.
4744 (Archive_member): Moved from Archive.
4745 (Should_include): Moved from archive.cc.
4746 (Lib_group): New.
4747 (Add_lib_group_symbols): New.
4748 * dynobj.cc (do_should_include_member): New.
4749 * dynobj.h (do_should_include_member): New.
4750 * gold.cc (queue_initial_tasks): Update call to queue.
4751 * main.cc (main): Print lib group stats.
4752 * object.cc (do_should_include_member): New.
4753 * object.h: Include archive.h.
4754 (Object::should_include_member): New.
4755 (Object::do_should_include_member): New.
4756 (Sized_relobj::do_should_include_member): New.
4757 * options.cc (General_options::parse_start_lib): New.
4758 (General_options::parse_end_lib): New.
4759 (Input_arguments::add_file): Handle lib groups.
4760 (Input_arguments::start_group): Check we are not in a lib.
4761 (Input_arguments::start_lib): New.
4762 (Input_arguments::end_lib): New.
4763 * options.h (General_options): Add start_lib and end_lib.
4764 (Input_argument::lib_): New.
4765 (Input_argument::lib): New.
4766 (Input_argument::is_lib): New.
4767 (Input_file_lib): New.
4768 (Input_arguments::in_lib_): New.
4769 (Input_arguments::in_lib): New.
4770 (Input_arguments::start_lib): New.
4771 (Input_arguments::end_lib_): New.
4772 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4773 in unused members as preempted.
4774 (Sized_pluginobj::do_should_include_member): New.
4775 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4776 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4777 return the blocker.
4778 (Read_symbols::do_whole_lib_group): New.
4779 (Read_symbols::do_lib_group): New.
4780 (Read_symbols::do_read_symbols): Handle lib groups.
4781 (Read_symbols::get_name): Handle lib groups.
4782 * readsyms.h (Read_symbols): Add an archive member pointer.
4783 (Read_symbols::do_whole_lib_group): New.
4784 (Read_symbols::do_lib_group): New.
4785 (Read_symbols::member_): New.
4786 * script.cc (read_input_script): Update call to queue_soon.
4787
4788 2010-03-19 Doug Kwan <dougkwan@google.com>
4789
4790 * arm.cc (Stub_table::Stub_table): Initialize new data members
4791 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4792 (Stub_table::add_reloc_stub): Assign stub offset and update
4793 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4794 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4795 New data members.
4796 (Stub_table::update_data_size_and_addralign): Use
4797 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4798 instead of going over all reloc stubs.
4799 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4800 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4801 Stringpool_template::offset_ to size of Stringpool_char.
4802 (Stringpool_template::new_key_offset): Remove code to initialize
4803 Stringpool_template::offset_.
4804 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4805 Stringpool_template::offset_ to zero.
4806
4807 2010-03-15 Doug Kwan <dougkwan@google.com>
4808
4809 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4810 offset_.
4811 (Stringpool_template::new_key_offset): New method.
4812 (Stringpool_template::add_string): Assign offsets when adding new
4813 strings.
4814 (Stringpool_template::set_string_offsets): Do not set string offsets
4815 when not optimizing.
4816 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4817 member size_.
4818 (Chunked_vector::clear): Clear size_.
4819 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4820 (Chunked_vector::size): Return size_.
4821 (Chunked_vector::push_back): Use size_ to find insert position.
4822 (Chunked_vector::size_): New data member.
4823 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4824 (Stringpool_template::new_key_offset): New method declaration.
4825 (Stringpool_template::offset_): New data member.
4826
4827 2010-03-15 Rafael Espindola <espindola@google.com>
4828
4829 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4830 Add_symbols' constructor.
4831 * readsyms.h (Add_symbols): Remove the input_group member.
4832
4833 2010-03-10 Ian Lance Taylor <iant@google.com>
4834
4835 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4836 target to ask whether a reference to a symbol requires a stack
4837 split.
4838 * target.h (Target::is_call_to_non_split): New function.
4839 (Target::do_is_call_to_non_split): Declare virtual function.
4840 * target.cc: Include "symtab.h".
4841 (Target::do_is_call_to_non_split): New function.
4842 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4843
4844 2010-03-10 Cary Coutant <ccoutant@google.com>
4845
4846 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4847 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4848 (File_read::open[2]): Add whole_file_view_ to list of views.
4849 (File_read::make_view): Remove test of whole_file_view_.
4850 (File_read::find_or_make_view): Create whole_file_view_ if
4851 necessary.
4852 (File_read::clear_views): Replace bool parameter with enum;
4853 adjust all callers. Don't delete views with permanent data;
4854 do delete cached views and views from archives if
4855 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4856 if clearing the corresponding view.
4857 * fileread.h (File_read::Clear_views_mode): New enum.
4858 (File_read::View::is_permanent_view): New method.
4859 (File_read::clear_views): Replace bool parameter
4860 with enum; adjust all callers.
4861 * options.h (General_options): Change keep_files_mapped option;
4862 add map_whole_files.
4863 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4864 releasing the file.
4865 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4866 the file.
4867
4868 2010-03-10 David S. Miller <davem@davemloft.net>
4869
4870 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4871
4872 2010-03-09 Sriraman Tallam <tmsriram@google.com>
4873
4874 * icf.cc (get_section_contents): Add '@' marker after processing the
4875 merge reloc.
4876
4877 2010-03-08 Doug Kwan <dougkwan@google.com>
4878
4879 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4880 due to a conversion warning.
4881 (Arm_relobj::update_output_local_symbol_count): Check for local
4882 symbol with unset output index.
4883
4884 2010-03-05 Ian Lance Taylor <iant@google.com>
4885
4886 * options.h (class General_options): Add --spare-dynamic-tags.
4887 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4888 --spare-dynamic-tags.
4889
4890 2010-03-05 Ian Lance Taylor <iant@google.com>
4891
4892 * incremental.cc: Include "libiberty.h".
4893
4894 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4895
4896 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4897 function, is_info_ member.
4898 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4899 (Versions::Versions): Update caller.
4900 (Versions::define_base_version): Likewise.
4901 (Versions::add_def): Likewise.
4902
4903 2010-03-03 Sriraman Tallam <tmsriram@google.com>
4904
4905 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4906 (Scan::possible_function_pointer_reloc): New function.
4907 (Scan::local_reloc_may_be_function_pointer): Change to call
4908 possible_function_pointer_reloc.
4909 (Scan::global_reloc_may_be_function_pointer): Ditto.
4910 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4911 relocations in ".data.rel.ro._ZTV" section.
4912 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4913 * testsuite/icf_safe_so_test.cc: Ditto.
4914 * testsuite/icf_safe_test.cc: Ditto.
4915 * testsuite/icf_safe_test.sh: Ditto.
4916
4917 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4918 Ian Lance Taylor <iant@google.com>
4919
4920 * target-reloc.h (relocate_section): Check the symbol table index
4921 for -1U before setting the local symbol index.
4922 (scan_relocatable_relocs): If copying the relocation, record that
4923 the local symbol is required.
4924 * object.h (Symbol_value::is_output_symtab_index_set): New
4925 function.
4926 (Symbol_value::may_be_discarded_from_output_symtab): New
4927 function.
4928 (Symbol_value::has_output_symtab_entry): New function.
4929 (Symbol_value::needs_output_symtab_entry): Remove.
4930 (Symbol_value::output_symtab_index): Make sure the symbol index is
4931 set.
4932 (Symbol_value::set_output_symtab_index): Make sure the symbol
4933 index is not set. Make sure the new index is valid.
4934 (Symbol_value::set_must_have_output_symtab_entry): New function.
4935 (Symbol_value::has_output_dynsym_entry): New function.
4936 (Symbol_value::set_output_dynsym_index): Make sure the new index
4937 is valid.
4938 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4939 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4940 local symbol if permitted.
4941 (Sized_relobj::do_finalize_local_symbols): Call
4942 is_output_symtab_index_set rather than needs_output_symtab_entry.
4943 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4944 rather than needs_output_symtab_entry. Call
4945 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4946 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4947 is_output_symtab_index_set rather than needs_output_symtab_entry.
4948 * testsuite/discard_locals_relocatable_test.c: New file.
4949 * testsuite/discard_locals_test.sh: Test -r.
4950 * testsuite/Makefile.am (check_DATA): Add
4951 discard_locals_relocatable_test1.syms,
4952 discard_local_relocatable_test2.syms.
4953 (MOSTLYCLEANFILES): Likewise. Also add
4954 discard_locals_relocatable_test1.lout and
4955 discard_locals_relocatable_test2.out.
4956 (discard_locals_relocatable_test1.syms): New target.
4957 (discard_locals_relocatable_test.o): New target.
4958 (discard_locals_relocatable_test1.out): New target.
4959 (discard_locals_relocatable_test2.syms): New target.
4960 (discard_locals_relocatable_test2.out): New target.
4961 (various): Add missing ../ld-new dependencies.
4962 * testsuite/Makefile.in: Rebuild.
4963
4964 2010-03-03 Nick Clifton <nickc@redhat.com>
4965
4966 * po/fi.po: New Finnish translation.
4967
4968 2010-03-01 Doug Kwan <dougkwan@google.com>
4969
4970 * layout.cc (Layout::Layout): Force section types of .init_array*,
4971 .preinit_array* and .fini_array* sections.
4972 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4973 Fix check of return value of std::string::find.().
4974 (Output_section::Input_section_sort_compare::operator()): Remove
4975 comment about .init_array.
4976 (Output_section::Input_section_sort_init_fini_compare::operator()):
4977 New method.
4978 (Output_section::sort_attached_input_sections): Handle .init_array
4979 and .fini_array specially.
4980 * output.h (Output_section::Inut_section_sort_compare): Update
4981 comment.
4982 (Output_section::Input_section_sort_init_fini_compare): New struct.
4983
4984 2010-02-26 Doug Kwan <dougkwan@google.com>
4985
4986 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4987 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4988 * testsuite/debug_msg.sh: Avoid matching source line number for
4989 use of global variable undef_int.
4990
4991 2010-02-26 Doug Kwan <dougkwan@google.com>
4992
4993 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4994 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4995 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4996 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4997 * options.cc (General_options::General_options): Initialize member
4998 fix_v4bx_.
4999 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5000 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5001 and rm_no_fix_v4bx.stdout
5002 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5003 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5004 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5005 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5006 and arm_no_fix_v4bx.
5007 * Makefile.in: Regenerate.
5008 * testsuite/arm_fix_v4bx.s: New file.
5009 * testsuite/arm_fix_v4bx.sh: Ditto.
5010
5011 2010-02-24 Doug Kwan <dougkwan@google.com>
5012
5013 * arm.cc (Target_arm::got_section): Make the .got section the first
5014 non RELRO section in the data segment.
5015 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5016 suffixes of section names.
5017
5018 2010-02-24 Doug Kwan <dougkwan@google.com>
5019
5020 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5021 flags and attributes merging if an input file is a binary file.
5022 * fileread.cc (Input_file::open): Record format of original file.
5023 * fileread.h (Input_file::Format): New enum type.
5024 (Input_file::Input_file): Initialize data member format_.
5025 (Input_file::format): New method definition.
5026 (Input_file::format_):: New data member.
5027
5028 2010-02-24 Doug Kwan <dougkwan@google.com>
5029
5030 * arm.cc (Arm_output_data_got): New class.
5031 (ARM_TCB_SIZE): New constant
5032 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5033 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5034 If user uses a script with a SECTIONS clause, issue only a warning
5035 for a misplaced EXIDX input section. Otherwise, issue an error.
5036 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5037 garbage collection.
5038 (Target_arm::got_mode_index_entry): Handle static linking.
5039 (Target_arm::Scan::local): Ditto.
5040 (Target_arm::Scan::global): Ditto.
5041 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5042 all incorrectly implemented relocations.
5043 (Target_arm::fix_exidx_coverage): Pass layout to
5044 Arm_output_section::fix_exidx_coverage.
5045 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5046 from ".ARM.exidx." and ".ARM.extab.".
5047
5048 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5049
5050 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5051 section if it does not already exist.
5052 * attributes.cc (Attributes_section_data::Attributes_section_data):
5053 Don't crash if size is zero.
5054
5055 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5056 Ian Lance Taylor <iant@google.com>
5057
5058 * gold.cc (queue_middle_tasks): If no input files were opened,
5059 exit.
5060 * workqueue.h (Task_function::Task_function): Assert that there is
5061 a blocker.
5062
5063 2010-02-22 Doug Kwan <dougkwan@google.com>
5064
5065 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5066 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5067 types to avoid warnings due to different uint64_t implementations
5068 on different hosts.
5069
5070 2010-02-21 Doug Kwan <dougkwan@google.com>
5071
5072 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5073 handling of the maximum backward branch offset.
5074 (Arm_relocate_functions::thumb_branch_common): Ditto.
5075 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5076 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
5077 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
5078 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5079 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5080 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5081 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5082 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5083 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5084 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5085 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5086 thumb2_bl_out_of_range.o): New rules.
5087 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5088 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5089 thumb2_bl_out_of_range
5090 * testsuite/Makefile.in: Regenerate.
5091 * testsuite/arm_bl_in_range.s: New file.
5092 * testsuite/arm_bl_out_of_range.s: Ditto.
5093 * testsuite/arm_branch_in_range.sh: Ditto.
5094 * testsuite/arm_branch_range.t: Ditto.
5095 * testsuite/thumb2_branch_range.t: Ditto.
5096 * testsuite/thumb_bl_in_range.s: Ditto.
5097 * testsuite/thumb_bl_out_of_range.s: Ditto.
5098 * testsuite/thumb_branch_range.t: Ditto.
5099
5100 2010-02-20 Sriraman Tallam <tmsriram@google.com>
5101
5102 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5103 Add reloc offset information.
5104 * icf.cc (get_section_contents): Change iterators to point to the new
5105 vectors. Add reloc offset information to the contents.
5106 * icf.h (Icf::Sections_reachable_info): New typedef.
5107 (Icf::Sections_reachable_list): New typedef.
5108 (Icf::Offset_info): New typedef.
5109 (Icf::Reloc_info): New struct typedef.
5110 (Icf::Reloc_info_list): New typedef.
5111 (Icf::symbol_reloc_list): Delete method.
5112 (Icf::addend_reloc_list): Delete method.
5113 (Icf::section_reloc_list): Delete method.
5114 (Icf::reloc_info_list): New method.
5115 (Icf::reloc_info_list_): New member.
5116
5117 2010-02-19 Doug Kwan <dougkwan@google.com>
5118
5119 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5120 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5121 * arm.cc (Arm_relocation_functions): New forward declaration.
5122 (Target_arm::Target_arm): Initialize new data members
5123 got_mod_index_offset_ and tls_base_symbol_defined_.
5124 (Target_arm::Relocate::relocate_tls): New method.
5125 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5126 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5127 New methods.
5128 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5129 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5130 (Target_arm::got_mod_index_offset_,
5131 Target_arm::tls_base_symbol_defined_): New data members.
5132 (Target_arm::Scan::local, Target::Scan::global,
5133 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5134 relocations.
5135
5136 2010-02-18 Doug Kwan <dougkwan@google.com>
5137
5138 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5139 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5140 text section as a parameter becuase some broken tools may not set
5141 the link in section header.
5142 (Target_arm::has_got_section): New method.
5143 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5144 without any mapping symbol as data only. Remove warning.
5145 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5146 link in its section header, try to discover the link by inspecting the
5147 REL31 relocation at the beginning of the section.
5148 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5149 in error message.
5150 (Target_arm::Scan::global): Treat any reference to the symbol
5151 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5152
5153 2010-02-12 Sriraman Tallam <tmsriram@google.com>
5154
5155 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5156 (Scan::global_reloc_may_be_function_pointer): New function.
5157 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5158 (Scan::global_reloc_may_be_function_pointer): New function.
5159 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5160 (Scan::global_reloc_may_be_function_pointer): New function.
5161 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5162 (Scan::global_reloc_may_be_function_pointer): New function.
5163 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5164 (Scan::global_reloc_may_be_function_pointer): New function.
5165 (Scan::possible_function_pointer_reloc): New function.
5166 (Target_x86_64::can_check_for_function_pointers): New function.
5167 * gc.h (gc_process_relocs): Scan relocation types to determine if
5168 function pointers were taken for targets that support it.
5169 * icf.cc (Icf::find_identical_sections): Include functions for
5170 folding in safe ICF whose pointer is not taken.
5171 * icf.h (Secn_fptr_taken_set): New typedef.
5172 (fptr_section_id_): New member.
5173 (section_has_function_pointers): New function.
5174 (set_section_has_function_pointers): New function.
5175 (check_section_for_function_pointers): New function.
5176 * options.h: Fix comment for safe ICF option.
5177 * target.h (can_check_for_function_pointers): New function.
5178 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5179 Modify icf_safe_test for X86-64.
5180 * testsuite/Makefile.in: Regenerate.
5181 * testsuite/icf_safe_so_test.cc: New file.
5182 * testsuite/icf_safe_so_test.sh: New file.
5183 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5184 (main): Change to take pointer to function kept_func_3.
5185 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5186 folding is done correctly for X86-64.
5187
5188 2010-02-12 David S. Miller <davem@davemloft.net>
5189
5190 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5191 is_symbolless parameter.
5192 (Output_reloc<SHT_REL>::is_symbolless): New.
5193 (Output_reloc<SHT_REL>::is_symbolless_): New.
5194 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5195 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5196 (Output_reloc<SHT_RELA>::is_symbolless): New.
5197 (Output_data_reloc::add_global): Handle is_symbolless.
5198 (Output_data_reloc::add_global_relative): Likewise.
5199 (Output_data_reloc::add_local): Likewise.
5200 (Output_data_reloc::add_local_relative): Likewise.
5201 (Output_data_reloc::add_symbolless_global_addend): New.
5202 (Output_data_reloc::add_symbolless_local_addend): New.
5203 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5204 is_symbolless.
5205 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5206 instead of ->is_relative_
5207 (Output_reloc::write): Likewise.
5208 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5209 (Output_reloc::write_rel): Simplify.
5210
5211 * sparc.cc (Target_sparc::Scan::local): Use
5212 ->add_symbolless_local_addend as needed.
5213 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5214 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5215 based upon relocation offset.
5216
5217 2010-02-11 Doug Kwan <dougkwan@google.com>
5218
5219 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5220 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5221 beginning of function.
5222 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5223 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5224 parameter is_32bit in calls to should_apply_static_reloc.
5225 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5226 (check_DATA): Add arm_abs_global.stdout.
5227 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5228 arm_abs_global.stdout): New rules.
5229 (MOSTLLYCLEANFILES): Add arm_abs_global
5230 * Makefile.in: Regenerate.
5231 * testsuite/arm_abs_global.s: New file.
5232 * testsuite/arm_abs_global.sh: Ditto.
5233 * testsuite/arm_abs_lib.s: Ditto.
5234
5235 2010-02-11 Ian Lance Taylor <iant@google.com>
5236
5237 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5238 Read_relocs task.
5239 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5240 Allocate_commons_task first.
5241 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5242 task, rather than symtab_lock_.
5243 (Gc_process_relocs::~Gc_process_relocs): New function.
5244 (Gc_process_relocs::is_runnable): Check this_blocker_.
5245 (Gc_process_relocs::locks): Use next_blocker_ rather than
5246 blocker_.
5247 (Scan_relocs::~Scan_relocs): New function.
5248 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5249 symtab_lock_.
5250 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5251 next_blocker_.
5252 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5253 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5254 constructor accordingly.
5255 (class Gc_process_relocs): Likewise.
5256 (class Scan_relocs): Likewise.
5257 * common.h (class Allocate_commons_task): Remove symtab_lock_
5258 field, and corresponding constructor parameter.
5259 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5260 symtab_lock_.
5261 (Allocate_commons_task::locks): Likewise.
5262
5263 2010-02-11 Ian Lance Taylor <iant@google.com>
5264
5265 * gold-threads.h (class Once): Define.
5266 (class Initialize_lock): Rewrite as child of Once.
5267 * gold-threads.cc (class Once_initialize): Define.
5268 (once_pointer_control): New static variable.
5269 (once_pointer, once_arg): New static variables.
5270 (c_run_once): New static function.
5271 (Once::Once, Once::run_once, Once::internal_run): New functions.
5272 (class Initialize_lock_once): Remove.
5273 (initialize_lock_control): Remove.
5274 (initialize_lock_pointer): Remove.
5275 (initialize_lock_once): Remove.
5276 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5277 (Initialize_lock::initialize): Rewrite.
5278 (Initialize_lock::do_run_once): New function.
5279 * archive.cc (Archive::interpret_header): Only clear name if it is
5280 not already empty.
5281 * fileread.cc: Include "gold-threads.h"
5282 (file_counts_lock): New static variable.
5283 (file_counts_initialize_lock): Likewise.
5284 (File_read::release): Only increment counts when using --stats.
5285 Use a lock around the increment.
5286 * parameters.cc (class Set_parameters_target_once): Define.
5287 (set_parameters_target_once): New static variable.
5288 (Parameters::Parameters): Move here from parameters.h.
5289 (Parameters::set_target): Rewrite.
5290 (Parameters::set_target_once): New function.
5291 (Parameters::clear_target): Move here and rewrite.
5292 * parameters.h (class Parameters): Update declarations. Add
5293 set_parameters_target_once_ field.
5294 (Parameters::Parameters): Move to parameters.cc.
5295 (Parameters::clear_target): Likewise.
5296 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5297 task.
5298 (Start_group::~Start_group): New function.
5299 (Start_group::is_runnable): New function.
5300 (Start_group::locks, Start_group::run): New functions.
5301 (Finish_group::run): Change saw_undefined to size_t.
5302 * readsyms.h (class Start_group): Define.
5303 (class Finish_group): Change saw_undefined_ field to size_t.
5304 (Finish_group::Finish_group): Remove saw_undefined and
5305 this_blocker parameters. Change all callers.
5306 (Finish_group::set_saw_undefined): New function.
5307 (Finish_group::set_blocker): New function.
5308 * symtab.h (class Symbol_table): Change saw_undefined to return
5309 size_t. Change saw_undefined_ field to size_t.
5310 * target-select.cc (Set_target_once::do_run_once): New function.
5311 (Target_selector::Target_selector): Initialize set_target_once_
5312 field. Don't initialize lock_ and initialize_lock_ fields.
5313 (Target_selector::instantiate_target): Rewrite.
5314 (Target_selector::set_target): New function.
5315 * target-select.h (class Set_target_once): Define.
5316 (class Target_selector): Update declarations. Make
5317 Set_target_once a friend. Remove lock_ and initialize_lock_
5318 fields. Add set_target_once_ field.
5319
5320 2010-02-10 Ian Lance Taylor <iant@google.com>
5321
5322 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5323 queueing any tasks.
5324 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5325 (queue_middle_tasks): Add all blockers before queueing any tasks.
5326 (queue_final_tasks): Likewise.
5327 * token.h (Task_token::add_blockers): New function.
5328 * object.h (Input_objects::number_of_relobjs): New function.
5329
5330 2010-02-10 Ian Lance Taylor <iant@google.com>
5331
5332 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5333 shared, not if not position independent.
5334 * x86_64.cc (Relocate::relocate_tls): Likewise.
5335 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5336 (tls_pie_pic_test): New target.
5337 * testsuite/Makefile.in: Rebuild.
5338
5339 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5340 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5341 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5342 * testsuite/Makefile.in: Rebuild.
5343
5344 2010-02-09 David S. Miller <davem@davemloft.net>
5345
5346 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5347 R_SPARC_RELATIVE using ->add_local_relative().
5348 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5349
5350 * output.h (Output_data_dynamic::add_section_size): New method
5351 that takes two Output_data objects.
5352 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5353 entry param. Handle it in initializers.
5354 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5355 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5356 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5357 arg.
5358 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5359 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5360 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5361 for dynrel_includes_plt.
5362 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5363 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5364 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5365 before .rela.plt
5366 (Target_sparc::do_finalize_sections): Update to pass true for
5367 dynrel_includes_plt.
5368 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5369 output before .rela.plt
5370 (Target_powerpc::do_finalize_sections): Update to pass true for
5371 dynrel_includes_plt when 32-bit.
5372
5373 2010-02-08 Doug Kwan <dougkwan@google.com>
5374
5375 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5376 method.
5377 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5378 Arm_relobj::scan_section_for_cortex_a8_stubs,
5379 Arm_relobj::do_relocation_section): Instead of calling
5380 Output_section::output_address, use faster
5381 Arm_relobj::simple_input_section_output_address.
5382
5383 2010-02-08 David S. Miller <davem@davemloft.net>
5384
5385 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5386 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5387 relocation helper function.
5388
5389 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5390 just like R_SPARC_GOT{10,13,22}.
5391 (Target_sparc::Scan::local): Likewise.
5392 (Target_sparc::Relocate:relocate): Likewise.
5393
5394 2010-02-06 Ian Lance Taylor <iant@google.com>
5395
5396 * configure.ac: Rewrite targetobjs duplicate removal code to use
5397 only shell constructs.
5398 * configure: Rebuild.
5399
5400 2010-02-05 Doug Kwan <dougkwan@google.com>
5401
5402 PR 11247
5403 * arm.cc (Arm_relobj::section_is_scannable): New method.
5404 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5405 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5406
5407 2010-02-04 Doug Kwan <dougkwan@google.com>
5408
5409 PR 11247
5410 * arm-reloc-property.cc (cstdio): Include.
5411 * configure.ac (targetobjs): Remove duplicates.
5412 * configure: Regenerate.
5413 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5414 big and little endian version for a given address size.
5415
5416 2010-02-03 Doug Kwan <dougkwan@google.com>
5417
5418 * arm-reloc-property.cc
5419 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5420 definition.
5421 * arm-reloc-property.h
5422 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5423 New method definition.
5424 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5425 declaration.
5426 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5427 overflow to N.
5428 (GOT_PREL): Change implemented to Y.
5429 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5430 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5431 (Arm_relocate_functions::movw_abs_nc): Remove method.
5432 (Arm_relocate_functions::movt_abs): Ditto.
5433 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5434 (Arm_relocate_functions::thm_movt_abs): Ditto.
5435 (Arm_relocate_functions::movw_rel_nc): Ditto.
5436 (Arm_relocate_functions::movw_rel): Ditto.
5437 (Arm_relocate_functions::movt_rel): Ditto.
5438 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5439 (Arm_relocate_functions:thm_movw_rel): Ditto.
5440 (Arm_relocate_functions:thm_movt_rel): Ditto.
5441 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5442 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5443 New method definitions.
5444 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5445 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5446 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5447 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5448 (Target_arm::Relocate::relocate): Check for non-static or
5449 unimplemented relocation code and exit early. Change calls to
5450 Target_arm::reloc_uses_thumb_bit and
5451 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5452 instead. Refactor code to handle similar relocations to increase
5453 code sharing. Remove check for unsupported relocation code in switch
5454 statement.
5455 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5456 relocation property table to find out size. Change error message to
5457 print out the name of a relocation code instead of the numeric value.
5458 (Target_arm::scan_reloc_for_stub): Use relocation property table
5459 instead of calling Target_arm::reloc_uses_thumb_bit().
5460
5461 2010-02-02 Doug Kwan <dougkwan@google.com>
5462
5463 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5464 types of relaxed input section.
5465
5466 2010-02-02 Doug Kwan <dougkwan@google.com>
5467
5468 * Makefile.am (HFILES): Add arm-reloc-property.h.
5469 (DEFFILES): New.
5470 (TARGETSOURCES): Add arm-reloc-property.cc
5471 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5472 (libgold_a_SOURCES): $(DEFFILES)
5473 * Makefile.in: Regenerate.
5474 * arm-reloc-property.cc: New file.
5475 * arm-reloc-property.h: New file.
5476 * arm-reloc.def: New file.
5477 * arm.cc: Update comments.
5478 (arm-reloc-property.h): New included header.
5479 (arm_reloc_property_table): New global variable.
5480 (Target_arm::do_select_as_default_target): New method definition.
5481 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5482 arm-reloc-property to targ_extra_obj.
5483 * parameters.cc (set_parameters_target): Call
5484 Target::select_as_default_target().
5485 * target.h (Target::select_as_default_target): New method definition.
5486 (Target::do_select_as_default_target): Same.
5487
5488 2010-02-01 Doug Kwan <dougkwan@google.com>
5489
5490 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5491 first_output_text_section_.
5492 (Arm_exidx_fixup::first_output_text_section): New method definition.
5493 (Arm_exidx_fixup::first_output_text_section_): New data member.
5494 (Arm_exidx_fixup::process_exidx_section): Record the first text
5495 output section seen.
5496 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5497 and entsize in output section header.
5498
5499 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5500
5501 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5502 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5503 (Arm_relocate_functions::thm_alu11): New Method.
5504 (Arm_relocate_functions::thm_pc8): New Method.
5505 (Arm_relocate_functions::thm_pc12): New Method.
5506 (Target_arm::Scan::local): Handle the relocations.
5507 (Target_arm::Scan::global): Likewise.
5508 (Target_arm::Relocate::relocate): Likewise.
5509 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5510
5511 2010-01-29 Doug Kwan <dougkwan@google.com>
5512
5513 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5514 of relocation types as ld.
5515
5516 2010-01-29 Doug Kwan <dougkwan@google.com>
5517
5518 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5519 to public.
5520 (Arm_relocate_functions::thumb_branch_common): Ditto.
5521 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5522 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5523 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5524 Arm_relocate_functions::jump24): Remove.
5525 (Target_arm::Relocate::relocate): Adjust code to call
5526 Arm_relocation_functions::arm_branch_common and
5527 Arm_relocation_functions::thumb_branch_common instead of their removed
5528 wrappers. Merge switch-cases together to reduce source code size.
5529
5530 2010-01-29 Doug Kwan <dougkwan@google.com>
5531
5532 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5533 output_local_symbol_count_needs_update_.
5534 (Arm_relobj::output_local_symbol_count_needs_update,
5535 Arm_relobj::set_output_local_symbol_count_needs_update,
5536 Arm_relobj::update_output_local_symbol_count): New methods.
5537 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5538 member.
5539 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5540 of pointed function as in a R_ARM_PREL31 relocation.
5541 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5542 for output local symbol count updating.
5543 (Target_arm::do_relax): Update output local symbol counts in objects
5544 if necessary.
5545 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5546
5547 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5548
5549 * arm.cc: Added support for the ARM relocations:
5550 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5551 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5552 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5553 movw_prel_nc).
5554 (Arm_relocate_functions::movw_rel): New method.
5555 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5556 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5557 thm_movw_prel_nc).
5558 (Arm_relocate_functions::thm_movw_rel): New method.
5559 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5560 thm_movt_prel).
5561 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5562 relocations.
5563 (Target_arm::Scan::global): Likewise.
5564 (Target_arm::Relocate::relocate): Likewise.
5565 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5566 Likewise.
5567
5568 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5569
5570 * arm.cc: Added support for ARM group relocations.
5571 (Target_arm::reloc_needs_sym_origin): New method.
5572 (Arm_relocate_functions::calc_grp_kn): New method.
5573 (Arm_relocate_functions::calc_grp_residual): New method.
5574 (Arm_relocate_functions::calc_grp_gn): New method.
5575 (Arm_relocate_functions::arm_grp_alu): New Method.
5576 (Arm_relocate_functions::arm_grp_ldr): New Method.
5577 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5578 (Arm_relocate_functions::arm_grp_ldc): New Method.
5579 (Target_arm::Scan::local): Handle the ARM group relocations.
5580 (Target_arm::Scan::global): Likewise.
5581 (Target_arm::Relocate::relocate): Likewise.
5582 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5583 Likewise.
5584
5585 2010-01-26 Doug Kwan <dougkwan@google.com>
5586
5587 * arm.cc (set): Include.
5588 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5589 pointer type.
5590 (Arm_output_section::Text_section_list): New type.
5591 (Arm_output_section::append_text_sections_to_list): New method.
5592 (Arm_output_section::fix_exidx_coverage): Ditto.
5593 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5594 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5595 Relobj::set_section_offset() instead of
5596 Sized_relobj::invalidate_section_offset().
5597 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5598 parameter for section headers. Ignore relocation sections for
5599 unallocated sections and EXIDX sections.
5600 (Target_arm::fix_exidx_coverage): New method.
5601 (Target_arm::output_section_address_less_than): New type.
5602 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5603 linked text section instead of the EXIDX section.
5604 (Arm_output_section::create_stub_group): Add an assertion to check
5605 that this is not an EXIDX output section.
5606 (Arm_output_section::append_text_sections_to_list): New method.
5607 (Arm_output_section::fix_exidx_coverage): Ditto.
5608 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5609 Arm_relobj::section_needs_reloc_stub_scanning.
5610 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5611 first pass.
5612 (Target_arm::fix_exidx_coverage): New method.
5613 * object.h (Relobj::set_output_section): New method.
5614 (Sized_relobj::invalidate_section_offset): Remove method.
5615 (Sized_relobj::do_invalidate_section_offset): Remove method.
5616 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5617
5618 2010-01-25 Doug Kwan <dougkwan@google.com>
5619
5620 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5621 Fix warning due to signed and unsigned comparison on a 32-bit host.
5622
5623 2010-01-22 Doug Kwan <dougkwan@google.com>
5624
5625 * arm.cc (Target_arm::do_relax): Record an output section for section
5626 offset adjustment it contains any stub table that has changed.
5627 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5628 offsets in an output section if necessary.
5629 * output.cc (Output_section::Output_section): Initialize
5630 section_offsets_need_adjustments_.
5631 (Output_section::add_input_section_for_script): Renamed to
5632 Output_section::add_simple_input_section.
5633 (Output_section::save_states): Add a comment.
5634 (Output_section::discard_states): New method defintion.
5635 (Output_section::adjust_section_offsets): Same.
5636 * output.h (Output_section::add_input_section_for_script): Renamed to
5637 Output_section::add_simple_input_section.
5638 (Output_section::discard_states): New method declaration.
5639 (Output_section::adjust_section_offsets): Same.
5640 (Output_section::section_offsets_need_adjustment,
5641 Output_section::set_section_offsets_need_adjustment): New method
5642 definitions.
5643 (Output_section::section_offsets_need_adjustment_): New data member.
5644 * script-sections.cc
5645 (Output_section_element_input::set_section_address): Adjust code for
5646 renaming of Output_section::add_input_section_for_script.
5647 (Orphan_output_section::set_section_address): Same.
5648
5649 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5650
5651 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5652 Fix_v4bx enum values .
5653 * gold/options.h (General_options): New option definitions.
5654 (General_options::fix_v4bx): New method.
5655 (General_options::Fix_v4bx): New enum.
5656 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5657 (General_options::parse_fix_v4bx_interworking): New method.
5658
5659 2010-01-22 Doug Kwan <dougkwan@google.com>
5660
5661 * arm.cc (Arm_exidx_fixup): New class.
5662
5663 2010-01-21 Doug Kwan <dougkwan@google.com>
5664
5665 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5666 classes.
5667 (Arm_exidx_section_offset_map): New type.
5668
5669 2010-01-21 Doug Kwan <dougkwan@google.com>
5670
5671 * arm.cc (Arm_exidx_input_section): New class.
5672 (Arm_relobj::exidx_input_section_by_link,
5673 Arm_relobj::exidx_input_section_by_shndx,
5674 Arm_relobj::make_exidx_input_section): New methods.
5675 (read_arm_attributes_section): Remove.
5676 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5677 information about them.
5678 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5679 to here.
5680
5681 2010-01-20 Doug Kwan <dougkwan@google.com>
5682
5683 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5684 Input_section_specifier to Section_id.
5685 (Target_arm::new_arm_input_section: Adjust code for change of key
5686 type.
5687 (Target_arm::find_arm_input_section): Ditto.
5688 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5689 (Section_id): Remove.
5690 (Garbage_collection::Section_id_hash): Remove.
5691 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5692 (Section_id): Remove.
5693 (Icf::Section_id_hash): Remove.
5694 * object.h (Section_id, Const_section_id, Section_id_hash,
5695 Const_section_id_hash): New type definitions.
5696 * output.cc (Output_section::add_relaxed_input_section): Change to
5697 use Const_section_id instead of Input_section_specifier as key type.
5698 (Output_section::add_merge_input_section): Ditto.
5699 (Output_section::build_relaxation_map): Change to use Section_id
5700 instead of Input_section_specifier as key type.
5701 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5702 Ditto.
5703 (Output_section::convert_input_sections_to_relaxed_sections): Change
5704 to use Const_section_id instead of Input_section_specifier as key type.
5705 (Output_section::find_merge_section): Ditto.
5706 (Output_section::find_relaxed_input_section): Ditto.
5707 * output.h (Input_section_specifier): Remove class.
5708 (Output_section::Output_section_data_by_input_section_map): Change
5709 key type to Const_section_id.
5710 (Output_section::Output_relaxed_input_section_by_input_section_map):
5711 Ditto.
5712 (Output_section::Relaxation_map): Change key type to Section_id.
5713
5714 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5715
5716 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5717 (class Arm_v4bx_stub): New class.
5718 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5719 (Stub_factory::make_arm_v4bx_stub): New method.
5720 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5721 (Stub_table::empty): Handle v4bx stubs.
5722 (Stub_table::add_arm_v4bx_stub): New method.
5723 (Stub_table::find_arm_v4bx_stub): New method.
5724 (Arm_relocate_functions::v4bx): New method.
5725 (Target_arm::fix_v4bx): New method.
5726 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5727 (Stub_table::relocate_stubs): Likewise.
5728 (Stub_table::do_write): Likewise.
5729 (Stub_table::update_data_size_and_addralign): Likewise.
5730 (Stub_table::finalize_stubs): Likewise.
5731 (Target_arm::Scan::local): Likewise.
5732 (Target_arm::Scan::global): Likewise.
5733 (Target_arm::do_finalize_sections): Likewise.
5734 (Target_arm::Relocate::relocate): Likewise.
5735 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5736 Likewise.
5737 (Target_arm::scan_reloc_for_stub): Likewise.
5738 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5739
5740 2010-01-19 Ian Lance Taylor <iant@google.com>
5741
5742 * output.cc (Output_section_headers::do_sized_write): Write large
5743 segment count to sh_info field.
5744 (Output_file_header::do_sized_write): For large segment count,
5745 write PN_XNUM to e_phnum field.
5746
5747 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5748
5749 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5750 (Arm_relocate_functions::thm_jump8): New function.
5751 (Arm_relocate_functions::thm_jump11): New function.
5752 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5753 R_ARM_THM_JUMP11.
5754 (Target_arm::Scan::global): Likewise.
5755 (Target_arm::Relocate::relocate): Likewise.
5756 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5757 Likewise.
5758
5759 2010-01-14 Doug Kwan <dougkwan@google.com>
5760
5761 * arm.cc (map, utility): Include headers.
5762 (Target_arm::apply_cortex_a8_workaround): New method.
5763 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5764 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5765 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5766 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5767 the --[no-]fix-cortex-a8 command line options.
5768 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5769 (Target_arm::relocate_stub): Use addend in instruction template.
5770 * options.h (DEFINE_bool): Set the user-set flag.
5771 (General_options): Add --[no-]-fix-cortex options.
5772 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
5773 : Update fast look-up map after conversion.
5774
5775 2010-01-14 Sriraman Tallam <tmsriram@google.com>
5776
5777 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5778 in the first pass of do_layout.
5779
5780 2010-01-13 Doug Kwan <dougkwan@google.com>
5781
5782 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5783 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5784 apparent compiler problem of not folding static constant integral
5785 data members of elfcpp::Elf_sizes<32>.
5786
5787 2010-01-13 Doug Kwan <dougkwan@google.com>
5788
5789 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5790 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5791 Arm_relobj::scan_section_for_cortex_a8_erratum,
5792 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5793 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5794 sections to scan for relocation stubs into a new method
5795 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5796 relocation and Cortex-A8 stub scanning.
5797 (Target_arm::do_relax): Force stubs to be after stubbed sections
5798 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
5799 the beginning of a new relaxation pass. Update a comment.
5800 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5801
5802 2010-01-12 Ian Lance Taylor <iant@google.com>
5803
5804 * target-reloc.h (visibility_error): New inline function.
5805 (relocate_section): Call visibility_error.
5806 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5807 (MOSTLYCLEANFILES): Likewise.
5808 (protected_4_pic.o, protected_3.err): New targets.
5809 * testsuite/protected_4.cc: New file.
5810
5811 2010-01-12 Doug Kwan <dougkwan@google.com>
5812
5813 * arm.cc (Cortex_a8_reloc): New class.
5814 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5815 and cortex_a8_relocs_info_.
5816 (Target_arm::fix_cortex_a8): New method definition.
5817 (Target_arm::Cortex_a8_relocs_info): New type.
5818 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5819 New data member declarations.
5820 (Target_arm::scan_reloc_for_stub): Record information about
5821 relocations for THUMB branches that might be exempted from the
5822 Cortex-A8 workaround.
5823 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5824 at the beginning of a relaxation pass.
5825
5826 2010-01-12 Doug Kwan <dougkwan@google.com>
5827
5828 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5829 (Arm_relobj::Mapping_symbol_position,
5830 Arm_reloj::Mapping_symbol_position_less,
5831 Arm_relobj::Mapping_symbols_info): New types.
5832 (Target_arm::is_mapping_symbol_name): New method definition.
5833 (Arm_relobj::do_count_local_symbols): Save information about mapping
5834 symbols.
5835
5836 2010-01-11 Doug Kwan <dougkwan@google.com>
5837
5838 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5839 Arm_relocate_functions::thumb32_branch_upper,
5840 Arm_relocate_functions::thumb32_branch_lower,
5841 Arm_relocate_functions::thumb32_cond_branch_offset,
5842 Arm_relocate_functions::thumb32_cond_branch_upper,
5843 Arm_relocate_functions::thumb32_cond_branch_lower,
5844 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5845 branch offset encoding.
5846 (Arm_relocate_functions::thumb_branch_common): Use new branch
5847 offset encoding methods to avoid code duplication.
5848 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5849 (Stub_addend_reader::operator()): Use new branch encoding method
5850 to avoid code duplication.
5851
5852 2010-01-11 Doug Kwan <dougkwan@google.com>
5853
5854 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5855 (Target_arm::do_finalize_sections): Define special EXIDX section
5856 symbols only if referenced.
5857 * gc.h (Garbage_collection::add_reference): New method.
5858 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5859 code duplication.
5860
5861 2010-01-11 Ian Lance Taylor <iant@google.com>
5862
5863 * script.cc (Version_script_info::build_expression_list_lookup):
5864 Change complaing about duplicate wildcard match from error to
5865 warning.
5866
5867 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5868 of 2009-12-30.
5869 (Version_script_info::Version_script_info): Initialize globs_,
5870 default_version_, default_is_global_, and exact_. Don't
5871 initialize globals_ or locals_.
5872 (Version_script_info::build_lookup_tables): Build local symbols
5873 first.
5874 (Version_script_info::unquote): New function.
5875 (Version_script_info::add_exact_match): New function.
5876 (Version_script_info::build_expression_list_lookup): Remove lookup
5877 parameter. Add is_global parameter. Change all callers. Handle
5878 wildcard pattern specially. Unquote pattern. Call
5879 add_exact_match.
5880 (Version_script_info::get_name_to_match): New function.
5881 (Version_script_info::get_symbol_version): New function.
5882 (Version_script_info::get_symbol_version_helper): Remove.
5883 (Version_script_info::check_unmatched_names): Call unquote.
5884 * script.h (class Version_script_info): Change get_symbol_version
5885 to be non-inline and add is_global parameter; change all callers.
5886 Rewrite symbol_is_local. Update declarations. Define struct
5887 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5888 Remove globals_ and locals_ members. Add exact_, globs_,
5889 default_version_, is_global_.
5890 (Version_script_info::Glob): Remove pattern, add expression and
5891 is_global. Update constructor. Change all callers.
5892 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5893 default version.
5894 (Versions::symbol_section_contents): If a symbol is undefined, or
5895 defined in a dynamic object, set the version index to
5896 VER_NDX_LOCAL.
5897 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5898 symbol_is_local.
5899 (Symbol_table::add_from_pluginobj): Likewise.
5900 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5901
5902 2010-01-11 Doug Kwan <dougkwan@google.com>
5903
5904 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5905 (incremental_dump_LDADD): Add linking option for libintl.
5906 * Makefile.in: Regenerate.
5907
5908 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5909
5910 PR gold/11144
5911 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5912 instead of -Ds.
5913 * testsuite/Makefile.in: Regenerated.
5914
5915 2010-01-10 Doug Kwan <dougkwan@google.com>
5916
5917 * options.h (DEFINE_var): Use parentheses around argument varname__
5918 in macro body to avoid any unintended subsequent substitutions.
5919
5920 2010-01-10 Ian Lance Taylor <iant@google.com>
5921
5922 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5923 candidates before doing symbol resolution.
5924
5925 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5926 ODR candidates if only one is weak.
5927
5928 2010-01-08 Ian Lance Taylor <iant@google.com>
5929
5930 * script.cc (Version_script_info::build_expression_list_lookup):
5931 Don't warn about ambiguous version, just record the ambiguity.
5932 (Version_script_info::get_symbol_version_helper): Give error if
5933 version is ambiguous.
5934
5935 2010-01-08 Doug Kwan <dougkwan@google.com>
5936
5937 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5938 prev_data_size_ and prev_addralign_. Remove initializer for
5939 deleted data member has_been_changed_.
5940 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5941 to determine if the table is empty.
5942 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5943 Remove.
5944 (Stub_table::add_reloc_stub): Define method in class definition
5945 instead of just declaring it there.
5946 (Stub_table::add_cortex_a8_stub): New method definition.
5947 (Stub_table::update_data_size_and_addralign): Ditto.
5948 (Stub_table::finalize_stubs): Ditto.
5949 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5950 (Stub_table::do_addralign_): Return address alignment in the
5951 (Stub_table::do_reset_address_and_file_offset): Define method in
5952 class definition instead of declaring it there. Set current data
5953 size to be the data size of the previous pass.
5954 (Stub_table::set_final_data_size): Use current data size as the
5955 final data size.
5956 (Stub_table::relocate_stub): Change parameter type of stub from
5957 Reloc_stub pointer to Stub pointer.
5958 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5959 (Stub_table::Cortex_a8_stub_list): New typedef.
5960 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5961 Stub_table::prev_addralign_): New data member.
5962 (Arm_relobj::Arm_relobj): Initialize data member
5963 section_has_cortex_a8_workaround_.
5964 (Arm_relobj::section_has_cortex_a8_workaround,
5965 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5966 definitions.
5967 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5968 declarations.
5969 (Target_arm::relocate_stub): Change parameter type of stub from
5970 Reloc_stub pointer to Stub pointer.
5971 (Insn_template::size, Insn_template::alignment): Handle
5972 THUMB16_SPECIAL_TYPE.
5973 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5974 Stub_table::update_data_size_and_addralign,
5975 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5976 definitions.
5977 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5978 (Stub_table::do_write): Ditto.
5979 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5980
5981 2010-01-08 Ian Lance Taylor <iant@google.com>
5982
5983 PR 11108
5984 * symtab.h (class Symbol): Remove fields is_target_special_ and
5985 has_plt_offset_. Add field is_defined_in_discarded_section_.
5986 (Symbol::is_defined_in_discarded_section): New function.
5987 (Symbol::set_is_defined_in_discarded_section): New function.
5988 (Symbol::has_plt_offset): Rewrite.
5989 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5990 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5991 Don't initialize is_target_special_ or has_plt_offset_.
5992 Initialize is_defined_in_discarded_section_.
5993 (Symbol_table::add_from_relobj): If appropriate, set
5994 is_defined_in_discarded_section.
5995 * resolve.cc (Symbol::override_base_with_special): Don't test
5996 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5997 * target-reloc.h (relocate_section): Do special handling for
5998 symbols defined in discarded sections for global symbols as well
5999 as local symbols.
6000
6001 2010-01-08 Ian Lance Taylor <iant@google.com>
6002
6003 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6004 the SHT_SYMTAB case.
6005
6006 2010-01-08 Ian Lance Taylor <iant@google.com>
6007
6008 * object.cc (Sized_relobj::do_layout): Don't get confused if
6009 layout_eh_frame returns NULL.
6010
6011 2010-01-08 Ian Lance Taylor <iant@google.com>
6012
6013 PR 11084
6014 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6015 dynamic symbol table, use the normal symbol table.
6016 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6017 symbol table.
6018
6019 2010-01-08 Ian Lance Taylor <iant@google.com>
6020
6021 PR 11072
6022 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6023 sections.
6024
6025 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6026
6027 * version.cc (print_version): Change to "Copyright 2010".
6028
6029 2010-01-08 Ian Lance Taylor <iant@google.com>
6030
6031 PR 10287
6032 PR 11063
6033 * i386.cc (class Target_i386): Change return type of plt_section
6034 to be non-const.
6035 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6036 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6037 tls_desc_rel_ field.
6038 (Output_data_plt_i386::rel_tls_desc): New function.
6039 (Target_i386::rel_tls_desc_section): New function.
6040 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6041 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6042 R_386_TLS_DESC reloc in rel_tls_desc_section.
6043 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6044 Define struct Tlsdesc_info.
6045 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6046 (Target_x86_64::do_reloc_symbol_index): New function.
6047 (Target_x86_64::add_tlsdesc_info): New function.
6048 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6049 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6050 tlsdesc_rel_ field.
6051 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6052 all callers.
6053 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6054 (Target_x86_64::rela_tlsdesc_section): New function.
6055 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6056 handling.
6057 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6058 (Target_x86_64::do_reloc_addend): New function.
6059 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6060 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6061 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6062 (Output_reloc::type): New function.
6063 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6064 (Output_reloc::is_target_specific): New function.
6065 (Output_reloc::target_arg): New function.
6066 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6067 absolute relocs and target specific relocs.
6068 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6069 add_target_specific.
6070 (class Output_data_reloc) [SHT_RELA]: Likewise.
6071 * output.cc (Output_reloc::Output_reloc): Add four new versions
6072 for absolute relocs and target specific relocs.
6073 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6074 (Output_reloc::get_symbol_index): Likewise.
6075 (Output_reloc::local_section_offset): Check that local_sym_index_
6076 is not TARGET_CODE or 0.
6077 (Output_reloc::symbol_value): Likewise.
6078 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6079 reloc.
6080 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6081 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6082 functions.
6083 * layout.cc (add_target_dynamic_tags): Use output section for
6084 DT_PLTRELSZ and DT_JMPREL.
6085
6086 2010-01-07 Ian Lance Taylor <iant@google.com>
6087
6088 PR 11061
6089 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6090 function.
6091 (class Output_data_reloc_generic): Define.
6092 (class Output_data_reloc_base): Change base class to
6093 Output_data_reloc_generic. Change add() method to call
6094 bump_relative_reloc_count for a relative reloc. Remove
6095 sort_relocs_ field.
6096 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6097 to sort_relocs().
6098 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6099 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6100 appropriate.
6101 * layout.h (class Layout): Update declaration.
6102
6103 2010-01-07 Ian Lance Taylor <iant@google.com>
6104
6105 * output.h (class Output_data): Add const version of
6106 output_section and do_output_section.
6107 (class Output_section_data): Add const version of
6108 do_output_section.
6109 (class Output_section): Likewise.
6110 * layout.cc (Layout::add_target_dynamic_tags): New function.
6111 * layout.h (class Layout): Update declarations.
6112 * arm.cc (Target_arm::do_finalize_sections): Use
6113 add_target_dynamic_tags.
6114 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6115 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6116 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6117 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6118
6119 2010-01-07 Ian Lance Taylor <iant@google.com>
6120
6121 PR 11042
6122 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6123 object as needed.
6124
6125 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6126 Ian Lance Taylor <iant@google.com>
6127
6128 PR 11019
6129 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6130 Xindex::read_symtab_xindex.
6131
6132 2010-01-07 Doug Kwan <dougkwan@google.com>
6133
6134 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6135 (Insn_template::thumb16_bcond_insn): New method declaration.
6136 (Insn_template): Fix spelling.
6137 (Stub::thumb16_special): New method declaration.
6138 (Stub::do_write): Define virtual method which was previously pure
6139 virtual.
6140 (Stub::do_thumb16_special): New method declaration.
6141 (Stub::do_fixed_endian_write): New template member.
6142 (Reloc_stub::do_write): Remove.
6143 (Reloc_stub::do_fixed_endian_write): Remove.
6144 (Cortex_a8_stub): New class definition.
6145 (Stub_factory::make_cortex_a8_stub): New method definition.
6146 (Stub_factory::Stub_factory): Add missing static storage class
6147 qualifier for elf32_arm_stub_a8_veneer_blx.
6148
6149 2010-01-07 Ian Lance Taylor <iant@google.com>
6150
6151 PR 10980
6152 * options.h (class General_options): Add --warn-unresolved-symbols
6153 and --error-unresolved-symbols.
6154 * errors.cc (Errors::undefined_symbol): Implement
6155 --warn-unresolved-symbols.
6156
6157 * options.h (class General_options): Add -z text and -z textoff.
6158 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6159
6160 2010-01-06 Sriraman Tallam <tmsriram@google.com>
6161
6162 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6163 (Garbage_collection::cident_sections): New function.
6164 (Garbage_collection::add_cident_section): New function.
6165 (Garbage_collection::cident_sections_): New member.
6166 (gc_process_relocs): Add references to sections whose names are C
6167 identifiers.
6168 * gold.h (cident_section_start_prefix): New constant.
6169 (cident_section_stop_prefix): New constant.
6170 (is_cident): New function.
6171 * layout.cc (Layout::define_section_symbols): Replace string constants
6172 with the newly defined constants.
6173 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6174 C identifiers.
6175 * testsuite/Makefile.am: Add gc_orphan_section_test.
6176 * testsuite/Makefile.in: Regenerate.
6177 * testsuite/gc_orphan_section_test.cc: New file.
6178 * testsuite/gc_orphan_section_test.sh: New file.
6179
6180 2010-01-06 Ian Lance Taylor <iant@google.com>
6181
6182 PR 10980
6183 * options.h (class General_options): Add --warn-shared-textrel.
6184 * layout.cc (Layout::finish_dynamic_section): Implement
6185 --warn-shared-textrel.
6186
6187 PR 10980
6188 * options.h (class General_options): Add --warn-multiple-gp.
6189
6190 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6191
6192 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6193 $(THREADSLIB) and $(LIBDL).
6194 * Makefile.in: Rebuild.
6195
6196 2010-01-06 Ian Lance Taylor <iant@google.com>
6197
6198 PR 10980
6199 * options.cc (General_options::parse_section_start): New function.
6200 (General_options::section_start): New function.
6201 (General_options::General_options): Initialize all members.
6202 * options.h: Include <map>
6203 (class General_options): Add --section-start. Add section_starts_
6204 member.
6205 * layout.cc (Layout::attach_allocated_section_to_segment): If
6206 --section-start was used, set the address of the segment. Remove
6207 local sort_sections.
6208 (Layout::relaxation_loop_body): If the address of the load segment
6209 has been set by --section-start, don't use it.
6210 * output.h (Output_segment::update_flags_for_output_section): New
6211 function.
6212 * output.cc (Output_segment::add_output_section): Call
6213 update_flags_for_output_section.
6214
6215 2010-01-05 Ian Lance Taylor <iant@google.com>
6216
6217 PR 10980
6218 * options.h (class General_options): Add --undefined-version.
6219 * script.cc (struct Version_expression): Add was_matched_by_symbol
6220 field.
6221 (Version_script_info::matched_symbol): New function.
6222 (Version_script_info::get_symbol_version_helper): Call
6223 matched_symbol.
6224 (Version_script_info::check_unmatched_names): New function.
6225 * script.h (class Version_script_info): Update declarations.
6226 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6227
6228 * options.h (class General_options): Use DEFINE_bool_alias for
6229 allow_multiple_definition.
6230 * resolve.cc (Symbol_table::should_override): Don't test
6231 allow_multiple_definition.
6232
6233 PR 10980
6234 * options.h (class General_options): Add --cref.
6235 * main.cc (main): Print cref table if --cref. Don't close mapfile
6236 until after printing cref table.
6237 * cref.cc: Include "symtab.h".
6238 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6239 (Cref_table_compare::operator()): New function.
6240 (Cref_inputs::gather_cref): New function.
6241 (filecol): New static const.
6242 (Cref_inputs::print_cref): New function.
6243 (Cref::print_cref): New function.
6244 * cref.h: Include <cstdio>.
6245 (class Cref): Update declarations.
6246 * mapfile.h (Mapfile::file): New function.
6247 * object.h (class Object): Define Symbols. Declare virtual
6248 do_get_global_symbols.
6249 (Object::get_global_symbols): New function.
6250 * object.cc (Input_objects::add_object): Pass object to cref_ if
6251 --cref.
6252 (Input_objects::archive_start): Likewise.
6253 (Input_objects::archive_stop): Likewise.
6254 (Input_objects::print_cref): New function.
6255 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6256 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6257 --cref.
6258 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6259 function.
6260 * plugin.h (class Sized_pluginobj): Update declarations.
6261
6262 2010-01-05 Ian Lance Taylor <iant@google.com>
6263
6264 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6265 to is_default_version. Rename insdef to insdefault.
6266 (Symbol_table::add_from_relobj): Rename def to is_default_version
6267 and local to is_forced_local.
6268 (Symbol_table::add_from_pluginobj): Likewise.
6269 (Symbol_table::add_from_dynobj): Likewise.
6270 (Symbol_table::define_special_symbol): Rename insdef to
6271 insdefault.
6272
6273 2010-01-04 Ian Lance Taylor <iant@google.com>
6274
6275 PR 10980
6276 * options.h (class General_options): Add
6277 --allow-multiple-definition and -z muldefs.
6278 * resolve.cc (Symbol_table::should_override): Don't warn about a
6279 multiple symbol definition if --allow-multiple-definition or -z
6280 muldefs.
6281
6282 PR 10980
6283 * options.h (class General_options): Add --add-needed and
6284 --copy-dt-needed-entries. Tweak --as-needed help entry.
6285 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6286 error if --copy-dt-needed-entries aka --add-needed is used and
6287 would cause a change in behaviour.
6288
6289 PR 10980
6290 * options.h (class General_options): Add -G as a short version of
6291 --shared. Add no-op options -assert, -g, and -i.
6292
6293 2010-01-04 Sriraman Tallam <tmsriram@google.com>
6294
6295 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6296 check for .text or .gnu.linkonce.t sections.
6297 * icf.cc (Icf::find_identical_sections): Ditto.
6298 Change the detection for mangled function name within the section
6299 name.
6300 * icf.h (is_section_foldable_candidate): New function.
6301
6302 2009-12-30 Ian Lance Taylor <iant@google.com>
6303
6304 PR 10980
6305 * options.h (class General_options): Permit two dashes with
6306 --retain-symbols-file.
6307
6308 2009-12-30 Ian Lance Taylor <iant@google.com>
6309
6310 PR 10979
6311 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6312 don't put the file header and segment headers in the text
6313 segment.
6314
6315 PR 10979
6316 * common.cc (Sort_commons::operator()): Stabilize sort when both
6317 entries are NULL.
6318 (Symbol_table::do_allocate_commons_list): When allocating common
6319 symbols, skip a symbol which is no longer common.
6320 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6321 an object before checking its type.
6322 * testsuite/common_test_2.c: New file.
6323 * testsuite/common_test_3.c: New file.
6324 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6325 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6326 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6327 (common_test_2_pic.o, common_test_2.so): New targets.
6328 (common_test_3_pic.o, common_test_3.so): New targets.
6329 * testsuite/Makefile.in: Rebuild.
6330
6331 PR 10979
6332 * script.cc (read_input_script): If we see a new SECTIONS clause,
6333 and we have added an input section, give an error.
6334 * layout.h (class Layout): Add have_added_input_section function.
6335 Add have_added_input_section_ field.
6336 * layout.cc (Layout::Layout): Initialize
6337 have_added_input_section_.
6338 (Layout::layout): Set have_added_input_section_.
6339 (Layout::layout_eh_frame): Likewise.
6340
6341 2009-12-30 Ian Lance Taylor <iant@google.com>
6342
6343 PR 10931
6344 * options.h (class General_options): Add --sort-common option.
6345 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6346 * common.cc (Sort_common): Add sort_order parameter to
6347 constructor. Add sort_order_ field.
6348 (Sort_commons::operator): Check sort_order_.
6349 (Symbol_table::allocate_commons): Determine the sort order.
6350 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6351 Change all callers.
6352 (Symbol_table::do_allocate_commons_list): Likewise.
6353
6354 2009-12-30 Ian Lance Taylor <iant@google.com>
6355
6356 PR 10916
6357 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6358 symbols from this object, don't change the visibility of an
6359 undefined symbol.
6360 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6361
6362 2009-12-30 Ian Lance Taylor <iant@google.com>
6363
6364 PR 10861
6365 * script.h (class Version_script_info): Define Language enum.
6366 Update declarations. Define Glob, Exact, and Lookup types. Add
6367 new fields globals_, locals_, and is_finalized_.
6368 * script.cc: Various formatting fixes.
6369 (class Parser_closure): Change language_stack_ from a vector of
6370 std::string to one of Version_script_info::Language. Adjust all
6371 uses accordingly.
6372 (class Lazy_demangler): Remove.
6373 (struct Version_expression): Change language from std::string to
6374 Version_script_info::Language.
6375 (Version_script_info::Version_script_info): New function.
6376 (Version_script_info::~Version_script_info): Don't call clear.
6377 (Version_script_info::finalize): New function.
6378 (Version_script_info::build_lookup_tables): New function.
6379 (Version_script_info::build_expression_list_lookup): New
6380 function.
6381 (Version_script_info::get_symbol_version_helper): Rewrite to use
6382 lookup tables.
6383 (Version_script_info::print_expression_list): Adjust to use
6384 Version_script_info::Language.
6385 (script_push_lex_into_version_mode): Check that the version script
6386 has not been finalized.
6387 (version_script_push_lang): Change language string to
6388 Version_script_info::Language.
6389 * options.cc (Command_line::version_script): New function.
6390 * options.h (class General_options): Add finalize_dynamic_list
6391 function. Change version_script from declaration to definition.
6392 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6393 * testsuite/version_script.map: Remove duplicate def of foo.
6394 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6395 version_script.map.
6396 * testsuite/Makefile.in: Rebuild.
6397
6398 2009-12-30 Ian Lance Taylor <iant@google.com>
6399
6400 PR 10843
6401 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6402 if the input symbol index is 0, make the output symbol index 0.
6403
6404 2009-12-30 Ian Lance Taylor <iant@google.com>
6405
6406 PR 10670
6407 * options.h (class General_options): Add -x/--discard-all.
6408 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6409 --discard-all. If the local symbol needs a dynamic entry, check
6410 that before handling --discard-locals.
6411
6412 2009-12-30 Ian Lance Taylor <iant@google.com>
6413
6414 PR 10450
6415 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6416 flags to PF_R.
6417 (Output_segment::add_output_section): Don't change the flags if
6418 the type is PT_TLS.
6419
6420 PR 10450
6421 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6422 GNU hash table if they need a dynamic value. Otherwise, don't add
6423 them if they are defined in a dynamic object or are forced local.
6424
6425 2009-12-29 Ian Lance Taylor <iant@google.com>
6426
6427 PR 10450
6428 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6429 .gnu.hash table for a 32-bit target.
6430
6431 PR 10450
6432 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6433 regular and a dynamic object only needs a dynamic symbol table
6434 entry if it is externally visible.
6435
6436 PR 10450
6437 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6438 constructor. Add global_offset_table_ field.
6439 (Target_i386::got_section): Set global_offset_table_.
6440 (Target_i386::do_finalize_sections): Set global_offset_table_
6441 size.
6442 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6443 in constructor. Add global_offset_table_ field.
6444 (Target_x86_64::got_section): Set global_offset_table_.
6445 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6446 size.
6447
6448 * layout.cc (Layout::Layout): Initialize increase_relro_.
6449 (Layout::get_output_section): Add is_relro, is_last_relro, and
6450 is_first_non_relro parameters. Change all callers.
6451 (Layout::choose_output_section): Likewise.
6452 (Layout::add_output_section_data): Likewise.
6453 (Layout::make_output_section): Likewise.
6454 (Layout::set_segment_offsets): Clear increase_relro when using a
6455 linker script.
6456 * layout.h (class Layout): Add increase_relro method. Add
6457 increase_relro_ field. Update declarations.
6458 * output.cc (Output_section::Output_section): Initialize
6459 is_last_relro_ and is_first_non_relro_.
6460 (Output_segment::add_output_section): Group relro sections is
6461 do_sort is true. Handle is_last_relro and is_first_non_relro.
6462 (Output_segment::maximum_alignment): Remove relro handling.
6463 (Output_segment::set_section_addresses): Add increase_relro
6464 parameter. Change all callers. Add initial alignment to align
6465 relro sections on separate page. Remove old relro handling.
6466 (Output_segment::set_section_list_addresses): Remove in_relro
6467 parameter. Change all callers.
6468 (Output_segment::set_offset): Add increase parameter. Change all
6469 callers. Remove old relro handling.
6470 * output.h (class Output_section): Add new methods: is_last_relro,
6471 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6472 Add is_last_relro_ and is_first_non_relro_ fields.
6473 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6474 Create separate .got.plt section. Call increase_relro.
6475 * x86_64.cc (Target_x86_64::got_section): Likewise.
6476 * testsuite/relro_script_test.t: Add .got.plt.
6477
6478 PR 10450
6479 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6480 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6481 (Layout::finalize): Call set_dynamic_symbol_size.
6482 (Layout::set_dynamic_symbol_size): New function.
6483 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6484 set_dynamic_symbol_size.
6485
6486 PR 10450
6487 * output.h (class Output_section): Add is_entsize_zero_ field.
6488 * output.cc (Output_section::Output_section): Initialize
6489 is_entsize_zero_.
6490 (Output_section::set_entsize): If two different entsizes are
6491 requested, force it to zero.
6492 (Output_section::add_input_section): Set flags for .debug_str
6493 before updating section flags. Set entsize.
6494 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6495 and SHF_STRING if all input sections have those flags.
6496
6497 2009-12-29 Rafael Espindola <espindola@google.com>
6498
6499 * main.cc (main): Fix the sys time reporting.
6500 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6501 reporting.
6502
6503 2009-12-29 Sriraman Tallam <tmsriram@google.com>
6504
6505 * options.cc (General_options::parse_version): Allow -v to exit
6506 without an error if there is nothing to link.
6507
6508 2009-12-29 Ian Lance Taylor <iant@google.com>
6509
6510 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6511 using a version of gcc before 4.1.
6512 * configure: Rebuild.
6513
6514 2009-12-28 Chris Demetriou <cgd@google.com>
6515
6516 * attributes.cc (Output_attributes_section_data::do_write): Use
6517 std::vector::front rather than std::vector::data.
6518
6519 2009-12-28 Ian Lance Taylor <iant@google.com>
6520
6521 * symtab.h (class Symbol_table): Add enum Defined.
6522 * resolve.cc (Symbol_table::should_override): Add defined
6523 parameter. Change all callers. Test whether object is NULL
6524 before calling a method on it.
6525 (Symbol_table::report_resolve_problem): Add defined parameter.
6526 Change all callers.
6527 (Symbol_table::should_override_with_special): Likewise.
6528 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6529 parameter. Change all callers.
6530 (Symbol_table::do_define_in_output_data): Likewise.
6531 (Symbol_table::define_in_output_segment): Likewise.
6532 (Symbol_table::do_define_in_output_segment): Likewise.
6533 (Symbol_table::define_as_constant): Likewise.
6534 (Symbol_table::do_define_as_constant): Likewise.
6535 * script.h (class Symbol_assignment): Add is_defsym parameter to
6536 constructor; change all callers.
6537 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6538 parameter. Change all callers. Add is_defsym_ field.
6539 (class Parser_closure): Add parsing_defsym parameter to
6540 constructor; change all callers. Add parsing_defsym accessor
6541 function. Add parsing_defsym_ field.
6542
6543 2009-12-28 Ian Lance Taylor <iant@google.com>
6544
6545 * gold.cc (queue_middle_tasks): Fix formatting.
6546 * object.cc (Relobj::is_section_name_included): Likewise.
6547
6548 2009-12-23 Ian Lance Taylor <iant@google.com>
6549
6550 * i386.cc (Target_i386::do_calls_non_split): Recognize
6551 -fsplit-stack prologue for a function with a static chain.
6552 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6553 -fsplit-stack prologue when using %r11.
6554
6555 2009-12-21 Sriraman Tallam <tmsriram@google.com>
6556
6557 * options.cc (General_options::parse_version): Make -v continue and do
6558 the link like GNU ld does.
6559
6560 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
6561
6562 * Makefile.am (CCFILES): Add timer.cc.
6563 (HFILES): Add timer.h.
6564 * configure.ac: Check for sysconf and times.
6565 * main.cc: include timer.h.
6566 (main): Use Timer instead of get_run_time.
6567 * timer.cc: New.
6568 * timer.h: New.
6569 * workqueue.cc: include timer.h.
6570 (Workqueue::find_and_run_task):
6571 Report user, sys and wall time.
6572 * Makefile.in: Regenerate.
6573 * config.in: Regenerate.
6574 * configure: Regenerate.
6575
6576 2009-12-16 Doug Kwan <dougkwan@google.com>
6577
6578 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6579 sections.
6580 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6581 relaxed input sections.
6582 * output.cc (Output_section::find_relaxed_input_section): Change
6583 return type to Output_relaxed_input_section pointer. Adjust code
6584 for new type of relaxed_input_section_map_.
6585 * output.h (Output_section::find_relaxed_input_section): Change
6586 return type to Output_relaxed_input_section pointer.
6587 (Output_section::Output_relaxed_input_section_by_input_section_map):
6588 New type.
6589 (Output_section::relaxed_input_section_map_): Change type to
6590 Output_section::Output_relaxed_input_section_by_input_section_map.
6591 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6592 input section.
6593
6594 2009-12-15 Ian Lance Taylor <iant@google.com>
6595
6596 * layout.cc (Layout::create_shstrtab): Only write out after input
6597 sections if we are compressing debug sections.
6598
6599 2009-12-15 Ian Lance Taylor <iant@google.com>
6600
6601 * archive.cc (Archive::add_symbols): Only look up a symbol without
6602 a version if there is, in fact, a version.
6603
6604 2009-12-14 Ian Lance Taylor <iant@google.com>
6605
6606 Revert -Wshadow changes, all changes from:
6607 2009-12-11 Doug Kwan <dougkwan@google.com>
6608 2009-12-11 Nick Clifton <nickc@redhat.com>
6609 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6610
6611 2009-12-11 Doug Kwan <dougkwan@google.com>
6612
6613 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6614 due to -Wshadow.
6615 * attributes.cc (Object_attribute::size): Ditto.
6616 (Attributes_section_data::size): Ditto.
6617 (Attributes_section_data::Attributes_section_data): Ditto.
6618 (Output_attributes_section_data::do_write): Ditto.
6619 * attributes.h (Object_attribute::set_type): Ditto.
6620 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6621
6622 2009-12-11 Nick Clifton <nickc@redhat.com>
6623
6624 * archive.cc: Fix shadowed variable warnings.
6625 * arm.cc: Likewise.
6626 * compressed_output.cc: Likewise.
6627 * compressed_output.h: Likewise.
6628 * configure: Likewise.
6629 * dwarf_reader.cc: Likewise.
6630 * dynobj.cc: Likewise.
6631 * dynobj.h: Likewise.
6632 * ehframe.cc: Likewise.
6633 * ehframe.h: Likewise.
6634 * errors.cc: Likewise.
6635 * expression.cc: Likewise.
6636 * fileread.cc: Likewise.
6637 * fileread.h: Likewise.
6638 * freebsd.h: Likewise.
6639 * i386.cc: Likewise.
6640 * icf.cc: Likewise.
6641 * incremental.h: Likewise.
6642 * layout.cc: Likewise.
6643 * layout.h: Likewise.
6644 * mapfile.cc: Likewise.
6645 * merge.cc: Likewise.
6646 * merge.h: Likewise.
6647 * object.cc: Likewise.
6648 * object.h: Likewise.
6649 * options.h: Likewise.
6650 * output.cc: Likewise.
6651 * output.h: Likewise.
6652 * parameters.cc: Likewise.
6653 * plugin.cc: Likewise.
6654 * powerpc.cc: Likewise.
6655 * reduced_debug_output.cc: Likewise.
6656 * reduced_debug_output.h: Likewise.
6657 * reloc.cc: Likewise.
6658 * reloc.h: Likewise.
6659 * resolve.cc: Likewise.
6660 * script-sections.cc: Likewise.
6661 * script.cc: Likewise.
6662 * script.h: Likewise.
6663 * sparc.cc: Likewise.
6664 * symtab.cc: Likewise.
6665 * symtab.h: Likewise.
6666 * target-select.cc: Likewise.
6667 * target-select.h: Likewise.
6668 * token.h: Likewise.
6669 * workqueue.cc: Likewise.
6670 * workqueue.h: Likewise.
6671 * x86_64.cc: Likewise.
6672
6673 2009-12-10 Doug Kwan <dougkwan@google.com>
6674
6675 * arm.cc (attributes.h): New include.
6676 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6677 (Arm_relobj::~Arm_relobj): Delete object pointed by
6678 attributes_section_data_.
6679 (Arm_relobj::attributes_section_data): New method definition.
6680 (Arm_relobj::attributes_section_data_): New data member declaration.
6681 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6682 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6683 attributes_section_data_.
6684 (Arm_dynobj::attributes_section_data): New method definition.
6685 (Arm_dynobj::attributes_section_data_): New data member declaration.
6686 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6687 initialization value of may_use_blx_ to false.
6688 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6689 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6690 object attributes to compute results instead of hard-coding.
6691 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6692 Target_arm::get_secondary_compatible_arch,
6693 Target_arm::set_secondary_compatible_arch
6694 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6695 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6696 New method declarations.
6697 (Target_arm::get_aeabi_object_attribute): New method definition.
6698 (Target_arm::attributes_section_data_): New data member declaration.
6699 (read_arm_attributes_section): New template definition.
6700 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6701 (Arm_dynobj::do_read_symbols): Ditto.
6702 (Target_arm::do_finalize_sections): Merge attributes sections from
6703 input. Check for BLX use after attributes section merging.
6704 Fix __exidx_start and __exidx_end visibility. Create an
6705 .ARM.attributes section if necessary.
6706 (Target_arm::get_secondary_compatible_arch,
6707 Target_arm::set_secondary_compatible_arch,
6708 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6709 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
6710 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
6711 New method definitions.
6712
6713 2009-12-09 Ian Lance Taylor <iant@google.com>
6714
6715 * plugin.cc (Plugin::load): Don't cast from void* to a function
6716 pointer.
6717
6718 2009-12-09 Ian Lance Taylor <iant@google.com>
6719
6720 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6721 information fields.
6722
6723 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6724
6725 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6726 Replace two_file_shared_1.so with two_file_shared_2.so.
6727 * testsuite/Makefile.in: Regenerated.
6728
6729 2009-12-08 Doug Kwan <dougkwan@google.com>
6730
6731 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6732 (HFILES): Add attributes.h and int_encoding.h.
6733 * Makefile.in: Regenerate.
6734 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6735 function definitions to int_encoding.cc
6736 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6737 prototypes to int_encoding.h
6738 * reduced_debug_output.cc (int_encoding.h): New include.
6739 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6740 function definitions to int_encoding.cc
6741 (insert_into_vector, read_from_pointer): Move template definitions to
6742 int_encoding.h
6743 * attributes.cc: New file.
6744 * attributes.h: New file.
6745 * int_encoding.cc: New file.
6746 * int_encoding.h: New file.
6747
6748 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
6749
6750 PR gold/11055
6751 * incremental-dump.cc (dump_incremental_inputs): New.
6752 (main): Use dump_incremental_inputs.
6753
6754 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6755
6756 PR gold/10893
6757 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6758 checking elfcpp::STT_FUNC.
6759 (Target_i386::Relocate::relocate): Likewise.
6760 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6761
6762 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6763 symbols from shared libraries into normal FUNC symbols.
6764
6765 * symtab.h (Symbol): Add is_func and use it.
6766
6767 2009-12-05 Doug Kwan <dougkwan@google.com>
6768
6769 * arm.cc (Target_arm::arm_info): Initialize new fields
6770 attributes_section and attributes_vendor.
6771 * i386.cc (Target_i386::i386_info): Same.
6772 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6773 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6774 fields attributes_section and attributes_vendor.
6775 * sparc.cc (Target_sparc::sparc_info): Same.
6776 * target.h (Target::attributes_section, Target::attributes_vendor,
6777 Target::is_attributes_section, Target::attribute_arg_type,
6778 Target::attributes_order): New method definitions.
6779 (Target::Target_info::attributes_section,
6780 Target::Target_info::attributes_vendor): New fields.
6781 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6782 virtual method definitions.
6783 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6784 attributes_section and attributes_vendor.
6785 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6786
6787 2009-12-05 Doug Kwan <dougkwan@google.com>
6788
6789 * arm.cc: Update comments about interworking and stub generation.
6790 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6791 considered as non-PIC.
6792 (Arm_relocate_functions::base_abs): Fix formatting.
6793 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6794 of function to use GOT entry address instead of offset.
6795 (Target_arm::Scan::global): Issue an error if a symbol would need a
6796 PLT does not get one because it is untyped. Remove code to create
6797 dynamic symbols for relative branches.
6798 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6799 takes unsigned integer instead of boolean.
6800
6801 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6802
6803 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6804 (two_file_test_LDADD): Likewise.
6805 (common_test_1_LDADD): Likewise.
6806 (exception_test_LDADD) Likewise.
6807 (weak_test_LDADD): Likewise.
6808 (many_sections_test_LDADD): Likewise.
6809 (initpri1_LDADD): Likewise.
6810 (script_test_1_LDADD): Likewise.
6811 (script_test_2_LDADD): Likewise.
6812 (justsyms_LDADD): Likewise.
6813 (binary_test_LDADD): Likewise.
6814 (large_LDADD): Likewise.
6815 * testsuite/Makefile.in: Regenerated.
6816
6817 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
6818
6819 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6820 (Symbol_table::override_with_special): Likewise.
6821 (Symbol_table::add_from_object): Likewise.
6822
6823 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6824
6825 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6826 Don't set the data_offset twice.
6827
6828 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6829
6830 * testsuite/Makefile.in: Regenerate.
6831
6832 2009-12-03 Doug Kwan <dougkwan@google.com>
6833
6834 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6835 (Target_arm::do_finalize_sections): Add parameter for symbol table
6836 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6837 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6838 parameter for symbol table pointer.
6839 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6840 an additional parameter for a pointer to symbol table.
6841 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6842 parameter for a symbol table pointer.
6843 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6844 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6845 Ditto.
6846 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6847 parameter for a symbol table pointer.
6848
6849 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
6850
6851 * incremental.cc (Incremental_inputs_header)
6852 (Incremental_inputs_header_write, Incremental_inputs_entry)
6853 (Incremental_inputs_entry_write): Move ...
6854 * incremental.h (Incremental_inputs_header)
6855 (Incremental_inputs_header_write, Incremental_inputs_entry)
6856 (Incremental_inputs_entry_write): here.
6857
6858 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6859
6860 * incremental.cc (make_sized_incremental_binary): Set the target.
6861 Error if it is incompatible.
6862 * output.h (Output_file): Add filename method.
6863
6864 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6865
6866 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6867 from the get_* methods.
6868
6869 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6870
6871 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6872 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6873 Write 0 for the data_offset of scripts.
6874
6875 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6876
6877 * testsuite/Makefile.am: Add the incremental_test.sh test.
6878 * testsuite/incremental_test.sh: New.
6879 * testsuite/incremental_test_1.c: New.
6880 * testsuite/incremental_test_2.c: New.
6881
6882 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
6883
6884 * incremental-dump.cc (main): Fix typos.
6885
6886 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
6887
6888 PR gold/11025
6889 * incremental-dump.cc (main): Use llu to print 64 bit values.
6890
6891 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6892 H.J. Lu <hongjiu.lu@intel.com>
6893
6894 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6895 $(LIBDL).
6896 (incremental_dump_LDADD): Likewise.
6897 * Makefile.in: Regenerated.
6898
6899 2009-11-25 Doug Kwan <dougkwan@google.com>
6900
6901 Revert:
6902
6903 2009-11-25 Doug Kwan <dougkwan@google.com>
6904
6905 * arm.cc (Target_arm::Target_arm): Move method definition
6906 outside of class definition. Add code to handle
6907 --target1-rel, --target1-abs and --target2= options.
6908 (Target_arm::get_reloc_reloc_type): Change method to be
6909 non-static and const.
6910 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6911 New data member declaration.
6912 (Target_arm::Scan::local, Target_arm::Scan::global,
6913 Target_arm::Relocate::relocate,
6914 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6915 Adjust call to Target_arm::get_real_reloc_type.
6916 (Target_arm::get_real_reloc_type): Use command line options
6917 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6918 * options.h (--target1-rel, --target1-abs, --target2): New
6919 ARM-only options.
6920
6921 2009-11-25 Doug Kwan <dougkwan@google.com>
6922
6923 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6924 class definition. Add code to handle --target1-rel, --target1-abs
6925 and --target2= options.
6926 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6927 and const.
6928 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6929 member declaration.
6930 (Target_arm::Scan::local, Target_arm::Scan::global,
6931 Target_arm::Relocate::relocate,
6932 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6933 call to Target_arm::get_real_reloc_type.
6934 (Target_arm::get_real_reloc_type): Use command line options to
6935 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6936 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6937 options.
6938
6939 2009-11-25 Doug Kwan <dougkwan@google.com>
6940
6941 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6942 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6943 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6944 formatting.
6945 (Arm_relocate_functions::thm_call): Replace body with a call to
6946 Arm_relocate_functions::thumb_branch_common.
6947 (Arm_relocate_functions::thm_jump24,
6948 Arm_relocate_functions::thm_xpc22): New method definitions.
6949 (Arm_relocate_functions::thumb_branch_common): New method definition.
6950 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6951 operator.
6952 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6953 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6954
6955 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
6956
6957 * Makefile.am: Build incremental-dump
6958 * Makefile.in: Regenerate.
6959 * incremental-dump.cc: New.
6960 * incremental.cc (Incremental_inputs_header_data,
6961 Incremental_inputs_entry_data): Move to incremental.h
6962 * incremental.h: (Incremental_inputs_header_data,
6963 Incremental_inputs_entry_data): Move from incremental.cc
6964
6965 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
6966
6967 * incremental.cc (Incremental_inputs_header,
6968 Incremental_inputs_header_write, Incremental_inputs_entry,
6969 Incremental_inputs_entry_write): Add a typedef with the data type.
6970
6971 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
6972
6973 * incremental.cc (Incremental_inputs_header,
6974 Incremental_inputs_header_write, Incremental_inputs_entry,
6975 Incremental_inputs_entry_write): Update comment about which
6976 type has the filed descriptions.
6977
6978 2009-11-15 Doug Kwan <dougkwan@google.com>
6979
6980 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6981 (Arm_relocate_functions::arm_branch_common): Change method defintion
6982 in class definition to a method declaration and update list of formal
6983 parameters.
6984 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6985 Arm_relocation_functions::jump24): Adjust call to
6986 Arm_relocate_functions::arm_branch_common. Update list of formal
6987 parameters.
6988 (Arm_relocate_functions::xpc25): New method definition.
6989 (Arm_relocate_functions::arm_branch_common): Move method defintion
6990 out from class definition. Use stubs for mode-switching and extending
6991 branch ranges.
6992 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6993 specially. Change code to enable use of stubs in ARM branches.
6994
6995 2009-11-10 Doug Kwan <dougkwan@google.com>
6996
6997 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6998 in method declaration.
6999 (Target_arm::relocate_stub): New method declaration.
7000 (Target_arm::default_target): Change to return a pointer instead of
7001 a const reference.
7002 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7003 Target_arm::default_target.
7004 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7005 method definition.
7006 (Target_arm::relocate_section): Adjust view.
7007 (Target_arm::relocate_stub): New method definition.
7008
7009 2009-11-10 Doug Kwan <dougkwan@google.com>
7010
7011 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7012 a format warning.
7013 * incremental.cc (open_incremental_binary): Initialized local
7014 variables to avoid warnings.
7015 * object.cc (make_elf_object): Ditto.
7016 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7017 a format warning.
7018
7019 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7020
7021 PR gold/10930
7022 * testsuite/plugin_test.c: Include "config.h".
7023
7024 2009-11-09 Doug Kwan <dougkwan@google.com>
7025
7026 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7027 (arm_symbol_value): Remove.
7028 (Arm_relocate_functions::arm_branch_common,
7029 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7030 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7031 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7032 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7033 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7034 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7035 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7036 Arm_relocate_functions::thm_mobw_abs_nc,
7037 Arm_relocate_functions::thm_mov_abs,
7038 Arm_relocate_functions::movw_prel_nc,
7039 Arm_relocate_functions::thm_movt_abs,
7040 Arm_relocate_functions::movt_prel,
7041 Arm_relocate_functions::thm_movw_prel_nc,
7042 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7043 (Target_arm::Relocate::relocate): Only decompose address into two
7044 parts if relocation type uses the thumb-bit and pass the actual
7045 bit instead of a flag indicating that the thumb-bit is used. Adjust
7046 calls to methods in Arm_relocate_functions for this change.
7047
7048 2009-11-08 Ian Lance Taylor <iant@google.com>
7049
7050 PR 10925
7051 * reloc.cc: Instantiate
7052 Sized_relobj::initialize_input_to_output_maps and
7053 Sized_relobj:free_input_to_output_maps.
7054
7055 2009-11-06 Ian Lance Taylor <iant@google.com>
7056
7057 PR 10876
7058 * defstd.cc (in_segment): Set only_if_ref true for "end".
7059
7060 2009-11-06 Doug Kwan <dougkwan@google.com>
7061
7062 * arm.cc (class Reloc_stub): Correct a comment.
7063 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7064 (Target_arm::scan_section_for_stubs): New method declaration.
7065 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7066 Change methods from private to protected.
7067 (Target_arm::do_may_relax): New method definition.
7068 (Target_arm::do_relax, Target_arm::group_sections,
7069 Target_arm::scan_reloc_for_stub,
7070 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7071 (Target_arm::arm_input_section_map_): New data member declaration.
7072 (Target_arm::scan_reloc_for_stub,
7073 Target_arm::scan_reloc_section_for_stubs,
7074 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7075 Target_arm::do_relax): New method definitions.
7076
7077 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7078
7079 * configure.ac: Check for (struct stat)::st_mtim
7080 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7081 * config.in: Regenerate.
7082 * configure: Regenerate.
7083
7084 2009-11-05 Ian Lance Taylor <iant@google.com>
7085
7086 PR 10910
7087 * output.cc (Output_segment::add_output_section): Add missing
7088 return statement.
7089
7090 2009-11-04 Ian Lance Taylor <iant@google.com>
7091
7092 PR 10880
7093 * object.h (class Object): Add is_needed and set_is_needed
7094 methods. Add is_needed_ field. Make bool fields into bitfields.
7095 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7096 defined in a dynamic object and referenced by a regular object,
7097 set is_needed for the dynamic object.
7098 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7099 if the file is marked with as_needed and it is not needed.
7100
7101 2009-11-04 Ian Lance Taylor <iant@google.com>
7102
7103 PR 10887
7104 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7105 tags if data is discarded by linker script.
7106 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7107 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7108 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7109 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7110
7111 2009-11-04 Ian Lance Taylor <iant@google.com>
7112
7113 * layout.cc (Layout::get_output_section): Add is_interp and
7114 is_dynamic_linker_section parameters. Change all callers.
7115 (Layout::choose_output_section): Likewise.
7116 (Layout::make_output_section): Likewise.
7117 (Layout::add_output_section_data): Add is_dynamic_linker_section
7118 parameter. Change all callers.
7119 * layout.h (class Layout): Update declarations.
7120 * output.h (class Output_section): Add is_interp, set_is_interp,
7121 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7122 Add is_interp_, is_dynamic_linker_section_ fields. Change
7123 generate_code_fills_at_write_ to a bitfield.
7124 * output.cc (Output_section::Output_sections): Initialize new
7125 fields.
7126 (Output_segment::add_output_section): Add do_sort parameter.
7127 Change all callers.
7128
7129 2009-11-03 Ian Lance Taylor <iant@google.com>
7130
7131 PR 10860
7132 * options.h (class General_options): Add --warn-common.
7133 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7134 merging two common symbols.
7135 (Symbol_table::should_override): Handle --warn-common when merging
7136 a common symbol with a defined symbol. Use report_resolve_problem
7137 for multiple definitions.
7138 (Symbol_table::report_resolve_problem): New function.
7139 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7140
7141 2009-11-03 Doug Kwan <dougkwan@google.com>
7142
7143 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7144 stub_factory_.
7145 (Target_arm::stub_factory): New method definition.
7146 (Target_arm::new_arm_input_section,
7147 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7148 Target_arm::reloc_uses_thumb_bit): New method declarations.
7149 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
7150 New type definitions.
7151 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7152 member declarations.
7153 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7154 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7155 New method definitions.
7156
7157 2009-11-03 Ian Lance Taylor <iant@google.com>
7158
7159 * options.h (class General_options): Add --warn_constructors.
7160
7161 2009-11-03 Ian Lance Taylor <iant@google.com>
7162
7163 PR 10893
7164 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7165 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7166
7167 2009-11-03 Ian Lance Taylor <iant@google.com>
7168
7169 PR 10895
7170 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7171 --msgid-bugs-address.
7172 (install-pdf): New target.
7173 (install-data_yes): Look up one directory to find mkinstalldirs.
7174
7175 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7176
7177 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7178 tree.
7179
7180 2009-10-30 Doug Kwan <dougkwan@google.com>
7181
7182 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7183
7184 2009-10-30 Doug Kwan <dougkwan@google.com>
7185
7186 * arm.cc (Stub_addend_reader): New struct template definition
7187 and partial specializations.
7188 (Stub_addend_reader::operator()): New method definition for a
7189 partially specialized template.
7190
7191 2009-10-30 Doug Kwan <dougkwan@google.com>
7192
7193 * arm.cc (Arm_relobj::processor_specific_flags): New method
7194 definition.
7195 (Arm_relobj::do_read_symbols): New method declaration.
7196 (Arm_relobj::processor_specific_flags_): New data member declaration.
7197 (Arm_dynobj): New class definition.
7198 (Target_arm::do_finalize_sections): Add input_objects parameter.
7199 (Target_arm::do_adjust_elf_header): New method declaration.
7200 (Target_arm::are_eabi_versions_compatible,
7201 (Target_arm::merge_processor_specific_flags): New method declaration.
7202 (Target_arm::do_make_elf_object): New overloaded method definitions
7203 and declaration.
7204 (Arm_relobj::do_read_symbols): New method definition.
7205 (Arm_dynobj::do_read_symbols): Ditto.
7206 (Target_arm::do_finalize_sections): Add input_objects parameters.
7207 Merge processor-specific flags from all input objects.
7208 (Target_arm::are_eabi_versions_compatible,
7209 Target_arm::merge_processor_specific_flags,
7210 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7211 New method definitions.
7212 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7213 Input_objects pointer type parameter.
7214 * layout.cc (Layout::finalize): Pass input objects to target's.
7215 finalize_sections function.
7216 * output.cc (Output_file_header::do_sized_write): Set ELF file
7217 header's processor-specific flags.
7218 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7219 Input_objects pointer type parameter.
7220 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7221 * target.h (Input_objects): New forward class declaration.
7222 (Target::processor_specific_flags,
7223 Target::are_processor_specific_flags_sect): New method definitions.
7224 (Target::finalize_sections): Add input_objects parameter.
7225 (Target::Target): Initialize processor_specific_flags_ and
7226 are_processor_specific_flags_set_.
7227 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7228 parameter.
7229 (Target::set_processor_specific_flags): New method definition.
7230 (Target::processor_specific_flags_,
7231 Target::are_processor_specific_flags_set_): New data member
7232 declarations.
7233 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7234 Input_objects pointer type parameter.
7235
7236 2009-10-30 Doug Kwan <dougkwan@google.com>
7237
7238 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7239
7240 2009-10-28 Ian Lance Taylor <iant@google.com>
7241
7242 * object.h (class Relobj): Drop options parameter from
7243 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7244 do_scan_relocs, do_relocate. Change all callers.
7245 (class Sized_relobj): Drop options parameters from
7246 do_gc_process_relocs, do_scan_relocs, do_relocate,
7247 do_relocate_sections, relocate_sections, emit_relocs_scan,
7248 emit_relocs_scan_reltype. Change all callers.
7249 (struct Relocate_info): Remove options field and all references to
7250 it.
7251 * reloc.h (class Read_relocs): Remove options constructor
7252 parameter and options_ field. Change all callers.
7253 (class Gc_process_relocs, class Scan_relocs): Likewise.
7254 (class Relocate_task): Likewise.
7255 * target-reloc.h (scan_relocs): Remove options parameter. Change
7256 all callers.
7257 (scan_relocatable_relocs): Likewise.
7258 * target.h (class Sized_target): Remove options parameter from
7259 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7260 all callers.
7261 * gc.h (gc_process_relocs): Remove options parameter. Change all
7262 callers.
7263 * arm.cc: Update functions to remove options parameters.
7264 * i386.cc: Likewise.
7265 * powerpc.cc: Likewise.
7266 * sparc.cc: Likewise.
7267 * x86_64.cc: Likewise.
7268 * testsuite/testfile.cc: Likewise.
7269
7270 2009-10-28 Doug Kwan <dougkwan@google.com>
7271
7272 * arm.cc (Arm_relobj): New class definition.
7273 (Arm_relobj::scan_sections_for_stubs,
7274 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7275 New method definitions.
7276
7277 2009-10-28 Cary Coutant <ccoutant@google.com>
7278
7279 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7280 (Plugin::cleanup_done_): New member.
7281 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7282 (Plugin_manager::cleanup_done_): Remove.
7283 (Plugin_manager::add_input_file): Edit error message.
7284 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7285 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7286
7287 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7288
7289 * fileread.cc: (File_read::View::~View): Use the new
7290 data_ownership_ filed.
7291 (File_read::~File_read): Dispose the new whole_file_view_.
7292 (File_read::open): Mmap the whole file if needed.
7293 (File_read::open): Use whole_file_view_ instead of contents_.
7294 (File_read::find_view): Use whole_file_view_ if applicable.
7295 (File_read::do_read): Use whole_file_view_ instead of contents_.
7296 (File_read::make_view): Use whole_file_view_ instead of contents_,
7297 update File_read::View::View call.
7298 (File_read::find_or_make_view): Update File_read::View::View
7299 call.
7300 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7301 remove contents_
7302 (File_read::View::Data_ownership): New enum.
7303 (File_read::View::View): Replace bool mapped_ with Data_ownership
7304 argument.
7305 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7306 (File_read::View::data_ownership_): New field.
7307 (File_read::contents_): Remove (replaced by whole_file_view_).
7308 (File_read::whole_file_view_): New field.
7309 * options.h (class General_options): Add --keep-files-mapped.
7310
7311 2009-10-27 Cary Coutant <ccoutant@google.com>
7312
7313 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7314 * testsuite/Makefile.am (plugin_test_5): New test case.
7315 * testsuite/Makefile.in: Regenerate.
7316
7317 2009-10-25 Doug Kwan <dougkwan@google.com>
7318
7319 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7320 from private to protected to allow access by child class.
7321 (Sized_relobj::do_relocate_sections): New method declaration.
7322 (Sized_relobj::relocate_sections): Virtualize.
7323 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
7324 Sized_relobj::relocate_sections. Instantiate template explicitly
7325 for different target sizes and endianity.
7326
7327 2009-10-24 Doug Kwan <dougkwan@google.com>
7328
7329 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7330 (Arm_input_section::as_arm_input_section): New method.
7331 (Arm_output_section): New class definition.
7332 (Arm_output_section::create_stub_group,
7333 Arm_output_section::group_sections): New method definitions.
7334
7335 2009-10-22 Doug Kwan <dougkwan@google.com>
7336
7337 * arm.cc (Arm_input_section): New class definition.
7338 (Arm_input_section::init, Arm_input_section:do_write,
7339 Arm_input_section::set_final_data_size,
7340 Arm_input_section::do_reset_address_and_file_offset): New method
7341 definitions.
7342
7343 2009-10-21 Doug Kwan <dougkwan@google.com>
7344
7345 * arm.cc (Stub_table, Arm_input_section): New forward class
7346 declarations.
7347 (Stub_table): New class defintion.
7348 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7349 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7350 New method definition.
7351
7352 2009-10-21 Doug Kwan <dougkwan@google.com>
7353
7354 * arm.cc: Update copyright comments.
7355 (Target_arm): New forward class template declaration.
7356 (Arm_address): New type.
7357 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7358 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7359 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7360 constants.
7361 (Insn_template): Same.
7362 (DEF_STUBS): New macro.
7363 (Stub_type): New enum type.
7364 (Stub_template): New class definition.
7365 (Stub): Same.
7366 (Reloc_stub): Same.
7367 (Stub_factory): Same.
7368 (Target_arm::Target_arm): Initialize may_use_blx_ and
7369 should_force_pic_veneer_.
7370 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7371 Target_arm::should_force_pic_veneer,
7372 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7373 Target_arm::using_thumb_only, Target_arm:;default_target): New
7374 method defintions.
7375 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7376 New data member declarations.
7377 (Insn_template::size, Insn_template::alignment): New method defintions.
7378 (Stub_template::Stub_template): New method definition.
7379 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7380 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7381 (Stub_factory::Stub_factory): New method definition.
7382 * gold.h (string_hash): New template.
7383 * output.h (Input_section_specifier::hash_value): Use
7384 gold::string_hash.
7385 (Input_section_specifier::string_hash): Remove.
7386 * stringpool.cc (Stringpool_template::string_hash): Use
7387 gold::string_hash.
7388
7389 2009-10-20 Doug Kwan <dougkwan@google.com>
7390
7391 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7392 symbols of relaxed input sections.
7393 * output.h (Output_section::find_relaxed_input_section): Make
7394 method public.
7395
7396 2009-10-16 Doug Kwan <dougkwan@google.com>
7397
7398 * dynobj.cc (Versions::Versions): Initialize version_script_.
7399 Only insert base version symbol definition for a shared object
7400 if version script defines any version versions.
7401 (Versions::define_base_version): New method definition.
7402 (Versions::add_def): Check that base version is not needed.
7403 (Versions::add_need): Define base version lazily.
7404 * dynobj.h (Versions::define_base_version): New method declaration.
7405 (Versions::needs_base_version_): New data member declaration.
7406 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7407 (check_DATA): Add no_version_test.stdout.
7408 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7409 New make rules.
7410 * testsuite/Makefile.in: Regenerate.
7411 * testsuite/no_version_test.c: New file.
7412 * testsuite/no_version_test.sh: Ditto.
7413
7414 2009-10-16 Doug Kwan <dougkwan@google.com>
7415
7416 * expression.cc (class Segment_start_expression): New class definition.
7417 (Segment_start_expression::value): New method definition.
7418 (script_exp_function_segment_start): Return a new
7419 Segment_start_expression.
7420 * gold/script-c.h (script_saw_segment_start_expression): New function
7421 prototype.
7422 * script-sections.cc (Script_sections::Script_sections): Initialize
7423 SAW_SEGMENT_START_EXPRESSION_ to false.
7424 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7425 and -Tbbs options to specify section addresses if given in
7426 command line and no SEGMENT_START expression is seen in a script.
7427 * script-sections.h (Script_sections::saw_segment_start_expression,
7428 Script_sections::set_saw_segment_start_expression): New method
7429 definition.
7430 (Script_sections::saw_segment_start_expression_): New data member
7431 declaration.
7432 * script.cc (script_saw_segment_start_expression): New function.
7433 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7434 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7435 script_test_7.sh and script_test_8.sh.
7436 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7437 script_test_8.stdout.
7438 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7439 (script_test_6, script_test_6.stdout, script_test_7,
7440 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7441 * Makefile.in: Regenerate.
7442 * testsuite/script_test_6.sh: New file.
7443 * testsuite/script_test_6.t: Same.
7444 * testsuite/script_test_7.sh: Same.
7445 * testsuite/script_test_7.t: Same.
7446 * testsuite/script_test_8.sh: Same.
7447
7448 2009-10-16 Doug Kwan <dougkwan@google.com>
7449
7450 * output.cc (Output_segment::set_section_list_address): Cast
7451 expressions to unsigned long long type to avoid format warnings.
7452
7453 2009-10-15 Ian Lance Taylor <iant@google.com>
7454
7455 * script.cc (Script_options::add_symbol_assignment): Always add a
7456 dot assignment to script_sections_.
7457 * script-sections.cc (Script_sections::add_dot_assignment):
7458 Initialize if necessary.
7459
7460 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7461 program headers with no load segment if there is a linker script.
7462
7463 * layout.cc (Layout::set_segment_offsets): Align the file offset
7464 to the segment aligment for -N or -n with no load segment.
7465 * output.cc (Output_segment::add_output_section): Don't crash if
7466 the first section is a TLS section.
7467 (Output_segment::set_section_list_addresses): Print an error
7468 message if the address moves backward in a linker script.
7469 * script-sections.cc
7470 (Output_section_element_input::set_section_addresses): Don't
7471 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7472 (Orphan_output_section::set_section_addresses): Likewise.
7473
7474 2009-10-15 Doug Kwan <dougkwan@google.com>
7475
7476 * layout.cc (Layout::finish_dynamic_section): Generate tags
7477 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7478 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7479 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7480
7481 2009-10-14 Ian Lance Taylor <iant@google.com>
7482
7483 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7484 fields.
7485 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7486 data_shdr fields of relinfo.
7487 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7488 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7489 R_386_TLS_LDO_32, adjust based on section flags.
7490 (Target_i386::Relocate::fix_up_ldo): Remove.
7491
7492 2009-10-13 Ian Lance Taylor <iant@google.com>
7493
7494 Add support for -pie.
7495 * options.h (class General_options): Add -pie and
7496 --pic-executable.
7497 (General_options::output_is_position_independent): Test -pie.
7498 (General_options::output_is_executable): Return true if not shared
7499 and not relocatable.
7500 (General_options::output_is_pie): Remove.
7501 * options.cc (General_options::finalize): Reject incompatible uses
7502 of -pie.
7503 * gold.cc (queue_middle_tasks): A -pie link is not static.
7504 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7505 * symtab.cc (Symbol::final_value_is_known): Return false if
7506 output_is_position_independent.
7507 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7508 output_is_position_independent.
7509 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7510 output_is_position_independent.
7511 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7512 output_is_position_independent.
7513 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7514 two_file_pie_test.
7515 (basic_pie_test.o, basic_pie_test): New targets.
7516 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7517 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7518 (two_file_pie_test): New target.
7519 * testsuite/Makefile.in: Rebuild.
7520 * README: Remove note saying that -pie is not supported.
7521
7522 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7523
7524 * options.h (class General_options): Add -init and -fini.
7525 * layout.cc (Layout::finish_dynamic_section): Emit
7526 given init and fini functions.
7527
7528 2009-10-13 Sriraman Tallam <tmsriram@google.com>
7529
7530 * gc.h (gc_process_relocs): Check if icf is enabled using new
7531 function.
7532 * gold.cc (queue_initial_tasks): Likewise.
7533 (queue_middle_tasks): Likewise.
7534 * object.cc (do_layout): Likewise.
7535 * symtab.cc (is_section_folded): Likewise.
7536 * main.cc (main): Likewise.
7537 * reloc.cc (Read_relocs::run): Likewise.
7538 (Sized_relobj::do_scan_relocs): Likewise.
7539 * icf.cc (is_function_ctor_or_dtor): New function.
7540 (Icf::find_identical_sections): Check if function is ctor or dtor when
7541 safe icf is chosen.
7542 * options.h (General_options::icf): Change option to be an enum.
7543 (Icf_status): New enum.
7544 (icf_enabled): New method.
7545 (icf_safe_folding): New method.
7546 (set_icf_status): New method.
7547 (icf_status_): New variable.
7548 * (options.cc) (General_options::finalize): Set icf_status_.
7549 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7550 icf_test and icf_keep_unique_test to use the --icf enum flag.
7551 * testsuite/icf_safe_test.sh: New file.
7552 * testsuite/icf_safe_test.cc: New file.
7553
7554 2009-10-12 Sriraman Tallam <tmsriram@google.com>
7555
7556 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7557 includes to gc.h and icf.h.
7558 * arm.cc: Include gc.h.
7559 * gold.cc: Likewise.
7560 * i386.cc: Likewise.
7561 * powerpc.cc: Likewise.
7562 * sparc.cc: Likewise.
7563 * x86_64.cc: Likewise.
7564 * gc.h: Include icf.h.
7565
7566 2009-10-11 Ian Lance Taylor <iant@google.com>
7567
7568 * plugin.cc: Include "gold.h" before other header files.
7569
7570 2009-10-10 Chris Demetriou <cgd@google.com>
7571
7572 * options.h (Input_file_argument::Input_file_type): New enum.
7573 (Input_file_argument::is_lib_): Replace with...
7574 (Input_file_argument::type_): New member.
7575 (Input_file_argument::Input_file_argument): Take Input_file_type
7576 'type' rather than boolean 'is_lib' as second argument.
7577 (Input_file_argument::is_lib): Use type_.
7578 (Input_file_argument::is_searched_file): New function.
7579 (Input_file_argument::may_need_search): Handle is_searched_file.
7580 * options.cc (General_options::parse_library): Support -l:filename.
7581 (General_options::parse_just_symbols): Update for Input_file_argument
7582 changes.
7583 (Command_line::process): Likewise.
7584 * archive.cc (Archive::get_file_and_offset): Likewise.
7585 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7586 * script.cc (read_script_file, script_add_file): Likewise.
7587 * fileread.cc (Input_file::Input_file): Likewise.
7588 (Input_file::will_search_for): Handle is_searched_file.
7589 (Input_file::open): Likewise.
7590 * readsyms.cc (Read_symbols::get_name): Likewise.
7591 * testsuite/Makefile.am (searched_file_test): New test.
7592 * testsuite/Makefile.in: Regenerate.
7593 * testsuite/searched_file_test.cc: New file.
7594 * testsuite/searched_file_test_lib.cc: New file.
7595
7596 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7597 Ian Lance Taylor <iant@google.com>
7598
7599 * descriptor.cc: Include <cstdio> and "binary-io.h".
7600 (Descriptors::open): Open the files in binary mode always.
7601 * script.cc (Lex::get_token): Treat \r as whitespace.
7602
7603 2009-10-09 Ian Lance Taylor <iant@google.com>
7604
7605 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7606
7607 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7608 Ian Lance Taylor <iant@google.com>
7609
7610 * configure.ac: Check for readv function also.
7611 * fileread.cc (readv): Define if not HAVE_READV.
7612 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7613 does not exist.
7614 * config.in: Regenerate.
7615 * configure: Regenerate.
7616
7617 2009-10-09 Doug Kwan <dougkwan@google.com>
7618
7619 * layout.cc (Layout::make_output_section): Call target hook to make
7620 ordinary output section.
7621 (Layout::finalize): Adjust parameter list of call the
7622 Target::may_relax().
7623 * layout.h (class Layout::section_list): New method.
7624 * merge.h (Output_merge_base::entsize): Change visibility to public.
7625 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7626 New methods.
7627 (Output_merge_string::do_is_string): New method.
7628 * object.cc (Sized_relobj::do_setup): renamed from
7629 Sized_relobj::set_up.
7630 * object.h (Sized_relobj::adjust_shndx,
7631 Sized_relobj::initializ_input_to_output_maps,
7632 Sized_relobj::free_input_to_output_maps): Change visibilities to
7633 protected.
7634 (Sized_relobj::setup): Virtualize.
7635 (Sized_relobj::do_setup): New method declaration.
7636 (Sized_relobj::invalidate_section_offset,
7637 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7638 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7639 * options.cc (parse_int): New function.
7640 * options.h (parse_int): New declaration.
7641 (DEFINE_int): New macro.
7642 (stub_group_size): New option.
7643 * output.cc (Output_section::Output_section): Initialize memebers
7644 merge_section_map_, merge_section_by_properties_map_,
7645 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7646 (Output_section::add_input_section): Handled deferred code-fill
7647 generation and remove an old comment.
7648 (Output_section::add_relaxed_input_section): New method definition.
7649 (Output_section::add_merge_input_section): Use merge section by
7650 properties map to speed to search. Update merge section maps
7651 as appropriate.
7652 (Output_section::build_relaxation_map): New method definition.
7653 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7654 Same.
7655 (Output_section::relax_input_section): Renamed to
7656 Output_section::convert_input_sections_to_relaxed_sections and change
7657 interface to take a vector of pointers to relaxed sections.
7658 (Output_section::find_merge_section,
7659 Output_section::find_relaxed_input_section): New method definitions.
7660 (Output_section::is_input_address_mapped,
7661 Output_section::output_offset, Output_section::output_address):
7662 Use output section data maps to speed up searching.
7663 (Output_section::find_starting_output_address): Add comments.
7664 (Output_section::do_write,
7665 Output_section::write_to_postprocessing_buffer): Do code-fill
7666 generation as appropriate.
7667 (Output_section::get_input_sections): Invalidate relaxed input section
7668 map.
7669 (Output_section::restore_states): Adjust type of checkpoint .
7670 Invalidate relaxed input section map.
7671 * output.h (Output_merge_base): New class declaration.
7672 (Input_section_specifier): New class defintion.
7673 (class Output_relaxed_input_section) Change base class to
7674 Output_section_data_build.
7675 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7676 base class initializer.
7677 (Output_section::add_relaxed_input_section): New method declaration.
7678 (Output_section::Input_section): Change visibility to protected.
7679 (Output_section::Input_section::relobj,
7680 Output_section::Input_section::shndx): Handle relaxed input sections.
7681 Output_section::input_sections) Change visibility to protected. Also
7682 define overload to return a non-const pointer.
7683 (Output_section::Merge_section_properties): New class defintion.
7684 (Output_section::Merge_section_by_properties_map,
7685 Output_section::Output_section_data_by_input_section_map,
7686 Output_section::Relaxation_map): New types.
7687 (Output_section::relax_input_section): Rename method to
7688 Output_section::convert_input_sections_to_relaxed_sections and change
7689 interface to take a vector of relaxed section pointers.
7690 (Output_section::find_merge_section,
7691 Output_section::find_relaxed_input_section,
7692 Output_section::build_relaxation_map,
7693 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7694 New method declarations.
7695 (Output_section::merge_section_map_
7696 Output_section::merge_section_by_properties_map_,
7697 Output_section::relaxed_input_section_map_,
7698 Output_section::is_relaxed_input_section_map_valid_,
7699 Output_section::generate_code_fills_at_write_): New data members.
7700 * script-sections.cc
7701 (Output_section_element_input::set_section_addresses): Call
7702 current_data_size and addralign methods of relaxed input sections.
7703 (Orphan_output_section::set_section_addresses): Call current_data_size
7704 and addralign methods of relaxed input sections.
7705 * symtab.cc (Symbol_table::compute_final_value): Extract template
7706 from the body of Symbol_table::sized_finalize_symbol.
7707 (Symbol_table::sized_finalized_symbol): Call
7708 Symbol_table::compute_final_value.
7709 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7710 (Symbol_table::compute_final_value): New templated method declaration.
7711 * target.cc (Target::do_make_output_section): New method defintion.
7712 * target.h (Target::make_output_section): New method declaration.
7713 (Target::relax): Add more parameters for input objects, symbol table
7714 and layout. Adjust call to do_relax.
7715 (Target::do_make_output_section): New method declaration.
7716 (Target::do_relax): Add parameters for input objects, symbol table
7717 and layout.
7718
7719 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7720
7721 * pread.c: Include stdio.h.
7722
7723 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7724
7725 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7726 defined.
7727
7728 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7729
7730 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7731 Change read_shndx type to unsigned int.
7732 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7733 int.
7734 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7735 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7736 Change read_shndx type to unsigned int.
7737 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7738 int.
7739 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7740 * layout.cc (Layout::create_symtab_sections): Cast the result of
7741 local_symcount * symsize to off_t in the gold_assert.
7742
7743 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7744
7745 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7746 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7747 R_ARM_BASE_ABS.
7748 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7749 (Arm_relocate_functions::thm_abs5): New function.
7750 (Arm_relocate_functions::abs12): New function.
7751 (Arm_relocate_functions::abs16): New function.
7752 (Arm_relocate_functions::base_abs): New function.
7753 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7754 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7755 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7756 R_ARM_BASE_ABS.
7757 (Scan::global): Likewise.
7758 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7759 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7760 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7761 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7762 R_ARM_BASE_ABS.
7763
7764 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7765
7766 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7767 (Arm_relocate_functions::movt_prel): New function.
7768 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7769 (Arm_relocate_functions::thm_movt_prel): New function.
7770 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7771 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7772 (Scan::global, Relocate::relocate): Likewise.
7773 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7774
7775 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7776
7777 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7778 Incremental_checker.
7779 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7780 unsigned int.
7781 (class Incremental_inputs_header): New class.
7782 (Incremental_inputs_header_writer): Edit comment.
7783 (Incremental_inputs_entry): New class.
7784 (Incremental_inputs_entry_writer): Edit comment.
7785 (Sized_incremental_binary::do_find_incremental_inputs_section):
7786 Add *strtab_shndx parameter, fill it.
7787 (Sized_incremental_binary::do_check_inputs): New method.
7788 (Incremental_checker::can_incrementally_link_output_file): Use
7789 Sized_incremental_binary::check_inputs.
7790 (Incremental_inputs::report_command_line): Save command line in
7791 command_line_.
7792 * incremental.h:
7793 (Incremental_binary::find_incremental_inputs_section): New
7794 method.
7795 (Incremental_binary::do_find_incremental_inputs_section): Add
7796 strtab_shndx parameter.
7797 (Incremental_binary::do_check_inputs): New pure virtual method.
7798 (Sized_incremental_binary::do_check_inputs): Declare.
7799 (Incremental_checker::Incremental_checker): Add incremental_inputs
7800 parameter, use it to initialize incremental_inputs_.
7801 (Incremental_checker::incremental_inputs_): New field.
7802 (Incremental_checker::command_line): New method.
7803 (Incremental_checker::inputs): New method.
7804 (Incremental_checker::command_line_): New field.
7805
7806 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7807
7808 * incremental.cc: Include <cstdarg> and "target-select.h".
7809 (vexplain_no_incremental): New function.
7810 (explain_no_incremental): New function.
7811 (Incremental_binary::error): New method.
7812 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7813 method.
7814 (make_sized_incremental_binary): New function.
7815 (open_incremental_binary): New function.
7816 (can_incrementally_link_file): Add checks if output is ELF and has
7817 inputs section.
7818 * incremental.h: Include "elfcpp_file.h" and "output.h".
7819 (Incremental_binary): New class.
7820 (Sized_incremental_binary): New class.
7821 (open_incremental_binary): Declare.
7822 * object.cc (is_elf_object): Use
7823 elfcpp::Elf_recognizer::is_elf_file.
7824 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7825 * output.h (Output_file::filesize): New method.
7826
7827 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7828
7829 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7830 New function.
7831 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7832 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7833 function.
7834 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7835 function.
7836 (Arm_relocate_functions::movw_abs_nc): New function.
7837 (Arm_relocate_functions::movt_abs): New function.
7838 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7839 (Arm_relocate_functions::thm_movt_abs): New function.
7840 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7841 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7842 (Scan::global): Likewise.
7843 (Relocate::relocate): Likewise.
7844 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7845
7846 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7847
7848 * arm.cc (Arm_relocate_functions::got_prel) New function.
7849 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7850 (Relocate::relocate): Likewise.
7851 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7852
7853 2009-10-06 Ian Lance Taylor <iant@google.com>
7854
7855 * options.h (class General_options): Define
7856 split_stack_adjust_size parameter.
7857 * object.h (class Object): Add uses_split_stack_ and
7858 has_no_split_stack_ fields. Add uses_split_stack and
7859 has_no_split_stack accessor functions. Declare
7860 handle_split_stack_section.
7861 (class Reloc_symbol_changes): Define.
7862 (class Sized_relobj): Define Function_offsets. Declare
7863 split_stack_adjust, split_stack_adjust_reltype, and
7864 find_functions.
7865 * object.cc (Object::handle_split_stack_section): New function.
7866 (Sized_relobj::do_layout): Call handle_split_stack_section.
7867 * dynobj.cc (Sized_dynobj::do_layout): Call
7868 handle_split_stack_section.
7869 * reloc.cc (Sized_relobj::relocate_sections): Call
7870 split_stack_adjust for executable sections in split_stack
7871 objects. Pass reloc_map to relocate_section.
7872 (Sized_relobj::split_stack_adjust): New function.
7873 (Sized_relobj::split_stack_adjust_reltype): New function.
7874 (Sized_relobj::find_functions): New function.
7875 * target-reloc.h: Include "object.h".
7876 (relocate_section): Add reloc_symbol_changes parameter. Change
7877 all callers.
7878 * target.h (class Target): Add calls_non_split method. Declare
7879 do_calls_non_split virtual method. Declare match_view and
7880 set_view_to_nop.
7881 * target.cc: Include "elfcpp.h".
7882 (Target::do_calls_non_split): New function.
7883 (Target::match_view): New function.
7884 (Target::set_view_to_nop): New function.
7885 * gold.cc (queue_middle_tasks): Give an error if mixing
7886 split-stack and non-split-stack objects with -r.
7887 * i386.cc (Target_i386::relocate_section): Add
7888 reloc_symbol_changes parameter.
7889 (Target_i386::do_calls_non_split): New function.
7890 * x86_64.cc (Target_x86_64::relocate_section): Add
7891 reloc_symbol_changes parameter.
7892 (Target_x86_64::do_calls_non_split): New function.
7893 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7894 parameter.
7895 * powerpc.cc (Target_powerpc::relocate_section): Add
7896 reloc_symbol_changes parameter.
7897 * sparc.cc (Target_sparc::relocate_section): Add
7898 reloc_symbol_changes parameter.
7899 * configure.ac: Call AM_CONDITIONAL for the default target.
7900 * configure: Rebuild.
7901 * testsuite/Makefile.am (TEST_AS): New variable.
7902 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7903 (check_DATA): Add split_i386 and split_x86_64 files.
7904 (SPLIT_DEFSYMS): Define.
7905 (split_i386_[1234n].o): New targets.
7906 (split_i386_[124]): New targets.
7907 (split_i386_[1234r].stdout): New targets.
7908 (split_x86_64_[1234n].o): New targets.
7909 (split_x86_64_[124]): New targets.
7910 (split_x86_64_[1234r].stdout): New targets.
7911 (MOSTLYCLEANFILES): Add new executables.
7912 * testsuite/split_i386.sh: New file.
7913 * testsuite/split_x86_64.sh: New file.
7914 * testsuite/split_i386_1.s: New file.
7915 * testsuite/split_i386_2.s: New file.
7916 * testsuite/split_i386_3.s: New file.
7917 * testsuite/split_i386_4.s: New file.
7918 * testsuite/split_i386_n.s: New file.
7919 * testsuite/split_x86_64_1.s: New file.
7920 * testsuite/split_x86_64_2.s: New file.
7921 * testsuite/split_x86_64_3.s: New file.
7922 * testsuite/split_x86_64_4.s: New file.
7923 * testsuite/split_x86_64_n.s: New file.
7924 * testsuite/testfile.cc (Target_test): Update relocation_section
7925 function.
7926 * testsuite/Makefile.in: Rebuild.
7927
7928 2009-10-06 Ian Lance Taylor <iant@google.com>
7929
7930 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7931 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7932 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7933 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7934 the address on ldo_addrs_.
7935 (Target_i386::Relocate::fix_up_ldo): New function.
7936
7937 2009-10-06 Rafael Espindola <espindola@google.com>
7938
7939 * plugin.cc (add_input_library): New.
7940 (Plugin::load): Add add_input_library to tv.
7941 (Plugin_manager::add_input_file): Add the is_lib argument.
7942 (add_input_file): Update call to Plugin_manager::add_input_file.
7943 (add_input_library): New.
7944 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7945
7946 2009-09-30 Doug Kwan <dougkwan@google.com>
7947
7948 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7949 symbol and call Symbol::may_need_copy_reloc to determine if
7950 a copy reloc is needed.
7951 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7952 nocopyreloc is given in command line.
7953 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7954 given in command line.
7955 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7956 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7957 of the removed Target_i386::may_need_copy_reloc.
7958 * options.h (copyreloc): New option with default value false.
7959 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7960 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7961 instead of the removed Target_powerpc::may_need_copy_reloc.
7962 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7963 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7964 instead of the removed Target_sparc::may_need_copy_reloc.
7965 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7966 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7967 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7968 instead of the removed Target_x86_64::may_need_copy_reloc.
7969
7970 2009-09-30 Ian Lance Taylor <iant@google.com>
7971
7972 * object.h (class Object): Remove target_ field, and target,
7973 sized_target, and set_target methods.
7974 (Object::sized_target): Remove.
7975 (class Sized_relobj): Update declarations. Remove sized_target.
7976 * object.cc (Sized_relobj::setup): Remove target parameter.
7977 Change all callers.
7978 (Input_objects::add_object): Don't do anything with the target.
7979 (make_elf_sized_object): Add punconfigured parameter. Change all
7980 callers. Set or test parameter target.
7981 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7982 Change all callers.
7983 * parameters.cc (Parameters::set_target): Change parameter type to
7984 be non-const.
7985 (Parameters::default_target): Remove.
7986 (set_parameters_target): Change parameter type to be non-const.
7987 (parameters_force_valid_target): New function.
7988 (parameters_clear_target): New function.
7989 * parameters.h (class Parameters): Update declarations. Remove
7990 default_target method. Add sized_target and clear_target
7991 methods. Change target_ to be non-const.
7992 (set_parameters_target): Update declaration.
7993 (parameters_force_valid_target): Declare.
7994 (parameters_clear_target): Declare.
7995 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7996 as NULL if we aren't searching.
7997 (Add_symbols::run): Don't check for compatible target.
7998 * fileread.cc (Input_file::open_binary): Call
7999 parameters_force_valid_target.
8000 * gold.cc (queue_middle_tasks): Likewise.
8001 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8002 set_target on object.
8003 * dynobj.h (class Sized_dynobj): Update declarations.
8004 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8005 make_elf_object returns NULL.
8006 (Archive::include_member): Don't check whether object target is
8007 compatible.
8008 * output.cc (Output_section::add_input_section): Get target from
8009 parameters.
8010 (Output_section::relax_input_section): Likewise.
8011 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8012 parameters.
8013 (Sized_relobj::do_scan_relocs): Likewise.
8014 (Sized_relobj::relocate_sections): Likewise.
8015 * resolve.cc (Symbol_table::resolve): Likewise.
8016 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8017 parameter. Change all callers.
8018 (Symbol_table::add_from_object): Get target from parameters.
8019 (Symbol_table::add_from_relobj): Don't check object target.
8020 (Symbol_table::add_from_dynobj): Likewise.
8021 (Symbol_table::define_special_symbol): Get target from
8022 parameters.
8023 * symtab.h (class Symbol_table): Update declaration.
8024 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8025 parameter. Change all callers. Clear parameter target.
8026 (Binary_test): Test target here.
8027 * testsuite/object_unittest.cc (gold_testsuite): Remove
8028 target_test_pointer parameter. Change all callers.
8029 (Object_test): Test target here.
8030
8031 2009-09-26 Ian Lance Taylor <iant@google.com>
8032
8033 * testsuite/initpri1.c: Don't try to use constructor priorities if
8034 compiling with gcc before 4.3.
8035
8036 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8037
8038 * testsuite/retain_symbols_file_test.sh (check_present): Change
8039 output file name to retain_symbols_file_test.stdout.
8040 (check_absent): Likewise.
8041
8042 2009-09-18 Craig Silverstein <csilvers@google.com>
8043
8044 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8045 * options.cc: Include <cerrno> and <fstream>.
8046 (General_options::finalize): Parse -retain-symbols-file tag.
8047 * options.h: New flag.
8048 (General_options): New method should_retain_symbol, new
8049 variable symbols_to_retain.
8050 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8051 should_retain_symbol map.
8052 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8053 * testsuite/Makefile.in: Regenerate.
8054 * testsuite/retain_symbols_file_test.sh: New file.
8055
8056 2009-09-18 Nick Clifton <nickc@redhat.com>
8057
8058 * po/es.po: Updated Spanish translation.
8059
8060 2009-09-17 Doug Kwan <dougkwan@google.com>
8061
8062 * debug.h (DEBUG_RELAXATION): New constant.
8063 (DEBUG_ALL): Add DEBUG_RELAXATION.
8064 (debug_string_to_enum): Add relaxation debug option.
8065 * layout.cc
8066 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8067 Layout::Relaxation_debug_check::read_sections,
8068 Layout::Relaxation_debug_check::read_sections): New method definitions.
8069 (Layout::Layout): Initialize data members
8070 record_output_section_data_from_scrips_,
8071 script_output_section_data_list_ and relaxation_debug_check_.
8072 (Layout::save_segments, Layout::restore_segments,
8073 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8074 Layout::relaxation_loop_body): New method definitions.
8075 (Layout::finalize): Support relaxation. Move section layout code to
8076 Layout::relaxation_loop_body.
8077 (Layout::set_asection_address_from_script): Move code for orphan
8078 section placement out.
8079 (Layout::place_orphan_sections_in_script): New method definition.
8080 * layout.h (Output_segment_headers, Output_file_header):
8081 New forward class declarations.
8082 (Layout::~Layout): Define.
8083 (Layout::new_output_section_data_from_script): New method definition.
8084 (Layout::place_orphan_sections_in_script): New method declaration.
8085 (Layout::Segment_states): New type declaration.
8086 (Layout::save_segments, Layout::restore_segments,
8087 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8088 Layout::relaxation_loop_body): New method declarations.
8089 (Layout::Output_section_data_list): New type declaration.
8090 (Layout::Relaxation_debug_check): New class definition.
8091 (Layout::record_output_section_data_from_script_,
8092 Layout::script_output_section_data_list_, Layout::segment_states_,
8093 Layout::relaxation_debug_check_): New data members.
8094 * output.cc: (Output_section_headers::do_size): New method definition.
8095 (Output_section_headers::Output_section_headers): Move size
8096 computation to Output_section_headers::do_size.
8097 (Output_segment_headers::do_size): New method definition.
8098 (Output_file_header::Output_file_header): Move size computation to
8099 Output_file_header::do_size and call it.
8100 (Output_file_header::do_size): New method definition.
8101 (Output_data_group::Output_data_group): Adjust call to
8102 Output_section_data.
8103 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8104 (Output_symtab_xindex::do_write): Add array bound check.
8105 (Output_section::Input_section::print_to_mapfile): Handle
8106 RELAXED_INPUT_SECTION_CODE.
8107 (Output_section::Output_section): Initialize data member checkpoint_.
8108 (Output_section::~Output_section): Delete checkpoint object pointed
8109 by checkpoint_.
8110 (Output_section::add_input_section): Always add an Input_section if
8111 relaxing.
8112 (Output_section::add_merge_input_section): Add assert.
8113 (Output_section::relax_input_section): New method definition.
8114 (Output_section::set_final_data_size): Set load address to zero for
8115 an unallocated section.
8116 (Output_section::do_address_and_file_offset_have_reset_values):
8117 New method definition.
8118 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8119 Handle relaxed input section.
8120 (Output_section::sort_attached_input_sections): Checkpoint input
8121 section list lazily.
8122 (Output_section::get_input_sections): Change type of input_sections to
8123 list of Simple_input_section pointers. Checkpoint input section list
8124 lazily. Also handle relaxed input sections.
8125 (Output_section::add_input_section_for_script): Take a reference to
8126 a Simple_input_section object instead of Relobj pointer and section
8127 index as parameter. Handle relaxed input sections.
8128 (Output_section::save_states, Output_section::restore_states): New
8129 method definitions.
8130 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8131 (Output_data::is_data_size_fixed): New method definition.
8132 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8133 if it is fixed.
8134 (Output_data::address_and_file_offset_have_reset_values): New method
8135 definition.
8136 (Output_data::do_address_and_file_offset_have_reset_values): New method
8137 definition.
8138 (Output_data::set_data_size): Check that data size is not fixed.
8139 (Output_data::fix_data_size): New method definition.
8140 (Output_data::is_data_size_fixed_): New data member.
8141 (Output_section_headers::set_final_data_size): New method definition.
8142 (Output_section_headers::do_size): New method declaration.
8143 (Output_segment_headers::set_final_data_size): New method definition.
8144 (Output_segment_headers::do_size): New method declaration.
8145 (Output_file_header::set_final_data_size)::New method definition.
8146 (Output_file_header::do_size)::New method declaration.
8147 (Output_section_data::Output_section_data): Add new parameter
8148 is_data_size_fixed and use it to fix data size.
8149 (Output_data_const::Output_data_const): Adjust call to base class
8150 constructor and fix data size.
8151 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8152 base class constructor and fix data size.
8153 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8154 base class constructor and fix data size.
8155 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8156 class constructor and fix data size.
8157 (Output_data_group::set_final_data_size): New method definition.
8158 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8159 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8160 class constructor and fix data size.
8161 (Output_relaxed_input_section): New class definition.
8162 (Output_section::Simple_input_section): New class definition.
8163 (Output_section::get_input_sections): Adjust parameter list.
8164 (Output_section::add_input_section_for_script): Same.
8165 (Output_section::save_states, Output_section::restore_states,
8166 Output_section::do_address_and_file_offset_have_reset_values,
8167 (Output_section::Input_section::Input_section): Handle
8168 RELAXED_INPUT_SECTION_CODE. Add new overload for
8169 Output_relaxed_input_section.
8170 (Output_section::Input_section::is_input_section,
8171 Output_section::Input_section::set_output_section): Handle relaxed
8172 input section.
8173 (Output_section::Input_section::is_relaxed_input_section,
8174 Output_section::Input_section::output_section_data,
8175 Output_section::Input_section::relaxed_input_section): New method
8176 definitions.
8177 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8178 value.
8179 (Output_section::Input_section::u1_): Update comments.
8180 (Output_section::Input_section::u2_): Add new union member poris.
8181 (Output_section::Checkpoint_output_section): New classs definition.
8182 (Output_section::relax_input_section): New method declaration.
8183 (Output_section::checkpoint_): New data member.
8184 (Output_segment): Update comments.
8185 (Output_segment::Output_segment): Un-privatize copy constructor.
8186 (Output_segment::operator=): Un-privatize.
8187 * script-sections.cc (Output_section_element::Input_section_list):
8188 Change element type to Output_section::Simple_input_section.
8189 (Output_section_element_dot_assignment::set_section_addresses):
8190 Register output section data for relaxation clean up.
8191 (Output_data_exression::Output_data_expression): Adjust call to base
8192 constructor to fix data size.
8193 (Output_section_element_data::set_section_addresses): Register
8194 Output_data_expression object for relaxation clean up.
8195 (struct Input_section_info): Replace Relobj pointer and section index
8196 pair with Output_section::Simple_input_section and Convert struct to a
8197 class.
8198 (Input_section_sorter::operator()): Adjust access to
8199 Input_section_info data member to use accessors.
8200 (Output_section_element_input::set_section_addresses): Use layout
8201 parameter. Adjust code to use Output_section::Simple_input_section
8202 and Input_secction_info classes. Register filler for relaxation
8203 clean up.
8204 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8205 and section index pair with Output_section::Simple_input_section
8206 class. Adjust code accordingly.
8207 (Phdrs_element::release_segment): New method definition.
8208 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8209 segment list.
8210 (Script_sections::release_segments): New method definition.
8211 * gold/script-sections.h (Script_sections::release_segments): New
8212 method declaration.
8213 * gold/target.h (Target::may_relax, Target::relax,
8214 Target::do_may_relax, Target::do_relax): New method definitions.
8215
8216 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8217
8218 * arm.cc (has_signed_unsigned_overflow): New function.
8219 (Arm_relocate_functions::abs8): New function.
8220 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8221 (Target_arm::Scan::global): Likewise.
8222 (Target_arm::relocate::relocate): Likewise.
8223 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8224 Likewise.
8225
8226 2009-09-16 Cary Coutant <ccoutant@google.com>
8227
8228 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8229 * testsuite/Makefile.in: Regenerate.
8230
8231 2009-09-11 Nick Clifton <nickc@redhat.com>
8232
8233 * po/gold.pot: Updated by the Translation project.
8234
8235 2009-09-08 Cary Coutant <ccoutant@google.com>
8236
8237 * output.cc (Output_file::open): Add execute permission to empty file.
8238 * testsuite/Makefile.am (permission_test): New test.
8239 * testsuite/Makefile.in: Regenerate.
8240
8241 2009-09-02 Ian Lance Taylor <iant@google.com>
8242
8243 * output.cc (Output_file::resize): Call map_no_anonymous rather
8244 than map.
8245
8246 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8247
8248 * gold.cc: Include "incremental.h".
8249 (queue_initial_tasks): Call Incremental_checker methods.
8250 * incremental.cc: Include "output.h".
8251 (Incremental_checker::can_incrementally_link_output_file): New
8252 method.
8253 * incremental.h (Incremental_checker): New class.
8254
8255 * output.cc (Output_file::open_for_modification): New method.
8256 (Output_file::map_anonymous): Changed return type to bool. Record
8257 map in base_ field.
8258 (Output_file::map_no_anonymous): New method, broken out of map.
8259 (Output_file::map): Use map_no_anonymous and map_anonymous.
8260 * output.h (class Output_file): Update declarations.
8261
8262 2009-08-24 Cary Coutant <ccoutant@google.com>
8263
8264 * options.h (Command_line::Pre_options): New class.
8265 (Command_line::pre_options): New member.
8266 * options.cc (gold::options::ready_to_register): New variable.
8267 (One_option::register_option): Do nothing if not registering options.
8268 Assert if same short option registered twice.
8269 (General_options::General_options): Turn off option registration when
8270 done constructing.
8271 (Command_line::Pre_options::Pre_options): New constructor.
8272
8273 2009-08-24 Cary Coutant <ccoutant@google.com>
8274
8275 * options.h (General_options::no_keep_memory): Remove incorrect
8276 short option.
8277
8278 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8279
8280 * Makefile.am (am__skiplex, am__skipyacc): New.
8281 * Makefile.in: Regenerate.
8282
8283 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8284
8285 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8286 (INCLUDES): ... this.
8287 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8288 (AM_CPPFLAGS): Renamed from ...
8289 (INCLUDE): ... this.
8290 * Makefile.in, testsuite/Makefile.in: Regenerate.
8291
8292 * Makefile.in: Regenerate.
8293 * aclocal.m4: Likewise.
8294 * config.in: Likewise.
8295 * configure: Likewise.
8296 * testsuite/Makefile.in: Likewise.
8297
8298 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8299 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8300 * Makefile.in: Regenerate.
8301 * testsuite/Makefile.in: Regenerate.
8302
8303 2009-08-19 Cary Coutant <ccoutant@google.com>
8304
8305 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8306 symbols in shared libraries overridden by hidden or internal symbols
8307 in the main program.
8308
8309 2009-08-19 Chris Demetriou <cgd@google.com>
8310
8311 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8312 checking source file names in error messages.
8313
8314 2009-08-18 Doug Kwan <dougkwan@google.com>
8315
8316 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8317 an elcpp::Ehdr as parameter. Adjust call to set_target.
8318 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8319 an elfcpp::Ehdr as parameter.
8320 * object.cc (Object::set_target): Remove the version that looks up
8321 a target and sets it.
8322 (Sized_relobj::setup): Take a Target object instead of
8323 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8324 (make_elf_sized_object): Find target and ask target to
8325 make an ELF object.
8326 * object.h: (Object::set_target): Remove the version that looks up
8327 a target and sets it.
8328 (Sized_relobj::setup): Take a Target object instead of
8329 an elfcpp:Ehdr as parameter.
8330 * target.cc: Include dynobj.h.
8331 (Target::do_make_elf_object_implementation): New.
8332 (Target::do_make_elf_object): New.
8333 * target.h (Target::make_elf_object): New template declaration.
8334 (Target::do_make_elf_object): New method declarations.
8335 (Target::do_make_elf_object_implementation): New template declaration.
8336
8337 2009-08-14 Ian Lance Taylor <iant@google.com>
8338
8339 * gold.h (FUNCTION_NAME): Define.
8340 (gold_unreachable): Use FUNCTION_NAME.
8341
8342 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8343
8344 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8345 symbol in the --keep-unique list is not found.
8346
8347 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8348
8349 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8350 been maked as --keep-unique.
8351 (Icf::unfold_section): New function.
8352 * icf.h (Icf::unfold_section): New function.
8353 * options.h (General_options::keep_unique): New option.
8354 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8355 * testsuite/Makefile.in: Regenerate.
8356 * testsuite/icf_keep_unique_test.sh: New file.
8357 * testsuite/icf_keep_unique_test.cc: New file.
8358
8359 2009-08-12 Cary Coutant <ccoutant@google.com>
8360
8361 PR 10471
8362 * resolve.cc (Symbol_table::resolve): Check for references from
8363 dynamic objects to hidden and internal symbols.
8364 * testsuite/Makefile.am (hidden_test.sh): New test.
8365 * testsuite/Makefile.in: Regenerate.
8366 * testsuite/hidden_test.sh: New script.
8367 * testsuite/hidden_test_1.c: New test source.
8368 * testsuite/hidden_test_main.c: New test source.
8369
8370 2009-08-11 Doug Kwan <dougkwan@google.com>
8371
8372 * arm.cc: Update comments.
8373 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8374 segment to locate the .ARM.exidx section if present.
8375
8376 2009-08-09 Doug Kwan <dougkwan@google.com>
8377
8378 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8379 patch.
8380
8381 2009-08-07 Sriraman Tallam <tmsriram@google.com>
8382 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8383 compiler warnings.
8384
8385 2009-08-06 Sriraman Tallam <tmsriram@google.com>
8386
8387 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8388 valid tls_segment only for non-debug-section relocations.
8389 * testsuite/Makefile.am: Add gc_tls_test.
8390 * testsuite/Makefile.in: Regenerate.
8391 * testsuite/gc_tls_test.cc: New file.
8392 * testsuite/gc_tls_test.sh: New file.
8393
8394 2009-08-05 Sriraman Tallam <tmsriram@google.com>
8395
8396 * icf.cc: New file.
8397 * icf.h: New file.
8398 * Makefile.am (CCFILES): Add icf.cc.
8399 (HFILES): Add icf.h
8400 * Makefile.in: Regenerate.
8401 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8402 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8403 section, symbol and addend information for the relocs.
8404 * gold.cc (queue_middle_tasks): Call identical code folding.
8405 * gold.h: Add defines for multimap.
8406 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8407 to the call of finalize_local_symbols.
8408 * main.cc (main): Create object of class Icf.
8409 * object.cc (Sized_relobj::do_layout): Allow this function to be
8410 called twice during icf.
8411 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8412 to sections marked as identical by icf.
8413 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8414 when available.
8415 (Sized_relobj::do_section_entsize): New function.
8416 * object.h (Object::section_entsize): New function.
8417 (Object::do_section_entsize): New pure virtual function.
8418 (Relobj::finalize_local_symbols): Add new parameter.
8419 (Relobj::do_section_entsize): New function.
8420 * options.h (General_options::icf): New option.
8421 (General_options::icf_iterations): New option.
8422 (General_options::print_icf_sections): New option.
8423 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8424 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8425 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8426 icf.
8427 * symtab.cc (Symbol_table::is_section_folded): New function.
8428 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8429 to sections marked as identical by icf.
8430 * symtab.h (Symbol_table::set_icf): New function.
8431 (Symbol_table::icf): New function.
8432 (Symbol_table::is_section_folded): New function.
8433 (Symbol_table::icf_): New data member.
8434 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8435 * testsuite/Makefile.am: Add commands to build icf_test.
8436 * testsuite/Makefile.in: Regenerate.
8437 * testsuite/icf_test.sh: New file.
8438 * testsuite/icf_test.cc: New file.
8439
8440 2009-07-24 Chris Demetriou <cgd@google.com>
8441
8442 * layout.cc (is_compressible_debug_section): Fix incorrect
8443 comment about compressed section names.
8444
8445 2009-07-20 Ian Lance Taylor <ian@airs.com>
8446
8447 PR 10419
8448 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8449
8450 2009-07-16 Ian Lance Taylor <iant@google.com>
8451
8452 PR 10400
8453 * layout.h: #include <map>.
8454 (class Kept_section): Change from struct to class. Add accessors
8455 and setters. Add section size to Comdat_group mapping. Change
8456 Comdat_group to std::map. Add is_comdat_ field. Add
8457 linkonce_size field in union.
8458 (class Layout): Update declaration of find_or_add_kept_section.
8459 Don't declare find_kept_object.
8460 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8461 parameter. Add object, shndx, is_comdat, and is_group_name
8462 parameters. Change all callers. Adjust for new Kept_section.
8463 (Layout::find_kept_object): Remove.
8464 * object.cc (Sized_relobj::include_section_group): Update use of
8465 Kept_section. Rename secnum to shndx. Only record
8466 Kept_comdat_section if sections are the same size.
8467 (Sized_relobj::include_linkonce_section): Update use of
8468 Kept_section. Only record Kept_comdat_section if sections are the
8469 same size. Set size of linkonce section.
8470 (Sized_relobj::map_to_kept_section): Update call to
8471 get_kept_comdat_section.
8472 * object.h (class Sized_relobj): Rename fields in
8473 Kept_comdat_section to drop trailing underscores; change object
8474 field to Relobj*. Change Kept_comdat_section_table to store
8475 struct rather than pointer.
8476 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8477 Add kept_object and kept_shndx parameters. Change all callers.
8478 (Sized_relobj::get_kept_comdat_section): Change return type to
8479 bool. Add kept_object and kept_shndx parameters. Change all
8480 callers.
8481 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8482 Layout::find_or_add_kept_section.
8483
8484 2009-07-09 Ian Lance Taylor <iant@google.com>
8485
8486 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8487 Reserve space in the hash table.
8488
8489 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8490
8491 * fileread.cc (File_read::get_mtime): New method.
8492 * fileread.h (Timespec): New structure.
8493 (File_read::get_mtime): New method.
8494 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8495 Renamed from timestamp_nsec.
8496 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8497 Elf_Xword.
8498 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
8499 timestamp_nsec.
8500 (Incremental_inputs::report_archive): Save mtime; style fix.
8501 (Incremental_inputs::report_obejct): Save mtime; style fix.
8502 (Incremental_inputs::report_script): Save mtime; style fix.
8503 (Incremental_inputs::finalize_inputs): Style fix.
8504 (Incremental_inputs::finalize): Style fix.
8505 (Incremental_inputs::create_input_section_data): Store inputs
8506 mtime.
8507 * incremental.h (Incremental_inputs::report_script): Add mtime
8508 argument.
8509 (Incremental_inputs::Input_info::Input_info): Intialize only one
8510 union member.
8511 (Incremental_inputs::Input_info::archive): Move to nameless
8512 union.
8513 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8514 (Incremental_inputs::Input_info::script): Move to nameless union.
8515 (Incremental_inputs::mtime): New field.
8516 * script.cc (read_input_script): Pass file mtime to
8517 Incremental_input.
8518 * script.h (Script_info::inputs): Style fix.
8519
8520 2009-07-01 Ian Lance Taylor <ian@airs.com>
8521
8522 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8523 instead of 32.
8524
8525 2009-06-24 Ian Lance Taylor <iant@google.com>
8526
8527 PR 10156
8528 * layout.cc (Layout::choose_output_section): If we find an
8529 existing section, update the flags.
8530 (Layout::create_notes): New function, broken out of
8531 Layout::finalize.
8532 (Layout::finalize): Don't create note sections.
8533 (Layout::create_note): Don't crash if linker script discards
8534 section.
8535 (Layout::create_gold_note): Likewise.
8536 (Layout::create_build_id): Likewise. Don't set
8537 after_input_sections on the section.
8538 (Layout::create_executable_stack_info): Remove target parameter.
8539 Change caller.
8540 * layout.h (class Layout): Declare create_notes. Update
8541 declaration of create_executable_stack_info.
8542 * gold.cc (queue_middle_tasks): Call create_notes.
8543 * output.cc (Output_section::update_flags_for_input_section): Move
8544 here from output.h. If SHF_ALLOC flag is newly set, mark address
8545 invalid.
8546 * output.h (Output_data::mark_address_invalid): New function.
8547 (class Output_section): Only declare, not define,
8548 update_flags_for_input_section. Remove set_flags.
8549
8550 2009-06-24 Ian Lance Taylor <iant@google.com>
8551
8552 * script-sections.cc (Output_section_definition::
8553 set_section_addresses): Rename shadowing local load_address to
8554 laddr.
8555
8556 2009-06-24 Ian Lance Taylor <iant@google.com>
8557
8558 PR 10244
8559 * reloc.cc (relocate_sections): Skip empty relocation sections.
8560
8561 2009-06-23 Ian Lance Taylor <iant@google.com>
8562
8563 PR 10156
8564 * layout.cc (Layout::create_note): Use choose_output_section
8565 rather than make_output_section.
8566
8567 2009-06-23 Ian Lance Taylor <iant@google.com>
8568
8569 PR 10237
8570 * options.cc (General_options::parse_V): Set printed_version_.
8571 (General_options::General_options): Initialize printed_version_.
8572 * options.h (class General_options): Add printed_version_ field.
8573 * gold.cc (queue_initial_tasks): If there are no input files,
8574 don't give a fatal error if we printed the version information.
8575 (queue_middle_tasks): If using -r with a shared object, give a
8576 fatal error rather than an ordinary error.
8577
8578 2009-06-23 Ian Lance Taylor <iant@google.com>
8579
8580 PR 10219
8581 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8582 (Layout::make_output_section): Set have_stabstr_section_ if we see
8583 a .stab*str section.
8584 (Layout::finalize): Call link_stabs_sections.
8585 (Layout::link_stabs_sections): New file.
8586 * layout.h (class Layout): Add have_stabstr_section_ field.
8587 Declare link_stabs_sections.
8588
8589 2009-06-23 Doug Kwan <dougkwan@google.com>
8590
8591 * Makefile.am (libgold_a_LIBADD): New.
8592 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8593 * Makefile.in: Regenerate.
8594 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8595 * configure: Regenerate.
8596 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8597 * fileread.cc: Include sys/state.h
8598 * gold.h: Declare memmem and strndup if found missing.
8599 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8600
8601 2009-06-23 Ian Lance Taylor <iant@google.com>
8602
8603 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8604 * configure: Rebuild.
8605
8606 2009-06-23 Ian Lance Taylor <iant@google.com>
8607
8608 PR 10147
8609 * object.cc (Object::section_contents): Don't try to get a view if
8610 the section has length zero.
8611 (Object::handle_gnu_warning_section): If the section is empty, use
8612 the name of the section as the warning.
8613
8614 2009-06-23 Ian Lance Taylor <iant@google.com>
8615
8616 PR 10133
8617 * stringpool.h (class Stringpool_template): Add optimize_ field.
8618 (Stringpool_template::set_optimize): New function.
8619 * stringpool.cc (Stringpool_template::Stringpool_template):
8620 Initialize optimize_ field.
8621 (Stringpool_template::set_string_offsets): Test local optimize
8622 fild rather than parameter.
8623 * layout.cc (Layout::Layout): Call set_optimize on the section
8624 name stringpool.
8625
8626 2009-06-22 Ian Lance Taylor <iant@google.com>
8627
8628 PR 10030
8629 * yyscript.y: Parse TARGET.
8630 * script.cc (script_set_target): New function.
8631 * script-c.h (script_set_target): Declare.
8632 * options.cc (General_options::string_to_object_format): Rename
8633 from string_to_object_format in anonymous namespace. Change
8634 callers.
8635 * options.h (class General_options): Declare
8636 string_to_object_format.
8637
8638 2009-06-22 Ian Lance Taylor <iant@google.com>
8639
8640 * script-sections.cc (Script_sections::create_segments): Don't put
8641 program headers in a PT_LOAD segment if -n or -N.
8642
8643 2009-06-22 Ian Lance Taylor <iant@google.com>
8644
8645 PR 10141
8646 * options.h (class General_options): Add -z lazy and -z now. Sort
8647 -z options into alphabetical order.
8648 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8649
8650 2009-06-21 Ian Lance Taylor <iant@google.com>
8651
8652 * layout.cc (Layout::make_output_section): Call
8653 Target::new_output_section.
8654 (Layout::attach_allocated_section_to_segment): Put large section
8655 sections in a separate load segment with the large segment flag
8656 set.
8657 (Layout::segment_precedes): Sort large data segments after other
8658 load segments.
8659 (align_file_offset): New static function.
8660 (Layout::set_segment_offsets): Use align_file_offset.
8661 * output.h (class Output_section): Add is_small_section_ and
8662 is_large_section_ fields.
8663 (Output_section::is_small_section): New function.
8664 (Output_section::set_is_small_section): New function.
8665 (Output_section::is_large_section): New function.
8666 (Output_section::set_is_large_section): New function.
8667 (Output_section::is_large_data_section): New function.
8668 (class Output_segment): Add is_large_data_segment_ field.
8669 (Output_segment::is_large_data_segment): New function.
8670 (Output_segment::set_is_large_data_segment): New function.
8671 * output.cc (Output_section::Output_section): Initialize new
8672 fields.
8673 (Output_segment::Output_segment): Likewise.
8674 (Output_segment::add_output_section): Add assertion that large
8675 data sections always go in large data segments. Force small data
8676 sections to the end of the list of data sections. Force small BSS
8677 sections to the start of the list of BSS sections. For large BSS
8678 sections to the end of the list of BSS sections.
8679 * symtab.h (class Symbol): Declare is_common_shndx.
8680 (Symbol::is_defined): Check Symbol::is_common_shndx.
8681 (Symbol::is_common): Likewise.
8682 (class Symbol_table): Define enum Commons_section_type. Update
8683 declarations. Add small_commons_ and large_commons_ fields.
8684 * symtab.cc (Symbol::is_common_shndx): New function.
8685 (Symbol_table::Symbol_table): Initialize new fields.
8686 (Symbol_table::add_from_object): Put small and large common
8687 symbols in the right list.
8688 (Symbol_table::sized_finalized_symbol): Check
8689 Symbol::is_common_shndx.
8690 (Symbol_table::sized_write_globals): Likewise.
8691 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8692 common symbol lists. Don't call do_allocate_commons_list if the
8693 list is empty.
8694 (Symbol_table::do_allocate_commons_list): Remove is_tls
8695 parameter. Add comons_section_type parameter. Change all
8696 callers. Handle small and large common symbols.
8697 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8698 Symbol::is_common_shndx.
8699 * resolve.cc (symbol_to_bits): Likewise.
8700 * target.h (Target::small_common_shndx): New function.
8701 (Target::small_common_section_flags): New function.
8702 (Target::large_common_shndx): New function.
8703 (Target::large_common_section_flags): New function.
8704 (Target::new_output_section): New function.
8705 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8706 small_common_section_flags, and large_common_section_flags
8707 fields.
8708 (Target::do_new_output_section): New virtual function.
8709 * arm.cc (Target_arm::arm_info): Initialize new fields.
8710 * i386.cc (Target_i386::i386_info): Likewise.
8711 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8712 Likewise.
8713 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8714 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8715 (Target_x86_64::do_new_output_section): New function.
8716 * configure.ac: Define conditional MCMODEL_MEDIUM.
8717 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8718 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8719 (large_LDFLAGS): Define.
8720 * testsuite/large.c: New file.
8721 * testsuite/testfile.cc (Target_test::test_target_info):
8722 Initialize new fields.
8723 * configure, testsuite/Makefile.in: Rebuild.
8724
8725 2009-06-05 Doug Kwan <dougkwan@google.com>
8726
8727 * Makefile.am (CCFILES): Add target.cc.
8728 * Makefile.in: Regenerate.
8729 * i386.cc (class Target_i386): Define new virtual method to
8730 override do_is_local_label_name in parent.
8731 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8732 local symbols if --discard-locals or -X is given.
8733 * options.h (class General_options): Declare new options
8734 '--discard-locals' and '-X' for discarding locals.
8735 * target.h (class Target): Define new methods is_local_label_name.
8736 Declare new virtual method do_is_local_label_name.
8737 * target.cc: New file.
8738 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8739 (check_SCRIPTS): Add discard_locals_test.sh.
8740 (check_DATA): Add discard_local_tests.syms.
8741 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8742 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8743 * testsuite/Makefile.in: Regenerate.
8744 * testsuite/discard_locals_test.c: New file.
8745 * testsuite/discard_locals_test.sh: Same.
8746
8747 2009-06-05 Doug Kwan <dougkwan@google.com>
8748
8749 * object.cc (Sized_relobj::Sized_relobj): Initialize
8750 discarded_eh_frame_shndx_ to -1U.
8751 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8752 section.
8753 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8754 a discarded .eh_frame section.
8755 (Sized_relobj::do_finalize_local_symbols): Ditto.
8756 * object.h (class Sized_relobj): Declare new member
8757 discarded_eh_frame_shndx_.
8758 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8759 (local_labels_test.o, local_labels_test): New rules.
8760 * testsuite/Makefile.in: Regenerate.
8761
8762 2009-06-04 Doug Kwan <dougkwan@google.com>
8763
8764 * layout.cc (Layout::section_name_mapping): Add mapping for
8765 special ARM sections.
8766
8767 2009-06-03 Doug Kwan <dougkwan@google.com>
8768
8769 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8770 (utils::has_overflow): Same.
8771
8772 2009-06-03 Ian Lance Taylor <iant@google.com>
8773
8774 * layout.cc (Layout::section_name_mapping): New array, replacing
8775 Layout::linkonce_mapping.
8776 (Layout::section_name_mapping_count): New variable, replacing
8777 Layout::linkonce_mapping_count.
8778 (Layout::linkonce_output_name): Remove.
8779 (Layout::output_section_name): Rewrite.
8780 * layout.h (class Layout): Rename Linkonce_mapping to
8781 Section_name_mapping, linkonce_mapping to section_name_mapping,
8782 linkonce_mapping_count to section_name_mapping_count. Don't
8783 declare linkonce_output_name.
8784
8785 2009-06-03 Doug Kwan <dougkwan@google.com>
8786
8787 * gold/arm.cc (namespace utils): New.
8788 (Target_arm::reloc_is_non_pic): Define new method.
8789 (class Arm_relocate_functions): New.
8790 (Target_arm::Relocate::relocate): Handle relocation types used by
8791 Android.
8792
8793 2009-06-03 Ian Lance Taylor <iant@google.com>
8794
8795 * arm.cc (Target_arm::scan::global): Use || instead of |.
8796
8797 2009-06-02 Doug Kwan <dougkwan@google.com>
8798
8799 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8800 issued_non_pic_error_.
8801 (class Target_arm::Scan): Declare new method check_non_pic.
8802 Define new method symbol_needs_plt_entry.
8803 Declare new data member issued_non_pic_error_.
8804 (class Target_arm::Relocate): Declare new method
8805 should_apply_static_reloc.
8806 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8807 (Target_arm::Scan::check_non_pic): Define new method.
8808 (Target_arm::Scan::local): Handle a small subset of reloc types used
8809 by Android.
8810 (Target_arm::Scan::local): Same.
8811 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8812
8813 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8814
8815 * incremental.cc (Incremental_inputs::report_command_line): Filter
8816 out --incremental-* options.
8817
8818 2009-05-29 Doug Kwan <dougkwan@google.com>
8819
8820 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8821 template class.
8822 (class Target_arm): Update comment.
8823 (Target_arm::Target_arm): Initialize new data members GOT_,
8824 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8825 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8826 and Target_arm::rel_dyn_section.
8827 Declare new_enum Target_arm::Got_type.
8828 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8829 and DYNBSS_.
8830 Update commments for member do_dynsym_value.
8831 (Target_arm::got_size, Target_arm::plt_section,
8832 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8833 new methods inside class defintion.
8834 (Target_arm::got_section): Define new method.
8835 (Target_arm::rel_dyn_section): Same.
8836 (Output_data_plt_arm): New template class.
8837 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8838 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8839 (Output_data_plt_arm::add_entry): Same.
8840 (Output_data_plt_arm::first_plt_entry): Define new
8841 static data member for PLT instruction template.
8842 (Output_data_plt_arm::plt_entry): Same.
8843 (Output_data_plt_arm::do_write): Define new method.
8844 (Target_arm::make_plt_entry): Same.
8845 (Target_arm::do_finalize_sections): Same.
8846 (Target_arm::do_dynsym_value): Same.
8847
8848 2009-05-28 Doug Kwan <dougkwan@google.com>
8849
8850 * Makefile.am (TARGETSOURCES): Add arm.cc.
8851 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8852 * Makefile.in: Regenerate.
8853 * arm.cc: New file.
8854 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8855
8856 2009-05-26 Doug Kwan <dougkwan@google.com>
8857
8858 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8859 (General_options::check_excluded_libs): Strip off directories in
8860 archive name before matching like GNU ld does.
8861 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8862 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8863 (exclude_libs_test_LDFLAGS): Add linker option
8864 -Wl,--exclude-libs,libexclude_libs_test_3
8865 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8866 an explicit archive without using -l.
8867 (alt/libexclude_libs_test_3.a): New make rule.
8868 * testsuite/Makefile.in: Regenerate.
8869 * testsuite/exclude_libs_test.c : Declare lib3_default().
8870 (main): Call it.
8871 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8872 * exclude_libs_test_3.c: New file.
8873
8874 2009-05-26 Nick Clifton <nickc@redhat.com>
8875
8876 * po/id.po: New Indonesian translation.
8877 * po/gold.pot: Updated template file.
8878
8879 2009-05-22 Sriraman Tallam <tmsriram@google.com>
8880
8881 * testsuite/Makefile.am: Add -ffunction-sections to compile
8882 gc_comdat_test files. Add -Wl,--gc-sections to build
8883 gc_comdat_test.
8884 * testsuite/Makefile.in: Regenerate.
8885 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8886
8887 2009-05-21 Sriraman Tallam <tmsriram@google.com>
8888
8889 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8890 kept comdat section was garbage collected.
8891 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8892 * testsuite/Makefile.in: Regenerate.
8893 * testsuite/gc_comdat_test.sh: New file.
8894 * testsuite/gc_comdat_test_1.cc: New file.
8895 * testsuite/gc_comdat_test_2.cc: New file.
8896
8897 2009-05-19 Doug Kwan <dougkwan@google.com>
8898
8899 * archive.cc (Archive::Archive): Move constructor from archive.h
8900 to here. Initialize no_export_.
8901 (Archive::get_elf_object_for_member): Set no_export flag of object.
8902 * archive.h (Archive::Archive): Move constructor body to
8903 archive.cc.
8904 (Archive::no_export): New method.
8905 (Archive::no_export_): New field.
8906 * object.h (Object::Object): Initialize no_export_ to false.
8907 (Object::no_export, Object::set_no_export): New methods.
8908 (Object::no_export_): New field.
8909 * options.cc (General_options::parse_exclude_libs): New method.
8910 (General_options::check_excluded_libs) Same.
8911 * options.h (exclude_libs): New option.
8912 (General_options::check_excluded_libs): New method declaration.
8913 (General_options::excluded_libs_): New field.
8914 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8915 default or protected visibility if an object has no-export flag set.
8916 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8917 (check_SCRIPTS): Add exclude_libs_test.sh.
8918 (check_DATA): Add exclude_libs_test.syms.
8919 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8920 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8921 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8922 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8923 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8924 libexclude_libs_test_2.a): New rules.
8925 * testsuite/Makefile.in: Regenerate.
8926 * testsuite/exclude_libs_test.c: New file.
8927 * testsuite/exclude_libs_test.sh: Ditto.
8928 * testsuite/exclude_libs_test_1.c: Ditto.
8929 * testsuite/exclude_libs_test_2.c: Ditto.
8930
8931 2009-05-15 Ian Lance Taylor <iant@google.com>
8932
8933 * configure.ac: Check for declarations for cases where libiberty.h
8934 checks HAVE_DECL_xxx.
8935 * configure, config.in: Rebuild.
8936
8937 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8938
8939 * gold.h (Incremental_argument_list): Remove (invalid) forward
8940 declaration.
8941 * incremental.cc (Incremental_inputs::report_achive): New method.
8942 (Incremental_inputs::report_object): New method.
8943 (Incremental_inputs::report_script): New method.
8944 (Incremental_inputs::finalize_inputs): New method.
8945 (Incremental_inputs::finalize): Call finalize_inputs().
8946 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8947 Create inputs entries.
8948 * incremental.h (Incremental_input_type): New enum.
8949 (Incremental_inputs::Incremental_input): Initialize new fields.
8950 (Incremental_inputs::report_inputs): New method.
8951 (Incremental_inputs::report_achive): New method.
8952 (Incremental_inputs::report_object): New method.
8953 (Incremental_inputs::report_script): New method.
8954 (Incremental_inputs::finalize_inputs): New method.
8955 (Incremental_inputs::Input_info): New struct.
8956 (Incremental_inputs::Input_info_map): New typedef.
8957 (Incremental_inputs::lock_): New field.
8958 (Incremental_inputs::Inputs_): New field.
8959 (Incremental_inputs::Inputs_map): New field.
8960 * main.cc (main): Call Incremental_input::report_inputs.
8961 * options.h (Input_argument_list): Typedef moved from
8962 Input_arguments.
8963 (Input_file_group::Files): Remove, use ::Input_argument_list.
8964 (Input_file_group::Input_argument_list): Remove, use
8965 ::Input_argument_list.
8966 * plugin.cc (Plugin_manager::add_input_file): Add error in
8967 incremental build.
8968 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8969 functions.
8970 * script.cc (read_input_script): Call
8971 Incremental_input::report_script.
8972 * script.h (Script_info): New class.
8973
8974 2009-04-27 Ian Lance Taylor <iant@google.com>
8975
8976 * x86_64.cc (do_adjust_output_section): Set entsize to
8977 plt_entry_size.
8978
8979 2009-04-23 Elliott Hughes <enh@google.com>
8980
8981 * output.cc (Output_file::close): After short writes, continue
8982 writing from the correct offset in the buffer being written.
8983
8984 2009-04-23 Chris Demetriou <cgd@google.com>
8985
8986 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8987 * configure: Regenerate.
8988 * config.in: Regenerate.
8989 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8990 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8991
8992 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8993
8994 * incremental.cc (Incremental_inputs_header_data): Renamed from
8995 Incremental_input_header_data.
8996 (Incremental_inputs_header_data::data_size): New field.
8997 (Incremental_inputs_header_data::put_input_file_count): Renamed
8998 from input_file_count.
8999 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9000 from command_line_offset.
9001 (Incremental_inputs_header_data::put_reserved): Renamed from
9002 put_reserved.
9003 (Incremental_inputs_entry_data): Renamed from
9004 Incremental_input_entry_data.
9005 (Incremental_inputs_entry_data::data_size): New field.
9006 (Incremental_inputs::report_command_line): New method.
9007 (Incremental_inputs::finalize): New method.
9008 (Incremental_inputs::create_incremental_inputs_data): New method.
9009 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9010 * incremental.h: New file.
9011 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9012 (Layout::finalize): Create incremental inputs section in
9013 incremental builds.
9014 (Layout::create_incremental_info_sections): New method.
9015 * layout.h (Layout::incremental_inputs): New method.
9016 (Layout::create_incremental_info_sections): New method.
9017 (Layout::incremental_inputs_): New field.
9018 * main.cc (main): Notify Incremental_input of the command line.
9019
9020 2009-04-01 Ian Lance Taylor <iant@google.com>
9021 Mikolaj Zalewski <mikolajz@google.com>
9022
9023 * gold.h (reserve_unordered_map): Define, three versions, one for
9024 each version of Unordered_map.
9025 * layout.cc (Layout::Layout): Remove options parameter. Add
9026 number_of_input_files parameter. Don't initialize options_.
9027 Initialize number_of_input_files_ and resized_signatures_. Move
9028 sections_are_attached_.
9029 (Layout::layout_group): Reserve space for group_signatures_.
9030 (Layout::find_or_add_kept_section): Change name parameter to be a
9031 reference. Resize signatures_ map when it gets large enough.
9032 (Layout::layout_eh_frame): Use parameters->options() instead of
9033 this->options_.
9034 (Layout::make_output_section): Likewise.
9035 (Layout::attach_allocated_section_to_segment): Likewise.
9036 (Layout::finalize, Layout::create_executable_stack): Likewise.
9037 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9038 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9039 * layout.h (class Layout): Update declarations. Remove options_
9040 field. Add number_of_input_files_ and resized_signatures_
9041 fields. Move sections_are_attached_ field.
9042 * main.cc (main): Pass number of input files to Layout
9043 constructor. Don't pass options.
9044
9045 2009-03-30 Ian Lance Taylor <iant@google.com>
9046
9047 * ffsll.c (ffsll): Correct implementation.
9048
9049 2009-03-27 Ian Lance Taylor <iant@google.com>
9050
9051 * ffsll.c: New file.
9052 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9053 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9054 * ftruncate.c (ftruncate): Declare before definition.
9055 * mremap.c (mremap): Likewise.
9056 * pread.c (pread): Likewise.
9057 * configure, Makefile.in, config.in: Rebuild.
9058
9059 * mremap.c: New file.
9060 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9061 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9062 (mremap): Declare if HAVE_MREMAP is not defined.
9063 * configure, Makefile.in, config.in: Rebuild.
9064
9065 2009-03-27 Cary Coutant <ccoutant@google.com>
9066
9067 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9068 position independent.
9069 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9070 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9071
9072 2009-03-24 Cary Coutant <ccoutant@google.com>
9073
9074 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9075 an executable.
9076 (needs_dynamic_reloc): Likewise.
9077
9078 2009-03-24 Ian Lance Taylor <iant@google.com>
9079
9080 * yyscript.y (file_cmd): Recognize EXTERN.
9081 (extern_name_list, extern_name_list_body): New nonterminals.
9082 * script.cc (script_add_extern): Define.
9083 * script-c.h (script_add_extern): Declare.
9084
9085 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
9086
9087 * object.cc (is_elf_object): Define.
9088 * object.h (is_elf_object): Declare.
9089 * archive.cc (Archive::get_elf_object_for_member): Call
9090 is_elf_object.
9091 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
9092
9093 2009-03-24 Elliott Hughes <enh@google.com>
9094
9095 * output.cc (Output_file::map_anonymous): Define.
9096 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9097 try an anonymous one. Report the size if the mmap fails.
9098 * output.h (class Output_file): Declare map_anonymous.
9099
9100 2009-03-24 Ian Lance Taylor <iant@google.com>
9101
9102 * target-select.cc (instantiate_target): Don't acquire the lock if
9103 the instantiated_target_ field has already been set.
9104
9105 2009-03-23 Ian Lance Taylor <iant@google.com>
9106
9107 * gold-threads.h (class Initialize_lock): Define.
9108 * gold-threads.cc (class Initialize_lock_once): Define.
9109 (initialize_lock_control): New static variable.
9110 (initialize_lock_pointer): New static variable.
9111 (initialize_lock_once): New static function.
9112 (Initialize_lock::Initialize_lock): Define.
9113 (Initialize_lock::initialize): Define.
9114 * target-select.h: Include "gold-threads.h".
9115 (class Target_selector): Add lock_ and initialize_lock_ fields.
9116 Don't define instantiate_target, just declare it.
9117 * target-select.cc (Target_selector::Target_selector): Initialize
9118 new fields.
9119 (Target_selector::instantiate_target): Define.
9120 * descriptors.h: Include "gold-threads.h".
9121 (class Descriptors): Add initialize_lock_ field.
9122 * descriptors.cc (Descriptors::Descriptors): Initialize new
9123 field.
9124 (Descriptors::open): Use initialize_lock_ field
9125 * errors.h (class Errors): Add initialize_lock_ field.
9126 * errors.cc (Errors::Errors): Initialize new field.
9127 (Errors::initialize_lock): Use initialize_lock_ field.
9128 * powerpc.cc (class Target_selector_powerpc): Remove
9129 instantiated_target_ field. In do_recognize call
9130 instantiate_target rather than do_instantiate_target. In
9131 do_instantiate_target just allocate a new target.
9132 * sparc.cc (class Target_selector_sparc): Likewise.
9133
9134 * freebsd.h: New file.
9135 * i386.cc: Include "freebsd.h".
9136 (Target_i386): Derive from Target_freebsd rather than
9137 Sized_target.
9138 (Target_selector_i386): Derive from Target_selector_freebsd rather
9139 than Target_selector.
9140 * x86_64.cc: Include "freebsd.h".
9141 (Target_x86_64): Derive from Target_freebsd rather than
9142 Sized_target.
9143 (Target_selector_x86_64): Derive from Target_selector_freebsd
9144 rather than Target_selector.
9145 * target.h (class Target): Add adjust_elf_header and
9146 do_adjust_elf_header.
9147 * output.cc (Output_file_header:: do_sized_write): Call target
9148 adjust_elf_header routine.
9149 * configure.tgt: Set targ_osabi.
9150 * configure.ac: Define GOLD_DEFAULT_OSABI.
9151 * parameters.cc (Parameters::default_target): Pass
9152 GOLD_DEFAULT_OSABI to select_target.
9153 * target-select.h (class Target_selector): Make instantiate_target
9154 protected rather than private.
9155 * Makefile.am (HFILES): Add freebsd.h.
9156 * configure, Makefile.in, config.in: Rebuild.
9157
9158 * merge.cc (do_add_input_section): Correct pend value. Change
9159 message about last entry not being null terminated from error to
9160 warning.
9161
9162 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9163
9164 * incremental.cc: New file.
9165 * Makefile.am (CCFILES): Add incremental.cc.
9166 * Makefile.in: Rebuild.
9167
9168 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9169
9170 * layout.cc (Layout::output_section_name): Preserve names
9171 of '.note.' sections.
9172
9173 2009-03-19 Ian Lance Taylor <iant@google.com>
9174
9175 * descriptors.cc (Descriptors::open): Check that the options are
9176 valid before using them.
9177
9178 2009-03-18 Ian Lance Taylor <iant@google.com>
9179
9180 * script-sections.h: Include <list>.
9181 (class Script_sections): Change Sections_elements from std::vector
9182 to std::list. Typedef public Elements_iterator. Add
9183 orphan_section_placement_, data_segment_align_start_, and
9184 saw_data_segment_align_ fields. Remove data_segment_align_index_
9185 field.
9186 * script-sections.cc (class Orphan_section_placement): New class.
9187 (class Sections_element): Add virtual functions is_relro and
9188 orphan_section_init. Remove virtual function place_orphan_here.
9189 (class Output_section_definition): Add is_relro and
9190 orphan_section_init. Remove place_orphan_here.
9191 (class Orphan_output_section): Likewise.
9192 (Script_sections::Script_sections): Update for field changes.
9193 (Script_sections::data_segment_align): Set saw_data_segment_align_
9194 and data_segment_align_start_, not data_segment_align_index.
9195 (Script_sections::data_segment_relro_end): Check
9196 saw_data_segment_align_. Use data_segment_align_start_ rather
9197 than data_segment_align_index_.
9198 (Script_sections::place_orphan): Rewrite to use
9199 Orphan_section_placement.
9200
9201 2009-03-17 Ian Lance Taylor <iant@google.com>
9202
9203 * archive.cc (Archive::add_symbols): Check for a version attached
9204 to the symbol name in the archive map.
9205 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9206 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9207 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9208 (ver_test_11.a): New target.
9209 * testsuite/Makefile.in: Rebuild.
9210
9211 * configure.ac: Check for chsize and posix_fallocate. Replace
9212 ftruncate.
9213 * ftruncate.c: New file, from gnulib.
9214 * output.cc (posix_fallocate): Define dummy version if not
9215 HAVE_POSIX_FALLOCATE.
9216 (Output_file::map): Call posix_fallocate rather than lseek and
9217 write.
9218 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9219 * configure, Makefile.in, config.in: Rebuild.
9220
9221 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
9222
9223 * layout.h (Layout::create_note): Add section_name parameter.
9224 * layout.cc (Layout::create_note): Likewise.
9225 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
9226
9227 2009-03-17 Ian Lance Taylor <iant@google.com>
9228
9229 * descriptors.cc: Include "options.h".
9230 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9231 (Descriptors::open): Always use O_CLOEXEC when opening a new
9232 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9233 then set FD_CLOEXEC.
9234
9235 * sparc.cc (class Target_sparc): Add has_got_section.
9236 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9237 make sure we have a GOT section.
9238
9239 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9240 (Target_sparc::Scan::local): Likewise.
9241 (Target_sparc::Scan::global): Likewise.
9242 (Target_sparc::Relocate::relocate): Likewise.
9243 (Target_sparc::Relocate::relocate_tls): Likewise.
9244
9245 * symtab.cc (Symbol_table::define_default_version): New function,
9246 broken out of add_from_object.
9247 (Symbol_table::add_from_object): Call define_default_version.
9248 (Symbol_table::define_special_symbol): Add resolve_oldsym
9249 parameter. Change all callers. If the version for a symbol comes
9250 from a version script, resolve it with the symbol with the same
9251 name with no version. Also add the symbol without a version if
9252 appropriate.
9253 (do_define_in_output_data): If resolving with oldsym, don't delete
9254 sym.
9255 (do_define_in_output_segment): Likewise.
9256 (do_define_as_constant): Likewise.
9257 * symtab.h (class Symbol_table): Update declarations.
9258
9259 2009-03-13 Ian Lance Taylor <iant@google.com>
9260
9261 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9262 (Read_symbols::requeue): New function.
9263 (Read_symbols::do_read_symbols): If make_elf_object fails because
9264 the target type is not configured, and the file was searched for,
9265 issue a warning and retry with the next directory.
9266 (Add_symbols::run): If the file has an incompatible format, and
9267 it was searched for, requeue the Read_symbols task. On error,
9268 release the object.
9269 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9270 dirindex parameter to constructor. Change all callers. Declare
9271 incompatible_warning and requeue.
9272 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9273 input_argument_ and input_group_ fields. Add them to
9274 constructor. Change all callers.
9275 (class Read_script): Add dirindex_ field. Add it to constructor.
9276 Change all callers.
9277 * archive.cc (Archive::setup): Remove input_objects parameter.
9278 Change all callers.
9279 (Archive::get_file_and_offset): Likewise.
9280 (Archive::read_all_symbols): Likewise.
9281 (Archive::read_symbols): Likewise.
9282 (Archive::get_elf_object_for_member): Remove input_objects
9283 parameter. Add punconfigured parameter. Change all callers.
9284 (Archive::add_symbols): Change return type to bool. Check return
9285 value of include_member.
9286 (Archive::include_all_members): Likewise.
9287 (Archive::include_member): Change return type to bool. Return
9288 false if first included object has incompatible target. Set
9289 included_member_ field.
9290 (Add_archive_symbols::run): If add_symbols returns false, requeue
9291 Read_symbols task.
9292 * archive.h (class Archive): Add included_member_ field.
9293 Initialize it in constructor. Add input_file and searched_for
9294 methods. Update declarations.
9295 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9296 input_argument_ fields. Add them to constructor. Change all
9297 callers.
9298 * script.cc: Include "target-select.h".
9299 (class Parser_closure): Add skip_on_incompatible_target_ and
9300 found_incompatible_target_ fields. Add
9301 skip_on_incompatible_target parameter to constructor. Change all
9302 callers. Add methods skip_on_incompatible_target,
9303 clear_skip_on_incompatible_target, found_incompatible_target, and
9304 set_found_incompatible_target.
9305 (read_input_script): Add dirindex parameter. Change all callers.
9306 If parser finds an incompatible target, requeue Read_symbols
9307 task.
9308 (script_set_symbol): Clear skip_on_incompatible_target in
9309 closure.
9310 (script_add_assertion, script_parse_option): Likewise.
9311 (script_start_sections, script_add_phdr): Likewise.
9312 (script_check_output_format): New function.
9313 * script.h (read_input_script): Update declaration.
9314 * script-c.h (script_check_output_format): Declare.
9315 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9316 (ignore_cmd): Remove OUTPUT_FORMAT.
9317 * fileread.cc (Input_file::Input_file): Add explicit this.
9318 (Input_file::will_search_for): New function.
9319 (Input_file::open): Add pindex parameter. Change all callers.
9320 * fileread.h (class Input_file): Add input_file_argument method.
9321 Declare will_search_for. Update declarations.
9322 * object.cc (make_elf_object): Add punconfigured parameter.
9323 Change all callers.
9324 * object.h (class Object): Make input_file public. Add
9325 searched_for method.
9326 (make_elf_object): Update declaration.
9327 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9328 restart search.
9329 * dirsearch.h (class Dirsearch): Update declaration.
9330 * options.h (class General_options): Add --warn-search-mismatch.
9331 * parameters.cc (Parameters::is_compatible_target): New function.
9332 * parameters.h (class Parameters): Declare is_compatible_target.
9333 * workqueue.cc (Workqueue::add_blocker): New function.
9334 * workqueue.h (class Workqueue): Declare add_blocker.
9335
9336 * fileread.cc (Input_file::open): Remove options parameter.
9337 Change all callers.
9338 (Input_file::open_binary): Likewise.
9339 * script.cc (read_input_script): Likewise.
9340 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9341 options parameter from constructor. Change all callers.
9342 (class Read_script): Likewise.
9343 * fileread.h (class Input_file): Update declarations.
9344 * script.h (read_input_script): Update declaration.
9345
9346 2009-03-10 Nick Clifton <nickc@redhat.com>
9347
9348 * po/es.po: New Spanish translation.
9349
9350 2009-03-06 Cary Coutant <ccoutant@google.com>
9351
9352 * options.cc (parse_short_option): Keep dash_z from registering itself.
9353
9354 2009-03-03 Ian Lance Taylor <iant@google.com>
9355
9356 PR 9918
9357 * target-reloc.h (relocate_section): Pass output_section to
9358 relocate.
9359 * i386.cc (Target_i386::should_apply_static_reloc): Add
9360 output_section parameter. Change all callers.
9361 (Target_i386::Relocate::relocate): Add output_section parameter.
9362 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9363 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9364 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9365 * testsuite/two_file_shared.sh: New script.
9366 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9367 (check_DATA): Add two_file_shared.dbg.
9368 (two_file_shared.dbg): New target.
9369 * testsuite/Makefile.in: Rebuild.
9370
9371 2009-03-01 Ian Lance Taylor <iant@google.com>
9372
9373 * configure.ac: Check for byteswap.h.
9374 * configure: Rebuild.
9375 * config.in: Rebuild.
9376
9377 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9378
9379 * layout.cc (Layout::find_or_add_kept_section): New function.
9380 (Layout::add_comdat): Removed.
9381 * layout.h (struct Kept_section): Move out of class Layout.
9382 Remove trailing underscores from field names. Add group_sections
9383 field. Rename group_ field to is_group. Change all uses.
9384 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9385 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9386 comdat_groups_ field.
9387 (Sized_relobj::include_section_group): Use
9388 find_or_add_kept_section and Kept_section::group_sections.
9389 (Sized_relobj::include_linkonce_section): Likewise.
9390 * object.cc (class Sized_relobj): Don't define Comdat_group or
9391 Comdat_group_table. Remove find_comdat_group and
9392 add_comdat_group. Remove comdat_groups_ field.
9393 * plugin.cc (include_comdat_group): Use
9394 Layout::find_or_add_kept_section.
9395
9396 2009-02-28 Ian Lance Taylor <iant@google.com>
9397
9398 * README: --gc-sections and map files are now supported. Document
9399 some build requirements.
9400
9401 PR 6992
9402 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9403 relocatable link set the value of the section symbol to zero.
9404 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9405 relocatable link don't include the section address in the local
9406 symbol value.
9407
9408 2009-02-27 Ian Lance Taylor <iant@google.com>
9409
9410 PR 6811
9411 * options.h (class Search_directory): Add is_system_directory.
9412 (class General_options): Declare is_in_system_directory.
9413 * options.cc (get_relative_sysroot): Make static.
9414 (get_default_sysroot): Make static.
9415 (General_optoins::is_in_system_directory): New function.
9416 * fileread.cc (Input_file::is_in_system_directory): New function.
9417 * fileread.h (class Input_file): Declare is_in_system_directory.
9418 * object.h (class Object): Add is_in_system_directory.
9419 (class Input_objects): Remove system_library_directory_ field.
9420 * object.cc (Input_objects::add_object): Don't set
9421 system_library_directory_.
9422 (input_objects::found_in_system_library_directory): Remove.
9423 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9424 parameter. Change all callers.
9425 (Symbol_table::sized_write_globals): Likewise.
9426 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9427 Call Object::is_in_system_directory.
9428 * symtab.h (class Symbol_table): Update declarations.
9429
9430 PR 5990
9431 * descriptors.h (Open_descriptor): Add is_on_stack field.
9432 * descriptors.cc (Descriptors::open): If the descriptor is on the
9433 top of the stack, remove it. Initialize is_on_stack field.
9434 (Descriptors::release): Only add pod to stack if it is not on the
9435 stack already.
9436 (Descriptors::close_some_descriptor): Clear stack_next and
9437 is_on_stack fields.
9438
9439 PR 7091
9440 * output.cc (Output_section::find_starting_output_address): Rename
9441 from starting_output_address; add PADDR parameter; change return
9442 type.
9443 * output.h (class Output_section): Declare
9444 find_starting_output_address instead of starting_output_address.
9445 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9446 section symbol for which we can't find a merge section.
9447
9448 PR 9836
9449 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9450 hidden or internal, force the symbol to be local.
9451 * resolve.cc (Symbol::override_visibility): Define.
9452 (Symbol::override_base): Use override_visibility.
9453 (Symbol_table::resolve): Likewise.
9454 (Symbol::override_base_with_special): Likewise.
9455 (Symbol_table::override_with_special): If the visibility is hidden
9456 or internal, force the symbol to be local.
9457 * symtab.h (class Symbol): Add set_visibility and
9458 override_visibility.
9459 * testsuite/ver_test_1.sh: New file.
9460 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9461 (check_DATA): Add ver_test_1.syms.
9462 (ver_test_1.syms): New target.
9463 * testsuite/Makefile.in: Rebuild.
9464
9465 2009-02-25 Cary Coutant <ccoutant@google.com>
9466
9467 * layout.cc (Layout::choose_output_section): Don't rename sections
9468 when using a linker script that has a SECTIONS clause.
9469 * Makefile.in: Regenerate.
9470
9471 * testsuite/Makefile.am (script_test_5.sh): New test case.
9472 * testsuite/Makefile.in: Regenerate.
9473 * testsuite/script_test_5.cc: New file.
9474 * testsuite/script_test_5.sh: New file.
9475 * testsuite/script_test_5.t: New file.
9476
9477 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
9478
9479 * archive.cc (Archive::include_member): Update calls to add_symbols.
9480 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9481 the Layout argument.
9482 * dynobj.h (do_add_symbols): Add the Layout argument.
9483 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9484 Layout argument.
9485 * object.h (Object::add_symbols): Add the Layout argument.
9486 (Object::do_add_symbols): Add the Layout argument.
9487 (Sized_relobj::do_add_symbols): Add the Layout argument.
9488 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9489 Unify the two versions.
9490 (Add_plugin_symbols): Remove.
9491 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9492 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9493 (Add_plugin_symbols): Remove.
9494 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9495 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9496 (Add_symbols::run): Make it work with Pulginobj.
9497
9498 2009-02-06 Ian Lance Taylor <iant@google.com>
9499
9500 * object.cc (Sized_relobj::do_layout): Make info message start
9501 with lower case letter.
9502
9503 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9504
9505 * binary.cc: Fix file comment.
9506
9507 * options.h (enum Incremental_disposition): Define.
9508 (class General_options): Add new options: --incremental,
9509 --incremental_changed, --incremental_unchanged,
9510 --incremental_unknown. Add incremental_disposition_ and
9511 implicit_incremental_ fields.
9512 (General_options::incremental_disposition): New function.
9513 (class Position_dependent_options): Add incremental_disposition
9514 option.
9515 (Position_dependent_options::copy_from_options): Set incremental
9516 dispositions.
9517 * options.cc (General_options::parse_incremental_changed): New
9518 function.
9519 (General_options::parse_incremental_unchanged): New function.
9520 (General_options::parse_incremental_unknown): New function.
9521 (General_options::General_options): Initialize new fields
9522 incremental_disposition_ and implicit_incremental_.
9523 (General_options::finalize): Check for uasge of --incremental-*
9524 without --incremental.
9525
9526 2009-02-06 Chris Demetriou <cgd@google.com>
9527
9528 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9529 pointer and to report location as the file name associated with
9530 the symbol.
9531 (gold_undefined_symbol_at_location): New function to replace the
9532 old gold_undefined_symbol functionality.
9533 * target-reloc.h (relocate_section): Update to use
9534 gold_undefined_symbol_at_location.
9535 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9536 Call gold_undefined_symbol function rather than gold_error.
9537 * errors.h (Errors::undefined_symbol): Take location as a
9538 string, rather than calculating it from a relocation.
9539 * errors.cc (Errors::fatal): Print "fatal error:" before the
9540 formatted message.
9541 (Errors::error, Errors::error_at_location): Print "error: "
9542 before the formatted message.
9543 (Errors::undefined_symbol): Take location as a string, rather
9544 than calculating it from a relocation.
9545 (gold_undefined_symbol_at_location): New function akin to
9546 old gold_undefined_symbol, calculates location from relocation.
9547 (gold_undefined_symbol): Change to take only a Symbol pointer
9548 and to report location as the file name associated with the symbol.
9549 * testsuite/debug_msg.sh: Update for changed error messages.
9550 * testsuite/undef_symbol.sh: Likewise.
9551
9552 2009-02-04 Duncan Sands <baldrick@free.fr>
9553
9554 PR 9812
9555 * reduced_debug_output.h
9556 (Output_reduced_debug_abbrev_section::failed): Use format for
9557 gold_warning.
9558 (Output_reduced_debug_info_section::faild): Likewise.
9559
9560 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9561
9562 * script.cc (Lazy_demangler): New class.
9563 (Version_script_info::get_symbol_version_helper): Demangle a
9564 symbol only once.
9565
9566 2009-01-29 Cary Coutant <ccoutant@google.com>
9567
9568 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9569 to __tls_get_addr.
9570 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9571
9572 2009-01-28 Ian Lance Taylor <iant@google.com>
9573
9574 * version.cc (version_string): Bump to 1.9.
9575
9576 * gold.h: Include <cstring> and <stdint.h>.
9577 * version.cc: Include <cstdio>.
9578 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9579 warning.
9580 * reduced_debug_output.cc (insert_into_vector): Rename from
9581 Insert_into_vector; change all callers. Use Swap_unaligned to
9582 avoid aliasing issue; remove union since it is unnecessary.
9583
9584 2009-01-27 Sriraman Tallam <tmsriram@google.com>
9585
9586 * Makefile.am (CCFILES): Add gc.cc.
9587 (HFILES): Add gc.h.
9588 * Makefile.in: Regenerate.
9589 * gold.cc (Gc_runner): New class.
9590 (queue_initial_tasks): Call garbage collection related tasks
9591 when corresponding options are invoked.
9592 (queue_middle_gc_tasks): New function.
9593 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9594 processed early before laying out sections during garbage collection.
9595 * gold.h (queue_middle_gc_tasks): New function.
9596 (is_prefix_of): Move from "layout.cc".
9597 * i386.cc (Target_i386::gc_process_relocs): New function.
9598 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9599 * main.cc (main): Create object of class "Garbage_collection".
9600 * object.cc (Relobj::copy_symbols_data): New function.
9601 (Relobj::is_section_name_included): New function.
9602 (Sized_relobj::do_layout): Allow this function to be called twice
9603 during garbage collection and defer layout of section during the
9604 first call.
9605 * object.h (Relobj::get_symbols_data): New function.
9606 (Relobj::is_section_name_included): New function.
9607 (Relobj::copy_symbols_data): New function.
9608 (Relobj::set_symbols_data): New function.
9609 (Relobj::get_relocs_data): New function.
9610 (Relobj::set_relocs_data): New function.
9611 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9612 (Relobj::gc_process_relocs): New function.
9613 (Relobj::do_gc_process_relocs): New pure virtual function.
9614 (Relobj::sd_): New data member.
9615 (Sized_relobj::is_output_section_offset_invalid): New function.
9616 (Sized_relobj::do_gc_process_relocs): New function.
9617 * options.h (General_options::gc_sections): Modify to not be a no-op.
9618 (General_options::print_gc_sections): New option.
9619 * plugin.cc (Plugin_finish::run): Remove function call to
9620 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9621 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9622 * reloc.cc (Read_relocs::run): Add task to process relocs and
9623 determine unreferenced sections when doing garbage collection.
9624 (Gc_process_relocs): New class.
9625 (Sized_relobj::do_gc_process_relocs): New function.
9626 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9627 sections that are garbage collected.
9628 * reloc.h (Gc_process_relocs): New class.
9629 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9630 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9631 symbols whose corresponding sections are garbage collected.
9632 (Symbol_table::Symbol_table): Add new parameter for the garbage
9633 collection object.
9634 (Symbol_table::gc_mark_undef_symbols): New function.
9635 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9636 (Symbol_table::gc_mark_dyn_syms): New function.
9637 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9638 as garbage.
9639 (Symbol_table::add_from_object): Likewise.
9640 (Symbol_table::add_from_relobj): When building shared objects, do not
9641 treat externally visible symbols as garbage.
9642 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9643 table information for static and relocatable links.
9644 * symtab.h (Symbol_table::set_gc): New function.
9645 (Symbol_table::gc): New function.
9646 (Symbol_table::gc_mark_undef_symbols): New function.
9647 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9648 (Symbol_table::gc_mark_dyn_syms): New function.
9649 (Symbol_table::gc_): New data member.
9650 * target.h (Sized_target::gc_process_relocs): New pure virtual
9651 function.
9652 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9653 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9654
9655 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9656
9657 * options.h (General_options::gc_sections): Define as a no-op for now.
9658 (General_options::no_keep_memory): Ditto.
9659 (General_options::Bshareable): Define.
9660 * options.cc (General_options::finalize): Honor -Bshareable.
9661
9662 2009-01-20 Andreas Schwab <schwab@suse.de>
9663
9664 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9665 read the value in the contents, since we don't use it. Use the
9666 template endianness when writing.
9667 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9668
9669 2009-01-19 Andreas Schwab <schwab@suse.de>
9670
9671 * configure.tgt (powerpc64-*): Fix targ_obj.
9672
9673 2009-01-15 Ian Lance Taylor <iant@google.com>
9674
9675 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9676 local symbols when stripping all symbols.
9677
9678 2009-01-14 Cary Coutant <ccoutant@google.com>
9679
9680 * output.cc (Output_reloc): Add explicit instantiations.
9681
9682 2009-01-14 Cary Coutant <ccoutant@google.com>
9683
9684 * archive.cc (Archive::get_elf_object_for_member): Remove call
9685 to File_read::claim_for_plugin.
9686 * descriptors.cc (Descriptors::open): Remove reference to
9687 is_claimed.
9688 (Descriptors::claim_for_plugin): Remove.
9689 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9690 (Descriptors::is_claimed): Remove.
9691 (claim_descriptor_for_plugin): Remove.
9692 * fileread.cc (File_read::claim_for_plugin): Remove.
9693 * fileread.h (File_read::claim_for_plugin): Remove.
9694 (File_read::descriptor): Reopen descriptor if necessary.
9695 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9696 (Plugin_manager::all_symbols_read): Add task parameter. Change
9697 all callers.
9698 (Plugin_manager::get_input_file): New function.
9699 (Plugin_manager::release_input_file): New function.
9700 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9701 corresponding data member.
9702 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9703 and pass to base constructor. Change all callers.
9704 (get_input_file, release_input_file): New functions.
9705 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9706 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9707 (Plugin_manager::all_symbols_read): Add task parameter.
9708 (Plugin_manager::get_input_file): New function.
9709 (Plugin_manager::release_input_file): New function.
9710 (Plugin_manager::task_): New data member.
9711 (Pluginobj::Pluginobj): Add filesize parameter.
9712 (Pluginobj::filename): New function.
9713 (Pluginobj::descriptor): New function.
9714 (Pluginobj::filesize): New function.
9715 (Pluginobj::filesize_): New data member.
9716 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9717 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9718 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9719
9720 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9721 with archive libraries.
9722 * testsuite/Makefile.in: Regenerate.
9723 * testsuite/plugin_test.c (struct sym_info): New type.
9724 (get_input_file, release_input_file): New static variables.
9725 (onload): Capture new transfer vector entries.
9726 (claim_file_hook): Stop reading at end of file according to filesize.
9727 Factor out parsing of readelf output into separate function.
9728 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9729 APIs and get the source file name from the symbol table. Convert
9730 source file name to corresponding object file name. Print info
9731 message when adding new input files.
9732 (parse_readelf_line): New function.
9733 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9734 * testsuite/plugin_test_2.sh: Likewise.
9735 * testsuite/plugin_test_3.sh: Likewise.
9736 * testsuite/plugin_test_4.sh: New test case.
9737
9738 2009-01-07 Ian Lance Taylor <iant@google.com>
9739
9740 * version.cc (version_string): Bump to 1.8.
9741
9742 2008-12-23 Cary Coutant <ccoutant@google.com>
9743
9744 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9745 * plugin.cc (Plugin_manager::finish): Rename as
9746 layout_deferred_objects. Move cleanup to separate function.
9747 (Plugin_manager::cleanup): New function.
9748 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9749 separately.
9750 * plugin.h (Plugin_manager::finish): Rename as
9751 layout_deferred_objects.
9752 (Plugin_manager::cleanup): New function.
9753 (Plugin_manager::cleanup_done): New field.
9754
9755 2008-12-23 Cary Coutant <ccoutant@google.com>
9756
9757 * plugin.cc (is_visible_from_outside): New function.
9758 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9759 so we don't return "IR only" status for exported symbols or -r links.
9760
9761 * testsuite/Makefile.am (plugin_test_3): New test case.
9762 * testsuite/Makefile.in: Regenerate.
9763 * testsuite/plugin_test_3.sh: New file.
9764
9765 2008-12-22 Cary Coutant <ccoutant@google.com>
9766
9767 * object.cc (Sized_relobj::layout_section): New function.
9768 (Sized_relobj::do_layout): Defer layout of input sections until after
9769 plugin has provided replacement files.
9770 (Sized_relobj::do_layout_deferred_sections): New function.
9771 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9772 (Relobj::layout_deferred_sections): New function.
9773 (Relobj::do_layout_deferred_sections): New function.
9774 (Sized_relobj::do_layout_deferred_sections): New function.
9775 (Sized_relobj::layout_section): New function.
9776 (Sized_relobj::Deferred_layout): New structure.
9777 (Sized_relobj::deferred_layout_): New field.
9778 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9779 Change all callers. Layout deferred sections.
9780 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9781 references.
9782 (Plugin_hook::run): Move code from do_plugin_hook inline.
9783 (Plugin_hook::do_plugin_hook): Remove.
9784 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9785 (Plugin_manager::finish): Renamed, was cleanup.
9786 (Plugin_manager::should_defer_layout): New function.
9787 (Plugin_manager::add_deferred_layout_object): New function.
9788 (Plugin_manager::Deferred_layout_list): New type.
9789 (Plugin_manager::deferred_layout_objects_): New field.
9790 (Plugin_hook::do_plugin_hook): Remove.
9791
9792 2008-12-17 Ian Lance Taylor <iant@google.com>
9793
9794 * options.h (class General_options): Add --no case for
9795 --export-dynamic.
9796
9797 2008-12-16 Cary Coutant <ccoutant@google.com>
9798
9799 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9800 vector.
9801 (Plugin_manager::claim_file): Create plugin object even if
9802 plugin did not call the add_symbols callback.
9803 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9804 asking for more symbols than were added.
9805 * testsuite/Makefile.am (plugin_test_1): Add test case with
9806 no global symbols.
9807 (empty.syms): New target.
9808 * testsuite/Makefile.in: Regenerate.
9809 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9810 message. Don't call add_symbols if no globals.
9811 (all_symbols_read_hook): Don't provide replacement for empty
9812 claimed file.
9813
9814 2008-12-12 Ian Lance Taylor <iant@google.com>
9815
9816 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9817 r_type == 0 for a local symbol with r_sym == 0.
9818 (scan_relocatable_relocs): Pass r_sym to
9819 local_non_section_strategy.
9820 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9821 r_sym parameter.
9822
9823 * configure.ac: Update test for TLS descriptors: they are
9824 supported as of glibc 2.9.
9825 * configure: Rebuild.
9826
9827 2008-12-11 Ian Lance Taylor <iant@google.com>
9828
9829 PR 7091
9830 * target-reloc.h (Default_scan_relocatable_relocs): For each
9831 function, map r_type == 0 to RELOC_DISCARD.
9832
9833 2008-12-10 Cary Coutant <ccoutant@google.com>
9834
9835 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9836 object to override a kept COMDAT group from a plugin object.
9837
9838 2008-12-09 Ian Lance Taylor <iant@google.com>
9839
9840 PR 7088
9841 * yyscript.y (file_cmd): Handle INPUT.
9842
9843 * testsuite/initpri1.c: Change all declarations to be full
9844 prototypes by adding void, to avoid compiler warnings.
9845
9846 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
9847
9848 * options.cc (General_options::parse_plugin_opt): New.
9849 (General_options::add_plugin): The argument now is just the filename.
9850 (General_options::add_plugin_option): New.
9851 * options.h (plugin_opt): New.
9852 (add_plugin): Change argument name.
9853 (add_plugin_option): New.
9854 * plugin.cc (Plugin::load): Don't parse the plugin option.
9855 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9856 (Plugin::add_option): New.
9857 (Plugin::args_): Change type.
9858 (Plugin::filename_): New.
9859 (Plugin_manager::add_plugin_option): New.
9860 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9861 * testsuite/Makefile.in: Regenerate.
9862
9863 2008-12-05 Cary Coutant <ccoutant@google.com>
9864
9865 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9866 Handle --strip-lto-sections option.
9867 * options.h (strip_lto_sections): New option.
9868
9869 2008-12-01 Cary Coutant <ccoutant@google.com>
9870
9871 * plugin.cc (ld_plugin_message): Change format parameter to const.
9872 Fix mismatch between new[] and delete.
9873
9874 2008-11-14 Cary Coutant <ccoutant@google.com>
9875
9876 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9877 instead of -1U.
9878
9879 2008-11-05 Craig Silverstein <csilvers@google.com>
9880
9881 * options.cc (General_options::parse_dynamic_list): New function.
9882 * options.h (General_options): New flags dynamic_list,
9883 dynamic_list_data, dynamic_list_cpp_new, and
9884 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9885 (General_options::in_dynamic_list): New function.
9886 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9887 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9888 (Lex::can_continue_name): Likewise.
9889 (yylex): Likewise.
9890 (read_script_file): New parameter script_options.
9891 (read_dynamic_list): New function.
9892 (Script_options::define_dynamic_list): New function.
9893 (dynamic_list_keyword_parsecodes): New variable.
9894 (dynamic_list_keywords): New variable.
9895 * script.h (Script_options::define_dynamic_list): New function
9896 prototype.
9897 (read_dynamic_list): New function prototype.
9898 * symtab.cc (strprefix): New macro.
9899 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9900 dynamic_list_data, dynamic_list_cpp_new, and
9901 dynamic_list_cpp_typeinfo.
9902 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9903 (dynamic_list_expr): New rule.
9904 (dynamic_list_nodes): Likewise.
9905 (dynamic_list_node): Likewise.
9906 * testsuite/Makefile.am (dynamic_list): New test.
9907 * testsuite/Makefile.in: Regenerated.
9908 * testsuite/dynamic_list.t: New file.
9909 * testsuite/dynamic_list.sh: New file.
9910
9911 2008-11-05 Craig Silverstein <csilvers@google.com>
9912
9913 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9914 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9915 (t11_last): Likewise.
9916 * testsuite/ver_test_6.c (main): Likewise.
9917
9918 2008-10-07 Cary Coutant <ccoutant@google.com>
9919
9920 * options.c (General_options::finalize): Add check for -static and
9921 -shared.
9922 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9923 is not empty.
9924
9925 2008-10-02 Cary Coutant <ccoutant@google.com>
9926
9927 * plugin.cc (make_sized_plugin_object): Fix conditional
9928 compilation to work when not all targets are enabled.
9929
9930 2008-09-29 Cary Coutant <ccoutant@google.com>
9931
9932 * archive.cc (Archive::get_file_and_offset): Use filename instead
9933 of name to get library path.
9934 (Archive::include_member): Unlock external member of a thin archive.
9935
9936 * testsuite/Makefile.am (TEST_AR): New variable.
9937 (thin_archive_test_1): New test.
9938 (thin_archive_test_2): New test.
9939 * testsuite/Makefile.in: Regenerate.
9940 * testsuite/thin_archive_main.cc: New file.
9941 * testsuite/thin_archive_test_1.cc: New file.
9942 * testsuite/thin_archive_test_2.cc: New file.
9943 * testsuite/thin_archive_test_3.cc: New file.
9944 * testsuite/thin_archive_test_4.cc: New file.
9945
9946 2008-09-29 Cary Coutant <ccoutant@google.com>
9947
9948 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9949 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9950 instead of -1U.
9951 (Sized_relobj::do_finalize_local_symbols): Likewise.
9952 (Sized_relobj::map_to_kept_section): Likewise.
9953 * object.h (Sized_relobj::invalid_address): New constant.
9954 (Sized_relobj::do_output_section_offset): Check for invalid_address
9955 and return -1ULL.
9956 * output.cc (Output_reloc::local_section_offset): Use constant
9957 invalid_address instead of -1U.
9958 (Output_reloc::get_address): Likewise.
9959 (Output_section::output_address): Change -1U to -1ULL.
9960 * output.h (Output_reloc::invalid_address): New constant.
9961 * reloc.cc (Sized_relobj::write_sections): Use constant
9962 invalid_address instead of -1U.
9963 (Sized_relobj::relocate_sections): Likewise.
9964 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9965 values for merge sections.
9966 * target-reloc.h (relocate_for_relocatable): Use constant
9967 invalid_address instead of -1U.
9968
9969 2008-09-19 Cary Coutant <ccoutant@google.com>
9970
9971 Add plugin functionality for link-time optimization (LTO).
9972 * configure.ac (plugins): Add --enable-plugins option.
9973 * configure: Regenerate.
9974 * config.in: Regenerate.
9975 * Makefile.am (LIBDL): New variable.
9976 (CCFILES): Add plugin.cc.
9977 (HFILES): Add plugin.h.
9978 (ldadd_var): Add LIBDL.
9979 * Makefile.in: Regenerate.
9980
9981 * archive.cc: Include "plugin.h".
9982 (Archive::setup): Don't preread archive symbols when using a plugin.
9983 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9984 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9985 files.
9986 (Archive::include_member): Add symbols from plugin objects.
9987 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9988 * descriptors.cc (Descriptors::open): Check for file descriptors
9989 abandoned by plugins.
9990 (Descriptors::claim_for_plugin): New function.
9991 * descriptors.h (Descriptors::claim_for_plugin): New function.
9992 (Open_descriptor::is_claimed): New field.
9993 (claim_descriptor_for_plugin): New function.
9994 * fileread.cc (File_read::claim_for_plugin): New function.
9995 * fileread.h (File_read::claim_for_plugin): New function.
9996 (File_read::descriptor): New function.
9997 * gold.cc: Include "plugin.h".
9998 (queue_initial_tasks): Add task to call plugin hooks for generating
9999 new object files.
10000 * main.cc: Include "plugin.h".
10001 (main): Load plugin libraries.
10002 * object.h (Pluginobj): Declare.
10003 (Object::pluginobj): New function.
10004 (Object::do_pluginobj): New function.
10005 (Object::set_target): New function.
10006 * options.cc: Include "plugin.h".
10007 (General_options::parse_plugin): New function.
10008 (General_options::General_options): Initialize plugins_ field.
10009 (General_options::add_plugin): New function.
10010 * options.h (Plugin_manager): Declare.
10011 (General_options): Add --plugin option.
10012 (General_options::has_plugins): New function.
10013 (General_options::plugins): New function.
10014 (General_options::add_plugin): New function.
10015 (General_options::plugins_): New field.
10016 * plugin.cc: New file.
10017 * plugin.h: New file.
10018 * readsyms.cc: Include "plugin.h".
10019 (Read_symbols::do_read_symbols): Check for archive before checking
10020 for ELF file. Call plugin hooks to claim files.
10021 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10022 from a real object file; force override when processing replacement
10023 files.
10024 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10025 (Symbol::init_base_object): Likewise.
10026 (Symbol::init_base_output_data): Likewise.
10027 (Symbol::init_base_output_segment): Likewise.
10028 (Symbol::init_base_constant): Likewise.
10029 (Symbol::init_base_undefined): Likewise.
10030 (Symbol::output_section): Assert that object is not a plugin.
10031 (Symbol_table::add_from_pluginobj): New function.
10032 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10033 undefined.
10034 (Symbol_table::sized_write_globals): Likewise.
10035 (Symbol_table::add_from_pluginobj): Instantiate template.
10036 * symtab.h (Sized_pluginobj): Declare.
10037 (Symbol::in_real_elf): New function.
10038 (Symbol::set_in_real_elf): New function.
10039 (Symbol::in_real_elf_): New field.
10040 (Symbol_table::add_from_pluginobj): New function.
10041
10042 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10043 (LIBDL): New variable.
10044 (LDADD): Add LIBDL.
10045 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10046 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10047 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10048 (MOSTLYCLEANFILES): Likewise.
10049 * testsuite/Makefile.in: Regenerate.
10050 * testsuite/plugin_test.c: New file.
10051 * testsuite/plugin_test_1.sh: New file.
10052 * testsuite/plugin_test_2.sh: New file.
10053
10054 2008-09-16 Ian Lance Taylor <iant@google.com>
10055
10056 * target-reloc.h (relocate_section): Check whether a symbol is
10057 defined by the ABI before reporting an undefined symbol error.
10058 * target.h (Target::is_defined_by_abi): Make parameter const.
10059 (Target::do_is_defined_by_abi): Likewise.
10060 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10061 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10062 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10063 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10064 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10065 * testsuite/Makefile.in: Rebuild.
10066
10067 * fileread.cc (make_view): Add casts to avoid warning.
10068
10069 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10070
10071 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10072 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10073
10074 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10075
10076 * options.h (General_options::output_is_executable): New.
10077 (General_options::output_is_pie): New.
10078 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10079 for shared libraries.
10080 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10081
10082 2008-09-11 Chris Demetriou <cgd@google.com>
10083
10084 * options.h (origin): New -z option.
10085 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10086 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10087 in DT_FLAGS_1.
10088
10089 2008-09-05 Cary Coutant <ccoutant@google.com>
10090
10091 * fileread.cc (File_read::make_view): Add check for attempt to map
10092 beyond end of file.
10093
10094 2008-09-05 Cary Coutant <ccoutant@google.com>
10095
10096 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10097 explicit instantiations.
10098
10099 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10100
10101 PR gold/6858
10102 * options.cc (General_options::finalize): Allow undefined symbols
10103 in shlibs if linking -shared.
10104
10105 PR gold/6859
10106 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10107 symbols as not needing a dynsym entry.
10108
10109 2008-08-20 Craig Silverstein <csilvers@google.com>
10110
10111 * fileread.cc (File_read::open): Do not lock the file unless it
10112 was successfully opened.
10113
10114 2008-08-14 Cary Coutant <ccoutant@google.com>
10115
10116 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10117 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10118 * testsuite/tls_test.cc (struct int128): 128-bit struct
10119 for testing TLS relocs with non-zero addend.
10120 (v12): New TLS variable.
10121 (t12): New test.
10122 (t_last): Add check for v12.
10123 * testsuite/tls_test.h (t12): New function.
10124 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10125
10126 2008-08-13 Ian Lance Taylor <iant@google.com>
10127
10128 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10129 set tls_segment_ or relro_segment_.
10130 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10131 when appropriate.
10132 * output.h (Output_section::clear_is_relro): New function.
10133 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10134 sections specially even when output_data_ is empty.
10135 (Output_segment::maximum_alignment): When first section is relro,
10136 only force alignment for PT_LOAD segments.
10137 * script.cc (script_data_segment_align): New function.
10138 (script_data_segment_relro_end): New function.
10139 * script-c.h (script_data_segment_align): Declare.
10140 (script_data_segment_relro_end): Declare.
10141 * script-sections.h (class Script_sections): Declare
10142 data_segment_align and data_segment_relro_end. Add fields
10143 segment_align_index_ and saw_relro_end_.
10144 * script-sections.cc (class Sections_element): Add set_is_relro
10145 virtual function. Add new bool* parameter to place_orphan_here.
10146 Add get_output_section virtual function.
10147 (class Output_section_definition): Add set_is_relro. Add new
10148 bool* parameter to place_orphan_here. Add get_output_section.
10149 Add is_relro_ field.
10150 (Output_section_definition::Output_section_definition): Initialize
10151 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10152 and is_relro_ fields.
10153 (Output_section_definition::place_orphan_here): Add is_relro
10154 parameter.
10155 (Output_section_definition::set_section_addresses): Set relro for
10156 output section.
10157 (Output_section_definition::alternate_constraint): Likewise.
10158 (class Orphan_output_section): Add new bool* parameter to
10159 place_orphan_here. Add get_output_section.
10160 (Orphan_output_section::place_orphan_here): Add is_relro
10161 parameter.
10162 (Script_sections::Script_sections): Initialize
10163 data_segment_align_index_ and saw_relro_end_.
10164 (Script_sections::data_segment_align): New function.
10165 (Script_sections::data_segment_relro_end): New function.
10166 (Script_sections::place_orphan): Set or clear is_relro.
10167 (Script_sections::set_section_addresses): Force alignment of first
10168 TLS section.
10169 * yyscript.y (exp): Call script_data_segment_align and
10170 script_data_segment_relro_end.
10171 * testsuite/relro_script_test.t: New file.
10172 * testsuite/relro_test.cc (using_script): Declare.
10173 (t1, t2): Test using_script.
10174 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10175 (relro_script_test_SOURCES): Define.
10176 (relro_script_test_DEPENDENCIES): Define.
10177 (relro_script_test_LDFLAGS): Define.
10178 (relro_script_test_LDADD): Define.
10179 (relro_script_test.so): New target.
10180 * testsuite/Makefile.in: Rebuild.
10181
10182 2008-08-06 Cary Coutant <ccoutant@google.com>
10183
10184 * archive.cc (Archive::total_archives, Archive::total_members)
10185 (Archive::total_members_loaded): New variables.
10186 (Archive::setup): Add parameter. Add option to preread
10187 archive symbols.
10188 (Archive::read_armap): Add counter.
10189 (Archive::get_file_and_offset): New function.
10190 (Archive::get_elf_object_for_member): New function.
10191 (Archive::read_all_symbols): New function.
10192 (Archive::read_symbols): New function.
10193 (Archive::add_symbols): Add counters.
10194 (Archive::include_all_members): Use armap to find members if it's
10195 already built.
10196 (Archive::include_member): Skip reading symbols if already read.
10197 Factored code into Archive::get_file_and_offset and
10198 Archive::get_elf_object_for_member. Changed call to
10199 Mapfile::report_include_archive_member.
10200 (Archive::print_stats): New function.
10201 * archive.h: Declare Object and Read_symbols_data classes.
10202 (Archive::Archive): Add initializers for new members.
10203 (Archive::setup): Add parameter.
10204 (Archive::print_stats): New function.
10205 (Archive::total_archives, Archive::total_members)
10206 (Archive::total_members_loaded): New variables.
10207 (Archive::get_file_and_offset): New function.
10208 (Archive::get_elf_object_for_member): New function.
10209 (Archive::read_all_symbols): New function.
10210 (Archive::read_symbols): New function.
10211 (Archive::Archive_member): New class.
10212 (Archive::members_): New member.
10213 (Archive::num_members_): New member.
10214 * main.cc: Include archive.h.
10215 (main): Call Archive::print_stats.
10216 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10217 archive parameter; member_name is now the fully-decorated name.
10218 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10219 * options.h: (General_options): Add --preread-archive-symbols option.
10220 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10221 Archive::setup.
10222
10223 2008-08-04 Ian Lance Taylor <iant@google.com>
10224
10225 * symtab.h (Symbol::use_plt_offset): New function.
10226 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10227 * powerpc.cc (Relocate::relocate): Likewise.
10228 * sparc.cc (Relocate::relocate): Likewise.
10229 * x86_64.cc (Relocate::relocate): Likewise.
10230 * testsuite/weak_plt.sh: New test.
10231 * testsuite/weak_plt_main.cc: New test.
10232 * testsuite/weak_plt_shared.cc: New test.
10233 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10234 (check_PROGRAMS): Add weak_plt.
10235 (check_DATA): Add weak_plt_shared.so.
10236 (weak_plt_main_pic.o, weak_plt): New targets.
10237 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10238 * testsuite/Makefile.in: Rebuild.
10239
10240 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10241 gcctestdir/ld.
10242 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10243 * testsuite/Makefile.in: Rebuild.
10244
10245 2008-08-04 Alan Modra <amodra@bigpond.net.au>
10246
10247 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10248 * Makefile.in: Regenerate.
10249 * po/POTFILES.in: Regenerate.
10250
10251 2008-07-29 Ian Lance Taylor <iant@google.com>
10252
10253 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10254 symbols before other symbols.
10255 * testsuite/script_test_2.cc (test_addr): Declare.
10256 (test_addr_alias): Declare.
10257 (main): Check that test_addr and test_addr_alias have the right
10258 values.
10259 * testsuite/script_test_2.t: Define test_addr_alias and
10260 test_addr.
10261
10262 2008-07-24 Ian Lance Taylor <iant@google.com>
10263
10264 PR 5990
10265 * descriptors.cc: New file.
10266 * descriptors.h: New file.
10267 * gold-threads.h (class Hold_optional_lock): New class.
10268 * fileread.cc: Include "descriptors.h".
10269 (File_read::~File_read): Release descriptor rather than closing
10270 it.
10271 (File_read::open) [file]: Call open_descriptor rather than open.
10272 Set is_descriptor_opened_.
10273 (File_read::open) [memory]: Assert that descriptor is not open.
10274 (File_read::reopen_descriptor): New function.
10275 (File_read::release): Release descriptor.
10276 (File_read::do_read): Make non-const. Reopen descriptor.
10277 (File_read::read): Make non-const.
10278 (File_read::make_view): Reopen descriptor.
10279 (File_read::do_readv): Likewise.
10280 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10281 Update declarations.
10282 * layout.cc: Include "descriptors.h".
10283 (Layout::create_build_id): Use open_descriptor rather than open.
10284 * output.cc: Include "descriptors.h".
10285 (Output_file::open): Use open_descriptor rather than open.
10286 * archive.cc (Archive::const_iterator): Change Archive to be
10287 non-const.
10288 (Archive::begin, Archive::end): Make non-const.
10289 (Archive::count_members): Likewise.
10290 * archive.h (class Archive): Update declarations.
10291 * object.h (Object::read): Make non-const.
10292 * Makefile.am (CCFILES): Add descriptors.cc.
10293 (HFILES): Add descriptors.h.
10294 * Makefile.in: Rebuild.
10295
10296 PR 6716
10297 * gold.h: Always include <clocale>. Add Solaris workarounds
10298 following code in binutils/sysdep.h.
10299
10300 PR 6048
10301 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10302 this->eh_frame_hdr_ is NULL before using it.
10303
10304 * dynobj.cc (Versions::Versions): Update comment.
10305
10306 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10307 the base version name.
10308
10309 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10310 array size plus one.
10311 (Stringpool_template::set_string_offsets): Subtract one from key
10312 before using it as an array index.
10313 (Stringpool_template::get_offset_with_length): Likewise.
10314 (Stringpool_template::write_to_buffer): Likewise.
10315 * stringpool.h (Stringpool_template::get_offset_from_key):
10316 Likewise.
10317
10318 2008-07-23 Ian Lance Taylor <iant@google.com>
10319
10320 PR 6658
10321 * object.h (Merged_symbol_value::value): Do our best to handle a
10322 negative addend.
10323
10324 PR 6647
10325 * script.cc (Version_script_info::get_versions): Don't add empty
10326 version tag to return value.
10327 (Version_script_info::get_symbol_version_helper): Change return
10328 type to bool. Add pversion parameter. Change all callers.
10329 (script_register_vers_node): Don't require a non-NULL tag.
10330 * script.h (class Version_script_info): Update declarations.
10331 (Version_script_info::get_symbol_version): Change return type to
10332 bool. Add version parameter. Change all callers.
10333 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10334 handling. Handle an empty version from a version script.
10335 (Symbol_table::define_special_symbol): Likewise.
10336 * testsuite/ver_test_10.script: New file.
10337 * testsuite/ver_test_10.sh: New file.
10338 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10339 (check_DATA): Add ver_test_10.syms.
10340 (ver_test_10.syms, ver_test_10.so): New target.
10341 * testsuite/Makefile.in: Rebuild.
10342
10343 2008-07-23 Simon Baldwin <simonb@google.com>
10344
10345 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10346 to zero for undefined symbols from dynamic libraries.
10347
10348 2008-07-23 Ian Lance Taylor <iant@google.com>
10349
10350 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10351 Change all callers.
10352 * symtab.h (class Symbol_table): Update declaration.
10353 * testsuite/ver_test_9.cc: New file.
10354 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10355 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10356 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10357 (ver_test_9.so, ver_test_9.o): New targets.
10358 * testsuite/Makefile.in: Rebuild.
10359
10360 2008-07-22 Ian Lance Taylor <iant@google.com>
10361
10362 * options.h (class General_options): Define --check-sections.
10363 * layout.cc (Layout::set_segment_offsets): Handle
10364 --check-sections.
10365
10366 * options.h (class General_options): Define -n/--nmagic and
10367 -N/--omagic.
10368 * options.cc (General_options::finalize): For -n/--nmagic or
10369 -N/--omagic, set -static.
10370 * layout.cc (Layout::attach_allocated_section_to_segment): If
10371 -N/--omagic, don't put read-only and read-write sections in
10372 different segments.
10373 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10374 finding a read-only segment.
10375 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10376 don't set the minimum segment alignment to the common page size,
10377 and don't set the file offset to the address modulo the page size.
10378 * script-sections.cc (Script_sections::create_segments): If
10379 -n/--omagic, don't put read-only and read-write sections in
10380 different segments.
10381
10382 * cref.cc: New file.
10383 * cref.h: New file.
10384 * options.h (class General_options): Add --print-symbol-counts.
10385 * main.cc (main): Issue defined symbol report if requested.
10386 * archive.cc (Archive::interpret_header): Make into a const member
10387 function.
10388 (Archive::add_symbols): Call Input_objects::archive_start and
10389 archive_stop.
10390 (Archive::const_iterator): Define new class.
10391 (Archive::begin, Archive::end): New functions.
10392 (Archive::include_all_members): Rewrite to use iterator.
10393 (Archive::count_members): New function.
10394 * archive.h (class Archive): Update declarations.
10395 (Archive::filename): New function.
10396 * object.cc: Include "cref.h".
10397 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10398 (Sized_relobj::do_get_global_symbol_counts): New function.
10399 (Input_objects::add_object): Add object to cross-referencer.
10400 (Input_objects::archive_start): New function.
10401 (Input_objects::archive_stop): New function.
10402 (Input_objects::print_symbol_counts): New function.
10403 * object.h: Declare Cref and Archive.
10404 (Object::get_global_symbol_counts): New function.
10405 (Object::do_get_global_symbol_counts): New pure virtual function.
10406 (class Sized_relobj): Add defined_count_ field. Update
10407 declarations.
10408 (class Input_objects): Add cref_ field. Update constructor.
10409 Update declarations.
10410 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10411 defined_count_.
10412 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10413 symbol counts.
10414 (Sized_dynobj::do_get_global_symbol_counts): New function.
10415 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10416 defined_count_. Update declarations. Define Symbols typedef.
10417 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10418 parameter. Change all callers.
10419 (Symbol_table::add_from_dynobj): Add sympointers and defined
10420 parameters. Change all callers.
10421 * symtab.h (class Symbol_table): Update declarations.
10422 * Makefile.am (CCFILES): Add cref.cc.
10423 (HFILES): Add cref.h.
10424 * Makefile.in: Rebuild.
10425
10426 2008-07-22 Simon Baldwin <simonb@google.com>
10427
10428 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10429 to zero when writing undefined symbols.
10430
10431 2008-07-22 Ian Lance Taylor <iant@google.com>
10432
10433 * output.cc (Output_section::add_input_section): Don't try to
10434 merge empty merge sections.
10435
10436 2008-07-21 Craig Silverstein <csilvers@google.com>
10437
10438 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10439 Include symbol version in error message.
10440
10441 2008-07-20 Chris Demetriou <cgd@google.com>
10442
10443 * configure.ac (gold_cv_c_random_seed): New configured variable.
10444 (RANDOM_SEED_CFLAGS): New substituted variable.
10445 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10446 * configure: Rebuild.
10447 * Makefile.in: Likewise.
10448 * testsuite/Makefile.in: Likewise.
10449
10450 2008-07-18 Ian Lance Taylor <iant@google.com>
10451
10452 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10453 where we see NAME/NULL and NAME/VERSION as separate symbols.
10454 * testsuite/ver_test_main.cc (main): Call t4.
10455 (t4, t4_2a): Define.
10456 * testsuite/ver_test_2.cc (t4_2): Define.
10457 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10458 * testsuite/ver_test_4.cc (t4_2a): Define.
10459 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10460 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10461
10462 2008-07-17 Ian Lance Taylor <iant@google.com>
10463
10464 * dynobj.cc (Versions::add_def): If we give an error about a
10465 missing version, go ahead and create the version anyhow.
10466
10467 2008-07-10 Ian Lance Taylor <iant@google.com>
10468
10469 Handle output sections with more than 0x7fffffff bytes.
10470 * object.h (class Relobj): Change map_to_output_ to
10471 output_sections_, and just keep a section pointer. Change all
10472 uses. Move comdat group support to Sized_relobj.
10473 (Relobj::is_section_specially_mapped): Remove.
10474 (Relobj::output_section): Remove poff parameter. Change all
10475 callers.
10476 (Relobj::output_section_offset): New function.
10477 (Relobj::set_section_offset): Rewrite.
10478 (Relobj::map_to_output): Remove.
10479 (Relobj::output_sections): New function.
10480 (Relobj::do_output_section_offset): New pure virtual function.
10481 (Relobj::do_set_section_offset): Likewise.
10482 (class Sized_relobj): Add section_offsets_ field. Add comdat
10483 group support from Relobj. Update declarations.
10484 (Sized_relobj::get_output_section_offset): New function.
10485 (Sized_relobj::do_output_section_offset): New function.
10486 (Sized_relobj::do_set_section_offset): New function.
10487 * object.cc (Relobj::output_section_address): Remove.
10488 (Sized_relobj::Sized_relobj): Initialize new fields.
10489 (Sized_relobj::include_section_group): Cast find_kept_object to
10490 Sized_relobj.
10491 (Sized_relobj::include_linkonce_section): Likewise.
10492 (Sized_relobj::do_layout): Use separate arrays for output section
10493 and output offset.
10494 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10495 output_sections.
10496 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10497 output_sections and section_offsets.
10498 (Sized_relobj::write_local_symbols): Likewise.
10499 (map_to_kept_section): Compute output address directly.
10500 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10501 output_sections and section_offsets.
10502 (Sized_relobj::write_sections): Likewise.
10503 (Sized_relobj::relocate_sections): Likewise.
10504 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10505 * output.h (class Output_reloc): Update declarations. Change
10506 u2_.relobj to Sized_relobj*.
10507 (class Output_data_reloc): Change add functions to use
10508 Sized_relobj*.
10509 * output.cc (Output_reloc::Output_reloc): Change relobj to
10510 Sized_relobj*.
10511 (Output_reloc::local_section_offset): Change return type to
10512 Elf_Addr. Use get_output_section_offset.
10513 (Output_reloc::get_address): Likewise.
10514 (Output_section::is_input_address_mapped): Don't call
10515 is_section_specially_mapped.
10516 (Output_section::output_offset): Likewise.
10517 (Output_section::output_address): Likewise.
10518 (Output_section::starting_output_address): Likewise.
10519 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10520 parameter to Sized_relobj*.
10521 (Copy_relocs::need_copy_reloc): Likewise.
10522 (Copy_relocs::save): Likewise.
10523 * copy-relocs.h (class Copy_relocs): Update declarations.
10524 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10525 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10526 * target-reloc.h (relocate_for_relocatable): Change
10527 offset_in_output_section type to Elf_Addr. Change code that uses
10528 it as well.
10529 * layout.cc (Layout::layout): Always set *off.
10530 * mapfile.cc (Mapfile::print_input_section): Use
10531 output_section_offset.
10532 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10533 Sized_relobj*.
10534 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10535 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10536 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10537
10538 2008-07-03 Ian Lance Taylor <iant@google.com>
10539
10540 * layout.cc (Layout::include_section): Do not discard unrecognized
10541 SHT_STRTAB sections.
10542
10543 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10544
10545 * script.cc (Lex::can_continue_name): Make '?' allowable in
10546 version-script names.
10547 * testsuite/version_script.map: Change glob pattern to use '?'
10548
10549 2008-06-30 Manish Singh <yosh@gimp.org>
10550
10551 PR 6585
10552 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10553 Correct typo.
10554
10555 2008-06-30 Ian Lance Taylor <iant@google.com>
10556
10557 PR 6660
10558 PR 6682
10559 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10560 versions]: Don't try to read the value in the contents, since we
10561 don't use it. Use the template endianness when writing.
10562
10563 2008-06-25 Cary Coutant <ccoutant@google.com>
10564
10565 * fileread.cc (File_read::make_view): Assert on zero-length view.
10566 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10567 symbol table when there are no symbols to read.
10568
10569 2008-06-23 Craig Silverstein <csilvers@google.com>
10570
10571 * version.cc (version_string): Bump to 1.7
10572
10573 2008-06-18 Craig Silverstein <csilvers@google.com>
10574
10575 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10576 constant 0xFFFF to type Valtype.
10577 (Powerpc_relocate_functions::rel16_ha): Likewise.
10578
10579 2008-06-17 Ian Lance Taylor <iant@google.com>
10580
10581 * output.h (Output_section::Input_section): Initialize p2align_ to
10582 zero for Output_section_data constructors.
10583 (Output_section::Input_section::addralign): If not an input
10584 section, return the alignment of the Output_section_data.
10585 * testsuite/copy_test.cc: New file.
10586 * testsuite/copy_test_1.cc: New file.
10587 * testsuite/copy_test_2.cc: New file.
10588 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10589 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10590 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10591 (copy_test_1_pic.o, copy_test_1.so): New targets.
10592 (copy_test_2_pic.o, copy_test_2.so): New targets.
10593 * testsuite/Makefile.in: Rebuild.
10594
10595 * script-sections.cc (Script_sections::place_orphan): Initialize
10596 local variable exact.
10597
10598 2008-06-13 David Edelsohn <edelsohn@gnu.org>
10599
10600 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10601
10602 2008-06-12 David Edelsohn <edelsohn@gnu.org>
10603 David S. Miller <davem@davemloft.net>
10604
10605 * powerpc.cc: New file.
10606 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10607 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10608 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10609 * Makefile.in: Rebuild.
10610
10611 2008-06-09 Ian Lance Taylor <iant@google.com>
10612
10613 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10614 <exception>.
10615 (throwing, orig_terminate): New static variables.
10616 (terminate_handler): New static function.
10617 (t2): Set terminate handler.
10618
10619 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10620
10621 PR 6584
10622 * binary.cc (Binary_to_elf::sized_convert): Fix .data
10623 alignment.
10624
10625 2008-05-30 Cary Coutant <ccoutant@google.com>
10626
10627 * archive.cc (Archive::include_all_members) Correct to step
10628 over symbol table and extended name table in thin archives.
10629
10630 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10631
10632 PR 6407
10633 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10634 calculation.
10635
10636 2008-05-28 Caleb Howe <cshowe@google.com>
10637
10638 * reduced_debug_output.cc: New file.
10639 * reduced_debug_output.h: New file.
10640 * options.h (class General_options): Add --strip-debug-non-line.
10641 * options.cc (General_options::finalize): Add strip_debug_non_line
10642 to the strip heirarchy.
10643 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10644 fields.
10645 * layout.cc: Include "reduced_debug_output.h".
10646 (Layout::Layout): Initialize new fields.
10647 (line_only_debug_sections): New static array.
10648 (is_lines_only_debug_sections): New static inline function.
10649 (Layout::include_section): Handle --strip-debug-non-line.
10650 (Layout::make_output_section): If --strip-debug-non-line, build
10651 new output sections for .debug_abbrev and .debug_info.
10652 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10653 gold. Warn about possible overflow.
10654 (read_signed_LEB_128): Likewise.
10655 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10656 (read_signed_LEB_128): Declare.
10657 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10658 (HFILES): Add reduced_debug_output.h.
10659 * Makefile.in: Rebuild.
10660
10661 2008-05-21 Ian Lance Taylor <iant@google.com>
10662
10663 * mapfile.cc: New file.
10664 * mapfile.h: New file.
10665 * options.h (class General_options): Add -M/--print-map and -Map.
10666 * options.cc (General_options::finalize): Make -M equivalent to
10667 -Map -.
10668 * main.cc: Include <cstdio> and "mapfile.h".
10669 (main): Open mapfile if requested.
10670 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10671 constructor. Change caller.
10672 (queue_initial_tasks): Add mapfile parameter. Change caller.
10673 (queue_middle_tasks): Likewise.
10674 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10675 declarations.
10676 * archive.cc: Include "mapfile.h".
10677 (Archive::add_symbols): Add mapfile parameter. Change all
10678 callers. Pass mapfile, symbol, and reason to include_member.
10679 (Archive::include_all_members): Add mapfile parameter. Change all
10680 callers.
10681 (Archive::include_member): Add mapfile, sym, and why parameters.
10682 Change all callers. Report inclusion to map file.
10683 * archive.h: Include "fileread.h".
10684 (class Archive): Update declarations.
10685 (Archive::file): New const method.
10686 (class Add_archive_symbols): Add mapfile_ field. Update
10687 constructor. Change all callers.
10688 * readsyms.h (class Read_symbols): Likewise.
10689 (class Finish_group): Likewise.
10690 (class Read_script): Likewise.
10691 * common.cc: Include "mapfile.h".
10692 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10693 all callers.
10694 (Symbol_table::do_allocate_commons): Likewise.
10695 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10696 symbol allocation to mapfile.
10697 * common.h (class Allocate_commons_task): Add mapfile_ field.
10698 Update constructor. Change all callers.
10699 * symtab.h (class Symbol_table): Update declarations.
10700 * layout.cc: Include "mapfile.h".
10701 (Layout_task_runner::run): Print information to mapfile.
10702 (Layout::create_gold_note): Change Output_data_fixed_space to
10703 Output_data_zero_fill.
10704 (Layout::create_build_id): Likewise.
10705 (Layout::print_to_mapfile): New function.
10706 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10707 constructor. Change caller.
10708 (class Layout): Declare print_to_mapfile.
10709 * output.cc (Output_section::Input_section::print_to_mapfile): New
10710 function.
10711 (Output_section::add_input_section): If producing a map, always
10712 add to input_sections_ list.
10713 (Output_section::do_print_to_mapfile): New function.
10714 (Output_segment::print_sections_to_mapfile): New function.
10715 (Output_segment::print_section_list_to_mapfile): New function.
10716 * output.h: Include "mapfile.h".
10717 (Output_data::print_to_mapfile): New function.
10718 (Output_data::do_print_to_mapfile): New virtual function.
10719 (Output_segment_headers::do_print_to_mapfile): New function.
10720 (Output_file_header::do_print_to_mapfile): New function.
10721 (Output_data_const::do_print_to_mapfile): New function.
10722 (class Output_data_const_buffer): Add map_name_ field. Update
10723 constructor. Change all callers. Add do_print_to_mapfile
10724 function.
10725 (class Output_data_fixed_space): Likewise.
10726 (class Output_data_space): Likewise.
10727 (class Output_data_zero_fill): New class.
10728 (Output_data_strtab::do_print_to_mapfile): New function.
10729 (Output_data_reloc_base::do_print_to_mapfile): New function.
10730 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10731 (Output_data_group::do_print_to_mapfile): New function.
10732 (Output_data_got::do_print_to_mapfile): New function.
10733 (Output_data_dynamic::do_print_to_mapfile): New function.
10734 (Output_symtab_xindex::do_print_to_mapfile): New function.
10735 (class Output_section): Declare do_print_to_mapflie. Declare
10736 print_to_mapfile in Input_section.
10737 (class Output_segment): Declare new functions.
10738 * object.h (Sized_relobj::symbol_count): New function.
10739 * script-sections.cc
10740 (Output_section_element_dot_assignment::set_section_addresses):
10741 Change Output_data_fixed_space to Output_data_zero_fill.
10742 (Output_data_expression::do_print_to_mapfile): New function.
10743 * script.cc (read_input_script): Add mapfile parameter. Change
10744 all callers.
10745 * script.h (read_input_script): Update declaration.
10746 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10747 (Eh_frame::do_print_to_mapfile): New function.
10748 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10749 (Output_merge_string::do_print_to_mapfile): New function.
10750 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10751 function.
10752 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10753 function.
10754 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10755 function.
10756 * Makefile.am (CCFILES): Add mapfile.cc.
10757 (HFILES): Add mapfile.h.
10758 * Makefile.in: Rebuild.
10759
10760 2008-05-19 Ian Lance Taylor <iant@google.com>
10761
10762 * options.h (class General_options): Add -z relro.
10763 * layout.cc (Layout::Layout): Initialize relro_segment_.
10764 (Layout::add_output_section_data): Return the output section.
10765 (Layout::make_output_section): Rcognize relro sections and mark
10766 them appropriately.
10767 (Layout::attach_allocated_section_to_segment): Put relro sections
10768 in a PT_GNU_RELRO segment.
10769 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10770 section as relro.
10771 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10772 PT_TLS segments.
10773 (Layout::linkonce_mapping): Map d.rel.ro.local to
10774 .data.rel.ro.local.
10775 (Layout::output_section_name): Us .data.rel.ro.local for any
10776 section which begins with that.
10777 * layout.h (class Layout): Update add_output_section_data
10778 declaration. Add relro_segment_ field.
10779 * output.cc (Output_section::Output_section): Initialize is_relro_
10780 and is_relro_local_ fields.
10781 (Output_segment::add_output_section): Group relro sections.
10782 (Output_segment::is_first_section_relro): New function.
10783 (Output_segment::maximum_alignment): If there is a relro section,
10784 align the segment to the common page size.
10785 (Output_segment::set_section_addresses): Track whether we are
10786 looking at relro sections. If the last section is a relro
10787 section, align to the common page size.
10788 (Output_segment::set_section_list_addresses): Add in_relro
10789 parameter. Change all callers. Align to the page size when
10790 moving from relro to non-relro section.
10791 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10792 segment.
10793 * output.h (class Output_section): Add is_relro_ and
10794 is_relro_local_ fields.
10795 (Output_section::is_relro): New function.
10796 (Output_section::set_is_relro): New function.
10797 (Output_section::is_relro_local): New function.
10798 (Output_section::set_is_relro_local): New function.
10799 (class Output_segment): Update declarations.
10800 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10801 * sparc.cc (Target_sparc::got_section): Likewise.
10802 * x86_64.cc (Target_x86_64::got_section): Likewise.
10803 * testsuite/relro_test_main.cc: New file.
10804 * testsuite/relro_test.cc: New file.
10805 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10806 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10807 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10808 (relro_test.so, relro_test_pic.o): New targets.
10809 * testsuite/Makefile.in: Rebuild.
10810
10811 2008-05-16 Ian Lance Taylor <iant@google.com>
10812
10813 * output.cc (Output_segment::add_output_section): Remove front
10814 parameter.
10815 * output.h (class Output_segment): Remove
10816 add_initial_output_section and overloaded add_output_section.
10817 Update declaration of remaining add_output_section.
10818 * layout.cc (Layout::create_interp): Call add_output_section
10819 rather than add_initial_output_section.
10820 (Layout::finish_dynamic_section): Likewise.
10821
10822 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10823 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10824 know the dynamic type.
10825 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10826 field. Initialize it in constructor.
10827 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10828 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10829 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10830 reloc.
10831
10832 * output.cc (Output_reloc::get_address): Change return type to
10833 Elf_Addr.
10834 * output.h (class Output_reloc): Update get_address declaration.
10835 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10836 for section addresses.
10837
10838 2008-05-09 Ian Lance Taylor <iant@google.com>
10839
10840 PR 6493
10841 * gold.cc (gold_nomem): Use return value of write.
10842
10843 2008-05-08 Ian Lance Taylor <iant@google.com>
10844
10845 * symtab.c (Symbol::init_base_output_data): Add version
10846 parameter. Change all callers.
10847 (Symbol::init_base_output_segment): Likewise.
10848 (Symbol::init_base_constant): Likewise.
10849 (Symbol::init_base_undefined): Likewise.
10850 (Sized_symbol::init_output_data): Likewise.
10851 (Sized_symbol::init_output_segment): Likewise.
10852 (Sized_symbol::init_constant): Likewise.
10853 (Sized_symbol::init_undefined): Likewise.
10854 (Symbol_table::do_define_in_output_data): If the new symbol has a
10855 version, mark it as the default.
10856 (Symbol_table::do_define_in_output_segment): Likewise.
10857 (Symbol_table::do_define_as_constant): Likewise.
10858 * symtab.h (class Symbol): Update declarations.
10859 (class Sized_symbol): Likewise.
10860 * resolve.cc (Symbol::override_version): New function.
10861 (Symbol::override_base): Call override_version.
10862 (Symbol::override_base_with_special): Likewise.
10863 * testsuite/ver_script_8.script: New file.
10864 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10865 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10866 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10867 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10868
10869 2008-05-06 Ian Lance Taylor <iant@google.com>
10870
10871 PR 6049
10872 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10873 functions.
10874 (class General_options): Remove existing --undefined, and add
10875 --no-undefined instead. Add new --undefined as synonym for -u.
10876 * archive.cc (Archive::add_symbols): Check whether symbol was
10877 named with -u.
10878 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10879 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10880 all uses. Add IS_UNDEFINED. Update declarations to split
10881 different versions of init_base. Declare init_base_undefined.
10882 (Symbol::is_defined): Handle IS_UNDEFINED.
10883 (Symbol::is_undefined): Likewise.
10884 (Symbol::is_weak_undefined): Call is_undefined.
10885 (Symbol::is_absolute): Handle IS_CONSTANT.
10886 (class Sized_symbol): Update declarations to split different
10887 versions of init. Declare init_undefined.
10888 (class Symbol_table): Declare new functions.
10889 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10890 Change all callers.
10891 (Symbol::init_base_output_data): Likewise.
10892 (Symbol::init_base_output_segment): Likewise.
10893 (Symbol::init_base_constant): Likewise.
10894 (Symbol::init_base_undefined): New function.
10895 (Sized_symbol::init_object): Rename from init. Change all
10896 callers.
10897 (Sized_symbol::init_output_data): Likewise.
10898 (Sized_symbol::init_output_segment): Likewise.
10899 (Sized_symbol::init_constant): Likewise.
10900 (Sized_symbol::init_undefined): New function.
10901 (Symbol_table::add_undefined_symbols_from_command_line): New
10902 function.
10903 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10904 function.
10905 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10906 (Symbol::output_section): Likewise.
10907 (Symbol::set_output_section): Likewise.
10908 (Symbol_table::sized_finalize_symbol): Likewise.
10909 (Symbol_table::sized_write_globals): Likewise.
10910 * resolve.cc (Symbol_table::should_override): Likewise.
10911 (Symbol::override_base_with_special): Likewise.
10912
10913 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10914 symbol, change it to have default visibility.
10915 * testsuite/protected_1.cc: New file.
10916 * testsuite/protected_2.cc: New file.
10917 * testsuite/protected_3.cc: New file.
10918 * testsuite/protected_main_1.cc: New file.
10919 * testsuite/protected_main_2.cc: New file.
10920 * testsuite/protected_main_3.cc: New file.
10921 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10922 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10923 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10924 (protected_1.so): New target.
10925 (protected_1_pic.o, protected_2_pic.o): New targets.
10926 (protected_3_pic.o): New target.
10927 (check_PROGRAMS): Add protected_2.
10928 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10929 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10930 * testsuite/Makefile.in: Rebuild.
10931
10932 * options.h (DEFINE_var): Add set_user_set_##varname__.
10933 (DEFINE_bool_alias): New macro.
10934 (class General_options): Define -Bstatic using DEFINE_bool_alias
10935 rather than DEFINE_special. Add --undefined as an alias for -z
10936 defs.
10937 * options.cc (General_options::parse_Bstatic): Remove.
10938
10939 * options.h (class General_options): Add --fatal-warnings.
10940 * main.cc (main): Implement --fatal-warnings.
10941 * errors.h (Errors::warning_count): New function.
10942
10943 * options.h (class General_options): Add -Bsymbolic-functions.
10944 * symtab.h (Symbol::is_preemptible): Check for
10945 -Bsymbolic-functions.
10946
10947 2008-05-05 Ian Lance Taylor <iant@google.com>
10948
10949 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10950 as noVARNAME rather than no-VARNAME.
10951 (class General_options): Add option -z combreloc.
10952 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10953 get_address.
10954 (Output_reloc::sort_before) [SHT_REL]: New function.
10955 (Output_reloc::sort_before) [SHT_RELA]: New function.
10956 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10957 Sort_relocs_comparison.
10958 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10959 parameter. Change all callers.
10960 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10961 sort_relocs parameter. Change all callers.
10962 * output.cc (Output_reloc::get_address): New function, broken out
10963 of write_rel.
10964 (Output_reloc::write_rel): Call it.
10965 (Output_reloc::compare): New function.
10966 (Output_data_reloc_base::do_write): Optionally sort relocs.
10967
10968 * configure.ac: If targ_extra_obj is set, link it in.
10969 * configure.tgt: Initialize all variables.
10970 (x86_64*): Set targ_extra_obj and targ_extra_size.
10971 * configure: Rebuild.
10972
10973 * object.cc (Sized_relobj::include_section_group): Adjust section
10974 indexes read from group data. Build vector to pass to
10975 layout_group.
10976 * layout.cc (Layout::layout_group): Add flags and shndxes
10977 parameters. Remove contents parameter. Change caller. Update
10978 explicit instantiations.
10979 * layout.h (class Layout): Update layout_group declaration.
10980 * output.cc (Output_data_group::Output_data_group): Add flags and
10981 input_shndxes parameters. Remove contents parameter. Change
10982 caller.
10983 (Output_data_group::do_write): Change input_sections_ to
10984 input_shndxes_.
10985 * output.h (class Output_data_group): Update constructor
10986 declaration. Rename input_sections_ to input_shndxes_.
10987 * testsuite/many_sections_test.cc: Add template.
10988
10989 2008-04-30 Cary Coutant <ccoutant@google.com>
10990
10991 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10992
10993 * layout.cc (Layout::include_section): Refactored check for debug
10994 info section.
10995 (Layout::add_comdat): Add new parameters. Change type
10996 of signature parameter. Add object and shndx to signatures table.
10997 (Layout::find_kept_object): New function.
10998 * layout.h: Include <cstring>.
10999 (Layout::is_debug_info_section): New function.
11000 (Layout::add_comdat): Add new parameters.
11001 (Layout::find_kept_object): New function.
11002 (Layout::Kept_section): New struct.
11003 (Layout::Signatures): Change type of map range.
11004 * object.cc (Relobj::output_section_address): New function.
11005 (Sized_relobj::include_section_group): Add new parameters. Change
11006 calls to Layout::add_comdat. Change to build table of kept comdat
11007 groups and table mapping discarded sections to kept sections.
11008 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11009 (Sized_relobj::do_layout): Change calls to include_section_group and
11010 include_linkonce_section.
11011 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11012 value to zero when section is discarded.
11013 (Sized_relobj::map_to_kept_section): New function.
11014 * object.h (Relobj::output_section_address): New function.
11015 (Relobj::Comdat_group): New type.
11016 (Relobj::find_comdat_group): New function.
11017 (Relobj::Comdat_group_table): New type.
11018 (Relobj::Kept_comdat_section): New type.
11019 (Relobj::Kept_comdat_section_table): New type.
11020 (Relobj::add_comdat_group): New function.
11021 (Relobj::set_kept_comdat_section): New function.
11022 (Relobj::get_kept_comdat_section): New function.
11023 (Relobj::comdat_groups_): New field.
11024 (Relobj::kept_comdat_sections_): New field.
11025 (Symbol_value::input_value): Update comment.
11026 (Sized_relobj::map_to_kept_section) New function.
11027 (Sized_relobj::include_linkonce_section): Add new parameter.
11028 * target-reloc.h (Comdat_behavior): New type.
11029 (get_comdat_behavior): New function.
11030 (relocate_section): Add code to map a discarded section to the
11031 corresponding kept section when applying a relocation.
11032
11033 2008-04-30 Craig Silverstein <csilvers@google.com>
11034
11035 * dwarf_reader.cc (next_generation_count): New static var.
11036 (Addr2line_cache_entry): New struct.
11037 (addr2line_cache): New static var.
11038 (Dwarf_line_info::one_addr2line): Added caching.
11039 (Dwarf_line_info::clear_addr2line_cache): New function.
11040 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11041 cache-size parameter.
11042 (Dwarf_line_info::one_addr2line_cache): New function.
11043 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11044 new cache-size argument to one_addr2line(), and clear cache.
11045
11046 2008-04-28 Cary Coutant <ccoutant@google.com>
11047
11048 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11049 R_386_PC8 relocations.
11050
11051 2008-04-23 Ian Lance Taylor <iant@google.com>
11052
11053 * object.cc (Sized_relobj::include_section_group): Check for
11054 invalid section group.
11055
11056 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11057 header size.
11058
11059 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11060 than read for file header.
11061 * archive.cc (Archive::include_member): Likewise.
11062
11063 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
11064
11065 * aclocal.m4: Regenerate.
11066 * configure: Regenerate.
11067
11068 2008-04-19 Ian Lance Taylor <iant@google.com>
11069
11070 * version.cc (version_string): Bump to 1.6.
11071
11072 * testsuite/Makefile.am (many_sections_r_test): New target.
11073 (many_sections_r_test_SOURCES): Remove.
11074 (many_sections_r_test_DEPENDENCIES): Remove.
11075 (many_sections_r_test_LDFLAGS): Remove.
11076 (many_sections_r_test_LDADD): Remove.
11077
11078 * object.cc (Sized_relobj::do_add_symbols): Always pass
11079 local_symbol_count_ to add_from_relobj.
11080
11081 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11082 every thousand variables.
11083 * testsuite/Makefile.in: Rebuild.
11084
11085 * object.cc (Xindex::initialize_symtab_xindex): New function.
11086 (Xindex::read_symtab_xindex): New function.
11087 (Xindex::sym_xindex_to_shndx): New function.
11088 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11089 available.
11090 (Sized_relobj::do_initialize_xindex): New function.
11091 (Sized_relobj::do_read_symbols): Adjust section links.
11092 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11093 parameter. Change all callers.
11094 (Sized_relobj::include_section_group): Adjust section links and
11095 symbol section indexes.
11096 (Sized_relobj::do_layout): Adjust section links.
11097 (Sized_relobj::do_count_local_symbols): Adjust section links and
11098 symbol section indexes.
11099 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11100 ordinary and special symbols.
11101 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11102 dynsym_xindex parameters. Change all callers. Adjust section
11103 links. Use SHN_XINDEX when needed.
11104 (Sized_relobj::get_symbol_location_info): Adjust section links.
11105 Don't get fooled by special symbols.
11106 * object.h (class Xindex): Define.
11107 (class Object): Add xindex_ parameter. Declare virtual functoin
11108 do_initialize_xindex.
11109 (Object::adjust_sym_shndx): New function.
11110 (Object::set_xindex): New protected function.
11111 (class Symbol_value): Add is_ordinary_shndx_ field.
11112 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11113 (Symbol_value::value): Assert ordinary section.
11114 (Symbol_value::initialize_input_to_output_map): Likewise.
11115 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11116 Change all callers.
11117 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11118 all callers.
11119 (class Sized_relobj): Update declarations.
11120 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11121 parameter. Change all callers.
11122 (Sized_relobj::adjust_shndx): New function.
11123 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11124 field.
11125 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11126 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11127 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11128 (Sized_dynobj::read_dynsym_section): Adjust section links.
11129 (Sized_dynobj::read_dynamic): Likewise.
11130 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11131 section links.
11132 (Sized_dynobj::do_initialize_xindex): New function.
11133 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11134 do_initialize_xindex.
11135 (Sized_dynobj::adjust_shndx): New function.
11136 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11137 dynsym_xindex_ fields.
11138 (Layout::finalize): Add a call to set_section_indexes before
11139 creating the symtab sections.
11140 (Layout::set_section_indexes): Don't do anything if the section
11141 already has a section index.
11142 (Layout::create_symtab_sections): Add shnum parameter. Change
11143 caller. Create .symtab_shndx section if needed.
11144 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11145 caller.
11146 (Layout::allocated_output_section_count): New function.
11147 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11148 needed.
11149 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11150 fields. Update declarations.
11151 (Layout::symtab_xindex): New function.
11152 (Layout::dynsym_xindex): New function.
11153 (class Write_symbols_task): Add layout_ field.
11154 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11155 Change caller.
11156 * output.cc (Output_section_headers::Output_section_headers): Add
11157 shstrtab_section parameter. Change all callers.
11158 (Output_section_headers::do_sized_write): Store overflow values
11159 for section count and section string table section index in
11160 section header zero.
11161 (Output_file_header::do_sized_write): Check for overflow of
11162 section count and section string table section index.
11163 (Output_symtab_xindex::do_write): New function.
11164 (Output_symtab_xindex::endian_do_write): New function.
11165 * output.h (class Output_section_headers): Add shstrtab_section_.
11166 Update declarations.
11167 (class Output_symtab_xindex): Define.
11168 (Output_section::has_out_shndx): New function.
11169 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11170 field.
11171 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11172 Change all callers.
11173 (Sized_symbol::init): Likewise.
11174 (Symbol::output_section): Check for ordinary symbol.
11175 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11176 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11177 callers.
11178 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11179 Change all callers. Simplify handling of symbols from sections
11180 not included in the link.
11181 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11182 distinction.
11183 (Weak_alias_sorter::operator()): Assert that symbols are
11184 ordinary.
11185 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11186 distinction.
11187 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11188 parameters. Change all callers.
11189 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11190 symbol distinction. Use SHN_XINDEX when needed.
11191 (Symbol_table::write_section_symbol): Add symtab_xindex
11192 parameter. Change all callers.
11193 (Symbol_table::sized_write_section_symbol): Likewise. Use
11194 SHN_XINDEX when needed.
11195 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11196 declarations.
11197 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11198 (Symbol::is_defined): Check is_ordinary.
11199 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11200 (Symbol::is_absolute, Symbol::is_common): Likewise.
11201 (class Sized_symbol): Update declarations.
11202 (class Symbol_table): Update declarations.
11203 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11204 parameters. Change all callers.
11205 (Sized_symbol::override): Likewise.
11206 (Symbol_table::override): Likewise.
11207 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11208 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11209 is_ordinary, and orig_st_shndx parameters. Change all callers.
11210 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11211 to be in an ordinary section.
11212 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11213 object and is_ordinary parameters. Change all callers.
11214 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11215 Change all callers. Don't add undefined or non-ordinary symbols
11216 to reloc_map_.
11217 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11218 Change all callers.
11219 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11220 declarations.
11221 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11222 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11223 (Sized_relobj::relocate_sections): Likewise.
11224 * target-reloc.h (scan_relocs): Adjust section symbol index.
11225 (scan_relocatable_relocs): Likewise.
11226 * i386.cc (Scan::local): Check for ordinary symbols.
11227 * sparc.cc (Scan::local): Likewise.
11228 * x86_64.cc (Scan::local): Likewise.
11229 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11230 to symbol_section_and_value.
11231 * testsuite/many_sections_test.cc: New file.
11232 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11233 (check_PROGRAMS): Add many_sections_test.
11234 (many_sections_test_SOURCES): Define.
11235 (many_sections_test_DEPENDENCIES): Define.
11236 (many_sections_test_LDFLAGS): Define.
11237 (BUILT_SOURCES): Add many_sections_define.h.
11238 (many_sections_define.h): New target.
11239 (BUILT_SOURCES): Add many_sections_check.h.
11240 (many_sections_check.h): New target.
11241 (check_PROGRAMS): Add many_sections_r_test.
11242 (many_sections_r_test_SOURCES): Define.
11243 (many_sections_r_test_DEPENDENCIES): Define.
11244 (many_sections_r_test_LDFLAGS): Define.
11245 (many_sections_r_test_LDADD): Define.
11246 (many_sections_r_test.o): New target.
11247 * testsuite/Makefile.in: Rebuild.
11248
11249 2008-04-17 Cary Coutant <ccoutant@google.com>
11250
11251 * errors.cc (Errors::info): New function.
11252 (gold_info): New function.
11253 * errors.h (Errors::info): New function.
11254 * gold.h (gold_info): New function.
11255 * object.cc (Input_objects::add_object): Print trace output.
11256 * options.cc (options::parse_set): New function.
11257 (General_options::parse_wrap): Deleted.
11258 (General_options::General_options): Deleted initializer.
11259 * options.h (options::String_set): New typedef.
11260 (options::parse_set): New function.
11261 (DEFINE_set): New macro.
11262 (General_options::wrap): Changed to use DEFINE_set. Changed
11263 callers of any_wrap_symbols and is_wrap_symbol.
11264 (General_options::trace, General_options::trace_symbol):
11265 New options.
11266 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11267 (General_options::wrap_symbols_): Deleted.
11268 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11269
11270 2008-04-17 David S. Miller <davem@davemloft.net>
11271
11272 * options.cc (General_options::parse_V): New function.
11273 * options.h: Add entries for -V and -Qy.
11274
11275 2008-04-17 Ian Lance Taylor <iant@google.com>
11276
11277 * common.cc (Symbol_table::allocate_commons): Remove options
11278 parameter. Change caller.
11279 (Symbol_table::do_allocate_commons): Remove options parameter.
11280 Change caller. Just call do_allocate_commons_list twice.
11281 (Symbol_table::do_allocate_commons_list): New function, broken out
11282 of do_allocate_commons.
11283 * common.h (class Allocate_commons_task): Remove options_ field.
11284 Update constructor.
11285 * symtab.cc (Symbol_table::Symbol_table): Initialize
11286 tls_commons_.
11287 (Symbol_table::add_from_object): Put TLS common symbols on
11288 tls_commons_ list.
11289 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11290 which are IN_OUTPUT_DATA.
11291 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11292 allocate_commons and do_allocate_commons declarations. Declare
11293 do_allocate_commons_list.
11294 * gold.cc (queue_middle_tasks): Update creation of
11295 Allocate_commons_task to not pass options.
11296 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11297 (TLS_TEST_C_FLAGS): New variable.
11298 (tls_test_c_pic.o): New target.
11299 (tls_test_shared.so): Link in tls_test_c_pic.o.
11300 (tls_test_c_pic_ie.o): New target.
11301 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11302 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11303 (tls_test_c.o): New target.
11304 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11305 (tls_pic_test_LDADD): Likewise.
11306 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11307 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11308 (tls_test_c_gnu2.o): New target.
11309 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11310 tls_test_c_gnu2.o.
11311 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11312 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11313 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11314 * testsuite/tls_test.cc: Include "config.h".
11315 (t_last): Call t11_last.
11316 * testsuite/tls_test.h (t11, t11_last): Declare.
11317 * testsuite/tls_test_c.c: New file.
11318 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11319 * configure.ac: Check for OpenMP support.
11320 * configure, config.in, Makefile.in: Rebuild.
11321 * testsuite/Makefile.in: Rebuild.
11322
11323 2008-04-16 Cary Coutant <ccoutant@google.com>
11324
11325 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11326 (Target_i386::tls_base_symbol_defined_): New field.
11327 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11328 (Target_i386::Scan::global): Likewise.
11329 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11330 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11331 (Target_x86_64::tls_base_symbol_defined_): New field.
11332 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11333 (Target_x86_64::Scan::global): Likewise.
11334
11335 2008-04-16 Cary Coutant <ccoutant@google.com>
11336
11337 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11338 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11339 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11340 building shared libraries.
11341 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11342 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11343 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11344 * testsuite/Makefile.in: Rebuild.
11345 * testsuite/weak_undef.h: New file.
11346 * testsuite/weak_undef_file1.cc: Add extra test cases.
11347 * testsuite/weak_undef_file2.cc: Likewise.
11348 * testsuite/weak_undef_test.cc: Likewise.
11349
11350 2008-04-16 David S. Miller <davem@davemloft.net>
11351
11352 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11353 Add issued_non_pic_error_ field. Declare check_non_pic.
11354 (Target_sparc::Scan::check_non_pic): New function.
11355 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11356 (Target_sparc::Scan::global): Likewise.
11357
11358 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11359 * configure: Rebuild.
11360
11361 * options.h (DEFINE_enable): New macro.
11362 (new_dtags): New enable option.
11363 (initfirst, interpose, loadfltr, nodefaultlib,
11364 nodelete, nodlopen, nodump): New -z options.
11365 * layout.cc (Layout:finish_dynamic_section): If new
11366 dtags enabled, emit DT_RUNPATH. Also, emit a
11367 DT_FLAGS_1 containing any specified -z flags.
11368
11369 2008-04-16 Ian Lance Taylor <iant@google.com>
11370
11371 * copy-relocs.cc: New file.
11372 * copy-relocs.h: New file.
11373 * reloc.cc: Remove Copy_relocs code.
11374 * reloc.h: Likewise.
11375 * reloc-types.h (struct Reloc_types) [both versions]: Add
11376 get_reloc_addend_noerror.
11377 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11378 variants of add_global which take an addend which must be zero.
11379 * i386.cc: Include "copy-relocs.h".
11380 (class Target_i386): Change type of copy_relocs_ to variable,
11381 update initializer.
11382 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11383 Change all callers.
11384 (Target_i386::do_finalize_sections): Change handling of
11385 copy_relocs_.
11386 * sparc.cc: Include "copy-relocs.h".
11387 (class Target_sparc): Change type of copy_relocs_ to variable,
11388 update initializer.
11389 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11390 Change all callers.
11391 (Target_sparc::do_finalize_sections): Change handling of
11392 copy_relocs_.
11393 * x86_64.cc: Include "copy-relocs.h".
11394 (class Target_x86_64): Change type of copy_relocs_ to variable,
11395 update initializer.
11396 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11397 class. Change all callers.
11398 (Target_x86_64::do_finalize_sections): Change handling of
11399 copy_relocs_.
11400 * Makefile.am (CCFILES): Add copy-relocs.cc.
11401 (HFILES): Add copy-relocs.h.
11402
11403 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11404
11405 * testsuite/script_test_4.sh: Permit leading zeroes.
11406
11407 2008-04-15 Ian Lance Taylor <iant@google.com>
11408
11409 * script-sections.cc (Script_sections::create_segments): Use
11410 header_size_adjustment even when there is enough room for the
11411 headers.
11412 * testsuite/script_test_4.sh: New file.
11413 * testsuite/script_test_4.t: New file.
11414 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11415 (check_DATA): Add script_test_4.stdout.
11416 (MOSTLYCLEANFILES): Likewise.
11417 (script_test_4): New target.
11418 (script_test_4.stdout): New target.
11419 * testsuite/Makefile.in: Rebuild.
11420
11421 * sparc.cc: Add definitions for Output_data_plt_sparc class
11422 constants.
11423
11424 2008-04-14 David S. Miller <davem@davemloft.net>
11425
11426 * sparc.cc: New file.
11427 * Makefile.am (TARGETSOURCES): Add sparc.cc
11428 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11429 * configure.tgt: Document targ_extra_size and
11430 targ_extra_big_endian. Add entries for sparc-* and
11431 sparc64-*.
11432 * configure.ac: Handle targ_extra_size and
11433 targ_extra_big_endian.
11434 * Makefile.in: Rebuild.
11435 * configure: Likewise.
11436 * po/POTFILES.in: Likewise.
11437 * po/gold.pot: Likewise.
11438
11439 2008-04-14 Ian Lance Taylor <iant@google.com>
11440
11441 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11442 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11443 in the name/type/flags to section mapping. Don't call
11444 allocate_output_section.
11445 (Layout::choose_output_section): Change parameter from adjust_name
11446 to is_input_section. Don't permit input sections after sections
11447 are attached to segments. Don't call allocate_output_section.
11448 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11449 not write_enable_output_section.
11450 (Layout::make_output_section): Don't push to
11451 unattached_section_list_ nor call attach_to_segment. Call
11452 attach_section_to_segment if sections are attached.
11453 (Layout::attach_sections_to_segments): New function.
11454 (Layout::attach_section_to_segment): New function.
11455 (Layout::attach_allocated_section_to_segment): Rename from
11456 attach_to_segment. Remove flags parameter.
11457 (Layout::allocate_output_section): Remove function.
11458 (Layout::write_enable_output_section): Remove function.
11459 * layout.h (class Layout): Update for above changes. Add new
11460 field sections_are_attached_.
11461 * output.h (Output_section::update_flags_for_input_section): New
11462 function.
11463 * output.cc (Output_section::add_input_section): Call
11464 update_flags_for_input_section.
11465 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11466
11467 2008-04-11 Cary Coutant <ccoutant@google.com>
11468
11469 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11470 thought unnecessary.
11471 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11472
11473 2008-04-11 Ian Lance Taylor <iant@google.com>
11474
11475 * output.h (class Output_section_data): Remove inline definition
11476 of set_addralign.
11477 * output.cc (Output_section_data::set_addralign): New function.
11478
11479 2008-04-11 Cary Coutant <ccoutant@google.com>
11480
11481 Add support for TLS descriptors for i386 and x86_64.
11482 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11483 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11484 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11485 GOT_TYPE_TLS_DESC.
11486 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11487 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11488 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11489 relocations.
11490 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11491 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11492 Fix problem with initial-exec relocations.
11493 (Target_i386::Relocate::relocate_tls): Likewise.
11494 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11495 relaxation.
11496 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11497 support for section-plus-offset dynamic table entries.
11498 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11499 (Output_data_dynamic::Dynamic_entry): Add support for
11500 section-plus-offset dynamic table entries.
11501 (Output_data_dynamic::Classification): Likewise.
11502 (Output_data_dynamic::classification_): Renamed offset_.
11503 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11504 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11505 (Target_x86_64::make_plt_section): New function.
11506 (Target_x86_64::reserve_tlsdesc_entries): New function.
11507 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11508 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11509 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11510 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11511 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11512 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11513 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11514 add extra PLT entry for TLS descriptors.
11515 (Output_data_plt_x86_64::got_): New field.
11516 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11517 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11518 fields.
11519 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11520 descriptors.
11521 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11522 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11523 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11524 R_386_TLS_DESC_CALL relocations.
11525 (Target_x86_64::Scan::global): Likewise.
11526 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11527 for TLS descriptors.
11528 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11529 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11530 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11531 GD-to-IE relaxation.
11532 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11533 and TLS_DESCRIPTORS.
11534 * Makefile.in: Rebuild.
11535 * configure: Rebuild.
11536 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11537 (tls_test_shared2.so): New target.
11538 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11539 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11540 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11541 (tls_shared_gd_to_ie_test_LDADD): New variable.
11542 (tls_shared_gnu2_gd_to_ie_test): New target.
11543 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11544 New targets.
11545 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11546 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11547 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11548 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11549 (tls_shared_gnu2_test): New target.
11550 (tls_test_gnu2_shared.so): New target.
11551 (tls_shared_gnu2_test_SOURCES): New variable.
11552 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11553 (tls_shared_gnu2_test_LDFLAGS): New variable.
11554 (tls_shared_gnu2_test_LDADD): New variable.
11555 * testsuite/Makefile.in: Rebuild.
11556 * testsuite/Makefile.
11557
11558 2008-04-11 Ian Lance Taylor <iant@google.com>
11559
11560 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11561 justsyms.t.
11562 * testsuite/Makefile.in: Rebuild.
11563
11564 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11565 long.
11566 * testsuite/script_test_2.cc (main): Adjust test.
11567
11568 2008-04-11 David S. Miller <davem@davemloft.net>
11569 Ian Lance Taylor <iant@google.com>
11570
11571 * options.h (General_options): Add entries for '-Y' and
11572 '-relax'.
11573 * options.cc (General_options:finalize): If -Y was used, add those
11574 entries to the library path instead of the default "/lib" and
11575 "/usr/lib".
11576
11577 2008-04-11 David S. Miller <davem@davemloft.net>
11578
11579 * testsuite/justsyms.t: Start at 0x100.
11580 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
11581 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11582 long.
11583 * testsuite/script_test_2.cc: Adjust string and section length
11584 checks.
11585
11586 2008-04-09 Ian Lance Taylor <iant@google.com>
11587
11588 PR gold/5996
11589 * script-sections.cc (Sections_element::allocate_to_segment): Add
11590 orphan parameter.
11591 (Output_section_definition::allocate_to_segment): Likewise.
11592 (Orphan_output_section::allocate_to_segment): Likewise.
11593 (Script_sections::attach_sections_using_phdrs_clause): Don't
11594 propagate non-PT_LOAD segments to orphan sections.
11595 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11596 readelf rather than objdump.
11597 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11598 .interp section and PT_INTERP segment are the same size.
11599 * testsuite/Makefile.in: Rebuild.
11600
11601 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11602 aliases for symbols defined in the same object.
11603 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11604 (weak_alias_test_SOURCES): New variable.
11605 (weak_alias_test_DEPENDENCIES): New variable.
11606 (weak_alias_test_LDFLAGS): New variable.
11607 (weak_alias_test_LDADD): New variable.
11608 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11609 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11610 (weak_alias_test_3.o): New target.
11611 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11612 * testsuite/weak_alias_test_main.cc: New file.
11613 * testsuite/weak_alias_test_1.cc: New file.
11614 * testsuite/weak_alias_test_2.cc: New file.
11615 * testsuite/weak_alias_test_3.cc: New file.
11616
11617 2008-04-08 Ian Lance Taylor <iant@google.com>
11618
11619 * options.h (class General_options): Add --noinhibit-exec option.
11620 * main.cc (main): Check --noinhibit-exec.
11621
11622 * options.h (class General_options): Define --wrap as a special
11623 option. Add wrap_symbols_ field.
11624 (General_options::any_wrap_symbols): New function.
11625 (General_options::is_wrap_symbol): New function.
11626 * options.cc (General_options::parse_wrap): New function.
11627 (General_options::General_options): Initialize wrap_symbols_.
11628 * symtab.cc (Symbol_table::wrap_symbol): New function.
11629 (Symbol_table::add_from_object): Handle --wrap.
11630 * symtab.h (class Symbol_table): Declare wrap_symbol.
11631 * target.h (Target::wrap_char): New function.
11632 (Target::Target_info): Add wrap_char field.
11633 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11634 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11635 * testsuite/testfile.cc (Target_test::test_target_info):
11636 Likewise.
11637
11638 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11639 there is one.
11640
11641 * layout.h (class Layout): Add added_eh_frame_data_ field.
11642 * layout.cc (Layout::Layout): Initialize new field.
11643 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11644 output section until we find a section we merged successfully.
11645 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11646 that the size be non-zero.
11647
11648 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11649 qualifier.
11650
11651 2008-04-08 Craig Silverstein <csilvers@google.com>
11652
11653 * configure.ac: Export new conditional variable HAVE_ZLIB.
11654 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11655 on HAVE_ZLIB.
11656 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11657 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11658
11659 2008-04-07 Ian Lance Taylor <iant@google.com>
11660
11661 * version.cc (version_string): Set to "1.5".
11662
11663 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11664 Add issued_non_pic_error_ field. Declare check_non_pic.
11665 (Target_x86_64::Scan::check_non_pic): New function.
11666 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11667 (Target_x86_64::Scan::global): Likewise.
11668
11669 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11670 addend parameter. Change caller. Handle merge sections.
11671 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11672 Address to Addend. Don't add in the result of
11673 local_section_offset, pass down the addend and use the returned
11674 value.
11675 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11676 Update declarations of local_section_offset and symbol_value.
11677 * testsuite/two_file_test_1.cc (t18): New function.
11678 * testsuite/two_file_test_2.cc (f18): New function.
11679 * testsuite/two_file_test_main.cc (main): Call t18.
11680 * testsuite/two_file_test.h (t18, f18): Declare.
11681
11682 * configure.ac: Don't test for objdump, c++filt, or readelf.
11683 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11684 conditionals.
11685 (TEST_READELF): New variable.
11686 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11687 (check_PROGRAMS): Add two_file_strip_test.
11688 (two_file_strip_test): New target.
11689 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11690 (two_file_same_shared_strip_test_SOURCES): New variable.
11691 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11692 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11693 (two_file_same_shared_strip_test_LDADD): New variable.
11694 (two_file_shared_strip.so): New target.
11695 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11696 (ver_test_5.syms, ver_test_7.syms): Likewise.
11697 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11698 (strip_test_3.stdout): Use TEST_OBJDUMP.
11699 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11700
11701 2008-04-04 Cary Coutant <ccoutant@google.com>
11702
11703 * symtab.h (Symbol::is_weak_undefined): New function.
11704 (Symbol::is_strong_undefined): New function.
11705 (Symbol::is_absolute): New function.
11706 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11707 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11708 absolute symbols.
11709 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11710 (weak_undef_test): New target.
11711 * testsuite/Makefile.in: Rebuild.
11712 * testsuite/weak_undef_file1.cc: New file.
11713 * testsuite/weak_undef_file2.cc: New file.
11714 * testsuite/weak_undef_test.cc: New file.
11715
11716 2008-04-03 Craig Silverstein <csilvers@google.com>
11717
11718 * compressed_output.h (class Output_compressed_section): Use
11719 unsigned buffer.
11720 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11721 add zlib header.
11722 (zlib_compressed_suffix): Removed.
11723 (Output_compressed_section::set_final_data_size): Use unsigned
11724 buffers.
11725 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11726 Fix linker invocation.
11727 (flagstest_o_specialfile_and_compress_debug_sections):
11728 Likewise.
11729 * testsuite/Makefile.in: Regenerated.
11730
11731 2008-04-02 David S. Miller <davem@davemloft.net>
11732
11733 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11734 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11735
11736 2008-04-02 Craig Silverstein <csilvers@google.com>
11737
11738 * TODO: New file.
11739
11740 2008-04-02 Ian Lance Taylor <iant@google.com>
11741
11742 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11743 parameters. Update for new key type to views_. Change all
11744 callers.
11745 (File_read::read): Adjust for byteshift in returned view.
11746 (File_read::add_view): New function, broken out of
11747 find_and_make_view.
11748 (File_read::make_view): New function, broken out of
11749 find_and_make_view.
11750 (File_read::find_or_make_view): Add offset and aligned
11751 parameters. Rewrite accordingly. Change all callers.
11752 (File_read::get_view): Add offset and aligned parameters. Adjust
11753 for byteshift in return value.
11754 (File_read::get_lasting_view): Likewise.
11755 * fileread.h (class File_read): Update declarations.
11756 (class File_read::View): Add byteshift_ field. Add byteshift to
11757 constructor. Add byteshift method.
11758 * archive.h (Archive::clear_uncached_views): New function.
11759 (Archive::get_view): Add aligned parameter. Change all callers.
11760 * object.h (Object::get_view): Add aligned parameter. Change all
11761 callers.
11762 (Object::get_lasting_view): Likewise.
11763
11764 * fileread.cc (File_read::release): Don't call clear_views if
11765 there are multiple objects.
11766 * fileread.h (File_read::clear_uncached_views): New function.
11767 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11768 on the archive.
11769
11770 2008-03-31 Cary Coutant <ccoutant@google.com>
11771
11772 Add thin archive support.
11773 * archive.cc (Archive::armagt): New const.
11774 (Archive::setup): Remove task parameter and calls to unlock.
11775 (Archive::unlock_nested_archives): New function.
11776 (Archive::read_header): Add nested_off parameter. Change
11777 all callers.
11778 (Archive::interpret_header): Likewise.
11779 (Archive::include_all_members): Change to handle thin
11780 archives.
11781 (Archive::include_member): Likewise.
11782 * archive.h (Archive::Archive): Add new parameters and
11783 initializers.
11784 (Archive::armagt): New const.
11785 (Archive::setup): Remove task parameter.
11786 (Archive::unlock_nested_archives): New function.
11787 (Archive::read_header): Add nested_off parameter.
11788 (Archive::interpret_header): Likewise.
11789 (Archive::Nested_archive_table): New typedef.
11790 (Archive::is_thin_archive_): New field.
11791 (Archive::nested_archives_): New field.
11792 (Archive::options_): New field.
11793 (Archive::dirpath_): New field.
11794 (Archive::task_): New field.
11795 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11796 for thin archives. Pass additional parameters to
11797 Archive::Archive. Unlock the archive file after calling
11798 Archive::setup.
11799
11800 2008-03-29 Ian Lance Taylor <iant@google.com>
11801
11802 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11803 version symbol to be local.
11804 * testsuite/ver_test_4.sh: New file.
11805 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11806 (check_DATA): Add ver_test_4.syms.
11807 (ver_test_4.syms): New target.
11808 * testsuite/Makefile.in: Rebuild.
11809
11810 * output.cc
11811 (Output_section::Input_section_sort_entry::has_priority): New
11812 function.
11813 (Output_section::Input_section_sort_entry::match_file_name): New
11814 function.
11815 (Output_section::Input_section_sort_entry::match_section_name):
11816 Remove.
11817 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11818 Remove.
11819 (Output_section::Input_section_sort_entry::match_section_file):
11820 Remove.
11821 (Output_section::Input_section_sort_compare::operator()): Rewrite
11822 using new Input_section_sort_entry functions. Sort crtbegin and
11823 crtend first. Sort sections with no priority before sections with
11824 a priority.
11825 * testsuite/initpri1.c (d3): Check j != 4.
11826 (cd5): New constructor/destructor function.
11827 (main): Check j != 2.
11828
11829 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11830 new symbol when resolving, don't call set_is_default.
11831 * testsuite/ver_test_7.cc: New file.
11832 * testsuite/ver_test_7.sh: New file.
11833 * testsuite/Makefile.am (ver_test_7.so): New target.
11834 (ver_test_7.o): New target.
11835 (check_SCRIPTS): Add ver_test_7.sh.
11836 (check_DATA): Add ver_test_7.syms.
11837 (ver_test_7.syms): New target.
11838
11839 2008-03-28 Ian Lance Taylor <iant@google.com>
11840
11841 * layout.cc (Layout::layout): If we see an input section with a
11842 name that needs sorting, set the must_sort flag for the output
11843 section.
11844 (Layout::make_output_section): If the name of the output section
11845 indicates that it might require sorting, set the may_sort flag.
11846 * output.h (Output_section::may_sort_attached_input_sections): New
11847 function.
11848 (Output_section::set_may_sort_attached_input_sections): New
11849 function.
11850 (Output_section::must_sort_attached_input_sections): New
11851 function.
11852 (Output_section::set_must_sort_attached_input_sections): New
11853 function.
11854 (class Output_section): Declare Input_section_sort_entry. Define
11855 Input_section_sort_compare. Declare
11856 sort_attached_input_sections. Add new fields:
11857 may_sort_attached_input_sections_,
11858 must_sort_attached_input_sections_,
11859 attached_input_sections_are_sorted_.
11860 * output.cc (Output_section::Output_section): Initialize new
11861 fields.
11862 (Output_section::add_input_section): Add an entry to
11863 input_sections_ if may_sort or must_sort are true.
11864 (Output_section::set_final_data_size): Call
11865 sort_attached_input_sections if necessary.
11866 (Output_section::Input_section_sort_entry): Define new class.
11867 (Output_section::Input_section_sort_compare::operator()): New
11868 function.
11869 (Output_section::sort_attached_input_sections): New function.
11870 * configure.ac: Check whether the compiler supports constructor
11871 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11872 * testsuite/initpri1.c: New file.
11873 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11874 CONSTRUCTOR_PRIORITY.
11875 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11876 (initpri1_LDFLAGS): New variable.
11877 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11878
11879 2008-03-27 Ian Lance Taylor <iant@google.com>
11880
11881 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11882 * testsuite/common_test_1.c: New file.
11883 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11884 (common_test_1_SOURCES): New variable.
11885 (common_test_1_DEPENDENCIES): New variable.
11886 (common_test_1_LDFLAGS): New variable.
11887
11888 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11889 and commons_ correctly when NAME/VERSION does not override
11890 NAME/NULL.
11891 * testsuite/ver_test_6.c: New file.
11892 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11893 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11894 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11895
11896 2008-03-26 Ian Lance Taylor <iant@google.com>
11897
11898 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11899 of an undefined symbol from a version script.
11900 * testsuite/Makefile.am (ver_test_5.so): New target.
11901 (ver_test_5.o): New target.
11902 (check_SCRIPTS): Add ver_test_5.sh.
11903 (check_DATA): Add ver_test_5.syms.
11904 (ver_test_5.syms): New target.
11905 * testsuite/ver_test_5.cc: New file.
11906 * testsuite/ver_test_5.script: New file.
11907 * testsuite/ver_test_5.sh: New file.
11908 * Makefile.in, testsuite/Makefile.in: Rebuild.
11909
11910 PR gold/5986
11911 Fix problems building gold with gcc 4.3.0.
11912 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11913 (gold_error_at_location, gold_warning_at_location): Use it.
11914 * configure.ac: Check whether we can compile and use a template
11915 function with a printf attribute.
11916 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11917 when jumping over bytes.
11918 * object.cc: Instantiate Object::read_section_data.
11919 * debug.h: Include <cstring>
11920 * dwarf_reader.cc: Include <algorithm>
11921 * main.cc: Include <cstring>.
11922 * options.cc: Include <cstring>.
11923 * output.cc: Include <cstring>.
11924 * script.cc: Include <cstring>.
11925 * script.h: Include <string>.
11926 * symtab.cc: Include <cstring> and <algorithm>.
11927 * target-select.cc: Include <cstring>.
11928 * version.cc: Include <string>.
11929 * testsuite/testmain.cc: Include <cstdlib>.
11930 * configure, config.in: Rebuild.
11931
11932 2008-03-25 Ian Lance Taylor <iant@google.com>
11933
11934 * options.cc: Include "../bfd/bfdver.h".
11935 (options::help): Print bug reporting address.
11936
11937 * version.cc (print_version): Adjust output for current value of
11938 BFD_VERSION_STRING.
11939
11940 * NEWS: New file.
11941
11942 * options.cc (options::help): Print list of supported targets.
11943 * target-select.h: Include <vector>.
11944 (class Target_selector): Make machine_, size_, and is_big_endian_
11945 fields const. Add bfd_name_ and instantiated_target_ fields.
11946 (Target_selector::Target_selector): Add bfd_name parameter.
11947 (Target_selector::recognize): Make non-virtual, call
11948 do_recognize.
11949 (Target_selector::recognize_by_name): Make non-virtual, call
11950 do_recognize_by_name.
11951 (Target_selector::supported_names): New function.
11952 (Target_selector::bfd_name): New function.
11953 (Target_selector::do_instantiate_target): New pure virtual
11954 function.
11955 (Target_selector::do_recognize): New virtual function.
11956 (Target_selector::do_recognize_by_name): New virtual function.
11957 (Target_selector::instantiate_target): New private function.
11958 (supported_target_names): Declare.
11959 * target-select.cc (Target_selector::Target_selector): Update for
11960 new parameter and fields.
11961 (select_target_by_name): Check that the name matches before
11962 calling recognize_by_name.
11963 (supported_target_names): New function.
11964 * i386.cc (class Target_selector_i386): Update Target_selector
11965 constructor call. Remove recognize and recognize_by_name. Add
11966 do_instantiate_target.
11967 * x86_64.cc (class Target_selector_x86_64): Likewise.
11968 * testsuite/testfile.cc (class Target_selector_test): Update for
11969 changes to Target_selector.
11970
11971 * README: Rewrite, with some notes on unsupported features.
11972
11973 2008-03-24 Cary Coutant <ccoutant@google.com>
11974
11975 * i386.cc (Target_i386::Got_type): New enum declaration.
11976 (Target_i386::Scan::local): Updated callers of Output_data_got
11977 member functions.
11978 (Target_i386::Scan::global): Likewise.
11979 (Target_i386::Relocate::relocate): Likewise.
11980 (Target_i386::Relocate::relocate_tls): Likewise.
11981 * object.h (Got_offset_list): New class.
11982 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11983 (Sized_relobj::local_got_offset): Likewise.
11984 (Sized_relobj::set_local_got_offset): Likewise.
11985 (Sized_relobj::local_has_tls_got_offset): Removed.
11986 (Sized_relobj::local_tls_got_offset): Removed.
11987 (Sized_relobj::set_local_tls_got_offset): Removed.
11988 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11989 * output.cc (Output_data_got::add_global): Added got_type parameter.
11990 (Output_data_got::add_global_with_rel): Likewise.
11991 (Output_data_got::add_global_with_rela): Likewise.
11992 (Output_data_got::add_global_pair_with_rel): New function.
11993 (Output_data_got::add_global_pair_with_rela): New function.
11994 (Output_data_got::add_local): Added got_type parameter.
11995 (Output_data_got::add_local_with_rel): Likewise.
11996 (Output_data_got::add_local_with_rela): Likewise.
11997 (Output_data_got::add_local_pair_with_rel): New function.
11998 (Output_data_got::add_local_pair_with_rela): New function.
11999 (Output_data_got::add_global_tls): Removed.
12000 (Output_data_got::add_global_tls_with_rel): Removed.
12001 (Output_data_got::add_global_tls_with_rela): Removed.
12002 (Output_data_got::add_local_tls): Removed.
12003 (Output_data_got::add_local_tls_with_rel): Removed.
12004 (Output_data_got::add_local_tls_with_rela): Removed.
12005 * output.h (Output_data_got::add_global): Added got_type parameter.
12006 (Output_data_got::add_global_with_rel): Likewise.
12007 (Output_data_got::add_global_with_rela): Likewise.
12008 (Output_data_got::add_global_pair_with_rel): New function.
12009 (Output_data_got::add_global_pair_with_rela): New function.
12010 (Output_data_got::add_local): Added got_type parameter.
12011 (Output_data_got::add_local_with_rel): Likewise.
12012 (Output_data_got::add_local_with_rela): Likewise.
12013 (Output_data_got::add_local_pair_with_rel): New function.
12014 (Output_data_got::add_local_pair_with_rela): New function.
12015 (Output_data_got::add_global_tls): Removed.
12016 (Output_data_got::add_global_tls_with_rel): Removed.
12017 (Output_data_got::add_global_tls_with_rela): Removed.
12018 (Output_data_got::add_local_tls): Removed.
12019 (Output_data_got::add_local_tls_with_rel): Removed.
12020 (Output_data_got::add_local_tls_with_rela): Removed.
12021 * resolve.cc (Symbol::override_base_with_special): Removed
12022 reference to has_got_offset_ field.
12023 * symtab.cc (Symbol::init_fields): Replaced initialization
12024 of got_offset_ with got_offsets_. Removed initialization
12025 of has_got_offset_
12026 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
12027 (Symbol::got_offset): Likewise.
12028 (Symbol::set_got_offset): Likewise.
12029 (Symbol::has_tls_got_offset): Removed.
12030 (Symbol::tls_got_offset): Removed.
12031 (Symbol::set_tls_got_offset): Removed.
12032 (Symbol::got_offset_): Removed.
12033 (Symbol::tls_mod_got_offset_): Removed.
12034 (Symbol::tls_pair_got_offset_): Removed.
12035 (Symbol::got_offsets_): New field.
12036 (Symbol::has_got_offset): Removed.
12037 (Symbol::has_tls_mod_got_offset): Removed.
12038 (Symbol::has_tls_pair_got_offset): Removed.
12039 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12040 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12041 member functions.
12042 (Target_x86_64::Scan::global): Likewise.
12043 (Target_x86_64::Relocate::relocate): Likewise.
12044 (Target_x86_64::Relocate::relocate_tls): Likewise.
12045
12046 2008-03-25 Ben Elliston <bje@au.ibm.com>
12047
12048 * yyscript.y: Fix spelling error in comment.
12049
12050 2008-03-24 Ian Lance Taylor <iant@google.com>
12051
12052 * options.h (class General_options): Define build_id option.
12053 * layout.h (class Layout): Declare write_build_id, create_note,
12054 create_build_id. Add build_id_note_ member.
12055 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12056 "libiberty.h", "md5.h", "sha1.h".
12057 (Layout::Layout): Initialize eh_frame_data_,
12058 eh_frame_hdr_section_, and build_id_note_.
12059 (Layout::finalize): Call create_build_id.
12060 (Layout::create_note): New function, broken out of
12061 Layout::create_gold_note.
12062 (Layout::create_gold_note): Call create_note.
12063 (Layout::create_build_id): New function.
12064 (Layout::write_build_id): New function.
12065 (Close_task_runner::run): Call write_build_id.
12066
12067 * x86_64.cc: Correct license to GPLv3.
12068
12069 2008-03-23 Ian Lance Taylor <iant@google.com>
12070
12071 * options.cc: Include "demangle.h".
12072 (parse_optional_string): New function.
12073 (parse_long_option): Handle takes_optional_argument.
12074 (parse_short_option): Update dash_z initializer. Handle
12075 takes_optional_argument.
12076 (General_options::General_options): Initialize do_demangle_.
12077 (General_options::finalize): Set do_demangle_. Handle demangling
12078 style.
12079 * options.h (parse_optional_string): Declare.
12080 (struct One_option): Add optional_arg field. Update constructor.
12081 Update call constructor calls. Add takes_optional_argument
12082 function.
12083 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12084 (DEFINE_optional_string): Define.
12085 (General_options::demangle): Change from DEFINE_bool to
12086 DEFINE_optional_string.
12087 (General_options::no_demangle): New function.
12088 (General_options::do_demangle): New function.
12089 (General_options::set_do_demangle): New function.
12090 (General_options::execstack_status_): Move definition to end of
12091 class definition.
12092 (General_options::static_): Likewise.
12093 (General_options::do_demangle_): New field.
12094 * object.cc (big_endian>::get_symbol_location_info): Call
12095 Options::do_demangle, not Options::demangle.
12096 * symtab.cc (demangle): Likewise.
12097
12098 2008-03-22 Ian Lance Taylor <iant@google.com>
12099
12100 * gold.h: Include <cstddef> and <sys/types.h>
12101 * options.h: Include <cstring>.
12102
12103 2008-03-21 Ian Lance Taylor <iant@google.com>
12104
12105 * Added source code to GNU binutils.