2011-09-13 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
1b045aac
ILT
12011-09-12 Ian Lance Taylor <iant@google.com>
2
3 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4 triggered if object has no symbols.
5
24c6c55a
DM
62011-09-09 David S. Miller <davem@davemloft.net>
7
8 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
9 (Output_fill_debug_line::do_write): Likewise.
10
66570254
CC
112011-08-29 Cary Coutant <ccoutant@google.com>
12
13 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
14 casts to match formatting specs.
15 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
16
8ea8cd50
CC
172011-08-26 Cary Coutant <ccoutant@google.com>
18
19 * layout.cc (Free_list::allocate): Provide guarantee of minimum
20 remaining hole size when allocating.
21 (Layout::make_output_section): Set fill methods for debug sections.
22 * layout.h (Free_list::Free_list_node): Move from private to
23 public.
24 (Free_list::set_min_hole_size): New function.
25 (Free_list::begin, Free_list::end): New functions.
26 (Free_list::min_hole_): New data member.
27 * output.cc: Include dwarf.h.
28 (Output_fill_debug_info::do_minimum_hole_size): New function.
29 (Output_fill_debug_info::do_write): New function.
30 (Output_fill_debug_line::do_minimum_hole_size): New function.
31 (Output_fill_debug_line::do_write): New function.
32 (Output_section::Output_section): Initialize new data member.
33 (Output_section::set_final_data_size): Ensure patch space is larger
34 than minimum hole size.
35 (Output_section::do_write): Fill holes in debug sections.
36 * output.h (Output_fill): New class.
37 (Output_fill_debug_info): New class.
38 (Output_fill_debug_line): New class.
39 (Output_section::set_free_space_fill): New function.
40 (Output_section::free_space_fill_): New data member.
41 * testsuite/Makefile.am (incremental_test_3): Add
42 --incremental-patch option.
43 (incremental_test_4): Likewise.
44 (incremental_test_5): Likewise.
45 (incremental_test_6): Likewise.
46 (incremental_copy_test): Likewise.
47 (incremental_common_test_1): Likewise.
48 * testsuite/Makefile.in: Regenerate.
49
7cf80422
NC
502011-08-26 Nick Clifton <nickc@redhat.com>
51
52 * po/es.po: Updated Spanish translation.
53
c3f7b0e5
CC
542011-08-01 Cary Coutant <ccoutant@google.com>
55
56 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
57 * gold/testsuite/Makefile.in: Regenerate.
58 * gold/testsuite/justsyms_exec.c: New source file.
59 * gold/testsuite/justsyms_lib.c: New source file.
60
9590bf25
CC
612011-08-01 Cary Coutant <ccoutant@google.com>
62
63 * layout.cc (Layout::set_segment_offsets): Don't realign text
64 segment if -Ttext was specified.
65 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
66 file type.
67 * object.h (Sized_relobj_file::e_type): New function.
68 (Sized_relobj_file::e_type_): New data member.
69 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
70 base address for ET_EXEC files.
71 * target.cc (Target::do_make_elf_object_implementation): Allow
72 ET_EXEC files with --just-symbols option.
73
dcd8d12e
CC
742011-07-28 Cary Coutant <ccoutant@google.com>
75
76 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
77 Add thread_number parameter.
78 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
79 * workqueue-threads.cc
80 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
81 current thread if its thread number is greater than desired thread
82 count.
83 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
84 Add thread_number parameter.
85 (Workqueue::should_cancel_thread): Likewise.
86 (Workqueue::find_runnable_or_wait): Pass thread_number to
87 should_cancel_thread.
88 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
89 parameter.
90
804eb480
ST
912011-07-22 Sriraman Tallam <tmsriram@google.com>
92
93 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
94 only after checking if it cannot be forced local.
95 * symtab.h (is_externally_visible): Check if the symbol is not forced
96 local.
97
f1ddb600
ILT
982011-07-15 Ian Lance Taylor <iant@google.com>
99
100 * options.h (class General_options): Add --print-output-format.
101 Move -EL next to -EB, for better --help output.
102 * target-select.cc: Include <cstdio>, "options.h", and
103 "parameters.h".
104 (Target_selector::do_target_bfd_name): New function.
105 (print_output_format): New function.
106 * target-select.h (class Target_selector): Update declarations.
107 (Target_selector::target_bfd_name): New function.
108 (print_output_format): Declare.
109 * main.cc: Include "target-select.h".
110 (main): Handle --print-output-format.
111 * gold.cc: Include "target-select.h".
112 (queue_initial_tasks): Handle --print-output-format when there are
113 no input files.
114 * parameters.cc (parameters_force_valid_target): Give a better
115 error message if -EB/-EL does not match target.
116 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
117 function.
118
7d172687
ILT
1192011-07-15 Ian Lance Taylor <iant@google.com>
120
121 * i386.cc (class Output_data_plt_i386): Add layout_ field.
122 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
123 (Output_data_plt_i386::do_write): Write address of .dynamic
124 section to first entry in .got.plt section.
125 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
126 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
127 Initialize layout_.
128 (Output_data_plt_x86_64::do_write): Write address of .dynamic
129 section to first entry in .got.plt section.
130 * layout.h (Layout::dynamic_section): New function.
131
e9552f7e
ST
1322011-07-13 Sriraman Tallam <tmsriram@google.com>
133
134 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
135 to claim_file call.
136 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
137 input_section_position_, and input_section_glob_.
138 (read_layout_from_file): Call function section_ordering_specified.
139 * layout.h (is_section_ordering_specified): New function.
140 (section_ordering_specified): New function.
141 (section_ordering_specified_): New boolean member.
142 * main.cc(main): Call load_plugins after layout object is defined.
143 * output.cc (Output_section::add_input_section): Use
144 function section_ordering_specified to check if section ordering is
145 needed.
146 * output.cc (Output_section::add_relaxed_input_section): Use
147 function section_ordering_specified to check if section ordering is
148 needed.
149 (Output_section::update_section_layout): New function.
150 (Output_section::sort_attached_input_sections): Check if input section
151 must be reordered.
152 * output.h (Output_section::update_section_layout): New function.
153 * plugin.cc (get_section_count): New function.
154 (get_section_type): New function.
155 (get_section_name): New function.
156 (get_section_contents): New function.
157 (update_section_order): New function.
158 (allow_section_ordering): New function.
159 (Plugin::load): Add the new interfaces to the transfer vector.
160 (Plugin_manager::load_plugins): New parameter.
161 (Plugin_manager::all_symbols_read): New parameter.
162 (Plugin_manager::claim_file): New parameter. Save the elf object for
163 unclaimed objects.
164 (Plugin_manager::get_elf_object): New function.
165 (Plugin_manager::get_view): Change to directly use the bool to check
166 if get_view is called from claim_file_hook.
167 * plugin.h (input_objects): New function
168 (Plugin__manager::load_plugins): New parameter.
169 (Plugin_manager::claim_file): New parameter.
170 (Plugin_manager::get_elf_object): New function.
171 (Plugin_manager::in_claim_file_handler): New function.
172 (Plugin_manager::in_claim_file_handler_): New member.
173 (layout): New function.
174 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
175 handler with an extra parameter. Make the elf object before calling
176 claim_file handler.
177 * testsuite/plugin_test.c (get_section_count): New function pointer.
178 (get_section_type): New function pointer.
179 (get_section_name): New function pointer.
180 (get_section_contents): New function pointer.
181 (update_section_order): New function pointer.
182 (allow_section_ordering): New function pointer.
183 (onload): Check if the new interfaces exist.
184
9446efde
ILT
1852011-07-13 Ian Lance Taylor <iant@google.com>
186
187 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
188 relro section.
189 * x86_64.cc (Target_x86_64::got_section): Likewise.
190 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
191 (relro_now_test_SOURCES): New variable.
192 (relro_now_test_DEPENDENCIES): New variable.
193 (relro_now_test_LDFLAGS): New variable.
194 (relro_now_test_LDADD): New variable.
195 (relro_now_test.so): New target.
196 * testsuite/Makefile.in: Rebuild.
197
07aa62f2
ILT
1982011-07-12 Ian Lance Taylor <iant@google.com>
199
200 PR gold/12980
201 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
202 GLOB_DAT relocation rather than a RELATIVE relocation for a
203 protected symbol when creating a shared library.
204 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
205 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
206 * testsuite/protected_main_1.cc (main): Test that protected
207 function has same address.
208
e2153196
ILT
2092011-07-11 Ian Lance Taylor <iant@google.com>
210
211 PR gold/12979
212 * options.h (class General_options): Add -Bgroup.
213 * options.cc (General_options::finalize): If -Bgroup is set,
214 default to --unresolved-symbols=report-all.
215 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
216 * target-reloc.h (issue_undefined_symbol_error): Handle
217 --unresolved-symbols=report-all.
218
6daf5215
ILT
2192011-07-08 Ian Lance Taylor <iant@google.com>
220
221 PR gold/11985
222 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
223 if linker script discards key sections.
224 (Layout::create_dynamic_symtab): Likewise.
225 (Layout::assign_local_dynsym_offsets): Likewise.
226 (Layout::sized_create_version_sections): Likewise.
227 (Layout::create_interp): Likewise.
228 (Layout::finish_dynamic_section): Likewise.
229 (Layout::set_dynamic_symbol_size): Likewise.
230
beabb2c6
ILT
2312011-07-08 Ian Lance Taylor <iant@google.com>
232
233 PR gold/12386
234 * options.h (class General_options): Add --unresolved-symbols.
235 * target-reloc.h (issue_undefined_symbol_error): Check
236 --unresolved-symbols. Add comments.
237
9c16daf1
ILT
2382011-07-08 Ian Lance Taylor <iant@google.com>
239
240 * testsuite/odr_violation2.cc (Ordering::operator()): Make
241 expression more complex.
242
191f1a2d
ILT
2432011-07-08 Ian Lance Taylor <iant@google.com>
244
245 PR gold/11317
246 * target-reloc.h (issue_undefined_symbol_error): New inline
247 function, broken out of relocate_section.
248 (relocate_section): Call issue_undefined_symbol_error.
249 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
250 there is no TLS segment if we are about to issue an undefined
251 symbol error.
252 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
253
62855347
ILT
2542011-07-08 Ian Lance Taylor <iant@google.com>
255
256 PR gold/12279
257 * resolve.cc (Symbol_table::should_override): Add fromtype
258 parameter. Change all callers. Give error when linking together
259 TLS and non-TLS symbol.
260 (Symbol_table::should_override_with_special): Add fromtype
261 parameter. Change all callers.
262 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
263 there is no TLS segment if we have reported some errors.
264 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
265
67181c72
ILT
2662011-07-08 Ian Lance Taylor <iant@google.com>
267
268 PR gold/12372
269 * target.h (Target::plt_address_for_global): New function.
270 (Target::plt_address_for_local): New function.
271 (Target::plt_section_for_global): Remove.
272 (Target::plt_section_for_local): Remove.
273 (Target::do_plt_address_for_global): New virtual function.
274 (Target::do_plt_address_for_local): New virtual function.
275 (Target::do_plt_section_for_global): Remove.
276 (Target::do_plt_section_for_local): Remove.
277 (Target::register_global_plt_entry): Add Symbol_table and Layout
278 parameters.
279 * output.cc (Output_data_got::Got_entry::write): Use
280 plt_address_for_global and plt_address_for_local.
281 * layout.cc (Layout::add_target_dynamic_tags): Use size and
282 address of output section.
283 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
284 got_irelative_, and irelative_count_ fields. Update
285 declarations.
286 (Output_data_plt_i386::has_irelative_section): New function.
287 (Output_data_plt_i386::entry_count): Add irelative_count_.
288 (Output_data_plt_i386::set_final_data_size): Likewise.
289 (class Target_i386): Add got_irelative_ and rel_irelative_
290 fields. Update declarations.
291 (Target_i386::Target_i386): Initialize new fields.
292 (Target_i386::do_plt_address_for_global): New function replacing
293 do_plt_section_for_global.
294 (Target_i386::do_plt_address_for_local): New function replacing
295 do_plt_section_for_local.
296 (Target_i386::got_section): Create got_irelative_.
297 (Target_i386::rel_irelative_section): New function.
298 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
299 fields. Don't define __rel_iplt_{start,end}.
300 (Output_data_plt_i386::add_entry): Add symtab and layout
301 parameters. Change all callers. Use different PLT and GOT for
302 IFUNC symbols.
303 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
304 layout parameters. Change all callers. Use different PLT and
305 GOT.
306 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
307 (Output_data_plt_i386::rel_irelative): New function.
308 (Output_data_plt_i386::address_for_global): New function.
309 (Output_data_plt_i386::address_for_local): New function.
310 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
311 IRELATIVE GOT when changing IFUNC GOT entries.
312 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
313 reloc.
314 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
315 if we didn't create an IRELATIVE GOT.
316 (Target_i386::Relocate::relocate): Use plt_address_for_global and
317 plt_address_for_local.
318 (Target_i386::do_dynsym_value): Use plt_address_for_global.
319 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
320 got_irelative_, and irelative_count_ fields. Update
321 declarations.
322 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
323 Initialize new fields. Remove symtab parameter. Change all
324 callers.
325 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
326 irelative_count_.
327 (Output_data_plt_x86_64::has_irelative_section): New function.
328 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
329 (class Target_x86_64): Add got_irelative_ and rel_irelative_
330 fields. Update declarations.
331 (Target_x86_64::Target_x86_64): Initialize new fields.
332 (Target_x86_64::do_plt_address_for_global): New function replacing
333 do_plt_section_for_global.
334 (Target_x86_64::do_plt_address_for_local): New function replacing
335 do_plt_section_for_local.
336 (Target_x86_64::got_section): Create got_irelative_.
337 (Target_x86_64::rela_irelative_section): New function.
338 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
339 all callers. Don't create __rel_iplt_{start,end}.
340 (Output_data_plt_x86_64::add_entry): Add symtab and layout
341 parameters. Change all callers. Use different PLT and GOT for
342 IFUNC symbols.
343 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
344 layout parameters. Change all callers. Use different PLT and
345 GOT.
346 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
347 parameters. Change all callers. Use different PLT and GOT for
348 IFUNC symbols.
349 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
350 (Output_data_plt_x86_64::rela_irelative): New function.
351 (Output_data_plt_x86_64::address_for_global): New function.
352 (Output_data_plt_x86_64::address_for_local): New function.
353 (Output_data_plt_x86_64::set_final_data_size): Likewise.
354 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
355 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
356 (Target_x86_64::register_global_plt_entry): Add symtab and layout
357 parameters.
358 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
359 reloc.
360 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
361 symbols if we didn't create an IRELATIVE GOT.
362 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
363 plt_address_for_local.
364 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
365 * testsuite/ifuncvar1.c: New test file.
366 * testsuite/ifuncvar2.c: New test file.
367 * testsuite/ifuncvar3.c: New test file.
368 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
369 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
370 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
371 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
372 * testsuite/Makefile.in: Rebuild.
373
33c15b45
CC
3742011-07-07 Cary Coutant <ccoutant@google.com>
375
376 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
377 (two_file_test_1_ndebug.o): Likewise.
378 (two_file_test_1b_ndebug.o): Likewise.
379 (two_file_test_2_ndebug.o): Likewise.
380 (two_file_test_main_ndebug.o): Likewise.
381 (incremental_test_2): Link with no-debug versions.
382
f48b5fb7
CC
3832011-07-06 Cary Coutant <ccoutant@google.com>
384
385 * gold/incremental.cc
386 (Output_section_incremental_inputs::write_info_blocks): Check for
387 hidden and internal symbols.
388
221597a5
CC
3892011-07-06 Cary Coutant <ccoutant@google.com>
390
391 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
392 Check disposition for startup file.
393 (Incremental_inputs::report_command_line): Ignore
394 --incremental-startup-unchanged option.
395 * options.cc (General_options::parse_incremental_startup_unchanged):
396 New function.
397 (General_options::General_options): Initialize new data member.
398 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
399 (General_options): Add --incremental-startup-unchanged option.
400 (General_options::incremental_startup_disposition): New function.
401 (General_options::incremental_startup_disposition_): New data member.
402
e24719f6
CC
4032011-07-06 Cary Coutant <ccoutant@google.com>
404
405 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
406 input file index to Script_info ctor.
407 (Sized_incremental_binary::do_file_has_changed): Find the
408 command-line argument for files named in scripts.
409 * incremental.h (Script_info::Script_info): New ctor
410 with input file index.
411 (Script_info::input_file_index): New function.
412 (Script_info::input_file_index_): New data member.
413 (Incremental_binary::get_library): Add const.
414 (Incremental_binary::get_script_info): Add const.
415 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
416 * testsuite/Makefile.am (incremental_test_5): New test case.
417 (incremental_test_6): New test case.
418 * testsuite/Makefile.in: Regenerate.
419
8f7c81e8
CC
4202011-07-06 Cary Coutant <ccoutant@google.com>
421
422 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
423 debug output when command lines differ.
424
9fbd3822
CC
4252011-07-06 Cary Coutant <ccoutant@google.com>
426
427 * incremental.cc (Incremental_inputs::report_command_line): Ignore
428 --incremental-patch option.
429 * layout.cc (Free_list::allocate): Extend allocation beyond original
430 end if enabled.
431 (Layout::make_output_section): Mark sections that should get
432 patch space.
433 * options.cc (parse_percent): New function.
434 * options.h (parse_percent): New function.
435 (DEFINE_percent): New macro.
436 (General_options): Add --incremental-patch option.
437 * output.cc (Output_section::Output_section): Initialize new data
438 members.
439 (Output_section::add_input_section): Print section name when out
440 of patch space.
441 (Output_section::add_output_section_data): Likewise.
442 (Output_section::set_final_data_size): Add patch space when
443 doing --incremental-full.
444 (Output_section::do_reset_address_and_file_offset): Remove patch
445 space.
446 (Output_segment::set_section_list_addresses): Print debug output
447 only if --incremental-update.
448 * output.h (Output_section::set_is_patch_space_allowed): New function.
449 (Output_section::is_patch_space_allowed_): New data member.
450 (Output_section::patch_space_): New data member.
451 * parameters.cc (Parameters::incremental_full): New function.
452 * parameters.h (Parameters::incremental_full): New function
453 * testsuite/Makefile.am (incremental_test_2): Add test for
454 --incremental-patch option.
455 * testsuite/Makefile.in: Regenerate.
456 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
457 (t18): Remove function body.
458
f6cccc2c
DK
4592011-07-05 Doug Kwan <dougkwan@google.com>
460
461 PR gold/12771
462 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
463 Arm_Address type for relocation result.
464 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
465 overflow check.
466 (Arm_relocate_functions::abs32): Use unaligned access.
467 (Arm_relocate_functions::rel32): Ditto.
468 (Arm_relocate_functions::prel31): Ditto.
469 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
470 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
471 static data relocations.
472 * testsuite/Makefile.in: Regnerate.
473 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
474
28a13fec
ILT
4752011-07-05 Ian Lance Taylor <iant@google.com>
476
477 PR gold/12392
478 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
479 symbols if necessary.
480 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
481
24d47b34
ILT
4822011-07-05 Ian Lance Taylor <iant@google.com>
483
484 PR gold/12952
485 * resolve.cc (Symbol::override_base_with_special): Simply override
486 version with special symbol version, ignoring previous version.
487
41f9cbbe
ILT
4882011-07-05 Ian Lance Taylor <iant@google.com>
489
490 * object.cc (Sized_relobj_file::include_section_group): Add
491 information to comment about signature location.
492
886288f1
ILT
4932011-07-02 Ian Lance Taylor <iant@google.com>
494
495 PR gold/12957
496 * options.h (class General_options): Add -f and -F.
497 * options.cc (General_options::finalize): Fatal error if -f/-F
498 are used without -shared.
499 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
500
ae3a6d4f
ILT
5012011-07-02 Ian Lance Taylor <iant@google.com>
502
503 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
504
21131061
ILT
5052011-07-01 Ian Lance Taylor <iant@google.com>
506
507 PR gold/12525
508 PR gold/12952
509 * resolve.cc (Symbol::override_base_with_special): Don't override
510 the version if the overriding symbol has a different name.
511 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
512 all callers. If we give an error about an undefined version,
513 define the base version if necessary.
514 * dynobj.h (class Versions): Update declaration.
515 * testsuite/weak_alias_test_5.cc: New file.
516 * testsuite/weak_alias_test.script: New file.
517 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
518 and versioned_alias have the right value, and call t2.
519 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
520 weak_alias_test_5.so.
521 (weak_alias_test_LDADD): Likewise.
522 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
523 * testsuite/Makefile.in: Rebuild.
524
611062c0
ILT
5252011-07-01 Ian Lance Taylor <iant@google.com>
526
527 PR gold/12525
528 * options.h (class General_options): Support -z notext.
529 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
530 -Wl,-z,notext.
531 (two_file_shared_nonpic.so): Likewise.
532 (two_file_shared_mixed.so): Likewise.
533 (two_file_shared_mixed_1.so): Likewise.
534 (weak_undef_lib_nonpic.so): Likewise.
535 (alt/weak_undef_lib_nonpic.so): Likewise.
536 (tls_test_shared_nonpic.so): Likewise.
537 * testsuite/Makefile.in: Rebuild.
538
328c7c2f
ILT
5392011-07-01 Ian Lance Taylor <iant@google.com>
540
541 PR gold/12525
542 * configure.ac: Test whether static linking works, setting
543 the automake conditional HAVE_STATIC.
544 * testsuite/Makefile.am: Disable tests using -static if
545 HAVE_STATIC is not true.
546 * configure, testsuite/Makefile.in: Rebuild.
547
02d7cd44
ILT
5482011-07-01 Ian Lance Taylor <iant@google.com>
549
550 PR gold/12525
551 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
552 Assert if we see DW_EH_PE_indirect.
553 * target.h (Target::ehframe_datarel_base): New function.
554 (Target::do_ehframe_datarel_base): New target function.
555 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
556 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
557 function.
558
07a60597
ILT
5592011-07-01 Ian Lance Taylor <iant@google.com>
560
561 PR gold/12571
562 * options.h (class General_options): Add
563 --ld-generated-unwind-info.
564 * ehframe.cc (Fde::write): Add address parameter. Change all
565 callers. If associated with PLT, fill in address and size.
566 (Cie::set_output_offset): Only add merge mapping if there is an
567 object.
568 (Cie::write): Add address parameter. Change all callers.
569 (Eh_frame::add_ehframe_for_plt): New function.
570 * ehframe.h (class Fde): Update declarations. Move shndx_ and
571 input_offset_ fields into union u_, with new plt field.
572 (Fde::Fde): Adjust for new union field.
573 (Fde::Fde) [Output_data version]: New constructor.
574 (Fde::add_mapping): Only add merge mapping if there is an object.
575 (class Cie): Update declarations.
576 (class Eh_frame): Declare add_ehframe_for_plt.
577 * layout.cc (Layout::layout_eh_frame): Break out code into
578 make_eh_frame_section, and call it.
579 (Layout::make_eh_frame_section): New function.
580 (Layout::add_eh_frame_for_plt): New function.
581 * layout.h (class Layout): Update declarations.
582 * merge.cc (Merge_map::add_mapping): Add assertion.
583 * i386.cc: Include "dwarf.h".
584 (class Output_data_plt_i386): Make first_plt_entry,
585 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
586 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
587 and plt_eh_frame_fde.
588 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
589 boundary. Call add_eh_frame_for_plt if appropriate.
590 * x86_64.cc: Include "dwarf.h".
591 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
592 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
593 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
594 and plt_eh_frame_fde.
595 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
596 appropriate.
597
14788a3f
ILT
5982011-06-29 Ian Lance Taylor <iant@google.com>
599
600 PR gold/12629
601 * object.cc (Sized_relobj_file::layout_section): Change shdr
602 parameter to be const.
603 (Sized_relobj_file::layout_eh_frame_section): New function, broken
604 out of do_layout.
605 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
606 appropriate. Call layout_eh_frame_section.
607 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
608 sections.
609 * object.h (class Sized_relobj_file): Update declarations.
610
6c21fce1
ILT
6112011-06-29 Ian Lance Taylor <iant@google.com>
612
37e41b03 613 PR gold/12652
6c21fce1
ILT
614 * script.cc (Token::integer_value): Accept trailing M/m/K/k
615 modifier.
616 (Lex::gather_token): Accept trailing M/m/K/k for integers.
617
4d5e4e62
ILT
6182011-06-29 Ian Lance Taylor <iant@google.com>
619
620 PR gold/12675
621 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
622 SHT_X86_64_UNWIND.
623 * layout.cc (Layout::layout_eh_frame): Likewise.
624
886f533a
ILT
6252011-06-29 Ian Lance Taylor <iant@google.com>
626
627 PR gold/12695
628 * layout.cc (Layout::symtab_section_shndx): New function.
629 * layout.h (class Layout): Declare symtab_section_shndx.
630 * output.cc (Output_section::write_header): Call it.
631
f3ae1b28
ILT
6322011-06-29 Ian Lance Taylor <iant@google.com>
633
634 PR gold/12818
635 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
636 symbols which are not used in a relocation.
637
aecf301f
ILT
6382011-06-28 Ian Lance Taylor <iant@google.com>
639
640 PR gold/12898
641 * layout.cc (Layout::segment_precedes): Don't crash if a linker
642 script create indistinguishable segments.
643 (Layout::set_segment_offsets): Use stable_sort when sorting
644 segments. Pass this to Compare_segments constructor.
645 * layout.h (class Layout): Make segment_precedes non-static.
646 (class Compare_segments): Change from struct to class. Add
647 layout_ field. Add constructor.
648 * script-sections.cc
649 (Script_sections::attach_sections_using_phdrs_clause): Rename
650 local orphan to is_orphan. Don't report failure to put empty
651 section in segment. On attachment failure, report name of
652 section, and attach to first PT_LOAD segment.
653
03ef7571
ILT
6542011-06-28 Ian Lance Taylor <iant@google.com>
655
656 PR gold/12934
657 * target-select.cc (Target_selector::Target_selector): Add
658 emulation parameter. Change all callers.
659 (select_target_by_bfd_name): Rename from select_target_by_name.
660 Change all callers.
661 (select_target_by_emulation): New function.
662 (supported_emulation_names): New function.
663 * target-select.h (class Target_selector): Add emulation_ field.
664 Update declarations.
665 (Target_selector::recognize_by_bfd_name): Rename from
666 recognize_by_name. Change all callers.
667 (Target_selector::supported_bfd_names): Rename from
668 supported_names. Change all callers.
669 (Target_selector::recognize_by_emulation): New function.
670 (Target_selector::supported_emulations): New function.
671 (Target_selector::emulation): New function.
672 (Target_selector::do_recognize_by_bfd_name): Rename from
673 do_recognize_by_name. Change all callers.
674 (Target_selector::do_supported_bfd_names): Rename from
675 do_supported_names. Change all callers.
676 (Target_selector::do_recognize_by_emulation): New function.
677 (Target_selector::do_supported_emulations): New function.
678 (select_target_by_bfd_name): Change name in declaration.
679 (select_target_by_emulation): Declare.
680 (supported_emulation_names): Declare.
681 * parameters.cc (parameters_force_valid_target): Try to find
682 target based on emulation from -m option.
683 * options.h (class General_options): Change doc string for -m.
684 * options.cc (help): Print emulations.
685 (General_options::parse_V): Likewise.
686 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
687 Add emulation parameter. Change all callers.
688
200b2bb9
ILT
6892011-06-28 Ian Lance Taylor <iant@google.com>
690
691 * target.h (class Target): Add osabi_ field.
692 (Target::osabi): New function.
693 (Target::set_osabi): New function.
694 (Target::Target): Initialize osabi_.
695 (Target::do_adjust_elf_header): Make pure virtual.
696 (Sized_target::do_adjust_elf_header): Declare.
697 * target.cc (Sized_target::do_adjust_elf_header): New function.
698 (class Sized_target): Instantiate all versions.
699 * freebsd.h (class Target_freebsd): Remove.
700 (Target_selector_freebsd::do_recognize): Call set_osabi on
701 Target.
702 (Target_selector_freebsd::do_recognize_by_name): Likewise.
703 (Target_selector_freebsd::set_osabi): Remove.
704 * i386.cc (class Target_i386): Inherit from Sized_target rather
705 than Target_freebsd.
706 * x86_64.cc (class Target_x86_64): Likewise.
707
b3ce541e
ILT
7082011-06-28 Ian Lance Taylor <iant@google.com>
709
710 * target.h (Target::can_check_for_function_pointers): Rewrite.
711 Make non-virtual.
712 (Target::can_icf_inline_merge_sections): Likewise.
713 (Target::section_may_have_icf_unsafe_poineters): Likewise.
714 (Target::Target_info): Add can_icf_inline_merge_sections field.
715 (Target::do_can_check_for_function_pointers): New virtual
716 function.
717 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
718 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
719 from can_check_for_function_pointers, move in file.
720 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
721 section_may_have_icf_unsafe_poineters, move in file.
722 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
723 * i386.cc (Target_i386::do_can_check_for_function_pointers):
724 Rename from can_check_for_function_pointers, move in file.
725 (Target_i386::can_icf_inline_merge_sections): Remove.
726 (Target_i386::i386_info): Initialize
727 can_icf_inline_merge_sections.
728 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
729 Initialize can_icf_inline_merge_sections.
730 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
731 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
732 Rename from can_check_for_function_pointers, move in file.
733 (Target_x86_64::can_icf_inline_merge_sections): Remove.
734 (Target_x86_64::x86_64_info): Initialize
735 can_icf_inline_merge_sections.
736 * testsuite/testfile.cc (Target_test::test_target_info):
737 Likewise.
738 * icf.cc (get_section_contents): Correct formatting.
739
6d1c4efb
ILT
7402011-06-27 Ian Lance Taylor <iant@google.com>
741
742 * symtab.cc (Symbol::versioned_name): New function.
743 (Symbol_table::add_to_final_symtab): Use versioned_name when
744 appropriate.
745 (Symbol_table::sized_write_symbol): Likewise.
746 * symtab.h (class Symbol): Declare versioned_name.
747 * stringpool.h (class Stringpool_template): Add variant of add
748 which takes a std::basic_string.
749 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
750 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
751 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
752 (ver_test_12.o): New target.
753 * testsuite/Makefile.in: Rebuild.
754
57eb9b50
DK
7552011-06-27 Doug Kwan <dougkwan@google.com>
756
757 * arm.cc (Arm_relocate_functions::thm_jump8,
758 Arm_relocate_functions::thm_jump11): Use a wider signed
759 type to compute offset.
760 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
761 arm_thm_jump8.
762 * testsuite/Makefile.in: Regenerate.
763 * testsuite/arm_branch_in_range.sh: Check test results of
764 arm_thm_jump11 and arm_thm_jump8.
765 * testsuite/arm_thm_jump11.s: New test source file.
766 * testsuite/arm_thm_jump11.t: New linker script.
767 * testsuite/arm_thm_jump8.s: New test source file.
768 * testsuite/arm_thm_jump8.t: New linker script.
769
487b39df
ILT
7702011-06-24 Ian Lance Taylor <iant@google.com>
771
772 * layout.cc: Include "object.h".
773 (ctors_sections_in_init_array): New static variable.
774 (Layout::is_ctors_in_init_array): New function.
775 (Layout::layout): Add entry to ctors_sections_in_init_array if
776 appropriate.
777 * layout.h (class Layout): Declare is_ctors_in_init_array.
778 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
779 is_ctors_reverse_view is set.
780 (Sized_relobj_file::write_sections): Add layout parameter. Change
781 all callers. Set is_ctors_reverse_view field of View_size.
782 (Sized_relobj_file::reverse_words): New function.
783 * object.h (Sized_relobj_file::View_size): Add
784 is_ctors_reverse_view field.
785 (class Sized_relobj_file): Update declarations.
786 * testsuite/initpri3.c: New test.
787 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
788 initpri3b.
789 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
790 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
791 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
792 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
793 * testsuite/Makefile.in: Rebuild.
794
472076e4
CC
7952011-06-24 Cary Coutant <ccoutant@google.com>
796
797 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
798 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
799 (debug_msg_cdebug.err): New targets.
800 * testsuite/Makefile.in: Regenerate.
801 * testsuite/debug_msg.sh: Check output of link with compressed debug.
802 Fix checks for link with shared library.
803
a60af0db
DK
8042011-06-24 Doug Kwan <dougkwan@google.com>
805
806 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
807 skip empty text sections.
808 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
809
5393d741
ILT
8102011-06-22 Ian Lance Taylor <iant@google.com>
811
812 PR gold/12910
813 * options.h (class General_options): Add --ctors-in-init-array.
814 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
815 friends as SHT_PROGBITS for merging sections.
816 (Layout::layout): Remove special handling of .init_array and
817 friends. Don't sort if doing relocatable link. Sort for .ctors
818 and .dtors if ctors_in_init_array.
819 (Layout::make_output_section): Force correct section types for
820 .init_array and friends. Don't sort if doing relocatable link,
821 Don't sort .ctors and .dtors if ctors_in_init_array.
822 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
823 (Layout::output_section_name): Add relobj parameter. Change all
824 callers. Handle .ctors. and .dtors. in code rather than table.
825 Handle .ctors and .dtors if ctors_in_init_array.
826 (Layout::match_file_name): New function, moved from output.cc.
827 * layout.h (class Layout): Update declarations.
828 * output.cc: Include "layout.h".
829 (Input_section_sort_entry::get_priority): New function.
830 (Input_section_sort_entry::match_file_name): Just call
831 Layout::match_file_name.
832 (Output_section::Input_section_sort_init_fini_compare::operator()):
833 Handle .ctors and .dtors. Sort by explicit priority rather than
834 by name.
835 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
836 * testsuite/initpri2.c: New test.
837 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
838 (check_PROGRAMS): Add initpri2.
839 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
840 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
841 * configure, testsuite/Makefile.in: Rebuild.
842
e1f74f98
ILT
8432011-06-19 Ian Lance Taylor <iant@google.com>
844
845 PR gold/12880
846 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
847 .interp section to a PT_INTERP segment even if we have seen a
848 --dynamic-linker option. Don't do it if we have seen a PHDRS
849 clause in a linker script.
850 (Layout::finalize): Don't create a .interp section if we've
851 already create a PT_INTERP segment.
852 (Layout::create_interp): Always call choose_output_section (revert
853 patch of 2011-06-17). Don't create PT_INTERP segment.
854 * script-sections.cc
855 (Script_sections::create_note_and_tls_segments): Add a .interp
856 section to a PT_INTERP segment even if we have seen a
857 --dynamic-linker option.
858
766f91bb
ILT
8592011-06-18 Ian Lance Taylor <iant@google.com>
860
861 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
862 merely because a non-PT_LOAD segment has a dynamic reloc.
863
0d212c3a
ILT
8642011-06-18 Ian Lance Taylor <iant@google.com>
865
866 * layout.cc (Layout::finish_dynamic_section): Don't create
867 DT_FLAGS entry if not needed.
868
911a5072
ILT
8692011-06-18 Ian Lance Taylor <iant@google.com>
870
871 PR gold/12745
872 * layout.cc (Layout::layout_eh_frame): Correct handling of
873 writable .eh_frame section.
874
534b4e5f
ILT
8752011-06-17 Ian Lance Taylor <iant@google.com>
876
877 PR gold/12893
878 * resolve.cc (Symbol_table::resolve): Don't give an error if a
879 symbol is redefined with the exact same object and value.
880
10b4f102
ILT
8812011-06-17 Ian Lance Taylor <iant@google.com>
882
883 PR gold/12880
884 * layout.h (class Layout): Add interp_segment_ field.
885 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
886 (Layout::attach_allocated_section_to_segment): If making shared
887 library, put .interp section in PT_INTERP segment.
888 (Layout::finalize): Also call create_interp if -dynamic-linker
889 option was used.
890 (Layout::create_interp): Assert that there is no PT_INTERP
891 segment. If not using a SECTIONS clause, use make_output_section.
892 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
893 * script-sections.cc
894 (Script_sections::create_note_and_tls_segments): If making shared
895 library, put .interp section in PT_INTERP segment.
896
a29b0dad
ILT
8972011-06-17 Ian Lance Taylor <iant@google.com>
898
e588ea8d
ILT
899 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
900 when making a shared library.
901
9022011-06-17 Ian Lance Taylor <iant@google.com>
903
904 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
905 parameter. Change all callers. Don't issue warning about PC32
906 against locally defined symbol.
a29b0dad 907
9d3b0698
ILT
9082011-06-16 Ian Lance Taylor <iant@google.com>
909
910 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
911 occurs in same object.
912
85b0f90c
AM
9132011-06-14 Alan Modra <amodra@gmail.com>
914
915 * po/POTFILES.in: Regenerate.
916
a94907d9
ILT
9172011-06-09 Ian Lance Taylor <iant@google.com>
918
919 * script-sections.cc
920 (Orphan_output_section::set_section_addresses): For a relocatable
921 link set address to 0.
922
4fb3a1c3
CC
9232011-06-09 Cary Coutant <ccoutant@google.com>
924
925 PR gold/12804
926 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
927 used with --compress-debug-sections.
928 * gold/object.cc (Sized_relobj_file::do_layout): Report
929 uncompressed size of compressed input sections.
930
61220854
CC
9312011-06-08 Cary Coutant <ccoutant@google.com>
932
933 PR gold/12804
934 * testsuite/two_file_test_2_v1.cc: Change initialization of
935 v2 to keep it in .data.
936
e6455dfb
CC
9372011-06-07 Cary Coutant <ccoutant@google.com>
938
939 * common.cc (Symbol_table::do_allocate_commons_list): Call
940 gold_fallback.
941 * errors.cc (Errors::fatal): Adjust call to gold_exit.
942 (Errors::fallback): New function.
943 (gold_fallback): New function.
944 * errors.h (Errors::fallback): New function.
945 * gold.cc (gold_exit): Change status parameter to enum; adjust
946 all callers.
947 (queue_initial_tasks): Call gold_fallback.
948 * gold.h: Include cstdlib.
949 (Exit_status): New enum type.
950 (gold_exit): Change status parameter to enum.
951 (gold_fallback): New function.
952 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
953 (Layout::create_symtab_sections): Likewise.
954 (Layout::create_shdrs): Likewise.
955 * main.cc (main): Adjust call to gold_exit.
956 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
957 (Output_data_got::add_got_entry_pair): Likewise.
958 (Output_section::add_input_section): Likewise.
959 (Output_section::add_output_section_data): Likewise.
960 (Output_segment::set_section_list_addresses): Likewise.
961 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
962
fb0e076f
CC
9632011-06-07 Cary Coutant <ccoutant@google.com>
964
965 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
966 for incremental links.
967 * output.cc (Output_segment::set_section_list_addresses): Remove
968 FIXME and test for TLS or BSS.
969
a5ee4d5d
CC
9702011-06-07 Cary Coutant <ccoutant@google.com>
971
972 * testsuite/Makefile.am: Add incremental_copy_test,
973 incremental_common_test_1.
974 * testsuite/Makefile.in: Regenerate.
975 * testsuite/common_test_1_v1.c: New source file.
976 * testsuite/common_test_1_v2.c: New source file.
977 * testsuite/copy_test_v1.cc: New source file.
978
5146f448
CC
9792011-06-07 Cary Coutant <ccoutant@google.com>
980
981 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
982 update, allocate common from bss section's free list.
983 * incremental-dump.cc (dump_incremental_inputs): Print flag for
984 linker-defined symbols.
985 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
986 Skip GOT and PLT entries that are no longer referenced.
987 (Output_section_incremental_inputs::write_info_blocks): Mark
988 linker-defined symbols.
989 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
990 * output.cc (Output_section::allocate): New function.
991 * output.h (Output_section::allocate): New function.
992 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
993 linker-defined symbols.
994 (Symbol::override_base_with_special): Copy is_predefined_ flag.
995 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
996 (Symbol::init_base_output_data): Likewise.
997 (Symbol::init_base_output_segment): Likewise.
998 (Symbol::init_base_constant): Likewise.
999 (Sized_symbol::init_output_data): Likewise.
1000 (Sized_symbol::init_output_segment): Likewise.
1001 (Sized_symbol::init_constant): Likewise.
1002 (Symbol_table::do_define_in_output_data): Likewise.
1003 (Symbol_table::do_define_in_output_segment): Likewise.
1004 (Symbol_table::do_define_as_constant): Likewise.
1005 * symtab.h (Symbol::is_predefined): New function.
1006 (Symbol::init_base_output_data): Add is_predefined parameter.
1007 (Symbol::init_base_output_segment): Likewise.
1008 (Symbol::init_base_constant): Likewise.
1009 (Symbol::is_predefined_): New data member.
1010 (Sized_symbol::init_output_data): Add is_predefined parameter.
1011 (Sized_symbol::init_output_segment): Likewise.
1012 (Sized_symbol::init_constant): Likewise.
1013 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1014
26d3c67d
CC
10152011-06-07 Cary Coutant <ccoutant@google.com>
1016
1017 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1018 instead of emit_copy_reloc.
1019 (Copy_relocs::emit_copy_reloc): Refactor.
1020 (Copy_relocs::make_copy_reloc): New function.
1021 (Copy_relocs::add_copy_reloc): Remove.
1022 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1023 section.
1024 (Copy_relocs::make_copy_reloc): New function.
1025 (Copy_relocs::add_copy_reloc): Remove.
1026 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1027 unchanged input files.
1028 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1029 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1030 Reserve BSS space for COPY relocations.
1031 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1032 (Output_section_incremental_inputs::write_info_blocks): Record
1033 whether a symbol is copied from a shared object.
1034 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1035 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1036 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1037 (Incremental_input_entry_reader::get_output_symbol_index): Add
1038 is_copy parameter.
1039 (Incremental_binary::emit_copy_relocs): New function.
1040 (Incremental_binary::do_emit_copy_relocs): New function.
1041 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1042 new data member.
1043 (Sized_incremental_binary::add_copy_reloc): New function.
1044 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1045 (Sized_incremental_binary::Copy_reloc): New struct.
1046 (Sized_incremental_binary::Copy_relocs): New typedef.
1047 (Sized_incremental_binary::copy_relocs_): New data member.
1048 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1049 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1050 * target.h (Sized_target::emit_copy_reloc): New function.
1051 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1052
7cdb37d9
CC
10532011-06-02 Cary Coutant <ccoutant@google.com>
1054
1055 PR gold/12163
1056 * gold/archive.cc (Archive::Archive): Initialize new data member.
1057 (Archive::include_all_members): Return if archive has already been
1058 included.
1059 * gold/archive.h (Archive::include_all_members_): New data member.
1060
cc643b88
NC
10612011-06-02 Nick Clifton <nickc@redhat.com>
1062
1063 * dynobj.h: Fix spelling mistake in comment.
1064 * output.cc: Likewise.
1065
f62a3ca7
DK
10662011-05-31 Doug Kwan <dougkwan@google.com>
1067 Asier Llano
1068
1069 PR gold/12826
cc643b88 1070 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1071 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1072 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1073 redundant arm_exidx_test.so.
1074 * testsuite/Makefile.in: Regenerate.
1075 (check_SCRIPTS): Add pr12826.sh
1076 (check_DATA): Add pr12826.stdout
1077 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1078 * testsuite/pr12826.sh: New file.
1079 * testsuite/pr12826_1.s: Ditto.
1080 * testsuite/pr12826_1.s: Ditto.
1081
8dbe1edc
ILT
10822011-05-30 Ian Lance Taylor <iant@google.com>
1083
1084 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1085 sections.
1086
c49875be
ILT
10872011-05-29 Ian Lance Taylor <iant@google.com>
1088
1089 PR gold/12804
1090 * testsuite/Makefile.am: Use different file name for two_file_test
1091 temporary file for each incremental test.
1092 * testsuite/Makefile.in: Rebuild.
1093
69d53f7a
ILT
10942011-05-29 Ian Lance Taylor <iant@google.com>
1095
1096 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1097 binary input file is empty.
1098
41d0ab5f
ILT
10992011-05-27 Ian Lance Taylor <iant@google.com>
1100
1101 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1102 (ver_test_9.so): Likewise.
1103 * testsuite/Makefile.in: Rebuild.
1104
89d8a36b
CC
11052011-05-26 Cary Coutant <ccoutant@google.com>
1106
1107 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1108 * incremental.cc (Incremental_inputs::report_input_section): Fix
1109 comment, indentation.
1110 (Incremental_inputs::report_comdat_group): New function.
1111 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1112 of data for incremental input file entry.
1113 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1114 group count, COMDAT group signatures.
1115 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1116 an unchanged input file.
1117 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1118 Initialize new data member.
1119 (Incremental_object_entry::add_comdat_group): New function.
1120 (Incremental_object_entry::get_comdat_group_count): New function.
1121 (Incremental_object_entry::get_comdat_signature_key): New function.
1122 (Incremental_object_entry::groups_): New data member.
1123 (Incremental_inputs::report_comdat_group): New function.
1124 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1125 data for incremental input file entry.
1126 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1127 (Incremental_input_entry_reader::get_input_section): Adjust size of
1128 data for incremental input file entry.
1129 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1130 (Incremental_input_entry_reader::get_comdat_group_signature): New
1131 function.
1132 * object.cc (Sized_relobj::include_section_group): Report kept
1133 COMDAT groups for incremental links.
1134
1706a06f
ILT
11352011-05-24 David Meyer <pdox@google.com>
1136
1137 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1138 with name parameter. Add found_name parameter.
1139 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1140 * dirsearch.h (class Dirsearch): Update declaration.
1141
a10ae760
ILT
11422011-05-24 Ian Lance Taylor <iant@google.com>
1143
1144 * archive.cc (Library_base::should_include_member): Pull in object
1145 from archive if it defines the entry symbol.
1146 * parameters.cc (Parameters::entry): New function.
1147 * parameters.h (class Parameters): Declare entry.
1148 * output.h (class Output_file_header): Remove entry_ field.
1149 * output.cc (Output_file_header::Output_file_header): Remove entry
1150 parameter. Change all callers.
1151 (Output_file_header::entry): Use parameters->entry.
1152 * gold.cc (queue_middle_tasks): Likewise.
1153 * plugin.cc (Plugin_hook::run): Likewise.
1154
aa92d6ed
CC
11552011-05-24 Cary Coutant <ccoutant@google.com>
1156
1157 * gold.cc (queue_initial_tasks): Pass incremental base filename
1158 to Output_file::open_base_file; don't print error message.
1159 * incremental-dump.cc (main): Adjust call to
1160 Output_file::open_for_modification.
1161 * incremental-dump.cc (main): Likewise.
1162 * incremental.cc (Incremental_inputs::report_command_line):
1163 Ignore --incremental-base option when comparing command lines.
1164 Ignore parameter when given as separate argument.
1165 * options.h (class General_options): Add --incremental-base.
1166 * output.cc (Output_file::Output_file):
1167 (Output_file::open_base_file): Add base_name and writable parameters;
1168 read base file into new file; print error message here.
1169 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1170 callers.
1171 * output.h (Output_file::open_for_modification): Rename to...
1172 (Output_file::open_base_file): ...this; add base_name and
1173 writable parameters; adjust all callers.
1174 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1175 callers.
1176 * testsuite/Makefile.am (incremental_test_4): Test
1177 --incremental-base.
1178 * testsuite/Makefile.in: Regenerate.
1179
2eedd706
CC
11802011-05-24 Cary Coutant <ccoutant@google.com>
1181
1182 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1183 incremental_test_4.
1184 * testsuite/Makefile.in: Regenerate.
1185 * testsuite/two_file_test_1_v1.cc: New test source file.
1186 * testsuite/two_file_test_1b_v1.cc: New test source file.
1187 * testsuite/two_file_test_2_v1.cc: New test source file.
1188
0f1c85a6
CC
11892011-05-24 Cary Coutant <ccoutant@google.com>
1190
1191 * dynobj.h (Dynobj::do_dynobj): New function.
1192 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1193 flag and soname for shared objects.
1194 * incremental.cc (Incremental_inputs::report_object): Make
1195 either Incremental_object_entry or Incremental_dynobj_entry; add
1196 soname to string table.
1197 (Incremental_inputs::report_input_section): Add assertion.
1198 (Output_section_incremental_inputs::set_final_data_size): Adjust
1199 type of input file entry for shared libraries; adjust size of
1200 shared library info entry.
1201 (Output_section_incremental_inputs::write_input_files): Write
1202 as_needed flag for shared libraries.
1203 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1204 of input file entry for shared libraries; write soname.
1205 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1206 soname from incremental info.
1207 * incremental.h (enum Incremental_input_flags): Add
1208 INCREMENTAL_INPUT_AS_NEEDED.
1209 (Incremental_input_entry::Incremental_input_entry): Initialize new
1210 data member.
1211 (Incremental_input_entry::set_as_needed): New function.
1212 (Incremental_input_entry::as_needed): New function.
1213 (Incremental_input_entry::do_dynobj_entry): New function.
1214 (Incremental_input_entry::as_needed_): New data member.
1215 (Incremental_object_entry::Incremental_object_entry): Don't check
1216 for shared library.
1217 (Incremental_object_entry::do_type): Likewise.
1218 (class Incremental_dynobj_entry): New class.
1219 (Incremental_input_entry_reader::as_needed): New function.
1220 (Incremental_input_entry_reader::get_soname): New function.
1221 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1222 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1223 size of shared library info entry.
1224 * layout.cc (Layout::finish_dynamic_section): Don't test for
1225 incremental link when adding DT_NEEDED entries.
1226 * object.h (Object::Object): Initialize new data member.
1227 (Object::dynobj): New function.
1228 (Object::set_as_needed): New function.
1229 (Object::as_needed): New function.
1230 (Object::do_dynobj): New function.
1231 (Object::as_needed_): New data member.
1232
6fa2a40b
CC
12332011-05-24 Cary Coutant <ccoutant@google.com>
1234
1235 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1236 info; adjust display of GOT entries.
1237 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1238 vector of input objects; remove file_status_.
1239 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1240 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1241 got_plt reader; call target hooks to reserve GOT entries.
1242 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1243 of input file info header and GOT info entry.
1244 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1245 relocation info.
1246 (Got_plt_view_info::got_descriptor): Remove.
1247 (Got_plt_view_info::sym_index): New data member.
1248 (Got_plt_view_info::input_index): New data member.
1249 (Local_got_offset_visitor::visit): Write input file index.
1250 (Global_got_offset_visitor::visit): Write 0 for input file index.
1251 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1252 with sym_index and input_index.
1253 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1254 incremental info GOT entry; replace got_descriptor with input_index.
1255 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1256 map from input file index to object.
1257 (Sized_relobj_incr::do_layout): Replace direct data member reference
1258 with accessor function.
1259 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1260 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1261 Adjust size of input file info header.
1262 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1263 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1264 (Incremental_input_entry_reader::get_input_section): Adjust size of
1265 input file info header.
1266 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1267 of incremental info GOT entry.
1268 (Incremental_got_plt_reader::get_got_desc): Remove.
1269 (Incremental_got_plt_reader::get_got_symndx): New function.
1270 (Incremental_got_plt_reader::get_got_input_index): New function.
1271 (Sized_incremental_binary::Sized_incremental_binary): Remove
1272 file_status_; add input_objects_.
1273 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1274 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1275 (Sized_incremental_binary::file_is_unchanged): Remove.
1276 (Sized_incremental_binary::set_input_object): New function.
1277 (Sized_incremental_binary::input_object): New function.
1278 (Sized_incremental_binary::file_status_): Remove.
1279 (Sized_incremental_binary::input_objects_): New data member.
1280 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1281 references.
1282 (Sized_relobj_incr::invalid_address): Move to base class.
1283 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1284 class.
1285 (Sized_relobj_incr::do_output_section_offset): Likewise.
1286 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1287 (Sized_relobj_incr::section_offsets_): Likewise.
1288 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1289 function.
1290 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1291 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1292 with accessor function.
1293 (Sized_relobj_file::do_layout): Likewise.
1294 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1295 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1296 (Sized_relobj_file::compute_final_local_value): Replace refs to
1297 section_offsets_ with accessor function.
1298 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1299 * object.h (Relobj::Relobj): Initialize new data members.
1300 (Relobj::add_dyn_reloc): New function.
1301 (Relobj::first_dyn_reloc): New function.
1302 (Relobj::dyn_reloc_count): New function.
1303 (Relobj::first_dyn_reloc_): New data member.
1304 (Relobj::dyn_reloc_count_): New data member.
1305 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1306 references.
1307 (Sized_relobj::Address): New typedef.
1308 (Sized_relobj::invalid_address): Move here from child class.
1309 (Sized_relobj::Sized_relobj): Initialize new data members.
1310 (Sized_relobj::sized_relobj): New function.
1311 (Sized_relobj::is_output_section_offset_invalid): Move here from
1312 child class.
1313 (Sized_relobj::get_output_section_offset): Likewise.
1314 (Sized_relobj::local_has_got_offset): Likewise.
1315 (Sized_relobj::local_got_offset): Likewise.
1316 (Sized_relobj::set_local_got_offset): Likewise.
1317 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1318 (Sized_relobj::clear_got_offsets): New function.
1319 (Sized_relobj::section_offsets): Move here from child class.
1320 (Sized_relobj::do_output_section_offset): Likewise.
1321 (Sized_relobj::do_set_section_offset): Likewise.
1322 (Sized_relobj::Local_got_offsets): Likewise.
1323 (Sized_relobj::local_got_offsets_): Likewise.
1324 (Sized_relobj::section_offsets_): Likewise.
1325 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1326 references.
1327 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1328 class.
1329 (Sized_relobj_file::sized_relobj): New function
1330 (Sized_relobj_file::local_has_got_offset): Move to base class.
1331 (Sized_relobj_file::local_got_offset): Likewise.
1332 (Sized_relobj_file::set_local_got_offset): Likewise.
1333 (Sized_relobj_file::get_output_section_offset): Likewise.
1334 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1335 (Sized_relobj_file::do_output_section_offset): Likewise.
1336 (Sized_relobj_file::do_set_section_offset): Likewise.
1337 (Sized_relobj_file::Local_got_offsets): Likewise.
1338 (Sized_relobj_file::local_got_offsets_): Likewise.
1339 (Sized_relobj_file::section_offsets_): Likewise.
1340 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1341 (all constructors).
1342 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1343 (Output_reloc::get_symbol_index): Likewise.
1344 (Output_reloc::local_section_offset): Likewise.
1345 (Output_reloc::get_address): Likewise.
1346 (Output_reloc::symbol_value): Likewise.
1347 (Output_data_got::reserve_slot): Move to class definition.
1348 (Output_data_got::reserve_local): New function.
1349 (Output_data_got::reserve_slot_for_global): Remove.
1350 (Output_data_got::reserve_global): New function.
1351 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1352 (all constructors, two instantiations).
1353 (Output_reloc::get_relobj): New function (two instantiations).
1354 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1355 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1356 (Output_data_reloc::add_global): Adjust type of relobj.
1357 (Output_data_reloc::add_global_relative): Likewise.
1358 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1359 (Output_data_reloc::add_local): Likewise.
1360 (Output_data_reloc::add_local_relative): Likewise.
1361 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1362 (Output_data_reloc::add_local_section): Likewise.
1363 (Output_data_reloc::add_output_section): Likewise.
1364 (Output_data_reloc::add_absolute): Likewise.
1365 (Output_data_reloc::add_target_specific): Likewise.
1366 (Output_data_got::reserve_slot): Move definition here.
1367 (Output_data_got::reserve_local): New function.
1368 (Output_data_got::reserve_global): New function.
1369 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1370 section_offsets_ with accessor function.
1371 (Sized_relobj_file::write_sections): Likewise.
1372 (Sized_relobj_file::do_relocate_sections): Likewise.
1373 * target.h (Sized_target::reserve_local_got_entry): New function.
1374 (Sized_target::reserve_global_got_entry): New function.
1375 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1376 (Target_x86_64::reserve_global_got_entry): New function.
1377 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1378
4829d394
CC
13792011-05-23 Cary Coutant <ccoutant@google.com>
1380
1381 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1382 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1383 bit when checking got_type.
1384 * incremental.cc (Sized_incremental_binary::setup_readers):
1385 Store symbol table and string table locations; initialize bit vector
1386 of file status flags.
1387 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1388 unchanged files.
1389 (Sized_incremental_binary::do_process_got_plt): New function.
1390 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1391 (Output_section_incremental_inputs::set_final_data_size): Record
1392 file index for each input file.
1393 (Output_section_incremental_inputs::write_got_plt): Store file index
1394 instead of input entry offset for each GOT entry.
1395 * incremental.h
1396 (Incremental_input_entry::Incremental_input_entry): Initialize new
1397 data member.
1398 (Incremental_input_entry::set_offset): Store file index.
1399 (Incremental_input_entry::get_file_index): New function.
1400 (Incremental_input_entry::file_index_): New data member.
1401 (Incremental_binary::process_got_plt): New function.
1402 (Incremental_binary::do_process_got_plt): New function.
1403 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1404 data members.
1405 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1406 (Sized_incremental_binary::set_file_is_unchanged): New function.
1407 (Sized_incremental_binary::file_is_unchanged): New function.
1408 (Sized_incremental_binary::do_process_got_plt): New function.
1409 (Sized_incremental_binary::file_status_): New data member.
1410 (Sized_incremental_binary::main_symtab_loc_): New data member.
1411 (Sized_incremental_binary::main_strtab_loc_): New data member.
1412 * output.cc (Output_data_got::Got_entry::write): Add case
1413 RESERVED_CODE.
1414 (Output_data_got::add_global): Call add_got_entry.
1415 (Output_data_got::add_global_plt): Likewise.
1416 (Output_data_got::add_global_with_rel): Likewise.
1417 (Output_data_got::add_global_with_rela): Likewise.
1418 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1419 (Output_data_got::add_global_pair_with_rela): Likewise.
1420 (Output_data_got::add_local): Call add_got_entry.
1421 (Output_data_got::add_local_plt): Likewise.
1422 (Output_data_got::add_local_with_rel): Likewise.
1423 (Output_data_got::add_local_with_rela): Likewise.
1424 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1425 (Output_data_got::add_local_pair_with_rela): Likewise.
1426 (Output_data_got::reserve_slot): New function.
1427 (Output_data_got::reserve_slot_for_global): New function.
1428 (Output_data_got::add_got_entry): New function.
1429 (Output_data_got::add_got_entry_pair): New function.
1430 (Output_section::add_output_section_data): Edit FIXME.
1431 * output.h
1432 (Output_section_data_build::Output_section_data_build): New
1433 constructor with size parameter.
1434 (Output_data_space::Output_data_space): Likewise.
1435 (Output_data_got::Output_data_got): Initialize new data member; new
1436 constructor with size parameter.
1437 (Output_data_got::add_constant): Call add_got_entry.
1438 (Output_data_got::reserve_slot): New function.
1439 (Output_data_got::reserve_slot_for_global): New function.
1440 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1441 (Output_data_got::add_got_entry): New function.
1442 (Output_data_got::add_got_entry_pair): New function.
1443 (Output_data_got::free_list_): New data member.
1444 * target.h (Sized_target::init_got_plt_for_update): New function.
1445 (Sized_target::register_global_plt_entry): New function.
1446 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1447 Initialize new data member; call init; add constructor with PLT count.
1448 (Output_data_plt_x86_64::init): New function.
1449 (Output_data_plt_x86_64::add_relocation): New function.
1450 (Output_data_plt_x86_64::reserve_slot): New function.
1451 (Output_data_plt_x86_64::free_list_): New data member.
1452 (Target_x86_64::init_got_plt_for_update): New function.
1453 (Target_x86_64::register_global_plt_entry): New function.
1454 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1455 incremental updates.
1456 (Output_data_plt_x86_64::add_relocation): New function.
1457 * testsuite/object_unittest.cc (Object_test): Set default options.
1458
ec69d6da
ILT
14592011-05-16 Ian Lance Taylor <iant@google.com>
1460
1461 * options.h (class General_options): Make -i a synonym for -r.
1462
732e31de
ILT
14632011-05-16 Ian Lance Taylor <iant@google.com>
1464
1465 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1466
403676b5
CC
14672011-05-10 Cary Coutant <ccoutant@google.com>
1468
1469 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1470 strip_all (-s).
1471
5b7b7d6e
ILT
14722011-05-06 Ian Lance Taylor <iant@google.com>
1473
1474 * layout.cc (Layout::layout): If the output section flags change,
1475 update the ordering.
1476
f0f9babf
CC
14772011-04-25 Cary Coutant <ccoutant@google.com>
1478
1479 * incremental-dump.cc (dump_incremental_inputs): Print local
1480 symbol info for each input file.
1481 * incremental.cc
1482 (Output_section_incremental_inputs::set_final_data_size): Add local
1483 symbol info to input file entries in incremental info.
1484 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1485 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1486 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1487 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1488 implementation.
1489 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1490 (Sized_incr_relobj::do_relocate): Write the local symbols.
1491 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1492 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1493 Adjust size of input file header.
1494 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1495 (Incremental_inputs_reader::get_local_symbol_count): New function.
1496 (Incremental_inputs_reader::get_input_section): Adjust size of input
1497 file header.
1498 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1499 (Sized_incr_relobj::This): New typedef.
1500 (Sized_incr_relobj::sym_size): New const data member.
1501 (Sized_incr_relobj::Local_symbol): New struct.
1502 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1503 (Sized_incr_relobj::do_local_symbol_offset): New function.
1504 (Sized_incr_relobj::local_symbol_count_): New data member.
1505 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1506 (Sized_incr_relobj::local_symbol_index_): New data member.
1507 (Sized_incr_relobj::local_symbol_offset_): New data member.
1508 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1509 (Sized_incr_relobj::local_symbols_): New data member.
1510 * object.h (Relobj::output_local_symbol_count): New function.
1511 (Relobj::local_symbol_offset): New function.
1512 (Relobj::do_output_local_symbol_count): New function.
1513 (Relobj::do_local_symbol_offset): New function.
1514 (Sized_relobj::do_output_local_symbol_count): New function.
1515 (Sized_relobj::do_local_symbol_offset): New function.
1516
d0a9ace3
ILT
15172011-04-22 Vladimir Simonov <sv@sw.ru>
1518
1519 * descriptors.cc (set_close_on_exec): New function.
1520 (Descriptors::open): Use set_close_on_exec.
1521 * output.cc (S_ISLNK): Define if not defined.
1522
94a3fc8b
CC
15232011-04-22 Cary Coutant <ccoutant@google.com>
1524
1525 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1526 global symbol map.
1527 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1528 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1529 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1530 relocations.
1531 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1532 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1533 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1534 * incremental.h
1535 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1536 function.
1537 (Incremental_binary::apply_incremental_relocs): New function.
1538 (Incremental_binary::do_apply_incremental_relocs): New function.
1539 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1540 data member.
1541 (Sized_incremental_binary::add_global_symbol): New function.
1542 (Sized_incremental_binary::global_symbol): New function.
1543 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1544 (Sized_incremental_binary::symbol_map_): New data member.
1545 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1546 * target.h (Sized_target::apply_relocation): New function.
1547 * target-reloc.h (apply_relocation): New function.
1548 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1549
c87e4302
DK
15502011-04-22 Doug Kwan <dougkwan@google.com>
1551
1552 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1553 flag of a SHT_ARM_EXIDX section.
1554 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1555 * testsuite/Makefile.in: Regenerate.
1556 * testsuite/arm_exidx_test.s: New file.
1557 * testsuite/arm_exidx_test.sh: Same.
1558
e7782cf6
CC
15592011-04-20 Cary Coutant <ccoutant@google.com>
1560
1561 PR gold/12689
1562 * archive.h (Incremental_archive_entry::Archive_member):
1563 Initialize arg_serial_ (second constructor).
1564
308ecdc7
ILT
15652011-04-17 Ian Lance Taylor <iant@google.com>
1566
1567 * object.cc (Relocate_info::location): Simplify location string.
1568 * errors.cc (Errors::error_at_location): Don't print program
1569 name.
1570 (Errors::warning_at_location): Likewise.
1571 (Errors::undefined_symbol): Likewise.
1572 * testsuite/debug_msg.sh: Update accordingly.
1573
bec5b579
CC
15742011-04-14 Cary Coutant <ccoutant@google.com>
1575
1576 * gold/layout.cc (Layout::symtab_section_offset): New function.
1577 * gold/layout.h (Layout::symtab_section_offset): New function.
1578 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1579
88597d34
ILT
15802011-04-12 Ian Lance Taylor <iant@google.com>
1581
1582 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1583 with MREMAP_MAYMOVE.
1584 * output.h (class Output_file): Add map_is_allocated_ field.
1585 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1586 not available, provide stubs. If mremap is not available, #define
1587 it to gold_mremap.
1588 (MREMAP_MAYMOVE): Define if not defined.
1589 (Output_file::Output_file): Initialize map_is_allocated_.
1590 (Output_file::resize): Check map_is_allocated_.
1591 (Output_file::map_anonymous): If mmap fails, use malloc.
1592 (Output_file::unmap): Don't do anything for an anonymous map.
1593 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1594 is not available, provide stubs.
1595 (File_read::View::~View): Use free rather than delete[].
1596 (File_read::make_view): Use malloc rather than new[]. If mmap
1597 fails, use malloc.
1598 (File_read::find_or_make_view): Use malloc rather than new[].
1599 * gold.h: Remove HAVE_REMAP code.
1600 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1601 exists. Rename mremap to gold_mremap. If mmap is not available
1602 don't do anything.
1603 * configure, config.in: Rebuild.
1604
11e361bc
ILT
16052011-04-11 Ian Lance Taylor <iant@google.com>
1606
1607 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1608 initialize local variable v.
1609
cdc29364
CC
16102011-04-11 Cary Coutant <ccoutant@google.com>
1611
1612 * archive.cc (Archive::include_member): Adjust call to
1613 report_object.
1614 (Add_archive_symbols::run): Track argument serial numbers.
1615 (Lib_group::include_member): Likewise.
1616 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1617 * archive.h (Incremental_archive_entry::Archive_member):
1618 Initialize arg_serial_.
1619 (Archive_member::arg_serial_): New data member.
1620 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1621 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1622 incremental link.
1623 (Sized_dynobj::do_for_all_local_got_entries): New function.
1624 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1625 function.
1626 * fileread.cc (get_mtime): New function.
1627 * fileread.h (get_mtime): New function.
1628 * gold.cc (queue_initial_tasks): Check for incremental update.
1629 (process_incremental_input): New function.
1630 (queue_middle_tasks): Don't force valid target for incremental
1631 update.
1632 * incremental-dump.cc (find_input_containing_global): Adjust
1633 size of symbol info entry.
1634 (dump_incremental_inputs): Dump argument serial number and
1635 in_system_directory flag; bias shndx by 1; print symbol names
1636 when dumping per-file symbol lists; use new symbol info readers.
1637 * incremental.cc
1638 (Output_section_incremental_inputs:update_data_size): New function.
1639 (Sized_incremental_binary::setup_readers): Setup input readers
1640 for each input file; build maps for files added from libraries
1641 and scripts.
1642 (Sized_incremental_binary::check_input_args): New function.
1643 (Sized_incremental_binary::do_check_inputs): Build map of argument
1644 serial numbers to input arguments.
1645 (Sized_incremental_binary::do_file_has_changed): Rename
1646 do_file_is_unchanged to this; compare file modification times.
1647 (Sized_incremental_binary::do_init_layout): New function.
1648 (Sized_incremental_binary::do_reserve_layout): New function.
1649 (Sized_incremental_binary::do_get_input_reader): Remove.
1650 (Sized_incremental_binary::get_symtab_view): New function.
1651 (Incremental_checker::can_incrementally_link_output_file): Remove.
1652 (Incremental_inputs::report_command_line): Exclude --debug options.
1653 (Incremental_inputs::report_archive_begin): Add parameter; track
1654 argument serial numbers; don't put input file entry for archive
1655 before archive members.
1656 (Incremental_inputs::report_archive_end): Put input file entry
1657 for archive after archive members.
1658 (Incremental_inputs::report_object): Add parameter; track argument
1659 serial numbers and in_system_directory flag.
1660 (Incremental_inputs::report_script): Add parameter; track argument
1661 serial numbers.
1662 (Output_section_incremental_inputs::set_final_data_size): Adjust
1663 size of symbol info entry; check for forwarding symbols.
1664 (Output_section_incremental_inputs::write_input_files): Write
1665 in_system_directory flag and argument serial number.
1666 (Output_section_incremental_inputs::write_info_blocks): Map section
1667 indices between incremental info and original input file; store
1668 input section index for each symbol.
1669 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1670 change operator() to visit().
1671 (class Global_got_offset_visitor): Likewise.
1672 (class Global_symbol_visitor_got_plt):
1673 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1674 classes.
1675 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1676 (Sized_incr_relobj::do_read_symbols): New function.
1677 (Sized_incr_relobj::do_layout): New function.
1678 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1679 (Sized_incr_relobj::do_add_symbols): New function.
1680 (Sized_incr_relobj::do_should_include_member): New function.
1681 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1682 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1683 (Sized_incr_relobj::do_section_size): New function.
1684 (Sized_incr_relobj::do_section_name): New function.
1685 (Sized_incr_relobj::do_section_contents): New function.
1686 (Sized_incr_relobj::do_section_flags): New function.
1687 (Sized_incr_relobj::do_section_entsize): New function.
1688 (Sized_incr_relobj::do_section_address): New function.
1689 (Sized_incr_relobj::do_section_type): New function.
1690 (Sized_incr_relobj::do_section_link): New function.
1691 (Sized_incr_relobj::do_section_info): New function.
1692 (Sized_incr_relobj::do_section_addralign): New function.
1693 (Sized_incr_relobj::do_initialize_xindex): New function.
1694 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1695 (Sized_incr_relobj::do_read_relocs): New function.
1696 (Sized_incr_relobj::do_gc_process_relocs): New function.
1697 (Sized_incr_relobj::do_scan_relocs): New function.
1698 (Sized_incr_relobj::do_count_local_symbols): New function.
1699 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1700 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1701 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1702 (Sized_incr_relobj::do_relocate): New function.
1703 (Sized_incr_relobj::do_set_section_offset): New function.
1704 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1705 (Sized_incr_dynobj::do_read_symbols): New function.
1706 (Sized_incr_dynobj::do_layout): New function.
1707 (Sized_incr_dynobj::do_add_symbols): New function.
1708 (Sized_incr_dynobj::do_should_include_member): New function.
1709 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1710 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1711 (Sized_incr_dynobj::do_section_size): New function.
1712 (Sized_incr_dynobj::do_section_name): New function.
1713 (Sized_incr_dynobj::do_section_contents): New function.
1714 (Sized_incr_dynobj::do_section_flags): New function.
1715 (Sized_incr_dynobj::do_section_entsize): New function.
1716 (Sized_incr_dynobj::do_section_address): New function.
1717 (Sized_incr_dynobj::do_section_type): New function.
1718 (Sized_incr_dynobj::do_section_link): New function.
1719 (Sized_incr_dynobj::do_section_info): New function.
1720 (Sized_incr_dynobj::do_section_addralign): New function.
1721 (Sized_incr_dynobj::do_initialize_xindex): New function.
1722 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1723 (make_sized_incremental_object): New function.
1724 (Incremental_library::copy_unused_symbols): New function.
1725 (Incremental_library::do_for_all_unused_symbols): New function.
1726 * incremental.h (enum Incremental_input_flags): New type.
1727 (class Incremental_checker): Remove.
1728 (Incremental_input_entry::Incremental_input_entry): Add argument
1729 serial number.
1730 (Incremental_input_entry::arg_serial): New function.
1731 (Incremental_input_entry::set_is_in_system_directory): New function.
1732 (Incremental_input_entry::is_in_system_directory): New function.
1733 (Incremental_input_entry::arg_serial_): New data member.
1734 (Incremental_input_entry::is_in_system_directory_): New data member.
1735 (class Script_info): Move here from script.h.
1736 (Script_info::Script_info): Add filename parameter.
1737 (Script_info::filename): New function.
1738 (Script_info::filename_): New data member.
1739 (Incremental_script_entry::Incremental_script_entry): Add argument
1740 serial number.
1741 (Incremental_object_entry::Incremental_object_entry): Likewise.
1742 (Incremental_object_entry::add_input_section): Build list of input
1743 sections with map to original shndx.
1744 (Incremental_object_entry::get_input_section_index): New function.
1745 (Incremental_object_entry::shndx_): New data member.
1746 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1747 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1748 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1749 serial number.
1750 (Incremental_inputs::report_archive_begin): Likewise.
1751 (Incremental_inputs::report_object): Likewise.
1752 (Incremental_inputs::report_script): Likewise.
1753 (class Incremental_global_symbol_reader): New class.
1754 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1755 and store flags and input file type.
1756 (Incremental_input_entry_reader::arg_serial): New function.
1757 (Incremental_input_entry_reader::type): Extract type from flags.
1758 (Incremental_input_entry_reader::is_in_system_directory): New function.
1759 (Incremental_input_entry_reader::get_input_section_count): Call
1760 accessor function for type.
1761 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1762 function for type; adjust size of global symbol entry.
1763 (Incremental_input_entry_reader::get_global_symbol_count): Call
1764 accessor function for type.
1765 (Incremental_input_entry_reader::get_object_count): Likewise.
1766 (Incremental_input_entry_reader::get_object_offset): Likewise.
1767 (Incremental_input_entry_reader::get_member_count): Likewise.
1768 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1769 (Incremental_input_entry_reader::get_member_offset): Likewise.
1770 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1771 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1772 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1773 (Incremental_input_entry_reader::get_global_symbol_reader): New
1774 function.
1775 (Incremental_input_entry_reader::get_output_symbol_index): New
1776 function.
1777 (Incremental_input_entry_reader::type_): Remove.
1778 (Incremental_input_entry_reader::flags_): New data member.
1779 (Incremental_inputs_reader::input_file_offset): New function.
1780 (Incremental_inputs_reader::input_file_index): New function.
1781 (Incremental_inputs_reader::input_file): Call input_file_offset.
1782 (Incremental_inputs_reader::input_file_at_offset): New function.
1783 (Incremental_relocs_reader::get_r_type): Reformat.
1784 (Incremental_relocs_reader::get_r_shndx): Reformat.
1785 (Incremental_relocs_reader::get_r_offset): Reformat.
1786 (Incremental_relocs_reader::data): New function.
1787 (Incremental_binary::Incremental_binary): Initialize new data members.
1788 (Incremental_binary::check_inputs): Add cmdline parameter.
1789 (Incremental_binary::file_is_unchanged): Remove.
1790 (Input_reader::arg_serial): New function.
1791 (Input_reader::get_unused_symbol_count): New function.
1792 (Input_reader::get_unused_symbol): New function.
1793 (Input_reader::do_arg_serial): New function.
1794 (Input_reader::do_get_unused_symbol_count): New function.
1795 (Input_reader::do_get_unused_symbol): New function.
1796 (Incremental_binary::input_file_count): New function.
1797 (Incremental_binary::get_input_reader): Change signature to use
1798 index instead of filename.
1799 (Incremental_binary::file_has_changed): New function.
1800 (Incremental_binary::get_input_argument): New function.
1801 (Incremental_binary::get_library): New function.
1802 (Incremental_binary::get_script_info): New function.
1803 (Incremental_binary::init_layout): New function.
1804 (Incremental_binary::reserve_layout): New function.
1805 (Incremental_binary::output_file): New function.
1806 (Incremental_binary::do_check_inputs): New function.
1807 (Incremental_binary::do_file_is_unchanged): Remove.
1808 (Incremental_binary::do_file_has_changed): New function.
1809 (Incremental_binary::do_init_layout): New function.
1810 (Incremental_binary::do_reserve_layout): New function.
1811 (Incremental_binary::do_input_file_count): New function.
1812 (Incremental_binary::do_get_input_reader): Change signature.
1813 (Incremental_binary::input_args_map_): New data member.
1814 (Incremental_binary::library_map_): New data member.
1815 (Incremental_binary::script_map_): New data member.
1816 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1817 new data members.
1818 (Sized_incremental_binary::output_section): New function.
1819 (Sized_incremental_binary::inputs_reader): Add const.
1820 (Sized_incremental_binary::symtab_reader): Add const.
1821 (Sized_incremental_binary::relocs_reader): Add const.
1822 (Sized_incremental_binary::got_plt_reader): Add const.
1823 (Sized_incremental_binary::get_symtab_view): New function.
1824 (Sized_incremental_binary::Inputs_reader): New typedef.
1825 (Sized_incremental_binary::Input_entry_reader): New typedef.
1826 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1827 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1828 (Sized_incremental_binary::do_file_has_changed): New function.
1829 (Sized_incremental_binary::do_init_layout): New function.
1830 (Sized_incremental_binary::do_reserve_layout): New function.
1831 (Sized_input_reader::Inputs_reader): Remove.
1832 (Sized_input_reader::Input_entry_reader): Remove.
1833 (Sized_input_reader::do_arg_serial): New function.
1834 (Sized_input_reader::do_get_unused_symbol_count): New function.
1835 (Sized_input_reader::do_get_unused_symbol): New function.
1836 (Sized_incremental_binary::do_input_file_count): New function.
1837 (Sized_incremental_binary::do_get_input_reader): Change signature;
1838 use index instead of filename.
1839 (Sized_incremental_binary::section_map_): New data member.
1840 (Sized_incremental_binary::input_entry_readers_): New data member.
1841 (class Sized_incr_relobj): New class.
1842 (class Sized_incr_dynobj): New class.
1843 (make_sized_incremental_object): New function.
1844 (class Incremental_library): New class.
1845 * layout.cc (Free_list::num_lists): New static data member.
1846 (Free_list::num_nodes): New static data member.
1847 (Free_list::num_removes): New static data member.
1848 (Free_list::num_remove_visits): New static data member.
1849 (Free_list::num_allocates): New static data member.
1850 (Free_list::num_allocate_visits): New static data member.
1851 (Free_list::init): New function.
1852 (Free_list::remove): New function.
1853 (Free_list::allocate): New function.
1854 (Free_list::dump): New function.
1855 (Free_list::print_stats): New function.
1856 (Layout_task_runner::run): Resize output file for incremental updates.
1857 (Layout::Layout): Initialize new data members.
1858 (Layout::set_incremental_base): New function.
1859 (Layout::init_fixed_output_section): New function.
1860 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1861 incremental updates.
1862 (Layout::create_gold_note): Do not create gold note section for
1863 incremental updates.
1864 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1865 for incremental updates.
1866 (Layout::set_section_offsets): For incremental updates, allocate space
1867 from free list.
1868 (Layout::create_symtab_sections): Layout with offsets relative to
1869 start of section; for incremental updates, allocate space from free
1870 list.
1871 (Layout::create_shdrs): For incremental updates, allocate space from
1872 free list.
1873 (Layout::finish_dynamic_section): For incremental updates, do not
1874 check --as-needed (fixed in subsequent patch).
1875 * layout.h (class Free_list): New class.
1876 (Layout::set_incremental_base): New function.
1877 (Layout::incremental_base): New function.
1878 (Layout::init_fixed_output_section): New function.
1879 (Layout::allocate): New function.
1880 (Layout::incremental_base_): New data member.
1881 (Layout::free_list_): New data member.
1882 * main.cc (main): Print Free_list statistics.
1883 * object.cc (Relobj::finalize_incremental_relocs): Add
1884 clear_counts parameter; clear counts only when clear_counts is set.
1885 (Sized_relobj::Sized_relobj): Initialize new base class.
1886 (Sized_relobj::do_layout): Don't report special sections.
1887 (Sized_relobj::do_for_all_local_got_entries): New function.
1888 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1889 symtab_off to all symbol table offsets.
1890 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1891 * object.h (class Got_offset_list): Move to top of file.
1892 (Object::Object): Allow case where input_file == NULL.
1893 (Object::~Object): Likewise.
1894 (Object::input_file): Assert that input_file != NULL.
1895 (Object::lock): Allow case where input_file == NULL.
1896 (Object::unlock): Likewise.
1897 (Object::is_locked): Likewise.
1898 (Object::token): Likewise.
1899 (Object::release): Likewise.
1900 (Object::is_incremental): New function.
1901 (Object::get_mtime): New function.
1902 (Object::for_all_local_got_entries): New function.
1903 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1904 (Object::set_is_in_system_directory): New function.
1905 (Object::is_in_system_directory): New function.
1906 (Object::do_is_incremental): New function.
1907 (Object::do_get_mtime): New function.
1908 (Object::do_for_all_local_got_entries): New function.
1909 (Object::is_in_system_directory_): New data member.
1910 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1911 (class Sized_relobj_base): New class.
1912 (class Sized_relobj): Derive from Sized_relobj_base.
1913 (class Sized_relobj::Symbols): Redeclare from base class.
1914 (class Sized_relobj::local_got_offset_list): Remove.
1915 (class Sized_relobj::Output_sections): Redeclare from base class.
1916 (class Sized_relobj::do_for_all_local_got_entries): New function.
1917 (class Sized_relobj::write_local_symbols): Add offset parameter.
1918 (class Sized_relobj::local_symbol_offset_): Update comment.
1919 (class Sized_relobj::local_dynsym_offset_): Update comment.
1920 * options.cc (Input_arguments::add_file): Remove const.
1921 * options.h (Input_file_argument::Input_file_argument):
1922 Initialize arg_serial_ (all constructors).
1923 (Input_file_argument::set_arg_serial): New function.
1924 (Input_file_argument::arg_serial): New function.
1925 (Input_file_argument::arg_serial_): New data member.
1926 (Input_arguments::Input_arguments): Initialize file_count_.
1927 (Input_arguments::add_file): Remove const.
1928 (Input_arguments::number_of_input_files): New function.
1929 (Input_arguments::file_count_): New data member.
1930 (Command_line::number_of_input_files): Call
1931 Input_arguments::number_of_input_files.
1932 * output.cc (Output_segment_headers::Output_segment_headers):
1933 Set current size.
1934 (Output_section::Input_section::current_data_size): New function.
1935 (Output_section::Output_section): Initialize new data members.
1936 (Output_section::add_input_section): Don't do merge sections for
1937 an incremental link; allocate space from free list for an
1938 incremental update.
1939 (Output_section::add_output_section_data): Allocate space from
1940 free list for an incremental update.
1941 (Output_section::update_data_size): New function.
1942 (Output_section::set_fixed_layout): New function.
1943 (Output_section::reserve): New function.
1944 (Output_segment::set_section_addresses): Remove const.
1945 (Output_segment::set_section_list_addresses): Remove const; allocate
1946 space from free list for an incremental update.
1947 (Output_segment::set_offset): Adjust size of RELRO segment for an
1948 incremental update.
1949 * output.h (Output_data::current_data_size): Move here from
1950 child classes.
1951 (Output_data::pre_finalize_data_size): New function.
1952 (Output_data::update_data_size): New function.
1953 (Output_section_headers::update_data_size): new function.
1954 (Output_section_data_build::current_data_size): Move to Output_data.
1955 (Output_data_strtab::update_data_size): New function.
1956 (Output_section::current_data_size): Move to Output_data.
1957 (Output_section::set_fixed_layout): New function.
1958 (Output_section::has_fixed_layout): New function.
1959 (Output_section::reserve): New function.
1960 (Output_section::update_data_size): New function.
1961 (Output_section::has_fixed_layout_): New data member.
1962 (Output_section::free_list_): New data member.
1963 (Output_segment::set_section_addresses): Remove const.
1964 (Output_segment::set_section_list_addresses): Remove const.
1965 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1966 New function.
1967 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1968 New function.
1969 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1970 parameter when calling Add_symbols constructor; store argument
1971 serial number for members of a lib group.
1972 (Add_symbols::locks): Allow case where token == NULL.
1973 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1974 (Read_member::~Read_member): New function.
1975 (Read_member::is_runnable): New function.
1976 (Read_member::locks): New function.
1977 (Read_member::run): New function.
1978 (Check_script::~Check_script): New function.
1979 (Check_script::is_runnable): New function.
1980 (Check_script::locks): New function.
1981 (Check_script::run): New function.
1982 (Check_library::~Check_library): New function.
1983 (Check_library::is_runnable): New function.
1984 (Check_library::locks): New function.
1985 (Check_library::run): New function.
1986 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1987 (Add_symbols::library_): New data member.
1988 (class Read_member): New class.
1989 (class Check_script): New class.
1990 (class Check_library): New class.
1991 * reloc.cc (Read_relocs::is_runnable): Allow case where
1992 token == NULL.
1993 (Read_relocs::locks): Likewise.
1994 (Scan_relocs::locks): Likewise.
1995 (Relocate_task::locks): Likewise.
1996 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1997 to clear counters.
1998 (Sized_relobj::incremental_relocs_scan): Fix comment.
1999 (Sized_relobj::do_relocate): Pass output file offset to
2000 write_local_symbols.
2001 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2002 from class declaration.
2003 * script.cc (read_input_script): Allocate Script_info; pass
2004 argument serial number to report_script.
2005 * script.h (class Script_info): Move to incremental.h.
2006 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2007 * symtab.h (Symbol_table::add_from_incrobj): New function.
2008 (Symbol_table::set_file_offset): New function.
2009
b961d0d7
CC
20102011-04-05 Cary Coutant <ccoutant@google.com>
2011
2012 * incremental-dump.cc (dump_incremental_inputs): Change signature
2013 to take a Sized_incremental_binary; change caller. Use readers
2014 in Sized_incremental_binary.
2015 * incremental.cc
2016 (Sized_incremental_binary::find_incremental_inputs_sections):
2017 Rename do_find_incremental_inputs_sections to this.
2018 (Sized_incremental_binary::setup_readers): New function.
2019 (Sized_incremental_binary::do_check_inputs): Check
2020 has_incremental_info_ flag; move setup code to setup_readers;
2021 use input readers.
2022 (Sized_incremental_binary::do_file_is_unchanged): New function.
2023 (Sized_incremental_binary::do_get_input_reader): New function.
2024 * incremental.h (class Incremental_binary): Move to end of file.
2025 (Incremental_binary::file_is_unchanged): New function.
2026 (Incremental_binary::do_file_is_unchanged): New function.
2027 (Incremental_binary::Input_reader): New class.
2028 (Incremental_binary::get_input_reader): New function.
2029 (class Sized_incremental_binary): Move to end of file.
2030 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2031 input section reader classes.
2032 (Sized_incremental_binary::has_incremental_info): New function.
2033 (Sized_incremental_binary::inputs_reader): New function.
2034 (Sized_incremental_binary::symtab_reader): New function.
2035 (Sized_incremental_binary::relocs_reader): New function.
2036 (Sized_incremental_binary::got_plt_reader): New function.
2037 (Sized_incremental_binary::do_file_is_unchanged): New function.
2038 (Sized_incremental_binary::Sized_input_reader): New class.
2039 (Sized_incremental_binary::get_input_reader): New function.
2040 (Sized_incremental_binary::find_incremental_inputs_sections):
2041 Rename do_find_incremental_inputs_sections to this.
2042 (Sized_incremental_binary::setup_readers): New function.
2043 (Sized_incremental_binary::has_incremental_info_): New data member.
2044 (Sized_incremental_binary::inputs_reader_): New data member.
2045 (Sized_incremental_binary::symtab_reader_): New data member.
2046 (Sized_incremental_binary::relocs_reader_): New data member.
2047 (Sized_incremental_binary::got_plt_reader_): New data member.
2048 (Sized_incremental_binary::current_input_file_): New data member.
2049
a869183f
PP
20502011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2051
2052 PR gold/12640
2053 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2054 violation.
2055
20562011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2057
2058 * archive.cc (Archive::include_member): Adjust call to report_object.
2059 (Add_archive_symbols::run): Add script_info to call to
2060 report_archive_begin.
2061 (Lib_group::include_member): Adjust call to report_object.
2062 (Add_lib_group_symbols::run): Adjust call to report_object.
2063 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2064 blocks. Add object count for script input files.
2065 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2066 script_info parameter; change all callers.
2067 (Incremental_inputs::report_object): Add script_info parameter;
2068 change all callers.
2069 (Incremental_inputs::report_script): Store backpointer to
2070 incremental info entry.
2071 (Output_section_incremental_inputs::set_final_data_size): Record
2072 additional information for scripts.
2073 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2074 * incremental.h (Incremental_script_entry::add_object): New function.
2075 (Incremental_script_entry::get_object_count): New function.
2076 (Incremental_script_entry::get_object): New function.
2077 (Incremental_script_entry::objects_): New data member; adjust
2078 constructor.
2079 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2080 (Incremental_inputs::report_object): Add script_info parameter.
2081 (Incremental_inputs_reader::get_object_count): New function.
2082 (Incremental_inputs_reader::get_object_offset): New function.
2083 * options.cc (Input_arguments::add_file): Return reference to
2084 new input argument.
2085 * options.h (Input_argument::set_script_info): New function.
2086 (Input_argument::script_info): New function.
2087 (Input_argument::script_info_): New data member; adjust all
2088 constructors.
2089 (Input_file_group::add_file): Return reference to new input argument.
2090 (Input_file_lib::add_file): Likewise.
2091 (Input_arguments::add_file): Likewise.
2092 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2093 * script.cc (Parser_closure::Parser_closure): Add script_info
2094 parameter; adjust all callers.
2095 (Parser_closure::script_info): New function.
2096 (Parser_closure::script_info_): New data member.
2097 (read_input_script): Report scripts earlier to incremental info.
2098 (script_add_file): Set script_info in Input_argument.
2099 (script_add_library): Likewise.
2100 * script.h (Script_options::Script_info): Rewrite class.
2101
a869183f 21022011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2103
2104 * archive.cc (Library_base::should_include_member): Move
2105 method here from class Archive.
2106 (Archive::Archive): Initialize base class.
2107 (Archive::should_include_member): Move to base class.
2108 (Archive::do_for_all_unused_symbols): New function.
2109 (Add_archive_symbols::run): Remove redundant access to
2110 incremental_inputs.
2111 (Lib_group::Lib_group): Initialize base class.
2112 (Lib_group::do_filename): New function.
2113 (Lib_group::include_member): Pass pointer to Lib_group to
2114 report_object.
2115 (Lib_group::do_for_all_unused_symbols): New function.
2116 (Add_lib_group_symbols::run): Report archive information for
2117 incremental links.
2118 * archive.h (class Library_base): New base class.
2119 (class Archive): Derive from Library_base.
2120 (Archive::filename): Move to base class.
2121 (Archive::set_incremental_info): Likewise.
2122 (Archive::incremental_info): Likewise.
2123 (Archive::Should_include): Likewise.
2124 (Archive::should_include_member): Likewise.
2125 (Archive::Armap_entry): Remove.
2126 (Archive::Unused_symbol_iterator): Remove.
2127 (Archive::unused_symbols_begin): Remove.
2128 (Archive::unused_symbols_end): Remove.
2129 (Archive::do_filename): New function.
2130 (Archive::do_get_mtime): New function.
2131 (Archive::do_for_all_unused_symbols): New function.
2132 (Archive::task_): Move to base class.
2133 (Archive::incremental_info_): Likewise.
2134 (class Lib_group): Derive from Library_base.
2135 (Lib_group::do_filename): New function.
2136 (Lib_group::do_get_mtime): New function.
2137 (Lib_group::do_for_all_unused_symbols): New function.
2138 (Lib_group::task_): Move to base class.
2139 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2140 function.
2141 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2142 function.
2143 * incremental.cc (Incremental_inputs::report_archive_begin):
2144 Use Library_base; call library's get_mtime; add incremental inputs
2145 entry before members.
2146 (class Unused_symbol_visitor): New class.
2147 (Incremental_inputs::report_archive_end): Use Library_base; use
2148 visitor class to record unused symbols; don't add incremental inputs
2149 entry after members.
2150 (Incremental_inputs::report_object): Use Library_base.
2151 * incremental.h
2152 (Incremental_archive_entry::Incremental_archive_entry): Remove
2153 unused Archive parameter.
2154 (Incremental_inputs::report_archive_begin): Use Library_base.
2155 (Incremental_inputs::report_archive_end): Likewise.
2156 (Incremental_inputs::report_object): Likewise.
2157 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2158 function.
2159 * object.h (Object::for_all_global_symbols): New function.
2160 (Object::do_for_all_global_symbols): New function.
2161 (Sized_relobj::do_for_all_global_symbols): New function.
2162 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2163 function.
2164 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2165 function.
2166
61ab3e40
ILT
21672011-03-27 Ian Lance Taylor <iant@google.com>
2168
2169 * archive.cc (Archive::interpret_header): Return -1 if something
2170 goes wrong. Change callers accordingly.
2171
30e1f9e6
CC
21722011-03-25 Cary Coutant <ccoutant@google.com>
2173
2174 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2175 * testsuite/Makefile.in: Regenerate.
2176
9370ce59 21772011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2178
2179 * plugin.cc (get_view): New.
2180 (Plugin::load): Pass get_view to the plugin.
2181 (Plugin_manager::get_view): New.
2182
9312bb0a
ILT
21832011-03-21 Ian Lance Taylor <iant@google.com>
2184
2185 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2186 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2187
7e12ba9e
ST
21882011-03-21 Sriraman Tallam <tmsriram@google.com>
2189
2190 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2191 Change == to -eq.
2192 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2193 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2194 Change == to -eq.
2195 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2196 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2197
fd7a005d
ILT
21982011-03-14 Ian Lance Taylor <iant@google.com>
2199
2200 * script-sections.cc (Sort_output_sections::script_compare):
2201 Rename from is_before, change return type.
2202 (Sort_output_sections::operator()): Adjust accordingly.
2203
ed16fd1b
ILT
22042011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2205
2206 PR gold/12572
2207 * testsuite/odr_violation2.cc: Add comment to make all error line
2208 numbers double digits.
2209 * testsuite/debug_msg.sh: Adjust expected errors.
2210
71ff8986
ILT
22112011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2212
2213 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2214 but mark earlier ones as non-canonical
2215 (offset_to_iterator): Update search target and example
2216 (do_addr2line): Return extra lines in a vector*
2217 (format_file_lineno): Extract from do_addr2line
2218 (one_addr2line): Add vector* out-param
2219 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2220 when a lineno entry appeared last for its instruction
2221 (Dwarf_line_info): Add vector* out-param
2222 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2223 * symtab.cc (Odr_violation_compare): Include the lineno in the
2224 comparison again.
2225 (linenos_from_loc): New. Combine the canonical line for an
2226 address with its other lines.
2227 (True_if_intersect): New. Helper functor to make
2228 std::set_intersection a query.
2229 (detect_odr_violations): Compare sets of lines instead of just
2230 one line for each function. This became less deterministic, but
2231 has fewer false positives.
2232 * symtab.h: Declarations.
2233 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2234 mix an optimized and non-optimized object in the same binary
2235 (odr_violation2.so): Same.
2236 * testsuite/Makefile.in: Regenerate from Makefile.am.
2237 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2238 * testsuite/debug_msg.sh: Update line numbers and add
2239 assertions.
2240 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2241 non-optimized context.
2242 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2243 isn't inlined, and use OdrDerived in an optimized context.
2244 * testsuite/odr_header1.h: Defines OdrDerived, where
2245 optimization will change the
2246 first-instruction-in-the-destructor's file and line number.
2247 * testsuite/odr_header2.h: Defines OdrBase.
2248
a19fefdc
ILT
22492011-03-09 Ian Lance Taylor <iant@google.com>
2250
2251 * fileread.cc (File_read::clear_views): Don't delete the whole
2252 file view.
2253
ecb351e9
ILT
22542011-03-08 Ian Lance Taylor <iant@google.com>
2255
2256 PR gold/12525
2257 * fileread.cc: #include <climits>.
2258 (GOLD_IOV_MAX): Define.
2259 (File_read::read_multiple): Limit number of entries by iov_max.
2260 * fileread.h (class File_read): Always set max_readv_entries to
2261 128.
2262
b821d13c
ILT
22632011-03-07 Ian Lance Taylor <iant@google.com>
2264
2265 PR gold/12525
2266 * options.h (class General_options): Add -dy and -dn.
2267
89243142
CC
22682011-03-02 Cary Coutant <ccoutant@google.com>
2269
2270 * testsuite/script_test_9.t: Add TLS segment.
2271
d0773f31
ILT
22722011-03-02 Simon Baldwin <simonb@google.com>
2273
2274 * configure.ac: Add check for gnu_indirect_function support in
2275 the toolchain building binutils.
2276 * configure: Rebuild.
2277
9370ce59 22782011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
2279
2280 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2281 plugin only symbols.
2282 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2283 in plugin files as not needed in the symbol table.
2284
4cf7a849
ST
22852011-02-11 Sriraman Tallam <tmsriram@google.com>
2286
2287 * output.cc (Output_section::add_input_section): Delay fill
2288 generation for section ordering.
2289
b578bd7d
ILT
22902011-02-09 Ian Lance Taylor <iant@google.com>
2291
2292 PR gold/12316
2293 * object.h (class Sized_relobj): Remove clear_local_symbols.
2294 * reloc.cc (Sized_relobj::do_relocate): Don't call
2295 clear_local_symbols.
2296
9370ce59 22972011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
2298
2299 * plugin.cc (is_visible_from_outside): Return true for symbols
2300 in the -u option.
2301
55382fb7
ILT
23022011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2303
2304 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2305 filename.
2306
4e271fff
ST
23072011-02-02 Sriraman Tallam <tmsriram@google.com>
2308
2309 * icf.h (is_section_foldable_candidate): Change type of parameter
2310 to std::string.
2311 * icf.cc (Icf::find_identical_sections): Change type of local variable
2312 section_name to be std::string.
2313 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2314
d433c3ac
ILT
23152011-01-25 Ian Lance Taylor <iant@google.com>
2316
2317 * script.cc (script_add_extern): Rewrite to use
2318 add_symbol_reference.
2319
880473a6
DK
23202011-01-25 Doug Kwan <dougkwan@google.com>
2321
d433c3ac 2322 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2323
f30f86fa
ILT
23242011-01-24 Ian Lance Taylor <iant@google.com>
2325
2326 * options.h (class General_options): Accept
2327 --no-detect-odr-violations.
2328
8e51a0b9
ILT
23292011-01-24 Ian Lance Taylor <iant@google.com>
2330
2331 * version.cc (version_string): Bump to 1.11.
2332
0f3b89d8
ILT
23332011-01-24 Ian Lance Taylor <iant@google.com>
2334
2335 * plugin.cc (class Plugin_rescan): Define new class.
2336 (Plugin_manager::claim_file): Set any_claimed_.
2337 (Plugin_manager::save_archive): New function.
2338 (Plugin_manager::save_input_group): New function.
2339 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2340 necessary.
2341 (Plugin_manager::new_undefined_symbol): New function.
2342 (Plugin_manager::rescan): New function.
2343 (Plugin_manager::rescannable_defines): New function.
2344 (Plugin_manager::add_input_file): Set any_added_.
2345 * plugin.h (class Plugin_manager): define new fields rescannable_,
2346 undefined_symbols_, any_claimed_, and any_added_. Declare
2347 Plugin_rescan as friend. Declare new functions.
2348 (Plugin_manager::Rescannable): Define type.
2349 (Plugin_manager::Rescannable_list): Define type.
2350 (Plugin_manager::Undefined_symbol_list): Define type.
2351 (Plugin_manager::Plugin_manager): Initialize new fields.
2352 * archive.cc (Archive::defines_symbol): New function.
2353 (Add_archive_symbols::run): Pass archive to plugins if any.
2354 * archive.h (class Archive): Declare defines_symbol.
2355 * readsyms.cc (Input_group::~Input_group): New function.
2356 (Finish_group::run): Pass input_group to plugins if any.
2357 * readsyms.h (class Input_group): Declare destructor.
2358 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2359 any.
2360
3bb951e5
ILT
23612011-01-10 Ian Lance Taylor <iant@google.com>
2362
2363 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2364 section as relro.
2365 (Layout::set_segment_offsets): Reset increase_relro before calling
2366 set_section_addresses a second time.
2367
0aa45fac
CC
23682011-01-04 Cary Coutant <ccoutant@google.com>
2369
2370 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2371 sections before NOBITS sections.
2372
0db46eb4
L
23732011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2374
2375 * version.cc (print_version): Update copyright to 2011.
2376
829c9745
CC
23772010-12-23 Cary Coutant <ccoutant@google.com>
2378
2379 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2380 of OS to this->add. Add OD parameter to second form of the function.
2381
7500420b
ILT
23822010-12-20 Ian Lance Taylor <iant@google.com>
2383
2384 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2385 second of two consecutive entries with same offset.
2386
f8e9a930
RW
23872010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2388
2389 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2390 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2391 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2392 to avoid unneeded links against $(LDADD).
2393 * testsuite/Makefile.in: Regenerate.
2394
2fbb4320
ILT
23952010-12-15 Ian Lance Taylor <iant@google.com>
2396
2397 PR gold/12324
2398 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2399 for R_X86_64_32 and R_X86_64_PC32.
2400 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2401 ver_matching_def_pic.o.
2402 (ver_matching_def_pic.o): New target.
2403
fedb228d
RW
24042010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2405
2406 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2407 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2408 Move definition before File_read::View member definitions.
2409 (File_read::View::~View): Initialize and hold lock before
2410 updating current_mapped_bytes.
2411
9b547ce6
RW
24122010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2413
2414 * dwarf_reader.cc: Remove outdated comment.
2415 * gold-threads.cc: Fix typo in error message.
2416 * archive.cc: Fix typos in comments.
2417 * archive.h: Likewise.
2418 * arm-reloc-property.cc: Likewise.
2419 * arm-reloc-property.h: Likewise.
2420 * arm-reloc.def: Likewise.
2421 * arm.cc: Likewise.
2422 * attributes.h: Likewise.
2423 * cref.cc: Likewise.
2424 * ehframe.cc: Likewise.
2425 * fileread.h: Likewise.
2426 * gold.h: Likewise.
2427 * i386.cc: Likewise.
2428 * icf.cc: Likewise.
2429 * incremental.h: Likewise.
2430 * int_encoding.cc: Likewise.
2431 * layout.h: Likewise.
2432 * main.cc: Likewise.
2433 * merge.h: Likewise.
2434 * object.cc: Likewise.
2435 * object.h: Likewise.
2436 * options.cc: Likewise.
2437 * readsyms.cc: Likewise.
2438 * reduced_debug_output.cc: Likewise.
2439 * reloc.cc: Likewise.
2440 * script-sections.cc: Likewise.
2441 * sparc.cc: Likewise.
2442 * symtab.h: Likewise.
2443 * target-reloc.h: Likewise.
2444 * target.cc: Likewise.
2445 * target.h: Likewise.
2446 * timer.cc: Likewise.
2447 * timer.h: Likewise.
2448 * x86_64.cc: Likewise.
2449
83e17bd5
CC
24502010-12-09 Cary Coutant <ccoutant@google.com>
2451
2452 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2453 stack.
2454 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2455 parameter; change all callers.
2456 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2457 * options.h (warn_execstack): New option.
2458
017257f8
DK
24592010-12-07 Doug Kwan <dougkwan@google.com>
2460
2461 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2462 like function call relocations.
2463
c20cbc06
ILT
24642010-12-07 Ian Lance Taylor <iant@google.com>
2465
2466 * archive.cc (Archive::get_elf_object_for_member): Permit
2467 punconfigured to be NULL.
2468 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2469 (Archive::include_member): Pass NULL to get_elf_object_for_member
2470 if we searched for the archive and this is the first included
2471 object.
2472
4dbfafcc
ILT
24732010-12-01 Ian Lance Taylor <iant@google.com>
2474
2475 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2476 track_relocs_type_ field.
2477 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2478 Set track_relocs_type_.
2479 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2480 contents when using RELA relocs.
2481 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2482 reloc_map_.
2483 * reloc.cc (Track_relocs::next_addend): New function.
2484 * reloc.h (class Track_relocs): Declare next_addend.
2485
e5e19edd
ILT
24862010-12-01 Ian Lance Taylor <iant@google.com>
2487
2488 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2489 virtual destructor.
2490
9a5ce24c
ILT
24912010-12-01 Ian Lance Taylor <iant@google.com>
2492
2493 * README: Update compilers known to work and fail.
2494
c7791212
NC
24952010-11-23 Matthias Klose <doko@ubuntu.com>
2496
2497 * configure.in: For --enable-gold, handle value `default' instead of
2498 `both*'. Always install ld as ld.bfd, install as ld if gold is
2499 not the default.
2500 * configure: Regenerate.
2501
0ad220c9
DK
25022010-11-18 Doug Kwan <dougkwan@google.com>
2503
2504 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2505 and right_alignment to be zero. Store result alignment only if it is
2506 greater than existing alignment.
2507
ab8056e0
CC
25082010-11-16 Cary Coutant <ccoutant@google.com>
2509
2510 PR gold/12220
2511 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2512 Check for ".zdebug_line".
2513
fd064a5b
CC
25142010-11-16 Doug Kwan <dougkwan@google.com>
2515 Cary Coutant <ccoutant@google.com>
2516
2517 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2518 by reference; adjust all callers.
2519 * output.cc (Output_segment::set_section_addresses): Adjust references
2520 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2521 list is empty.
2522 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2523 end at page boundary.
2524
6fc6ea19
CC
25252010-11-16 Cary Coutant <ccoutant@google.com>
2526
2527 PR gold/12220
2528 * layout.cc (Layout::choose_output_section): Transform names of
2529 compressed sections even when using a script with a SECTIONS clause.
2530 (Layout::output_section_name): Remove code to transform
2531 compressed debug section names.
2532 * output.cc (Output_section::add_input_section): Use uncompressed
2533 section size when tracking input sections.
2534
95a2c8d6
RS
25352010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2536
2537 * symtab.h (Symbol::NON_PIC_REF): Remove.
2538 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2539 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2540 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2541 (Symbol::use_plt_offset): Take a flags argument and pass it
2542 directly to needs_dynamic_reloc. Restrict check for undefined
2543 weak symbols to function calls.
2544 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2545 (Target_arm::Scan::global): Use it.
2546 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2547 (Target_arm::Relocate::relocate): Likewise.
2548 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2549 parameter with an r_type parameter. Use get_reference_flags
2550 to get the flags.
2551 (Target_arm::Relocate::relocate): Update accordingly.
2552 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2553 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2554 (Target_i386::Scan::global): Likewise.
2555 (Target_i386::Relocate::relocate): Likewise.
2556 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2557 parameter with an r_type parameter. Use get_reference_flags
2558 to get the flags.
2559 (Target_i386::Relocate::relocate): Update accordingly.
2560 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2561 (Target_powerpc::Scan::global): Use it.
2562 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2563 (Target_powerpc::Relocate::relocate): Likewise.
2564 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2565 (Target_sparc::Scan::global): Use it.
2566 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2567 (Target_sparc::Relocate::relocate): Likewise.
2568 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2569 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2570 (Target_x86_64::Scan::global): Likewise.
2571 (Target_x86_64::Relocate::relocate): Likewise.
2572
f625ae50
DK
25732010-11-08 Doug Kwan <dougkwan@google.com>
2574 Cary Coutant <ccoutant@google.com>
2575
2576 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2577 (Arm_exidx_merge_section::section_contents_): New data member.
2578 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2579 (Arm_input_section::~Arm_input_section): De-allocate memory.
2580 (Arm_input_section::original_contents_): New data member.
2581 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2582 in parameters instead of calling Object::section_contents without
2583 locking.
2584 (Arm_output_section::group_section): New parameter TASK. Pass it
2585 to callees that need locking objects.
2586 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2587 to lock EXIDX input sections. Fix a formatting issue. Call
2588 Arm_exidx_merged_section::build_contents to create merged section
2589 contents.
2590 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2591 to lock object of stub table owner.
2592 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2593 TEXT_SIZE to initialize data member TEXT_SIZE_.
2594 (Arm_exidx_input_section::addralign): Fix typo in comment.
2595 (Arm_exidx_input_section::text_size): New method.
2596 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2597 that require locking objects. Lock objects before scanning for stubs
2598 and updating local symbols.
2599 (Arm_input_section<big_endian>::init): Copy contents of original
2600 input section.
2601 (Arm_input_section<big_endian>::do_write): Use saved contents of
2602 original input section instead of calling Object::section_contents
2603 without locking.
2604 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2605 size without calling Object::section_size().
2606 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2607 for size. Allocate a buffer for merged EXIDX entries.
2608 (Arm_exidx_merged_section::build_contents): New method.
2609 (Arm_exidx_merged_section::do_write): Move merge section contents
2610 building code to Arm_exidx_merged_section::build_contetns. Write
2611 out contetns in buffer instead of building it on the fly.
2612 (Arm_relobj::make_exidx_input_section): Also pass text section size
2613 to Arm_exidx_input_section constructor.
2614 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2615 (Arm_dynobj::do_read_symbols): Fix memory leak.
2616 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2617 * target.h: (class Task): Add forward declaration.
2618 (Target::relax): Add new parameter TASK and pass it to
2619 Target::do_relax().
2620 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2621
5f9bcf58
CC
26222010-11-05 Cary Coutant <ccoutant@google.com>
2623
2624 PR gold/10708
2625 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2626 object when reading from the file.
2627 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2628 second layout pass.
2629 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2630 when reading section contents.
2631 (get_section_contents): Likewise.
2632 (icf::find_identical_sections): Likewise.
2633 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2634 object when reading from the file.
2635 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2636 the object when doing deferred section layout.
2637
e597fa08
NC
26382010-11-03 Nick Clifton <nickc@redhat.com>
2639
2640 PR gold/12001
2641 * script.h (class Symbol_assignment: name): New member. Returns
2642 the name of the symbol.
2643 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2644 Returns true if the given symbol name is on the list of
2645 assignments wating to be processed.
2646 * archive.cc (should_incldue_member): If the symbol is undefined,
2647 check to see if it is on the list of symbols pending assignment.
2648
3f9a3278
ILT
26492010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2650
2651 * script-sections.cc (Script_sections::find_memory_region): Check
2652 for a NULL output section pointer.
2653
d06fb4d1
DK
26542010-10-29 Doug Kwan <dougkwan@google.com>
2655
2656 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2657 Output_section::add_relaxed_input_section.
2658 * output.cc (Output_section::add_relaxed_input_section): Add new
2659 arguments LAYOUT and NAME. Set section order index.
2660 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2661 Copy section order index.
2662 * output.h (Output_section::add_relaxed_input_section): Add new
2663 arguments LAYOUT and NAME.
2664
90e24de5
ILT
26652010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2666
2667 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2668 NATIVE_OR_CROSS_LINKER.
2669 * testsuite/Makefile.in: Regenerate.
2670
c9484ea5
DK
26712010-10-20 Doug Kwan <dougkwan@google.com>
2672
2673 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2674 without SHF_LINK_ORDER flags.
2675 * layout.cc (Layout::choose_output_section): Do not filter
2676 SHF_LINK_ORDER flag in a relocatable link.
2677
5bc2f5be
CC
26782010-10-17 Cary Coutant <ccoutant@google.com>
2679
2680 * output.h (Output_segment::set_section_addresses): Change function
2681 signature. Update all callers.
2682 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2683 sections.
2684 (Output_segment::set_section_addresses): Align after last TLS
2685 section. Add padding before last relro section instead of after.
2686
0c91cf04
DK
26872010-10-17 Doug Kwan <dougkwan@google.com>
2688
2689 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2690 GOT output section to be writable.
2691
8c21d9d3
CC
26922010-10-14 Cary Coutant <ccoutant@google.com>
2693
2694 * debug.h (DEBUG_INCREMENTAL): New flag.
2695 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2696 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2697 mode.
2698 * incremental.cc (report_command_line): Ignore all forms of
2699 --incremental.
2700 * layout.cc (Layout::Layout): Check parameters for incremental link
2701 mode.
2702 * options.cc (General_options::parse_incremental): New function.
2703 (General_options::parse_no_incremental): New function.
2704 (General_options::parse_incremental_full): New function.
2705 (General_options::parse_incremental_update): New function.
2706 (General_options::incremental_mode_): New data member.
2707 (General_options::finalize): Check incremental_mode_.
2708 * options.h (General_options): Update help text for --incremental.
2709 Add --no-incremental, --incremental-full, --incremental-update.
2710 (General_options::Incremental_mode): New enum type.
2711 (General_options::incremental_mode): New function.
2712 (General_options::incremental_mode_): New data member.
2713 * parameters.cc (Parameters::incremental_mode_): New data member.
2714 (Parameters::set_options): Set incremental_mode_.
2715 (Parameters::set_incremental_full): New function.
2716 (Parameters::incremental): New function.
2717 (Parameters::incremental_update): New function.
2718 (set_parameters_incremental_full): New function.
2719 * parameters.h (Parameters::set_incremental_full): New function.
2720 (Parameters::incremental): New function.
2721 (Parameters::incremental_update): New function.
2722 (Parameters::incremental_mode_): New data member.
2723 (set_parameters_incremental_full): New function.
2724 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2725 incremental link mode.
2726 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2727 (Sized_relobj::do_relocate_sections): Likewise.
2728 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2729 option.
2730 * testsuite/Makefile.in: Regenerate.
2731 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2732
bb32aa18 27332010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2734
2735 * script-sections.h (class Script_sections): Make
2736 Sections_elements typedef public.
2737 * script-sections.cc (class Sort_output_sections): Add elements_
2738 field. Add constructor which sets it; change all callers.
2739 (Sort_output_sections::is_before): New function.
2740 (Sort_output_sections::operator()): Call is_before.
2741 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2742 conditional.
2743 * testsuite/script_test_10.sh: New test. Test script section
2744 order.
2745 * testsuite/script_test_10.t: Likewise.
2746 * testsuite/script_test_10.s: Likewise.
2747 * testsuite/Makefile.am: Wrap the cross linker tests and the
2748 common tests into NATIVE_OR_CROSS_LINKER.
2749 (check_SCRIPTS): Add script_test_10.sh.
2750 (check_DATA): Add script_test_10.stdout.
2751 (script_test_10.o, script_test_10): New targets.
2752 (script_test_10.stdout): New target.
2753 * configure, testsuite/Makefile.in: Regenerate.
2754
3cef7179
ILT
27552010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2756
2757 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2758 error for the deprecated relocations.
2759 (Target_arm::Scan::global): Likewise.
2760 (Target_arm::Relocate::relocate): Likewise.
2761
7411e9a8
RS
27622010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2763
2764 * fileread.cc (Input_file::find_file): Initialize *found_name
2765 and *namep when using the fallback search for case 4.
2766
6a9da32a
CC
27672010-10-11 Cary Coutant <ccoutant@google.com>
2768
2769 * options.h (class General_options): Redefine -z lazy as an alias for
2770 the negation of -z now.
2771
ac897c20
ILT
27722010-10-11 Ian Lance Taylor <iant@google.com>
2773
2774 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2775 binding.
2776
ea5cae92
NC
27772010-10-06 Nick Clifton <nickc@redhat.com>
2778
2779 * script-sections.cc(class Memory_region): Remove
2780 current_lma_offset_ field. Rename current_vma_offset_ to
2781 current_offset_. Add last_section_ field.
2782 (Memory_region::get_current_vma_address): Rename to
2783 get_current_address.
2784 (Memory_region::get_current_lma_address): Delete.
2785 (Memory_region::increment_vma_offset): Rename to
2786 increment_offset.
2787 (Memory_region::increment_lma_offset): Delete.
2788 (Memory_region::attributes_compatible): New method. Returns
2789 true if the provided section is compatible with the region.
2790 (Memory_region::get_last_section): New method. Returns the last
2791 section to use the region.
2792 (Memory_region::set_last_section): New method. Stores the last
2793 section to use the region.
2794 (Script_sections::block_in_region): New method. Returns true if
2795 a block of memory is contained within a region.
2796 (Script_sections::find_memory_region): New method. Locates a
2797 memory region to be used to set a VMA or LMA address.
2798 (Output_section_definition::set_section_addresses): Add code to
2799 check for addresses set by memory regions.
2800 (Output_segment::set_section_addresses): Remove memory region
2801 walking code.
2802 (Script_sections::create_segment): Add a warning if a header
2803 segment is created outside of any region.
2804 * script-sections.h (class Script_sections): Add prototypes for
2805 find_memory_region and block_in_region methods.
2806 * testsuite/memory_test.s: Use .long instead of .word.
2807 * testsuite/memory_test.t: Add some more output sections.
2808 * testsuite/memory_test.sh: Update expected output.
2809
a9bfd952
DK
28102010-10-02 Doug Kwan <dougkwan@google.com>
2811
2812 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2813 defintion to symtab.h
2814 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2815 declaration to defintion.
2816
bacff3ab
NC
28172010-10-01 Nick Clifton <nickc@redhat.com>
2818
2819 * expression.cc (eval): Replace dummy argument with NULL.
2820 (eval_maybe_dot): Check for a NULL result section pointer.
2821 (Symbol_expression::value): Likewise.
2822 (Dot_expression::value): Likewise.
2823 (BINARY_EXPRESSION): Likewise.
2824 (Max_expression::value): Likewise.
2825 (Min_expression::value): Likewise.
2826 (Absolute_expression::value): Likewise.
2827 (Addr_expression::value_from_output_section): Likewise.
2828 (Loaddddr_expression::value_from_output_section): Likewise.
2829 (Segment_start_expression::value): Likewise.
2830 * script-sections.cc
2831 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2832 argument with NULL.
2833 (Sections_elememt_dot_assignment::set_section_addresses):
2834 Likewise.
2835 (Output_data_expression::do_write_to_buffer): Likewise.
2836 (Output_section_definition::finalize_symbols): Likewise.
2837 (Output_section_definition::set_section_addresses): Likewise.
2838
f81bc8b5
DK
28392010-09-30 Doug Kwan <dougkwan@google.com>
2840
2841 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2842
c95e9f27
ST
28432010-09-28 Sriraman Tallam <tmsriram@google.com>
2844
2845 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2846 function.
c95e9f27
ST
2847 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2848 virtual function.
2849 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2850 virtual function.
2851 * icf.cc (get_section_contents): Inline merge sections only when
2852 target allows it.
2853
3cac54d2
RW
28542010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2855
2856 * configure: Regenerate.
2857
2904037a
ILT
28582010-09-17 Ian Lance Taylor <iant@google.com>
2859
2860 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2861 * testsuite/Makefile.am (memory_test.o): New target.
2862 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2863 memory_test.t.
2864 * testsuite/Makefile.in: Rebuild.
2904037a 2865
bca7fb63
DK
28662010-09-17 Doug Kwan <dougkwan@google.com>
2867
2868 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2869 defintion if relocation uses GOT entries of the symbol.
2870 * testsuite/icf_safe_test.sh: Fix test.
2871 * testsuite/icf_safe_so_test.sh: Fix test.
2872
4ef28648
CC
28732010-09-16 Cary Coutant <ccoutant@google.com>
2874
2875 * script_sections.cc (class Memory_region): Remove "NULL" from
2876 vector initializations.
2877
793990de
CC
28782010-09-15 Cary Coutant <ccoutant@google.com>
2879
2880 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2881 Resolve forwarding symbols.
2882
81e015e2
DK
28832010-09-15 Doug Kwan <dougkwan@google.com>
2884
2885 * gold/testsuite/script_test_3.t: Add ARM special sections.
2886 * gold/testsuite/script_test_4.t: Same.
2887 * gold/testsuite/script_test_5.t: Same.
2888 * gold/testsuite/script_test_6.t: Same.
2889 * gold/testsuite/script_test_7.t: Same.
2890 * gold/testsuite/script_test_7.t: Same.
2891 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2892
36171d64
CC
28932010-09-14 Cary Coutant <ccoutant@google.com>
2894
2895 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2896 (Target_x86_64::Relocate::relocate_tls): Replace check for
2897 saw_tls_block_reloc_ with test for executable section.
2898
d89051bd
CC
28992010-09-12 Cary Coutant <ccoutant@google.com>
2900
2901 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2902 position-independent executables to shared libraries need dynamic
2903 relocations.
2904 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2905 position-independent executables.
2906 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2907 * testsuite/Makefile.in: Regenerate.
2908
fca41f0f
NC
29092010-09-10 Nick Clifton <nickc@redhat.com>
2910
2911 PR gold/11997
2912 * testsuite/memory_test.t: Discard any sections that are not
2913 needed.
2914
6695e4b3
L
29152010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2916
2917 PR gold/11996
2918 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2919 "This::" to work around a bug in gcc 4.2.
2920
2921 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2922
0f72bf6f
RÁE
29232010-09-09 Rafael Espindola <espindola@google.com>
2924
2925 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2926 sections with different PF_X flags in the same segment.
2927 (Layout::find_first_load_seg): Search all segments to find the first
2928 one.
2929 * options.h (rosegment): New.
2930
29312010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2932
05a79166 2933 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2934
aa98ff75
DK
29352010-09-08 Doug Kwan <dougkwan@google.com>
2936
2937 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2938 (Arm_relobj::do_relocate_sections): Add new parameter for output
2939 file to match the parent.
2940 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2941 of local symbols instead of input values. Update code to track
2942 changes in gold::relocate_section.
2943 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2944 (Sized_relobj::compute_final_local_value_internal): New methods.
2945 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2946 body into private version of Sized_relobj::compute_final_local_value.
2947 Call the inline method.
2948 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2949 merged symbol value if there is one.
2950 (Symbol_value::has_output_value): New method defintiion.
2951 (Sized_relobj::Compute_final_local_value_status): New enum type.
2952 (Sized_relobj::compute_final_local_value): New methods.
2953 (Sized_relobj::compute_final_local_value_internal): New methods.
2954 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2955 and arm_cortex_a8.sh.
2956 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2957 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2958 New tests.
2959 * Makefile.in: Regenerate.
2960 * testsuite/arm_bl_out_of_range.s: Update test.
2961 * testsuite/thumb_bl_out_of_range.s: Ditto.
2962 * testsuite/thumb_blx_out_of_range.s: Ditto.
2963 * testsuite/arm_branch_out_of_range.sh: New file.
2964 * testsuite/arm_cortex_a8.sh: Ditto.
2965 * testsuite/arm_cortex_a8_b.s: Ditto.
2966 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2967 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2968 * testsuite/arm_cortex_a8_bl.s: Ditto.
2969 * testsuite/arm_cortex_a8_blx.s: Ditto.
2970 * testsuite/arm_cortex_a8_local.s: Ditto.
2971 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2972 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2973
05a79166
L
29742010-09-08 Rafael Espindola <espindola@google.com>
2975
2976 * Makefile.am (memory_test.stdout): Run readelf with -W.
2977 * Makefile.in: Regenerate.
2978 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2979 64 bit output.
2980
33dbc701
RÁE
29812010-09-08 Rafael Espindola <espindola@google.com>
2982
2983 * script-sections.cc (Script_sections::add_memory_region): Convert
2984 field precision to int.
2985 * script.cc (script_set_section_region, script_set_section_region):
2986 Convert field precision to int.
2987
731ca54a
RÁE
29882010-09-08 Rafael Espindola <espindola@google.com>
2989
2990 * arm.cc (do_finalize_sections): Create the __exidx_start and
2991 __exdix_end symbols even when the section is missing.
2992
7f8cd844
NC
29932010-09-08 Nick Clifton <nickc@redhat.com>
2994
2995 * README: Remove claim that MEMORY is not supported.
2996 * expression.cc (script_exp_function_origin)
2997 (script_exp_function_length): Move from here to ...
2998 * script.cc: ... here.
2999 (script_set_section_region, script_add_memory)
3000 (script_parse_memory_attr, script_include_directive): New
3001 functions.
3002 * script-sections.cc
3003 (class Memory_region): New class.
3004 (class Output_section_definition): Add set_memory_region,
3005 set_section_vma, set_section_lma and get_section_name methods.
3006 (class Script_Sections): Add add_memory_region,
3007 find_memory_region, find_memory_region_origin,
3008 find_memory_region_length and set_memory_region methods.
3009 Have set_section_addresses method walk the list of set memory
3010 regions.
3011 Extend the print methos to display memory regions.
3012 * script-sections.h: Add prototypes for new methods.
3013 Add enum for MEMORY region attributes.
3014 * yyscript.y: Add support for parsing MEMORY regions.
3015 * script-c.h: Add prototypes for new functions.
3016 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3017 * testsuite/Makefile.in: Regenerate.
3018 * testsuite/memory_test.sh: New script.
3019 * testsuite/memory_test.s: New assembler source file.
3020 * testsuite/memory_test.t: New linker script.
3021
a4649286
DK
30222010-08-27 Doug Kwan <dougkwan@google.com>
3023
3024 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3025 reference override an existing dynamic weak reference.
3026 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3027 * testsuite/Makefile.in: Regenerate.
3028 * testsuite/dyn_weak_ref.sh: New file.
3029 * testsuite/dyn_weak_ref_1.c: Ditto.
3030 * testsuite/dyn_weak_ref_2.c: Ditto.
3031
b56648ad
ILT
30322010-08-27 Ian Lance Taylor <iant@google.com>
3033
3034 * incremental.h (class Incremental_input_entry): Add virtual
3035 destructor.
3036
809313cb
ILT
30372010-08-27 Ian Lance Taylor <iant@google.com>
3038
3039 * testsuite/start_lib_test_3.c: Mark t3 as used.
3040
11e32464
NC
30412010-08-27 Nick Clifton <nickc@redhat.com>
3042
3043 * options.cc (version_script): Fix small typo in previous
3044 whitespace tidyup.
3045
ca09d69a
NC
30462010-08-25 Nick Clifton <nickc@redhat.com>
3047
3048 * archive.cc: Formatting fixes: Remove whitespace between
3049 typename and following asterisk. Remove whitespace between
3050 function name and opening parenthesis.
3051 * archive.h: Likewise.
3052 * arm.cc: Likewise.
3053 * attributes.cc: Likewise.
3054 * attributes.h: Likewise.
3055 * common.cc: Likewise.
3056 * copy-relocs.cc: Likewise.
3057 * dirsearch.h: Likewise.
3058 * dynobj.cc: Likewise.
3059 * ehframe.cc: Likewise.
3060 * ehframe.h: Likewise.
3061 * expression.cc: Likewise.
3062 * fileread.cc: Likewise.
3063 * fileread.h: Likewise.
3064 * gc.h: Likewise.
3065 * gold-threads.cc: Likewise.
3066 * gold.cc: Likewise.
3067 * i386.cc: Likewise.
3068 * icf.h: Likewise.
3069 * incremental-dump.cc: Likewise.
3070 * incremental.cc: Likewise.
3071 * layout.cc: Likewise.
3072 * layout.h: Likewise.
3073 * main.cc: Likewise.
3074 * merge.cc: Likewise.
3075 * merge.h: Likewise.
3076 * object.cc: Likewise.
3077 * object.h: Likewise.
3078 * options.cc: Likewise.
3079 * options.h: Likewise.
3080 * output.cc: Likewise.
3081 * output.h: Likewise.
3082 * plugin.cc: Likewise.
3083 * plugin.h: Likewise.
3084 * powerpc.cc: Likewise.
3085 * reloc.cc: Likewise.
3086 * script-c.h: Likewise.
3087 * script-sections.cc: Likewise.
3088 * script.cc: Likewise.
3089 * stringpool.cc: Likewise.
3090 * symtab.cc: Likewise.
3091 * symtab.h: Likewise.
3092 * target.cc: Likewise.
3093 * timer.cc: Likewise.
3094 * timer.h: Likewise.
3095 * version.cc: Likewise.
3096 * x86_64.cc: Likewise.
3097
b8fa8750
NC
30982010-08-24 Nick Clifton <nickc@redhat.com>
3099
3100 PR 11899
3101 * layout.cc (segment_precedes): Sort segments by their physical
3102 addresses, if they have been set.
3103
9919d93b
CC
31042010-08-23 Cary Coutant <ccoutant@google.com>
3105
3106 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3107 symbols data.
3108 (Lib_group::include_member): Unlock object after deleting its
3109 symbols data.
3110 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3111 the bug fixed here.
3112
97b4be1c
CC
31132010-08-19 Neil Vachharajani <nvachhar@google.com>
3114 Cary Coutant <ccoutant@google.com>
3115
3116 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3117 constructor, and set_blocker.
3118 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3119 readsyms_blocker_.
3120 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3121 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3122 * testsuite/Makefile.am (start_lib_test): New test case.
3123 * testsuite/Makefile.in: Regenerate.
3124 * testsuite/start_lib_test_main.c: New file.
3125 * testsuite/start_lib_test_1.c: New file.
3126 * testsuite/start_lib_test_2.c: New file.
3127 * testsuite/start_lib_test_3.c: New file.
3128
dd0b1884
ILT
31292010-08-19 Ian Lance Taylor <iant@google.com>
3130
3131 * Makefile.in: Rebuild with automake 1.11.1.
3132 * aclocal.m4: Likewise.
3133 * testsuite/Makefile.in: Likewise.
3134
7223e9ca
ILT
31352010-08-19 Ian Lance Taylor <iant@google.com>
3136
3137 PR 10893
3138 * i386.cc (class Output_data_plt_i386): Update declarations.
3139 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3140 local_ifuncs_ fields.
3141 (Target_i386::do_plt_section_for_global): New function.
3142 (Target_i386::do_plt_section_for_local): New function.
3143 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3144 parameter; change all callers. Initialize global_ifuncs_ and
3145 local_ifuncs_. If doing a static link define __rel_iplt_start and
3146 __rel_iplt_end.
3147 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3148 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3149 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3150 symbols.
3151 (Target_i386::make_plt_section): New function, broken out of
3152 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3153 (Target_i386::make_plt_entry): Call make_plt_section.
3154 (Target_i386::make_local_ifunc_plt_entry): New function.
3155 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3156 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3157 R_386_IRELATIVE to switch.
3158 (Target_i386::Scan::global): Likewise.
3159 (Target_i386::Relocate::relocate): Likewise.
3160 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3161 switch.
3162 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3163 (Target_x86_64::do_plt_section_for_global): New function.
3164 (Target_x86_64::do_plt_section_for_local): New function.
3165 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3166 parameter; change all callers. If doing a static link define
3167 __rela_iplt_start and __rela_iplt_end.
3168 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3169 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3170 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3171 to point to .plt.
3172 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3173 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3174 switch.
3175 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3176 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3177 R_X86_64_IRELATIVE to switch.
3178 (Target_x86_64::Scan::global): Likewise.
3179 (Target_x86_64::Relocate::relocate): Likewise.
3180 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3181 switch.
3182 * target.h (class Target): Add plt_section_for_global and
3183 plt_section_for_local functions. Add do_plt_section_for_global
3184 and do_plt_section_for_local virtual functions.
3185 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3186 clarifying comments.
3187 (Symbol::use_plt_offset): Handle IFUNC symbol.
3188 * object.cc (Sized_relobj::Sized_relobj): Initialize
3189 local_plt_offsets_.
3190 (Sized_relobj::local_has_plt_offset): New function.
3191 (Sized_relobj::local_plt_offset): New function.
3192 (Sized_relobj::set_local_plt_offset): New function.
3193 (Sized_relobj::do_count): Handle IFUNC symbol.
3194 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3195 a bit away from input_shndx_ field. Add set_is_func_symbol and
3196 is_ifunc_symbol functions.
3197 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3198 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3199 local_plt_offsets_ field.
3200 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3201 * output.h (class Output_section_data): Add non-const
3202 output_section function.
3203 (class Output_data_got): Update declarations.
3204 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3205 Add use_plt_offset parameter to global and local constructors.
3206 Change all callers. Change local_sym_index_ field to 31 bits.
3207 Change GSYM_CODE and CONSTANT_CODE accordingly.
3208 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3209 doing a static link don't set sh_link field.
3210 (Output_data_got::Got_entry::write): Use PLT offset if
3211 appropriate.
3212 (Output_data_got::add_global_plt): New function.
3213 (Output_data_got::add_local_plt): New function.
3214 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3215 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3216 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3217 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3218 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3219 IFUNC conditional.
3220 * testsuite/ifunc-sel.h: New file.
3221 * testsuite/ifuncmain1.c: New file.
3222 * testsuite/ifuncmain1vis.c: New file.
3223 * testsuite/ifuncmod1.c: New file.
3224 * testsuite/ifuncdep2.c: New file.
3225 * testsuite/ifuncmain2.c: New file.
3226 * testsuite/ifuncmain3.c: New file.
3227 * testsuite/ifuncmod3.c: New file.
3228 * testsuite/ifuncmain4.c: New file.
3229 * testsuite/ifuncmain5.c: New file.
3230 * testsuite/ifuncmod5.c: New file.
3231 * testsuite/ifuncmain6pie.c: New file.
3232 * testsuite/ifuncmod6.c: New file.
3233 * testsuite/ifuncmain7.c: New file.
3234 * configure, testsuite/Makefile.in: Rebuild.
3235
56f75c03
ILT
32362010-08-18 Ian Lance Taylor <iant@google.com>
3237
3238 * incremental.cc
3239 (Output_section_incremental_inputs::write_input_files): Add cast
3240 to avoid signed/unsigned comparison warning.
3241 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3242
55455f89
CC
32432010-08-12 Cary Coutant <ccoutant@google.com>
3244
3245 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3246
e2054bcb
ILT
32472010-08-13 Ian Lance Taylor <iant@google.com>
3248
3249 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3250
74f67560
DK
32512010-08-12 Cary Coutant <ccoutant@google.com>
3252 Doug Kwan <dougkwan@google.com>
3253
3254 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3255 defintion overrides non-weak undef, remember that the original undef
3256 is not weak.
3257 * symtab.cc (Symbol_table::sized_write_global): For undef without
3258 an original weak binding, set binding to global in output.
3259 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3260 * testsuite/Makefile.in: Regenerate.
3261 * testsuite/strong_ref_weak_def.sh: New file.
3262 * testsuite/strong_ref_weak_def_1.c: Ditto.
3263 * testsuite/strong_ref_weak_def_2.c: Ditto.
3264
d1238d12
CC
32652010-08-12 Cary Coutant <ccoutant@google.com>
3266
3267 * testsuite/incremental_test.sh: Rewrite.
3268 * testsuite/incremental_test_1.c: Rewrite.
3269 * testsuite/incremental_test_2.c: Rewrite.
3270
0e70b911
CC
32712010-08-12 Cary Coutant <ccoutant@google.com>
3272
3273 * arm.cc (Target_arm::got_size): Add const.
3274 (Target_arm::got_entry_count): New function.
3275 (Target_arm::plt_entry_count): New function.
3276 (Target_arm::first_plt_entry_offset): New function.
3277 (Target_arm::plt_entry_size): New function.
3278 (Output_data_plt_arm::entry_count): New function.
3279 (Output_data_plt_arm::first_plt_entry_offset): New function.
3280 (Output_data_plt_arm::get_plt_entry_size): New function.
3281 * i386.cc (Target_i386::got_size): Add const.
3282 (Target_i386::got_entry_count): New function.
3283 (Target_i386::plt_entry_count): New function.
3284 (Target_i386::first_plt_entry_offset): New function.
3285 (Target_i386::plt_entry_size): New function.
3286 (Output_data_plt_i386::entry_count): New function.
3287 (Output_data_plt_i386::first_plt_entry_offset): New function.
3288 (Output_data_plt_i386::get_plt_entry_size): New function.
3289 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3290 find_incremental_inputs_sections. Dump incremental_got_plt section.
3291 * incremental.cc: Include target.h.
3292 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3293 parameter. Adjust all callers. Find incremental_got_plt section.
3294 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3295 section.
3296 (Output_section_incremental_inputs::set_final_data_size): Calculate
3297 size of incremental_got_plt section.
3298 (Output_section_incremental_inputs::do_write): Write the
3299 incremental_got_plt section.
3300 (Got_plt_view_info): New struct.
3301 (Local_got_offset_visitor): New class.
3302 (Global_got_offset_visitor): New class.
3303 (Global_symbol_visitor_got_plt): New class.
3304 (Output_section_incremental_inputs::write_got_plt): New function.
3305 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3306 Add parameter. Adjust all callers.
3307 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3308 (Incremental_inputs::got_plt_section): New function.
3309 (Incremental_inputs::got_plt_section_): New data member.
3310 (Incremental_got_plt_reader): New class.
3311 * layout.cc (Layout::create_incremental_info_sections): Add the
3312 incremental_got_plt section.
3313 * object.h (Got_offset_list::get_list): New function.
3314 (Got offset_list::for_all_got_offsets): New function.
3315 (Sized_relobj::local_got_offset_list): New function.
3316 * powerpc.cc (Target_powerpc::got_size): Add const.
3317 (Target_powerpc::got_entry_count): New function.
3318 (Target_powerpc::plt_entry_count): New function.
3319 (Target_powerpc::first_plt_entry_offset): New function.
3320 (Target_powerpc::plt_entry_size): New function.
3321 (Output_data_plt_powerpc::entry_count): New function.
3322 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3323 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3324 * sparc.cc (Target_sparc::got_size): Add const.
3325 (Target_sparc::got_entry_count): New function.
3326 (Target_sparc::plt_entry_count): New function.
3327 (Target_sparc::first_plt_entry_offset): New function.
3328 (Target_sparc::plt_entry_size): New function.
3329 (Output_data_plt_sparc::entry_count): New function.
3330 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3331 (Output_data_plt_sparc::get_plt_entry_size): New function.
3332 * symtab.h (Symbol::got_offset_list): New function.
3333 (Symbol_table::for_all_symbols): New function.
3334 * target.h (Sized_target::got_entry_count): New function.
3335 (Sized_target::plt_entry_count): New function.
3336 (Sized_target::plt_entry_size): New function.
3337 * x86_64.cc (Target_x86_64::got_size): Add const.
3338 (Target_x86_64::got_entry_count): New function.
3339 (Target_x86_64::plt_entry_count): New function.
3340 (Target_x86_64::first_plt_entry_offset): New function.
3341 (Target_x86_64::plt_entry_size): New function.
3342 (Output_data_plt_x86_64::entry_count): New function.
3343 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3344 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3345
09ec0418
CC
33462010-08-12 Cary Coutant <ccoutant@google.com>
3347
3348 * archive.cc: Include incremental.h.
3349 (Archive::Archive): Initialize incremental_info_.
3350 (Archive::include_member): Record archive members in incremental info.
3351 (Add_archive_symbols::run): Record begin and end of an archive in
3352 incremental info.
3353 (Lib_group::include_member): Record objects in incremental info.
3354 * archive.h (Incremental_archive_entry): Forward declaration.
3355 (Archive::set_incremental_info): New member function.
3356 (Archive::incremental_info): New member function.
3357 (Archive::Unused_symbol_iterator): New class.
3358 (Archive::unused_symbols_begin): New member function.
3359 (Archive::unused_symbols_end): New member function.
3360 (Archive::incremental_info_): New data member.
3361 * incremental-dump.cc (find_input_containing_global): New function.
3362 (dump_incremental_inputs): Dump new incremental info sections.
3363 * incremental.cc: Include symtab.h.
3364 (Output_section_incremental_inputs): New class.
3365 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3366 new incremental info sections.
3367 (Sized_incremental_binary::do_check_inputs): Likewise.
3368 (Incremental_inputs::report_archive): Remove.
3369 (Incremental_inputs::report_archive_begin): New function.
3370 (Incremental_inputs::report_archive_end): New function.
3371 (Incremental_inputs::report_object): New function.
3372 (Incremental_inputs::finalize_inputs): Remove.
3373 (Incremental_inputs::report_input_section): New function.
3374 (Incremental_inputs::report_script): Rewrite.
3375 (Incremental_inputs::finalize): Do nothing but finalize string table.
3376 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3377 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3378 (Incremental_inputs::create_data_sections): New function.
3379 (Incremental_inputs::relocs_entsize): New function.
3380 (Output_section_incremental_inputs::set_final_data_size): New function.
3381 (Output_section_incremental_inputs::do_write): New function.
3382 (Output_section_incremental_inputs::write_header): New function.
3383 (Output_section_incremental_inputs::write_input_files): New function.
3384 (Output_section_incremental_inputs::write_info_blocks): New function.
3385 (Output_section_incremental_inputs::write_symtab): New function.
3386 * incremental.h (Incremental_script_entry): Forward declaration.
3387 (Incremental_object_entry): Forward declaration.
3388 (Incremental_archive_entry): Forward declaration.
3389 (Incremental_inputs): Forward declaration.
3390 (Incremental_inputs_header_data): Remove.
3391 (Incremental_inputs_header): Remove.
3392 (Incremental_inputs_header_write): Remove.
3393 (Incremental_inputs_entry_data): Remove.
3394 (Incremental_inputs_entry): Remove.
3395 (Incremental_inputs_entry_write): Remove.
3396 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3397 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3398 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3399 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3400 Likewise.
3401 (Incremental_input_entry): New class.
3402 (Incremental_script_entry): New class.
3403 (Incremental_object_entry): New class.
3404 (Incremental_archive_entry): New class.
3405 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3406 (Incremental_inputs::report_inputs): Remove.
3407 (Incremental_inputs::report_archive): Remove.
3408 (Incremental_inputs::report_archive_begin): New function.
3409 (Incremental_inputs::report_archive_end): New function.
3410 (Incremental_inputs::report_object): Change prototype.
3411 (Incremental_inputs::report_input_section): New function.
3412 (Incremental_inputs::report_script): Change prototype.
3413 (Incremental_inputs::get_reloc_count): New function.
3414 (Incremental_inputs::set_reloc_count): New function.
3415 (Incremental_inputs::create_data_sections): New function.
3416 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3417 (Incremental_inputs::inputs_section): New function.
3418 (Incremental_inputs::symtab_section): New function.
3419 (Incremental_inputs::relocs_section): New function.
3420 (Incremental_inputs::get_stringpool): Add const.
3421 (Incremental_inputs::command_line): Add const.
3422 (Incremental_inputs::inputs): Remove.
3423 (Incremental_inputs::command_line_key): New function.
3424 (Incremental_inputs::input_file_count): New function.
3425 (Incremental_inputs::input_files): New function.
3426 (Incremental_inputs::relocs_entsize): New function.
3427 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3428 (Incremental_inputs::finalize_inputs): Remove.
3429 (Incremental_inputs::Input_info): Remove.
3430 (Incremental_inputs::lock_): Remove.
3431 (Incremental_inputs::inputs_): Change type.
3432 (Incremental_inputs::inputs_map_): Remove.
3433 (Incremental_inputs::current_object_entry_): New data member.
3434 (Incremental_inputs::inputs_section_): New data member.
3435 (Incremental_inputs::symtab_section_): New data member.
3436 (Incremental_inputs::relocs_section_): New data member.
3437 (Incremental_inputs::reloc_count_): New data member.
3438 (Incremental_inputs_reader): New class.
3439 (Incremental_symtab_reader): New class.
3440 (Incremental_relocs_reader): New class.
3441 * layout.cc (Layout::finalize): Move finalization of incremental info
3442 and creation of incremental info sections to follow finalization of
3443 symbol table. Set offsets for postprocessing sections.
3444 (Layout::create_incremental_info_sections): Call
3445 Incremental_inputs::create_data_sections. Add incremental symtab
3446 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3447 sections to layout after input sections.
3448 * layout.h (struct Timespec): Forward declaration.
3449 (Layout::incremental_inputs): Add const.
3450 (Layout::create_incremental_info_sections): Add parameter.
3451 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3452 * object.cc: Include incremental.h.
3453 (Relobj::finalize_incremental_relocs): New function.
3454 (Sized_relobj::do_layout): Record input sections in incremental info.
3455 * object.h (Object::output_section): New function.
3456 (Object::output_section_offset): Moved from Relobj.
3457 (Object::get_incremental_reloc_base): New function.
3458 (Object::get_incremental_reloc_count): New function.
3459 (Object::do_output_section): New function.
3460 (Object::do_output_section_offset): Moved from Relobj.
3461 (Object::do_get_incremental_reloc_base): New function.
3462 (Object::do_get_incremental_reloc_count): New function.
3463 (Object::Object): Initialize new data members.
3464 (Relobj::output_section): Renamed do_output_section and moved to
3465 protected.
3466 (Relobj::output_section_offset): Moved to Object.
3467 (Relobj::do_get_incremental_reloc_base): New function.
3468 (Relobj::do_get_incremental_reloc_count): New function.
3469 (Relobj::allocate_incremental_reloc_counts): New function.
3470 (Relobj::count_incremental_reloc): New function.
3471 (Relobj::finalize_incremental_relocs): New function.
3472 (Relobj::next_incremental_reloc_index): New function.
3473 (Relobj::reloc_counts_): New data member.
3474 (Relobj::reloc_bases_): New data member.
3475 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3476 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3477 (Sized_relobj::incremental_relocs_scan): New function.
3478 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3479 (Sized_relobj::incremental_relocs_write): New function.
3480 (Sized_relobj::incremental_relocs_write_reltype): New function.
3481 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3482 incremental link.
3483 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3484 archives and object files elsewhere.
3485 (Add_symbols::run): Report object files here.
3486 (Finish_group::run): Report end of archive at end of group.
3487 * reloc.cc: Include layout.h, incremental.h.
3488 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3489 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3490 (Sized_relobj::incremental_relocs_scan): New function.
3491 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3492 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3493 (Sized_relobj::incremental_relocs_write): New function.
3494 (Sized_relobj::incremental_relocs_write_reltype): New function.
3495 * script.cc (read_input_script): Rewrite test for incremental link.
3496 Change call to Incremental_inputs::report_script.
3497 * symtab.h (Symbol_table::first_global_index): New function.
3498 (Symbol_table::output_count): New function.
3499
ce0d1972
DK
35002010-08-12 Doug Kwan <dougkwan@google.com>
3501
3502 * arm.cc (Target_arm::merge_object_attributes): Check command line
3503 options --no-wchar-size-warning and --no-enum-size-warning.
3504 * options.h (General_options): Add ld-compatible options
3505 --no-enum-size-warning and --no-wchar-size-warning.
3506
6e5710ce
ILT
35072010-08-04 Ian Lance Taylor <iant@google.com>
3508
3509 * x86_64.cc (Target_x86_64::Scan::local): Use
3510 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3511 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3512 (Target_x86_64::Scan::global): Likewise.
3513 (Target_x86_64::Relocate::relocate): Likewise.
3514 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3515 Likewise.
3516
fef830db
CC
35172010-08-03 Cary Coutant <ccoutant@google.com>
3518
3519 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3520 to reserve space in merged_strings vector. Keep total input size
3521 for stats.
3522 (Output_merge_string::do_print_merge_stats): Print total input size.
3523 * merge.h (Output_merge_string): Add input_size_ field.
3524 * stringpool.cc (Stringpool_template::string_length): Move
3525 implementations out of Stringpool_template class and place in
3526 stringpool.h.
3527 * stringpool.h (string_length): Move out of Stringpool_template.
3528
1e3811b0
ILT
35292010-08-03 Ian Lance Taylor <iant@google.com>
3530
3531 PR 11712
3532 * layout.cc (relaxation_loop_body): If address of load segment is
3533 set, adjust address to include headers if possible.
3534
7af0c620
ILT
35352010-08-03 Ian Lance Taylor <iant@google.com>
3536
3537 * version.cc (version_string): Bump to 1.10.
3538
22f0da72
ILT
35392010-08-03 Ian Lance Taylor <iant@google.com>
3540
3541 PR 11805
3542 * layout.h (enum Output_section_order): Define.
3543 (class Layout): Update declarations.
3544 * layout.cc (Layout::get_output_section): Add order parameter.
3545 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3546 is_first_non_relro parameters. Change all callers.
3547 (Layout::choose_output_section): Likewise.
3548 (Layout::add_output_section_data): Likewise.
3549 (Layout::make_output_section): Likewise. Set order.
3550 (Layout::default_section_order): New function.
3551 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3552 * output.cc (Output_section::Output_section): Initialize order_.
3553 Don't initialize deleted fields.
3554 (Output_segment::Output_segment): Don't initialize deleted
3555 fields.
3556 (Output_segment::add_output_section_to_load): New function
3557 replacing add_output_section. Change all callers to call this or
3558 add_output_section_to_nonload.
3559 (Output_segment::add_output_section_to_nonload): New function.
3560 (Output_segment::remove_output_section): Rewrite.
3561 (Output_segment::add_initial_output_data): Likewise.
3562 (Output_segment::has_any_data_sections): Likewise.
3563 (Output_segment::is_first_section_relro): Likewise.
3564 (Output_segment::maximum_alignment): Likewise.
3565 (Output_segment::has_dynamic_reloc): New function replacing
3566 dynamic_reloc_count. Change all callers.
3567 (Output_segment::has_dynamic_reloc_list): New function replacing
3568 dynamic_reloc_count_list. Change all callers.
3569 (Output_segment::set_section_addresses): Rewrite.
3570 (Output_segment::set_offset): Rewrite.
3571 (Output_segment::find_first_and_last_list): Remove.
3572 (Output_segment::set_tls_offsets): Rewrite.
3573 (Output_segment::first_section_load_address): Likewise.
3574 (Output_segment::output_section_count): Likewise.
3575 (Output_segment::section_with_lowest_load_address): Likewise.
3576 (Output_segment::write_section_headers): Likewise.
3577 (Output_segment::print_sections_to_map): Likewise.
3578 * output.h (class Output_data): Remove dynamic_reloc_count_
3579 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3580 (Output_data::add_dynamic_reloc): Rewrite.
3581 (Output_data::has_dynamic_reloc): New function.
3582 (Output_data::dynamic_reloc_count): Remove.
3583 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3584 is_last_relro_, is_first_non_relro_, is_interp_,
3585 is_dynamic_linker_section_ fields. Add order and set_order
3586 functions. Remove is_relro_local, set_is_relro_local,
3587 is_last_relro, set_is_last_relro, is_first_non_relro,
3588 set_is_first_non_relro functions, is_interp, set_is_interp,
3589 is_dynamic_linker_section, and set_is_dynamic_linker_section
3590 functions.
3591 (class Output_segment): Change Output_data_list from std::list to
3592 std:;vector. Add output_lists_ field. Remove output_data_ and
3593 output_bss_ fields. Update declarations.
3594
3ff2ccb0
ILT
35952010-08-02 Ian Lance Taylor <iant@google.com>
3596
3597 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3598 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3599 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3600
88a4108b
ILT
36012010-08-02 Ian Lance Taylor <iant@google.com>
3602
3603 PR 11855
3604 * script.cc (Script_options::Script_options): Initialize
3605 symbol_definitions_ and symbol_references_.
3606 (Script_options::add_symbol_assignment): Update
3607 symbol_definitions_ and symbol_references_.
3608 (Script_options::add_symbol_reference): New function.
3609 (script_symbol): New function.
3610 * script.h (class Script_options): Add symbol_definitions_ and
3611 symbol_references_ fields.
3612 (Script_options::referenced_const_iterator): New type.
3613 (Script_options::referenced_begin): New function.
3614 (Script_options::referenced_end): New function.
3615 (Script_options::is_referenced): New function.
3616 (Script_options::any_unreferenced): New function.
3617 * script-c.h (script_symbol): Declare.
3618 * yyscript.y (exp): Call script_symbol.
3619 * symtab.cc: Include "script.h".
3620 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3621 Change all callers. Check symbols referenced by scripts.
3622 (Symbol_table::add_undefined_symbols_from_command_line): Add
3623 layout parameter. Change all callers.
3624 (Symbol_table::do_add_undefined_symbols_from_command_line):
3625 Likewise. Break out loop body. Check symbols referenced by
3626 scripts.
3627 (Symbol_table::add_undefined_symbol_from_command_line): New
3628 function broken out of
3629 do_add_undefined_symbols_from_command_line.
3630 * symtab.h (class Symbol_table): Update declarations.
3631 * archive.cc: Include "layout.h".
3632 (Archive::should_include_member): Add layout parameter. Change
3633 all callers. Check for symbol mentioned in expression.
3634 * archive.h (class Archive): Update declaration.
3635 * object.cc (Sized_relobj::do_should_include_member): Add layout
3636 parameter.
3637 * object.h (Object::should_include_member): Add layout parameter.
3638 Change all callers.
3639 (Object::do_should_include_member): Add layout parameter.
3640 (class Sized_relobj): Update declaration.
3641 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3642 parameter.
3643 * dynobj.h (class Sized_dynobj): Update declaration.
3644 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3645 layout parameter.
3646 * plugin.h (class Sized_pluginobj): Update declaration.
3647
5f1ab67a
ILT
36482010-08-02 Ian Lance Taylor <iant@google.com>
3649
3650 PR 11866
3651 * output.cc (Output_segment::set_offset): Search for the first and
3652 last sections rather than assuming that the list is in order.
3653 (Output_segment::find_first_and_last_list): New function.
3654 * output.h (class Output_segment): Update declarations.
3655 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3656 (relro_strip_test_SOURCES): New variable.
3657 (relro_strip_test_DEPENDENCIES): New variable.
3658 (relro_strip_test_LDFLAGS): New variable.
3659 (relro_strip_test_LDADD): New variable.
3660 (relro_strip_test.so): New target.
3661
a8df5856
ILT
36622010-08-02 Ian Lance Taylor <iant@google.com>
3663
3664 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3665 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3666 (Target_i386::got_tlsdesc_section): New function.
3667 (Target_i386::got_section): Create space for GOT entries for
3668 TLSDESC relocations.
3669 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3670 R_386_TLS_GOTDESC.
3671 (Target_i386::Scan::global): Likewise.
3672 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3673 using TLSDESC GOT.
3674 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3675 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3676 (Target_x86_64::got_tlsdesc_section): New function.
3677 (Target_x86_64::got_section): Create space for GOT entries for
3678 TLSDESC relocations.
3679 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3680 R_386_TLS_GOTDESC.
3681 (Target_x86_64::Scan::global): Likewise.
3682 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3683 using TLSDESC GOT.
3684
0c10a0a6
ILT
36852010-08-02 Ian Lance Taylor <iant@google.com>
3686
3687 * testsuite/final_layout.sh: Use dc to convert from hex to
3688 decimal.
3689
41cbeecc
ST
36902010-07-29 Sriraman Tallam <tmsriram@google.com>
3691
3692 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3693 paramter to the call to gold::gc_process_relocs.
3694 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3695 paramter to the call to gold::gc_process_relocs.
3696 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3697 parameter to the call to gold::gc_process_relocs.
3698 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3699 template parameter to the call to gold::gc_process_relocs.
3700 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3701 paramter to the call to gold::gc_process_relocs.
3702 * gc.h (get_embedded_addend_size): New function.
3703 (gc_process_relocs): Save the size of the reloc for use by ICF.
3704 * icf.cc (get_section_contents): Get the addend from the text section
3705 for SHT_REL relocation sections.
3706 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3707 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3708 * int_encoding.h (read_from_pointer): New overloaded function.
3709 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3710 * testsuite/icf_sht_rel_addend_test.sh: New file.
3711 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3712 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3713
6ea55b82
RW
37142010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3715
3716 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3717 * Makefile.in: Regenerate.
3718 * testsuite/Makefile.in: Regenerate.
3719
9691462b
ILT
37202010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3721
3722 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3723 * gold/testsuite/debug_msg.cc: Likewise.
3724 * gold/testsuite/odr_violation1.cc
3725 * gold/testsuite/odr_violation2.cc
3726
76897331
CC
37272010-07-21 Cary Coutant <ccoutant@google.com>
3728
3729 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3730 string, and length fields.
3731 (Output_merge_string::Merged_strings_list): New type.
3732 (Output_merge_string::Merged_strings_lists): New typedef.
3733 (Output_merge_string): Replace merged_strings_ with
3734 merged_strings_lists_.
3735 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3736 Merged_strings_list per input object and section. Don't store pointer
3737 to the string. Don't store length with each merged string entry.
3738 (Output_merge_string::finalize_merged_data): Loop over list of merged
3739 strings lists. Recompute length of each merged string.
3740
78384e8f
CC
37412010-07-15 Cary Coutant <ccoutant@google.com>
3742
3743 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3744 here.
3745
783659f9
ILT
37462010-07-14 Ian Lance Taylor <iant@google.com>
3747
3748 * descriptors.cc (Descriptors::open): Report correct name in error
3749 message.
3750
131687b4
DK
37512010-07-13 Doug Kwan <dougkwan@google.com>
3752
3753 * arm.cc (Arm_input_section::Arm_input_section): For a
3754 SHT_ARM_EXIDX section, always keeps the input sections.
3755 (Arm_input_section::set_exidx_section_link): New method.
3756 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3757 has_errors_ to false.
3758 (Arm_exidx_input_section::has_errors,
3759 Arm_exidx_input_section::set_has_errors): New methods.
3760 (Arm_exidx_input_section::has_errors_): New data member.
3761 (Arm_relobj::get_exidx_shndx_list): New method.
3762 (Arm_output_section::append_text_sections_to_list): Do not skip
3763 section without SHF_EXECINSTR.
3764 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3765 errors.
3766 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3767 section header. Make error messages more verbose. Check for
3768 a non-executable section linked to an EXIDX section.
3769 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3770 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3771 check that there is no deferred EXIDX section if we exit early.
3772 Instead of not making an EXIDX section in case of an error, make one
3773 and set the has_errors flag of it.
3774 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3775 in a relocatable link.
3776 (Target_arm::do_relax): Look for the EXIDX output section instead of
3777 assuming that it is called .ARM.exidx.
3778 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3779 section list. Do not check for SHF_EXECINSTR section flags but
3780 skip any input section with errors.
3781 * output.cc (Output_section::Output_section): Initialize
3782 always_keeps_input_sections_ to false.
3783 (Output_section::add_input_section): Check for
3784 always_keeps_input_sections_.
3785 * output.h (Output_section::always_keeps_input_sections,
3786 Output_section::set_always_keeps_input_sections): New methods.
3787 (Output_section::always_keeps_input_sections): New data member.
3788
69517287
RÁE
37892010-07-13 Rafael Espindola <espindola@google.com>
3790
3791 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3792 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3793
82742395
ILT
37942010-07-13 Philip Herron <herron.philip@googlemail.com>
3795 Ian Lance Taylor <iant@google.com>
3796
3797 * output.h (Output_section_lookup_maps::add_merge_section):
3798 Correct check of whether value was inserted.
3799 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3800 (Output_section_lookup_maps::add_relaxed_input_section):
3801 Likewise.
3802 * arm.cc (Target_arm::got_section): Remove used local os.
3803 * i386.cc (Target_i386::got_section): Likewise.
3804 * x86_64.cc (Target_x86_64::got_section): Likewise.
3805 * sparc.cc (Target_sparc::got_section): Likewise.
3806 (Target_sparc::relocate): Remove unused local have_got_offset.
3807 * powerpc.cc (Target_powerpc::relocate): Likewise.
3808
f2d707b5
ILT
38092010-07-13 Ian Lance Taylor <iant@google.com>
3810
241531d6
ILT
3811 * compressed_output.cc (zlib_decompress): Fix signature in
3812 !HAVE_ZLIB_H case.
3813
f2d707b5
ILT
3814 * archive.cc (Archive::include_member): Unlock an external member
3815 of a thin archive. Don't bother to delete an object we know is
3816 NULL.
3817
a2e47362
CC
38182010-07-12 Cary Coutant <ccoutant@google.com>
3819
3820 * compressed_output.cc (zlib_decompress): New function.
3821 (get_uncompressed_size): New function.
3822 (decompress_input_section): New function.
3823 * compressed_output.h (get_uncompressed_size): New function.
3824 (decompress_input_section): New function.
3825 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3826 Handle compressed debug sections.
3827 * layout.cc (is_compressed_debug_section): New function.
3828 (Layout::output_section_name): Map compressed section names to
3829 canonical names.
3830 * layout.h (is_compressed_debug_section): New function.
3831 (is_debug_info_section): Recognize compressed debug sections.
3832 * merge.cc: Include compressed_output.h.
3833 (Output_merge_data::do_add_input_section): Handle compressed
3834 debug sections.
3835 (Output_merge_string::do_add_input_section): Handle compressed
3836 debug sections.
3837 * object.cc: Include compressed_output.h.
3838 (Sized_relobj::Sized_relobj): Initialize new data members.
3839 (build_compressed_section_map): New function.
3840 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3841 * object.h (Object::section_is_compressed): New method.
3842 (Object::do_section_is_compressed): New method.
3843 (Sized_relobj::Compressed_section_map): New type.
3844 (Sized_relobj::do_section_is_compressed): New method.
3845 (Sized_relobj::compressed_sections_): New data member.
3846 * output.cc (Output_section::add_input_section): Handle compressed
3847 debug sections.
3848 * reloc.cc: Include compressed_output.h.
3849 (Sized_relobj::write_sections): Handle compressed debug sections.
3850
ce279a62
CC
38512010-07-08 Cary Coutant <ccoutant@google.com>
3852
3853 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3854 weak when resolving to a dynamic def.
3855 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3856 for weak undef/dynamic def cases. Adjust callers.
3857 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3858 undef_binding_weak_.
3859 (Symbol_table::sized_write_globals): Adjust symbol binding.
3860 (Symbol_table::sized_write_symbol): Add binding parameter.
3861 * symtab.h (Symbol::set_undef_binding): New method.
3862 (Symbol::is_undef_binding_weak): New method.
3863 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3864 (Symbol_table::should_override): Add new parameter.
3865 (Symbol_table::sized_write_symbol): Add new parameter.
3866
3867 * testsuite/weak_undef_file1.cc: Add new test case.
3868 * testsuite/weak_undef_file2.cc: Fix header comment.
3869 * testsuite/weak_undef_test.cc: Add new test case.
3870
b2286c10
DK
38712010-06-29 Doug Kwan <dougkwan@google.com>
3872
3873 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3874 Initialize USE_SYMBOL_.
3875 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3876 definition.
3877 (Arm_reloc_property::uses_symbol_): New data member declaration.
3878 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3879 uses symbol value and symbol is undefined but not weakly undefined.
3880
4802450a
RÁE
38812010-06-28 Rafael Espindola <espindola@google.com>
3882
3883 * plugin.cc (Plugin::load): Use dlerror.
3884
e5ca47ba
ILT
38852010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3886
3887 * symtab.cc (detect_odr_violations): When reporting an ODR
3888 violation, report an object where the symbol is defined.
3889
8a75a161
DK
38902010-06-25 Doug Kwan <dougkwan@google.com>
3891
3892 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3893 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3894 definition.
3895 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3896 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3897 target hook to detect function points.
3898 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3899 * icf.h (Icf::check_section_for_function_pointers): Change type of
3900 parameter SECTION_NAME to const reference to std::string. Use
3901 target hook to determine if section may have unsafe pointers.
3902 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3903 method definition.
3904
42218b9f
RÁE
39052010-06-21 Rafael Espindola <espindola@google.com>
3906
3907 * fileread.cc (Input_file::find_fie): New
3908 (Input_file::open): Use Input_file::find_fie.
3909 * fileread.h (Input_file::find_fie): New
3910 * plugin.cc (set_extra_library_path): New.
3911 (Plugin::load): Add set_extra_library_path to the transfer vector.
3912 (Plugin_manager::set_extra_library_path): New.
3913 (Plugin_manager::add_input_file): Use the extra search path if set.
3914 (set_extra_library_path(): New.
3915 * plugin.h (Plugin_manager): Add set_extra_library_path and
3916 extra_search_path_.
3917
a0506cca
CC
39182010-06-19 Cary Coutant <ccoutant@google.com>
3919
3920 * layout.cc (gdb_sections): Add .debug_types.
3921 (lines_only_debug_sections): Likewise.
3922
6508b958
RÁE
39232010-06-18 Rafael Espindola <espindola@google.com>
3924
3925 * plugin.cc (add_input_file,add_input_library)
3926 (Plugin_manager::add_input_file): Make filename arguments const.
3927 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3928 const.
3929
3e235302
DK
39302010-06-16 Doug Kwan <dougkwan@google.com>
3931
3932 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3933 .ARM.attributes section if we have not merged any input
3934 attributes sections.
3935
106e8a6c
DK
39362010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3937
3938 * arm.cc: Allow combining objects with no EABI version
3939 information.
3940
91ff43fe
RÁE
39412010-06-15 Rafael Espindola <espindola@google.com>
3942
3943 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3944
68ed838c
ILT
39452010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3946
3947 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3948 (struct iovec): Correct !HAVE_READV definition.
3949
f3a2388f
CC
39502010-06-10 Cary Coutant <ccoutant@google.com>
3951
3952 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3953 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3954 reloc sections.
3955 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3956
3957 PR 11683
3958 * symtab.h (Symbol::is_placeholder): New member function.
3959 * target-reloc.h (relocate_section): Check for placeholder symbols.
3960
3961 * testsuite/Makefile.am (plugin_test_8): New test.
3962 (plugin_test_9): New test.
3963 * testsuite/Makefile.in: Regenerate.
3964
e1df38aa
NC
39652010-06-09 Nick Clifton <nickc@redhat.com>
3966
3967 * yyscript.y (input_list_element): Allow strings prefixed with
3968 the '-' character. Treat these as libraries.
3969 * script.cc (script_add_library): New function. Adds a library
3970 specified by "-l<name>" found in an input script.
3971 * script-c.h: Add prototype for script_add_library.
3972
25bbe950
DK
39732010-06-07 Doug Kwan <dougkwan@google.com>
3974
3975 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3976 Restrict stub-group size to be within long conditional branch
3977 range when working around cortex-A8 erratum.
3978
0f32ea4c
ILT
39792010-06-07 Damien Diederen <dd@crosstwine.com>
3980
3981 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3982 #ifdef typo.
3983
8fe2a369
ST
39842010-06-03 Sriraman Tallam <tmsriram@google.com>
3985
3986 PR gold/11658
3987 * output.cc
3988 (Output_section::Input_section_sort_entry::compare_section_ordering):
3989 Change to return non-zero correctly.
3990 (Output_section::Input_section_sort_section_order_index_compare
3991 ::operator()): Change to fix ambiguity in comparisons.
3992
6e9ba2ca
ST
39932010-06-01 Sriraman Tallam <tmsriram@google.com>
3994
3995 * gold.h (is_wildcard_string): New function.
3996 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3997 (Layout::layout_eh_frame): Ditto.
3998 (Layout::find_section_order_index): New method.
3999 (Layout::read_layout_from_file): New method.
4000 * layout.h (Layout::find_section_order_index): New method.
4001 (Layout::read_layout_from_file): New method.
4002 (Layout::input_section_position_): New private member.
4003 (Layout::input_section_glob_): New private member.
4004 * main.cc (main): Call read_layout_from_file here.
4005 * options.h (--section-ordering-file): New option.
4006 * output.cc (Output_section::input_section_order_specified_): New
4007 member.
4008 (Output_section::Output_section): Initialize new member.
4009 (Output_section::add_input_section): Add new parameter.
4010 Keep input sections when --section-ordering-file is used.
4011 (Output_section::set_final_data_size): Sort input sections when
4012 section ordering file is specified.
4013 (Output_section::Input_section_sort_entry): Add new parameter.
4014 Check sorting type.
4015 (Output_section::Input_section_sort_entry::compare_section_ordering):
4016 New method.
4017 (Output_section::Input_section_sort_compare::operator()): Change to
4018 consider section_order_index.
4019 (Output_section::Input_section_sort_init_fini_compare::operator()):
4020 Change to consider section_order_index.
4021 (Output_section::Input_section_sort_section_order_index_compare
4022 ::operator()): New method.
4023 (Output_section::sort_attached_input_sections): Change to sort
4024 according to section order when specified.
e1df38aa
NC
4025 (Output_section::add_input_section<32, true>): Add new parameter.
4026 (Output_section::add_input_section<64, true>): Add new parameter.
4027 (Output_section::add_input_section<32, false>): Add new parameter.
4028 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4029 * output.h (Output_section::add_input_section): Add new parameter.
4030 (Output_section::input_section_order_specified): New
4031 method.
4032 (Output_section::set_input_section_order_specified): New method.
4033 (Input_section::Input_section): Initialize section_order_index_.
4034 (Input_section::section_order_index): New method.
4035 (Input_section::set_section_order_index): New method.
4036 (Input_section::section_order_index_): New member.
4037 (Input_section::Input_section_sort_section_order_index_compare): New
4038 struct.
4039 (Output_section::input_section_order_specified_): New member.
4040 * script-sections.cc (is_wildcard_string): Delete and move modified
4041 method to gold.h.
4042 (Output_section_element_input::Output_section_element_input): Modify
4043 call to is_wildcard_string.
4044 (Output_section_element_input::Input_section_pattern
4045 ::Input_section_pattern): Ditto.
4046 (Output_section_element_input::Output_section_element_input): Ditto.
4047 * testsuite/Makefile.am (final_layout): New test case.
4048 * testsuite/Makefile.in: Regenerate.
4049 * testsuite/final_layout.cc: New file.
4050 * testsuite/final_layout.sh: New file.
4051
3537c84b
RÁE
40522010-06-01 Rafael Espindola <espindola@google.com>
4053
4054 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4055
105b6afd
RÁE
40562010-06-01 Rafael Espindola <espindola@google.com>
4057
4058 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4059 visibility of symbols.
4060
29e11421
DK
40612010-05-27 Doug Kwan <dougkwan@google.com>
4062
4063 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4064 from start of output section instead of address for a local symbol
4065 in a merged or relaxed section when doing a relocatable link.
4066
5e0f337e
RÁE
40672010-05-26 Rafael Espindola <espindola@google.com>
4068
4069 PR 11604
4070 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4071 adding sections the garbage collector removed.
4072 * gold/testsuite/Makefile.am: Add test.
4073 * gold/testsuite/Makefile.in: Regenerate.
4074 * gold/testsuite/plugin_test_7.sh: New.
4075 * gold/testsuite/plugin_test_7_1.c: New.
4076 * gold/testsuite/plugin_test_7_2.c: New.
4077
f4187277
RÁE
40782010-05-26 Rafael Espindola <espindola@google.com>
4079
4080 * script-sections.cc (Output_section_definition::set_section_addresses):
4081 Check for --section-start.
4082
5c388529
DK
40832010-05-26 Doug Kwan <dougkwan@google.com>
4084
4085 * arm.cc (Arm_scan_relocatable_relocs): New class.
4086 (Target_arm::relocate_special_relocatable): New method.
4087 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4088 (Arm_relocate_functions::thumb_branch_common): Same.
4089 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4090 instead of Default_scan_relocatable_relocs.
4091 * target-reloc.h (relocate_for_relocatable): Let target handle
4092 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4093 * target.h (Sized_target::relocate_special_relocatable): New method.
4094
bca1c3ae
ILT
40952010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4096
4097 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4098
0439c796
DK
40992010-05-23 Doug Kwan <dougkwan@google.com>
4100
4101 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4102 instead of a cast.
4103 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4104 with a direct branch, not a conditional branch, to a stub.
4105 * merge.cc (Output_merge_base::record_input_section): New method
4106 defintion.
4107 (Output_merge_data::do_add_input_section): Record input section if
4108 keeps-input-sections flag is set.
4109 (Output_merge_string::do_add_input_section): Ditto.
4110 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4111 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4112 INPUT_SECTIONS_.
4113 (Output_merge_base::keeps_input_sections,
4114 Output_merge_base::set_keeps_input_sections,
4115 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4116 method definitions.
4117 (Output_merge_base::Input_sections): New type declaration.
4118 (Output_merge_base::input_sections_begin,
4119 Output_merge_base::input_sections_end,
4120 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4121 (Output_merge_base::bool keeps_input_sections_,
4122 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4123 Output_merge_base::input_sections_): New data members.
4124 (Output_merge_data::do_set_keeps_input_sections): New method
4125 defintion.
4126 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4127 * output.cc (Output_section::Input_section::relobj): Move method
4128 defintion from class declaration to here and handle merge sections.
4129 (Output_section::Input_section::shndx): Ditto.
4130 (Output_section::Output_section): Remove initializations of removed
4131 data members and initialize new data member LOOKUP_MAPS_.
4132 (Output_section::add_input_section): Set keeps-input-sections flag
4133 for a newly created merge output section as appropriate. Adjust code
4134 to use Output_section_lookup_maps class.
4135 (Output_section::add_relaxed_input_section): Adjst code for lookup
4136 maps code refactoring.
4137 (Output_section::add_merge_input_section): Add a new parameter
4138 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4139 class. If adding input section to a newly created merge output
4140 section fails, remove the new merge section.
4141 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4142 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4143 (Output_section::find_merge_section): Ditto.
4144 (Output_section::build_lookup_maps): New method defintion.
4145 (Output_section::find_relaxed_input_section): Adjust code to use
4146 Output_section_lookup_maps class.
4147 (Output_section::get_input_sections): Export merge sections. Adjust
4148 code to use Output_section_lookup_maps class.
4149 (Output_section:::add_script_input_section): Adjust code to use
4150 Output_section_lookup_maps class. Update lookup maps for merge
4151 sections also.
4152 (Output_section::discard_states): Use Output_section_lookup_maps.
4153 (Output_section::restore_states): Same.
4154 * output.h (Merge_section_properties): Move class defintion out of
4155 Output_section.
4156 (Output_section_lookup_maps): New class.
4157 (Output_section::Input_section::is_merge_section): New method
4158 defintion.
4159 (Output_section::Input_section::relobj): Move defintion out of class
4160 defintion. Declare method only.
4161 (Output_section::Input_section::shndx): Ditto.
4162 (Output_section::Input_section::output_merge_base): New method defintion.
4163 (Output_section::Input_section::u2_.pomb): New union field.
4164 (Output_section::Merge_section_by_properties_map,
4165 Output_section::Output_section_data_by_input_section_map,
4166 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4167 Remove types.
4168 (Output_section::add_merge_input_section): Add new parameter
4169 KEEPS_INPUT_SECTIONS.
4170 (Output_section::build_lookup_maps): New method declaration.
4171 (Output_section::merge_section_map_,
4172 Output_section::merge_section_by_properties_map_,
4173 Output_section::relaxed_input_section_map_,
4174 Output_section::is_relaxed_input_section_map_valid_): Remove data
4175 members.
4176 (Output_section::lookup_maps_): New data member.
4177
76295588
L
41782010-05-21 Doug Kwan <dougkwan@google.com>
4179
4180 PR gold/11619
4181 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4182 avoid a compilation error.
4183
d103a984
RÁE
41842010-05-19 Rafael Espindola <espindola@google.com>
4185
4186 * script-sections.cc (Output_section_definition::allocate_to_segment):
4187 Update the phdrs_list even when the output section is NULL.
4188 * testsuite/Makefile.am: Add test.
4189 * testsuite/Makefile.in: Regenerate.
4190 * testsuite/script_test_9.cc: New.
4191 * testsuite/script_test_9.sh: New.
4192 * testsuite/script_test_9.t: New.
4193
6625d24e
DK
41942010-05-19 Doug Kwan <dougkwan@google.com>
4195
4196 * arm.cc (Arm_input_section::original_size): New method.
4197 (Arm_input_section::do_addralign): Add a cast.
4198 (Arm_input_section::do_output_offset): Remove static cast.
4199 (Arm_input_section::original_addralign,
4200 Arm_input_section::original_size_): Change type to uint32_t.
4201 (Arm_input_section::init): Add safe casts for section alignment
4202 and size.
4203 (Arm_input_section::set_final_data_size): Do not set address and
4204 offset of stub table.
4205 (Arm_output_section::fix_exidx_coverage): Change use of of
4206 Output_section::Simple_input_section to that of
4207 Output_section::Input_section.
4208 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4209 except for the first pass.
4210 * output.cc (Output_section::get_input_sections): Change type of
4211 input_sections to std::list<Input_section>.
4212 (Output_section::add_script_input_section): Rename from
4213 Output_section::add_simple_input_section. Change type of SIS
4214 parameter from Simple_input_section to Input_section.
4215 * output.h (Output_section::Simple_input_section): Remove class.
4216 (Output_section::Input_section): Change class visibility to public.
4217 (Output_section::Input_section::addralign): Use stored alignments
4218 for special input sections if set.
4219 (Output_section::Input_section::set_addralign): New method.
4220 (Output_section::get_input_sections): Change parameter type from
4221 list of Simple_input_section to list of Input_section.
4222 (Output_section::add_script_input_section): Rename from
4223 Output_section::add_simple_input_section. Change first parameter's
4224 type from Simple_input_section to Input_section and remove the
4225 second and third parameters.
4226 * script-sections.cc (Input_section::Input_section_list): Change
4227 type to list of Output_section::Input_section/
4228 (Input_section_info::Input_section_info): Change parameter type of
4229 INPUT_SECTION to Output_section::Input_section.
4230 (Input_section_info::input_section): Change return type.
4231 (Input_section_info::input_section_): Change type to
4232 Output_section::Input_section.
4233 (Output_section_element_input::set_section_addresses): Adjust code
4234 to use Output_section::Input_section instead of
4235 Output_section::Simple_input_section. Adjust code for renaming
4236 of Output_section::add_simple_input_section.
4237 (Orphan_output_section::set_section_addresses): Ditto.
4238
e1e82ea4
RW
42392010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4240
4241 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4242 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4243
91e75c8a
RÁE
42442010-05-18 Rafael Espindola <espindola@google.com>
4245
4246 * options.cc (General_options::finalize): Handle -nostdlib.
4247 * options.h (nostdlib): New option.
4248 * script.cc (script_add_search_dir): Handle -nostdlib.
4249
da59ad79
DK
42502010-05-12 Doug Kwan <dougkwan@google.com>
4251
4252 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4253 attributes section only if there no attributes section after merging.
4254 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4255 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4256 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4257 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4258 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4259 and arm_attr_merge_7.stdout.
4260 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4261 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4262 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4263 arm_attr_merge_7b.o): New rules.
4264 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4265 arm_attr_merge_7
4266 * testsuite/Makefile.in: Regenerate.
4267 * testsuite/arm_attr_merge.sh: New file.
4268 * testsuite/arm_attr_merge_[67][ab].s: Same.
4269
3e01a7fd
NC
42702010-05-05 Nick Clifton <nickc@redhat.com>
4271
4272 * po/es.po: Updated Spanish translation.
4273
7ad2014a
L
42742010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4275
4276 * Makefile.am (install-exec-local): Properly install gold as
4277 default cross linker.
4278 * Makefile.in: Regenerated.
4279
4fda8867
NC
42802010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4281 Nick Clifton <nickc@redhat.com>
4282
4283 * configure.ac (install_as_default): Define and set to false
4284 unless --enable-gold or --enable-gold=both/gold has been
4285 specified.
4286 * configure: Regenerate.
4287
4288 * Makefile.am (install-exec-local): Install the executable as
4289 'ld.gold'. If install_as_default is true then also install it as
4290 'ld'.
4291 * Makefile.in: Regenerated.
4292
bd288ea2
ILT
42932010-04-24 Ian Lance Taylor <iant@google.com>
4294
4295 * layout.cc (Layout::layout_reloc): In relocatable link don't
4296 combine reloc sections for grouped sections.
4297
ef38fd8a
ST
42982010-04-23 Sriraman Tallam <tmsriram@google.com>
4299
4300 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4301 sections that are not ordinary to icf.
4302 * icf.cc (get_section_contents): Handle relocation pointing to section
4303 with no object or shndx information.
4304 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4305 * testsuite/Makefile.in: Regenerate.
4306 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4307 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4308
f6973bdc
ILT
43092010-04-22 Ian Lance Taylor <iant@google.com>
4310
4311 * expression.cc (Expression::Expression_eval_info): Add
4312 result_alignment_pointer field.
4313 (Expression::eval_with_dot): Add result_alignment_pointer
4314 parameter. Change all callers.
4315 (Expression::eval_maybe_dot): Likewise.
4316 (class Binary_expression): Add alignment_pointer parameter to
4317 left_value and right_value. Change all callers.
4318 (BINARY_EXPRESSION): Set result alignment.
4319 (class Trinary_expression): Add alignment_pointer parameter to
4320 arg2_value and arg3_value. Change all callers.
4321 (Trinary_cond::value): Set result alignment.
4322 (Max_expression::value, Min_expression::value): Likewise.
4323 (Align_expression::value): Likewise.
4324 * script-sections.cc (class Sections_element): Add dot_alignment
4325 parameter to set_section_addresses virtual function. Update
4326 instantiations.
4327 (class Output_section_element): Likewise.
4328 (Script_sections::create_segments): Add dot_alignment parameter.
4329 Change all callers.
4330 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4331 (Script_sections::set_phdrs_clause_addresses): Likewise.
4332 * script-sections.h: Update declarations.
4333 * script.h: Update declarations.
4334 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4335 min_p_align.
4336 * testsuite/script_test_3.t: Set large alignment.
4337 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4338 segment has expected alignment.
4339
9c9c98a5
NC
43402010-04-22 Nick Clifton <nickc@redhat.com>
4341
4342 * po/gold.pot: Updated by the Translation project.
4343 * po/vi.po: Updated Vietnamese translation.
4344
2253bfba
L
43452010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4346
4347 * testsuite/Makefile.am (check_PROGRAMS): Add
4348 icf_virtual_function_folding_test.
4349 * testsuite/Makefile.in: Regenerated.
4350
85fdf906
AH
43512010-04-15 Andrew Haley <aph@redhat.com>
4352
4353 * options.h (merge_exidx_entries): New option.
4354 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4355 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4356 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4357 (Target_arm::merge_exidx_entries): New function.
4358 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4359 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4360 to Arm_exidx_fixup constructor.
4361 Add new arg, merge_exidx_entries.
4362 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4363 Arm_output_section::fix_exidx_coverage.
4364
ce97fa81
ST
43652010-04-18 Sriraman Tallam <tmsriram@google.com>
4366
4367 * icf.cc (get_section_contents): Check for preemptible functions.
4368 Ignore addend when appropriate.
4369 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4370 section folded.
4371 (add_from_relobj): Check for section folded.
4372 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4373 * symtab.h (should_add_dynsym_entry): Add new parameter.
4374 * target-reloc.h (scan_relocs): Check for section folded.
4375 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4376 Check reloc types for function pointers in shared objects.
4377 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4378 case.
4379 (icf_preemptible_functions_test): New test case.
4380 (icf_string_merge_test): New test case.
4381 * testsuite.Makefile.in: Regenerate.
4382 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4383 bar_glob. Refactor code.
4384 * testsuite/icf_preemptible_functions_test.cc: New file.
4385 * testsuite/icf_preemptible_functions_test.sh: New file.
4386 * testsuite/icf_string_merge_test.cc: New file.
4387 * testsuite/icf_string_merge_test.sh: New file.
4388 * testsuite/icf_virtual_function_folding_test.cc: New file.
4389 * testsuite/icf_virtual_function_folding_test.sh: New file.
4390
04ceb17c
DK
43912010-04-14 Doug Kwan <dougkwan@google.com>
4392
4393 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4394 for local symbol recounting if we remove a section due to ICF.
4395 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4396 there are no regular objects in input.
4397
153e7da4
DK
43982010-04-13 Doug Kwan <dougkwan@google.com>
4399
4400 * arm.cc (Arm_input_section::set_final_data_size): Compute
4401 accurate final data size instead of using current data size.
4402
4dbd9faf
DK
44032010-04-09 Doug Kwan <dougkwan@google.com>
4404
4405 * layout.cc (Layout::choose_output_section): Handle script section
4406 types.
4407 (Layout::make_output_section_for_script): Add section type parameter.
4408 Handle script section types.
4409 * layout.h (Layout::make_output_section_for_script): Add section
4410 type parameter.
4411 * output.cc (Output_section::Output_section): Initialize data member
4412 is_noload_.
4413 (Output_section::do_reset_address_and_file_offset): Do not set address
4414 to 0 if section is a NOLOAD section.
4415 * output.h (Output_section::is_noload): New method.
4416 (Output_section::set_is_noload): Ditto.
4417 (Output_section::is_noload_): New data member.
4418 * script-c.h (Script_section_type): New enum type.
4419 (struct Parser_output_section_header): Add new file section_type.
4420 * script-sections.cc (Sections_element::output_section_name): Add
4421 parameter for returning script section type.
4422 (Output_section_definition::output_section_name): Ditto.
4423 (Output_section_definition::section_type)P; New method.
4424 (Output_section_definiton::script_section_type_name): Ditto.
4425 (Output_section_definition::script_section_type_): New data member.
4426 (Output_section_definition::Output_section_definition): Initialize
4427 data member Output_section_definition::script_section_type_.
4428 (Output_section_definition::create_sections): Pass script section type
4429 to Layout::make_output_section_for_script.
4430 (Output_section_definition::output_section_name): Return script
4431 section type to caller.
4432 (Output_section_definition::set_section_address): Do not advance
4433 dot value and load address if section type is NOLOAD. Set address
4434 of NOLOAD sections regardless of section flags.
4435 (Output_section_definition::print): Print section type if it is
4436 not SCRIPT_SECTION_TYPE_NONE.
4437 (Output_section_definition::section_type): New method.
4438 (Output_section_definition::script_section_type_name): Ditto.
4439 (Script_sections::output_section_name): Add new parameter
4440 PSECTION_TYPE for returning script section type. Pass it to
4441 section elements. Handle discard sections.
4442 (Sort_output_sections::operator()): Handle NOLOAD sections.
4443 * script-sections.h (Script_sections::Section_type): New enum type.
4444 (Script_sections::output_section_name): Add a new parameter for
4445 returning script section type.
4446 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4447 INFO and NOLOAD.
4448 * yyscript.y (union): Add new field SECTION_TYPE.
4449 (COPY, DSECT, INFO, NOLOAD): New tokens.
4450 (opt_address_and_section_type): Change type to output_section_header.
4451 (section_type): New non-terminal
4452 (section_header): Handle section type.
2253bfba 4453 (opt_address_and_section_type): Return section type value.
4dbd9faf 4454
721ea635
L
44552010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4456
4457 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4458 * testsuite/plugin_common_test_2.c (foo): Likewise.
4459
6bf924b0
DK
44602010-04-08 Doug Kwan <dougkwan@google.com>
4461
4462 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4463 Output_merge_data.
4464 * output.cc (Output_section::add_merge_input_section): Simplify
4465 code and return status of Output_merge_base::add_input_section.
e1df38aa 4466 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
4467 returns true.
4468
24af6f92
DK
44692010-04-07 Doug Kwan <dougkwan@google.com>
4470
4471 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4472 if section is marked as containing instructions but has no mapping
4473 symbols.
4474 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4475 correct section index.
4476 (Arm_relobj::find_linked_text_section): Ditto.
4477
00698fc5
CC
44782010-04-07 Cary Coutant <ccoutant@google.com>
4479
4480 * archive.cc (include_member): Destroy Read_symbols_data object before
4481 releasing file.
4482 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4483 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4484 (Read_symbols_data::~Read_symbols_data) New destructor.
4485 (Section_relocs::Section_relocs) New constructor.
4486 (Section_relocs::~Section_relocs) New destructor.
4487 (Read_relocs_data::Read_relocs_data) New constructor.
4488 (Read_relocs_data::~Read_relocs_data) New destructor.
4489 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4490 pointers to NULL after deleting.
4491
7296d933
DK
44922010-04-07 Doug Kwan <dougkwan@google.com>
4493
4494 * arm.cc: Replace "endianity" with "endianness" in comments.
4495 (Arm_exidx_cantunwind): Ditto.
4496 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4497 (Arm_relobj::merge_flags_and_attributes): New method.
4498 (Arm_relobj::merge_flags_and_attributes_): New data member.
4499 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4500 (Arm_relobj::scan_sections_for_stubs): Ditto.
4501 (Arm_relobj::do_read_symbols): Check to see if we really want to
4502 merge processor-specific flags and attributes. Exit early if
4503 an object is empty except for section names and the undefined symbol.
4504 (Target_arm::do_finalize_sections): Move check for ELF format to
4505 Arm_relobj::do_read_symbols. Merge processor specific flags and
4506 attributes from a regular object only when we have determined that
4507 it is aapropriate. Do not create an .ARM.attributes section in
4508 output if there is no regular input object.
4509 (Target_arm::merge_processor_specific_flags): Check
4510 --warn-mismatch before printing any error.
4511 (Target_arm::merge_object_attributes): Ditto.
4512 * gold.cc (queue_middle_tasks): Handle the case in which there is
4513 no regular object in input.
4514 * options.cc (General_options::parse_EB): New method.
4515 (General_options::parse_EL): Same.
4516 (General_options::General_options): Initialize endianness_.
4517 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4518 New options.
4519 (General_options::Endianness): New enum.
4520 (General_options::endianness): New method.
4521 (General_options::endianness_): New data member.
4522 * parameters.cc (Parameters::set_options): Check target endianness.
4523 (Parameters::set_target_once): Ditto.
4524 (Parameters::check_target_endianness): New method.
4525 (parameters_force_valid_target): If either -EL or -EB is specified,
4526 use it to define endianness of default target.
4527 * parameters.h (Parameters::check_target_endianness): New method
4528 declaration.
4529 * target.h (class Target): Change "endianity" to "endianness"
4530 in comments.
4531
efc8d4f2
RW
45322010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4533
4534 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4535 * configure: Regenerate.
4536 * Makefile.in: Regenerate.
4537 * testsuite/Makefile.in: Regenerate.
4538
be234d88
CC
45392010-04-06 Cary Coutant <ccoutant@google.com>
4540
4541 gcc PR lto/42757
4542 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4543 prevailing definitions of common symbols.
4544 * testsuite/plugin_test_6.sh: New test case.
4545 * testsuite/plugin_common_test_1.c: New test case.
4546 * testsuite/plugin_common_test_2.c: New test case.
4547 * testsuite/Makefile.am (plugin_test_6): New test case.
4548 * testsuite/Makefile.in: Regenerate.
4549
bd32c6bd
NC
45502010-04-06 Nick Clifton <nickc@redhat.com>
4551
4552 * po/vi.po: New Vietnamese translation.
4553
323c532f
DK
45542010-03-30 Doug Kwan <dougkwan@google.com>
4555
4556 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4557
4fcd97eb
DK
45582010-03-25 Doug Kwan <dougkwan@google.com>
4559
4560 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4561 to avoid a conversion warning on a 32-bit host.
4562
4ebf39db
ILT
45632010-03-24 Ian Lance Taylor <iant@google.com>
4564
4565 * testsuite/script_test_3.t: Add a TLS segment.
4566 * testsuite/Makefile.am (check_PROGRAMS): Add
4567 tls_phdrs_script_test.
4568 (tls_phdrs_script_test_SOURCES): Define.
4569 (tls_phdrs_script_test_DEPENDENCIES): Define.
4570 (tls_phdrs_script_test_LDFLAGS): Define.
4571 (tls_phdrs_script_test_LDADD): Define.
4572 * testsuite/Makefile.in: Rebuild.
4573
4a599bdd
CC
45742010-03-23 Cary Coutant <ccoutant@google.com>
4575
4576 * fileread.cc (find_or_make_view): Fix comment.
4577
6c93b22c
ILT
45782010-03-23 Ian Lance Taylor <iant@google.com>
4579
4580 * script-sections.cc (class Orphan_section_placement): Define
4581 PLACE_TLS and PLACE_TLS_BSS.
4582 (Orphan_section_placement::Orphan_section_placement): Initialize
4583 new places.
4584 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4585 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4586 (tls_script_test_SOURCES): Define.
4587 (tls_script_test_DEPENDENCIES): Define.
4588 (tls_script_test_LDFLAGS): Define.
4589 (tls_script_test_LDADD): Define.
4590 * testsuite/Makefile.in: Rebuild.
4591
a2c7281b
DK
45922010-03-22 Doug Kwan <dougkwan@google.com>
4593
4594 * arm.cc (Arm_relocate_functions::abs8,
4595 Arm_relocate_functions::abs16): Use correct check for overflow
4596 specified in the ARM ELF specs.
4597 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4598 target of a BLX instruction specially.
4599 (Reloc_stub::stub_type_for_reloc): Ditto.
4600 (Relocate::relocate): Use symbolic names instead of numeric relocation
4601 codes to report error.
4602 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4603 workaround.
4604 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4605 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4606 thumb2_blx_out_of_range.stdout
4607 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4608 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4609 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4610 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4611 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4612 thumb2_blx_in_range, thumb2_blx_in_range.o,
4613 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4614 thumb2_blx_out_of_range.o): New rules.
4615 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4616 thumb2_blx_in_range and thumb2_blx_out_of_range.
4617 * testsuite/Makefile.in: Regenerate.
4618 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4619 * testsuite/thumb_blx_in_range.s: New file.
4620 * testsuite/thumb_blx_out_of_range.s: New file.
4621
b0193076
RÁE
46222010-03-22 Rafael Espindola <espindola@google.com>
4623
4624 * archive.cc (Should_include): Move to archive.h.
4625 (should_include_member): Make it a member of Archive.
4626 (Lib_group): New.
4627 (Add_lib_group_symbols): New.
4628 * archive.h: Include options.h.
4629 (Archive_member): Moved from Archive.
4630 (Should_include): Moved from archive.cc.
4631 (Lib_group): New.
4632 (Add_lib_group_symbols): New.
4633 * dynobj.cc (do_should_include_member): New.
4634 * dynobj.h (do_should_include_member): New.
4635 * gold.cc (queue_initial_tasks): Update call to queue.
4636 * main.cc (main): Print lib group stats.
4637 * object.cc (do_should_include_member): New.
4638 * object.h: Include archive.h.
4639 (Object::should_include_member): New.
4640 (Object::do_should_include_member): New.
4641 (Sized_relobj::do_should_include_member): New.
4642 * options.cc (General_options::parse_start_lib): New.
4643 (General_options::parse_end_lib): New.
4644 (Input_arguments::add_file): Handle lib groups.
4645 (Input_arguments::start_group): Check we are not in a lib.
4646 (Input_arguments::start_lib): New.
4647 (Input_arguments::end_lib): New.
4648 * options.h (General_options): Add start_lib and end_lib.
4649 (Input_argument::lib_): New.
4650 (Input_argument::lib): New.
4651 (Input_argument::is_lib): New.
4652 (Input_file_lib): New.
4653 (Input_arguments::in_lib_): New.
4654 (Input_arguments::in_lib): New.
4655 (Input_arguments::start_lib): New.
4656 (Input_arguments::end_lib_): New.
4657 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4658 in unused members as preempted.
4659 (Sized_pluginobj::do_should_include_member): New.
4660 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4661 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4662 return the blocker.
4663 (Read_symbols::do_whole_lib_group): New.
4664 (Read_symbols::do_lib_group): New.
4665 (Read_symbols::do_read_symbols): Handle lib groups.
4666 (Read_symbols::get_name): Handle lib groups.
4667 * readsyms.h (Read_symbols): Add an archive member pointer.
4668 (Read_symbols::do_whole_lib_group): New.
4669 (Read_symbols::do_lib_group): New.
4670 (Read_symbols::member_): New.
4671 * script.cc (read_input_script): Update call to queue_soon.
4672
d099120c
DK
46732010-03-19 Doug Kwan <dougkwan@google.com>
4674
4675 * arm.cc (Stub_table::Stub_table): Initialize new data members
4676 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4677 (Stub_table::add_reloc_stub): Assign stub offset and update
4678 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4679 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4680 New data members.
4681 (Stub_table::update_data_size_and_addralign): Use
4682 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4683 instead of going over all reloc stubs.
4684 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4685 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4686 Stringpool_template::offset_ to size of Stringpool_char.
4687 (Stringpool_template::new_key_offset): Remove code to initialize
4688 Stringpool_template::offset_.
4689 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4690 Stringpool_template::offset_ to zero.
4691
1aa37384
DK
46922010-03-15 Doug Kwan <dougkwan@google.com>
4693
4694 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4695 offset_.
4696 (Stringpool_template::new_key_offset): New method.
4697 (Stringpool_template::add_string): Assign offsets when adding new
4698 strings.
4699 (Stringpool_template::set_string_offsets): Do not set string offsets
4700 when not optimizing.
4701 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4702 member size_.
4703 (Chunked_vector::clear): Clear size_.
4704 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4705 (Chunked_vector::size): Return size_.
4706 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4707 (Chunked_vector::size_): New data member.
1aa37384
DK
4708 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4709 (Stringpool_template::new_key_offset): New method declaration.
4710 (Stringpool_template::offset_): New data member.
4711
b672b057
RÁE
47122010-03-15 Rafael Espindola <espindola@google.com>
4713
4714 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4715 Add_symbols' constructor.
4716 * readsyms.h (Add_symbols): Remove the input_group member.
4717
b6848d3c
ILT
47182010-03-10 Ian Lance Taylor <iant@google.com>
4719
4720 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4721 target to ask whether a reference to a symbol requires a stack
4722 split.
4723 * target.h (Target::is_call_to_non_split): New function.
4724 (Target::do_is_call_to_non_split): Declare virtual function.
4725 * target.cc: Include "symtab.h".
4726 (Target::do_is_call_to_non_split): New function.
4727 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4728
a2a5469e
CC
47292010-03-10 Cary Coutant <ccoutant@google.com>
4730
4731 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4732 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4733 (File_read::open[2]): Add whole_file_view_ to list of views.
4734 (File_read::make_view): Remove test of whole_file_view_.
4735 (File_read::find_or_make_view): Create whole_file_view_ if
4736 necessary.
4737 (File_read::clear_views): Replace bool parameter with enum;
4738 adjust all callers. Don't delete views with permanent data;
4739 do delete cached views and views from archives if
4740 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4741 if clearing the corresponding view.
4742 * fileread.h (File_read::Clear_views_mode): New enum.
4743 (File_read::View::is_permanent_view): New method.
4744 (File_read::clear_views): Replace bool parameter
4745 with enum; adjust all callers.
4746 * options.h (General_options): Change keep_files_mapped option;
4747 add map_whole_files.
4748 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4749 releasing the file.
4750 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4751 the file.
4752
8861f32b
DM
47532010-03-10 David S. Miller <davem@davemloft.net>
4754
4755 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4756
d62d0f5f
ST
47572010-03-09 Sriraman Tallam <tmsriram@google.com>
4758
4759 * icf.cc (get_section_contents): Add '@' marker after processing the
4760 merge reloc.
4761
9177756d
DK
47622010-03-08 Doug Kwan <dougkwan@google.com>
4763
4764 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4765 due to a conversion warning.
4766 (Arm_relobj::update_output_local_symbol_count): Check for local
4767 symbol with unset output index.
4768
9e9e071b
ILT
47692010-03-05 Ian Lance Taylor <iant@google.com>
4770
4771 * options.h (class General_options): Add --spare-dynamic-tags.
4772 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4773 --spare-dynamic-tags.
4774
a81ee015
ILT
47752010-03-05 Ian Lance Taylor <iant@google.com>
4776
4777 * incremental.cc: Include "libiberty.h".
4778
44ec90b9
RO
47792010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4780
4781 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4782 function, is_info_ member.
4783 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4784 (Versions::Versions): Update caller.
4785 (Versions::define_base_version): Likewise.
4786 (Versions::add_def): Likewise.
4787
0897ed3b
ST
47882010-03-03 Sriraman Tallam <tmsriram@google.com>
4789
4790 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4791 (Scan::possible_function_pointer_reloc): New function.
4792 (Scan::local_reloc_may_be_function_pointer): Change to call
4793 possible_function_pointer_reloc.
4794 (Scan::global_reloc_may_be_function_pointer): Ditto.
4795 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4796 relocations in ".data.rel.ro._ZTV" section.
4797 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4798 * testsuite/icf_safe_so_test.cc: Ditto.
4799 * testsuite/icf_safe_test.cc: Ditto.
4800 * testsuite/icf_safe_test.sh: Ditto.
4801
d3bbad62
ILT
48022010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4803 Ian Lance Taylor <iant@google.com>
4804
4805 * target-reloc.h (relocate_section): Check the symbol table index
4806 for -1U before setting the local symbol index.
4807 (scan_relocatable_relocs): If copying the relocation, record that
4808 the local symbol is required.
4809 * object.h (Symbol_value::is_output_symtab_index_set): New
4810 function.
4811 (Symbol_value::may_be_discarded_from_output_symtab): New
4812 function.
4813 (Symbol_value::has_output_symtab_entry): New function.
4814 (Symbol_value::needs_output_symtab_entry): Remove.
4815 (Symbol_value::output_symtab_index): Make sure the symbol index is
4816 set.
4817 (Symbol_value::set_output_symtab_index): Make sure the symbol
4818 index is not set. Make sure the new index is valid.
4819 (Symbol_value::set_must_have_output_symtab_entry): New function.
4820 (Symbol_value::has_output_dynsym_entry): New function.
4821 (Symbol_value::set_output_dynsym_index): Make sure the new index
4822 is valid.
4823 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4824 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4825 local symbol if permitted.
4826 (Sized_relobj::do_finalize_local_symbols): Call
4827 is_output_symtab_index_set rather than needs_output_symtab_entry.
4828 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4829 rather than needs_output_symtab_entry. Call
4830 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4831 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4832 is_output_symtab_index_set rather than needs_output_symtab_entry.
4833 * testsuite/discard_locals_relocatable_test.c: New file.
4834 * testsuite/discard_locals_test.sh: Test -r.
4835 * testsuite/Makefile.am (check_DATA): Add
4836 discard_locals_relocatable_test1.syms,
4837 discard_local_relocatable_test2.syms.
4838 (MOSTLYCLEANFILES): Likewise. Also add
4839 discard_locals_relocatable_test1.lout and
4840 discard_locals_relocatable_test2.out.
4841 (discard_locals_relocatable_test1.syms): New target.
4842 (discard_locals_relocatable_test.o): New target.
4843 (discard_locals_relocatable_test1.out): New target.
4844 (discard_locals_relocatable_test2.syms): New target.
4845 (discard_locals_relocatable_test2.out): New target.
4846 (various): Add missing ../ld-new dependencies.
4847 * testsuite/Makefile.in: Rebuild.
4848
7e8ccf26
NC
48492010-03-03 Nick Clifton <nickc@redhat.com>
4850
4851 * po/fi.po: New Finnish translation.
4852
2a0ff005
DK
48532010-03-01 Doug Kwan <dougkwan@google.com>
4854
4855 * layout.cc (Layout::Layout): Force section types of .init_array*,
4856 .preinit_array* and .fini_array* sections.
4857 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4858 Fix check of return value of std::string::find.().
4859 (Output_section::Input_section_sort_compare::operator()): Remove
4860 comment about .init_array.
4861 (Output_section::Input_section_sort_init_fini_compare::operator()):
4862 New method.
4863 (Output_section::sort_attached_input_sections): Handle .init_array
4864 and .fini_array specially.
4865 * output.h (Output_section::Inut_section_sort_compare): Update
4866 comment.
4867 (Output_section::Input_section_sort_init_fini_compare): New struct.
4868
c3e4ae29
DK
48692010-02-26 Doug Kwan <dougkwan@google.com>
4870
4871 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4872 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4873 * testsuite/debug_msg.sh: Avoid matching source line number for
4874 use of global variable undef_int.
4875
2fd9ae7a
DK
48762010-02-26 Doug Kwan <dougkwan@google.com>
4877
4878 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4879 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4880 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4881 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4882 * options.cc (General_options::General_options): Initialize member
4883 fix_v4bx_.
4884 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4885 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4886 and rm_no_fix_v4bx.stdout
4887 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4888 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4889 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4890 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4891 and arm_no_fix_v4bx.
4892 * Makefile.in: Regenerate.
4893 * testsuite/arm_fix_v4bx.s: New file.
4894 * testsuite/arm_fix_v4bx.sh: Ditto.
4895
67ec7d0b
DK
48962010-02-24 Doug Kwan <dougkwan@google.com>
4897
4898 * arm.cc (Target_arm::got_section): Make the .got section the first
4899 non RELRO section in the data segment.
4900 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4901 suffixes of section names.
4902
10165461
DK
49032010-02-24 Doug Kwan <dougkwan@google.com>
4904
4905 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4906 flags and attributes merging if an input file is a binary file.
4907 * fileread.cc (Input_file::open): Record format of original file.
4908 * fileread.h (Input_file::Format): New enum type.
4909 (Input_file::Input_file): Initialize data member format_.
4910 (Input_file::format): New method definition.
4911 (Input_file::format_):: New data member.
4912
4a54abbb
DK
49132010-02-24 Doug Kwan <dougkwan@google.com>
4914
4915 * arm.cc (Arm_output_data_got): New class.
4916 (ARM_TCB_SIZE): New constant
4917 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4918 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4919 If user uses a script with a SECTIONS clause, issue only a warning
4920 for a misplaced EXIDX input section. Otherwise, issue an error.
4921 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4922 garbage collection.
4923 (Target_arm::got_mode_index_entry): Handle static linking.
4924 (Target_arm::Scan::local): Ditto.
4925 (Target_arm::Scan::global): Ditto.
4926 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4927 all incorrectly implemented relocations.
e1df38aa 4928 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4929 Arm_output_section::fix_exidx_coverage.
4930 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4931 from ".ARM.exidx." and ".ARM.extab.".
4932
ca419a6f
ILT
49332010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4934
4935 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4936 section if it does not already exist.
4937 * attributes.cc (Attributes_section_data::Attributes_section_data):
4938 Don't crash if size is zero.
4939
135b9c78
ILT
49402010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4941 Ian Lance Taylor <iant@google.com>
4942
4943 * gold.cc (queue_middle_tasks): If no input files were opened,
4944 exit.
4945 * workqueue.h (Task_function::Task_function): Assert that there is
4946 a blocker.
4947
bb0bfe4f
DK
49482010-02-22 Doug Kwan <dougkwan@google.com>
4949
4950 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4951 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4952 types to avoid warnings due to different uint64_t implementations
4953 on different hosts.
4954
2a2b6d42
DK
49552010-02-21 Doug Kwan <dougkwan@google.com>
4956
4957 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4958 handling of the maximum backward branch offset.
4959 (Arm_relocate_functions::thumb_branch_common): Ditto.
4960 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4961 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4962 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4963 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4964 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4965 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4966 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4967 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4968 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4969 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4970 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4971 thumb2_bl_out_of_range.o): New rules.
4972 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4973 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4974 thumb2_bl_out_of_range
4975 * testsuite/Makefile.in: Regenerate.
4976 * testsuite/arm_bl_in_range.s: New file.
4977 * testsuite/arm_bl_out_of_range.s: Ditto.
4978 * testsuite/arm_branch_in_range.sh: Ditto.
4979 * testsuite/arm_branch_range.t: Ditto.
4980 * testsuite/thumb2_branch_range.t: Ditto.
4981 * testsuite/thumb_bl_in_range.s: Ditto.
4982 * testsuite/thumb_bl_out_of_range.s: Ditto.
4983 * testsuite/thumb_branch_range.t: Ditto.
4984
b487ad64
ST
49852010-02-20 Sriraman Tallam <tmsriram@google.com>
4986
4987 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4988 Add reloc offset information.
4989 * icf.cc (get_section_contents): Change iterators to point to the new
4990 vectors. Add reloc offset information to the contents.
4991 * icf.h (Icf::Sections_reachable_info): New typedef.
4992 (Icf::Sections_reachable_list): New typedef.
4993 (Icf::Offset_info): New typedef.
4994 (Icf::Reloc_info): New struct typedef.
4995 (Icf::Reloc_info_list): New typedef.
4996 (Icf::symbol_reloc_list): Delete method.
4997 (Icf::addend_reloc_list): Delete method.
4998 (Icf::section_reloc_list): Delete method.
4999 (Icf::reloc_info_list): New method.
5000 (Icf::reloc_info_list_): New member.
5001
f96accdf
DK
50022010-02-19 Doug Kwan <dougkwan@google.com>
5003
5004 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5005 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5006 * arm.cc (Arm_relocation_functions): New forward declaration.
5007 (Target_arm::Target_arm): Initialize new data members
5008 got_mod_index_offset_ and tls_base_symbol_defined_.
5009 (Target_arm::Relocate::relocate_tls): New method.
5010 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5011 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5012 New methods.
5013 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5014 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5015 (Target_arm::got_mod_index_offset_,
5016 Target_arm::tls_base_symbol_defined_): New data members.
5017 (Target_arm::Scan::local, Target::Scan::global,
5018 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5019 relocations.
5020
c8761b9a
DK
50212010-02-18 Doug Kwan <dougkwan@google.com>
5022
5023 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5024 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5025 text section as a parameter becuase some broken tools may not set
5026 the link in section header.
5027 (Target_arm::has_got_section): New method.
5028 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5029 without any mapping symbol as data only. Remove warning.
5030 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5031 link in its section header, try to discover the link by inspecting the
5032 REL31 relocation at the beginning of the section.
5033 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5034 in error message.
5035 (Target_arm::Scan::global): Treat any reference to the symbol
5036 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5037
21bb3914
ST
50382010-02-12 Sriraman Tallam <tmsriram@google.com>
5039
5040 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5041 (Scan::global_reloc_may_be_function_pointer): New function.
5042 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5043 (Scan::global_reloc_may_be_function_pointer): New function.
5044 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5045 (Scan::global_reloc_may_be_function_pointer): New function.
5046 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5047 (Scan::global_reloc_may_be_function_pointer): New function.
5048 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5049 (Scan::global_reloc_may_be_function_pointer): New function.
5050 (Scan::possible_function_pointer_reloc): New function.
5051 (Target_x86_64::can_check_for_function_pointers): New function.
5052 * gc.h (gc_process_relocs): Scan relocation types to determine if
5053 function pointers were taken for targets that support it.
5054 * icf.cc (Icf::find_identical_sections): Include functions for
5055 folding in safe ICF whose pointer is not taken.
5056 * icf.h (Secn_fptr_taken_set): New typedef.
5057 (fptr_section_id_): New member.
5058 (section_has_function_pointers): New function.
5059 (set_section_has_function_pointers): New function.
5060 (check_section_for_function_pointers): New function.
5061 * options.h: Fix comment for safe ICF option.
5062 * target.h (can_check_for_function_pointers): New function.
5063 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5064 Modify icf_safe_test for X86-64.
5065 * testsuite/Makefile.in: Regenerate.
5066 * testsuite/icf_safe_so_test.cc: New file.
5067 * testsuite/icf_safe_so_test.sh: New file.
5068 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5069 (main): Change to take pointer to function kept_func_3.
5070 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5071 folding is done correctly for X86-64.
5072
0da6fa6c
DM
50732010-02-12 David S. Miller <davem@davemloft.net>
5074
5075 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5076 is_symbolless parameter.
5077 (Output_reloc<SHT_REL>::is_symbolless): New.
5078 (Output_reloc<SHT_REL>::is_symbolless_): New.
5079 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5080 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5081 (Output_reloc<SHT_RELA>::is_symbolless): New.
5082 (Output_data_reloc::add_global): Handle is_symbolless.
5083 (Output_data_reloc::add_global_relative): Likewise.
5084 (Output_data_reloc::add_local): Likewise.
5085 (Output_data_reloc::add_local_relative): Likewise.
5086 (Output_data_reloc::add_symbolless_global_addend): New.
5087 (Output_data_reloc::add_symbolless_local_addend): New.
5088 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5089 is_symbolless.
5090 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5091 instead of ->is_relative_
5092 (Output_reloc::write): Likewise.
5093 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5094 (Output_reloc::write_rel): Simplify.
5095
5096 * sparc.cc (Target_sparc::Scan::local): Use
5097 ->add_symbolless_local_addend as needed.
5098 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5099 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5100 based upon relocation offset.
5101
e4782e83
DK
51022010-02-11 Doug Kwan <dougkwan@google.com>
5103
5104 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5105 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5106 beginning of function.
5107 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5108 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5109 parameter is_32bit in calls to should_apply_static_reloc.
5110 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5111 (check_DATA): Add arm_abs_global.stdout.
5112 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5113 arm_abs_global.stdout): New rules.
5114 (MOSTLLYCLEANFILES): Add arm_abs_global
5115 * Makefile.in: Regenerate.
5116 * testsuite/arm_abs_global.s: New file.
5117 * testsuite/arm_abs_global.sh: Ditto.
5118 * testsuite/arm_abs_lib.s: Ditto.
5119
93ceb764
ILT
51202010-02-11 Ian Lance Taylor <iant@google.com>
5121
5122 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5123 Read_relocs task.
5124 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5125 Allocate_commons_task first.
5126 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5127 task, rather than symtab_lock_.
5128 (Gc_process_relocs::~Gc_process_relocs): New function.
5129 (Gc_process_relocs::is_runnable): Check this_blocker_.
5130 (Gc_process_relocs::locks): Use next_blocker_ rather than
5131 blocker_.
5132 (Scan_relocs::~Scan_relocs): New function.
5133 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5134 symtab_lock_.
5135 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5136 next_blocker_.
5137 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5138 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5139 constructor accordingly.
5140 (class Gc_process_relocs): Likewise.
5141 (class Scan_relocs): Likewise.
5142 * common.h (class Allocate_commons_task): Remove symtab_lock_
5143 field, and corresponding constructor parameter.
5144 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5145 symtab_lock_.
5146 (Allocate_commons_task::locks): Likewise.
5147
114dfbe1
ILT
51482010-02-11 Ian Lance Taylor <iant@google.com>
5149
5150 * gold-threads.h (class Once): Define.
5151 (class Initialize_lock): Rewrite as child of Once.
5152 * gold-threads.cc (class Once_initialize): Define.
5153 (once_pointer_control): New static variable.
5154 (once_pointer, once_arg): New static variables.
5155 (c_run_once): New static function.
5156 (Once::Once, Once::run_once, Once::internal_run): New functions.
5157 (class Initialize_lock_once): Remove.
5158 (initialize_lock_control): Remove.
5159 (initialize_lock_pointer): Remove.
5160 (initialize_lock_once): Remove.
5161 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5162 (Initialize_lock::initialize): Rewrite.
5163 (Initialize_lock::do_run_once): New function.
5164 * archive.cc (Archive::interpret_header): Only clear name if it is
5165 not already empty.
5166 * fileread.cc: Include "gold-threads.h"
5167 (file_counts_lock): New static variable.
5168 (file_counts_initialize_lock): Likewise.
5169 (File_read::release): Only increment counts when using --stats.
5170 Use a lock around the increment.
5171 * parameters.cc (class Set_parameters_target_once): Define.
5172 (set_parameters_target_once): New static variable.
5173 (Parameters::Parameters): Move here from parameters.h.
5174 (Parameters::set_target): Rewrite.
5175 (Parameters::set_target_once): New function.
5176 (Parameters::clear_target): Move here and rewrite.
5177 * parameters.h (class Parameters): Update declarations. Add
5178 set_parameters_target_once_ field.
5179 (Parameters::Parameters): Move to parameters.cc.
5180 (Parameters::clear_target): Likewise.
5181 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5182 task.
5183 (Start_group::~Start_group): New function.
5184 (Start_group::is_runnable): New function.
5185 (Start_group::locks, Start_group::run): New functions.
5186 (Finish_group::run): Change saw_undefined to size_t.
5187 * readsyms.h (class Start_group): Define.
5188 (class Finish_group): Change saw_undefined_ field to size_t.
5189 (Finish_group::Finish_group): Remove saw_undefined and
5190 this_blocker parameters. Change all callers.
5191 (Finish_group::set_saw_undefined): New function.
5192 (Finish_group::set_blocker): New function.
5193 * symtab.h (class Symbol_table): Change saw_undefined to return
5194 size_t. Change saw_undefined_ field to size_t.
5195 * target-select.cc (Set_target_once::do_run_once): New function.
5196 (Target_selector::Target_selector): Initialize set_target_once_
5197 field. Don't initialize lock_ and initialize_lock_ fields.
5198 (Target_selector::instantiate_target): Rewrite.
5199 (Target_selector::set_target): New function.
5200 * target-select.h (class Set_target_once): Define.
5201 (class Target_selector): Update declarations. Make
5202 Set_target_once a friend. Remove lock_ and initialize_lock_
5203 fields. Add set_target_once_ field.
5204
fa17a3f4
ILT
52052010-02-10 Ian Lance Taylor <iant@google.com>
5206
5207 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5208 queueing any tasks.
5209 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5210 (queue_middle_tasks): Add all blockers before queueing any tasks.
5211 (queue_final_tasks): Likewise.
5212 * token.h (Task_token::add_blockers): New function.
5213 * object.h (Input_objects::number_of_relobjs): New function.
5214
c7177d31
ILT
52152010-02-10 Ian Lance Taylor <iant@google.com>
5216
5de0e392
ILT
5217 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5218 shared, not if not position independent.
5219 * x86_64.cc (Relocate::relocate_tls): Likewise.
5220 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5221 (tls_pie_pic_test): New target.
5222 * testsuite/Makefile.in: Rebuild.
5223
c7177d31
ILT
5224 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5225 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5226 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5227 * testsuite/Makefile.in: Rebuild.
5228
684b268a
DM
52292010-02-09 David S. Miller <davem@davemloft.net>
5230
5231 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5232 R_SPARC_RELATIVE using ->add_local_relative().
5233 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5234
612a8d3d
DM
5235 * output.h (Output_data_dynamic::add_section_size): New method
5236 that takes two Output_data objects.
5237 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5238 entry param. Handle it in initializers.
5239 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5240 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5241 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5242 arg.
5243 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5244 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5245 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5246 for dynrel_includes_plt.
5247 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5248 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5249 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5250 before .rela.plt
5251 (Target_sparc::do_finalize_sections): Update to pass true for
5252 dynrel_includes_plt.
5253 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5254 output before .rela.plt
5255 (Target_powerpc::do_finalize_sections): Update to pass true for
5256 dynrel_includes_plt when 32-bit.
5257
cb1be87e
DK
52582010-02-08 Doug Kwan <dougkwan@google.com>
5259
5260 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5261 method.
5262 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5263 Arm_relobj::scan_section_for_cortex_a8_stubs,
5264 Arm_relobj::do_relocation_section): Instead of calling
5265 Output_section::output_address, use faster
5266 Arm_relobj::simple_input_section_output_address.
5267
705b5121
DM
52682010-02-08 David S. Miller <davem@davemloft.net>
5269
5270 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5271 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5272 relocation helper function.
5273
024c4466
DM
5274 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5275 just like R_SPARC_GOT{10,13,22}.
5276 (Target_sparc::Scan::local): Likewise.
5277 (Target_sparc::Relocate:relocate): Likewise.
5278
9109c078
ILT
52792010-02-06 Ian Lance Taylor <iant@google.com>
5280
5281 * configure.ac: Rewrite targetobjs duplicate removal code to use
5282 only shell constructs.
5283 * configure: Rebuild.
5284
cf846138
DK
52852010-02-05 Doug Kwan <dougkwan@google.com>
5286
5287 PR 11247
5288 * arm.cc (Arm_relobj::section_is_scannable): New method.
5289 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5290 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5291
6cfaf60b
DK
52922010-02-04 Doug Kwan <dougkwan@google.com>
5293
5294 PR 11247
5295 * arm-reloc-property.cc (cstdio): Include.
5296 * configure.ac (targetobjs): Remove duplicates.
5297 * configure: Regenerate.
5298 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5299 big and little endian version for a given address size.
5300
5c57f1be
DK
53012010-02-03 Doug Kwan <dougkwan@google.com>
5302
5303 * arm-reloc-property.cc
5304 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5305 definition.
5306 * arm-reloc-property.h
5307 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5308 New method definition.
5309 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5310 declaration.
5311 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5312 overflow to N.
5313 (GOT_PREL): Change implemented to Y.
5314 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5315 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5316 (Arm_relocate_functions::movw_abs_nc): Remove method.
5317 (Arm_relocate_functions::movt_abs): Ditto.
5318 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5319 (Arm_relocate_functions::thm_movt_abs): Ditto.
5320 (Arm_relocate_functions::movw_rel_nc): Ditto.
5321 (Arm_relocate_functions::movw_rel): Ditto.
5322 (Arm_relocate_functions::movt_rel): Ditto.
5323 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5324 (Arm_relocate_functions:thm_movw_rel): Ditto.
5325 (Arm_relocate_functions:thm_movt_rel): Ditto.
5326 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5327 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5328 New method definitions.
5329 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5330 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5331 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5332 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5333 (Target_arm::Relocate::relocate): Check for non-static or
5334 unimplemented relocation code and exit early. Change calls to
5335 Target_arm::reloc_uses_thumb_bit and
5336 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5337 instead. Refactor code to handle similar relocations to increase
5338 code sharing. Remove check for unsupported relocation code in switch
5339 statement.
5340 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5341 relocation property table to find out size. Change error message to
5342 print out the name of a relocation code instead of the numeric value.
5343 (Target_arm::scan_reloc_for_stub): Use relocation property table
5344 instead of calling Target_arm::reloc_uses_thumb_bit().
5345
218c5831
DK
53462010-02-02 Doug Kwan <dougkwan@google.com>
5347
5348 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5349 types of relaxed input section.
5350
0d31c79d
DK
53512010-02-02 Doug Kwan <dougkwan@google.com>
5352
5353 * Makefile.am (HFILES): Add arm-reloc-property.h.
5354 (DEFFILES): New.
5355 (TARGETSOURCES): Add arm-reloc-property.cc
5356 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5357 (libgold_a_SOURCES): $(DEFFILES)
5358 * Makefile.in: Regenerate.
5359 * arm-reloc-property.cc: New file.
5360 * arm-reloc-property.h: New file.
5361 * arm-reloc.def: New file.
5362 * arm.cc: Update comments.
5363 (arm-reloc-property.h): New included header.
5364 (arm_reloc_property_table): New global variable.
5365 (Target_arm::do_select_as_default_target): New method definition.
5366 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5367 arm-reloc-property to targ_extra_obj.
5368 * parameters.cc (set_parameters_target): Call
5369 Target::select_as_default_target().
5370 * target.h (Target::select_as_default_target): New method definition.
5371 (Target::do_select_as_default_target): Same.
5372
546c7457
DK
53732010-02-01 Doug Kwan <dougkwan@google.com>
5374
5375 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5376 first_output_text_section_.
5377 (Arm_exidx_fixup::first_output_text_section): New method definition.
5378 (Arm_exidx_fixup::first_output_text_section_): New data member.
5379 (Arm_exidx_fixup::process_exidx_section): Record the first text
5380 output section seen.
5381 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5382 and entsize in output section header.
5383
11b861d5
DK
53842010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5385
5386 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5387 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5388 (Arm_relocate_functions::thm_alu11): New Method.
5389 (Arm_relocate_functions::thm_pc8): New Method.
5390 (Arm_relocate_functions::thm_pc12): New Method.
5391 (Target_arm::Scan::local): Handle the relocations.
5392 (Target_arm::Scan::global): Likewise.
5393 (Target_arm::Relocate::relocate): Likewise.
5394 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5395
c9a2c125
DK
53962010-01-29 Doug Kwan <dougkwan@google.com>
5397
5398 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5399 of relocation types as ld.
5400
1521477a
DK
54012010-01-29 Doug Kwan <dougkwan@google.com>
5402
5403 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5404 to public.
5405 (Arm_relocate_functions::thumb_branch_common): Ditto.
5406 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5407 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5408 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5409 Arm_relocate_functions::jump24): Remove.
5410 (Target_arm::Relocate::relocate): Adjust code to call
5411 Arm_relocation_functions::arm_branch_common and
5412 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5413 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5414
e7eca48c
DK
54152010-01-29 Doug Kwan <dougkwan@google.com>
5416
5417 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5418 output_local_symbol_count_needs_update_.
5419 (Arm_relobj::output_local_symbol_count_needs_update,
5420 Arm_relobj::set_output_local_symbol_count_needs_update,
5421 Arm_relobj::update_output_local_symbol_count): New methods.
5422 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5423 member.
5424 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5425 of pointed function as in a R_ARM_PREL31 relocation.
5426 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5427 for output local symbol count updating.
5428 (Target_arm::do_relax): Update output local symbol counts in objects
5429 if necessary.
5430 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5431
02961d7e
ILT
54322010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5433
5434 * arm.cc: Added support for the ARM relocations:
5435 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5436 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5437 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5438 movw_prel_nc).
5439 (Arm_relocate_functions::movw_rel): New method.
5440 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5441 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5442 thm_movw_prel_nc).
5443 (Arm_relocate_functions::thm_movw_rel): New method.
5444 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5445 thm_movt_prel).
5446 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5447 relocations.
5448 (Target_arm::Scan::global): Likewise.
5449 (Target_arm::Relocate::relocate): Likewise.
5450 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5451 Likewise.
5452
b10d2873
ILT
54532010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5454
5455 * arm.cc: Added support for ARM group relocations.
5456 (Target_arm::reloc_needs_sym_origin): New method.
5457 (Arm_relocate_functions::calc_grp_kn): New method.
5458 (Arm_relocate_functions::calc_grp_residual): New method.
5459 (Arm_relocate_functions::calc_grp_gn): New method.
5460 (Arm_relocate_functions::arm_grp_alu): New Method.
5461 (Arm_relocate_functions::arm_grp_ldr): New Method.
5462 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5463 (Arm_relocate_functions::arm_grp_ldc): New Method.
5464 (Target_arm::Scan::local): Handle the ARM group relocations.
5465 (Target_arm::Scan::global): Likewise.
5466 (Target_arm::Relocate::relocate): Likewise.
5467 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5468 Likewise.
5469
2b328d4e
DK
54702010-01-26 Doug Kwan <dougkwan@google.com>
5471
5472 * arm.cc (set): Include.
5473 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5474 pointer type.
5475 (Arm_output_section::Text_section_list): New type.
5476 (Arm_output_section::append_text_sections_to_list): New method.
5477 (Arm_output_section::fix_exidx_coverage): Ditto.
5478 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5479 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5480 Relobj::set_section_offset() instead of
5481 Sized_relobj::invalidate_section_offset().
5482 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5483 parameter for section headers. Ignore relocation sections for
5484 unallocated sections and EXIDX sections.
5485 (Target_arm::fix_exidx_coverage): New method.
5486 (Target_arm::output_section_address_less_than): New type.
5487 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5488 linked text section instead of the EXIDX section.
5489 (Arm_output_section::create_stub_group): Add an assertion to check
5490 that this is not an EXIDX output section.
5491 (Arm_output_section::append_text_sections_to_list): New method.
5492 (Arm_output_section::fix_exidx_coverage): Ditto.
5493 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5494 Arm_relobj::section_needs_reloc_stub_scanning.
5495 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5496 first pass.
5497 (Target_arm::fix_exidx_coverage): New method.
5498 * object.h (Relobj::set_output_section): New method.
5499 (Sized_relobj::invalidate_section_offset): Remove method.
5500 (Sized_relobj::do_invalidate_section_offset): Remove method.
5501 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5502
c7f3c371
DK
55032010-01-25 Doug Kwan <dougkwan@google.com>
5504
5505 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5506 Fix warning due to signed and unsigned comparison on a 32-bit host.
5507
8923b24c
DK
55082010-01-22 Doug Kwan <dougkwan@google.com>
5509
5510 * arm.cc (Target_arm::do_relax): Record an output section for section
5511 offset adjustment it contains any stub table that has changed.
5512 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5513 offsets in an output section if necessary.
5514 * output.cc (Output_section::Output_section): Initialize
5515 section_offsets_need_adjustments_.
5516 (Output_section::add_input_section_for_script): Renamed to
5517 Output_section::add_simple_input_section.
5518 (Output_section::save_states): Add a comment.
5519 (Output_section::discard_states): New method defintion.
5520 (Output_section::adjust_section_offsets): Same.
5521 * output.h (Output_section::add_input_section_for_script): Renamed to
5522 Output_section::add_simple_input_section.
5523 (Output_section::discard_states): New method declaration.
5524 (Output_section::adjust_section_offsets): Same.
5525 (Output_section::section_offsets_need_adjustment,
5526 Output_section::set_section_offsets_need_adjustment): New method
5527 definitions.
5528 (Output_section::section_offsets_need_adjustment_): New data member.
5529 * script-sections.cc
5530 (Output_section_element_input::set_section_address): Adjust code for
5531 renaming of Output_section::add_input_section_for_script.
5532 (Orphan_output_section::set_section_address): Same.
5533
9b2fd367
DK
55342010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5535
5536 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5537 Fix_v4bx enum values .
5538 * gold/options.h (General_options): New option definitions.
5539 (General_options::fix_v4bx): New method.
5540 (General_options::Fix_v4bx): New enum.
5541 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5542 (General_options::parse_fix_v4bx_interworking): New method.
5543
80d0d023
DK
55442010-01-22 Doug Kwan <dougkwan@google.com>
5545
5546 * arm.cc (Arm_exidx_fixup): New class.
5547
af2cdeae
DK
55482010-01-21 Doug Kwan <dougkwan@google.com>
5549
5550 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5551 classes.
5552 (Arm_exidx_section_offset_map): New type.
5553
993d07c1
DK
55542010-01-21 Doug Kwan <dougkwan@google.com>
5555
5556 * arm.cc (Arm_exidx_input_section): New class.
5557 (Arm_relobj::exidx_input_section_by_link,
5558 Arm_relobj::exidx_input_section_by_shndx,
5559 Arm_relobj::make_exidx_input_section): New methods.
5560 (read_arm_attributes_section): Remove.
5561 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5562 information about them.
5563 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5564 to here.
5565
5ac169d4
DK
55662010-01-20 Doug Kwan <dougkwan@google.com>
5567
5568 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5569 Input_section_specifier to Section_id.
5570 (Target_arm::new_arm_input_section: Adjust code for change of key
5571 type.
5572 (Target_arm::find_arm_input_section): Ditto.
5573 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5574 (Section_id): Remove.
5575 (Garbage_collection::Section_id_hash): Remove.
5576 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5577 (Section_id): Remove.
5578 (Icf::Section_id_hash): Remove.
5579 * object.h (Section_id, Const_section_id, Section_id_hash,
5580 Const_section_id_hash): New type definitions.
5581 * output.cc (Output_section::add_relaxed_input_section): Change to
5582 use Const_section_id instead of Input_section_specifier as key type.
5583 (Output_section::add_merge_input_section): Ditto.
5584 (Output_section::build_relaxation_map): Change to use Section_id
5585 instead of Input_section_specifier as key type.
5586 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5587 Ditto.
5588 (Output_section::convert_input_sections_to_relaxed_sections): Change
5589 to use Const_section_id instead of Input_section_specifier as key type.
5590 (Output_section::find_merge_section): Ditto.
5591 (Output_section::find_relaxed_input_section): Ditto.
5592 * output.h (Input_section_specifier): Remove class.
5593 (Output_section::Output_section_data_by_input_section_map): Change
5594 key type to Const_section_id.
5595 (Output_section::Output_relaxed_input_section_by_input_section_map):
5596 Ditto.
5597 (Output_section::Relaxation_map): Change key type to Section_id.
5598
a2162063
ILT
55992010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5600
5601 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5602 (class Arm_v4bx_stub): New class.
5603 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5604 (Stub_factory::make_arm_v4bx_stub): New method.
5605 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5606 (Stub_table::empty): Handle v4bx stubs.
5607 (Stub_table::add_arm_v4bx_stub): New method.
5608 (Stub_table::find_arm_v4bx_stub): New method.
5609 (Arm_relocate_functions::v4bx): New method.
5610 (Target_arm::fix_v4bx): New method.
5611 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5612 (Stub_table::relocate_stubs): Likewise.
5613 (Stub_table::do_write): Likewise.
5614 (Stub_table::update_data_size_and_addralign): Likewise.
5615 (Stub_table::finalize_stubs): Likewise.
5616 (Target_arm::Scan::local): Likewise.
5617 (Target_arm::Scan::global): Likewise.
5618 (Target_arm::do_finalize_sections): Likewise.
5619 (Target_arm::Relocate::relocate): Likewise.
5620 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5621 Likewise.
5622 (Target_arm::scan_reloc_for_stub): Likewise.
5623 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5624
5696ab0b
ILT
56252010-01-19 Ian Lance Taylor <iant@google.com>
5626
5627 * output.cc (Output_section_headers::do_sized_write): Write large
5628 segment count to sh_info field.
5629 (Output_file_header::do_sized_write): For large segment count,
5630 write PN_XNUM to e_phnum field.
5631
800d0f56
ILT
56322010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5633
5634 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5635 (Arm_relocate_functions::thm_jump8): New function.
5636 (Arm_relocate_functions::thm_jump11): New function.
5637 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5638 R_ARM_THM_JUMP11.
5639 (Target_arm::Scan::global): Likewise.
5640 (Target_arm::Relocate::relocate): Likewise.
5641 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5642 Likewise.
5643
41263c05
DK
56442010-01-14 Doug Kwan <dougkwan@google.com>
5645
5646 * arm.cc (map, utility): Include headers.
5647 (Target_arm::apply_cortex_a8_workaround): New method.
5648 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5649 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5650 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5651 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5652 the --[no-]fix-cortex-a8 command line options.
5653 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5654 (Target_arm::relocate_stub): Use addend in instruction template.
5655 * options.h (DEFINE_bool): Set the user-set flag.
5656 (General_options): Add --[no-]-fix-cortex options.
5657 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 5658 : Update fast look-up map after conversion.
41263c05 5659
459e9b03
ST
56602010-01-14 Sriraman Tallam <tmsriram@google.com>
5661
5662 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5663 in the first pass of do_layout.
5664
b521dfe4
DK
56652010-01-13 Doug Kwan <dougkwan@google.com>
5666
5667 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5668 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5669 apparent compiler problem of not folding static constant integral
5670 data members of elfcpp::Elf_sizes<32>.
5671
44272192
DK
56722010-01-13 Doug Kwan <dougkwan@google.com>
5673
5674 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5675 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5676 Arm_relobj::scan_section_for_cortex_a8_erratum,
5677 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5678 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5679 sections to scan for relocation stubs into a new method
5680 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5681 relocation and Cortex-A8 stub scanning.
5682 (Target_arm::do_relax): Force stubs to be after stubbed sections
5683 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 5684 the beginning of a new relaxation pass. Update a comment.
44272192
DK
5685 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5686
44b71ece
ILT
56872010-01-12 Ian Lance Taylor <iant@google.com>
5688
5689 * target-reloc.h (visibility_error): New inline function.
5690 (relocate_section): Call visibility_error.
5691 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5692 (MOSTLYCLEANFILES): Likewise.
5693 (protected_4_pic.o, protected_3.err): New targets.
5694 * testsuite/protected_4.cc: New file.
5695
a120bc7f
DK
56962010-01-12 Doug Kwan <dougkwan@google.com>
5697
5698 * arm.cc (Cortex_a8_reloc): New class.
5699 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5700 and cortex_a8_relocs_info_.
5701 (Target_arm::fix_cortex_a8): New method definition.
5702 (Target_arm::Cortex_a8_relocs_info): New type.
5703 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5704 New data member declarations.
5705 (Target_arm::scan_reloc_for_stub): Record information about
5706 relocations for THUMB branches that might be exempted from the
5707 Cortex-A8 workaround.
5708 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5709 at the beginning of a relaxation pass.
5710
20138696
DK
57112010-01-12 Doug Kwan <dougkwan@google.com>
5712
5713 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5714 (Arm_relobj::Mapping_symbol_position,
5715 Arm_reloj::Mapping_symbol_position_less,
5716 Arm_relobj::Mapping_symbols_info): New types.
5717 (Target_arm::is_mapping_symbol_name): New method definition.
5718 (Arm_relobj::do_count_local_symbols): Save information about mapping
5719 symbols.
5720
089d69dc
DK
57212010-01-11 Doug Kwan <dougkwan@google.com>
5722
5723 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5724 Arm_relocate_functions::thumb32_branch_upper,
5725 Arm_relocate_functions::thumb32_branch_lower,
5726 Arm_relocate_functions::thumb32_cond_branch_offset,
5727 Arm_relocate_functions::thumb32_cond_branch_upper,
5728 Arm_relocate_functions::thumb32_cond_branch_lower,
5729 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5730 branch offset encoding.
5731 (Arm_relocate_functions::thumb_branch_common): Use new branch
5732 offset encoding methods to avoid code duplication.
5733 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5734 (Stub_addend_reader::operator()): Use new branch encoding method
5735 to avoid code duplication.
5736
99e5bff2
DK
57372010-01-11 Doug Kwan <dougkwan@google.com>
5738
5739 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5740 (Target_arm::do_finalize_sections): Define special EXIDX section
5741 symbols only if referenced.
5742 * gc.h (Garbage_collection::add_reference): New method.
5743 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5744 code duplication.
5745
98e090bd
ILT
57462010-01-11 Ian Lance Taylor <iant@google.com>
5747
d0a91bd8
ILT
5748 * script.cc (Version_script_info::build_expression_list_lookup):
5749 Change complaing about duplicate wildcard match from error to
5750 warning.
5751
98e090bd
ILT
5752 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5753 of 2009-12-30.
5754 (Version_script_info::Version_script_info): Initialize globs_,
5755 default_version_, default_is_global_, and exact_. Don't
5756 initialize globals_ or locals_.
5757 (Version_script_info::build_lookup_tables): Build local symbols
5758 first.
5759 (Version_script_info::unquote): New function.
5760 (Version_script_info::add_exact_match): New function.
5761 (Version_script_info::build_expression_list_lookup): Remove lookup
5762 parameter. Add is_global parameter. Change all callers. Handle
5763 wildcard pattern specially. Unquote pattern. Call
5764 add_exact_match.
5765 (Version_script_info::get_name_to_match): New function.
5766 (Version_script_info::get_symbol_version): New function.
5767 (Version_script_info::get_symbol_version_helper): Remove.
5768 (Version_script_info::check_unmatched_names): Call unquote.
5769 * script.h (class Version_script_info): Change get_symbol_version
5770 to be non-inline and add is_global parameter; change all callers.
5771 Rewrite symbol_is_local. Update declarations. Define struct
5772 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5773 Remove globals_ and locals_ members. Add exact_, globs_,
5774 default_version_, is_global_.
5775 (Version_script_info::Glob): Remove pattern, add expression and
5776 is_global. Update constructor. Change all callers.
5777 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5778 default version.
5779 (Versions::symbol_section_contents): If a symbol is undefined, or
5780 defined in a dynamic object, set the version index to
5781 VER_NDX_LOCAL.
5782 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5783 symbol_is_local.
5784 (Symbol_table::add_from_pluginobj): Likewise.
5785 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5786
d56962d3
DK
57872010-01-11 Doug Kwan <dougkwan@google.com>
5788
5789 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5790 (incremental_dump_LDADD): Add linking option for libintl.
5791 * Makefile.in: Regenerate.
5792
94e6ee91
L
57932010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5794
5795 PR gold/11144
5796 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5797 instead of -Ds.
5798 * testsuite/Makefile.in: Regenerated.
5799
e96c574b
DK
58002010-01-10 Doug Kwan <dougkwan@google.com>
5801
5802 * options.h (DEFINE_var): Use parentheses around argument varname__
5803 in macro body to avoid any unintended subsequent substitutions.
5804
7198066b
ILT
58052010-01-10 Ian Lance Taylor <iant@google.com>
5806
ba4d53bf
ILT
5807 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5808 candidates before doing symbol resolution.
5809
7198066b
ILT
5810 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5811 ODR candidates if only one is weak.
5812
a2beed37
ILT
58132010-01-08 Ian Lance Taylor <iant@google.com>
5814
5815 * script.cc (Version_script_info::build_expression_list_lookup):
5816 Don't warn about ambiguous version, just record the ambiguity.
5817 (Version_script_info::get_symbol_version_helper): Give error if
5818 version is ambiguous.
5819
2fb7225c
DK
58202010-01-08 Doug Kwan <dougkwan@google.com>
5821
5822 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5823 prev_data_size_ and prev_addralign_. Remove initializer for
5824 deleted data member has_been_changed_.
5825 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5826 to determine if the table is empty.
5827 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5828 Remove.
5829 (Stub_table::add_reloc_stub): Define method in class definition
5830 instead of just declaring it there.
5831 (Stub_table::add_cortex_a8_stub): New method definition.
5832 (Stub_table::update_data_size_and_addralign): Ditto.
5833 (Stub_table::finalize_stubs): Ditto.
5834 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5835 (Stub_table::do_addralign_): Return address alignment in the
5836 (Stub_table::do_reset_address_and_file_offset): Define method in
5837 class definition instead of declaring it there. Set current data
5838 size to be the data size of the previous pass.
5839 (Stub_table::set_final_data_size): Use current data size as the
5840 final data size.
5841 (Stub_table::relocate_stub): Change parameter type of stub from
5842 Reloc_stub pointer to Stub pointer.
5843 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5844 (Stub_table::Cortex_a8_stub_list): New typedef.
5845 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5846 Stub_table::prev_addralign_): New data member.
5847 (Arm_relobj::Arm_relobj): Initialize data member
5848 section_has_cortex_a8_workaround_.
5849 (Arm_relobj::section_has_cortex_a8_workaround,
5850 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5851 definitions.
5852 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5853 declarations.
5854 (Target_arm::relocate_stub): Change parameter type of stub from
5855 Reloc_stub pointer to Stub pointer.
5856 (Insn_template::size, Insn_template::alignment): Handle
5857 THUMB16_SPECIAL_TYPE.
5858 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5859 Stub_table::update_data_size_and_addralign,
5860 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5861 definitions.
5862 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5863 (Stub_table::do_write): Ditto.
5864 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5865
880cd20d
ILT
58662010-01-08 Ian Lance Taylor <iant@google.com>
5867
5868 PR 11108
5869 * symtab.h (class Symbol): Remove fields is_target_special_ and
5870 has_plt_offset_. Add field is_defined_in_discarded_section_.
5871 (Symbol::is_defined_in_discarded_section): New function.
5872 (Symbol::set_is_defined_in_discarded_section): New function.
5873 (Symbol::has_plt_offset): Rewrite.
5874 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5875 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5876 Don't initialize is_target_special_ or has_plt_offset_.
5877 Initialize is_defined_in_discarded_section_.
5878 (Symbol_table::add_from_relobj): If appropriate, set
5879 is_defined_in_discarded_section.
5880 * resolve.cc (Symbol::override_base_with_special): Don't test
5881 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5882 * target-reloc.h (relocate_section): Do special handling for
5883 symbols defined in discarded sections for global symbols as well
5884 as local symbols.
5885
2703e3eb
ILT
58862010-01-08 Ian Lance Taylor <iant@google.com>
5887
5888 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5889 the SHT_SYMTAB case.
5890
339d40a3
ILT
58912010-01-08 Ian Lance Taylor <iant@google.com>
5892
5893 * object.cc (Sized_relobj::do_layout): Don't get confused if
5894 layout_eh_frame returns NULL.
5895
abecea76
ILT
58962010-01-08 Ian Lance Taylor <iant@google.com>
5897
5898 PR 11084
5899 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5900 dynamic symbol table, use the normal symbol table.
5901 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5902 symbol table.
5903
6b7dd3f3
ILT
59042010-01-08 Ian Lance Taylor <iant@google.com>
5905
5906 PR 11072
5907 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5908 sections.
5909
36c50e63
L
59102010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5911
5912 * version.cc (print_version): Change to "Copyright 2010".
5913
e291e7b9
ILT
59142010-01-08 Ian Lance Taylor <iant@google.com>
5915
5916 PR 10287
5917 PR 11063
5918 * i386.cc (class Target_i386): Change return type of plt_section
5919 to be non-const.
5920 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5921 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5922 tls_desc_rel_ field.
5923 (Output_data_plt_i386::rel_tls_desc): New function.
5924 (Target_i386::rel_tls_desc_section): New function.
5925 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5926 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5927 R_386_TLS_DESC reloc in rel_tls_desc_section.
5928 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5929 Define struct Tlsdesc_info.
5930 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5931 (Target_x86_64::do_reloc_symbol_index): New function.
5932 (Target_x86_64::add_tlsdesc_info): New function.
5933 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5934 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5935 tlsdesc_rel_ field.
5936 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5937 all callers.
5938 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5939 (Target_x86_64::rela_tlsdesc_section): New function.
5940 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5941 handling.
5942 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5943 (Target_x86_64::do_reloc_addend): New function.
5944 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5945 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5946 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5947 (Output_reloc::type): New function.
5948 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5949 (Output_reloc::is_target_specific): New function.
5950 (Output_reloc::target_arg): New function.
5951 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5952 absolute relocs and target specific relocs.
5953 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5954 add_target_specific.
5955 (class Output_data_reloc) [SHT_RELA]: Likewise.
5956 * output.cc (Output_reloc::Output_reloc): Add four new versions
5957 for absolute relocs and target specific relocs.
5958 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5959 (Output_reloc::get_symbol_index): Likewise.
5960 (Output_reloc::local_section_offset): Check that local_sym_index_
5961 is not TARGET_CODE or 0.
5962 (Output_reloc::symbol_value): Likewise.
5963 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5964 reloc.
5965 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5966 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5967 functions.
5968 * layout.cc (add_target_dynamic_tags): Use output section for
5969 DT_PLTRELSZ and DT_JMPREL.
5970
3a44184e
ILT
59712010-01-07 Ian Lance Taylor <iant@google.com>
5972
5973 PR 11061
5974 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5975 function.
5976 (class Output_data_reloc_generic): Define.
5977 (class Output_data_reloc_base): Change base class to
5978 Output_data_reloc_generic. Change add() method to call
5979 bump_relative_reloc_count for a relative reloc. Remove
5980 sort_relocs_ field.
5981 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5982 to sort_relocs().
5983 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5984 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5985 appropriate.
5986 * layout.h (class Layout): Update declaration.
5987
ea715a34
ILT
59882010-01-07 Ian Lance Taylor <iant@google.com>
5989
5990 * output.h (class Output_data): Add const version of
5991 output_section and do_output_section.
5992 (class Output_section_data): Add const version of
5993 do_output_section.
5994 (class Output_section): Likewise.
5995 * layout.cc (Layout::add_target_dynamic_tags): New function.
5996 * layout.h (class Layout): Update declarations.
5997 * arm.cc (Target_arm::do_finalize_sections): Use
5998 add_target_dynamic_tags.
5999 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6000 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6001 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6002 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6003
659948a4
ILT
60042010-01-07 Ian Lance Taylor <iant@google.com>
6005
6006 PR 11042
6007 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6008 object as needed.
6009
9d3b86f6
ILT
60102010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6011 Ian Lance Taylor <iant@google.com>
6012
6013 PR 11019
6014 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6015 Xindex::read_symtab_xindex.
6016
bb0d3eb0
DK
60172010-01-07 Doug Kwan <dougkwan@google.com>
6018
6019 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6020 (Insn_template::thumb16_bcond_insn): New method declaration.
6021 (Insn_template): Fix spelling.
6022 (Stub::thumb16_special): New method declaration.
6023 (Stub::do_write): Define virtual method which was previously pure
6024 virtual.
6025 (Stub::do_thumb16_special): New method declaration.
6026 (Stub::do_fixed_endian_write): New template member.
6027 (Reloc_stub::do_write): Remove.
6028 (Reloc_stub::do_fixed_endian_write): Remove.
6029 (Cortex_a8_stub): New class definition.
6030 (Stub_factory::make_cortex_a8_stub): New method definition.
6031 (Stub_factory::Stub_factory): Add missing static storage class
6032 qualifier for elf32_arm_stub_a8_veneer_blx.
6033
ffeef7df
ILT
60342010-01-07 Ian Lance Taylor <iant@google.com>
6035
dc3f80fe
ILT
6036 PR 10980
6037 * options.h (class General_options): Add --warn-unresolved-symbols
6038 and --error-unresolved-symbols.
6039 * errors.cc (Errors::undefined_symbol): Implement
6040 --warn-unresolved-symbols.
6041
ffeef7df
ILT
6042 * options.h (class General_options): Add -z text and -z textoff.
6043 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6044
f1ec9ded
ST
60452010-01-06 Sriraman Tallam <tmsriram@google.com>
6046
6047 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6048 (Garbage_collection::cident_sections): New function.
6049 (Garbage_collection::add_cident_section): New function.
6050 (Garbage_collection::cident_sections_): New member.
6051 (gc_process_relocs): Add references to sections whose names are C
6052 identifiers.
6053 * gold.h (cident_section_start_prefix): New constant.
6054 (cident_section_stop_prefix): New constant.
6055 (is_cident): New function.
6056 * layout.cc (Layout::define_section_symbols): Replace string constants
6057 with the newly defined constants.
6058 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6059 C identifiers.
6060 * testsuite/Makefile.am: Add gc_orphan_section_test.
6061 * testsuite/Makefile.in: Regenerate.
6062 * testsuite/gc_orphan_section_test.cc: New file.
6063 * testsuite/gc_orphan_section_test.sh: New file.
6064
6eda8c29
ILT
60652010-01-06 Ian Lance Taylor <iant@google.com>
6066
b9674e17
ILT
6067 PR 10980
6068 * options.h (class General_options): Add --warn-shared-textrel.
6069 * layout.cc (Layout::finish_dynamic_section): Implement
6070 --warn-shared-textrel.
6071
6eda8c29
ILT
6072 PR 10980
6073 * options.h (class General_options): Add --warn-multiple-gp.
6074
32dcd44e
ILT
60752010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6076
6077 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6078 $(THREADSLIB) and $(LIBDL).
6079 * Makefile.in: Rebuild.
6080
a192ba05
ILT
60812010-01-06 Ian Lance Taylor <iant@google.com>
6082
6083 PR 10980
6084 * options.cc (General_options::parse_section_start): New function.
6085 (General_options::section_start): New function.
6086 (General_options::General_options): Initialize all members.
6087 * options.h: Include <map>
6088 (class General_options): Add --section-start. Add section_starts_
6089 member.
6090 * layout.cc (Layout::attach_allocated_section_to_segment): If
6091 --section-start was used, set the address of the segment. Remove
6092 local sort_sections.
6093 (Layout::relaxation_loop_body): If the address of the load segment
6094 has been set by --section-start, don't use it.
6095 * output.h (Output_segment::update_flags_for_output_section): New
6096 function.
6097 * output.cc (Output_segment::add_output_section): Call
6098 update_flags_for_output_section.
6099
dde3f402
ILT
61002010-01-05 Ian Lance Taylor <iant@google.com>
6101
62dfdd4d
ILT
6102 PR 10980
6103 * options.h (class General_options): Add --undefined-version.
6104 * script.cc (struct Version_expression): Add was_matched_by_symbol
6105 field.
6106 (Version_script_info::matched_symbol): New function.
6107 (Version_script_info::get_symbol_version_helper): Call
6108 matched_symbol.
6109 (Version_script_info::check_unmatched_names): New function.
6110 * script.h (class Version_script_info): Update declarations.
6111 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6112
9c4ae156
ILT
6113 * options.h (class General_options): Use DEFINE_bool_alias for
6114 allow_multiple_definition.
6115 * resolve.cc (Symbol_table::should_override): Don't test
6116 allow_multiple_definition.
6117
dde3f402
ILT
6118 PR 10980
6119 * options.h (class General_options): Add --cref.
6120 * main.cc (main): Print cref table if --cref. Don't close mapfile
6121 until after printing cref table.
6122 * cref.cc: Include "symtab.h".
6123 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6124 (Cref_table_compare::operator()): New function.
6125 (Cref_inputs::gather_cref): New function.
6126 (filecol): New static const.
6127 (Cref_inputs::print_cref): New function.
6128 (Cref::print_cref): New function.
6129 * cref.h: Include <cstdio>.
6130 (class Cref): Update declarations.
6131 * mapfile.h (Mapfile::file): New function.
6132 * object.h (class Object): Define Symbols. Declare virtual
6133 do_get_global_symbols.
6134 (Object::get_global_symbols): New function.
6135 * object.cc (Input_objects::add_object): Pass object to cref_ if
6136 --cref.
6137 (Input_objects::archive_start): Likewise.
6138 (Input_objects::archive_stop): Likewise.
6139 (Input_objects::print_cref): New function.
6140 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6141 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6142 --cref.
6143 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6144 function.
6145 * plugin.h (class Sized_pluginobj): Update declarations.
6146
8781f709
ILT
61472010-01-05 Ian Lance Taylor <iant@google.com>
6148
6149 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6150 to is_default_version. Rename insdef to insdefault.
6151 (Symbol_table::add_from_relobj): Rename def to is_default_version
6152 and local to is_forced_local.
6153 (Symbol_table::add_from_pluginobj): Likewise.
6154 (Symbol_table::add_from_dynobj): Likewise.
6155 (Symbol_table::define_special_symbol): Rename insdef to
6156 insdefault.
6157
fe35d28d
ILT
61582010-01-04 Ian Lance Taylor <iant@google.com>
6159
30bc8c46
ILT
6160 PR 10980
6161 * options.h (class General_options): Add
6162 --allow-multiple-definition and -z muldefs.
6163 * resolve.cc (Symbol_table::should_override): Don't warn about a
6164 multiple symbol definition if --allow-multiple-definition or -z
6165 muldefs.
6166
7eaea549
ILT
6167 PR 10980
6168 * options.h (class General_options): Add --add-needed and
6169 --copy-dt-needed-entries. Tweak --as-needed help entry.
6170 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6171 error if --copy-dt-needed-entries aka --add-needed is used and
6172 would cause a change in behaviour.
6173
fe35d28d
ILT
6174 PR 10980
6175 * options.h (class General_options): Add -G as a short version of
6176 --shared. Add no-op options -assert, -g, and -i.
6177
55a2bb35
ST
61782010-01-04 Sriraman Tallam <tmsriram@google.com>
6179
6180 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6181 check for .text or .gnu.linkonce.t sections.
6182 * icf.cc (Icf::find_identical_sections): Ditto.
6183 Change the detection for mangled function name within the section
6184 name.
6185 * icf.h (is_section_foldable_candidate): New function.
6186
719328e1
ILT
61872009-12-30 Ian Lance Taylor <iant@google.com>
6188
6189 PR 10980
6190 * options.h (class General_options): Permit two dashes with
6191 --retain-symbols-file.
6192
d7bb5745
ILT
61932009-12-30 Ian Lance Taylor <iant@google.com>
6194
403a15dd
ILT
6195 PR 10979
6196 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6197 don't put the file header and segment headers in the text
6198 segment.
6199
eda294df
ILT
6200 PR 10979
6201 * common.cc (Sort_commons::operator()): Stabilize sort when both
6202 entries are NULL.
6203 (Symbol_table::do_allocate_commons_list): When allocating common
6204 symbols, skip a symbol which is no longer common.
6205 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6206 an object before checking its type.
6207 * testsuite/common_test_2.c: New file.
6208 * testsuite/common_test_3.c: New file.
6209 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6210 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6211 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6212 (common_test_2_pic.o, common_test_2.so): New targets.
6213 (common_test_3_pic.o, common_test_3.so): New targets.
6214 * testsuite/Makefile.in: Rebuild.
6215
d7bb5745
ILT
6216 PR 10979
6217 * script.cc (read_input_script): If we see a new SECTIONS clause,
6218 and we have added an input section, give an error.
6219 * layout.h (class Layout): Add have_added_input_section function.
6220 Add have_added_input_section_ field.
6221 * layout.cc (Layout::Layout): Initialize
6222 have_added_input_section_.
6223 (Layout::layout): Set have_added_input_section_.
6224 (Layout::layout_eh_frame): Likewise.
6225
fc59c572
ILT
62262009-12-30 Ian Lance Taylor <iant@google.com>
6227
6228 PR 10931
6229 * options.h (class General_options): Add --sort-common option.
6230 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6231 * common.cc (Sort_common): Add sort_order parameter to
6232 constructor. Add sort_order_ field.
6233 (Sort_commons::operator): Check sort_order_.
6234 (Symbol_table::allocate_commons): Determine the sort order.
6235 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6236 Change all callers.
6237 (Symbol_table::do_allocate_commons_list): Likewise.
6238
1c74fab0
ILT
62392009-12-30 Ian Lance Taylor <iant@google.com>
6240
6241 PR 10916
6242 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6243 symbols from this object, don't change the visibility of an
6244 undefined symbol.
6245 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6246
6affe781
ILT
62472009-12-30 Ian Lance Taylor <iant@google.com>
6248
6249 PR 10861
6250 * script.h (class Version_script_info): Define Language enum.
6251 Update declarations. Define Glob, Exact, and Lookup types. Add
6252 new fields globals_, locals_, and is_finalized_.
6253 * script.cc: Various formatting fixes.
6254 (class Parser_closure): Change language_stack_ from a vector of
6255 std::string to one of Version_script_info::Language. Adjust all
6256 uses accordingly.
6257 (class Lazy_demangler): Remove.
6258 (struct Version_expression): Change language from std::string to
6259 Version_script_info::Language.
6260 (Version_script_info::Version_script_info): New function.
6261 (Version_script_info::~Version_script_info): Don't call clear.
6262 (Version_script_info::finalize): New function.
6263 (Version_script_info::build_lookup_tables): New function.
6264 (Version_script_info::build_expression_list_lookup): New
6265 function.
6266 (Version_script_info::get_symbol_version_helper): Rewrite to use
6267 lookup tables.
6268 (Version_script_info::print_expression_list): Adjust to use
6269 Version_script_info::Language.
6270 (script_push_lex_into_version_mode): Check that the version script
6271 has not been finalized.
6272 (version_script_push_lang): Change language string to
6273 Version_script_info::Language.
6274 * options.cc (Command_line::version_script): New function.
6275 * options.h (class General_options): Add finalize_dynamic_list
6276 function. Change version_script from declaration to definition.
6277 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6278 * testsuite/version_script.map: Remove duplicate def of foo.
6279 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6280 version_script.map.
6281 * testsuite/Makefile.in: Rebuild.
6282
818bf354
ILT
62832009-12-30 Ian Lance Taylor <iant@google.com>
6284
6285 PR 10843
6286 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6287 if the input symbol index is 0, make the output symbol index 0.
6288
ebcc8304
ILT
62892009-12-30 Ian Lance Taylor <iant@google.com>
6290
6291 PR 10670
6292 * options.h (class General_options): Add -x/--discard-all.
6293 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6294 --discard-all. If the local symbol needs a dynamic entry, check
6295 that before handling --discard-locals.
6296
176fe33f
ILT
62972009-12-30 Ian Lance Taylor <iant@google.com>
6298
bb321bb1
ILT
6299 PR 10450
6300 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6301 flags to PF_R.
6302 (Output_segment::add_output_section): Don't change the flags if
6303 the type is PT_TLS.
6304
176fe33f
ILT
6305 PR 10450
6306 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6307 GNU hash table if they need a dynamic value. Otherwise, don't add
6308 them if they are defined in a dynamic object or are forced local.
6309
e8cd95c7
ILT
63102009-12-29 Ian Lance Taylor <iant@google.com>
6311
1b81fb71
ILT
6312 PR 10450
6313 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6314 .gnu.hash table for a 32-bit target.
6315
8d6d383d
ILT
6316 PR 10450
6317 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6318 regular and a dynamic object only needs a dynamic symbol table
6319 entry if it is externally visible.
6320
e785ec03
ILT
6321 PR 10450
6322 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6323 constructor. Add global_offset_table_ field.
6324 (Target_i386::got_section): Set global_offset_table_.
6325 (Target_i386::do_finalize_sections): Set global_offset_table_
6326 size.
6327 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6328 in constructor. Add global_offset_table_ field.
6329 (Target_x86_64::got_section): Set global_offset_table_.
6330 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6331 size.
6332
1a2dff53
ILT
6333 * layout.cc (Layout::Layout): Initialize increase_relro_.
6334 (Layout::get_output_section): Add is_relro, is_last_relro, and
6335 is_first_non_relro parameters. Change all callers.
6336 (Layout::choose_output_section): Likewise.
6337 (Layout::add_output_section_data): Likewise.
6338 (Layout::make_output_section): Likewise.
6339 (Layout::set_segment_offsets): Clear increase_relro when using a
6340 linker script.
6341 * layout.h (class Layout): Add increase_relro method. Add
6342 increase_relro_ field. Update declarations.
6343 * output.cc (Output_section::Output_section): Initialize
6344 is_last_relro_ and is_first_non_relro_.
6345 (Output_segment::add_output_section): Group relro sections is
6346 do_sort is true. Handle is_last_relro and is_first_non_relro.
6347 (Output_segment::maximum_alignment): Remove relro handling.
6348 (Output_segment::set_section_addresses): Add increase_relro
6349 parameter. Change all callers. Add initial alignment to align
6350 relro sections on separate page. Remove old relro handling.
6351 (Output_segment::set_section_list_addresses): Remove in_relro
6352 parameter. Change all callers.
6353 (Output_segment::set_offset): Add increase parameter. Change all
6354 callers. Remove old relro handling.
6355 * output.h (class Output_section): Add new methods: is_last_relro,
6356 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6357 Add is_last_relro_ and is_first_non_relro_ fields.
6358 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6359 Create separate .got.plt section. Call increase_relro.
6360 * x86_64.cc (Target_x86_64::got_section): Likewise.
6361 * testsuite/relro_script_test.t: Add .got.plt.
6362
f0ba79e2
ILT
6363 PR 10450
6364 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6365 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6366 (Layout::finalize): Call set_dynamic_symbol_size.
6367 (Layout::set_dynamic_symbol_size): New function.
6368 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6369 set_dynamic_symbol_size.
6370
e8cd95c7
ILT
6371 PR 10450
6372 * output.h (class Output_section): Add is_entsize_zero_ field.
6373 * output.cc (Output_section::Output_section): Initialize
6374 is_entsize_zero_.
6375 (Output_section::set_entsize): If two different entsizes are
6376 requested, force it to zero.
6377 (Output_section::add_input_section): Set flags for .debug_str
6378 before updating section flags. Set entsize.
6379 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6380 and SHF_STRING if all input sections have those flags.
6381
3e1b9a8a
RÁE
63822009-12-29 Rafael Espindola <espindola@google.com>
6383
6384 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6385 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6386 reporting.
3e1b9a8a 6387
3dcad376
ST
63882009-12-29 Sriraman Tallam <tmsriram@google.com>
6389
6390 * options.cc (General_options::parse_version): Allow -v to exit
6391 without an error if there is nothing to link.
6392
084e2665
ILT
63932009-12-29 Ian Lance Taylor <iant@google.com>
6394
6395 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6396 using a version of gcc before 4.1.
6397 * configure: Rebuild.
6398
250acde3
CD
63992009-12-28 Chris Demetriou <cgd@google.com>
6400
6401 * attributes.cc (Output_attributes_section_data::do_write): Use
6402 std::vector::front rather than std::vector::data.
6403
99fff23b
ILT
64042009-12-28 Ian Lance Taylor <iant@google.com>
6405
6406 * symtab.h (class Symbol_table): Add enum Defined.
6407 * resolve.cc (Symbol_table::should_override): Add defined
6408 parameter. Change all callers. Test whether object is NULL
6409 before calling a method on it.
6410 (Symbol_table::report_resolve_problem): Add defined parameter.
6411 Change all callers.
6412 (Symbol_table::should_override_with_special): Likewise.
6413 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6414 parameter. Change all callers.
6415 (Symbol_table::do_define_in_output_data): Likewise.
6416 (Symbol_table::define_in_output_segment): Likewise.
6417 (Symbol_table::do_define_in_output_segment): Likewise.
6418 (Symbol_table::define_as_constant): Likewise.
6419 (Symbol_table::do_define_as_constant): Likewise.
6420 * script.h (class Symbol_assignment): Add is_defsym parameter to
6421 constructor; change all callers.
6422 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6423 parameter. Change all callers. Add is_defsym_ field.
6424 (class Parser_closure): Add parsing_defsym parameter to
6425 constructor; change all callers. Add parsing_defsym accessor
6426 function. Add parsing_defsym_ field.
6427
556bd683
ILT
64282009-12-28 Ian Lance Taylor <iant@google.com>
6429
6430 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6431 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6432
1782c879
ILT
64332009-12-23 Ian Lance Taylor <iant@google.com>
6434
6435 * i386.cc (Target_i386::do_calls_non_split): Recognize
6436 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6437 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6438 -fsplit-stack prologue when using %r11.
1782c879 6439
329ca2b1
ST
64402009-12-21 Sriraman Tallam <tmsriram@google.com>
6441
6442 * options.cc (General_options::parse_version): Make -v continue and do
6443 the link like GNU ld does.
6444
d675ff46
RÁE
64452009-12-17 Rafael Avila de Espindola <espindola@google.com>
6446
6447 * Makefile.am (CCFILES): Add timer.cc.
6448 (HFILES): Add timer.h.
6449 * configure.ac: Check for sysconf and times.
6450 * main.cc: include timer.h.
6451 (main): Use Timer instead of get_run_time.
6452 * timer.cc: New.
6453 * timer.h: New.
6454 * workqueue.cc: include timer.h.
6455 (Workqueue::find_and_run_task):
6456 Report user, sys and wall time.
6457 * Makefile.in: Regenerate.
6458 * config.in: Regenerate.
6459 * configure: Regenerate.
6460
d6344fb5
DK
64612009-12-16 Doug Kwan <dougkwan@google.com>
6462
6463 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6464 sections.
6465 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6466 relaxed input sections.
6467 * output.cc (Output_section::find_relaxed_input_section): Change
6468 return type to Output_relaxed_input_section pointer. Adjust code
6469 for new type of relaxed_input_section_map_.
6470 * output.h (Output_section::find_relaxed_input_section): Change
6471 return type to Output_relaxed_input_section pointer.
6472 (Output_section::Output_relaxed_input_section_by_input_section_map):
6473 New type.
6474 (Output_section::relaxed_input_section_map_): Change type to
6475 Output_section::Output_relaxed_input_section_by_input_section_map.
6476 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6477 input section.
6478
0e0d5469
ILT
64792009-12-15 Ian Lance Taylor <iant@google.com>
6480
6481 * layout.cc (Layout::create_shstrtab): Only write out after input
6482 sections if we are compressing debug sections.
6483
0649a889
ILT
64842009-12-15 Ian Lance Taylor <iant@google.com>
6485
6486 * archive.cc (Archive::add_symbols): Only look up a symbol without
6487 a version if there is, in fact, a version.
6488
2ea97941
ILT
64892009-12-14 Ian Lance Taylor <iant@google.com>
6490
6491 Revert -Wshadow changes, all changes from:
6492 2009-12-11 Doug Kwan <dougkwan@google.com>
6493 2009-12-11 Nick Clifton <nickc@redhat.com>
6494 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6495
b0eec2cc
DK
64962009-12-11 Doug Kwan <dougkwan@google.com>
6497
6498 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6499 due to -Wshadow.
6500 * attributes.cc (Object_attribute::size): Ditto.
6501 (Attributes_section_data::size): Ditto.
6502 (Attributes_section_data::Attributes_section_data): Ditto.
6503 (Output_attributes_section_data::do_write): Ditto.
6504 * attributes.h (Object_attribute::set_type): Ditto.
6505 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6506
91d6fa6a
NC
65072009-12-11 Nick Clifton <nickc@redhat.com>
6508
6509 * archive.cc: Fix shadowed variable warnings.
6510 * arm.cc: Likewise.
6511 * compressed_output.cc: Likewise.
6512 * compressed_output.h: Likewise.
6513 * configure: Likewise.
6514 * dwarf_reader.cc: Likewise.
6515 * dynobj.cc: Likewise.
6516 * dynobj.h: Likewise.
6517 * ehframe.cc: Likewise.
6518 * ehframe.h: Likewise.
6519 * errors.cc: Likewise.
6520 * expression.cc: Likewise.
6521 * fileread.cc: Likewise.
6522 * fileread.h: Likewise.
6523 * freebsd.h: Likewise.
6524 * i386.cc: Likewise.
6525 * icf.cc: Likewise.
6526 * incremental.h: Likewise.
6527 * layout.cc: Likewise.
6528 * layout.h: Likewise.
6529 * mapfile.cc: Likewise.
6530 * merge.cc: Likewise.
6531 * merge.h: Likewise.
6532 * object.cc: Likewise.
6533 * object.h: Likewise.
6534 * options.h: Likewise.
6535 * output.cc: Likewise.
6536 * output.h: Likewise.
6537 * parameters.cc: Likewise.
6538 * plugin.cc: Likewise.
6539 * powerpc.cc: Likewise.
6540 * reduced_debug_output.cc: Likewise.
6541 * reduced_debug_output.h: Likewise.
6542 * reloc.cc: Likewise.
6543 * reloc.h: Likewise.
6544 * resolve.cc: Likewise.
6545 * script-sections.cc: Likewise.
6546 * script.cc: Likewise.
6547 * script.h: Likewise.
6548 * sparc.cc: Likewise.
6549 * symtab.cc: Likewise.
6550 * symtab.h: Likewise.
6551 * target-select.cc: Likewise.
6552 * target-select.h: Likewise.
6553 * token.h: Likewise.
6554 * workqueue.cc: Likewise.
6555 * workqueue.h: Likewise.
6556 * x86_64.cc: Likewise.
6557
a0351a69
DK
65582009-12-10 Doug Kwan <dougkwan@google.com>
6559
6560 * arm.cc (attributes.h): New include.
6561 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6562 (Arm_relobj::~Arm_relobj): Delete object pointed by
6563 attributes_section_data_.
6564 (Arm_relobj::attributes_section_data): New method definition.
6565 (Arm_relobj::attributes_section_data_): New data member declaration.
6566 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6567 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6568 attributes_section_data_.
6569 (Arm_dynobj::attributes_section_data): New method definition.
6570 (Arm_dynobj::attributes_section_data_): New data member declaration.
6571 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6572 initialization value of may_use_blx_ to false.
6573 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6574 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6575 object attributes to compute results instead of hard-coding.
6576 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6577 Target_arm::get_secondary_compatible_arch,
6578 Target_arm::set_secondary_compatible_arch
6579 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6580 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6581 New method declarations.
6582 (Target_arm::get_aeabi_object_attribute): New method definition.
6583 (Target_arm::attributes_section_data_): New data member declaration.
6584 (read_arm_attributes_section): New template definition.
6585 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6586 (Arm_dynobj::do_read_symbols): Ditto.
6587 (Target_arm::do_finalize_sections): Merge attributes sections from
6588 input. Check for BLX use after attributes section merging.
6589 Fix __exidx_start and __exidx_end visibility. Create an
6590 .ARM.attributes section if necessary.
6591 (Target_arm::get_secondary_compatible_arch,
6592 Target_arm::set_secondary_compatible_arch,
6593 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6594 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 6595 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
6596 New method definitions.
6597
b59befec
ILT
65982009-12-09 Ian Lance Taylor <iant@google.com>
6599
6600 * plugin.cc (Plugin::load): Don't cast from void* to a function
6601 pointer.
6602
1276bc89
ILT
66032009-12-09 Ian Lance Taylor <iant@google.com>
6604
6605 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6606 information fields.
6607
2f2de248
L
66082009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6609
6610 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6611 Replace two_file_shared_1.so with two_file_shared_2.so.
6612 * testsuite/Makefile.in: Regenerated.
6613
4f787271
DK
66142009-12-08 Doug Kwan <dougkwan@google.com>
6615
6616 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6617 (HFILES): Add attributes.h and int_encoding.h.
6618 * Makefile.in: Regenerate.
6619 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6620 function definitions to int_encoding.cc
6621 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6622 prototypes to int_encoding.h
6623 * reduced_debug_output.cc (int_encoding.h): New include.
6624 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6625 function definitions to int_encoding.cc
6626 (insert_into_vector, read_from_pointer): Move template definitions to
6627 int_encoding.h
6628 * attributes.cc: New file.
6629 * attributes.h: New file.
6630 * int_encoding.cc: New file.
6631 * int_encoding.h: New file.
6632
20b52f1a
RÁE
66332009-12-07 Rafael Avila de Espindola <espindola@google.com>
6634
6635 PR gold/11055
6636 * incremental-dump.cc (dump_incremental_inputs): New.
6637 (main): Use dump_incremental_inputs.
6638
53d7974c
L
66392009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6640
6641 PR gold/10893
6642 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6643 checking elfcpp::STT_FUNC.
6644 (Target_i386::Relocate::relocate): Likewise.
6645 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6646
6647 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6648 symbols from shared libraries into normal FUNC symbols.
6649
6650 * symtab.h (Symbol): Add is_func and use it.
6651
05a352e6
DK
66522009-12-05 Doug Kwan <dougkwan@google.com>
6653
6654 * arm.cc (Target_arm::arm_info): Initialize new fields
6655 attributes_section and attributes_vendor.
6656 * i386.cc (Target_i386::i386_info): Same.
6657 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6658 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6659 fields attributes_section and attributes_vendor.
53d7974c 6660 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
6661 * target.h (Target::attributes_section, Target::attributes_vendor,
6662 Target::is_attributes_section, Target::attribute_arg_type,
6663 Target::attributes_order): New method definitions.
6664 (Target::Target_info::attributes_section,
6665 Target::Target_info::attributes_vendor): New fields.
6666 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6667 virtual method definitions.
6668 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6669 attributes_section and attributes_vendor.
6670 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6671
f4e5969c
DK
66722009-12-05 Doug Kwan <dougkwan@google.com>
6673
6674 * arm.cc: Update comments about interworking and stub generation.
6675 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6676 considered as non-PIC.
6677 (Arm_relocate_functions::base_abs): Fix formatting.
6678 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6679 of function to use GOT entry address instead of offset.
6680 (Target_arm::Scan::global): Issue an error if a symbol would need a
6681 PLT does not get one because it is untyped. Remove code to create
6682 dynamic symbols for relative branches.
6683 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6684 takes unsigned integer instead of boolean.
6685
1abce4a6
L
66862009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6687
6688 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6689 (two_file_test_LDADD): Likewise.
6690 (common_test_1_LDADD): Likewise.
6691 (exception_test_LDADD) Likewise.
6692 (weak_test_LDADD): Likewise.
6693 (many_sections_test_LDADD): Likewise.
6694 (initpri1_LDADD): Likewise.
6695 (script_test_1_LDADD): Likewise.
6696 (script_test_2_LDADD): Likewise.
6697 (justsyms_LDADD): Likewise.
6698 (binary_test_LDADD): Likewise.
6699 (large_LDADD): Likewise.
6700 * testsuite/Makefile.in: Regenerated.
6701
adcf2816 67022009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 6703
adcf2816
L
6704 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6705 (Symbol_table::override_with_special): Likewise.
6706 (Symbol_table::add_from_object): Likewise.
6707
28e67f5d
RÁE
67082009-12-04 Rafael Avila de Espindola <espindola@google.com>
6709
6710 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6711 Don't set the data_offset twice.
6712
ae10a101
RÁE
67132009-12-04 Rafael Avila de Espindola <espindola@google.com>
6714
6715 * testsuite/Makefile.in: Regenerate.
6716
f59f41f3
DK
67172009-12-03 Doug Kwan <dougkwan@google.com>
6718
6719 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6720 (Target_arm::do_finalize_sections): Add parameter for symbol table
6721 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6722 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6723 parameter for symbol table pointer.
6724 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6725 an additional parameter for a pointer to symbol table.
6726 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6727 parameter for a symbol table pointer.
6728 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6729 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6730 Ditto.
6731 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6732 parameter for a symbol table pointer.
6733
ca55d848
RÁE
67342009-12-03 Rafael Avila de Espindola <espindola@google.com>
6735
6736 * incremental.cc (Incremental_inputs_header)
6737 (Incremental_inputs_header_write, Incremental_inputs_entry)
6738 (Incremental_inputs_entry_write): Move ...
6739 * incremental.h (Incremental_inputs_header)
6740 (Incremental_inputs_header_write, Incremental_inputs_entry)
6741 (Incremental_inputs_entry_write): here.
6742
3aec4f9c
RÁE
67432009-12-02 Rafael Avila de Espindola <espindola@google.com>
6744
6745 * incremental.cc (make_sized_incremental_binary): Set the target.
6746 Error if it is incompatible.
6747 * output.h (Output_file): Add filename method.
6748
9c0ae74d
RÁE
67492009-12-02 Rafael Avila de Espindola <espindola@google.com>
6750
6751 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6752 from the get_* methods.
6753
a45500ae
RÁE
67542009-12-02 Rafael Avila de Espindola <espindola@google.com>
6755
6756 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6757 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6758 Write 0 for the data_offset of scripts.
6759
325e6408
RÁE
67602009-12-02 Rafael Avila de Espindola <espindola@google.com>
6761
6762 * testsuite/Makefile.am: Add the incremental_test.sh test.
6763 * testsuite/incremental_test.sh: New.
6764 * testsuite/incremental_test_1.c: New.
6765 * testsuite/incremental_test_2.c: New.
6766
954c3e2e
RÁE
67672009-12-01 Rafael Avila de Espindola <espindola@google.com>
6768
6769 * incremental-dump.cc (main): Fix typos.
6770
f8086623
RÁE
67712009-11-27 Rafael Avila de Espindola <espindola@google.com>
6772
6773 PR gold/11025
6774 * incremental-dump.cc (main): Use llu to print 64 bit values.
6775
3b0dd6ac
L
67762009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6777 H.J. Lu <hongjiu.lu@intel.com>
6778
6779 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6780 $(LIBDL).
6781 (incremental_dump_LDADD): Likewise.
6782 * Makefile.in: Regenerated.
6783
a6d1ef57 67842009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6785
a6d1ef57
DK
6786 Revert:
6787
6788 2009-11-25 Doug Kwan <dougkwan@google.com>
6789
6790 * arm.cc (Target_arm::Target_arm): Move method definition
6791 outside of class definition. Add code to handle
6792 --target1-rel, --target1-abs and --target2= options.
6793 (Target_arm::get_reloc_reloc_type): Change method to be
6794 non-static and const.
6795 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6796 New data member declaration.
6797 (Target_arm::Scan::local, Target_arm::Scan::global,
6798 Target_arm::Relocate::relocate,
6799 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6800 Adjust call to Target_arm::get_real_reloc_type.
6801 (Target_arm::get_real_reloc_type): Use command line options
6802 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6803 * options.h (--target1-rel, --target1-abs, --target2): New
6804 ARM-only options.
6805
50aeb7d4
DK
68062009-11-25 Doug Kwan <dougkwan@google.com>
6807
6808 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6809 class definition. Add code to handle --target1-rel, --target1-abs
6810 and --target2= options.
6811 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6812 and const.
6813 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6814 member declaration.
6815 (Target_arm::Scan::local, Target_arm::Scan::global,
6816 Target_arm::Relocate::relocate,
6817 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6818 call to Target_arm::get_real_reloc_type.
6819 (Target_arm::get_real_reloc_type): Use command line options to
6820 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6821 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6822 options.
6823
51938283
DK
68242009-11-25 Doug Kwan <dougkwan@google.com>
6825
6826 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6827 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6828 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6829 formatting.
6830 (Arm_relocate_functions::thm_call): Replace body with a call to
6831 Arm_relocate_functions::thumb_branch_common.
6832 (Arm_relocate_functions::thm_jump24,
6833 Arm_relocate_functions::thm_xpc22): New method definitions.
6834 (Arm_relocate_functions::thumb_branch_common): New method definition.
6835 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6836 operator.
6837 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6838 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6839
e2b8f3c4
RÁE
68402009-11-24 Rafael Avila de Espindola <espindola@google.com>
6841
6842 * Makefile.am: Build incremental-dump
6843 * Makefile.in: Regenerate.
6844 * incremental-dump.cc: New.
6845 * incremental.cc (Incremental_inputs_header_data,
6846 Incremental_inputs_entry_data): Move to incremental.h
6847 * incremental.h: (Incremental_inputs_header_data,
6848 Incremental_inputs_entry_data): Move from incremental.cc
6849
bcba9aec
RÁE
68502009-11-24 Rafael Avila de Espindola <espindola@google.com>
6851
6852 * incremental.cc (Incremental_inputs_header,
6853 Incremental_inputs_header_write, Incremental_inputs_entry,
6854 Incremental_inputs_entry_write): Add a typedef with the data type.
6855
7c3afe08
RÁE
68562009-11-24 Rafael Avila de Espindola <espindola@google.com>
6857
6858 * incremental.cc (Incremental_inputs_header,
6859 Incremental_inputs_header_write, Incremental_inputs_entry,
6860 Incremental_inputs_entry_write): Update comment about which
6861 type has the filed descriptions.
6862
d204b6e9
DK
68632009-11-15 Doug Kwan <dougkwan@google.com>
6864
6865 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6866 (Arm_relocate_functions::arm_branch_common): Change method defintion
6867 in class definition to a method declaration and update list of formal
6868 parameters.
6869 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6870 Arm_relocation_functions::jump24): Adjust call to
6871 Arm_relocate_functions::arm_branch_common. Update list of formal
6872 parameters.
6873 (Arm_relocate_functions::xpc25): New method definition.
6874 (Arm_relocate_functions::arm_branch_common): Move method defintion
6875 out from class definition. Use stubs for mode-switching and extending
6876 branch ranges.
6877 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6878 specially. Change code to enable use of stubs in ARM branches.
6879
43d12afe
DK
68802009-11-10 Doug Kwan <dougkwan@google.com>
6881
6882 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6883 in method declaration.
6884 (Target_arm::relocate_stub): New method declaration.
6885 (Target_arm::default_target): Change to return a pointer instead of
6886 a const reference.
6887 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6888 Target_arm::default_target.
6889 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6890 method definition.
6891 (Target_arm::relocate_section): Adjust view.
6892 (Target_arm::relocate_stub): New method definition.
6893
ac33a407
DK
68942009-11-10 Doug Kwan <dougkwan@google.com>
6895
6896 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6897 a format warning.
6898 * incremental.cc (open_incremental_binary): Initialized local
6899 variables to avoid warnings.
6900 * object.cc (make_elf_object): Ditto.
6901 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6902 a format warning.
e1df38aa 6903
88ee28e9
L
6904009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6905
6906 PR gold/10930
6907 * testsuite/plugin_test.c: Include "config.h".
6908
2daedcd6
DK
69092009-11-09 Doug Kwan <dougkwan@google.com>
6910
6911 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6912 (arm_symbol_value): Remove.
6913 (Arm_relocate_functions::arm_branch_common,
6914 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6915 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6916 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6917 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6918 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6919 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6920 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6921 Arm_relocate_functions::thm_mobw_abs_nc,
6922 Arm_relocate_functions::thm_mov_abs,
6923 Arm_relocate_functions::movw_prel_nc,
6924 Arm_relocate_functions::thm_movt_abs,
6925 Arm_relocate_functions::movt_prel,
6926 Arm_relocate_functions::thm_movw_prel_nc,
6927 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6928 (Target_arm::Relocate::relocate): Only decompose address into two
6929 parts if relocation type uses the thumb-bit and pass the actual
6930 bit instead of a flag indicating that the thumb-bit is used. Adjust
6931 calls to methods in Arm_relocate_functions for this change.
6932
1276bc89 69332009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6934
6935 PR 10925
6936 * reloc.cc: Instantiate
6937 Sized_relobj::initialize_input_to_output_maps and
6938 Sized_relobj:free_input_to_output_maps.
6939
e53ad1b5
ILT
69402009-11-06 Ian Lance Taylor <iant@google.com>
6941
6942 PR 10876
6943 * defstd.cc (in_segment): Set only_if_ref true for "end".
6944
eb44217c
DK
69452009-11-06 Doug Kwan <dougkwan@google.com>
6946
6947 * arm.cc (class Reloc_stub): Correct a comment.
6948 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6949 (Target_arm::scan_section_for_stubs): New method declaration.
6950 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6951 Change methods from private to protected.
6952 (Target_arm::do_may_relax): New method definition.
6953 (Target_arm::do_relax, Target_arm::group_sections,
6954 Target_arm::scan_reloc_for_stub,
6955 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6956 (Target_arm::arm_input_section_map_): New data member declaration.
6957 (Target_arm::scan_reloc_for_stub,
6958 Target_arm::scan_reloc_section_for_stubs,
6959 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6960 Target_arm::do_relax): New method definitions.
6961
5d329b7d
ILT
69622009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6963
6964 * configure.ac: Check for (struct stat)::st_mtim
6965 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6966 * config.in: Regenerate.
6967 * configure: Regenerate.
6968
96a0d71b
ILT
69692009-11-05 Ian Lance Taylor <iant@google.com>
6970
6971 PR 10910
6972 * output.cc (Output_segment::add_output_section): Add missing
6973 return statement.
6974
594c8e5e
ILT
69752009-11-04 Ian Lance Taylor <iant@google.com>
6976
6977 PR 10880
6978 * object.h (class Object): Add is_needed and set_is_needed
6979 methods. Add is_needed_ field. Make bool fields into bitfields.
6980 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6981 defined in a dynamic object and referenced by a regular object,
6982 set is_needed for the dynamic object.
6983 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6984 if the file is marked with as_needed and it is not needed.
6985
22b127cc
ILT
69862009-11-04 Ian Lance Taylor <iant@google.com>
6987
6988 PR 10887
6989 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6990 tags if data is discarded by linker script.
6991 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6992 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6993 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6994 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6995
f5c870d2
ILT
69962009-11-04 Ian Lance Taylor <iant@google.com>
6997
6998 * layout.cc (Layout::get_output_section): Add is_interp and
6999 is_dynamic_linker_section parameters. Change all callers.
7000 (Layout::choose_output_section): Likewise.
7001 (Layout::make_output_section): Likewise.
7002 (Layout::add_output_section_data): Add is_dynamic_linker_section
7003 parameter. Change all callers.
7004 * layout.h (class Layout): Update declarations.
7005 * output.h (class Output_section): Add is_interp, set_is_interp,
7006 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7007 Add is_interp_, is_dynamic_linker_section_ fields. Change
7008 generate_code_fills_at_write_ to a bitfield.
7009 * output.cc (Output_section::Output_sections): Initialize new
7010 fields.
7011 (Output_segment::add_output_section): Add do_sort parameter.
7012 Change all callers.
7013
1ae4d23b
ILT
70142009-11-03 Ian Lance Taylor <iant@google.com>
7015
7016 PR 10860
7017 * options.h (class General_options): Add --warn-common.
7018 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7019 merging two common symbols.
7020 (Symbol_table::should_override): Handle --warn-common when merging
7021 a common symbol with a defined symbol. Use report_resolve_problem
7022 for multiple definitions.
7023 (Symbol_table::report_resolve_problem): New function.
7024 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7025
55da9579
DK
70262009-11-03 Doug Kwan <dougkwan@google.com>
7027
7028 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7029 stub_factory_.
7030 (Target_arm::stub_factory): New method definition.
7031 (Target_arm::new_arm_input_section,
7032 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7033 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7034 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7035 New type definitions.
7036 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7037 member declarations.
7038 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7039 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7040 New method definitions.
7041
37a9ac43
ILT
70422009-11-03 Ian Lance Taylor <iant@google.com>
7043
7044 * options.h (class General_options): Add --warn_constructors.
7045
b3d6a3d4
ILT
70462009-11-03 Ian Lance Taylor <iant@google.com>
7047
7048 PR 10893
7049 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7050 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7051
934b01dd
ILT
70522009-11-03 Ian Lance Taylor <iant@google.com>
7053
7054 PR 10895
7055 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7056 --msgid-bugs-address.
7057 (install-pdf): New target.
7058 (install-data_yes): Look up one directory to find mkinstalldirs.
7059
03c1939b
L
70602009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7061
7062 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7063 tree.
7064
ebd95253
DK
70652009-10-30 Doug Kwan <dougkwan@google.com>
7066
7067 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7068
e9bbb538
DK
70692009-10-30 Doug Kwan <dougkwan@google.com>
7070
7071 * arm.cc (Stub_addend_reader): New struct template definition
7072 and partial specializations.
7073 (Stub_addend_reader::operator()): New method definition for a
7074 partially specialized template.
7075
d5b40221
DK
70762009-10-30 Doug Kwan <dougkwan@google.com>
7077
7078 * arm.cc (Arm_relobj::processor_specific_flags): New method
7079 definition.
7080 (Arm_relobj::do_read_symbols): New method declaration.
7081 (Arm_relobj::processor_specific_flags_): New data member declaration.
7082 (Arm_dynobj): New class definition.
7083 (Target_arm::do_finalize_sections): Add input_objects parameter.
7084 (Target_arm::do_adjust_elf_header): New method declaration.
7085 (Target_arm::are_eabi_versions_compatible,
7086 (Target_arm::merge_processor_specific_flags): New method declaration.
7087 (Target_arm::do_make_elf_object): New overloaded method definitions
7088 and declaration.
7089 (Arm_relobj::do_read_symbols): New method definition.
7090 (Arm_dynobj::do_read_symbols): Ditto.
7091 (Target_arm::do_finalize_sections): Add input_objects parameters.
7092 Merge processor-specific flags from all input objects.
7093 (Target_arm::are_eabi_versions_compatible,
7094 Target_arm::merge_processor_specific_flags,
7095 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7096 New method definitions.
7097 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7098 Input_objects pointer type parameter.
7099 * layout.cc (Layout::finalize): Pass input objects to target's.
7100 finalize_sections function.
7101 * output.cc (Output_file_header::do_sized_write): Set ELF file
7102 header's processor-specific flags.
7103 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7104 Input_objects pointer type parameter.
7105 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7106 * target.h (Input_objects): New forward class declaration.
7107 (Target::processor_specific_flags,
7108 Target::are_processor_specific_flags_sect): New method definitions.
7109 (Target::finalize_sections): Add input_objects parameter.
7110 (Target::Target): Initialize processor_specific_flags_ and
7111 are_processor_specific_flags_set_.
7112 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7113 parameter.
7114 (Target::set_processor_specific_flags): New method definition.
7115 (Target::processor_specific_flags_,
7116 Target::are_processor_specific_flags_set_): New data member
7117 declarations.
7118 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7119 Input_objects pointer type parameter.
7120
ebabffbd
DK
71212009-10-30 Doug Kwan <dougkwan@google.com>
7122
7123 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7124
ad0f2072
ILT
71252009-10-28 Ian Lance Taylor <iant@google.com>
7126
7127 * object.h (class Relobj): Drop options parameter from
7128 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7129 do_scan_relocs, do_relocate. Change all callers.
7130 (class Sized_relobj): Drop options parameters from
7131 do_gc_process_relocs, do_scan_relocs, do_relocate,
7132 do_relocate_sections, relocate_sections, emit_relocs_scan,
7133 emit_relocs_scan_reltype. Change all callers.
7134 (struct Relocate_info): Remove options field and all references to
7135 it.
7136 * reloc.h (class Read_relocs): Remove options constructor
7137 parameter and options_ field. Change all callers.
7138 (class Gc_process_relocs, class Scan_relocs): Likewise.
7139 (class Relocate_task): Likewise.
7140 * target-reloc.h (scan_relocs): Remove options parameter. Change
7141 all callers.
7142 (scan_relocatable_relocs): Likewise.
7143 * target.h (class Sized_target): Remove options parameter from
7144 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7145 all callers.
7146 * gc.h (gc_process_relocs): Remove options parameter. Change all
7147 callers.
7148 * arm.cc: Update functions to remove options parameters.
7149 * i386.cc: Likewise.
7150 * powerpc.cc: Likewise.
7151 * sparc.cc: Likewise.
7152 * x86_64.cc: Likewise.
7153 * testsuite/testfile.cc: Likewise.
7154
8ffa3667
DK
71552009-10-28 Doug Kwan <dougkwan@google.com>
7156
7157 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7158 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7159 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7160 New method definitions.
7161
40f36857
CC
71622009-10-28 Cary Coutant <ccoutant@google.com>
7163
7164 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7165 (Plugin::cleanup_done_): New member.
7166 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7167 (Plugin_manager::cleanup_done_): Remove.
7168 (Plugin_manager::add_input_file): Edit error message.
7169 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7170 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7171
2c849493
ILT
71722009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7173
7174 * fileread.cc: (File_read::View::~View): Use the new
7175 data_ownership_ filed.
7176 (File_read::~File_read): Dispose the new whole_file_view_.
7177 (File_read::open): Mmap the whole file if needed.
7178 (File_read::open): Use whole_file_view_ instead of contents_.
7179 (File_read::find_view): Use whole_file_view_ if applicable.
7180 (File_read::do_read): Use whole_file_view_ instead of contents_.
7181 (File_read::make_view): Use whole_file_view_ instead of contents_,
7182 update File_read::View::View call.
7183 (File_read::find_or_make_view): Update File_read::View::View
7184 call.
7185 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7186 remove contents_
7187 (File_read::View::Data_ownership): New enum.
7188 (File_read::View::View): Replace bool mapped_ with Data_ownership
7189 argument.
7190 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7191 (File_read::View::data_ownership_): New field.
7192 (File_read::contents_): Remove (replaced by whole_file_view_).
7193 (File_read::whole_file_view_): New field.
7194 * options.h (class General_options): Add --keep-files-mapped.
7195
24998053
CC
71962009-10-27 Cary Coutant <ccoutant@google.com>
7197
7198 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7199 * testsuite/Makefile.am (plugin_test_5): New test case.
7200 * testsuite/Makefile.in: Regenerate.
7201
72adc4fa
DK
72022009-10-25 Doug Kwan <dougkwan@google.com>
7203
7204 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7205 from private to protected to allow access by child class.
7206 (Sized_relobj::do_relocate_sections): New method declaration.
7207 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7208 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7209 Sized_relobj::relocate_sections. Instantiate template explicitly
7210 for different target sizes and endianity.
7211
07f508a2
DK
72122009-10-24 Doug Kwan <dougkwan@google.com>
7213
7214 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7215 (Arm_input_section::as_arm_input_section): New method.
7216 (Arm_output_section): New class definition.
7217 (Arm_output_section::create_stub_group,
7218 Arm_output_section::group_sections): New method definitions.
7219
10ad9fe5
DK
72202009-10-22 Doug Kwan <dougkwan@google.com>
7221
7222 * arm.cc (Arm_input_section): New class definition.
7223 (Arm_input_section::init, Arm_input_section:do_write,
7224 Arm_input_section::set_final_data_size,
7225 Arm_input_section::do_reset_address_and_file_offset): New method
7226 definitions.
7227
56ee5e00
DK
72282009-10-21 Doug Kwan <dougkwan@google.com>
7229
7230 * arm.cc (Stub_table, Arm_input_section): New forward class
7231 declarations.
7232 (Stub_table): New class defintion.
7233 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7234 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7235 New method definition.
7236
b569affa
DK
72372009-10-21 Doug Kwan <dougkwan@google.com>
7238
7239 * arm.cc: Update copyright comments.
7240 (Target_arm): New forward class template declaration.
7241 (Arm_address): New type.
7242 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7243 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7244 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7245 constants.
7246 (Insn_template): Same.
7247 (DEF_STUBS): New macro.
7248 (Stub_type): New enum type.
7249 (Stub_template): New class definition.
7250 (Stub): Same.
7251 (Reloc_stub): Same.
7252 (Stub_factory): Same.
7253 (Target_arm::Target_arm): Initialize may_use_blx_ and
7254 should_force_pic_veneer_.
7255 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7256 Target_arm::should_force_pic_veneer,
7257 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7258 Target_arm::using_thumb_only, Target_arm:;default_target): New
7259 method defintions.
7260 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7261 New data member declarations.
7262 (Insn_template::size, Insn_template::alignment): New method defintions.
7263 (Stub_template::Stub_template): New method definition.
7264 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7265 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7266 (Stub_factory::Stub_factory): New method definition.
7267 * gold.h (string_hash): New template.
7268 * output.h (Input_section_specifier::hash_value): Use
7269 gold::string_hash.
7270 (Input_section_specifier::string_hash): Remove.
7271 * stringpool.cc (Stringpool_template::string_hash): Use
7272 gold::string_hash.
7273
6c172549
DK
72742009-10-20 Doug Kwan <dougkwan@google.com>
7275
7276 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7277 symbols of relaxed input sections.
7278 * output.h (Output_section::find_relaxed_input_section): Make
7279 method public.
7280
c5617f2f
DK
72812009-10-16 Doug Kwan <dougkwan@google.com>
7282
7283 * dynobj.cc (Versions::Versions): Initialize version_script_.
7284 Only insert base version symbol definition for a shared object
7285 if version script defines any version versions.
7286 (Versions::define_base_version): New method definition.
7287 (Versions::add_def): Check that base version is not needed.
7288 (Versions::add_need): Define base version lazily.
7289 * dynobj.h (Versions::define_base_version): New method declaration.
7290 (Versions::needs_base_version_): New data member declaration.
7291 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7292 (check_DATA): Add no_version_test.stdout.
7293 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7294 New make rules.
7295 * testsuite/Makefile.in: Regenerate.
7296 * testsuite/no_version_test.c: New file.
7297 * testsuite/no_version_test.sh: Ditto.
7298
3c12dcdb
DK
72992009-10-16 Doug Kwan <dougkwan@google.com>
7300
7301 * expression.cc (class Segment_start_expression): New class definition.
7302 (Segment_start_expression::value): New method definition.
7303 (script_exp_function_segment_start): Return a new
7304 Segment_start_expression.
7305 * gold/script-c.h (script_saw_segment_start_expression): New function
7306 prototype.
7307 * script-sections.cc (Script_sections::Script_sections): Initialize
7308 SAW_SEGMENT_START_EXPRESSION_ to false.
7309 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7310 and -Tbbs options to specify section addresses if given in
7311 command line and no SEGMENT_START expression is seen in a script.
7312 * script-sections.h (Script_sections::saw_segment_start_expression,
7313 Script_sections::set_saw_segment_start_expression): New method
7314 definition.
7315 (Script_sections::saw_segment_start_expression_): New data member
7316 declaration.
7317 * script.cc (script_saw_segment_start_expression): New function.
7318 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7319 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7320 script_test_7.sh and script_test_8.sh.
7321 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7322 script_test_8.stdout.
7323 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7324 (script_test_6, script_test_6.stdout, script_test_7,
7325 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7326 * Makefile.in: Regenerate.
7327 * testsuite/script_test_6.sh: New file.
7328 * testsuite/script_test_6.t: Same.
7329 * testsuite/script_test_7.sh: Same.
7330 * testsuite/script_test_7.t: Same.
7331 * testsuite/script_test_8.sh: Same.
7332
64b1ae37
DK
73332009-10-16 Doug Kwan <dougkwan@google.com>
7334
7335 * output.cc (Output_segment::set_section_list_address): Cast
7336 expressions to unsigned long long type to avoid format warnings.
7337
661be1e2
ILT
73382009-10-15 Ian Lance Taylor <iant@google.com>
7339
12edd763 7340 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7341 dot assignment to script_sections_.
12edd763
ILT
7342 * script-sections.cc (Script_sections::add_dot_assignment):
7343 Initialize if necessary.
7344
68b6574b
ILT
7345 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7346 program headers with no load segment if there is a linker script.
7347
661be1e2
ILT
7348 * layout.cc (Layout::set_segment_offsets): Align the file offset
7349 to the segment aligment for -N or -n with no load segment.
7350 * output.cc (Output_segment::add_output_section): Don't crash if
7351 the first section is a TLS section.
7352 (Output_segment::set_section_list_addresses): Print an error
7353 message if the address moves backward in a linker script.
7354 * script-sections.cc
7355 (Output_section_element_input::set_section_addresses): Don't
7356 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7357 (Orphan_output_section::set_section_addresses): Likewise.
7358
f15f61a7
DK
73592009-10-15 Doug Kwan <dougkwan@google.com>
7360
7361 * layout.cc (Layout::finish_dynamic_section): Generate tags
7362 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7363 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7364 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7365
82bb573a
ILT
73662009-10-14 Ian Lance Taylor <iant@google.com>
7367
7368 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7369 fields.
7370 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7371 data_shdr fields of relinfo.
7372 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7373 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7374 R_386_TLS_LDO_32, adjust based on section flags.
7375 (Target_i386::Relocate::fix_up_ldo): Remove.
7376
374ad285
ILT
73772009-10-13 Ian Lance Taylor <iant@google.com>
7378
7379 Add support for -pie.
7380 * options.h (class General_options): Add -pie and
7381 --pic-executable.
7382 (General_options::output_is_position_independent): Test -pie.
7383 (General_options::output_is_executable): Return true if not shared
7384 and not relocatable.
7385 (General_options::output_is_pie): Remove.
7386 * options.cc (General_options::finalize): Reject incompatible uses
7387 of -pie.
7388 * gold.cc (queue_middle_tasks): A -pie link is not static.
7389 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7390 * symtab.cc (Symbol::final_value_is_known): Return false if
7391 output_is_position_independent.
7392 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7393 output_is_position_independent.
7394 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7395 output_is_position_independent.
7396 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7397 output_is_position_independent.
7398 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7399 two_file_pie_test.
7400 (basic_pie_test.o, basic_pie_test): New targets.
7401 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7402 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7403 (two_file_pie_test): New target.
7404 * testsuite/Makefile.in: Rebuild.
7405 * README: Remove note saying that -pie is not supported.
7406
c6585162
ILT
74072009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7408
7409 * options.h (class General_options): Add -init and -fini.
7410 * layout.cc (Layout::finish_dynamic_section): Emit
7411 given init and fini functions.
7412
032ce4e9
ST
74132009-10-13 Sriraman Tallam <tmsriram@google.com>
7414
7415 * gc.h (gc_process_relocs): Check if icf is enabled using new
7416 function.
7417 * gold.cc (queue_initial_tasks): Likewise.
7418 (queue_middle_tasks): Likewise.
7419 * object.cc (do_layout): Likewise.
7420 * symtab.cc (is_section_folded): Likewise.
7421 * main.cc (main): Likewise.
7422 * reloc.cc (Read_relocs::run): Likewise.
7423 (Sized_relobj::do_scan_relocs): Likewise.
7424 * icf.cc (is_function_ctor_or_dtor): New function.
7425 (Icf::find_identical_sections): Check if function is ctor or dtor when
7426 safe icf is chosen.
7427 * options.h (General_options::icf): Change option to be an enum.
7428 (Icf_status): New enum.
7429 (icf_enabled): New method.
7430 (icf_safe_folding): New method.
7431 (set_icf_status): New method.
7432 (icf_status_): New variable.
7433 * (options.cc) (General_options::finalize): Set icf_status_.
7434 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7435 icf_test and icf_keep_unique_test to use the --icf enum flag.
7436 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7437 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7438
f345227a
ST
74392009-10-12 Sriraman Tallam <tmsriram@google.com>
7440
7441 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7442 includes to gc.h and icf.h.
7443 * arm.cc: Include gc.h.
7444 * gold.cc: Likewise.
7445 * i386.cc: Likewise.
7446 * powerpc.cc: Likewise.
7447 * sparc.cc: Likewise.
7448 * x86_64.cc: Likewise.
7449 * gc.h: Include icf.h.
7450
1c7814ed
ILT
74512009-10-11 Ian Lance Taylor <iant@google.com>
7452
7453 * plugin.cc: Include "gold.h" before other header files.
7454
ae3b5189
CD
74552009-10-10 Chris Demetriou <cgd@google.com>
7456
7457 * options.h (Input_file_argument::Input_file_type): New enum.
7458 (Input_file_argument::is_lib_): Replace with...
7459 (Input_file_argument::type_): New member.
7460 (Input_file_argument::Input_file_argument): Take Input_file_type
7461 'type' rather than boolean 'is_lib' as second argument.
7462 (Input_file_argument::is_lib): Use type_.
7463 (Input_file_argument::is_searched_file): New function.
7464 (Input_file_argument::may_need_search): Handle is_searched_file.
7465 * options.cc (General_options::parse_library): Support -l:filename.
7466 (General_options::parse_just_symbols): Update for Input_file_argument
7467 changes.
7468 (Command_line::process): Likewise.
7469 * archive.cc (Archive::get_file_and_offset): Likewise.
7470 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7471 * script.cc (read_script_file, script_add_file): Likewise.
7472 * fileread.cc (Input_file::Input_file): Likewise.
7473 (Input_file::will_search_for): Handle is_searched_file.
7474 (Input_file::open): Likewise.
7475 * readsyms.cc (Read_symbols::get_name): Likewise.
7476 * testsuite/Makefile.am (searched_file_test): New test.
7477 * testsuite/Makefile.in: Regenerate.
7478 * testsuite/searched_file_test.cc: New file.
7479 * testsuite/searched_file_test_lib.cc: New file.
7480
f3048a1d
ILT
74812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7482 Ian Lance Taylor <iant@google.com>
7483
7484 * descriptor.cc: Include <cstdio> and "binary-io.h".
7485 (Descriptors::open): Open the files in binary mode always.
7486 * script.cc (Lex::get_token): Treat \r as whitespace.
7487
d4780e57
ILT
74882009-10-09 Ian Lance Taylor <iant@google.com>
7489
7490 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7491
d9a893b8
ILT
74922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7493 Ian Lance Taylor <iant@google.com>
7494
7495 * configure.ac: Check for readv function also.
7496 * fileread.cc (readv): Define if not HAVE_READV.
7497 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7498 does not exist.
7499 * config.in: Regenerate.
7500 * configure: Regenerate.
7501
c0a62865
DK
75022009-10-09 Doug Kwan <dougkwan@google.com>
7503
7504 * layout.cc (Layout::make_output_section): Call target hook to make
7505 ordinary output section.
7506 (Layout::finalize): Adjust parameter list of call the
7507 Target::may_relax().
7508 * layout.h (class Layout::section_list): New method.
7509 * merge.h (Output_merge_base::entsize): Change visibility to public.
7510 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7511 New methods.
7512 (Output_merge_string::do_is_string): New method.
7513 * object.cc (Sized_relobj::do_setup): renamed from
7514 Sized_relobj::set_up.
7515 * object.h (Sized_relobj::adjust_shndx,
7516 Sized_relobj::initializ_input_to_output_maps,
7517 Sized_relobj::free_input_to_output_maps): Change visibilities to
7518 protected.
7519 (Sized_relobj::setup): Virtualize.
7520 (Sized_relobj::do_setup): New method declaration.
7521 (Sized_relobj::invalidate_section_offset,
7522 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7523 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7524 * options.cc (parse_int): New function.
7525 * options.h (parse_int): New declaration.
7526 (DEFINE_int): New macro.
7527 (stub_group_size): New option.
7528 * output.cc (Output_section::Output_section): Initialize memebers
7529 merge_section_map_, merge_section_by_properties_map_,
7530 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7531 (Output_section::add_input_section): Handled deferred code-fill
7532 generation and remove an old comment.
7533 (Output_section::add_relaxed_input_section): New method definition.
7534 (Output_section::add_merge_input_section): Use merge section by
7535 properties map to speed to search. Update merge section maps
7536 as appropriate.
7537 (Output_section::build_relaxation_map): New method definition.
7538 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7539 Same.
7540 (Output_section::relax_input_section): Renamed to
7541 Output_section::convert_input_sections_to_relaxed_sections and change
7542 interface to take a vector of pointers to relaxed sections.
7543 (Output_section::find_merge_section,
7544 Output_section::find_relaxed_input_section): New method definitions.
7545 (Output_section::is_input_address_mapped,
7546 Output_section::output_offset, Output_section::output_address):
7547 Use output section data maps to speed up searching.
7548 (Output_section::find_starting_output_address): Add comments.
7549 (Output_section::do_write,
7550 Output_section::write_to_postprocessing_buffer): Do code-fill
7551 generation as appropriate.
7552 (Output_section::get_input_sections): Invalidate relaxed input section
7553 map.
7554 (Output_section::restore_states): Adjust type of checkpoint .
7555 Invalidate relaxed input section map.
7556 * output.h (Output_merge_base): New class declaration.
7557 (Input_section_specifier): New class defintion.
7558 (class Output_relaxed_input_section) Change base class to
7559 Output_section_data_build.
7560 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7561 base class initializer.
7562 (Output_section::add_relaxed_input_section): New method declaration.
7563 (Output_section::Input_section): Change visibility to protected.
7564 (Output_section::Input_section::relobj,
7565 Output_section::Input_section::shndx): Handle relaxed input sections.
7566 Output_section::input_sections) Change visibility to protected. Also
7567 define overload to return a non-const pointer.
7568 (Output_section::Merge_section_properties): New class defintion.
7569 (Output_section::Merge_section_by_properties_map,
7570 Output_section::Output_section_data_by_input_section_map,
7571 Output_section::Relaxation_map): New types.
7572 (Output_section::relax_input_section): Rename method to
7573 Output_section::convert_input_sections_to_relaxed_sections and change
7574 interface to take a vector of relaxed section pointers.
7575 (Output_section::find_merge_section,
7576 Output_section::find_relaxed_input_section,
7577 Output_section::build_relaxation_map,
7578 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7579 New method declarations.
7580 (Output_section::merge_section_map_
7581 Output_section::merge_section_by_properties_map_,
7582 Output_section::relaxed_input_section_map_,
7583 Output_section::is_relaxed_input_section_map_valid_,
7584 Output_section::generate_code_fills_at_write_): New data members.
7585 * script-sections.cc
7586 (Output_section_element_input::set_section_addresses): Call
7587 current_data_size and addralign methods of relaxed input sections.
7588 (Orphan_output_section::set_section_addresses): Call current_data_size
7589 and addralign methods of relaxed input sections.
7590 * symtab.cc (Symbol_table::compute_final_value): Extract template
7591 from the body of Symbol_table::sized_finalize_symbol.
7592 (Symbol_table::sized_finalized_symbol): Call
7593 Symbol_table::compute_final_value.
7594 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7595 (Symbol_table::compute_final_value): New templated method declaration.
7596 * target.cc (Target::do_make_output_section): New method defintion.
7597 * target.h (Target::make_output_section): New method declaration.
7598 (Target::relax): Add more parameters for input objects, symbol table
7599 and layout. Adjust call to do_relax.
7600 (Target::do_make_output_section): New method declaration.
7601 (Target::do_relax): Add parameters for input objects, symbol table
7602 and layout.
7603
d446d6c4
ILT
76042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7605
7606 * pread.c: Include stdio.h.
7607
bc06c745
ILT
76082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7609
7610 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7611 defined.
7612
75aea3d0
ILT
76132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7614
7615 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7616 Change read_shndx type to unsigned int.
7617 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7618 int.
7619 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7620 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7621 Change read_shndx type to unsigned int.
7622 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7623 int.
7624 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7625 * layout.cc (Layout::create_symtab_sections): Cast the result of
7626 local_symcount * symsize to off_t in the gold_assert.
7627
be8fcb75
ILT
76282009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7629
7630 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7631 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7632 R_ARM_BASE_ABS.
7633 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7634 (Arm_relocate_functions::thm_abs5): New function.
7635 (Arm_relocate_functions::abs12): New function.
7636 (Arm_relocate_functions::abs16): New function.
7637 (Arm_relocate_functions::base_abs): New function.
7638 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7639 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7640 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7641 R_ARM_BASE_ABS.
7642 (Scan::global): Likewise.
7643 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7644 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7645 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7646 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7647 R_ARM_BASE_ABS.
7648
c2a122b6
ILT
76492009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7650
7651 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7652 (Arm_relocate_functions::movt_prel): New function.
7653 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7654 (Arm_relocate_functions::thm_movt_prel): New function.
7655 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7656 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7657 (Scan::global, Relocate::relocate): Likewise.
7658 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7659
c4aa1e2d
ILT
76602009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7661
7662 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7663 Incremental_checker.
7664 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7665 unsigned int.
7666 (class Incremental_inputs_header): New class.
7667 (Incremental_inputs_header_writer): Edit comment.
7668 (Incremental_inputs_entry): New class.
7669 (Incremental_inputs_entry_writer): Edit comment.
7670 (Sized_incremental_binary::do_find_incremental_inputs_section):
7671 Add *strtab_shndx parameter, fill it.
7672 (Sized_incremental_binary::do_check_inputs): New method.
7673 (Incremental_checker::can_incrementally_link_output_file): Use
7674 Sized_incremental_binary::check_inputs.
7675 (Incremental_inputs::report_command_line): Save command line in
7676 command_line_.
7677 * incremental.h:
7678 (Incremental_binary::find_incremental_inputs_section): New
7679 method.
7680 (Incremental_binary::do_find_incremental_inputs_section): Add
7681 strtab_shndx parameter.
7682 (Incremental_binary::do_check_inputs): New pure virtual method.
7683 (Sized_incremental_binary::do_check_inputs): Declare.
7684 (Incremental_checker::Incremental_checker): Add incremental_inputs
7685 parameter, use it to initialize incremental_inputs_.
7686 (Incremental_checker::incremental_inputs_): New field.
7687 (Incremental_checker::command_line): New method.
7688 (Incremental_checker::inputs): New method.
7689 (Incremental_checker::command_line_): New field.
7690
c549a694
ILT
76912009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7692
7693 * incremental.cc: Include <cstdarg> and "target-select.h".
7694 (vexplain_no_incremental): New function.
7695 (explain_no_incremental): New function.
7696 (Incremental_binary::error): New method.
7697 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7698 method.
7699 (make_sized_incremental_binary): New function.
7700 (open_incremental_binary): New function.
7701 (can_incrementally_link_file): Add checks if output is ELF and has
7702 inputs section.
7703 * incremental.h: Include "elfcpp_file.h" and "output.h".
7704 (Incremental_binary): New class.
7705 (Sized_incremental_binary): New class.
7706 (open_incremental_binary): Declare.
7707 * object.cc (is_elf_object): Use
7708 elfcpp::Elf_recognizer::is_elf_file.
7709 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7710 * output.h (Output_file::filesize): New method.
7711
fd3c5f0b
ILT
77122009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7713
7714 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7715 New function.
7716 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7717 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7718 function.
7719 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7720 function.
7721 (Arm_relocate_functions::movw_abs_nc): New function.
7722 (Arm_relocate_functions::movt_abs): New function.
7723 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7724 (Arm_relocate_functions::thm_movt_abs): New function.
7725 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7726 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7727 (Scan::global): Likewise.
7728 (Relocate::relocate): Likewise.
7729 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7730
7f5309a5
ILT
77312009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7732
7733 * arm.cc (Arm_relocate_functions::got_prel) New function.
7734 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7735 (Relocate::relocate): Likewise.
7736 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7737
364c7fa5
ILT
77382009-10-06 Ian Lance Taylor <iant@google.com>
7739
7740 * options.h (class General_options): Define
7741 split_stack_adjust_size parameter.
7742 * object.h (class Object): Add uses_split_stack_ and
7743 has_no_split_stack_ fields. Add uses_split_stack and
7744 has_no_split_stack accessor functions. Declare
7745 handle_split_stack_section.
7746 (class Reloc_symbol_changes): Define.
7747 (class Sized_relobj): Define Function_offsets. Declare
7748 split_stack_adjust, split_stack_adjust_reltype, and
7749 find_functions.
7750 * object.cc (Object::handle_split_stack_section): New function.
7751 (Sized_relobj::do_layout): Call handle_split_stack_section.
7752 * dynobj.cc (Sized_dynobj::do_layout): Call
7753 handle_split_stack_section.
7754 * reloc.cc (Sized_relobj::relocate_sections): Call
7755 split_stack_adjust for executable sections in split_stack
7756 objects. Pass reloc_map to relocate_section.
7757 (Sized_relobj::split_stack_adjust): New function.
7758 (Sized_relobj::split_stack_adjust_reltype): New function.
7759 (Sized_relobj::find_functions): New function.
7760 * target-reloc.h: Include "object.h".
7761 (relocate_section): Add reloc_symbol_changes parameter. Change
7762 all callers.
7763 * target.h (class Target): Add calls_non_split method. Declare
7764 do_calls_non_split virtual method. Declare match_view and
7765 set_view_to_nop.
7766 * target.cc: Include "elfcpp.h".
7767 (Target::do_calls_non_split): New function.
7768 (Target::match_view): New function.
7769 (Target::set_view_to_nop): New function.
7770 * gold.cc (queue_middle_tasks): Give an error if mixing
7771 split-stack and non-split-stack objects with -r.
7772 * i386.cc (Target_i386::relocate_section): Add
7773 reloc_symbol_changes parameter.
7774 (Target_i386::do_calls_non_split): New function.
7775 * x86_64.cc (Target_x86_64::relocate_section): Add
7776 reloc_symbol_changes parameter.
7777 (Target_x86_64::do_calls_non_split): New function.
7778 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7779 parameter.
7780 * powerpc.cc (Target_powerpc::relocate_section): Add
7781 reloc_symbol_changes parameter.
7782 * sparc.cc (Target_sparc::relocate_section): Add
7783 reloc_symbol_changes parameter.
7784 * configure.ac: Call AM_CONDITIONAL for the default target.
7785 * configure: Rebuild.
7786 * testsuite/Makefile.am (TEST_AS): New variable.
7787 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7788 (check_DATA): Add split_i386 and split_x86_64 files.
7789 (SPLIT_DEFSYMS): Define.
7790 (split_i386_[1234n].o): New targets.
7791 (split_i386_[124]): New targets.
7792 (split_i386_[1234r].stdout): New targets.
7793 (split_x86_64_[1234n].o): New targets.
7794 (split_x86_64_[124]): New targets.
7795 (split_x86_64_[1234r].stdout): New targets.
7796 (MOSTLYCLEANFILES): Add new executables.
7797 * testsuite/split_i386.sh: New file.
7798 * testsuite/split_x86_64.sh: New file.
7799 * testsuite/split_i386_1.s: New file.
7800 * testsuite/split_i386_2.s: New file.
7801 * testsuite/split_i386_3.s: New file.
7802 * testsuite/split_i386_4.s: New file.
7803 * testsuite/split_i386_n.s: New file.
7804 * testsuite/split_x86_64_1.s: New file.
7805 * testsuite/split_x86_64_2.s: New file.
7806 * testsuite/split_x86_64_3.s: New file.
7807 * testsuite/split_x86_64_4.s: New file.
7808 * testsuite/split_x86_64_n.s: New file.
7809 * testsuite/testfile.cc (Target_test): Update relocation_section
7810 function.
7811 * testsuite/Makefile.in: Rebuild.
7812
e8a9fcda
ILT
78132009-10-06 Ian Lance Taylor <iant@google.com>
7814
7815 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7816 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7817 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7818 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7819 the address on ldo_addrs_.
7820 (Target_i386::Relocate::fix_up_ldo): New function.
7821
e99daf92
ILT
78222009-10-06 Rafael Espindola <espindola@google.com>
7823
7824 * plugin.cc (add_input_library): New.
7825 (Plugin::load): Add add_input_library to tv.
7826 (Plugin_manager::add_input_file): Add the is_lib argument.
7827 (add_input_file): Update call to Plugin_manager::add_input_file.
7828 (add_input_library): New.
7829 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7830
966d4097
DK
78312009-09-30 Doug Kwan <dougkwan@google.com>
7832
7833 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7834 symbol and call Symbol::may_need_copy_reloc to determine if
7835 a copy reloc is needed.
7836 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7837 nocopyreloc is given in command line.
7838 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7839 given in command line.
7840 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7841 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7842 of the removed Target_i386::may_need_copy_reloc.
7843 * options.h (copyreloc): New option with default value false.
7844 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7845 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7846 instead of the removed Target_powerpc::may_need_copy_reloc.
7847 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7848 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7849 instead of the removed Target_sparc::may_need_copy_reloc.
7850 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7851 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7852 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7853 instead of the removed Target_x86_64::may_need_copy_reloc.
7854
029ba973
ILT
78552009-09-30 Ian Lance Taylor <iant@google.com>
7856
7857 * object.h (class Object): Remove target_ field, and target,
7858 sized_target, and set_target methods.
7859 (Object::sized_target): Remove.
7860 (class Sized_relobj): Update declarations. Remove sized_target.
7861 * object.cc (Sized_relobj::setup): Remove target parameter.
7862 Change all callers.
7863 (Input_objects::add_object): Don't do anything with the target.
7864 (make_elf_sized_object): Add punconfigured parameter. Change all
7865 callers. Set or test parameter target.
7866 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7867 Change all callers.
7868 * parameters.cc (Parameters::set_target): Change parameter type to
7869 be non-const.
7870 (Parameters::default_target): Remove.
7871 (set_parameters_target): Change parameter type to be non-const.
7872 (parameters_force_valid_target): New function.
7873 (parameters_clear_target): New function.
7874 * parameters.h (class Parameters): Update declarations. Remove
7875 default_target method. Add sized_target and clear_target
7876 methods. Change target_ to be non-const.
7877 (set_parameters_target): Update declaration.
7878 (parameters_force_valid_target): Declare.
7879 (parameters_clear_target): Declare.
7880 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7881 as NULL if we aren't searching.
7882 (Add_symbols::run): Don't check for compatible target.
7883 * fileread.cc (Input_file::open_binary): Call
7884 parameters_force_valid_target.
7885 * gold.cc (queue_middle_tasks): Likewise.
7886 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7887 set_target on object.
7888 * dynobj.h (class Sized_dynobj): Update declarations.
7889 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7890 make_elf_object returns NULL.
7891 (Archive::include_member): Don't check whether object target is
7892 compatible.
7893 * output.cc (Output_section::add_input_section): Get target from
7894 parameters.
7895 (Output_section::relax_input_section): Likewise.
7896 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7897 parameters.
7898 (Sized_relobj::do_scan_relocs): Likewise.
7899 (Sized_relobj::relocate_sections): Likewise.
7900 * resolve.cc (Symbol_table::resolve): Likewise.
7901 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7902 parameter. Change all callers.
7903 (Symbol_table::add_from_object): Get target from parameters.
7904 (Symbol_table::add_from_relobj): Don't check object target.
7905 (Symbol_table::add_from_dynobj): Likewise.
7906 (Symbol_table::define_special_symbol): Get target from
7907 parameters.
7908 * symtab.h (class Symbol_table): Update declaration.
7909 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7910 parameter. Change all callers. Clear parameter target.
7911 (Binary_test): Test target here.
7912 * testsuite/object_unittest.cc (gold_testsuite): Remove
7913 target_test_pointer parameter. Change all callers.
7914 (Object_test): Test target here.
7915
a6a22b83
ILT
79162009-09-26 Ian Lance Taylor <iant@google.com>
7917
7918 * testsuite/initpri1.c: Don't try to use constructor priorities if
7919 compiling with gcc before 4.3.
7920
6a8f49fe
ILT
79212009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7922
7923 * testsuite/retain_symbols_file_test.sh (check_present): Change
7924 output file name to retain_symbols_file_test.stdout.
7925 (check_absent): Likewise.
7926
8c604651
CS
79272009-09-18 Craig Silverstein <csilvers@google.com>
7928
7929 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7930 * options.cc: Include <cerrno> and <fstream>.
7931 (General_options::finalize): Parse -retain-symbols-file tag.
7932 * options.h: New flag.
7933 (General_options): New method should_retain_symbol, new
7934 variable symbols_to_retain.
7935 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7936 should_retain_symbol map.
7937 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7938 * testsuite/Makefile.in: Regenerate.
7939 * testsuite/retain_symbols_file_test.sh: New file.
7940
ca58b19f
NC
79412009-09-18 Nick Clifton <nickc@redhat.com>
7942
7943 * po/es.po: Updated Spanish translation.
7944
20e6d0d6
DK
79452009-09-17 Doug Kwan <dougkwan@google.com>
7946
7947 * debug.h (DEBUG_RELAXATION): New constant.
7948 (DEBUG_ALL): Add DEBUG_RELAXATION.
7949 (debug_string_to_enum): Add relaxation debug option.
7950 * layout.cc
7951 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7952 Layout::Relaxation_debug_check::read_sections,
7953 Layout::Relaxation_debug_check::read_sections): New method definitions.
7954 (Layout::Layout): Initialize data members
7955 record_output_section_data_from_scrips_,
7956 script_output_section_data_list_ and relaxation_debug_check_.
7957 (Layout::save_segments, Layout::restore_segments,
7958 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7959 Layout::relaxation_loop_body): New method definitions.
7960 (Layout::finalize): Support relaxation. Move section layout code to
7961 Layout::relaxation_loop_body.
7962 (Layout::set_asection_address_from_script): Move code for orphan
7963 section placement out.
7964 (Layout::place_orphan_sections_in_script): New method definition.
7965 * layout.h (Output_segment_headers, Output_file_header):
7966 New forward class declarations.
7967 (Layout::~Layout): Define.
7968 (Layout::new_output_section_data_from_script): New method definition.
7969 (Layout::place_orphan_sections_in_script): New method declaration.
7970 (Layout::Segment_states): New type declaration.
7971 (Layout::save_segments, Layout::restore_segments,
7972 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7973 Layout::relaxation_loop_body): New method declarations.
7974 (Layout::Output_section_data_list): New type declaration.
7975 (Layout::Relaxation_debug_check): New class definition.
7976 (Layout::record_output_section_data_from_script_,
7977 Layout::script_output_section_data_list_, Layout::segment_states_,
7978 Layout::relaxation_debug_check_): New data members.
7979 * output.cc: (Output_section_headers::do_size): New method definition.
7980 (Output_section_headers::Output_section_headers): Move size
7981 computation to Output_section_headers::do_size.
7982 (Output_segment_headers::do_size): New method definition.
e1df38aa 7983 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7984 Output_file_header::do_size and call it.
7985 (Output_file_header::do_size): New method definition.
7986 (Output_data_group::Output_data_group): Adjust call to
7987 Output_section_data.
7988 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7989 (Output_symtab_xindex::do_write): Add array bound check.
7990 (Output_section::Input_section::print_to_mapfile): Handle
7991 RELAXED_INPUT_SECTION_CODE.
7992 (Output_section::Output_section): Initialize data member checkpoint_.
7993 (Output_section::~Output_section): Delete checkpoint object pointed
7994 by checkpoint_.
7995 (Output_section::add_input_section): Always add an Input_section if
7996 relaxing.
7997 (Output_section::add_merge_input_section): Add assert.
7998 (Output_section::relax_input_section): New method definition.
7999 (Output_section::set_final_data_size): Set load address to zero for
8000 an unallocated section.
8001 (Output_section::do_address_and_file_offset_have_reset_values):
8002 New method definition.
8003 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8004 Handle relaxed input section.
8005 (Output_section::sort_attached_input_sections): Checkpoint input
8006 section list lazily.
8007 (Output_section::get_input_sections): Change type of input_sections to
8008 list of Simple_input_section pointers. Checkpoint input section list
8009 lazily. Also handle relaxed input sections.
8010 (Output_section::add_input_section_for_script): Take a reference to
8011 a Simple_input_section object instead of Relobj pointer and section
8012 index as parameter. Handle relaxed input sections.
8013 (Output_section::save_states, Output_section::restore_states): New
8014 method definitions.
8015 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8016 (Output_data::is_data_size_fixed): New method definition.
8017 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8018 if it is fixed.
8019 (Output_data::address_and_file_offset_have_reset_values): New method
8020 definition.
8021 (Output_data::do_address_and_file_offset_have_reset_values): New method
8022 definition.
8023 (Output_data::set_data_size): Check that data size is not fixed.
8024 (Output_data::fix_data_size): New method definition.
8025 (Output_data::is_data_size_fixed_): New data member.
8026 (Output_section_headers::set_final_data_size): New method definition.
8027 (Output_section_headers::do_size): New method declaration.
8028 (Output_segment_headers::set_final_data_size): New method definition.
8029 (Output_segment_headers::do_size): New method declaration.
8030 (Output_file_header::set_final_data_size)::New method definition.
8031 (Output_file_header::do_size)::New method declaration.
8032 (Output_section_data::Output_section_data): Add new parameter
8033 is_data_size_fixed and use it to fix data size.
8034 (Output_data_const::Output_data_const): Adjust call to base class
8035 constructor and fix data size.
8036 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8037 base class constructor and fix data size.
8038 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8039 base class constructor and fix data size.
8040 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8041 class constructor and fix data size.
8042 (Output_data_group::set_final_data_size): New method definition.
8043 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8044 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8045 class constructor and fix data size.
8046 (Output_relaxed_input_section): New class definition.
8047 (Output_section::Simple_input_section): New class definition.
8048 (Output_section::get_input_sections): Adjust parameter list.
8049 (Output_section::add_input_section_for_script): Same.
8050 (Output_section::save_states, Output_section::restore_states,
8051 Output_section::do_address_and_file_offset_have_reset_values,
8052 (Output_section::Input_section::Input_section): Handle
8053 RELAXED_INPUT_SECTION_CODE. Add new overload for
8054 Output_relaxed_input_section.
8055 (Output_section::Input_section::is_input_section,
8056 Output_section::Input_section::set_output_section): Handle relaxed
8057 input section.
8058 (Output_section::Input_section::is_relaxed_input_section,
8059 Output_section::Input_section::output_section_data,
8060 Output_section::Input_section::relaxed_input_section): New method
8061 definitions.
8062 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8063 value.
8064 (Output_section::Input_section::u1_): Update comments.
8065 (Output_section::Input_section::u2_): Add new union member poris.
8066 (Output_section::Checkpoint_output_section): New classs definition.
8067 (Output_section::relax_input_section): New method declaration.
8068 (Output_section::checkpoint_): New data member.
8069 (Output_segment): Update comments.
8070 (Output_segment::Output_segment): Un-privatize copy constructor.
8071 (Output_segment::operator=): Un-privatize.
8072 * script-sections.cc (Output_section_element::Input_section_list):
8073 Change element type to Output_section::Simple_input_section.
8074 (Output_section_element_dot_assignment::set_section_addresses):
8075 Register output section data for relaxation clean up.
8076 (Output_data_exression::Output_data_expression): Adjust call to base
8077 constructor to fix data size.
8078 (Output_section_element_data::set_section_addresses): Register
8079 Output_data_expression object for relaxation clean up.
8080 (struct Input_section_info): Replace Relobj pointer and section index
8081 pair with Output_section::Simple_input_section and Convert struct to a
8082 class.
8083 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8084 Input_section_info data member to use accessors.
20e6d0d6
DK
8085 (Output_section_element_input::set_section_addresses): Use layout
8086 parameter. Adjust code to use Output_section::Simple_input_section
8087 and Input_secction_info classes. Register filler for relaxation
8088 clean up.
8089 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8090 and section index pair with Output_section::Simple_input_section
8091 class. Adjust code accordingly.
8092 (Phdrs_element::release_segment): New method definition.
8093 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8094 segment list.
8095 (Script_sections::release_segments): New method definition.
8096 * gold/script-sections.h (Script_sections::release_segments): New
8097 method declaration.
8098 * gold/target.h (Target::may_relax, Target::relax,
8099 Target::do_may_relax, Target::do_relax): New method definitions.
8100
5e445df6
ILT
81012009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8102
8103 * arm.cc (has_signed_unsigned_overflow): New function.
8104 (Arm_relocate_functions::abs8): New function.
8105 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8106 (Target_arm::Scan::global): Likewise.
8107 (Target_arm::relocate::relocate): Likewise.
8108 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8109 Likewise.
8110
8c604651 81112009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8112
8113 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8114 * testsuite/Makefile.in: Regenerate.
8115
1e9cc1c2
NC
81162009-09-11 Nick Clifton <nickc@redhat.com>
8117
8118 * po/gold.pot: Updated by the Translation project.
8119
6a89f575
CC
81202009-09-08 Cary Coutant <ccoutant@google.com>
8121
8122 * output.cc (Output_file::open): Add execute permission to empty file.
8123 * testsuite/Makefile.am (permission_test): New test.
8124 * testsuite/Makefile.in: Regenerate.
8125
fdcac5af
ILT
81262009-09-02 Ian Lance Taylor <iant@google.com>
8127
8128 * output.cc (Output_file::resize): Call map_no_anonymous rather
8129 than map.
8130
44453f85
ILT
81312009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8132
8133 * gold.cc: Include "incremental.h".
8134 (queue_initial_tasks): Call Incremental_checker methods.
8135 * incremental.cc: Include "output.h".
8136 (Incremental_checker::can_incrementally_link_output_file): New
8137 method.
8138 * incremental.h (Incremental_checker): New class.
8139
8140 * output.cc (Output_file::open_for_modification): New method.
8141 (Output_file::map_anonymous): Changed return type to bool. Record
8142 map in base_ field.
8143 (Output_file::map_no_anonymous): New method, broken out of map.
8144 (Output_file::map): Use map_no_anonymous and map_anonymous.
8145 * output.h (class Output_file): Update declarations.
8146
293c1386
CC
81472009-08-24 Cary Coutant <ccoutant@google.com>
8148
8149 * options.h (Command_line::Pre_options): New class.
8150 (Command_line::pre_options): New member.
8151 * options.cc (gold::options::ready_to_register): New variable.
8152 (One_option::register_option): Do nothing if not registering options.
8153 Assert if same short option registered twice.
8154 (General_options::General_options): Turn off option registration when
8155 done constructing.
8156 (Command_line::Pre_options::Pre_options): New constructor.
8157
f773f3d2
CC
81582009-08-24 Cary Coutant <ccoutant@google.com>
8159
06a73cfe
CC
8160 * options.h (General_options::no_keep_memory): Remove incorrect
8161 short option.
f773f3d2 8162
a15af8e2
RW
81632009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8164
8165 * Makefile.am (am__skiplex, am__skipyacc): New.
8166 * Makefile.in: Regenerate.
8167
c462b41b
RW
81682009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8169
14ec8efd
RW
8170 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8171 (INCLUDES): ... this.
8172 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8173 (AM_CPPFLAGS): Renamed from ...
8174 (INCLUDE): ... this.
8175 * Makefile.in, testsuite/Makefile.in: Regenerate.
8176
81ecdfbb
RW
8177 * Makefile.in: Regenerate.
8178 * aclocal.m4: Likewise.
8179 * config.in: Likewise.
8180 * configure: Likewise.
8181 * testsuite/Makefile.in: Likewise.
8182
c462b41b
RW
8183 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8184 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8185 * Makefile.in: Regenerate.
8186 * testsuite/Makefile.in: Regenerate.
8187
2da73f13
CC
81882009-08-19 Cary Coutant <ccoutant@google.com>
8189
8190 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8191 symbols in shared libraries overridden by hidden or internal symbols
8192 in the main program.
8193
2db70501
CD
81942009-08-19 Chris Demetriou <cgd@google.com>
8195
8196 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8197 checking source file names in error messages.
8198
f733487b
DK
81992009-08-18 Doug Kwan <dougkwan@google.com>
8200
8201 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8202 an elcpp::Ehdr as parameter. Adjust call to set_target.
8203 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8204 an elfcpp::Ehdr as parameter.
8205 * object.cc (Object::set_target): Remove the version that looks up
8206 a target and sets it.
8207 (Sized_relobj::setup): Take a Target object instead of
8208 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8209 (make_elf_sized_object): Find target and ask target to
8210 make an ELF object.
8211 * object.h: (Object::set_target): Remove the version that looks up
8212 a target and sets it.
8213 (Sized_relobj::setup): Take a Target object instead of
8214 an elfcpp:Ehdr as parameter.
8215 * target.cc: Include dynobj.h.
8216 (Target::do_make_elf_object_implementation): New.
8217 (Target::do_make_elf_object): New.
8218 * target.h (Target::make_elf_object): New template declaration.
8219 (Target::do_make_elf_object): New method declarations.
8220 (Target::do_make_elf_object_implementation): New template declaration.
8221
cc70f101
ILT
82222009-08-14 Ian Lance Taylor <iant@google.com>
8223
8224 * gold.h (FUNCTION_NAME): Define.
8225 (gold_unreachable): Use FUNCTION_NAME.
8226
ef5e0cb1
ST
82272009-08-12 Sriraman Tallam <tmsriram@google.com>
8228
8229 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8230 symbol in the --keep-unique list is not found.
8231
48c187ce
ST
82322009-08-12 Sriraman Tallam <tmsriram@google.com>
8233
8234 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8235 been maked as --keep-unique.
8236 (Icf::unfold_section): New function.
8237 * icf.h (Icf::unfold_section): New function.
8238 * options.h (General_options::keep_unique): New option.
8239 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8240 * testsuite/Makefile.in: Regenerate.
8241 * testsuite/icf_keep_unique_test.sh: New file.
8242 * testsuite/icf_keep_unique_test.cc: New file.
8243
645afe0c
CC
82442009-08-12 Cary Coutant <ccoutant@google.com>
8245
8246 PR 10471
8247 * resolve.cc (Symbol_table::resolve): Check for references from
8248 dynamic objects to hidden and internal symbols.
8249 * testsuite/Makefile.am (hidden_test.sh): New test.
8250 * testsuite/Makefile.in: Regenerate.
8251 * testsuite/hidden_test.sh: New script.
8252 * testsuite/hidden_test_1.c: New test source.
8253 * testsuite/hidden_test_main.c: New test source.
8254
11af873f
DK
82552009-08-11 Doug Kwan <dougkwan@google.com>
8256
8257 * arm.cc: Update comments.
8258 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8259 segment to locate the .ARM.exidx section if present.
8260
b9f7d72d
DK
82612009-08-09 Doug Kwan <dougkwan@google.com>
8262
8263 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8264 patch.
8265
ddd3c53c
ST
82662009-08-07 Sriraman Tallam <tmsriram@google.com>
8267 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8268 compiler warnings.
8269
27721062
ST
82702009-08-06 Sriraman Tallam <tmsriram@google.com>
8271
8272 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8273 valid tls_segment only for non-debug-section relocations.
8274 * testsuite/Makefile.am: Add gc_tls_test.
8275 * testsuite/Makefile.in: Regenerate.
8276 * testsuite/gc_tls_test.cc: New file.
8277 * testsuite/gc_tls_test.sh: New file.
8278
ef15dade 82792009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8280
ef15dade
ST
8281 * icf.cc: New file.
8282 * icf.h: New file.
8283 * Makefile.am (CCFILES): Add icf.cc.
8284 (HFILES): Add icf.h
8285 * Makefile.in: Regenerate.
8286 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8287 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8288 section, symbol and addend information for the relocs.
8289 * gold.cc (queue_middle_tasks): Call identical code folding.
8290 * gold.h: Add defines for multimap.
8291 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8292 to the call of finalize_local_symbols.
8293 * main.cc (main): Create object of class Icf.
8294 * object.cc (Sized_relobj::do_layout): Allow this function to be
8295 called twice during icf.
8296 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8297 to sections marked as identical by icf.
8298 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8299 when available.
8300 (Sized_relobj::do_section_entsize): New function.
8301 * object.h (Object::section_entsize): New function.
8302 (Object::do_section_entsize): New pure virtual function.
8303 (Relobj::finalize_local_symbols): Add new parameter.
8304 (Relobj::do_section_entsize): New function.
8305 * options.h (General_options::icf): New option.
8306 (General_options::icf_iterations): New option.
8307 (General_options::print_icf_sections): New option.
8308 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8309 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8310 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8311 icf.
8312 * symtab.cc (Symbol_table::is_section_folded): New function.
8313 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8314 to sections marked as identical by icf.
8315 * symtab.h (Symbol_table::set_icf): New function.
8316 (Symbol_table::icf): New function.
8317 (Symbol_table::is_section_folded): New function.
8318 (Symbol_table::icf_): New data member.
8319 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8320 * testsuite/Makefile.am: Add commands to build icf_test.
8321 * testsuite/Makefile.in: Regenerate.
8322 * testsuite/icf_test.sh: New file.
8323 * testsuite/icf_test.cc: New file.
8324
c3b65ac4
CD
83252009-07-24 Chris Demetriou <cgd@google.com>
8326
8327 * layout.cc (is_compressible_debug_section): Fix incorrect
8328 comment about compressed section names.
8329
1caf2c51
ILT
83302009-07-20 Ian Lance Taylor <ian@airs.com>
8331
8332 PR 10419
8333 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8334
1ef4d87f
ILT
83352009-07-16 Ian Lance Taylor <iant@google.com>
8336
8337 PR 10400
8338 * layout.h: #include <map>.
8339 (class Kept_section): Change from struct to class. Add accessors
8340 and setters. Add section size to Comdat_group mapping. Change
8341 Comdat_group to std::map. Add is_comdat_ field. Add
8342 linkonce_size field in union.
8343 (class Layout): Update declaration of find_or_add_kept_section.
8344 Don't declare find_kept_object.
8345 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8346 parameter. Add object, shndx, is_comdat, and is_group_name
8347 parameters. Change all callers. Adjust for new Kept_section.
8348 (Layout::find_kept_object): Remove.
8349 * object.cc (Sized_relobj::include_section_group): Update use of
8350 Kept_section. Rename secnum to shndx. Only record
8351 Kept_comdat_section if sections are the same size.
8352 (Sized_relobj::include_linkonce_section): Update use of
8353 Kept_section. Only record Kept_comdat_section if sections are the
8354 same size. Set size of linkonce section.
8355 (Sized_relobj::map_to_kept_section): Update call to
8356 get_kept_comdat_section.
8357 * object.h (class Sized_relobj): Rename fields in
8358 Kept_comdat_section to drop trailing underscores; change object
8359 field to Relobj*. Change Kept_comdat_section_table to store
8360 struct rather than pointer.
8361 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8362 Add kept_object and kept_shndx parameters. Change all callers.
8363 (Sized_relobj::get_kept_comdat_section): Change return type to
8364 bool. Add kept_object and kept_shndx parameters. Change all
8365 callers.
8366 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8367 Layout::find_or_add_kept_section.
8368
37c3b7b0
ILT
83692009-07-09 Ian Lance Taylor <iant@google.com>
8370
8371 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8372 Reserve space in the hash table.
8373
98fa85cb
ILT
83742009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8375
8376 * fileread.cc (File_read::get_mtime): New method.
8377 * fileread.h (Timespec): New structure.
8378 (File_read::get_mtime): New method.
8379 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8380 Renamed from timestamp_nsec.
8381 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8382 Elf_Xword.
e1df38aa 8383 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8384 timestamp_nsec.
e1df38aa 8385 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8386 (Incremental_inputs::report_obejct): Save mtime; style fix.
8387 (Incremental_inputs::report_script): Save mtime; style fix.
8388 (Incremental_inputs::finalize_inputs): Style fix.
8389 (Incremental_inputs::finalize): Style fix.
8390 (Incremental_inputs::create_input_section_data): Store inputs
8391 mtime.
8392 * incremental.h (Incremental_inputs::report_script): Add mtime
8393 argument.
8394 (Incremental_inputs::Input_info::Input_info): Intialize only one
8395 union member.
8396 (Incremental_inputs::Input_info::archive): Move to nameless
8397 union.
8398 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8399 (Incremental_inputs::Input_info::script): Move to nameless union.
8400 (Incremental_inputs::mtime): New field.
8401 * script.cc (read_input_script): Pass file mtime to
8402 Incremental_input.
8403 * script.h (Script_info::inputs): Style fix.
8404
c9d70757
ILT
84052009-07-01 Ian Lance Taylor <ian@airs.com>
8406
8407 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8408 instead of 32.
8409
9c547ec3
ILT
84102009-06-24 Ian Lance Taylor <iant@google.com>
8411
8412 PR 10156
8413 * layout.cc (Layout::choose_output_section): If we find an
8414 existing section, update the flags.
8415 (Layout::create_notes): New function, broken out of
8416 Layout::finalize.
8417 (Layout::finalize): Don't create note sections.
8418 (Layout::create_note): Don't crash if linker script discards
8419 section.
8420 (Layout::create_gold_note): Likewise.
8421 (Layout::create_build_id): Likewise. Don't set
8422 after_input_sections on the section.
8423 (Layout::create_executable_stack_info): Remove target parameter.
8424 Change caller.
8425 * layout.h (class Layout): Declare create_notes. Update
8426 declaration of create_executable_stack_info.
8427 * gold.cc (queue_middle_tasks): Call create_notes.
8428 * output.cc (Output_section::update_flags_for_input_section): Move
8429 here from output.h. If SHF_ALLOC flag is newly set, mark address
8430 invalid.
8431 * output.h (Output_data::mark_address_invalid): New function.
8432 (class Output_section): Only declare, not define,
8433 update_flags_for_input_section. Remove set_flags.
8434
55458500
ILT
84352009-06-24 Ian Lance Taylor <iant@google.com>
8436
8437 * script-sections.cc (Output_section_definition::
8438 set_section_addresses): Rename shadowing local load_address to
8439 laddr.
8440
1307d6cd
ILT
84412009-06-24 Ian Lance Taylor <iant@google.com>
8442
8443 PR 10244
8444 * reloc.cc (relocate_sections): Skip empty relocation sections.
8445
ec3f783e
ILT
84462009-06-23 Ian Lance Taylor <iant@google.com>
8447
8448 PR 10156
8449 * layout.cc (Layout::create_note): Use choose_output_section
8450 rather than make_output_section.
8451
459c9f1c
ILT
84522009-06-23 Ian Lance Taylor <iant@google.com>
8453
8454 PR 10237
8455 * options.cc (General_options::parse_V): Set printed_version_.
8456 (General_options::General_options): Initialize printed_version_.
8457 * options.h (class General_options): Add printed_version_ field.
8458 * gold.cc (queue_initial_tasks): If there are no input files,
8459 don't give a fatal error if we printed the version information.
8460 (queue_middle_tasks): If using -r with a shared object, give a
8461 fatal error rather than an ordinary error.
8462
1518dc8f
ILT
84632009-06-23 Ian Lance Taylor <iant@google.com>
8464
8465 PR 10219
8466 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8467 (Layout::make_output_section): Set have_stabstr_section_ if we see
8468 a .stab*str section.
8469 (Layout::finalize): Call link_stabs_sections.
8470 (Layout::link_stabs_sections): New file.
8471 * layout.h (class Layout): Add have_stabstr_section_ field.
8472 Declare link_stabs_sections.
8473
3d857b98
DK
84742009-06-23 Doug Kwan <dougkwan@google.com>
8475
8476 * Makefile.am (libgold_a_LIBADD): New.
8477 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8478 * Makefile.in: Regenerate.
8479 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8480 * configure: Regenerate.
8481 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8482 * fileread.cc: Include sys/state.h
8483 * gold.h: Declare memmem and strndup if found missing.
8484 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8485
0639a6f6
ILT
84862009-06-23 Ian Lance Taylor <iant@google.com>
8487
8488 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8489 * configure: Rebuild.
8490
8d63875c
ILT
84912009-06-23 Ian Lance Taylor <iant@google.com>
8492
8493 PR 10147
8494 * object.cc (Object::section_contents): Don't try to get a view if
8495 the section has length zero.
8496 (Object::handle_gnu_warning_section): If the section is empty, use
8497 the name of the section as the warning.
8498
f7c8a183
ILT
84992009-06-23 Ian Lance Taylor <iant@google.com>
8500
8501 PR 10133
8502 * stringpool.h (class Stringpool_template): Add optimize_ field.
8503 (Stringpool_template::set_optimize): New function.
8504 * stringpool.cc (Stringpool_template::Stringpool_template):
8505 Initialize optimize_ field.
8506 (Stringpool_template::set_string_offsets): Test local optimize
8507 fild rather than parameter.
8508 * layout.cc (Layout::Layout): Call set_optimize on the section
8509 name stringpool.
8510
e6a307ba
ILT
85112009-06-22 Ian Lance Taylor <iant@google.com>
8512
8513 PR 10030
8514 * yyscript.y: Parse TARGET.
8515 * script.cc (script_set_target): New function.
8516 * script-c.h (script_set_target): Declare.
8517 * options.cc (General_options::string_to_object_format): Rename
8518 from string_to_object_format in anonymous namespace. Change
8519 callers.
8520 * options.h (class General_options): Declare
8521 string_to_object_format.
8522
3ee173de
ILT
85232009-06-22 Ian Lance Taylor <iant@google.com>
8524
8525 * script-sections.cc (Script_sections::create_segments): Don't put
8526 program headers in a PT_LOAD segment if -n or -N.
8527
85282009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
8529
8530 PR 10141
8531 * options.h (class General_options): Add -z lazy and -z now. Sort
8532 -z options into alphabetical order.
8533 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8534
cd6739a1 85352009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
8536
8537 * layout.cc (Layout::make_output_section): Call
8538 Target::new_output_section.
8539 (Layout::attach_allocated_section_to_segment): Put large section
8540 sections in a separate load segment with the large segment flag
8541 set.
8542 (Layout::segment_precedes): Sort large data segments after other
8543 load segments.
8544 (align_file_offset): New static function.
8545 (Layout::set_segment_offsets): Use align_file_offset.
8546 * output.h (class Output_section): Add is_small_section_ and
8547 is_large_section_ fields.
8548 (Output_section::is_small_section): New function.
8549 (Output_section::set_is_small_section): New function.
8550 (Output_section::is_large_section): New function.
8551 (Output_section::set_is_large_section): New function.
8552 (Output_section::is_large_data_section): New function.
8553 (class Output_segment): Add is_large_data_segment_ field.
8554 (Output_segment::is_large_data_segment): New function.
8555 (Output_segment::set_is_large_data_segment): New function.
8556 * output.cc (Output_section::Output_section): Initialize new
8557 fields.
8558 (Output_segment::Output_segment): Likewise.
8559 (Output_segment::add_output_section): Add assertion that large
8560 data sections always go in large data segments. Force small data
8561 sections to the end of the list of data sections. Force small BSS
8562 sections to the start of the list of BSS sections. For large BSS
8563 sections to the end of the list of BSS sections.
8564 * symtab.h (class Symbol): Declare is_common_shndx.
8565 (Symbol::is_defined): Check Symbol::is_common_shndx.
8566 (Symbol::is_common): Likewise.
8567 (class Symbol_table): Define enum Commons_section_type. Update
8568 declarations. Add small_commons_ and large_commons_ fields.
8569 * symtab.cc (Symbol::is_common_shndx): New function.
8570 (Symbol_table::Symbol_table): Initialize new fields.
8571 (Symbol_table::add_from_object): Put small and large common
8572 symbols in the right list.
8573 (Symbol_table::sized_finalized_symbol): Check
8574 Symbol::is_common_shndx.
8575 (Symbol_table::sized_write_globals): Likewise.
8576 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8577 common symbol lists. Don't call do_allocate_commons_list if the
8578 list is empty.
8579 (Symbol_table::do_allocate_commons_list): Remove is_tls
8580 parameter. Add comons_section_type parameter. Change all
8581 callers. Handle small and large common symbols.
8582 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8583 Symbol::is_common_shndx.
8584 * resolve.cc (symbol_to_bits): Likewise.
8585 * target.h (Target::small_common_shndx): New function.
8586 (Target::small_common_section_flags): New function.
8587 (Target::large_common_shndx): New function.
8588 (Target::large_common_section_flags): New function.
8589 (Target::new_output_section): New function.
8590 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8591 small_common_section_flags, and large_common_section_flags
8592 fields.
8593 (Target::do_new_output_section): New virtual function.
8594 * arm.cc (Target_arm::arm_info): Initialize new fields.
8595 * i386.cc (Target_i386::i386_info): Likewise.
8596 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8597 Likewise.
8598 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8599 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8600 (Target_x86_64::do_new_output_section): New function.
8601 * configure.ac: Define conditional MCMODEL_MEDIUM.
8602 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8603 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8604 (large_LDFLAGS): Define.
8605 * testsuite/large.c: New file.
8606 * testsuite/testfile.cc (Target_test::test_target_info):
8607 Initialize new fields.
8608 * configure, testsuite/Makefile.in: Rebuild.
8609
bb04269c
DK
86102009-06-05 Doug Kwan <dougkwan@google.com>
8611
8612 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 8613 * Makefile.in: Regenerate.
bb04269c
DK
8614 * i386.cc (class Target_i386): Define new virtual method to
8615 override do_is_local_label_name in parent.
8616 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8617 local symbols if --discard-locals or -X is given.
8618 * options.h (class General_options): Declare new options
8619 '--discard-locals' and '-X' for discarding locals.
8620 * target.h (class Target): Define new methods is_local_label_name.
8621 Declare new virtual method do_is_local_label_name.
8622 * target.cc: New file.
8623 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8624 (check_SCRIPTS): Add discard_locals_test.sh.
8625 (check_DATA): Add discard_local_tests.syms.
8626 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8627 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8628 * testsuite/Makefile.in: Regenerate.
8629 * testsuite/discard_locals_test.c: New file.
8630 * testsuite/discard_locals_test.sh: Same.
8631
805bb01c
DK
86322009-06-05 Doug Kwan <dougkwan@google.com>
8633
8634 * object.cc (Sized_relobj::Sized_relobj): Initialize
8635 discarded_eh_frame_shndx_ to -1U.
8636 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8637 section.
8638 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8639 a discarded .eh_frame section.
8640 (Sized_relobj::do_finalize_local_symbols): Ditto.
8641 * object.h (class Sized_relobj): Declare new member
8642 discarded_eh_frame_shndx_.
8643 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8644 (local_labels_test.o, local_labels_test): New rules.
8645 * testsuite/Makefile.in: Regenerate.
8646
1dcd334d
DK
86472009-06-04 Doug Kwan <dougkwan@google.com>
8648
8649 * layout.cc (Layout::section_name_mapping): Add mapping for
8650 special ARM sections.
8651
96d49306
DK
86522009-06-03 Doug Kwan <dougkwan@google.com>
8653
8654 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8655 (utils::has_overflow): Same.
8656
dff16297
ILT
86572009-06-03 Ian Lance Taylor <iant@google.com>
8658
8659 * layout.cc (Layout::section_name_mapping): New array, replacing
8660 Layout::linkonce_mapping.
8661 (Layout::section_name_mapping_count): New variable, replacing
8662 Layout::linkonce_mapping_count.
8663 (Layout::linkonce_output_name): Remove.
8664 (Layout::output_section_name): Rewrite.
8665 * layout.h (class Layout): Rename Linkonce_mapping to
8666 Section_name_mapping, linkonce_mapping to section_name_mapping,
8667 linkonce_mapping_count to section_name_mapping_count. Don't
8668 declare linkonce_output_name.
8669
c121c671
DK
86702009-06-03 Doug Kwan <dougkwan@google.com>
8671
8672 * gold/arm.cc (namespace utils): New.
8673 (Target_arm::reloc_is_non_pic): Define new method.
8674 (class Arm_relocate_functions): New.
8675 (Target_arm::Relocate::relocate): Handle relocation types used by
8676 Android.
8677
07800fab
ILT
86782009-06-03 Ian Lance Taylor <iant@google.com>
8679
8680 * arm.cc (Target_arm::scan::global): Use || instead of |.
8681
c121c671
DK
86822009-06-02 Doug Kwan <dougkwan@google.com>
8683
8684 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8685 issued_non_pic_error_.
8686 (class Target_arm::Scan): Declare new method check_non_pic.
8687 Define new method symbol_needs_plt_entry.
8688 Declare new data member issued_non_pic_error_.
8689 (class Target_arm::Relocate): Declare new method
8690 should_apply_static_reloc.
8691 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8692 (Target_arm::Scan::check_non_pic): Define new method.
8693 (Target_arm::Scan::local): Handle a small subset of reloc types used
8694 by Android.
8695 (Target_arm::Scan::local): Same.
8696 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8697
b19b0c6d
ILT
86982009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8699
8700 * incremental.cc (Incremental_inputs::report_command_line): Filter
8701 out --incremental-* options.
8702
94cdfcff
DK
87032009-05-29 Doug Kwan <dougkwan@google.com>
8704
8705 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8706 template class.
8707 (class Target_arm): Update comment.
8708 (Target_arm::Target_arm): Initialize new data members GOT_,
8709 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8710 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8711 and Target_arm::rel_dyn_section.
8712 Declare new_enum Target_arm::Got_type.
8713 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8714 and DYNBSS_.
8715 Update commments for member do_dynsym_value.
8716 (Target_arm::got_size, Target_arm::plt_section,
8717 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8718 new methods inside class defintion.
8719 (Target_arm::got_section): Define new method.
8720 (Target_arm::rel_dyn_section): Same.
8721 (Output_data_plt_arm): New template class.
8722 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8723 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8724 (Output_data_plt_arm::add_entry): Same.
8725 (Output_data_plt_arm::first_plt_entry): Define new
8726 static data member for PLT instruction template.
8727 (Output_data_plt_arm::plt_entry): Same.
8728 (Output_data_plt_arm::do_write): Define new method.
8729 (Target_arm::make_plt_entry): Same.
8730 (Target_arm::do_finalize_sections): Same.
8731 (Target_arm::do_dynsym_value): Same.
8732
4a657b0d
DK
87332009-05-28 Doug Kwan <dougkwan@google.com>
8734
8735 * Makefile.am (TARGETSOURCES): Add arm.cc.
8736 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8737 * Makefile.in: Regenerate.
8738 * arm.cc: New file.
8739 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8740
e7ae8c36
DK
87412009-05-26 Doug Kwan <dougkwan@google.com>
8742
8743 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8744 (General_options::check_excluded_libs): Strip off directories in
8745 archive name before matching like GNU ld does.
8746 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8747 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8748 (exclude_libs_test_LDFLAGS): Add linker option
8749 -Wl,--exclude-libs,libexclude_libs_test_3
8750 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8751 an explicit archive without using -l.
8752 (alt/libexclude_libs_test_3.a): New make rule.
8753 * testsuite/Makefile.in: Regenerate.
8754 * testsuite/exclude_libs_test.c : Declare lib3_default().
8755 (main): Call it.
8756 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8757 * exclude_libs_test_3.c: New file.
8758
f12e7348
NC
87592009-05-26 Nick Clifton <nickc@redhat.com>
8760
8761 * po/id.po: New Indonesian translation.
8762 * po/gold.pot: Updated template file.
8763
4daadc0d
ST
87642009-05-22 Sriraman Tallam <tmsriram@google.com>
8765
e1df38aa 8766 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8767 gc_comdat_test files. Add -Wl,--gc-sections to build
8768 gc_comdat_test.
8769 * testsuite/Makefile.in: Regenerate.
8770 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8771
531813ad
ST
87722009-05-21 Sriraman Tallam <tmsriram@google.com>
8773
8774 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8775 kept comdat section was garbage collected.
8776 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8777 * testsuite/Makefile.in: Regenerate.
8778 * testsuite/gc_comdat_test.sh: New file.
8779 * testsuite/gc_comdat_test_1.cc: New file.
8780 * testsuite/gc_comdat_test_2.cc: New file.
8781
65514900
CC
87822009-05-19 Doug Kwan <dougkwan@google.com>
8783
8784 * archive.cc (Archive::Archive): Move constructor from archive.h
8785 to here. Initialize no_export_.
8786 (Archive::get_elf_object_for_member): Set no_export flag of object.
8787 * archive.h (Archive::Archive): Move constructor body to
8788 archive.cc.
8789 (Archive::no_export): New method.
8790 (Archive::no_export_): New field.
8791 * object.h (Object::Object): Initialize no_export_ to false.
8792 (Object::no_export, Object::set_no_export): New methods.
8793 (Object::no_export_): New field.
8794 * options.cc (General_options::parse_exclude_libs): New method.
8795 (General_options::check_excluded_libs) Same.
8796 * options.h (exclude_libs): New option.
8797 (General_options::check_excluded_libs): New method declaration.
8798 (General_options::excluded_libs_): New field.
8799 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8800 default or protected visibility if an object has no-export flag set.
8801 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8802 (check_SCRIPTS): Add exclude_libs_test.sh.
8803 (check_DATA): Add exclude_libs_test.syms.
8804 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8805 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8806 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8807 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8808 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8809 libexclude_libs_test_2.a): New rules.
8810 * testsuite/Makefile.in: Regenerate.
8811 * testsuite/exclude_libs_test.c: New file.
8812 * testsuite/exclude_libs_test.sh: Ditto.
8813 * testsuite/exclude_libs_test_1.c: Ditto.
8814 * testsuite/exclude_libs_test_2.c: Ditto.
8815
1b77ea50
ILT
88162009-05-15 Ian Lance Taylor <iant@google.com>
8817
8818 * configure.ac: Check for declarations for cases where libiberty.h
8819 checks HAVE_DECL_xxx.
8820 * configure, config.in: Rebuild.
8821
072fe7ce
ILT
88222009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8823
8824 * gold.h (Incremental_argument_list): Remove (invalid) forward
8825 declaration.
8826 * incremental.cc (Incremental_inputs::report_achive): New method.
8827 (Incremental_inputs::report_object): New method.
8828 (Incremental_inputs::report_script): New method.
8829 (Incremental_inputs::finalize_inputs): New method.
8830 (Incremental_inputs::finalize): Call finalize_inputs().
8831 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8832 Create inputs entries.
8833 * incremental.h (Incremental_input_type): New enum.
8834 (Incremental_inputs::Incremental_input): Initialize new fields.
8835 (Incremental_inputs::report_inputs): New method.
8836 (Incremental_inputs::report_achive): New method.
8837 (Incremental_inputs::report_object): New method.
8838 (Incremental_inputs::report_script): New method.
8839 (Incremental_inputs::finalize_inputs): New method.
8840 (Incremental_inputs::Input_info): New struct.
8841 (Incremental_inputs::Input_info_map): New typedef.
8842 (Incremental_inputs::lock_): New field.
8843 (Incremental_inputs::Inputs_): New field.
8844 (Incremental_inputs::Inputs_map): New field.
8845 * main.cc (main): Call Incremental_input::report_inputs.
8846 * options.h (Input_argument_list): Typedef moved from
8847 Input_arguments.
8848 (Input_file_group::Files): Remove, use ::Input_argument_list.
8849 (Input_file_group::Input_argument_list): Remove, use
8850 ::Input_argument_list.
8851 * plugin.cc (Plugin_manager::add_input_file): Add error in
8852 incremental build.
8853 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8854 functions.
8855 * script.cc (read_input_script): Call
8856 Incremental_input::report_script.
8857 * script.h (Script_info): New class.
8858
b0481b0b
ILT
88592009-04-27 Ian Lance Taylor <iant@google.com>
8860
8861 * x86_64.cc (do_adjust_output_section): Set entsize to
8862 plt_entry_size.
8863
b22a5a41 88642009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8865
8866 * output.cc (Output_file::close): After short writes, continue
8867 writing from the correct offset in the buffer being written.
8868
40fde488
CD
88692009-04-23 Chris Demetriou <cgd@google.com>
8870
8871 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8872 * configure: Regenerate.
8873 * config.in: Regenerate.
8874 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8875 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8876
3ce2c28e
ILT
88772009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8878
8879 * incremental.cc (Incremental_inputs_header_data): Renamed from
8880 Incremental_input_header_data.
8881 (Incremental_inputs_header_data::data_size): New field.
8882 (Incremental_inputs_header_data::put_input_file_count): Renamed
8883 from input_file_count.
8884 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8885 from command_line_offset.
8886 (Incremental_inputs_header_data::put_reserved): Renamed from
8887 put_reserved.
8888 (Incremental_inputs_entry_data): Renamed from
8889 Incremental_input_entry_data.
8890 (Incremental_inputs_entry_data::data_size): New field.
8891 (Incremental_inputs::report_command_line): New method.
8892 (Incremental_inputs::finalize): New method.
8893 (Incremental_inputs::create_incremental_inputs_data): New method.
8894 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8895 * incremental.h: New file.
8896 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8897 (Layout::finalize): Create incremental inputs section in
8898 incremental builds.
8899 (Layout::create_incremental_info_sections): New method.
8900 * layout.h (Layout::incremental_inputs): New method.
8901 (Layout::create_incremental_info_sections): New method.
8902 (Layout::incremental_inputs_): New field.
8903 * main.cc (main): Notify Incremental_input of the command line.
8904
e55bde5e
ILT
89052009-04-01 Ian Lance Taylor <iant@google.com>
8906 Mikolaj Zalewski <mikolajz@google.com>
8907
8908 * gold.h (reserve_unordered_map): Define, three versions, one for
8909 each version of Unordered_map.
8910 * layout.cc (Layout::Layout): Remove options parameter. Add
8911 number_of_input_files parameter. Don't initialize options_.
8912 Initialize number_of_input_files_ and resized_signatures_. Move
8913 sections_are_attached_.
8914 (Layout::layout_group): Reserve space for group_signatures_.
8915 (Layout::find_or_add_kept_section): Change name parameter to be a
8916 reference. Resize signatures_ map when it gets large enough.
8917 (Layout::layout_eh_frame): Use parameters->options() instead of
8918 this->options_.
8919 (Layout::make_output_section): Likewise.
8920 (Layout::attach_allocated_section_to_segment): Likewise.
8921 (Layout::finalize, Layout::create_executable_stack): Likewise.
8922 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8923 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8924 * layout.h (class Layout): Update declarations. Remove options_
8925 field. Add number_of_input_files_ and resized_signatures_
8926 fields. Move sections_are_attached_ field.
8927 * main.cc (main): Pass number of input files to Layout
8928 constructor. Don't pass options.
8929
154b857c
ILT
89302009-03-30 Ian Lance Taylor <iant@google.com>
8931
8932 * ffsll.c (ffsll): Correct implementation.
8933
2f35ab9b
ILT
89342009-03-27 Ian Lance Taylor <iant@google.com>
8935
fd03461a
ILT
8936 * ffsll.c: New file.
8937 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8938 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8939 * ftruncate.c (ftruncate): Declare before definition.
8940 * mremap.c (mremap): Likewise.
8941 * pread.c (pread): Likewise.
8942 * configure, Makefile.in, config.in: Rebuild.
8943
2f35ab9b
ILT
8944 * mremap.c: New file.
8945 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8946 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8947 (mremap): Declare if HAVE_MREMAP is not defined.
8948 * configure, Makefile.in, config.in: Rebuild.
8949
33aea2fd
CC
89502009-03-27 Cary Coutant <ccoutant@google.com>
8951
8952 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8953 position independent.
8954 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8955 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8956
6d479619
CC
89572009-03-24 Cary Coutant <ccoutant@google.com>
8958
8959 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8960 an executable.
8961 (needs_dynamic_reloc): Likewise.
8962
afc06bb8
ILT
89632009-03-24 Ian Lance Taylor <iant@google.com>
8964
8965 * yyscript.y (file_cmd): Recognize EXTERN.
8966 (extern_name_list, extern_name_list_body): New nonterminals.
8967 * script.cc (script_add_extern): Define.
8968 * script-c.h (script_add_extern): Declare.
8969
f6060a4d
ILT
89702009-03-24 Rafael Avila de Espindola <espindola@google.com>
8971
8972 * object.cc (is_elf_object): Define.
8973 * object.h (is_elf_object): Declare.
8974 * archive.cc (Archive::get_elf_object_for_member): Call
8975 is_elf_object.
33aea2fd 8976 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8977
26736d8e
ILT
89782009-03-24 Elliott Hughes <enh@google.com>
8979
8980 * output.cc (Output_file::map_anonymous): Define.
8981 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8982 try an anonymous one. Report the size if the mmap fails.
8983 * output.h (class Output_file): Declare map_anonymous.
8984
22fd9730
ILT
89852009-03-24 Ian Lance Taylor <iant@google.com>
8986
8987 * target-select.cc (instantiate_target): Don't acquire the lock if
8988 the instantiated_target_ field has already been set.
8989
cb010894
ILT
89902009-03-23 Ian Lance Taylor <iant@google.com>
8991
7f055c20
ILT
8992 * gold-threads.h (class Initialize_lock): Define.
8993 * gold-threads.cc (class Initialize_lock_once): Define.
8994 (initialize_lock_control): New static variable.
8995 (initialize_lock_pointer): New static variable.
8996 (initialize_lock_once): New static function.
8997 (Initialize_lock::Initialize_lock): Define.
8998 (Initialize_lock::initialize): Define.
8999 * target-select.h: Include "gold-threads.h".
9000 (class Target_selector): Add lock_ and initialize_lock_ fields.
9001 Don't define instantiate_target, just declare it.
9002 * target-select.cc (Target_selector::Target_selector): Initialize
9003 new fields.
9004 (Target_selector::instantiate_target): Define.
9005 * descriptors.h: Include "gold-threads.h".
9006 (class Descriptors): Add initialize_lock_ field.
9007 * descriptors.cc (Descriptors::Descriptors): Initialize new
9008 field.
9009 (Descriptors::open): Use initialize_lock_ field
9010 * errors.h (class Errors): Add initialize_lock_ field.
9011 * errors.cc (Errors::Errors): Initialize new field.
9012 (Errors::initialize_lock): Use initialize_lock_ field.
9013 * powerpc.cc (class Target_selector_powerpc): Remove
9014 instantiated_target_ field. In do_recognize call
9015 instantiate_target rather than do_instantiate_target. In
9016 do_instantiate_target just allocate a new target.
9017 * sparc.cc (class Target_selector_sparc): Likewise.
9018
36959681
ILT
9019 * freebsd.h: New file.
9020 * i386.cc: Include "freebsd.h".
9021 (Target_i386): Derive from Target_freebsd rather than
9022 Sized_target.
9023 (Target_selector_i386): Derive from Target_selector_freebsd rather
9024 than Target_selector.
9025 * x86_64.cc: Include "freebsd.h".
9026 (Target_x86_64): Derive from Target_freebsd rather than
9027 Sized_target.
9028 (Target_selector_x86_64): Derive from Target_selector_freebsd
9029 rather than Target_selector.
9030 * target.h (class Target): Add adjust_elf_header and
9031 do_adjust_elf_header.
9032 * output.cc (Output_file_header:: do_sized_write): Call target
9033 adjust_elf_header routine.
9034 * configure.tgt: Set targ_osabi.
9035 * configure.ac: Define GOLD_DEFAULT_OSABI.
9036 * parameters.cc (Parameters::default_target): Pass
9037 GOLD_DEFAULT_OSABI to select_target.
9038 * target-select.h (class Target_selector): Make instantiate_target
9039 protected rather than private.
9040 * Makefile.am (HFILES): Add freebsd.h.
9041 * configure, Makefile.in, config.in: Rebuild.
9042
cb010894
ILT
9043 * merge.cc (do_add_input_section): Correct pend value. Change
9044 message about last entry not being null terminated from error to
9045 warning.
9046
0e879927
ILT
90472009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9048
9049 * incremental.cc: New file.
9050 * Makefile.am (CCFILES): Add incremental.cc.
9051 * Makefile.in: Rebuild.
9052
41105937
PP
90532009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9054
9055 * layout.cc (Layout::output_section_name): Preserve names
9056 of '.note.' sections.
e1df38aa 9057
60439920
ILT
90582009-03-19 Ian Lance Taylor <iant@google.com>
9059
9060 * descriptors.cc (Descriptors::open): Check that the options are
9061 valid before using them.
9062
0d371ad3
ILT
90632009-03-18 Ian Lance Taylor <iant@google.com>
9064
9065 * script-sections.h: Include <list>.
9066 (class Script_sections): Change Sections_elements from std::vector
9067 to std::list. Typedef public Elements_iterator. Add
9068 orphan_section_placement_, data_segment_align_start_, and
9069 saw_data_segment_align_ fields. Remove data_segment_align_index_
9070 field.
9071 * script-sections.cc (class Orphan_section_placement): New class.
9072 (class Sections_element): Add virtual functions is_relro and
9073 orphan_section_init. Remove virtual function place_orphan_here.
9074 (class Output_section_definition): Add is_relro and
9075 orphan_section_init. Remove place_orphan_here.
9076 (class Orphan_output_section): Likewise.
9077 (Script_sections::Script_sections): Update for field changes.
9078 (Script_sections::data_segment_align): Set saw_data_segment_align_
9079 and data_segment_align_start_, not data_segment_align_index.
9080 (Script_sections::data_segment_relro_end): Check
9081 saw_data_segment_align_. Use data_segment_align_start_ rather
9082 than data_segment_align_index_.
9083 (Script_sections::place_orphan): Rewrite to use
9084 Orphan_section_placement.
9085
9201d894
ILT
90862009-03-17 Ian Lance Taylor <iant@google.com>
9087
9c5b8369
ILT
9088 * archive.cc (Archive::add_symbols): Check for a version attached
9089 to the symbol name in the archive map.
9090 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9091 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9092 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9093 (ver_test_11.a): New target.
9094 * testsuite/Makefile.in: Rebuild.
9095
9201d894
ILT
9096 * configure.ac: Check for chsize and posix_fallocate. Replace
9097 ftruncate.
9098 * ftruncate.c: New file, from gnulib.
9099 * output.cc (posix_fallocate): Define dummy version if not
9100 HAVE_POSIX_FALLOCATE.
9101 (Output_file::map): Call posix_fallocate rather than lseek and
9102 write.
9103 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9104 * configure, Makefile.in, config.in: Rebuild.
9105
ef4ab7a8 91062009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9107
ef4ab7a8
PP
9108 * layout.h (Layout::create_note): Add section_name parameter.
9109 * layout.cc (Layout::create_note): Likewise.
9110 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9111
8c500701
ILT
91122009-03-17 Ian Lance Taylor <iant@google.com>
9113
e85b18e1
ILT
9114 * descriptors.cc: Include "options.h".
9115 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9116 (Descriptors::open): Always use O_CLOEXEC when opening a new
9117 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9118 then set FD_CLOEXEC.
9119
9efe6174
ILT
9120 * sparc.cc (class Target_sparc): Add has_got_section.
9121 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9122 make sure we have a GOT section.
9123
9124 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9125 (Target_sparc::Scan::local): Likewise.
9126 (Target_sparc::Scan::global): Likewise.
9127 (Target_sparc::Relocate::relocate): Likewise.
9128 (Target_sparc::Relocate::relocate_tls): Likewise.
9129
8c500701
ILT
9130 * symtab.cc (Symbol_table::define_default_version): New function,
9131 broken out of add_from_object.
9132 (Symbol_table::add_from_object): Call define_default_version.
9133 (Symbol_table::define_special_symbol): Add resolve_oldsym
9134 parameter. Change all callers. If the version for a symbol comes
9135 from a version script, resolve it with the symbol with the same
9136 name with no version. Also add the symbol without a version if
9137 appropriate.
9138 (do_define_in_output_data): If resolving with oldsym, don't delete
9139 sym.
9140 (do_define_in_output_segment): Likewise.
9141 (do_define_as_constant): Likewise.
9142 * symtab.h (class Symbol_table): Update declarations.
9143
f1ed28fb
ILT
91442009-03-13 Ian Lance Taylor <iant@google.com>
9145
15f8229b
ILT
9146 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9147 (Read_symbols::requeue): New function.
9148 (Read_symbols::do_read_symbols): If make_elf_object fails because
9149 the target type is not configured, and the file was searched for,
9150 issue a warning and retry with the next directory.
9151 (Add_symbols::run): If the file has an incompatible format, and
9152 it was searched for, requeue the Read_symbols task. On error,
9153 release the object.
9154 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9155 dirindex parameter to constructor. Change all callers. Declare
9156 incompatible_warning and requeue.
9157 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9158 input_argument_ and input_group_ fields. Add them to
9159 constructor. Change all callers.
9160 (class Read_script): Add dirindex_ field. Add it to constructor.
9161 Change all callers.
9162 * archive.cc (Archive::setup): Remove input_objects parameter.
9163 Change all callers.
9164 (Archive::get_file_and_offset): Likewise.
9165 (Archive::read_all_symbols): Likewise.
9166 (Archive::read_symbols): Likewise.
9167 (Archive::get_elf_object_for_member): Remove input_objects
9168 parameter. Add punconfigured parameter. Change all callers.
9169 (Archive::add_symbols): Change return type to bool. Check return
9170 value of include_member.
9171 (Archive::include_all_members): Likewise.
9172 (Archive::include_member): Change return type to bool. Return
9173 false if first included object has incompatible target. Set
9174 included_member_ field.
9175 (Add_archive_symbols::run): If add_symbols returns false, requeue
9176 Read_symbols task.
9177 * archive.h (class Archive): Add included_member_ field.
9178 Initialize it in constructor. Add input_file and searched_for
9179 methods. Update declarations.
9180 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9181 input_argument_ fields. Add them to constructor. Change all
9182 callers.
9183 * script.cc: Include "target-select.h".
9184 (class Parser_closure): Add skip_on_incompatible_target_ and
9185 found_incompatible_target_ fields. Add
9186 skip_on_incompatible_target parameter to constructor. Change all
9187 callers. Add methods skip_on_incompatible_target,
9188 clear_skip_on_incompatible_target, found_incompatible_target, and
9189 set_found_incompatible_target.
9190 (read_input_script): Add dirindex parameter. Change all callers.
9191 If parser finds an incompatible target, requeue Read_symbols
9192 task.
9193 (script_set_symbol): Clear skip_on_incompatible_target in
9194 closure.
9195 (script_add_assertion, script_parse_option): Likewise.
9196 (script_start_sections, script_add_phdr): Likewise.
9197 (script_check_output_format): New function.
9198 * script.h (read_input_script): Update declaration.
9199 * script-c.h (script_check_output_format): Declare.
9200 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9201 (ignore_cmd): Remove OUTPUT_FORMAT.
9202 * fileread.cc (Input_file::Input_file): Add explicit this.
9203 (Input_file::will_search_for): New function.
9204 (Input_file::open): Add pindex parameter. Change all callers.
9205 * fileread.h (class Input_file): Add input_file_argument method.
9206 Declare will_search_for. Update declarations.
9207 * object.cc (make_elf_object): Add punconfigured parameter.
9208 Change all callers.
9209 * object.h (class Object): Make input_file public. Add
9210 searched_for method.
9211 (make_elf_object): Update declaration.
9212 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9213 restart search.
9214 * dirsearch.h (class Dirsearch): Update declaration.
9215 * options.h (class General_options): Add --warn-search-mismatch.
9216 * parameters.cc (Parameters::is_compatible_target): New function.
9217 * parameters.h (class Parameters): Declare is_compatible_target.
9218 * workqueue.cc (Workqueue::add_blocker): New function.
9219 * workqueue.h (class Workqueue): Declare add_blocker.
9220
f1ed28fb
ILT
9221 * fileread.cc (Input_file::open): Remove options parameter.
9222 Change all callers.
9223 (Input_file::open_binary): Likewise.
9224 * script.cc (read_input_script): Likewise.
9225 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9226 options parameter from constructor. Change all callers.
9227 (class Read_script): Likewise.
9228 * fileread.h (class Input_file): Update declarations.
9229 * script.h (read_input_script): Update declaration.
9230
34dd024a
NC
92312009-03-10 Nick Clifton <nickc@redhat.com>
9232
9233 * po/es.po: New Spanish translation.
9234
6d71b17c
CC
92352009-03-06 Cary Coutant <ccoutant@google.com>
9236
9237 * options.cc (parse_short_option): Keep dash_z from registering itself.
9238
031cdbed
ILT
92392009-03-03 Ian Lance Taylor <iant@google.com>
9240
9241 PR 9918
9242 * target-reloc.h (relocate_section): Pass output_section to
9243 relocate.
9244 * i386.cc (Target_i386::should_apply_static_reloc): Add
9245 output_section parameter. Change all callers.
9246 (Target_i386::Relocate::relocate): Add output_section parameter.
9247 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9248 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9249 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9250 * testsuite/two_file_shared.sh: New script.
9251 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9252 (check_DATA): Add two_file_shared.dbg.
9253 (two_file_shared.dbg): New target.
9254 * testsuite/Makefile.in: Rebuild.
9255
15d5fa16
ILT
92562009-03-01 Ian Lance Taylor <iant@google.com>
9257
9258 * configure.ac: Check for byteswap.h.
9259 * configure: Rebuild.
9260 * config.in: Rebuild.
9261
8a4c0b0d
ILT
92622009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9263
9264 * layout.cc (Layout::find_or_add_kept_section): New function.
9265 (Layout::add_comdat): Removed.
9266 * layout.h (struct Kept_section): Move out of class Layout.
9267 Remove trailing underscores from field names. Add group_sections
9268 field. Rename group_ field to is_group. Change all uses.
9269 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9270 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9271 comdat_groups_ field.
9272 (Sized_relobj::include_section_group): Use
9273 find_or_add_kept_section and Kept_section::group_sections.
9274 (Sized_relobj::include_linkonce_section): Likewise.
9275 * object.cc (class Sized_relobj): Don't define Comdat_group or
9276 Comdat_group_table. Remove find_comdat_group and
9277 add_comdat_group. Remove comdat_groups_ field.
9278 * plugin.cc (include_comdat_group): Use
9279 Layout::find_or_add_kept_section.
9280
b4ecf66b
ILT
92812009-02-28 Ian Lance Taylor <iant@google.com>
9282
14359ca0
ILT
9283 * README: --gc-sections and map files are now supported. Document
9284 some build requirements.
9285
b4ecf66b
ILT
9286 PR 6992
9287 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9288 relocatable link set the value of the section symbol to zero.
9289 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9290 relocatable link don't include the section address in the local
9291 symbol value.
9292
0602e05a
ILT
92932009-02-27 Ian Lance Taylor <iant@google.com>
9294
fd9d194f
ILT
9295 PR 6811
9296 * options.h (class Search_directory): Add is_system_directory.
9297 (class General_options): Declare is_in_system_directory.
9298 * options.cc (get_relative_sysroot): Make static.
9299 (get_default_sysroot): Make static.
9300 (General_optoins::is_in_system_directory): New function.
9301 * fileread.cc (Input_file::is_in_system_directory): New function.
9302 * fileread.h (class Input_file): Declare is_in_system_directory.
9303 * object.h (class Object): Add is_in_system_directory.
9304 (class Input_objects): Remove system_library_directory_ field.
9305 * object.cc (Input_objects::add_object): Don't set
9306 system_library_directory_.
9307 (input_objects::found_in_system_library_directory): Remove.
9308 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9309 parameter. Change all callers.
9310 (Symbol_table::sized_write_globals): Likewise.
9311 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9312 Call Object::is_in_system_directory.
9313 * symtab.h (class Symbol_table): Update declarations.
9314
61edd21f
ILT
9315 PR 5990
9316 * descriptors.h (Open_descriptor): Add is_on_stack field.
9317 * descriptors.cc (Descriptors::open): If the descriptor is on the
9318 top of the stack, remove it. Initialize is_on_stack field.
9319 (Descriptors::release): Only add pod to stack if it is not on the
9320 stack already.
9321 (Descriptors::close_some_descriptor): Clear stack_next and
9322 is_on_stack fields.
9323
e29e076a
ILT
9324 PR 7091
9325 * output.cc (Output_section::find_starting_output_address): Rename
9326 from starting_output_address; add PADDR parameter; change return
9327 type.
9328 * output.h (class Output_section): Declare
9329 find_starting_output_address instead of starting_output_address.
9330 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9331 section symbol for which we can't find a merge section.
9332
0602e05a
ILT
9333 PR 9836
9334 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9335 hidden or internal, force the symbol to be local.
9336 * resolve.cc (Symbol::override_visibility): Define.
9337 (Symbol::override_base): Use override_visibility.
9338 (Symbol_table::resolve): Likewise.
9339 (Symbol::override_base_with_special): Likewise.
9340 (Symbol_table::override_with_special): If the visibility is hidden
9341 or internal, force the symbol to be local.
9342 * symtab.h (class Symbol): Add set_visibility and
9343 override_visibility.
9344 * testsuite/ver_test_1.sh: New file.
9345 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9346 (check_DATA): Add ver_test_1.syms.
9347 (ver_test_1.syms): New target.
9348 * testsuite/Makefile.in: Rebuild.
9349
401a9a73
CC
93502009-02-25 Cary Coutant <ccoutant@google.com>
9351
9352 * layout.cc (Layout::choose_output_section): Don't rename sections
9353 when using a linker script that has a SECTIONS clause.
9354 * Makefile.in: Regenerate.
9355
9356 * testsuite/Makefile.am (script_test_5.sh): New test case.
9357 * testsuite/Makefile.in: Regenerate.
9358 * testsuite/script_test_5.cc: New file.
9359 * testsuite/script_test_5.sh: New file.
9360 * testsuite/script_test_5.t: New file.
9361
f488e4b0
CC
93622009-02-13 Rafael Avila de Espindola <espindola@google.com>
9363
9364 * archive.cc (Archive::include_member): Update calls to add_symbols.
9365 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9366 the Layout argument.
9367 * dynobj.h (do_add_symbols): Add the Layout argument.
9368 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9369 Layout argument.
9370 * object.h (Object::add_symbols): Add the Layout argument.
9371 (Object::do_add_symbols): Add the Layout argument.
9372 (Sized_relobj::do_add_symbols): Add the Layout argument.
9373 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9374 Unify the two versions.
9375 (Add_plugin_symbols): Remove.
9376 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9377 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9378 (Add_plugin_symbols): Remove.
9379 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9380 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9381 (Add_symbols::run): Make it work with Pulginobj.
9382
89dd1680
ILT
93832009-02-06 Ian Lance Taylor <iant@google.com>
9384
9385 * object.cc (Sized_relobj::do_layout): Make info message start
9386 with lower case letter.
9387
266d0a74
ILT
93882009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9389
602b464e
ILT
9390 * binary.cc: Fix file comment.
9391
266d0a74
ILT
9392 * options.h (enum Incremental_disposition): Define.
9393 (class General_options): Add new options: --incremental,
9394 --incremental_changed, --incremental_unchanged,
9395 --incremental_unknown. Add incremental_disposition_ and
9396 implicit_incremental_ fields.
9397 (General_options::incremental_disposition): New function.
9398 (class Position_dependent_options): Add incremental_disposition
9399 option.
9400 (Position_dependent_options::copy_from_options): Set incremental
9401 dispositions.
9402 * options.cc (General_options::parse_incremental_changed): New
9403 function.
9404 (General_options::parse_incremental_unchanged): New function.
9405 (General_options::parse_incremental_unknown): New function.
9406 (General_options::General_options): Initialize new fields
9407 incremental_disposition_ and implicit_incremental_.
9408 (General_options::finalize): Check for uasge of --incremental-*
9409 without --incremental.
9410
f073bbf7
CD
94112009-02-06 Chris Demetriou <cgd@google.com>
9412
9413 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9414 pointer and to report location as the file name associated with
9415 the symbol.
9416 (gold_undefined_symbol_at_location): New function to replace the
9417 old gold_undefined_symbol functionality.
9418 * target-reloc.h (relocate_section): Update to use
9419 gold_undefined_symbol_at_location.
9420 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9421 Call gold_undefined_symbol function rather than gold_error.
9422 * errors.h (Errors::undefined_symbol): Take location as a
9423 string, rather than calculating it from a relocation.
9424 * errors.cc (Errors::fatal): Print "fatal error:" before the
9425 formatted message.
9426 (Errors::error, Errors::error_at_location): Print "error: "
9427 before the formatted message.
9428 (Errors::undefined_symbol): Take location as a string, rather
9429 than calculating it from a relocation.
9430 (gold_undefined_symbol_at_location): New function akin to
9431 old gold_undefined_symbol, calculates location from relocation.
9432 (gold_undefined_symbol): Change to take only a Symbol pointer
9433 and to report location as the file name associated with the symbol.
9434 * testsuite/debug_msg.sh: Update for changed error messages.
9435 * testsuite/undef_symbol.sh: Likewise.
9436
8e94a90c
ILT
94372009-02-04 Duncan Sands <baldrick@free.fr>
9438
9439 PR 9812
9440 * reduced_debug_output.h
9441 (Output_reduced_debug_abbrev_section::failed): Use format for
9442 gold_warning.
9443 (Output_reduced_debug_info_section::faild): Likewise.
9444
88a0e15b
ILT
94452009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9446
9447 * script.cc (Lazy_demangler): New class.
9448 (Version_script_info::get_symbol_version_helper): Demangle a
9449 symbol only once.
9450
5efc7cd2
CC
94512009-01-29 Cary Coutant <ccoutant@google.com>
9452
9453 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9454 to __tls_get_addr.
9455 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9456
e0ebcf42
ILT
94572009-01-28 Ian Lance Taylor <iant@google.com>
9458
5efc7cd2 9459 * version.cc (version_string): Bump to 1.9.
75fe7426 9460
e0ebcf42
ILT
9461 * gold.h: Include <cstring> and <stdint.h>.
9462 * version.cc: Include <cstdio>.
9463 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9464 warning.
9465 * reduced_debug_output.cc (insert_into_vector): Rename from
9466 Insert_into_vector; change all callers. Use Swap_unaligned to
9467 avoid aliasing issue; remove union since it is unnecessary.
9468
8e2813be 94692009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
9470
9471 * Makefile.am (CCFILES): Add gc.cc.
9472 (HFILES): Add gc.h.
9473 * Makefile.in: Regenerate.
9474 * gold.cc (Gc_runner): New class.
9475 (queue_initial_tasks): Call garbage collection related tasks
9476 when corresponding options are invoked.
9477 (queue_middle_gc_tasks): New function.
9478 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9479 processed early before laying out sections during garbage collection.
9480 * gold.h (queue_middle_gc_tasks): New function.
9481 (is_prefix_of): Move from "layout.cc".
9482 * i386.cc (Target_i386::gc_process_relocs): New function.
9483 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9484 * main.cc (main): Create object of class "Garbage_collection".
9485 * object.cc (Relobj::copy_symbols_data): New function.
9486 (Relobj::is_section_name_included): New function.
e1df38aa
NC
9487 (Sized_relobj::do_layout): Allow this function to be called twice
9488 during garbage collection and defer layout of section during the
6d03d481
ST
9489 first call.
9490 * object.h (Relobj::get_symbols_data): New function.
9491 (Relobj::is_section_name_included): New function.
9492 (Relobj::copy_symbols_data): New function.
9493 (Relobj::set_symbols_data): New function.
9494 (Relobj::get_relocs_data): New function.
9495 (Relobj::set_relocs_data): New function.
9496 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9497 (Relobj::gc_process_relocs): New function.
9498 (Relobj::do_gc_process_relocs): New pure virtual function.
9499 (Relobj::sd_): New data member.
9500 (Sized_relobj::is_output_section_offset_invalid): New function.
9501 (Sized_relobj::do_gc_process_relocs): New function.
9502 * options.h (General_options::gc_sections): Modify to not be a no-op.
9503 (General_options::print_gc_sections): New option.
9504 * plugin.cc (Plugin_finish::run): Remove function call to
9505 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9506 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9507 * reloc.cc (Read_relocs::run): Add task to process relocs and
9508 determine unreferenced sections when doing garbage collection.
9509 (Gc_process_relocs): New class.
9510 (Sized_relobj::do_gc_process_relocs): New function.
9511 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9512 sections that are garbage collected.
9513 * reloc.h (Gc_process_relocs): New class.
9514 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9515 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9516 symbols whose corresponding sections are garbage collected.
9517 (Symbol_table::Symbol_table): Add new parameter for the garbage
9518 collection object.
9519 (Symbol_table::gc_mark_undef_symbols): New function.
9520 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9521 (Symbol_table::gc_mark_dyn_syms): New function.
9522 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9523 as garbage.
9524 (Symbol_table::add_from_object): Likewise.
9525 (Symbol_table::add_from_relobj): When building shared objects, do not
9526 treat externally visible symbols as garbage.
9527 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9528 table information for static and relocatable links.
9529 * symtab.h (Symbol_table::set_gc): New function.
9530 (Symbol_table::gc): New function.
9531 (Symbol_table::gc_mark_undef_symbols): New function.
9532 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9533 (Symbol_table::gc_mark_dyn_syms): New function.
9534 (Symbol_table::gc_): New data member.
e1df38aa 9535 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
9536 function.
9537 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9538 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9539
3b293544
CF
95402009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9541
9542 * options.h (General_options::gc_sections): Define as a no-op for now.
9543 (General_options::no_keep_memory): Ditto.
9544 (General_options::Bshareable): Define.
9545 * options.cc (General_options::finalize): Honor -Bshareable.
9546
83d22aa8
AS
95472009-01-20 Andreas Schwab <schwab@suse.de>
9548
9549 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9550 read the value in the contents, since we don't use it. Use the
9551 template endianness when writing.
9552 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9553
cd536b21
AS
95542009-01-19 Andreas Schwab <schwab@suse.de>
9555
9556 * configure.tgt (powerpc64-*): Fix targ_obj.
9557
99e9a495
ILT
95582009-01-15 Ian Lance Taylor <iant@google.com>
9559
9560 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9561 local symbols when stripping all symbols.
9562
bbbfea06
CC
95632009-01-14 Cary Coutant <ccoutant@google.com>
9564
99e9a495 9565 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 9566
0f7c0701
CC
95672009-01-14 Cary Coutant <ccoutant@google.com>
9568
9569 * archive.cc (Archive::get_elf_object_for_member): Remove call
9570 to File_read::claim_for_plugin.
9571 * descriptors.cc (Descriptors::open): Remove reference to
9572 is_claimed.
9573 (Descriptors::claim_for_plugin): Remove.
9574 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9575 (Descriptors::is_claimed): Remove.
9576 (claim_descriptor_for_plugin): Remove.
9577 * fileread.cc (File_read::claim_for_plugin): Remove.
9578 * fileread.h (File_read::claim_for_plugin): Remove.
9579 (File_read::descriptor): Reopen descriptor if necessary.
9580 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9581 (Plugin_manager::all_symbols_read): Add task parameter. Change
9582 all callers.
9583 (Plugin_manager::get_input_file): New function.
9584 (Plugin_manager::release_input_file): New function.
9585 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9586 corresponding data member.
9587 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9588 and pass to base constructor. Change all callers.
9589 (get_input_file, release_input_file): New functions.
9590 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9591 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9592 (Plugin_manager::all_symbols_read): Add task parameter.
9593 (Plugin_manager::get_input_file): New function.
9594 (Plugin_manager::release_input_file): New function.
9595 (Plugin_manager::task_): New data member.
9596 (Pluginobj::Pluginobj): Add filesize parameter.
9597 (Pluginobj::filename): New function.
9598 (Pluginobj::descriptor): New function.
9599 (Pluginobj::filesize): New function.
9600 (Pluginobj::filesize_): New data member.
9601 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9602 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9603 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9604
9605 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9606 with archive libraries.
9607 * testsuite/Makefile.in: Regenerate.
9608 * testsuite/plugin_test.c (struct sym_info): New type.
9609 (get_input_file, release_input_file): New static variables.
9610 (onload): Capture new transfer vector entries.
9611 (claim_file_hook): Stop reading at end of file according to filesize.
9612 Factor out parsing of readelf output into separate function.
9613 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9614 APIs and get the source file name from the symbol table. Convert
9615 source file name to corresponding object file name. Print info
9616 message when adding new input files.
9617 (parse_readelf_line): New function.
9618 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9619 * testsuite/plugin_test_2.sh: Likewise.
9620 * testsuite/plugin_test_3.sh: Likewise.
9621 * testsuite/plugin_test_4.sh: New test case.
9622
62a6d109
ILT
96232009-01-07 Ian Lance Taylor <iant@google.com>
9624
9625 * version.cc (version_string): Bump to 1.8.
9626
483620e8
CC
96272008-12-23 Cary Coutant <ccoutant@google.com>
9628
9629 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9630 * plugin.cc (Plugin_manager::finish): Rename as
9631 layout_deferred_objects. Move cleanup to separate function.
9632 (Plugin_manager::cleanup): New function.
9633 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9634 separately.
9635 * plugin.h (Plugin_manager::finish): Rename as
9636 layout_deferred_objects.
9637 (Plugin_manager::cleanup): New function.
9638 (Plugin_manager::cleanup_done): New field.
9639
d66a9eb3
CC
96402008-12-23 Cary Coutant <ccoutant@google.com>
9641
9642 * plugin.cc (is_visible_from_outside): New function.
9643 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9644 so we don't return "IR only" status for exported symbols or -r links.
9645
9646 * testsuite/Makefile.am (plugin_test_3): New test case.
9647 * testsuite/Makefile.in: Regenerate.
9648 * testsuite/plugin_test_3.sh: New file.
9649
5995b570
CC
96502008-12-22 Cary Coutant <ccoutant@google.com>
9651
9652 * object.cc (Sized_relobj::layout_section): New function.
9653 (Sized_relobj::do_layout): Defer layout of input sections until after
9654 plugin has provided replacement files.
9655 (Sized_relobj::do_layout_deferred_sections): New function.
9656 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9657 (Relobj::layout_deferred_sections): New function.
9658 (Relobj::do_layout_deferred_sections): New function.
9659 (Sized_relobj::do_layout_deferred_sections): New function.
9660 (Sized_relobj::layout_section): New function.
9661 (Sized_relobj::Deferred_layout): New structure.
9662 (Sized_relobj::deferred_layout_): New field.
9663 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9664 Change all callers. Layout deferred sections.
9665 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9666 references.
9667 (Plugin_hook::run): Move code from do_plugin_hook inline.
9668 (Plugin_hook::do_plugin_hook): Remove.
9669 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9670 (Plugin_manager::finish): Renamed, was cleanup.
9671 (Plugin_manager::should_defer_layout): New function.
9672 (Plugin_manager::add_deferred_layout_object): New function.
9673 (Plugin_manager::Deferred_layout_list): New type.
9674 (Plugin_manager::deferred_layout_objects_): New field.
9675 (Plugin_hook::do_plugin_hook): Remove.
9676
ee769c88
ILT
96772008-12-17 Ian Lance Taylor <iant@google.com>
9678
9679 * options.h (class General_options): Add --no case for
9680 --export-dynamic.
9681
abc8dcba
CC
96822008-12-16 Cary Coutant <ccoutant@google.com>
9683
9684 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9685 vector.
9686 (Plugin_manager::claim_file): Create plugin object even if
9687 plugin did not call the add_symbols callback.
9688 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9689 asking for more symbols than were added.
9690 * testsuite/Makefile.am (plugin_test_1): Add test case with
9691 no global symbols.
9692 (empty.syms): New target.
9693 * testsuite/Makefile.in: Regenerate.
9694 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9695 message. Don't call add_symbols if no globals.
9696 (all_symbols_read_hook): Don't provide replacement for empty
9697 claimed file.
9698
b0074644
ILT
96992008-12-12 Ian Lance Taylor <iant@google.com>
9700
68943102
ILT
9701 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9702 r_type == 0 for a local symbol with r_sym == 0.
9703 (scan_relocatable_relocs): Pass r_sym to
9704 local_non_section_strategy.
9705 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9706 r_sym parameter.
9707
b0074644
ILT
9708 * configure.ac: Update test for TLS descriptors: they are
9709 supported as of glibc 2.9.
9710 * configure: Rebuild.
9711
c2508178
ILT
97122008-12-11 Ian Lance Taylor <iant@google.com>
9713
9714 PR 7091
9715 * target-reloc.h (Default_scan_relocatable_relocs): For each
9716 function, map r_type == 0 to RELOC_DISCARD.
9717
2756a258
CC
97182008-12-10 Cary Coutant <ccoutant@google.com>
9719
9720 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9721 object to override a kept COMDAT group from a plugin object.
9722
bb6f53d3
ILT
97232008-12-09 Ian Lance Taylor <iant@google.com>
9724
fbc558e1
ILT
9725 PR 7088
9726 * yyscript.y (file_cmd): Handle INPUT.
9727
bb6f53d3
ILT
9728 * testsuite/initpri1.c: Change all declarations to be full
9729 prototypes by adding void, to avoid compiler warnings.
9730
4674ecfc
CC
97312008-12-05 Rafael Avila de Espindola <espindola@google.com>
9732
9733 * options.cc (General_options::parse_plugin_opt): New.
9734 (General_options::add_plugin): The argument now is just the filename.
9735 (General_options::add_plugin_option): New.
9736 * options.h (plugin_opt): New.
9737 (add_plugin): Change argument name.
9738 (add_plugin_option): New.
9739 * plugin.cc (Plugin::load): Don't parse the plugin option.
9740 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9741 (Plugin::add_option): New.
9742 (Plugin::args_): Change type.
9743 (Plugin::filename_): New.
9744 (Plugin_manager::add_plugin_option): New.
9745 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9746 * testsuite/Makefile.in: Regenerate.
9747
fd06b4aa
CC
97482008-12-05 Cary Coutant <ccoutant@google.com>
9749
9750 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9751 Handle --strip-lto-sections option.
9752 * options.h (strip_lto_sections): New option.
9753
6c52134c
CC
97542008-12-01 Cary Coutant <ccoutant@google.com>
9755
9756 * plugin.cc (ld_plugin_message): Change format parameter to const.
9757 Fix mismatch between new[] and delete.
9758
a45248e0
CC
97592008-11-14 Cary Coutant <ccoutant@google.com>
9760
9761 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9762 instead of -1U.
9763
c82fbeee
CS
97642008-11-05 Craig Silverstein <csilvers@google.com>
9765
9766 * options.cc (General_options::parse_dynamic_list): New function.
9767 * options.h (General_options): New flags dynamic_list,
9768 dynamic_list_data, dynamic_list_cpp_new, and
9769 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9770 (General_options::in_dynamic_list): New function.
9771 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9772 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9773 (Lex::can_continue_name): Likewise.
9774 (yylex): Likewise.
9775 (read_script_file): New parameter script_options.
9776 (read_dynamic_list): New function.
9777 (Script_options::define_dynamic_list): New function.
9778 (dynamic_list_keyword_parsecodes): New variable.
9779 (dynamic_list_keywords): New variable.
9780 * script.h (Script_options::define_dynamic_list): New function
9781 prototype.
9782 (read_dynamic_list): New function prototype.
9783 * symtab.cc (strprefix): New macro.
9784 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9785 dynamic_list_data, dynamic_list_cpp_new, and
9786 dynamic_list_cpp_typeinfo.
9787 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9788 (dynamic_list_expr): New rule.
9789 (dynamic_list_nodes): Likewise.
9790 (dynamic_list_node): Likewise.
9791 * testsuite/Makefile.am (dynamic_list): New test.
9792 * testsuite/Makefile.in: Regenerated.
9793 * testsuite/dynamic_list.t: New file.
9794 * testsuite/dynamic_list.sh: New file.
9795
e0bb29a5
CS
97962008-11-05 Craig Silverstein <csilvers@google.com>
9797
9798 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9799 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9800 (t11_last): Likewise.
9801 * testsuite/ver_test_6.c (main): Likewise.
9802
4e1e25e0
CC
98032008-10-07 Cary Coutant <ccoutant@google.com>
9804
9805 * options.c (General_options::finalize): Add check for -static and
9806 -shared.
9807 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9808 is not empty.
9809
92f03fcb
CC
98102008-10-02 Cary Coutant <ccoutant@google.com>
9811
9812 * plugin.cc (make_sized_plugin_object): Fix conditional
9813 compilation to work when not all targets are enabled.
9814
fbd8a257
CC
98152008-09-29 Cary Coutant <ccoutant@google.com>
9816
9817 * archive.cc (Archive::get_file_and_offset): Use filename instead
9818 of name to get library path.
9819 (Archive::include_member): Unlock external member of a thin archive.
9820
9821 * testsuite/Makefile.am (TEST_AR): New variable.
9822 (thin_archive_test_1): New test.
9823 (thin_archive_test_2): New test.
81636b3f
CC
9824 * testsuite/Makefile.in: Regenerate.
9825 * testsuite/thin_archive_main.cc: New file.
9826 * testsuite/thin_archive_test_1.cc: New file.
9827 * testsuite/thin_archive_test_2.cc: New file.
9828 * testsuite/thin_archive_test_3.cc: New file.
9829 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9830
eff45813
CC
98312008-09-29 Cary Coutant <ccoutant@google.com>
9832
9833 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9834 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9835 instead of -1U.
9836 (Sized_relobj::do_finalize_local_symbols): Likewise.
9837 (Sized_relobj::map_to_kept_section): Likewise.
9838 * object.h (Sized_relobj::invalid_address): New constant.
9839 (Sized_relobj::do_output_section_offset): Check for invalid_address
9840 and return -1ULL.
9841 * output.cc (Output_reloc::local_section_offset): Use constant
9842 invalid_address instead of -1U.
9843 (Output_reloc::get_address): Likewise.
9844 (Output_section::output_address): Change -1U to -1ULL.
9845 * output.h (Output_reloc::invalid_address): New constant.
9846 * reloc.cc (Sized_relobj::write_sections): Use constant
9847 invalid_address instead of -1U.
9848 (Sized_relobj::relocate_sections): Likewise.
9849 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9850 values for merge sections.
9851 * target-reloc.h (relocate_for_relocatable): Use constant
9852 invalid_address instead of -1U.
9853
89fc3421
CC
98542008-09-19 Cary Coutant <ccoutant@google.com>
9855
9856 Add plugin functionality for link-time optimization (LTO).
9857 * configure.ac (plugins): Add --enable-plugins option.
9858 * configure: Regenerate.
9859 * config.in: Regenerate.
9860 * Makefile.am (LIBDL): New variable.
9861 (CCFILES): Add plugin.cc.
9862 (HFILES): Add plugin.h.
9863 (ldadd_var): Add LIBDL.
9864 * Makefile.in: Regenerate.
9865
9866 * archive.cc: Include "plugin.h".
9867 (Archive::setup): Don't preread archive symbols when using a plugin.
9868 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9869 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9870 files.
9871 (Archive::include_member): Add symbols from plugin objects.
9872 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9873 * descriptors.cc (Descriptors::open): Check for file descriptors
9874 abandoned by plugins.
9875 (Descriptors::claim_for_plugin): New function.
9876 * descriptors.h (Descriptors::claim_for_plugin): New function.
9877 (Open_descriptor::is_claimed): New field.
9878 (claim_descriptor_for_plugin): New function.
9879 * fileread.cc (File_read::claim_for_plugin): New function.
9880 * fileread.h (File_read::claim_for_plugin): New function.
9881 (File_read::descriptor): New function.
9882 * gold.cc: Include "plugin.h".
9883 (queue_initial_tasks): Add task to call plugin hooks for generating
9884 new object files.
9885 * main.cc: Include "plugin.h".
9886 (main): Load plugin libraries.
9887 * object.h (Pluginobj): Declare.
9888 (Object::pluginobj): New function.
9889 (Object::do_pluginobj): New function.
9890 (Object::set_target): New function.
9891 * options.cc: Include "plugin.h".
9892 (General_options::parse_plugin): New function.
9893 (General_options::General_options): Initialize plugins_ field.
9894 (General_options::add_plugin): New function.
9895 * options.h (Plugin_manager): Declare.
9896 (General_options): Add --plugin option.
9897 (General_options::has_plugins): New function.
9898 (General_options::plugins): New function.
9899 (General_options::add_plugin): New function.
9900 (General_options::plugins_): New field.
9901 * plugin.cc: New file.
9902 * plugin.h: New file.
9903 * readsyms.cc: Include "plugin.h".
9904 (Read_symbols::do_read_symbols): Check for archive before checking
9905 for ELF file. Call plugin hooks to claim files.
9906 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9907 from a real object file; force override when processing replacement
9908 files.
9909 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9910 (Symbol::init_base_object): Likewise.
9911 (Symbol::init_base_output_data): Likewise.
9912 (Symbol::init_base_output_segment): Likewise.
9913 (Symbol::init_base_constant): Likewise.
9914 (Symbol::init_base_undefined): Likewise.
9915 (Symbol::output_section): Assert that object is not a plugin.
9916 (Symbol_table::add_from_pluginobj): New function.
9917 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9918 undefined.
9919 (Symbol_table::sized_write_globals): Likewise.
9920 (Symbol_table::add_from_pluginobj): Instantiate template.
9921 * symtab.h (Sized_pluginobj): Declare.
9922 (Symbol::in_real_elf): New function.
9923 (Symbol::set_in_real_elf): New function.
9924 (Symbol::in_real_elf_): New field.
9925 (Symbol_table::add_from_pluginobj): New function.
9926
9927 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9928 (LIBDL): New variable.
9929 (LDADD): Add LIBDL.
9930 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9931 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9932 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9933 (MOSTLYCLEANFILES): Likewise.
9934 * testsuite/Makefile.in: Regenerate.
9935 * testsuite/plugin_test.c: New file.
9936 * testsuite/plugin_test_1.sh: New file.
9937 * testsuite/plugin_test_2.sh: New file.
9938
de31bda5
ILT
99392008-09-16 Ian Lance Taylor <iant@google.com>
9940
9c2d0ef9
ILT
9941 * target-reloc.h (relocate_section): Check whether a symbol is
9942 defined by the ABI before reporting an undefined symbol error.
9943 * target.h (Target::is_defined_by_abi): Make parameter const.
9944 (Target::do_is_defined_by_abi): Likewise.
9945 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9946 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9947 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9948 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9949 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9950 * testsuite/Makefile.in: Rebuild.
9951
de31bda5
ILT
9952 * fileread.cc (make_view): Add casts to avoid warning.
9953
9fa33bee
AO
99542008-09-16 Alexandre Oliva <aoliva@redhat.com>
9955
9956 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9957 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9958
183fd0e3
AO
99592008-09-16 Alexandre Oliva <aoliva@redhat.com>
9960
9961 * options.h (General_options::output_is_executable): New.
9962 (General_options::output_is_pie): New.
9963 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9964 for shared libraries.
9965 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9966
7be8330a
CD
99672008-09-11 Chris Demetriou <cgd@google.com>
9968
9969 * options.h (origin): New -z option.
9970 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9971 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9972 in DT_FLAGS_1.
9973
a9caad02
CC
99742008-09-05 Cary Coutant <ccoutant@google.com>
9975
9976 * fileread.cc (File_read::make_view): Add check for attempt to map
9977 beyond end of file.
9978
ae6dce4d
CC
99792008-09-05 Cary Coutant <ccoutant@google.com>
9980
9981 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9982 explicit instantiations.
9983
d7ab2a47
KVH
99842008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9985
9986 PR gold/6858
9987 * options.cc (General_options::finalize): Allow undefined symbols
9988 in shlibs if linking -shared.
9989
9990 PR gold/6859
9991 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9992 symbols as not needing a dynsym entry.
9993
1e52a9c1
CS
99942008-08-20 Craig Silverstein <csilvers@google.com>
9995
9996 * fileread.cc (File_read::open): Do not lock the file unless it
9997 was successfully opened.
9998
d85c80a3
CC
99992008-08-14 Cary Coutant <ccoutant@google.com>
10000
10001 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10002 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10003 * testsuite/tls_test.cc (struct int128): 128-bit struct
10004 for testing TLS relocs with non-zero addend.
10005 (v12): New TLS variable.
10006 (t12): New test.
10007 (t_last): Add check for v12.
10008 * testsuite/tls_test.h (t12): New function.
10009 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10010
2d924fd9
ILT
100112008-08-13 Ian Lance Taylor <iant@google.com>
10012
10013 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10014 set tls_segment_ or relro_segment_.
10015 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10016 when appropriate.
10017 * output.h (Output_section::clear_is_relro): New function.
10018 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10019 sections specially even when output_data_ is empty.
10020 (Output_segment::maximum_alignment): When first section is relro,
10021 only force alignment for PT_LOAD segments.
10022 * script.cc (script_data_segment_align): New function.
10023 (script_data_segment_relro_end): New function.
10024 * script-c.h (script_data_segment_align): Declare.
10025 (script_data_segment_relro_end): Declare.
10026 * script-sections.h (class Script_sections): Declare
10027 data_segment_align and data_segment_relro_end. Add fields
10028 segment_align_index_ and saw_relro_end_.
10029 * script-sections.cc (class Sections_element): Add set_is_relro
10030 virtual function. Add new bool* parameter to place_orphan_here.
10031 Add get_output_section virtual function.
10032 (class Output_section_definition): Add set_is_relro. Add new
10033 bool* parameter to place_orphan_here. Add get_output_section.
10034 Add is_relro_ field.
10035 (Output_section_definition::Output_section_definition): Initialize
10036 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10037 and is_relro_ fields.
10038 (Output_section_definition::place_orphan_here): Add is_relro
10039 parameter.
10040 (Output_section_definition::set_section_addresses): Set relro for
10041 output section.
10042 (Output_section_definition::alternate_constraint): Likewise.
10043 (class Orphan_output_section): Add new bool* parameter to
10044 place_orphan_here. Add get_output_section.
10045 (Orphan_output_section::place_orphan_here): Add is_relro
10046 parameter.
10047 (Script_sections::Script_sections): Initialize
10048 data_segment_align_index_ and saw_relro_end_.
10049 (Script_sections::data_segment_align): New function.
10050 (Script_sections::data_segment_relro_end): New function.
10051 (Script_sections::place_orphan): Set or clear is_relro.
10052 (Script_sections::set_section_addresses): Force alignment of first
10053 TLS section.
10054 * yyscript.y (exp): Call script_data_segment_align and
10055 script_data_segment_relro_end.
10056 * testsuite/relro_script_test.t: New file.
10057 * testsuite/relro_test.cc (using_script): Declare.
10058 (t1, t2): Test using_script.
10059 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10060 (relro_script_test_SOURCES): Define.
10061 (relro_script_test_DEPENDENCIES): Define.
10062 (relro_script_test_LDFLAGS): Define.
10063 (relro_script_test_LDADD): Define.
10064 (relro_script_test.so): New target.
10065 * testsuite/Makefile.in: Rebuild.
10066
f827c9a9
CC
100672008-08-06 Cary Coutant <ccoutant@google.com>
10068
10069 * archive.cc (Archive::total_archives, Archive::total_members)
10070 (Archive::total_members_loaded): New variables.
10071 (Archive::setup): Add parameter. Add option to preread
10072 archive symbols.
10073 (Archive::read_armap): Add counter.
10074 (Archive::get_file_and_offset): New function.
10075 (Archive::get_elf_object_for_member): New function.
10076 (Archive::read_all_symbols): New function.
10077 (Archive::read_symbols): New function.
10078 (Archive::add_symbols): Add counters.
10079 (Archive::include_all_members): Use armap to find members if it's
10080 already built.
10081 (Archive::include_member): Skip reading symbols if already read.
10082 Factored code into Archive::get_file_and_offset and
10083 Archive::get_elf_object_for_member. Changed call to
10084 Mapfile::report_include_archive_member.
10085 (Archive::print_stats): New function.
10086 * archive.h: Declare Object and Read_symbols_data classes.
10087 (Archive::Archive): Add initializers for new members.
10088 (Archive::setup): Add parameter.
10089 (Archive::print_stats): New function.
10090 (Archive::total_archives, Archive::total_members)
10091 (Archive::total_members_loaded): New variables.
10092 (Archive::get_file_and_offset): New function.
10093 (Archive::get_elf_object_for_member): New function.
10094 (Archive::read_all_symbols): New function.
10095 (Archive::read_symbols): New function.
10096 (Archive::Archive_member): New class.
10097 (Archive::members_): New member.
10098 (Archive::num_members_): New member.
10099 * main.cc: Include archive.h.
10100 (main): Call Archive::print_stats.
10101 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10102 archive parameter; member_name is now the fully-decorated name.
10103 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10104 * options.h: (General_options): Add --preread-archive-symbols option.
10105 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10106 Archive::setup.
10107
de4c45bd
ILT
101082008-08-04 Ian Lance Taylor <iant@google.com>
10109
10110 * symtab.h (Symbol::use_plt_offset): New function.
10111 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10112 * powerpc.cc (Relocate::relocate): Likewise.
10113 * sparc.cc (Relocate::relocate): Likewise.
10114 * x86_64.cc (Relocate::relocate): Likewise.
10115 * testsuite/weak_plt.sh: New test.
10116 * testsuite/weak_plt_main.cc: New test.
10117 * testsuite/weak_plt_shared.cc: New test.
10118 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10119 (check_PROGRAMS): Add weak_plt.
10120 (check_DATA): Add weak_plt_shared.so.
10121 (weak_plt_main_pic.o, weak_plt): New targets.
10122 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10123 * testsuite/Makefile.in: Rebuild.
10124
10125 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10126 gcctestdir/ld.
10127 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10128 * testsuite/Makefile.in: Rebuild.
10129
323ee3f4
AM
101302008-08-04 Alan Modra <amodra@bigpond.net.au>
10131
10132 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10133 * Makefile.in: Regenerate.
10134 * po/POTFILES.in: Regenerate.
10135
7c07ecec
ILT
101362008-07-29 Ian Lance Taylor <iant@google.com>
10137
10138 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10139 symbols before other symbols.
10140 * testsuite/script_test_2.cc (test_addr): Declare.
10141 (test_addr_alias): Declare.
10142 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10143 values.
7c07ecec
ILT
10144 * testsuite/script_test_2.t: Define test_addr_alias and
10145 test_addr.
10146
5778530e
ILT
101472008-07-24 Ian Lance Taylor <iant@google.com>
10148
2a00e4fb
ILT
10149 PR 5990
10150 * descriptors.cc: New file.
10151 * descriptors.h: New file.
10152 * gold-threads.h (class Hold_optional_lock): New class.
10153 * fileread.cc: Include "descriptors.h".
10154 (File_read::~File_read): Release descriptor rather than closing
10155 it.
10156 (File_read::open) [file]: Call open_descriptor rather than open.
10157 Set is_descriptor_opened_.
10158 (File_read::open) [memory]: Assert that descriptor is not open.
10159 (File_read::reopen_descriptor): New function.
10160 (File_read::release): Release descriptor.
10161 (File_read::do_read): Make non-const. Reopen descriptor.
10162 (File_read::read): Make non-const.
10163 (File_read::make_view): Reopen descriptor.
10164 (File_read::do_readv): Likewise.
10165 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10166 Update declarations.
10167 * layout.cc: Include "descriptors.h".
10168 (Layout::create_build_id): Use open_descriptor rather than open.
10169 * output.cc: Include "descriptors.h".
10170 (Output_file::open): Use open_descriptor rather than open.
10171 * archive.cc (Archive::const_iterator): Change Archive to be
10172 non-const.
10173 (Archive::begin, Archive::end): Make non-const.
10174 (Archive::count_members): Likewise.
10175 * archive.h (class Archive): Update declarations.
10176 * object.h (Object::read): Make non-const.
10177 * Makefile.am (CCFILES): Add descriptors.cc.
10178 (HFILES): Add descriptors.h.
10179 * Makefile.in: Rebuild.
10180
801647d1
ILT
10181 PR 6716
10182 * gold.h: Always include <clocale>. Add Solaris workarounds
10183 following code in binutils/sysdep.h.
10184
5edd166e
ILT
10185 PR 6048
10186 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10187 this->eh_frame_hdr_ is NULL before using it.
10188
c89ad728
ILT
10189 * dynobj.cc (Versions::Versions): Update comment.
10190
aa86f06b
ILT
10191 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10192 the base version name.
10193
5778530e
ILT
10194 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10195 array size plus one.
10196 (Stringpool_template::set_string_offsets): Subtract one from key
10197 before using it as an array index.
10198 (Stringpool_template::get_offset_with_length): Likewise.
10199 (Stringpool_template::write_to_buffer): Likewise.
10200 * stringpool.h (Stringpool_template::get_offset_from_key):
10201 Likewise.
10202
057ead22
ILT
102032008-07-23 Ian Lance Taylor <iant@google.com>
10204
7f649c59
ILT
10205 PR 6658
10206 * object.h (Merged_symbol_value::value): Do our best to handle a
10207 negative addend.
10208
057ead22
ILT
10209 PR 6647
10210 * script.cc (Version_script_info::get_versions): Don't add empty
10211 version tag to return value.
10212 (Version_script_info::get_symbol_version_helper): Change return
10213 type to bool. Add pversion parameter. Change all callers.
10214 (script_register_vers_node): Don't require a non-NULL tag.
10215 * script.h (class Version_script_info): Update declarations.
10216 (Version_script_info::get_symbol_version): Change return type to
10217 bool. Add version parameter. Change all callers.
10218 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10219 handling. Handle an empty version from a version script.
10220 (Symbol_table::define_special_symbol): Likewise.
10221 * testsuite/ver_test_10.script: New file.
10222 * testsuite/ver_test_10.sh: New file.
10223 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10224 (check_DATA): Add ver_test_10.syms.
10225 (ver_test_10.syms, ver_test_10.so): New target.
10226 * testsuite/Makefile.in: Rebuild.
10227
58e54ac2
CD
102282008-07-23 Simon Baldwin <simonb@google.com>
10229
10230 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10231 to zero for undefined symbols from dynamic libraries.
10232
95d14cd3
ILT
102332008-07-23 Ian Lance Taylor <iant@google.com>
10234
10235 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10236 Change all callers.
10237 * symtab.h (class Symbol_table): Update declaration.
10238 * testsuite/ver_test_9.cc: New file.
10239 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10240 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10241 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10242 (ver_test_9.so, ver_test_9.o): New targets.
10243 * testsuite/Makefile.in: Rebuild.
10244
92de84a6
ILT
102452008-07-22 Ian Lance Taylor <iant@google.com>
10246
34810851
ILT
10247 * options.h (class General_options): Define --check-sections.
10248 * layout.cc (Layout::set_segment_offsets): Handle
10249 --check-sections.
10250
af6156ef
ILT
10251 * options.h (class General_options): Define -n/--nmagic and
10252 -N/--omagic.
10253 * options.cc (General_options::finalize): For -n/--nmagic or
10254 -N/--omagic, set -static.
10255 * layout.cc (Layout::attach_allocated_section_to_segment): If
10256 -N/--omagic, don't put read-only and read-write sections in
10257 different segments.
10258 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10259 finding a read-only segment.
10260 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10261 don't set the minimum segment alignment to the common page size,
10262 and don't set the file offset to the address modulo the page size.
10263 * script-sections.cc (Script_sections::create_segments): If
10264 -n/--omagic, don't put read-only and read-write sections in
10265 different segments.
10266
92de84a6
ILT
10267 * cref.cc: New file.
10268 * cref.h: New file.
10269 * options.h (class General_options): Add --print-symbol-counts.
10270 * main.cc (main): Issue defined symbol report if requested.
10271 * archive.cc (Archive::interpret_header): Make into a const member
10272 function.
10273 (Archive::add_symbols): Call Input_objects::archive_start and
10274 archive_stop.
10275 (Archive::const_iterator): Define new class.
10276 (Archive::begin, Archive::end): New functions.
10277 (Archive::include_all_members): Rewrite to use iterator.
10278 (Archive::count_members): New function.
10279 * archive.h (class Archive): Update declarations.
10280 (Archive::filename): New function.
10281 * object.cc: Include "cref.h".
10282 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10283 (Sized_relobj::do_get_global_symbol_counts): New function.
10284 (Input_objects::add_object): Add object to cross-referencer.
10285 (Input_objects::archive_start): New function.
10286 (Input_objects::archive_stop): New function.
10287 (Input_objects::print_symbol_counts): New function.
10288 * object.h: Declare Cref and Archive.
10289 (Object::get_global_symbol_counts): New function.
10290 (Object::do_get_global_symbol_counts): New pure virtual function.
10291 (class Sized_relobj): Add defined_count_ field. Update
10292 declarations.
10293 (class Input_objects): Add cref_ field. Update constructor.
10294 Update declarations.
10295 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10296 defined_count_.
10297 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10298 symbol counts.
10299 (Sized_dynobj::do_get_global_symbol_counts): New function.
10300 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10301 defined_count_. Update declarations. Define Symbols typedef.
10302 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10303 parameter. Change all callers.
10304 (Symbol_table::add_from_dynobj): Add sympointers and defined
10305 parameters. Change all callers.
10306 * symtab.h (class Symbol_table): Update declarations.
10307 * Makefile.am (CCFILES): Add cref.cc.
10308 (HFILES): Add cref.h.
10309 * Makefile.in: Rebuild.
10310
3f7c5e1d
CD
103112008-07-22 Simon Baldwin <simonb@google.com>
10312
10313 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10314 to zero when writing undefined symbols.
10315
e0b64032
ILT
103162008-07-22 Ian Lance Taylor <iant@google.com>
10317
10318 * output.cc (Output_section::add_input_section): Don't try to
10319 merge empty merge sections.
10320
096b02cf
CS
103212008-07-21 Craig Silverstein <csilvers@google.com>
10322
10323 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10324 Include symbol version in error message.
cd536b21 10325
1d1f116d
CD
103262008-07-20 Chris Demetriou <cgd@google.com>
10327
cd536b21 10328 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10329 (RANDOM_SEED_CFLAGS): New substituted variable.
10330 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10331 * configure: Rebuild.
10332 * Makefile.in: Likewise.
10333 * testsuite/Makefile.in: Likewise.
10334
a18f591e
ILT
103352008-07-18 Ian Lance Taylor <iant@google.com>
10336
10337 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10338 where we see NAME/NULL and NAME/VERSION as separate symbols.
10339 * testsuite/ver_test_main.cc (main): Call t4.
10340 (t4, t4_2a): Define.
10341 * testsuite/ver_test_2.cc (t4_2): Define.
10342 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10343 * testsuite/ver_test_4.cc (t4_2a): Define.
10344 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10345 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10346
c6e3f6ed
ILT
103472008-07-17 Ian Lance Taylor <iant@google.com>
10348
10349 * dynobj.cc (Versions::add_def): If we give an error about a
10350 missing version, go ahead and create the version anyhow.
10351
ef9beddf
ILT
103522008-07-10 Ian Lance Taylor <iant@google.com>
10353
10354 Handle output sections with more than 0x7fffffff bytes.
10355 * object.h (class Relobj): Change map_to_output_ to
10356 output_sections_, and just keep a section pointer. Change all
10357 uses. Move comdat group support to Sized_relobj.
10358 (Relobj::is_section_specially_mapped): Remove.
10359 (Relobj::output_section): Remove poff parameter. Change all
10360 callers.
10361 (Relobj::output_section_offset): New function.
10362 (Relobj::set_section_offset): Rewrite.
10363 (Relobj::map_to_output): Remove.
10364 (Relobj::output_sections): New function.
10365 (Relobj::do_output_section_offset): New pure virtual function.
10366 (Relobj::do_set_section_offset): Likewise.
10367 (class Sized_relobj): Add section_offsets_ field. Add comdat
10368 group support from Relobj. Update declarations.
10369 (Sized_relobj::get_output_section_offset): New function.
10370 (Sized_relobj::do_output_section_offset): New function.
10371 (Sized_relobj::do_set_section_offset): New function.
10372 * object.cc (Relobj::output_section_address): Remove.
10373 (Sized_relobj::Sized_relobj): Initialize new fields.
10374 (Sized_relobj::include_section_group): Cast find_kept_object to
10375 Sized_relobj.
10376 (Sized_relobj::include_linkonce_section): Likewise.
10377 (Sized_relobj::do_layout): Use separate arrays for output section
10378 and output offset.
10379 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10380 output_sections.
10381 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10382 output_sections and section_offsets.
10383 (Sized_relobj::write_local_symbols): Likewise.
10384 (map_to_kept_section): Compute output address directly.
10385 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10386 output_sections and section_offsets.
10387 (Sized_relobj::write_sections): Likewise.
10388 (Sized_relobj::relocate_sections): Likewise.
10389 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10390 * output.h (class Output_reloc): Update declarations. Change
10391 u2_.relobj to Sized_relobj*.
10392 (class Output_data_reloc): Change add functions to use
10393 Sized_relobj*.
10394 * output.cc (Output_reloc::Output_reloc): Change relobj to
10395 Sized_relobj*.
10396 (Output_reloc::local_section_offset): Change return type to
10397 Elf_Addr. Use get_output_section_offset.
10398 (Output_reloc::get_address): Likewise.
10399 (Output_section::is_input_address_mapped): Don't call
10400 is_section_specially_mapped.
10401 (Output_section::output_offset): Likewise.
10402 (Output_section::output_address): Likewise.
10403 (Output_section::starting_output_address): Likewise.
10404 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10405 parameter to Sized_relobj*.
10406 (Copy_relocs::need_copy_reloc): Likewise.
10407 (Copy_relocs::save): Likewise.
10408 * copy-relocs.h (class Copy_relocs): Update declarations.
10409 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10410 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10411 * target-reloc.h (relocate_for_relocatable): Change
10412 offset_in_output_section type to Elf_Addr. Change code that uses
10413 it as well.
10414 * layout.cc (Layout::layout): Always set *off.
10415 * mapfile.cc (Mapfile::print_input_section): Use
10416 output_section_offset.
10417 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10418 Sized_relobj*.
10419 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10420 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10421 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10422
5cb66f97
ILT
104232008-07-03 Ian Lance Taylor <iant@google.com>
10424
10425 * layout.cc (Layout::include_section): Do not discard unrecognized
10426 SHT_STRTAB sections.
10427
afe47622
CS
104282008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10429
10430 * script.cc (Lex::can_continue_name): Make '?' allowable in
10431 version-script names.
10432 * testsuite/version_script.map: Change glob pattern to use '?'
10433
5adf9721
ILT
104342008-06-30 Manish Singh <yosh@gimp.org>
10435
10436 PR 6585
10437 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10438 Correct typo.
10439
e6fde208
ILT
104402008-06-30 Ian Lance Taylor <iant@google.com>
10441
10442 PR 6660
10443 PR 6682
10444 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10445 versions]: Don't try to read the value in the contents, since we
10446 don't use it. Use the template endianness when writing.
10447
3f2e6a2d
CC
104482008-06-25 Cary Coutant <ccoutant@google.com>
10449
10450 * fileread.cc (File_read::make_view): Assert on zero-length view.
10451 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10452 symbol table when there are no symbols to read.
10453
c43d3a48
CS
104542008-06-23 Craig Silverstein <csilvers@google.com>
10455
10456 * version.cc (version_string): Bump to 1.7
10457
5f494ea0
CS
104582008-06-18 Craig Silverstein <csilvers@google.com>
10459
10460 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10461 constant 0xFFFF to type Valtype.
10462 (Powerpc_relocate_functions::rel16_ha): Likewise.
10463
c42e122e
ILT
104642008-06-17 Ian Lance Taylor <iant@google.com>
10465
f34787f8
ILT
10466 * output.h (Output_section::Input_section): Initialize p2align_ to
10467 zero for Output_section_data constructors.
10468 (Output_section::Input_section::addralign): If not an input
10469 section, return the alignment of the Output_section_data.
10470 * testsuite/copy_test.cc: New file.
10471 * testsuite/copy_test_1.cc: New file.
10472 * testsuite/copy_test_2.cc: New file.
10473 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10474 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10475 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10476 (copy_test_1_pic.o, copy_test_1.so): New targets.
10477 (copy_test_2_pic.o, copy_test_2.so): New targets.
10478 * testsuite/Makefile.in: Rebuild.
10479
c42e122e
ILT
10480 * script-sections.cc (Script_sections::place_orphan): Initialize
10481 local variable exact.
10482
ce3ac18a
DE
104832008-06-13 David Edelsohn <edelsohn@gnu.org>
10484
10485 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10486
42cacb20
DE
104872008-06-12 David Edelsohn <edelsohn@gnu.org>
10488 David S. Miller <davem@davemloft.net>
10489
10490 * powerpc.cc: New file.
10491 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10492 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10493 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10494 * Makefile.in: Rebuild.
10495
7b308235
ILT
104962008-06-09 Ian Lance Taylor <iant@google.com>
10497
10498 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10499 <exception>.
10500 (throwing, orig_terminate): New static variables.
10501 (terminate_handler): New static function.
10502 (t2): Set terminate handler.
10503
f0b886e3
ILT
105042008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10505
10506 PR 6584
cd536b21 10507 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
10508 alignment.
10509
3e90f135
CC
105102008-05-30 Cary Coutant <ccoutant@google.com>
10511
10512 * archive.cc (Archive::include_all_members) Correct to step
10513 over symbol table and extended name table in thin archives.
10514
e09ad04a
ILT
105152008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10516
10517 PR 6407
10518 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10519 calculation.
10520
62b01cb5
ILT
105212008-05-28 Caleb Howe <cshowe@google.com>
10522
10523 * reduced_debug_output.cc: New file.
10524 * reduced_debug_output.h: New file.
92de84a6 10525 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
10526 * options.cc (General_options::finalize): Add strip_debug_non_line
10527 to the strip heirarchy.
10528 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10529 fields.
10530 * layout.cc: Include "reduced_debug_output.h".
10531 (Layout::Layout): Initialize new fields.
10532 (line_only_debug_sections): New static array.
10533 (is_lines_only_debug_sections): New static inline function.
10534 (Layout::include_section): Handle --strip-debug-non-line.
10535 (Layout::make_output_section): If --strip-debug-non-line, build
10536 new output sections for .debug_abbrev and .debug_info.
10537 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10538 gold. Warn about possible overflow.
10539 (read_signed_LEB_128): Likewise.
10540 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10541 (read_signed_LEB_128): Declare.
10542 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10543 (HFILES): Add reduced_debug_output.h.
10544 * Makefile.in: Rebuild.
10545
7d9e3d98
ILT
105462008-05-21 Ian Lance Taylor <iant@google.com>
10547
10548 * mapfile.cc: New file.
10549 * mapfile.h: New file.
10550 * options.h (class General_options): Add -M/--print-map and -Map.
10551 * options.cc (General_options::finalize): Make -M equivalent to
10552 -Map -.
10553 * main.cc: Include <cstdio> and "mapfile.h".
10554 (main): Open mapfile if requested.
10555 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10556 constructor. Change caller.
10557 (queue_initial_tasks): Add mapfile parameter. Change caller.
10558 (queue_middle_tasks): Likewise.
10559 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10560 declarations.
10561 * archive.cc: Include "mapfile.h".
10562 (Archive::add_symbols): Add mapfile parameter. Change all
10563 callers. Pass mapfile, symbol, and reason to include_member.
10564 (Archive::include_all_members): Add mapfile parameter. Change all
10565 callers.
10566 (Archive::include_member): Add mapfile, sym, and why parameters.
10567 Change all callers. Report inclusion to map file.
10568 * archive.h: Include "fileread.h".
10569 (class Archive): Update declarations.
10570 (Archive::file): New const method.
10571 (class Add_archive_symbols): Add mapfile_ field. Update
10572 constructor. Change all callers.
10573 * readsyms.h (class Read_symbols): Likewise.
10574 (class Finish_group): Likewise.
10575 (class Read_script): Likewise.
10576 * common.cc: Include "mapfile.h".
10577 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10578 all callers.
10579 (Symbol_table::do_allocate_commons): Likewise.
10580 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10581 symbol allocation to mapfile.
10582 * common.h (class Allocate_commons_task): Add mapfile_ field.
10583 Update constructor. Change all callers.
10584 * symtab.h (class Symbol_table): Update declarations.
10585 * layout.cc: Include "mapfile.h".
10586 (Layout_task_runner::run): Print information to mapfile.
10587 (Layout::create_gold_note): Change Output_data_fixed_space to
10588 Output_data_zero_fill.
10589 (Layout::create_build_id): Likewise.
10590 (Layout::print_to_mapfile): New function.
10591 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10592 constructor. Change caller.
10593 (class Layout): Declare print_to_mapfile.
10594 * output.cc (Output_section::Input_section::print_to_mapfile): New
10595 function.
10596 (Output_section::add_input_section): If producing a map, always
10597 add to input_sections_ list.
10598 (Output_section::do_print_to_mapfile): New function.
10599 (Output_segment::print_sections_to_mapfile): New function.
10600 (Output_segment::print_section_list_to_mapfile): New function.
10601 * output.h: Include "mapfile.h".
10602 (Output_data::print_to_mapfile): New function.
10603 (Output_data::do_print_to_mapfile): New virtual function.
10604 (Output_segment_headers::do_print_to_mapfile): New function.
10605 (Output_file_header::do_print_to_mapfile): New function.
10606 (Output_data_const::do_print_to_mapfile): New function.
10607 (class Output_data_const_buffer): Add map_name_ field. Update
10608 constructor. Change all callers. Add do_print_to_mapfile
10609 function.
10610 (class Output_data_fixed_space): Likewise.
10611 (class Output_data_space): Likewise.
10612 (class Output_data_zero_fill): New class.
10613 (Output_data_strtab::do_print_to_mapfile): New function.
10614 (Output_data_reloc_base::do_print_to_mapfile): New function.
10615 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10616 (Output_data_group::do_print_to_mapfile): New function.
10617 (Output_data_got::do_print_to_mapfile): New function.
10618 (Output_data_dynamic::do_print_to_mapfile): New function.
10619 (Output_symtab_xindex::do_print_to_mapfile): New function.
10620 (class Output_section): Declare do_print_to_mapflie. Declare
10621 print_to_mapfile in Input_section.
10622 (class Output_segment): Declare new functions.
10623 * object.h (Sized_relobj::symbol_count): New function.
10624 * script-sections.cc
10625 (Output_section_element_dot_assignment::set_section_addresses):
10626 Change Output_data_fixed_space to Output_data_zero_fill.
10627 (Output_data_expression::do_print_to_mapfile): New function.
10628 * script.cc (read_input_script): Add mapfile parameter. Change
10629 all callers.
10630 * script.h (read_input_script): Update declaration.
10631 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10632 (Eh_frame::do_print_to_mapfile): New function.
10633 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10634 (Output_merge_string::do_print_to_mapfile): New function.
10635 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10636 function.
10637 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10638 function.
10639 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10640 function.
10641 * Makefile.am (CCFILES): Add mapfile.cc.
10642 (HFILES): Add mapfile.h.
10643 * Makefile.in: Rebuild.
10644
9f1d377b
ILT
106452008-05-19 Ian Lance Taylor <iant@google.com>
10646
10647 * options.h (class General_options): Add -z relro.
10648 * layout.cc (Layout::Layout): Initialize relro_segment_.
10649 (Layout::add_output_section_data): Return the output section.
10650 (Layout::make_output_section): Rcognize relro sections and mark
10651 them appropriately.
10652 (Layout::attach_allocated_section_to_segment): Put relro sections
10653 in a PT_GNU_RELRO segment.
10654 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10655 section as relro.
10656 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10657 PT_TLS segments.
10658 (Layout::linkonce_mapping): Map d.rel.ro.local to
10659 .data.rel.ro.local.
10660 (Layout::output_section_name): Us .data.rel.ro.local for any
10661 section which begins with that.
10662 * layout.h (class Layout): Update add_output_section_data
10663 declaration. Add relro_segment_ field.
10664 * output.cc (Output_section::Output_section): Initialize is_relro_
10665 and is_relro_local_ fields.
10666 (Output_segment::add_output_section): Group relro sections.
10667 (Output_segment::is_first_section_relro): New function.
10668 (Output_segment::maximum_alignment): If there is a relro section,
10669 align the segment to the common page size.
10670 (Output_segment::set_section_addresses): Track whether we are
10671 looking at relro sections. If the last section is a relro
10672 section, align to the common page size.
10673 (Output_segment::set_section_list_addresses): Add in_relro
10674 parameter. Change all callers. Align to the page size when
10675 moving from relro to non-relro section.
10676 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10677 segment.
10678 * output.h (class Output_section): Add is_relro_ and
10679 is_relro_local_ fields.
10680 (Output_section::is_relro): New function.
10681 (Output_section::set_is_relro): New function.
10682 (Output_section::is_relro_local): New function.
10683 (Output_section::set_is_relro_local): New function.
10684 (class Output_segment): Update declarations.
10685 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10686 * sparc.cc (Target_sparc::got_section): Likewise.
10687 * x86_64.cc (Target_x86_64::got_section): Likewise.
10688 * testsuite/relro_test_main.cc: New file.
10689 * testsuite/relro_test.cc: New file.
10690 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10691 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10692 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10693 (relro_test.so, relro_test_pic.o): New targets.
10694 * testsuite/Makefile.in: Rebuild.
10695
a984ee1d
ILT
106962008-05-16 Ian Lance Taylor <iant@google.com>
10697
01676dcd
ILT
10698 * output.cc (Output_segment::add_output_section): Remove front
10699 parameter.
10700 * output.h (class Output_segment): Remove
10701 add_initial_output_section and overloaded add_output_section.
10702 Update declaration of remaining add_output_section.
10703 * layout.cc (Layout::create_interp): Call add_output_section
10704 rather than add_initial_output_section.
10705 (Layout::finish_dynamic_section): Likewise.
10706
497897f9
ILT
10707 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10708 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10709 know the dynamic type.
10710 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10711 field. Initialize it in constructor.
10712 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10713 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10714 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10715 reloc.
10716
a984ee1d
ILT
10717 * output.cc (Output_reloc::get_address): Change return type to
10718 Elf_Addr.
10719 * output.h (class Output_reloc): Update get_address declaration.
10720 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10721 for section addresses.
10722
55ba0940
ILT
107232008-05-09 Ian Lance Taylor <iant@google.com>
10724
10725 PR 6493
10726 * gold.cc (gold_nomem): Use return value of write.
10727
75517b77
ILT
107282008-05-08 Ian Lance Taylor <iant@google.com>
10729
10730 * symtab.c (Symbol::init_base_output_data): Add version
10731 parameter. Change all callers.
10732 (Symbol::init_base_output_segment): Likewise.
10733 (Symbol::init_base_constant): Likewise.
10734 (Symbol::init_base_undefined): Likewise.
10735 (Sized_symbol::init_output_data): Likewise.
10736 (Sized_symbol::init_output_segment): Likewise.
10737 (Sized_symbol::init_constant): Likewise.
10738 (Sized_symbol::init_undefined): Likewise.
10739 (Symbol_table::do_define_in_output_data): If the new symbol has a
10740 version, mark it as the default.
10741 (Symbol_table::do_define_in_output_segment): Likewise.
10742 (Symbol_table::do_define_as_constant): Likewise.
10743 * symtab.h (class Symbol): Update declarations.
10744 (class Sized_symbol): Likewise.
10745 * resolve.cc (Symbol::override_version): New function.
c42e122e 10746 (Symbol::override_base): Call override_version.
75517b77
ILT
10747 (Symbol::override_base_with_special): Likewise.
10748 * testsuite/ver_script_8.script: New file.
10749 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10750 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10751 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10752 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10753
f1f70eae
ILT
107542008-05-06 Ian Lance Taylor <iant@google.com>
10755
f3e9c5c5
ILT
10756 PR 6049
10757 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10758 functions.
10759 (class General_options): Remove existing --undefined, and add
10760 --no-undefined instead. Add new --undefined as synonym for -u.
10761 * archive.cc (Archive::add_symbols): Check whether symbol was
10762 named with -u.
10763 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10764 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10765 all uses. Add IS_UNDEFINED. Update declarations to split
10766 different versions of init_base. Declare init_base_undefined.
10767 (Symbol::is_defined): Handle IS_UNDEFINED.
10768 (Symbol::is_undefined): Likewise.
10769 (Symbol::is_weak_undefined): Call is_undefined.
10770 (Symbol::is_absolute): Handle IS_CONSTANT.
10771 (class Sized_symbol): Update declarations to split different
10772 versions of init. Declare init_undefined.
10773 (class Symbol_table): Declare new functions.
10774 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10775 Change all callers.
10776 (Symbol::init_base_output_data): Likewise.
10777 (Symbol::init_base_output_segment): Likewise.
10778 (Symbol::init_base_constant): Likewise.
10779 (Symbol::init_base_undefined): New function.
10780 (Sized_symbol::init_object): Rename from init. Change all
10781 callers.
10782 (Sized_symbol::init_output_data): Likewise.
10783 (Sized_symbol::init_output_segment): Likewise.
10784 (Sized_symbol::init_constant): Likewise.
10785 (Sized_symbol::init_undefined): New function.
10786 (Symbol_table::add_undefined_symbols_from_command_line): New
10787 function.
10788 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10789 function.
10790 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10791 (Symbol::output_section): Likewise.
10792 (Symbol::set_output_section): Likewise.
10793 (Symbol_table::sized_finalize_symbol): Likewise.
10794 (Symbol_table::sized_write_globals): Likewise.
10795 * resolve.cc (Symbol_table::should_override): Likewise.
10796 (Symbol::override_base_with_special): Likewise.
10797
8bdcdf2c
ILT
10798 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10799 symbol, change it to have default visibility.
10800 * testsuite/protected_1.cc: New file.
10801 * testsuite/protected_2.cc: New file.
10802 * testsuite/protected_3.cc: New file.
10803 * testsuite/protected_main_1.cc: New file.
10804 * testsuite/protected_main_2.cc: New file.
10805 * testsuite/protected_main_3.cc: New file.
10806 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10807 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10808 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10809 (protected_1.so): New target.
10810 (protected_1_pic.o, protected_2_pic.o): New targets.
10811 (protected_3_pic.o): New target.
10812 (check_PROGRAMS): Add protected_2.
10813 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10814 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10815 * testsuite/Makefile.in: Rebuild.
10816
2b706932
ILT
10817 * options.h (DEFINE_var): Add set_user_set_##varname__.
10818 (DEFINE_bool_alias): New macro.
10819 (class General_options): Define -Bstatic using DEFINE_bool_alias
10820 rather than DEFINE_special. Add --undefined as an alias for -z
10821 defs.
10822 * options.cc (General_options::parse_Bstatic): Remove.
10823
d82a5bcc
ILT
10824 * options.h (class General_options): Add --fatal-warnings.
10825 * main.cc (main): Implement --fatal-warnings.
10826 * errors.h (Errors::warning_count): New function.
10827
f1f70eae
ILT
10828 * options.h (class General_options): Add -Bsymbolic-functions.
10829 * symtab.h (Symbol::is_preemptible): Check for
10830 -Bsymbolic-functions.
10831
8825ac63
ILT
108322008-05-05 Ian Lance Taylor <iant@google.com>
10833
d98bc257
ILT
10834 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10835 as noVARNAME rather than no-VARNAME.
10836 (class General_options): Add option -z combreloc.
10837 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10838 get_address.
10839 (Output_reloc::sort_before) [SHT_REL]: New function.
10840 (Output_reloc::sort_before) [SHT_RELA]: New function.
10841 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10842 Sort_relocs_comparison.
10843 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10844 parameter. Change all callers.
10845 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10846 sort_relocs parameter. Change all callers.
10847 * output.cc (Output_reloc::get_address): New function, broken out
10848 of write_rel.
10849 (Output_reloc::write_rel): Call it.
10850 (Output_reloc::compare): New function.
10851 (Output_data_reloc_base::do_write): Optionally sort relocs.
10852
60b2b4e7
ILT
10853 * configure.ac: If targ_extra_obj is set, link it in.
10854 * configure.tgt: Initialize all variables.
10855 (x86_64*): Set targ_extra_obj and targ_extra_size.
10856 * configure: Rebuild.
10857
8825ac63
ILT
10858 * object.cc (Sized_relobj::include_section_group): Adjust section
10859 indexes read from group data. Build vector to pass to
10860 layout_group.
10861 * layout.cc (Layout::layout_group): Add flags and shndxes
10862 parameters. Remove contents parameter. Change caller. Update
10863 explicit instantiations.
10864 * layout.h (class Layout): Update layout_group declaration.
10865 * output.cc (Output_data_group::Output_data_group): Add flags and
10866 input_shndxes parameters. Remove contents parameter. Change
10867 caller.
10868 (Output_data_group::do_write): Change input_sections_ to
10869 input_shndxes_.
10870 * output.h (class Output_data_group): Update constructor
10871 declaration. Rename input_sections_ to input_shndxes_.
10872 * testsuite/many_sections_test.cc: Add template.
10873
e94cf127
CC
108742008-04-30 Cary Coutant <ccoutant@google.com>
10875
4418b2d5
CC
10876 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10877
e94cf127
CC
10878 * layout.cc (Layout::include_section): Refactored check for debug
10879 info section.
10880 (Layout::add_comdat): Add new parameters. Change type
10881 of signature parameter. Add object and shndx to signatures table.
10882 (Layout::find_kept_object): New function.
10883 * layout.h: Include <cstring>.
10884 (Layout::is_debug_info_section): New function.
10885 (Layout::add_comdat): Add new parameters.
10886 (Layout::find_kept_object): New function.
10887 (Layout::Kept_section): New struct.
10888 (Layout::Signatures): Change type of map range.
10889 * object.cc (Relobj::output_section_address): New function.
10890 (Sized_relobj::include_section_group): Add new parameters. Change
10891 calls to Layout::add_comdat. Change to build table of kept comdat
10892 groups and table mapping discarded sections to kept sections.
10893 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10894 (Sized_relobj::do_layout): Change calls to include_section_group and
10895 include_linkonce_section.
10896 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10897 value to zero when section is discarded.
10898 (Sized_relobj::map_to_kept_section): New function.
10899 * object.h (Relobj::output_section_address): New function.
10900 (Relobj::Comdat_group): New type.
10901 (Relobj::find_comdat_group): New function.
10902 (Relobj::Comdat_group_table): New type.
10903 (Relobj::Kept_comdat_section): New type.
10904 (Relobj::Kept_comdat_section_table): New type.
10905 (Relobj::add_comdat_group): New function.
10906 (Relobj::set_kept_comdat_section): New function.
10907 (Relobj::get_kept_comdat_section): New function.
10908 (Relobj::comdat_groups_): New field.
10909 (Relobj::kept_comdat_sections_): New field.
10910 (Symbol_value::input_value): Update comment.
10911 (Sized_relobj::map_to_kept_section) New function.
10912 (Sized_relobj::include_linkonce_section): Add new parameter.
10913 * target-reloc.h (Comdat_behavior): New type.
10914 (get_comdat_behavior): New function.
10915 (relocate_section): Add code to map a discarded section to the
10916 corresponding kept section when applying a relocation.
10917
e4e5049b
CS
109182008-04-30 Craig Silverstein <csilvers@google.com>
10919
10920 * dwarf_reader.cc (next_generation_count): New static var.
10921 (Addr2line_cache_entry): New struct.
10922 (addr2line_cache): New static var.
10923 (Dwarf_line_info::one_addr2line): Added caching.
10924 (Dwarf_line_info::clear_addr2line_cache): New function.
10925 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10926 cache-size parameter.
10927 (Dwarf_line_info::one_addr2line_cache): New function.
10928 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10929 new cache-size argument to one_addr2line(), and clear cache.
10930
d09e9154
CC
109312008-04-28 Cary Coutant <ccoutant@google.com>
10932
10933 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10934 R_386_PC8 relocations.
10935
7ef73768
ILT
109362008-04-23 Ian Lance Taylor <iant@google.com>
10937
55438702
ILT
10938 * object.cc (Sized_relobj::include_section_group): Check for
10939 invalid section group.
10940
c165fb93
ILT
10941 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10942 header size.
10943
7ef73768
ILT
10944 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10945 than read for file header.
10946 * archive.cc (Archive::include_member): Likewise.
10947
6194aaab
L
109482008-04-23 Paolo Bonzini <bonzini@gnu.org>
10949
10950 * aclocal.m4: Regenerate.
10951 * configure: Regenerate.
10952
d491d34e
ILT
109532008-04-19 Ian Lance Taylor <iant@google.com>
10954
5ea2bac6
ILT
10955 * version.cc (version_string): Bump to 1.6.
10956
7bc3e21a
ILT
10957 * testsuite/Makefile.am (many_sections_r_test): New target.
10958 (many_sections_r_test_SOURCES): Remove.
10959 (many_sections_r_test_DEPENDENCIES): Remove.
10960 (many_sections_r_test_LDFLAGS): Remove.
10961 (many_sections_r_test_LDADD): Remove.
10962
7fcd3aa9
ILT
10963 * object.cc (Sized_relobj::do_add_symbols): Always pass
10964 local_symbol_count_ to add_from_relobj.
10965
4c94d6ae
ILT
10966 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10967 every thousand variables.
10968 * testsuite/Makefile.in: Rebuild.
10969
d491d34e
ILT
10970 * object.cc (Xindex::initialize_symtab_xindex): New function.
10971 (Xindex::read_symtab_xindex): New function.
10972 (Xindex::sym_xindex_to_shndx): New function.
10973 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10974 available.
10975 (Sized_relobj::do_initialize_xindex): New function.
10976 (Sized_relobj::do_read_symbols): Adjust section links.
10977 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10978 parameter. Change all callers.
10979 (Sized_relobj::include_section_group): Adjust section links and
10980 symbol section indexes.
10981 (Sized_relobj::do_layout): Adjust section links.
10982 (Sized_relobj::do_count_local_symbols): Adjust section links and
10983 symbol section indexes.
10984 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10985 ordinary and special symbols.
10986 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10987 dynsym_xindex parameters. Change all callers. Adjust section
10988 links. Use SHN_XINDEX when needed.
10989 (Sized_relobj::get_symbol_location_info): Adjust section links.
10990 Don't get fooled by special symbols.
10991 * object.h (class Xindex): Define.
10992 (class Object): Add xindex_ parameter. Declare virtual functoin
10993 do_initialize_xindex.
10994 (Object::adjust_sym_shndx): New function.
10995 (Object::set_xindex): New protected function.
10996 (class Symbol_value): Add is_ordinary_shndx_ field.
10997 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10998 (Symbol_value::value): Assert ordinary section.
10999 (Symbol_value::initialize_input_to_output_map): Likewise.
11000 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11001 Change all callers.
11002 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11003 all callers.
11004 (class Sized_relobj): Update declarations.
11005 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11006 parameter. Change all callers.
11007 (Sized_relobj::adjust_shndx): New function.
11008 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11009 field.
11010 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11011 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11012 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11013 (Sized_dynobj::read_dynsym_section): Adjust section links.
11014 (Sized_dynobj::read_dynamic): Likewise.
11015 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11016 section links.
11017 (Sized_dynobj::do_initialize_xindex): New function.
11018 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11019 do_initialize_xindex.
11020 (Sized_dynobj::adjust_shndx): New function.
11021 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11022 dynsym_xindex_ fields.
11023 (Layout::finalize): Add a call to set_section_indexes before
11024 creating the symtab sections.
11025 (Layout::set_section_indexes): Don't do anything if the section
11026 already has a section index.
11027 (Layout::create_symtab_sections): Add shnum parameter. Change
11028 caller. Create .symtab_shndx section if needed.
11029 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11030 caller.
11031 (Layout::allocated_output_section_count): New function.
11032 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11033 needed.
11034 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11035 fields. Update declarations.
11036 (Layout::symtab_xindex): New function.
11037 (Layout::dynsym_xindex): New function.
11038 (class Write_symbols_task): Add layout_ field.
11039 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11040 Change caller.
11041 * output.cc (Output_section_headers::Output_section_headers): Add
11042 shstrtab_section parameter. Change all callers.
11043 (Output_section_headers::do_sized_write): Store overflow values
11044 for section count and section string table section index in
11045 section header zero.
11046 (Output_file_header::do_sized_write): Check for overflow of
11047 section count and section string table section index.
11048 (Output_symtab_xindex::do_write): New function.
11049 (Output_symtab_xindex::endian_do_write): New function.
11050 * output.h (class Output_section_headers): Add shstrtab_section_.
11051 Update declarations.
11052 (class Output_symtab_xindex): Define.
11053 (Output_section::has_out_shndx): New function.
11054 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11055 field.
11056 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11057 Change all callers.
11058 (Sized_symbol::init): Likewise.
11059 (Symbol::output_section): Check for ordinary symbol.
11060 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11061 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11062 callers.
11063 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11064 Change all callers. Simplify handling of symbols from sections
11065 not included in the link.
11066 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11067 distinction.
11068 (Weak_alias_sorter::operator()): Assert that symbols are
11069 ordinary.
11070 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11071 distinction.
11072 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11073 parameters. Change all callers.
11074 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11075 symbol distinction. Use SHN_XINDEX when needed.
11076 (Symbol_table::write_section_symbol): Add symtab_xindex
11077 parameter. Change all callers.
11078 (Symbol_table::sized_write_section_symbol): Likewise. Use
11079 SHN_XINDEX when needed.
11080 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11081 declarations.
11082 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11083 (Symbol::is_defined): Check is_ordinary.
11084 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11085 (Symbol::is_absolute, Symbol::is_common): Likewise.
11086 (class Sized_symbol): Update declarations.
11087 (class Symbol_table): Update declarations.
11088 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11089 parameters. Change all callers.
11090 (Sized_symbol::override): Likewise.
11091 (Symbol_table::override): Likewise.
11092 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11093 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11094 is_ordinary, and orig_st_shndx parameters. Change all callers.
11095 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11096 to be in an ordinary section.
11097 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11098 object and is_ordinary parameters. Change all callers.
11099 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11100 Change all callers. Don't add undefined or non-ordinary symbols
11101 to reloc_map_.
11102 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11103 Change all callers.
11104 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11105 declarations.
11106 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11107 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11108 (Sized_relobj::relocate_sections): Likewise.
11109 * target-reloc.h (scan_relocs): Adjust section symbol index.
11110 (scan_relocatable_relocs): Likewise.
11111 * i386.cc (Scan::local): Check for ordinary symbols.
11112 * sparc.cc (Scan::local): Likewise.
11113 * x86_64.cc (Scan::local): Likewise.
11114 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11115 to symbol_section_and_value.
11116 * testsuite/many_sections_test.cc: New file.
11117 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11118 (check_PROGRAMS): Add many_sections_test.
11119 (many_sections_test_SOURCES): Define.
11120 (many_sections_test_DEPENDENCIES): Define.
11121 (many_sections_test_LDFLAGS): Define.
11122 (BUILT_SOURCES): Add many_sections_define.h.
11123 (many_sections_define.h): New target.
11124 (BUILT_SOURCES): Add many_sections_check.h.
11125 (many_sections_check.h): New target.
11126 (check_PROGRAMS): Add many_sections_r_test.
11127 (many_sections_r_test_SOURCES): Define.
11128 (many_sections_r_test_DEPENDENCIES): Define.
11129 (many_sections_r_test_LDFLAGS): Define.
11130 (many_sections_r_test_LDADD): Define.
11131 (many_sections_r_test.o): New target.
11132 * testsuite/Makefile.in: Rebuild.
11133
c5818ff1
CC
111342008-04-17 Cary Coutant <ccoutant@google.com>
11135
11136 * errors.cc (Errors::info): New function.
11137 (gold_info): New function.
11138 * errors.h (Errors::info): New function.
11139 * gold.h (gold_info): New function.
11140 * object.cc (Input_objects::add_object): Print trace output.
11141 * options.cc (options::parse_set): New function.
11142 (General_options::parse_wrap): Deleted.
11143 (General_options::General_options): Deleted initializer.
11144 * options.h (options::String_set): New typedef.
11145 (options::parse_set): New function.
11146 (DEFINE_set): New macro.
11147 (General_options::wrap): Changed to use DEFINE_set. Changed
11148 callers of any_wrap_symbols and is_wrap_symbol.
11149 (General_options::trace, General_options::trace_symbol):
11150 New options.
11151 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11152 (General_options::wrap_symbols_): Deleted.
11153 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11154
b5be4a7c
DM
111552008-04-17 David S. Miller <davem@davemloft.net>
11156
11157 * options.cc (General_options::parse_V): New function.
11158 * options.h: Add entries for -V and -Qy.
11159
155a0dd7
ILT
111602008-04-17 Ian Lance Taylor <iant@google.com>
11161
11162 * common.cc (Symbol_table::allocate_commons): Remove options
11163 parameter. Change caller.
11164 (Symbol_table::do_allocate_commons): Remove options parameter.
11165 Change caller. Just call do_allocate_commons_list twice.
11166 (Symbol_table::do_allocate_commons_list): New function, broken out
11167 of do_allocate_commons.
11168 * common.h (class Allocate_commons_task): Remove options_ field.
11169 Update constructor.
11170 * symtab.cc (Symbol_table::Symbol_table): Initialize
11171 tls_commons_.
11172 (Symbol_table::add_from_object): Put TLS common symbols on
11173 tls_commons_ list.
11174 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11175 which are IN_OUTPUT_DATA.
11176 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11177 allocate_commons and do_allocate_commons declarations. Declare
11178 do_allocate_commons_list.
11179 * gold.cc (queue_middle_tasks): Update creation of
11180 Allocate_commons_task to not pass options.
11181 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11182 (TLS_TEST_C_FLAGS): New variable.
11183 (tls_test_c_pic.o): New target.
11184 (tls_test_shared.so): Link in tls_test_c_pic.o.
11185 (tls_test_c_pic_ie.o): New target.
11186 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11187 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11188 (tls_test_c.o): New target.
11189 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11190 (tls_pic_test_LDADD): Likewise.
11191 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11192 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11193 (tls_test_c_gnu2.o): New target.
11194 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11195 tls_test_c_gnu2.o.
11196 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11197 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11198 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11199 * testsuite/tls_test.cc: Include "config.h".
11200 (t_last): Call t11_last.
11201 * testsuite/tls_test.h (t11, t11_last): Declare.
11202 * testsuite/tls_test_c.c: New file.
11203 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11204 * configure.ac: Check for OpenMP support.
11205 * configure, config.in, Makefile.in: Rebuild.
11206 * testsuite/Makefile.in: Rebuild.
11207
edfbb029
CC
112082008-04-16 Cary Coutant <ccoutant@google.com>
11209
11210 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11211 (Target_i386::tls_base_symbol_defined_): New field.
11212 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11213 (Target_i386::Scan::global): Likewise.
11214 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11215 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11216 (Target_x86_64::tls_base_symbol_defined_): New field.
11217 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11218 (Target_x86_64::Scan::global): Likewise.
11219
f3c69fca
CC
112202008-04-16 Cary Coutant <ccoutant@google.com>
11221
11222 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11223 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11224 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11225 building shared libraries.
11226 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11227 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11228 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11229 * testsuite/Makefile.in: Rebuild.
11230 * testsuite/weak_undef.h: New file.
11231 * testsuite/weak_undef_file1.cc: Add extra test cases.
11232 * testsuite/weak_undef_file2.cc: Likewise.
11233 * testsuite/weak_undef_test.cc: Likewise.
11234
7c414435
DM
112352008-04-16 David S. Miller <davem@davemloft.net>
11236
32b769e1
DM
11237 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11238 Add issued_non_pic_error_ field. Declare check_non_pic.
11239 (Target_sparc::Scan::check_non_pic): New function.
11240 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11241 (Target_sparc::Scan::global): Likewise.
11242
11936fb1
DM
11243 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11244 * configure: Rebuild.
11245
7c414435
DM
11246 * options.h (DEFINE_enable): New macro.
11247 (new_dtags): New enable option.
11248 (initfirst, interpose, loadfltr, nodefaultlib,
11249 nodelete, nodlopen, nodump): New -z options.
11250 * layout.cc (Layout:finish_dynamic_section): If new
11251 dtags enabled, emit DT_RUNPATH. Also, emit a
11252 DT_FLAGS_1 containing any specified -z flags.
11253
85c7bf8b
ILT
112542008-04-16 Ian Lance Taylor <iant@google.com>
11255
12c0daef
ILT
11256 * copy-relocs.cc: New file.
11257 * copy-relocs.h: New file.
11258 * reloc.cc: Remove Copy_relocs code.
11259 * reloc.h: Likewise.
11260 * reloc-types.h (struct Reloc_types) [both versions]: Add
11261 get_reloc_addend_noerror.
11262 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11263 variants of add_global which take an addend which must be zero.
11264 * i386.cc: Include "copy-relocs.h".
11265 (class Target_i386): Change type of copy_relocs_ to variable,
11266 update initializer.
11267 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11268 Change all callers.
11269 (Target_i386::do_finalize_sections): Change handling of
11270 copy_relocs_.
11271 * sparc.cc: Include "copy-relocs.h".
11272 (class Target_sparc): Change type of copy_relocs_ to variable,
11273 update initializer.
11274 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11275 Change all callers.
11276 (Target_sparc::do_finalize_sections): Change handling of
11277 copy_relocs_.
11278 * x86_64.cc: Include "copy-relocs.h".
11279 (class Target_x86_64): Change type of copy_relocs_ to variable,
11280 update initializer.
11281 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11282 class. Change all callers.
11283 (Target_x86_64::do_finalize_sections): Change handling of
11284 copy_relocs_.
11285 * Makefile.am (CCFILES): Add copy-relocs.cc.
11286 (HFILES): Add copy-relocs.h.
11287
4f4995b6
ILT
11288 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11289
85c7bf8b
ILT
11290 * testsuite/script_test_4.sh: Permit leading zeroes.
11291
4f2a9edd
ILT
112922008-04-15 Ian Lance Taylor <iant@google.com>
11293
e6188289
ILT
11294 * script-sections.cc (Script_sections::create_segments): Use
11295 header_size_adjustment even when there is enough room for the
11296 headers.
11297 * testsuite/script_test_4.sh: New file.
11298 * testsuite/script_test_4.t: New file.
11299 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11300 (check_DATA): Add script_test_4.stdout.
11301 (MOSTLYCLEANFILES): Likewise.
11302 (script_test_4): New target.
11303 (script_test_4.stdout): New target.
11304 * testsuite/Makefile.in: Rebuild.
11305
4f2a9edd
ILT
11306 * sparc.cc: Add definitions for Output_data_plt_sparc class
11307 constants.
11308
f5314dd5
DM
113092008-04-14 David S. Miller <davem@davemloft.net>
11310
11311 * sparc.cc: New file.
11312 * Makefile.am (TARGETSOURCES): Add sparc.cc
11313 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11314 * configure.tgt: Document targ_extra_size and
11315 targ_extra_big_endian. Add entries for sparc-* and
11316 sparc64-*.
11317 * configure.ac: Handle targ_extra_size and
11318 targ_extra_big_endian.
11319 * Makefile.in: Rebuild.
11320 * configure: Likewise.
11321 * po/POTFILES.in: Likewise.
11322 * po/gold.pot: Likewise.
11323
154e0e9a
ILT
113242008-04-14 Ian Lance Taylor <iant@google.com>
11325
11326 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11327 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11328 in the name/type/flags to section mapping. Don't call
11329 allocate_output_section.
11330 (Layout::choose_output_section): Change parameter from adjust_name
11331 to is_input_section. Don't permit input sections after sections
11332 are attached to segments. Don't call allocate_output_section.
11333 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11334 not write_enable_output_section.
11335 (Layout::make_output_section): Don't push to
11336 unattached_section_list_ nor call attach_to_segment. Call
11337 attach_section_to_segment if sections are attached.
11338 (Layout::attach_sections_to_segments): New function.
11339 (Layout::attach_section_to_segment): New function.
11340 (Layout::attach_allocated_section_to_segment): Rename from
11341 attach_to_segment. Remove flags parameter.
11342 (Layout::allocate_output_section): Remove function.
11343 (Layout::write_enable_output_section): Remove function.
11344 * layout.h (class Layout): Update for above changes. Add new
11345 field sections_are_attached_.
11346 * output.h (Output_section::update_flags_for_input_section): New
11347 function.
11348 * output.cc (Output_section::add_input_section): Call
11349 update_flags_for_input_section.
11350 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11351
009a67a2
CC
113522008-04-11 Cary Coutant <ccoutant@google.com>
11353
11354 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11355 thought unnecessary.
11356 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11357
759b1a24
ILT
113582008-04-11 Ian Lance Taylor <iant@google.com>
11359
11360 * output.h (class Output_section_data): Remove inline definition
11361 of set_addralign.
11362 * output.cc (Output_section_data::set_addralign): New function.
11363
c2b45e22
CC
113642008-04-11 Cary Coutant <ccoutant@google.com>
11365
11366 Add support for TLS descriptors for i386 and x86_64.
11367 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11368 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11369 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11370 GOT_TYPE_TLS_DESC.
11371 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11372 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11373 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11374 relocations.
11375 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11376 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11377 Fix problem with initial-exec relocations.
11378 (Target_i386::Relocate::relocate_tls): Likewise.
11379 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11380 relaxation.
11381 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11382 support for section-plus-offset dynamic table entries.
11383 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11384 (Output_data_dynamic::Dynamic_entry): Add support for
11385 section-plus-offset dynamic table entries.
11386 (Output_data_dynamic::Classification): Likewise.
11387 (Output_data_dynamic::classification_): Renamed offset_.
11388 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11389 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11390 (Target_x86_64::make_plt_section): New function.
11391 (Target_x86_64::reserve_tlsdesc_entries): New function.
11392 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11393 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11394 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11395 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11396 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11397 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11398 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11399 add extra PLT entry for TLS descriptors.
11400 (Output_data_plt_x86_64::got_): New field.
11401 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11402 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11403 fields.
11404 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11405 descriptors.
11406 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11407 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11408 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11409 R_386_TLS_DESC_CALL relocations.
11410 (Target_x86_64::Scan::global): Likewise.
11411 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11412 for TLS descriptors.
11413 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11414 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11415 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11416 GD-to-IE relaxation.
11417 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11418 and TLS_DESCRIPTORS.
11419 * Makefile.in: Rebuild.
11420 * configure: Rebuild.
11421 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11422 (tls_test_shared2.so): New target.
11423 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11424 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11425 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11426 (tls_shared_gd_to_ie_test_LDADD): New variable.
11427 (tls_shared_gnu2_gd_to_ie_test): New target.
11428 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11429 New targets.
11430 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11431 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11432 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11433 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11434 (tls_shared_gnu2_test): New target.
11435 (tls_test_gnu2_shared.so): New target.
11436 (tls_shared_gnu2_test_SOURCES): New variable.
11437 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11438 (tls_shared_gnu2_test_LDFLAGS): New variable.
11439 (tls_shared_gnu2_test_LDADD): New variable.
11440 * testsuite/Makefile.in: Rebuild.
11441 * testsuite/Makefile.
11442
83bfb6b7
ILT
114432008-04-11 Ian Lance Taylor <iant@google.com>
11444
11445 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11446 justsyms.t.
11447 * testsuite/Makefile.in: Rebuild.
11448
11449 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11450 long.
11451 * testsuite/script_test_2.cc (main): Adjust test.
11452
706e1f5e
ILT
114532008-04-11 David S. Miller <davem@davemloft.net>
11454 Ian Lance Taylor <iant@google.com>
11455
11456 * options.h (General_options): Add entries for '-Y' and
11457 '-relax'.
11458 * options.cc (General_options:finalize): If -Y was used, add those
11459 entries to the library path instead of the default "/lib" and
11460 "/usr/lib".
11461
7c98e6bb
DM
114622008-04-11 David S. Miller <davem@davemloft.net>
11463
11464 * testsuite/justsyms.t: Start at 0x100.
11465 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
11466 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11467 long.
11468 * testsuite/script_test_2.cc: Adjust string and section length
11469 checks.
7c98e6bb 11470
99a37bfd
ILT
114712008-04-09 Ian Lance Taylor <iant@google.com>
11472
2cefc357
ILT
11473 PR gold/5996
11474 * script-sections.cc (Sections_element::allocate_to_segment): Add
11475 orphan parameter.
11476 (Output_section_definition::allocate_to_segment): Likewise.
11477 (Orphan_output_section::allocate_to_segment): Likewise.
11478 (Script_sections::attach_sections_using_phdrs_clause): Don't
11479 propagate non-PT_LOAD segments to orphan sections.
11480 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11481 readelf rather than objdump.
11482 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11483 .interp section and PT_INTERP segment are the same size.
11484 * testsuite/Makefile.in: Rebuild.
11485
99a37bfd
ILT
11486 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11487 aliases for symbols defined in the same object.
11488 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11489 (weak_alias_test_SOURCES): New variable.
11490 (weak_alias_test_DEPENDENCIES): New variable.
11491 (weak_alias_test_LDFLAGS): New variable.
11492 (weak_alias_test_LDADD): New variable.
11493 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11494 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11495 (weak_alias_test_3.o): New target.
11496 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11497 * testsuite/weak_alias_test_main.cc: New file.
11498 * testsuite/weak_alias_test_1.cc: New file.
11499 * testsuite/weak_alias_test_2.cc: New file.
11500 * testsuite/weak_alias_test_3.cc: New file.
11501
780e49c5
ILT
115022008-04-08 Ian Lance Taylor <iant@google.com>
11503
cdb0b8f5
ILT
11504 * options.h (class General_options): Add --noinhibit-exec option.
11505 * main.cc (main): Check --noinhibit-exec.
11506
0864d551
ILT
11507 * options.h (class General_options): Define --wrap as a special
11508 option. Add wrap_symbols_ field.
11509 (General_options::any_wrap_symbols): New function.
11510 (General_options::is_wrap_symbol): New function.
11511 * options.cc (General_options::parse_wrap): New function.
11512 (General_options::General_options): Initialize wrap_symbols_.
11513 * symtab.cc (Symbol_table::wrap_symbol): New function.
11514 (Symbol_table::add_from_object): Handle --wrap.
11515 * symtab.h (class Symbol_table): Declare wrap_symbol.
11516 * target.h (Target::wrap_char): New function.
11517 (Target::Target_info): Add wrap_char field.
11518 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11519 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11520 * testsuite/testfile.cc (Target_test::test_target_info):
11521 Likewise.
11522
789aa6de
ILT
11523 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11524 there is one.
11525
2c38906f
ILT
11526 * layout.h (class Layout): Add added_eh_frame_data_ field.
11527 * layout.cc (Layout::Layout): Initialize new field.
11528 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11529 output section until we find a section we merged successfully.
11530 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11531 that the size be non-zero.
11532
780e49c5
ILT
11533 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11534 qualifier.
11535
7fcd0256
ILT
115362008-04-08 Craig Silverstein <csilvers@google.com>
11537
11538 * configure.ac: Export new conditional variable HAVE_ZLIB.
11539 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11540 on HAVE_ZLIB.
11541 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11542 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11543
6835af53
ILT
115442008-04-07 Ian Lance Taylor <iant@google.com>
11545
e24f324c
ILT
11546 * version.cc (version_string): Set to "1.5".
11547
a036edd8
ILT
11548 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11549 Add issued_non_pic_error_ field. Declare check_non_pic.
11550 (Target_x86_64::Scan::check_non_pic): New function.
11551 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11552 (Target_x86_64::Scan::global): Likewise.
11553
624f8810
ILT
11554 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11555 addend parameter. Change caller. Handle merge sections.
11556 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11557 Address to Addend. Don't add in the result of
11558 local_section_offset, pass down the addend and use the returned
11559 value.
11560 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11561 Update declarations of local_section_offset and symbol_value.
11562 * testsuite/two_file_test_1.cc (t18): New function.
11563 * testsuite/two_file_test_2.cc (f18): New function.
11564 * testsuite/two_file_test_main.cc (main): Call t18.
11565 * testsuite/two_file_test.h (t18, f18): Declare.
11566
6835af53
ILT
11567 * configure.ac: Don't test for objdump, c++filt, or readelf.
11568 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11569 conditionals.
11570 (TEST_READELF): New variable.
11571 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11572 (check_PROGRAMS): Add two_file_strip_test.
11573 (two_file_strip_test): New target.
11574 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11575 (two_file_same_shared_strip_test_SOURCES): New variable.
11576 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11577 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11578 (two_file_same_shared_strip_test_LDADD): New variable.
11579 (two_file_shared_strip.so): New target.
11580 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11581 (ver_test_5.syms, ver_test_7.syms): Likewise.
11582 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11583 (strip_test_3.stdout): Use TEST_OBJDUMP.
11584 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11585
86925eef
CC
115862008-04-04 Cary Coutant <ccoutant@google.com>
11587
11588 * symtab.h (Symbol::is_weak_undefined): New function.
11589 (Symbol::is_strong_undefined): New function.
11590 (Symbol::is_absolute): New function.
11591 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11592 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11593 absolute symbols.
11594 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11595 (weak_undef_test): New target.
11596 * testsuite/Makefile.in: Rebuild.
11597 * testsuite/weak_undef_file1.cc: New file.
11598 * testsuite/weak_undef_file2.cc: New file.
11599 * testsuite/weak_undef_test.cc: New file.
11600
126f3ece
ILT
116012008-04-03 Craig Silverstein <csilvers@google.com>
11602
11603 * compressed_output.h (class Output_compressed_section): Use
11604 unsigned buffer.
11605 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11606 add zlib header.
11607 (zlib_compressed_suffix): Removed.
11608 (Output_compressed_section::set_final_data_size): Use unsigned
11609 buffers.
11610 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11611 Fix linker invocation.
11612 (flagstest_o_specialfile_and_compress_debug_sections):
11613 Likewise.
11614 * testsuite/Makefile.in: Regenerated.
11615
deae2a14
DM
116162008-04-02 David S. Miller <davem@davemloft.net>
11617
11618 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11619 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11620
70752818
ILT
116212008-04-02 Craig Silverstein <csilvers@google.com>
11622
11623 * TODO: New file.
11624
39d0cb0e
ILT
116252008-04-02 Ian Lance Taylor <iant@google.com>
11626
11627 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11628 parameters. Update for new key type to views_. Change all
11629 callers.
11630 (File_read::read): Adjust for byteshift in returned view.
11631 (File_read::add_view): New function, broken out of
11632 find_and_make_view.
11633 (File_read::make_view): New function, broken out of
11634 find_and_make_view.
11635 (File_read::find_or_make_view): Add offset and aligned
11636 parameters. Rewrite accordingly. Change all callers.
11637 (File_read::get_view): Add offset and aligned parameters. Adjust
11638 for byteshift in return value.
11639 (File_read::get_lasting_view): Likewise.
11640 * fileread.h (class File_read): Update declarations.
11641 (class File_read::View): Add byteshift_ field. Add byteshift to
11642 constructor. Add byteshift method.
11643 * archive.h (Archive::clear_uncached_views): New function.
11644 (Archive::get_view): Add aligned parameter. Change all callers.
11645 * object.h (Object::get_view): Add aligned parameter. Change all
11646 callers.
11647 (Object::get_lasting_view): Likewise.
11648
11649 * fileread.cc (File_read::release): Don't call clear_views if
11650 there are multiple objects.
11651 * fileread.h (File_read::clear_uncached_views): New function.
11652 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11653 on the archive.
11654
a1207466
CC
116552008-03-31 Cary Coutant <ccoutant@google.com>
11656
11657 Add thin archive support.
11658 * archive.cc (Archive::armagt): New const.
11659 (Archive::setup): Remove task parameter and calls to unlock.
11660 (Archive::unlock_nested_archives): New function.
11661 (Archive::read_header): Add nested_off parameter. Change
11662 all callers.
11663 (Archive::interpret_header): Likewise.
11664 (Archive::include_all_members): Change to handle thin
11665 archives.
11666 (Archive::include_member): Likewise.
11667 * archive.h (Archive::Archive): Add new parameters and
11668 initializers.
11669 (Archive::armagt): New const.
11670 (Archive::setup): Remove task parameter.
11671 (Archive::unlock_nested_archives): New function.
11672 (Archive::read_header): Add nested_off parameter.
11673 (Archive::interpret_header): Likewise.
11674 (Archive::Nested_archive_table): New typedef.
11675 (Archive::is_thin_archive_): New field.
11676 (Archive::nested_archives_): New field.
11677 (Archive::options_): New field.
11678 (Archive::dirpath_): New field.
11679 (Archive::task_): New field.
11680 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11681 for thin archives. Pass additional parameters to
11682 Archive::Archive. Unlock the archive file after calling
11683 Archive::setup.
cd536b21 11684
479f6503
ILT
116852008-03-29 Ian Lance Taylor <iant@google.com>
11686
686c8caf
ILT
11687 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11688 version symbol to be local.
11689 * testsuite/ver_test_4.sh: New file.
11690 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11691 (check_DATA): Add ver_test_4.syms.
11692 (ver_test_4.syms): New target.
11693 * testsuite/Makefile.in: Rebuild.
11694
ab794b6b
ILT
11695 * output.cc
11696 (Output_section::Input_section_sort_entry::has_priority): New
11697 function.
11698 (Output_section::Input_section_sort_entry::match_file_name): New
11699 function.
11700 (Output_section::Input_section_sort_entry::match_section_name):
11701 Remove.
11702 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11703 Remove.
11704 (Output_section::Input_section_sort_entry::match_section_file):
11705 Remove.
11706 (Output_section::Input_section_sort_compare::operator()): Rewrite
11707 using new Input_section_sort_entry functions. Sort crtbegin and
11708 crtend first. Sort sections with no priority before sections with
11709 a priority.
11710 * testsuite/initpri1.c (d3): Check j != 4.
11711 (cd5): New constructor/destructor function.
11712 (main): Check j != 2.
11713
479f6503
ILT
11714 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11715 new symbol when resolving, don't call set_is_default.
11716 * testsuite/ver_test_7.cc: New file.
11717 * testsuite/ver_test_7.sh: New file.
11718 * testsuite/Makefile.am (ver_test_7.so): New target.
11719 (ver_test_7.o): New target.
11720 (check_SCRIPTS): Add ver_test_7.sh.
11721 (check_DATA): Add ver_test_7.syms.
11722 (ver_test_7.syms): New target.
11723
2fd32231
ILT
117242008-03-28 Ian Lance Taylor <iant@google.com>
11725
11726 * layout.cc (Layout::layout): If we see an input section with a
11727 name that needs sorting, set the must_sort flag for the output
11728 section.
11729 (Layout::make_output_section): If the name of the output section
11730 indicates that it might require sorting, set the may_sort flag.
11731 * output.h (Output_section::may_sort_attached_input_sections): New
11732 function.
11733 (Output_section::set_may_sort_attached_input_sections): New
11734 function.
11735 (Output_section::must_sort_attached_input_sections): New
11736 function.
11737 (Output_section::set_must_sort_attached_input_sections): New
11738 function.
11739 (class Output_section): Declare Input_section_sort_entry. Define
11740 Input_section_sort_compare. Declare
11741 sort_attached_input_sections. Add new fields:
11742 may_sort_attached_input_sections_,
11743 must_sort_attached_input_sections_,
11744 attached_input_sections_are_sorted_.
11745 * output.cc (Output_section::Output_section): Initialize new
11746 fields.
11747 (Output_section::add_input_section): Add an entry to
11748 input_sections_ if may_sort or must_sort are true.
11749 (Output_section::set_final_data_size): Call
11750 sort_attached_input_sections if necessary.
11751 (Output_section::Input_section_sort_entry): Define new class.
11752 (Output_section::Input_section_sort_compare::operator()): New
11753 function.
11754 (Output_section::sort_attached_input_sections): New function.
11755 * configure.ac: Check whether the compiler supports constructor
11756 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11757 * testsuite/initpri1.c: New file.
11758 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11759 CONSTRUCTOR_PRIORITY.
11760 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11761 (initpri1_LDFLAGS): New variable.
11762 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11763
18e6b24e
ILT
117642008-03-27 Ian Lance Taylor <iant@google.com>
11765
49bdd526
ILT
11766 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11767 * testsuite/common_test_1.c: New file.
11768 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11769 (common_test_1_SOURCES): New variable.
11770 (common_test_1_DEPENDENCIES): New variable.
11771 (common_test_1_LDFLAGS): New variable.
11772
18e6b24e
ILT
11773 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11774 and commons_ correctly when NAME/VERSION does not override
11775 NAME/NULL.
11776 * testsuite/ver_test_6.c: New file.
11777 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11778 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11779 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11780
04bf7072
ILT
117812008-03-26 Ian Lance Taylor <iant@google.com>
11782
5871526f
ILT
11783 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11784 of an undefined symbol from a version script.
11785 * testsuite/Makefile.am (ver_test_5.so): New target.
11786 (ver_test_5.o): New target.
11787 (check_SCRIPTS): Add ver_test_5.sh.
11788 (check_DATA): Add ver_test_5.syms.
11789 (ver_test_5.syms): New target.
11790 * testsuite/ver_test_5.cc: New file.
11791 * testsuite/ver_test_5.script: New file.
11792 * testsuite/ver_test_5.sh: New file.
11793 * Makefile.in, testsuite/Makefile.in: Rebuild.
11794
04bf7072
ILT
11795 PR gold/5986
11796 Fix problems building gold with gcc 4.3.0.
11797 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11798 (gold_error_at_location, gold_warning_at_location): Use it.
11799 * configure.ac: Check whether we can compile and use a template
11800 function with a printf attribute.
11801 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11802 when jumping over bytes.
11803 * object.cc: Instantiate Object::read_section_data.
11804 * debug.h: Include <cstring>
11805 * dwarf_reader.cc: Include <algorithm>
11806 * main.cc: Include <cstring>.
11807 * options.cc: Include <cstring>.
11808 * output.cc: Include <cstring>.
11809 * script.cc: Include <cstring>.
11810 * script.h: Include <string>.
11811 * symtab.cc: Include <cstring> and <algorithm>.
11812 * target-select.cc: Include <cstring>.
11813 * version.cc: Include <string>.
11814 * testsuite/testmain.cc: Include <cstdlib>.
11815 * configure, config.in: Rebuild.
11816
874c5b28
ILT
118172008-03-25 Ian Lance Taylor <iant@google.com>
11818
819d6c3a
ILT
11819 * options.cc: Include "../bfd/bfdver.h".
11820 (options::help): Print bug reporting address.
11821
f4b2c6f5
ILT
11822 * version.cc (print_version): Adjust output for current value of
11823 BFD_VERSION_STRING.
11824
11825 * NEWS: New file.
11826
e96caa79
ILT
11827 * options.cc (options::help): Print list of supported targets.
11828 * target-select.h: Include <vector>.
11829 (class Target_selector): Make machine_, size_, and is_big_endian_
11830 fields const. Add bfd_name_ and instantiated_target_ fields.
11831 (Target_selector::Target_selector): Add bfd_name parameter.
11832 (Target_selector::recognize): Make non-virtual, call
11833 do_recognize.
11834 (Target_selector::recognize_by_name): Make non-virtual, call
11835 do_recognize_by_name.
11836 (Target_selector::supported_names): New function.
11837 (Target_selector::bfd_name): New function.
11838 (Target_selector::do_instantiate_target): New pure virtual
11839 function.
11840 (Target_selector::do_recognize): New virtual function.
11841 (Target_selector::do_recognize_by_name): New virtual function.
11842 (Target_selector::instantiate_target): New private function.
11843 (supported_target_names): Declare.
11844 * target-select.cc (Target_selector::Target_selector): Update for
11845 new parameter and fields.
11846 (select_target_by_name): Check that the name matches before
11847 calling recognize_by_name.
11848 (supported_target_names): New function.
11849 * i386.cc (class Target_selector_i386): Update Target_selector
11850 constructor call. Remove recognize and recognize_by_name. Add
11851 do_instantiate_target.
11852 * x86_64.cc (class Target_selector_x86_64): Likewise.
11853 * testsuite/testfile.cc (class Target_selector_test): Update for
11854 changes to Target_selector.
11855
874c5b28
ILT
11856 * README: Rewrite, with some notes on unsupported features.
11857
0a65a3a7
CC
118582008-03-24 Cary Coutant <ccoutant@google.com>
11859
11860 * i386.cc (Target_i386::Got_type): New enum declaration.
11861 (Target_i386::Scan::local): Updated callers of Output_data_got
11862 member functions.
11863 (Target_i386::Scan::global): Likewise.
11864 (Target_i386::Relocate::relocate): Likewise.
11865 (Target_i386::Relocate::relocate_tls): Likewise.
11866 * object.h (Got_offset_list): New class.
11867 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11868 (Sized_relobj::local_got_offset): Likewise.
11869 (Sized_relobj::set_local_got_offset): Likewise.
11870 (Sized_relobj::local_has_tls_got_offset): Removed.
11871 (Sized_relobj::local_tls_got_offset): Removed.
11872 (Sized_relobj::set_local_tls_got_offset): Removed.
11873 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11874 * output.cc (Output_data_got::add_global): Added got_type parameter.
11875 (Output_data_got::add_global_with_rel): Likewise.
11876 (Output_data_got::add_global_with_rela): Likewise.
11877 (Output_data_got::add_global_pair_with_rel): New function.
11878 (Output_data_got::add_global_pair_with_rela): New function.
11879 (Output_data_got::add_local): Added got_type parameter.
11880 (Output_data_got::add_local_with_rel): Likewise.
11881 (Output_data_got::add_local_with_rela): Likewise.
11882 (Output_data_got::add_local_pair_with_rel): New function.
11883 (Output_data_got::add_local_pair_with_rela): New function.
11884 (Output_data_got::add_global_tls): Removed.
11885 (Output_data_got::add_global_tls_with_rel): Removed.
11886 (Output_data_got::add_global_tls_with_rela): Removed.
11887 (Output_data_got::add_local_tls): Removed.
11888 (Output_data_got::add_local_tls_with_rel): Removed.
11889 (Output_data_got::add_local_tls_with_rela): Removed.
11890 * output.h (Output_data_got::add_global): Added got_type parameter.
11891 (Output_data_got::add_global_with_rel): Likewise.
11892 (Output_data_got::add_global_with_rela): Likewise.
11893 (Output_data_got::add_global_pair_with_rel): New function.
11894 (Output_data_got::add_global_pair_with_rela): New function.
11895 (Output_data_got::add_local): Added got_type parameter.
11896 (Output_data_got::add_local_with_rel): Likewise.
11897 (Output_data_got::add_local_with_rela): Likewise.
11898 (Output_data_got::add_local_pair_with_rel): New function.
11899 (Output_data_got::add_local_pair_with_rela): New function.
11900 (Output_data_got::add_global_tls): Removed.
11901 (Output_data_got::add_global_tls_with_rel): Removed.
11902 (Output_data_got::add_global_tls_with_rela): Removed.
11903 (Output_data_got::add_local_tls): Removed.
11904 (Output_data_got::add_local_tls_with_rel): Removed.
11905 (Output_data_got::add_local_tls_with_rela): Removed.
11906 * resolve.cc (Symbol::override_base_with_special): Removed
11907 reference to has_got_offset_ field.
11908 * symtab.cc (Symbol::init_fields): Replaced initialization
11909 of got_offset_ with got_offsets_. Removed initialization
11910 of has_got_offset_
53fcba31 11911 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11912 (Symbol::got_offset): Likewise.
11913 (Symbol::set_got_offset): Likewise.
11914 (Symbol::has_tls_got_offset): Removed.
11915 (Symbol::tls_got_offset): Removed.
11916 (Symbol::set_tls_got_offset): Removed.
11917 (Symbol::got_offset_): Removed.
11918 (Symbol::tls_mod_got_offset_): Removed.
11919 (Symbol::tls_pair_got_offset_): Removed.
11920 (Symbol::got_offsets_): New field.
11921 (Symbol::has_got_offset): Removed.
11922 (Symbol::has_tls_mod_got_offset): Removed.
11923 (Symbol::has_tls_pair_got_offset): Removed.
11924 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11925 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11926 member functions.
11927 (Target_x86_64::Scan::global): Likewise.
11928 (Target_x86_64::Relocate::relocate): Likewise.
11929 (Target_x86_64::Relocate::relocate_tls): Likewise.
11930
bd52eafb
BE
119312008-03-25 Ben Elliston <bje@au.ibm.com>
11932
11933 * yyscript.y: Fix spelling error in comment.
11934
8b105e34
ILT
119352008-03-24 Ian Lance Taylor <iant@google.com>
11936
8ed814a9
ILT
11937 * options.h (class General_options): Define build_id option.
11938 * layout.h (class Layout): Declare write_build_id, create_note,
11939 create_build_id. Add build_id_note_ member.
11940 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11941 "libiberty.h", "md5.h", "sha1.h".
11942 (Layout::Layout): Initialize eh_frame_data_,
11943 eh_frame_hdr_section_, and build_id_note_.
11944 (Layout::finalize): Call create_build_id.
11945 (Layout::create_note): New function, broken out of
11946 Layout::create_gold_note.
11947 (Layout::create_gold_note): Call create_note.
11948 (Layout::create_build_id): New function.
11949 (Layout::write_build_id): New function.
11950 (Close_task_runner::run): Call write_build_id.
11951
8b105e34
ILT
11952 * x86_64.cc: Correct license to GPLv3.
11953
086a1841
ILT
119542008-03-23 Ian Lance Taylor <iant@google.com>
11955
11956 * options.cc: Include "demangle.h".
11957 (parse_optional_string): New function.
11958 (parse_long_option): Handle takes_optional_argument.
11959 (parse_short_option): Update dash_z initializer. Handle
11960 takes_optional_argument.
11961 (General_options::General_options): Initialize do_demangle_.
11962 (General_options::finalize): Set do_demangle_. Handle demangling
11963 style.
11964 * options.h (parse_optional_string): Declare.
11965 (struct One_option): Add optional_arg field. Update constructor.
11966 Update call constructor calls. Add takes_optional_argument
11967 function.
11968 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11969 (DEFINE_optional_string): Define.
11970 (General_options::demangle): Change from DEFINE_bool to
11971 DEFINE_optional_string.
11972 (General_options::no_demangle): New function.
11973 (General_options::do_demangle): New function.
11974 (General_options::set_do_demangle): New function.
11975 (General_options::execstack_status_): Move definition to end of
11976 class definition.
11977 (General_options::static_): Likewise.
11978 (General_options::do_demangle_): New field.
11979 * object.cc (big_endian>::get_symbol_location_info): Call
11980 Options::do_demangle, not Options::demangle.
11981 * symtab.cc (demangle): Likewise.
11982
cbb93e63
ILT
119832008-03-22 Ian Lance Taylor <iant@google.com>
11984
11985 * gold.h: Include <cstddef> and <sys/types.h>
11986 * options.h: Include <cstring>.
11987
ec531623
ILT
119882008-03-21 Ian Lance Taylor <iant@google.com>
11989
11990 * Added source code to GNU binutils.
This page took 0.71535 seconds and 4 git commands to generate.