* gold/incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2011-10-10 Cary Coutant <ccoutant@google.com>
2
3 * gold/incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4 Initialize defined_count_.
5 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
6 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
7 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
8 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
9 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
10 * gold/incremental.h (Sized_relobj_incr::defined_count_): New data
11 member.
12 (Sized_incr_dynobj::defined_count_): New data member.
13 * gold/plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
14 Return zeroes instead of internal error.
15
16 2011-10-10 Cary Coutant <ccoutant@google.com>
17
18 PR gold/13249
19 * gold/output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
20 (Output_reloc::symbol_value): Return PLT offset if flag is set.
21 * gold/output.h (class Output_reloc): Add use_plt_offset flag.
22 (Output_reloc::type_): Adjust size of bit field.
23 (Output_reloc::use_plt_offset_): New bit field.
24 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
25 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
26 flag. Adjust all callers.
27 * gold/x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
28 creating RELATIVE relocations.
29
30 2011-10-10 Nick Clifton <nickc@redhat.com>
31
32 * po/es.po: Updated Spanish translation.
33 * po/fi.po: Updated Finnish translation.
34
35 2011-10-03 Diego Novillo <dnovillo@google.com>
36
37 * options.cc (parse_uint): Fix dereference of RETVAL.
38
39 2011-09-29 Sriraman Tallam <tmsriram@google.com>
40
41 * layout.h (section_order_map_): New member.
42 (get_section_order_map): New member function.
43 * output.cc (Output_section::add_input_section): Check for patterns
44 only when --section-ordering-file is specified.
45 * gold.cc (queue_middle_tasks): Delay updating order of sections till
46 output_sections have been formed.
47 * layout.cc (Layout_Layout): Initialize section_order_map_.
48 * plugin.cc (update_section_order): Store order in order_map. Do not
49 update the order.
50 * testsuite/Makefile.am: Add test case for plugin_final_layout.
51 * testsuite/Makefile.in: Regenerate.
52 * testsuite/plugin_section_order.c: New file.
53 * testsuite/plugin_final_layout.cc: New file.
54 * testsuite/plugin_final_layout.sh: New file.
55
56 2011-09-29 Cary Coutant <ccoutant@google.com>
57
58 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
59 Check for NULL.
60 * gold/symtab.cc (Symbol_table::add_from_relobj): Ignore version
61 symbols during incremental update.
62 (Symbol_table::add_from_dynobj): Likewise.
63
64 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
65 Ian Lance Taylor <iant@google.com>
66
67 * symtab.cc (Symbol_table::define_special_symbol): Always
68 canonicalize version string.
69
70 2011-09-26 Cary Coutant <ccoutant@google.com>
71
72 * gold/gold.cc (queue_initial_tasks): Move option checks ...
73 * gold/options.cc (General_options::finalize): ... to here. Disable
74 some options; make others fatal.
75
76 2011-09-26 Cary Coutant <ccoutant@google.com>
77
78 gcc PR lto/47247
79 * plugin.cc (get_symbols_v2): New function.
80 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
81 (is_referenced_from_outside): New function.
82 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
83 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
84 (get_symbols): Pass version parameter.
85 (get_symbols_v2): New function.
86 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
87 parameter.
88 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
89 (onload): Add LDPT_GET_SYMBOLS_V2.
90 (all_symbols_read_hook): Use get_symbols_v2; check for
91 LDPR_PREVAILING_DEF_IRONLY_EXP.
92 * testsuite/plugin_test_3.sh: Update expected results.
93
94 2011-09-23 Simon Baldwin <simonb@google.com>
95
96 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
97 configuration options.
98 * configure: Regenerate.
99 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
100 * Makefile.in: Regenerate.
101 * testsuite/Makefile.in: Regenerate.
102
103 2011-09-19 Sriraman Tallam <tmsriram@google.com>
104
105 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
106
107 2011-09-19 Cary Coutant <ccoutant@google.com>
108
109 * incremental.cc (can_incremental_update): Fix typo in comment.
110 * incremental.h (can_incremental_update): Likewise.
111
112 2011-09-18 Cary Coutant <ccoutant@google.com>
113
114 * incremental.cc (can_incremental_update): New function.
115 * incremental.h (can_incremental_update): New function.
116 * layout.cc (Layout::init_fixed_output_section): Call it.
117 (Layout::make_output_section): Don't allow patch space in .eh_frame.
118 * object.cc (Sized_relobj_file::do_layout): Call
119 can_incremental_update.
120
121 2011-09-13 Cary Coutant <ccoutant@google.com>
122
123 * configure.ac: Check for glibc support for gnu_indirect_function
124 support with static linking, setting automake conditional
125 IFUNC_STATIC.
126 * Makefile.in: Regenerate.
127 * configure: Regenerate.
128
129 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
130 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
131 for IFUNC_STATIC.
132 * testsuite/Makefile.in: Regenerate.
133
134 2011-09-13 Cary Coutant <ccoutant@google.com>
135
136 * incremental.cc (Sized_relobj_incr::do_layout): Call
137 report_comdat_group for kept comdat sections.
138 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
139 * testsuite/Makefile.in: Regenerate.
140 * testsuite/incr_comdat_test_1.cc: New source file.
141 * testsuite/incr_comdat_test_2_v1.cc: New source file.
142 * testsuite/incr_comdat_test_2_v2.cc: New source file.
143 * testsuite/incr_comdat_test_2_v3.cc: New source file.
144
145 2011-09-13 Ian Lance Taylor <iant@google.com>
146
147 * object.cc (Sized_relobj_file::do_layout): Remove unused local
148 variable external_symbols_offset.
149
150 2011-09-12 Ian Lance Taylor <iant@google.com>
151
152 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
153 triggered if object has no symbols.
154
155 2011-09-09 David S. Miller <davem@davemloft.net>
156
157 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
158 (Output_fill_debug_line::do_write): Likewise.
159
160 2011-08-29 Cary Coutant <ccoutant@google.com>
161
162 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
163 casts to match formatting specs.
164 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
165
166 2011-08-26 Cary Coutant <ccoutant@google.com>
167
168 * layout.cc (Free_list::allocate): Provide guarantee of minimum
169 remaining hole size when allocating.
170 (Layout::make_output_section): Set fill methods for debug sections.
171 * layout.h (Free_list::Free_list_node): Move from private to
172 public.
173 (Free_list::set_min_hole_size): New function.
174 (Free_list::begin, Free_list::end): New functions.
175 (Free_list::min_hole_): New data member.
176 * output.cc: Include dwarf.h.
177 (Output_fill_debug_info::do_minimum_hole_size): New function.
178 (Output_fill_debug_info::do_write): New function.
179 (Output_fill_debug_line::do_minimum_hole_size): New function.
180 (Output_fill_debug_line::do_write): New function.
181 (Output_section::Output_section): Initialize new data member.
182 (Output_section::set_final_data_size): Ensure patch space is larger
183 than minimum hole size.
184 (Output_section::do_write): Fill holes in debug sections.
185 * output.h (Output_fill): New class.
186 (Output_fill_debug_info): New class.
187 (Output_fill_debug_line): New class.
188 (Output_section::set_free_space_fill): New function.
189 (Output_section::free_space_fill_): New data member.
190 * testsuite/Makefile.am (incremental_test_3): Add
191 --incremental-patch option.
192 (incremental_test_4): Likewise.
193 (incremental_test_5): Likewise.
194 (incremental_test_6): Likewise.
195 (incremental_copy_test): Likewise.
196 (incremental_common_test_1): Likewise.
197 * testsuite/Makefile.in: Regenerate.
198
199 2011-08-26 Nick Clifton <nickc@redhat.com>
200
201 * po/es.po: Updated Spanish translation.
202
203 2011-08-01 Cary Coutant <ccoutant@google.com>
204
205 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
206 * gold/testsuite/Makefile.in: Regenerate.
207 * gold/testsuite/justsyms_exec.c: New source file.
208 * gold/testsuite/justsyms_lib.c: New source file.
209
210 2011-08-01 Cary Coutant <ccoutant@google.com>
211
212 * layout.cc (Layout::set_segment_offsets): Don't realign text
213 segment if -Ttext was specified.
214 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
215 file type.
216 * object.h (Sized_relobj_file::e_type): New function.
217 (Sized_relobj_file::e_type_): New data member.
218 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
219 base address for ET_EXEC files.
220 * target.cc (Target::do_make_elf_object_implementation): Allow
221 ET_EXEC files with --just-symbols option.
222
223 2011-07-28 Cary Coutant <ccoutant@google.com>
224
225 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
226 Add thread_number parameter.
227 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
228 * workqueue-threads.cc
229 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
230 current thread if its thread number is greater than desired thread
231 count.
232 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
233 Add thread_number parameter.
234 (Workqueue::should_cancel_thread): Likewise.
235 (Workqueue::find_runnable_or_wait): Pass thread_number to
236 should_cancel_thread.
237 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
238 parameter.
239
240 2011-07-22 Sriraman Tallam <tmsriram@google.com>
241
242 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
243 only after checking if it cannot be forced local.
244 * symtab.h (is_externally_visible): Check if the symbol is not forced
245 local.
246
247 2011-07-15 Ian Lance Taylor <iant@google.com>
248
249 * options.h (class General_options): Add --print-output-format.
250 Move -EL next to -EB, for better --help output.
251 * target-select.cc: Include <cstdio>, "options.h", and
252 "parameters.h".
253 (Target_selector::do_target_bfd_name): New function.
254 (print_output_format): New function.
255 * target-select.h (class Target_selector): Update declarations.
256 (Target_selector::target_bfd_name): New function.
257 (print_output_format): Declare.
258 * main.cc: Include "target-select.h".
259 (main): Handle --print-output-format.
260 * gold.cc: Include "target-select.h".
261 (queue_initial_tasks): Handle --print-output-format when there are
262 no input files.
263 * parameters.cc (parameters_force_valid_target): Give a better
264 error message if -EB/-EL does not match target.
265 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
266 function.
267
268 2011-07-15 Ian Lance Taylor <iant@google.com>
269
270 * i386.cc (class Output_data_plt_i386): Add layout_ field.
271 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
272 (Output_data_plt_i386::do_write): Write address of .dynamic
273 section to first entry in .got.plt section.
274 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
275 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
276 Initialize layout_.
277 (Output_data_plt_x86_64::do_write): Write address of .dynamic
278 section to first entry in .got.plt section.
279 * layout.h (Layout::dynamic_section): New function.
280
281 2011-07-13 Sriraman Tallam <tmsriram@google.com>
282
283 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
284 to claim_file call.
285 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
286 input_section_position_, and input_section_glob_.
287 (read_layout_from_file): Call function section_ordering_specified.
288 * layout.h (is_section_ordering_specified): New function.
289 (section_ordering_specified): New function.
290 (section_ordering_specified_): New boolean member.
291 * main.cc(main): Call load_plugins after layout object is defined.
292 * output.cc (Output_section::add_input_section): Use
293 function section_ordering_specified to check if section ordering is
294 needed.
295 * output.cc (Output_section::add_relaxed_input_section): Use
296 function section_ordering_specified to check if section ordering is
297 needed.
298 (Output_section::update_section_layout): New function.
299 (Output_section::sort_attached_input_sections): Check if input section
300 must be reordered.
301 * output.h (Output_section::update_section_layout): New function.
302 * plugin.cc (get_section_count): New function.
303 (get_section_type): New function.
304 (get_section_name): New function.
305 (get_section_contents): New function.
306 (update_section_order): New function.
307 (allow_section_ordering): New function.
308 (Plugin::load): Add the new interfaces to the transfer vector.
309 (Plugin_manager::load_plugins): New parameter.
310 (Plugin_manager::all_symbols_read): New parameter.
311 (Plugin_manager::claim_file): New parameter. Save the elf object for
312 unclaimed objects.
313 (Plugin_manager::get_elf_object): New function.
314 (Plugin_manager::get_view): Change to directly use the bool to check
315 if get_view is called from claim_file_hook.
316 * plugin.h (input_objects): New function
317 (Plugin__manager::load_plugins): New parameter.
318 (Plugin_manager::claim_file): New parameter.
319 (Plugin_manager::get_elf_object): New function.
320 (Plugin_manager::in_claim_file_handler): New function.
321 (Plugin_manager::in_claim_file_handler_): New member.
322 (layout): New function.
323 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
324 handler with an extra parameter. Make the elf object before calling
325 claim_file handler.
326 * testsuite/plugin_test.c (get_section_count): New function pointer.
327 (get_section_type): New function pointer.
328 (get_section_name): New function pointer.
329 (get_section_contents): New function pointer.
330 (update_section_order): New function pointer.
331 (allow_section_ordering): New function pointer.
332 (onload): Check if the new interfaces exist.
333
334 2011-07-13 Ian Lance Taylor <iant@google.com>
335
336 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
337 relro section.
338 * x86_64.cc (Target_x86_64::got_section): Likewise.
339 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
340 (relro_now_test_SOURCES): New variable.
341 (relro_now_test_DEPENDENCIES): New variable.
342 (relro_now_test_LDFLAGS): New variable.
343 (relro_now_test_LDADD): New variable.
344 (relro_now_test.so): New target.
345 * testsuite/Makefile.in: Rebuild.
346
347 2011-07-12 Ian Lance Taylor <iant@google.com>
348
349 PR gold/12980
350 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
351 GLOB_DAT relocation rather than a RELATIVE relocation for a
352 protected symbol when creating a shared library.
353 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
354 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
355 * testsuite/protected_main_1.cc (main): Test that protected
356 function has same address.
357
358 2011-07-11 Ian Lance Taylor <iant@google.com>
359
360 PR gold/12979
361 * options.h (class General_options): Add -Bgroup.
362 * options.cc (General_options::finalize): If -Bgroup is set,
363 default to --unresolved-symbols=report-all.
364 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
365 * target-reloc.h (issue_undefined_symbol_error): Handle
366 --unresolved-symbols=report-all.
367
368 2011-07-08 Ian Lance Taylor <iant@google.com>
369
370 PR gold/11985
371 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
372 if linker script discards key sections.
373 (Layout::create_dynamic_symtab): Likewise.
374 (Layout::assign_local_dynsym_offsets): Likewise.
375 (Layout::sized_create_version_sections): Likewise.
376 (Layout::create_interp): Likewise.
377 (Layout::finish_dynamic_section): Likewise.
378 (Layout::set_dynamic_symbol_size): Likewise.
379
380 2011-07-08 Ian Lance Taylor <iant@google.com>
381
382 PR gold/12386
383 * options.h (class General_options): Add --unresolved-symbols.
384 * target-reloc.h (issue_undefined_symbol_error): Check
385 --unresolved-symbols. Add comments.
386
387 2011-07-08 Ian Lance Taylor <iant@google.com>
388
389 * testsuite/odr_violation2.cc (Ordering::operator()): Make
390 expression more complex.
391
392 2011-07-08 Ian Lance Taylor <iant@google.com>
393
394 PR gold/11317
395 * target-reloc.h (issue_undefined_symbol_error): New inline
396 function, broken out of relocate_section.
397 (relocate_section): Call issue_undefined_symbol_error.
398 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
399 there is no TLS segment if we are about to issue an undefined
400 symbol error.
401 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
402
403 2011-07-08 Ian Lance Taylor <iant@google.com>
404
405 PR gold/12279
406 * resolve.cc (Symbol_table::should_override): Add fromtype
407 parameter. Change all callers. Give error when linking together
408 TLS and non-TLS symbol.
409 (Symbol_table::should_override_with_special): Add fromtype
410 parameter. Change all callers.
411 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
412 there is no TLS segment if we have reported some errors.
413 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
414
415 2011-07-08 Ian Lance Taylor <iant@google.com>
416
417 PR gold/12372
418 * target.h (Target::plt_address_for_global): New function.
419 (Target::plt_address_for_local): New function.
420 (Target::plt_section_for_global): Remove.
421 (Target::plt_section_for_local): Remove.
422 (Target::do_plt_address_for_global): New virtual function.
423 (Target::do_plt_address_for_local): New virtual function.
424 (Target::do_plt_section_for_global): Remove.
425 (Target::do_plt_section_for_local): Remove.
426 (Target::register_global_plt_entry): Add Symbol_table and Layout
427 parameters.
428 * output.cc (Output_data_got::Got_entry::write): Use
429 plt_address_for_global and plt_address_for_local.
430 * layout.cc (Layout::add_target_dynamic_tags): Use size and
431 address of output section.
432 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
433 got_irelative_, and irelative_count_ fields. Update
434 declarations.
435 (Output_data_plt_i386::has_irelative_section): New function.
436 (Output_data_plt_i386::entry_count): Add irelative_count_.
437 (Output_data_plt_i386::set_final_data_size): Likewise.
438 (class Target_i386): Add got_irelative_ and rel_irelative_
439 fields. Update declarations.
440 (Target_i386::Target_i386): Initialize new fields.
441 (Target_i386::do_plt_address_for_global): New function replacing
442 do_plt_section_for_global.
443 (Target_i386::do_plt_address_for_local): New function replacing
444 do_plt_section_for_local.
445 (Target_i386::got_section): Create got_irelative_.
446 (Target_i386::rel_irelative_section): New function.
447 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
448 fields. Don't define __rel_iplt_{start,end}.
449 (Output_data_plt_i386::add_entry): Add symtab and layout
450 parameters. Change all callers. Use different PLT and GOT for
451 IFUNC symbols.
452 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
453 layout parameters. Change all callers. Use different PLT and
454 GOT.
455 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
456 (Output_data_plt_i386::rel_irelative): New function.
457 (Output_data_plt_i386::address_for_global): New function.
458 (Output_data_plt_i386::address_for_local): New function.
459 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
460 IRELATIVE GOT when changing IFUNC GOT entries.
461 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
462 reloc.
463 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
464 if we didn't create an IRELATIVE GOT.
465 (Target_i386::Relocate::relocate): Use plt_address_for_global and
466 plt_address_for_local.
467 (Target_i386::do_dynsym_value): Use plt_address_for_global.
468 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
469 got_irelative_, and irelative_count_ fields. Update
470 declarations.
471 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
472 Initialize new fields. Remove symtab parameter. Change all
473 callers.
474 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
475 irelative_count_.
476 (Output_data_plt_x86_64::has_irelative_section): New function.
477 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
478 (class Target_x86_64): Add got_irelative_ and rel_irelative_
479 fields. Update declarations.
480 (Target_x86_64::Target_x86_64): Initialize new fields.
481 (Target_x86_64::do_plt_address_for_global): New function replacing
482 do_plt_section_for_global.
483 (Target_x86_64::do_plt_address_for_local): New function replacing
484 do_plt_section_for_local.
485 (Target_x86_64::got_section): Create got_irelative_.
486 (Target_x86_64::rela_irelative_section): New function.
487 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
488 all callers. Don't create __rel_iplt_{start,end}.
489 (Output_data_plt_x86_64::add_entry): Add symtab and layout
490 parameters. Change all callers. Use different PLT and GOT for
491 IFUNC symbols.
492 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
493 layout parameters. Change all callers. Use different PLT and
494 GOT.
495 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
496 parameters. Change all callers. Use different PLT and GOT for
497 IFUNC symbols.
498 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
499 (Output_data_plt_x86_64::rela_irelative): New function.
500 (Output_data_plt_x86_64::address_for_global): New function.
501 (Output_data_plt_x86_64::address_for_local): New function.
502 (Output_data_plt_x86_64::set_final_data_size): Likewise.
503 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
504 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
505 (Target_x86_64::register_global_plt_entry): Add symtab and layout
506 parameters.
507 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
508 reloc.
509 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
510 symbols if we didn't create an IRELATIVE GOT.
511 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
512 plt_address_for_local.
513 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
514 * testsuite/ifuncvar1.c: New test file.
515 * testsuite/ifuncvar2.c: New test file.
516 * testsuite/ifuncvar3.c: New test file.
517 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
518 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
519 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
520 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
521 * testsuite/Makefile.in: Rebuild.
522
523 2011-07-07 Cary Coutant <ccoutant@google.com>
524
525 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
526 (two_file_test_1_ndebug.o): Likewise.
527 (two_file_test_1b_ndebug.o): Likewise.
528 (two_file_test_2_ndebug.o): Likewise.
529 (two_file_test_main_ndebug.o): Likewise.
530 (incremental_test_2): Link with no-debug versions.
531
532 2011-07-06 Cary Coutant <ccoutant@google.com>
533
534 * gold/incremental.cc
535 (Output_section_incremental_inputs::write_info_blocks): Check for
536 hidden and internal symbols.
537
538 2011-07-06 Cary Coutant <ccoutant@google.com>
539
540 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
541 Check disposition for startup file.
542 (Incremental_inputs::report_command_line): Ignore
543 --incremental-startup-unchanged option.
544 * options.cc (General_options::parse_incremental_startup_unchanged):
545 New function.
546 (General_options::General_options): Initialize new data member.
547 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
548 (General_options): Add --incremental-startup-unchanged option.
549 (General_options::incremental_startup_disposition): New function.
550 (General_options::incremental_startup_disposition_): New data member.
551
552 2011-07-06 Cary Coutant <ccoutant@google.com>
553
554 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
555 input file index to Script_info ctor.
556 (Sized_incremental_binary::do_file_has_changed): Find the
557 command-line argument for files named in scripts.
558 * incremental.h (Script_info::Script_info): New ctor
559 with input file index.
560 (Script_info::input_file_index): New function.
561 (Script_info::input_file_index_): New data member.
562 (Incremental_binary::get_library): Add const.
563 (Incremental_binary::get_script_info): Add const.
564 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
565 * testsuite/Makefile.am (incremental_test_5): New test case.
566 (incremental_test_6): New test case.
567 * testsuite/Makefile.in: Regenerate.
568
569 2011-07-06 Cary Coutant <ccoutant@google.com>
570
571 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
572 debug output when command lines differ.
573
574 2011-07-06 Cary Coutant <ccoutant@google.com>
575
576 * incremental.cc (Incremental_inputs::report_command_line): Ignore
577 --incremental-patch option.
578 * layout.cc (Free_list::allocate): Extend allocation beyond original
579 end if enabled.
580 (Layout::make_output_section): Mark sections that should get
581 patch space.
582 * options.cc (parse_percent): New function.
583 * options.h (parse_percent): New function.
584 (DEFINE_percent): New macro.
585 (General_options): Add --incremental-patch option.
586 * output.cc (Output_section::Output_section): Initialize new data
587 members.
588 (Output_section::add_input_section): Print section name when out
589 of patch space.
590 (Output_section::add_output_section_data): Likewise.
591 (Output_section::set_final_data_size): Add patch space when
592 doing --incremental-full.
593 (Output_section::do_reset_address_and_file_offset): Remove patch
594 space.
595 (Output_segment::set_section_list_addresses): Print debug output
596 only if --incremental-update.
597 * output.h (Output_section::set_is_patch_space_allowed): New function.
598 (Output_section::is_patch_space_allowed_): New data member.
599 (Output_section::patch_space_): New data member.
600 * parameters.cc (Parameters::incremental_full): New function.
601 * parameters.h (Parameters::incremental_full): New function
602 * testsuite/Makefile.am (incremental_test_2): Add test for
603 --incremental-patch option.
604 * testsuite/Makefile.in: Regenerate.
605 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
606 (t18): Remove function body.
607
608 2011-07-05 Doug Kwan <dougkwan@google.com>
609
610 PR gold/12771
611 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
612 Arm_Address type for relocation result.
613 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
614 overflow check.
615 (Arm_relocate_functions::abs32): Use unaligned access.
616 (Arm_relocate_functions::rel32): Ditto.
617 (Arm_relocate_functions::prel31): Ditto.
618 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
619 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
620 static data relocations.
621 * testsuite/Makefile.in: Regnerate.
622 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
623
624 2011-07-05 Ian Lance Taylor <iant@google.com>
625
626 PR gold/12392
627 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
628 symbols if necessary.
629 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
630
631 2011-07-05 Ian Lance Taylor <iant@google.com>
632
633 PR gold/12952
634 * resolve.cc (Symbol::override_base_with_special): Simply override
635 version with special symbol version, ignoring previous version.
636
637 2011-07-05 Ian Lance Taylor <iant@google.com>
638
639 * object.cc (Sized_relobj_file::include_section_group): Add
640 information to comment about signature location.
641
642 2011-07-02 Ian Lance Taylor <iant@google.com>
643
644 PR gold/12957
645 * options.h (class General_options): Add -f and -F.
646 * options.cc (General_options::finalize): Fatal error if -f/-F
647 are used without -shared.
648 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
649
650 2011-07-02 Ian Lance Taylor <iant@google.com>
651
652 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
653
654 2011-07-01 Ian Lance Taylor <iant@google.com>
655
656 PR gold/12525
657 PR gold/12952
658 * resolve.cc (Symbol::override_base_with_special): Don't override
659 the version if the overriding symbol has a different name.
660 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
661 all callers. If we give an error about an undefined version,
662 define the base version if necessary.
663 * dynobj.h (class Versions): Update declaration.
664 * testsuite/weak_alias_test_5.cc: New file.
665 * testsuite/weak_alias_test.script: New file.
666 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
667 and versioned_alias have the right value, and call t2.
668 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
669 weak_alias_test_5.so.
670 (weak_alias_test_LDADD): Likewise.
671 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
672 * testsuite/Makefile.in: Rebuild.
673
674 2011-07-01 Ian Lance Taylor <iant@google.com>
675
676 PR gold/12525
677 * options.h (class General_options): Support -z notext.
678 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
679 -Wl,-z,notext.
680 (two_file_shared_nonpic.so): Likewise.
681 (two_file_shared_mixed.so): Likewise.
682 (two_file_shared_mixed_1.so): Likewise.
683 (weak_undef_lib_nonpic.so): Likewise.
684 (alt/weak_undef_lib_nonpic.so): Likewise.
685 (tls_test_shared_nonpic.so): Likewise.
686 * testsuite/Makefile.in: Rebuild.
687
688 2011-07-01 Ian Lance Taylor <iant@google.com>
689
690 PR gold/12525
691 * configure.ac: Test whether static linking works, setting
692 the automake conditional HAVE_STATIC.
693 * testsuite/Makefile.am: Disable tests using -static if
694 HAVE_STATIC is not true.
695 * configure, testsuite/Makefile.in: Rebuild.
696
697 2011-07-01 Ian Lance Taylor <iant@google.com>
698
699 PR gold/12525
700 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
701 Assert if we see DW_EH_PE_indirect.
702 * target.h (Target::ehframe_datarel_base): New function.
703 (Target::do_ehframe_datarel_base): New target function.
704 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
705 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
706 function.
707
708 2011-07-01 Ian Lance Taylor <iant@google.com>
709
710 PR gold/12571
711 * options.h (class General_options): Add
712 --ld-generated-unwind-info.
713 * ehframe.cc (Fde::write): Add address parameter. Change all
714 callers. If associated with PLT, fill in address and size.
715 (Cie::set_output_offset): Only add merge mapping if there is an
716 object.
717 (Cie::write): Add address parameter. Change all callers.
718 (Eh_frame::add_ehframe_for_plt): New function.
719 * ehframe.h (class Fde): Update declarations. Move shndx_ and
720 input_offset_ fields into union u_, with new plt field.
721 (Fde::Fde): Adjust for new union field.
722 (Fde::Fde) [Output_data version]: New constructor.
723 (Fde::add_mapping): Only add merge mapping if there is an object.
724 (class Cie): Update declarations.
725 (class Eh_frame): Declare add_ehframe_for_plt.
726 * layout.cc (Layout::layout_eh_frame): Break out code into
727 make_eh_frame_section, and call it.
728 (Layout::make_eh_frame_section): New function.
729 (Layout::add_eh_frame_for_plt): New function.
730 * layout.h (class Layout): Update declarations.
731 * merge.cc (Merge_map::add_mapping): Add assertion.
732 * i386.cc: Include "dwarf.h".
733 (class Output_data_plt_i386): Make first_plt_entry,
734 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
735 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
736 and plt_eh_frame_fde.
737 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
738 boundary. Call add_eh_frame_for_plt if appropriate.
739 * x86_64.cc: Include "dwarf.h".
740 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
741 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
742 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
743 and plt_eh_frame_fde.
744 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
745 appropriate.
746
747 2011-06-29 Ian Lance Taylor <iant@google.com>
748
749 PR gold/12629
750 * object.cc (Sized_relobj_file::layout_section): Change shdr
751 parameter to be const.
752 (Sized_relobj_file::layout_eh_frame_section): New function, broken
753 out of do_layout.
754 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
755 appropriate. Call layout_eh_frame_section.
756 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
757 sections.
758 * object.h (class Sized_relobj_file): Update declarations.
759
760 2011-06-29 Ian Lance Taylor <iant@google.com>
761
762 PR gold/12652
763 * script.cc (Token::integer_value): Accept trailing M/m/K/k
764 modifier.
765 (Lex::gather_token): Accept trailing M/m/K/k for integers.
766
767 2011-06-29 Ian Lance Taylor <iant@google.com>
768
769 PR gold/12675
770 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
771 SHT_X86_64_UNWIND.
772 * layout.cc (Layout::layout_eh_frame): Likewise.
773
774 2011-06-29 Ian Lance Taylor <iant@google.com>
775
776 PR gold/12695
777 * layout.cc (Layout::symtab_section_shndx): New function.
778 * layout.h (class Layout): Declare symtab_section_shndx.
779 * output.cc (Output_section::write_header): Call it.
780
781 2011-06-29 Ian Lance Taylor <iant@google.com>
782
783 PR gold/12818
784 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
785 symbols which are not used in a relocation.
786
787 2011-06-28 Ian Lance Taylor <iant@google.com>
788
789 PR gold/12898
790 * layout.cc (Layout::segment_precedes): Don't crash if a linker
791 script create indistinguishable segments.
792 (Layout::set_segment_offsets): Use stable_sort when sorting
793 segments. Pass this to Compare_segments constructor.
794 * layout.h (class Layout): Make segment_precedes non-static.
795 (class Compare_segments): Change from struct to class. Add
796 layout_ field. Add constructor.
797 * script-sections.cc
798 (Script_sections::attach_sections_using_phdrs_clause): Rename
799 local orphan to is_orphan. Don't report failure to put empty
800 section in segment. On attachment failure, report name of
801 section, and attach to first PT_LOAD segment.
802
803 2011-06-28 Ian Lance Taylor <iant@google.com>
804
805 PR gold/12934
806 * target-select.cc (Target_selector::Target_selector): Add
807 emulation parameter. Change all callers.
808 (select_target_by_bfd_name): Rename from select_target_by_name.
809 Change all callers.
810 (select_target_by_emulation): New function.
811 (supported_emulation_names): New function.
812 * target-select.h (class Target_selector): Add emulation_ field.
813 Update declarations.
814 (Target_selector::recognize_by_bfd_name): Rename from
815 recognize_by_name. Change all callers.
816 (Target_selector::supported_bfd_names): Rename from
817 supported_names. Change all callers.
818 (Target_selector::recognize_by_emulation): New function.
819 (Target_selector::supported_emulations): New function.
820 (Target_selector::emulation): New function.
821 (Target_selector::do_recognize_by_bfd_name): Rename from
822 do_recognize_by_name. Change all callers.
823 (Target_selector::do_supported_bfd_names): Rename from
824 do_supported_names. Change all callers.
825 (Target_selector::do_recognize_by_emulation): New function.
826 (Target_selector::do_supported_emulations): New function.
827 (select_target_by_bfd_name): Change name in declaration.
828 (select_target_by_emulation): Declare.
829 (supported_emulation_names): Declare.
830 * parameters.cc (parameters_force_valid_target): Try to find
831 target based on emulation from -m option.
832 * options.h (class General_options): Change doc string for -m.
833 * options.cc (help): Print emulations.
834 (General_options::parse_V): Likewise.
835 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
836 Add emulation parameter. Change all callers.
837
838 2011-06-28 Ian Lance Taylor <iant@google.com>
839
840 * target.h (class Target): Add osabi_ field.
841 (Target::osabi): New function.
842 (Target::set_osabi): New function.
843 (Target::Target): Initialize osabi_.
844 (Target::do_adjust_elf_header): Make pure virtual.
845 (Sized_target::do_adjust_elf_header): Declare.
846 * target.cc (Sized_target::do_adjust_elf_header): New function.
847 (class Sized_target): Instantiate all versions.
848 * freebsd.h (class Target_freebsd): Remove.
849 (Target_selector_freebsd::do_recognize): Call set_osabi on
850 Target.
851 (Target_selector_freebsd::do_recognize_by_name): Likewise.
852 (Target_selector_freebsd::set_osabi): Remove.
853 * i386.cc (class Target_i386): Inherit from Sized_target rather
854 than Target_freebsd.
855 * x86_64.cc (class Target_x86_64): Likewise.
856
857 2011-06-28 Ian Lance Taylor <iant@google.com>
858
859 * target.h (Target::can_check_for_function_pointers): Rewrite.
860 Make non-virtual.
861 (Target::can_icf_inline_merge_sections): Likewise.
862 (Target::section_may_have_icf_unsafe_poineters): Likewise.
863 (Target::Target_info): Add can_icf_inline_merge_sections field.
864 (Target::do_can_check_for_function_pointers): New virtual
865 function.
866 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
867 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
868 from can_check_for_function_pointers, move in file.
869 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
870 section_may_have_icf_unsafe_poineters, move in file.
871 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
872 * i386.cc (Target_i386::do_can_check_for_function_pointers):
873 Rename from can_check_for_function_pointers, move in file.
874 (Target_i386::can_icf_inline_merge_sections): Remove.
875 (Target_i386::i386_info): Initialize
876 can_icf_inline_merge_sections.
877 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
878 Initialize can_icf_inline_merge_sections.
879 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
880 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
881 Rename from can_check_for_function_pointers, move in file.
882 (Target_x86_64::can_icf_inline_merge_sections): Remove.
883 (Target_x86_64::x86_64_info): Initialize
884 can_icf_inline_merge_sections.
885 * testsuite/testfile.cc (Target_test::test_target_info):
886 Likewise.
887 * icf.cc (get_section_contents): Correct formatting.
888
889 2011-06-27 Ian Lance Taylor <iant@google.com>
890
891 * symtab.cc (Symbol::versioned_name): New function.
892 (Symbol_table::add_to_final_symtab): Use versioned_name when
893 appropriate.
894 (Symbol_table::sized_write_symbol): Likewise.
895 * symtab.h (class Symbol): Declare versioned_name.
896 * stringpool.h (class Stringpool_template): Add variant of add
897 which takes a std::basic_string.
898 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
899 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
900 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
901 (ver_test_12.o): New target.
902 * testsuite/Makefile.in: Rebuild.
903
904 2011-06-27 Doug Kwan <dougkwan@google.com>
905
906 * arm.cc (Arm_relocate_functions::thm_jump8,
907 Arm_relocate_functions::thm_jump11): Use a wider signed
908 type to compute offset.
909 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
910 arm_thm_jump8.
911 * testsuite/Makefile.in: Regenerate.
912 * testsuite/arm_branch_in_range.sh: Check test results of
913 arm_thm_jump11 and arm_thm_jump8.
914 * testsuite/arm_thm_jump11.s: New test source file.
915 * testsuite/arm_thm_jump11.t: New linker script.
916 * testsuite/arm_thm_jump8.s: New test source file.
917 * testsuite/arm_thm_jump8.t: New linker script.
918
919 2011-06-24 Ian Lance Taylor <iant@google.com>
920
921 * layout.cc: Include "object.h".
922 (ctors_sections_in_init_array): New static variable.
923 (Layout::is_ctors_in_init_array): New function.
924 (Layout::layout): Add entry to ctors_sections_in_init_array if
925 appropriate.
926 * layout.h (class Layout): Declare is_ctors_in_init_array.
927 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
928 is_ctors_reverse_view is set.
929 (Sized_relobj_file::write_sections): Add layout parameter. Change
930 all callers. Set is_ctors_reverse_view field of View_size.
931 (Sized_relobj_file::reverse_words): New function.
932 * object.h (Sized_relobj_file::View_size): Add
933 is_ctors_reverse_view field.
934 (class Sized_relobj_file): Update declarations.
935 * testsuite/initpri3.c: New test.
936 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
937 initpri3b.
938 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
939 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
940 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
941 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
942 * testsuite/Makefile.in: Rebuild.
943
944 2011-06-24 Cary Coutant <ccoutant@google.com>
945
946 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
947 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
948 (debug_msg_cdebug.err): New targets.
949 * testsuite/Makefile.in: Regenerate.
950 * testsuite/debug_msg.sh: Check output of link with compressed debug.
951 Fix checks for link with shared library.
952
953 2011-06-24 Doug Kwan <dougkwan@google.com>
954
955 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
956 skip empty text sections.
957 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
958
959 2011-06-22 Ian Lance Taylor <iant@google.com>
960
961 PR gold/12910
962 * options.h (class General_options): Add --ctors-in-init-array.
963 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
964 friends as SHT_PROGBITS for merging sections.
965 (Layout::layout): Remove special handling of .init_array and
966 friends. Don't sort if doing relocatable link. Sort for .ctors
967 and .dtors if ctors_in_init_array.
968 (Layout::make_output_section): Force correct section types for
969 .init_array and friends. Don't sort if doing relocatable link,
970 Don't sort .ctors and .dtors if ctors_in_init_array.
971 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
972 (Layout::output_section_name): Add relobj parameter. Change all
973 callers. Handle .ctors. and .dtors. in code rather than table.
974 Handle .ctors and .dtors if ctors_in_init_array.
975 (Layout::match_file_name): New function, moved from output.cc.
976 * layout.h (class Layout): Update declarations.
977 * output.cc: Include "layout.h".
978 (Input_section_sort_entry::get_priority): New function.
979 (Input_section_sort_entry::match_file_name): Just call
980 Layout::match_file_name.
981 (Output_section::Input_section_sort_init_fini_compare::operator()):
982 Handle .ctors and .dtors. Sort by explicit priority rather than
983 by name.
984 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
985 * testsuite/initpri2.c: New test.
986 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
987 (check_PROGRAMS): Add initpri2.
988 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
989 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
990 * configure, testsuite/Makefile.in: Rebuild.
991
992 2011-06-19 Ian Lance Taylor <iant@google.com>
993
994 PR gold/12880
995 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
996 .interp section to a PT_INTERP segment even if we have seen a
997 --dynamic-linker option. Don't do it if we have seen a PHDRS
998 clause in a linker script.
999 (Layout::finalize): Don't create a .interp section if we've
1000 already create a PT_INTERP segment.
1001 (Layout::create_interp): Always call choose_output_section (revert
1002 patch of 2011-06-17). Don't create PT_INTERP segment.
1003 * script-sections.cc
1004 (Script_sections::create_note_and_tls_segments): Add a .interp
1005 section to a PT_INTERP segment even if we have seen a
1006 --dynamic-linker option.
1007
1008 2011-06-18 Ian Lance Taylor <iant@google.com>
1009
1010 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1011 merely because a non-PT_LOAD segment has a dynamic reloc.
1012
1013 2011-06-18 Ian Lance Taylor <iant@google.com>
1014
1015 * layout.cc (Layout::finish_dynamic_section): Don't create
1016 DT_FLAGS entry if not needed.
1017
1018 2011-06-18 Ian Lance Taylor <iant@google.com>
1019
1020 PR gold/12745
1021 * layout.cc (Layout::layout_eh_frame): Correct handling of
1022 writable .eh_frame section.
1023
1024 2011-06-17 Ian Lance Taylor <iant@google.com>
1025
1026 PR gold/12893
1027 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1028 symbol is redefined with the exact same object and value.
1029
1030 2011-06-17 Ian Lance Taylor <iant@google.com>
1031
1032 PR gold/12880
1033 * layout.h (class Layout): Add interp_segment_ field.
1034 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1035 (Layout::attach_allocated_section_to_segment): If making shared
1036 library, put .interp section in PT_INTERP segment.
1037 (Layout::finalize): Also call create_interp if -dynamic-linker
1038 option was used.
1039 (Layout::create_interp): Assert that there is no PT_INTERP
1040 segment. If not using a SECTIONS clause, use make_output_section.
1041 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1042 * script-sections.cc
1043 (Script_sections::create_note_and_tls_segments): If making shared
1044 library, put .interp section in PT_INTERP segment.
1045
1046 2011-06-17 Ian Lance Taylor <iant@google.com>
1047
1048 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1049 when making a shared library.
1050
1051 2011-06-17 Ian Lance Taylor <iant@google.com>
1052
1053 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1054 parameter. Change all callers. Don't issue warning about PC32
1055 against locally defined symbol.
1056
1057 2011-06-16 Ian Lance Taylor <iant@google.com>
1058
1059 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1060 occurs in same object.
1061
1062 2011-06-14 Alan Modra <amodra@gmail.com>
1063
1064 * po/POTFILES.in: Regenerate.
1065
1066 2011-06-09 Ian Lance Taylor <iant@google.com>
1067
1068 * script-sections.cc
1069 (Orphan_output_section::set_section_addresses): For a relocatable
1070 link set address to 0.
1071
1072 2011-06-09 Cary Coutant <ccoutant@google.com>
1073
1074 PR gold/12804
1075 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1076 used with --compress-debug-sections.
1077 * gold/object.cc (Sized_relobj_file::do_layout): Report
1078 uncompressed size of compressed input sections.
1079
1080 2011-06-08 Cary Coutant <ccoutant@google.com>
1081
1082 PR gold/12804
1083 * testsuite/two_file_test_2_v1.cc: Change initialization of
1084 v2 to keep it in .data.
1085
1086 2011-06-07 Cary Coutant <ccoutant@google.com>
1087
1088 * common.cc (Symbol_table::do_allocate_commons_list): Call
1089 gold_fallback.
1090 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1091 (Errors::fallback): New function.
1092 (gold_fallback): New function.
1093 * errors.h (Errors::fallback): New function.
1094 * gold.cc (gold_exit): Change status parameter to enum; adjust
1095 all callers.
1096 (queue_initial_tasks): Call gold_fallback.
1097 * gold.h: Include cstdlib.
1098 (Exit_status): New enum type.
1099 (gold_exit): Change status parameter to enum.
1100 (gold_fallback): New function.
1101 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1102 (Layout::create_symtab_sections): Likewise.
1103 (Layout::create_shdrs): Likewise.
1104 * main.cc (main): Adjust call to gold_exit.
1105 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1106 (Output_data_got::add_got_entry_pair): Likewise.
1107 (Output_section::add_input_section): Likewise.
1108 (Output_section::add_output_section_data): Likewise.
1109 (Output_segment::set_section_list_addresses): Likewise.
1110 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1111
1112 2011-06-07 Cary Coutant <ccoutant@google.com>
1113
1114 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1115 for incremental links.
1116 * output.cc (Output_segment::set_section_list_addresses): Remove
1117 FIXME and test for TLS or BSS.
1118
1119 2011-06-07 Cary Coutant <ccoutant@google.com>
1120
1121 * testsuite/Makefile.am: Add incremental_copy_test,
1122 incremental_common_test_1.
1123 * testsuite/Makefile.in: Regenerate.
1124 * testsuite/common_test_1_v1.c: New source file.
1125 * testsuite/common_test_1_v2.c: New source file.
1126 * testsuite/copy_test_v1.cc: New source file.
1127
1128 2011-06-07 Cary Coutant <ccoutant@google.com>
1129
1130 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1131 update, allocate common from bss section's free list.
1132 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1133 linker-defined symbols.
1134 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1135 Skip GOT and PLT entries that are no longer referenced.
1136 (Output_section_incremental_inputs::write_info_blocks): Mark
1137 linker-defined symbols.
1138 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1139 * output.cc (Output_section::allocate): New function.
1140 * output.h (Output_section::allocate): New function.
1141 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1142 linker-defined symbols.
1143 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1144 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1145 (Symbol::init_base_output_data): Likewise.
1146 (Symbol::init_base_output_segment): Likewise.
1147 (Symbol::init_base_constant): Likewise.
1148 (Sized_symbol::init_output_data): Likewise.
1149 (Sized_symbol::init_output_segment): Likewise.
1150 (Sized_symbol::init_constant): Likewise.
1151 (Symbol_table::do_define_in_output_data): Likewise.
1152 (Symbol_table::do_define_in_output_segment): Likewise.
1153 (Symbol_table::do_define_as_constant): Likewise.
1154 * symtab.h (Symbol::is_predefined): New function.
1155 (Symbol::init_base_output_data): Add is_predefined parameter.
1156 (Symbol::init_base_output_segment): Likewise.
1157 (Symbol::init_base_constant): Likewise.
1158 (Symbol::is_predefined_): New data member.
1159 (Sized_symbol::init_output_data): Add is_predefined parameter.
1160 (Sized_symbol::init_output_segment): Likewise.
1161 (Sized_symbol::init_constant): Likewise.
1162 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1163
1164 2011-06-07 Cary Coutant <ccoutant@google.com>
1165
1166 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1167 instead of emit_copy_reloc.
1168 (Copy_relocs::emit_copy_reloc): Refactor.
1169 (Copy_relocs::make_copy_reloc): New function.
1170 (Copy_relocs::add_copy_reloc): Remove.
1171 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1172 section.
1173 (Copy_relocs::make_copy_reloc): New function.
1174 (Copy_relocs::add_copy_reloc): Remove.
1175 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1176 unchanged input files.
1177 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1178 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1179 Reserve BSS space for COPY relocations.
1180 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1181 (Output_section_incremental_inputs::write_info_blocks): Record
1182 whether a symbol is copied from a shared object.
1183 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1184 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1185 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1186 (Incremental_input_entry_reader::get_output_symbol_index): Add
1187 is_copy parameter.
1188 (Incremental_binary::emit_copy_relocs): New function.
1189 (Incremental_binary::do_emit_copy_relocs): New function.
1190 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1191 new data member.
1192 (Sized_incremental_binary::add_copy_reloc): New function.
1193 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1194 (Sized_incremental_binary::Copy_reloc): New struct.
1195 (Sized_incremental_binary::Copy_relocs): New typedef.
1196 (Sized_incremental_binary::copy_relocs_): New data member.
1197 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1198 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1199 * target.h (Sized_target::emit_copy_reloc): New function.
1200 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1201
1202 2011-06-02 Cary Coutant <ccoutant@google.com>
1203
1204 PR gold/12163
1205 * gold/archive.cc (Archive::Archive): Initialize new data member.
1206 (Archive::include_all_members): Return if archive has already been
1207 included.
1208 * gold/archive.h (Archive::include_all_members_): New data member.
1209
1210 2011-06-02 Nick Clifton <nickc@redhat.com>
1211
1212 * dynobj.h: Fix spelling mistake in comment.
1213 * output.cc: Likewise.
1214
1215 2011-05-31 Doug Kwan <dougkwan@google.com>
1216 Asier Llano
1217
1218 PR gold/12826
1219 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
1220 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1221 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1222 redundant arm_exidx_test.so.
1223 * testsuite/Makefile.in: Regenerate.
1224 (check_SCRIPTS): Add pr12826.sh
1225 (check_DATA): Add pr12826.stdout
1226 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1227 * testsuite/pr12826.sh: New file.
1228 * testsuite/pr12826_1.s: Ditto.
1229 * testsuite/pr12826_1.s: Ditto.
1230
1231 2011-05-30 Ian Lance Taylor <iant@google.com>
1232
1233 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1234 sections.
1235
1236 2011-05-29 Ian Lance Taylor <iant@google.com>
1237
1238 PR gold/12804
1239 * testsuite/Makefile.am: Use different file name for two_file_test
1240 temporary file for each incremental test.
1241 * testsuite/Makefile.in: Rebuild.
1242
1243 2011-05-29 Ian Lance Taylor <iant@google.com>
1244
1245 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1246 binary input file is empty.
1247
1248 2011-05-27 Ian Lance Taylor <iant@google.com>
1249
1250 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1251 (ver_test_9.so): Likewise.
1252 * testsuite/Makefile.in: Rebuild.
1253
1254 2011-05-26 Cary Coutant <ccoutant@google.com>
1255
1256 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1257 * incremental.cc (Incremental_inputs::report_input_section): Fix
1258 comment, indentation.
1259 (Incremental_inputs::report_comdat_group): New function.
1260 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1261 of data for incremental input file entry.
1262 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1263 group count, COMDAT group signatures.
1264 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1265 an unchanged input file.
1266 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1267 Initialize new data member.
1268 (Incremental_object_entry::add_comdat_group): New function.
1269 (Incremental_object_entry::get_comdat_group_count): New function.
1270 (Incremental_object_entry::get_comdat_signature_key): New function.
1271 (Incremental_object_entry::groups_): New data member.
1272 (Incremental_inputs::report_comdat_group): New function.
1273 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1274 data for incremental input file entry.
1275 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1276 (Incremental_input_entry_reader::get_input_section): Adjust size of
1277 data for incremental input file entry.
1278 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1279 (Incremental_input_entry_reader::get_comdat_group_signature): New
1280 function.
1281 * object.cc (Sized_relobj::include_section_group): Report kept
1282 COMDAT groups for incremental links.
1283
1284 2011-05-24 David Meyer <pdox@google.com>
1285
1286 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1287 with name parameter. Add found_name parameter.
1288 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1289 * dirsearch.h (class Dirsearch): Update declaration.
1290
1291 2011-05-24 Ian Lance Taylor <iant@google.com>
1292
1293 * archive.cc (Library_base::should_include_member): Pull in object
1294 from archive if it defines the entry symbol.
1295 * parameters.cc (Parameters::entry): New function.
1296 * parameters.h (class Parameters): Declare entry.
1297 * output.h (class Output_file_header): Remove entry_ field.
1298 * output.cc (Output_file_header::Output_file_header): Remove entry
1299 parameter. Change all callers.
1300 (Output_file_header::entry): Use parameters->entry.
1301 * gold.cc (queue_middle_tasks): Likewise.
1302 * plugin.cc (Plugin_hook::run): Likewise.
1303
1304 2011-05-24 Cary Coutant <ccoutant@google.com>
1305
1306 * gold.cc (queue_initial_tasks): Pass incremental base filename
1307 to Output_file::open_base_file; don't print error message.
1308 * incremental-dump.cc (main): Adjust call to
1309 Output_file::open_for_modification.
1310 * incremental-dump.cc (main): Likewise.
1311 * incremental.cc (Incremental_inputs::report_command_line):
1312 Ignore --incremental-base option when comparing command lines.
1313 Ignore parameter when given as separate argument.
1314 * options.h (class General_options): Add --incremental-base.
1315 * output.cc (Output_file::Output_file):
1316 (Output_file::open_base_file): Add base_name and writable parameters;
1317 read base file into new file; print error message here.
1318 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1319 callers.
1320 * output.h (Output_file::open_for_modification): Rename to...
1321 (Output_file::open_base_file): ...this; add base_name and
1322 writable parameters; adjust all callers.
1323 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1324 callers.
1325 * testsuite/Makefile.am (incremental_test_4): Test
1326 --incremental-base.
1327 * testsuite/Makefile.in: Regenerate.
1328
1329 2011-05-24 Cary Coutant <ccoutant@google.com>
1330
1331 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1332 incremental_test_4.
1333 * testsuite/Makefile.in: Regenerate.
1334 * testsuite/two_file_test_1_v1.cc: New test source file.
1335 * testsuite/two_file_test_1b_v1.cc: New test source file.
1336 * testsuite/two_file_test_2_v1.cc: New test source file.
1337
1338 2011-05-24 Cary Coutant <ccoutant@google.com>
1339
1340 * dynobj.h (Dynobj::do_dynobj): New function.
1341 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1342 flag and soname for shared objects.
1343 * incremental.cc (Incremental_inputs::report_object): Make
1344 either Incremental_object_entry or Incremental_dynobj_entry; add
1345 soname to string table.
1346 (Incremental_inputs::report_input_section): Add assertion.
1347 (Output_section_incremental_inputs::set_final_data_size): Adjust
1348 type of input file entry for shared libraries; adjust size of
1349 shared library info entry.
1350 (Output_section_incremental_inputs::write_input_files): Write
1351 as_needed flag for shared libraries.
1352 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1353 of input file entry for shared libraries; write soname.
1354 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1355 soname from incremental info.
1356 * incremental.h (enum Incremental_input_flags): Add
1357 INCREMENTAL_INPUT_AS_NEEDED.
1358 (Incremental_input_entry::Incremental_input_entry): Initialize new
1359 data member.
1360 (Incremental_input_entry::set_as_needed): New function.
1361 (Incremental_input_entry::as_needed): New function.
1362 (Incremental_input_entry::do_dynobj_entry): New function.
1363 (Incremental_input_entry::as_needed_): New data member.
1364 (Incremental_object_entry::Incremental_object_entry): Don't check
1365 for shared library.
1366 (Incremental_object_entry::do_type): Likewise.
1367 (class Incremental_dynobj_entry): New class.
1368 (Incremental_input_entry_reader::as_needed): New function.
1369 (Incremental_input_entry_reader::get_soname): New function.
1370 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1371 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1372 size of shared library info entry.
1373 * layout.cc (Layout::finish_dynamic_section): Don't test for
1374 incremental link when adding DT_NEEDED entries.
1375 * object.h (Object::Object): Initialize new data member.
1376 (Object::dynobj): New function.
1377 (Object::set_as_needed): New function.
1378 (Object::as_needed): New function.
1379 (Object::do_dynobj): New function.
1380 (Object::as_needed_): New data member.
1381
1382 2011-05-24 Cary Coutant <ccoutant@google.com>
1383
1384 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1385 info; adjust display of GOT entries.
1386 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1387 vector of input objects; remove file_status_.
1388 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1389 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1390 got_plt reader; call target hooks to reserve GOT entries.
1391 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1392 of input file info header and GOT info entry.
1393 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1394 relocation info.
1395 (Got_plt_view_info::got_descriptor): Remove.
1396 (Got_plt_view_info::sym_index): New data member.
1397 (Got_plt_view_info::input_index): New data member.
1398 (Local_got_offset_visitor::visit): Write input file index.
1399 (Global_got_offset_visitor::visit): Write 0 for input file index.
1400 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1401 with sym_index and input_index.
1402 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1403 incremental info GOT entry; replace got_descriptor with input_index.
1404 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1405 map from input file index to object.
1406 (Sized_relobj_incr::do_layout): Replace direct data member reference
1407 with accessor function.
1408 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1409 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1410 Adjust size of input file info header.
1411 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1412 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1413 (Incremental_input_entry_reader::get_input_section): Adjust size of
1414 input file info header.
1415 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1416 of incremental info GOT entry.
1417 (Incremental_got_plt_reader::get_got_desc): Remove.
1418 (Incremental_got_plt_reader::get_got_symndx): New function.
1419 (Incremental_got_plt_reader::get_got_input_index): New function.
1420 (Sized_incremental_binary::Sized_incremental_binary): Remove
1421 file_status_; add input_objects_.
1422 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1423 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1424 (Sized_incremental_binary::file_is_unchanged): Remove.
1425 (Sized_incremental_binary::set_input_object): New function.
1426 (Sized_incremental_binary::input_object): New function.
1427 (Sized_incremental_binary::file_status_): Remove.
1428 (Sized_incremental_binary::input_objects_): New data member.
1429 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1430 references.
1431 (Sized_relobj_incr::invalid_address): Move to base class.
1432 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1433 class.
1434 (Sized_relobj_incr::do_output_section_offset): Likewise.
1435 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1436 (Sized_relobj_incr::section_offsets_): Likewise.
1437 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1438 function.
1439 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1440 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1441 with accessor function.
1442 (Sized_relobj_file::do_layout): Likewise.
1443 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1444 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1445 (Sized_relobj_file::compute_final_local_value): Replace refs to
1446 section_offsets_ with accessor function.
1447 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1448 * object.h (Relobj::Relobj): Initialize new data members.
1449 (Relobj::add_dyn_reloc): New function.
1450 (Relobj::first_dyn_reloc): New function.
1451 (Relobj::dyn_reloc_count): New function.
1452 (Relobj::first_dyn_reloc_): New data member.
1453 (Relobj::dyn_reloc_count_): New data member.
1454 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1455 references.
1456 (Sized_relobj::Address): New typedef.
1457 (Sized_relobj::invalid_address): Move here from child class.
1458 (Sized_relobj::Sized_relobj): Initialize new data members.
1459 (Sized_relobj::sized_relobj): New function.
1460 (Sized_relobj::is_output_section_offset_invalid): Move here from
1461 child class.
1462 (Sized_relobj::get_output_section_offset): Likewise.
1463 (Sized_relobj::local_has_got_offset): Likewise.
1464 (Sized_relobj::local_got_offset): Likewise.
1465 (Sized_relobj::set_local_got_offset): Likewise.
1466 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1467 (Sized_relobj::clear_got_offsets): New function.
1468 (Sized_relobj::section_offsets): Move here from child class.
1469 (Sized_relobj::do_output_section_offset): Likewise.
1470 (Sized_relobj::do_set_section_offset): Likewise.
1471 (Sized_relobj::Local_got_offsets): Likewise.
1472 (Sized_relobj::local_got_offsets_): Likewise.
1473 (Sized_relobj::section_offsets_): Likewise.
1474 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1475 references.
1476 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1477 class.
1478 (Sized_relobj_file::sized_relobj): New function
1479 (Sized_relobj_file::local_has_got_offset): Move to base class.
1480 (Sized_relobj_file::local_got_offset): Likewise.
1481 (Sized_relobj_file::set_local_got_offset): Likewise.
1482 (Sized_relobj_file::get_output_section_offset): Likewise.
1483 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1484 (Sized_relobj_file::do_output_section_offset): Likewise.
1485 (Sized_relobj_file::do_set_section_offset): Likewise.
1486 (Sized_relobj_file::Local_got_offsets): Likewise.
1487 (Sized_relobj_file::local_got_offsets_): Likewise.
1488 (Sized_relobj_file::section_offsets_): Likewise.
1489 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1490 (all constructors).
1491 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1492 (Output_reloc::get_symbol_index): Likewise.
1493 (Output_reloc::local_section_offset): Likewise.
1494 (Output_reloc::get_address): Likewise.
1495 (Output_reloc::symbol_value): Likewise.
1496 (Output_data_got::reserve_slot): Move to class definition.
1497 (Output_data_got::reserve_local): New function.
1498 (Output_data_got::reserve_slot_for_global): Remove.
1499 (Output_data_got::reserve_global): New function.
1500 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1501 (all constructors, two instantiations).
1502 (Output_reloc::get_relobj): New function (two instantiations).
1503 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1504 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1505 (Output_data_reloc::add_global): Adjust type of relobj.
1506 (Output_data_reloc::add_global_relative): Likewise.
1507 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1508 (Output_data_reloc::add_local): Likewise.
1509 (Output_data_reloc::add_local_relative): Likewise.
1510 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1511 (Output_data_reloc::add_local_section): Likewise.
1512 (Output_data_reloc::add_output_section): Likewise.
1513 (Output_data_reloc::add_absolute): Likewise.
1514 (Output_data_reloc::add_target_specific): Likewise.
1515 (Output_data_got::reserve_slot): Move definition here.
1516 (Output_data_got::reserve_local): New function.
1517 (Output_data_got::reserve_global): New function.
1518 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1519 section_offsets_ with accessor function.
1520 (Sized_relobj_file::write_sections): Likewise.
1521 (Sized_relobj_file::do_relocate_sections): Likewise.
1522 * target.h (Sized_target::reserve_local_got_entry): New function.
1523 (Sized_target::reserve_global_got_entry): New function.
1524 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1525 (Target_x86_64::reserve_global_got_entry): New function.
1526 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1527
1528 2011-05-23 Cary Coutant <ccoutant@google.com>
1529
1530 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1531 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1532 bit when checking got_type.
1533 * incremental.cc (Sized_incremental_binary::setup_readers):
1534 Store symbol table and string table locations; initialize bit vector
1535 of file status flags.
1536 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1537 unchanged files.
1538 (Sized_incremental_binary::do_process_got_plt): New function.
1539 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1540 (Output_section_incremental_inputs::set_final_data_size): Record
1541 file index for each input file.
1542 (Output_section_incremental_inputs::write_got_plt): Store file index
1543 instead of input entry offset for each GOT entry.
1544 * incremental.h
1545 (Incremental_input_entry::Incremental_input_entry): Initialize new
1546 data member.
1547 (Incremental_input_entry::set_offset): Store file index.
1548 (Incremental_input_entry::get_file_index): New function.
1549 (Incremental_input_entry::file_index_): New data member.
1550 (Incremental_binary::process_got_plt): New function.
1551 (Incremental_binary::do_process_got_plt): New function.
1552 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1553 data members.
1554 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1555 (Sized_incremental_binary::set_file_is_unchanged): New function.
1556 (Sized_incremental_binary::file_is_unchanged): New function.
1557 (Sized_incremental_binary::do_process_got_plt): New function.
1558 (Sized_incremental_binary::file_status_): New data member.
1559 (Sized_incremental_binary::main_symtab_loc_): New data member.
1560 (Sized_incremental_binary::main_strtab_loc_): New data member.
1561 * output.cc (Output_data_got::Got_entry::write): Add case
1562 RESERVED_CODE.
1563 (Output_data_got::add_global): Call add_got_entry.
1564 (Output_data_got::add_global_plt): Likewise.
1565 (Output_data_got::add_global_with_rel): Likewise.
1566 (Output_data_got::add_global_with_rela): Likewise.
1567 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1568 (Output_data_got::add_global_pair_with_rela): Likewise.
1569 (Output_data_got::add_local): Call add_got_entry.
1570 (Output_data_got::add_local_plt): Likewise.
1571 (Output_data_got::add_local_with_rel): Likewise.
1572 (Output_data_got::add_local_with_rela): Likewise.
1573 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1574 (Output_data_got::add_local_pair_with_rela): Likewise.
1575 (Output_data_got::reserve_slot): New function.
1576 (Output_data_got::reserve_slot_for_global): New function.
1577 (Output_data_got::add_got_entry): New function.
1578 (Output_data_got::add_got_entry_pair): New function.
1579 (Output_section::add_output_section_data): Edit FIXME.
1580 * output.h
1581 (Output_section_data_build::Output_section_data_build): New
1582 constructor with size parameter.
1583 (Output_data_space::Output_data_space): Likewise.
1584 (Output_data_got::Output_data_got): Initialize new data member; new
1585 constructor with size parameter.
1586 (Output_data_got::add_constant): Call add_got_entry.
1587 (Output_data_got::reserve_slot): New function.
1588 (Output_data_got::reserve_slot_for_global): New function.
1589 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1590 (Output_data_got::add_got_entry): New function.
1591 (Output_data_got::add_got_entry_pair): New function.
1592 (Output_data_got::free_list_): New data member.
1593 * target.h (Sized_target::init_got_plt_for_update): New function.
1594 (Sized_target::register_global_plt_entry): New function.
1595 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1596 Initialize new data member; call init; add constructor with PLT count.
1597 (Output_data_plt_x86_64::init): New function.
1598 (Output_data_plt_x86_64::add_relocation): New function.
1599 (Output_data_plt_x86_64::reserve_slot): New function.
1600 (Output_data_plt_x86_64::free_list_): New data member.
1601 (Target_x86_64::init_got_plt_for_update): New function.
1602 (Target_x86_64::register_global_plt_entry): New function.
1603 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1604 incremental updates.
1605 (Output_data_plt_x86_64::add_relocation): New function.
1606 * testsuite/object_unittest.cc (Object_test): Set default options.
1607
1608 2011-05-16 Ian Lance Taylor <iant@google.com>
1609
1610 * options.h (class General_options): Make -i a synonym for -r.
1611
1612 2011-05-16 Ian Lance Taylor <iant@google.com>
1613
1614 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1615
1616 2011-05-10 Cary Coutant <ccoutant@google.com>
1617
1618 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1619 strip_all (-s).
1620
1621 2011-05-06 Ian Lance Taylor <iant@google.com>
1622
1623 * layout.cc (Layout::layout): If the output section flags change,
1624 update the ordering.
1625
1626 2011-04-25 Cary Coutant <ccoutant@google.com>
1627
1628 * incremental-dump.cc (dump_incremental_inputs): Print local
1629 symbol info for each input file.
1630 * incremental.cc
1631 (Output_section_incremental_inputs::set_final_data_size): Add local
1632 symbol info to input file entries in incremental info.
1633 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1634 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1635 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1636 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1637 implementation.
1638 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1639 (Sized_incr_relobj::do_relocate): Write the local symbols.
1640 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1641 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1642 Adjust size of input file header.
1643 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1644 (Incremental_inputs_reader::get_local_symbol_count): New function.
1645 (Incremental_inputs_reader::get_input_section): Adjust size of input
1646 file header.
1647 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1648 (Sized_incr_relobj::This): New typedef.
1649 (Sized_incr_relobj::sym_size): New const data member.
1650 (Sized_incr_relobj::Local_symbol): New struct.
1651 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1652 (Sized_incr_relobj::do_local_symbol_offset): New function.
1653 (Sized_incr_relobj::local_symbol_count_): New data member.
1654 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1655 (Sized_incr_relobj::local_symbol_index_): New data member.
1656 (Sized_incr_relobj::local_symbol_offset_): New data member.
1657 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1658 (Sized_incr_relobj::local_symbols_): New data member.
1659 * object.h (Relobj::output_local_symbol_count): New function.
1660 (Relobj::local_symbol_offset): New function.
1661 (Relobj::do_output_local_symbol_count): New function.
1662 (Relobj::do_local_symbol_offset): New function.
1663 (Sized_relobj::do_output_local_symbol_count): New function.
1664 (Sized_relobj::do_local_symbol_offset): New function.
1665
1666 2011-04-22 Vladimir Simonov <sv@sw.ru>
1667
1668 * descriptors.cc (set_close_on_exec): New function.
1669 (Descriptors::open): Use set_close_on_exec.
1670 * output.cc (S_ISLNK): Define if not defined.
1671
1672 2011-04-22 Cary Coutant <ccoutant@google.com>
1673
1674 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1675 global symbol map.
1676 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1677 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1678 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1679 relocations.
1680 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1681 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1682 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1683 * incremental.h
1684 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1685 function.
1686 (Incremental_binary::apply_incremental_relocs): New function.
1687 (Incremental_binary::do_apply_incremental_relocs): New function.
1688 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1689 data member.
1690 (Sized_incremental_binary::add_global_symbol): New function.
1691 (Sized_incremental_binary::global_symbol): New function.
1692 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1693 (Sized_incremental_binary::symbol_map_): New data member.
1694 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1695 * target.h (Sized_target::apply_relocation): New function.
1696 * target-reloc.h (apply_relocation): New function.
1697 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1698
1699 2011-04-22 Doug Kwan <dougkwan@google.com>
1700
1701 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1702 flag of a SHT_ARM_EXIDX section.
1703 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1704 * testsuite/Makefile.in: Regenerate.
1705 * testsuite/arm_exidx_test.s: New file.
1706 * testsuite/arm_exidx_test.sh: Same.
1707
1708 2011-04-20 Cary Coutant <ccoutant@google.com>
1709
1710 PR gold/12689
1711 * archive.h (Incremental_archive_entry::Archive_member):
1712 Initialize arg_serial_ (second constructor).
1713
1714 2011-04-17 Ian Lance Taylor <iant@google.com>
1715
1716 * object.cc (Relocate_info::location): Simplify location string.
1717 * errors.cc (Errors::error_at_location): Don't print program
1718 name.
1719 (Errors::warning_at_location): Likewise.
1720 (Errors::undefined_symbol): Likewise.
1721 * testsuite/debug_msg.sh: Update accordingly.
1722
1723 2011-04-14 Cary Coutant <ccoutant@google.com>
1724
1725 * gold/layout.cc (Layout::symtab_section_offset): New function.
1726 * gold/layout.h (Layout::symtab_section_offset): New function.
1727 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1728
1729 2011-04-12 Ian Lance Taylor <iant@google.com>
1730
1731 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1732 with MREMAP_MAYMOVE.
1733 * output.h (class Output_file): Add map_is_allocated_ field.
1734 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1735 not available, provide stubs. If mremap is not available, #define
1736 it to gold_mremap.
1737 (MREMAP_MAYMOVE): Define if not defined.
1738 (Output_file::Output_file): Initialize map_is_allocated_.
1739 (Output_file::resize): Check map_is_allocated_.
1740 (Output_file::map_anonymous): If mmap fails, use malloc.
1741 (Output_file::unmap): Don't do anything for an anonymous map.
1742 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1743 is not available, provide stubs.
1744 (File_read::View::~View): Use free rather than delete[].
1745 (File_read::make_view): Use malloc rather than new[]. If mmap
1746 fails, use malloc.
1747 (File_read::find_or_make_view): Use malloc rather than new[].
1748 * gold.h: Remove HAVE_REMAP code.
1749 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1750 exists. Rename mremap to gold_mremap. If mmap is not available
1751 don't do anything.
1752 * configure, config.in: Rebuild.
1753
1754 2011-04-11 Ian Lance Taylor <iant@google.com>
1755
1756 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1757 initialize local variable v.
1758
1759 2011-04-11 Cary Coutant <ccoutant@google.com>
1760
1761 * archive.cc (Archive::include_member): Adjust call to
1762 report_object.
1763 (Add_archive_symbols::run): Track argument serial numbers.
1764 (Lib_group::include_member): Likewise.
1765 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1766 * archive.h (Incremental_archive_entry::Archive_member):
1767 Initialize arg_serial_.
1768 (Archive_member::arg_serial_): New data member.
1769 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1770 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1771 incremental link.
1772 (Sized_dynobj::do_for_all_local_got_entries): New function.
1773 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1774 function.
1775 * fileread.cc (get_mtime): New function.
1776 * fileread.h (get_mtime): New function.
1777 * gold.cc (queue_initial_tasks): Check for incremental update.
1778 (process_incremental_input): New function.
1779 (queue_middle_tasks): Don't force valid target for incremental
1780 update.
1781 * incremental-dump.cc (find_input_containing_global): Adjust
1782 size of symbol info entry.
1783 (dump_incremental_inputs): Dump argument serial number and
1784 in_system_directory flag; bias shndx by 1; print symbol names
1785 when dumping per-file symbol lists; use new symbol info readers.
1786 * incremental.cc
1787 (Output_section_incremental_inputs:update_data_size): New function.
1788 (Sized_incremental_binary::setup_readers): Setup input readers
1789 for each input file; build maps for files added from libraries
1790 and scripts.
1791 (Sized_incremental_binary::check_input_args): New function.
1792 (Sized_incremental_binary::do_check_inputs): Build map of argument
1793 serial numbers to input arguments.
1794 (Sized_incremental_binary::do_file_has_changed): Rename
1795 do_file_is_unchanged to this; compare file modification times.
1796 (Sized_incremental_binary::do_init_layout): New function.
1797 (Sized_incremental_binary::do_reserve_layout): New function.
1798 (Sized_incremental_binary::do_get_input_reader): Remove.
1799 (Sized_incremental_binary::get_symtab_view): New function.
1800 (Incremental_checker::can_incrementally_link_output_file): Remove.
1801 (Incremental_inputs::report_command_line): Exclude --debug options.
1802 (Incremental_inputs::report_archive_begin): Add parameter; track
1803 argument serial numbers; don't put input file entry for archive
1804 before archive members.
1805 (Incremental_inputs::report_archive_end): Put input file entry
1806 for archive after archive members.
1807 (Incremental_inputs::report_object): Add parameter; track argument
1808 serial numbers and in_system_directory flag.
1809 (Incremental_inputs::report_script): Add parameter; track argument
1810 serial numbers.
1811 (Output_section_incremental_inputs::set_final_data_size): Adjust
1812 size of symbol info entry; check for forwarding symbols.
1813 (Output_section_incremental_inputs::write_input_files): Write
1814 in_system_directory flag and argument serial number.
1815 (Output_section_incremental_inputs::write_info_blocks): Map section
1816 indices between incremental info and original input file; store
1817 input section index for each symbol.
1818 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1819 change operator() to visit().
1820 (class Global_got_offset_visitor): Likewise.
1821 (class Global_symbol_visitor_got_plt):
1822 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1823 classes.
1824 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1825 (Sized_incr_relobj::do_read_symbols): New function.
1826 (Sized_incr_relobj::do_layout): New function.
1827 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1828 (Sized_incr_relobj::do_add_symbols): New function.
1829 (Sized_incr_relobj::do_should_include_member): New function.
1830 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1831 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1832 (Sized_incr_relobj::do_section_size): New function.
1833 (Sized_incr_relobj::do_section_name): New function.
1834 (Sized_incr_relobj::do_section_contents): New function.
1835 (Sized_incr_relobj::do_section_flags): New function.
1836 (Sized_incr_relobj::do_section_entsize): New function.
1837 (Sized_incr_relobj::do_section_address): New function.
1838 (Sized_incr_relobj::do_section_type): New function.
1839 (Sized_incr_relobj::do_section_link): New function.
1840 (Sized_incr_relobj::do_section_info): New function.
1841 (Sized_incr_relobj::do_section_addralign): New function.
1842 (Sized_incr_relobj::do_initialize_xindex): New function.
1843 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1844 (Sized_incr_relobj::do_read_relocs): New function.
1845 (Sized_incr_relobj::do_gc_process_relocs): New function.
1846 (Sized_incr_relobj::do_scan_relocs): New function.
1847 (Sized_incr_relobj::do_count_local_symbols): New function.
1848 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1849 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1850 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1851 (Sized_incr_relobj::do_relocate): New function.
1852 (Sized_incr_relobj::do_set_section_offset): New function.
1853 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1854 (Sized_incr_dynobj::do_read_symbols): New function.
1855 (Sized_incr_dynobj::do_layout): New function.
1856 (Sized_incr_dynobj::do_add_symbols): New function.
1857 (Sized_incr_dynobj::do_should_include_member): New function.
1858 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1859 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1860 (Sized_incr_dynobj::do_section_size): New function.
1861 (Sized_incr_dynobj::do_section_name): New function.
1862 (Sized_incr_dynobj::do_section_contents): New function.
1863 (Sized_incr_dynobj::do_section_flags): New function.
1864 (Sized_incr_dynobj::do_section_entsize): New function.
1865 (Sized_incr_dynobj::do_section_address): New function.
1866 (Sized_incr_dynobj::do_section_type): New function.
1867 (Sized_incr_dynobj::do_section_link): New function.
1868 (Sized_incr_dynobj::do_section_info): New function.
1869 (Sized_incr_dynobj::do_section_addralign): New function.
1870 (Sized_incr_dynobj::do_initialize_xindex): New function.
1871 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1872 (make_sized_incremental_object): New function.
1873 (Incremental_library::copy_unused_symbols): New function.
1874 (Incremental_library::do_for_all_unused_symbols): New function.
1875 * incremental.h (enum Incremental_input_flags): New type.
1876 (class Incremental_checker): Remove.
1877 (Incremental_input_entry::Incremental_input_entry): Add argument
1878 serial number.
1879 (Incremental_input_entry::arg_serial): New function.
1880 (Incremental_input_entry::set_is_in_system_directory): New function.
1881 (Incremental_input_entry::is_in_system_directory): New function.
1882 (Incremental_input_entry::arg_serial_): New data member.
1883 (Incremental_input_entry::is_in_system_directory_): New data member.
1884 (class Script_info): Move here from script.h.
1885 (Script_info::Script_info): Add filename parameter.
1886 (Script_info::filename): New function.
1887 (Script_info::filename_): New data member.
1888 (Incremental_script_entry::Incremental_script_entry): Add argument
1889 serial number.
1890 (Incremental_object_entry::Incremental_object_entry): Likewise.
1891 (Incremental_object_entry::add_input_section): Build list of input
1892 sections with map to original shndx.
1893 (Incremental_object_entry::get_input_section_index): New function.
1894 (Incremental_object_entry::shndx_): New data member.
1895 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1896 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1897 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1898 serial number.
1899 (Incremental_inputs::report_archive_begin): Likewise.
1900 (Incremental_inputs::report_object): Likewise.
1901 (Incremental_inputs::report_script): Likewise.
1902 (class Incremental_global_symbol_reader): New class.
1903 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1904 and store flags and input file type.
1905 (Incremental_input_entry_reader::arg_serial): New function.
1906 (Incremental_input_entry_reader::type): Extract type from flags.
1907 (Incremental_input_entry_reader::is_in_system_directory): New function.
1908 (Incremental_input_entry_reader::get_input_section_count): Call
1909 accessor function for type.
1910 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1911 function for type; adjust size of global symbol entry.
1912 (Incremental_input_entry_reader::get_global_symbol_count): Call
1913 accessor function for type.
1914 (Incremental_input_entry_reader::get_object_count): Likewise.
1915 (Incremental_input_entry_reader::get_object_offset): Likewise.
1916 (Incremental_input_entry_reader::get_member_count): Likewise.
1917 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1918 (Incremental_input_entry_reader::get_member_offset): Likewise.
1919 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1920 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1921 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1922 (Incremental_input_entry_reader::get_global_symbol_reader): New
1923 function.
1924 (Incremental_input_entry_reader::get_output_symbol_index): New
1925 function.
1926 (Incremental_input_entry_reader::type_): Remove.
1927 (Incremental_input_entry_reader::flags_): New data member.
1928 (Incremental_inputs_reader::input_file_offset): New function.
1929 (Incremental_inputs_reader::input_file_index): New function.
1930 (Incremental_inputs_reader::input_file): Call input_file_offset.
1931 (Incremental_inputs_reader::input_file_at_offset): New function.
1932 (Incremental_relocs_reader::get_r_type): Reformat.
1933 (Incremental_relocs_reader::get_r_shndx): Reformat.
1934 (Incremental_relocs_reader::get_r_offset): Reformat.
1935 (Incremental_relocs_reader::data): New function.
1936 (Incremental_binary::Incremental_binary): Initialize new data members.
1937 (Incremental_binary::check_inputs): Add cmdline parameter.
1938 (Incremental_binary::file_is_unchanged): Remove.
1939 (Input_reader::arg_serial): New function.
1940 (Input_reader::get_unused_symbol_count): New function.
1941 (Input_reader::get_unused_symbol): New function.
1942 (Input_reader::do_arg_serial): New function.
1943 (Input_reader::do_get_unused_symbol_count): New function.
1944 (Input_reader::do_get_unused_symbol): New function.
1945 (Incremental_binary::input_file_count): New function.
1946 (Incremental_binary::get_input_reader): Change signature to use
1947 index instead of filename.
1948 (Incremental_binary::file_has_changed): New function.
1949 (Incremental_binary::get_input_argument): New function.
1950 (Incremental_binary::get_library): New function.
1951 (Incremental_binary::get_script_info): New function.
1952 (Incremental_binary::init_layout): New function.
1953 (Incremental_binary::reserve_layout): New function.
1954 (Incremental_binary::output_file): New function.
1955 (Incremental_binary::do_check_inputs): New function.
1956 (Incremental_binary::do_file_is_unchanged): Remove.
1957 (Incremental_binary::do_file_has_changed): New function.
1958 (Incremental_binary::do_init_layout): New function.
1959 (Incremental_binary::do_reserve_layout): New function.
1960 (Incremental_binary::do_input_file_count): New function.
1961 (Incremental_binary::do_get_input_reader): Change signature.
1962 (Incremental_binary::input_args_map_): New data member.
1963 (Incremental_binary::library_map_): New data member.
1964 (Incremental_binary::script_map_): New data member.
1965 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1966 new data members.
1967 (Sized_incremental_binary::output_section): New function.
1968 (Sized_incremental_binary::inputs_reader): Add const.
1969 (Sized_incremental_binary::symtab_reader): Add const.
1970 (Sized_incremental_binary::relocs_reader): Add const.
1971 (Sized_incremental_binary::got_plt_reader): Add const.
1972 (Sized_incremental_binary::get_symtab_view): New function.
1973 (Sized_incremental_binary::Inputs_reader): New typedef.
1974 (Sized_incremental_binary::Input_entry_reader): New typedef.
1975 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1976 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1977 (Sized_incremental_binary::do_file_has_changed): New function.
1978 (Sized_incremental_binary::do_init_layout): New function.
1979 (Sized_incremental_binary::do_reserve_layout): New function.
1980 (Sized_input_reader::Inputs_reader): Remove.
1981 (Sized_input_reader::Input_entry_reader): Remove.
1982 (Sized_input_reader::do_arg_serial): New function.
1983 (Sized_input_reader::do_get_unused_symbol_count): New function.
1984 (Sized_input_reader::do_get_unused_symbol): New function.
1985 (Sized_incremental_binary::do_input_file_count): New function.
1986 (Sized_incremental_binary::do_get_input_reader): Change signature;
1987 use index instead of filename.
1988 (Sized_incremental_binary::section_map_): New data member.
1989 (Sized_incremental_binary::input_entry_readers_): New data member.
1990 (class Sized_incr_relobj): New class.
1991 (class Sized_incr_dynobj): New class.
1992 (make_sized_incremental_object): New function.
1993 (class Incremental_library): New class.
1994 * layout.cc (Free_list::num_lists): New static data member.
1995 (Free_list::num_nodes): New static data member.
1996 (Free_list::num_removes): New static data member.
1997 (Free_list::num_remove_visits): New static data member.
1998 (Free_list::num_allocates): New static data member.
1999 (Free_list::num_allocate_visits): New static data member.
2000 (Free_list::init): New function.
2001 (Free_list::remove): New function.
2002 (Free_list::allocate): New function.
2003 (Free_list::dump): New function.
2004 (Free_list::print_stats): New function.
2005 (Layout_task_runner::run): Resize output file for incremental updates.
2006 (Layout::Layout): Initialize new data members.
2007 (Layout::set_incremental_base): New function.
2008 (Layout::init_fixed_output_section): New function.
2009 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2010 incremental updates.
2011 (Layout::create_gold_note): Do not create gold note section for
2012 incremental updates.
2013 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2014 for incremental updates.
2015 (Layout::set_section_offsets): For incremental updates, allocate space
2016 from free list.
2017 (Layout::create_symtab_sections): Layout with offsets relative to
2018 start of section; for incremental updates, allocate space from free
2019 list.
2020 (Layout::create_shdrs): For incremental updates, allocate space from
2021 free list.
2022 (Layout::finish_dynamic_section): For incremental updates, do not
2023 check --as-needed (fixed in subsequent patch).
2024 * layout.h (class Free_list): New class.
2025 (Layout::set_incremental_base): New function.
2026 (Layout::incremental_base): New function.
2027 (Layout::init_fixed_output_section): New function.
2028 (Layout::allocate): New function.
2029 (Layout::incremental_base_): New data member.
2030 (Layout::free_list_): New data member.
2031 * main.cc (main): Print Free_list statistics.
2032 * object.cc (Relobj::finalize_incremental_relocs): Add
2033 clear_counts parameter; clear counts only when clear_counts is set.
2034 (Sized_relobj::Sized_relobj): Initialize new base class.
2035 (Sized_relobj::do_layout): Don't report special sections.
2036 (Sized_relobj::do_for_all_local_got_entries): New function.
2037 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2038 symtab_off to all symbol table offsets.
2039 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2040 * object.h (class Got_offset_list): Move to top of file.
2041 (Object::Object): Allow case where input_file == NULL.
2042 (Object::~Object): Likewise.
2043 (Object::input_file): Assert that input_file != NULL.
2044 (Object::lock): Allow case where input_file == NULL.
2045 (Object::unlock): Likewise.
2046 (Object::is_locked): Likewise.
2047 (Object::token): Likewise.
2048 (Object::release): Likewise.
2049 (Object::is_incremental): New function.
2050 (Object::get_mtime): New function.
2051 (Object::for_all_local_got_entries): New function.
2052 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2053 (Object::set_is_in_system_directory): New function.
2054 (Object::is_in_system_directory): New function.
2055 (Object::do_is_incremental): New function.
2056 (Object::do_get_mtime): New function.
2057 (Object::do_for_all_local_got_entries): New function.
2058 (Object::is_in_system_directory_): New data member.
2059 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2060 (class Sized_relobj_base): New class.
2061 (class Sized_relobj): Derive from Sized_relobj_base.
2062 (class Sized_relobj::Symbols): Redeclare from base class.
2063 (class Sized_relobj::local_got_offset_list): Remove.
2064 (class Sized_relobj::Output_sections): Redeclare from base class.
2065 (class Sized_relobj::do_for_all_local_got_entries): New function.
2066 (class Sized_relobj::write_local_symbols): Add offset parameter.
2067 (class Sized_relobj::local_symbol_offset_): Update comment.
2068 (class Sized_relobj::local_dynsym_offset_): Update comment.
2069 * options.cc (Input_arguments::add_file): Remove const.
2070 * options.h (Input_file_argument::Input_file_argument):
2071 Initialize arg_serial_ (all constructors).
2072 (Input_file_argument::set_arg_serial): New function.
2073 (Input_file_argument::arg_serial): New function.
2074 (Input_file_argument::arg_serial_): New data member.
2075 (Input_arguments::Input_arguments): Initialize file_count_.
2076 (Input_arguments::add_file): Remove const.
2077 (Input_arguments::number_of_input_files): New function.
2078 (Input_arguments::file_count_): New data member.
2079 (Command_line::number_of_input_files): Call
2080 Input_arguments::number_of_input_files.
2081 * output.cc (Output_segment_headers::Output_segment_headers):
2082 Set current size.
2083 (Output_section::Input_section::current_data_size): New function.
2084 (Output_section::Output_section): Initialize new data members.
2085 (Output_section::add_input_section): Don't do merge sections for
2086 an incremental link; allocate space from free list for an
2087 incremental update.
2088 (Output_section::add_output_section_data): Allocate space from
2089 free list for an incremental update.
2090 (Output_section::update_data_size): New function.
2091 (Output_section::set_fixed_layout): New function.
2092 (Output_section::reserve): New function.
2093 (Output_segment::set_section_addresses): Remove const.
2094 (Output_segment::set_section_list_addresses): Remove const; allocate
2095 space from free list for an incremental update.
2096 (Output_segment::set_offset): Adjust size of RELRO segment for an
2097 incremental update.
2098 * output.h (Output_data::current_data_size): Move here from
2099 child classes.
2100 (Output_data::pre_finalize_data_size): New function.
2101 (Output_data::update_data_size): New function.
2102 (Output_section_headers::update_data_size): new function.
2103 (Output_section_data_build::current_data_size): Move to Output_data.
2104 (Output_data_strtab::update_data_size): New function.
2105 (Output_section::current_data_size): Move to Output_data.
2106 (Output_section::set_fixed_layout): New function.
2107 (Output_section::has_fixed_layout): New function.
2108 (Output_section::reserve): New function.
2109 (Output_section::update_data_size): New function.
2110 (Output_section::has_fixed_layout_): New data member.
2111 (Output_section::free_list_): New data member.
2112 (Output_segment::set_section_addresses): Remove const.
2113 (Output_segment::set_section_list_addresses): Remove const.
2114 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2115 New function.
2116 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2117 New function.
2118 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2119 parameter when calling Add_symbols constructor; store argument
2120 serial number for members of a lib group.
2121 (Add_symbols::locks): Allow case where token == NULL.
2122 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2123 (Read_member::~Read_member): New function.
2124 (Read_member::is_runnable): New function.
2125 (Read_member::locks): New function.
2126 (Read_member::run): New function.
2127 (Check_script::~Check_script): New function.
2128 (Check_script::is_runnable): New function.
2129 (Check_script::locks): New function.
2130 (Check_script::run): New function.
2131 (Check_library::~Check_library): New function.
2132 (Check_library::is_runnable): New function.
2133 (Check_library::locks): New function.
2134 (Check_library::run): New function.
2135 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2136 (Add_symbols::library_): New data member.
2137 (class Read_member): New class.
2138 (class Check_script): New class.
2139 (class Check_library): New class.
2140 * reloc.cc (Read_relocs::is_runnable): Allow case where
2141 token == NULL.
2142 (Read_relocs::locks): Likewise.
2143 (Scan_relocs::locks): Likewise.
2144 (Relocate_task::locks): Likewise.
2145 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2146 to clear counters.
2147 (Sized_relobj::incremental_relocs_scan): Fix comment.
2148 (Sized_relobj::do_relocate): Pass output file offset to
2149 write_local_symbols.
2150 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2151 from class declaration.
2152 * script.cc (read_input_script): Allocate Script_info; pass
2153 argument serial number to report_script.
2154 * script.h (class Script_info): Move to incremental.h.
2155 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2156 * symtab.h (Symbol_table::add_from_incrobj): New function.
2157 (Symbol_table::set_file_offset): New function.
2158
2159 2011-04-05 Cary Coutant <ccoutant@google.com>
2160
2161 * incremental-dump.cc (dump_incremental_inputs): Change signature
2162 to take a Sized_incremental_binary; change caller. Use readers
2163 in Sized_incremental_binary.
2164 * incremental.cc
2165 (Sized_incremental_binary::find_incremental_inputs_sections):
2166 Rename do_find_incremental_inputs_sections to this.
2167 (Sized_incremental_binary::setup_readers): New function.
2168 (Sized_incremental_binary::do_check_inputs): Check
2169 has_incremental_info_ flag; move setup code to setup_readers;
2170 use input readers.
2171 (Sized_incremental_binary::do_file_is_unchanged): New function.
2172 (Sized_incremental_binary::do_get_input_reader): New function.
2173 * incremental.h (class Incremental_binary): Move to end of file.
2174 (Incremental_binary::file_is_unchanged): New function.
2175 (Incremental_binary::do_file_is_unchanged): New function.
2176 (Incremental_binary::Input_reader): New class.
2177 (Incremental_binary::get_input_reader): New function.
2178 (class Sized_incremental_binary): Move to end of file.
2179 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2180 input section reader classes.
2181 (Sized_incremental_binary::has_incremental_info): New function.
2182 (Sized_incremental_binary::inputs_reader): New function.
2183 (Sized_incremental_binary::symtab_reader): New function.
2184 (Sized_incremental_binary::relocs_reader): New function.
2185 (Sized_incremental_binary::got_plt_reader): New function.
2186 (Sized_incremental_binary::do_file_is_unchanged): New function.
2187 (Sized_incremental_binary::Sized_input_reader): New class.
2188 (Sized_incremental_binary::get_input_reader): New function.
2189 (Sized_incremental_binary::find_incremental_inputs_sections):
2190 Rename do_find_incremental_inputs_sections to this.
2191 (Sized_incremental_binary::setup_readers): New function.
2192 (Sized_incremental_binary::has_incremental_info_): New data member.
2193 (Sized_incremental_binary::inputs_reader_): New data member.
2194 (Sized_incremental_binary::symtab_reader_): New data member.
2195 (Sized_incremental_binary::relocs_reader_): New data member.
2196 (Sized_incremental_binary::got_plt_reader_): New data member.
2197 (Sized_incremental_binary::current_input_file_): New data member.
2198
2199 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2200
2201 PR gold/12640
2202 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2203 violation.
2204
2205 2011-03-30 Cary Coutant <ccoutant@google.com>
2206
2207 * archive.cc (Archive::include_member): Adjust call to report_object.
2208 (Add_archive_symbols::run): Add script_info to call to
2209 report_archive_begin.
2210 (Lib_group::include_member): Adjust call to report_object.
2211 (Add_lib_group_symbols::run): Adjust call to report_object.
2212 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2213 blocks. Add object count for script input files.
2214 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2215 script_info parameter; change all callers.
2216 (Incremental_inputs::report_object): Add script_info parameter;
2217 change all callers.
2218 (Incremental_inputs::report_script): Store backpointer to
2219 incremental info entry.
2220 (Output_section_incremental_inputs::set_final_data_size): Record
2221 additional information for scripts.
2222 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2223 * incremental.h (Incremental_script_entry::add_object): New function.
2224 (Incremental_script_entry::get_object_count): New function.
2225 (Incremental_script_entry::get_object): New function.
2226 (Incremental_script_entry::objects_): New data member; adjust
2227 constructor.
2228 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2229 (Incremental_inputs::report_object): Add script_info parameter.
2230 (Incremental_inputs_reader::get_object_count): New function.
2231 (Incremental_inputs_reader::get_object_offset): New function.
2232 * options.cc (Input_arguments::add_file): Return reference to
2233 new input argument.
2234 * options.h (Input_argument::set_script_info): New function.
2235 (Input_argument::script_info): New function.
2236 (Input_argument::script_info_): New data member; adjust all
2237 constructors.
2238 (Input_file_group::add_file): Return reference to new input argument.
2239 (Input_file_lib::add_file): Likewise.
2240 (Input_arguments::add_file): Likewise.
2241 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2242 * script.cc (Parser_closure::Parser_closure): Add script_info
2243 parameter; adjust all callers.
2244 (Parser_closure::script_info): New function.
2245 (Parser_closure::script_info_): New data member.
2246 (read_input_script): Report scripts earlier to incremental info.
2247 (script_add_file): Set script_info in Input_argument.
2248 (script_add_library): Likewise.
2249 * script.h (Script_options::Script_info): Rewrite class.
2250
2251 2011-03-29 Cary Coutant <ccoutant@google.com>
2252
2253 * archive.cc (Library_base::should_include_member): Move
2254 method here from class Archive.
2255 (Archive::Archive): Initialize base class.
2256 (Archive::should_include_member): Move to base class.
2257 (Archive::do_for_all_unused_symbols): New function.
2258 (Add_archive_symbols::run): Remove redundant access to
2259 incremental_inputs.
2260 (Lib_group::Lib_group): Initialize base class.
2261 (Lib_group::do_filename): New function.
2262 (Lib_group::include_member): Pass pointer to Lib_group to
2263 report_object.
2264 (Lib_group::do_for_all_unused_symbols): New function.
2265 (Add_lib_group_symbols::run): Report archive information for
2266 incremental links.
2267 * archive.h (class Library_base): New base class.
2268 (class Archive): Derive from Library_base.
2269 (Archive::filename): Move to base class.
2270 (Archive::set_incremental_info): Likewise.
2271 (Archive::incremental_info): Likewise.
2272 (Archive::Should_include): Likewise.
2273 (Archive::should_include_member): Likewise.
2274 (Archive::Armap_entry): Remove.
2275 (Archive::Unused_symbol_iterator): Remove.
2276 (Archive::unused_symbols_begin): Remove.
2277 (Archive::unused_symbols_end): Remove.
2278 (Archive::do_filename): New function.
2279 (Archive::do_get_mtime): New function.
2280 (Archive::do_for_all_unused_symbols): New function.
2281 (Archive::task_): Move to base class.
2282 (Archive::incremental_info_): Likewise.
2283 (class Lib_group): Derive from Library_base.
2284 (Lib_group::do_filename): New function.
2285 (Lib_group::do_get_mtime): New function.
2286 (Lib_group::do_for_all_unused_symbols): New function.
2287 (Lib_group::task_): Move to base class.
2288 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2289 function.
2290 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2291 function.
2292 * incremental.cc (Incremental_inputs::report_archive_begin):
2293 Use Library_base; call library's get_mtime; add incremental inputs
2294 entry before members.
2295 (class Unused_symbol_visitor): New class.
2296 (Incremental_inputs::report_archive_end): Use Library_base; use
2297 visitor class to record unused symbols; don't add incremental inputs
2298 entry after members.
2299 (Incremental_inputs::report_object): Use Library_base.
2300 * incremental.h
2301 (Incremental_archive_entry::Incremental_archive_entry): Remove
2302 unused Archive parameter.
2303 (Incremental_inputs::report_archive_begin): Use Library_base.
2304 (Incremental_inputs::report_archive_end): Likewise.
2305 (Incremental_inputs::report_object): Likewise.
2306 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2307 function.
2308 * object.h (Object::for_all_global_symbols): New function.
2309 (Object::do_for_all_global_symbols): New function.
2310 (Sized_relobj::do_for_all_global_symbols): New function.
2311 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2312 function.
2313 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2314 function.
2315
2316 2011-03-27 Ian Lance Taylor <iant@google.com>
2317
2318 * archive.cc (Archive::interpret_header): Return -1 if something
2319 goes wrong. Change callers accordingly.
2320
2321 2011-03-25 Cary Coutant <ccoutant@google.com>
2322
2323 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2324 * testsuite/Makefile.in: Regenerate.
2325
2326 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
2327
2328 * plugin.cc (get_view): New.
2329 (Plugin::load): Pass get_view to the plugin.
2330 (Plugin_manager::get_view): New.
2331
2332 2011-03-21 Ian Lance Taylor <iant@google.com>
2333
2334 * testsuite/final_layout.sh: Rewrite to not use dc.
2335 * testsuite/relro_test.sh: Fail if dc is not present.
2336
2337 2011-03-21 Sriraman Tallam <tmsriram@google.com>
2338
2339 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2340 Change == to -eq.
2341 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2342 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2343 Change == to -eq.
2344 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2345 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2346
2347 2011-03-14 Ian Lance Taylor <iant@google.com>
2348
2349 * script-sections.cc (Sort_output_sections::script_compare):
2350 Rename from is_before, change return type.
2351 (Sort_output_sections::operator()): Adjust accordingly.
2352
2353 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2354
2355 PR gold/12572
2356 * testsuite/odr_violation2.cc: Add comment to make all error line
2357 numbers double digits.
2358 * testsuite/debug_msg.sh: Adjust expected errors.
2359
2360 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2361
2362 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2363 but mark earlier ones as non-canonical
2364 (offset_to_iterator): Update search target and example
2365 (do_addr2line): Return extra lines in a vector*
2366 (format_file_lineno): Extract from do_addr2line
2367 (one_addr2line): Add vector* out-param
2368 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2369 when a lineno entry appeared last for its instruction
2370 (Dwarf_line_info): Add vector* out-param
2371 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2372 * symtab.cc (Odr_violation_compare): Include the lineno in the
2373 comparison again.
2374 (linenos_from_loc): New. Combine the canonical line for an
2375 address with its other lines.
2376 (True_if_intersect): New. Helper functor to make
2377 std::set_intersection a query.
2378 (detect_odr_violations): Compare sets of lines instead of just
2379 one line for each function. This became less deterministic, but
2380 has fewer false positives.
2381 * symtab.h: Declarations.
2382 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2383 mix an optimized and non-optimized object in the same binary
2384 (odr_violation2.so): Same.
2385 * testsuite/Makefile.in: Regenerate from Makefile.am.
2386 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2387 * testsuite/debug_msg.sh: Update line numbers and add
2388 assertions.
2389 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2390 non-optimized context.
2391 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2392 isn't inlined, and use OdrDerived in an optimized context.
2393 * testsuite/odr_header1.h: Defines OdrDerived, where
2394 optimization will change the
2395 first-instruction-in-the-destructor's file and line number.
2396 * testsuite/odr_header2.h: Defines OdrBase.
2397
2398 2011-03-09 Ian Lance Taylor <iant@google.com>
2399
2400 * fileread.cc (File_read::clear_views): Don't delete the whole
2401 file view.
2402
2403 2011-03-08 Ian Lance Taylor <iant@google.com>
2404
2405 PR gold/12525
2406 * fileread.cc: #include <climits>.
2407 (GOLD_IOV_MAX): Define.
2408 (File_read::read_multiple): Limit number of entries by iov_max.
2409 * fileread.h (class File_read): Always set max_readv_entries to
2410 128.
2411
2412 2011-03-07 Ian Lance Taylor <iant@google.com>
2413
2414 PR gold/12525
2415 * options.h (class General_options): Add -dy and -dn.
2416
2417 2011-03-02 Cary Coutant <ccoutant@google.com>
2418
2419 * testsuite/script_test_9.t: Add TLS segment.
2420
2421 2011-03-02 Simon Baldwin <simonb@google.com>
2422
2423 * configure.ac: Add check for gnu_indirect_function support in
2424 the toolchain building binutils.
2425 * configure: Rebuild.
2426
2427 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
2428
2429 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2430 plugin only symbols.
2431 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2432 in plugin files as not needed in the symbol table.
2433
2434 2011-02-11 Sriraman Tallam <tmsriram@google.com>
2435
2436 * output.cc (Output_section::add_input_section): Delay fill
2437 generation for section ordering.
2438
2439 2011-02-09 Ian Lance Taylor <iant@google.com>
2440
2441 PR gold/12316
2442 * object.h (class Sized_relobj): Remove clear_local_symbols.
2443 * reloc.cc (Sized_relobj::do_relocate): Don't call
2444 clear_local_symbols.
2445
2446 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
2447
2448 * plugin.cc (is_visible_from_outside): Return true for symbols
2449 in the -u option.
2450
2451 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2452
2453 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2454 filename.
2455
2456 2011-02-02 Sriraman Tallam <tmsriram@google.com>
2457
2458 * icf.h (is_section_foldable_candidate): Change type of parameter
2459 to std::string.
2460 * icf.cc (Icf::find_identical_sections): Change type of local variable
2461 section_name to be std::string.
2462 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2463
2464 2011-01-25 Ian Lance Taylor <iant@google.com>
2465
2466 * script.cc (script_add_extern): Rewrite to use
2467 add_symbol_reference.
2468
2469 2011-01-25 Doug Kwan <dougkwan@google.com>
2470
2471 * icf.cc (get_section_contents): Always lock section's object.
2472
2473 2011-01-24 Ian Lance Taylor <iant@google.com>
2474
2475 * options.h (class General_options): Accept
2476 --no-detect-odr-violations.
2477
2478 2011-01-24 Ian Lance Taylor <iant@google.com>
2479
2480 * version.cc (version_string): Bump to 1.11.
2481
2482 2011-01-24 Ian Lance Taylor <iant@google.com>
2483
2484 * plugin.cc (class Plugin_rescan): Define new class.
2485 (Plugin_manager::claim_file): Set any_claimed_.
2486 (Plugin_manager::save_archive): New function.
2487 (Plugin_manager::save_input_group): New function.
2488 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2489 necessary.
2490 (Plugin_manager::new_undefined_symbol): New function.
2491 (Plugin_manager::rescan): New function.
2492 (Plugin_manager::rescannable_defines): New function.
2493 (Plugin_manager::add_input_file): Set any_added_.
2494 * plugin.h (class Plugin_manager): define new fields rescannable_,
2495 undefined_symbols_, any_claimed_, and any_added_. Declare
2496 Plugin_rescan as friend. Declare new functions.
2497 (Plugin_manager::Rescannable): Define type.
2498 (Plugin_manager::Rescannable_list): Define type.
2499 (Plugin_manager::Undefined_symbol_list): Define type.
2500 (Plugin_manager::Plugin_manager): Initialize new fields.
2501 * archive.cc (Archive::defines_symbol): New function.
2502 (Add_archive_symbols::run): Pass archive to plugins if any.
2503 * archive.h (class Archive): Declare defines_symbol.
2504 * readsyms.cc (Input_group::~Input_group): New function.
2505 (Finish_group::run): Pass input_group to plugins if any.
2506 * readsyms.h (class Input_group): Declare destructor.
2507 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2508 any.
2509
2510 2011-01-10 Ian Lance Taylor <iant@google.com>
2511
2512 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2513 section as relro.
2514 (Layout::set_segment_offsets): Reset increase_relro before calling
2515 set_section_addresses a second time.
2516
2517 2011-01-04 Cary Coutant <ccoutant@google.com>
2518
2519 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2520 sections before NOBITS sections.
2521
2522 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2523
2524 * version.cc (print_version): Update copyright to 2011.
2525
2526 2010-12-23 Cary Coutant <ccoutant@google.com>
2527
2528 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2529 of OS to this->add. Add OD parameter to second form of the function.
2530
2531 2010-12-20 Ian Lance Taylor <iant@google.com>
2532
2533 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2534 second of two consecutive entries with same offset.
2535
2536 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2537
2538 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2539 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2540 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2541 to avoid unneeded links against $(LDADD).
2542 * testsuite/Makefile.in: Regenerate.
2543
2544 2010-12-15 Ian Lance Taylor <iant@google.com>
2545
2546 PR gold/12324
2547 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2548 for R_X86_64_32 and R_X86_64_PC32.
2549 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2550 ver_matching_def_pic.o.
2551 (ver_matching_def_pic.o): New target.
2552
2553 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2554
2555 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2556 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2557 Move definition before File_read::View member definitions.
2558 (File_read::View::~View): Initialize and hold lock before
2559 updating current_mapped_bytes.
2560
2561 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2562
2563 * dwarf_reader.cc: Remove outdated comment.
2564 * gold-threads.cc: Fix typo in error message.
2565 * archive.cc: Fix typos in comments.
2566 * archive.h: Likewise.
2567 * arm-reloc-property.cc: Likewise.
2568 * arm-reloc-property.h: Likewise.
2569 * arm-reloc.def: Likewise.
2570 * arm.cc: Likewise.
2571 * attributes.h: Likewise.
2572 * cref.cc: Likewise.
2573 * ehframe.cc: Likewise.
2574 * fileread.h: Likewise.
2575 * gold.h: Likewise.
2576 * i386.cc: Likewise.
2577 * icf.cc: Likewise.
2578 * incremental.h: Likewise.
2579 * int_encoding.cc: Likewise.
2580 * layout.h: Likewise.
2581 * main.cc: Likewise.
2582 * merge.h: Likewise.
2583 * object.cc: Likewise.
2584 * object.h: Likewise.
2585 * options.cc: Likewise.
2586 * readsyms.cc: Likewise.
2587 * reduced_debug_output.cc: Likewise.
2588 * reloc.cc: Likewise.
2589 * script-sections.cc: Likewise.
2590 * sparc.cc: Likewise.
2591 * symtab.h: Likewise.
2592 * target-reloc.h: Likewise.
2593 * target.cc: Likewise.
2594 * target.h: Likewise.
2595 * timer.cc: Likewise.
2596 * timer.h: Likewise.
2597 * x86_64.cc: Likewise.
2598
2599 2010-12-09 Cary Coutant <ccoutant@google.com>
2600
2601 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2602 stack.
2603 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2604 parameter; change all callers.
2605 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2606 * options.h (warn_execstack): New option.
2607
2608 2010-12-07 Doug Kwan <dougkwan@google.com>
2609
2610 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2611 like function call relocations.
2612
2613 2010-12-07 Ian Lance Taylor <iant@google.com>
2614
2615 * archive.cc (Archive::get_elf_object_for_member): Permit
2616 punconfigured to be NULL.
2617 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2618 (Archive::include_member): Pass NULL to get_elf_object_for_member
2619 if we searched for the archive and this is the first included
2620 object.
2621
2622 2010-12-01 Ian Lance Taylor <iant@google.com>
2623
2624 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2625 track_relocs_type_ field.
2626 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2627 Set track_relocs_type_.
2628 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2629 contents when using RELA relocs.
2630 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2631 reloc_map_.
2632 * reloc.cc (Track_relocs::next_addend): New function.
2633 * reloc.h (class Track_relocs): Declare next_addend.
2634
2635 2010-12-01 Ian Lance Taylor <iant@google.com>
2636
2637 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2638 virtual destructor.
2639
2640 2010-12-01 Ian Lance Taylor <iant@google.com>
2641
2642 * README: Update compilers known to work and fail.
2643
2644 2010-11-23 Matthias Klose <doko@ubuntu.com>
2645
2646 * configure.in: For --enable-gold, handle value `default' instead of
2647 `both*'. Always install ld as ld.bfd, install as ld if gold is
2648 not the default.
2649 * configure: Regenerate.
2650
2651 2010-11-18 Doug Kwan <dougkwan@google.com>
2652
2653 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2654 and right_alignment to be zero. Store result alignment only if it is
2655 greater than existing alignment.
2656
2657 2010-11-16 Cary Coutant <ccoutant@google.com>
2658
2659 PR gold/12220
2660 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2661 Check for ".zdebug_line".
2662
2663 2010-11-16 Doug Kwan <dougkwan@google.com>
2664 Cary Coutant <ccoutant@google.com>
2665
2666 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2667 by reference; adjust all callers.
2668 * output.cc (Output_segment::set_section_addresses): Adjust references
2669 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2670 list is empty.
2671 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2672 end at page boundary.
2673
2674 2010-11-16 Cary Coutant <ccoutant@google.com>
2675
2676 PR gold/12220
2677 * layout.cc (Layout::choose_output_section): Transform names of
2678 compressed sections even when using a script with a SECTIONS clause.
2679 (Layout::output_section_name): Remove code to transform
2680 compressed debug section names.
2681 * output.cc (Output_section::add_input_section): Use uncompressed
2682 section size when tracking input sections.
2683
2684 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2685
2686 * symtab.h (Symbol::NON_PIC_REF): Remove.
2687 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2688 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2689 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2690 (Symbol::use_plt_offset): Take a flags argument and pass it
2691 directly to needs_dynamic_reloc. Restrict check for undefined
2692 weak symbols to function calls.
2693 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2694 (Target_arm::Scan::global): Use it.
2695 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2696 (Target_arm::Relocate::relocate): Likewise.
2697 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2698 parameter with an r_type parameter. Use get_reference_flags
2699 to get the flags.
2700 (Target_arm::Relocate::relocate): Update accordingly.
2701 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2702 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2703 (Target_i386::Scan::global): Likewise.
2704 (Target_i386::Relocate::relocate): Likewise.
2705 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2706 parameter with an r_type parameter. Use get_reference_flags
2707 to get the flags.
2708 (Target_i386::Relocate::relocate): Update accordingly.
2709 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2710 (Target_powerpc::Scan::global): Use it.
2711 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2712 (Target_powerpc::Relocate::relocate): Likewise.
2713 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2714 (Target_sparc::Scan::global): Use it.
2715 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2716 (Target_sparc::Relocate::relocate): Likewise.
2717 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2718 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2719 (Target_x86_64::Scan::global): Likewise.
2720 (Target_x86_64::Relocate::relocate): Likewise.
2721
2722 2010-11-08 Doug Kwan <dougkwan@google.com>
2723 Cary Coutant <ccoutant@google.com>
2724
2725 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2726 (Arm_exidx_merge_section::section_contents_): New data member.
2727 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2728 (Arm_input_section::~Arm_input_section): De-allocate memory.
2729 (Arm_input_section::original_contents_): New data member.
2730 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2731 in parameters instead of calling Object::section_contents without
2732 locking.
2733 (Arm_output_section::group_section): New parameter TASK. Pass it
2734 to callees that need locking objects.
2735 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2736 to lock EXIDX input sections. Fix a formatting issue. Call
2737 Arm_exidx_merged_section::build_contents to create merged section
2738 contents.
2739 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2740 to lock object of stub table owner.
2741 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2742 TEXT_SIZE to initialize data member TEXT_SIZE_.
2743 (Arm_exidx_input_section::addralign): Fix typo in comment.
2744 (Arm_exidx_input_section::text_size): New method.
2745 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2746 that require locking objects. Lock objects before scanning for stubs
2747 and updating local symbols.
2748 (Arm_input_section<big_endian>::init): Copy contents of original
2749 input section.
2750 (Arm_input_section<big_endian>::do_write): Use saved contents of
2751 original input section instead of calling Object::section_contents
2752 without locking.
2753 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2754 size without calling Object::section_size().
2755 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2756 for size. Allocate a buffer for merged EXIDX entries.
2757 (Arm_exidx_merged_section::build_contents): New method.
2758 (Arm_exidx_merged_section::do_write): Move merge section contents
2759 building code to Arm_exidx_merged_section::build_contetns. Write
2760 out contetns in buffer instead of building it on the fly.
2761 (Arm_relobj::make_exidx_input_section): Also pass text section size
2762 to Arm_exidx_input_section constructor.
2763 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2764 (Arm_dynobj::do_read_symbols): Fix memory leak.
2765 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2766 * target.h: (class Task): Add forward declaration.
2767 (Target::relax): Add new parameter TASK and pass it to
2768 Target::do_relax().
2769 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2770
2771 2010-11-05 Cary Coutant <ccoutant@google.com>
2772
2773 PR gold/10708
2774 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2775 object when reading from the file.
2776 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2777 second layout pass.
2778 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2779 when reading section contents.
2780 (get_section_contents): Likewise.
2781 (icf::find_identical_sections): Likewise.
2782 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2783 object when reading from the file.
2784 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2785 the object when doing deferred section layout.
2786
2787 2010-11-03 Nick Clifton <nickc@redhat.com>
2788
2789 PR gold/12001
2790 * script.h (class Symbol_assignment: name): New member. Returns
2791 the name of the symbol.
2792 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2793 Returns true if the given symbol name is on the list of
2794 assignments wating to be processed.
2795 * archive.cc (should_incldue_member): If the symbol is undefined,
2796 check to see if it is on the list of symbols pending assignment.
2797
2798 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2799
2800 * script-sections.cc (Script_sections::find_memory_region): Check
2801 for a NULL output section pointer.
2802
2803 2010-10-29 Doug Kwan <dougkwan@google.com>
2804
2805 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2806 Output_section::add_relaxed_input_section.
2807 * output.cc (Output_section::add_relaxed_input_section): Add new
2808 arguments LAYOUT and NAME. Set section order index.
2809 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2810 Copy section order index.
2811 * output.h (Output_section::add_relaxed_input_section): Add new
2812 arguments LAYOUT and NAME.
2813
2814 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2815
2816 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2817 NATIVE_OR_CROSS_LINKER.
2818 * testsuite/Makefile.in: Regenerate.
2819
2820 2010-10-20 Doug Kwan <dougkwan@google.com>
2821
2822 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2823 without SHF_LINK_ORDER flags.
2824 * layout.cc (Layout::choose_output_section): Do not filter
2825 SHF_LINK_ORDER flag in a relocatable link.
2826
2827 2010-10-17 Cary Coutant <ccoutant@google.com>
2828
2829 * output.h (Output_segment::set_section_addresses): Change function
2830 signature. Update all callers.
2831 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2832 sections.
2833 (Output_segment::set_section_addresses): Align after last TLS
2834 section. Add padding before last relro section instead of after.
2835
2836 2010-10-17 Doug Kwan <dougkwan@google.com>
2837
2838 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2839 GOT output section to be writable.
2840
2841 2010-10-14 Cary Coutant <ccoutant@google.com>
2842
2843 * debug.h (DEBUG_INCREMENTAL): New flag.
2844 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2845 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2846 mode.
2847 * incremental.cc (report_command_line): Ignore all forms of
2848 --incremental.
2849 * layout.cc (Layout::Layout): Check parameters for incremental link
2850 mode.
2851 * options.cc (General_options::parse_incremental): New function.
2852 (General_options::parse_no_incremental): New function.
2853 (General_options::parse_incremental_full): New function.
2854 (General_options::parse_incremental_update): New function.
2855 (General_options::incremental_mode_): New data member.
2856 (General_options::finalize): Check incremental_mode_.
2857 * options.h (General_options): Update help text for --incremental.
2858 Add --no-incremental, --incremental-full, --incremental-update.
2859 (General_options::Incremental_mode): New enum type.
2860 (General_options::incremental_mode): New function.
2861 (General_options::incremental_mode_): New data member.
2862 * parameters.cc (Parameters::incremental_mode_): New data member.
2863 (Parameters::set_options): Set incremental_mode_.
2864 (Parameters::set_incremental_full): New function.
2865 (Parameters::incremental): New function.
2866 (Parameters::incremental_update): New function.
2867 (set_parameters_incremental_full): New function.
2868 * parameters.h (Parameters::set_incremental_full): New function.
2869 (Parameters::incremental): New function.
2870 (Parameters::incremental_update): New function.
2871 (Parameters::incremental_mode_): New data member.
2872 (set_parameters_incremental_full): New function.
2873 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2874 incremental link mode.
2875 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2876 (Sized_relobj::do_relocate_sections): Likewise.
2877 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2878 option.
2879 * testsuite/Makefile.in: Regenerate.
2880 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2881
2882 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2883
2884 * script-sections.h (class Script_sections): Make
2885 Sections_elements typedef public.
2886 * script-sections.cc (class Sort_output_sections): Add elements_
2887 field. Add constructor which sets it; change all callers.
2888 (Sort_output_sections::is_before): New function.
2889 (Sort_output_sections::operator()): Call is_before.
2890 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2891 conditional.
2892 * testsuite/script_test_10.sh: New test. Test script section
2893 order.
2894 * testsuite/script_test_10.t: Likewise.
2895 * testsuite/script_test_10.s: Likewise.
2896 * testsuite/Makefile.am: Wrap the cross linker tests and the
2897 common tests into NATIVE_OR_CROSS_LINKER.
2898 (check_SCRIPTS): Add script_test_10.sh.
2899 (check_DATA): Add script_test_10.stdout.
2900 (script_test_10.o, script_test_10): New targets.
2901 (script_test_10.stdout): New target.
2902 * configure, testsuite/Makefile.in: Regenerate.
2903
2904 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2905
2906 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2907 error for the deprecated relocations.
2908 (Target_arm::Scan::global): Likewise.
2909 (Target_arm::Relocate::relocate): Likewise.
2910
2911 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2912
2913 * fileread.cc (Input_file::find_file): Initialize *found_name
2914 and *namep when using the fallback search for case 4.
2915
2916 2010-10-11 Cary Coutant <ccoutant@google.com>
2917
2918 * options.h (class General_options): Redefine -z lazy as an alias for
2919 the negation of -z now.
2920
2921 2010-10-11 Ian Lance Taylor <iant@google.com>
2922
2923 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2924 binding.
2925
2926 2010-10-06 Nick Clifton <nickc@redhat.com>
2927
2928 * script-sections.cc(class Memory_region): Remove
2929 current_lma_offset_ field. Rename current_vma_offset_ to
2930 current_offset_. Add last_section_ field.
2931 (Memory_region::get_current_vma_address): Rename to
2932 get_current_address.
2933 (Memory_region::get_current_lma_address): Delete.
2934 (Memory_region::increment_vma_offset): Rename to
2935 increment_offset.
2936 (Memory_region::increment_lma_offset): Delete.
2937 (Memory_region::attributes_compatible): New method. Returns
2938 true if the provided section is compatible with the region.
2939 (Memory_region::get_last_section): New method. Returns the last
2940 section to use the region.
2941 (Memory_region::set_last_section): New method. Stores the last
2942 section to use the region.
2943 (Script_sections::block_in_region): New method. Returns true if
2944 a block of memory is contained within a region.
2945 (Script_sections::find_memory_region): New method. Locates a
2946 memory region to be used to set a VMA or LMA address.
2947 (Output_section_definition::set_section_addresses): Add code to
2948 check for addresses set by memory regions.
2949 (Output_segment::set_section_addresses): Remove memory region
2950 walking code.
2951 (Script_sections::create_segment): Add a warning if a header
2952 segment is created outside of any region.
2953 * script-sections.h (class Script_sections): Add prototypes for
2954 find_memory_region and block_in_region methods.
2955 * testsuite/memory_test.s: Use .long instead of .word.
2956 * testsuite/memory_test.t: Add some more output sections.
2957 * testsuite/memory_test.sh: Update expected output.
2958
2959 2010-10-02 Doug Kwan <dougkwan@google.com>
2960
2961 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2962 defintion to symtab.h
2963 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2964 declaration to defintion.
2965
2966 2010-10-01 Nick Clifton <nickc@redhat.com>
2967
2968 * expression.cc (eval): Replace dummy argument with NULL.
2969 (eval_maybe_dot): Check for a NULL result section pointer.
2970 (Symbol_expression::value): Likewise.
2971 (Dot_expression::value): Likewise.
2972 (BINARY_EXPRESSION): Likewise.
2973 (Max_expression::value): Likewise.
2974 (Min_expression::value): Likewise.
2975 (Absolute_expression::value): Likewise.
2976 (Addr_expression::value_from_output_section): Likewise.
2977 (Loaddddr_expression::value_from_output_section): Likewise.
2978 (Segment_start_expression::value): Likewise.
2979 * script-sections.cc
2980 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2981 argument with NULL.
2982 (Sections_elememt_dot_assignment::set_section_addresses):
2983 Likewise.
2984 (Output_data_expression::do_write_to_buffer): Likewise.
2985 (Output_section_definition::finalize_symbols): Likewise.
2986 (Output_section_definition::set_section_addresses): Likewise.
2987
2988 2010-09-30 Doug Kwan <dougkwan@google.com>
2989
2990 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2991
2992 2010-09-28 Sriraman Tallam <tmsriram@google.com>
2993
2994 * target.h (Target::can_icf_inline_merge_sections): New virtual
2995 function.
2996 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2997 virtual function.
2998 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2999 virtual function.
3000 * icf.cc (get_section_contents): Inline merge sections only when
3001 target allows it.
3002
3003 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3004
3005 * configure: Regenerate.
3006
3007 2010-09-17 Ian Lance Taylor <iant@google.com>
3008
3009 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
3010 * testsuite/Makefile.am (memory_test.o): New target.
3011 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3012 memory_test.t.
3013 * testsuite/Makefile.in: Rebuild.
3014
3015 2010-09-17 Doug Kwan <dougkwan@google.com>
3016
3017 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3018 defintion if relocation uses GOT entries of the symbol.
3019 * testsuite/icf_safe_test.sh: Fix test.
3020 * testsuite/icf_safe_so_test.sh: Fix test.
3021
3022 2010-09-16 Cary Coutant <ccoutant@google.com>
3023
3024 * script_sections.cc (class Memory_region): Remove "NULL" from
3025 vector initializations.
3026
3027 2010-09-15 Cary Coutant <ccoutant@google.com>
3028
3029 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3030 Resolve forwarding symbols.
3031
3032 2010-09-15 Doug Kwan <dougkwan@google.com>
3033
3034 * gold/testsuite/script_test_3.t: Add ARM special sections.
3035 * gold/testsuite/script_test_4.t: Same.
3036 * gold/testsuite/script_test_5.t: Same.
3037 * gold/testsuite/script_test_6.t: Same.
3038 * gold/testsuite/script_test_7.t: Same.
3039 * gold/testsuite/script_test_7.t: Same.
3040 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3041
3042 2010-09-14 Cary Coutant <ccoutant@google.com>
3043
3044 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3045 (Target_x86_64::Relocate::relocate_tls): Replace check for
3046 saw_tls_block_reloc_ with test for executable section.
3047
3048 2010-09-12 Cary Coutant <ccoutant@google.com>
3049
3050 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3051 position-independent executables to shared libraries need dynamic
3052 relocations.
3053 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3054 position-independent executables.
3055 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3056 * testsuite/Makefile.in: Regenerate.
3057
3058 2010-09-10 Nick Clifton <nickc@redhat.com>
3059
3060 PR gold/11997
3061 * testsuite/memory_test.t: Discard any sections that are not
3062 needed.
3063
3064 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3065
3066 PR gold/11996
3067 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3068 "This::" to work around a bug in gcc 4.2.
3069
3070 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3071
3072 2010-09-09 Rafael Espindola <espindola@google.com>
3073
3074 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3075 sections with different PF_X flags in the same segment.
3076 (Layout::find_first_load_seg): Search all segments to find the first
3077 one.
3078 * options.h (rosegment): New.
3079
3080 2010-09-08 Rafael Espindola <espindola@google.com>
3081
3082 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
3083
3084 2010-09-08 Doug Kwan <dougkwan@google.com>
3085
3086 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3087 (Arm_relobj::do_relocate_sections): Add new parameter for output
3088 file to match the parent.
3089 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3090 of local symbols instead of input values. Update code to track
3091 changes in gold::relocate_section.
3092 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3093 (Sized_relobj::compute_final_local_value_internal): New methods.
3094 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3095 body into private version of Sized_relobj::compute_final_local_value.
3096 Call the inline method.
3097 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3098 merged symbol value if there is one.
3099 (Symbol_value::has_output_value): New method defintiion.
3100 (Sized_relobj::Compute_final_local_value_status): New enum type.
3101 (Sized_relobj::compute_final_local_value): New methods.
3102 (Sized_relobj::compute_final_local_value_internal): New methods.
3103 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3104 and arm_cortex_a8.sh.
3105 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3106 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3107 New tests.
3108 * Makefile.in: Regenerate.
3109 * testsuite/arm_bl_out_of_range.s: Update test.
3110 * testsuite/thumb_bl_out_of_range.s: Ditto.
3111 * testsuite/thumb_blx_out_of_range.s: Ditto.
3112 * testsuite/arm_branch_out_of_range.sh: New file.
3113 * testsuite/arm_cortex_a8.sh: Ditto.
3114 * testsuite/arm_cortex_a8_b.s: Ditto.
3115 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3116 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3117 * testsuite/arm_cortex_a8_bl.s: Ditto.
3118 * testsuite/arm_cortex_a8_blx.s: Ditto.
3119 * testsuite/arm_cortex_a8_local.s: Ditto.
3120 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3121 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3122
3123 2010-09-08 Rafael Espindola <espindola@google.com>
3124
3125 * Makefile.am (memory_test.stdout): Run readelf with -W.
3126 * Makefile.in: Regenerate.
3127 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3128 64 bit output.
3129
3130 2010-09-08 Rafael Espindola <espindola@google.com>
3131
3132 * script-sections.cc (Script_sections::add_memory_region): Convert
3133 field precision to int.
3134 * script.cc (script_set_section_region, script_set_section_region):
3135 Convert field precision to int.
3136
3137 2010-09-08 Rafael Espindola <espindola@google.com>
3138
3139 * arm.cc (do_finalize_sections): Create the __exidx_start and
3140 __exdix_end symbols even when the section is missing.
3141
3142 2010-09-08 Nick Clifton <nickc@redhat.com>
3143
3144 * README: Remove claim that MEMORY is not supported.
3145 * expression.cc (script_exp_function_origin)
3146 (script_exp_function_length): Move from here to ...
3147 * script.cc: ... here.
3148 (script_set_section_region, script_add_memory)
3149 (script_parse_memory_attr, script_include_directive): New
3150 functions.
3151 * script-sections.cc
3152 (class Memory_region): New class.
3153 (class Output_section_definition): Add set_memory_region,
3154 set_section_vma, set_section_lma and get_section_name methods.
3155 (class Script_Sections): Add add_memory_region,
3156 find_memory_region, find_memory_region_origin,
3157 find_memory_region_length and set_memory_region methods.
3158 Have set_section_addresses method walk the list of set memory
3159 regions.
3160 Extend the print methos to display memory regions.
3161 * script-sections.h: Add prototypes for new methods.
3162 Add enum for MEMORY region attributes.
3163 * yyscript.y: Add support for parsing MEMORY regions.
3164 * script-c.h: Add prototypes for new functions.
3165 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3166 * testsuite/Makefile.in: Regenerate.
3167 * testsuite/memory_test.sh: New script.
3168 * testsuite/memory_test.s: New assembler source file.
3169 * testsuite/memory_test.t: New linker script.
3170
3171 2010-08-27 Doug Kwan <dougkwan@google.com>
3172
3173 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3174 reference override an existing dynamic weak reference.
3175 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3176 * testsuite/Makefile.in: Regenerate.
3177 * testsuite/dyn_weak_ref.sh: New file.
3178 * testsuite/dyn_weak_ref_1.c: Ditto.
3179 * testsuite/dyn_weak_ref_2.c: Ditto.
3180
3181 2010-08-27 Ian Lance Taylor <iant@google.com>
3182
3183 * incremental.h (class Incremental_input_entry): Add virtual
3184 destructor.
3185
3186 2010-08-27 Ian Lance Taylor <iant@google.com>
3187
3188 * testsuite/start_lib_test_3.c: Mark t3 as used.
3189
3190 2010-08-27 Nick Clifton <nickc@redhat.com>
3191
3192 * options.cc (version_script): Fix small typo in previous
3193 whitespace tidyup.
3194
3195 2010-08-25 Nick Clifton <nickc@redhat.com>
3196
3197 * archive.cc: Formatting fixes: Remove whitespace between
3198 typename and following asterisk. Remove whitespace between
3199 function name and opening parenthesis.
3200 * archive.h: Likewise.
3201 * arm.cc: Likewise.
3202 * attributes.cc: Likewise.
3203 * attributes.h: Likewise.
3204 * common.cc: Likewise.
3205 * copy-relocs.cc: Likewise.
3206 * dirsearch.h: Likewise.
3207 * dynobj.cc: Likewise.
3208 * ehframe.cc: Likewise.
3209 * ehframe.h: Likewise.
3210 * expression.cc: Likewise.
3211 * fileread.cc: Likewise.
3212 * fileread.h: Likewise.
3213 * gc.h: Likewise.
3214 * gold-threads.cc: Likewise.
3215 * gold.cc: Likewise.
3216 * i386.cc: Likewise.
3217 * icf.h: Likewise.
3218 * incremental-dump.cc: Likewise.
3219 * incremental.cc: Likewise.
3220 * layout.cc: Likewise.
3221 * layout.h: Likewise.
3222 * main.cc: Likewise.
3223 * merge.cc: Likewise.
3224 * merge.h: Likewise.
3225 * object.cc: Likewise.
3226 * object.h: Likewise.
3227 * options.cc: Likewise.
3228 * options.h: Likewise.
3229 * output.cc: Likewise.
3230 * output.h: Likewise.
3231 * plugin.cc: Likewise.
3232 * plugin.h: Likewise.
3233 * powerpc.cc: Likewise.
3234 * reloc.cc: Likewise.
3235 * script-c.h: Likewise.
3236 * script-sections.cc: Likewise.
3237 * script.cc: Likewise.
3238 * stringpool.cc: Likewise.
3239 * symtab.cc: Likewise.
3240 * symtab.h: Likewise.
3241 * target.cc: Likewise.
3242 * timer.cc: Likewise.
3243 * timer.h: Likewise.
3244 * version.cc: Likewise.
3245 * x86_64.cc: Likewise.
3246
3247 2010-08-24 Nick Clifton <nickc@redhat.com>
3248
3249 PR 11899
3250 * layout.cc (segment_precedes): Sort segments by their physical
3251 addresses, if they have been set.
3252
3253 2010-08-23 Cary Coutant <ccoutant@google.com>
3254
3255 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3256 symbols data.
3257 (Lib_group::include_member): Unlock object after deleting its
3258 symbols data.
3259 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3260 the bug fixed here.
3261
3262 2010-08-19 Neil Vachharajani <nvachhar@google.com>
3263 Cary Coutant <ccoutant@google.com>
3264
3265 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3266 constructor, and set_blocker.
3267 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3268 readsyms_blocker_.
3269 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3270 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3271 * testsuite/Makefile.am (start_lib_test): New test case.
3272 * testsuite/Makefile.in: Regenerate.
3273 * testsuite/start_lib_test_main.c: New file.
3274 * testsuite/start_lib_test_1.c: New file.
3275 * testsuite/start_lib_test_2.c: New file.
3276 * testsuite/start_lib_test_3.c: New file.
3277
3278 2010-08-19 Ian Lance Taylor <iant@google.com>
3279
3280 * Makefile.in: Rebuild with automake 1.11.1.
3281 * aclocal.m4: Likewise.
3282 * testsuite/Makefile.in: Likewise.
3283
3284 2010-08-19 Ian Lance Taylor <iant@google.com>
3285
3286 PR 10893
3287 * i386.cc (class Output_data_plt_i386): Update declarations.
3288 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3289 local_ifuncs_ fields.
3290 (Target_i386::do_plt_section_for_global): New function.
3291 (Target_i386::do_plt_section_for_local): New function.
3292 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3293 parameter; change all callers. Initialize global_ifuncs_ and
3294 local_ifuncs_. If doing a static link define __rel_iplt_start and
3295 __rel_iplt_end.
3296 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3297 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3298 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3299 symbols.
3300 (Target_i386::make_plt_section): New function, broken out of
3301 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3302 (Target_i386::make_plt_entry): Call make_plt_section.
3303 (Target_i386::make_local_ifunc_plt_entry): New function.
3304 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3305 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3306 R_386_IRELATIVE to switch.
3307 (Target_i386::Scan::global): Likewise.
3308 (Target_i386::Relocate::relocate): Likewise.
3309 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3310 switch.
3311 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3312 (Target_x86_64::do_plt_section_for_global): New function.
3313 (Target_x86_64::do_plt_section_for_local): New function.
3314 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3315 parameter; change all callers. If doing a static link define
3316 __rela_iplt_start and __rela_iplt_end.
3317 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3318 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3319 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3320 to point to .plt.
3321 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3322 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3323 switch.
3324 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3325 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3326 R_X86_64_IRELATIVE to switch.
3327 (Target_x86_64::Scan::global): Likewise.
3328 (Target_x86_64::Relocate::relocate): Likewise.
3329 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3330 switch.
3331 * target.h (class Target): Add plt_section_for_global and
3332 plt_section_for_local functions. Add do_plt_section_for_global
3333 and do_plt_section_for_local virtual functions.
3334 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3335 clarifying comments.
3336 (Symbol::use_plt_offset): Handle IFUNC symbol.
3337 * object.cc (Sized_relobj::Sized_relobj): Initialize
3338 local_plt_offsets_.
3339 (Sized_relobj::local_has_plt_offset): New function.
3340 (Sized_relobj::local_plt_offset): New function.
3341 (Sized_relobj::set_local_plt_offset): New function.
3342 (Sized_relobj::do_count): Handle IFUNC symbol.
3343 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3344 a bit away from input_shndx_ field. Add set_is_func_symbol and
3345 is_ifunc_symbol functions.
3346 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3347 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3348 local_plt_offsets_ field.
3349 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3350 * output.h (class Output_section_data): Add non-const
3351 output_section function.
3352 (class Output_data_got): Update declarations.
3353 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3354 Add use_plt_offset parameter to global and local constructors.
3355 Change all callers. Change local_sym_index_ field to 31 bits.
3356 Change GSYM_CODE and CONSTANT_CODE accordingly.
3357 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3358 doing a static link don't set sh_link field.
3359 (Output_data_got::Got_entry::write): Use PLT offset if
3360 appropriate.
3361 (Output_data_got::add_global_plt): New function.
3362 (Output_data_got::add_local_plt): New function.
3363 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3364 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3365 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3366 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3367 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3368 IFUNC conditional.
3369 * testsuite/ifunc-sel.h: New file.
3370 * testsuite/ifuncmain1.c: New file.
3371 * testsuite/ifuncmain1vis.c: New file.
3372 * testsuite/ifuncmod1.c: New file.
3373 * testsuite/ifuncdep2.c: New file.
3374 * testsuite/ifuncmain2.c: New file.
3375 * testsuite/ifuncmain3.c: New file.
3376 * testsuite/ifuncmod3.c: New file.
3377 * testsuite/ifuncmain4.c: New file.
3378 * testsuite/ifuncmain5.c: New file.
3379 * testsuite/ifuncmod5.c: New file.
3380 * testsuite/ifuncmain6pie.c: New file.
3381 * testsuite/ifuncmod6.c: New file.
3382 * testsuite/ifuncmain7.c: New file.
3383 * configure, testsuite/Makefile.in: Rebuild.
3384
3385 2010-08-18 Ian Lance Taylor <iant@google.com>
3386
3387 * incremental.cc
3388 (Output_section_incremental_inputs::write_input_files): Add cast
3389 to avoid signed/unsigned comparison warning.
3390 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3391
3392 2010-08-12 Cary Coutant <ccoutant@google.com>
3393
3394 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3395
3396 2010-08-13 Ian Lance Taylor <iant@google.com>
3397
3398 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3399
3400 2010-08-12 Cary Coutant <ccoutant@google.com>
3401 Doug Kwan <dougkwan@google.com>
3402
3403 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3404 defintion overrides non-weak undef, remember that the original undef
3405 is not weak.
3406 * symtab.cc (Symbol_table::sized_write_global): For undef without
3407 an original weak binding, set binding to global in output.
3408 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3409 * testsuite/Makefile.in: Regenerate.
3410 * testsuite/strong_ref_weak_def.sh: New file.
3411 * testsuite/strong_ref_weak_def_1.c: Ditto.
3412 * testsuite/strong_ref_weak_def_2.c: Ditto.
3413
3414 2010-08-12 Cary Coutant <ccoutant@google.com>
3415
3416 * testsuite/incremental_test.sh: Rewrite.
3417 * testsuite/incremental_test_1.c: Rewrite.
3418 * testsuite/incremental_test_2.c: Rewrite.
3419
3420 2010-08-12 Cary Coutant <ccoutant@google.com>
3421
3422 * arm.cc (Target_arm::got_size): Add const.
3423 (Target_arm::got_entry_count): New function.
3424 (Target_arm::plt_entry_count): New function.
3425 (Target_arm::first_plt_entry_offset): New function.
3426 (Target_arm::plt_entry_size): New function.
3427 (Output_data_plt_arm::entry_count): New function.
3428 (Output_data_plt_arm::first_plt_entry_offset): New function.
3429 (Output_data_plt_arm::get_plt_entry_size): New function.
3430 * i386.cc (Target_i386::got_size): Add const.
3431 (Target_i386::got_entry_count): New function.
3432 (Target_i386::plt_entry_count): New function.
3433 (Target_i386::first_plt_entry_offset): New function.
3434 (Target_i386::plt_entry_size): New function.
3435 (Output_data_plt_i386::entry_count): New function.
3436 (Output_data_plt_i386::first_plt_entry_offset): New function.
3437 (Output_data_plt_i386::get_plt_entry_size): New function.
3438 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3439 find_incremental_inputs_sections. Dump incremental_got_plt section.
3440 * incremental.cc: Include target.h.
3441 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3442 parameter. Adjust all callers. Find incremental_got_plt section.
3443 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3444 section.
3445 (Output_section_incremental_inputs::set_final_data_size): Calculate
3446 size of incremental_got_plt section.
3447 (Output_section_incremental_inputs::do_write): Write the
3448 incremental_got_plt section.
3449 (Got_plt_view_info): New struct.
3450 (Local_got_offset_visitor): New class.
3451 (Global_got_offset_visitor): New class.
3452 (Global_symbol_visitor_got_plt): New class.
3453 (Output_section_incremental_inputs::write_got_plt): New function.
3454 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3455 Add parameter. Adjust all callers.
3456 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3457 (Incremental_inputs::got_plt_section): New function.
3458 (Incremental_inputs::got_plt_section_): New data member.
3459 (Incremental_got_plt_reader): New class.
3460 * layout.cc (Layout::create_incremental_info_sections): Add the
3461 incremental_got_plt section.
3462 * object.h (Got_offset_list::get_list): New function.
3463 (Got offset_list::for_all_got_offsets): New function.
3464 (Sized_relobj::local_got_offset_list): New function.
3465 * powerpc.cc (Target_powerpc::got_size): Add const.
3466 (Target_powerpc::got_entry_count): New function.
3467 (Target_powerpc::plt_entry_count): New function.
3468 (Target_powerpc::first_plt_entry_offset): New function.
3469 (Target_powerpc::plt_entry_size): New function.
3470 (Output_data_plt_powerpc::entry_count): New function.
3471 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3472 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3473 * sparc.cc (Target_sparc::got_size): Add const.
3474 (Target_sparc::got_entry_count): New function.
3475 (Target_sparc::plt_entry_count): New function.
3476 (Target_sparc::first_plt_entry_offset): New function.
3477 (Target_sparc::plt_entry_size): New function.
3478 (Output_data_plt_sparc::entry_count): New function.
3479 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3480 (Output_data_plt_sparc::get_plt_entry_size): New function.
3481 * symtab.h (Symbol::got_offset_list): New function.
3482 (Symbol_table::for_all_symbols): New function.
3483 * target.h (Sized_target::got_entry_count): New function.
3484 (Sized_target::plt_entry_count): New function.
3485 (Sized_target::plt_entry_size): New function.
3486 * x86_64.cc (Target_x86_64::got_size): Add const.
3487 (Target_x86_64::got_entry_count): New function.
3488 (Target_x86_64::plt_entry_count): New function.
3489 (Target_x86_64::first_plt_entry_offset): New function.
3490 (Target_x86_64::plt_entry_size): New function.
3491 (Output_data_plt_x86_64::entry_count): New function.
3492 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3493 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3494
3495 2010-08-12 Cary Coutant <ccoutant@google.com>
3496
3497 * archive.cc: Include incremental.h.
3498 (Archive::Archive): Initialize incremental_info_.
3499 (Archive::include_member): Record archive members in incremental info.
3500 (Add_archive_symbols::run): Record begin and end of an archive in
3501 incremental info.
3502 (Lib_group::include_member): Record objects in incremental info.
3503 * archive.h (Incremental_archive_entry): Forward declaration.
3504 (Archive::set_incremental_info): New member function.
3505 (Archive::incremental_info): New member function.
3506 (Archive::Unused_symbol_iterator): New class.
3507 (Archive::unused_symbols_begin): New member function.
3508 (Archive::unused_symbols_end): New member function.
3509 (Archive::incremental_info_): New data member.
3510 * incremental-dump.cc (find_input_containing_global): New function.
3511 (dump_incremental_inputs): Dump new incremental info sections.
3512 * incremental.cc: Include symtab.h.
3513 (Output_section_incremental_inputs): New class.
3514 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3515 new incremental info sections.
3516 (Sized_incremental_binary::do_check_inputs): Likewise.
3517 (Incremental_inputs::report_archive): Remove.
3518 (Incremental_inputs::report_archive_begin): New function.
3519 (Incremental_inputs::report_archive_end): New function.
3520 (Incremental_inputs::report_object): New function.
3521 (Incremental_inputs::finalize_inputs): Remove.
3522 (Incremental_inputs::report_input_section): New function.
3523 (Incremental_inputs::report_script): Rewrite.
3524 (Incremental_inputs::finalize): Do nothing but finalize string table.
3525 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3526 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3527 (Incremental_inputs::create_data_sections): New function.
3528 (Incremental_inputs::relocs_entsize): New function.
3529 (Output_section_incremental_inputs::set_final_data_size): New function.
3530 (Output_section_incremental_inputs::do_write): New function.
3531 (Output_section_incremental_inputs::write_header): New function.
3532 (Output_section_incremental_inputs::write_input_files): New function.
3533 (Output_section_incremental_inputs::write_info_blocks): New function.
3534 (Output_section_incremental_inputs::write_symtab): New function.
3535 * incremental.h (Incremental_script_entry): Forward declaration.
3536 (Incremental_object_entry): Forward declaration.
3537 (Incremental_archive_entry): Forward declaration.
3538 (Incremental_inputs): Forward declaration.
3539 (Incremental_inputs_header_data): Remove.
3540 (Incremental_inputs_header): Remove.
3541 (Incremental_inputs_header_write): Remove.
3542 (Incremental_inputs_entry_data): Remove.
3543 (Incremental_inputs_entry): Remove.
3544 (Incremental_inputs_entry_write): Remove.
3545 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3546 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3547 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3548 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3549 Likewise.
3550 (Incremental_input_entry): New class.
3551 (Incremental_script_entry): New class.
3552 (Incremental_object_entry): New class.
3553 (Incremental_archive_entry): New class.
3554 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3555 (Incremental_inputs::report_inputs): Remove.
3556 (Incremental_inputs::report_archive): Remove.
3557 (Incremental_inputs::report_archive_begin): New function.
3558 (Incremental_inputs::report_archive_end): New function.
3559 (Incremental_inputs::report_object): Change prototype.
3560 (Incremental_inputs::report_input_section): New function.
3561 (Incremental_inputs::report_script): Change prototype.
3562 (Incremental_inputs::get_reloc_count): New function.
3563 (Incremental_inputs::set_reloc_count): New function.
3564 (Incremental_inputs::create_data_sections): New function.
3565 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3566 (Incremental_inputs::inputs_section): New function.
3567 (Incremental_inputs::symtab_section): New function.
3568 (Incremental_inputs::relocs_section): New function.
3569 (Incremental_inputs::get_stringpool): Add const.
3570 (Incremental_inputs::command_line): Add const.
3571 (Incremental_inputs::inputs): Remove.
3572 (Incremental_inputs::command_line_key): New function.
3573 (Incremental_inputs::input_file_count): New function.
3574 (Incremental_inputs::input_files): New function.
3575 (Incremental_inputs::relocs_entsize): New function.
3576 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3577 (Incremental_inputs::finalize_inputs): Remove.
3578 (Incremental_inputs::Input_info): Remove.
3579 (Incremental_inputs::lock_): Remove.
3580 (Incremental_inputs::inputs_): Change type.
3581 (Incremental_inputs::inputs_map_): Remove.
3582 (Incremental_inputs::current_object_entry_): New data member.
3583 (Incremental_inputs::inputs_section_): New data member.
3584 (Incremental_inputs::symtab_section_): New data member.
3585 (Incremental_inputs::relocs_section_): New data member.
3586 (Incremental_inputs::reloc_count_): New data member.
3587 (Incremental_inputs_reader): New class.
3588 (Incremental_symtab_reader): New class.
3589 (Incremental_relocs_reader): New class.
3590 * layout.cc (Layout::finalize): Move finalization of incremental info
3591 and creation of incremental info sections to follow finalization of
3592 symbol table. Set offsets for postprocessing sections.
3593 (Layout::create_incremental_info_sections): Call
3594 Incremental_inputs::create_data_sections. Add incremental symtab
3595 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3596 sections to layout after input sections.
3597 * layout.h (struct Timespec): Forward declaration.
3598 (Layout::incremental_inputs): Add const.
3599 (Layout::create_incremental_info_sections): Add parameter.
3600 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3601 * object.cc: Include incremental.h.
3602 (Relobj::finalize_incremental_relocs): New function.
3603 (Sized_relobj::do_layout): Record input sections in incremental info.
3604 * object.h (Object::output_section): New function.
3605 (Object::output_section_offset): Moved from Relobj.
3606 (Object::get_incremental_reloc_base): New function.
3607 (Object::get_incremental_reloc_count): New function.
3608 (Object::do_output_section): New function.
3609 (Object::do_output_section_offset): Moved from Relobj.
3610 (Object::do_get_incremental_reloc_base): New function.
3611 (Object::do_get_incremental_reloc_count): New function.
3612 (Object::Object): Initialize new data members.
3613 (Relobj::output_section): Renamed do_output_section and moved to
3614 protected.
3615 (Relobj::output_section_offset): Moved to Object.
3616 (Relobj::do_get_incremental_reloc_base): New function.
3617 (Relobj::do_get_incremental_reloc_count): New function.
3618 (Relobj::allocate_incremental_reloc_counts): New function.
3619 (Relobj::count_incremental_reloc): New function.
3620 (Relobj::finalize_incremental_relocs): New function.
3621 (Relobj::next_incremental_reloc_index): New function.
3622 (Relobj::reloc_counts_): New data member.
3623 (Relobj::reloc_bases_): New data member.
3624 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3625 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3626 (Sized_relobj::incremental_relocs_scan): New function.
3627 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3628 (Sized_relobj::incremental_relocs_write): New function.
3629 (Sized_relobj::incremental_relocs_write_reltype): New function.
3630 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3631 incremental link.
3632 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3633 archives and object files elsewhere.
3634 (Add_symbols::run): Report object files here.
3635 (Finish_group::run): Report end of archive at end of group.
3636 * reloc.cc: Include layout.h, incremental.h.
3637 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3638 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3639 (Sized_relobj::incremental_relocs_scan): New function.
3640 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3641 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3642 (Sized_relobj::incremental_relocs_write): New function.
3643 (Sized_relobj::incremental_relocs_write_reltype): New function.
3644 * script.cc (read_input_script): Rewrite test for incremental link.
3645 Change call to Incremental_inputs::report_script.
3646 * symtab.h (Symbol_table::first_global_index): New function.
3647 (Symbol_table::output_count): New function.
3648
3649 2010-08-12 Doug Kwan <dougkwan@google.com>
3650
3651 * arm.cc (Target_arm::merge_object_attributes): Check command line
3652 options --no-wchar-size-warning and --no-enum-size-warning.
3653 * options.h (General_options): Add ld-compatible options
3654 --no-enum-size-warning and --no-wchar-size-warning.
3655
3656 2010-08-04 Ian Lance Taylor <iant@google.com>
3657
3658 * x86_64.cc (Target_x86_64::Scan::local): Use
3659 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3660 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3661 (Target_x86_64::Scan::global): Likewise.
3662 (Target_x86_64::Relocate::relocate): Likewise.
3663 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3664 Likewise.
3665
3666 2010-08-03 Cary Coutant <ccoutant@google.com>
3667
3668 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3669 to reserve space in merged_strings vector. Keep total input size
3670 for stats.
3671 (Output_merge_string::do_print_merge_stats): Print total input size.
3672 * merge.h (Output_merge_string): Add input_size_ field.
3673 * stringpool.cc (Stringpool_template::string_length): Move
3674 implementations out of Stringpool_template class and place in
3675 stringpool.h.
3676 * stringpool.h (string_length): Move out of Stringpool_template.
3677
3678 2010-08-03 Ian Lance Taylor <iant@google.com>
3679
3680 PR 11712
3681 * layout.cc (relaxation_loop_body): If address of load segment is
3682 set, adjust address to include headers if possible.
3683
3684 2010-08-03 Ian Lance Taylor <iant@google.com>
3685
3686 * version.cc (version_string): Bump to 1.10.
3687
3688 2010-08-03 Ian Lance Taylor <iant@google.com>
3689
3690 PR 11805
3691 * layout.h (enum Output_section_order): Define.
3692 (class Layout): Update declarations.
3693 * layout.cc (Layout::get_output_section): Add order parameter.
3694 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3695 is_first_non_relro parameters. Change all callers.
3696 (Layout::choose_output_section): Likewise.
3697 (Layout::add_output_section_data): Likewise.
3698 (Layout::make_output_section): Likewise. Set order.
3699 (Layout::default_section_order): New function.
3700 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3701 * output.cc (Output_section::Output_section): Initialize order_.
3702 Don't initialize deleted fields.
3703 (Output_segment::Output_segment): Don't initialize deleted
3704 fields.
3705 (Output_segment::add_output_section_to_load): New function
3706 replacing add_output_section. Change all callers to call this or
3707 add_output_section_to_nonload.
3708 (Output_segment::add_output_section_to_nonload): New function.
3709 (Output_segment::remove_output_section): Rewrite.
3710 (Output_segment::add_initial_output_data): Likewise.
3711 (Output_segment::has_any_data_sections): Likewise.
3712 (Output_segment::is_first_section_relro): Likewise.
3713 (Output_segment::maximum_alignment): Likewise.
3714 (Output_segment::has_dynamic_reloc): New function replacing
3715 dynamic_reloc_count. Change all callers.
3716 (Output_segment::has_dynamic_reloc_list): New function replacing
3717 dynamic_reloc_count_list. Change all callers.
3718 (Output_segment::set_section_addresses): Rewrite.
3719 (Output_segment::set_offset): Rewrite.
3720 (Output_segment::find_first_and_last_list): Remove.
3721 (Output_segment::set_tls_offsets): Rewrite.
3722 (Output_segment::first_section_load_address): Likewise.
3723 (Output_segment::output_section_count): Likewise.
3724 (Output_segment::section_with_lowest_load_address): Likewise.
3725 (Output_segment::write_section_headers): Likewise.
3726 (Output_segment::print_sections_to_map): Likewise.
3727 * output.h (class Output_data): Remove dynamic_reloc_count_
3728 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3729 (Output_data::add_dynamic_reloc): Rewrite.
3730 (Output_data::has_dynamic_reloc): New function.
3731 (Output_data::dynamic_reloc_count): Remove.
3732 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3733 is_last_relro_, is_first_non_relro_, is_interp_,
3734 is_dynamic_linker_section_ fields. Add order and set_order
3735 functions. Remove is_relro_local, set_is_relro_local,
3736 is_last_relro, set_is_last_relro, is_first_non_relro,
3737 set_is_first_non_relro functions, is_interp, set_is_interp,
3738 is_dynamic_linker_section, and set_is_dynamic_linker_section
3739 functions.
3740 (class Output_segment): Change Output_data_list from std::list to
3741 std:;vector. Add output_lists_ field. Remove output_data_ and
3742 output_bss_ fields. Update declarations.
3743
3744 2010-08-02 Ian Lance Taylor <iant@google.com>
3745
3746 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3747 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3748 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3749
3750 2010-08-02 Ian Lance Taylor <iant@google.com>
3751
3752 PR 11855
3753 * script.cc (Script_options::Script_options): Initialize
3754 symbol_definitions_ and symbol_references_.
3755 (Script_options::add_symbol_assignment): Update
3756 symbol_definitions_ and symbol_references_.
3757 (Script_options::add_symbol_reference): New function.
3758 (script_symbol): New function.
3759 * script.h (class Script_options): Add symbol_definitions_ and
3760 symbol_references_ fields.
3761 (Script_options::referenced_const_iterator): New type.
3762 (Script_options::referenced_begin): New function.
3763 (Script_options::referenced_end): New function.
3764 (Script_options::is_referenced): New function.
3765 (Script_options::any_unreferenced): New function.
3766 * script-c.h (script_symbol): Declare.
3767 * yyscript.y (exp): Call script_symbol.
3768 * symtab.cc: Include "script.h".
3769 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3770 Change all callers. Check symbols referenced by scripts.
3771 (Symbol_table::add_undefined_symbols_from_command_line): Add
3772 layout parameter. Change all callers.
3773 (Symbol_table::do_add_undefined_symbols_from_command_line):
3774 Likewise. Break out loop body. Check symbols referenced by
3775 scripts.
3776 (Symbol_table::add_undefined_symbol_from_command_line): New
3777 function broken out of
3778 do_add_undefined_symbols_from_command_line.
3779 * symtab.h (class Symbol_table): Update declarations.
3780 * archive.cc: Include "layout.h".
3781 (Archive::should_include_member): Add layout parameter. Change
3782 all callers. Check for symbol mentioned in expression.
3783 * archive.h (class Archive): Update declaration.
3784 * object.cc (Sized_relobj::do_should_include_member): Add layout
3785 parameter.
3786 * object.h (Object::should_include_member): Add layout parameter.
3787 Change all callers.
3788 (Object::do_should_include_member): Add layout parameter.
3789 (class Sized_relobj): Update declaration.
3790 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3791 parameter.
3792 * dynobj.h (class Sized_dynobj): Update declaration.
3793 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3794 layout parameter.
3795 * plugin.h (class Sized_pluginobj): Update declaration.
3796
3797 2010-08-02 Ian Lance Taylor <iant@google.com>
3798
3799 PR 11866
3800 * output.cc (Output_segment::set_offset): Search for the first and
3801 last sections rather than assuming that the list is in order.
3802 (Output_segment::find_first_and_last_list): New function.
3803 * output.h (class Output_segment): Update declarations.
3804 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3805 (relro_strip_test_SOURCES): New variable.
3806 (relro_strip_test_DEPENDENCIES): New variable.
3807 (relro_strip_test_LDFLAGS): New variable.
3808 (relro_strip_test_LDADD): New variable.
3809 (relro_strip_test.so): New target.
3810
3811 2010-08-02 Ian Lance Taylor <iant@google.com>
3812
3813 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3814 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3815 (Target_i386::got_tlsdesc_section): New function.
3816 (Target_i386::got_section): Create space for GOT entries for
3817 TLSDESC relocations.
3818 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3819 R_386_TLS_GOTDESC.
3820 (Target_i386::Scan::global): Likewise.
3821 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3822 using TLSDESC GOT.
3823 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3824 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3825 (Target_x86_64::got_tlsdesc_section): New function.
3826 (Target_x86_64::got_section): Create space for GOT entries for
3827 TLSDESC relocations.
3828 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3829 R_386_TLS_GOTDESC.
3830 (Target_x86_64::Scan::global): Likewise.
3831 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3832 using TLSDESC GOT.
3833
3834 2010-08-02 Ian Lance Taylor <iant@google.com>
3835
3836 * testsuite/final_layout.sh: Use dc to convert from hex to
3837 decimal.
3838
3839 2010-07-29 Sriraman Tallam <tmsriram@google.com>
3840
3841 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3842 paramter to the call to gold::gc_process_relocs.
3843 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3844 paramter to the call to gold::gc_process_relocs.
3845 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3846 parameter to the call to gold::gc_process_relocs.
3847 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3848 template parameter to the call to gold::gc_process_relocs.
3849 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3850 paramter to the call to gold::gc_process_relocs.
3851 * gc.h (get_embedded_addend_size): New function.
3852 (gc_process_relocs): Save the size of the reloc for use by ICF.
3853 * icf.cc (get_section_contents): Get the addend from the text section
3854 for SHT_REL relocation sections.
3855 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3856 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3857 * int_encoding.h (read_from_pointer): New overloaded function.
3858 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3859 * testsuite/icf_sht_rel_addend_test.sh: New file.
3860 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3861 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3862
3863 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3864
3865 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3866 * Makefile.in: Regenerate.
3867 * testsuite/Makefile.in: Regenerate.
3868
3869 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3870
3871 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3872 * gold/testsuite/debug_msg.cc: Likewise.
3873 * gold/testsuite/odr_violation1.cc
3874 * gold/testsuite/odr_violation2.cc
3875
3876 2010-07-21 Cary Coutant <ccoutant@google.com>
3877
3878 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3879 string, and length fields.
3880 (Output_merge_string::Merged_strings_list): New type.
3881 (Output_merge_string::Merged_strings_lists): New typedef.
3882 (Output_merge_string): Replace merged_strings_ with
3883 merged_strings_lists_.
3884 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3885 Merged_strings_list per input object and section. Don't store pointer
3886 to the string. Don't store length with each merged string entry.
3887 (Output_merge_string::finalize_merged_data): Loop over list of merged
3888 strings lists. Recompute length of each merged string.
3889
3890 2010-07-15 Cary Coutant <ccoutant@google.com>
3891
3892 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3893 here.
3894
3895 2010-07-14 Ian Lance Taylor <iant@google.com>
3896
3897 * descriptors.cc (Descriptors::open): Report correct name in error
3898 message.
3899
3900 2010-07-13 Doug Kwan <dougkwan@google.com>
3901
3902 * arm.cc (Arm_input_section::Arm_input_section): For a
3903 SHT_ARM_EXIDX section, always keeps the input sections.
3904 (Arm_input_section::set_exidx_section_link): New method.
3905 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3906 has_errors_ to false.
3907 (Arm_exidx_input_section::has_errors,
3908 Arm_exidx_input_section::set_has_errors): New methods.
3909 (Arm_exidx_input_section::has_errors_): New data member.
3910 (Arm_relobj::get_exidx_shndx_list): New method.
3911 (Arm_output_section::append_text_sections_to_list): Do not skip
3912 section without SHF_EXECINSTR.
3913 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3914 errors.
3915 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3916 section header. Make error messages more verbose. Check for
3917 a non-executable section linked to an EXIDX section.
3918 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3919 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3920 check that there is no deferred EXIDX section if we exit early.
3921 Instead of not making an EXIDX section in case of an error, make one
3922 and set the has_errors flag of it.
3923 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3924 in a relocatable link.
3925 (Target_arm::do_relax): Look for the EXIDX output section instead of
3926 assuming that it is called .ARM.exidx.
3927 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3928 section list. Do not check for SHF_EXECINSTR section flags but
3929 skip any input section with errors.
3930 * output.cc (Output_section::Output_section): Initialize
3931 always_keeps_input_sections_ to false.
3932 (Output_section::add_input_section): Check for
3933 always_keeps_input_sections_.
3934 * output.h (Output_section::always_keeps_input_sections,
3935 Output_section::set_always_keeps_input_sections): New methods.
3936 (Output_section::always_keeps_input_sections): New data member.
3937
3938 2010-07-13 Rafael Espindola <espindola@google.com>
3939
3940 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3941 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3942
3943 2010-07-13 Philip Herron <herron.philip@googlemail.com>
3944 Ian Lance Taylor <iant@google.com>
3945
3946 * output.h (Output_section_lookup_maps::add_merge_section):
3947 Correct check of whether value was inserted.
3948 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3949 (Output_section_lookup_maps::add_relaxed_input_section):
3950 Likewise.
3951 * arm.cc (Target_arm::got_section): Remove used local os.
3952 * i386.cc (Target_i386::got_section): Likewise.
3953 * x86_64.cc (Target_x86_64::got_section): Likewise.
3954 * sparc.cc (Target_sparc::got_section): Likewise.
3955 (Target_sparc::relocate): Remove unused local have_got_offset.
3956 * powerpc.cc (Target_powerpc::relocate): Likewise.
3957
3958 2010-07-13 Ian Lance Taylor <iant@google.com>
3959
3960 * compressed_output.cc (zlib_decompress): Fix signature in
3961 !HAVE_ZLIB_H case.
3962
3963 * archive.cc (Archive::include_member): Unlock an external member
3964 of a thin archive. Don't bother to delete an object we know is
3965 NULL.
3966
3967 2010-07-12 Cary Coutant <ccoutant@google.com>
3968
3969 * compressed_output.cc (zlib_decompress): New function.
3970 (get_uncompressed_size): New function.
3971 (decompress_input_section): New function.
3972 * compressed_output.h (get_uncompressed_size): New function.
3973 (decompress_input_section): New function.
3974 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3975 Handle compressed debug sections.
3976 * layout.cc (is_compressed_debug_section): New function.
3977 (Layout::output_section_name): Map compressed section names to
3978 canonical names.
3979 * layout.h (is_compressed_debug_section): New function.
3980 (is_debug_info_section): Recognize compressed debug sections.
3981 * merge.cc: Include compressed_output.h.
3982 (Output_merge_data::do_add_input_section): Handle compressed
3983 debug sections.
3984 (Output_merge_string::do_add_input_section): Handle compressed
3985 debug sections.
3986 * object.cc: Include compressed_output.h.
3987 (Sized_relobj::Sized_relobj): Initialize new data members.
3988 (build_compressed_section_map): New function.
3989 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3990 * object.h (Object::section_is_compressed): New method.
3991 (Object::do_section_is_compressed): New method.
3992 (Sized_relobj::Compressed_section_map): New type.
3993 (Sized_relobj::do_section_is_compressed): New method.
3994 (Sized_relobj::compressed_sections_): New data member.
3995 * output.cc (Output_section::add_input_section): Handle compressed
3996 debug sections.
3997 * reloc.cc: Include compressed_output.h.
3998 (Sized_relobj::write_sections): Handle compressed debug sections.
3999
4000 2010-07-08 Cary Coutant <ccoutant@google.com>
4001
4002 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4003 weak when resolving to a dynamic def.
4004 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4005 for weak undef/dynamic def cases. Adjust callers.
4006 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4007 undef_binding_weak_.
4008 (Symbol_table::sized_write_globals): Adjust symbol binding.
4009 (Symbol_table::sized_write_symbol): Add binding parameter.
4010 * symtab.h (Symbol::set_undef_binding): New method.
4011 (Symbol::is_undef_binding_weak): New method.
4012 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4013 (Symbol_table::should_override): Add new parameter.
4014 (Symbol_table::sized_write_symbol): Add new parameter.
4015
4016 * testsuite/weak_undef_file1.cc: Add new test case.
4017 * testsuite/weak_undef_file2.cc: Fix header comment.
4018 * testsuite/weak_undef_test.cc: Add new test case.
4019
4020 2010-06-29 Doug Kwan <dougkwan@google.com>
4021
4022 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4023 Initialize USE_SYMBOL_.
4024 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4025 definition.
4026 (Arm_reloc_property::uses_symbol_): New data member declaration.
4027 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4028 uses symbol value and symbol is undefined but not weakly undefined.
4029
4030 2010-06-28 Rafael Espindola <espindola@google.com>
4031
4032 * plugin.cc (Plugin::load): Use dlerror.
4033
4034 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4035
4036 * symtab.cc (detect_odr_violations): When reporting an ODR
4037 violation, report an object where the symbol is defined.
4038
4039 2010-06-25 Doug Kwan <dougkwan@google.com>
4040
4041 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4042 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4043 definition.
4044 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4045 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4046 target hook to detect function points.
4047 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4048 * icf.h (Icf::check_section_for_function_pointers): Change type of
4049 parameter SECTION_NAME to const reference to std::string. Use
4050 target hook to determine if section may have unsafe pointers.
4051 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4052 method definition.
4053
4054 2010-06-21 Rafael Espindola <espindola@google.com>
4055
4056 * fileread.cc (Input_file::find_fie): New
4057 (Input_file::open): Use Input_file::find_fie.
4058 * fileread.h (Input_file::find_fie): New
4059 * plugin.cc (set_extra_library_path): New.
4060 (Plugin::load): Add set_extra_library_path to the transfer vector.
4061 (Plugin_manager::set_extra_library_path): New.
4062 (Plugin_manager::add_input_file): Use the extra search path if set.
4063 (set_extra_library_path(): New.
4064 * plugin.h (Plugin_manager): Add set_extra_library_path and
4065 extra_search_path_.
4066
4067 2010-06-19 Cary Coutant <ccoutant@google.com>
4068
4069 * layout.cc (gdb_sections): Add .debug_types.
4070 (lines_only_debug_sections): Likewise.
4071
4072 2010-06-18 Rafael Espindola <espindola@google.com>
4073
4074 * plugin.cc (add_input_file,add_input_library)
4075 (Plugin_manager::add_input_file): Make filename arguments const.
4076 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4077 const.
4078
4079 2010-06-16 Doug Kwan <dougkwan@google.com>
4080
4081 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4082 .ARM.attributes section if we have not merged any input
4083 attributes sections.
4084
4085 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4086
4087 * arm.cc: Allow combining objects with no EABI version
4088 information.
4089
4090 2010-06-15 Rafael Espindola <espindola@google.com>
4091
4092 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4093
4094 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4095
4096 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4097 (struct iovec): Correct !HAVE_READV definition.
4098
4099 2010-06-10 Cary Coutant <ccoutant@google.com>
4100
4101 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4102 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4103 reloc sections.
4104 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4105
4106 PR 11683
4107 * symtab.h (Symbol::is_placeholder): New member function.
4108 * target-reloc.h (relocate_section): Check for placeholder symbols.
4109
4110 * testsuite/Makefile.am (plugin_test_8): New test.
4111 (plugin_test_9): New test.
4112 * testsuite/Makefile.in: Regenerate.
4113
4114 2010-06-09 Nick Clifton <nickc@redhat.com>
4115
4116 * yyscript.y (input_list_element): Allow strings prefixed with
4117 the '-' character. Treat these as libraries.
4118 * script.cc (script_add_library): New function. Adds a library
4119 specified by "-l<name>" found in an input script.
4120 * script-c.h: Add prototype for script_add_library.
4121
4122 2010-06-07 Doug Kwan <dougkwan@google.com>
4123
4124 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4125 Restrict stub-group size to be within long conditional branch
4126 range when working around cortex-A8 erratum.
4127
4128 2010-06-07 Damien Diederen <dd@crosstwine.com>
4129
4130 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4131 #ifdef typo.
4132
4133 2010-06-03 Sriraman Tallam <tmsriram@google.com>
4134
4135 PR gold/11658
4136 * output.cc
4137 (Output_section::Input_section_sort_entry::compare_section_ordering):
4138 Change to return non-zero correctly.
4139 (Output_section::Input_section_sort_section_order_index_compare
4140 ::operator()): Change to fix ambiguity in comparisons.
4141
4142 2010-06-01 Sriraman Tallam <tmsriram@google.com>
4143
4144 * gold.h (is_wildcard_string): New function.
4145 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4146 (Layout::layout_eh_frame): Ditto.
4147 (Layout::find_section_order_index): New method.
4148 (Layout::read_layout_from_file): New method.
4149 * layout.h (Layout::find_section_order_index): New method.
4150 (Layout::read_layout_from_file): New method.
4151 (Layout::input_section_position_): New private member.
4152 (Layout::input_section_glob_): New private member.
4153 * main.cc (main): Call read_layout_from_file here.
4154 * options.h (--section-ordering-file): New option.
4155 * output.cc (Output_section::input_section_order_specified_): New
4156 member.
4157 (Output_section::Output_section): Initialize new member.
4158 (Output_section::add_input_section): Add new parameter.
4159 Keep input sections when --section-ordering-file is used.
4160 (Output_section::set_final_data_size): Sort input sections when
4161 section ordering file is specified.
4162 (Output_section::Input_section_sort_entry): Add new parameter.
4163 Check sorting type.
4164 (Output_section::Input_section_sort_entry::compare_section_ordering):
4165 New method.
4166 (Output_section::Input_section_sort_compare::operator()): Change to
4167 consider section_order_index.
4168 (Output_section::Input_section_sort_init_fini_compare::operator()):
4169 Change to consider section_order_index.
4170 (Output_section::Input_section_sort_section_order_index_compare
4171 ::operator()): New method.
4172 (Output_section::sort_attached_input_sections): Change to sort
4173 according to section order when specified.
4174 (Output_section::add_input_section<32, true>): Add new parameter.
4175 (Output_section::add_input_section<64, true>): Add new parameter.
4176 (Output_section::add_input_section<32, false>): Add new parameter.
4177 (Output_section::add_input_section<64, false>): Add new parameter.
4178 * output.h (Output_section::add_input_section): Add new parameter.
4179 (Output_section::input_section_order_specified): New
4180 method.
4181 (Output_section::set_input_section_order_specified): New method.
4182 (Input_section::Input_section): Initialize section_order_index_.
4183 (Input_section::section_order_index): New method.
4184 (Input_section::set_section_order_index): New method.
4185 (Input_section::section_order_index_): New member.
4186 (Input_section::Input_section_sort_section_order_index_compare): New
4187 struct.
4188 (Output_section::input_section_order_specified_): New member.
4189 * script-sections.cc (is_wildcard_string): Delete and move modified
4190 method to gold.h.
4191 (Output_section_element_input::Output_section_element_input): Modify
4192 call to is_wildcard_string.
4193 (Output_section_element_input::Input_section_pattern
4194 ::Input_section_pattern): Ditto.
4195 (Output_section_element_input::Output_section_element_input): Ditto.
4196 * testsuite/Makefile.am (final_layout): New test case.
4197 * testsuite/Makefile.in: Regenerate.
4198 * testsuite/final_layout.cc: New file.
4199 * testsuite/final_layout.sh: New file.
4200
4201 2010-06-01 Rafael Espindola <espindola@google.com>
4202
4203 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4204
4205 2010-06-01 Rafael Espindola <espindola@google.com>
4206
4207 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4208 visibility of symbols.
4209
4210 2010-05-27 Doug Kwan <dougkwan@google.com>
4211
4212 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4213 from start of output section instead of address for a local symbol
4214 in a merged or relaxed section when doing a relocatable link.
4215
4216 2010-05-26 Rafael Espindola <espindola@google.com>
4217
4218 PR 11604
4219 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4220 adding sections the garbage collector removed.
4221 * gold/testsuite/Makefile.am: Add test.
4222 * gold/testsuite/Makefile.in: Regenerate.
4223 * gold/testsuite/plugin_test_7.sh: New.
4224 * gold/testsuite/plugin_test_7_1.c: New.
4225 * gold/testsuite/plugin_test_7_2.c: New.
4226
4227 2010-05-26 Rafael Espindola <espindola@google.com>
4228
4229 * script-sections.cc (Output_section_definition::set_section_addresses):
4230 Check for --section-start.
4231
4232 2010-05-26 Doug Kwan <dougkwan@google.com>
4233
4234 * arm.cc (Arm_scan_relocatable_relocs): New class.
4235 (Target_arm::relocate_special_relocatable): New method.
4236 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4237 (Arm_relocate_functions::thumb_branch_common): Same.
4238 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4239 instead of Default_scan_relocatable_relocs.
4240 * target-reloc.h (relocate_for_relocatable): Let target handle
4241 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4242 * target.h (Sized_target::relocate_special_relocatable): New method.
4243
4244 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4245
4246 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4247
4248 2010-05-23 Doug Kwan <dougkwan@google.com>
4249
4250 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4251 instead of a cast.
4252 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4253 with a direct branch, not a conditional branch, to a stub.
4254 * merge.cc (Output_merge_base::record_input_section): New method
4255 defintion.
4256 (Output_merge_data::do_add_input_section): Record input section if
4257 keeps-input-sections flag is set.
4258 (Output_merge_string::do_add_input_section): Ditto.
4259 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4260 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4261 INPUT_SECTIONS_.
4262 (Output_merge_base::keeps_input_sections,
4263 Output_merge_base::set_keeps_input_sections,
4264 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4265 method definitions.
4266 (Output_merge_base::Input_sections): New type declaration.
4267 (Output_merge_base::input_sections_begin,
4268 Output_merge_base::input_sections_end,
4269 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4270 (Output_merge_base::bool keeps_input_sections_,
4271 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4272 Output_merge_base::input_sections_): New data members.
4273 (Output_merge_data::do_set_keeps_input_sections): New method
4274 defintion.
4275 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4276 * output.cc (Output_section::Input_section::relobj): Move method
4277 defintion from class declaration to here and handle merge sections.
4278 (Output_section::Input_section::shndx): Ditto.
4279 (Output_section::Output_section): Remove initializations of removed
4280 data members and initialize new data member LOOKUP_MAPS_.
4281 (Output_section::add_input_section): Set keeps-input-sections flag
4282 for a newly created merge output section as appropriate. Adjust code
4283 to use Output_section_lookup_maps class.
4284 (Output_section::add_relaxed_input_section): Adjst code for lookup
4285 maps code refactoring.
4286 (Output_section::add_merge_input_section): Add a new parameter
4287 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4288 class. If adding input section to a newly created merge output
4289 section fails, remove the new merge section.
4290 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
4291 Adjust code for use of the Output_section_lookup_maps class.
4292 (Output_section::find_merge_section): Ditto.
4293 (Output_section::build_lookup_maps): New method defintion.
4294 (Output_section::find_relaxed_input_section): Adjust code to use
4295 Output_section_lookup_maps class.
4296 (Output_section::get_input_sections): Export merge sections. Adjust
4297 code to use Output_section_lookup_maps class.
4298 (Output_section:::add_script_input_section): Adjust code to use
4299 Output_section_lookup_maps class. Update lookup maps for merge
4300 sections also.
4301 (Output_section::discard_states): Use Output_section_lookup_maps.
4302 (Output_section::restore_states): Same.
4303 * output.h (Merge_section_properties): Move class defintion out of
4304 Output_section.
4305 (Output_section_lookup_maps): New class.
4306 (Output_section::Input_section::is_merge_section): New method
4307 defintion.
4308 (Output_section::Input_section::relobj): Move defintion out of class
4309 defintion. Declare method only.
4310 (Output_section::Input_section::shndx): Ditto.
4311 (Output_section::Input_section::output_merge_base): New method defintion.
4312 (Output_section::Input_section::u2_.pomb): New union field.
4313 (Output_section::Merge_section_by_properties_map,
4314 Output_section::Output_section_data_by_input_section_map,
4315 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4316 Remove types.
4317 (Output_section::add_merge_input_section): Add new parameter
4318 KEEPS_INPUT_SECTIONS.
4319 (Output_section::build_lookup_maps): New method declaration.
4320 (Output_section::merge_section_map_,
4321 Output_section::merge_section_by_properties_map_,
4322 Output_section::relaxed_input_section_map_,
4323 Output_section::is_relaxed_input_section_map_valid_): Remove data
4324 members.
4325 (Output_section::lookup_maps_): New data member.
4326
4327 2010-05-21 Doug Kwan <dougkwan@google.com>
4328
4329 PR gold/11619
4330 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4331 avoid a compilation error.
4332
4333 2010-05-19 Rafael Espindola <espindola@google.com>
4334
4335 * script-sections.cc (Output_section_definition::allocate_to_segment):
4336 Update the phdrs_list even when the output section is NULL.
4337 * testsuite/Makefile.am: Add test.
4338 * testsuite/Makefile.in: Regenerate.
4339 * testsuite/script_test_9.cc: New.
4340 * testsuite/script_test_9.sh: New.
4341 * testsuite/script_test_9.t: New.
4342
4343 2010-05-19 Doug Kwan <dougkwan@google.com>
4344
4345 * arm.cc (Arm_input_section::original_size): New method.
4346 (Arm_input_section::do_addralign): Add a cast.
4347 (Arm_input_section::do_output_offset): Remove static cast.
4348 (Arm_input_section::original_addralign,
4349 Arm_input_section::original_size_): Change type to uint32_t.
4350 (Arm_input_section::init): Add safe casts for section alignment
4351 and size.
4352 (Arm_input_section::set_final_data_size): Do not set address and
4353 offset of stub table.
4354 (Arm_output_section::fix_exidx_coverage): Change use of of
4355 Output_section::Simple_input_section to that of
4356 Output_section::Input_section.
4357 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4358 except for the first pass.
4359 * output.cc (Output_section::get_input_sections): Change type of
4360 input_sections to std::list<Input_section>.
4361 (Output_section::add_script_input_section): Rename from
4362 Output_section::add_simple_input_section. Change type of SIS
4363 parameter from Simple_input_section to Input_section.
4364 * output.h (Output_section::Simple_input_section): Remove class.
4365 (Output_section::Input_section): Change class visibility to public.
4366 (Output_section::Input_section::addralign): Use stored alignments
4367 for special input sections if set.
4368 (Output_section::Input_section::set_addralign): New method.
4369 (Output_section::get_input_sections): Change parameter type from
4370 list of Simple_input_section to list of Input_section.
4371 (Output_section::add_script_input_section): Rename from
4372 Output_section::add_simple_input_section. Change first parameter's
4373 type from Simple_input_section to Input_section and remove the
4374 second and third parameters.
4375 * script-sections.cc (Input_section::Input_section_list): Change
4376 type to list of Output_section::Input_section/
4377 (Input_section_info::Input_section_info): Change parameter type of
4378 INPUT_SECTION to Output_section::Input_section.
4379 (Input_section_info::input_section): Change return type.
4380 (Input_section_info::input_section_): Change type to
4381 Output_section::Input_section.
4382 (Output_section_element_input::set_section_addresses): Adjust code
4383 to use Output_section::Input_section instead of
4384 Output_section::Simple_input_section. Adjust code for renaming
4385 of Output_section::add_simple_input_section.
4386 (Orphan_output_section::set_section_addresses): Ditto.
4387
4388 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4389
4390 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4391 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4392
4393 2010-05-18 Rafael Espindola <espindola@google.com>
4394
4395 * options.cc (General_options::finalize): Handle -nostdlib.
4396 * options.h (nostdlib): New option.
4397 * script.cc (script_add_search_dir): Handle -nostdlib.
4398
4399 2010-05-12 Doug Kwan <dougkwan@google.com>
4400
4401 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4402 attributes section only if there no attributes section after merging.
4403 (Target_arm::merge_object_attributes): Move value of
4404 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
4405 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4406 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4407 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4408 and arm_attr_merge_7.stdout.
4409 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4410 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4411 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4412 arm_attr_merge_7b.o): New rules.
4413 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4414 arm_attr_merge_7
4415 * testsuite/Makefile.in: Regenerate.
4416 * testsuite/arm_attr_merge.sh: New file.
4417 * testsuite/arm_attr_merge_[67][ab].s: Same.
4418
4419 2010-05-05 Nick Clifton <nickc@redhat.com>
4420
4421 * po/es.po: Updated Spanish translation.
4422
4423 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4424
4425 * Makefile.am (install-exec-local): Properly install gold as
4426 default cross linker.
4427 * Makefile.in: Regenerated.
4428
4429 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4430 Nick Clifton <nickc@redhat.com>
4431
4432 * configure.ac (install_as_default): Define and set to false
4433 unless --enable-gold or --enable-gold=both/gold has been
4434 specified.
4435 * configure: Regenerate.
4436
4437 * Makefile.am (install-exec-local): Install the executable as
4438 'ld.gold'. If install_as_default is true then also install it as
4439 'ld'.
4440 * Makefile.in: Regenerated.
4441
4442 2010-04-24 Ian Lance Taylor <iant@google.com>
4443
4444 * layout.cc (Layout::layout_reloc): In relocatable link don't
4445 combine reloc sections for grouped sections.
4446
4447 2010-04-23 Sriraman Tallam <tmsriram@google.com>
4448
4449 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4450 sections that are not ordinary to icf.
4451 * icf.cc (get_section_contents): Handle relocation pointing to section
4452 with no object or shndx information.
4453 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4454 * testsuite/Makefile.in: Regenerate.
4455 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4456 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4457
4458 2010-04-22 Ian Lance Taylor <iant@google.com>
4459
4460 * expression.cc (Expression::Expression_eval_info): Add
4461 result_alignment_pointer field.
4462 (Expression::eval_with_dot): Add result_alignment_pointer
4463 parameter. Change all callers.
4464 (Expression::eval_maybe_dot): Likewise.
4465 (class Binary_expression): Add alignment_pointer parameter to
4466 left_value and right_value. Change all callers.
4467 (BINARY_EXPRESSION): Set result alignment.
4468 (class Trinary_expression): Add alignment_pointer parameter to
4469 arg2_value and arg3_value. Change all callers.
4470 (Trinary_cond::value): Set result alignment.
4471 (Max_expression::value, Min_expression::value): Likewise.
4472 (Align_expression::value): Likewise.
4473 * script-sections.cc (class Sections_element): Add dot_alignment
4474 parameter to set_section_addresses virtual function. Update
4475 instantiations.
4476 (class Output_section_element): Likewise.
4477 (Script_sections::create_segments): Add dot_alignment parameter.
4478 Change all callers.
4479 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4480 (Script_sections::set_phdrs_clause_addresses): Likewise.
4481 * script-sections.h: Update declarations.
4482 * script.h: Update declarations.
4483 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4484 min_p_align.
4485 * testsuite/script_test_3.t: Set large alignment.
4486 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4487 segment has expected alignment.
4488
4489 2010-04-22 Nick Clifton <nickc@redhat.com>
4490
4491 * po/gold.pot: Updated by the Translation project.
4492 * po/vi.po: Updated Vietnamese translation.
4493
4494 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4495
4496 * testsuite/Makefile.am (check_PROGRAMS): Add
4497 icf_virtual_function_folding_test.
4498 * testsuite/Makefile.in: Regenerated.
4499
4500 2010-04-15 Andrew Haley <aph@redhat.com>
4501
4502 * options.h (merge_exidx_entries): New option.
4503 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4504 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4505 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4506 (Target_arm::merge_exidx_entries): New function.
4507 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4508 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4509 to Arm_exidx_fixup constructor.
4510 Add new arg, merge_exidx_entries.
4511 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4512 Arm_output_section::fix_exidx_coverage.
4513
4514 2010-04-18 Sriraman Tallam <tmsriram@google.com>
4515
4516 * icf.cc (get_section_contents): Check for preemptible functions.
4517 Ignore addend when appropriate.
4518 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4519 section folded.
4520 (add_from_relobj): Check for section folded.
4521 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4522 * symtab.h (should_add_dynsym_entry): Add new parameter.
4523 * target-reloc.h (scan_relocs): Check for section folded.
4524 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4525 Check reloc types for function pointers in shared objects.
4526 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4527 case.
4528 (icf_preemptible_functions_test): New test case.
4529 (icf_string_merge_test): New test case.
4530 * testsuite.Makefile.in: Regenerate.
4531 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4532 bar_glob. Refactor code.
4533 * testsuite/icf_preemptible_functions_test.cc: New file.
4534 * testsuite/icf_preemptible_functions_test.sh: New file.
4535 * testsuite/icf_string_merge_test.cc: New file.
4536 * testsuite/icf_string_merge_test.sh: New file.
4537 * testsuite/icf_virtual_function_folding_test.cc: New file.
4538 * testsuite/icf_virtual_function_folding_test.sh: New file.
4539
4540 2010-04-14 Doug Kwan <dougkwan@google.com>
4541
4542 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4543 for local symbol recounting if we remove a section due to ICF.
4544 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4545 there are no regular objects in input.
4546
4547 2010-04-13 Doug Kwan <dougkwan@google.com>
4548
4549 * arm.cc (Arm_input_section::set_final_data_size): Compute
4550 accurate final data size instead of using current data size.
4551
4552 2010-04-09 Doug Kwan <dougkwan@google.com>
4553
4554 * layout.cc (Layout::choose_output_section): Handle script section
4555 types.
4556 (Layout::make_output_section_for_script): Add section type parameter.
4557 Handle script section types.
4558 * layout.h (Layout::make_output_section_for_script): Add section
4559 type parameter.
4560 * output.cc (Output_section::Output_section): Initialize data member
4561 is_noload_.
4562 (Output_section::do_reset_address_and_file_offset): Do not set address
4563 to 0 if section is a NOLOAD section.
4564 * output.h (Output_section::is_noload): New method.
4565 (Output_section::set_is_noload): Ditto.
4566 (Output_section::is_noload_): New data member.
4567 * script-c.h (Script_section_type): New enum type.
4568 (struct Parser_output_section_header): Add new file section_type.
4569 * script-sections.cc (Sections_element::output_section_name): Add
4570 parameter for returning script section type.
4571 (Output_section_definition::output_section_name): Ditto.
4572 (Output_section_definition::section_type)P; New method.
4573 (Output_section_definiton::script_section_type_name): Ditto.
4574 (Output_section_definition::script_section_type_): New data member.
4575 (Output_section_definition::Output_section_definition): Initialize
4576 data member Output_section_definition::script_section_type_.
4577 (Output_section_definition::create_sections): Pass script section type
4578 to Layout::make_output_section_for_script.
4579 (Output_section_definition::output_section_name): Return script
4580 section type to caller.
4581 (Output_section_definition::set_section_address): Do not advance
4582 dot value and load address if section type is NOLOAD. Set address
4583 of NOLOAD sections regardless of section flags.
4584 (Output_section_definition::print): Print section type if it is
4585 not SCRIPT_SECTION_TYPE_NONE.
4586 (Output_section_definition::section_type): New method.
4587 (Output_section_definition::script_section_type_name): Ditto.
4588 (Script_sections::output_section_name): Add new parameter
4589 PSECTION_TYPE for returning script section type. Pass it to
4590 section elements. Handle discard sections.
4591 (Sort_output_sections::operator()): Handle NOLOAD sections.
4592 * script-sections.h (Script_sections::Section_type): New enum type.
4593 (Script_sections::output_section_name): Add a new parameter for
4594 returning script section type.
4595 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4596 INFO and NOLOAD.
4597 * yyscript.y (union): Add new field SECTION_TYPE.
4598 (COPY, DSECT, INFO, NOLOAD): New tokens.
4599 (opt_address_and_section_type): Change type to output_section_header.
4600 (section_type): New non-terminal
4601 (section_header): Handle section type.
4602 (opt_address_and_section_type): Return section type value.
4603
4604 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4605
4606 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4607 * testsuite/plugin_common_test_2.c (foo): Likewise.
4608
4609 2010-04-08 Doug Kwan <dougkwan@google.com>
4610
4611 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4612 Output_merge_data.
4613 * output.cc (Output_section::add_merge_input_section): Simplify
4614 code and return status of Output_merge_base::add_input_section.
4615 Update merge section map only if Output_merge_base::add_input_section
4616 returns true.
4617
4618 2010-04-07 Doug Kwan <dougkwan@google.com>
4619
4620 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4621 if section is marked as containing instructions but has no mapping
4622 symbols.
4623 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4624 correct section index.
4625 (Arm_relobj::find_linked_text_section): Ditto.
4626
4627 2010-04-07 Cary Coutant <ccoutant@google.com>
4628
4629 * archive.cc (include_member): Destroy Read_symbols_data object before
4630 releasing file.
4631 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4632 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4633 (Read_symbols_data::~Read_symbols_data) New destructor.
4634 (Section_relocs::Section_relocs) New constructor.
4635 (Section_relocs::~Section_relocs) New destructor.
4636 (Read_relocs_data::Read_relocs_data) New constructor.
4637 (Read_relocs_data::~Read_relocs_data) New destructor.
4638 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4639 pointers to NULL after deleting.
4640
4641 2010-04-07 Doug Kwan <dougkwan@google.com>
4642
4643 * arm.cc: Replace "endianity" with "endianness" in comments.
4644 (Arm_exidx_cantunwind): Ditto.
4645 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4646 (Arm_relobj::merge_flags_and_attributes): New method.
4647 (Arm_relobj::merge_flags_and_attributes_): New data member.
4648 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4649 (Arm_relobj::scan_sections_for_stubs): Ditto.
4650 (Arm_relobj::do_read_symbols): Check to see if we really want to
4651 merge processor-specific flags and attributes. Exit early if
4652 an object is empty except for section names and the undefined symbol.
4653 (Target_arm::do_finalize_sections): Move check for ELF format to
4654 Arm_relobj::do_read_symbols. Merge processor specific flags and
4655 attributes from a regular object only when we have determined that
4656 it is aapropriate. Do not create an .ARM.attributes section in
4657 output if there is no regular input object.
4658 (Target_arm::merge_processor_specific_flags): Check
4659 --warn-mismatch before printing any error.
4660 (Target_arm::merge_object_attributes): Ditto.
4661 * gold.cc (queue_middle_tasks): Handle the case in which there is
4662 no regular object in input.
4663 * options.cc (General_options::parse_EB): New method.
4664 (General_options::parse_EL): Same.
4665 (General_options::General_options): Initialize endianness_.
4666 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4667 New options.
4668 (General_options::Endianness): New enum.
4669 (General_options::endianness): New method.
4670 (General_options::endianness_): New data member.
4671 * parameters.cc (Parameters::set_options): Check target endianness.
4672 (Parameters::set_target_once): Ditto.
4673 (Parameters::check_target_endianness): New method.
4674 (parameters_force_valid_target): If either -EL or -EB is specified,
4675 use it to define endianness of default target.
4676 * parameters.h (Parameters::check_target_endianness): New method
4677 declaration.
4678 * target.h (class Target): Change "endianity" to "endianness"
4679 in comments.
4680
4681 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4682
4683 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4684 * configure: Regenerate.
4685 * Makefile.in: Regenerate.
4686 * testsuite/Makefile.in: Regenerate.
4687
4688 2010-04-06 Cary Coutant <ccoutant@google.com>
4689
4690 gcc PR lto/42757
4691 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4692 prevailing definitions of common symbols.
4693 * testsuite/plugin_test_6.sh: New test case.
4694 * testsuite/plugin_common_test_1.c: New test case.
4695 * testsuite/plugin_common_test_2.c: New test case.
4696 * testsuite/Makefile.am (plugin_test_6): New test case.
4697 * testsuite/Makefile.in: Regenerate.
4698
4699 2010-04-06 Nick Clifton <nickc@redhat.com>
4700
4701 * po/vi.po: New Vietnamese translation.
4702
4703 2010-03-30 Doug Kwan <dougkwan@google.com>
4704
4705 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4706
4707 2010-03-25 Doug Kwan <dougkwan@google.com>
4708
4709 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4710 to avoid a conversion warning on a 32-bit host.
4711
4712 2010-03-24 Ian Lance Taylor <iant@google.com>
4713
4714 * testsuite/script_test_3.t: Add a TLS segment.
4715 * testsuite/Makefile.am (check_PROGRAMS): Add
4716 tls_phdrs_script_test.
4717 (tls_phdrs_script_test_SOURCES): Define.
4718 (tls_phdrs_script_test_DEPENDENCIES): Define.
4719 (tls_phdrs_script_test_LDFLAGS): Define.
4720 (tls_phdrs_script_test_LDADD): Define.
4721 * testsuite/Makefile.in: Rebuild.
4722
4723 2010-03-23 Cary Coutant <ccoutant@google.com>
4724
4725 * fileread.cc (find_or_make_view): Fix comment.
4726
4727 2010-03-23 Ian Lance Taylor <iant@google.com>
4728
4729 * script-sections.cc (class Orphan_section_placement): Define
4730 PLACE_TLS and PLACE_TLS_BSS.
4731 (Orphan_section_placement::Orphan_section_placement): Initialize
4732 new places.
4733 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4734 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4735 (tls_script_test_SOURCES): Define.
4736 (tls_script_test_DEPENDENCIES): Define.
4737 (tls_script_test_LDFLAGS): Define.
4738 (tls_script_test_LDADD): Define.
4739 * testsuite/Makefile.in: Rebuild.
4740
4741 2010-03-22 Doug Kwan <dougkwan@google.com>
4742
4743 * arm.cc (Arm_relocate_functions::abs8,
4744 Arm_relocate_functions::abs16): Use correct check for overflow
4745 specified in the ARM ELF specs.
4746 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4747 target of a BLX instruction specially.
4748 (Reloc_stub::stub_type_for_reloc): Ditto.
4749 (Relocate::relocate): Use symbolic names instead of numeric relocation
4750 codes to report error.
4751 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4752 workaround.
4753 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4754 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4755 thumb2_blx_out_of_range.stdout
4756 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4757 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4758 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4759 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4760 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4761 thumb2_blx_in_range, thumb2_blx_in_range.o,
4762 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4763 thumb2_blx_out_of_range.o): New rules.
4764 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4765 thumb2_blx_in_range and thumb2_blx_out_of_range.
4766 * testsuite/Makefile.in: Regenerate.
4767 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4768 * testsuite/thumb_blx_in_range.s: New file.
4769 * testsuite/thumb_blx_out_of_range.s: New file.
4770
4771 2010-03-22 Rafael Espindola <espindola@google.com>
4772
4773 * archive.cc (Should_include): Move to archive.h.
4774 (should_include_member): Make it a member of Archive.
4775 (Lib_group): New.
4776 (Add_lib_group_symbols): New.
4777 * archive.h: Include options.h.
4778 (Archive_member): Moved from Archive.
4779 (Should_include): Moved from archive.cc.
4780 (Lib_group): New.
4781 (Add_lib_group_symbols): New.
4782 * dynobj.cc (do_should_include_member): New.
4783 * dynobj.h (do_should_include_member): New.
4784 * gold.cc (queue_initial_tasks): Update call to queue.
4785 * main.cc (main): Print lib group stats.
4786 * object.cc (do_should_include_member): New.
4787 * object.h: Include archive.h.
4788 (Object::should_include_member): New.
4789 (Object::do_should_include_member): New.
4790 (Sized_relobj::do_should_include_member): New.
4791 * options.cc (General_options::parse_start_lib): New.
4792 (General_options::parse_end_lib): New.
4793 (Input_arguments::add_file): Handle lib groups.
4794 (Input_arguments::start_group): Check we are not in a lib.
4795 (Input_arguments::start_lib): New.
4796 (Input_arguments::end_lib): New.
4797 * options.h (General_options): Add start_lib and end_lib.
4798 (Input_argument::lib_): New.
4799 (Input_argument::lib): New.
4800 (Input_argument::is_lib): New.
4801 (Input_file_lib): New.
4802 (Input_arguments::in_lib_): New.
4803 (Input_arguments::in_lib): New.
4804 (Input_arguments::start_lib): New.
4805 (Input_arguments::end_lib_): New.
4806 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4807 in unused members as preempted.
4808 (Sized_pluginobj::do_should_include_member): New.
4809 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4810 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4811 return the blocker.
4812 (Read_symbols::do_whole_lib_group): New.
4813 (Read_symbols::do_lib_group): New.
4814 (Read_symbols::do_read_symbols): Handle lib groups.
4815 (Read_symbols::get_name): Handle lib groups.
4816 * readsyms.h (Read_symbols): Add an archive member pointer.
4817 (Read_symbols::do_whole_lib_group): New.
4818 (Read_symbols::do_lib_group): New.
4819 (Read_symbols::member_): New.
4820 * script.cc (read_input_script): Update call to queue_soon.
4821
4822 2010-03-19 Doug Kwan <dougkwan@google.com>
4823
4824 * arm.cc (Stub_table::Stub_table): Initialize new data members
4825 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4826 (Stub_table::add_reloc_stub): Assign stub offset and update
4827 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4828 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4829 New data members.
4830 (Stub_table::update_data_size_and_addralign): Use
4831 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4832 instead of going over all reloc stubs.
4833 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4834 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4835 Stringpool_template::offset_ to size of Stringpool_char.
4836 (Stringpool_template::new_key_offset): Remove code to initialize
4837 Stringpool_template::offset_.
4838 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4839 Stringpool_template::offset_ to zero.
4840
4841 2010-03-15 Doug Kwan <dougkwan@google.com>
4842
4843 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4844 offset_.
4845 (Stringpool_template::new_key_offset): New method.
4846 (Stringpool_template::add_string): Assign offsets when adding new
4847 strings.
4848 (Stringpool_template::set_string_offsets): Do not set string offsets
4849 when not optimizing.
4850 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4851 member size_.
4852 (Chunked_vector::clear): Clear size_.
4853 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4854 (Chunked_vector::size): Return size_.
4855 (Chunked_vector::push_back): Use size_ to find insert position.
4856 (Chunked_vector::size_): New data member.
4857 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4858 (Stringpool_template::new_key_offset): New method declaration.
4859 (Stringpool_template::offset_): New data member.
4860
4861 2010-03-15 Rafael Espindola <espindola@google.com>
4862
4863 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4864 Add_symbols' constructor.
4865 * readsyms.h (Add_symbols): Remove the input_group member.
4866
4867 2010-03-10 Ian Lance Taylor <iant@google.com>
4868
4869 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4870 target to ask whether a reference to a symbol requires a stack
4871 split.
4872 * target.h (Target::is_call_to_non_split): New function.
4873 (Target::do_is_call_to_non_split): Declare virtual function.
4874 * target.cc: Include "symtab.h".
4875 (Target::do_is_call_to_non_split): New function.
4876 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4877
4878 2010-03-10 Cary Coutant <ccoutant@google.com>
4879
4880 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4881 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4882 (File_read::open[2]): Add whole_file_view_ to list of views.
4883 (File_read::make_view): Remove test of whole_file_view_.
4884 (File_read::find_or_make_view): Create whole_file_view_ if
4885 necessary.
4886 (File_read::clear_views): Replace bool parameter with enum;
4887 adjust all callers. Don't delete views with permanent data;
4888 do delete cached views and views from archives if
4889 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4890 if clearing the corresponding view.
4891 * fileread.h (File_read::Clear_views_mode): New enum.
4892 (File_read::View::is_permanent_view): New method.
4893 (File_read::clear_views): Replace bool parameter
4894 with enum; adjust all callers.
4895 * options.h (General_options): Change keep_files_mapped option;
4896 add map_whole_files.
4897 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4898 releasing the file.
4899 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4900 the file.
4901
4902 2010-03-10 David S. Miller <davem@davemloft.net>
4903
4904 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4905
4906 2010-03-09 Sriraman Tallam <tmsriram@google.com>
4907
4908 * icf.cc (get_section_contents): Add '@' marker after processing the
4909 merge reloc.
4910
4911 2010-03-08 Doug Kwan <dougkwan@google.com>
4912
4913 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4914 due to a conversion warning.
4915 (Arm_relobj::update_output_local_symbol_count): Check for local
4916 symbol with unset output index.
4917
4918 2010-03-05 Ian Lance Taylor <iant@google.com>
4919
4920 * options.h (class General_options): Add --spare-dynamic-tags.
4921 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4922 --spare-dynamic-tags.
4923
4924 2010-03-05 Ian Lance Taylor <iant@google.com>
4925
4926 * incremental.cc: Include "libiberty.h".
4927
4928 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4929
4930 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4931 function, is_info_ member.
4932 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4933 (Versions::Versions): Update caller.
4934 (Versions::define_base_version): Likewise.
4935 (Versions::add_def): Likewise.
4936
4937 2010-03-03 Sriraman Tallam <tmsriram@google.com>
4938
4939 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4940 (Scan::possible_function_pointer_reloc): New function.
4941 (Scan::local_reloc_may_be_function_pointer): Change to call
4942 possible_function_pointer_reloc.
4943 (Scan::global_reloc_may_be_function_pointer): Ditto.
4944 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4945 relocations in ".data.rel.ro._ZTV" section.
4946 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4947 * testsuite/icf_safe_so_test.cc: Ditto.
4948 * testsuite/icf_safe_test.cc: Ditto.
4949 * testsuite/icf_safe_test.sh: Ditto.
4950
4951 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4952 Ian Lance Taylor <iant@google.com>
4953
4954 * target-reloc.h (relocate_section): Check the symbol table index
4955 for -1U before setting the local symbol index.
4956 (scan_relocatable_relocs): If copying the relocation, record that
4957 the local symbol is required.
4958 * object.h (Symbol_value::is_output_symtab_index_set): New
4959 function.
4960 (Symbol_value::may_be_discarded_from_output_symtab): New
4961 function.
4962 (Symbol_value::has_output_symtab_entry): New function.
4963 (Symbol_value::needs_output_symtab_entry): Remove.
4964 (Symbol_value::output_symtab_index): Make sure the symbol index is
4965 set.
4966 (Symbol_value::set_output_symtab_index): Make sure the symbol
4967 index is not set. Make sure the new index is valid.
4968 (Symbol_value::set_must_have_output_symtab_entry): New function.
4969 (Symbol_value::has_output_dynsym_entry): New function.
4970 (Symbol_value::set_output_dynsym_index): Make sure the new index
4971 is valid.
4972 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4973 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4974 local symbol if permitted.
4975 (Sized_relobj::do_finalize_local_symbols): Call
4976 is_output_symtab_index_set rather than needs_output_symtab_entry.
4977 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4978 rather than needs_output_symtab_entry. Call
4979 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4980 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4981 is_output_symtab_index_set rather than needs_output_symtab_entry.
4982 * testsuite/discard_locals_relocatable_test.c: New file.
4983 * testsuite/discard_locals_test.sh: Test -r.
4984 * testsuite/Makefile.am (check_DATA): Add
4985 discard_locals_relocatable_test1.syms,
4986 discard_local_relocatable_test2.syms.
4987 (MOSTLYCLEANFILES): Likewise. Also add
4988 discard_locals_relocatable_test1.lout and
4989 discard_locals_relocatable_test2.out.
4990 (discard_locals_relocatable_test1.syms): New target.
4991 (discard_locals_relocatable_test.o): New target.
4992 (discard_locals_relocatable_test1.out): New target.
4993 (discard_locals_relocatable_test2.syms): New target.
4994 (discard_locals_relocatable_test2.out): New target.
4995 (various): Add missing ../ld-new dependencies.
4996 * testsuite/Makefile.in: Rebuild.
4997
4998 2010-03-03 Nick Clifton <nickc@redhat.com>
4999
5000 * po/fi.po: New Finnish translation.
5001
5002 2010-03-01 Doug Kwan <dougkwan@google.com>
5003
5004 * layout.cc (Layout::Layout): Force section types of .init_array*,
5005 .preinit_array* and .fini_array* sections.
5006 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5007 Fix check of return value of std::string::find.().
5008 (Output_section::Input_section_sort_compare::operator()): Remove
5009 comment about .init_array.
5010 (Output_section::Input_section_sort_init_fini_compare::operator()):
5011 New method.
5012 (Output_section::sort_attached_input_sections): Handle .init_array
5013 and .fini_array specially.
5014 * output.h (Output_section::Inut_section_sort_compare): Update
5015 comment.
5016 (Output_section::Input_section_sort_init_fini_compare): New struct.
5017
5018 2010-02-26 Doug Kwan <dougkwan@google.com>
5019
5020 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5021 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5022 * testsuite/debug_msg.sh: Avoid matching source line number for
5023 use of global variable undef_int.
5024
5025 2010-02-26 Doug Kwan <dougkwan@google.com>
5026
5027 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5028 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5029 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5030 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5031 * options.cc (General_options::General_options): Initialize member
5032 fix_v4bx_.
5033 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5034 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5035 and rm_no_fix_v4bx.stdout
5036 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5037 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5038 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5039 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5040 and arm_no_fix_v4bx.
5041 * Makefile.in: Regenerate.
5042 * testsuite/arm_fix_v4bx.s: New file.
5043 * testsuite/arm_fix_v4bx.sh: Ditto.
5044
5045 2010-02-24 Doug Kwan <dougkwan@google.com>
5046
5047 * arm.cc (Target_arm::got_section): Make the .got section the first
5048 non RELRO section in the data segment.
5049 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5050 suffixes of section names.
5051
5052 2010-02-24 Doug Kwan <dougkwan@google.com>
5053
5054 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5055 flags and attributes merging if an input file is a binary file.
5056 * fileread.cc (Input_file::open): Record format of original file.
5057 * fileread.h (Input_file::Format): New enum type.
5058 (Input_file::Input_file): Initialize data member format_.
5059 (Input_file::format): New method definition.
5060 (Input_file::format_):: New data member.
5061
5062 2010-02-24 Doug Kwan <dougkwan@google.com>
5063
5064 * arm.cc (Arm_output_data_got): New class.
5065 (ARM_TCB_SIZE): New constant
5066 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5067 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5068 If user uses a script with a SECTIONS clause, issue only a warning
5069 for a misplaced EXIDX input section. Otherwise, issue an error.
5070 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5071 garbage collection.
5072 (Target_arm::got_mode_index_entry): Handle static linking.
5073 (Target_arm::Scan::local): Ditto.
5074 (Target_arm::Scan::global): Ditto.
5075 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5076 all incorrectly implemented relocations.
5077 (Target_arm::fix_exidx_coverage): Pass layout to
5078 Arm_output_section::fix_exidx_coverage.
5079 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5080 from ".ARM.exidx." and ".ARM.extab.".
5081
5082 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5083
5084 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5085 section if it does not already exist.
5086 * attributes.cc (Attributes_section_data::Attributes_section_data):
5087 Don't crash if size is zero.
5088
5089 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5090 Ian Lance Taylor <iant@google.com>
5091
5092 * gold.cc (queue_middle_tasks): If no input files were opened,
5093 exit.
5094 * workqueue.h (Task_function::Task_function): Assert that there is
5095 a blocker.
5096
5097 2010-02-22 Doug Kwan <dougkwan@google.com>
5098
5099 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5100 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5101 types to avoid warnings due to different uint64_t implementations
5102 on different hosts.
5103
5104 2010-02-21 Doug Kwan <dougkwan@google.com>
5105
5106 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5107 handling of the maximum backward branch offset.
5108 (Arm_relocate_functions::thumb_branch_common): Ditto.
5109 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5110 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
5111 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
5112 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5113 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5114 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5115 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5116 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5117 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5118 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5119 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5120 thumb2_bl_out_of_range.o): New rules.
5121 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5122 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5123 thumb2_bl_out_of_range
5124 * testsuite/Makefile.in: Regenerate.
5125 * testsuite/arm_bl_in_range.s: New file.
5126 * testsuite/arm_bl_out_of_range.s: Ditto.
5127 * testsuite/arm_branch_in_range.sh: Ditto.
5128 * testsuite/arm_branch_range.t: Ditto.
5129 * testsuite/thumb2_branch_range.t: Ditto.
5130 * testsuite/thumb_bl_in_range.s: Ditto.
5131 * testsuite/thumb_bl_out_of_range.s: Ditto.
5132 * testsuite/thumb_branch_range.t: Ditto.
5133
5134 2010-02-20 Sriraman Tallam <tmsriram@google.com>
5135
5136 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5137 Add reloc offset information.
5138 * icf.cc (get_section_contents): Change iterators to point to the new
5139 vectors. Add reloc offset information to the contents.
5140 * icf.h (Icf::Sections_reachable_info): New typedef.
5141 (Icf::Sections_reachable_list): New typedef.
5142 (Icf::Offset_info): New typedef.
5143 (Icf::Reloc_info): New struct typedef.
5144 (Icf::Reloc_info_list): New typedef.
5145 (Icf::symbol_reloc_list): Delete method.
5146 (Icf::addend_reloc_list): Delete method.
5147 (Icf::section_reloc_list): Delete method.
5148 (Icf::reloc_info_list): New method.
5149 (Icf::reloc_info_list_): New member.
5150
5151 2010-02-19 Doug Kwan <dougkwan@google.com>
5152
5153 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5154 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5155 * arm.cc (Arm_relocation_functions): New forward declaration.
5156 (Target_arm::Target_arm): Initialize new data members
5157 got_mod_index_offset_ and tls_base_symbol_defined_.
5158 (Target_arm::Relocate::relocate_tls): New method.
5159 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5160 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5161 New methods.
5162 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5163 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5164 (Target_arm::got_mod_index_offset_,
5165 Target_arm::tls_base_symbol_defined_): New data members.
5166 (Target_arm::Scan::local, Target::Scan::global,
5167 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5168 relocations.
5169
5170 2010-02-18 Doug Kwan <dougkwan@google.com>
5171
5172 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5173 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5174 text section as a parameter becuase some broken tools may not set
5175 the link in section header.
5176 (Target_arm::has_got_section): New method.
5177 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5178 without any mapping symbol as data only. Remove warning.
5179 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5180 link in its section header, try to discover the link by inspecting the
5181 REL31 relocation at the beginning of the section.
5182 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5183 in error message.
5184 (Target_arm::Scan::global): Treat any reference to the symbol
5185 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5186
5187 2010-02-12 Sriraman Tallam <tmsriram@google.com>
5188
5189 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5190 (Scan::global_reloc_may_be_function_pointer): New function.
5191 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5192 (Scan::global_reloc_may_be_function_pointer): New function.
5193 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5194 (Scan::global_reloc_may_be_function_pointer): New function.
5195 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5196 (Scan::global_reloc_may_be_function_pointer): New function.
5197 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5198 (Scan::global_reloc_may_be_function_pointer): New function.
5199 (Scan::possible_function_pointer_reloc): New function.
5200 (Target_x86_64::can_check_for_function_pointers): New function.
5201 * gc.h (gc_process_relocs): Scan relocation types to determine if
5202 function pointers were taken for targets that support it.
5203 * icf.cc (Icf::find_identical_sections): Include functions for
5204 folding in safe ICF whose pointer is not taken.
5205 * icf.h (Secn_fptr_taken_set): New typedef.
5206 (fptr_section_id_): New member.
5207 (section_has_function_pointers): New function.
5208 (set_section_has_function_pointers): New function.
5209 (check_section_for_function_pointers): New function.
5210 * options.h: Fix comment for safe ICF option.
5211 * target.h (can_check_for_function_pointers): New function.
5212 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5213 Modify icf_safe_test for X86-64.
5214 * testsuite/Makefile.in: Regenerate.
5215 * testsuite/icf_safe_so_test.cc: New file.
5216 * testsuite/icf_safe_so_test.sh: New file.
5217 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5218 (main): Change to take pointer to function kept_func_3.
5219 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5220 folding is done correctly for X86-64.
5221
5222 2010-02-12 David S. Miller <davem@davemloft.net>
5223
5224 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5225 is_symbolless parameter.
5226 (Output_reloc<SHT_REL>::is_symbolless): New.
5227 (Output_reloc<SHT_REL>::is_symbolless_): New.
5228 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5229 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5230 (Output_reloc<SHT_RELA>::is_symbolless): New.
5231 (Output_data_reloc::add_global): Handle is_symbolless.
5232 (Output_data_reloc::add_global_relative): Likewise.
5233 (Output_data_reloc::add_local): Likewise.
5234 (Output_data_reloc::add_local_relative): Likewise.
5235 (Output_data_reloc::add_symbolless_global_addend): New.
5236 (Output_data_reloc::add_symbolless_local_addend): New.
5237 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5238 is_symbolless.
5239 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5240 instead of ->is_relative_
5241 (Output_reloc::write): Likewise.
5242 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5243 (Output_reloc::write_rel): Simplify.
5244
5245 * sparc.cc (Target_sparc::Scan::local): Use
5246 ->add_symbolless_local_addend as needed.
5247 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5248 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5249 based upon relocation offset.
5250
5251 2010-02-11 Doug Kwan <dougkwan@google.com>
5252
5253 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5254 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5255 beginning of function.
5256 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5257 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5258 parameter is_32bit in calls to should_apply_static_reloc.
5259 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5260 (check_DATA): Add arm_abs_global.stdout.
5261 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5262 arm_abs_global.stdout): New rules.
5263 (MOSTLLYCLEANFILES): Add arm_abs_global
5264 * Makefile.in: Regenerate.
5265 * testsuite/arm_abs_global.s: New file.
5266 * testsuite/arm_abs_global.sh: Ditto.
5267 * testsuite/arm_abs_lib.s: Ditto.
5268
5269 2010-02-11 Ian Lance Taylor <iant@google.com>
5270
5271 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5272 Read_relocs task.
5273 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5274 Allocate_commons_task first.
5275 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5276 task, rather than symtab_lock_.
5277 (Gc_process_relocs::~Gc_process_relocs): New function.
5278 (Gc_process_relocs::is_runnable): Check this_blocker_.
5279 (Gc_process_relocs::locks): Use next_blocker_ rather than
5280 blocker_.
5281 (Scan_relocs::~Scan_relocs): New function.
5282 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5283 symtab_lock_.
5284 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5285 next_blocker_.
5286 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5287 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5288 constructor accordingly.
5289 (class Gc_process_relocs): Likewise.
5290 (class Scan_relocs): Likewise.
5291 * common.h (class Allocate_commons_task): Remove symtab_lock_
5292 field, and corresponding constructor parameter.
5293 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5294 symtab_lock_.
5295 (Allocate_commons_task::locks): Likewise.
5296
5297 2010-02-11 Ian Lance Taylor <iant@google.com>
5298
5299 * gold-threads.h (class Once): Define.
5300 (class Initialize_lock): Rewrite as child of Once.
5301 * gold-threads.cc (class Once_initialize): Define.
5302 (once_pointer_control): New static variable.
5303 (once_pointer, once_arg): New static variables.
5304 (c_run_once): New static function.
5305 (Once::Once, Once::run_once, Once::internal_run): New functions.
5306 (class Initialize_lock_once): Remove.
5307 (initialize_lock_control): Remove.
5308 (initialize_lock_pointer): Remove.
5309 (initialize_lock_once): Remove.
5310 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5311 (Initialize_lock::initialize): Rewrite.
5312 (Initialize_lock::do_run_once): New function.
5313 * archive.cc (Archive::interpret_header): Only clear name if it is
5314 not already empty.
5315 * fileread.cc: Include "gold-threads.h"
5316 (file_counts_lock): New static variable.
5317 (file_counts_initialize_lock): Likewise.
5318 (File_read::release): Only increment counts when using --stats.
5319 Use a lock around the increment.
5320 * parameters.cc (class Set_parameters_target_once): Define.
5321 (set_parameters_target_once): New static variable.
5322 (Parameters::Parameters): Move here from parameters.h.
5323 (Parameters::set_target): Rewrite.
5324 (Parameters::set_target_once): New function.
5325 (Parameters::clear_target): Move here and rewrite.
5326 * parameters.h (class Parameters): Update declarations. Add
5327 set_parameters_target_once_ field.
5328 (Parameters::Parameters): Move to parameters.cc.
5329 (Parameters::clear_target): Likewise.
5330 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5331 task.
5332 (Start_group::~Start_group): New function.
5333 (Start_group::is_runnable): New function.
5334 (Start_group::locks, Start_group::run): New functions.
5335 (Finish_group::run): Change saw_undefined to size_t.
5336 * readsyms.h (class Start_group): Define.
5337 (class Finish_group): Change saw_undefined_ field to size_t.
5338 (Finish_group::Finish_group): Remove saw_undefined and
5339 this_blocker parameters. Change all callers.
5340 (Finish_group::set_saw_undefined): New function.
5341 (Finish_group::set_blocker): New function.
5342 * symtab.h (class Symbol_table): Change saw_undefined to return
5343 size_t. Change saw_undefined_ field to size_t.
5344 * target-select.cc (Set_target_once::do_run_once): New function.
5345 (Target_selector::Target_selector): Initialize set_target_once_
5346 field. Don't initialize lock_ and initialize_lock_ fields.
5347 (Target_selector::instantiate_target): Rewrite.
5348 (Target_selector::set_target): New function.
5349 * target-select.h (class Set_target_once): Define.
5350 (class Target_selector): Update declarations. Make
5351 Set_target_once a friend. Remove lock_ and initialize_lock_
5352 fields. Add set_target_once_ field.
5353
5354 2010-02-10 Ian Lance Taylor <iant@google.com>
5355
5356 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5357 queueing any tasks.
5358 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5359 (queue_middle_tasks): Add all blockers before queueing any tasks.
5360 (queue_final_tasks): Likewise.
5361 * token.h (Task_token::add_blockers): New function.
5362 * object.h (Input_objects::number_of_relobjs): New function.
5363
5364 2010-02-10 Ian Lance Taylor <iant@google.com>
5365
5366 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5367 shared, not if not position independent.
5368 * x86_64.cc (Relocate::relocate_tls): Likewise.
5369 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5370 (tls_pie_pic_test): New target.
5371 * testsuite/Makefile.in: Rebuild.
5372
5373 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5374 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5375 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5376 * testsuite/Makefile.in: Rebuild.
5377
5378 2010-02-09 David S. Miller <davem@davemloft.net>
5379
5380 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5381 R_SPARC_RELATIVE using ->add_local_relative().
5382 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5383
5384 * output.h (Output_data_dynamic::add_section_size): New method
5385 that takes two Output_data objects.
5386 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5387 entry param. Handle it in initializers.
5388 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5389 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5390 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5391 arg.
5392 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5393 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5394 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5395 for dynrel_includes_plt.
5396 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5397 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5398 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5399 before .rela.plt
5400 (Target_sparc::do_finalize_sections): Update to pass true for
5401 dynrel_includes_plt.
5402 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5403 output before .rela.plt
5404 (Target_powerpc::do_finalize_sections): Update to pass true for
5405 dynrel_includes_plt when 32-bit.
5406
5407 2010-02-08 Doug Kwan <dougkwan@google.com>
5408
5409 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5410 method.
5411 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5412 Arm_relobj::scan_section_for_cortex_a8_stubs,
5413 Arm_relobj::do_relocation_section): Instead of calling
5414 Output_section::output_address, use faster
5415 Arm_relobj::simple_input_section_output_address.
5416
5417 2010-02-08 David S. Miller <davem@davemloft.net>
5418
5419 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5420 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5421 relocation helper function.
5422
5423 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5424 just like R_SPARC_GOT{10,13,22}.
5425 (Target_sparc::Scan::local): Likewise.
5426 (Target_sparc::Relocate:relocate): Likewise.
5427
5428 2010-02-06 Ian Lance Taylor <iant@google.com>
5429
5430 * configure.ac: Rewrite targetobjs duplicate removal code to use
5431 only shell constructs.
5432 * configure: Rebuild.
5433
5434 2010-02-05 Doug Kwan <dougkwan@google.com>
5435
5436 PR 11247
5437 * arm.cc (Arm_relobj::section_is_scannable): New method.
5438 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5439 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5440
5441 2010-02-04 Doug Kwan <dougkwan@google.com>
5442
5443 PR 11247
5444 * arm-reloc-property.cc (cstdio): Include.
5445 * configure.ac (targetobjs): Remove duplicates.
5446 * configure: Regenerate.
5447 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5448 big and little endian version for a given address size.
5449
5450 2010-02-03 Doug Kwan <dougkwan@google.com>
5451
5452 * arm-reloc-property.cc
5453 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5454 definition.
5455 * arm-reloc-property.h
5456 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5457 New method definition.
5458 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5459 declaration.
5460 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5461 overflow to N.
5462 (GOT_PREL): Change implemented to Y.
5463 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5464 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5465 (Arm_relocate_functions::movw_abs_nc): Remove method.
5466 (Arm_relocate_functions::movt_abs): Ditto.
5467 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5468 (Arm_relocate_functions::thm_movt_abs): Ditto.
5469 (Arm_relocate_functions::movw_rel_nc): Ditto.
5470 (Arm_relocate_functions::movw_rel): Ditto.
5471 (Arm_relocate_functions::movt_rel): Ditto.
5472 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5473 (Arm_relocate_functions:thm_movw_rel): Ditto.
5474 (Arm_relocate_functions:thm_movt_rel): Ditto.
5475 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5476 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5477 New method definitions.
5478 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5479 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5480 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5481 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5482 (Target_arm::Relocate::relocate): Check for non-static or
5483 unimplemented relocation code and exit early. Change calls to
5484 Target_arm::reloc_uses_thumb_bit and
5485 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5486 instead. Refactor code to handle similar relocations to increase
5487 code sharing. Remove check for unsupported relocation code in switch
5488 statement.
5489 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5490 relocation property table to find out size. Change error message to
5491 print out the name of a relocation code instead of the numeric value.
5492 (Target_arm::scan_reloc_for_stub): Use relocation property table
5493 instead of calling Target_arm::reloc_uses_thumb_bit().
5494
5495 2010-02-02 Doug Kwan <dougkwan@google.com>
5496
5497 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5498 types of relaxed input section.
5499
5500 2010-02-02 Doug Kwan <dougkwan@google.com>
5501
5502 * Makefile.am (HFILES): Add arm-reloc-property.h.
5503 (DEFFILES): New.
5504 (TARGETSOURCES): Add arm-reloc-property.cc
5505 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5506 (libgold_a_SOURCES): $(DEFFILES)
5507 * Makefile.in: Regenerate.
5508 * arm-reloc-property.cc: New file.
5509 * arm-reloc-property.h: New file.
5510 * arm-reloc.def: New file.
5511 * arm.cc: Update comments.
5512 (arm-reloc-property.h): New included header.
5513 (arm_reloc_property_table): New global variable.
5514 (Target_arm::do_select_as_default_target): New method definition.
5515 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5516 arm-reloc-property to targ_extra_obj.
5517 * parameters.cc (set_parameters_target): Call
5518 Target::select_as_default_target().
5519 * target.h (Target::select_as_default_target): New method definition.
5520 (Target::do_select_as_default_target): Same.
5521
5522 2010-02-01 Doug Kwan <dougkwan@google.com>
5523
5524 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5525 first_output_text_section_.
5526 (Arm_exidx_fixup::first_output_text_section): New method definition.
5527 (Arm_exidx_fixup::first_output_text_section_): New data member.
5528 (Arm_exidx_fixup::process_exidx_section): Record the first text
5529 output section seen.
5530 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5531 and entsize in output section header.
5532
5533 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5534
5535 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5536 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5537 (Arm_relocate_functions::thm_alu11): New Method.
5538 (Arm_relocate_functions::thm_pc8): New Method.
5539 (Arm_relocate_functions::thm_pc12): New Method.
5540 (Target_arm::Scan::local): Handle the relocations.
5541 (Target_arm::Scan::global): Likewise.
5542 (Target_arm::Relocate::relocate): Likewise.
5543 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5544
5545 2010-01-29 Doug Kwan <dougkwan@google.com>
5546
5547 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5548 of relocation types as ld.
5549
5550 2010-01-29 Doug Kwan <dougkwan@google.com>
5551
5552 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5553 to public.
5554 (Arm_relocate_functions::thumb_branch_common): Ditto.
5555 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5556 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5557 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5558 Arm_relocate_functions::jump24): Remove.
5559 (Target_arm::Relocate::relocate): Adjust code to call
5560 Arm_relocation_functions::arm_branch_common and
5561 Arm_relocation_functions::thumb_branch_common instead of their removed
5562 wrappers. Merge switch-cases together to reduce source code size.
5563
5564 2010-01-29 Doug Kwan <dougkwan@google.com>
5565
5566 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5567 output_local_symbol_count_needs_update_.
5568 (Arm_relobj::output_local_symbol_count_needs_update,
5569 Arm_relobj::set_output_local_symbol_count_needs_update,
5570 Arm_relobj::update_output_local_symbol_count): New methods.
5571 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5572 member.
5573 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5574 of pointed function as in a R_ARM_PREL31 relocation.
5575 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5576 for output local symbol count updating.
5577 (Target_arm::do_relax): Update output local symbol counts in objects
5578 if necessary.
5579 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5580
5581 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5582
5583 * arm.cc: Added support for the ARM relocations:
5584 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5585 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5586 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5587 movw_prel_nc).
5588 (Arm_relocate_functions::movw_rel): New method.
5589 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5590 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5591 thm_movw_prel_nc).
5592 (Arm_relocate_functions::thm_movw_rel): New method.
5593 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5594 thm_movt_prel).
5595 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5596 relocations.
5597 (Target_arm::Scan::global): Likewise.
5598 (Target_arm::Relocate::relocate): Likewise.
5599 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5600 Likewise.
5601
5602 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5603
5604 * arm.cc: Added support for ARM group relocations.
5605 (Target_arm::reloc_needs_sym_origin): New method.
5606 (Arm_relocate_functions::calc_grp_kn): New method.
5607 (Arm_relocate_functions::calc_grp_residual): New method.
5608 (Arm_relocate_functions::calc_grp_gn): New method.
5609 (Arm_relocate_functions::arm_grp_alu): New Method.
5610 (Arm_relocate_functions::arm_grp_ldr): New Method.
5611 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5612 (Arm_relocate_functions::arm_grp_ldc): New Method.
5613 (Target_arm::Scan::local): Handle the ARM group relocations.
5614 (Target_arm::Scan::global): Likewise.
5615 (Target_arm::Relocate::relocate): Likewise.
5616 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5617 Likewise.
5618
5619 2010-01-26 Doug Kwan <dougkwan@google.com>
5620
5621 * arm.cc (set): Include.
5622 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5623 pointer type.
5624 (Arm_output_section::Text_section_list): New type.
5625 (Arm_output_section::append_text_sections_to_list): New method.
5626 (Arm_output_section::fix_exidx_coverage): Ditto.
5627 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5628 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5629 Relobj::set_section_offset() instead of
5630 Sized_relobj::invalidate_section_offset().
5631 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5632 parameter for section headers. Ignore relocation sections for
5633 unallocated sections and EXIDX sections.
5634 (Target_arm::fix_exidx_coverage): New method.
5635 (Target_arm::output_section_address_less_than): New type.
5636 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5637 linked text section instead of the EXIDX section.
5638 (Arm_output_section::create_stub_group): Add an assertion to check
5639 that this is not an EXIDX output section.
5640 (Arm_output_section::append_text_sections_to_list): New method.
5641 (Arm_output_section::fix_exidx_coverage): Ditto.
5642 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5643 Arm_relobj::section_needs_reloc_stub_scanning.
5644 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5645 first pass.
5646 (Target_arm::fix_exidx_coverage): New method.
5647 * object.h (Relobj::set_output_section): New method.
5648 (Sized_relobj::invalidate_section_offset): Remove method.
5649 (Sized_relobj::do_invalidate_section_offset): Remove method.
5650 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5651
5652 2010-01-25 Doug Kwan <dougkwan@google.com>
5653
5654 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5655 Fix warning due to signed and unsigned comparison on a 32-bit host.
5656
5657 2010-01-22 Doug Kwan <dougkwan@google.com>
5658
5659 * arm.cc (Target_arm::do_relax): Record an output section for section
5660 offset adjustment it contains any stub table that has changed.
5661 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5662 offsets in an output section if necessary.
5663 * output.cc (Output_section::Output_section): Initialize
5664 section_offsets_need_adjustments_.
5665 (Output_section::add_input_section_for_script): Renamed to
5666 Output_section::add_simple_input_section.
5667 (Output_section::save_states): Add a comment.
5668 (Output_section::discard_states): New method defintion.
5669 (Output_section::adjust_section_offsets): Same.
5670 * output.h (Output_section::add_input_section_for_script): Renamed to
5671 Output_section::add_simple_input_section.
5672 (Output_section::discard_states): New method declaration.
5673 (Output_section::adjust_section_offsets): Same.
5674 (Output_section::section_offsets_need_adjustment,
5675 Output_section::set_section_offsets_need_adjustment): New method
5676 definitions.
5677 (Output_section::section_offsets_need_adjustment_): New data member.
5678 * script-sections.cc
5679 (Output_section_element_input::set_section_address): Adjust code for
5680 renaming of Output_section::add_input_section_for_script.
5681 (Orphan_output_section::set_section_address): Same.
5682
5683 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5684
5685 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5686 Fix_v4bx enum values .
5687 * gold/options.h (General_options): New option definitions.
5688 (General_options::fix_v4bx): New method.
5689 (General_options::Fix_v4bx): New enum.
5690 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5691 (General_options::parse_fix_v4bx_interworking): New method.
5692
5693 2010-01-22 Doug Kwan <dougkwan@google.com>
5694
5695 * arm.cc (Arm_exidx_fixup): New class.
5696
5697 2010-01-21 Doug Kwan <dougkwan@google.com>
5698
5699 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5700 classes.
5701 (Arm_exidx_section_offset_map): New type.
5702
5703 2010-01-21 Doug Kwan <dougkwan@google.com>
5704
5705 * arm.cc (Arm_exidx_input_section): New class.
5706 (Arm_relobj::exidx_input_section_by_link,
5707 Arm_relobj::exidx_input_section_by_shndx,
5708 Arm_relobj::make_exidx_input_section): New methods.
5709 (read_arm_attributes_section): Remove.
5710 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5711 information about them.
5712 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5713 to here.
5714
5715 2010-01-20 Doug Kwan <dougkwan@google.com>
5716
5717 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5718 Input_section_specifier to Section_id.
5719 (Target_arm::new_arm_input_section: Adjust code for change of key
5720 type.
5721 (Target_arm::find_arm_input_section): Ditto.
5722 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5723 (Section_id): Remove.
5724 (Garbage_collection::Section_id_hash): Remove.
5725 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5726 (Section_id): Remove.
5727 (Icf::Section_id_hash): Remove.
5728 * object.h (Section_id, Const_section_id, Section_id_hash,
5729 Const_section_id_hash): New type definitions.
5730 * output.cc (Output_section::add_relaxed_input_section): Change to
5731 use Const_section_id instead of Input_section_specifier as key type.
5732 (Output_section::add_merge_input_section): Ditto.
5733 (Output_section::build_relaxation_map): Change to use Section_id
5734 instead of Input_section_specifier as key type.
5735 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5736 Ditto.
5737 (Output_section::convert_input_sections_to_relaxed_sections): Change
5738 to use Const_section_id instead of Input_section_specifier as key type.
5739 (Output_section::find_merge_section): Ditto.
5740 (Output_section::find_relaxed_input_section): Ditto.
5741 * output.h (Input_section_specifier): Remove class.
5742 (Output_section::Output_section_data_by_input_section_map): Change
5743 key type to Const_section_id.
5744 (Output_section::Output_relaxed_input_section_by_input_section_map):
5745 Ditto.
5746 (Output_section::Relaxation_map): Change key type to Section_id.
5747
5748 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5749
5750 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5751 (class Arm_v4bx_stub): New class.
5752 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5753 (Stub_factory::make_arm_v4bx_stub): New method.
5754 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5755 (Stub_table::empty): Handle v4bx stubs.
5756 (Stub_table::add_arm_v4bx_stub): New method.
5757 (Stub_table::find_arm_v4bx_stub): New method.
5758 (Arm_relocate_functions::v4bx): New method.
5759 (Target_arm::fix_v4bx): New method.
5760 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5761 (Stub_table::relocate_stubs): Likewise.
5762 (Stub_table::do_write): Likewise.
5763 (Stub_table::update_data_size_and_addralign): Likewise.
5764 (Stub_table::finalize_stubs): Likewise.
5765 (Target_arm::Scan::local): Likewise.
5766 (Target_arm::Scan::global): Likewise.
5767 (Target_arm::do_finalize_sections): Likewise.
5768 (Target_arm::Relocate::relocate): Likewise.
5769 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5770 Likewise.
5771 (Target_arm::scan_reloc_for_stub): Likewise.
5772 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5773
5774 2010-01-19 Ian Lance Taylor <iant@google.com>
5775
5776 * output.cc (Output_section_headers::do_sized_write): Write large
5777 segment count to sh_info field.
5778 (Output_file_header::do_sized_write): For large segment count,
5779 write PN_XNUM to e_phnum field.
5780
5781 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5782
5783 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5784 (Arm_relocate_functions::thm_jump8): New function.
5785 (Arm_relocate_functions::thm_jump11): New function.
5786 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5787 R_ARM_THM_JUMP11.
5788 (Target_arm::Scan::global): Likewise.
5789 (Target_arm::Relocate::relocate): Likewise.
5790 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5791 Likewise.
5792
5793 2010-01-14 Doug Kwan <dougkwan@google.com>
5794
5795 * arm.cc (map, utility): Include headers.
5796 (Target_arm::apply_cortex_a8_workaround): New method.
5797 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5798 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5799 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5800 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5801 the --[no-]fix-cortex-a8 command line options.
5802 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5803 (Target_arm::relocate_stub): Use addend in instruction template.
5804 * options.h (DEFINE_bool): Set the user-set flag.
5805 (General_options): Add --[no-]-fix-cortex options.
5806 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
5807 : Update fast look-up map after conversion.
5808
5809 2010-01-14 Sriraman Tallam <tmsriram@google.com>
5810
5811 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5812 in the first pass of do_layout.
5813
5814 2010-01-13 Doug Kwan <dougkwan@google.com>
5815
5816 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5817 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5818 apparent compiler problem of not folding static constant integral
5819 data members of elfcpp::Elf_sizes<32>.
5820
5821 2010-01-13 Doug Kwan <dougkwan@google.com>
5822
5823 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5824 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5825 Arm_relobj::scan_section_for_cortex_a8_erratum,
5826 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5827 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5828 sections to scan for relocation stubs into a new method
5829 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5830 relocation and Cortex-A8 stub scanning.
5831 (Target_arm::do_relax): Force stubs to be after stubbed sections
5832 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
5833 the beginning of a new relaxation pass. Update a comment.
5834 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5835
5836 2010-01-12 Ian Lance Taylor <iant@google.com>
5837
5838 * target-reloc.h (visibility_error): New inline function.
5839 (relocate_section): Call visibility_error.
5840 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5841 (MOSTLYCLEANFILES): Likewise.
5842 (protected_4_pic.o, protected_3.err): New targets.
5843 * testsuite/protected_4.cc: New file.
5844
5845 2010-01-12 Doug Kwan <dougkwan@google.com>
5846
5847 * arm.cc (Cortex_a8_reloc): New class.
5848 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5849 and cortex_a8_relocs_info_.
5850 (Target_arm::fix_cortex_a8): New method definition.
5851 (Target_arm::Cortex_a8_relocs_info): New type.
5852 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5853 New data member declarations.
5854 (Target_arm::scan_reloc_for_stub): Record information about
5855 relocations for THUMB branches that might be exempted from the
5856 Cortex-A8 workaround.
5857 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5858 at the beginning of a relaxation pass.
5859
5860 2010-01-12 Doug Kwan <dougkwan@google.com>
5861
5862 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5863 (Arm_relobj::Mapping_symbol_position,
5864 Arm_reloj::Mapping_symbol_position_less,
5865 Arm_relobj::Mapping_symbols_info): New types.
5866 (Target_arm::is_mapping_symbol_name): New method definition.
5867 (Arm_relobj::do_count_local_symbols): Save information about mapping
5868 symbols.
5869
5870 2010-01-11 Doug Kwan <dougkwan@google.com>
5871
5872 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5873 Arm_relocate_functions::thumb32_branch_upper,
5874 Arm_relocate_functions::thumb32_branch_lower,
5875 Arm_relocate_functions::thumb32_cond_branch_offset,
5876 Arm_relocate_functions::thumb32_cond_branch_upper,
5877 Arm_relocate_functions::thumb32_cond_branch_lower,
5878 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5879 branch offset encoding.
5880 (Arm_relocate_functions::thumb_branch_common): Use new branch
5881 offset encoding methods to avoid code duplication.
5882 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5883 (Stub_addend_reader::operator()): Use new branch encoding method
5884 to avoid code duplication.
5885
5886 2010-01-11 Doug Kwan <dougkwan@google.com>
5887
5888 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5889 (Target_arm::do_finalize_sections): Define special EXIDX section
5890 symbols only if referenced.
5891 * gc.h (Garbage_collection::add_reference): New method.
5892 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5893 code duplication.
5894
5895 2010-01-11 Ian Lance Taylor <iant@google.com>
5896
5897 * script.cc (Version_script_info::build_expression_list_lookup):
5898 Change complaing about duplicate wildcard match from error to
5899 warning.
5900
5901 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5902 of 2009-12-30.
5903 (Version_script_info::Version_script_info): Initialize globs_,
5904 default_version_, default_is_global_, and exact_. Don't
5905 initialize globals_ or locals_.
5906 (Version_script_info::build_lookup_tables): Build local symbols
5907 first.
5908 (Version_script_info::unquote): New function.
5909 (Version_script_info::add_exact_match): New function.
5910 (Version_script_info::build_expression_list_lookup): Remove lookup
5911 parameter. Add is_global parameter. Change all callers. Handle
5912 wildcard pattern specially. Unquote pattern. Call
5913 add_exact_match.
5914 (Version_script_info::get_name_to_match): New function.
5915 (Version_script_info::get_symbol_version): New function.
5916 (Version_script_info::get_symbol_version_helper): Remove.
5917 (Version_script_info::check_unmatched_names): Call unquote.
5918 * script.h (class Version_script_info): Change get_symbol_version
5919 to be non-inline and add is_global parameter; change all callers.
5920 Rewrite symbol_is_local. Update declarations. Define struct
5921 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5922 Remove globals_ and locals_ members. Add exact_, globs_,
5923 default_version_, is_global_.
5924 (Version_script_info::Glob): Remove pattern, add expression and
5925 is_global. Update constructor. Change all callers.
5926 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5927 default version.
5928 (Versions::symbol_section_contents): If a symbol is undefined, or
5929 defined in a dynamic object, set the version index to
5930 VER_NDX_LOCAL.
5931 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5932 symbol_is_local.
5933 (Symbol_table::add_from_pluginobj): Likewise.
5934 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5935
5936 2010-01-11 Doug Kwan <dougkwan@google.com>
5937
5938 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5939 (incremental_dump_LDADD): Add linking option for libintl.
5940 * Makefile.in: Regenerate.
5941
5942 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5943
5944 PR gold/11144
5945 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5946 instead of -Ds.
5947 * testsuite/Makefile.in: Regenerated.
5948
5949 2010-01-10 Doug Kwan <dougkwan@google.com>
5950
5951 * options.h (DEFINE_var): Use parentheses around argument varname__
5952 in macro body to avoid any unintended subsequent substitutions.
5953
5954 2010-01-10 Ian Lance Taylor <iant@google.com>
5955
5956 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5957 candidates before doing symbol resolution.
5958
5959 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5960 ODR candidates if only one is weak.
5961
5962 2010-01-08 Ian Lance Taylor <iant@google.com>
5963
5964 * script.cc (Version_script_info::build_expression_list_lookup):
5965 Don't warn about ambiguous version, just record the ambiguity.
5966 (Version_script_info::get_symbol_version_helper): Give error if
5967 version is ambiguous.
5968
5969 2010-01-08 Doug Kwan <dougkwan@google.com>
5970
5971 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5972 prev_data_size_ and prev_addralign_. Remove initializer for
5973 deleted data member has_been_changed_.
5974 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5975 to determine if the table is empty.
5976 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5977 Remove.
5978 (Stub_table::add_reloc_stub): Define method in class definition
5979 instead of just declaring it there.
5980 (Stub_table::add_cortex_a8_stub): New method definition.
5981 (Stub_table::update_data_size_and_addralign): Ditto.
5982 (Stub_table::finalize_stubs): Ditto.
5983 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5984 (Stub_table::do_addralign_): Return address alignment in the
5985 (Stub_table::do_reset_address_and_file_offset): Define method in
5986 class definition instead of declaring it there. Set current data
5987 size to be the data size of the previous pass.
5988 (Stub_table::set_final_data_size): Use current data size as the
5989 final data size.
5990 (Stub_table::relocate_stub): Change parameter type of stub from
5991 Reloc_stub pointer to Stub pointer.
5992 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5993 (Stub_table::Cortex_a8_stub_list): New typedef.
5994 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5995 Stub_table::prev_addralign_): New data member.
5996 (Arm_relobj::Arm_relobj): Initialize data member
5997 section_has_cortex_a8_workaround_.
5998 (Arm_relobj::section_has_cortex_a8_workaround,
5999 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6000 definitions.
6001 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6002 declarations.
6003 (Target_arm::relocate_stub): Change parameter type of stub from
6004 Reloc_stub pointer to Stub pointer.
6005 (Insn_template::size, Insn_template::alignment): Handle
6006 THUMB16_SPECIAL_TYPE.
6007 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6008 Stub_table::update_data_size_and_addralign,
6009 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6010 definitions.
6011 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6012 (Stub_table::do_write): Ditto.
6013 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6014
6015 2010-01-08 Ian Lance Taylor <iant@google.com>
6016
6017 PR 11108
6018 * symtab.h (class Symbol): Remove fields is_target_special_ and
6019 has_plt_offset_. Add field is_defined_in_discarded_section_.
6020 (Symbol::is_defined_in_discarded_section): New function.
6021 (Symbol::set_is_defined_in_discarded_section): New function.
6022 (Symbol::has_plt_offset): Rewrite.
6023 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6024 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6025 Don't initialize is_target_special_ or has_plt_offset_.
6026 Initialize is_defined_in_discarded_section_.
6027 (Symbol_table::add_from_relobj): If appropriate, set
6028 is_defined_in_discarded_section.
6029 * resolve.cc (Symbol::override_base_with_special): Don't test
6030 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6031 * target-reloc.h (relocate_section): Do special handling for
6032 symbols defined in discarded sections for global symbols as well
6033 as local symbols.
6034
6035 2010-01-08 Ian Lance Taylor <iant@google.com>
6036
6037 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6038 the SHT_SYMTAB case.
6039
6040 2010-01-08 Ian Lance Taylor <iant@google.com>
6041
6042 * object.cc (Sized_relobj::do_layout): Don't get confused if
6043 layout_eh_frame returns NULL.
6044
6045 2010-01-08 Ian Lance Taylor <iant@google.com>
6046
6047 PR 11084
6048 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6049 dynamic symbol table, use the normal symbol table.
6050 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6051 symbol table.
6052
6053 2010-01-08 Ian Lance Taylor <iant@google.com>
6054
6055 PR 11072
6056 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6057 sections.
6058
6059 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6060
6061 * version.cc (print_version): Change to "Copyright 2010".
6062
6063 2010-01-08 Ian Lance Taylor <iant@google.com>
6064
6065 PR 10287
6066 PR 11063
6067 * i386.cc (class Target_i386): Change return type of plt_section
6068 to be non-const.
6069 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6070 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6071 tls_desc_rel_ field.
6072 (Output_data_plt_i386::rel_tls_desc): New function.
6073 (Target_i386::rel_tls_desc_section): New function.
6074 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6075 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6076 R_386_TLS_DESC reloc in rel_tls_desc_section.
6077 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6078 Define struct Tlsdesc_info.
6079 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6080 (Target_x86_64::do_reloc_symbol_index): New function.
6081 (Target_x86_64::add_tlsdesc_info): New function.
6082 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6083 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6084 tlsdesc_rel_ field.
6085 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6086 all callers.
6087 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6088 (Target_x86_64::rela_tlsdesc_section): New function.
6089 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6090 handling.
6091 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6092 (Target_x86_64::do_reloc_addend): New function.
6093 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6094 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6095 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6096 (Output_reloc::type): New function.
6097 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6098 (Output_reloc::is_target_specific): New function.
6099 (Output_reloc::target_arg): New function.
6100 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6101 absolute relocs and target specific relocs.
6102 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6103 add_target_specific.
6104 (class Output_data_reloc) [SHT_RELA]: Likewise.
6105 * output.cc (Output_reloc::Output_reloc): Add four new versions
6106 for absolute relocs and target specific relocs.
6107 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6108 (Output_reloc::get_symbol_index): Likewise.
6109 (Output_reloc::local_section_offset): Check that local_sym_index_
6110 is not TARGET_CODE or 0.
6111 (Output_reloc::symbol_value): Likewise.
6112 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6113 reloc.
6114 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6115 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6116 functions.
6117 * layout.cc (add_target_dynamic_tags): Use output section for
6118 DT_PLTRELSZ and DT_JMPREL.
6119
6120 2010-01-07 Ian Lance Taylor <iant@google.com>
6121
6122 PR 11061
6123 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6124 function.
6125 (class Output_data_reloc_generic): Define.
6126 (class Output_data_reloc_base): Change base class to
6127 Output_data_reloc_generic. Change add() method to call
6128 bump_relative_reloc_count for a relative reloc. Remove
6129 sort_relocs_ field.
6130 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6131 to sort_relocs().
6132 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6133 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6134 appropriate.
6135 * layout.h (class Layout): Update declaration.
6136
6137 2010-01-07 Ian Lance Taylor <iant@google.com>
6138
6139 * output.h (class Output_data): Add const version of
6140 output_section and do_output_section.
6141 (class Output_section_data): Add const version of
6142 do_output_section.
6143 (class Output_section): Likewise.
6144 * layout.cc (Layout::add_target_dynamic_tags): New function.
6145 * layout.h (class Layout): Update declarations.
6146 * arm.cc (Target_arm::do_finalize_sections): Use
6147 add_target_dynamic_tags.
6148 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6149 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6150 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6151 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6152
6153 2010-01-07 Ian Lance Taylor <iant@google.com>
6154
6155 PR 11042
6156 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6157 object as needed.
6158
6159 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6160 Ian Lance Taylor <iant@google.com>
6161
6162 PR 11019
6163 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6164 Xindex::read_symtab_xindex.
6165
6166 2010-01-07 Doug Kwan <dougkwan@google.com>
6167
6168 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6169 (Insn_template::thumb16_bcond_insn): New method declaration.
6170 (Insn_template): Fix spelling.
6171 (Stub::thumb16_special): New method declaration.
6172 (Stub::do_write): Define virtual method which was previously pure
6173 virtual.
6174 (Stub::do_thumb16_special): New method declaration.
6175 (Stub::do_fixed_endian_write): New template member.
6176 (Reloc_stub::do_write): Remove.
6177 (Reloc_stub::do_fixed_endian_write): Remove.
6178 (Cortex_a8_stub): New class definition.
6179 (Stub_factory::make_cortex_a8_stub): New method definition.
6180 (Stub_factory::Stub_factory): Add missing static storage class
6181 qualifier for elf32_arm_stub_a8_veneer_blx.
6182
6183 2010-01-07 Ian Lance Taylor <iant@google.com>
6184
6185 PR 10980
6186 * options.h (class General_options): Add --warn-unresolved-symbols
6187 and --error-unresolved-symbols.
6188 * errors.cc (Errors::undefined_symbol): Implement
6189 --warn-unresolved-symbols.
6190
6191 * options.h (class General_options): Add -z text and -z textoff.
6192 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6193
6194 2010-01-06 Sriraman Tallam <tmsriram@google.com>
6195
6196 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6197 (Garbage_collection::cident_sections): New function.
6198 (Garbage_collection::add_cident_section): New function.
6199 (Garbage_collection::cident_sections_): New member.
6200 (gc_process_relocs): Add references to sections whose names are C
6201 identifiers.
6202 * gold.h (cident_section_start_prefix): New constant.
6203 (cident_section_stop_prefix): New constant.
6204 (is_cident): New function.
6205 * layout.cc (Layout::define_section_symbols): Replace string constants
6206 with the newly defined constants.
6207 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6208 C identifiers.
6209 * testsuite/Makefile.am: Add gc_orphan_section_test.
6210 * testsuite/Makefile.in: Regenerate.
6211 * testsuite/gc_orphan_section_test.cc: New file.
6212 * testsuite/gc_orphan_section_test.sh: New file.
6213
6214 2010-01-06 Ian Lance Taylor <iant@google.com>
6215
6216 PR 10980
6217 * options.h (class General_options): Add --warn-shared-textrel.
6218 * layout.cc (Layout::finish_dynamic_section): Implement
6219 --warn-shared-textrel.
6220
6221 PR 10980
6222 * options.h (class General_options): Add --warn-multiple-gp.
6223
6224 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6225
6226 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6227 $(THREADSLIB) and $(LIBDL).
6228 * Makefile.in: Rebuild.
6229
6230 2010-01-06 Ian Lance Taylor <iant@google.com>
6231
6232 PR 10980
6233 * options.cc (General_options::parse_section_start): New function.
6234 (General_options::section_start): New function.
6235 (General_options::General_options): Initialize all members.
6236 * options.h: Include <map>
6237 (class General_options): Add --section-start. Add section_starts_
6238 member.
6239 * layout.cc (Layout::attach_allocated_section_to_segment): If
6240 --section-start was used, set the address of the segment. Remove
6241 local sort_sections.
6242 (Layout::relaxation_loop_body): If the address of the load segment
6243 has been set by --section-start, don't use it.
6244 * output.h (Output_segment::update_flags_for_output_section): New
6245 function.
6246 * output.cc (Output_segment::add_output_section): Call
6247 update_flags_for_output_section.
6248
6249 2010-01-05 Ian Lance Taylor <iant@google.com>
6250
6251 PR 10980
6252 * options.h (class General_options): Add --undefined-version.
6253 * script.cc (struct Version_expression): Add was_matched_by_symbol
6254 field.
6255 (Version_script_info::matched_symbol): New function.
6256 (Version_script_info::get_symbol_version_helper): Call
6257 matched_symbol.
6258 (Version_script_info::check_unmatched_names): New function.
6259 * script.h (class Version_script_info): Update declarations.
6260 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6261
6262 * options.h (class General_options): Use DEFINE_bool_alias for
6263 allow_multiple_definition.
6264 * resolve.cc (Symbol_table::should_override): Don't test
6265 allow_multiple_definition.
6266
6267 PR 10980
6268 * options.h (class General_options): Add --cref.
6269 * main.cc (main): Print cref table if --cref. Don't close mapfile
6270 until after printing cref table.
6271 * cref.cc: Include "symtab.h".
6272 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6273 (Cref_table_compare::operator()): New function.
6274 (Cref_inputs::gather_cref): New function.
6275 (filecol): New static const.
6276 (Cref_inputs::print_cref): New function.
6277 (Cref::print_cref): New function.
6278 * cref.h: Include <cstdio>.
6279 (class Cref): Update declarations.
6280 * mapfile.h (Mapfile::file): New function.
6281 * object.h (class Object): Define Symbols. Declare virtual
6282 do_get_global_symbols.
6283 (Object::get_global_symbols): New function.
6284 * object.cc (Input_objects::add_object): Pass object to cref_ if
6285 --cref.
6286 (Input_objects::archive_start): Likewise.
6287 (Input_objects::archive_stop): Likewise.
6288 (Input_objects::print_cref): New function.
6289 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6290 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6291 --cref.
6292 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6293 function.
6294 * plugin.h (class Sized_pluginobj): Update declarations.
6295
6296 2010-01-05 Ian Lance Taylor <iant@google.com>
6297
6298 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6299 to is_default_version. Rename insdef to insdefault.
6300 (Symbol_table::add_from_relobj): Rename def to is_default_version
6301 and local to is_forced_local.
6302 (Symbol_table::add_from_pluginobj): Likewise.
6303 (Symbol_table::add_from_dynobj): Likewise.
6304 (Symbol_table::define_special_symbol): Rename insdef to
6305 insdefault.
6306
6307 2010-01-04 Ian Lance Taylor <iant@google.com>
6308
6309 PR 10980
6310 * options.h (class General_options): Add
6311 --allow-multiple-definition and -z muldefs.
6312 * resolve.cc (Symbol_table::should_override): Don't warn about a
6313 multiple symbol definition if --allow-multiple-definition or -z
6314 muldefs.
6315
6316 PR 10980
6317 * options.h (class General_options): Add --add-needed and
6318 --copy-dt-needed-entries. Tweak --as-needed help entry.
6319 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6320 error if --copy-dt-needed-entries aka --add-needed is used and
6321 would cause a change in behaviour.
6322
6323 PR 10980
6324 * options.h (class General_options): Add -G as a short version of
6325 --shared. Add no-op options -assert, -g, and -i.
6326
6327 2010-01-04 Sriraman Tallam <tmsriram@google.com>
6328
6329 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6330 check for .text or .gnu.linkonce.t sections.
6331 * icf.cc (Icf::find_identical_sections): Ditto.
6332 Change the detection for mangled function name within the section
6333 name.
6334 * icf.h (is_section_foldable_candidate): New function.
6335
6336 2009-12-30 Ian Lance Taylor <iant@google.com>
6337
6338 PR 10980
6339 * options.h (class General_options): Permit two dashes with
6340 --retain-symbols-file.
6341
6342 2009-12-30 Ian Lance Taylor <iant@google.com>
6343
6344 PR 10979
6345 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6346 don't put the file header and segment headers in the text
6347 segment.
6348
6349 PR 10979
6350 * common.cc (Sort_commons::operator()): Stabilize sort when both
6351 entries are NULL.
6352 (Symbol_table::do_allocate_commons_list): When allocating common
6353 symbols, skip a symbol which is no longer common.
6354 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6355 an object before checking its type.
6356 * testsuite/common_test_2.c: New file.
6357 * testsuite/common_test_3.c: New file.
6358 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6359 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6360 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6361 (common_test_2_pic.o, common_test_2.so): New targets.
6362 (common_test_3_pic.o, common_test_3.so): New targets.
6363 * testsuite/Makefile.in: Rebuild.
6364
6365 PR 10979
6366 * script.cc (read_input_script): If we see a new SECTIONS clause,
6367 and we have added an input section, give an error.
6368 * layout.h (class Layout): Add have_added_input_section function.
6369 Add have_added_input_section_ field.
6370 * layout.cc (Layout::Layout): Initialize
6371 have_added_input_section_.
6372 (Layout::layout): Set have_added_input_section_.
6373 (Layout::layout_eh_frame): Likewise.
6374
6375 2009-12-30 Ian Lance Taylor <iant@google.com>
6376
6377 PR 10931
6378 * options.h (class General_options): Add --sort-common option.
6379 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6380 * common.cc (Sort_common): Add sort_order parameter to
6381 constructor. Add sort_order_ field.
6382 (Sort_commons::operator): Check sort_order_.
6383 (Symbol_table::allocate_commons): Determine the sort order.
6384 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6385 Change all callers.
6386 (Symbol_table::do_allocate_commons_list): Likewise.
6387
6388 2009-12-30 Ian Lance Taylor <iant@google.com>
6389
6390 PR 10916
6391 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6392 symbols from this object, don't change the visibility of an
6393 undefined symbol.
6394 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6395
6396 2009-12-30 Ian Lance Taylor <iant@google.com>
6397
6398 PR 10861
6399 * script.h (class Version_script_info): Define Language enum.
6400 Update declarations. Define Glob, Exact, and Lookup types. Add
6401 new fields globals_, locals_, and is_finalized_.
6402 * script.cc: Various formatting fixes.
6403 (class Parser_closure): Change language_stack_ from a vector of
6404 std::string to one of Version_script_info::Language. Adjust all
6405 uses accordingly.
6406 (class Lazy_demangler): Remove.
6407 (struct Version_expression): Change language from std::string to
6408 Version_script_info::Language.
6409 (Version_script_info::Version_script_info): New function.
6410 (Version_script_info::~Version_script_info): Don't call clear.
6411 (Version_script_info::finalize): New function.
6412 (Version_script_info::build_lookup_tables): New function.
6413 (Version_script_info::build_expression_list_lookup): New
6414 function.
6415 (Version_script_info::get_symbol_version_helper): Rewrite to use
6416 lookup tables.
6417 (Version_script_info::print_expression_list): Adjust to use
6418 Version_script_info::Language.
6419 (script_push_lex_into_version_mode): Check that the version script
6420 has not been finalized.
6421 (version_script_push_lang): Change language string to
6422 Version_script_info::Language.
6423 * options.cc (Command_line::version_script): New function.
6424 * options.h (class General_options): Add finalize_dynamic_list
6425 function. Change version_script from declaration to definition.
6426 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6427 * testsuite/version_script.map: Remove duplicate def of foo.
6428 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6429 version_script.map.
6430 * testsuite/Makefile.in: Rebuild.
6431
6432 2009-12-30 Ian Lance Taylor <iant@google.com>
6433
6434 PR 10843
6435 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6436 if the input symbol index is 0, make the output symbol index 0.
6437
6438 2009-12-30 Ian Lance Taylor <iant@google.com>
6439
6440 PR 10670
6441 * options.h (class General_options): Add -x/--discard-all.
6442 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6443 --discard-all. If the local symbol needs a dynamic entry, check
6444 that before handling --discard-locals.
6445
6446 2009-12-30 Ian Lance Taylor <iant@google.com>
6447
6448 PR 10450
6449 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6450 flags to PF_R.
6451 (Output_segment::add_output_section): Don't change the flags if
6452 the type is PT_TLS.
6453
6454 PR 10450
6455 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6456 GNU hash table if they need a dynamic value. Otherwise, don't add
6457 them if they are defined in a dynamic object or are forced local.
6458
6459 2009-12-29 Ian Lance Taylor <iant@google.com>
6460
6461 PR 10450
6462 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6463 .gnu.hash table for a 32-bit target.
6464
6465 PR 10450
6466 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6467 regular and a dynamic object only needs a dynamic symbol table
6468 entry if it is externally visible.
6469
6470 PR 10450
6471 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6472 constructor. Add global_offset_table_ field.
6473 (Target_i386::got_section): Set global_offset_table_.
6474 (Target_i386::do_finalize_sections): Set global_offset_table_
6475 size.
6476 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6477 in constructor. Add global_offset_table_ field.
6478 (Target_x86_64::got_section): Set global_offset_table_.
6479 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6480 size.
6481
6482 * layout.cc (Layout::Layout): Initialize increase_relro_.
6483 (Layout::get_output_section): Add is_relro, is_last_relro, and
6484 is_first_non_relro parameters. Change all callers.
6485 (Layout::choose_output_section): Likewise.
6486 (Layout::add_output_section_data): Likewise.
6487 (Layout::make_output_section): Likewise.
6488 (Layout::set_segment_offsets): Clear increase_relro when using a
6489 linker script.
6490 * layout.h (class Layout): Add increase_relro method. Add
6491 increase_relro_ field. Update declarations.
6492 * output.cc (Output_section::Output_section): Initialize
6493 is_last_relro_ and is_first_non_relro_.
6494 (Output_segment::add_output_section): Group relro sections is
6495 do_sort is true. Handle is_last_relro and is_first_non_relro.
6496 (Output_segment::maximum_alignment): Remove relro handling.
6497 (Output_segment::set_section_addresses): Add increase_relro
6498 parameter. Change all callers. Add initial alignment to align
6499 relro sections on separate page. Remove old relro handling.
6500 (Output_segment::set_section_list_addresses): Remove in_relro
6501 parameter. Change all callers.
6502 (Output_segment::set_offset): Add increase parameter. Change all
6503 callers. Remove old relro handling.
6504 * output.h (class Output_section): Add new methods: is_last_relro,
6505 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6506 Add is_last_relro_ and is_first_non_relro_ fields.
6507 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6508 Create separate .got.plt section. Call increase_relro.
6509 * x86_64.cc (Target_x86_64::got_section): Likewise.
6510 * testsuite/relro_script_test.t: Add .got.plt.
6511
6512 PR 10450
6513 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6514 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6515 (Layout::finalize): Call set_dynamic_symbol_size.
6516 (Layout::set_dynamic_symbol_size): New function.
6517 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6518 set_dynamic_symbol_size.
6519
6520 PR 10450
6521 * output.h (class Output_section): Add is_entsize_zero_ field.
6522 * output.cc (Output_section::Output_section): Initialize
6523 is_entsize_zero_.
6524 (Output_section::set_entsize): If two different entsizes are
6525 requested, force it to zero.
6526 (Output_section::add_input_section): Set flags for .debug_str
6527 before updating section flags. Set entsize.
6528 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6529 and SHF_STRING if all input sections have those flags.
6530
6531 2009-12-29 Rafael Espindola <espindola@google.com>
6532
6533 * main.cc (main): Fix the sys time reporting.
6534 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6535 reporting.
6536
6537 2009-12-29 Sriraman Tallam <tmsriram@google.com>
6538
6539 * options.cc (General_options::parse_version): Allow -v to exit
6540 without an error if there is nothing to link.
6541
6542 2009-12-29 Ian Lance Taylor <iant@google.com>
6543
6544 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6545 using a version of gcc before 4.1.
6546 * configure: Rebuild.
6547
6548 2009-12-28 Chris Demetriou <cgd@google.com>
6549
6550 * attributes.cc (Output_attributes_section_data::do_write): Use
6551 std::vector::front rather than std::vector::data.
6552
6553 2009-12-28 Ian Lance Taylor <iant@google.com>
6554
6555 * symtab.h (class Symbol_table): Add enum Defined.
6556 * resolve.cc (Symbol_table::should_override): Add defined
6557 parameter. Change all callers. Test whether object is NULL
6558 before calling a method on it.
6559 (Symbol_table::report_resolve_problem): Add defined parameter.
6560 Change all callers.
6561 (Symbol_table::should_override_with_special): Likewise.
6562 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6563 parameter. Change all callers.
6564 (Symbol_table::do_define_in_output_data): Likewise.
6565 (Symbol_table::define_in_output_segment): Likewise.
6566 (Symbol_table::do_define_in_output_segment): Likewise.
6567 (Symbol_table::define_as_constant): Likewise.
6568 (Symbol_table::do_define_as_constant): Likewise.
6569 * script.h (class Symbol_assignment): Add is_defsym parameter to
6570 constructor; change all callers.
6571 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6572 parameter. Change all callers. Add is_defsym_ field.
6573 (class Parser_closure): Add parsing_defsym parameter to
6574 constructor; change all callers. Add parsing_defsym accessor
6575 function. Add parsing_defsym_ field.
6576
6577 2009-12-28 Ian Lance Taylor <iant@google.com>
6578
6579 * gold.cc (queue_middle_tasks): Fix formatting.
6580 * object.cc (Relobj::is_section_name_included): Likewise.
6581
6582 2009-12-23 Ian Lance Taylor <iant@google.com>
6583
6584 * i386.cc (Target_i386::do_calls_non_split): Recognize
6585 -fsplit-stack prologue for a function with a static chain.
6586 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6587 -fsplit-stack prologue when using %r11.
6588
6589 2009-12-21 Sriraman Tallam <tmsriram@google.com>
6590
6591 * options.cc (General_options::parse_version): Make -v continue and do
6592 the link like GNU ld does.
6593
6594 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
6595
6596 * Makefile.am (CCFILES): Add timer.cc.
6597 (HFILES): Add timer.h.
6598 * configure.ac: Check for sysconf and times.
6599 * main.cc: include timer.h.
6600 (main): Use Timer instead of get_run_time.
6601 * timer.cc: New.
6602 * timer.h: New.
6603 * workqueue.cc: include timer.h.
6604 (Workqueue::find_and_run_task):
6605 Report user, sys and wall time.
6606 * Makefile.in: Regenerate.
6607 * config.in: Regenerate.
6608 * configure: Regenerate.
6609
6610 2009-12-16 Doug Kwan <dougkwan@google.com>
6611
6612 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6613 sections.
6614 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6615 relaxed input sections.
6616 * output.cc (Output_section::find_relaxed_input_section): Change
6617 return type to Output_relaxed_input_section pointer. Adjust code
6618 for new type of relaxed_input_section_map_.
6619 * output.h (Output_section::find_relaxed_input_section): Change
6620 return type to Output_relaxed_input_section pointer.
6621 (Output_section::Output_relaxed_input_section_by_input_section_map):
6622 New type.
6623 (Output_section::relaxed_input_section_map_): Change type to
6624 Output_section::Output_relaxed_input_section_by_input_section_map.
6625 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6626 input section.
6627
6628 2009-12-15 Ian Lance Taylor <iant@google.com>
6629
6630 * layout.cc (Layout::create_shstrtab): Only write out after input
6631 sections if we are compressing debug sections.
6632
6633 2009-12-15 Ian Lance Taylor <iant@google.com>
6634
6635 * archive.cc (Archive::add_symbols): Only look up a symbol without
6636 a version if there is, in fact, a version.
6637
6638 2009-12-14 Ian Lance Taylor <iant@google.com>
6639
6640 Revert -Wshadow changes, all changes from:
6641 2009-12-11 Doug Kwan <dougkwan@google.com>
6642 2009-12-11 Nick Clifton <nickc@redhat.com>
6643 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6644
6645 2009-12-11 Doug Kwan <dougkwan@google.com>
6646
6647 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6648 due to -Wshadow.
6649 * attributes.cc (Object_attribute::size): Ditto.
6650 (Attributes_section_data::size): Ditto.
6651 (Attributes_section_data::Attributes_section_data): Ditto.
6652 (Output_attributes_section_data::do_write): Ditto.
6653 * attributes.h (Object_attribute::set_type): Ditto.
6654 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6655
6656 2009-12-11 Nick Clifton <nickc@redhat.com>
6657
6658 * archive.cc: Fix shadowed variable warnings.
6659 * arm.cc: Likewise.
6660 * compressed_output.cc: Likewise.
6661 * compressed_output.h: Likewise.
6662 * configure: Likewise.
6663 * dwarf_reader.cc: Likewise.
6664 * dynobj.cc: Likewise.
6665 * dynobj.h: Likewise.
6666 * ehframe.cc: Likewise.
6667 * ehframe.h: Likewise.
6668 * errors.cc: Likewise.
6669 * expression.cc: Likewise.
6670 * fileread.cc: Likewise.
6671 * fileread.h: Likewise.
6672 * freebsd.h: Likewise.
6673 * i386.cc: Likewise.
6674 * icf.cc: Likewise.
6675 * incremental.h: Likewise.
6676 * layout.cc: Likewise.
6677 * layout.h: Likewise.
6678 * mapfile.cc: Likewise.
6679 * merge.cc: Likewise.
6680 * merge.h: Likewise.
6681 * object.cc: Likewise.
6682 * object.h: Likewise.
6683 * options.h: Likewise.
6684 * output.cc: Likewise.
6685 * output.h: Likewise.
6686 * parameters.cc: Likewise.
6687 * plugin.cc: Likewise.
6688 * powerpc.cc: Likewise.
6689 * reduced_debug_output.cc: Likewise.
6690 * reduced_debug_output.h: Likewise.
6691 * reloc.cc: Likewise.
6692 * reloc.h: Likewise.
6693 * resolve.cc: Likewise.
6694 * script-sections.cc: Likewise.
6695 * script.cc: Likewise.
6696 * script.h: Likewise.
6697 * sparc.cc: Likewise.
6698 * symtab.cc: Likewise.
6699 * symtab.h: Likewise.
6700 * target-select.cc: Likewise.
6701 * target-select.h: Likewise.
6702 * token.h: Likewise.
6703 * workqueue.cc: Likewise.
6704 * workqueue.h: Likewise.
6705 * x86_64.cc: Likewise.
6706
6707 2009-12-10 Doug Kwan <dougkwan@google.com>
6708
6709 * arm.cc (attributes.h): New include.
6710 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6711 (Arm_relobj::~Arm_relobj): Delete object pointed by
6712 attributes_section_data_.
6713 (Arm_relobj::attributes_section_data): New method definition.
6714 (Arm_relobj::attributes_section_data_): New data member declaration.
6715 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6716 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6717 attributes_section_data_.
6718 (Arm_dynobj::attributes_section_data): New method definition.
6719 (Arm_dynobj::attributes_section_data_): New data member declaration.
6720 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6721 initialization value of may_use_blx_ to false.
6722 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6723 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6724 object attributes to compute results instead of hard-coding.
6725 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6726 Target_arm::get_secondary_compatible_arch,
6727 Target_arm::set_secondary_compatible_arch
6728 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6729 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6730 New method declarations.
6731 (Target_arm::get_aeabi_object_attribute): New method definition.
6732 (Target_arm::attributes_section_data_): New data member declaration.
6733 (read_arm_attributes_section): New template definition.
6734 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6735 (Arm_dynobj::do_read_symbols): Ditto.
6736 (Target_arm::do_finalize_sections): Merge attributes sections from
6737 input. Check for BLX use after attributes section merging.
6738 Fix __exidx_start and __exidx_end visibility. Create an
6739 .ARM.attributes section if necessary.
6740 (Target_arm::get_secondary_compatible_arch,
6741 Target_arm::set_secondary_compatible_arch,
6742 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6743 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
6744 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
6745 New method definitions.
6746
6747 2009-12-09 Ian Lance Taylor <iant@google.com>
6748
6749 * plugin.cc (Plugin::load): Don't cast from void* to a function
6750 pointer.
6751
6752 2009-12-09 Ian Lance Taylor <iant@google.com>
6753
6754 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6755 information fields.
6756
6757 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6758
6759 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6760 Replace two_file_shared_1.so with two_file_shared_2.so.
6761 * testsuite/Makefile.in: Regenerated.
6762
6763 2009-12-08 Doug Kwan <dougkwan@google.com>
6764
6765 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6766 (HFILES): Add attributes.h and int_encoding.h.
6767 * Makefile.in: Regenerate.
6768 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6769 function definitions to int_encoding.cc
6770 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6771 prototypes to int_encoding.h
6772 * reduced_debug_output.cc (int_encoding.h): New include.
6773 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6774 function definitions to int_encoding.cc
6775 (insert_into_vector, read_from_pointer): Move template definitions to
6776 int_encoding.h
6777 * attributes.cc: New file.
6778 * attributes.h: New file.
6779 * int_encoding.cc: New file.
6780 * int_encoding.h: New file.
6781
6782 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
6783
6784 PR gold/11055
6785 * incremental-dump.cc (dump_incremental_inputs): New.
6786 (main): Use dump_incremental_inputs.
6787
6788 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6789
6790 PR gold/10893
6791 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6792 checking elfcpp::STT_FUNC.
6793 (Target_i386::Relocate::relocate): Likewise.
6794 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6795
6796 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6797 symbols from shared libraries into normal FUNC symbols.
6798
6799 * symtab.h (Symbol): Add is_func and use it.
6800
6801 2009-12-05 Doug Kwan <dougkwan@google.com>
6802
6803 * arm.cc (Target_arm::arm_info): Initialize new fields
6804 attributes_section and attributes_vendor.
6805 * i386.cc (Target_i386::i386_info): Same.
6806 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6807 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6808 fields attributes_section and attributes_vendor.
6809 * sparc.cc (Target_sparc::sparc_info): Same.
6810 * target.h (Target::attributes_section, Target::attributes_vendor,
6811 Target::is_attributes_section, Target::attribute_arg_type,
6812 Target::attributes_order): New method definitions.
6813 (Target::Target_info::attributes_section,
6814 Target::Target_info::attributes_vendor): New fields.
6815 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6816 virtual method definitions.
6817 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6818 attributes_section and attributes_vendor.
6819 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6820
6821 2009-12-05 Doug Kwan <dougkwan@google.com>
6822
6823 * arm.cc: Update comments about interworking and stub generation.
6824 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6825 considered as non-PIC.
6826 (Arm_relocate_functions::base_abs): Fix formatting.
6827 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6828 of function to use GOT entry address instead of offset.
6829 (Target_arm::Scan::global): Issue an error if a symbol would need a
6830 PLT does not get one because it is untyped. Remove code to create
6831 dynamic symbols for relative branches.
6832 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6833 takes unsigned integer instead of boolean.
6834
6835 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6836
6837 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6838 (two_file_test_LDADD): Likewise.
6839 (common_test_1_LDADD): Likewise.
6840 (exception_test_LDADD) Likewise.
6841 (weak_test_LDADD): Likewise.
6842 (many_sections_test_LDADD): Likewise.
6843 (initpri1_LDADD): Likewise.
6844 (script_test_1_LDADD): Likewise.
6845 (script_test_2_LDADD): Likewise.
6846 (justsyms_LDADD): Likewise.
6847 (binary_test_LDADD): Likewise.
6848 (large_LDADD): Likewise.
6849 * testsuite/Makefile.in: Regenerated.
6850
6851 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
6852
6853 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6854 (Symbol_table::override_with_special): Likewise.
6855 (Symbol_table::add_from_object): Likewise.
6856
6857 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6858
6859 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6860 Don't set the data_offset twice.
6861
6862 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
6863
6864 * testsuite/Makefile.in: Regenerate.
6865
6866 2009-12-03 Doug Kwan <dougkwan@google.com>
6867
6868 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6869 (Target_arm::do_finalize_sections): Add parameter for symbol table
6870 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6871 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6872 parameter for symbol table pointer.
6873 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6874 an additional parameter for a pointer to symbol table.
6875 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6876 parameter for a symbol table pointer.
6877 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6878 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6879 Ditto.
6880 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6881 parameter for a symbol table pointer.
6882
6883 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
6884
6885 * incremental.cc (Incremental_inputs_header)
6886 (Incremental_inputs_header_write, Incremental_inputs_entry)
6887 (Incremental_inputs_entry_write): Move ...
6888 * incremental.h (Incremental_inputs_header)
6889 (Incremental_inputs_header_write, Incremental_inputs_entry)
6890 (Incremental_inputs_entry_write): here.
6891
6892 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6893
6894 * incremental.cc (make_sized_incremental_binary): Set the target.
6895 Error if it is incompatible.
6896 * output.h (Output_file): Add filename method.
6897
6898 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6899
6900 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6901 from the get_* methods.
6902
6903 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6904
6905 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6906 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6907 Write 0 for the data_offset of scripts.
6908
6909 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
6910
6911 * testsuite/Makefile.am: Add the incremental_test.sh test.
6912 * testsuite/incremental_test.sh: New.
6913 * testsuite/incremental_test_1.c: New.
6914 * testsuite/incremental_test_2.c: New.
6915
6916 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
6917
6918 * incremental-dump.cc (main): Fix typos.
6919
6920 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
6921
6922 PR gold/11025
6923 * incremental-dump.cc (main): Use llu to print 64 bit values.
6924
6925 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6926 H.J. Lu <hongjiu.lu@intel.com>
6927
6928 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6929 $(LIBDL).
6930 (incremental_dump_LDADD): Likewise.
6931 * Makefile.in: Regenerated.
6932
6933 2009-11-25 Doug Kwan <dougkwan@google.com>
6934
6935 Revert:
6936
6937 2009-11-25 Doug Kwan <dougkwan@google.com>
6938
6939 * arm.cc (Target_arm::Target_arm): Move method definition
6940 outside of class definition. Add code to handle
6941 --target1-rel, --target1-abs and --target2= options.
6942 (Target_arm::get_reloc_reloc_type): Change method to be
6943 non-static and const.
6944 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6945 New data member declaration.
6946 (Target_arm::Scan::local, Target_arm::Scan::global,
6947 Target_arm::Relocate::relocate,
6948 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6949 Adjust call to Target_arm::get_real_reloc_type.
6950 (Target_arm::get_real_reloc_type): Use command line options
6951 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6952 * options.h (--target1-rel, --target1-abs, --target2): New
6953 ARM-only options.
6954
6955 2009-11-25 Doug Kwan <dougkwan@google.com>
6956
6957 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6958 class definition. Add code to handle --target1-rel, --target1-abs
6959 and --target2= options.
6960 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6961 and const.
6962 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6963 member declaration.
6964 (Target_arm::Scan::local, Target_arm::Scan::global,
6965 Target_arm::Relocate::relocate,
6966 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6967 call to Target_arm::get_real_reloc_type.
6968 (Target_arm::get_real_reloc_type): Use command line options to
6969 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6970 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6971 options.
6972
6973 2009-11-25 Doug Kwan <dougkwan@google.com>
6974
6975 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6976 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6977 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6978 formatting.
6979 (Arm_relocate_functions::thm_call): Replace body with a call to
6980 Arm_relocate_functions::thumb_branch_common.
6981 (Arm_relocate_functions::thm_jump24,
6982 Arm_relocate_functions::thm_xpc22): New method definitions.
6983 (Arm_relocate_functions::thumb_branch_common): New method definition.
6984 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6985 operator.
6986 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6987 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6988
6989 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
6990
6991 * Makefile.am: Build incremental-dump
6992 * Makefile.in: Regenerate.
6993 * incremental-dump.cc: New.
6994 * incremental.cc (Incremental_inputs_header_data,
6995 Incremental_inputs_entry_data): Move to incremental.h
6996 * incremental.h: (Incremental_inputs_header_data,
6997 Incremental_inputs_entry_data): Move from incremental.cc
6998
6999 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7000
7001 * incremental.cc (Incremental_inputs_header,
7002 Incremental_inputs_header_write, Incremental_inputs_entry,
7003 Incremental_inputs_entry_write): Add a typedef with the data type.
7004
7005 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
7006
7007 * incremental.cc (Incremental_inputs_header,
7008 Incremental_inputs_header_write, Incremental_inputs_entry,
7009 Incremental_inputs_entry_write): Update comment about which
7010 type has the filed descriptions.
7011
7012 2009-11-15 Doug Kwan <dougkwan@google.com>
7013
7014 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7015 (Arm_relocate_functions::arm_branch_common): Change method defintion
7016 in class definition to a method declaration and update list of formal
7017 parameters.
7018 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7019 Arm_relocation_functions::jump24): Adjust call to
7020 Arm_relocate_functions::arm_branch_common. Update list of formal
7021 parameters.
7022 (Arm_relocate_functions::xpc25): New method definition.
7023 (Arm_relocate_functions::arm_branch_common): Move method defintion
7024 out from class definition. Use stubs for mode-switching and extending
7025 branch ranges.
7026 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7027 specially. Change code to enable use of stubs in ARM branches.
7028
7029 2009-11-10 Doug Kwan <dougkwan@google.com>
7030
7031 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7032 in method declaration.
7033 (Target_arm::relocate_stub): New method declaration.
7034 (Target_arm::default_target): Change to return a pointer instead of
7035 a const reference.
7036 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7037 Target_arm::default_target.
7038 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7039 method definition.
7040 (Target_arm::relocate_section): Adjust view.
7041 (Target_arm::relocate_stub): New method definition.
7042
7043 2009-11-10 Doug Kwan <dougkwan@google.com>
7044
7045 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7046 a format warning.
7047 * incremental.cc (open_incremental_binary): Initialized local
7048 variables to avoid warnings.
7049 * object.cc (make_elf_object): Ditto.
7050 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7051 a format warning.
7052
7053 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7054
7055 PR gold/10930
7056 * testsuite/plugin_test.c: Include "config.h".
7057
7058 2009-11-09 Doug Kwan <dougkwan@google.com>
7059
7060 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7061 (arm_symbol_value): Remove.
7062 (Arm_relocate_functions::arm_branch_common,
7063 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7064 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7065 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7066 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7067 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7068 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7069 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7070 Arm_relocate_functions::thm_mobw_abs_nc,
7071 Arm_relocate_functions::thm_mov_abs,
7072 Arm_relocate_functions::movw_prel_nc,
7073 Arm_relocate_functions::thm_movt_abs,
7074 Arm_relocate_functions::movt_prel,
7075 Arm_relocate_functions::thm_movw_prel_nc,
7076 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7077 (Target_arm::Relocate::relocate): Only decompose address into two
7078 parts if relocation type uses the thumb-bit and pass the actual
7079 bit instead of a flag indicating that the thumb-bit is used. Adjust
7080 calls to methods in Arm_relocate_functions for this change.
7081
7082 2009-11-08 Ian Lance Taylor <iant@google.com>
7083
7084 PR 10925
7085 * reloc.cc: Instantiate
7086 Sized_relobj::initialize_input_to_output_maps and
7087 Sized_relobj:free_input_to_output_maps.
7088
7089 2009-11-06 Ian Lance Taylor <iant@google.com>
7090
7091 PR 10876
7092 * defstd.cc (in_segment): Set only_if_ref true for "end".
7093
7094 2009-11-06 Doug Kwan <dougkwan@google.com>
7095
7096 * arm.cc (class Reloc_stub): Correct a comment.
7097 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7098 (Target_arm::scan_section_for_stubs): New method declaration.
7099 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7100 Change methods from private to protected.
7101 (Target_arm::do_may_relax): New method definition.
7102 (Target_arm::do_relax, Target_arm::group_sections,
7103 Target_arm::scan_reloc_for_stub,
7104 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7105 (Target_arm::arm_input_section_map_): New data member declaration.
7106 (Target_arm::scan_reloc_for_stub,
7107 Target_arm::scan_reloc_section_for_stubs,
7108 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7109 Target_arm::do_relax): New method definitions.
7110
7111 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7112
7113 * configure.ac: Check for (struct stat)::st_mtim
7114 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7115 * config.in: Regenerate.
7116 * configure: Regenerate.
7117
7118 2009-11-05 Ian Lance Taylor <iant@google.com>
7119
7120 PR 10910
7121 * output.cc (Output_segment::add_output_section): Add missing
7122 return statement.
7123
7124 2009-11-04 Ian Lance Taylor <iant@google.com>
7125
7126 PR 10880
7127 * object.h (class Object): Add is_needed and set_is_needed
7128 methods. Add is_needed_ field. Make bool fields into bitfields.
7129 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7130 defined in a dynamic object and referenced by a regular object,
7131 set is_needed for the dynamic object.
7132 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7133 if the file is marked with as_needed and it is not needed.
7134
7135 2009-11-04 Ian Lance Taylor <iant@google.com>
7136
7137 PR 10887
7138 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7139 tags if data is discarded by linker script.
7140 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7141 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7142 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7143 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7144
7145 2009-11-04 Ian Lance Taylor <iant@google.com>
7146
7147 * layout.cc (Layout::get_output_section): Add is_interp and
7148 is_dynamic_linker_section parameters. Change all callers.
7149 (Layout::choose_output_section): Likewise.
7150 (Layout::make_output_section): Likewise.
7151 (Layout::add_output_section_data): Add is_dynamic_linker_section
7152 parameter. Change all callers.
7153 * layout.h (class Layout): Update declarations.
7154 * output.h (class Output_section): Add is_interp, set_is_interp,
7155 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7156 Add is_interp_, is_dynamic_linker_section_ fields. Change
7157 generate_code_fills_at_write_ to a bitfield.
7158 * output.cc (Output_section::Output_sections): Initialize new
7159 fields.
7160 (Output_segment::add_output_section): Add do_sort parameter.
7161 Change all callers.
7162
7163 2009-11-03 Ian Lance Taylor <iant@google.com>
7164
7165 PR 10860
7166 * options.h (class General_options): Add --warn-common.
7167 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7168 merging two common symbols.
7169 (Symbol_table::should_override): Handle --warn-common when merging
7170 a common symbol with a defined symbol. Use report_resolve_problem
7171 for multiple definitions.
7172 (Symbol_table::report_resolve_problem): New function.
7173 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7174
7175 2009-11-03 Doug Kwan <dougkwan@google.com>
7176
7177 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7178 stub_factory_.
7179 (Target_arm::stub_factory): New method definition.
7180 (Target_arm::new_arm_input_section,
7181 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7182 Target_arm::reloc_uses_thumb_bit): New method declarations.
7183 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
7184 New type definitions.
7185 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7186 member declarations.
7187 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7188 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7189 New method definitions.
7190
7191 2009-11-03 Ian Lance Taylor <iant@google.com>
7192
7193 * options.h (class General_options): Add --warn_constructors.
7194
7195 2009-11-03 Ian Lance Taylor <iant@google.com>
7196
7197 PR 10893
7198 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7199 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7200
7201 2009-11-03 Ian Lance Taylor <iant@google.com>
7202
7203 PR 10895
7204 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7205 --msgid-bugs-address.
7206 (install-pdf): New target.
7207 (install-data_yes): Look up one directory to find mkinstalldirs.
7208
7209 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7210
7211 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7212 tree.
7213
7214 2009-10-30 Doug Kwan <dougkwan@google.com>
7215
7216 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7217
7218 2009-10-30 Doug Kwan <dougkwan@google.com>
7219
7220 * arm.cc (Stub_addend_reader): New struct template definition
7221 and partial specializations.
7222 (Stub_addend_reader::operator()): New method definition for a
7223 partially specialized template.
7224
7225 2009-10-30 Doug Kwan <dougkwan@google.com>
7226
7227 * arm.cc (Arm_relobj::processor_specific_flags): New method
7228 definition.
7229 (Arm_relobj::do_read_symbols): New method declaration.
7230 (Arm_relobj::processor_specific_flags_): New data member declaration.
7231 (Arm_dynobj): New class definition.
7232 (Target_arm::do_finalize_sections): Add input_objects parameter.
7233 (Target_arm::do_adjust_elf_header): New method declaration.
7234 (Target_arm::are_eabi_versions_compatible,
7235 (Target_arm::merge_processor_specific_flags): New method declaration.
7236 (Target_arm::do_make_elf_object): New overloaded method definitions
7237 and declaration.
7238 (Arm_relobj::do_read_symbols): New method definition.
7239 (Arm_dynobj::do_read_symbols): Ditto.
7240 (Target_arm::do_finalize_sections): Add input_objects parameters.
7241 Merge processor-specific flags from all input objects.
7242 (Target_arm::are_eabi_versions_compatible,
7243 Target_arm::merge_processor_specific_flags,
7244 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7245 New method definitions.
7246 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7247 Input_objects pointer type parameter.
7248 * layout.cc (Layout::finalize): Pass input objects to target's.
7249 finalize_sections function.
7250 * output.cc (Output_file_header::do_sized_write): Set ELF file
7251 header's processor-specific flags.
7252 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7253 Input_objects pointer type parameter.
7254 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7255 * target.h (Input_objects): New forward class declaration.
7256 (Target::processor_specific_flags,
7257 Target::are_processor_specific_flags_sect): New method definitions.
7258 (Target::finalize_sections): Add input_objects parameter.
7259 (Target::Target): Initialize processor_specific_flags_ and
7260 are_processor_specific_flags_set_.
7261 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7262 parameter.
7263 (Target::set_processor_specific_flags): New method definition.
7264 (Target::processor_specific_flags_,
7265 Target::are_processor_specific_flags_set_): New data member
7266 declarations.
7267 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7268 Input_objects pointer type parameter.
7269
7270 2009-10-30 Doug Kwan <dougkwan@google.com>
7271
7272 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7273
7274 2009-10-28 Ian Lance Taylor <iant@google.com>
7275
7276 * object.h (class Relobj): Drop options parameter from
7277 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7278 do_scan_relocs, do_relocate. Change all callers.
7279 (class Sized_relobj): Drop options parameters from
7280 do_gc_process_relocs, do_scan_relocs, do_relocate,
7281 do_relocate_sections, relocate_sections, emit_relocs_scan,
7282 emit_relocs_scan_reltype. Change all callers.
7283 (struct Relocate_info): Remove options field and all references to
7284 it.
7285 * reloc.h (class Read_relocs): Remove options constructor
7286 parameter and options_ field. Change all callers.
7287 (class Gc_process_relocs, class Scan_relocs): Likewise.
7288 (class Relocate_task): Likewise.
7289 * target-reloc.h (scan_relocs): Remove options parameter. Change
7290 all callers.
7291 (scan_relocatable_relocs): Likewise.
7292 * target.h (class Sized_target): Remove options parameter from
7293 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7294 all callers.
7295 * gc.h (gc_process_relocs): Remove options parameter. Change all
7296 callers.
7297 * arm.cc: Update functions to remove options parameters.
7298 * i386.cc: Likewise.
7299 * powerpc.cc: Likewise.
7300 * sparc.cc: Likewise.
7301 * x86_64.cc: Likewise.
7302 * testsuite/testfile.cc: Likewise.
7303
7304 2009-10-28 Doug Kwan <dougkwan@google.com>
7305
7306 * arm.cc (Arm_relobj): New class definition.
7307 (Arm_relobj::scan_sections_for_stubs,
7308 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7309 New method definitions.
7310
7311 2009-10-28 Cary Coutant <ccoutant@google.com>
7312
7313 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7314 (Plugin::cleanup_done_): New member.
7315 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7316 (Plugin_manager::cleanup_done_): Remove.
7317 (Plugin_manager::add_input_file): Edit error message.
7318 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7319 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7320
7321 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7322
7323 * fileread.cc: (File_read::View::~View): Use the new
7324 data_ownership_ filed.
7325 (File_read::~File_read): Dispose the new whole_file_view_.
7326 (File_read::open): Mmap the whole file if needed.
7327 (File_read::open): Use whole_file_view_ instead of contents_.
7328 (File_read::find_view): Use whole_file_view_ if applicable.
7329 (File_read::do_read): Use whole_file_view_ instead of contents_.
7330 (File_read::make_view): Use whole_file_view_ instead of contents_,
7331 update File_read::View::View call.
7332 (File_read::find_or_make_view): Update File_read::View::View
7333 call.
7334 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7335 remove contents_
7336 (File_read::View::Data_ownership): New enum.
7337 (File_read::View::View): Replace bool mapped_ with Data_ownership
7338 argument.
7339 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7340 (File_read::View::data_ownership_): New field.
7341 (File_read::contents_): Remove (replaced by whole_file_view_).
7342 (File_read::whole_file_view_): New field.
7343 * options.h (class General_options): Add --keep-files-mapped.
7344
7345 2009-10-27 Cary Coutant <ccoutant@google.com>
7346
7347 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7348 * testsuite/Makefile.am (plugin_test_5): New test case.
7349 * testsuite/Makefile.in: Regenerate.
7350
7351 2009-10-25 Doug Kwan <dougkwan@google.com>
7352
7353 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7354 from private to protected to allow access by child class.
7355 (Sized_relobj::do_relocate_sections): New method declaration.
7356 (Sized_relobj::relocate_sections): Virtualize.
7357 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
7358 Sized_relobj::relocate_sections. Instantiate template explicitly
7359 for different target sizes and endianity.
7360
7361 2009-10-24 Doug Kwan <dougkwan@google.com>
7362
7363 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7364 (Arm_input_section::as_arm_input_section): New method.
7365 (Arm_output_section): New class definition.
7366 (Arm_output_section::create_stub_group,
7367 Arm_output_section::group_sections): New method definitions.
7368
7369 2009-10-22 Doug Kwan <dougkwan@google.com>
7370
7371 * arm.cc (Arm_input_section): New class definition.
7372 (Arm_input_section::init, Arm_input_section:do_write,
7373 Arm_input_section::set_final_data_size,
7374 Arm_input_section::do_reset_address_and_file_offset): New method
7375 definitions.
7376
7377 2009-10-21 Doug Kwan <dougkwan@google.com>
7378
7379 * arm.cc (Stub_table, Arm_input_section): New forward class
7380 declarations.
7381 (Stub_table): New class defintion.
7382 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7383 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7384 New method definition.
7385
7386 2009-10-21 Doug Kwan <dougkwan@google.com>
7387
7388 * arm.cc: Update copyright comments.
7389 (Target_arm): New forward class template declaration.
7390 (Arm_address): New type.
7391 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7392 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7393 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7394 constants.
7395 (Insn_template): Same.
7396 (DEF_STUBS): New macro.
7397 (Stub_type): New enum type.
7398 (Stub_template): New class definition.
7399 (Stub): Same.
7400 (Reloc_stub): Same.
7401 (Stub_factory): Same.
7402 (Target_arm::Target_arm): Initialize may_use_blx_ and
7403 should_force_pic_veneer_.
7404 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7405 Target_arm::should_force_pic_veneer,
7406 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7407 Target_arm::using_thumb_only, Target_arm:;default_target): New
7408 method defintions.
7409 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7410 New data member declarations.
7411 (Insn_template::size, Insn_template::alignment): New method defintions.
7412 (Stub_template::Stub_template): New method definition.
7413 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7414 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7415 (Stub_factory::Stub_factory): New method definition.
7416 * gold.h (string_hash): New template.
7417 * output.h (Input_section_specifier::hash_value): Use
7418 gold::string_hash.
7419 (Input_section_specifier::string_hash): Remove.
7420 * stringpool.cc (Stringpool_template::string_hash): Use
7421 gold::string_hash.
7422
7423 2009-10-20 Doug Kwan <dougkwan@google.com>
7424
7425 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7426 symbols of relaxed input sections.
7427 * output.h (Output_section::find_relaxed_input_section): Make
7428 method public.
7429
7430 2009-10-16 Doug Kwan <dougkwan@google.com>
7431
7432 * dynobj.cc (Versions::Versions): Initialize version_script_.
7433 Only insert base version symbol definition for a shared object
7434 if version script defines any version versions.
7435 (Versions::define_base_version): New method definition.
7436 (Versions::add_def): Check that base version is not needed.
7437 (Versions::add_need): Define base version lazily.
7438 * dynobj.h (Versions::define_base_version): New method declaration.
7439 (Versions::needs_base_version_): New data member declaration.
7440 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7441 (check_DATA): Add no_version_test.stdout.
7442 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7443 New make rules.
7444 * testsuite/Makefile.in: Regenerate.
7445 * testsuite/no_version_test.c: New file.
7446 * testsuite/no_version_test.sh: Ditto.
7447
7448 2009-10-16 Doug Kwan <dougkwan@google.com>
7449
7450 * expression.cc (class Segment_start_expression): New class definition.
7451 (Segment_start_expression::value): New method definition.
7452 (script_exp_function_segment_start): Return a new
7453 Segment_start_expression.
7454 * gold/script-c.h (script_saw_segment_start_expression): New function
7455 prototype.
7456 * script-sections.cc (Script_sections::Script_sections): Initialize
7457 SAW_SEGMENT_START_EXPRESSION_ to false.
7458 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7459 and -Tbbs options to specify section addresses if given in
7460 command line and no SEGMENT_START expression is seen in a script.
7461 * script-sections.h (Script_sections::saw_segment_start_expression,
7462 Script_sections::set_saw_segment_start_expression): New method
7463 definition.
7464 (Script_sections::saw_segment_start_expression_): New data member
7465 declaration.
7466 * script.cc (script_saw_segment_start_expression): New function.
7467 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7468 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7469 script_test_7.sh and script_test_8.sh.
7470 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7471 script_test_8.stdout.
7472 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7473 (script_test_6, script_test_6.stdout, script_test_7,
7474 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7475 * Makefile.in: Regenerate.
7476 * testsuite/script_test_6.sh: New file.
7477 * testsuite/script_test_6.t: Same.
7478 * testsuite/script_test_7.sh: Same.
7479 * testsuite/script_test_7.t: Same.
7480 * testsuite/script_test_8.sh: Same.
7481
7482 2009-10-16 Doug Kwan <dougkwan@google.com>
7483
7484 * output.cc (Output_segment::set_section_list_address): Cast
7485 expressions to unsigned long long type to avoid format warnings.
7486
7487 2009-10-15 Ian Lance Taylor <iant@google.com>
7488
7489 * script.cc (Script_options::add_symbol_assignment): Always add a
7490 dot assignment to script_sections_.
7491 * script-sections.cc (Script_sections::add_dot_assignment):
7492 Initialize if necessary.
7493
7494 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7495 program headers with no load segment if there is a linker script.
7496
7497 * layout.cc (Layout::set_segment_offsets): Align the file offset
7498 to the segment aligment for -N or -n with no load segment.
7499 * output.cc (Output_segment::add_output_section): Don't crash if
7500 the first section is a TLS section.
7501 (Output_segment::set_section_list_addresses): Print an error
7502 message if the address moves backward in a linker script.
7503 * script-sections.cc
7504 (Output_section_element_input::set_section_addresses): Don't
7505 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7506 (Orphan_output_section::set_section_addresses): Likewise.
7507
7508 2009-10-15 Doug Kwan <dougkwan@google.com>
7509
7510 * layout.cc (Layout::finish_dynamic_section): Generate tags
7511 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7512 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7513 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7514
7515 2009-10-14 Ian Lance Taylor <iant@google.com>
7516
7517 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7518 fields.
7519 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7520 data_shdr fields of relinfo.
7521 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7522 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7523 R_386_TLS_LDO_32, adjust based on section flags.
7524 (Target_i386::Relocate::fix_up_ldo): Remove.
7525
7526 2009-10-13 Ian Lance Taylor <iant@google.com>
7527
7528 Add support for -pie.
7529 * options.h (class General_options): Add -pie and
7530 --pic-executable.
7531 (General_options::output_is_position_independent): Test -pie.
7532 (General_options::output_is_executable): Return true if not shared
7533 and not relocatable.
7534 (General_options::output_is_pie): Remove.
7535 * options.cc (General_options::finalize): Reject incompatible uses
7536 of -pie.
7537 * gold.cc (queue_middle_tasks): A -pie link is not static.
7538 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7539 * symtab.cc (Symbol::final_value_is_known): Return false if
7540 output_is_position_independent.
7541 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7542 output_is_position_independent.
7543 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7544 output_is_position_independent.
7545 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7546 output_is_position_independent.
7547 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7548 two_file_pie_test.
7549 (basic_pie_test.o, basic_pie_test): New targets.
7550 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7551 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7552 (two_file_pie_test): New target.
7553 * testsuite/Makefile.in: Rebuild.
7554 * README: Remove note saying that -pie is not supported.
7555
7556 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7557
7558 * options.h (class General_options): Add -init and -fini.
7559 * layout.cc (Layout::finish_dynamic_section): Emit
7560 given init and fini functions.
7561
7562 2009-10-13 Sriraman Tallam <tmsriram@google.com>
7563
7564 * gc.h (gc_process_relocs): Check if icf is enabled using new
7565 function.
7566 * gold.cc (queue_initial_tasks): Likewise.
7567 (queue_middle_tasks): Likewise.
7568 * object.cc (do_layout): Likewise.
7569 * symtab.cc (is_section_folded): Likewise.
7570 * main.cc (main): Likewise.
7571 * reloc.cc (Read_relocs::run): Likewise.
7572 (Sized_relobj::do_scan_relocs): Likewise.
7573 * icf.cc (is_function_ctor_or_dtor): New function.
7574 (Icf::find_identical_sections): Check if function is ctor or dtor when
7575 safe icf is chosen.
7576 * options.h (General_options::icf): Change option to be an enum.
7577 (Icf_status): New enum.
7578 (icf_enabled): New method.
7579 (icf_safe_folding): New method.
7580 (set_icf_status): New method.
7581 (icf_status_): New variable.
7582 * (options.cc) (General_options::finalize): Set icf_status_.
7583 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7584 icf_test and icf_keep_unique_test to use the --icf enum flag.
7585 * testsuite/icf_safe_test.sh: New file.
7586 * testsuite/icf_safe_test.cc: New file.
7587
7588 2009-10-12 Sriraman Tallam <tmsriram@google.com>
7589
7590 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7591 includes to gc.h and icf.h.
7592 * arm.cc: Include gc.h.
7593 * gold.cc: Likewise.
7594 * i386.cc: Likewise.
7595 * powerpc.cc: Likewise.
7596 * sparc.cc: Likewise.
7597 * x86_64.cc: Likewise.
7598 * gc.h: Include icf.h.
7599
7600 2009-10-11 Ian Lance Taylor <iant@google.com>
7601
7602 * plugin.cc: Include "gold.h" before other header files.
7603
7604 2009-10-10 Chris Demetriou <cgd@google.com>
7605
7606 * options.h (Input_file_argument::Input_file_type): New enum.
7607 (Input_file_argument::is_lib_): Replace with...
7608 (Input_file_argument::type_): New member.
7609 (Input_file_argument::Input_file_argument): Take Input_file_type
7610 'type' rather than boolean 'is_lib' as second argument.
7611 (Input_file_argument::is_lib): Use type_.
7612 (Input_file_argument::is_searched_file): New function.
7613 (Input_file_argument::may_need_search): Handle is_searched_file.
7614 * options.cc (General_options::parse_library): Support -l:filename.
7615 (General_options::parse_just_symbols): Update for Input_file_argument
7616 changes.
7617 (Command_line::process): Likewise.
7618 * archive.cc (Archive::get_file_and_offset): Likewise.
7619 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7620 * script.cc (read_script_file, script_add_file): Likewise.
7621 * fileread.cc (Input_file::Input_file): Likewise.
7622 (Input_file::will_search_for): Handle is_searched_file.
7623 (Input_file::open): Likewise.
7624 * readsyms.cc (Read_symbols::get_name): Likewise.
7625 * testsuite/Makefile.am (searched_file_test): New test.
7626 * testsuite/Makefile.in: Regenerate.
7627 * testsuite/searched_file_test.cc: New file.
7628 * testsuite/searched_file_test_lib.cc: New file.
7629
7630 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7631 Ian Lance Taylor <iant@google.com>
7632
7633 * descriptor.cc: Include <cstdio> and "binary-io.h".
7634 (Descriptors::open): Open the files in binary mode always.
7635 * script.cc (Lex::get_token): Treat \r as whitespace.
7636
7637 2009-10-09 Ian Lance Taylor <iant@google.com>
7638
7639 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7640
7641 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7642 Ian Lance Taylor <iant@google.com>
7643
7644 * configure.ac: Check for readv function also.
7645 * fileread.cc (readv): Define if not HAVE_READV.
7646 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7647 does not exist.
7648 * config.in: Regenerate.
7649 * configure: Regenerate.
7650
7651 2009-10-09 Doug Kwan <dougkwan@google.com>
7652
7653 * layout.cc (Layout::make_output_section): Call target hook to make
7654 ordinary output section.
7655 (Layout::finalize): Adjust parameter list of call the
7656 Target::may_relax().
7657 * layout.h (class Layout::section_list): New method.
7658 * merge.h (Output_merge_base::entsize): Change visibility to public.
7659 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7660 New methods.
7661 (Output_merge_string::do_is_string): New method.
7662 * object.cc (Sized_relobj::do_setup): renamed from
7663 Sized_relobj::set_up.
7664 * object.h (Sized_relobj::adjust_shndx,
7665 Sized_relobj::initializ_input_to_output_maps,
7666 Sized_relobj::free_input_to_output_maps): Change visibilities to
7667 protected.
7668 (Sized_relobj::setup): Virtualize.
7669 (Sized_relobj::do_setup): New method declaration.
7670 (Sized_relobj::invalidate_section_offset,
7671 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7672 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7673 * options.cc (parse_int): New function.
7674 * options.h (parse_int): New declaration.
7675 (DEFINE_int): New macro.
7676 (stub_group_size): New option.
7677 * output.cc (Output_section::Output_section): Initialize memebers
7678 merge_section_map_, merge_section_by_properties_map_,
7679 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7680 (Output_section::add_input_section): Handled deferred code-fill
7681 generation and remove an old comment.
7682 (Output_section::add_relaxed_input_section): New method definition.
7683 (Output_section::add_merge_input_section): Use merge section by
7684 properties map to speed to search. Update merge section maps
7685 as appropriate.
7686 (Output_section::build_relaxation_map): New method definition.
7687 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7688 Same.
7689 (Output_section::relax_input_section): Renamed to
7690 Output_section::convert_input_sections_to_relaxed_sections and change
7691 interface to take a vector of pointers to relaxed sections.
7692 (Output_section::find_merge_section,
7693 Output_section::find_relaxed_input_section): New method definitions.
7694 (Output_section::is_input_address_mapped,
7695 Output_section::output_offset, Output_section::output_address):
7696 Use output section data maps to speed up searching.
7697 (Output_section::find_starting_output_address): Add comments.
7698 (Output_section::do_write,
7699 Output_section::write_to_postprocessing_buffer): Do code-fill
7700 generation as appropriate.
7701 (Output_section::get_input_sections): Invalidate relaxed input section
7702 map.
7703 (Output_section::restore_states): Adjust type of checkpoint .
7704 Invalidate relaxed input section map.
7705 * output.h (Output_merge_base): New class declaration.
7706 (Input_section_specifier): New class defintion.
7707 (class Output_relaxed_input_section) Change base class to
7708 Output_section_data_build.
7709 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7710 base class initializer.
7711 (Output_section::add_relaxed_input_section): New method declaration.
7712 (Output_section::Input_section): Change visibility to protected.
7713 (Output_section::Input_section::relobj,
7714 Output_section::Input_section::shndx): Handle relaxed input sections.
7715 Output_section::input_sections) Change visibility to protected. Also
7716 define overload to return a non-const pointer.
7717 (Output_section::Merge_section_properties): New class defintion.
7718 (Output_section::Merge_section_by_properties_map,
7719 Output_section::Output_section_data_by_input_section_map,
7720 Output_section::Relaxation_map): New types.
7721 (Output_section::relax_input_section): Rename method to
7722 Output_section::convert_input_sections_to_relaxed_sections and change
7723 interface to take a vector of relaxed section pointers.
7724 (Output_section::find_merge_section,
7725 Output_section::find_relaxed_input_section,
7726 Output_section::build_relaxation_map,
7727 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7728 New method declarations.
7729 (Output_section::merge_section_map_
7730 Output_section::merge_section_by_properties_map_,
7731 Output_section::relaxed_input_section_map_,
7732 Output_section::is_relaxed_input_section_map_valid_,
7733 Output_section::generate_code_fills_at_write_): New data members.
7734 * script-sections.cc
7735 (Output_section_element_input::set_section_addresses): Call
7736 current_data_size and addralign methods of relaxed input sections.
7737 (Orphan_output_section::set_section_addresses): Call current_data_size
7738 and addralign methods of relaxed input sections.
7739 * symtab.cc (Symbol_table::compute_final_value): Extract template
7740 from the body of Symbol_table::sized_finalize_symbol.
7741 (Symbol_table::sized_finalized_symbol): Call
7742 Symbol_table::compute_final_value.
7743 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7744 (Symbol_table::compute_final_value): New templated method declaration.
7745 * target.cc (Target::do_make_output_section): New method defintion.
7746 * target.h (Target::make_output_section): New method declaration.
7747 (Target::relax): Add more parameters for input objects, symbol table
7748 and layout. Adjust call to do_relax.
7749 (Target::do_make_output_section): New method declaration.
7750 (Target::do_relax): Add parameters for input objects, symbol table
7751 and layout.
7752
7753 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7754
7755 * pread.c: Include stdio.h.
7756
7757 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7758
7759 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7760 defined.
7761
7762 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7763
7764 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7765 Change read_shndx type to unsigned int.
7766 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7767 int.
7768 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7769 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7770 Change read_shndx type to unsigned int.
7771 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7772 int.
7773 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7774 * layout.cc (Layout::create_symtab_sections): Cast the result of
7775 local_symcount * symsize to off_t in the gold_assert.
7776
7777 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7778
7779 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7780 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7781 R_ARM_BASE_ABS.
7782 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7783 (Arm_relocate_functions::thm_abs5): New function.
7784 (Arm_relocate_functions::abs12): New function.
7785 (Arm_relocate_functions::abs16): New function.
7786 (Arm_relocate_functions::base_abs): New function.
7787 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7788 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7789 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7790 R_ARM_BASE_ABS.
7791 (Scan::global): Likewise.
7792 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7793 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7794 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7795 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7796 R_ARM_BASE_ABS.
7797
7798 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7799
7800 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7801 (Arm_relocate_functions::movt_prel): New function.
7802 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7803 (Arm_relocate_functions::thm_movt_prel): New function.
7804 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7805 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7806 (Scan::global, Relocate::relocate): Likewise.
7807 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7808
7809 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7810
7811 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7812 Incremental_checker.
7813 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7814 unsigned int.
7815 (class Incremental_inputs_header): New class.
7816 (Incremental_inputs_header_writer): Edit comment.
7817 (Incremental_inputs_entry): New class.
7818 (Incremental_inputs_entry_writer): Edit comment.
7819 (Sized_incremental_binary::do_find_incremental_inputs_section):
7820 Add *strtab_shndx parameter, fill it.
7821 (Sized_incremental_binary::do_check_inputs): New method.
7822 (Incremental_checker::can_incrementally_link_output_file): Use
7823 Sized_incremental_binary::check_inputs.
7824 (Incremental_inputs::report_command_line): Save command line in
7825 command_line_.
7826 * incremental.h:
7827 (Incremental_binary::find_incremental_inputs_section): New
7828 method.
7829 (Incremental_binary::do_find_incremental_inputs_section): Add
7830 strtab_shndx parameter.
7831 (Incremental_binary::do_check_inputs): New pure virtual method.
7832 (Sized_incremental_binary::do_check_inputs): Declare.
7833 (Incremental_checker::Incremental_checker): Add incremental_inputs
7834 parameter, use it to initialize incremental_inputs_.
7835 (Incremental_checker::incremental_inputs_): New field.
7836 (Incremental_checker::command_line): New method.
7837 (Incremental_checker::inputs): New method.
7838 (Incremental_checker::command_line_): New field.
7839
7840 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7841
7842 * incremental.cc: Include <cstdarg> and "target-select.h".
7843 (vexplain_no_incremental): New function.
7844 (explain_no_incremental): New function.
7845 (Incremental_binary::error): New method.
7846 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7847 method.
7848 (make_sized_incremental_binary): New function.
7849 (open_incremental_binary): New function.
7850 (can_incrementally_link_file): Add checks if output is ELF and has
7851 inputs section.
7852 * incremental.h: Include "elfcpp_file.h" and "output.h".
7853 (Incremental_binary): New class.
7854 (Sized_incremental_binary): New class.
7855 (open_incremental_binary): Declare.
7856 * object.cc (is_elf_object): Use
7857 elfcpp::Elf_recognizer::is_elf_file.
7858 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7859 * output.h (Output_file::filesize): New method.
7860
7861 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7862
7863 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7864 New function.
7865 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7866 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7867 function.
7868 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7869 function.
7870 (Arm_relocate_functions::movw_abs_nc): New function.
7871 (Arm_relocate_functions::movt_abs): New function.
7872 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7873 (Arm_relocate_functions::thm_movt_abs): New function.
7874 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7875 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7876 (Scan::global): Likewise.
7877 (Relocate::relocate): Likewise.
7878 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7879
7880 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7881
7882 * arm.cc (Arm_relocate_functions::got_prel) New function.
7883 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7884 (Relocate::relocate): Likewise.
7885 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7886
7887 2009-10-06 Ian Lance Taylor <iant@google.com>
7888
7889 * options.h (class General_options): Define
7890 split_stack_adjust_size parameter.
7891 * object.h (class Object): Add uses_split_stack_ and
7892 has_no_split_stack_ fields. Add uses_split_stack and
7893 has_no_split_stack accessor functions. Declare
7894 handle_split_stack_section.
7895 (class Reloc_symbol_changes): Define.
7896 (class Sized_relobj): Define Function_offsets. Declare
7897 split_stack_adjust, split_stack_adjust_reltype, and
7898 find_functions.
7899 * object.cc (Object::handle_split_stack_section): New function.
7900 (Sized_relobj::do_layout): Call handle_split_stack_section.
7901 * dynobj.cc (Sized_dynobj::do_layout): Call
7902 handle_split_stack_section.
7903 * reloc.cc (Sized_relobj::relocate_sections): Call
7904 split_stack_adjust for executable sections in split_stack
7905 objects. Pass reloc_map to relocate_section.
7906 (Sized_relobj::split_stack_adjust): New function.
7907 (Sized_relobj::split_stack_adjust_reltype): New function.
7908 (Sized_relobj::find_functions): New function.
7909 * target-reloc.h: Include "object.h".
7910 (relocate_section): Add reloc_symbol_changes parameter. Change
7911 all callers.
7912 * target.h (class Target): Add calls_non_split method. Declare
7913 do_calls_non_split virtual method. Declare match_view and
7914 set_view_to_nop.
7915 * target.cc: Include "elfcpp.h".
7916 (Target::do_calls_non_split): New function.
7917 (Target::match_view): New function.
7918 (Target::set_view_to_nop): New function.
7919 * gold.cc (queue_middle_tasks): Give an error if mixing
7920 split-stack and non-split-stack objects with -r.
7921 * i386.cc (Target_i386::relocate_section): Add
7922 reloc_symbol_changes parameter.
7923 (Target_i386::do_calls_non_split): New function.
7924 * x86_64.cc (Target_x86_64::relocate_section): Add
7925 reloc_symbol_changes parameter.
7926 (Target_x86_64::do_calls_non_split): New function.
7927 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7928 parameter.
7929 * powerpc.cc (Target_powerpc::relocate_section): Add
7930 reloc_symbol_changes parameter.
7931 * sparc.cc (Target_sparc::relocate_section): Add
7932 reloc_symbol_changes parameter.
7933 * configure.ac: Call AM_CONDITIONAL for the default target.
7934 * configure: Rebuild.
7935 * testsuite/Makefile.am (TEST_AS): New variable.
7936 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7937 (check_DATA): Add split_i386 and split_x86_64 files.
7938 (SPLIT_DEFSYMS): Define.
7939 (split_i386_[1234n].o): New targets.
7940 (split_i386_[124]): New targets.
7941 (split_i386_[1234r].stdout): New targets.
7942 (split_x86_64_[1234n].o): New targets.
7943 (split_x86_64_[124]): New targets.
7944 (split_x86_64_[1234r].stdout): New targets.
7945 (MOSTLYCLEANFILES): Add new executables.
7946 * testsuite/split_i386.sh: New file.
7947 * testsuite/split_x86_64.sh: New file.
7948 * testsuite/split_i386_1.s: New file.
7949 * testsuite/split_i386_2.s: New file.
7950 * testsuite/split_i386_3.s: New file.
7951 * testsuite/split_i386_4.s: New file.
7952 * testsuite/split_i386_n.s: New file.
7953 * testsuite/split_x86_64_1.s: New file.
7954 * testsuite/split_x86_64_2.s: New file.
7955 * testsuite/split_x86_64_3.s: New file.
7956 * testsuite/split_x86_64_4.s: New file.
7957 * testsuite/split_x86_64_n.s: New file.
7958 * testsuite/testfile.cc (Target_test): Update relocation_section
7959 function.
7960 * testsuite/Makefile.in: Rebuild.
7961
7962 2009-10-06 Ian Lance Taylor <iant@google.com>
7963
7964 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7965 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7966 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7967 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7968 the address on ldo_addrs_.
7969 (Target_i386::Relocate::fix_up_ldo): New function.
7970
7971 2009-10-06 Rafael Espindola <espindola@google.com>
7972
7973 * plugin.cc (add_input_library): New.
7974 (Plugin::load): Add add_input_library to tv.
7975 (Plugin_manager::add_input_file): Add the is_lib argument.
7976 (add_input_file): Update call to Plugin_manager::add_input_file.
7977 (add_input_library): New.
7978 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7979
7980 2009-09-30 Doug Kwan <dougkwan@google.com>
7981
7982 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7983 symbol and call Symbol::may_need_copy_reloc to determine if
7984 a copy reloc is needed.
7985 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7986 nocopyreloc is given in command line.
7987 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7988 given in command line.
7989 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7990 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7991 of the removed Target_i386::may_need_copy_reloc.
7992 * options.h (copyreloc): New option with default value false.
7993 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7994 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7995 instead of the removed Target_powerpc::may_need_copy_reloc.
7996 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7997 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7998 instead of the removed Target_sparc::may_need_copy_reloc.
7999 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8000 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8001 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8002 instead of the removed Target_x86_64::may_need_copy_reloc.
8003
8004 2009-09-30 Ian Lance Taylor <iant@google.com>
8005
8006 * object.h (class Object): Remove target_ field, and target,
8007 sized_target, and set_target methods.
8008 (Object::sized_target): Remove.
8009 (class Sized_relobj): Update declarations. Remove sized_target.
8010 * object.cc (Sized_relobj::setup): Remove target parameter.
8011 Change all callers.
8012 (Input_objects::add_object): Don't do anything with the target.
8013 (make_elf_sized_object): Add punconfigured parameter. Change all
8014 callers. Set or test parameter target.
8015 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8016 Change all callers.
8017 * parameters.cc (Parameters::set_target): Change parameter type to
8018 be non-const.
8019 (Parameters::default_target): Remove.
8020 (set_parameters_target): Change parameter type to be non-const.
8021 (parameters_force_valid_target): New function.
8022 (parameters_clear_target): New function.
8023 * parameters.h (class Parameters): Update declarations. Remove
8024 default_target method. Add sized_target and clear_target
8025 methods. Change target_ to be non-const.
8026 (set_parameters_target): Update declaration.
8027 (parameters_force_valid_target): Declare.
8028 (parameters_clear_target): Declare.
8029 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8030 as NULL if we aren't searching.
8031 (Add_symbols::run): Don't check for compatible target.
8032 * fileread.cc (Input_file::open_binary): Call
8033 parameters_force_valid_target.
8034 * gold.cc (queue_middle_tasks): Likewise.
8035 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8036 set_target on object.
8037 * dynobj.h (class Sized_dynobj): Update declarations.
8038 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8039 make_elf_object returns NULL.
8040 (Archive::include_member): Don't check whether object target is
8041 compatible.
8042 * output.cc (Output_section::add_input_section): Get target from
8043 parameters.
8044 (Output_section::relax_input_section): Likewise.
8045 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8046 parameters.
8047 (Sized_relobj::do_scan_relocs): Likewise.
8048 (Sized_relobj::relocate_sections): Likewise.
8049 * resolve.cc (Symbol_table::resolve): Likewise.
8050 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8051 parameter. Change all callers.
8052 (Symbol_table::add_from_object): Get target from parameters.
8053 (Symbol_table::add_from_relobj): Don't check object target.
8054 (Symbol_table::add_from_dynobj): Likewise.
8055 (Symbol_table::define_special_symbol): Get target from
8056 parameters.
8057 * symtab.h (class Symbol_table): Update declaration.
8058 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8059 parameter. Change all callers. Clear parameter target.
8060 (Binary_test): Test target here.
8061 * testsuite/object_unittest.cc (gold_testsuite): Remove
8062 target_test_pointer parameter. Change all callers.
8063 (Object_test): Test target here.
8064
8065 2009-09-26 Ian Lance Taylor <iant@google.com>
8066
8067 * testsuite/initpri1.c: Don't try to use constructor priorities if
8068 compiling with gcc before 4.3.
8069
8070 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8071
8072 * testsuite/retain_symbols_file_test.sh (check_present): Change
8073 output file name to retain_symbols_file_test.stdout.
8074 (check_absent): Likewise.
8075
8076 2009-09-18 Craig Silverstein <csilvers@google.com>
8077
8078 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8079 * options.cc: Include <cerrno> and <fstream>.
8080 (General_options::finalize): Parse -retain-symbols-file tag.
8081 * options.h: New flag.
8082 (General_options): New method should_retain_symbol, new
8083 variable symbols_to_retain.
8084 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8085 should_retain_symbol map.
8086 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8087 * testsuite/Makefile.in: Regenerate.
8088 * testsuite/retain_symbols_file_test.sh: New file.
8089
8090 2009-09-18 Nick Clifton <nickc@redhat.com>
8091
8092 * po/es.po: Updated Spanish translation.
8093
8094 2009-09-17 Doug Kwan <dougkwan@google.com>
8095
8096 * debug.h (DEBUG_RELAXATION): New constant.
8097 (DEBUG_ALL): Add DEBUG_RELAXATION.
8098 (debug_string_to_enum): Add relaxation debug option.
8099 * layout.cc
8100 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8101 Layout::Relaxation_debug_check::read_sections,
8102 Layout::Relaxation_debug_check::read_sections): New method definitions.
8103 (Layout::Layout): Initialize data members
8104 record_output_section_data_from_scrips_,
8105 script_output_section_data_list_ and relaxation_debug_check_.
8106 (Layout::save_segments, Layout::restore_segments,
8107 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8108 Layout::relaxation_loop_body): New method definitions.
8109 (Layout::finalize): Support relaxation. Move section layout code to
8110 Layout::relaxation_loop_body.
8111 (Layout::set_asection_address_from_script): Move code for orphan
8112 section placement out.
8113 (Layout::place_orphan_sections_in_script): New method definition.
8114 * layout.h (Output_segment_headers, Output_file_header):
8115 New forward class declarations.
8116 (Layout::~Layout): Define.
8117 (Layout::new_output_section_data_from_script): New method definition.
8118 (Layout::place_orphan_sections_in_script): New method declaration.
8119 (Layout::Segment_states): New type declaration.
8120 (Layout::save_segments, Layout::restore_segments,
8121 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8122 Layout::relaxation_loop_body): New method declarations.
8123 (Layout::Output_section_data_list): New type declaration.
8124 (Layout::Relaxation_debug_check): New class definition.
8125 (Layout::record_output_section_data_from_script_,
8126 Layout::script_output_section_data_list_, Layout::segment_states_,
8127 Layout::relaxation_debug_check_): New data members.
8128 * output.cc: (Output_section_headers::do_size): New method definition.
8129 (Output_section_headers::Output_section_headers): Move size
8130 computation to Output_section_headers::do_size.
8131 (Output_segment_headers::do_size): New method definition.
8132 (Output_file_header::Output_file_header): Move size computation to
8133 Output_file_header::do_size and call it.
8134 (Output_file_header::do_size): New method definition.
8135 (Output_data_group::Output_data_group): Adjust call to
8136 Output_section_data.
8137 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8138 (Output_symtab_xindex::do_write): Add array bound check.
8139 (Output_section::Input_section::print_to_mapfile): Handle
8140 RELAXED_INPUT_SECTION_CODE.
8141 (Output_section::Output_section): Initialize data member checkpoint_.
8142 (Output_section::~Output_section): Delete checkpoint object pointed
8143 by checkpoint_.
8144 (Output_section::add_input_section): Always add an Input_section if
8145 relaxing.
8146 (Output_section::add_merge_input_section): Add assert.
8147 (Output_section::relax_input_section): New method definition.
8148 (Output_section::set_final_data_size): Set load address to zero for
8149 an unallocated section.
8150 (Output_section::do_address_and_file_offset_have_reset_values):
8151 New method definition.
8152 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8153 Handle relaxed input section.
8154 (Output_section::sort_attached_input_sections): Checkpoint input
8155 section list lazily.
8156 (Output_section::get_input_sections): Change type of input_sections to
8157 list of Simple_input_section pointers. Checkpoint input section list
8158 lazily. Also handle relaxed input sections.
8159 (Output_section::add_input_section_for_script): Take a reference to
8160 a Simple_input_section object instead of Relobj pointer and section
8161 index as parameter. Handle relaxed input sections.
8162 (Output_section::save_states, Output_section::restore_states): New
8163 method definitions.
8164 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8165 (Output_data::is_data_size_fixed): New method definition.
8166 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8167 if it is fixed.
8168 (Output_data::address_and_file_offset_have_reset_values): New method
8169 definition.
8170 (Output_data::do_address_and_file_offset_have_reset_values): New method
8171 definition.
8172 (Output_data::set_data_size): Check that data size is not fixed.
8173 (Output_data::fix_data_size): New method definition.
8174 (Output_data::is_data_size_fixed_): New data member.
8175 (Output_section_headers::set_final_data_size): New method definition.
8176 (Output_section_headers::do_size): New method declaration.
8177 (Output_segment_headers::set_final_data_size): New method definition.
8178 (Output_segment_headers::do_size): New method declaration.
8179 (Output_file_header::set_final_data_size)::New method definition.
8180 (Output_file_header::do_size)::New method declaration.
8181 (Output_section_data::Output_section_data): Add new parameter
8182 is_data_size_fixed and use it to fix data size.
8183 (Output_data_const::Output_data_const): Adjust call to base class
8184 constructor and fix data size.
8185 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8186 base class constructor and fix data size.
8187 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8188 base class constructor and fix data size.
8189 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8190 class constructor and fix data size.
8191 (Output_data_group::set_final_data_size): New method definition.
8192 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8193 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8194 class constructor and fix data size.
8195 (Output_relaxed_input_section): New class definition.
8196 (Output_section::Simple_input_section): New class definition.
8197 (Output_section::get_input_sections): Adjust parameter list.
8198 (Output_section::add_input_section_for_script): Same.
8199 (Output_section::save_states, Output_section::restore_states,
8200 Output_section::do_address_and_file_offset_have_reset_values,
8201 (Output_section::Input_section::Input_section): Handle
8202 RELAXED_INPUT_SECTION_CODE. Add new overload for
8203 Output_relaxed_input_section.
8204 (Output_section::Input_section::is_input_section,
8205 Output_section::Input_section::set_output_section): Handle relaxed
8206 input section.
8207 (Output_section::Input_section::is_relaxed_input_section,
8208 Output_section::Input_section::output_section_data,
8209 Output_section::Input_section::relaxed_input_section): New method
8210 definitions.
8211 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8212 value.
8213 (Output_section::Input_section::u1_): Update comments.
8214 (Output_section::Input_section::u2_): Add new union member poris.
8215 (Output_section::Checkpoint_output_section): New classs definition.
8216 (Output_section::relax_input_section): New method declaration.
8217 (Output_section::checkpoint_): New data member.
8218 (Output_segment): Update comments.
8219 (Output_segment::Output_segment): Un-privatize copy constructor.
8220 (Output_segment::operator=): Un-privatize.
8221 * script-sections.cc (Output_section_element::Input_section_list):
8222 Change element type to Output_section::Simple_input_section.
8223 (Output_section_element_dot_assignment::set_section_addresses):
8224 Register output section data for relaxation clean up.
8225 (Output_data_exression::Output_data_expression): Adjust call to base
8226 constructor to fix data size.
8227 (Output_section_element_data::set_section_addresses): Register
8228 Output_data_expression object for relaxation clean up.
8229 (struct Input_section_info): Replace Relobj pointer and section index
8230 pair with Output_section::Simple_input_section and Convert struct to a
8231 class.
8232 (Input_section_sorter::operator()): Adjust access to
8233 Input_section_info data member to use accessors.
8234 (Output_section_element_input::set_section_addresses): Use layout
8235 parameter. Adjust code to use Output_section::Simple_input_section
8236 and Input_secction_info classes. Register filler for relaxation
8237 clean up.
8238 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8239 and section index pair with Output_section::Simple_input_section
8240 class. Adjust code accordingly.
8241 (Phdrs_element::release_segment): New method definition.
8242 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8243 segment list.
8244 (Script_sections::release_segments): New method definition.
8245 * gold/script-sections.h (Script_sections::release_segments): New
8246 method declaration.
8247 * gold/target.h (Target::may_relax, Target::relax,
8248 Target::do_may_relax, Target::do_relax): New method definitions.
8249
8250 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8251
8252 * arm.cc (has_signed_unsigned_overflow): New function.
8253 (Arm_relocate_functions::abs8): New function.
8254 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8255 (Target_arm::Scan::global): Likewise.
8256 (Target_arm::relocate::relocate): Likewise.
8257 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8258 Likewise.
8259
8260 2009-09-16 Cary Coutant <ccoutant@google.com>
8261
8262 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8263 * testsuite/Makefile.in: Regenerate.
8264
8265 2009-09-11 Nick Clifton <nickc@redhat.com>
8266
8267 * po/gold.pot: Updated by the Translation project.
8268
8269 2009-09-08 Cary Coutant <ccoutant@google.com>
8270
8271 * output.cc (Output_file::open): Add execute permission to empty file.
8272 * testsuite/Makefile.am (permission_test): New test.
8273 * testsuite/Makefile.in: Regenerate.
8274
8275 2009-09-02 Ian Lance Taylor <iant@google.com>
8276
8277 * output.cc (Output_file::resize): Call map_no_anonymous rather
8278 than map.
8279
8280 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8281
8282 * gold.cc: Include "incremental.h".
8283 (queue_initial_tasks): Call Incremental_checker methods.
8284 * incremental.cc: Include "output.h".
8285 (Incremental_checker::can_incrementally_link_output_file): New
8286 method.
8287 * incremental.h (Incremental_checker): New class.
8288
8289 * output.cc (Output_file::open_for_modification): New method.
8290 (Output_file::map_anonymous): Changed return type to bool. Record
8291 map in base_ field.
8292 (Output_file::map_no_anonymous): New method, broken out of map.
8293 (Output_file::map): Use map_no_anonymous and map_anonymous.
8294 * output.h (class Output_file): Update declarations.
8295
8296 2009-08-24 Cary Coutant <ccoutant@google.com>
8297
8298 * options.h (Command_line::Pre_options): New class.
8299 (Command_line::pre_options): New member.
8300 * options.cc (gold::options::ready_to_register): New variable.
8301 (One_option::register_option): Do nothing if not registering options.
8302 Assert if same short option registered twice.
8303 (General_options::General_options): Turn off option registration when
8304 done constructing.
8305 (Command_line::Pre_options::Pre_options): New constructor.
8306
8307 2009-08-24 Cary Coutant <ccoutant@google.com>
8308
8309 * options.h (General_options::no_keep_memory): Remove incorrect
8310 short option.
8311
8312 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8313
8314 * Makefile.am (am__skiplex, am__skipyacc): New.
8315 * Makefile.in: Regenerate.
8316
8317 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8318
8319 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8320 (INCLUDES): ... this.
8321 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8322 (AM_CPPFLAGS): Renamed from ...
8323 (INCLUDE): ... this.
8324 * Makefile.in, testsuite/Makefile.in: Regenerate.
8325
8326 * Makefile.in: Regenerate.
8327 * aclocal.m4: Likewise.
8328 * config.in: Likewise.
8329 * configure: Likewise.
8330 * testsuite/Makefile.in: Likewise.
8331
8332 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8333 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8334 * Makefile.in: Regenerate.
8335 * testsuite/Makefile.in: Regenerate.
8336
8337 2009-08-19 Cary Coutant <ccoutant@google.com>
8338
8339 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8340 symbols in shared libraries overridden by hidden or internal symbols
8341 in the main program.
8342
8343 2009-08-19 Chris Demetriou <cgd@google.com>
8344
8345 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8346 checking source file names in error messages.
8347
8348 2009-08-18 Doug Kwan <dougkwan@google.com>
8349
8350 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8351 an elcpp::Ehdr as parameter. Adjust call to set_target.
8352 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8353 an elfcpp::Ehdr as parameter.
8354 * object.cc (Object::set_target): Remove the version that looks up
8355 a target and sets it.
8356 (Sized_relobj::setup): Take a Target object instead of
8357 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8358 (make_elf_sized_object): Find target and ask target to
8359 make an ELF object.
8360 * object.h: (Object::set_target): Remove the version that looks up
8361 a target and sets it.
8362 (Sized_relobj::setup): Take a Target object instead of
8363 an elfcpp:Ehdr as parameter.
8364 * target.cc: Include dynobj.h.
8365 (Target::do_make_elf_object_implementation): New.
8366 (Target::do_make_elf_object): New.
8367 * target.h (Target::make_elf_object): New template declaration.
8368 (Target::do_make_elf_object): New method declarations.
8369 (Target::do_make_elf_object_implementation): New template declaration.
8370
8371 2009-08-14 Ian Lance Taylor <iant@google.com>
8372
8373 * gold.h (FUNCTION_NAME): Define.
8374 (gold_unreachable): Use FUNCTION_NAME.
8375
8376 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8377
8378 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8379 symbol in the --keep-unique list is not found.
8380
8381 2009-08-12 Sriraman Tallam <tmsriram@google.com>
8382
8383 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8384 been maked as --keep-unique.
8385 (Icf::unfold_section): New function.
8386 * icf.h (Icf::unfold_section): New function.
8387 * options.h (General_options::keep_unique): New option.
8388 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8389 * testsuite/Makefile.in: Regenerate.
8390 * testsuite/icf_keep_unique_test.sh: New file.
8391 * testsuite/icf_keep_unique_test.cc: New file.
8392
8393 2009-08-12 Cary Coutant <ccoutant@google.com>
8394
8395 PR 10471
8396 * resolve.cc (Symbol_table::resolve): Check for references from
8397 dynamic objects to hidden and internal symbols.
8398 * testsuite/Makefile.am (hidden_test.sh): New test.
8399 * testsuite/Makefile.in: Regenerate.
8400 * testsuite/hidden_test.sh: New script.
8401 * testsuite/hidden_test_1.c: New test source.
8402 * testsuite/hidden_test_main.c: New test source.
8403
8404 2009-08-11 Doug Kwan <dougkwan@google.com>
8405
8406 * arm.cc: Update comments.
8407 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8408 segment to locate the .ARM.exidx section if present.
8409
8410 2009-08-09 Doug Kwan <dougkwan@google.com>
8411
8412 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8413 patch.
8414
8415 2009-08-07 Sriraman Tallam <tmsriram@google.com>
8416 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8417 compiler warnings.
8418
8419 2009-08-06 Sriraman Tallam <tmsriram@google.com>
8420
8421 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8422 valid tls_segment only for non-debug-section relocations.
8423 * testsuite/Makefile.am: Add gc_tls_test.
8424 * testsuite/Makefile.in: Regenerate.
8425 * testsuite/gc_tls_test.cc: New file.
8426 * testsuite/gc_tls_test.sh: New file.
8427
8428 2009-08-05 Sriraman Tallam <tmsriram@google.com>
8429
8430 * icf.cc: New file.
8431 * icf.h: New file.
8432 * Makefile.am (CCFILES): Add icf.cc.
8433 (HFILES): Add icf.h
8434 * Makefile.in: Regenerate.
8435 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8436 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8437 section, symbol and addend information for the relocs.
8438 * gold.cc (queue_middle_tasks): Call identical code folding.
8439 * gold.h: Add defines for multimap.
8440 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8441 to the call of finalize_local_symbols.
8442 * main.cc (main): Create object of class Icf.
8443 * object.cc (Sized_relobj::do_layout): Allow this function to be
8444 called twice during icf.
8445 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8446 to sections marked as identical by icf.
8447 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8448 when available.
8449 (Sized_relobj::do_section_entsize): New function.
8450 * object.h (Object::section_entsize): New function.
8451 (Object::do_section_entsize): New pure virtual function.
8452 (Relobj::finalize_local_symbols): Add new parameter.
8453 (Relobj::do_section_entsize): New function.
8454 * options.h (General_options::icf): New option.
8455 (General_options::icf_iterations): New option.
8456 (General_options::print_icf_sections): New option.
8457 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8458 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8459 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8460 icf.
8461 * symtab.cc (Symbol_table::is_section_folded): New function.
8462 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8463 to sections marked as identical by icf.
8464 * symtab.h (Symbol_table::set_icf): New function.
8465 (Symbol_table::icf): New function.
8466 (Symbol_table::is_section_folded): New function.
8467 (Symbol_table::icf_): New data member.
8468 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8469 * testsuite/Makefile.am: Add commands to build icf_test.
8470 * testsuite/Makefile.in: Regenerate.
8471 * testsuite/icf_test.sh: New file.
8472 * testsuite/icf_test.cc: New file.
8473
8474 2009-07-24 Chris Demetriou <cgd@google.com>
8475
8476 * layout.cc (is_compressible_debug_section): Fix incorrect
8477 comment about compressed section names.
8478
8479 2009-07-20 Ian Lance Taylor <ian@airs.com>
8480
8481 PR 10419
8482 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8483
8484 2009-07-16 Ian Lance Taylor <iant@google.com>
8485
8486 PR 10400
8487 * layout.h: #include <map>.
8488 (class Kept_section): Change from struct to class. Add accessors
8489 and setters. Add section size to Comdat_group mapping. Change
8490 Comdat_group to std::map. Add is_comdat_ field. Add
8491 linkonce_size field in union.
8492 (class Layout): Update declaration of find_or_add_kept_section.
8493 Don't declare find_kept_object.
8494 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8495 parameter. Add object, shndx, is_comdat, and is_group_name
8496 parameters. Change all callers. Adjust for new Kept_section.
8497 (Layout::find_kept_object): Remove.
8498 * object.cc (Sized_relobj::include_section_group): Update use of
8499 Kept_section. Rename secnum to shndx. Only record
8500 Kept_comdat_section if sections are the same size.
8501 (Sized_relobj::include_linkonce_section): Update use of
8502 Kept_section. Only record Kept_comdat_section if sections are the
8503 same size. Set size of linkonce section.
8504 (Sized_relobj::map_to_kept_section): Update call to
8505 get_kept_comdat_section.
8506 * object.h (class Sized_relobj): Rename fields in
8507 Kept_comdat_section to drop trailing underscores; change object
8508 field to Relobj*. Change Kept_comdat_section_table to store
8509 struct rather than pointer.
8510 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8511 Add kept_object and kept_shndx parameters. Change all callers.
8512 (Sized_relobj::get_kept_comdat_section): Change return type to
8513 bool. Add kept_object and kept_shndx parameters. Change all
8514 callers.
8515 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8516 Layout::find_or_add_kept_section.
8517
8518 2009-07-09 Ian Lance Taylor <iant@google.com>
8519
8520 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8521 Reserve space in the hash table.
8522
8523 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8524
8525 * fileread.cc (File_read::get_mtime): New method.
8526 * fileread.h (Timespec): New structure.
8527 (File_read::get_mtime): New method.
8528 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8529 Renamed from timestamp_nsec.
8530 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8531 Elf_Xword.
8532 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
8533 timestamp_nsec.
8534 (Incremental_inputs::report_archive): Save mtime; style fix.
8535 (Incremental_inputs::report_obejct): Save mtime; style fix.
8536 (Incremental_inputs::report_script): Save mtime; style fix.
8537 (Incremental_inputs::finalize_inputs): Style fix.
8538 (Incremental_inputs::finalize): Style fix.
8539 (Incremental_inputs::create_input_section_data): Store inputs
8540 mtime.
8541 * incremental.h (Incremental_inputs::report_script): Add mtime
8542 argument.
8543 (Incremental_inputs::Input_info::Input_info): Intialize only one
8544 union member.
8545 (Incremental_inputs::Input_info::archive): Move to nameless
8546 union.
8547 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8548 (Incremental_inputs::Input_info::script): Move to nameless union.
8549 (Incremental_inputs::mtime): New field.
8550 * script.cc (read_input_script): Pass file mtime to
8551 Incremental_input.
8552 * script.h (Script_info::inputs): Style fix.
8553
8554 2009-07-01 Ian Lance Taylor <ian@airs.com>
8555
8556 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8557 instead of 32.
8558
8559 2009-06-24 Ian Lance Taylor <iant@google.com>
8560
8561 PR 10156
8562 * layout.cc (Layout::choose_output_section): If we find an
8563 existing section, update the flags.
8564 (Layout::create_notes): New function, broken out of
8565 Layout::finalize.
8566 (Layout::finalize): Don't create note sections.
8567 (Layout::create_note): Don't crash if linker script discards
8568 section.
8569 (Layout::create_gold_note): Likewise.
8570 (Layout::create_build_id): Likewise. Don't set
8571 after_input_sections on the section.
8572 (Layout::create_executable_stack_info): Remove target parameter.
8573 Change caller.
8574 * layout.h (class Layout): Declare create_notes. Update
8575 declaration of create_executable_stack_info.
8576 * gold.cc (queue_middle_tasks): Call create_notes.
8577 * output.cc (Output_section::update_flags_for_input_section): Move
8578 here from output.h. If SHF_ALLOC flag is newly set, mark address
8579 invalid.
8580 * output.h (Output_data::mark_address_invalid): New function.
8581 (class Output_section): Only declare, not define,
8582 update_flags_for_input_section. Remove set_flags.
8583
8584 2009-06-24 Ian Lance Taylor <iant@google.com>
8585
8586 * script-sections.cc (Output_section_definition::
8587 set_section_addresses): Rename shadowing local load_address to
8588 laddr.
8589
8590 2009-06-24 Ian Lance Taylor <iant@google.com>
8591
8592 PR 10244
8593 * reloc.cc (relocate_sections): Skip empty relocation sections.
8594
8595 2009-06-23 Ian Lance Taylor <iant@google.com>
8596
8597 PR 10156
8598 * layout.cc (Layout::create_note): Use choose_output_section
8599 rather than make_output_section.
8600
8601 2009-06-23 Ian Lance Taylor <iant@google.com>
8602
8603 PR 10237
8604 * options.cc (General_options::parse_V): Set printed_version_.
8605 (General_options::General_options): Initialize printed_version_.
8606 * options.h (class General_options): Add printed_version_ field.
8607 * gold.cc (queue_initial_tasks): If there are no input files,
8608 don't give a fatal error if we printed the version information.
8609 (queue_middle_tasks): If using -r with a shared object, give a
8610 fatal error rather than an ordinary error.
8611
8612 2009-06-23 Ian Lance Taylor <iant@google.com>
8613
8614 PR 10219
8615 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8616 (Layout::make_output_section): Set have_stabstr_section_ if we see
8617 a .stab*str section.
8618 (Layout::finalize): Call link_stabs_sections.
8619 (Layout::link_stabs_sections): New file.
8620 * layout.h (class Layout): Add have_stabstr_section_ field.
8621 Declare link_stabs_sections.
8622
8623 2009-06-23 Doug Kwan <dougkwan@google.com>
8624
8625 * Makefile.am (libgold_a_LIBADD): New.
8626 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8627 * Makefile.in: Regenerate.
8628 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8629 * configure: Regenerate.
8630 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8631 * fileread.cc: Include sys/state.h
8632 * gold.h: Declare memmem and strndup if found missing.
8633 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8634
8635 2009-06-23 Ian Lance Taylor <iant@google.com>
8636
8637 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8638 * configure: Rebuild.
8639
8640 2009-06-23 Ian Lance Taylor <iant@google.com>
8641
8642 PR 10147
8643 * object.cc (Object::section_contents): Don't try to get a view if
8644 the section has length zero.
8645 (Object::handle_gnu_warning_section): If the section is empty, use
8646 the name of the section as the warning.
8647
8648 2009-06-23 Ian Lance Taylor <iant@google.com>
8649
8650 PR 10133
8651 * stringpool.h (class Stringpool_template): Add optimize_ field.
8652 (Stringpool_template::set_optimize): New function.
8653 * stringpool.cc (Stringpool_template::Stringpool_template):
8654 Initialize optimize_ field.
8655 (Stringpool_template::set_string_offsets): Test local optimize
8656 fild rather than parameter.
8657 * layout.cc (Layout::Layout): Call set_optimize on the section
8658 name stringpool.
8659
8660 2009-06-22 Ian Lance Taylor <iant@google.com>
8661
8662 PR 10030
8663 * yyscript.y: Parse TARGET.
8664 * script.cc (script_set_target): New function.
8665 * script-c.h (script_set_target): Declare.
8666 * options.cc (General_options::string_to_object_format): Rename
8667 from string_to_object_format in anonymous namespace. Change
8668 callers.
8669 * options.h (class General_options): Declare
8670 string_to_object_format.
8671
8672 2009-06-22 Ian Lance Taylor <iant@google.com>
8673
8674 * script-sections.cc (Script_sections::create_segments): Don't put
8675 program headers in a PT_LOAD segment if -n or -N.
8676
8677 2009-06-22 Ian Lance Taylor <iant@google.com>
8678
8679 PR 10141
8680 * options.h (class General_options): Add -z lazy and -z now. Sort
8681 -z options into alphabetical order.
8682 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8683
8684 2009-06-21 Ian Lance Taylor <iant@google.com>
8685
8686 * layout.cc (Layout::make_output_section): Call
8687 Target::new_output_section.
8688 (Layout::attach_allocated_section_to_segment): Put large section
8689 sections in a separate load segment with the large segment flag
8690 set.
8691 (Layout::segment_precedes): Sort large data segments after other
8692 load segments.
8693 (align_file_offset): New static function.
8694 (Layout::set_segment_offsets): Use align_file_offset.
8695 * output.h (class Output_section): Add is_small_section_ and
8696 is_large_section_ fields.
8697 (Output_section::is_small_section): New function.
8698 (Output_section::set_is_small_section): New function.
8699 (Output_section::is_large_section): New function.
8700 (Output_section::set_is_large_section): New function.
8701 (Output_section::is_large_data_section): New function.
8702 (class Output_segment): Add is_large_data_segment_ field.
8703 (Output_segment::is_large_data_segment): New function.
8704 (Output_segment::set_is_large_data_segment): New function.
8705 * output.cc (Output_section::Output_section): Initialize new
8706 fields.
8707 (Output_segment::Output_segment): Likewise.
8708 (Output_segment::add_output_section): Add assertion that large
8709 data sections always go in large data segments. Force small data
8710 sections to the end of the list of data sections. Force small BSS
8711 sections to the start of the list of BSS sections. For large BSS
8712 sections to the end of the list of BSS sections.
8713 * symtab.h (class Symbol): Declare is_common_shndx.
8714 (Symbol::is_defined): Check Symbol::is_common_shndx.
8715 (Symbol::is_common): Likewise.
8716 (class Symbol_table): Define enum Commons_section_type. Update
8717 declarations. Add small_commons_ and large_commons_ fields.
8718 * symtab.cc (Symbol::is_common_shndx): New function.
8719 (Symbol_table::Symbol_table): Initialize new fields.
8720 (Symbol_table::add_from_object): Put small and large common
8721 symbols in the right list.
8722 (Symbol_table::sized_finalized_symbol): Check
8723 Symbol::is_common_shndx.
8724 (Symbol_table::sized_write_globals): Likewise.
8725 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8726 common symbol lists. Don't call do_allocate_commons_list if the
8727 list is empty.
8728 (Symbol_table::do_allocate_commons_list): Remove is_tls
8729 parameter. Add comons_section_type parameter. Change all
8730 callers. Handle small and large common symbols.
8731 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8732 Symbol::is_common_shndx.
8733 * resolve.cc (symbol_to_bits): Likewise.
8734 * target.h (Target::small_common_shndx): New function.
8735 (Target::small_common_section_flags): New function.
8736 (Target::large_common_shndx): New function.
8737 (Target::large_common_section_flags): New function.
8738 (Target::new_output_section): New function.
8739 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8740 small_common_section_flags, and large_common_section_flags
8741 fields.
8742 (Target::do_new_output_section): New virtual function.
8743 * arm.cc (Target_arm::arm_info): Initialize new fields.
8744 * i386.cc (Target_i386::i386_info): Likewise.
8745 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8746 Likewise.
8747 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8748 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8749 (Target_x86_64::do_new_output_section): New function.
8750 * configure.ac: Define conditional MCMODEL_MEDIUM.
8751 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8752 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8753 (large_LDFLAGS): Define.
8754 * testsuite/large.c: New file.
8755 * testsuite/testfile.cc (Target_test::test_target_info):
8756 Initialize new fields.
8757 * configure, testsuite/Makefile.in: Rebuild.
8758
8759 2009-06-05 Doug Kwan <dougkwan@google.com>
8760
8761 * Makefile.am (CCFILES): Add target.cc.
8762 * Makefile.in: Regenerate.
8763 * i386.cc (class Target_i386): Define new virtual method to
8764 override do_is_local_label_name in parent.
8765 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8766 local symbols if --discard-locals or -X is given.
8767 * options.h (class General_options): Declare new options
8768 '--discard-locals' and '-X' for discarding locals.
8769 * target.h (class Target): Define new methods is_local_label_name.
8770 Declare new virtual method do_is_local_label_name.
8771 * target.cc: New file.
8772 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8773 (check_SCRIPTS): Add discard_locals_test.sh.
8774 (check_DATA): Add discard_local_tests.syms.
8775 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8776 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8777 * testsuite/Makefile.in: Regenerate.
8778 * testsuite/discard_locals_test.c: New file.
8779 * testsuite/discard_locals_test.sh: Same.
8780
8781 2009-06-05 Doug Kwan <dougkwan@google.com>
8782
8783 * object.cc (Sized_relobj::Sized_relobj): Initialize
8784 discarded_eh_frame_shndx_ to -1U.
8785 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8786 section.
8787 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8788 a discarded .eh_frame section.
8789 (Sized_relobj::do_finalize_local_symbols): Ditto.
8790 * object.h (class Sized_relobj): Declare new member
8791 discarded_eh_frame_shndx_.
8792 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8793 (local_labels_test.o, local_labels_test): New rules.
8794 * testsuite/Makefile.in: Regenerate.
8795
8796 2009-06-04 Doug Kwan <dougkwan@google.com>
8797
8798 * layout.cc (Layout::section_name_mapping): Add mapping for
8799 special ARM sections.
8800
8801 2009-06-03 Doug Kwan <dougkwan@google.com>
8802
8803 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8804 (utils::has_overflow): Same.
8805
8806 2009-06-03 Ian Lance Taylor <iant@google.com>
8807
8808 * layout.cc (Layout::section_name_mapping): New array, replacing
8809 Layout::linkonce_mapping.
8810 (Layout::section_name_mapping_count): New variable, replacing
8811 Layout::linkonce_mapping_count.
8812 (Layout::linkonce_output_name): Remove.
8813 (Layout::output_section_name): Rewrite.
8814 * layout.h (class Layout): Rename Linkonce_mapping to
8815 Section_name_mapping, linkonce_mapping to section_name_mapping,
8816 linkonce_mapping_count to section_name_mapping_count. Don't
8817 declare linkonce_output_name.
8818
8819 2009-06-03 Doug Kwan <dougkwan@google.com>
8820
8821 * gold/arm.cc (namespace utils): New.
8822 (Target_arm::reloc_is_non_pic): Define new method.
8823 (class Arm_relocate_functions): New.
8824 (Target_arm::Relocate::relocate): Handle relocation types used by
8825 Android.
8826
8827 2009-06-03 Ian Lance Taylor <iant@google.com>
8828
8829 * arm.cc (Target_arm::scan::global): Use || instead of |.
8830
8831 2009-06-02 Doug Kwan <dougkwan@google.com>
8832
8833 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8834 issued_non_pic_error_.
8835 (class Target_arm::Scan): Declare new method check_non_pic.
8836 Define new method symbol_needs_plt_entry.
8837 Declare new data member issued_non_pic_error_.
8838 (class Target_arm::Relocate): Declare new method
8839 should_apply_static_reloc.
8840 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8841 (Target_arm::Scan::check_non_pic): Define new method.
8842 (Target_arm::Scan::local): Handle a small subset of reloc types used
8843 by Android.
8844 (Target_arm::Scan::local): Same.
8845 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8846
8847 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8848
8849 * incremental.cc (Incremental_inputs::report_command_line): Filter
8850 out --incremental-* options.
8851
8852 2009-05-29 Doug Kwan <dougkwan@google.com>
8853
8854 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8855 template class.
8856 (class Target_arm): Update comment.
8857 (Target_arm::Target_arm): Initialize new data members GOT_,
8858 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8859 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8860 and Target_arm::rel_dyn_section.
8861 Declare new_enum Target_arm::Got_type.
8862 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8863 and DYNBSS_.
8864 Update commments for member do_dynsym_value.
8865 (Target_arm::got_size, Target_arm::plt_section,
8866 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8867 new methods inside class defintion.
8868 (Target_arm::got_section): Define new method.
8869 (Target_arm::rel_dyn_section): Same.
8870 (Output_data_plt_arm): New template class.
8871 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8872 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8873 (Output_data_plt_arm::add_entry): Same.
8874 (Output_data_plt_arm::first_plt_entry): Define new
8875 static data member for PLT instruction template.
8876 (Output_data_plt_arm::plt_entry): Same.
8877 (Output_data_plt_arm::do_write): Define new method.
8878 (Target_arm::make_plt_entry): Same.
8879 (Target_arm::do_finalize_sections): Same.
8880 (Target_arm::do_dynsym_value): Same.
8881
8882 2009-05-28 Doug Kwan <dougkwan@google.com>
8883
8884 * Makefile.am (TARGETSOURCES): Add arm.cc.
8885 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8886 * Makefile.in: Regenerate.
8887 * arm.cc: New file.
8888 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8889
8890 2009-05-26 Doug Kwan <dougkwan@google.com>
8891
8892 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8893 (General_options::check_excluded_libs): Strip off directories in
8894 archive name before matching like GNU ld does.
8895 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8896 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8897 (exclude_libs_test_LDFLAGS): Add linker option
8898 -Wl,--exclude-libs,libexclude_libs_test_3
8899 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8900 an explicit archive without using -l.
8901 (alt/libexclude_libs_test_3.a): New make rule.
8902 * testsuite/Makefile.in: Regenerate.
8903 * testsuite/exclude_libs_test.c : Declare lib3_default().
8904 (main): Call it.
8905 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8906 * exclude_libs_test_3.c: New file.
8907
8908 2009-05-26 Nick Clifton <nickc@redhat.com>
8909
8910 * po/id.po: New Indonesian translation.
8911 * po/gold.pot: Updated template file.
8912
8913 2009-05-22 Sriraman Tallam <tmsriram@google.com>
8914
8915 * testsuite/Makefile.am: Add -ffunction-sections to compile
8916 gc_comdat_test files. Add -Wl,--gc-sections to build
8917 gc_comdat_test.
8918 * testsuite/Makefile.in: Regenerate.
8919 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8920
8921 2009-05-21 Sriraman Tallam <tmsriram@google.com>
8922
8923 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8924 kept comdat section was garbage collected.
8925 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8926 * testsuite/Makefile.in: Regenerate.
8927 * testsuite/gc_comdat_test.sh: New file.
8928 * testsuite/gc_comdat_test_1.cc: New file.
8929 * testsuite/gc_comdat_test_2.cc: New file.
8930
8931 2009-05-19 Doug Kwan <dougkwan@google.com>
8932
8933 * archive.cc (Archive::Archive): Move constructor from archive.h
8934 to here. Initialize no_export_.
8935 (Archive::get_elf_object_for_member): Set no_export flag of object.
8936 * archive.h (Archive::Archive): Move constructor body to
8937 archive.cc.
8938 (Archive::no_export): New method.
8939 (Archive::no_export_): New field.
8940 * object.h (Object::Object): Initialize no_export_ to false.
8941 (Object::no_export, Object::set_no_export): New methods.
8942 (Object::no_export_): New field.
8943 * options.cc (General_options::parse_exclude_libs): New method.
8944 (General_options::check_excluded_libs) Same.
8945 * options.h (exclude_libs): New option.
8946 (General_options::check_excluded_libs): New method declaration.
8947 (General_options::excluded_libs_): New field.
8948 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8949 default or protected visibility if an object has no-export flag set.
8950 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8951 (check_SCRIPTS): Add exclude_libs_test.sh.
8952 (check_DATA): Add exclude_libs_test.syms.
8953 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8954 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8955 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8956 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8957 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8958 libexclude_libs_test_2.a): New rules.
8959 * testsuite/Makefile.in: Regenerate.
8960 * testsuite/exclude_libs_test.c: New file.
8961 * testsuite/exclude_libs_test.sh: Ditto.
8962 * testsuite/exclude_libs_test_1.c: Ditto.
8963 * testsuite/exclude_libs_test_2.c: Ditto.
8964
8965 2009-05-15 Ian Lance Taylor <iant@google.com>
8966
8967 * configure.ac: Check for declarations for cases where libiberty.h
8968 checks HAVE_DECL_xxx.
8969 * configure, config.in: Rebuild.
8970
8971 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8972
8973 * gold.h (Incremental_argument_list): Remove (invalid) forward
8974 declaration.
8975 * incremental.cc (Incremental_inputs::report_achive): New method.
8976 (Incremental_inputs::report_object): New method.
8977 (Incremental_inputs::report_script): New method.
8978 (Incremental_inputs::finalize_inputs): New method.
8979 (Incremental_inputs::finalize): Call finalize_inputs().
8980 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8981 Create inputs entries.
8982 * incremental.h (Incremental_input_type): New enum.
8983 (Incremental_inputs::Incremental_input): Initialize new fields.
8984 (Incremental_inputs::report_inputs): New method.
8985 (Incremental_inputs::report_achive): New method.
8986 (Incremental_inputs::report_object): New method.
8987 (Incremental_inputs::report_script): New method.
8988 (Incremental_inputs::finalize_inputs): New method.
8989 (Incremental_inputs::Input_info): New struct.
8990 (Incremental_inputs::Input_info_map): New typedef.
8991 (Incremental_inputs::lock_): New field.
8992 (Incremental_inputs::Inputs_): New field.
8993 (Incremental_inputs::Inputs_map): New field.
8994 * main.cc (main): Call Incremental_input::report_inputs.
8995 * options.h (Input_argument_list): Typedef moved from
8996 Input_arguments.
8997 (Input_file_group::Files): Remove, use ::Input_argument_list.
8998 (Input_file_group::Input_argument_list): Remove, use
8999 ::Input_argument_list.
9000 * plugin.cc (Plugin_manager::add_input_file): Add error in
9001 incremental build.
9002 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9003 functions.
9004 * script.cc (read_input_script): Call
9005 Incremental_input::report_script.
9006 * script.h (Script_info): New class.
9007
9008 2009-04-27 Ian Lance Taylor <iant@google.com>
9009
9010 * x86_64.cc (do_adjust_output_section): Set entsize to
9011 plt_entry_size.
9012
9013 2009-04-23 Elliott Hughes <enh@google.com>
9014
9015 * output.cc (Output_file::close): After short writes, continue
9016 writing from the correct offset in the buffer being written.
9017
9018 2009-04-23 Chris Demetriou <cgd@google.com>
9019
9020 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9021 * configure: Regenerate.
9022 * config.in: Regenerate.
9023 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9024 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9025
9026 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9027
9028 * incremental.cc (Incremental_inputs_header_data): Renamed from
9029 Incremental_input_header_data.
9030 (Incremental_inputs_header_data::data_size): New field.
9031 (Incremental_inputs_header_data::put_input_file_count): Renamed
9032 from input_file_count.
9033 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9034 from command_line_offset.
9035 (Incremental_inputs_header_data::put_reserved): Renamed from
9036 put_reserved.
9037 (Incremental_inputs_entry_data): Renamed from
9038 Incremental_input_entry_data.
9039 (Incremental_inputs_entry_data::data_size): New field.
9040 (Incremental_inputs::report_command_line): New method.
9041 (Incremental_inputs::finalize): New method.
9042 (Incremental_inputs::create_incremental_inputs_data): New method.
9043 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9044 * incremental.h: New file.
9045 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9046 (Layout::finalize): Create incremental inputs section in
9047 incremental builds.
9048 (Layout::create_incremental_info_sections): New method.
9049 * layout.h (Layout::incremental_inputs): New method.
9050 (Layout::create_incremental_info_sections): New method.
9051 (Layout::incremental_inputs_): New field.
9052 * main.cc (main): Notify Incremental_input of the command line.
9053
9054 2009-04-01 Ian Lance Taylor <iant@google.com>
9055 Mikolaj Zalewski <mikolajz@google.com>
9056
9057 * gold.h (reserve_unordered_map): Define, three versions, one for
9058 each version of Unordered_map.
9059 * layout.cc (Layout::Layout): Remove options parameter. Add
9060 number_of_input_files parameter. Don't initialize options_.
9061 Initialize number_of_input_files_ and resized_signatures_. Move
9062 sections_are_attached_.
9063 (Layout::layout_group): Reserve space for group_signatures_.
9064 (Layout::find_or_add_kept_section): Change name parameter to be a
9065 reference. Resize signatures_ map when it gets large enough.
9066 (Layout::layout_eh_frame): Use parameters->options() instead of
9067 this->options_.
9068 (Layout::make_output_section): Likewise.
9069 (Layout::attach_allocated_section_to_segment): Likewise.
9070 (Layout::finalize, Layout::create_executable_stack): Likewise.
9071 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9072 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9073 * layout.h (class Layout): Update declarations. Remove options_
9074 field. Add number_of_input_files_ and resized_signatures_
9075 fields. Move sections_are_attached_ field.
9076 * main.cc (main): Pass number of input files to Layout
9077 constructor. Don't pass options.
9078
9079 2009-03-30 Ian Lance Taylor <iant@google.com>
9080
9081 * ffsll.c (ffsll): Correct implementation.
9082
9083 2009-03-27 Ian Lance Taylor <iant@google.com>
9084
9085 * ffsll.c: New file.
9086 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9087 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9088 * ftruncate.c (ftruncate): Declare before definition.
9089 * mremap.c (mremap): Likewise.
9090 * pread.c (pread): Likewise.
9091 * configure, Makefile.in, config.in: Rebuild.
9092
9093 * mremap.c: New file.
9094 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9095 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9096 (mremap): Declare if HAVE_MREMAP is not defined.
9097 * configure, Makefile.in, config.in: Rebuild.
9098
9099 2009-03-27 Cary Coutant <ccoutant@google.com>
9100
9101 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9102 position independent.
9103 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9104 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9105
9106 2009-03-24 Cary Coutant <ccoutant@google.com>
9107
9108 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9109 an executable.
9110 (needs_dynamic_reloc): Likewise.
9111
9112 2009-03-24 Ian Lance Taylor <iant@google.com>
9113
9114 * yyscript.y (file_cmd): Recognize EXTERN.
9115 (extern_name_list, extern_name_list_body): New nonterminals.
9116 * script.cc (script_add_extern): Define.
9117 * script-c.h (script_add_extern): Declare.
9118
9119 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
9120
9121 * object.cc (is_elf_object): Define.
9122 * object.h (is_elf_object): Declare.
9123 * archive.cc (Archive::get_elf_object_for_member): Call
9124 is_elf_object.
9125 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
9126
9127 2009-03-24 Elliott Hughes <enh@google.com>
9128
9129 * output.cc (Output_file::map_anonymous): Define.
9130 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9131 try an anonymous one. Report the size if the mmap fails.
9132 * output.h (class Output_file): Declare map_anonymous.
9133
9134 2009-03-24 Ian Lance Taylor <iant@google.com>
9135
9136 * target-select.cc (instantiate_target): Don't acquire the lock if
9137 the instantiated_target_ field has already been set.
9138
9139 2009-03-23 Ian Lance Taylor <iant@google.com>
9140
9141 * gold-threads.h (class Initialize_lock): Define.
9142 * gold-threads.cc (class Initialize_lock_once): Define.
9143 (initialize_lock_control): New static variable.
9144 (initialize_lock_pointer): New static variable.
9145 (initialize_lock_once): New static function.
9146 (Initialize_lock::Initialize_lock): Define.
9147 (Initialize_lock::initialize): Define.
9148 * target-select.h: Include "gold-threads.h".
9149 (class Target_selector): Add lock_ and initialize_lock_ fields.
9150 Don't define instantiate_target, just declare it.
9151 * target-select.cc (Target_selector::Target_selector): Initialize
9152 new fields.
9153 (Target_selector::instantiate_target): Define.
9154 * descriptors.h: Include "gold-threads.h".
9155 (class Descriptors): Add initialize_lock_ field.
9156 * descriptors.cc (Descriptors::Descriptors): Initialize new
9157 field.
9158 (Descriptors::open): Use initialize_lock_ field
9159 * errors.h (class Errors): Add initialize_lock_ field.
9160 * errors.cc (Errors::Errors): Initialize new field.
9161 (Errors::initialize_lock): Use initialize_lock_ field.
9162 * powerpc.cc (class Target_selector_powerpc): Remove
9163 instantiated_target_ field. In do_recognize call
9164 instantiate_target rather than do_instantiate_target. In
9165 do_instantiate_target just allocate a new target.
9166 * sparc.cc (class Target_selector_sparc): Likewise.
9167
9168 * freebsd.h: New file.
9169 * i386.cc: Include "freebsd.h".
9170 (Target_i386): Derive from Target_freebsd rather than
9171 Sized_target.
9172 (Target_selector_i386): Derive from Target_selector_freebsd rather
9173 than Target_selector.
9174 * x86_64.cc: Include "freebsd.h".
9175 (Target_x86_64): Derive from Target_freebsd rather than
9176 Sized_target.
9177 (Target_selector_x86_64): Derive from Target_selector_freebsd
9178 rather than Target_selector.
9179 * target.h (class Target): Add adjust_elf_header and
9180 do_adjust_elf_header.
9181 * output.cc (Output_file_header:: do_sized_write): Call target
9182 adjust_elf_header routine.
9183 * configure.tgt: Set targ_osabi.
9184 * configure.ac: Define GOLD_DEFAULT_OSABI.
9185 * parameters.cc (Parameters::default_target): Pass
9186 GOLD_DEFAULT_OSABI to select_target.
9187 * target-select.h (class Target_selector): Make instantiate_target
9188 protected rather than private.
9189 * Makefile.am (HFILES): Add freebsd.h.
9190 * configure, Makefile.in, config.in: Rebuild.
9191
9192 * merge.cc (do_add_input_section): Correct pend value. Change
9193 message about last entry not being null terminated from error to
9194 warning.
9195
9196 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9197
9198 * incremental.cc: New file.
9199 * Makefile.am (CCFILES): Add incremental.cc.
9200 * Makefile.in: Rebuild.
9201
9202 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9203
9204 * layout.cc (Layout::output_section_name): Preserve names
9205 of '.note.' sections.
9206
9207 2009-03-19 Ian Lance Taylor <iant@google.com>
9208
9209 * descriptors.cc (Descriptors::open): Check that the options are
9210 valid before using them.
9211
9212 2009-03-18 Ian Lance Taylor <iant@google.com>
9213
9214 * script-sections.h: Include <list>.
9215 (class Script_sections): Change Sections_elements from std::vector
9216 to std::list. Typedef public Elements_iterator. Add
9217 orphan_section_placement_, data_segment_align_start_, and
9218 saw_data_segment_align_ fields. Remove data_segment_align_index_
9219 field.
9220 * script-sections.cc (class Orphan_section_placement): New class.
9221 (class Sections_element): Add virtual functions is_relro and
9222 orphan_section_init. Remove virtual function place_orphan_here.
9223 (class Output_section_definition): Add is_relro and
9224 orphan_section_init. Remove place_orphan_here.
9225 (class Orphan_output_section): Likewise.
9226 (Script_sections::Script_sections): Update for field changes.
9227 (Script_sections::data_segment_align): Set saw_data_segment_align_
9228 and data_segment_align_start_, not data_segment_align_index.
9229 (Script_sections::data_segment_relro_end): Check
9230 saw_data_segment_align_. Use data_segment_align_start_ rather
9231 than data_segment_align_index_.
9232 (Script_sections::place_orphan): Rewrite to use
9233 Orphan_section_placement.
9234
9235 2009-03-17 Ian Lance Taylor <iant@google.com>
9236
9237 * archive.cc (Archive::add_symbols): Check for a version attached
9238 to the symbol name in the archive map.
9239 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9240 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9241 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9242 (ver_test_11.a): New target.
9243 * testsuite/Makefile.in: Rebuild.
9244
9245 * configure.ac: Check for chsize and posix_fallocate. Replace
9246 ftruncate.
9247 * ftruncate.c: New file, from gnulib.
9248 * output.cc (posix_fallocate): Define dummy version if not
9249 HAVE_POSIX_FALLOCATE.
9250 (Output_file::map): Call posix_fallocate rather than lseek and
9251 write.
9252 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9253 * configure, Makefile.in, config.in: Rebuild.
9254
9255 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
9256
9257 * layout.h (Layout::create_note): Add section_name parameter.
9258 * layout.cc (Layout::create_note): Likewise.
9259 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
9260
9261 2009-03-17 Ian Lance Taylor <iant@google.com>
9262
9263 * descriptors.cc: Include "options.h".
9264 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9265 (Descriptors::open): Always use O_CLOEXEC when opening a new
9266 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9267 then set FD_CLOEXEC.
9268
9269 * sparc.cc (class Target_sparc): Add has_got_section.
9270 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9271 make sure we have a GOT section.
9272
9273 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9274 (Target_sparc::Scan::local): Likewise.
9275 (Target_sparc::Scan::global): Likewise.
9276 (Target_sparc::Relocate::relocate): Likewise.
9277 (Target_sparc::Relocate::relocate_tls): Likewise.
9278
9279 * symtab.cc (Symbol_table::define_default_version): New function,
9280 broken out of add_from_object.
9281 (Symbol_table::add_from_object): Call define_default_version.
9282 (Symbol_table::define_special_symbol): Add resolve_oldsym
9283 parameter. Change all callers. If the version for a symbol comes
9284 from a version script, resolve it with the symbol with the same
9285 name with no version. Also add the symbol without a version if
9286 appropriate.
9287 (do_define_in_output_data): If resolving with oldsym, don't delete
9288 sym.
9289 (do_define_in_output_segment): Likewise.
9290 (do_define_as_constant): Likewise.
9291 * symtab.h (class Symbol_table): Update declarations.
9292
9293 2009-03-13 Ian Lance Taylor <iant@google.com>
9294
9295 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9296 (Read_symbols::requeue): New function.
9297 (Read_symbols::do_read_symbols): If make_elf_object fails because
9298 the target type is not configured, and the file was searched for,
9299 issue a warning and retry with the next directory.
9300 (Add_symbols::run): If the file has an incompatible format, and
9301 it was searched for, requeue the Read_symbols task. On error,
9302 release the object.
9303 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9304 dirindex parameter to constructor. Change all callers. Declare
9305 incompatible_warning and requeue.
9306 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9307 input_argument_ and input_group_ fields. Add them to
9308 constructor. Change all callers.
9309 (class Read_script): Add dirindex_ field. Add it to constructor.
9310 Change all callers.
9311 * archive.cc (Archive::setup): Remove input_objects parameter.
9312 Change all callers.
9313 (Archive::get_file_and_offset): Likewise.
9314 (Archive::read_all_symbols): Likewise.
9315 (Archive::read_symbols): Likewise.
9316 (Archive::get_elf_object_for_member): Remove input_objects
9317 parameter. Add punconfigured parameter. Change all callers.
9318 (Archive::add_symbols): Change return type to bool. Check return
9319 value of include_member.
9320 (Archive::include_all_members): Likewise.
9321 (Archive::include_member): Change return type to bool. Return
9322 false if first included object has incompatible target. Set
9323 included_member_ field.
9324 (Add_archive_symbols::run): If add_symbols returns false, requeue
9325 Read_symbols task.
9326 * archive.h (class Archive): Add included_member_ field.
9327 Initialize it in constructor. Add input_file and searched_for
9328 methods. Update declarations.
9329 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9330 input_argument_ fields. Add them to constructor. Change all
9331 callers.
9332 * script.cc: Include "target-select.h".
9333 (class Parser_closure): Add skip_on_incompatible_target_ and
9334 found_incompatible_target_ fields. Add
9335 skip_on_incompatible_target parameter to constructor. Change all
9336 callers. Add methods skip_on_incompatible_target,
9337 clear_skip_on_incompatible_target, found_incompatible_target, and
9338 set_found_incompatible_target.
9339 (read_input_script): Add dirindex parameter. Change all callers.
9340 If parser finds an incompatible target, requeue Read_symbols
9341 task.
9342 (script_set_symbol): Clear skip_on_incompatible_target in
9343 closure.
9344 (script_add_assertion, script_parse_option): Likewise.
9345 (script_start_sections, script_add_phdr): Likewise.
9346 (script_check_output_format): New function.
9347 * script.h (read_input_script): Update declaration.
9348 * script-c.h (script_check_output_format): Declare.
9349 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9350 (ignore_cmd): Remove OUTPUT_FORMAT.
9351 * fileread.cc (Input_file::Input_file): Add explicit this.
9352 (Input_file::will_search_for): New function.
9353 (Input_file::open): Add pindex parameter. Change all callers.
9354 * fileread.h (class Input_file): Add input_file_argument method.
9355 Declare will_search_for. Update declarations.
9356 * object.cc (make_elf_object): Add punconfigured parameter.
9357 Change all callers.
9358 * object.h (class Object): Make input_file public. Add
9359 searched_for method.
9360 (make_elf_object): Update declaration.
9361 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9362 restart search.
9363 * dirsearch.h (class Dirsearch): Update declaration.
9364 * options.h (class General_options): Add --warn-search-mismatch.
9365 * parameters.cc (Parameters::is_compatible_target): New function.
9366 * parameters.h (class Parameters): Declare is_compatible_target.
9367 * workqueue.cc (Workqueue::add_blocker): New function.
9368 * workqueue.h (class Workqueue): Declare add_blocker.
9369
9370 * fileread.cc (Input_file::open): Remove options parameter.
9371 Change all callers.
9372 (Input_file::open_binary): Likewise.
9373 * script.cc (read_input_script): Likewise.
9374 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9375 options parameter from constructor. Change all callers.
9376 (class Read_script): Likewise.
9377 * fileread.h (class Input_file): Update declarations.
9378 * script.h (read_input_script): Update declaration.
9379
9380 2009-03-10 Nick Clifton <nickc@redhat.com>
9381
9382 * po/es.po: New Spanish translation.
9383
9384 2009-03-06 Cary Coutant <ccoutant@google.com>
9385
9386 * options.cc (parse_short_option): Keep dash_z from registering itself.
9387
9388 2009-03-03 Ian Lance Taylor <iant@google.com>
9389
9390 PR 9918
9391 * target-reloc.h (relocate_section): Pass output_section to
9392 relocate.
9393 * i386.cc (Target_i386::should_apply_static_reloc): Add
9394 output_section parameter. Change all callers.
9395 (Target_i386::Relocate::relocate): Add output_section parameter.
9396 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9397 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9398 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9399 * testsuite/two_file_shared.sh: New script.
9400 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9401 (check_DATA): Add two_file_shared.dbg.
9402 (two_file_shared.dbg): New target.
9403 * testsuite/Makefile.in: Rebuild.
9404
9405 2009-03-01 Ian Lance Taylor <iant@google.com>
9406
9407 * configure.ac: Check for byteswap.h.
9408 * configure: Rebuild.
9409 * config.in: Rebuild.
9410
9411 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9412
9413 * layout.cc (Layout::find_or_add_kept_section): New function.
9414 (Layout::add_comdat): Removed.
9415 * layout.h (struct Kept_section): Move out of class Layout.
9416 Remove trailing underscores from field names. Add group_sections
9417 field. Rename group_ field to is_group. Change all uses.
9418 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9419 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9420 comdat_groups_ field.
9421 (Sized_relobj::include_section_group): Use
9422 find_or_add_kept_section and Kept_section::group_sections.
9423 (Sized_relobj::include_linkonce_section): Likewise.
9424 * object.cc (class Sized_relobj): Don't define Comdat_group or
9425 Comdat_group_table. Remove find_comdat_group and
9426 add_comdat_group. Remove comdat_groups_ field.
9427 * plugin.cc (include_comdat_group): Use
9428 Layout::find_or_add_kept_section.
9429
9430 2009-02-28 Ian Lance Taylor <iant@google.com>
9431
9432 * README: --gc-sections and map files are now supported. Document
9433 some build requirements.
9434
9435 PR 6992
9436 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9437 relocatable link set the value of the section symbol to zero.
9438 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9439 relocatable link don't include the section address in the local
9440 symbol value.
9441
9442 2009-02-27 Ian Lance Taylor <iant@google.com>
9443
9444 PR 6811
9445 * options.h (class Search_directory): Add is_system_directory.
9446 (class General_options): Declare is_in_system_directory.
9447 * options.cc (get_relative_sysroot): Make static.
9448 (get_default_sysroot): Make static.
9449 (General_optoins::is_in_system_directory): New function.
9450 * fileread.cc (Input_file::is_in_system_directory): New function.
9451 * fileread.h (class Input_file): Declare is_in_system_directory.
9452 * object.h (class Object): Add is_in_system_directory.
9453 (class Input_objects): Remove system_library_directory_ field.
9454 * object.cc (Input_objects::add_object): Don't set
9455 system_library_directory_.
9456 (input_objects::found_in_system_library_directory): Remove.
9457 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9458 parameter. Change all callers.
9459 (Symbol_table::sized_write_globals): Likewise.
9460 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9461 Call Object::is_in_system_directory.
9462 * symtab.h (class Symbol_table): Update declarations.
9463
9464 PR 5990
9465 * descriptors.h (Open_descriptor): Add is_on_stack field.
9466 * descriptors.cc (Descriptors::open): If the descriptor is on the
9467 top of the stack, remove it. Initialize is_on_stack field.
9468 (Descriptors::release): Only add pod to stack if it is not on the
9469 stack already.
9470 (Descriptors::close_some_descriptor): Clear stack_next and
9471 is_on_stack fields.
9472
9473 PR 7091
9474 * output.cc (Output_section::find_starting_output_address): Rename
9475 from starting_output_address; add PADDR parameter; change return
9476 type.
9477 * output.h (class Output_section): Declare
9478 find_starting_output_address instead of starting_output_address.
9479 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9480 section symbol for which we can't find a merge section.
9481
9482 PR 9836
9483 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9484 hidden or internal, force the symbol to be local.
9485 * resolve.cc (Symbol::override_visibility): Define.
9486 (Symbol::override_base): Use override_visibility.
9487 (Symbol_table::resolve): Likewise.
9488 (Symbol::override_base_with_special): Likewise.
9489 (Symbol_table::override_with_special): If the visibility is hidden
9490 or internal, force the symbol to be local.
9491 * symtab.h (class Symbol): Add set_visibility and
9492 override_visibility.
9493 * testsuite/ver_test_1.sh: New file.
9494 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9495 (check_DATA): Add ver_test_1.syms.
9496 (ver_test_1.syms): New target.
9497 * testsuite/Makefile.in: Rebuild.
9498
9499 2009-02-25 Cary Coutant <ccoutant@google.com>
9500
9501 * layout.cc (Layout::choose_output_section): Don't rename sections
9502 when using a linker script that has a SECTIONS clause.
9503 * Makefile.in: Regenerate.
9504
9505 * testsuite/Makefile.am (script_test_5.sh): New test case.
9506 * testsuite/Makefile.in: Regenerate.
9507 * testsuite/script_test_5.cc: New file.
9508 * testsuite/script_test_5.sh: New file.
9509 * testsuite/script_test_5.t: New file.
9510
9511 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
9512
9513 * archive.cc (Archive::include_member): Update calls to add_symbols.
9514 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9515 the Layout argument.
9516 * dynobj.h (do_add_symbols): Add the Layout argument.
9517 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9518 Layout argument.
9519 * object.h (Object::add_symbols): Add the Layout argument.
9520 (Object::do_add_symbols): Add the Layout argument.
9521 (Sized_relobj::do_add_symbols): Add the Layout argument.
9522 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9523 Unify the two versions.
9524 (Add_plugin_symbols): Remove.
9525 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9526 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9527 (Add_plugin_symbols): Remove.
9528 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9529 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9530 (Add_symbols::run): Make it work with Pulginobj.
9531
9532 2009-02-06 Ian Lance Taylor <iant@google.com>
9533
9534 * object.cc (Sized_relobj::do_layout): Make info message start
9535 with lower case letter.
9536
9537 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9538
9539 * binary.cc: Fix file comment.
9540
9541 * options.h (enum Incremental_disposition): Define.
9542 (class General_options): Add new options: --incremental,
9543 --incremental_changed, --incremental_unchanged,
9544 --incremental_unknown. Add incremental_disposition_ and
9545 implicit_incremental_ fields.
9546 (General_options::incremental_disposition): New function.
9547 (class Position_dependent_options): Add incremental_disposition
9548 option.
9549 (Position_dependent_options::copy_from_options): Set incremental
9550 dispositions.
9551 * options.cc (General_options::parse_incremental_changed): New
9552 function.
9553 (General_options::parse_incremental_unchanged): New function.
9554 (General_options::parse_incremental_unknown): New function.
9555 (General_options::General_options): Initialize new fields
9556 incremental_disposition_ and implicit_incremental_.
9557 (General_options::finalize): Check for uasge of --incremental-*
9558 without --incremental.
9559
9560 2009-02-06 Chris Demetriou <cgd@google.com>
9561
9562 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9563 pointer and to report location as the file name associated with
9564 the symbol.
9565 (gold_undefined_symbol_at_location): New function to replace the
9566 old gold_undefined_symbol functionality.
9567 * target-reloc.h (relocate_section): Update to use
9568 gold_undefined_symbol_at_location.
9569 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9570 Call gold_undefined_symbol function rather than gold_error.
9571 * errors.h (Errors::undefined_symbol): Take location as a
9572 string, rather than calculating it from a relocation.
9573 * errors.cc (Errors::fatal): Print "fatal error:" before the
9574 formatted message.
9575 (Errors::error, Errors::error_at_location): Print "error: "
9576 before the formatted message.
9577 (Errors::undefined_symbol): Take location as a string, rather
9578 than calculating it from a relocation.
9579 (gold_undefined_symbol_at_location): New function akin to
9580 old gold_undefined_symbol, calculates location from relocation.
9581 (gold_undefined_symbol): Change to take only a Symbol pointer
9582 and to report location as the file name associated with the symbol.
9583 * testsuite/debug_msg.sh: Update for changed error messages.
9584 * testsuite/undef_symbol.sh: Likewise.
9585
9586 2009-02-04 Duncan Sands <baldrick@free.fr>
9587
9588 PR 9812
9589 * reduced_debug_output.h
9590 (Output_reduced_debug_abbrev_section::failed): Use format for
9591 gold_warning.
9592 (Output_reduced_debug_info_section::faild): Likewise.
9593
9594 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9595
9596 * script.cc (Lazy_demangler): New class.
9597 (Version_script_info::get_symbol_version_helper): Demangle a
9598 symbol only once.
9599
9600 2009-01-29 Cary Coutant <ccoutant@google.com>
9601
9602 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9603 to __tls_get_addr.
9604 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9605
9606 2009-01-28 Ian Lance Taylor <iant@google.com>
9607
9608 * version.cc (version_string): Bump to 1.9.
9609
9610 * gold.h: Include <cstring> and <stdint.h>.
9611 * version.cc: Include <cstdio>.
9612 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9613 warning.
9614 * reduced_debug_output.cc (insert_into_vector): Rename from
9615 Insert_into_vector; change all callers. Use Swap_unaligned to
9616 avoid aliasing issue; remove union since it is unnecessary.
9617
9618 2009-01-27 Sriraman Tallam <tmsriram@google.com>
9619
9620 * Makefile.am (CCFILES): Add gc.cc.
9621 (HFILES): Add gc.h.
9622 * Makefile.in: Regenerate.
9623 * gold.cc (Gc_runner): New class.
9624 (queue_initial_tasks): Call garbage collection related tasks
9625 when corresponding options are invoked.
9626 (queue_middle_gc_tasks): New function.
9627 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9628 processed early before laying out sections during garbage collection.
9629 * gold.h (queue_middle_gc_tasks): New function.
9630 (is_prefix_of): Move from "layout.cc".
9631 * i386.cc (Target_i386::gc_process_relocs): New function.
9632 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9633 * main.cc (main): Create object of class "Garbage_collection".
9634 * object.cc (Relobj::copy_symbols_data): New function.
9635 (Relobj::is_section_name_included): New function.
9636 (Sized_relobj::do_layout): Allow this function to be called twice
9637 during garbage collection and defer layout of section during the
9638 first call.
9639 * object.h (Relobj::get_symbols_data): New function.
9640 (Relobj::is_section_name_included): New function.
9641 (Relobj::copy_symbols_data): New function.
9642 (Relobj::set_symbols_data): New function.
9643 (Relobj::get_relocs_data): New function.
9644 (Relobj::set_relocs_data): New function.
9645 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9646 (Relobj::gc_process_relocs): New function.
9647 (Relobj::do_gc_process_relocs): New pure virtual function.
9648 (Relobj::sd_): New data member.
9649 (Sized_relobj::is_output_section_offset_invalid): New function.
9650 (Sized_relobj::do_gc_process_relocs): New function.
9651 * options.h (General_options::gc_sections): Modify to not be a no-op.
9652 (General_options::print_gc_sections): New option.
9653 * plugin.cc (Plugin_finish::run): Remove function call to
9654 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9655 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9656 * reloc.cc (Read_relocs::run): Add task to process relocs and
9657 determine unreferenced sections when doing garbage collection.
9658 (Gc_process_relocs): New class.
9659 (Sized_relobj::do_gc_process_relocs): New function.
9660 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9661 sections that are garbage collected.
9662 * reloc.h (Gc_process_relocs): New class.
9663 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9664 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9665 symbols whose corresponding sections are garbage collected.
9666 (Symbol_table::Symbol_table): Add new parameter for the garbage
9667 collection object.
9668 (Symbol_table::gc_mark_undef_symbols): New function.
9669 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9670 (Symbol_table::gc_mark_dyn_syms): New function.
9671 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9672 as garbage.
9673 (Symbol_table::add_from_object): Likewise.
9674 (Symbol_table::add_from_relobj): When building shared objects, do not
9675 treat externally visible symbols as garbage.
9676 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9677 table information for static and relocatable links.
9678 * symtab.h (Symbol_table::set_gc): New function.
9679 (Symbol_table::gc): New function.
9680 (Symbol_table::gc_mark_undef_symbols): New function.
9681 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9682 (Symbol_table::gc_mark_dyn_syms): New function.
9683 (Symbol_table::gc_): New data member.
9684 * target.h (Sized_target::gc_process_relocs): New pure virtual
9685 function.
9686 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9687 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9688
9689 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9690
9691 * options.h (General_options::gc_sections): Define as a no-op for now.
9692 (General_options::no_keep_memory): Ditto.
9693 (General_options::Bshareable): Define.
9694 * options.cc (General_options::finalize): Honor -Bshareable.
9695
9696 2009-01-20 Andreas Schwab <schwab@suse.de>
9697
9698 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9699 read the value in the contents, since we don't use it. Use the
9700 template endianness when writing.
9701 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9702
9703 2009-01-19 Andreas Schwab <schwab@suse.de>
9704
9705 * configure.tgt (powerpc64-*): Fix targ_obj.
9706
9707 2009-01-15 Ian Lance Taylor <iant@google.com>
9708
9709 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9710 local symbols when stripping all symbols.
9711
9712 2009-01-14 Cary Coutant <ccoutant@google.com>
9713
9714 * output.cc (Output_reloc): Add explicit instantiations.
9715
9716 2009-01-14 Cary Coutant <ccoutant@google.com>
9717
9718 * archive.cc (Archive::get_elf_object_for_member): Remove call
9719 to File_read::claim_for_plugin.
9720 * descriptors.cc (Descriptors::open): Remove reference to
9721 is_claimed.
9722 (Descriptors::claim_for_plugin): Remove.
9723 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9724 (Descriptors::is_claimed): Remove.
9725 (claim_descriptor_for_plugin): Remove.
9726 * fileread.cc (File_read::claim_for_plugin): Remove.
9727 * fileread.h (File_read::claim_for_plugin): Remove.
9728 (File_read::descriptor): Reopen descriptor if necessary.
9729 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9730 (Plugin_manager::all_symbols_read): Add task parameter. Change
9731 all callers.
9732 (Plugin_manager::get_input_file): New function.
9733 (Plugin_manager::release_input_file): New function.
9734 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9735 corresponding data member.
9736 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9737 and pass to base constructor. Change all callers.
9738 (get_input_file, release_input_file): New functions.
9739 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9740 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9741 (Plugin_manager::all_symbols_read): Add task parameter.
9742 (Plugin_manager::get_input_file): New function.
9743 (Plugin_manager::release_input_file): New function.
9744 (Plugin_manager::task_): New data member.
9745 (Pluginobj::Pluginobj): Add filesize parameter.
9746 (Pluginobj::filename): New function.
9747 (Pluginobj::descriptor): New function.
9748 (Pluginobj::filesize): New function.
9749 (Pluginobj::filesize_): New data member.
9750 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9751 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9752 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9753
9754 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9755 with archive libraries.
9756 * testsuite/Makefile.in: Regenerate.
9757 * testsuite/plugin_test.c (struct sym_info): New type.
9758 (get_input_file, release_input_file): New static variables.
9759 (onload): Capture new transfer vector entries.
9760 (claim_file_hook): Stop reading at end of file according to filesize.
9761 Factor out parsing of readelf output into separate function.
9762 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9763 APIs and get the source file name from the symbol table. Convert
9764 source file name to corresponding object file name. Print info
9765 message when adding new input files.
9766 (parse_readelf_line): New function.
9767 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9768 * testsuite/plugin_test_2.sh: Likewise.
9769 * testsuite/plugin_test_3.sh: Likewise.
9770 * testsuite/plugin_test_4.sh: New test case.
9771
9772 2009-01-07 Ian Lance Taylor <iant@google.com>
9773
9774 * version.cc (version_string): Bump to 1.8.
9775
9776 2008-12-23 Cary Coutant <ccoutant@google.com>
9777
9778 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9779 * plugin.cc (Plugin_manager::finish): Rename as
9780 layout_deferred_objects. Move cleanup to separate function.
9781 (Plugin_manager::cleanup): New function.
9782 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9783 separately.
9784 * plugin.h (Plugin_manager::finish): Rename as
9785 layout_deferred_objects.
9786 (Plugin_manager::cleanup): New function.
9787 (Plugin_manager::cleanup_done): New field.
9788
9789 2008-12-23 Cary Coutant <ccoutant@google.com>
9790
9791 * plugin.cc (is_visible_from_outside): New function.
9792 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9793 so we don't return "IR only" status for exported symbols or -r links.
9794
9795 * testsuite/Makefile.am (plugin_test_3): New test case.
9796 * testsuite/Makefile.in: Regenerate.
9797 * testsuite/plugin_test_3.sh: New file.
9798
9799 2008-12-22 Cary Coutant <ccoutant@google.com>
9800
9801 * object.cc (Sized_relobj::layout_section): New function.
9802 (Sized_relobj::do_layout): Defer layout of input sections until after
9803 plugin has provided replacement files.
9804 (Sized_relobj::do_layout_deferred_sections): New function.
9805 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9806 (Relobj::layout_deferred_sections): New function.
9807 (Relobj::do_layout_deferred_sections): New function.
9808 (Sized_relobj::do_layout_deferred_sections): New function.
9809 (Sized_relobj::layout_section): New function.
9810 (Sized_relobj::Deferred_layout): New structure.
9811 (Sized_relobj::deferred_layout_): New field.
9812 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9813 Change all callers. Layout deferred sections.
9814 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9815 references.
9816 (Plugin_hook::run): Move code from do_plugin_hook inline.
9817 (Plugin_hook::do_plugin_hook): Remove.
9818 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9819 (Plugin_manager::finish): Renamed, was cleanup.
9820 (Plugin_manager::should_defer_layout): New function.
9821 (Plugin_manager::add_deferred_layout_object): New function.
9822 (Plugin_manager::Deferred_layout_list): New type.
9823 (Plugin_manager::deferred_layout_objects_): New field.
9824 (Plugin_hook::do_plugin_hook): Remove.
9825
9826 2008-12-17 Ian Lance Taylor <iant@google.com>
9827
9828 * options.h (class General_options): Add --no case for
9829 --export-dynamic.
9830
9831 2008-12-16 Cary Coutant <ccoutant@google.com>
9832
9833 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9834 vector.
9835 (Plugin_manager::claim_file): Create plugin object even if
9836 plugin did not call the add_symbols callback.
9837 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9838 asking for more symbols than were added.
9839 * testsuite/Makefile.am (plugin_test_1): Add test case with
9840 no global symbols.
9841 (empty.syms): New target.
9842 * testsuite/Makefile.in: Regenerate.
9843 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9844 message. Don't call add_symbols if no globals.
9845 (all_symbols_read_hook): Don't provide replacement for empty
9846 claimed file.
9847
9848 2008-12-12 Ian Lance Taylor <iant@google.com>
9849
9850 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9851 r_type == 0 for a local symbol with r_sym == 0.
9852 (scan_relocatable_relocs): Pass r_sym to
9853 local_non_section_strategy.
9854 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9855 r_sym parameter.
9856
9857 * configure.ac: Update test for TLS descriptors: they are
9858 supported as of glibc 2.9.
9859 * configure: Rebuild.
9860
9861 2008-12-11 Ian Lance Taylor <iant@google.com>
9862
9863 PR 7091
9864 * target-reloc.h (Default_scan_relocatable_relocs): For each
9865 function, map r_type == 0 to RELOC_DISCARD.
9866
9867 2008-12-10 Cary Coutant <ccoutant@google.com>
9868
9869 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9870 object to override a kept COMDAT group from a plugin object.
9871
9872 2008-12-09 Ian Lance Taylor <iant@google.com>
9873
9874 PR 7088
9875 * yyscript.y (file_cmd): Handle INPUT.
9876
9877 * testsuite/initpri1.c: Change all declarations to be full
9878 prototypes by adding void, to avoid compiler warnings.
9879
9880 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
9881
9882 * options.cc (General_options::parse_plugin_opt): New.
9883 (General_options::add_plugin): The argument now is just the filename.
9884 (General_options::add_plugin_option): New.
9885 * options.h (plugin_opt): New.
9886 (add_plugin): Change argument name.
9887 (add_plugin_option): New.
9888 * plugin.cc (Plugin::load): Don't parse the plugin option.
9889 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9890 (Plugin::add_option): New.
9891 (Plugin::args_): Change type.
9892 (Plugin::filename_): New.
9893 (Plugin_manager::add_plugin_option): New.
9894 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9895 * testsuite/Makefile.in: Regenerate.
9896
9897 2008-12-05 Cary Coutant <ccoutant@google.com>
9898
9899 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9900 Handle --strip-lto-sections option.
9901 * options.h (strip_lto_sections): New option.
9902
9903 2008-12-01 Cary Coutant <ccoutant@google.com>
9904
9905 * plugin.cc (ld_plugin_message): Change format parameter to const.
9906 Fix mismatch between new[] and delete.
9907
9908 2008-11-14 Cary Coutant <ccoutant@google.com>
9909
9910 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9911 instead of -1U.
9912
9913 2008-11-05 Craig Silverstein <csilvers@google.com>
9914
9915 * options.cc (General_options::parse_dynamic_list): New function.
9916 * options.h (General_options): New flags dynamic_list,
9917 dynamic_list_data, dynamic_list_cpp_new, and
9918 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9919 (General_options::in_dynamic_list): New function.
9920 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9921 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9922 (Lex::can_continue_name): Likewise.
9923 (yylex): Likewise.
9924 (read_script_file): New parameter script_options.
9925 (read_dynamic_list): New function.
9926 (Script_options::define_dynamic_list): New function.
9927 (dynamic_list_keyword_parsecodes): New variable.
9928 (dynamic_list_keywords): New variable.
9929 * script.h (Script_options::define_dynamic_list): New function
9930 prototype.
9931 (read_dynamic_list): New function prototype.
9932 * symtab.cc (strprefix): New macro.
9933 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9934 dynamic_list_data, dynamic_list_cpp_new, and
9935 dynamic_list_cpp_typeinfo.
9936 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9937 (dynamic_list_expr): New rule.
9938 (dynamic_list_nodes): Likewise.
9939 (dynamic_list_node): Likewise.
9940 * testsuite/Makefile.am (dynamic_list): New test.
9941 * testsuite/Makefile.in: Regenerated.
9942 * testsuite/dynamic_list.t: New file.
9943 * testsuite/dynamic_list.sh: New file.
9944
9945 2008-11-05 Craig Silverstein <csilvers@google.com>
9946
9947 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9948 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9949 (t11_last): Likewise.
9950 * testsuite/ver_test_6.c (main): Likewise.
9951
9952 2008-10-07 Cary Coutant <ccoutant@google.com>
9953
9954 * options.c (General_options::finalize): Add check for -static and
9955 -shared.
9956 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9957 is not empty.
9958
9959 2008-10-02 Cary Coutant <ccoutant@google.com>
9960
9961 * plugin.cc (make_sized_plugin_object): Fix conditional
9962 compilation to work when not all targets are enabled.
9963
9964 2008-09-29 Cary Coutant <ccoutant@google.com>
9965
9966 * archive.cc (Archive::get_file_and_offset): Use filename instead
9967 of name to get library path.
9968 (Archive::include_member): Unlock external member of a thin archive.
9969
9970 * testsuite/Makefile.am (TEST_AR): New variable.
9971 (thin_archive_test_1): New test.
9972 (thin_archive_test_2): New test.
9973 * testsuite/Makefile.in: Regenerate.
9974 * testsuite/thin_archive_main.cc: New file.
9975 * testsuite/thin_archive_test_1.cc: New file.
9976 * testsuite/thin_archive_test_2.cc: New file.
9977 * testsuite/thin_archive_test_3.cc: New file.
9978 * testsuite/thin_archive_test_4.cc: New file.
9979
9980 2008-09-29 Cary Coutant <ccoutant@google.com>
9981
9982 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9983 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9984 instead of -1U.
9985 (Sized_relobj::do_finalize_local_symbols): Likewise.
9986 (Sized_relobj::map_to_kept_section): Likewise.
9987 * object.h (Sized_relobj::invalid_address): New constant.
9988 (Sized_relobj::do_output_section_offset): Check for invalid_address
9989 and return -1ULL.
9990 * output.cc (Output_reloc::local_section_offset): Use constant
9991 invalid_address instead of -1U.
9992 (Output_reloc::get_address): Likewise.
9993 (Output_section::output_address): Change -1U to -1ULL.
9994 * output.h (Output_reloc::invalid_address): New constant.
9995 * reloc.cc (Sized_relobj::write_sections): Use constant
9996 invalid_address instead of -1U.
9997 (Sized_relobj::relocate_sections): Likewise.
9998 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9999 values for merge sections.
10000 * target-reloc.h (relocate_for_relocatable): Use constant
10001 invalid_address instead of -1U.
10002
10003 2008-09-19 Cary Coutant <ccoutant@google.com>
10004
10005 Add plugin functionality for link-time optimization (LTO).
10006 * configure.ac (plugins): Add --enable-plugins option.
10007 * configure: Regenerate.
10008 * config.in: Regenerate.
10009 * Makefile.am (LIBDL): New variable.
10010 (CCFILES): Add plugin.cc.
10011 (HFILES): Add plugin.h.
10012 (ldadd_var): Add LIBDL.
10013 * Makefile.in: Regenerate.
10014
10015 * archive.cc: Include "plugin.h".
10016 (Archive::setup): Don't preread archive symbols when using a plugin.
10017 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10018 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10019 files.
10020 (Archive::include_member): Add symbols from plugin objects.
10021 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10022 * descriptors.cc (Descriptors::open): Check for file descriptors
10023 abandoned by plugins.
10024 (Descriptors::claim_for_plugin): New function.
10025 * descriptors.h (Descriptors::claim_for_plugin): New function.
10026 (Open_descriptor::is_claimed): New field.
10027 (claim_descriptor_for_plugin): New function.
10028 * fileread.cc (File_read::claim_for_plugin): New function.
10029 * fileread.h (File_read::claim_for_plugin): New function.
10030 (File_read::descriptor): New function.
10031 * gold.cc: Include "plugin.h".
10032 (queue_initial_tasks): Add task to call plugin hooks for generating
10033 new object files.
10034 * main.cc: Include "plugin.h".
10035 (main): Load plugin libraries.
10036 * object.h (Pluginobj): Declare.
10037 (Object::pluginobj): New function.
10038 (Object::do_pluginobj): New function.
10039 (Object::set_target): New function.
10040 * options.cc: Include "plugin.h".
10041 (General_options::parse_plugin): New function.
10042 (General_options::General_options): Initialize plugins_ field.
10043 (General_options::add_plugin): New function.
10044 * options.h (Plugin_manager): Declare.
10045 (General_options): Add --plugin option.
10046 (General_options::has_plugins): New function.
10047 (General_options::plugins): New function.
10048 (General_options::add_plugin): New function.
10049 (General_options::plugins_): New field.
10050 * plugin.cc: New file.
10051 * plugin.h: New file.
10052 * readsyms.cc: Include "plugin.h".
10053 (Read_symbols::do_read_symbols): Check for archive before checking
10054 for ELF file. Call plugin hooks to claim files.
10055 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10056 from a real object file; force override when processing replacement
10057 files.
10058 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10059 (Symbol::init_base_object): Likewise.
10060 (Symbol::init_base_output_data): Likewise.
10061 (Symbol::init_base_output_segment): Likewise.
10062 (Symbol::init_base_constant): Likewise.
10063 (Symbol::init_base_undefined): Likewise.
10064 (Symbol::output_section): Assert that object is not a plugin.
10065 (Symbol_table::add_from_pluginobj): New function.
10066 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10067 undefined.
10068 (Symbol_table::sized_write_globals): Likewise.
10069 (Symbol_table::add_from_pluginobj): Instantiate template.
10070 * symtab.h (Sized_pluginobj): Declare.
10071 (Symbol::in_real_elf): New function.
10072 (Symbol::set_in_real_elf): New function.
10073 (Symbol::in_real_elf_): New field.
10074 (Symbol_table::add_from_pluginobj): New function.
10075
10076 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10077 (LIBDL): New variable.
10078 (LDADD): Add LIBDL.
10079 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10080 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10081 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10082 (MOSTLYCLEANFILES): Likewise.
10083 * testsuite/Makefile.in: Regenerate.
10084 * testsuite/plugin_test.c: New file.
10085 * testsuite/plugin_test_1.sh: New file.
10086 * testsuite/plugin_test_2.sh: New file.
10087
10088 2008-09-16 Ian Lance Taylor <iant@google.com>
10089
10090 * target-reloc.h (relocate_section): Check whether a symbol is
10091 defined by the ABI before reporting an undefined symbol error.
10092 * target.h (Target::is_defined_by_abi): Make parameter const.
10093 (Target::do_is_defined_by_abi): Likewise.
10094 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10095 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10096 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10097 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10098 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10099 * testsuite/Makefile.in: Rebuild.
10100
10101 * fileread.cc (make_view): Add casts to avoid warning.
10102
10103 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10104
10105 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10106 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10107
10108 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
10109
10110 * options.h (General_options::output_is_executable): New.
10111 (General_options::output_is_pie): New.
10112 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10113 for shared libraries.
10114 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10115
10116 2008-09-11 Chris Demetriou <cgd@google.com>
10117
10118 * options.h (origin): New -z option.
10119 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10120 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10121 in DT_FLAGS_1.
10122
10123 2008-09-05 Cary Coutant <ccoutant@google.com>
10124
10125 * fileread.cc (File_read::make_view): Add check for attempt to map
10126 beyond end of file.
10127
10128 2008-09-05 Cary Coutant <ccoutant@google.com>
10129
10130 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10131 explicit instantiations.
10132
10133 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10134
10135 PR gold/6858
10136 * options.cc (General_options::finalize): Allow undefined symbols
10137 in shlibs if linking -shared.
10138
10139 PR gold/6859
10140 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10141 symbols as not needing a dynsym entry.
10142
10143 2008-08-20 Craig Silverstein <csilvers@google.com>
10144
10145 * fileread.cc (File_read::open): Do not lock the file unless it
10146 was successfully opened.
10147
10148 2008-08-14 Cary Coutant <ccoutant@google.com>
10149
10150 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10151 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10152 * testsuite/tls_test.cc (struct int128): 128-bit struct
10153 for testing TLS relocs with non-zero addend.
10154 (v12): New TLS variable.
10155 (t12): New test.
10156 (t_last): Add check for v12.
10157 * testsuite/tls_test.h (t12): New function.
10158 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10159
10160 2008-08-13 Ian Lance Taylor <iant@google.com>
10161
10162 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10163 set tls_segment_ or relro_segment_.
10164 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10165 when appropriate.
10166 * output.h (Output_section::clear_is_relro): New function.
10167 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10168 sections specially even when output_data_ is empty.
10169 (Output_segment::maximum_alignment): When first section is relro,
10170 only force alignment for PT_LOAD segments.
10171 * script.cc (script_data_segment_align): New function.
10172 (script_data_segment_relro_end): New function.
10173 * script-c.h (script_data_segment_align): Declare.
10174 (script_data_segment_relro_end): Declare.
10175 * script-sections.h (class Script_sections): Declare
10176 data_segment_align and data_segment_relro_end. Add fields
10177 segment_align_index_ and saw_relro_end_.
10178 * script-sections.cc (class Sections_element): Add set_is_relro
10179 virtual function. Add new bool* parameter to place_orphan_here.
10180 Add get_output_section virtual function.
10181 (class Output_section_definition): Add set_is_relro. Add new
10182 bool* parameter to place_orphan_here. Add get_output_section.
10183 Add is_relro_ field.
10184 (Output_section_definition::Output_section_definition): Initialize
10185 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10186 and is_relro_ fields.
10187 (Output_section_definition::place_orphan_here): Add is_relro
10188 parameter.
10189 (Output_section_definition::set_section_addresses): Set relro for
10190 output section.
10191 (Output_section_definition::alternate_constraint): Likewise.
10192 (class Orphan_output_section): Add new bool* parameter to
10193 place_orphan_here. Add get_output_section.
10194 (Orphan_output_section::place_orphan_here): Add is_relro
10195 parameter.
10196 (Script_sections::Script_sections): Initialize
10197 data_segment_align_index_ and saw_relro_end_.
10198 (Script_sections::data_segment_align): New function.
10199 (Script_sections::data_segment_relro_end): New function.
10200 (Script_sections::place_orphan): Set or clear is_relro.
10201 (Script_sections::set_section_addresses): Force alignment of first
10202 TLS section.
10203 * yyscript.y (exp): Call script_data_segment_align and
10204 script_data_segment_relro_end.
10205 * testsuite/relro_script_test.t: New file.
10206 * testsuite/relro_test.cc (using_script): Declare.
10207 (t1, t2): Test using_script.
10208 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10209 (relro_script_test_SOURCES): Define.
10210 (relro_script_test_DEPENDENCIES): Define.
10211 (relro_script_test_LDFLAGS): Define.
10212 (relro_script_test_LDADD): Define.
10213 (relro_script_test.so): New target.
10214 * testsuite/Makefile.in: Rebuild.
10215
10216 2008-08-06 Cary Coutant <ccoutant@google.com>
10217
10218 * archive.cc (Archive::total_archives, Archive::total_members)
10219 (Archive::total_members_loaded): New variables.
10220 (Archive::setup): Add parameter. Add option to preread
10221 archive symbols.
10222 (Archive::read_armap): Add counter.
10223 (Archive::get_file_and_offset): New function.
10224 (Archive::get_elf_object_for_member): New function.
10225 (Archive::read_all_symbols): New function.
10226 (Archive::read_symbols): New function.
10227 (Archive::add_symbols): Add counters.
10228 (Archive::include_all_members): Use armap to find members if it's
10229 already built.
10230 (Archive::include_member): Skip reading symbols if already read.
10231 Factored code into Archive::get_file_and_offset and
10232 Archive::get_elf_object_for_member. Changed call to
10233 Mapfile::report_include_archive_member.
10234 (Archive::print_stats): New function.
10235 * archive.h: Declare Object and Read_symbols_data classes.
10236 (Archive::Archive): Add initializers for new members.
10237 (Archive::setup): Add parameter.
10238 (Archive::print_stats): New function.
10239 (Archive::total_archives, Archive::total_members)
10240 (Archive::total_members_loaded): New variables.
10241 (Archive::get_file_and_offset): New function.
10242 (Archive::get_elf_object_for_member): New function.
10243 (Archive::read_all_symbols): New function.
10244 (Archive::read_symbols): New function.
10245 (Archive::Archive_member): New class.
10246 (Archive::members_): New member.
10247 (Archive::num_members_): New member.
10248 * main.cc: Include archive.h.
10249 (main): Call Archive::print_stats.
10250 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10251 archive parameter; member_name is now the fully-decorated name.
10252 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10253 * options.h: (General_options): Add --preread-archive-symbols option.
10254 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10255 Archive::setup.
10256
10257 2008-08-04 Ian Lance Taylor <iant@google.com>
10258
10259 * symtab.h (Symbol::use_plt_offset): New function.
10260 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10261 * powerpc.cc (Relocate::relocate): Likewise.
10262 * sparc.cc (Relocate::relocate): Likewise.
10263 * x86_64.cc (Relocate::relocate): Likewise.
10264 * testsuite/weak_plt.sh: New test.
10265 * testsuite/weak_plt_main.cc: New test.
10266 * testsuite/weak_plt_shared.cc: New test.
10267 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10268 (check_PROGRAMS): Add weak_plt.
10269 (check_DATA): Add weak_plt_shared.so.
10270 (weak_plt_main_pic.o, weak_plt): New targets.
10271 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10272 * testsuite/Makefile.in: Rebuild.
10273
10274 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10275 gcctestdir/ld.
10276 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10277 * testsuite/Makefile.in: Rebuild.
10278
10279 2008-08-04 Alan Modra <amodra@bigpond.net.au>
10280
10281 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10282 * Makefile.in: Regenerate.
10283 * po/POTFILES.in: Regenerate.
10284
10285 2008-07-29 Ian Lance Taylor <iant@google.com>
10286
10287 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10288 symbols before other symbols.
10289 * testsuite/script_test_2.cc (test_addr): Declare.
10290 (test_addr_alias): Declare.
10291 (main): Check that test_addr and test_addr_alias have the right
10292 values.
10293 * testsuite/script_test_2.t: Define test_addr_alias and
10294 test_addr.
10295
10296 2008-07-24 Ian Lance Taylor <iant@google.com>
10297
10298 PR 5990
10299 * descriptors.cc: New file.
10300 * descriptors.h: New file.
10301 * gold-threads.h (class Hold_optional_lock): New class.
10302 * fileread.cc: Include "descriptors.h".
10303 (File_read::~File_read): Release descriptor rather than closing
10304 it.
10305 (File_read::open) [file]: Call open_descriptor rather than open.
10306 Set is_descriptor_opened_.
10307 (File_read::open) [memory]: Assert that descriptor is not open.
10308 (File_read::reopen_descriptor): New function.
10309 (File_read::release): Release descriptor.
10310 (File_read::do_read): Make non-const. Reopen descriptor.
10311 (File_read::read): Make non-const.
10312 (File_read::make_view): Reopen descriptor.
10313 (File_read::do_readv): Likewise.
10314 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10315 Update declarations.
10316 * layout.cc: Include "descriptors.h".
10317 (Layout::create_build_id): Use open_descriptor rather than open.
10318 * output.cc: Include "descriptors.h".
10319 (Output_file::open): Use open_descriptor rather than open.
10320 * archive.cc (Archive::const_iterator): Change Archive to be
10321 non-const.
10322 (Archive::begin, Archive::end): Make non-const.
10323 (Archive::count_members): Likewise.
10324 * archive.h (class Archive): Update declarations.
10325 * object.h (Object::read): Make non-const.
10326 * Makefile.am (CCFILES): Add descriptors.cc.
10327 (HFILES): Add descriptors.h.
10328 * Makefile.in: Rebuild.
10329
10330 PR 6716
10331 * gold.h: Always include <clocale>. Add Solaris workarounds
10332 following code in binutils/sysdep.h.
10333
10334 PR 6048
10335 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10336 this->eh_frame_hdr_ is NULL before using it.
10337
10338 * dynobj.cc (Versions::Versions): Update comment.
10339
10340 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10341 the base version name.
10342
10343 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10344 array size plus one.
10345 (Stringpool_template::set_string_offsets): Subtract one from key
10346 before using it as an array index.
10347 (Stringpool_template::get_offset_with_length): Likewise.
10348 (Stringpool_template::write_to_buffer): Likewise.
10349 * stringpool.h (Stringpool_template::get_offset_from_key):
10350 Likewise.
10351
10352 2008-07-23 Ian Lance Taylor <iant@google.com>
10353
10354 PR 6658
10355 * object.h (Merged_symbol_value::value): Do our best to handle a
10356 negative addend.
10357
10358 PR 6647
10359 * script.cc (Version_script_info::get_versions): Don't add empty
10360 version tag to return value.
10361 (Version_script_info::get_symbol_version_helper): Change return
10362 type to bool. Add pversion parameter. Change all callers.
10363 (script_register_vers_node): Don't require a non-NULL tag.
10364 * script.h (class Version_script_info): Update declarations.
10365 (Version_script_info::get_symbol_version): Change return type to
10366 bool. Add version parameter. Change all callers.
10367 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10368 handling. Handle an empty version from a version script.
10369 (Symbol_table::define_special_symbol): Likewise.
10370 * testsuite/ver_test_10.script: New file.
10371 * testsuite/ver_test_10.sh: New file.
10372 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10373 (check_DATA): Add ver_test_10.syms.
10374 (ver_test_10.syms, ver_test_10.so): New target.
10375 * testsuite/Makefile.in: Rebuild.
10376
10377 2008-07-23 Simon Baldwin <simonb@google.com>
10378
10379 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10380 to zero for undefined symbols from dynamic libraries.
10381
10382 2008-07-23 Ian Lance Taylor <iant@google.com>
10383
10384 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10385 Change all callers.
10386 * symtab.h (class Symbol_table): Update declaration.
10387 * testsuite/ver_test_9.cc: New file.
10388 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10389 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10390 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10391 (ver_test_9.so, ver_test_9.o): New targets.
10392 * testsuite/Makefile.in: Rebuild.
10393
10394 2008-07-22 Ian Lance Taylor <iant@google.com>
10395
10396 * options.h (class General_options): Define --check-sections.
10397 * layout.cc (Layout::set_segment_offsets): Handle
10398 --check-sections.
10399
10400 * options.h (class General_options): Define -n/--nmagic and
10401 -N/--omagic.
10402 * options.cc (General_options::finalize): For -n/--nmagic or
10403 -N/--omagic, set -static.
10404 * layout.cc (Layout::attach_allocated_section_to_segment): If
10405 -N/--omagic, don't put read-only and read-write sections in
10406 different segments.
10407 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10408 finding a read-only segment.
10409 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10410 don't set the minimum segment alignment to the common page size,
10411 and don't set the file offset to the address modulo the page size.
10412 * script-sections.cc (Script_sections::create_segments): If
10413 -n/--omagic, don't put read-only and read-write sections in
10414 different segments.
10415
10416 * cref.cc: New file.
10417 * cref.h: New file.
10418 * options.h (class General_options): Add --print-symbol-counts.
10419 * main.cc (main): Issue defined symbol report if requested.
10420 * archive.cc (Archive::interpret_header): Make into a const member
10421 function.
10422 (Archive::add_symbols): Call Input_objects::archive_start and
10423 archive_stop.
10424 (Archive::const_iterator): Define new class.
10425 (Archive::begin, Archive::end): New functions.
10426 (Archive::include_all_members): Rewrite to use iterator.
10427 (Archive::count_members): New function.
10428 * archive.h (class Archive): Update declarations.
10429 (Archive::filename): New function.
10430 * object.cc: Include "cref.h".
10431 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10432 (Sized_relobj::do_get_global_symbol_counts): New function.
10433 (Input_objects::add_object): Add object to cross-referencer.
10434 (Input_objects::archive_start): New function.
10435 (Input_objects::archive_stop): New function.
10436 (Input_objects::print_symbol_counts): New function.
10437 * object.h: Declare Cref and Archive.
10438 (Object::get_global_symbol_counts): New function.
10439 (Object::do_get_global_symbol_counts): New pure virtual function.
10440 (class Sized_relobj): Add defined_count_ field. Update
10441 declarations.
10442 (class Input_objects): Add cref_ field. Update constructor.
10443 Update declarations.
10444 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10445 defined_count_.
10446 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10447 symbol counts.
10448 (Sized_dynobj::do_get_global_symbol_counts): New function.
10449 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10450 defined_count_. Update declarations. Define Symbols typedef.
10451 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10452 parameter. Change all callers.
10453 (Symbol_table::add_from_dynobj): Add sympointers and defined
10454 parameters. Change all callers.
10455 * symtab.h (class Symbol_table): Update declarations.
10456 * Makefile.am (CCFILES): Add cref.cc.
10457 (HFILES): Add cref.h.
10458 * Makefile.in: Rebuild.
10459
10460 2008-07-22 Simon Baldwin <simonb@google.com>
10461
10462 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10463 to zero when writing undefined symbols.
10464
10465 2008-07-22 Ian Lance Taylor <iant@google.com>
10466
10467 * output.cc (Output_section::add_input_section): Don't try to
10468 merge empty merge sections.
10469
10470 2008-07-21 Craig Silverstein <csilvers@google.com>
10471
10472 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10473 Include symbol version in error message.
10474
10475 2008-07-20 Chris Demetriou <cgd@google.com>
10476
10477 * configure.ac (gold_cv_c_random_seed): New configured variable.
10478 (RANDOM_SEED_CFLAGS): New substituted variable.
10479 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10480 * configure: Rebuild.
10481 * Makefile.in: Likewise.
10482 * testsuite/Makefile.in: Likewise.
10483
10484 2008-07-18 Ian Lance Taylor <iant@google.com>
10485
10486 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10487 where we see NAME/NULL and NAME/VERSION as separate symbols.
10488 * testsuite/ver_test_main.cc (main): Call t4.
10489 (t4, t4_2a): Define.
10490 * testsuite/ver_test_2.cc (t4_2): Define.
10491 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10492 * testsuite/ver_test_4.cc (t4_2a): Define.
10493 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10494 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10495
10496 2008-07-17 Ian Lance Taylor <iant@google.com>
10497
10498 * dynobj.cc (Versions::add_def): If we give an error about a
10499 missing version, go ahead and create the version anyhow.
10500
10501 2008-07-10 Ian Lance Taylor <iant@google.com>
10502
10503 Handle output sections with more than 0x7fffffff bytes.
10504 * object.h (class Relobj): Change map_to_output_ to
10505 output_sections_, and just keep a section pointer. Change all
10506 uses. Move comdat group support to Sized_relobj.
10507 (Relobj::is_section_specially_mapped): Remove.
10508 (Relobj::output_section): Remove poff parameter. Change all
10509 callers.
10510 (Relobj::output_section_offset): New function.
10511 (Relobj::set_section_offset): Rewrite.
10512 (Relobj::map_to_output): Remove.
10513 (Relobj::output_sections): New function.
10514 (Relobj::do_output_section_offset): New pure virtual function.
10515 (Relobj::do_set_section_offset): Likewise.
10516 (class Sized_relobj): Add section_offsets_ field. Add comdat
10517 group support from Relobj. Update declarations.
10518 (Sized_relobj::get_output_section_offset): New function.
10519 (Sized_relobj::do_output_section_offset): New function.
10520 (Sized_relobj::do_set_section_offset): New function.
10521 * object.cc (Relobj::output_section_address): Remove.
10522 (Sized_relobj::Sized_relobj): Initialize new fields.
10523 (Sized_relobj::include_section_group): Cast find_kept_object to
10524 Sized_relobj.
10525 (Sized_relobj::include_linkonce_section): Likewise.
10526 (Sized_relobj::do_layout): Use separate arrays for output section
10527 and output offset.
10528 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10529 output_sections.
10530 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10531 output_sections and section_offsets.
10532 (Sized_relobj::write_local_symbols): Likewise.
10533 (map_to_kept_section): Compute output address directly.
10534 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10535 output_sections and section_offsets.
10536 (Sized_relobj::write_sections): Likewise.
10537 (Sized_relobj::relocate_sections): Likewise.
10538 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10539 * output.h (class Output_reloc): Update declarations. Change
10540 u2_.relobj to Sized_relobj*.
10541 (class Output_data_reloc): Change add functions to use
10542 Sized_relobj*.
10543 * output.cc (Output_reloc::Output_reloc): Change relobj to
10544 Sized_relobj*.
10545 (Output_reloc::local_section_offset): Change return type to
10546 Elf_Addr. Use get_output_section_offset.
10547 (Output_reloc::get_address): Likewise.
10548 (Output_section::is_input_address_mapped): Don't call
10549 is_section_specially_mapped.
10550 (Output_section::output_offset): Likewise.
10551 (Output_section::output_address): Likewise.
10552 (Output_section::starting_output_address): Likewise.
10553 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10554 parameter to Sized_relobj*.
10555 (Copy_relocs::need_copy_reloc): Likewise.
10556 (Copy_relocs::save): Likewise.
10557 * copy-relocs.h (class Copy_relocs): Update declarations.
10558 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10559 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10560 * target-reloc.h (relocate_for_relocatable): Change
10561 offset_in_output_section type to Elf_Addr. Change code that uses
10562 it as well.
10563 * layout.cc (Layout::layout): Always set *off.
10564 * mapfile.cc (Mapfile::print_input_section): Use
10565 output_section_offset.
10566 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10567 Sized_relobj*.
10568 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10569 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10570 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10571
10572 2008-07-03 Ian Lance Taylor <iant@google.com>
10573
10574 * layout.cc (Layout::include_section): Do not discard unrecognized
10575 SHT_STRTAB sections.
10576
10577 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10578
10579 * script.cc (Lex::can_continue_name): Make '?' allowable in
10580 version-script names.
10581 * testsuite/version_script.map: Change glob pattern to use '?'
10582
10583 2008-06-30 Manish Singh <yosh@gimp.org>
10584
10585 PR 6585
10586 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10587 Correct typo.
10588
10589 2008-06-30 Ian Lance Taylor <iant@google.com>
10590
10591 PR 6660
10592 PR 6682
10593 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10594 versions]: Don't try to read the value in the contents, since we
10595 don't use it. Use the template endianness when writing.
10596
10597 2008-06-25 Cary Coutant <ccoutant@google.com>
10598
10599 * fileread.cc (File_read::make_view): Assert on zero-length view.
10600 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10601 symbol table when there are no symbols to read.
10602
10603 2008-06-23 Craig Silverstein <csilvers@google.com>
10604
10605 * version.cc (version_string): Bump to 1.7
10606
10607 2008-06-18 Craig Silverstein <csilvers@google.com>
10608
10609 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10610 constant 0xFFFF to type Valtype.
10611 (Powerpc_relocate_functions::rel16_ha): Likewise.
10612
10613 2008-06-17 Ian Lance Taylor <iant@google.com>
10614
10615 * output.h (Output_section::Input_section): Initialize p2align_ to
10616 zero for Output_section_data constructors.
10617 (Output_section::Input_section::addralign): If not an input
10618 section, return the alignment of the Output_section_data.
10619 * testsuite/copy_test.cc: New file.
10620 * testsuite/copy_test_1.cc: New file.
10621 * testsuite/copy_test_2.cc: New file.
10622 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10623 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10624 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10625 (copy_test_1_pic.o, copy_test_1.so): New targets.
10626 (copy_test_2_pic.o, copy_test_2.so): New targets.
10627 * testsuite/Makefile.in: Rebuild.
10628
10629 * script-sections.cc (Script_sections::place_orphan): Initialize
10630 local variable exact.
10631
10632 2008-06-13 David Edelsohn <edelsohn@gnu.org>
10633
10634 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10635
10636 2008-06-12 David Edelsohn <edelsohn@gnu.org>
10637 David S. Miller <davem@davemloft.net>
10638
10639 * powerpc.cc: New file.
10640 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10641 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10642 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10643 * Makefile.in: Rebuild.
10644
10645 2008-06-09 Ian Lance Taylor <iant@google.com>
10646
10647 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10648 <exception>.
10649 (throwing, orig_terminate): New static variables.
10650 (terminate_handler): New static function.
10651 (t2): Set terminate handler.
10652
10653 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10654
10655 PR 6584
10656 * binary.cc (Binary_to_elf::sized_convert): Fix .data
10657 alignment.
10658
10659 2008-05-30 Cary Coutant <ccoutant@google.com>
10660
10661 * archive.cc (Archive::include_all_members) Correct to step
10662 over symbol table and extended name table in thin archives.
10663
10664 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10665
10666 PR 6407
10667 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10668 calculation.
10669
10670 2008-05-28 Caleb Howe <cshowe@google.com>
10671
10672 * reduced_debug_output.cc: New file.
10673 * reduced_debug_output.h: New file.
10674 * options.h (class General_options): Add --strip-debug-non-line.
10675 * options.cc (General_options::finalize): Add strip_debug_non_line
10676 to the strip heirarchy.
10677 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10678 fields.
10679 * layout.cc: Include "reduced_debug_output.h".
10680 (Layout::Layout): Initialize new fields.
10681 (line_only_debug_sections): New static array.
10682 (is_lines_only_debug_sections): New static inline function.
10683 (Layout::include_section): Handle --strip-debug-non-line.
10684 (Layout::make_output_section): If --strip-debug-non-line, build
10685 new output sections for .debug_abbrev and .debug_info.
10686 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10687 gold. Warn about possible overflow.
10688 (read_signed_LEB_128): Likewise.
10689 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10690 (read_signed_LEB_128): Declare.
10691 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10692 (HFILES): Add reduced_debug_output.h.
10693 * Makefile.in: Rebuild.
10694
10695 2008-05-21 Ian Lance Taylor <iant@google.com>
10696
10697 * mapfile.cc: New file.
10698 * mapfile.h: New file.
10699 * options.h (class General_options): Add -M/--print-map and -Map.
10700 * options.cc (General_options::finalize): Make -M equivalent to
10701 -Map -.
10702 * main.cc: Include <cstdio> and "mapfile.h".
10703 (main): Open mapfile if requested.
10704 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10705 constructor. Change caller.
10706 (queue_initial_tasks): Add mapfile parameter. Change caller.
10707 (queue_middle_tasks): Likewise.
10708 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10709 declarations.
10710 * archive.cc: Include "mapfile.h".
10711 (Archive::add_symbols): Add mapfile parameter. Change all
10712 callers. Pass mapfile, symbol, and reason to include_member.
10713 (Archive::include_all_members): Add mapfile parameter. Change all
10714 callers.
10715 (Archive::include_member): Add mapfile, sym, and why parameters.
10716 Change all callers. Report inclusion to map file.
10717 * archive.h: Include "fileread.h".
10718 (class Archive): Update declarations.
10719 (Archive::file): New const method.
10720 (class Add_archive_symbols): Add mapfile_ field. Update
10721 constructor. Change all callers.
10722 * readsyms.h (class Read_symbols): Likewise.
10723 (class Finish_group): Likewise.
10724 (class Read_script): Likewise.
10725 * common.cc: Include "mapfile.h".
10726 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10727 all callers.
10728 (Symbol_table::do_allocate_commons): Likewise.
10729 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10730 symbol allocation to mapfile.
10731 * common.h (class Allocate_commons_task): Add mapfile_ field.
10732 Update constructor. Change all callers.
10733 * symtab.h (class Symbol_table): Update declarations.
10734 * layout.cc: Include "mapfile.h".
10735 (Layout_task_runner::run): Print information to mapfile.
10736 (Layout::create_gold_note): Change Output_data_fixed_space to
10737 Output_data_zero_fill.
10738 (Layout::create_build_id): Likewise.
10739 (Layout::print_to_mapfile): New function.
10740 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10741 constructor. Change caller.
10742 (class Layout): Declare print_to_mapfile.
10743 * output.cc (Output_section::Input_section::print_to_mapfile): New
10744 function.
10745 (Output_section::add_input_section): If producing a map, always
10746 add to input_sections_ list.
10747 (Output_section::do_print_to_mapfile): New function.
10748 (Output_segment::print_sections_to_mapfile): New function.
10749 (Output_segment::print_section_list_to_mapfile): New function.
10750 * output.h: Include "mapfile.h".
10751 (Output_data::print_to_mapfile): New function.
10752 (Output_data::do_print_to_mapfile): New virtual function.
10753 (Output_segment_headers::do_print_to_mapfile): New function.
10754 (Output_file_header::do_print_to_mapfile): New function.
10755 (Output_data_const::do_print_to_mapfile): New function.
10756 (class Output_data_const_buffer): Add map_name_ field. Update
10757 constructor. Change all callers. Add do_print_to_mapfile
10758 function.
10759 (class Output_data_fixed_space): Likewise.
10760 (class Output_data_space): Likewise.
10761 (class Output_data_zero_fill): New class.
10762 (Output_data_strtab::do_print_to_mapfile): New function.
10763 (Output_data_reloc_base::do_print_to_mapfile): New function.
10764 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10765 (Output_data_group::do_print_to_mapfile): New function.
10766 (Output_data_got::do_print_to_mapfile): New function.
10767 (Output_data_dynamic::do_print_to_mapfile): New function.
10768 (Output_symtab_xindex::do_print_to_mapfile): New function.
10769 (class Output_section): Declare do_print_to_mapflie. Declare
10770 print_to_mapfile in Input_section.
10771 (class Output_segment): Declare new functions.
10772 * object.h (Sized_relobj::symbol_count): New function.
10773 * script-sections.cc
10774 (Output_section_element_dot_assignment::set_section_addresses):
10775 Change Output_data_fixed_space to Output_data_zero_fill.
10776 (Output_data_expression::do_print_to_mapfile): New function.
10777 * script.cc (read_input_script): Add mapfile parameter. Change
10778 all callers.
10779 * script.h (read_input_script): Update declaration.
10780 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10781 (Eh_frame::do_print_to_mapfile): New function.
10782 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10783 (Output_merge_string::do_print_to_mapfile): New function.
10784 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10785 function.
10786 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10787 function.
10788 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10789 function.
10790 * Makefile.am (CCFILES): Add mapfile.cc.
10791 (HFILES): Add mapfile.h.
10792 * Makefile.in: Rebuild.
10793
10794 2008-05-19 Ian Lance Taylor <iant@google.com>
10795
10796 * options.h (class General_options): Add -z relro.
10797 * layout.cc (Layout::Layout): Initialize relro_segment_.
10798 (Layout::add_output_section_data): Return the output section.
10799 (Layout::make_output_section): Rcognize relro sections and mark
10800 them appropriately.
10801 (Layout::attach_allocated_section_to_segment): Put relro sections
10802 in a PT_GNU_RELRO segment.
10803 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10804 section as relro.
10805 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10806 PT_TLS segments.
10807 (Layout::linkonce_mapping): Map d.rel.ro.local to
10808 .data.rel.ro.local.
10809 (Layout::output_section_name): Us .data.rel.ro.local for any
10810 section which begins with that.
10811 * layout.h (class Layout): Update add_output_section_data
10812 declaration. Add relro_segment_ field.
10813 * output.cc (Output_section::Output_section): Initialize is_relro_
10814 and is_relro_local_ fields.
10815 (Output_segment::add_output_section): Group relro sections.
10816 (Output_segment::is_first_section_relro): New function.
10817 (Output_segment::maximum_alignment): If there is a relro section,
10818 align the segment to the common page size.
10819 (Output_segment::set_section_addresses): Track whether we are
10820 looking at relro sections. If the last section is a relro
10821 section, align to the common page size.
10822 (Output_segment::set_section_list_addresses): Add in_relro
10823 parameter. Change all callers. Align to the page size when
10824 moving from relro to non-relro section.
10825 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10826 segment.
10827 * output.h (class Output_section): Add is_relro_ and
10828 is_relro_local_ fields.
10829 (Output_section::is_relro): New function.
10830 (Output_section::set_is_relro): New function.
10831 (Output_section::is_relro_local): New function.
10832 (Output_section::set_is_relro_local): New function.
10833 (class Output_segment): Update declarations.
10834 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10835 * sparc.cc (Target_sparc::got_section): Likewise.
10836 * x86_64.cc (Target_x86_64::got_section): Likewise.
10837 * testsuite/relro_test_main.cc: New file.
10838 * testsuite/relro_test.cc: New file.
10839 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10840 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10841 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10842 (relro_test.so, relro_test_pic.o): New targets.
10843 * testsuite/Makefile.in: Rebuild.
10844
10845 2008-05-16 Ian Lance Taylor <iant@google.com>
10846
10847 * output.cc (Output_segment::add_output_section): Remove front
10848 parameter.
10849 * output.h (class Output_segment): Remove
10850 add_initial_output_section and overloaded add_output_section.
10851 Update declaration of remaining add_output_section.
10852 * layout.cc (Layout::create_interp): Call add_output_section
10853 rather than add_initial_output_section.
10854 (Layout::finish_dynamic_section): Likewise.
10855
10856 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10857 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10858 know the dynamic type.
10859 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10860 field. Initialize it in constructor.
10861 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10862 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10863 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10864 reloc.
10865
10866 * output.cc (Output_reloc::get_address): Change return type to
10867 Elf_Addr.
10868 * output.h (class Output_reloc): Update get_address declaration.
10869 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10870 for section addresses.
10871
10872 2008-05-09 Ian Lance Taylor <iant@google.com>
10873
10874 PR 6493
10875 * gold.cc (gold_nomem): Use return value of write.
10876
10877 2008-05-08 Ian Lance Taylor <iant@google.com>
10878
10879 * symtab.c (Symbol::init_base_output_data): Add version
10880 parameter. Change all callers.
10881 (Symbol::init_base_output_segment): Likewise.
10882 (Symbol::init_base_constant): Likewise.
10883 (Symbol::init_base_undefined): Likewise.
10884 (Sized_symbol::init_output_data): Likewise.
10885 (Sized_symbol::init_output_segment): Likewise.
10886 (Sized_symbol::init_constant): Likewise.
10887 (Sized_symbol::init_undefined): Likewise.
10888 (Symbol_table::do_define_in_output_data): If the new symbol has a
10889 version, mark it as the default.
10890 (Symbol_table::do_define_in_output_segment): Likewise.
10891 (Symbol_table::do_define_as_constant): Likewise.
10892 * symtab.h (class Symbol): Update declarations.
10893 (class Sized_symbol): Likewise.
10894 * resolve.cc (Symbol::override_version): New function.
10895 (Symbol::override_base): Call override_version.
10896 (Symbol::override_base_with_special): Likewise.
10897 * testsuite/ver_script_8.script: New file.
10898 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10899 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10900 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10901 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10902
10903 2008-05-06 Ian Lance Taylor <iant@google.com>
10904
10905 PR 6049
10906 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10907 functions.
10908 (class General_options): Remove existing --undefined, and add
10909 --no-undefined instead. Add new --undefined as synonym for -u.
10910 * archive.cc (Archive::add_symbols): Check whether symbol was
10911 named with -u.
10912 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10913 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10914 all uses. Add IS_UNDEFINED. Update declarations to split
10915 different versions of init_base. Declare init_base_undefined.
10916 (Symbol::is_defined): Handle IS_UNDEFINED.
10917 (Symbol::is_undefined): Likewise.
10918 (Symbol::is_weak_undefined): Call is_undefined.
10919 (Symbol::is_absolute): Handle IS_CONSTANT.
10920 (class Sized_symbol): Update declarations to split different
10921 versions of init. Declare init_undefined.
10922 (class Symbol_table): Declare new functions.
10923 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10924 Change all callers.
10925 (Symbol::init_base_output_data): Likewise.
10926 (Symbol::init_base_output_segment): Likewise.
10927 (Symbol::init_base_constant): Likewise.
10928 (Symbol::init_base_undefined): New function.
10929 (Sized_symbol::init_object): Rename from init. Change all
10930 callers.
10931 (Sized_symbol::init_output_data): Likewise.
10932 (Sized_symbol::init_output_segment): Likewise.
10933 (Sized_symbol::init_constant): Likewise.
10934 (Sized_symbol::init_undefined): New function.
10935 (Symbol_table::add_undefined_symbols_from_command_line): New
10936 function.
10937 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10938 function.
10939 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10940 (Symbol::output_section): Likewise.
10941 (Symbol::set_output_section): Likewise.
10942 (Symbol_table::sized_finalize_symbol): Likewise.
10943 (Symbol_table::sized_write_globals): Likewise.
10944 * resolve.cc (Symbol_table::should_override): Likewise.
10945 (Symbol::override_base_with_special): Likewise.
10946
10947 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10948 symbol, change it to have default visibility.
10949 * testsuite/protected_1.cc: New file.
10950 * testsuite/protected_2.cc: New file.
10951 * testsuite/protected_3.cc: New file.
10952 * testsuite/protected_main_1.cc: New file.
10953 * testsuite/protected_main_2.cc: New file.
10954 * testsuite/protected_main_3.cc: New file.
10955 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10956 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10957 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10958 (protected_1.so): New target.
10959 (protected_1_pic.o, protected_2_pic.o): New targets.
10960 (protected_3_pic.o): New target.
10961 (check_PROGRAMS): Add protected_2.
10962 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10963 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10964 * testsuite/Makefile.in: Rebuild.
10965
10966 * options.h (DEFINE_var): Add set_user_set_##varname__.
10967 (DEFINE_bool_alias): New macro.
10968 (class General_options): Define -Bstatic using DEFINE_bool_alias
10969 rather than DEFINE_special. Add --undefined as an alias for -z
10970 defs.
10971 * options.cc (General_options::parse_Bstatic): Remove.
10972
10973 * options.h (class General_options): Add --fatal-warnings.
10974 * main.cc (main): Implement --fatal-warnings.
10975 * errors.h (Errors::warning_count): New function.
10976
10977 * options.h (class General_options): Add -Bsymbolic-functions.
10978 * symtab.h (Symbol::is_preemptible): Check for
10979 -Bsymbolic-functions.
10980
10981 2008-05-05 Ian Lance Taylor <iant@google.com>
10982
10983 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10984 as noVARNAME rather than no-VARNAME.
10985 (class General_options): Add option -z combreloc.
10986 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10987 get_address.
10988 (Output_reloc::sort_before) [SHT_REL]: New function.
10989 (Output_reloc::sort_before) [SHT_RELA]: New function.
10990 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10991 Sort_relocs_comparison.
10992 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10993 parameter. Change all callers.
10994 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10995 sort_relocs parameter. Change all callers.
10996 * output.cc (Output_reloc::get_address): New function, broken out
10997 of write_rel.
10998 (Output_reloc::write_rel): Call it.
10999 (Output_reloc::compare): New function.
11000 (Output_data_reloc_base::do_write): Optionally sort relocs.
11001
11002 * configure.ac: If targ_extra_obj is set, link it in.
11003 * configure.tgt: Initialize all variables.
11004 (x86_64*): Set targ_extra_obj and targ_extra_size.
11005 * configure: Rebuild.
11006
11007 * object.cc (Sized_relobj::include_section_group): Adjust section
11008 indexes read from group data. Build vector to pass to
11009 layout_group.
11010 * layout.cc (Layout::layout_group): Add flags and shndxes
11011 parameters. Remove contents parameter. Change caller. Update
11012 explicit instantiations.
11013 * layout.h (class Layout): Update layout_group declaration.
11014 * output.cc (Output_data_group::Output_data_group): Add flags and
11015 input_shndxes parameters. Remove contents parameter. Change
11016 caller.
11017 (Output_data_group::do_write): Change input_sections_ to
11018 input_shndxes_.
11019 * output.h (class Output_data_group): Update constructor
11020 declaration. Rename input_sections_ to input_shndxes_.
11021 * testsuite/many_sections_test.cc: Add template.
11022
11023 2008-04-30 Cary Coutant <ccoutant@google.com>
11024
11025 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11026
11027 * layout.cc (Layout::include_section): Refactored check for debug
11028 info section.
11029 (Layout::add_comdat): Add new parameters. Change type
11030 of signature parameter. Add object and shndx to signatures table.
11031 (Layout::find_kept_object): New function.
11032 * layout.h: Include <cstring>.
11033 (Layout::is_debug_info_section): New function.
11034 (Layout::add_comdat): Add new parameters.
11035 (Layout::find_kept_object): New function.
11036 (Layout::Kept_section): New struct.
11037 (Layout::Signatures): Change type of map range.
11038 * object.cc (Relobj::output_section_address): New function.
11039 (Sized_relobj::include_section_group): Add new parameters. Change
11040 calls to Layout::add_comdat. Change to build table of kept comdat
11041 groups and table mapping discarded sections to kept sections.
11042 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11043 (Sized_relobj::do_layout): Change calls to include_section_group and
11044 include_linkonce_section.
11045 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11046 value to zero when section is discarded.
11047 (Sized_relobj::map_to_kept_section): New function.
11048 * object.h (Relobj::output_section_address): New function.
11049 (Relobj::Comdat_group): New type.
11050 (Relobj::find_comdat_group): New function.
11051 (Relobj::Comdat_group_table): New type.
11052 (Relobj::Kept_comdat_section): New type.
11053 (Relobj::Kept_comdat_section_table): New type.
11054 (Relobj::add_comdat_group): New function.
11055 (Relobj::set_kept_comdat_section): New function.
11056 (Relobj::get_kept_comdat_section): New function.
11057 (Relobj::comdat_groups_): New field.
11058 (Relobj::kept_comdat_sections_): New field.
11059 (Symbol_value::input_value): Update comment.
11060 (Sized_relobj::map_to_kept_section) New function.
11061 (Sized_relobj::include_linkonce_section): Add new parameter.
11062 * target-reloc.h (Comdat_behavior): New type.
11063 (get_comdat_behavior): New function.
11064 (relocate_section): Add code to map a discarded section to the
11065 corresponding kept section when applying a relocation.
11066
11067 2008-04-30 Craig Silverstein <csilvers@google.com>
11068
11069 * dwarf_reader.cc (next_generation_count): New static var.
11070 (Addr2line_cache_entry): New struct.
11071 (addr2line_cache): New static var.
11072 (Dwarf_line_info::one_addr2line): Added caching.
11073 (Dwarf_line_info::clear_addr2line_cache): New function.
11074 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11075 cache-size parameter.
11076 (Dwarf_line_info::one_addr2line_cache): New function.
11077 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11078 new cache-size argument to one_addr2line(), and clear cache.
11079
11080 2008-04-28 Cary Coutant <ccoutant@google.com>
11081
11082 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11083 R_386_PC8 relocations.
11084
11085 2008-04-23 Ian Lance Taylor <iant@google.com>
11086
11087 * object.cc (Sized_relobj::include_section_group): Check for
11088 invalid section group.
11089
11090 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11091 header size.
11092
11093 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11094 than read for file header.
11095 * archive.cc (Archive::include_member): Likewise.
11096
11097 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
11098
11099 * aclocal.m4: Regenerate.
11100 * configure: Regenerate.
11101
11102 2008-04-19 Ian Lance Taylor <iant@google.com>
11103
11104 * version.cc (version_string): Bump to 1.6.
11105
11106 * testsuite/Makefile.am (many_sections_r_test): New target.
11107 (many_sections_r_test_SOURCES): Remove.
11108 (many_sections_r_test_DEPENDENCIES): Remove.
11109 (many_sections_r_test_LDFLAGS): Remove.
11110 (many_sections_r_test_LDADD): Remove.
11111
11112 * object.cc (Sized_relobj::do_add_symbols): Always pass
11113 local_symbol_count_ to add_from_relobj.
11114
11115 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11116 every thousand variables.
11117 * testsuite/Makefile.in: Rebuild.
11118
11119 * object.cc (Xindex::initialize_symtab_xindex): New function.
11120 (Xindex::read_symtab_xindex): New function.
11121 (Xindex::sym_xindex_to_shndx): New function.
11122 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11123 available.
11124 (Sized_relobj::do_initialize_xindex): New function.
11125 (Sized_relobj::do_read_symbols): Adjust section links.
11126 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11127 parameter. Change all callers.
11128 (Sized_relobj::include_section_group): Adjust section links and
11129 symbol section indexes.
11130 (Sized_relobj::do_layout): Adjust section links.
11131 (Sized_relobj::do_count_local_symbols): Adjust section links and
11132 symbol section indexes.
11133 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11134 ordinary and special symbols.
11135 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11136 dynsym_xindex parameters. Change all callers. Adjust section
11137 links. Use SHN_XINDEX when needed.
11138 (Sized_relobj::get_symbol_location_info): Adjust section links.
11139 Don't get fooled by special symbols.
11140 * object.h (class Xindex): Define.
11141 (class Object): Add xindex_ parameter. Declare virtual functoin
11142 do_initialize_xindex.
11143 (Object::adjust_sym_shndx): New function.
11144 (Object::set_xindex): New protected function.
11145 (class Symbol_value): Add is_ordinary_shndx_ field.
11146 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11147 (Symbol_value::value): Assert ordinary section.
11148 (Symbol_value::initialize_input_to_output_map): Likewise.
11149 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11150 Change all callers.
11151 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11152 all callers.
11153 (class Sized_relobj): Update declarations.
11154 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11155 parameter. Change all callers.
11156 (Sized_relobj::adjust_shndx): New function.
11157 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11158 field.
11159 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11160 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11161 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11162 (Sized_dynobj::read_dynsym_section): Adjust section links.
11163 (Sized_dynobj::read_dynamic): Likewise.
11164 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11165 section links.
11166 (Sized_dynobj::do_initialize_xindex): New function.
11167 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11168 do_initialize_xindex.
11169 (Sized_dynobj::adjust_shndx): New function.
11170 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11171 dynsym_xindex_ fields.
11172 (Layout::finalize): Add a call to set_section_indexes before
11173 creating the symtab sections.
11174 (Layout::set_section_indexes): Don't do anything if the section
11175 already has a section index.
11176 (Layout::create_symtab_sections): Add shnum parameter. Change
11177 caller. Create .symtab_shndx section if needed.
11178 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11179 caller.
11180 (Layout::allocated_output_section_count): New function.
11181 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11182 needed.
11183 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11184 fields. Update declarations.
11185 (Layout::symtab_xindex): New function.
11186 (Layout::dynsym_xindex): New function.
11187 (class Write_symbols_task): Add layout_ field.
11188 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11189 Change caller.
11190 * output.cc (Output_section_headers::Output_section_headers): Add
11191 shstrtab_section parameter. Change all callers.
11192 (Output_section_headers::do_sized_write): Store overflow values
11193 for section count and section string table section index in
11194 section header zero.
11195 (Output_file_header::do_sized_write): Check for overflow of
11196 section count and section string table section index.
11197 (Output_symtab_xindex::do_write): New function.
11198 (Output_symtab_xindex::endian_do_write): New function.
11199 * output.h (class Output_section_headers): Add shstrtab_section_.
11200 Update declarations.
11201 (class Output_symtab_xindex): Define.
11202 (Output_section::has_out_shndx): New function.
11203 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11204 field.
11205 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11206 Change all callers.
11207 (Sized_symbol::init): Likewise.
11208 (Symbol::output_section): Check for ordinary symbol.
11209 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11210 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11211 callers.
11212 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11213 Change all callers. Simplify handling of symbols from sections
11214 not included in the link.
11215 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11216 distinction.
11217 (Weak_alias_sorter::operator()): Assert that symbols are
11218 ordinary.
11219 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11220 distinction.
11221 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11222 parameters. Change all callers.
11223 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11224 symbol distinction. Use SHN_XINDEX when needed.
11225 (Symbol_table::write_section_symbol): Add symtab_xindex
11226 parameter. Change all callers.
11227 (Symbol_table::sized_write_section_symbol): Likewise. Use
11228 SHN_XINDEX when needed.
11229 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11230 declarations.
11231 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11232 (Symbol::is_defined): Check is_ordinary.
11233 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11234 (Symbol::is_absolute, Symbol::is_common): Likewise.
11235 (class Sized_symbol): Update declarations.
11236 (class Symbol_table): Update declarations.
11237 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11238 parameters. Change all callers.
11239 (Sized_symbol::override): Likewise.
11240 (Symbol_table::override): Likewise.
11241 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11242 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11243 is_ordinary, and orig_st_shndx parameters. Change all callers.
11244 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11245 to be in an ordinary section.
11246 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11247 object and is_ordinary parameters. Change all callers.
11248 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11249 Change all callers. Don't add undefined or non-ordinary symbols
11250 to reloc_map_.
11251 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11252 Change all callers.
11253 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11254 declarations.
11255 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11256 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11257 (Sized_relobj::relocate_sections): Likewise.
11258 * target-reloc.h (scan_relocs): Adjust section symbol index.
11259 (scan_relocatable_relocs): Likewise.
11260 * i386.cc (Scan::local): Check for ordinary symbols.
11261 * sparc.cc (Scan::local): Likewise.
11262 * x86_64.cc (Scan::local): Likewise.
11263 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11264 to symbol_section_and_value.
11265 * testsuite/many_sections_test.cc: New file.
11266 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11267 (check_PROGRAMS): Add many_sections_test.
11268 (many_sections_test_SOURCES): Define.
11269 (many_sections_test_DEPENDENCIES): Define.
11270 (many_sections_test_LDFLAGS): Define.
11271 (BUILT_SOURCES): Add many_sections_define.h.
11272 (many_sections_define.h): New target.
11273 (BUILT_SOURCES): Add many_sections_check.h.
11274 (many_sections_check.h): New target.
11275 (check_PROGRAMS): Add many_sections_r_test.
11276 (many_sections_r_test_SOURCES): Define.
11277 (many_sections_r_test_DEPENDENCIES): Define.
11278 (many_sections_r_test_LDFLAGS): Define.
11279 (many_sections_r_test_LDADD): Define.
11280 (many_sections_r_test.o): New target.
11281 * testsuite/Makefile.in: Rebuild.
11282
11283 2008-04-17 Cary Coutant <ccoutant@google.com>
11284
11285 * errors.cc (Errors::info): New function.
11286 (gold_info): New function.
11287 * errors.h (Errors::info): New function.
11288 * gold.h (gold_info): New function.
11289 * object.cc (Input_objects::add_object): Print trace output.
11290 * options.cc (options::parse_set): New function.
11291 (General_options::parse_wrap): Deleted.
11292 (General_options::General_options): Deleted initializer.
11293 * options.h (options::String_set): New typedef.
11294 (options::parse_set): New function.
11295 (DEFINE_set): New macro.
11296 (General_options::wrap): Changed to use DEFINE_set. Changed
11297 callers of any_wrap_symbols and is_wrap_symbol.
11298 (General_options::trace, General_options::trace_symbol):
11299 New options.
11300 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11301 (General_options::wrap_symbols_): Deleted.
11302 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11303
11304 2008-04-17 David S. Miller <davem@davemloft.net>
11305
11306 * options.cc (General_options::parse_V): New function.
11307 * options.h: Add entries for -V and -Qy.
11308
11309 2008-04-17 Ian Lance Taylor <iant@google.com>
11310
11311 * common.cc (Symbol_table::allocate_commons): Remove options
11312 parameter. Change caller.
11313 (Symbol_table::do_allocate_commons): Remove options parameter.
11314 Change caller. Just call do_allocate_commons_list twice.
11315 (Symbol_table::do_allocate_commons_list): New function, broken out
11316 of do_allocate_commons.
11317 * common.h (class Allocate_commons_task): Remove options_ field.
11318 Update constructor.
11319 * symtab.cc (Symbol_table::Symbol_table): Initialize
11320 tls_commons_.
11321 (Symbol_table::add_from_object): Put TLS common symbols on
11322 tls_commons_ list.
11323 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11324 which are IN_OUTPUT_DATA.
11325 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11326 allocate_commons and do_allocate_commons declarations. Declare
11327 do_allocate_commons_list.
11328 * gold.cc (queue_middle_tasks): Update creation of
11329 Allocate_commons_task to not pass options.
11330 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11331 (TLS_TEST_C_FLAGS): New variable.
11332 (tls_test_c_pic.o): New target.
11333 (tls_test_shared.so): Link in tls_test_c_pic.o.
11334 (tls_test_c_pic_ie.o): New target.
11335 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11336 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11337 (tls_test_c.o): New target.
11338 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11339 (tls_pic_test_LDADD): Likewise.
11340 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11341 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11342 (tls_test_c_gnu2.o): New target.
11343 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11344 tls_test_c_gnu2.o.
11345 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11346 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11347 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11348 * testsuite/tls_test.cc: Include "config.h".
11349 (t_last): Call t11_last.
11350 * testsuite/tls_test.h (t11, t11_last): Declare.
11351 * testsuite/tls_test_c.c: New file.
11352 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11353 * configure.ac: Check for OpenMP support.
11354 * configure, config.in, Makefile.in: Rebuild.
11355 * testsuite/Makefile.in: Rebuild.
11356
11357 2008-04-16 Cary Coutant <ccoutant@google.com>
11358
11359 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11360 (Target_i386::tls_base_symbol_defined_): New field.
11361 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11362 (Target_i386::Scan::global): Likewise.
11363 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11364 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11365 (Target_x86_64::tls_base_symbol_defined_): New field.
11366 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11367 (Target_x86_64::Scan::global): Likewise.
11368
11369 2008-04-16 Cary Coutant <ccoutant@google.com>
11370
11371 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11372 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11373 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11374 building shared libraries.
11375 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11376 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11377 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11378 * testsuite/Makefile.in: Rebuild.
11379 * testsuite/weak_undef.h: New file.
11380 * testsuite/weak_undef_file1.cc: Add extra test cases.
11381 * testsuite/weak_undef_file2.cc: Likewise.
11382 * testsuite/weak_undef_test.cc: Likewise.
11383
11384 2008-04-16 David S. Miller <davem@davemloft.net>
11385
11386 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11387 Add issued_non_pic_error_ field. Declare check_non_pic.
11388 (Target_sparc::Scan::check_non_pic): New function.
11389 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11390 (Target_sparc::Scan::global): Likewise.
11391
11392 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11393 * configure: Rebuild.
11394
11395 * options.h (DEFINE_enable): New macro.
11396 (new_dtags): New enable option.
11397 (initfirst, interpose, loadfltr, nodefaultlib,
11398 nodelete, nodlopen, nodump): New -z options.
11399 * layout.cc (Layout:finish_dynamic_section): If new
11400 dtags enabled, emit DT_RUNPATH. Also, emit a
11401 DT_FLAGS_1 containing any specified -z flags.
11402
11403 2008-04-16 Ian Lance Taylor <iant@google.com>
11404
11405 * copy-relocs.cc: New file.
11406 * copy-relocs.h: New file.
11407 * reloc.cc: Remove Copy_relocs code.
11408 * reloc.h: Likewise.
11409 * reloc-types.h (struct Reloc_types) [both versions]: Add
11410 get_reloc_addend_noerror.
11411 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11412 variants of add_global which take an addend which must be zero.
11413 * i386.cc: Include "copy-relocs.h".
11414 (class Target_i386): Change type of copy_relocs_ to variable,
11415 update initializer.
11416 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11417 Change all callers.
11418 (Target_i386::do_finalize_sections): Change handling of
11419 copy_relocs_.
11420 * sparc.cc: Include "copy-relocs.h".
11421 (class Target_sparc): Change type of copy_relocs_ to variable,
11422 update initializer.
11423 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11424 Change all callers.
11425 (Target_sparc::do_finalize_sections): Change handling of
11426 copy_relocs_.
11427 * x86_64.cc: Include "copy-relocs.h".
11428 (class Target_x86_64): Change type of copy_relocs_ to variable,
11429 update initializer.
11430 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11431 class. Change all callers.
11432 (Target_x86_64::do_finalize_sections): Change handling of
11433 copy_relocs_.
11434 * Makefile.am (CCFILES): Add copy-relocs.cc.
11435 (HFILES): Add copy-relocs.h.
11436
11437 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11438
11439 * testsuite/script_test_4.sh: Permit leading zeroes.
11440
11441 2008-04-15 Ian Lance Taylor <iant@google.com>
11442
11443 * script-sections.cc (Script_sections::create_segments): Use
11444 header_size_adjustment even when there is enough room for the
11445 headers.
11446 * testsuite/script_test_4.sh: New file.
11447 * testsuite/script_test_4.t: New file.
11448 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11449 (check_DATA): Add script_test_4.stdout.
11450 (MOSTLYCLEANFILES): Likewise.
11451 (script_test_4): New target.
11452 (script_test_4.stdout): New target.
11453 * testsuite/Makefile.in: Rebuild.
11454
11455 * sparc.cc: Add definitions for Output_data_plt_sparc class
11456 constants.
11457
11458 2008-04-14 David S. Miller <davem@davemloft.net>
11459
11460 * sparc.cc: New file.
11461 * Makefile.am (TARGETSOURCES): Add sparc.cc
11462 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11463 * configure.tgt: Document targ_extra_size and
11464 targ_extra_big_endian. Add entries for sparc-* and
11465 sparc64-*.
11466 * configure.ac: Handle targ_extra_size and
11467 targ_extra_big_endian.
11468 * Makefile.in: Rebuild.
11469 * configure: Likewise.
11470 * po/POTFILES.in: Likewise.
11471 * po/gold.pot: Likewise.
11472
11473 2008-04-14 Ian Lance Taylor <iant@google.com>
11474
11475 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11476 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11477 in the name/type/flags to section mapping. Don't call
11478 allocate_output_section.
11479 (Layout::choose_output_section): Change parameter from adjust_name
11480 to is_input_section. Don't permit input sections after sections
11481 are attached to segments. Don't call allocate_output_section.
11482 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11483 not write_enable_output_section.
11484 (Layout::make_output_section): Don't push to
11485 unattached_section_list_ nor call attach_to_segment. Call
11486 attach_section_to_segment if sections are attached.
11487 (Layout::attach_sections_to_segments): New function.
11488 (Layout::attach_section_to_segment): New function.
11489 (Layout::attach_allocated_section_to_segment): Rename from
11490 attach_to_segment. Remove flags parameter.
11491 (Layout::allocate_output_section): Remove function.
11492 (Layout::write_enable_output_section): Remove function.
11493 * layout.h (class Layout): Update for above changes. Add new
11494 field sections_are_attached_.
11495 * output.h (Output_section::update_flags_for_input_section): New
11496 function.
11497 * output.cc (Output_section::add_input_section): Call
11498 update_flags_for_input_section.
11499 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11500
11501 2008-04-11 Cary Coutant <ccoutant@google.com>
11502
11503 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11504 thought unnecessary.
11505 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11506
11507 2008-04-11 Ian Lance Taylor <iant@google.com>
11508
11509 * output.h (class Output_section_data): Remove inline definition
11510 of set_addralign.
11511 * output.cc (Output_section_data::set_addralign): New function.
11512
11513 2008-04-11 Cary Coutant <ccoutant@google.com>
11514
11515 Add support for TLS descriptors for i386 and x86_64.
11516 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11517 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11518 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11519 GOT_TYPE_TLS_DESC.
11520 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11521 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11522 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11523 relocations.
11524 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11525 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11526 Fix problem with initial-exec relocations.
11527 (Target_i386::Relocate::relocate_tls): Likewise.
11528 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11529 relaxation.
11530 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11531 support for section-plus-offset dynamic table entries.
11532 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11533 (Output_data_dynamic::Dynamic_entry): Add support for
11534 section-plus-offset dynamic table entries.
11535 (Output_data_dynamic::Classification): Likewise.
11536 (Output_data_dynamic::classification_): Renamed offset_.
11537 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11538 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11539 (Target_x86_64::make_plt_section): New function.
11540 (Target_x86_64::reserve_tlsdesc_entries): New function.
11541 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11542 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11543 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11544 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11545 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11546 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11547 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11548 add extra PLT entry for TLS descriptors.
11549 (Output_data_plt_x86_64::got_): New field.
11550 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11551 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11552 fields.
11553 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11554 descriptors.
11555 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11556 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11557 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11558 R_386_TLS_DESC_CALL relocations.
11559 (Target_x86_64::Scan::global): Likewise.
11560 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11561 for TLS descriptors.
11562 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11563 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11564 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11565 GD-to-IE relaxation.
11566 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11567 and TLS_DESCRIPTORS.
11568 * Makefile.in: Rebuild.
11569 * configure: Rebuild.
11570 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11571 (tls_test_shared2.so): New target.
11572 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11573 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11574 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11575 (tls_shared_gd_to_ie_test_LDADD): New variable.
11576 (tls_shared_gnu2_gd_to_ie_test): New target.
11577 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11578 New targets.
11579 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11580 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11581 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11582 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11583 (tls_shared_gnu2_test): New target.
11584 (tls_test_gnu2_shared.so): New target.
11585 (tls_shared_gnu2_test_SOURCES): New variable.
11586 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11587 (tls_shared_gnu2_test_LDFLAGS): New variable.
11588 (tls_shared_gnu2_test_LDADD): New variable.
11589 * testsuite/Makefile.in: Rebuild.
11590 * testsuite/Makefile.
11591
11592 2008-04-11 Ian Lance Taylor <iant@google.com>
11593
11594 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11595 justsyms.t.
11596 * testsuite/Makefile.in: Rebuild.
11597
11598 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11599 long.
11600 * testsuite/script_test_2.cc (main): Adjust test.
11601
11602 2008-04-11 David S. Miller <davem@davemloft.net>
11603 Ian Lance Taylor <iant@google.com>
11604
11605 * options.h (General_options): Add entries for '-Y' and
11606 '-relax'.
11607 * options.cc (General_options:finalize): If -Y was used, add those
11608 entries to the library path instead of the default "/lib" and
11609 "/usr/lib".
11610
11611 2008-04-11 David S. Miller <davem@davemloft.net>
11612
11613 * testsuite/justsyms.t: Start at 0x100.
11614 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
11615 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11616 long.
11617 * testsuite/script_test_2.cc: Adjust string and section length
11618 checks.
11619
11620 2008-04-09 Ian Lance Taylor <iant@google.com>
11621
11622 PR gold/5996
11623 * script-sections.cc (Sections_element::allocate_to_segment): Add
11624 orphan parameter.
11625 (Output_section_definition::allocate_to_segment): Likewise.
11626 (Orphan_output_section::allocate_to_segment): Likewise.
11627 (Script_sections::attach_sections_using_phdrs_clause): Don't
11628 propagate non-PT_LOAD segments to orphan sections.
11629 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11630 readelf rather than objdump.
11631 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11632 .interp section and PT_INTERP segment are the same size.
11633 * testsuite/Makefile.in: Rebuild.
11634
11635 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11636 aliases for symbols defined in the same object.
11637 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11638 (weak_alias_test_SOURCES): New variable.
11639 (weak_alias_test_DEPENDENCIES): New variable.
11640 (weak_alias_test_LDFLAGS): New variable.
11641 (weak_alias_test_LDADD): New variable.
11642 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11643 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11644 (weak_alias_test_3.o): New target.
11645 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11646 * testsuite/weak_alias_test_main.cc: New file.
11647 * testsuite/weak_alias_test_1.cc: New file.
11648 * testsuite/weak_alias_test_2.cc: New file.
11649 * testsuite/weak_alias_test_3.cc: New file.
11650
11651 2008-04-08 Ian Lance Taylor <iant@google.com>
11652
11653 * options.h (class General_options): Add --noinhibit-exec option.
11654 * main.cc (main): Check --noinhibit-exec.
11655
11656 * options.h (class General_options): Define --wrap as a special
11657 option. Add wrap_symbols_ field.
11658 (General_options::any_wrap_symbols): New function.
11659 (General_options::is_wrap_symbol): New function.
11660 * options.cc (General_options::parse_wrap): New function.
11661 (General_options::General_options): Initialize wrap_symbols_.
11662 * symtab.cc (Symbol_table::wrap_symbol): New function.
11663 (Symbol_table::add_from_object): Handle --wrap.
11664 * symtab.h (class Symbol_table): Declare wrap_symbol.
11665 * target.h (Target::wrap_char): New function.
11666 (Target::Target_info): Add wrap_char field.
11667 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11668 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11669 * testsuite/testfile.cc (Target_test::test_target_info):
11670 Likewise.
11671
11672 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11673 there is one.
11674
11675 * layout.h (class Layout): Add added_eh_frame_data_ field.
11676 * layout.cc (Layout::Layout): Initialize new field.
11677 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11678 output section until we find a section we merged successfully.
11679 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11680 that the size be non-zero.
11681
11682 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11683 qualifier.
11684
11685 2008-04-08 Craig Silverstein <csilvers@google.com>
11686
11687 * configure.ac: Export new conditional variable HAVE_ZLIB.
11688 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11689 on HAVE_ZLIB.
11690 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11691 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11692
11693 2008-04-07 Ian Lance Taylor <iant@google.com>
11694
11695 * version.cc (version_string): Set to "1.5".
11696
11697 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11698 Add issued_non_pic_error_ field. Declare check_non_pic.
11699 (Target_x86_64::Scan::check_non_pic): New function.
11700 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11701 (Target_x86_64::Scan::global): Likewise.
11702
11703 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11704 addend parameter. Change caller. Handle merge sections.
11705 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11706 Address to Addend. Don't add in the result of
11707 local_section_offset, pass down the addend and use the returned
11708 value.
11709 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11710 Update declarations of local_section_offset and symbol_value.
11711 * testsuite/two_file_test_1.cc (t18): New function.
11712 * testsuite/two_file_test_2.cc (f18): New function.
11713 * testsuite/two_file_test_main.cc (main): Call t18.
11714 * testsuite/two_file_test.h (t18, f18): Declare.
11715
11716 * configure.ac: Don't test for objdump, c++filt, or readelf.
11717 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11718 conditionals.
11719 (TEST_READELF): New variable.
11720 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11721 (check_PROGRAMS): Add two_file_strip_test.
11722 (two_file_strip_test): New target.
11723 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11724 (two_file_same_shared_strip_test_SOURCES): New variable.
11725 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11726 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11727 (two_file_same_shared_strip_test_LDADD): New variable.
11728 (two_file_shared_strip.so): New target.
11729 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11730 (ver_test_5.syms, ver_test_7.syms): Likewise.
11731 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11732 (strip_test_3.stdout): Use TEST_OBJDUMP.
11733 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11734
11735 2008-04-04 Cary Coutant <ccoutant@google.com>
11736
11737 * symtab.h (Symbol::is_weak_undefined): New function.
11738 (Symbol::is_strong_undefined): New function.
11739 (Symbol::is_absolute): New function.
11740 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11741 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11742 absolute symbols.
11743 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11744 (weak_undef_test): New target.
11745 * testsuite/Makefile.in: Rebuild.
11746 * testsuite/weak_undef_file1.cc: New file.
11747 * testsuite/weak_undef_file2.cc: New file.
11748 * testsuite/weak_undef_test.cc: New file.
11749
11750 2008-04-03 Craig Silverstein <csilvers@google.com>
11751
11752 * compressed_output.h (class Output_compressed_section): Use
11753 unsigned buffer.
11754 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11755 add zlib header.
11756 (zlib_compressed_suffix): Removed.
11757 (Output_compressed_section::set_final_data_size): Use unsigned
11758 buffers.
11759 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11760 Fix linker invocation.
11761 (flagstest_o_specialfile_and_compress_debug_sections):
11762 Likewise.
11763 * testsuite/Makefile.in: Regenerated.
11764
11765 2008-04-02 David S. Miller <davem@davemloft.net>
11766
11767 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11768 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11769
11770 2008-04-02 Craig Silverstein <csilvers@google.com>
11771
11772 * TODO: New file.
11773
11774 2008-04-02 Ian Lance Taylor <iant@google.com>
11775
11776 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11777 parameters. Update for new key type to views_. Change all
11778 callers.
11779 (File_read::read): Adjust for byteshift in returned view.
11780 (File_read::add_view): New function, broken out of
11781 find_and_make_view.
11782 (File_read::make_view): New function, broken out of
11783 find_and_make_view.
11784 (File_read::find_or_make_view): Add offset and aligned
11785 parameters. Rewrite accordingly. Change all callers.
11786 (File_read::get_view): Add offset and aligned parameters. Adjust
11787 for byteshift in return value.
11788 (File_read::get_lasting_view): Likewise.
11789 * fileread.h (class File_read): Update declarations.
11790 (class File_read::View): Add byteshift_ field. Add byteshift to
11791 constructor. Add byteshift method.
11792 * archive.h (Archive::clear_uncached_views): New function.
11793 (Archive::get_view): Add aligned parameter. Change all callers.
11794 * object.h (Object::get_view): Add aligned parameter. Change all
11795 callers.
11796 (Object::get_lasting_view): Likewise.
11797
11798 * fileread.cc (File_read::release): Don't call clear_views if
11799 there are multiple objects.
11800 * fileread.h (File_read::clear_uncached_views): New function.
11801 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11802 on the archive.
11803
11804 2008-03-31 Cary Coutant <ccoutant@google.com>
11805
11806 Add thin archive support.
11807 * archive.cc (Archive::armagt): New const.
11808 (Archive::setup): Remove task parameter and calls to unlock.
11809 (Archive::unlock_nested_archives): New function.
11810 (Archive::read_header): Add nested_off parameter. Change
11811 all callers.
11812 (Archive::interpret_header): Likewise.
11813 (Archive::include_all_members): Change to handle thin
11814 archives.
11815 (Archive::include_member): Likewise.
11816 * archive.h (Archive::Archive): Add new parameters and
11817 initializers.
11818 (Archive::armagt): New const.
11819 (Archive::setup): Remove task parameter.
11820 (Archive::unlock_nested_archives): New function.
11821 (Archive::read_header): Add nested_off parameter.
11822 (Archive::interpret_header): Likewise.
11823 (Archive::Nested_archive_table): New typedef.
11824 (Archive::is_thin_archive_): New field.
11825 (Archive::nested_archives_): New field.
11826 (Archive::options_): New field.
11827 (Archive::dirpath_): New field.
11828 (Archive::task_): New field.
11829 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11830 for thin archives. Pass additional parameters to
11831 Archive::Archive. Unlock the archive file after calling
11832 Archive::setup.
11833
11834 2008-03-29 Ian Lance Taylor <iant@google.com>
11835
11836 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11837 version symbol to be local.
11838 * testsuite/ver_test_4.sh: New file.
11839 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11840 (check_DATA): Add ver_test_4.syms.
11841 (ver_test_4.syms): New target.
11842 * testsuite/Makefile.in: Rebuild.
11843
11844 * output.cc
11845 (Output_section::Input_section_sort_entry::has_priority): New
11846 function.
11847 (Output_section::Input_section_sort_entry::match_file_name): New
11848 function.
11849 (Output_section::Input_section_sort_entry::match_section_name):
11850 Remove.
11851 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11852 Remove.
11853 (Output_section::Input_section_sort_entry::match_section_file):
11854 Remove.
11855 (Output_section::Input_section_sort_compare::operator()): Rewrite
11856 using new Input_section_sort_entry functions. Sort crtbegin and
11857 crtend first. Sort sections with no priority before sections with
11858 a priority.
11859 * testsuite/initpri1.c (d3): Check j != 4.
11860 (cd5): New constructor/destructor function.
11861 (main): Check j != 2.
11862
11863 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11864 new symbol when resolving, don't call set_is_default.
11865 * testsuite/ver_test_7.cc: New file.
11866 * testsuite/ver_test_7.sh: New file.
11867 * testsuite/Makefile.am (ver_test_7.so): New target.
11868 (ver_test_7.o): New target.
11869 (check_SCRIPTS): Add ver_test_7.sh.
11870 (check_DATA): Add ver_test_7.syms.
11871 (ver_test_7.syms): New target.
11872
11873 2008-03-28 Ian Lance Taylor <iant@google.com>
11874
11875 * layout.cc (Layout::layout): If we see an input section with a
11876 name that needs sorting, set the must_sort flag for the output
11877 section.
11878 (Layout::make_output_section): If the name of the output section
11879 indicates that it might require sorting, set the may_sort flag.
11880 * output.h (Output_section::may_sort_attached_input_sections): New
11881 function.
11882 (Output_section::set_may_sort_attached_input_sections): New
11883 function.
11884 (Output_section::must_sort_attached_input_sections): New
11885 function.
11886 (Output_section::set_must_sort_attached_input_sections): New
11887 function.
11888 (class Output_section): Declare Input_section_sort_entry. Define
11889 Input_section_sort_compare. Declare
11890 sort_attached_input_sections. Add new fields:
11891 may_sort_attached_input_sections_,
11892 must_sort_attached_input_sections_,
11893 attached_input_sections_are_sorted_.
11894 * output.cc (Output_section::Output_section): Initialize new
11895 fields.
11896 (Output_section::add_input_section): Add an entry to
11897 input_sections_ if may_sort or must_sort are true.
11898 (Output_section::set_final_data_size): Call
11899 sort_attached_input_sections if necessary.
11900 (Output_section::Input_section_sort_entry): Define new class.
11901 (Output_section::Input_section_sort_compare::operator()): New
11902 function.
11903 (Output_section::sort_attached_input_sections): New function.
11904 * configure.ac: Check whether the compiler supports constructor
11905 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11906 * testsuite/initpri1.c: New file.
11907 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11908 CONSTRUCTOR_PRIORITY.
11909 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11910 (initpri1_LDFLAGS): New variable.
11911 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11912
11913 2008-03-27 Ian Lance Taylor <iant@google.com>
11914
11915 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11916 * testsuite/common_test_1.c: New file.
11917 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11918 (common_test_1_SOURCES): New variable.
11919 (common_test_1_DEPENDENCIES): New variable.
11920 (common_test_1_LDFLAGS): New variable.
11921
11922 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11923 and commons_ correctly when NAME/VERSION does not override
11924 NAME/NULL.
11925 * testsuite/ver_test_6.c: New file.
11926 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11927 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11928 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11929
11930 2008-03-26 Ian Lance Taylor <iant@google.com>
11931
11932 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11933 of an undefined symbol from a version script.
11934 * testsuite/Makefile.am (ver_test_5.so): New target.
11935 (ver_test_5.o): New target.
11936 (check_SCRIPTS): Add ver_test_5.sh.
11937 (check_DATA): Add ver_test_5.syms.
11938 (ver_test_5.syms): New target.
11939 * testsuite/ver_test_5.cc: New file.
11940 * testsuite/ver_test_5.script: New file.
11941 * testsuite/ver_test_5.sh: New file.
11942 * Makefile.in, testsuite/Makefile.in: Rebuild.
11943
11944 PR gold/5986
11945 Fix problems building gold with gcc 4.3.0.
11946 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11947 (gold_error_at_location, gold_warning_at_location): Use it.
11948 * configure.ac: Check whether we can compile and use a template
11949 function with a printf attribute.
11950 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11951 when jumping over bytes.
11952 * object.cc: Instantiate Object::read_section_data.
11953 * debug.h: Include <cstring>
11954 * dwarf_reader.cc: Include <algorithm>
11955 * main.cc: Include <cstring>.
11956 * options.cc: Include <cstring>.
11957 * output.cc: Include <cstring>.
11958 * script.cc: Include <cstring>.
11959 * script.h: Include <string>.
11960 * symtab.cc: Include <cstring> and <algorithm>.
11961 * target-select.cc: Include <cstring>.
11962 * version.cc: Include <string>.
11963 * testsuite/testmain.cc: Include <cstdlib>.
11964 * configure, config.in: Rebuild.
11965
11966 2008-03-25 Ian Lance Taylor <iant@google.com>
11967
11968 * options.cc: Include "../bfd/bfdver.h".
11969 (options::help): Print bug reporting address.
11970
11971 * version.cc (print_version): Adjust output for current value of
11972 BFD_VERSION_STRING.
11973
11974 * NEWS: New file.
11975
11976 * options.cc (options::help): Print list of supported targets.
11977 * target-select.h: Include <vector>.
11978 (class Target_selector): Make machine_, size_, and is_big_endian_
11979 fields const. Add bfd_name_ and instantiated_target_ fields.
11980 (Target_selector::Target_selector): Add bfd_name parameter.
11981 (Target_selector::recognize): Make non-virtual, call
11982 do_recognize.
11983 (Target_selector::recognize_by_name): Make non-virtual, call
11984 do_recognize_by_name.
11985 (Target_selector::supported_names): New function.
11986 (Target_selector::bfd_name): New function.
11987 (Target_selector::do_instantiate_target): New pure virtual
11988 function.
11989 (Target_selector::do_recognize): New virtual function.
11990 (Target_selector::do_recognize_by_name): New virtual function.
11991 (Target_selector::instantiate_target): New private function.
11992 (supported_target_names): Declare.
11993 * target-select.cc (Target_selector::Target_selector): Update for
11994 new parameter and fields.
11995 (select_target_by_name): Check that the name matches before
11996 calling recognize_by_name.
11997 (supported_target_names): New function.
11998 * i386.cc (class Target_selector_i386): Update Target_selector
11999 constructor call. Remove recognize and recognize_by_name. Add
12000 do_instantiate_target.
12001 * x86_64.cc (class Target_selector_x86_64): Likewise.
12002 * testsuite/testfile.cc (class Target_selector_test): Update for
12003 changes to Target_selector.
12004
12005 * README: Rewrite, with some notes on unsupported features.
12006
12007 2008-03-24 Cary Coutant <ccoutant@google.com>
12008
12009 * i386.cc (Target_i386::Got_type): New enum declaration.
12010 (Target_i386::Scan::local): Updated callers of Output_data_got
12011 member functions.
12012 (Target_i386::Scan::global): Likewise.
12013 (Target_i386::Relocate::relocate): Likewise.
12014 (Target_i386::Relocate::relocate_tls): Likewise.
12015 * object.h (Got_offset_list): New class.
12016 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12017 (Sized_relobj::local_got_offset): Likewise.
12018 (Sized_relobj::set_local_got_offset): Likewise.
12019 (Sized_relobj::local_has_tls_got_offset): Removed.
12020 (Sized_relobj::local_tls_got_offset): Removed.
12021 (Sized_relobj::set_local_tls_got_offset): Removed.
12022 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12023 * output.cc (Output_data_got::add_global): Added got_type parameter.
12024 (Output_data_got::add_global_with_rel): Likewise.
12025 (Output_data_got::add_global_with_rela): Likewise.
12026 (Output_data_got::add_global_pair_with_rel): New function.
12027 (Output_data_got::add_global_pair_with_rela): New function.
12028 (Output_data_got::add_local): Added got_type parameter.
12029 (Output_data_got::add_local_with_rel): Likewise.
12030 (Output_data_got::add_local_with_rela): Likewise.
12031 (Output_data_got::add_local_pair_with_rel): New function.
12032 (Output_data_got::add_local_pair_with_rela): New function.
12033 (Output_data_got::add_global_tls): Removed.
12034 (Output_data_got::add_global_tls_with_rel): Removed.
12035 (Output_data_got::add_global_tls_with_rela): Removed.
12036 (Output_data_got::add_local_tls): Removed.
12037 (Output_data_got::add_local_tls_with_rel): Removed.
12038 (Output_data_got::add_local_tls_with_rela): Removed.
12039 * output.h (Output_data_got::add_global): Added got_type parameter.
12040 (Output_data_got::add_global_with_rel): Likewise.
12041 (Output_data_got::add_global_with_rela): Likewise.
12042 (Output_data_got::add_global_pair_with_rel): New function.
12043 (Output_data_got::add_global_pair_with_rela): New function.
12044 (Output_data_got::add_local): Added got_type parameter.
12045 (Output_data_got::add_local_with_rel): Likewise.
12046 (Output_data_got::add_local_with_rela): Likewise.
12047 (Output_data_got::add_local_pair_with_rel): New function.
12048 (Output_data_got::add_local_pair_with_rela): New function.
12049 (Output_data_got::add_global_tls): Removed.
12050 (Output_data_got::add_global_tls_with_rel): Removed.
12051 (Output_data_got::add_global_tls_with_rela): Removed.
12052 (Output_data_got::add_local_tls): Removed.
12053 (Output_data_got::add_local_tls_with_rel): Removed.
12054 (Output_data_got::add_local_tls_with_rela): Removed.
12055 * resolve.cc (Symbol::override_base_with_special): Removed
12056 reference to has_got_offset_ field.
12057 * symtab.cc (Symbol::init_fields): Replaced initialization
12058 of got_offset_ with got_offsets_. Removed initialization
12059 of has_got_offset_
12060 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
12061 (Symbol::got_offset): Likewise.
12062 (Symbol::set_got_offset): Likewise.
12063 (Symbol::has_tls_got_offset): Removed.
12064 (Symbol::tls_got_offset): Removed.
12065 (Symbol::set_tls_got_offset): Removed.
12066 (Symbol::got_offset_): Removed.
12067 (Symbol::tls_mod_got_offset_): Removed.
12068 (Symbol::tls_pair_got_offset_): Removed.
12069 (Symbol::got_offsets_): New field.
12070 (Symbol::has_got_offset): Removed.
12071 (Symbol::has_tls_mod_got_offset): Removed.
12072 (Symbol::has_tls_pair_got_offset): Removed.
12073 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12074 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12075 member functions.
12076 (Target_x86_64::Scan::global): Likewise.
12077 (Target_x86_64::Relocate::relocate): Likewise.
12078 (Target_x86_64::Relocate::relocate_tls): Likewise.
12079
12080 2008-03-25 Ben Elliston <bje@au.ibm.com>
12081
12082 * yyscript.y: Fix spelling error in comment.
12083
12084 2008-03-24 Ian Lance Taylor <iant@google.com>
12085
12086 * options.h (class General_options): Define build_id option.
12087 * layout.h (class Layout): Declare write_build_id, create_note,
12088 create_build_id. Add build_id_note_ member.
12089 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12090 "libiberty.h", "md5.h", "sha1.h".
12091 (Layout::Layout): Initialize eh_frame_data_,
12092 eh_frame_hdr_section_, and build_id_note_.
12093 (Layout::finalize): Call create_build_id.
12094 (Layout::create_note): New function, broken out of
12095 Layout::create_gold_note.
12096 (Layout::create_gold_note): Call create_note.
12097 (Layout::create_build_id): New function.
12098 (Layout::write_build_id): New function.
12099 (Close_task_runner::run): Call write_build_id.
12100
12101 * x86_64.cc: Correct license to GPLv3.
12102
12103 2008-03-23 Ian Lance Taylor <iant@google.com>
12104
12105 * options.cc: Include "demangle.h".
12106 (parse_optional_string): New function.
12107 (parse_long_option): Handle takes_optional_argument.
12108 (parse_short_option): Update dash_z initializer. Handle
12109 takes_optional_argument.
12110 (General_options::General_options): Initialize do_demangle_.
12111 (General_options::finalize): Set do_demangle_. Handle demangling
12112 style.
12113 * options.h (parse_optional_string): Declare.
12114 (struct One_option): Add optional_arg field. Update constructor.
12115 Update call constructor calls. Add takes_optional_argument
12116 function.
12117 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12118 (DEFINE_optional_string): Define.
12119 (General_options::demangle): Change from DEFINE_bool to
12120 DEFINE_optional_string.
12121 (General_options::no_demangle): New function.
12122 (General_options::do_demangle): New function.
12123 (General_options::set_do_demangle): New function.
12124 (General_options::execstack_status_): Move definition to end of
12125 class definition.
12126 (General_options::static_): Likewise.
12127 (General_options::do_demangle_): New field.
12128 * object.cc (big_endian>::get_symbol_location_info): Call
12129 Options::do_demangle, not Options::demangle.
12130 * symtab.cc (demangle): Likewise.
12131
12132 2008-03-22 Ian Lance Taylor <iant@google.com>
12133
12134 * gold.h: Include <cstddef> and <sys/types.h>
12135 * options.h: Include <cstring>.
12136
12137 2008-03-21 Ian Lance Taylor <iant@google.com>
12138
12139 * Added source code to GNU binutils.
This page took 0.270043 seconds and 5 git commands to generate.