2011-10-31 Sriraman Tallam <tmsriram@google.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
7257cc92
ST
12011-10-31 Sriraman Tallam <tmsriram@google.com>
2
3 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4 gc_mark_symbol.
5 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
6 gc_mark_symbol.
7 Change to just keep the section associated with symbol.
8 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
9 they are externally visible and --export-dynamic is turned on.
10 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
11
bfc34b3f
ILT
122011-10-19 Ian Lance Taylor <iant@google.com>
13
14 PR gold/13163
15 * script-sections.cc
16 (Output_section_element_dot_assignment::needs_output_section): New
17 function.
18
ea0d8c47
ILT
192011-10-19 Ian Lance Taylor <iant@google.com>
20
21 PR gold/13204
22 * layout.cc (Layout::segment_precedes): Don't assert failure if a
23 --section-start option was seen.
24 * options.h (General_options::any_section_start): New function.
25
abd242a9
DM
262011-10-18 David S. Miller <davem@davemloft.net>
27
28 PR binutils/13301
29 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
30 member to track relocation locations that have moved during TLS
31 reloc optimizations.
32 (Target_sparc::Relocate::Relocate): Initialize to NULL.
33 (Target_sparc::Relocate::relocate): Adjust view down by 4
34 bytes if it matches reloc_adjust_addr_.
35 (Target_sparc::Relocate::relocate_tls): Always move the
36 __tls_get_addr call delay slot instruction forward 4 bytes when
37 performing relaxation.
38
bab9090f
CC
392011-10-18 Cary Coutant <ccoutant@google.com>
40
41 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
42 (Output_file::map_no_anonymous): Check for non-zero
43 return code from posix_fallocate.
44
f7c5b166
CC
452011-10-17 Cary Coutant <ccoutant@google.com>
46
47 PR gold/13245
48 * plugin.cc (is_visible_from_outside): Check for symbols
49 referenced from dynamic objects.
50 * resolve.cc (Symbol_table::resolve): Don't count references
51 from dynamic objects as references from real ELF files.
52 * testsuite/plugin_test_2.sh: Adjust expected result.
53
b490c0bb
CC
542011-10-17 Cary Coutant <ccoutant@google.com>
55
56 * gold.cc: Include timer.h.
57 (queue_middle_tasks): Stamp time.
58 (queue_final_tasks): Likewise.
59 * main.cc (main): Store timer in parameters. Print timers
60 for each pass.
61 * parameters.cc (Parameters::Parameters): Initialize timer_.
62 (Parameters::set_timer): New function.
63 (set_parameters_timer): New function.
64 * parameters.h (Parameters::set_timer): New function.
65 (Parameters::timer): New function.
66 (Parameters::timer_): New data member.
67 (set_parameters_timer): New function.
68 * timer.cc (Timer::stamp): New function.
69 (Timer::get_pass_time): New function.
70 * timer.h (Timer::stamp): New function.
71 (Timer::get_pass_time): New function.
72 (Timer::pass_times_): New data member.
73
f475cf7b
CC
742011-10-17 Cary Coutant <ccoutant@google.com>
75
76 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
77 task for members of lib groups.
78
cdd7e244
CC
792011-10-17 Cary Coutant <ccoutant@google.com>
80
81 PR gold/13288
4f95c8b4 82 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
83 (File_read::make_view): Move bounds check (replace with assert)...
84 (File_read::find_or_make_view): ... to here.
85
dfb45471
CC
862011-10-12 Cary Coutant <ccoutant@google.com>
87
4f95c8b4 88 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
89 ::read returns less than requested size.
90
53bbcc1b
CC
912011-10-10 Cary Coutant <ccoutant@google.com>
92
4f95c8b4 93 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
94 Initialize defined_count_.
95 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
96 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
97 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
98 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
99 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 100 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
101 member.
102 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 103 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
104 Return zeroes instead of internal error.
105
397b129b
CC
1062011-10-10 Cary Coutant <ccoutant@google.com>
107
108 PR gold/13249
4f95c8b4 109 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 110 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 111 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
112 (Output_reloc::type_): Adjust size of bit field.
113 (Output_reloc::use_plt_offset_): New bit field.
114 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
115 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
116 flag. Adjust all callers.
4f95c8b4 117 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
118 creating RELATIVE relocations.
119
d5698657
NC
1202011-10-10 Nick Clifton <nickc@redhat.com>
121
122 * po/es.po: Updated Spanish translation.
123 * po/fi.po: Updated Finnish translation.
124
6a59a5c2
DN
1252011-10-03 Diego Novillo <dnovillo@google.com>
126
127 * options.cc (parse_uint): Fix dereference of RETVAL.
128
f0558624
ST
1292011-09-29 Sriraman Tallam <tmsriram@google.com>
130
131 * layout.h (section_order_map_): New member.
132 (get_section_order_map): New member function.
133 * output.cc (Output_section::add_input_section): Check for patterns
134 only when --section-ordering-file is specified.
135 * gold.cc (queue_middle_tasks): Delay updating order of sections till
136 output_sections have been formed.
137 * layout.cc (Layout_Layout): Initialize section_order_map_.
138 * plugin.cc (update_section_order): Store order in order_map. Do not
139 update the order.
140 * testsuite/Makefile.am: Add test case for plugin_final_layout.
141 * testsuite/Makefile.in: Regenerate.
142 * testsuite/plugin_section_order.c: New file.
143 * testsuite/plugin_final_layout.cc: New file.
144 * testsuite/plugin_final_layout.sh: New file.
145
a7dac153
CC
1462011-09-29 Cary Coutant <ccoutant@google.com>
147
4f95c8b4 148 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 149 Check for NULL.
4f95c8b4 150 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
151 symbols during incremental update.
152 (Symbol_table::add_from_dynobj): Likewise.
153
eebd87a5
ILT
1542011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
155 Ian Lance Taylor <iant@google.com>
156
157 * symtab.cc (Symbol_table::define_special_symbol): Always
158 canonicalize version string.
159
403a3331
CC
1602011-09-26 Cary Coutant <ccoutant@google.com>
161
4f95c8b4
CC
162 * gold.cc (queue_initial_tasks): Move option checks ...
163 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
164 some options; make others fatal.
165
235061c2
CC
1662011-09-26 Cary Coutant <ccoutant@google.com>
167
168 gcc PR lto/47247
169 * plugin.cc (get_symbols_v2): New function.
170 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
171 (is_referenced_from_outside): New function.
172 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
173 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
174 (get_symbols): Pass version parameter.
175 (get_symbols_v2): New function.
176 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
177 parameter.
178 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
179 (onload): Add LDPT_GET_SYMBOLS_V2.
180 (all_symbols_read_hook): Use get_symbols_v2; check for
181 LDPR_PREVAILING_DEF_IRONLY_EXP.
182 * testsuite/plugin_test_3.sh: Update expected results.
183
dc87f620
ILT
1842011-09-23 Simon Baldwin <simonb@google.com>
185
186 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
187 configuration options.
188 * configure: Regenerate.
189 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
190 * Makefile.in: Regenerate.
191 * testsuite/Makefile.in: Regenerate.
192
a8279f82
ST
1932011-09-19 Sriraman Tallam <tmsriram@google.com>
194
195 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
196
0c9350c8
CC
1972011-09-19 Cary Coutant <ccoutant@google.com>
198
199 * incremental.cc (can_incremental_update): Fix typo in comment.
200 * incremental.h (can_incremental_update): Likewise.
201
aa06ae28
CC
2022011-09-18 Cary Coutant <ccoutant@google.com>
203
204 * incremental.cc (can_incremental_update): New function.
205 * incremental.h (can_incremental_update): New function.
206 * layout.cc (Layout::init_fixed_output_section): Call it.
207 (Layout::make_output_section): Don't allow patch space in .eh_frame.
208 * object.cc (Sized_relobj_file::do_layout): Call
209 can_incremental_update.
210
ebb300b2
CC
2112011-09-13 Cary Coutant <ccoutant@google.com>
212
213 * configure.ac: Check for glibc support for gnu_indirect_function
214 support with static linking, setting automake conditional
215 IFUNC_STATIC.
216 * Makefile.in: Regenerate.
217 * configure: Regenerate.
218
219 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
220 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
221 for IFUNC_STATIC.
222 * testsuite/Makefile.in: Regenerate.
223
1206d0d5
CC
2242011-09-13 Cary Coutant <ccoutant@google.com>
225
226 * incremental.cc (Sized_relobj_incr::do_layout): Call
227 report_comdat_group for kept comdat sections.
228 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
229 * testsuite/Makefile.in: Regenerate.
230 * testsuite/incr_comdat_test_1.cc: New source file.
231 * testsuite/incr_comdat_test_2_v1.cc: New source file.
232 * testsuite/incr_comdat_test_2_v2.cc: New source file.
233 * testsuite/incr_comdat_test_2_v3.cc: New source file.
234
40b29874
ILT
2352011-09-13 Ian Lance Taylor <iant@google.com>
236
237 * object.cc (Sized_relobj_file::do_layout): Remove unused local
238 variable external_symbols_offset.
239
1b045aac
ILT
2402011-09-12 Ian Lance Taylor <iant@google.com>
241
242 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
243 triggered if object has no symbols.
244
24c6c55a
DM
2452011-09-09 David S. Miller <davem@davemloft.net>
246
247 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
248 (Output_fill_debug_line::do_write): Likewise.
249
66570254
CC
2502011-08-29 Cary Coutant <ccoutant@google.com>
251
252 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
253 casts to match formatting specs.
254 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
255
8ea8cd50
CC
2562011-08-26 Cary Coutant <ccoutant@google.com>
257
258 * layout.cc (Free_list::allocate): Provide guarantee of minimum
259 remaining hole size when allocating.
260 (Layout::make_output_section): Set fill methods for debug sections.
261 * layout.h (Free_list::Free_list_node): Move from private to
262 public.
263 (Free_list::set_min_hole_size): New function.
264 (Free_list::begin, Free_list::end): New functions.
265 (Free_list::min_hole_): New data member.
266 * output.cc: Include dwarf.h.
267 (Output_fill_debug_info::do_minimum_hole_size): New function.
268 (Output_fill_debug_info::do_write): New function.
269 (Output_fill_debug_line::do_minimum_hole_size): New function.
270 (Output_fill_debug_line::do_write): New function.
271 (Output_section::Output_section): Initialize new data member.
272 (Output_section::set_final_data_size): Ensure patch space is larger
273 than minimum hole size.
274 (Output_section::do_write): Fill holes in debug sections.
275 * output.h (Output_fill): New class.
276 (Output_fill_debug_info): New class.
277 (Output_fill_debug_line): New class.
278 (Output_section::set_free_space_fill): New function.
279 (Output_section::free_space_fill_): New data member.
280 * testsuite/Makefile.am (incremental_test_3): Add
281 --incremental-patch option.
282 (incremental_test_4): Likewise.
283 (incremental_test_5): Likewise.
284 (incremental_test_6): Likewise.
285 (incremental_copy_test): Likewise.
286 (incremental_common_test_1): Likewise.
287 * testsuite/Makefile.in: Regenerate.
288
7cf80422
NC
2892011-08-26 Nick Clifton <nickc@redhat.com>
290
291 * po/es.po: Updated Spanish translation.
292
c3f7b0e5
CC
2932011-08-01 Cary Coutant <ccoutant@google.com>
294
295 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
296 * gold/testsuite/Makefile.in: Regenerate.
297 * gold/testsuite/justsyms_exec.c: New source file.
298 * gold/testsuite/justsyms_lib.c: New source file.
299
9590bf25
CC
3002011-08-01 Cary Coutant <ccoutant@google.com>
301
302 * layout.cc (Layout::set_segment_offsets): Don't realign text
303 segment if -Ttext was specified.
304 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
305 file type.
306 * object.h (Sized_relobj_file::e_type): New function.
307 (Sized_relobj_file::e_type_): New data member.
308 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
309 base address for ET_EXEC files.
310 * target.cc (Target::do_make_elf_object_implementation): Allow
311 ET_EXEC files with --just-symbols option.
312
dcd8d12e
CC
3132011-07-28 Cary Coutant <ccoutant@google.com>
314
315 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
316 Add thread_number parameter.
317 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
318 * workqueue-threads.cc
319 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
320 current thread if its thread number is greater than desired thread
321 count.
322 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
323 Add thread_number parameter.
324 (Workqueue::should_cancel_thread): Likewise.
325 (Workqueue::find_runnable_or_wait): Pass thread_number to
326 should_cancel_thread.
327 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
328 parameter.
329
804eb480
ST
3302011-07-22 Sriraman Tallam <tmsriram@google.com>
331
332 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
333 only after checking if it cannot be forced local.
334 * symtab.h (is_externally_visible): Check if the symbol is not forced
335 local.
336
f1ddb600
ILT
3372011-07-15 Ian Lance Taylor <iant@google.com>
338
339 * options.h (class General_options): Add --print-output-format.
340 Move -EL next to -EB, for better --help output.
341 * target-select.cc: Include <cstdio>, "options.h", and
342 "parameters.h".
343 (Target_selector::do_target_bfd_name): New function.
344 (print_output_format): New function.
345 * target-select.h (class Target_selector): Update declarations.
346 (Target_selector::target_bfd_name): New function.
347 (print_output_format): Declare.
348 * main.cc: Include "target-select.h".
349 (main): Handle --print-output-format.
350 * gold.cc: Include "target-select.h".
351 (queue_initial_tasks): Handle --print-output-format when there are
352 no input files.
353 * parameters.cc (parameters_force_valid_target): Give a better
354 error message if -EB/-EL does not match target.
355 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
356 function.
357
7d172687
ILT
3582011-07-15 Ian Lance Taylor <iant@google.com>
359
360 * i386.cc (class Output_data_plt_i386): Add layout_ field.
361 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
362 (Output_data_plt_i386::do_write): Write address of .dynamic
363 section to first entry in .got.plt section.
364 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
365 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
366 Initialize layout_.
367 (Output_data_plt_x86_64::do_write): Write address of .dynamic
368 section to first entry in .got.plt section.
369 * layout.h (Layout::dynamic_section): New function.
370
e9552f7e
ST
3712011-07-13 Sriraman Tallam <tmsriram@google.com>
372
373 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
374 to claim_file call.
375 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
376 input_section_position_, and input_section_glob_.
377 (read_layout_from_file): Call function section_ordering_specified.
378 * layout.h (is_section_ordering_specified): New function.
379 (section_ordering_specified): New function.
380 (section_ordering_specified_): New boolean member.
381 * main.cc(main): Call load_plugins after layout object is defined.
382 * output.cc (Output_section::add_input_section): Use
383 function section_ordering_specified to check if section ordering is
384 needed.
385 * output.cc (Output_section::add_relaxed_input_section): Use
386 function section_ordering_specified to check if section ordering is
387 needed.
388 (Output_section::update_section_layout): New function.
389 (Output_section::sort_attached_input_sections): Check if input section
390 must be reordered.
391 * output.h (Output_section::update_section_layout): New function.
392 * plugin.cc (get_section_count): New function.
393 (get_section_type): New function.
394 (get_section_name): New function.
395 (get_section_contents): New function.
396 (update_section_order): New function.
397 (allow_section_ordering): New function.
398 (Plugin::load): Add the new interfaces to the transfer vector.
399 (Plugin_manager::load_plugins): New parameter.
400 (Plugin_manager::all_symbols_read): New parameter.
401 (Plugin_manager::claim_file): New parameter. Save the elf object for
402 unclaimed objects.
403 (Plugin_manager::get_elf_object): New function.
404 (Plugin_manager::get_view): Change to directly use the bool to check
405 if get_view is called from claim_file_hook.
406 * plugin.h (input_objects): New function
407 (Plugin__manager::load_plugins): New parameter.
408 (Plugin_manager::claim_file): New parameter.
409 (Plugin_manager::get_elf_object): New function.
410 (Plugin_manager::in_claim_file_handler): New function.
411 (Plugin_manager::in_claim_file_handler_): New member.
412 (layout): New function.
413 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
414 handler with an extra parameter. Make the elf object before calling
415 claim_file handler.
416 * testsuite/plugin_test.c (get_section_count): New function pointer.
417 (get_section_type): New function pointer.
418 (get_section_name): New function pointer.
419 (get_section_contents): New function pointer.
420 (update_section_order): New function pointer.
421 (allow_section_ordering): New function pointer.
422 (onload): Check if the new interfaces exist.
423
9446efde
ILT
4242011-07-13 Ian Lance Taylor <iant@google.com>
425
426 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
427 relro section.
428 * x86_64.cc (Target_x86_64::got_section): Likewise.
429 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
430 (relro_now_test_SOURCES): New variable.
431 (relro_now_test_DEPENDENCIES): New variable.
432 (relro_now_test_LDFLAGS): New variable.
433 (relro_now_test_LDADD): New variable.
434 (relro_now_test.so): New target.
435 * testsuite/Makefile.in: Rebuild.
436
07aa62f2
ILT
4372011-07-12 Ian Lance Taylor <iant@google.com>
438
439 PR gold/12980
440 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
441 GLOB_DAT relocation rather than a RELATIVE relocation for a
442 protected symbol when creating a shared library.
443 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
444 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
445 * testsuite/protected_main_1.cc (main): Test that protected
446 function has same address.
447
e2153196
ILT
4482011-07-11 Ian Lance Taylor <iant@google.com>
449
450 PR gold/12979
451 * options.h (class General_options): Add -Bgroup.
452 * options.cc (General_options::finalize): If -Bgroup is set,
453 default to --unresolved-symbols=report-all.
454 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
455 * target-reloc.h (issue_undefined_symbol_error): Handle
456 --unresolved-symbols=report-all.
457
6daf5215
ILT
4582011-07-08 Ian Lance Taylor <iant@google.com>
459
460 PR gold/11985
461 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
462 if linker script discards key sections.
463 (Layout::create_dynamic_symtab): Likewise.
464 (Layout::assign_local_dynsym_offsets): Likewise.
465 (Layout::sized_create_version_sections): Likewise.
466 (Layout::create_interp): Likewise.
467 (Layout::finish_dynamic_section): Likewise.
468 (Layout::set_dynamic_symbol_size): Likewise.
469
beabb2c6
ILT
4702011-07-08 Ian Lance Taylor <iant@google.com>
471
472 PR gold/12386
473 * options.h (class General_options): Add --unresolved-symbols.
474 * target-reloc.h (issue_undefined_symbol_error): Check
475 --unresolved-symbols. Add comments.
476
9c16daf1
ILT
4772011-07-08 Ian Lance Taylor <iant@google.com>
478
479 * testsuite/odr_violation2.cc (Ordering::operator()): Make
480 expression more complex.
481
191f1a2d
ILT
4822011-07-08 Ian Lance Taylor <iant@google.com>
483
484 PR gold/11317
485 * target-reloc.h (issue_undefined_symbol_error): New inline
486 function, broken out of relocate_section.
487 (relocate_section): Call issue_undefined_symbol_error.
488 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
489 there is no TLS segment if we are about to issue an undefined
490 symbol error.
491 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
492
62855347
ILT
4932011-07-08 Ian Lance Taylor <iant@google.com>
494
495 PR gold/12279
496 * resolve.cc (Symbol_table::should_override): Add fromtype
497 parameter. Change all callers. Give error when linking together
498 TLS and non-TLS symbol.
499 (Symbol_table::should_override_with_special): Add fromtype
500 parameter. Change all callers.
501 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
502 there is no TLS segment if we have reported some errors.
503 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
504
67181c72
ILT
5052011-07-08 Ian Lance Taylor <iant@google.com>
506
507 PR gold/12372
508 * target.h (Target::plt_address_for_global): New function.
509 (Target::plt_address_for_local): New function.
510 (Target::plt_section_for_global): Remove.
511 (Target::plt_section_for_local): Remove.
512 (Target::do_plt_address_for_global): New virtual function.
513 (Target::do_plt_address_for_local): New virtual function.
514 (Target::do_plt_section_for_global): Remove.
515 (Target::do_plt_section_for_local): Remove.
516 (Target::register_global_plt_entry): Add Symbol_table and Layout
517 parameters.
518 * output.cc (Output_data_got::Got_entry::write): Use
519 plt_address_for_global and plt_address_for_local.
520 * layout.cc (Layout::add_target_dynamic_tags): Use size and
521 address of output section.
522 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
523 got_irelative_, and irelative_count_ fields. Update
524 declarations.
525 (Output_data_plt_i386::has_irelative_section): New function.
526 (Output_data_plt_i386::entry_count): Add irelative_count_.
527 (Output_data_plt_i386::set_final_data_size): Likewise.
528 (class Target_i386): Add got_irelative_ and rel_irelative_
529 fields. Update declarations.
530 (Target_i386::Target_i386): Initialize new fields.
531 (Target_i386::do_plt_address_for_global): New function replacing
532 do_plt_section_for_global.
533 (Target_i386::do_plt_address_for_local): New function replacing
534 do_plt_section_for_local.
535 (Target_i386::got_section): Create got_irelative_.
536 (Target_i386::rel_irelative_section): New function.
537 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
538 fields. Don't define __rel_iplt_{start,end}.
539 (Output_data_plt_i386::add_entry): Add symtab and layout
540 parameters. Change all callers. Use different PLT and GOT for
541 IFUNC symbols.
542 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
543 layout parameters. Change all callers. Use different PLT and
544 GOT.
545 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
546 (Output_data_plt_i386::rel_irelative): New function.
547 (Output_data_plt_i386::address_for_global): New function.
548 (Output_data_plt_i386::address_for_local): New function.
549 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
550 IRELATIVE GOT when changing IFUNC GOT entries.
551 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
552 reloc.
553 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
554 if we didn't create an IRELATIVE GOT.
555 (Target_i386::Relocate::relocate): Use plt_address_for_global and
556 plt_address_for_local.
557 (Target_i386::do_dynsym_value): Use plt_address_for_global.
558 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
559 got_irelative_, and irelative_count_ fields. Update
560 declarations.
561 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
562 Initialize new fields. Remove symtab parameter. Change all
563 callers.
564 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
565 irelative_count_.
566 (Output_data_plt_x86_64::has_irelative_section): New function.
567 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
568 (class Target_x86_64): Add got_irelative_ and rel_irelative_
569 fields. Update declarations.
570 (Target_x86_64::Target_x86_64): Initialize new fields.
571 (Target_x86_64::do_plt_address_for_global): New function replacing
572 do_plt_section_for_global.
573 (Target_x86_64::do_plt_address_for_local): New function replacing
574 do_plt_section_for_local.
575 (Target_x86_64::got_section): Create got_irelative_.
576 (Target_x86_64::rela_irelative_section): New function.
577 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
578 all callers. Don't create __rel_iplt_{start,end}.
579 (Output_data_plt_x86_64::add_entry): Add symtab and layout
580 parameters. Change all callers. Use different PLT and GOT for
581 IFUNC symbols.
582 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
583 layout parameters. Change all callers. Use different PLT and
584 GOT.
585 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
586 parameters. Change all callers. Use different PLT and GOT for
587 IFUNC symbols.
588 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
589 (Output_data_plt_x86_64::rela_irelative): New function.
590 (Output_data_plt_x86_64::address_for_global): New function.
591 (Output_data_plt_x86_64::address_for_local): New function.
592 (Output_data_plt_x86_64::set_final_data_size): Likewise.
593 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
594 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
595 (Target_x86_64::register_global_plt_entry): Add symtab and layout
596 parameters.
597 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
598 reloc.
599 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
600 symbols if we didn't create an IRELATIVE GOT.
601 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
602 plt_address_for_local.
603 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
604 * testsuite/ifuncvar1.c: New test file.
605 * testsuite/ifuncvar2.c: New test file.
606 * testsuite/ifuncvar3.c: New test file.
607 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
608 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
609 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
610 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
611 * testsuite/Makefile.in: Rebuild.
612
33c15b45
CC
6132011-07-07 Cary Coutant <ccoutant@google.com>
614
615 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
616 (two_file_test_1_ndebug.o): Likewise.
617 (two_file_test_1b_ndebug.o): Likewise.
618 (two_file_test_2_ndebug.o): Likewise.
619 (two_file_test_main_ndebug.o): Likewise.
620 (incremental_test_2): Link with no-debug versions.
621
f48b5fb7
CC
6222011-07-06 Cary Coutant <ccoutant@google.com>
623
624 * gold/incremental.cc
625 (Output_section_incremental_inputs::write_info_blocks): Check for
626 hidden and internal symbols.
627
221597a5
CC
6282011-07-06 Cary Coutant <ccoutant@google.com>
629
630 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
631 Check disposition for startup file.
632 (Incremental_inputs::report_command_line): Ignore
633 --incremental-startup-unchanged option.
634 * options.cc (General_options::parse_incremental_startup_unchanged):
635 New function.
636 (General_options::General_options): Initialize new data member.
637 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
638 (General_options): Add --incremental-startup-unchanged option.
639 (General_options::incremental_startup_disposition): New function.
640 (General_options::incremental_startup_disposition_): New data member.
641
e24719f6
CC
6422011-07-06 Cary Coutant <ccoutant@google.com>
643
644 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
645 input file index to Script_info ctor.
646 (Sized_incremental_binary::do_file_has_changed): Find the
647 command-line argument for files named in scripts.
648 * incremental.h (Script_info::Script_info): New ctor
649 with input file index.
650 (Script_info::input_file_index): New function.
651 (Script_info::input_file_index_): New data member.
652 (Incremental_binary::get_library): Add const.
653 (Incremental_binary::get_script_info): Add const.
654 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
655 * testsuite/Makefile.am (incremental_test_5): New test case.
656 (incremental_test_6): New test case.
657 * testsuite/Makefile.in: Regenerate.
658
8f7c81e8
CC
6592011-07-06 Cary Coutant <ccoutant@google.com>
660
661 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
662 debug output when command lines differ.
663
9fbd3822
CC
6642011-07-06 Cary Coutant <ccoutant@google.com>
665
666 * incremental.cc (Incremental_inputs::report_command_line): Ignore
667 --incremental-patch option.
668 * layout.cc (Free_list::allocate): Extend allocation beyond original
669 end if enabled.
670 (Layout::make_output_section): Mark sections that should get
671 patch space.
672 * options.cc (parse_percent): New function.
673 * options.h (parse_percent): New function.
674 (DEFINE_percent): New macro.
675 (General_options): Add --incremental-patch option.
676 * output.cc (Output_section::Output_section): Initialize new data
677 members.
678 (Output_section::add_input_section): Print section name when out
679 of patch space.
680 (Output_section::add_output_section_data): Likewise.
681 (Output_section::set_final_data_size): Add patch space when
682 doing --incremental-full.
683 (Output_section::do_reset_address_and_file_offset): Remove patch
684 space.
685 (Output_segment::set_section_list_addresses): Print debug output
686 only if --incremental-update.
687 * output.h (Output_section::set_is_patch_space_allowed): New function.
688 (Output_section::is_patch_space_allowed_): New data member.
689 (Output_section::patch_space_): New data member.
690 * parameters.cc (Parameters::incremental_full): New function.
691 * parameters.h (Parameters::incremental_full): New function
692 * testsuite/Makefile.am (incremental_test_2): Add test for
693 --incremental-patch option.
694 * testsuite/Makefile.in: Regenerate.
695 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
696 (t18): Remove function body.
697
f6cccc2c
DK
6982011-07-05 Doug Kwan <dougkwan@google.com>
699
700 PR gold/12771
701 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
702 Arm_Address type for relocation result.
703 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
704 overflow check.
705 (Arm_relocate_functions::abs32): Use unaligned access.
706 (Arm_relocate_functions::rel32): Ditto.
707 (Arm_relocate_functions::prel31): Ditto.
708 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
709 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
710 static data relocations.
711 * testsuite/Makefile.in: Regnerate.
712 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
713
28a13fec
ILT
7142011-07-05 Ian Lance Taylor <iant@google.com>
715
716 PR gold/12392
717 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
718 symbols if necessary.
719 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
720
24d47b34
ILT
7212011-07-05 Ian Lance Taylor <iant@google.com>
722
723 PR gold/12952
724 * resolve.cc (Symbol::override_base_with_special): Simply override
725 version with special symbol version, ignoring previous version.
726
41f9cbbe
ILT
7272011-07-05 Ian Lance Taylor <iant@google.com>
728
729 * object.cc (Sized_relobj_file::include_section_group): Add
730 information to comment about signature location.
731
886288f1
ILT
7322011-07-02 Ian Lance Taylor <iant@google.com>
733
734 PR gold/12957
735 * options.h (class General_options): Add -f and -F.
736 * options.cc (General_options::finalize): Fatal error if -f/-F
737 are used without -shared.
738 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
739
ae3a6d4f
ILT
7402011-07-02 Ian Lance Taylor <iant@google.com>
741
742 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
743
21131061
ILT
7442011-07-01 Ian Lance Taylor <iant@google.com>
745
746 PR gold/12525
747 PR gold/12952
748 * resolve.cc (Symbol::override_base_with_special): Don't override
749 the version if the overriding symbol has a different name.
750 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
751 all callers. If we give an error about an undefined version,
752 define the base version if necessary.
753 * dynobj.h (class Versions): Update declaration.
754 * testsuite/weak_alias_test_5.cc: New file.
755 * testsuite/weak_alias_test.script: New file.
756 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
757 and versioned_alias have the right value, and call t2.
758 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
759 weak_alias_test_5.so.
760 (weak_alias_test_LDADD): Likewise.
761 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
762 * testsuite/Makefile.in: Rebuild.
763
611062c0
ILT
7642011-07-01 Ian Lance Taylor <iant@google.com>
765
766 PR gold/12525
767 * options.h (class General_options): Support -z notext.
768 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
769 -Wl,-z,notext.
770 (two_file_shared_nonpic.so): Likewise.
771 (two_file_shared_mixed.so): Likewise.
772 (two_file_shared_mixed_1.so): Likewise.
773 (weak_undef_lib_nonpic.so): Likewise.
774 (alt/weak_undef_lib_nonpic.so): Likewise.
775 (tls_test_shared_nonpic.so): Likewise.
776 * testsuite/Makefile.in: Rebuild.
777
328c7c2f
ILT
7782011-07-01 Ian Lance Taylor <iant@google.com>
779
780 PR gold/12525
781 * configure.ac: Test whether static linking works, setting
782 the automake conditional HAVE_STATIC.
783 * testsuite/Makefile.am: Disable tests using -static if
784 HAVE_STATIC is not true.
785 * configure, testsuite/Makefile.in: Rebuild.
786
02d7cd44
ILT
7872011-07-01 Ian Lance Taylor <iant@google.com>
788
789 PR gold/12525
790 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
791 Assert if we see DW_EH_PE_indirect.
792 * target.h (Target::ehframe_datarel_base): New function.
793 (Target::do_ehframe_datarel_base): New target function.
794 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
795 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
796 function.
797
07a60597
ILT
7982011-07-01 Ian Lance Taylor <iant@google.com>
799
800 PR gold/12571
801 * options.h (class General_options): Add
802 --ld-generated-unwind-info.
803 * ehframe.cc (Fde::write): Add address parameter. Change all
804 callers. If associated with PLT, fill in address and size.
805 (Cie::set_output_offset): Only add merge mapping if there is an
806 object.
807 (Cie::write): Add address parameter. Change all callers.
808 (Eh_frame::add_ehframe_for_plt): New function.
809 * ehframe.h (class Fde): Update declarations. Move shndx_ and
810 input_offset_ fields into union u_, with new plt field.
811 (Fde::Fde): Adjust for new union field.
812 (Fde::Fde) [Output_data version]: New constructor.
813 (Fde::add_mapping): Only add merge mapping if there is an object.
814 (class Cie): Update declarations.
815 (class Eh_frame): Declare add_ehframe_for_plt.
816 * layout.cc (Layout::layout_eh_frame): Break out code into
817 make_eh_frame_section, and call it.
818 (Layout::make_eh_frame_section): New function.
819 (Layout::add_eh_frame_for_plt): New function.
820 * layout.h (class Layout): Update declarations.
821 * merge.cc (Merge_map::add_mapping): Add assertion.
822 * i386.cc: Include "dwarf.h".
823 (class Output_data_plt_i386): Make first_plt_entry,
824 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
825 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
826 and plt_eh_frame_fde.
827 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
828 boundary. Call add_eh_frame_for_plt if appropriate.
829 * x86_64.cc: Include "dwarf.h".
830 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
831 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
832 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
833 and plt_eh_frame_fde.
834 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
835 appropriate.
836
14788a3f
ILT
8372011-06-29 Ian Lance Taylor <iant@google.com>
838
839 PR gold/12629
840 * object.cc (Sized_relobj_file::layout_section): Change shdr
841 parameter to be const.
842 (Sized_relobj_file::layout_eh_frame_section): New function, broken
843 out of do_layout.
844 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
845 appropriate. Call layout_eh_frame_section.
846 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
847 sections.
848 * object.h (class Sized_relobj_file): Update declarations.
849
6c21fce1
ILT
8502011-06-29 Ian Lance Taylor <iant@google.com>
851
37e41b03 852 PR gold/12652
6c21fce1
ILT
853 * script.cc (Token::integer_value): Accept trailing M/m/K/k
854 modifier.
855 (Lex::gather_token): Accept trailing M/m/K/k for integers.
856
4d5e4e62
ILT
8572011-06-29 Ian Lance Taylor <iant@google.com>
858
859 PR gold/12675
860 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
861 SHT_X86_64_UNWIND.
862 * layout.cc (Layout::layout_eh_frame): Likewise.
863
886f533a
ILT
8642011-06-29 Ian Lance Taylor <iant@google.com>
865
866 PR gold/12695
867 * layout.cc (Layout::symtab_section_shndx): New function.
868 * layout.h (class Layout): Declare symtab_section_shndx.
869 * output.cc (Output_section::write_header): Call it.
870
f3ae1b28
ILT
8712011-06-29 Ian Lance Taylor <iant@google.com>
872
873 PR gold/12818
874 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
875 symbols which are not used in a relocation.
876
aecf301f
ILT
8772011-06-28 Ian Lance Taylor <iant@google.com>
878
879 PR gold/12898
880 * layout.cc (Layout::segment_precedes): Don't crash if a linker
881 script create indistinguishable segments.
882 (Layout::set_segment_offsets): Use stable_sort when sorting
883 segments. Pass this to Compare_segments constructor.
884 * layout.h (class Layout): Make segment_precedes non-static.
885 (class Compare_segments): Change from struct to class. Add
886 layout_ field. Add constructor.
887 * script-sections.cc
888 (Script_sections::attach_sections_using_phdrs_clause): Rename
889 local orphan to is_orphan. Don't report failure to put empty
890 section in segment. On attachment failure, report name of
891 section, and attach to first PT_LOAD segment.
892
03ef7571
ILT
8932011-06-28 Ian Lance Taylor <iant@google.com>
894
895 PR gold/12934
896 * target-select.cc (Target_selector::Target_selector): Add
897 emulation parameter. Change all callers.
898 (select_target_by_bfd_name): Rename from select_target_by_name.
899 Change all callers.
900 (select_target_by_emulation): New function.
901 (supported_emulation_names): New function.
902 * target-select.h (class Target_selector): Add emulation_ field.
903 Update declarations.
904 (Target_selector::recognize_by_bfd_name): Rename from
905 recognize_by_name. Change all callers.
906 (Target_selector::supported_bfd_names): Rename from
907 supported_names. Change all callers.
908 (Target_selector::recognize_by_emulation): New function.
909 (Target_selector::supported_emulations): New function.
910 (Target_selector::emulation): New function.
911 (Target_selector::do_recognize_by_bfd_name): Rename from
912 do_recognize_by_name. Change all callers.
913 (Target_selector::do_supported_bfd_names): Rename from
914 do_supported_names. Change all callers.
915 (Target_selector::do_recognize_by_emulation): New function.
916 (Target_selector::do_supported_emulations): New function.
917 (select_target_by_bfd_name): Change name in declaration.
918 (select_target_by_emulation): Declare.
919 (supported_emulation_names): Declare.
920 * parameters.cc (parameters_force_valid_target): Try to find
921 target based on emulation from -m option.
922 * options.h (class General_options): Change doc string for -m.
923 * options.cc (help): Print emulations.
924 (General_options::parse_V): Likewise.
925 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
926 Add emulation parameter. Change all callers.
927
200b2bb9
ILT
9282011-06-28 Ian Lance Taylor <iant@google.com>
929
930 * target.h (class Target): Add osabi_ field.
931 (Target::osabi): New function.
932 (Target::set_osabi): New function.
933 (Target::Target): Initialize osabi_.
934 (Target::do_adjust_elf_header): Make pure virtual.
935 (Sized_target::do_adjust_elf_header): Declare.
936 * target.cc (Sized_target::do_adjust_elf_header): New function.
937 (class Sized_target): Instantiate all versions.
938 * freebsd.h (class Target_freebsd): Remove.
939 (Target_selector_freebsd::do_recognize): Call set_osabi on
940 Target.
941 (Target_selector_freebsd::do_recognize_by_name): Likewise.
942 (Target_selector_freebsd::set_osabi): Remove.
943 * i386.cc (class Target_i386): Inherit from Sized_target rather
944 than Target_freebsd.
945 * x86_64.cc (class Target_x86_64): Likewise.
946
b3ce541e
ILT
9472011-06-28 Ian Lance Taylor <iant@google.com>
948
949 * target.h (Target::can_check_for_function_pointers): Rewrite.
950 Make non-virtual.
951 (Target::can_icf_inline_merge_sections): Likewise.
952 (Target::section_may_have_icf_unsafe_poineters): Likewise.
953 (Target::Target_info): Add can_icf_inline_merge_sections field.
954 (Target::do_can_check_for_function_pointers): New virtual
955 function.
956 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
957 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
958 from can_check_for_function_pointers, move in file.
959 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
960 section_may_have_icf_unsafe_poineters, move in file.
961 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
962 * i386.cc (Target_i386::do_can_check_for_function_pointers):
963 Rename from can_check_for_function_pointers, move in file.
964 (Target_i386::can_icf_inline_merge_sections): Remove.
965 (Target_i386::i386_info): Initialize
966 can_icf_inline_merge_sections.
967 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
968 Initialize can_icf_inline_merge_sections.
969 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
970 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
971 Rename from can_check_for_function_pointers, move in file.
972 (Target_x86_64::can_icf_inline_merge_sections): Remove.
973 (Target_x86_64::x86_64_info): Initialize
974 can_icf_inline_merge_sections.
975 * testsuite/testfile.cc (Target_test::test_target_info):
976 Likewise.
977 * icf.cc (get_section_contents): Correct formatting.
978
6d1c4efb
ILT
9792011-06-27 Ian Lance Taylor <iant@google.com>
980
981 * symtab.cc (Symbol::versioned_name): New function.
982 (Symbol_table::add_to_final_symtab): Use versioned_name when
983 appropriate.
984 (Symbol_table::sized_write_symbol): Likewise.
985 * symtab.h (class Symbol): Declare versioned_name.
986 * stringpool.h (class Stringpool_template): Add variant of add
987 which takes a std::basic_string.
988 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
989 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
990 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
991 (ver_test_12.o): New target.
992 * testsuite/Makefile.in: Rebuild.
993
57eb9b50
DK
9942011-06-27 Doug Kwan <dougkwan@google.com>
995
996 * arm.cc (Arm_relocate_functions::thm_jump8,
997 Arm_relocate_functions::thm_jump11): Use a wider signed
998 type to compute offset.
999 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1000 arm_thm_jump8.
1001 * testsuite/Makefile.in: Regenerate.
1002 * testsuite/arm_branch_in_range.sh: Check test results of
1003 arm_thm_jump11 and arm_thm_jump8.
1004 * testsuite/arm_thm_jump11.s: New test source file.
1005 * testsuite/arm_thm_jump11.t: New linker script.
1006 * testsuite/arm_thm_jump8.s: New test source file.
1007 * testsuite/arm_thm_jump8.t: New linker script.
1008
487b39df
ILT
10092011-06-24 Ian Lance Taylor <iant@google.com>
1010
1011 * layout.cc: Include "object.h".
1012 (ctors_sections_in_init_array): New static variable.
1013 (Layout::is_ctors_in_init_array): New function.
1014 (Layout::layout): Add entry to ctors_sections_in_init_array if
1015 appropriate.
1016 * layout.h (class Layout): Declare is_ctors_in_init_array.
1017 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1018 is_ctors_reverse_view is set.
1019 (Sized_relobj_file::write_sections): Add layout parameter. Change
1020 all callers. Set is_ctors_reverse_view field of View_size.
1021 (Sized_relobj_file::reverse_words): New function.
1022 * object.h (Sized_relobj_file::View_size): Add
1023 is_ctors_reverse_view field.
1024 (class Sized_relobj_file): Update declarations.
1025 * testsuite/initpri3.c: New test.
1026 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1027 initpri3b.
1028 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1029 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1030 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1031 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1032 * testsuite/Makefile.in: Rebuild.
1033
472076e4
CC
10342011-06-24 Cary Coutant <ccoutant@google.com>
1035
1036 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1037 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1038 (debug_msg_cdebug.err): New targets.
1039 * testsuite/Makefile.in: Regenerate.
1040 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1041 Fix checks for link with shared library.
1042
a60af0db
DK
10432011-06-24 Doug Kwan <dougkwan@google.com>
1044
1045 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1046 skip empty text sections.
1047 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1048
5393d741
ILT
10492011-06-22 Ian Lance Taylor <iant@google.com>
1050
1051 PR gold/12910
1052 * options.h (class General_options): Add --ctors-in-init-array.
1053 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1054 friends as SHT_PROGBITS for merging sections.
1055 (Layout::layout): Remove special handling of .init_array and
1056 friends. Don't sort if doing relocatable link. Sort for .ctors
1057 and .dtors if ctors_in_init_array.
1058 (Layout::make_output_section): Force correct section types for
1059 .init_array and friends. Don't sort if doing relocatable link,
1060 Don't sort .ctors and .dtors if ctors_in_init_array.
1061 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
1062 (Layout::output_section_name): Add relobj parameter. Change all
1063 callers. Handle .ctors. and .dtors. in code rather than table.
1064 Handle .ctors and .dtors if ctors_in_init_array.
1065 (Layout::match_file_name): New function, moved from output.cc.
1066 * layout.h (class Layout): Update declarations.
1067 * output.cc: Include "layout.h".
1068 (Input_section_sort_entry::get_priority): New function.
1069 (Input_section_sort_entry::match_file_name): Just call
1070 Layout::match_file_name.
1071 (Output_section::Input_section_sort_init_fini_compare::operator()):
1072 Handle .ctors and .dtors. Sort by explicit priority rather than
1073 by name.
1074 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
1075 * testsuite/initpri2.c: New test.
1076 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
1077 (check_PROGRAMS): Add initpri2.
1078 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
1079 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
1080 * configure, testsuite/Makefile.in: Rebuild.
1081
e1f74f98
ILT
10822011-06-19 Ian Lance Taylor <iant@google.com>
1083
1084 PR gold/12880
1085 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
1086 .interp section to a PT_INTERP segment even if we have seen a
1087 --dynamic-linker option. Don't do it if we have seen a PHDRS
1088 clause in a linker script.
1089 (Layout::finalize): Don't create a .interp section if we've
1090 already create a PT_INTERP segment.
1091 (Layout::create_interp): Always call choose_output_section (revert
1092 patch of 2011-06-17). Don't create PT_INTERP segment.
1093 * script-sections.cc
1094 (Script_sections::create_note_and_tls_segments): Add a .interp
1095 section to a PT_INTERP segment even if we have seen a
1096 --dynamic-linker option.
1097
766f91bb
ILT
10982011-06-18 Ian Lance Taylor <iant@google.com>
1099
1100 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
1101 merely because a non-PT_LOAD segment has a dynamic reloc.
1102
0d212c3a
ILT
11032011-06-18 Ian Lance Taylor <iant@google.com>
1104
1105 * layout.cc (Layout::finish_dynamic_section): Don't create
1106 DT_FLAGS entry if not needed.
1107
911a5072
ILT
11082011-06-18 Ian Lance Taylor <iant@google.com>
1109
1110 PR gold/12745
1111 * layout.cc (Layout::layout_eh_frame): Correct handling of
1112 writable .eh_frame section.
1113
534b4e5f
ILT
11142011-06-17 Ian Lance Taylor <iant@google.com>
1115
1116 PR gold/12893
1117 * resolve.cc (Symbol_table::resolve): Don't give an error if a
1118 symbol is redefined with the exact same object and value.
1119
10b4f102
ILT
11202011-06-17 Ian Lance Taylor <iant@google.com>
1121
1122 PR gold/12880
1123 * layout.h (class Layout): Add interp_segment_ field.
1124 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
1125 (Layout::attach_allocated_section_to_segment): If making shared
1126 library, put .interp section in PT_INTERP segment.
1127 (Layout::finalize): Also call create_interp if -dynamic-linker
1128 option was used.
1129 (Layout::create_interp): Assert that there is no PT_INTERP
1130 segment. If not using a SECTIONS clause, use make_output_section.
1131 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
1132 * script-sections.cc
1133 (Script_sections::create_note_and_tls_segments): If making shared
1134 library, put .interp section in PT_INTERP segment.
1135
a29b0dad
ILT
11362011-06-17 Ian Lance Taylor <iant@google.com>
1137
e588ea8d
ILT
1138 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
1139 when making a shared library.
1140
11412011-06-17 Ian Lance Taylor <iant@google.com>
1142
1143 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
1144 parameter. Change all callers. Don't issue warning about PC32
1145 against locally defined symbol.
a29b0dad 1146
9d3b0698
ILT
11472011-06-16 Ian Lance Taylor <iant@google.com>
1148
1149 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
1150 occurs in same object.
1151
85b0f90c
AM
11522011-06-14 Alan Modra <amodra@gmail.com>
1153
1154 * po/POTFILES.in: Regenerate.
1155
a94907d9
ILT
11562011-06-09 Ian Lance Taylor <iant@google.com>
1157
1158 * script-sections.cc
1159 (Orphan_output_section::set_section_addresses): For a relocatable
1160 link set address to 0.
1161
4fb3a1c3
CC
11622011-06-09 Cary Coutant <ccoutant@google.com>
1163
1164 PR gold/12804
1165 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1166 used with --compress-debug-sections.
1167 * gold/object.cc (Sized_relobj_file::do_layout): Report
1168 uncompressed size of compressed input sections.
1169
61220854
CC
11702011-06-08 Cary Coutant <ccoutant@google.com>
1171
1172 PR gold/12804
1173 * testsuite/two_file_test_2_v1.cc: Change initialization of
1174 v2 to keep it in .data.
1175
e6455dfb
CC
11762011-06-07 Cary Coutant <ccoutant@google.com>
1177
1178 * common.cc (Symbol_table::do_allocate_commons_list): Call
1179 gold_fallback.
1180 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1181 (Errors::fallback): New function.
1182 (gold_fallback): New function.
1183 * errors.h (Errors::fallback): New function.
1184 * gold.cc (gold_exit): Change status parameter to enum; adjust
1185 all callers.
1186 (queue_initial_tasks): Call gold_fallback.
1187 * gold.h: Include cstdlib.
1188 (Exit_status): New enum type.
1189 (gold_exit): Change status parameter to enum.
1190 (gold_fallback): New function.
1191 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1192 (Layout::create_symtab_sections): Likewise.
1193 (Layout::create_shdrs): Likewise.
1194 * main.cc (main): Adjust call to gold_exit.
1195 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1196 (Output_data_got::add_got_entry_pair): Likewise.
1197 (Output_section::add_input_section): Likewise.
1198 (Output_section::add_output_section_data): Likewise.
1199 (Output_segment::set_section_list_addresses): Likewise.
1200 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1201
fb0e076f
CC
12022011-06-07 Cary Coutant <ccoutant@google.com>
1203
1204 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1205 for incremental links.
1206 * output.cc (Output_segment::set_section_list_addresses): Remove
1207 FIXME and test for TLS or BSS.
1208
a5ee4d5d
CC
12092011-06-07 Cary Coutant <ccoutant@google.com>
1210
1211 * testsuite/Makefile.am: Add incremental_copy_test,
1212 incremental_common_test_1.
1213 * testsuite/Makefile.in: Regenerate.
1214 * testsuite/common_test_1_v1.c: New source file.
1215 * testsuite/common_test_1_v2.c: New source file.
1216 * testsuite/copy_test_v1.cc: New source file.
1217
5146f448
CC
12182011-06-07 Cary Coutant <ccoutant@google.com>
1219
1220 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1221 update, allocate common from bss section's free list.
1222 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1223 linker-defined symbols.
1224 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1225 Skip GOT and PLT entries that are no longer referenced.
1226 (Output_section_incremental_inputs::write_info_blocks): Mark
1227 linker-defined symbols.
1228 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1229 * output.cc (Output_section::allocate): New function.
1230 * output.h (Output_section::allocate): New function.
1231 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1232 linker-defined symbols.
1233 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1234 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1235 (Symbol::init_base_output_data): Likewise.
1236 (Symbol::init_base_output_segment): Likewise.
1237 (Symbol::init_base_constant): Likewise.
1238 (Sized_symbol::init_output_data): Likewise.
1239 (Sized_symbol::init_output_segment): Likewise.
1240 (Sized_symbol::init_constant): Likewise.
1241 (Symbol_table::do_define_in_output_data): Likewise.
1242 (Symbol_table::do_define_in_output_segment): Likewise.
1243 (Symbol_table::do_define_as_constant): Likewise.
1244 * symtab.h (Symbol::is_predefined): New function.
1245 (Symbol::init_base_output_data): Add is_predefined parameter.
1246 (Symbol::init_base_output_segment): Likewise.
1247 (Symbol::init_base_constant): Likewise.
1248 (Symbol::is_predefined_): New data member.
1249 (Sized_symbol::init_output_data): Add is_predefined parameter.
1250 (Sized_symbol::init_output_segment): Likewise.
1251 (Sized_symbol::init_constant): Likewise.
1252 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1253
26d3c67d
CC
12542011-06-07 Cary Coutant <ccoutant@google.com>
1255
1256 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1257 instead of emit_copy_reloc.
1258 (Copy_relocs::emit_copy_reloc): Refactor.
1259 (Copy_relocs::make_copy_reloc): New function.
1260 (Copy_relocs::add_copy_reloc): Remove.
1261 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1262 section.
1263 (Copy_relocs::make_copy_reloc): New function.
1264 (Copy_relocs::add_copy_reloc): Remove.
1265 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1266 unchanged input files.
1267 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1268 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1269 Reserve BSS space for COPY relocations.
1270 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1271 (Output_section_incremental_inputs::write_info_blocks): Record
1272 whether a symbol is copied from a shared object.
1273 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1274 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1275 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1276 (Incremental_input_entry_reader::get_output_symbol_index): Add
1277 is_copy parameter.
1278 (Incremental_binary::emit_copy_relocs): New function.
1279 (Incremental_binary::do_emit_copy_relocs): New function.
1280 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1281 new data member.
1282 (Sized_incremental_binary::add_copy_reloc): New function.
1283 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1284 (Sized_incremental_binary::Copy_reloc): New struct.
1285 (Sized_incremental_binary::Copy_relocs): New typedef.
1286 (Sized_incremental_binary::copy_relocs_): New data member.
1287 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1288 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1289 * target.h (Sized_target::emit_copy_reloc): New function.
1290 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1291
7cdb37d9
CC
12922011-06-02 Cary Coutant <ccoutant@google.com>
1293
1294 PR gold/12163
1295 * gold/archive.cc (Archive::Archive): Initialize new data member.
1296 (Archive::include_all_members): Return if archive has already been
1297 included.
1298 * gold/archive.h (Archive::include_all_members_): New data member.
1299
cc643b88
NC
13002011-06-02 Nick Clifton <nickc@redhat.com>
1301
1302 * dynobj.h: Fix spelling mistake in comment.
1303 * output.cc: Likewise.
1304
f62a3ca7
DK
13052011-05-31 Doug Kwan <dougkwan@google.com>
1306 Asier Llano
1307
1308 PR gold/12826
cc643b88 1309 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1310 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1311 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1312 redundant arm_exidx_test.so.
1313 * testsuite/Makefile.in: Regenerate.
1314 (check_SCRIPTS): Add pr12826.sh
1315 (check_DATA): Add pr12826.stdout
1316 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1317 * testsuite/pr12826.sh: New file.
1318 * testsuite/pr12826_1.s: Ditto.
1319 * testsuite/pr12826_1.s: Ditto.
1320
8dbe1edc
ILT
13212011-05-30 Ian Lance Taylor <iant@google.com>
1322
1323 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1324 sections.
1325
c49875be
ILT
13262011-05-29 Ian Lance Taylor <iant@google.com>
1327
1328 PR gold/12804
1329 * testsuite/Makefile.am: Use different file name for two_file_test
1330 temporary file for each incremental test.
1331 * testsuite/Makefile.in: Rebuild.
1332
69d53f7a
ILT
13332011-05-29 Ian Lance Taylor <iant@google.com>
1334
1335 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1336 binary input file is empty.
1337
41d0ab5f
ILT
13382011-05-27 Ian Lance Taylor <iant@google.com>
1339
1340 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1341 (ver_test_9.so): Likewise.
1342 * testsuite/Makefile.in: Rebuild.
1343
89d8a36b
CC
13442011-05-26 Cary Coutant <ccoutant@google.com>
1345
1346 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1347 * incremental.cc (Incremental_inputs::report_input_section): Fix
1348 comment, indentation.
1349 (Incremental_inputs::report_comdat_group): New function.
1350 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1351 of data for incremental input file entry.
1352 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1353 group count, COMDAT group signatures.
1354 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1355 an unchanged input file.
1356 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1357 Initialize new data member.
1358 (Incremental_object_entry::add_comdat_group): New function.
1359 (Incremental_object_entry::get_comdat_group_count): New function.
1360 (Incremental_object_entry::get_comdat_signature_key): New function.
1361 (Incremental_object_entry::groups_): New data member.
1362 (Incremental_inputs::report_comdat_group): New function.
1363 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1364 data for incremental input file entry.
1365 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1366 (Incremental_input_entry_reader::get_input_section): Adjust size of
1367 data for incremental input file entry.
1368 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1369 (Incremental_input_entry_reader::get_comdat_group_signature): New
1370 function.
1371 * object.cc (Sized_relobj::include_section_group): Report kept
1372 COMDAT groups for incremental links.
1373
1706a06f
ILT
13742011-05-24 David Meyer <pdox@google.com>
1375
1376 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1377 with name parameter. Add found_name parameter.
1378 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1379 * dirsearch.h (class Dirsearch): Update declaration.
1380
a10ae760
ILT
13812011-05-24 Ian Lance Taylor <iant@google.com>
1382
1383 * archive.cc (Library_base::should_include_member): Pull in object
1384 from archive if it defines the entry symbol.
1385 * parameters.cc (Parameters::entry): New function.
1386 * parameters.h (class Parameters): Declare entry.
1387 * output.h (class Output_file_header): Remove entry_ field.
1388 * output.cc (Output_file_header::Output_file_header): Remove entry
1389 parameter. Change all callers.
1390 (Output_file_header::entry): Use parameters->entry.
1391 * gold.cc (queue_middle_tasks): Likewise.
1392 * plugin.cc (Plugin_hook::run): Likewise.
1393
aa92d6ed
CC
13942011-05-24 Cary Coutant <ccoutant@google.com>
1395
1396 * gold.cc (queue_initial_tasks): Pass incremental base filename
1397 to Output_file::open_base_file; don't print error message.
1398 * incremental-dump.cc (main): Adjust call to
1399 Output_file::open_for_modification.
1400 * incremental-dump.cc (main): Likewise.
1401 * incremental.cc (Incremental_inputs::report_command_line):
1402 Ignore --incremental-base option when comparing command lines.
1403 Ignore parameter when given as separate argument.
1404 * options.h (class General_options): Add --incremental-base.
1405 * output.cc (Output_file::Output_file):
1406 (Output_file::open_base_file): Add base_name and writable parameters;
1407 read base file into new file; print error message here.
1408 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1409 callers.
1410 * output.h (Output_file::open_for_modification): Rename to...
1411 (Output_file::open_base_file): ...this; add base_name and
1412 writable parameters; adjust all callers.
1413 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1414 callers.
1415 * testsuite/Makefile.am (incremental_test_4): Test
1416 --incremental-base.
1417 * testsuite/Makefile.in: Regenerate.
1418
2eedd706
CC
14192011-05-24 Cary Coutant <ccoutant@google.com>
1420
1421 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1422 incremental_test_4.
1423 * testsuite/Makefile.in: Regenerate.
1424 * testsuite/two_file_test_1_v1.cc: New test source file.
1425 * testsuite/two_file_test_1b_v1.cc: New test source file.
1426 * testsuite/two_file_test_2_v1.cc: New test source file.
1427
0f1c85a6
CC
14282011-05-24 Cary Coutant <ccoutant@google.com>
1429
1430 * dynobj.h (Dynobj::do_dynobj): New function.
1431 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1432 flag and soname for shared objects.
1433 * incremental.cc (Incremental_inputs::report_object): Make
1434 either Incremental_object_entry or Incremental_dynobj_entry; add
1435 soname to string table.
1436 (Incremental_inputs::report_input_section): Add assertion.
1437 (Output_section_incremental_inputs::set_final_data_size): Adjust
1438 type of input file entry for shared libraries; adjust size of
1439 shared library info entry.
1440 (Output_section_incremental_inputs::write_input_files): Write
1441 as_needed flag for shared libraries.
1442 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1443 of input file entry for shared libraries; write soname.
1444 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1445 soname from incremental info.
1446 * incremental.h (enum Incremental_input_flags): Add
1447 INCREMENTAL_INPUT_AS_NEEDED.
1448 (Incremental_input_entry::Incremental_input_entry): Initialize new
1449 data member.
1450 (Incremental_input_entry::set_as_needed): New function.
1451 (Incremental_input_entry::as_needed): New function.
1452 (Incremental_input_entry::do_dynobj_entry): New function.
1453 (Incremental_input_entry::as_needed_): New data member.
1454 (Incremental_object_entry::Incremental_object_entry): Don't check
1455 for shared library.
1456 (Incremental_object_entry::do_type): Likewise.
1457 (class Incremental_dynobj_entry): New class.
1458 (Incremental_input_entry_reader::as_needed): New function.
1459 (Incremental_input_entry_reader::get_soname): New function.
1460 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1461 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1462 size of shared library info entry.
1463 * layout.cc (Layout::finish_dynamic_section): Don't test for
1464 incremental link when adding DT_NEEDED entries.
1465 * object.h (Object::Object): Initialize new data member.
1466 (Object::dynobj): New function.
1467 (Object::set_as_needed): New function.
1468 (Object::as_needed): New function.
1469 (Object::do_dynobj): New function.
1470 (Object::as_needed_): New data member.
1471
6fa2a40b
CC
14722011-05-24 Cary Coutant <ccoutant@google.com>
1473
1474 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1475 info; adjust display of GOT entries.
1476 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1477 vector of input objects; remove file_status_.
1478 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1479 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1480 got_plt reader; call target hooks to reserve GOT entries.
1481 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1482 of input file info header and GOT info entry.
1483 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1484 relocation info.
1485 (Got_plt_view_info::got_descriptor): Remove.
1486 (Got_plt_view_info::sym_index): New data member.
1487 (Got_plt_view_info::input_index): New data member.
1488 (Local_got_offset_visitor::visit): Write input file index.
1489 (Global_got_offset_visitor::visit): Write 0 for input file index.
1490 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1491 with sym_index and input_index.
1492 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1493 incremental info GOT entry; replace got_descriptor with input_index.
1494 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1495 map from input file index to object.
1496 (Sized_relobj_incr::do_layout): Replace direct data member reference
1497 with accessor function.
1498 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1499 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1500 Adjust size of input file info header.
1501 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1502 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1503 (Incremental_input_entry_reader::get_input_section): Adjust size of
1504 input file info header.
1505 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1506 of incremental info GOT entry.
1507 (Incremental_got_plt_reader::get_got_desc): Remove.
1508 (Incremental_got_plt_reader::get_got_symndx): New function.
1509 (Incremental_got_plt_reader::get_got_input_index): New function.
1510 (Sized_incremental_binary::Sized_incremental_binary): Remove
1511 file_status_; add input_objects_.
1512 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1513 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1514 (Sized_incremental_binary::file_is_unchanged): Remove.
1515 (Sized_incremental_binary::set_input_object): New function.
1516 (Sized_incremental_binary::input_object): New function.
1517 (Sized_incremental_binary::file_status_): Remove.
1518 (Sized_incremental_binary::input_objects_): New data member.
1519 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1520 references.
1521 (Sized_relobj_incr::invalid_address): Move to base class.
1522 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1523 class.
1524 (Sized_relobj_incr::do_output_section_offset): Likewise.
1525 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1526 (Sized_relobj_incr::section_offsets_): Likewise.
1527 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1528 function.
1529 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1530 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1531 with accessor function.
1532 (Sized_relobj_file::do_layout): Likewise.
1533 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1534 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1535 (Sized_relobj_file::compute_final_local_value): Replace refs to
1536 section_offsets_ with accessor function.
1537 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1538 * object.h (Relobj::Relobj): Initialize new data members.
1539 (Relobj::add_dyn_reloc): New function.
1540 (Relobj::first_dyn_reloc): New function.
1541 (Relobj::dyn_reloc_count): New function.
1542 (Relobj::first_dyn_reloc_): New data member.
1543 (Relobj::dyn_reloc_count_): New data member.
1544 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1545 references.
1546 (Sized_relobj::Address): New typedef.
1547 (Sized_relobj::invalid_address): Move here from child class.
1548 (Sized_relobj::Sized_relobj): Initialize new data members.
1549 (Sized_relobj::sized_relobj): New function.
1550 (Sized_relobj::is_output_section_offset_invalid): Move here from
1551 child class.
1552 (Sized_relobj::get_output_section_offset): Likewise.
1553 (Sized_relobj::local_has_got_offset): Likewise.
1554 (Sized_relobj::local_got_offset): Likewise.
1555 (Sized_relobj::set_local_got_offset): Likewise.
1556 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1557 (Sized_relobj::clear_got_offsets): New function.
1558 (Sized_relobj::section_offsets): Move here from child class.
1559 (Sized_relobj::do_output_section_offset): Likewise.
1560 (Sized_relobj::do_set_section_offset): Likewise.
1561 (Sized_relobj::Local_got_offsets): Likewise.
1562 (Sized_relobj::local_got_offsets_): Likewise.
1563 (Sized_relobj::section_offsets_): Likewise.
1564 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1565 references.
1566 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1567 class.
1568 (Sized_relobj_file::sized_relobj): New function
1569 (Sized_relobj_file::local_has_got_offset): Move to base class.
1570 (Sized_relobj_file::local_got_offset): Likewise.
1571 (Sized_relobj_file::set_local_got_offset): Likewise.
1572 (Sized_relobj_file::get_output_section_offset): Likewise.
1573 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1574 (Sized_relobj_file::do_output_section_offset): Likewise.
1575 (Sized_relobj_file::do_set_section_offset): Likewise.
1576 (Sized_relobj_file::Local_got_offsets): Likewise.
1577 (Sized_relobj_file::local_got_offsets_): Likewise.
1578 (Sized_relobj_file::section_offsets_): Likewise.
1579 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1580 (all constructors).
1581 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1582 (Output_reloc::get_symbol_index): Likewise.
1583 (Output_reloc::local_section_offset): Likewise.
1584 (Output_reloc::get_address): Likewise.
1585 (Output_reloc::symbol_value): Likewise.
1586 (Output_data_got::reserve_slot): Move to class definition.
1587 (Output_data_got::reserve_local): New function.
1588 (Output_data_got::reserve_slot_for_global): Remove.
1589 (Output_data_got::reserve_global): New function.
1590 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1591 (all constructors, two instantiations).
1592 (Output_reloc::get_relobj): New function (two instantiations).
1593 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1594 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1595 (Output_data_reloc::add_global): Adjust type of relobj.
1596 (Output_data_reloc::add_global_relative): Likewise.
1597 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1598 (Output_data_reloc::add_local): Likewise.
1599 (Output_data_reloc::add_local_relative): Likewise.
1600 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1601 (Output_data_reloc::add_local_section): Likewise.
1602 (Output_data_reloc::add_output_section): Likewise.
1603 (Output_data_reloc::add_absolute): Likewise.
1604 (Output_data_reloc::add_target_specific): Likewise.
1605 (Output_data_got::reserve_slot): Move definition here.
1606 (Output_data_got::reserve_local): New function.
1607 (Output_data_got::reserve_global): New function.
1608 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1609 section_offsets_ with accessor function.
1610 (Sized_relobj_file::write_sections): Likewise.
1611 (Sized_relobj_file::do_relocate_sections): Likewise.
1612 * target.h (Sized_target::reserve_local_got_entry): New function.
1613 (Sized_target::reserve_global_got_entry): New function.
1614 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1615 (Target_x86_64::reserve_global_got_entry): New function.
1616 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1617
4829d394
CC
16182011-05-23 Cary Coutant <ccoutant@google.com>
1619
1620 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1621 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1622 bit when checking got_type.
1623 * incremental.cc (Sized_incremental_binary::setup_readers):
1624 Store symbol table and string table locations; initialize bit vector
1625 of file status flags.
1626 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1627 unchanged files.
1628 (Sized_incremental_binary::do_process_got_plt): New function.
1629 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1630 (Output_section_incremental_inputs::set_final_data_size): Record
1631 file index for each input file.
1632 (Output_section_incremental_inputs::write_got_plt): Store file index
1633 instead of input entry offset for each GOT entry.
1634 * incremental.h
1635 (Incremental_input_entry::Incremental_input_entry): Initialize new
1636 data member.
1637 (Incremental_input_entry::set_offset): Store file index.
1638 (Incremental_input_entry::get_file_index): New function.
1639 (Incremental_input_entry::file_index_): New data member.
1640 (Incremental_binary::process_got_plt): New function.
1641 (Incremental_binary::do_process_got_plt): New function.
1642 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1643 data members.
1644 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1645 (Sized_incremental_binary::set_file_is_unchanged): New function.
1646 (Sized_incremental_binary::file_is_unchanged): New function.
1647 (Sized_incremental_binary::do_process_got_plt): New function.
1648 (Sized_incremental_binary::file_status_): New data member.
1649 (Sized_incremental_binary::main_symtab_loc_): New data member.
1650 (Sized_incremental_binary::main_strtab_loc_): New data member.
1651 * output.cc (Output_data_got::Got_entry::write): Add case
1652 RESERVED_CODE.
1653 (Output_data_got::add_global): Call add_got_entry.
1654 (Output_data_got::add_global_plt): Likewise.
1655 (Output_data_got::add_global_with_rel): Likewise.
1656 (Output_data_got::add_global_with_rela): Likewise.
1657 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1658 (Output_data_got::add_global_pair_with_rela): Likewise.
1659 (Output_data_got::add_local): Call add_got_entry.
1660 (Output_data_got::add_local_plt): Likewise.
1661 (Output_data_got::add_local_with_rel): Likewise.
1662 (Output_data_got::add_local_with_rela): Likewise.
1663 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1664 (Output_data_got::add_local_pair_with_rela): Likewise.
1665 (Output_data_got::reserve_slot): New function.
1666 (Output_data_got::reserve_slot_for_global): New function.
1667 (Output_data_got::add_got_entry): New function.
1668 (Output_data_got::add_got_entry_pair): New function.
1669 (Output_section::add_output_section_data): Edit FIXME.
1670 * output.h
1671 (Output_section_data_build::Output_section_data_build): New
1672 constructor with size parameter.
1673 (Output_data_space::Output_data_space): Likewise.
1674 (Output_data_got::Output_data_got): Initialize new data member; new
1675 constructor with size parameter.
1676 (Output_data_got::add_constant): Call add_got_entry.
1677 (Output_data_got::reserve_slot): New function.
1678 (Output_data_got::reserve_slot_for_global): New function.
1679 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1680 (Output_data_got::add_got_entry): New function.
1681 (Output_data_got::add_got_entry_pair): New function.
1682 (Output_data_got::free_list_): New data member.
1683 * target.h (Sized_target::init_got_plt_for_update): New function.
1684 (Sized_target::register_global_plt_entry): New function.
1685 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1686 Initialize new data member; call init; add constructor with PLT count.
1687 (Output_data_plt_x86_64::init): New function.
1688 (Output_data_plt_x86_64::add_relocation): New function.
1689 (Output_data_plt_x86_64::reserve_slot): New function.
1690 (Output_data_plt_x86_64::free_list_): New data member.
1691 (Target_x86_64::init_got_plt_for_update): New function.
1692 (Target_x86_64::register_global_plt_entry): New function.
1693 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1694 incremental updates.
1695 (Output_data_plt_x86_64::add_relocation): New function.
1696 * testsuite/object_unittest.cc (Object_test): Set default options.
1697
ec69d6da
ILT
16982011-05-16 Ian Lance Taylor <iant@google.com>
1699
1700 * options.h (class General_options): Make -i a synonym for -r.
1701
732e31de
ILT
17022011-05-16 Ian Lance Taylor <iant@google.com>
1703
1704 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1705
403676b5
CC
17062011-05-10 Cary Coutant <ccoutant@google.com>
1707
1708 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1709 strip_all (-s).
1710
5b7b7d6e
ILT
17112011-05-06 Ian Lance Taylor <iant@google.com>
1712
1713 * layout.cc (Layout::layout): If the output section flags change,
1714 update the ordering.
1715
f0f9babf
CC
17162011-04-25 Cary Coutant <ccoutant@google.com>
1717
1718 * incremental-dump.cc (dump_incremental_inputs): Print local
1719 symbol info for each input file.
1720 * incremental.cc
1721 (Output_section_incremental_inputs::set_final_data_size): Add local
1722 symbol info to input file entries in incremental info.
1723 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1724 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1725 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1726 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1727 implementation.
1728 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1729 (Sized_incr_relobj::do_relocate): Write the local symbols.
1730 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1731 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1732 Adjust size of input file header.
1733 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1734 (Incremental_inputs_reader::get_local_symbol_count): New function.
1735 (Incremental_inputs_reader::get_input_section): Adjust size of input
1736 file header.
1737 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1738 (Sized_incr_relobj::This): New typedef.
1739 (Sized_incr_relobj::sym_size): New const data member.
1740 (Sized_incr_relobj::Local_symbol): New struct.
1741 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1742 (Sized_incr_relobj::do_local_symbol_offset): New function.
1743 (Sized_incr_relobj::local_symbol_count_): New data member.
1744 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1745 (Sized_incr_relobj::local_symbol_index_): New data member.
1746 (Sized_incr_relobj::local_symbol_offset_): New data member.
1747 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1748 (Sized_incr_relobj::local_symbols_): New data member.
1749 * object.h (Relobj::output_local_symbol_count): New function.
1750 (Relobj::local_symbol_offset): New function.
1751 (Relobj::do_output_local_symbol_count): New function.
1752 (Relobj::do_local_symbol_offset): New function.
1753 (Sized_relobj::do_output_local_symbol_count): New function.
1754 (Sized_relobj::do_local_symbol_offset): New function.
1755
d0a9ace3
ILT
17562011-04-22 Vladimir Simonov <sv@sw.ru>
1757
1758 * descriptors.cc (set_close_on_exec): New function.
1759 (Descriptors::open): Use set_close_on_exec.
1760 * output.cc (S_ISLNK): Define if not defined.
1761
94a3fc8b
CC
17622011-04-22 Cary Coutant <ccoutant@google.com>
1763
1764 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1765 global symbol map.
1766 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1767 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1768 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1769 relocations.
1770 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1771 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1772 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1773 * incremental.h
1774 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1775 function.
1776 (Incremental_binary::apply_incremental_relocs): New function.
1777 (Incremental_binary::do_apply_incremental_relocs): New function.
1778 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1779 data member.
1780 (Sized_incremental_binary::add_global_symbol): New function.
1781 (Sized_incremental_binary::global_symbol): New function.
1782 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1783 (Sized_incremental_binary::symbol_map_): New data member.
1784 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1785 * target.h (Sized_target::apply_relocation): New function.
1786 * target-reloc.h (apply_relocation): New function.
1787 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1788
c87e4302
DK
17892011-04-22 Doug Kwan <dougkwan@google.com>
1790
1791 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1792 flag of a SHT_ARM_EXIDX section.
1793 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1794 * testsuite/Makefile.in: Regenerate.
1795 * testsuite/arm_exidx_test.s: New file.
1796 * testsuite/arm_exidx_test.sh: Same.
1797
e7782cf6
CC
17982011-04-20 Cary Coutant <ccoutant@google.com>
1799
1800 PR gold/12689
1801 * archive.h (Incremental_archive_entry::Archive_member):
1802 Initialize arg_serial_ (second constructor).
1803
308ecdc7
ILT
18042011-04-17 Ian Lance Taylor <iant@google.com>
1805
1806 * object.cc (Relocate_info::location): Simplify location string.
1807 * errors.cc (Errors::error_at_location): Don't print program
1808 name.
1809 (Errors::warning_at_location): Likewise.
1810 (Errors::undefined_symbol): Likewise.
1811 * testsuite/debug_msg.sh: Update accordingly.
1812
bec5b579
CC
18132011-04-14 Cary Coutant <ccoutant@google.com>
1814
1815 * gold/layout.cc (Layout::symtab_section_offset): New function.
1816 * gold/layout.h (Layout::symtab_section_offset): New function.
1817 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1818
88597d34
ILT
18192011-04-12 Ian Lance Taylor <iant@google.com>
1820
1821 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1822 with MREMAP_MAYMOVE.
1823 * output.h (class Output_file): Add map_is_allocated_ field.
1824 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1825 not available, provide stubs. If mremap is not available, #define
1826 it to gold_mremap.
1827 (MREMAP_MAYMOVE): Define if not defined.
1828 (Output_file::Output_file): Initialize map_is_allocated_.
1829 (Output_file::resize): Check map_is_allocated_.
1830 (Output_file::map_anonymous): If mmap fails, use malloc.
1831 (Output_file::unmap): Don't do anything for an anonymous map.
1832 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1833 is not available, provide stubs.
1834 (File_read::View::~View): Use free rather than delete[].
1835 (File_read::make_view): Use malloc rather than new[]. If mmap
1836 fails, use malloc.
1837 (File_read::find_or_make_view): Use malloc rather than new[].
1838 * gold.h: Remove HAVE_REMAP code.
1839 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1840 exists. Rename mremap to gold_mremap. If mmap is not available
1841 don't do anything.
1842 * configure, config.in: Rebuild.
1843
11e361bc
ILT
18442011-04-11 Ian Lance Taylor <iant@google.com>
1845
1846 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1847 initialize local variable v.
1848
cdc29364
CC
18492011-04-11 Cary Coutant <ccoutant@google.com>
1850
1851 * archive.cc (Archive::include_member): Adjust call to
1852 report_object.
1853 (Add_archive_symbols::run): Track argument serial numbers.
1854 (Lib_group::include_member): Likewise.
1855 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1856 * archive.h (Incremental_archive_entry::Archive_member):
1857 Initialize arg_serial_.
1858 (Archive_member::arg_serial_): New data member.
1859 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1860 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1861 incremental link.
1862 (Sized_dynobj::do_for_all_local_got_entries): New function.
1863 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1864 function.
1865 * fileread.cc (get_mtime): New function.
1866 * fileread.h (get_mtime): New function.
1867 * gold.cc (queue_initial_tasks): Check for incremental update.
1868 (process_incremental_input): New function.
1869 (queue_middle_tasks): Don't force valid target for incremental
1870 update.
1871 * incremental-dump.cc (find_input_containing_global): Adjust
1872 size of symbol info entry.
1873 (dump_incremental_inputs): Dump argument serial number and
1874 in_system_directory flag; bias shndx by 1; print symbol names
1875 when dumping per-file symbol lists; use new symbol info readers.
1876 * incremental.cc
1877 (Output_section_incremental_inputs:update_data_size): New function.
1878 (Sized_incremental_binary::setup_readers): Setup input readers
1879 for each input file; build maps for files added from libraries
1880 and scripts.
1881 (Sized_incremental_binary::check_input_args): New function.
1882 (Sized_incremental_binary::do_check_inputs): Build map of argument
1883 serial numbers to input arguments.
1884 (Sized_incremental_binary::do_file_has_changed): Rename
1885 do_file_is_unchanged to this; compare file modification times.
1886 (Sized_incremental_binary::do_init_layout): New function.
1887 (Sized_incremental_binary::do_reserve_layout): New function.
1888 (Sized_incremental_binary::do_get_input_reader): Remove.
1889 (Sized_incremental_binary::get_symtab_view): New function.
1890 (Incremental_checker::can_incrementally_link_output_file): Remove.
1891 (Incremental_inputs::report_command_line): Exclude --debug options.
1892 (Incremental_inputs::report_archive_begin): Add parameter; track
1893 argument serial numbers; don't put input file entry for archive
1894 before archive members.
1895 (Incremental_inputs::report_archive_end): Put input file entry
1896 for archive after archive members.
1897 (Incremental_inputs::report_object): Add parameter; track argument
1898 serial numbers and in_system_directory flag.
1899 (Incremental_inputs::report_script): Add parameter; track argument
1900 serial numbers.
1901 (Output_section_incremental_inputs::set_final_data_size): Adjust
1902 size of symbol info entry; check for forwarding symbols.
1903 (Output_section_incremental_inputs::write_input_files): Write
1904 in_system_directory flag and argument serial number.
1905 (Output_section_incremental_inputs::write_info_blocks): Map section
1906 indices between incremental info and original input file; store
1907 input section index for each symbol.
1908 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1909 change operator() to visit().
1910 (class Global_got_offset_visitor): Likewise.
1911 (class Global_symbol_visitor_got_plt):
1912 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1913 classes.
1914 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1915 (Sized_incr_relobj::do_read_symbols): New function.
1916 (Sized_incr_relobj::do_layout): New function.
1917 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1918 (Sized_incr_relobj::do_add_symbols): New function.
1919 (Sized_incr_relobj::do_should_include_member): New function.
1920 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1921 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1922 (Sized_incr_relobj::do_section_size): New function.
1923 (Sized_incr_relobj::do_section_name): New function.
1924 (Sized_incr_relobj::do_section_contents): New function.
1925 (Sized_incr_relobj::do_section_flags): New function.
1926 (Sized_incr_relobj::do_section_entsize): New function.
1927 (Sized_incr_relobj::do_section_address): New function.
1928 (Sized_incr_relobj::do_section_type): New function.
1929 (Sized_incr_relobj::do_section_link): New function.
1930 (Sized_incr_relobj::do_section_info): New function.
1931 (Sized_incr_relobj::do_section_addralign): New function.
1932 (Sized_incr_relobj::do_initialize_xindex): New function.
1933 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1934 (Sized_incr_relobj::do_read_relocs): New function.
1935 (Sized_incr_relobj::do_gc_process_relocs): New function.
1936 (Sized_incr_relobj::do_scan_relocs): New function.
1937 (Sized_incr_relobj::do_count_local_symbols): New function.
1938 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1939 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1940 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1941 (Sized_incr_relobj::do_relocate): New function.
1942 (Sized_incr_relobj::do_set_section_offset): New function.
1943 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1944 (Sized_incr_dynobj::do_read_symbols): New function.
1945 (Sized_incr_dynobj::do_layout): New function.
1946 (Sized_incr_dynobj::do_add_symbols): New function.
1947 (Sized_incr_dynobj::do_should_include_member): New function.
1948 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1949 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1950 (Sized_incr_dynobj::do_section_size): New function.
1951 (Sized_incr_dynobj::do_section_name): New function.
1952 (Sized_incr_dynobj::do_section_contents): New function.
1953 (Sized_incr_dynobj::do_section_flags): New function.
1954 (Sized_incr_dynobj::do_section_entsize): New function.
1955 (Sized_incr_dynobj::do_section_address): New function.
1956 (Sized_incr_dynobj::do_section_type): New function.
1957 (Sized_incr_dynobj::do_section_link): New function.
1958 (Sized_incr_dynobj::do_section_info): New function.
1959 (Sized_incr_dynobj::do_section_addralign): New function.
1960 (Sized_incr_dynobj::do_initialize_xindex): New function.
1961 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1962 (make_sized_incremental_object): New function.
1963 (Incremental_library::copy_unused_symbols): New function.
1964 (Incremental_library::do_for_all_unused_symbols): New function.
1965 * incremental.h (enum Incremental_input_flags): New type.
1966 (class Incremental_checker): Remove.
1967 (Incremental_input_entry::Incremental_input_entry): Add argument
1968 serial number.
1969 (Incremental_input_entry::arg_serial): New function.
1970 (Incremental_input_entry::set_is_in_system_directory): New function.
1971 (Incremental_input_entry::is_in_system_directory): New function.
1972 (Incremental_input_entry::arg_serial_): New data member.
1973 (Incremental_input_entry::is_in_system_directory_): New data member.
1974 (class Script_info): Move here from script.h.
1975 (Script_info::Script_info): Add filename parameter.
1976 (Script_info::filename): New function.
1977 (Script_info::filename_): New data member.
1978 (Incremental_script_entry::Incremental_script_entry): Add argument
1979 serial number.
1980 (Incremental_object_entry::Incremental_object_entry): Likewise.
1981 (Incremental_object_entry::add_input_section): Build list of input
1982 sections with map to original shndx.
1983 (Incremental_object_entry::get_input_section_index): New function.
1984 (Incremental_object_entry::shndx_): New data member.
1985 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1986 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1987 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1988 serial number.
1989 (Incremental_inputs::report_archive_begin): Likewise.
1990 (Incremental_inputs::report_object): Likewise.
1991 (Incremental_inputs::report_script): Likewise.
1992 (class Incremental_global_symbol_reader): New class.
1993 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1994 and store flags and input file type.
1995 (Incremental_input_entry_reader::arg_serial): New function.
1996 (Incremental_input_entry_reader::type): Extract type from flags.
1997 (Incremental_input_entry_reader::is_in_system_directory): New function.
1998 (Incremental_input_entry_reader::get_input_section_count): Call
1999 accessor function for type.
2000 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2001 function for type; adjust size of global symbol entry.
2002 (Incremental_input_entry_reader::get_global_symbol_count): Call
2003 accessor function for type.
2004 (Incremental_input_entry_reader::get_object_count): Likewise.
2005 (Incremental_input_entry_reader::get_object_offset): Likewise.
2006 (Incremental_input_entry_reader::get_member_count): Likewise.
2007 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2008 (Incremental_input_entry_reader::get_member_offset): Likewise.
2009 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2010 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2011 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2012 (Incremental_input_entry_reader::get_global_symbol_reader): New
2013 function.
2014 (Incremental_input_entry_reader::get_output_symbol_index): New
2015 function.
2016 (Incremental_input_entry_reader::type_): Remove.
2017 (Incremental_input_entry_reader::flags_): New data member.
2018 (Incremental_inputs_reader::input_file_offset): New function.
2019 (Incremental_inputs_reader::input_file_index): New function.
2020 (Incremental_inputs_reader::input_file): Call input_file_offset.
2021 (Incremental_inputs_reader::input_file_at_offset): New function.
2022 (Incremental_relocs_reader::get_r_type): Reformat.
2023 (Incremental_relocs_reader::get_r_shndx): Reformat.
2024 (Incremental_relocs_reader::get_r_offset): Reformat.
2025 (Incremental_relocs_reader::data): New function.
2026 (Incremental_binary::Incremental_binary): Initialize new data members.
2027 (Incremental_binary::check_inputs): Add cmdline parameter.
2028 (Incremental_binary::file_is_unchanged): Remove.
2029 (Input_reader::arg_serial): New function.
2030 (Input_reader::get_unused_symbol_count): New function.
2031 (Input_reader::get_unused_symbol): New function.
2032 (Input_reader::do_arg_serial): New function.
2033 (Input_reader::do_get_unused_symbol_count): New function.
2034 (Input_reader::do_get_unused_symbol): New function.
2035 (Incremental_binary::input_file_count): New function.
2036 (Incremental_binary::get_input_reader): Change signature to use
2037 index instead of filename.
2038 (Incremental_binary::file_has_changed): New function.
2039 (Incremental_binary::get_input_argument): New function.
2040 (Incremental_binary::get_library): New function.
2041 (Incremental_binary::get_script_info): New function.
2042 (Incremental_binary::init_layout): New function.
2043 (Incremental_binary::reserve_layout): New function.
2044 (Incremental_binary::output_file): New function.
2045 (Incremental_binary::do_check_inputs): New function.
2046 (Incremental_binary::do_file_is_unchanged): Remove.
2047 (Incremental_binary::do_file_has_changed): New function.
2048 (Incremental_binary::do_init_layout): New function.
2049 (Incremental_binary::do_reserve_layout): New function.
2050 (Incremental_binary::do_input_file_count): New function.
2051 (Incremental_binary::do_get_input_reader): Change signature.
2052 (Incremental_binary::input_args_map_): New data member.
2053 (Incremental_binary::library_map_): New data member.
2054 (Incremental_binary::script_map_): New data member.
2055 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2056 new data members.
2057 (Sized_incremental_binary::output_section): New function.
2058 (Sized_incremental_binary::inputs_reader): Add const.
2059 (Sized_incremental_binary::symtab_reader): Add const.
2060 (Sized_incremental_binary::relocs_reader): Add const.
2061 (Sized_incremental_binary::got_plt_reader): Add const.
2062 (Sized_incremental_binary::get_symtab_view): New function.
2063 (Sized_incremental_binary::Inputs_reader): New typedef.
2064 (Sized_incremental_binary::Input_entry_reader): New typedef.
2065 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
2066 (Sized_incremental_binary::do_file_is_unchanged): Remove.
2067 (Sized_incremental_binary::do_file_has_changed): New function.
2068 (Sized_incremental_binary::do_init_layout): New function.
2069 (Sized_incremental_binary::do_reserve_layout): New function.
2070 (Sized_input_reader::Inputs_reader): Remove.
2071 (Sized_input_reader::Input_entry_reader): Remove.
2072 (Sized_input_reader::do_arg_serial): New function.
2073 (Sized_input_reader::do_get_unused_symbol_count): New function.
2074 (Sized_input_reader::do_get_unused_symbol): New function.
2075 (Sized_incremental_binary::do_input_file_count): New function.
2076 (Sized_incremental_binary::do_get_input_reader): Change signature;
2077 use index instead of filename.
2078 (Sized_incremental_binary::section_map_): New data member.
2079 (Sized_incremental_binary::input_entry_readers_): New data member.
2080 (class Sized_incr_relobj): New class.
2081 (class Sized_incr_dynobj): New class.
2082 (make_sized_incremental_object): New function.
2083 (class Incremental_library): New class.
2084 * layout.cc (Free_list::num_lists): New static data member.
2085 (Free_list::num_nodes): New static data member.
2086 (Free_list::num_removes): New static data member.
2087 (Free_list::num_remove_visits): New static data member.
2088 (Free_list::num_allocates): New static data member.
2089 (Free_list::num_allocate_visits): New static data member.
2090 (Free_list::init): New function.
2091 (Free_list::remove): New function.
2092 (Free_list::allocate): New function.
2093 (Free_list::dump): New function.
2094 (Free_list::print_stats): New function.
2095 (Layout_task_runner::run): Resize output file for incremental updates.
2096 (Layout::Layout): Initialize new data members.
2097 (Layout::set_incremental_base): New function.
2098 (Layout::init_fixed_output_section): New function.
2099 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
2100 incremental updates.
2101 (Layout::create_gold_note): Do not create gold note section for
2102 incremental updates.
2103 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
2104 for incremental updates.
2105 (Layout::set_section_offsets): For incremental updates, allocate space
2106 from free list.
2107 (Layout::create_symtab_sections): Layout with offsets relative to
2108 start of section; for incremental updates, allocate space from free
2109 list.
2110 (Layout::create_shdrs): For incremental updates, allocate space from
2111 free list.
2112 (Layout::finish_dynamic_section): For incremental updates, do not
2113 check --as-needed (fixed in subsequent patch).
2114 * layout.h (class Free_list): New class.
2115 (Layout::set_incremental_base): New function.
2116 (Layout::incremental_base): New function.
2117 (Layout::init_fixed_output_section): New function.
2118 (Layout::allocate): New function.
2119 (Layout::incremental_base_): New data member.
2120 (Layout::free_list_): New data member.
2121 * main.cc (main): Print Free_list statistics.
2122 * object.cc (Relobj::finalize_incremental_relocs): Add
2123 clear_counts parameter; clear counts only when clear_counts is set.
2124 (Sized_relobj::Sized_relobj): Initialize new base class.
2125 (Sized_relobj::do_layout): Don't report special sections.
2126 (Sized_relobj::do_for_all_local_got_entries): New function.
2127 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
2128 symtab_off to all symbol table offsets.
2129 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
2130 * object.h (class Got_offset_list): Move to top of file.
2131 (Object::Object): Allow case where input_file == NULL.
2132 (Object::~Object): Likewise.
2133 (Object::input_file): Assert that input_file != NULL.
2134 (Object::lock): Allow case where input_file == NULL.
2135 (Object::unlock): Likewise.
2136 (Object::is_locked): Likewise.
2137 (Object::token): Likewise.
2138 (Object::release): Likewise.
2139 (Object::is_incremental): New function.
2140 (Object::get_mtime): New function.
2141 (Object::for_all_local_got_entries): New function.
2142 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
2143 (Object::set_is_in_system_directory): New function.
2144 (Object::is_in_system_directory): New function.
2145 (Object::do_is_incremental): New function.
2146 (Object::do_get_mtime): New function.
2147 (Object::do_for_all_local_got_entries): New function.
2148 (Object::is_in_system_directory_): New data member.
2149 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
2150 (class Sized_relobj_base): New class.
2151 (class Sized_relobj): Derive from Sized_relobj_base.
2152 (class Sized_relobj::Symbols): Redeclare from base class.
2153 (class Sized_relobj::local_got_offset_list): Remove.
2154 (class Sized_relobj::Output_sections): Redeclare from base class.
2155 (class Sized_relobj::do_for_all_local_got_entries): New function.
2156 (class Sized_relobj::write_local_symbols): Add offset parameter.
2157 (class Sized_relobj::local_symbol_offset_): Update comment.
2158 (class Sized_relobj::local_dynsym_offset_): Update comment.
2159 * options.cc (Input_arguments::add_file): Remove const.
2160 * options.h (Input_file_argument::Input_file_argument):
2161 Initialize arg_serial_ (all constructors).
2162 (Input_file_argument::set_arg_serial): New function.
2163 (Input_file_argument::arg_serial): New function.
2164 (Input_file_argument::arg_serial_): New data member.
2165 (Input_arguments::Input_arguments): Initialize file_count_.
2166 (Input_arguments::add_file): Remove const.
2167 (Input_arguments::number_of_input_files): New function.
2168 (Input_arguments::file_count_): New data member.
2169 (Command_line::number_of_input_files): Call
2170 Input_arguments::number_of_input_files.
2171 * output.cc (Output_segment_headers::Output_segment_headers):
2172 Set current size.
2173 (Output_section::Input_section::current_data_size): New function.
2174 (Output_section::Output_section): Initialize new data members.
2175 (Output_section::add_input_section): Don't do merge sections for
2176 an incremental link; allocate space from free list for an
2177 incremental update.
2178 (Output_section::add_output_section_data): Allocate space from
2179 free list for an incremental update.
2180 (Output_section::update_data_size): New function.
2181 (Output_section::set_fixed_layout): New function.
2182 (Output_section::reserve): New function.
2183 (Output_segment::set_section_addresses): Remove const.
2184 (Output_segment::set_section_list_addresses): Remove const; allocate
2185 space from free list for an incremental update.
2186 (Output_segment::set_offset): Adjust size of RELRO segment for an
2187 incremental update.
2188 * output.h (Output_data::current_data_size): Move here from
2189 child classes.
2190 (Output_data::pre_finalize_data_size): New function.
2191 (Output_data::update_data_size): New function.
2192 (Output_section_headers::update_data_size): new function.
2193 (Output_section_data_build::current_data_size): Move to Output_data.
2194 (Output_data_strtab::update_data_size): New function.
2195 (Output_section::current_data_size): Move to Output_data.
2196 (Output_section::set_fixed_layout): New function.
2197 (Output_section::has_fixed_layout): New function.
2198 (Output_section::reserve): New function.
2199 (Output_section::update_data_size): New function.
2200 (Output_section::has_fixed_layout_): New data member.
2201 (Output_section::free_list_): New data member.
2202 (Output_segment::set_section_addresses): Remove const.
2203 (Output_segment::set_section_list_addresses): Remove const.
2204 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2205 New function.
2206 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2207 New function.
2208 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2209 parameter when calling Add_symbols constructor; store argument
2210 serial number for members of a lib group.
2211 (Add_symbols::locks): Allow case where token == NULL.
2212 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2213 (Read_member::~Read_member): New function.
2214 (Read_member::is_runnable): New function.
2215 (Read_member::locks): New function.
2216 (Read_member::run): New function.
2217 (Check_script::~Check_script): New function.
2218 (Check_script::is_runnable): New function.
2219 (Check_script::locks): New function.
2220 (Check_script::run): New function.
2221 (Check_library::~Check_library): New function.
2222 (Check_library::is_runnable): New function.
2223 (Check_library::locks): New function.
2224 (Check_library::run): New function.
2225 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2226 (Add_symbols::library_): New data member.
2227 (class Read_member): New class.
2228 (class Check_script): New class.
2229 (class Check_library): New class.
2230 * reloc.cc (Read_relocs::is_runnable): Allow case where
2231 token == NULL.
2232 (Read_relocs::locks): Likewise.
2233 (Scan_relocs::locks): Likewise.
2234 (Relocate_task::locks): Likewise.
2235 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2236 to clear counters.
2237 (Sized_relobj::incremental_relocs_scan): Fix comment.
2238 (Sized_relobj::do_relocate): Pass output file offset to
2239 write_local_symbols.
2240 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2241 from class declaration.
2242 * script.cc (read_input_script): Allocate Script_info; pass
2243 argument serial number to report_script.
2244 * script.h (class Script_info): Move to incremental.h.
2245 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2246 * symtab.h (Symbol_table::add_from_incrobj): New function.
2247 (Symbol_table::set_file_offset): New function.
2248
b961d0d7
CC
22492011-04-05 Cary Coutant <ccoutant@google.com>
2250
2251 * incremental-dump.cc (dump_incremental_inputs): Change signature
2252 to take a Sized_incremental_binary; change caller. Use readers
2253 in Sized_incremental_binary.
2254 * incremental.cc
2255 (Sized_incremental_binary::find_incremental_inputs_sections):
2256 Rename do_find_incremental_inputs_sections to this.
2257 (Sized_incremental_binary::setup_readers): New function.
2258 (Sized_incremental_binary::do_check_inputs): Check
2259 has_incremental_info_ flag; move setup code to setup_readers;
2260 use input readers.
2261 (Sized_incremental_binary::do_file_is_unchanged): New function.
2262 (Sized_incremental_binary::do_get_input_reader): New function.
2263 * incremental.h (class Incremental_binary): Move to end of file.
2264 (Incremental_binary::file_is_unchanged): New function.
2265 (Incremental_binary::do_file_is_unchanged): New function.
2266 (Incremental_binary::Input_reader): New class.
2267 (Incremental_binary::get_input_reader): New function.
2268 (class Sized_incremental_binary): Move to end of file.
2269 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2270 input section reader classes.
2271 (Sized_incremental_binary::has_incremental_info): New function.
2272 (Sized_incremental_binary::inputs_reader): New function.
2273 (Sized_incremental_binary::symtab_reader): New function.
2274 (Sized_incremental_binary::relocs_reader): New function.
2275 (Sized_incremental_binary::got_plt_reader): New function.
2276 (Sized_incremental_binary::do_file_is_unchanged): New function.
2277 (Sized_incremental_binary::Sized_input_reader): New class.
2278 (Sized_incremental_binary::get_input_reader): New function.
2279 (Sized_incremental_binary::find_incremental_inputs_sections):
2280 Rename do_find_incremental_inputs_sections to this.
2281 (Sized_incremental_binary::setup_readers): New function.
2282 (Sized_incremental_binary::has_incremental_info_): New data member.
2283 (Sized_incremental_binary::inputs_reader_): New data member.
2284 (Sized_incremental_binary::symtab_reader_): New data member.
2285 (Sized_incremental_binary::relocs_reader_): New data member.
2286 (Sized_incremental_binary::got_plt_reader_): New data member.
2287 (Sized_incremental_binary::current_input_file_): New data member.
2288
a869183f
PP
22892011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2290
2291 PR gold/12640
2292 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2293 violation.
2294
22952011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2296
2297 * archive.cc (Archive::include_member): Adjust call to report_object.
2298 (Add_archive_symbols::run): Add script_info to call to
2299 report_archive_begin.
2300 (Lib_group::include_member): Adjust call to report_object.
2301 (Add_lib_group_symbols::run): Adjust call to report_object.
2302 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2303 blocks. Add object count for script input files.
2304 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2305 script_info parameter; change all callers.
2306 (Incremental_inputs::report_object): Add script_info parameter;
2307 change all callers.
2308 (Incremental_inputs::report_script): Store backpointer to
2309 incremental info entry.
2310 (Output_section_incremental_inputs::set_final_data_size): Record
2311 additional information for scripts.
2312 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2313 * incremental.h (Incremental_script_entry::add_object): New function.
2314 (Incremental_script_entry::get_object_count): New function.
2315 (Incremental_script_entry::get_object): New function.
2316 (Incremental_script_entry::objects_): New data member; adjust
2317 constructor.
2318 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2319 (Incremental_inputs::report_object): Add script_info parameter.
2320 (Incremental_inputs_reader::get_object_count): New function.
2321 (Incremental_inputs_reader::get_object_offset): New function.
2322 * options.cc (Input_arguments::add_file): Return reference to
2323 new input argument.
2324 * options.h (Input_argument::set_script_info): New function.
2325 (Input_argument::script_info): New function.
2326 (Input_argument::script_info_): New data member; adjust all
2327 constructors.
2328 (Input_file_group::add_file): Return reference to new input argument.
2329 (Input_file_lib::add_file): Likewise.
2330 (Input_arguments::add_file): Likewise.
2331 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2332 * script.cc (Parser_closure::Parser_closure): Add script_info
2333 parameter; adjust all callers.
2334 (Parser_closure::script_info): New function.
2335 (Parser_closure::script_info_): New data member.
2336 (read_input_script): Report scripts earlier to incremental info.
2337 (script_add_file): Set script_info in Input_argument.
2338 (script_add_library): Likewise.
2339 * script.h (Script_options::Script_info): Rewrite class.
2340
a869183f 23412011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2342
2343 * archive.cc (Library_base::should_include_member): Move
2344 method here from class Archive.
2345 (Archive::Archive): Initialize base class.
2346 (Archive::should_include_member): Move to base class.
2347 (Archive::do_for_all_unused_symbols): New function.
2348 (Add_archive_symbols::run): Remove redundant access to
2349 incremental_inputs.
2350 (Lib_group::Lib_group): Initialize base class.
2351 (Lib_group::do_filename): New function.
2352 (Lib_group::include_member): Pass pointer to Lib_group to
2353 report_object.
2354 (Lib_group::do_for_all_unused_symbols): New function.
2355 (Add_lib_group_symbols::run): Report archive information for
2356 incremental links.
2357 * archive.h (class Library_base): New base class.
2358 (class Archive): Derive from Library_base.
2359 (Archive::filename): Move to base class.
2360 (Archive::set_incremental_info): Likewise.
2361 (Archive::incremental_info): Likewise.
2362 (Archive::Should_include): Likewise.
2363 (Archive::should_include_member): Likewise.
2364 (Archive::Armap_entry): Remove.
2365 (Archive::Unused_symbol_iterator): Remove.
2366 (Archive::unused_symbols_begin): Remove.
2367 (Archive::unused_symbols_end): Remove.
2368 (Archive::do_filename): New function.
2369 (Archive::do_get_mtime): New function.
2370 (Archive::do_for_all_unused_symbols): New function.
2371 (Archive::task_): Move to base class.
2372 (Archive::incremental_info_): Likewise.
2373 (class Lib_group): Derive from Library_base.
2374 (Lib_group::do_filename): New function.
2375 (Lib_group::do_get_mtime): New function.
2376 (Lib_group::do_for_all_unused_symbols): New function.
2377 (Lib_group::task_): Move to base class.
2378 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2379 function.
2380 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2381 function.
2382 * incremental.cc (Incremental_inputs::report_archive_begin):
2383 Use Library_base; call library's get_mtime; add incremental inputs
2384 entry before members.
2385 (class Unused_symbol_visitor): New class.
2386 (Incremental_inputs::report_archive_end): Use Library_base; use
2387 visitor class to record unused symbols; don't add incremental inputs
2388 entry after members.
2389 (Incremental_inputs::report_object): Use Library_base.
2390 * incremental.h
2391 (Incremental_archive_entry::Incremental_archive_entry): Remove
2392 unused Archive parameter.
2393 (Incremental_inputs::report_archive_begin): Use Library_base.
2394 (Incremental_inputs::report_archive_end): Likewise.
2395 (Incremental_inputs::report_object): Likewise.
2396 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2397 function.
2398 * object.h (Object::for_all_global_symbols): New function.
2399 (Object::do_for_all_global_symbols): New function.
2400 (Sized_relobj::do_for_all_global_symbols): New function.
2401 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2402 function.
2403 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2404 function.
2405
61ab3e40
ILT
24062011-03-27 Ian Lance Taylor <iant@google.com>
2407
2408 * archive.cc (Archive::interpret_header): Return -1 if something
2409 goes wrong. Change callers accordingly.
2410
30e1f9e6
CC
24112011-03-25 Cary Coutant <ccoutant@google.com>
2412
2413 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2414 * testsuite/Makefile.in: Regenerate.
2415
9370ce59 24162011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2417
2418 * plugin.cc (get_view): New.
2419 (Plugin::load): Pass get_view to the plugin.
2420 (Plugin_manager::get_view): New.
2421
9312bb0a
ILT
24222011-03-21 Ian Lance Taylor <iant@google.com>
2423
2424 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2425 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2426
7e12ba9e
ST
24272011-03-21 Sriraman Tallam <tmsriram@google.com>
2428
2429 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2430 Change == to -eq.
2431 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2432 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2433 Change == to -eq.
2434 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2435 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2436
fd7a005d
ILT
24372011-03-14 Ian Lance Taylor <iant@google.com>
2438
2439 * script-sections.cc (Sort_output_sections::script_compare):
2440 Rename from is_before, change return type.
2441 (Sort_output_sections::operator()): Adjust accordingly.
2442
ed16fd1b
ILT
24432011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2444
2445 PR gold/12572
2446 * testsuite/odr_violation2.cc: Add comment to make all error line
2447 numbers double digits.
2448 * testsuite/debug_msg.sh: Adjust expected errors.
2449
71ff8986
ILT
24502011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2451
2452 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2453 but mark earlier ones as non-canonical
2454 (offset_to_iterator): Update search target and example
2455 (do_addr2line): Return extra lines in a vector*
2456 (format_file_lineno): Extract from do_addr2line
2457 (one_addr2line): Add vector* out-param
2458 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2459 when a lineno entry appeared last for its instruction
2460 (Dwarf_line_info): Add vector* out-param
2461 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2462 * symtab.cc (Odr_violation_compare): Include the lineno in the
2463 comparison again.
2464 (linenos_from_loc): New. Combine the canonical line for an
2465 address with its other lines.
2466 (True_if_intersect): New. Helper functor to make
2467 std::set_intersection a query.
2468 (detect_odr_violations): Compare sets of lines instead of just
2469 one line for each function. This became less deterministic, but
2470 has fewer false positives.
2471 * symtab.h: Declarations.
2472 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2473 mix an optimized and non-optimized object in the same binary
2474 (odr_violation2.so): Same.
2475 * testsuite/Makefile.in: Regenerate from Makefile.am.
2476 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2477 * testsuite/debug_msg.sh: Update line numbers and add
2478 assertions.
2479 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2480 non-optimized context.
2481 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2482 isn't inlined, and use OdrDerived in an optimized context.
2483 * testsuite/odr_header1.h: Defines OdrDerived, where
2484 optimization will change the
2485 first-instruction-in-the-destructor's file and line number.
2486 * testsuite/odr_header2.h: Defines OdrBase.
2487
a19fefdc
ILT
24882011-03-09 Ian Lance Taylor <iant@google.com>
2489
2490 * fileread.cc (File_read::clear_views): Don't delete the whole
2491 file view.
2492
ecb351e9
ILT
24932011-03-08 Ian Lance Taylor <iant@google.com>
2494
2495 PR gold/12525
2496 * fileread.cc: #include <climits>.
2497 (GOLD_IOV_MAX): Define.
2498 (File_read::read_multiple): Limit number of entries by iov_max.
2499 * fileread.h (class File_read): Always set max_readv_entries to
2500 128.
2501
b821d13c
ILT
25022011-03-07 Ian Lance Taylor <iant@google.com>
2503
2504 PR gold/12525
2505 * options.h (class General_options): Add -dy and -dn.
2506
89243142
CC
25072011-03-02 Cary Coutant <ccoutant@google.com>
2508
2509 * testsuite/script_test_9.t: Add TLS segment.
2510
d0773f31
ILT
25112011-03-02 Simon Baldwin <simonb@google.com>
2512
2513 * configure.ac: Add check for gnu_indirect_function support in
2514 the toolchain building binutils.
2515 * configure: Rebuild.
2516
9370ce59 25172011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
2518
2519 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2520 plugin only symbols.
2521 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2522 in plugin files as not needed in the symbol table.
2523
4cf7a849
ST
25242011-02-11 Sriraman Tallam <tmsriram@google.com>
2525
2526 * output.cc (Output_section::add_input_section): Delay fill
2527 generation for section ordering.
2528
b578bd7d
ILT
25292011-02-09 Ian Lance Taylor <iant@google.com>
2530
2531 PR gold/12316
2532 * object.h (class Sized_relobj): Remove clear_local_symbols.
2533 * reloc.cc (Sized_relobj::do_relocate): Don't call
2534 clear_local_symbols.
2535
9370ce59 25362011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
2537
2538 * plugin.cc (is_visible_from_outside): Return true for symbols
2539 in the -u option.
2540
55382fb7
ILT
25412011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2542
2543 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2544 filename.
2545
4e271fff
ST
25462011-02-02 Sriraman Tallam <tmsriram@google.com>
2547
2548 * icf.h (is_section_foldable_candidate): Change type of parameter
2549 to std::string.
2550 * icf.cc (Icf::find_identical_sections): Change type of local variable
2551 section_name to be std::string.
2552 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2553
d433c3ac
ILT
25542011-01-25 Ian Lance Taylor <iant@google.com>
2555
2556 * script.cc (script_add_extern): Rewrite to use
2557 add_symbol_reference.
2558
880473a6
DK
25592011-01-25 Doug Kwan <dougkwan@google.com>
2560
d433c3ac 2561 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2562
f30f86fa
ILT
25632011-01-24 Ian Lance Taylor <iant@google.com>
2564
2565 * options.h (class General_options): Accept
2566 --no-detect-odr-violations.
2567
8e51a0b9
ILT
25682011-01-24 Ian Lance Taylor <iant@google.com>
2569
2570 * version.cc (version_string): Bump to 1.11.
2571
0f3b89d8
ILT
25722011-01-24 Ian Lance Taylor <iant@google.com>
2573
2574 * plugin.cc (class Plugin_rescan): Define new class.
2575 (Plugin_manager::claim_file): Set any_claimed_.
2576 (Plugin_manager::save_archive): New function.
2577 (Plugin_manager::save_input_group): New function.
2578 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2579 necessary.
2580 (Plugin_manager::new_undefined_symbol): New function.
2581 (Plugin_manager::rescan): New function.
2582 (Plugin_manager::rescannable_defines): New function.
2583 (Plugin_manager::add_input_file): Set any_added_.
2584 * plugin.h (class Plugin_manager): define new fields rescannable_,
2585 undefined_symbols_, any_claimed_, and any_added_. Declare
2586 Plugin_rescan as friend. Declare new functions.
2587 (Plugin_manager::Rescannable): Define type.
2588 (Plugin_manager::Rescannable_list): Define type.
2589 (Plugin_manager::Undefined_symbol_list): Define type.
2590 (Plugin_manager::Plugin_manager): Initialize new fields.
2591 * archive.cc (Archive::defines_symbol): New function.
2592 (Add_archive_symbols::run): Pass archive to plugins if any.
2593 * archive.h (class Archive): Declare defines_symbol.
2594 * readsyms.cc (Input_group::~Input_group): New function.
2595 (Finish_group::run): Pass input_group to plugins if any.
2596 * readsyms.h (class Input_group): Declare destructor.
2597 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2598 any.
2599
3bb951e5
ILT
26002011-01-10 Ian Lance Taylor <iant@google.com>
2601
2602 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2603 section as relro.
2604 (Layout::set_segment_offsets): Reset increase_relro before calling
2605 set_section_addresses a second time.
2606
0aa45fac
CC
26072011-01-04 Cary Coutant <ccoutant@google.com>
2608
2609 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2610 sections before NOBITS sections.
2611
0db46eb4
L
26122011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2613
2614 * version.cc (print_version): Update copyright to 2011.
2615
829c9745
CC
26162010-12-23 Cary Coutant <ccoutant@google.com>
2617
2618 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2619 of OS to this->add. Add OD parameter to second form of the function.
2620
7500420b
ILT
26212010-12-20 Ian Lance Taylor <iant@google.com>
2622
2623 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2624 second of two consecutive entries with same offset.
2625
f8e9a930
RW
26262010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2627
2628 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2629 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2630 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2631 to avoid unneeded links against $(LDADD).
2632 * testsuite/Makefile.in: Regenerate.
2633
2fbb4320
ILT
26342010-12-15 Ian Lance Taylor <iant@google.com>
2635
2636 PR gold/12324
2637 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2638 for R_X86_64_32 and R_X86_64_PC32.
2639 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2640 ver_matching_def_pic.o.
2641 (ver_matching_def_pic.o): New target.
2642
fedb228d
RW
26432010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2644
2645 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2646 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2647 Move definition before File_read::View member definitions.
2648 (File_read::View::~View): Initialize and hold lock before
2649 updating current_mapped_bytes.
2650
9b547ce6
RW
26512010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2652
2653 * dwarf_reader.cc: Remove outdated comment.
2654 * gold-threads.cc: Fix typo in error message.
2655 * archive.cc: Fix typos in comments.
2656 * archive.h: Likewise.
2657 * arm-reloc-property.cc: Likewise.
2658 * arm-reloc-property.h: Likewise.
2659 * arm-reloc.def: Likewise.
2660 * arm.cc: Likewise.
2661 * attributes.h: Likewise.
2662 * cref.cc: Likewise.
2663 * ehframe.cc: Likewise.
2664 * fileread.h: Likewise.
2665 * gold.h: Likewise.
2666 * i386.cc: Likewise.
2667 * icf.cc: Likewise.
2668 * incremental.h: Likewise.
2669 * int_encoding.cc: Likewise.
2670 * layout.h: Likewise.
2671 * main.cc: Likewise.
2672 * merge.h: Likewise.
2673 * object.cc: Likewise.
2674 * object.h: Likewise.
2675 * options.cc: Likewise.
2676 * readsyms.cc: Likewise.
2677 * reduced_debug_output.cc: Likewise.
2678 * reloc.cc: Likewise.
2679 * script-sections.cc: Likewise.
2680 * sparc.cc: Likewise.
2681 * symtab.h: Likewise.
2682 * target-reloc.h: Likewise.
2683 * target.cc: Likewise.
2684 * target.h: Likewise.
2685 * timer.cc: Likewise.
2686 * timer.h: Likewise.
2687 * x86_64.cc: Likewise.
2688
83e17bd5
CC
26892010-12-09 Cary Coutant <ccoutant@google.com>
2690
2691 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2692 stack.
2693 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2694 parameter; change all callers.
2695 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2696 * options.h (warn_execstack): New option.
2697
017257f8
DK
26982010-12-07 Doug Kwan <dougkwan@google.com>
2699
2700 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2701 like function call relocations.
2702
c20cbc06
ILT
27032010-12-07 Ian Lance Taylor <iant@google.com>
2704
2705 * archive.cc (Archive::get_elf_object_for_member): Permit
2706 punconfigured to be NULL.
2707 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2708 (Archive::include_member): Pass NULL to get_elf_object_for_member
2709 if we searched for the archive and this is the first included
2710 object.
2711
4dbfafcc
ILT
27122010-12-01 Ian Lance Taylor <iant@google.com>
2713
2714 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2715 track_relocs_type_ field.
2716 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2717 Set track_relocs_type_.
2718 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2719 contents when using RELA relocs.
2720 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2721 reloc_map_.
2722 * reloc.cc (Track_relocs::next_addend): New function.
2723 * reloc.h (class Track_relocs): Declare next_addend.
2724
e5e19edd
ILT
27252010-12-01 Ian Lance Taylor <iant@google.com>
2726
2727 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2728 virtual destructor.
2729
9a5ce24c
ILT
27302010-12-01 Ian Lance Taylor <iant@google.com>
2731
2732 * README: Update compilers known to work and fail.
2733
c7791212
NC
27342010-11-23 Matthias Klose <doko@ubuntu.com>
2735
2736 * configure.in: For --enable-gold, handle value `default' instead of
2737 `both*'. Always install ld as ld.bfd, install as ld if gold is
2738 not the default.
2739 * configure: Regenerate.
2740
0ad220c9
DK
27412010-11-18 Doug Kwan <dougkwan@google.com>
2742
2743 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2744 and right_alignment to be zero. Store result alignment only if it is
2745 greater than existing alignment.
2746
ab8056e0
CC
27472010-11-16 Cary Coutant <ccoutant@google.com>
2748
2749 PR gold/12220
2750 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2751 Check for ".zdebug_line".
2752
fd064a5b
CC
27532010-11-16 Doug Kwan <dougkwan@google.com>
2754 Cary Coutant <ccoutant@google.com>
2755
2756 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2757 by reference; adjust all callers.
2758 * output.cc (Output_segment::set_section_addresses): Adjust references
2759 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2760 list is empty.
2761 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2762 end at page boundary.
2763
6fc6ea19
CC
27642010-11-16 Cary Coutant <ccoutant@google.com>
2765
2766 PR gold/12220
2767 * layout.cc (Layout::choose_output_section): Transform names of
2768 compressed sections even when using a script with a SECTIONS clause.
2769 (Layout::output_section_name): Remove code to transform
2770 compressed debug section names.
2771 * output.cc (Output_section::add_input_section): Use uncompressed
2772 section size when tracking input sections.
2773
95a2c8d6
RS
27742010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2775
2776 * symtab.h (Symbol::NON_PIC_REF): Remove.
2777 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2778 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2779 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2780 (Symbol::use_plt_offset): Take a flags argument and pass it
2781 directly to needs_dynamic_reloc. Restrict check for undefined
2782 weak symbols to function calls.
2783 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2784 (Target_arm::Scan::global): Use it.
2785 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2786 (Target_arm::Relocate::relocate): Likewise.
2787 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2788 parameter with an r_type parameter. Use get_reference_flags
2789 to get the flags.
2790 (Target_arm::Relocate::relocate): Update accordingly.
2791 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2792 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2793 (Target_i386::Scan::global): Likewise.
2794 (Target_i386::Relocate::relocate): Likewise.
2795 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2796 parameter with an r_type parameter. Use get_reference_flags
2797 to get the flags.
2798 (Target_i386::Relocate::relocate): Update accordingly.
2799 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2800 (Target_powerpc::Scan::global): Use it.
2801 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2802 (Target_powerpc::Relocate::relocate): Likewise.
2803 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2804 (Target_sparc::Scan::global): Use it.
2805 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2806 (Target_sparc::Relocate::relocate): Likewise.
2807 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2808 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2809 (Target_x86_64::Scan::global): Likewise.
2810 (Target_x86_64::Relocate::relocate): Likewise.
2811
f625ae50
DK
28122010-11-08 Doug Kwan <dougkwan@google.com>
2813 Cary Coutant <ccoutant@google.com>
2814
2815 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2816 (Arm_exidx_merge_section::section_contents_): New data member.
2817 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2818 (Arm_input_section::~Arm_input_section): De-allocate memory.
2819 (Arm_input_section::original_contents_): New data member.
2820 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2821 in parameters instead of calling Object::section_contents without
2822 locking.
2823 (Arm_output_section::group_section): New parameter TASK. Pass it
2824 to callees that need locking objects.
2825 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2826 to lock EXIDX input sections. Fix a formatting issue. Call
2827 Arm_exidx_merged_section::build_contents to create merged section
2828 contents.
2829 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2830 to lock object of stub table owner.
2831 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2832 TEXT_SIZE to initialize data member TEXT_SIZE_.
2833 (Arm_exidx_input_section::addralign): Fix typo in comment.
2834 (Arm_exidx_input_section::text_size): New method.
2835 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2836 that require locking objects. Lock objects before scanning for stubs
2837 and updating local symbols.
2838 (Arm_input_section<big_endian>::init): Copy contents of original
2839 input section.
2840 (Arm_input_section<big_endian>::do_write): Use saved contents of
2841 original input section instead of calling Object::section_contents
2842 without locking.
2843 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2844 size without calling Object::section_size().
2845 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2846 for size. Allocate a buffer for merged EXIDX entries.
2847 (Arm_exidx_merged_section::build_contents): New method.
2848 (Arm_exidx_merged_section::do_write): Move merge section contents
2849 building code to Arm_exidx_merged_section::build_contetns. Write
2850 out contetns in buffer instead of building it on the fly.
2851 (Arm_relobj::make_exidx_input_section): Also pass text section size
2852 to Arm_exidx_input_section constructor.
2853 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2854 (Arm_dynobj::do_read_symbols): Fix memory leak.
2855 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2856 * target.h: (class Task): Add forward declaration.
2857 (Target::relax): Add new parameter TASK and pass it to
2858 Target::do_relax().
2859 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2860
5f9bcf58
CC
28612010-11-05 Cary Coutant <ccoutant@google.com>
2862
2863 PR gold/10708
2864 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2865 object when reading from the file.
2866 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2867 second layout pass.
2868 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2869 when reading section contents.
2870 (get_section_contents): Likewise.
2871 (icf::find_identical_sections): Likewise.
2872 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2873 object when reading from the file.
2874 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2875 the object when doing deferred section layout.
2876
e597fa08
NC
28772010-11-03 Nick Clifton <nickc@redhat.com>
2878
2879 PR gold/12001
2880 * script.h (class Symbol_assignment: name): New member. Returns
2881 the name of the symbol.
2882 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2883 Returns true if the given symbol name is on the list of
2884 assignments wating to be processed.
2885 * archive.cc (should_incldue_member): If the symbol is undefined,
2886 check to see if it is on the list of symbols pending assignment.
2887
3f9a3278
ILT
28882010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2889
2890 * script-sections.cc (Script_sections::find_memory_region): Check
2891 for a NULL output section pointer.
2892
d06fb4d1
DK
28932010-10-29 Doug Kwan <dougkwan@google.com>
2894
2895 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2896 Output_section::add_relaxed_input_section.
2897 * output.cc (Output_section::add_relaxed_input_section): Add new
2898 arguments LAYOUT and NAME. Set section order index.
2899 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2900 Copy section order index.
2901 * output.h (Output_section::add_relaxed_input_section): Add new
2902 arguments LAYOUT and NAME.
2903
90e24de5
ILT
29042010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2905
2906 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2907 NATIVE_OR_CROSS_LINKER.
2908 * testsuite/Makefile.in: Regenerate.
2909
c9484ea5
DK
29102010-10-20 Doug Kwan <dougkwan@google.com>
2911
2912 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2913 without SHF_LINK_ORDER flags.
2914 * layout.cc (Layout::choose_output_section): Do not filter
2915 SHF_LINK_ORDER flag in a relocatable link.
2916
5bc2f5be
CC
29172010-10-17 Cary Coutant <ccoutant@google.com>
2918
2919 * output.h (Output_segment::set_section_addresses): Change function
2920 signature. Update all callers.
2921 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2922 sections.
2923 (Output_segment::set_section_addresses): Align after last TLS
2924 section. Add padding before last relro section instead of after.
2925
0c91cf04
DK
29262010-10-17 Doug Kwan <dougkwan@google.com>
2927
2928 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2929 GOT output section to be writable.
2930
8c21d9d3
CC
29312010-10-14 Cary Coutant <ccoutant@google.com>
2932
2933 * debug.h (DEBUG_INCREMENTAL): New flag.
2934 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2935 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2936 mode.
2937 * incremental.cc (report_command_line): Ignore all forms of
2938 --incremental.
2939 * layout.cc (Layout::Layout): Check parameters for incremental link
2940 mode.
2941 * options.cc (General_options::parse_incremental): New function.
2942 (General_options::parse_no_incremental): New function.
2943 (General_options::parse_incremental_full): New function.
2944 (General_options::parse_incremental_update): New function.
2945 (General_options::incremental_mode_): New data member.
2946 (General_options::finalize): Check incremental_mode_.
2947 * options.h (General_options): Update help text for --incremental.
2948 Add --no-incremental, --incremental-full, --incremental-update.
2949 (General_options::Incremental_mode): New enum type.
2950 (General_options::incremental_mode): New function.
2951 (General_options::incremental_mode_): New data member.
2952 * parameters.cc (Parameters::incremental_mode_): New data member.
2953 (Parameters::set_options): Set incremental_mode_.
2954 (Parameters::set_incremental_full): New function.
2955 (Parameters::incremental): New function.
2956 (Parameters::incremental_update): New function.
2957 (set_parameters_incremental_full): New function.
2958 * parameters.h (Parameters::set_incremental_full): New function.
2959 (Parameters::incremental): New function.
2960 (Parameters::incremental_update): New function.
2961 (Parameters::incremental_mode_): New data member.
2962 (set_parameters_incremental_full): New function.
2963 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2964 incremental link mode.
2965 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2966 (Sized_relobj::do_relocate_sections): Likewise.
2967 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2968 option.
2969 * testsuite/Makefile.in: Regenerate.
2970 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2971
bb32aa18 29722010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2973
2974 * script-sections.h (class Script_sections): Make
2975 Sections_elements typedef public.
2976 * script-sections.cc (class Sort_output_sections): Add elements_
2977 field. Add constructor which sets it; change all callers.
2978 (Sort_output_sections::is_before): New function.
2979 (Sort_output_sections::operator()): Call is_before.
2980 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2981 conditional.
2982 * testsuite/script_test_10.sh: New test. Test script section
2983 order.
2984 * testsuite/script_test_10.t: Likewise.
2985 * testsuite/script_test_10.s: Likewise.
2986 * testsuite/Makefile.am: Wrap the cross linker tests and the
2987 common tests into NATIVE_OR_CROSS_LINKER.
2988 (check_SCRIPTS): Add script_test_10.sh.
2989 (check_DATA): Add script_test_10.stdout.
2990 (script_test_10.o, script_test_10): New targets.
2991 (script_test_10.stdout): New target.
2992 * configure, testsuite/Makefile.in: Regenerate.
2993
3cef7179
ILT
29942010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2995
2996 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2997 error for the deprecated relocations.
2998 (Target_arm::Scan::global): Likewise.
2999 (Target_arm::Relocate::relocate): Likewise.
3000
7411e9a8
RS
30012010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3002
3003 * fileread.cc (Input_file::find_file): Initialize *found_name
3004 and *namep when using the fallback search for case 4.
3005
6a9da32a
CC
30062010-10-11 Cary Coutant <ccoutant@google.com>
3007
3008 * options.h (class General_options): Redefine -z lazy as an alias for
3009 the negation of -z now.
3010
ac897c20
ILT
30112010-10-11 Ian Lance Taylor <iant@google.com>
3012
3013 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3014 binding.
3015
ea5cae92
NC
30162010-10-06 Nick Clifton <nickc@redhat.com>
3017
3018 * script-sections.cc(class Memory_region): Remove
3019 current_lma_offset_ field. Rename current_vma_offset_ to
3020 current_offset_. Add last_section_ field.
3021 (Memory_region::get_current_vma_address): Rename to
3022 get_current_address.
3023 (Memory_region::get_current_lma_address): Delete.
3024 (Memory_region::increment_vma_offset): Rename to
3025 increment_offset.
3026 (Memory_region::increment_lma_offset): Delete.
3027 (Memory_region::attributes_compatible): New method. Returns
3028 true if the provided section is compatible with the region.
3029 (Memory_region::get_last_section): New method. Returns the last
3030 section to use the region.
3031 (Memory_region::set_last_section): New method. Stores the last
3032 section to use the region.
3033 (Script_sections::block_in_region): New method. Returns true if
3034 a block of memory is contained within a region.
3035 (Script_sections::find_memory_region): New method. Locates a
3036 memory region to be used to set a VMA or LMA address.
3037 (Output_section_definition::set_section_addresses): Add code to
3038 check for addresses set by memory regions.
3039 (Output_segment::set_section_addresses): Remove memory region
3040 walking code.
3041 (Script_sections::create_segment): Add a warning if a header
3042 segment is created outside of any region.
3043 * script-sections.h (class Script_sections): Add prototypes for
3044 find_memory_region and block_in_region methods.
3045 * testsuite/memory_test.s: Use .long instead of .word.
3046 * testsuite/memory_test.t: Add some more output sections.
3047 * testsuite/memory_test.sh: Update expected output.
3048
a9bfd952
DK
30492010-10-02 Doug Kwan <dougkwan@google.com>
3050
3051 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3052 defintion to symtab.h
3053 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3054 declaration to defintion.
3055
bacff3ab
NC
30562010-10-01 Nick Clifton <nickc@redhat.com>
3057
3058 * expression.cc (eval): Replace dummy argument with NULL.
3059 (eval_maybe_dot): Check for a NULL result section pointer.
3060 (Symbol_expression::value): Likewise.
3061 (Dot_expression::value): Likewise.
3062 (BINARY_EXPRESSION): Likewise.
3063 (Max_expression::value): Likewise.
3064 (Min_expression::value): Likewise.
3065 (Absolute_expression::value): Likewise.
3066 (Addr_expression::value_from_output_section): Likewise.
3067 (Loaddddr_expression::value_from_output_section): Likewise.
3068 (Segment_start_expression::value): Likewise.
3069 * script-sections.cc
3070 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
3071 argument with NULL.
3072 (Sections_elememt_dot_assignment::set_section_addresses):
3073 Likewise.
3074 (Output_data_expression::do_write_to_buffer): Likewise.
3075 (Output_section_definition::finalize_symbols): Likewise.
3076 (Output_section_definition::set_section_addresses): Likewise.
3077
f81bc8b5
DK
30782010-09-30 Doug Kwan <dougkwan@google.com>
3079
3080 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
3081
c95e9f27
ST
30822010-09-28 Sriraman Tallam <tmsriram@google.com>
3083
3084 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 3085 function.
c95e9f27
ST
3086 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
3087 virtual function.
3088 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
3089 virtual function.
3090 * icf.cc (get_section_contents): Inline merge sections only when
3091 target allows it.
3092
3cac54d2
RW
30932010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3094
3095 * configure: Regenerate.
3096
2904037a
ILT
30972010-09-17 Ian Lance Taylor <iant@google.com>
3098
3099 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
3100 * testsuite/Makefile.am (memory_test.o): New target.
3101 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
3102 memory_test.t.
3103 * testsuite/Makefile.in: Rebuild.
2904037a 3104
bca7fb63
DK
31052010-09-17 Doug Kwan <dougkwan@google.com>
3106
3107 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
3108 defintion if relocation uses GOT entries of the symbol.
3109 * testsuite/icf_safe_test.sh: Fix test.
3110 * testsuite/icf_safe_so_test.sh: Fix test.
3111
4ef28648
CC
31122010-09-16 Cary Coutant <ccoutant@google.com>
3113
3114 * script_sections.cc (class Memory_region): Remove "NULL" from
3115 vector initializations.
3116
793990de
CC
31172010-09-15 Cary Coutant <ccoutant@google.com>
3118
3119 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
3120 Resolve forwarding symbols.
3121
81e015e2
DK
31222010-09-15 Doug Kwan <dougkwan@google.com>
3123
3124 * gold/testsuite/script_test_3.t: Add ARM special sections.
3125 * gold/testsuite/script_test_4.t: Same.
3126 * gold/testsuite/script_test_5.t: Same.
3127 * gold/testsuite/script_test_6.t: Same.
3128 * gold/testsuite/script_test_7.t: Same.
3129 * gold/testsuite/script_test_7.t: Same.
3130 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
3131
36171d64
CC
31322010-09-14 Cary Coutant <ccoutant@google.com>
3133
3134 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
3135 (Target_x86_64::Relocate::relocate_tls): Replace check for
3136 saw_tls_block_reloc_ with test for executable section.
3137
d89051bd
CC
31382010-09-12 Cary Coutant <ccoutant@google.com>
3139
3140 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
3141 position-independent executables to shared libraries need dynamic
3142 relocations.
3143 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
3144 position-independent executables.
3145 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
3146 * testsuite/Makefile.in: Regenerate.
3147
fca41f0f
NC
31482010-09-10 Nick Clifton <nickc@redhat.com>
3149
3150 PR gold/11997
3151 * testsuite/memory_test.t: Discard any sections that are not
3152 needed.
3153
6695e4b3
L
31542010-09-09 H.J. Lu <hongjiu.lu@intel.com>
3155
3156 PR gold/11996
3157 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
3158 "This::" to work around a bug in gcc 4.2.
3159
3160 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3161
0f72bf6f
RÁE
31622010-09-09 Rafael Espindola <espindola@google.com>
3163
3164 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3165 sections with different PF_X flags in the same segment.
3166 (Layout::find_first_load_seg): Search all segments to find the first
3167 one.
3168 * options.h (rosegment): New.
3169
31702010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3171
05a79166 3172 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3173
aa98ff75
DK
31742010-09-08 Doug Kwan <dougkwan@google.com>
3175
3176 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3177 (Arm_relobj::do_relocate_sections): Add new parameter for output
3178 file to match the parent.
3179 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3180 of local symbols instead of input values. Update code to track
3181 changes in gold::relocate_section.
3182 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3183 (Sized_relobj::compute_final_local_value_internal): New methods.
3184 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3185 body into private version of Sized_relobj::compute_final_local_value.
3186 Call the inline method.
3187 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3188 merged symbol value if there is one.
3189 (Symbol_value::has_output_value): New method defintiion.
3190 (Sized_relobj::Compute_final_local_value_status): New enum type.
3191 (Sized_relobj::compute_final_local_value): New methods.
3192 (Sized_relobj::compute_final_local_value_internal): New methods.
3193 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3194 and arm_cortex_a8.sh.
3195 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3196 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3197 New tests.
3198 * Makefile.in: Regenerate.
3199 * testsuite/arm_bl_out_of_range.s: Update test.
3200 * testsuite/thumb_bl_out_of_range.s: Ditto.
3201 * testsuite/thumb_blx_out_of_range.s: Ditto.
3202 * testsuite/arm_branch_out_of_range.sh: New file.
3203 * testsuite/arm_cortex_a8.sh: Ditto.
3204 * testsuite/arm_cortex_a8_b.s: Ditto.
3205 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3206 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3207 * testsuite/arm_cortex_a8_bl.s: Ditto.
3208 * testsuite/arm_cortex_a8_blx.s: Ditto.
3209 * testsuite/arm_cortex_a8_local.s: Ditto.
3210 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3211 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3212
05a79166
L
32132010-09-08 Rafael Espindola <espindola@google.com>
3214
3215 * Makefile.am (memory_test.stdout): Run readelf with -W.
3216 * Makefile.in: Regenerate.
3217 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3218 64 bit output.
3219
33dbc701
RÁE
32202010-09-08 Rafael Espindola <espindola@google.com>
3221
3222 * script-sections.cc (Script_sections::add_memory_region): Convert
3223 field precision to int.
3224 * script.cc (script_set_section_region, script_set_section_region):
3225 Convert field precision to int.
3226
731ca54a
RÁE
32272010-09-08 Rafael Espindola <espindola@google.com>
3228
3229 * arm.cc (do_finalize_sections): Create the __exidx_start and
3230 __exdix_end symbols even when the section is missing.
3231
7f8cd844
NC
32322010-09-08 Nick Clifton <nickc@redhat.com>
3233
3234 * README: Remove claim that MEMORY is not supported.
3235 * expression.cc (script_exp_function_origin)
3236 (script_exp_function_length): Move from here to ...
3237 * script.cc: ... here.
3238 (script_set_section_region, script_add_memory)
3239 (script_parse_memory_attr, script_include_directive): New
3240 functions.
3241 * script-sections.cc
3242 (class Memory_region): New class.
3243 (class Output_section_definition): Add set_memory_region,
3244 set_section_vma, set_section_lma and get_section_name methods.
3245 (class Script_Sections): Add add_memory_region,
3246 find_memory_region, find_memory_region_origin,
3247 find_memory_region_length and set_memory_region methods.
3248 Have set_section_addresses method walk the list of set memory
3249 regions.
3250 Extend the print methos to display memory regions.
3251 * script-sections.h: Add prototypes for new methods.
3252 Add enum for MEMORY region attributes.
3253 * yyscript.y: Add support for parsing MEMORY regions.
3254 * script-c.h: Add prototypes for new functions.
3255 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3256 * testsuite/Makefile.in: Regenerate.
3257 * testsuite/memory_test.sh: New script.
3258 * testsuite/memory_test.s: New assembler source file.
3259 * testsuite/memory_test.t: New linker script.
3260
a4649286
DK
32612010-08-27 Doug Kwan <dougkwan@google.com>
3262
3263 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3264 reference override an existing dynamic weak reference.
3265 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3266 * testsuite/Makefile.in: Regenerate.
3267 * testsuite/dyn_weak_ref.sh: New file.
3268 * testsuite/dyn_weak_ref_1.c: Ditto.
3269 * testsuite/dyn_weak_ref_2.c: Ditto.
3270
b56648ad
ILT
32712010-08-27 Ian Lance Taylor <iant@google.com>
3272
3273 * incremental.h (class Incremental_input_entry): Add virtual
3274 destructor.
3275
809313cb
ILT
32762010-08-27 Ian Lance Taylor <iant@google.com>
3277
3278 * testsuite/start_lib_test_3.c: Mark t3 as used.
3279
11e32464
NC
32802010-08-27 Nick Clifton <nickc@redhat.com>
3281
3282 * options.cc (version_script): Fix small typo in previous
3283 whitespace tidyup.
3284
ca09d69a
NC
32852010-08-25 Nick Clifton <nickc@redhat.com>
3286
3287 * archive.cc: Formatting fixes: Remove whitespace between
3288 typename and following asterisk. Remove whitespace between
3289 function name and opening parenthesis.
3290 * archive.h: Likewise.
3291 * arm.cc: Likewise.
3292 * attributes.cc: Likewise.
3293 * attributes.h: Likewise.
3294 * common.cc: Likewise.
3295 * copy-relocs.cc: Likewise.
3296 * dirsearch.h: Likewise.
3297 * dynobj.cc: Likewise.
3298 * ehframe.cc: Likewise.
3299 * ehframe.h: Likewise.
3300 * expression.cc: Likewise.
3301 * fileread.cc: Likewise.
3302 * fileread.h: Likewise.
3303 * gc.h: Likewise.
3304 * gold-threads.cc: Likewise.
3305 * gold.cc: Likewise.
3306 * i386.cc: Likewise.
3307 * icf.h: Likewise.
3308 * incremental-dump.cc: Likewise.
3309 * incremental.cc: Likewise.
3310 * layout.cc: Likewise.
3311 * layout.h: Likewise.
3312 * main.cc: Likewise.
3313 * merge.cc: Likewise.
3314 * merge.h: Likewise.
3315 * object.cc: Likewise.
3316 * object.h: Likewise.
3317 * options.cc: Likewise.
3318 * options.h: Likewise.
3319 * output.cc: Likewise.
3320 * output.h: Likewise.
3321 * plugin.cc: Likewise.
3322 * plugin.h: Likewise.
3323 * powerpc.cc: Likewise.
3324 * reloc.cc: Likewise.
3325 * script-c.h: Likewise.
3326 * script-sections.cc: Likewise.
3327 * script.cc: Likewise.
3328 * stringpool.cc: Likewise.
3329 * symtab.cc: Likewise.
3330 * symtab.h: Likewise.
3331 * target.cc: Likewise.
3332 * timer.cc: Likewise.
3333 * timer.h: Likewise.
3334 * version.cc: Likewise.
3335 * x86_64.cc: Likewise.
3336
b8fa8750
NC
33372010-08-24 Nick Clifton <nickc@redhat.com>
3338
3339 PR 11899
3340 * layout.cc (segment_precedes): Sort segments by their physical
3341 addresses, if they have been set.
3342
9919d93b
CC
33432010-08-23 Cary Coutant <ccoutant@google.com>
3344
3345 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3346 symbols data.
3347 (Lib_group::include_member): Unlock object after deleting its
3348 symbols data.
3349 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3350 the bug fixed here.
3351
97b4be1c
CC
33522010-08-19 Neil Vachharajani <nvachhar@google.com>
3353 Cary Coutant <ccoutant@google.com>
3354
3355 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3356 constructor, and set_blocker.
3357 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3358 readsyms_blocker_.
3359 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3360 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3361 * testsuite/Makefile.am (start_lib_test): New test case.
3362 * testsuite/Makefile.in: Regenerate.
3363 * testsuite/start_lib_test_main.c: New file.
3364 * testsuite/start_lib_test_1.c: New file.
3365 * testsuite/start_lib_test_2.c: New file.
3366 * testsuite/start_lib_test_3.c: New file.
3367
dd0b1884
ILT
33682010-08-19 Ian Lance Taylor <iant@google.com>
3369
3370 * Makefile.in: Rebuild with automake 1.11.1.
3371 * aclocal.m4: Likewise.
3372 * testsuite/Makefile.in: Likewise.
3373
7223e9ca
ILT
33742010-08-19 Ian Lance Taylor <iant@google.com>
3375
3376 PR 10893
3377 * i386.cc (class Output_data_plt_i386): Update declarations.
3378 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3379 local_ifuncs_ fields.
3380 (Target_i386::do_plt_section_for_global): New function.
3381 (Target_i386::do_plt_section_for_local): New function.
3382 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3383 parameter; change all callers. Initialize global_ifuncs_ and
3384 local_ifuncs_. If doing a static link define __rel_iplt_start and
3385 __rel_iplt_end.
3386 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3387 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3388 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3389 symbols.
3390 (Target_i386::make_plt_section): New function, broken out of
3391 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3392 (Target_i386::make_plt_entry): Call make_plt_section.
3393 (Target_i386::make_local_ifunc_plt_entry): New function.
3394 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3395 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3396 R_386_IRELATIVE to switch.
3397 (Target_i386::Scan::global): Likewise.
3398 (Target_i386::Relocate::relocate): Likewise.
3399 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3400 switch.
3401 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3402 (Target_x86_64::do_plt_section_for_global): New function.
3403 (Target_x86_64::do_plt_section_for_local): New function.
3404 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3405 parameter; change all callers. If doing a static link define
3406 __rela_iplt_start and __rela_iplt_end.
3407 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3408 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3409 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3410 to point to .plt.
3411 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3412 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3413 switch.
3414 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3415 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3416 R_X86_64_IRELATIVE to switch.
3417 (Target_x86_64::Scan::global): Likewise.
3418 (Target_x86_64::Relocate::relocate): Likewise.
3419 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3420 switch.
3421 * target.h (class Target): Add plt_section_for_global and
3422 plt_section_for_local functions. Add do_plt_section_for_global
3423 and do_plt_section_for_local virtual functions.
3424 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3425 clarifying comments.
3426 (Symbol::use_plt_offset): Handle IFUNC symbol.
3427 * object.cc (Sized_relobj::Sized_relobj): Initialize
3428 local_plt_offsets_.
3429 (Sized_relobj::local_has_plt_offset): New function.
3430 (Sized_relobj::local_plt_offset): New function.
3431 (Sized_relobj::set_local_plt_offset): New function.
3432 (Sized_relobj::do_count): Handle IFUNC symbol.
3433 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3434 a bit away from input_shndx_ field. Add set_is_func_symbol and
3435 is_ifunc_symbol functions.
3436 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3437 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3438 local_plt_offsets_ field.
3439 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3440 * output.h (class Output_section_data): Add non-const
3441 output_section function.
3442 (class Output_data_got): Update declarations.
3443 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3444 Add use_plt_offset parameter to global and local constructors.
3445 Change all callers. Change local_sym_index_ field to 31 bits.
3446 Change GSYM_CODE and CONSTANT_CODE accordingly.
3447 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3448 doing a static link don't set sh_link field.
3449 (Output_data_got::Got_entry::write): Use PLT offset if
3450 appropriate.
3451 (Output_data_got::add_global_plt): New function.
3452 (Output_data_got::add_local_plt): New function.
3453 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3454 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3455 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3456 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3457 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3458 IFUNC conditional.
3459 * testsuite/ifunc-sel.h: New file.
3460 * testsuite/ifuncmain1.c: New file.
3461 * testsuite/ifuncmain1vis.c: New file.
3462 * testsuite/ifuncmod1.c: New file.
3463 * testsuite/ifuncdep2.c: New file.
3464 * testsuite/ifuncmain2.c: New file.
3465 * testsuite/ifuncmain3.c: New file.
3466 * testsuite/ifuncmod3.c: New file.
3467 * testsuite/ifuncmain4.c: New file.
3468 * testsuite/ifuncmain5.c: New file.
3469 * testsuite/ifuncmod5.c: New file.
3470 * testsuite/ifuncmain6pie.c: New file.
3471 * testsuite/ifuncmod6.c: New file.
3472 * testsuite/ifuncmain7.c: New file.
3473 * configure, testsuite/Makefile.in: Rebuild.
3474
56f75c03
ILT
34752010-08-18 Ian Lance Taylor <iant@google.com>
3476
3477 * incremental.cc
3478 (Output_section_incremental_inputs::write_input_files): Add cast
3479 to avoid signed/unsigned comparison warning.
3480 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3481
55455f89
CC
34822010-08-12 Cary Coutant <ccoutant@google.com>
3483
3484 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3485
e2054bcb
ILT
34862010-08-13 Ian Lance Taylor <iant@google.com>
3487
3488 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3489
74f67560
DK
34902010-08-12 Cary Coutant <ccoutant@google.com>
3491 Doug Kwan <dougkwan@google.com>
3492
3493 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3494 defintion overrides non-weak undef, remember that the original undef
3495 is not weak.
3496 * symtab.cc (Symbol_table::sized_write_global): For undef without
3497 an original weak binding, set binding to global in output.
3498 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3499 * testsuite/Makefile.in: Regenerate.
3500 * testsuite/strong_ref_weak_def.sh: New file.
3501 * testsuite/strong_ref_weak_def_1.c: Ditto.
3502 * testsuite/strong_ref_weak_def_2.c: Ditto.
3503
d1238d12
CC
35042010-08-12 Cary Coutant <ccoutant@google.com>
3505
3506 * testsuite/incremental_test.sh: Rewrite.
3507 * testsuite/incremental_test_1.c: Rewrite.
3508 * testsuite/incremental_test_2.c: Rewrite.
3509
0e70b911
CC
35102010-08-12 Cary Coutant <ccoutant@google.com>
3511
3512 * arm.cc (Target_arm::got_size): Add const.
3513 (Target_arm::got_entry_count): New function.
3514 (Target_arm::plt_entry_count): New function.
3515 (Target_arm::first_plt_entry_offset): New function.
3516 (Target_arm::plt_entry_size): New function.
3517 (Output_data_plt_arm::entry_count): New function.
3518 (Output_data_plt_arm::first_plt_entry_offset): New function.
3519 (Output_data_plt_arm::get_plt_entry_size): New function.
3520 * i386.cc (Target_i386::got_size): Add const.
3521 (Target_i386::got_entry_count): New function.
3522 (Target_i386::plt_entry_count): New function.
3523 (Target_i386::first_plt_entry_offset): New function.
3524 (Target_i386::plt_entry_size): New function.
3525 (Output_data_plt_i386::entry_count): New function.
3526 (Output_data_plt_i386::first_plt_entry_offset): New function.
3527 (Output_data_plt_i386::get_plt_entry_size): New function.
3528 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3529 find_incremental_inputs_sections. Dump incremental_got_plt section.
3530 * incremental.cc: Include target.h.
3531 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3532 parameter. Adjust all callers. Find incremental_got_plt section.
3533 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3534 section.
3535 (Output_section_incremental_inputs::set_final_data_size): Calculate
3536 size of incremental_got_plt section.
3537 (Output_section_incremental_inputs::do_write): Write the
3538 incremental_got_plt section.
3539 (Got_plt_view_info): New struct.
3540 (Local_got_offset_visitor): New class.
3541 (Global_got_offset_visitor): New class.
3542 (Global_symbol_visitor_got_plt): New class.
3543 (Output_section_incremental_inputs::write_got_plt): New function.
3544 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3545 Add parameter. Adjust all callers.
3546 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3547 (Incremental_inputs::got_plt_section): New function.
3548 (Incremental_inputs::got_plt_section_): New data member.
3549 (Incremental_got_plt_reader): New class.
3550 * layout.cc (Layout::create_incremental_info_sections): Add the
3551 incremental_got_plt section.
3552 * object.h (Got_offset_list::get_list): New function.
3553 (Got offset_list::for_all_got_offsets): New function.
3554 (Sized_relobj::local_got_offset_list): New function.
3555 * powerpc.cc (Target_powerpc::got_size): Add const.
3556 (Target_powerpc::got_entry_count): New function.
3557 (Target_powerpc::plt_entry_count): New function.
3558 (Target_powerpc::first_plt_entry_offset): New function.
3559 (Target_powerpc::plt_entry_size): New function.
3560 (Output_data_plt_powerpc::entry_count): New function.
3561 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3562 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3563 * sparc.cc (Target_sparc::got_size): Add const.
3564 (Target_sparc::got_entry_count): New function.
3565 (Target_sparc::plt_entry_count): New function.
3566 (Target_sparc::first_plt_entry_offset): New function.
3567 (Target_sparc::plt_entry_size): New function.
3568 (Output_data_plt_sparc::entry_count): New function.
3569 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3570 (Output_data_plt_sparc::get_plt_entry_size): New function.
3571 * symtab.h (Symbol::got_offset_list): New function.
3572 (Symbol_table::for_all_symbols): New function.
3573 * target.h (Sized_target::got_entry_count): New function.
3574 (Sized_target::plt_entry_count): New function.
3575 (Sized_target::plt_entry_size): New function.
3576 * x86_64.cc (Target_x86_64::got_size): Add const.
3577 (Target_x86_64::got_entry_count): New function.
3578 (Target_x86_64::plt_entry_count): New function.
3579 (Target_x86_64::first_plt_entry_offset): New function.
3580 (Target_x86_64::plt_entry_size): New function.
3581 (Output_data_plt_x86_64::entry_count): New function.
3582 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3583 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3584
09ec0418
CC
35852010-08-12 Cary Coutant <ccoutant@google.com>
3586
3587 * archive.cc: Include incremental.h.
3588 (Archive::Archive): Initialize incremental_info_.
3589 (Archive::include_member): Record archive members in incremental info.
3590 (Add_archive_symbols::run): Record begin and end of an archive in
3591 incremental info.
3592 (Lib_group::include_member): Record objects in incremental info.
3593 * archive.h (Incremental_archive_entry): Forward declaration.
3594 (Archive::set_incremental_info): New member function.
3595 (Archive::incremental_info): New member function.
3596 (Archive::Unused_symbol_iterator): New class.
3597 (Archive::unused_symbols_begin): New member function.
3598 (Archive::unused_symbols_end): New member function.
3599 (Archive::incremental_info_): New data member.
3600 * incremental-dump.cc (find_input_containing_global): New function.
3601 (dump_incremental_inputs): Dump new incremental info sections.
3602 * incremental.cc: Include symtab.h.
3603 (Output_section_incremental_inputs): New class.
3604 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3605 new incremental info sections.
3606 (Sized_incremental_binary::do_check_inputs): Likewise.
3607 (Incremental_inputs::report_archive): Remove.
3608 (Incremental_inputs::report_archive_begin): New function.
3609 (Incremental_inputs::report_archive_end): New function.
3610 (Incremental_inputs::report_object): New function.
3611 (Incremental_inputs::finalize_inputs): Remove.
3612 (Incremental_inputs::report_input_section): New function.
3613 (Incremental_inputs::report_script): Rewrite.
3614 (Incremental_inputs::finalize): Do nothing but finalize string table.
3615 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3616 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3617 (Incremental_inputs::create_data_sections): New function.
3618 (Incremental_inputs::relocs_entsize): New function.
3619 (Output_section_incremental_inputs::set_final_data_size): New function.
3620 (Output_section_incremental_inputs::do_write): New function.
3621 (Output_section_incremental_inputs::write_header): New function.
3622 (Output_section_incremental_inputs::write_input_files): New function.
3623 (Output_section_incremental_inputs::write_info_blocks): New function.
3624 (Output_section_incremental_inputs::write_symtab): New function.
3625 * incremental.h (Incremental_script_entry): Forward declaration.
3626 (Incremental_object_entry): Forward declaration.
3627 (Incremental_archive_entry): Forward declaration.
3628 (Incremental_inputs): Forward declaration.
3629 (Incremental_inputs_header_data): Remove.
3630 (Incremental_inputs_header): Remove.
3631 (Incremental_inputs_header_write): Remove.
3632 (Incremental_inputs_entry_data): Remove.
3633 (Incremental_inputs_entry): Remove.
3634 (Incremental_inputs_entry_write): Remove.
3635 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3636 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3637 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3638 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3639 Likewise.
3640 (Incremental_input_entry): New class.
3641 (Incremental_script_entry): New class.
3642 (Incremental_object_entry): New class.
3643 (Incremental_archive_entry): New class.
3644 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3645 (Incremental_inputs::report_inputs): Remove.
3646 (Incremental_inputs::report_archive): Remove.
3647 (Incremental_inputs::report_archive_begin): New function.
3648 (Incremental_inputs::report_archive_end): New function.
3649 (Incremental_inputs::report_object): Change prototype.
3650 (Incremental_inputs::report_input_section): New function.
3651 (Incremental_inputs::report_script): Change prototype.
3652 (Incremental_inputs::get_reloc_count): New function.
3653 (Incremental_inputs::set_reloc_count): New function.
3654 (Incremental_inputs::create_data_sections): New function.
3655 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3656 (Incremental_inputs::inputs_section): New function.
3657 (Incremental_inputs::symtab_section): New function.
3658 (Incremental_inputs::relocs_section): New function.
3659 (Incremental_inputs::get_stringpool): Add const.
3660 (Incremental_inputs::command_line): Add const.
3661 (Incremental_inputs::inputs): Remove.
3662 (Incremental_inputs::command_line_key): New function.
3663 (Incremental_inputs::input_file_count): New function.
3664 (Incremental_inputs::input_files): New function.
3665 (Incremental_inputs::relocs_entsize): New function.
3666 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3667 (Incremental_inputs::finalize_inputs): Remove.
3668 (Incremental_inputs::Input_info): Remove.
3669 (Incremental_inputs::lock_): Remove.
3670 (Incremental_inputs::inputs_): Change type.
3671 (Incremental_inputs::inputs_map_): Remove.
3672 (Incremental_inputs::current_object_entry_): New data member.
3673 (Incremental_inputs::inputs_section_): New data member.
3674 (Incremental_inputs::symtab_section_): New data member.
3675 (Incremental_inputs::relocs_section_): New data member.
3676 (Incremental_inputs::reloc_count_): New data member.
3677 (Incremental_inputs_reader): New class.
3678 (Incremental_symtab_reader): New class.
3679 (Incremental_relocs_reader): New class.
3680 * layout.cc (Layout::finalize): Move finalization of incremental info
3681 and creation of incremental info sections to follow finalization of
3682 symbol table. Set offsets for postprocessing sections.
3683 (Layout::create_incremental_info_sections): Call
3684 Incremental_inputs::create_data_sections. Add incremental symtab
3685 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3686 sections to layout after input sections.
3687 * layout.h (struct Timespec): Forward declaration.
3688 (Layout::incremental_inputs): Add const.
3689 (Layout::create_incremental_info_sections): Add parameter.
3690 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3691 * object.cc: Include incremental.h.
3692 (Relobj::finalize_incremental_relocs): New function.
3693 (Sized_relobj::do_layout): Record input sections in incremental info.
3694 * object.h (Object::output_section): New function.
3695 (Object::output_section_offset): Moved from Relobj.
3696 (Object::get_incremental_reloc_base): New function.
3697 (Object::get_incremental_reloc_count): New function.
3698 (Object::do_output_section): New function.
3699 (Object::do_output_section_offset): Moved from Relobj.
3700 (Object::do_get_incremental_reloc_base): New function.
3701 (Object::do_get_incremental_reloc_count): New function.
3702 (Object::Object): Initialize new data members.
3703 (Relobj::output_section): Renamed do_output_section and moved to
3704 protected.
3705 (Relobj::output_section_offset): Moved to Object.
3706 (Relobj::do_get_incremental_reloc_base): New function.
3707 (Relobj::do_get_incremental_reloc_count): New function.
3708 (Relobj::allocate_incremental_reloc_counts): New function.
3709 (Relobj::count_incremental_reloc): New function.
3710 (Relobj::finalize_incremental_relocs): New function.
3711 (Relobj::next_incremental_reloc_index): New function.
3712 (Relobj::reloc_counts_): New data member.
3713 (Relobj::reloc_bases_): New data member.
3714 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3715 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3716 (Sized_relobj::incremental_relocs_scan): New function.
3717 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3718 (Sized_relobj::incremental_relocs_write): New function.
3719 (Sized_relobj::incremental_relocs_write_reltype): New function.
3720 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3721 incremental link.
3722 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3723 archives and object files elsewhere.
3724 (Add_symbols::run): Report object files here.
3725 (Finish_group::run): Report end of archive at end of group.
3726 * reloc.cc: Include layout.h, incremental.h.
3727 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3728 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3729 (Sized_relobj::incremental_relocs_scan): New function.
3730 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3731 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3732 (Sized_relobj::incremental_relocs_write): New function.
3733 (Sized_relobj::incremental_relocs_write_reltype): New function.
3734 * script.cc (read_input_script): Rewrite test for incremental link.
3735 Change call to Incremental_inputs::report_script.
3736 * symtab.h (Symbol_table::first_global_index): New function.
3737 (Symbol_table::output_count): New function.
3738
ce0d1972
DK
37392010-08-12 Doug Kwan <dougkwan@google.com>
3740
3741 * arm.cc (Target_arm::merge_object_attributes): Check command line
3742 options --no-wchar-size-warning and --no-enum-size-warning.
3743 * options.h (General_options): Add ld-compatible options
3744 --no-enum-size-warning and --no-wchar-size-warning.
3745
6e5710ce
ILT
37462010-08-04 Ian Lance Taylor <iant@google.com>
3747
3748 * x86_64.cc (Target_x86_64::Scan::local): Use
3749 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3750 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3751 (Target_x86_64::Scan::global): Likewise.
3752 (Target_x86_64::Relocate::relocate): Likewise.
3753 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3754 Likewise.
3755
fef830db
CC
37562010-08-03 Cary Coutant <ccoutant@google.com>
3757
3758 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3759 to reserve space in merged_strings vector. Keep total input size
3760 for stats.
3761 (Output_merge_string::do_print_merge_stats): Print total input size.
3762 * merge.h (Output_merge_string): Add input_size_ field.
3763 * stringpool.cc (Stringpool_template::string_length): Move
3764 implementations out of Stringpool_template class and place in
3765 stringpool.h.
3766 * stringpool.h (string_length): Move out of Stringpool_template.
3767
1e3811b0
ILT
37682010-08-03 Ian Lance Taylor <iant@google.com>
3769
3770 PR 11712
3771 * layout.cc (relaxation_loop_body): If address of load segment is
3772 set, adjust address to include headers if possible.
3773
7af0c620
ILT
37742010-08-03 Ian Lance Taylor <iant@google.com>
3775
3776 * version.cc (version_string): Bump to 1.10.
3777
22f0da72
ILT
37782010-08-03 Ian Lance Taylor <iant@google.com>
3779
3780 PR 11805
3781 * layout.h (enum Output_section_order): Define.
3782 (class Layout): Update declarations.
3783 * layout.cc (Layout::get_output_section): Add order parameter.
3784 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3785 is_first_non_relro parameters. Change all callers.
3786 (Layout::choose_output_section): Likewise.
3787 (Layout::add_output_section_data): Likewise.
3788 (Layout::make_output_section): Likewise. Set order.
3789 (Layout::default_section_order): New function.
3790 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3791 * output.cc (Output_section::Output_section): Initialize order_.
3792 Don't initialize deleted fields.
3793 (Output_segment::Output_segment): Don't initialize deleted
3794 fields.
3795 (Output_segment::add_output_section_to_load): New function
3796 replacing add_output_section. Change all callers to call this or
3797 add_output_section_to_nonload.
3798 (Output_segment::add_output_section_to_nonload): New function.
3799 (Output_segment::remove_output_section): Rewrite.
3800 (Output_segment::add_initial_output_data): Likewise.
3801 (Output_segment::has_any_data_sections): Likewise.
3802 (Output_segment::is_first_section_relro): Likewise.
3803 (Output_segment::maximum_alignment): Likewise.
3804 (Output_segment::has_dynamic_reloc): New function replacing
3805 dynamic_reloc_count. Change all callers.
3806 (Output_segment::has_dynamic_reloc_list): New function replacing
3807 dynamic_reloc_count_list. Change all callers.
3808 (Output_segment::set_section_addresses): Rewrite.
3809 (Output_segment::set_offset): Rewrite.
3810 (Output_segment::find_first_and_last_list): Remove.
3811 (Output_segment::set_tls_offsets): Rewrite.
3812 (Output_segment::first_section_load_address): Likewise.
3813 (Output_segment::output_section_count): Likewise.
3814 (Output_segment::section_with_lowest_load_address): Likewise.
3815 (Output_segment::write_section_headers): Likewise.
3816 (Output_segment::print_sections_to_map): Likewise.
3817 * output.h (class Output_data): Remove dynamic_reloc_count_
3818 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3819 (Output_data::add_dynamic_reloc): Rewrite.
3820 (Output_data::has_dynamic_reloc): New function.
3821 (Output_data::dynamic_reloc_count): Remove.
3822 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3823 is_last_relro_, is_first_non_relro_, is_interp_,
3824 is_dynamic_linker_section_ fields. Add order and set_order
3825 functions. Remove is_relro_local, set_is_relro_local,
3826 is_last_relro, set_is_last_relro, is_first_non_relro,
3827 set_is_first_non_relro functions, is_interp, set_is_interp,
3828 is_dynamic_linker_section, and set_is_dynamic_linker_section
3829 functions.
3830 (class Output_segment): Change Output_data_list from std::list to
3831 std:;vector. Add output_lists_ field. Remove output_data_ and
3832 output_bss_ fields. Update declarations.
3833
3ff2ccb0
ILT
38342010-08-02 Ian Lance Taylor <iant@google.com>
3835
3836 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3837 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3838 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3839
88a4108b
ILT
38402010-08-02 Ian Lance Taylor <iant@google.com>
3841
3842 PR 11855
3843 * script.cc (Script_options::Script_options): Initialize
3844 symbol_definitions_ and symbol_references_.
3845 (Script_options::add_symbol_assignment): Update
3846 symbol_definitions_ and symbol_references_.
3847 (Script_options::add_symbol_reference): New function.
3848 (script_symbol): New function.
3849 * script.h (class Script_options): Add symbol_definitions_ and
3850 symbol_references_ fields.
3851 (Script_options::referenced_const_iterator): New type.
3852 (Script_options::referenced_begin): New function.
3853 (Script_options::referenced_end): New function.
3854 (Script_options::is_referenced): New function.
3855 (Script_options::any_unreferenced): New function.
3856 * script-c.h (script_symbol): Declare.
3857 * yyscript.y (exp): Call script_symbol.
3858 * symtab.cc: Include "script.h".
3859 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3860 Change all callers. Check symbols referenced by scripts.
3861 (Symbol_table::add_undefined_symbols_from_command_line): Add
3862 layout parameter. Change all callers.
3863 (Symbol_table::do_add_undefined_symbols_from_command_line):
3864 Likewise. Break out loop body. Check symbols referenced by
3865 scripts.
3866 (Symbol_table::add_undefined_symbol_from_command_line): New
3867 function broken out of
3868 do_add_undefined_symbols_from_command_line.
3869 * symtab.h (class Symbol_table): Update declarations.
3870 * archive.cc: Include "layout.h".
3871 (Archive::should_include_member): Add layout parameter. Change
3872 all callers. Check for symbol mentioned in expression.
3873 * archive.h (class Archive): Update declaration.
3874 * object.cc (Sized_relobj::do_should_include_member): Add layout
3875 parameter.
3876 * object.h (Object::should_include_member): Add layout parameter.
3877 Change all callers.
3878 (Object::do_should_include_member): Add layout parameter.
3879 (class Sized_relobj): Update declaration.
3880 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3881 parameter.
3882 * dynobj.h (class Sized_dynobj): Update declaration.
3883 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3884 layout parameter.
3885 * plugin.h (class Sized_pluginobj): Update declaration.
3886
5f1ab67a
ILT
38872010-08-02 Ian Lance Taylor <iant@google.com>
3888
3889 PR 11866
3890 * output.cc (Output_segment::set_offset): Search for the first and
3891 last sections rather than assuming that the list is in order.
3892 (Output_segment::find_first_and_last_list): New function.
3893 * output.h (class Output_segment): Update declarations.
3894 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3895 (relro_strip_test_SOURCES): New variable.
3896 (relro_strip_test_DEPENDENCIES): New variable.
3897 (relro_strip_test_LDFLAGS): New variable.
3898 (relro_strip_test_LDADD): New variable.
3899 (relro_strip_test.so): New target.
3900
a8df5856
ILT
39012010-08-02 Ian Lance Taylor <iant@google.com>
3902
3903 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3904 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3905 (Target_i386::got_tlsdesc_section): New function.
3906 (Target_i386::got_section): Create space for GOT entries for
3907 TLSDESC relocations.
3908 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3909 R_386_TLS_GOTDESC.
3910 (Target_i386::Scan::global): Likewise.
3911 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3912 using TLSDESC GOT.
3913 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3914 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3915 (Target_x86_64::got_tlsdesc_section): New function.
3916 (Target_x86_64::got_section): Create space for GOT entries for
3917 TLSDESC relocations.
3918 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3919 R_386_TLS_GOTDESC.
3920 (Target_x86_64::Scan::global): Likewise.
3921 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3922 using TLSDESC GOT.
3923
0c10a0a6
ILT
39242010-08-02 Ian Lance Taylor <iant@google.com>
3925
3926 * testsuite/final_layout.sh: Use dc to convert from hex to
3927 decimal.
3928
41cbeecc
ST
39292010-07-29 Sriraman Tallam <tmsriram@google.com>
3930
3931 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3932 paramter to the call to gold::gc_process_relocs.
3933 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3934 paramter to the call to gold::gc_process_relocs.
3935 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3936 parameter to the call to gold::gc_process_relocs.
3937 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3938 template parameter to the call to gold::gc_process_relocs.
3939 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3940 paramter to the call to gold::gc_process_relocs.
3941 * gc.h (get_embedded_addend_size): New function.
3942 (gc_process_relocs): Save the size of the reloc for use by ICF.
3943 * icf.cc (get_section_contents): Get the addend from the text section
3944 for SHT_REL relocation sections.
3945 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3946 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3947 * int_encoding.h (read_from_pointer): New overloaded function.
3948 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3949 * testsuite/icf_sht_rel_addend_test.sh: New file.
3950 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3951 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3952
6ea55b82
RW
39532010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3954
3955 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3956 * Makefile.in: Regenerate.
3957 * testsuite/Makefile.in: Regenerate.
3958
9691462b
ILT
39592010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3960
3961 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3962 * gold/testsuite/debug_msg.cc: Likewise.
3963 * gold/testsuite/odr_violation1.cc
3964 * gold/testsuite/odr_violation2.cc
3965
76897331
CC
39662010-07-21 Cary Coutant <ccoutant@google.com>
3967
3968 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3969 string, and length fields.
3970 (Output_merge_string::Merged_strings_list): New type.
3971 (Output_merge_string::Merged_strings_lists): New typedef.
3972 (Output_merge_string): Replace merged_strings_ with
3973 merged_strings_lists_.
3974 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3975 Merged_strings_list per input object and section. Don't store pointer
3976 to the string. Don't store length with each merged string entry.
3977 (Output_merge_string::finalize_merged_data): Loop over list of merged
3978 strings lists. Recompute length of each merged string.
3979
78384e8f
CC
39802010-07-15 Cary Coutant <ccoutant@google.com>
3981
3982 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3983 here.
3984
783659f9
ILT
39852010-07-14 Ian Lance Taylor <iant@google.com>
3986
3987 * descriptors.cc (Descriptors::open): Report correct name in error
3988 message.
3989
131687b4
DK
39902010-07-13 Doug Kwan <dougkwan@google.com>
3991
3992 * arm.cc (Arm_input_section::Arm_input_section): For a
3993 SHT_ARM_EXIDX section, always keeps the input sections.
3994 (Arm_input_section::set_exidx_section_link): New method.
3995 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3996 has_errors_ to false.
3997 (Arm_exidx_input_section::has_errors,
3998 Arm_exidx_input_section::set_has_errors): New methods.
3999 (Arm_exidx_input_section::has_errors_): New data member.
4000 (Arm_relobj::get_exidx_shndx_list): New method.
4001 (Arm_output_section::append_text_sections_to_list): Do not skip
4002 section without SHF_EXECINSTR.
4003 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4004 errors.
4005 (Arm_relobj::make_exidx_input_section): Add new parameter for text
4006 section header. Make error messages more verbose. Check for
4007 a non-executable section linked to an EXIDX section.
4008 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4009 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4010 check that there is no deferred EXIDX section if we exit early.
4011 Instead of not making an EXIDX section in case of an error, make one
4012 and set the has_errors flag of it.
4013 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4014 in a relocatable link.
4015 (Target_arm::do_relax): Look for the EXIDX output section instead of
4016 assuming that it is called .ARM.exidx.
4017 (Target_arm::fix_exidx_coverage): Add a new parameter for input
4018 section list. Do not check for SHF_EXECINSTR section flags but
4019 skip any input section with errors.
4020 * output.cc (Output_section::Output_section): Initialize
4021 always_keeps_input_sections_ to false.
4022 (Output_section::add_input_section): Check for
4023 always_keeps_input_sections_.
4024 * output.h (Output_section::always_keeps_input_sections,
4025 Output_section::set_always_keeps_input_sections): New methods.
4026 (Output_section::always_keeps_input_sections): New data member.
4027
69517287
RÁE
40282010-07-13 Rafael Espindola <espindola@google.com>
4029
4030 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4031 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4032
82742395
ILT
40332010-07-13 Philip Herron <herron.philip@googlemail.com>
4034 Ian Lance Taylor <iant@google.com>
4035
4036 * output.h (Output_section_lookup_maps::add_merge_section):
4037 Correct check of whether value was inserted.
4038 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4039 (Output_section_lookup_maps::add_relaxed_input_section):
4040 Likewise.
4041 * arm.cc (Target_arm::got_section): Remove used local os.
4042 * i386.cc (Target_i386::got_section): Likewise.
4043 * x86_64.cc (Target_x86_64::got_section): Likewise.
4044 * sparc.cc (Target_sparc::got_section): Likewise.
4045 (Target_sparc::relocate): Remove unused local have_got_offset.
4046 * powerpc.cc (Target_powerpc::relocate): Likewise.
4047
f2d707b5
ILT
40482010-07-13 Ian Lance Taylor <iant@google.com>
4049
241531d6
ILT
4050 * compressed_output.cc (zlib_decompress): Fix signature in
4051 !HAVE_ZLIB_H case.
4052
f2d707b5
ILT
4053 * archive.cc (Archive::include_member): Unlock an external member
4054 of a thin archive. Don't bother to delete an object we know is
4055 NULL.
4056
a2e47362
CC
40572010-07-12 Cary Coutant <ccoutant@google.com>
4058
4059 * compressed_output.cc (zlib_decompress): New function.
4060 (get_uncompressed_size): New function.
4061 (decompress_input_section): New function.
4062 * compressed_output.h (get_uncompressed_size): New function.
4063 (decompress_input_section): New function.
4064 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
4065 Handle compressed debug sections.
4066 * layout.cc (is_compressed_debug_section): New function.
4067 (Layout::output_section_name): Map compressed section names to
4068 canonical names.
4069 * layout.h (is_compressed_debug_section): New function.
4070 (is_debug_info_section): Recognize compressed debug sections.
4071 * merge.cc: Include compressed_output.h.
4072 (Output_merge_data::do_add_input_section): Handle compressed
4073 debug sections.
4074 (Output_merge_string::do_add_input_section): Handle compressed
4075 debug sections.
4076 * object.cc: Include compressed_output.h.
4077 (Sized_relobj::Sized_relobj): Initialize new data members.
4078 (build_compressed_section_map): New function.
4079 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
4080 * object.h (Object::section_is_compressed): New method.
4081 (Object::do_section_is_compressed): New method.
4082 (Sized_relobj::Compressed_section_map): New type.
4083 (Sized_relobj::do_section_is_compressed): New method.
4084 (Sized_relobj::compressed_sections_): New data member.
4085 * output.cc (Output_section::add_input_section): Handle compressed
4086 debug sections.
4087 * reloc.cc: Include compressed_output.h.
4088 (Sized_relobj::write_sections): Handle compressed debug sections.
4089
ce279a62
CC
40902010-07-08 Cary Coutant <ccoutant@google.com>
4091
4092 * resolve.cc (Symbol_table::resolve): Remember whether undef was
4093 weak when resolving to a dynamic def.
4094 (Symbol_table::should_override): Add adjust_dyndef flag; set it
4095 for weak undef/dynamic def cases. Adjust callers.
4096 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
4097 undef_binding_weak_.
4098 (Symbol_table::sized_write_globals): Adjust symbol binding.
4099 (Symbol_table::sized_write_symbol): Add binding parameter.
4100 * symtab.h (Symbol::set_undef_binding): New method.
4101 (Symbol::is_undef_binding_weak): New method.
4102 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
4103 (Symbol_table::should_override): Add new parameter.
4104 (Symbol_table::sized_write_symbol): Add new parameter.
4105
4106 * testsuite/weak_undef_file1.cc: Add new test case.
4107 * testsuite/weak_undef_file2.cc: Fix header comment.
4108 * testsuite/weak_undef_test.cc: Add new test case.
4109
b2286c10
DK
41102010-06-29 Doug Kwan <dougkwan@google.com>
4111
4112 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
4113 Initialize USE_SYMBOL_.
4114 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
4115 definition.
4116 (Arm_reloc_property::uses_symbol_): New data member declaration.
4117 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
4118 uses symbol value and symbol is undefined but not weakly undefined.
4119
4802450a
RÁE
41202010-06-28 Rafael Espindola <espindola@google.com>
4121
4122 * plugin.cc (Plugin::load): Use dlerror.
4123
e5ca47ba
ILT
41242010-06-26 Jeffrey Yaskin <jyasskin@google.com>
4125
4126 * symtab.cc (detect_odr_violations): When reporting an ODR
4127 violation, report an object where the symbol is defined.
4128
8a75a161
DK
41292010-06-25 Doug Kwan <dougkwan@google.com>
4130
4131 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
4132 (Target_arm::section_may_have_icf_unsafe_pointers): New method
4133 definition.
4134 (Target_arm::Scan::local_reloc_may_be_function_pointer,
4135 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
4136 target hook to detect function points.
4137 (Target_arm::Scan::possible_function_pointer_reloc): New method.
4138 * icf.h (Icf::check_section_for_function_pointers): Change type of
4139 parameter SECTION_NAME to const reference to std::string. Use
4140 target hook to determine if section may have unsafe pointers.
4141 * target.h (Target::section_may_have_icf_unsafe_pointers): New
4142 method definition.
4143
42218b9f
RÁE
41442010-06-21 Rafael Espindola <espindola@google.com>
4145
4146 * fileread.cc (Input_file::find_fie): New
4147 (Input_file::open): Use Input_file::find_fie.
4148 * fileread.h (Input_file::find_fie): New
4149 * plugin.cc (set_extra_library_path): New.
4150 (Plugin::load): Add set_extra_library_path to the transfer vector.
4151 (Plugin_manager::set_extra_library_path): New.
4152 (Plugin_manager::add_input_file): Use the extra search path if set.
4153 (set_extra_library_path(): New.
4154 * plugin.h (Plugin_manager): Add set_extra_library_path and
4155 extra_search_path_.
4156
a0506cca
CC
41572010-06-19 Cary Coutant <ccoutant@google.com>
4158
4159 * layout.cc (gdb_sections): Add .debug_types.
4160 (lines_only_debug_sections): Likewise.
4161
6508b958
RÁE
41622010-06-18 Rafael Espindola <espindola@google.com>
4163
4164 * plugin.cc (add_input_file,add_input_library)
4165 (Plugin_manager::add_input_file): Make filename arguments const.
4166 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4167 const.
4168
3e235302
DK
41692010-06-16 Doug Kwan <dougkwan@google.com>
4170
4171 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4172 .ARM.attributes section if we have not merged any input
4173 attributes sections.
4174
106e8a6c
DK
41752010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4176
4177 * arm.cc: Allow combining objects with no EABI version
4178 information.
4179
91ff43fe
RÁE
41802010-06-15 Rafael Espindola <espindola@google.com>
4181
4182 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4183
68ed838c
ILT
41842010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4185
4186 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4187 (struct iovec): Correct !HAVE_READV definition.
4188
f3a2388f
CC
41892010-06-10 Cary Coutant <ccoutant@google.com>
4190
4191 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4192 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4193 reloc sections.
4194 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4195
4196 PR 11683
4197 * symtab.h (Symbol::is_placeholder): New member function.
4198 * target-reloc.h (relocate_section): Check for placeholder symbols.
4199
4200 * testsuite/Makefile.am (plugin_test_8): New test.
4201 (plugin_test_9): New test.
4202 * testsuite/Makefile.in: Regenerate.
4203
e1df38aa
NC
42042010-06-09 Nick Clifton <nickc@redhat.com>
4205
4206 * yyscript.y (input_list_element): Allow strings prefixed with
4207 the '-' character. Treat these as libraries.
4208 * script.cc (script_add_library): New function. Adds a library
4209 specified by "-l<name>" found in an input script.
4210 * script-c.h: Add prototype for script_add_library.
4211
25bbe950
DK
42122010-06-07 Doug Kwan <dougkwan@google.com>
4213
4214 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4215 Restrict stub-group size to be within long conditional branch
4216 range when working around cortex-A8 erratum.
4217
0f32ea4c
ILT
42182010-06-07 Damien Diederen <dd@crosstwine.com>
4219
4220 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4221 #ifdef typo.
4222
8fe2a369
ST
42232010-06-03 Sriraman Tallam <tmsriram@google.com>
4224
4225 PR gold/11658
4226 * output.cc
4227 (Output_section::Input_section_sort_entry::compare_section_ordering):
4228 Change to return non-zero correctly.
4229 (Output_section::Input_section_sort_section_order_index_compare
4230 ::operator()): Change to fix ambiguity in comparisons.
4231
6e9ba2ca
ST
42322010-06-01 Sriraman Tallam <tmsriram@google.com>
4233
4234 * gold.h (is_wildcard_string): New function.
4235 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4236 (Layout::layout_eh_frame): Ditto.
4237 (Layout::find_section_order_index): New method.
4238 (Layout::read_layout_from_file): New method.
4239 * layout.h (Layout::find_section_order_index): New method.
4240 (Layout::read_layout_from_file): New method.
4241 (Layout::input_section_position_): New private member.
4242 (Layout::input_section_glob_): New private member.
4243 * main.cc (main): Call read_layout_from_file here.
4244 * options.h (--section-ordering-file): New option.
4245 * output.cc (Output_section::input_section_order_specified_): New
4246 member.
4247 (Output_section::Output_section): Initialize new member.
4248 (Output_section::add_input_section): Add new parameter.
4249 Keep input sections when --section-ordering-file is used.
4250 (Output_section::set_final_data_size): Sort input sections when
4251 section ordering file is specified.
4252 (Output_section::Input_section_sort_entry): Add new parameter.
4253 Check sorting type.
4254 (Output_section::Input_section_sort_entry::compare_section_ordering):
4255 New method.
4256 (Output_section::Input_section_sort_compare::operator()): Change to
4257 consider section_order_index.
4258 (Output_section::Input_section_sort_init_fini_compare::operator()):
4259 Change to consider section_order_index.
4260 (Output_section::Input_section_sort_section_order_index_compare
4261 ::operator()): New method.
4262 (Output_section::sort_attached_input_sections): Change to sort
4263 according to section order when specified.
e1df38aa
NC
4264 (Output_section::add_input_section<32, true>): Add new parameter.
4265 (Output_section::add_input_section<64, true>): Add new parameter.
4266 (Output_section::add_input_section<32, false>): Add new parameter.
4267 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4268 * output.h (Output_section::add_input_section): Add new parameter.
4269 (Output_section::input_section_order_specified): New
4270 method.
4271 (Output_section::set_input_section_order_specified): New method.
4272 (Input_section::Input_section): Initialize section_order_index_.
4273 (Input_section::section_order_index): New method.
4274 (Input_section::set_section_order_index): New method.
4275 (Input_section::section_order_index_): New member.
4276 (Input_section::Input_section_sort_section_order_index_compare): New
4277 struct.
4278 (Output_section::input_section_order_specified_): New member.
4279 * script-sections.cc (is_wildcard_string): Delete and move modified
4280 method to gold.h.
4281 (Output_section_element_input::Output_section_element_input): Modify
4282 call to is_wildcard_string.
4283 (Output_section_element_input::Input_section_pattern
4284 ::Input_section_pattern): Ditto.
4285 (Output_section_element_input::Output_section_element_input): Ditto.
4286 * testsuite/Makefile.am (final_layout): New test case.
4287 * testsuite/Makefile.in: Regenerate.
4288 * testsuite/final_layout.cc: New file.
4289 * testsuite/final_layout.sh: New file.
4290
3537c84b
RÁE
42912010-06-01 Rafael Espindola <espindola@google.com>
4292
4293 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4294
105b6afd
RÁE
42952010-06-01 Rafael Espindola <espindola@google.com>
4296
4297 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4298 visibility of symbols.
4299
29e11421
DK
43002010-05-27 Doug Kwan <dougkwan@google.com>
4301
4302 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4303 from start of output section instead of address for a local symbol
4304 in a merged or relaxed section when doing a relocatable link.
4305
5e0f337e
RÁE
43062010-05-26 Rafael Espindola <espindola@google.com>
4307
4308 PR 11604
4309 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4310 adding sections the garbage collector removed.
4311 * gold/testsuite/Makefile.am: Add test.
4312 * gold/testsuite/Makefile.in: Regenerate.
4313 * gold/testsuite/plugin_test_7.sh: New.
4314 * gold/testsuite/plugin_test_7_1.c: New.
4315 * gold/testsuite/plugin_test_7_2.c: New.
4316
f4187277
RÁE
43172010-05-26 Rafael Espindola <espindola@google.com>
4318
4319 * script-sections.cc (Output_section_definition::set_section_addresses):
4320 Check for --section-start.
4321
5c388529
DK
43222010-05-26 Doug Kwan <dougkwan@google.com>
4323
4324 * arm.cc (Arm_scan_relocatable_relocs): New class.
4325 (Target_arm::relocate_special_relocatable): New method.
4326 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4327 (Arm_relocate_functions::thumb_branch_common): Same.
4328 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4329 instead of Default_scan_relocatable_relocs.
4330 * target-reloc.h (relocate_for_relocatable): Let target handle
4331 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4332 * target.h (Sized_target::relocate_special_relocatable): New method.
4333
bca1c3ae
ILT
43342010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4335
4336 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4337
0439c796
DK
43382010-05-23 Doug Kwan <dougkwan@google.com>
4339
4340 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4341 instead of a cast.
4342 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4343 with a direct branch, not a conditional branch, to a stub.
4344 * merge.cc (Output_merge_base::record_input_section): New method
4345 defintion.
4346 (Output_merge_data::do_add_input_section): Record input section if
4347 keeps-input-sections flag is set.
4348 (Output_merge_string::do_add_input_section): Ditto.
4349 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4350 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4351 INPUT_SECTIONS_.
4352 (Output_merge_base::keeps_input_sections,
4353 Output_merge_base::set_keeps_input_sections,
4354 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4355 method definitions.
4356 (Output_merge_base::Input_sections): New type declaration.
4357 (Output_merge_base::input_sections_begin,
4358 Output_merge_base::input_sections_end,
4359 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4360 (Output_merge_base::bool keeps_input_sections_,
4361 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4362 Output_merge_base::input_sections_): New data members.
4363 (Output_merge_data::do_set_keeps_input_sections): New method
4364 defintion.
4365 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4366 * output.cc (Output_section::Input_section::relobj): Move method
4367 defintion from class declaration to here and handle merge sections.
4368 (Output_section::Input_section::shndx): Ditto.
4369 (Output_section::Output_section): Remove initializations of removed
4370 data members and initialize new data member LOOKUP_MAPS_.
4371 (Output_section::add_input_section): Set keeps-input-sections flag
4372 for a newly created merge output section as appropriate. Adjust code
4373 to use Output_section_lookup_maps class.
4374 (Output_section::add_relaxed_input_section): Adjst code for lookup
4375 maps code refactoring.
4376 (Output_section::add_merge_input_section): Add a new parameter
4377 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4378 class. If adding input section to a newly created merge output
4379 section fails, remove the new merge section.
4380 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4381 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4382 (Output_section::find_merge_section): Ditto.
4383 (Output_section::build_lookup_maps): New method defintion.
4384 (Output_section::find_relaxed_input_section): Adjust code to use
4385 Output_section_lookup_maps class.
4386 (Output_section::get_input_sections): Export merge sections. Adjust
4387 code to use Output_section_lookup_maps class.
4388 (Output_section:::add_script_input_section): Adjust code to use
4389 Output_section_lookup_maps class. Update lookup maps for merge
4390 sections also.
4391 (Output_section::discard_states): Use Output_section_lookup_maps.
4392 (Output_section::restore_states): Same.
4393 * output.h (Merge_section_properties): Move class defintion out of
4394 Output_section.
4395 (Output_section_lookup_maps): New class.
4396 (Output_section::Input_section::is_merge_section): New method
4397 defintion.
4398 (Output_section::Input_section::relobj): Move defintion out of class
4399 defintion. Declare method only.
4400 (Output_section::Input_section::shndx): Ditto.
4401 (Output_section::Input_section::output_merge_base): New method defintion.
4402 (Output_section::Input_section::u2_.pomb): New union field.
4403 (Output_section::Merge_section_by_properties_map,
4404 Output_section::Output_section_data_by_input_section_map,
4405 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4406 Remove types.
4407 (Output_section::add_merge_input_section): Add new parameter
4408 KEEPS_INPUT_SECTIONS.
4409 (Output_section::build_lookup_maps): New method declaration.
4410 (Output_section::merge_section_map_,
4411 Output_section::merge_section_by_properties_map_,
4412 Output_section::relaxed_input_section_map_,
4413 Output_section::is_relaxed_input_section_map_valid_): Remove data
4414 members.
4415 (Output_section::lookup_maps_): New data member.
4416
76295588
L
44172010-05-21 Doug Kwan <dougkwan@google.com>
4418
4419 PR gold/11619
4420 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4421 avoid a compilation error.
4422
d103a984
RÁE
44232010-05-19 Rafael Espindola <espindola@google.com>
4424
4425 * script-sections.cc (Output_section_definition::allocate_to_segment):
4426 Update the phdrs_list even when the output section is NULL.
4427 * testsuite/Makefile.am: Add test.
4428 * testsuite/Makefile.in: Regenerate.
4429 * testsuite/script_test_9.cc: New.
4430 * testsuite/script_test_9.sh: New.
4431 * testsuite/script_test_9.t: New.
4432
6625d24e
DK
44332010-05-19 Doug Kwan <dougkwan@google.com>
4434
4435 * arm.cc (Arm_input_section::original_size): New method.
4436 (Arm_input_section::do_addralign): Add a cast.
4437 (Arm_input_section::do_output_offset): Remove static cast.
4438 (Arm_input_section::original_addralign,
4439 Arm_input_section::original_size_): Change type to uint32_t.
4440 (Arm_input_section::init): Add safe casts for section alignment
4441 and size.
4442 (Arm_input_section::set_final_data_size): Do not set address and
4443 offset of stub table.
4444 (Arm_output_section::fix_exidx_coverage): Change use of of
4445 Output_section::Simple_input_section to that of
4446 Output_section::Input_section.
4447 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4448 except for the first pass.
4449 * output.cc (Output_section::get_input_sections): Change type of
4450 input_sections to std::list<Input_section>.
4451 (Output_section::add_script_input_section): Rename from
4452 Output_section::add_simple_input_section. Change type of SIS
4453 parameter from Simple_input_section to Input_section.
4454 * output.h (Output_section::Simple_input_section): Remove class.
4455 (Output_section::Input_section): Change class visibility to public.
4456 (Output_section::Input_section::addralign): Use stored alignments
4457 for special input sections if set.
4458 (Output_section::Input_section::set_addralign): New method.
4459 (Output_section::get_input_sections): Change parameter type from
4460 list of Simple_input_section to list of Input_section.
4461 (Output_section::add_script_input_section): Rename from
4462 Output_section::add_simple_input_section. Change first parameter's
4463 type from Simple_input_section to Input_section and remove the
4464 second and third parameters.
4465 * script-sections.cc (Input_section::Input_section_list): Change
4466 type to list of Output_section::Input_section/
4467 (Input_section_info::Input_section_info): Change parameter type of
4468 INPUT_SECTION to Output_section::Input_section.
4469 (Input_section_info::input_section): Change return type.
4470 (Input_section_info::input_section_): Change type to
4471 Output_section::Input_section.
4472 (Output_section_element_input::set_section_addresses): Adjust code
4473 to use Output_section::Input_section instead of
4474 Output_section::Simple_input_section. Adjust code for renaming
4475 of Output_section::add_simple_input_section.
4476 (Orphan_output_section::set_section_addresses): Ditto.
4477
e1e82ea4
RW
44782010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4479
4480 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4481 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4482
91e75c8a
RÁE
44832010-05-18 Rafael Espindola <espindola@google.com>
4484
4485 * options.cc (General_options::finalize): Handle -nostdlib.
4486 * options.h (nostdlib): New option.
4487 * script.cc (script_add_search_dir): Handle -nostdlib.
4488
da59ad79
DK
44892010-05-12 Doug Kwan <dougkwan@google.com>
4490
4491 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4492 attributes section only if there no attributes section after merging.
4493 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4494 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4495 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4496 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4497 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4498 and arm_attr_merge_7.stdout.
4499 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4500 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4501 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4502 arm_attr_merge_7b.o): New rules.
4503 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4504 arm_attr_merge_7
4505 * testsuite/Makefile.in: Regenerate.
4506 * testsuite/arm_attr_merge.sh: New file.
4507 * testsuite/arm_attr_merge_[67][ab].s: Same.
4508
3e01a7fd
NC
45092010-05-05 Nick Clifton <nickc@redhat.com>
4510
4511 * po/es.po: Updated Spanish translation.
4512
7ad2014a
L
45132010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4514
4515 * Makefile.am (install-exec-local): Properly install gold as
4516 default cross linker.
4517 * Makefile.in: Regenerated.
4518
4fda8867
NC
45192010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4520 Nick Clifton <nickc@redhat.com>
4521
4522 * configure.ac (install_as_default): Define and set to false
4523 unless --enable-gold or --enable-gold=both/gold has been
4524 specified.
4525 * configure: Regenerate.
4526
4527 * Makefile.am (install-exec-local): Install the executable as
4528 'ld.gold'. If install_as_default is true then also install it as
4529 'ld'.
4530 * Makefile.in: Regenerated.
4531
bd288ea2
ILT
45322010-04-24 Ian Lance Taylor <iant@google.com>
4533
4534 * layout.cc (Layout::layout_reloc): In relocatable link don't
4535 combine reloc sections for grouped sections.
4536
ef38fd8a
ST
45372010-04-23 Sriraman Tallam <tmsriram@google.com>
4538
4539 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4540 sections that are not ordinary to icf.
4541 * icf.cc (get_section_contents): Handle relocation pointing to section
4542 with no object or shndx information.
4543 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4544 * testsuite/Makefile.in: Regenerate.
4545 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4546 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4547
f6973bdc
ILT
45482010-04-22 Ian Lance Taylor <iant@google.com>
4549
4550 * expression.cc (Expression::Expression_eval_info): Add
4551 result_alignment_pointer field.
4552 (Expression::eval_with_dot): Add result_alignment_pointer
4553 parameter. Change all callers.
4554 (Expression::eval_maybe_dot): Likewise.
4555 (class Binary_expression): Add alignment_pointer parameter to
4556 left_value and right_value. Change all callers.
4557 (BINARY_EXPRESSION): Set result alignment.
4558 (class Trinary_expression): Add alignment_pointer parameter to
4559 arg2_value and arg3_value. Change all callers.
4560 (Trinary_cond::value): Set result alignment.
4561 (Max_expression::value, Min_expression::value): Likewise.
4562 (Align_expression::value): Likewise.
4563 * script-sections.cc (class Sections_element): Add dot_alignment
4564 parameter to set_section_addresses virtual function. Update
4565 instantiations.
4566 (class Output_section_element): Likewise.
4567 (Script_sections::create_segments): Add dot_alignment parameter.
4568 Change all callers.
4569 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4570 (Script_sections::set_phdrs_clause_addresses): Likewise.
4571 * script-sections.h: Update declarations.
4572 * script.h: Update declarations.
4573 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4574 min_p_align.
4575 * testsuite/script_test_3.t: Set large alignment.
4576 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4577 segment has expected alignment.
4578
9c9c98a5
NC
45792010-04-22 Nick Clifton <nickc@redhat.com>
4580
4581 * po/gold.pot: Updated by the Translation project.
4582 * po/vi.po: Updated Vietnamese translation.
4583
2253bfba
L
45842010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4585
4586 * testsuite/Makefile.am (check_PROGRAMS): Add
4587 icf_virtual_function_folding_test.
4588 * testsuite/Makefile.in: Regenerated.
4589
85fdf906
AH
45902010-04-15 Andrew Haley <aph@redhat.com>
4591
4592 * options.h (merge_exidx_entries): New option.
4593 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4594 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4595 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4596 (Target_arm::merge_exidx_entries): New function.
4597 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4598 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4599 to Arm_exidx_fixup constructor.
4600 Add new arg, merge_exidx_entries.
4601 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4602 Arm_output_section::fix_exidx_coverage.
4603
ce97fa81
ST
46042010-04-18 Sriraman Tallam <tmsriram@google.com>
4605
4606 * icf.cc (get_section_contents): Check for preemptible functions.
4607 Ignore addend when appropriate.
4608 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4609 section folded.
4610 (add_from_relobj): Check for section folded.
4611 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4612 * symtab.h (should_add_dynsym_entry): Add new parameter.
4613 * target-reloc.h (scan_relocs): Check for section folded.
4614 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4615 Check reloc types for function pointers in shared objects.
4616 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4617 case.
4618 (icf_preemptible_functions_test): New test case.
4619 (icf_string_merge_test): New test case.
4620 * testsuite.Makefile.in: Regenerate.
4621 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4622 bar_glob. Refactor code.
4623 * testsuite/icf_preemptible_functions_test.cc: New file.
4624 * testsuite/icf_preemptible_functions_test.sh: New file.
4625 * testsuite/icf_string_merge_test.cc: New file.
4626 * testsuite/icf_string_merge_test.sh: New file.
4627 * testsuite/icf_virtual_function_folding_test.cc: New file.
4628 * testsuite/icf_virtual_function_folding_test.sh: New file.
4629
04ceb17c
DK
46302010-04-14 Doug Kwan <dougkwan@google.com>
4631
4632 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4633 for local symbol recounting if we remove a section due to ICF.
4634 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4635 there are no regular objects in input.
4636
153e7da4
DK
46372010-04-13 Doug Kwan <dougkwan@google.com>
4638
4639 * arm.cc (Arm_input_section::set_final_data_size): Compute
4640 accurate final data size instead of using current data size.
4641
4dbd9faf
DK
46422010-04-09 Doug Kwan <dougkwan@google.com>
4643
4644 * layout.cc (Layout::choose_output_section): Handle script section
4645 types.
4646 (Layout::make_output_section_for_script): Add section type parameter.
4647 Handle script section types.
4648 * layout.h (Layout::make_output_section_for_script): Add section
4649 type parameter.
4650 * output.cc (Output_section::Output_section): Initialize data member
4651 is_noload_.
4652 (Output_section::do_reset_address_and_file_offset): Do not set address
4653 to 0 if section is a NOLOAD section.
4654 * output.h (Output_section::is_noload): New method.
4655 (Output_section::set_is_noload): Ditto.
4656 (Output_section::is_noload_): New data member.
4657 * script-c.h (Script_section_type): New enum type.
4658 (struct Parser_output_section_header): Add new file section_type.
4659 * script-sections.cc (Sections_element::output_section_name): Add
4660 parameter for returning script section type.
4661 (Output_section_definition::output_section_name): Ditto.
4662 (Output_section_definition::section_type)P; New method.
4663 (Output_section_definiton::script_section_type_name): Ditto.
4664 (Output_section_definition::script_section_type_): New data member.
4665 (Output_section_definition::Output_section_definition): Initialize
4666 data member Output_section_definition::script_section_type_.
4667 (Output_section_definition::create_sections): Pass script section type
4668 to Layout::make_output_section_for_script.
4669 (Output_section_definition::output_section_name): Return script
4670 section type to caller.
4671 (Output_section_definition::set_section_address): Do not advance
4672 dot value and load address if section type is NOLOAD. Set address
4673 of NOLOAD sections regardless of section flags.
4674 (Output_section_definition::print): Print section type if it is
4675 not SCRIPT_SECTION_TYPE_NONE.
4676 (Output_section_definition::section_type): New method.
4677 (Output_section_definition::script_section_type_name): Ditto.
4678 (Script_sections::output_section_name): Add new parameter
4679 PSECTION_TYPE for returning script section type. Pass it to
4680 section elements. Handle discard sections.
4681 (Sort_output_sections::operator()): Handle NOLOAD sections.
4682 * script-sections.h (Script_sections::Section_type): New enum type.
4683 (Script_sections::output_section_name): Add a new parameter for
4684 returning script section type.
4685 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4686 INFO and NOLOAD.
4687 * yyscript.y (union): Add new field SECTION_TYPE.
4688 (COPY, DSECT, INFO, NOLOAD): New tokens.
4689 (opt_address_and_section_type): Change type to output_section_header.
4690 (section_type): New non-terminal
4691 (section_header): Handle section type.
2253bfba 4692 (opt_address_and_section_type): Return section type value.
4dbd9faf 4693
721ea635
L
46942010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4695
4696 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4697 * testsuite/plugin_common_test_2.c (foo): Likewise.
4698
6bf924b0
DK
46992010-04-08 Doug Kwan <dougkwan@google.com>
4700
4701 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4702 Output_merge_data.
4703 * output.cc (Output_section::add_merge_input_section): Simplify
4704 code and return status of Output_merge_base::add_input_section.
e1df38aa 4705 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
4706 returns true.
4707
24af6f92
DK
47082010-04-07 Doug Kwan <dougkwan@google.com>
4709
4710 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4711 if section is marked as containing instructions but has no mapping
4712 symbols.
4713 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4714 correct section index.
4715 (Arm_relobj::find_linked_text_section): Ditto.
4716
00698fc5
CC
47172010-04-07 Cary Coutant <ccoutant@google.com>
4718
4719 * archive.cc (include_member): Destroy Read_symbols_data object before
4720 releasing file.
4721 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4722 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4723 (Read_symbols_data::~Read_symbols_data) New destructor.
4724 (Section_relocs::Section_relocs) New constructor.
4725 (Section_relocs::~Section_relocs) New destructor.
4726 (Read_relocs_data::Read_relocs_data) New constructor.
4727 (Read_relocs_data::~Read_relocs_data) New destructor.
4728 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4729 pointers to NULL after deleting.
4730
7296d933
DK
47312010-04-07 Doug Kwan <dougkwan@google.com>
4732
4733 * arm.cc: Replace "endianity" with "endianness" in comments.
4734 (Arm_exidx_cantunwind): Ditto.
4735 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4736 (Arm_relobj::merge_flags_and_attributes): New method.
4737 (Arm_relobj::merge_flags_and_attributes_): New data member.
4738 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4739 (Arm_relobj::scan_sections_for_stubs): Ditto.
4740 (Arm_relobj::do_read_symbols): Check to see if we really want to
4741 merge processor-specific flags and attributes. Exit early if
4742 an object is empty except for section names and the undefined symbol.
4743 (Target_arm::do_finalize_sections): Move check for ELF format to
4744 Arm_relobj::do_read_symbols. Merge processor specific flags and
4745 attributes from a regular object only when we have determined that
4746 it is aapropriate. Do not create an .ARM.attributes section in
4747 output if there is no regular input object.
4748 (Target_arm::merge_processor_specific_flags): Check
4749 --warn-mismatch before printing any error.
4750 (Target_arm::merge_object_attributes): Ditto.
4751 * gold.cc (queue_middle_tasks): Handle the case in which there is
4752 no regular object in input.
4753 * options.cc (General_options::parse_EB): New method.
4754 (General_options::parse_EL): Same.
4755 (General_options::General_options): Initialize endianness_.
4756 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4757 New options.
4758 (General_options::Endianness): New enum.
4759 (General_options::endianness): New method.
4760 (General_options::endianness_): New data member.
4761 * parameters.cc (Parameters::set_options): Check target endianness.
4762 (Parameters::set_target_once): Ditto.
4763 (Parameters::check_target_endianness): New method.
4764 (parameters_force_valid_target): If either -EL or -EB is specified,
4765 use it to define endianness of default target.
4766 * parameters.h (Parameters::check_target_endianness): New method
4767 declaration.
4768 * target.h (class Target): Change "endianity" to "endianness"
4769 in comments.
4770
efc8d4f2
RW
47712010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4772
4773 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4774 * configure: Regenerate.
4775 * Makefile.in: Regenerate.
4776 * testsuite/Makefile.in: Regenerate.
4777
be234d88
CC
47782010-04-06 Cary Coutant <ccoutant@google.com>
4779
4780 gcc PR lto/42757
4781 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4782 prevailing definitions of common symbols.
4783 * testsuite/plugin_test_6.sh: New test case.
4784 * testsuite/plugin_common_test_1.c: New test case.
4785 * testsuite/plugin_common_test_2.c: New test case.
4786 * testsuite/Makefile.am (plugin_test_6): New test case.
4787 * testsuite/Makefile.in: Regenerate.
4788
bd32c6bd
NC
47892010-04-06 Nick Clifton <nickc@redhat.com>
4790
4791 * po/vi.po: New Vietnamese translation.
4792
323c532f
DK
47932010-03-30 Doug Kwan <dougkwan@google.com>
4794
4795 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4796
4fcd97eb
DK
47972010-03-25 Doug Kwan <dougkwan@google.com>
4798
4799 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4800 to avoid a conversion warning on a 32-bit host.
4801
4ebf39db
ILT
48022010-03-24 Ian Lance Taylor <iant@google.com>
4803
4804 * testsuite/script_test_3.t: Add a TLS segment.
4805 * testsuite/Makefile.am (check_PROGRAMS): Add
4806 tls_phdrs_script_test.
4807 (tls_phdrs_script_test_SOURCES): Define.
4808 (tls_phdrs_script_test_DEPENDENCIES): Define.
4809 (tls_phdrs_script_test_LDFLAGS): Define.
4810 (tls_phdrs_script_test_LDADD): Define.
4811 * testsuite/Makefile.in: Rebuild.
4812
4a599bdd
CC
48132010-03-23 Cary Coutant <ccoutant@google.com>
4814
4815 * fileread.cc (find_or_make_view): Fix comment.
4816
6c93b22c
ILT
48172010-03-23 Ian Lance Taylor <iant@google.com>
4818
4819 * script-sections.cc (class Orphan_section_placement): Define
4820 PLACE_TLS and PLACE_TLS_BSS.
4821 (Orphan_section_placement::Orphan_section_placement): Initialize
4822 new places.
4823 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4824 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4825 (tls_script_test_SOURCES): Define.
4826 (tls_script_test_DEPENDENCIES): Define.
4827 (tls_script_test_LDFLAGS): Define.
4828 (tls_script_test_LDADD): Define.
4829 * testsuite/Makefile.in: Rebuild.
4830
a2c7281b
DK
48312010-03-22 Doug Kwan <dougkwan@google.com>
4832
4833 * arm.cc (Arm_relocate_functions::abs8,
4834 Arm_relocate_functions::abs16): Use correct check for overflow
4835 specified in the ARM ELF specs.
4836 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4837 target of a BLX instruction specially.
4838 (Reloc_stub::stub_type_for_reloc): Ditto.
4839 (Relocate::relocate): Use symbolic names instead of numeric relocation
4840 codes to report error.
4841 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4842 workaround.
4843 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4844 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4845 thumb2_blx_out_of_range.stdout
4846 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4847 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4848 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4849 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4850 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4851 thumb2_blx_in_range, thumb2_blx_in_range.o,
4852 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4853 thumb2_blx_out_of_range.o): New rules.
4854 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4855 thumb2_blx_in_range and thumb2_blx_out_of_range.
4856 * testsuite/Makefile.in: Regenerate.
4857 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4858 * testsuite/thumb_blx_in_range.s: New file.
4859 * testsuite/thumb_blx_out_of_range.s: New file.
4860
b0193076
RÁE
48612010-03-22 Rafael Espindola <espindola@google.com>
4862
4863 * archive.cc (Should_include): Move to archive.h.
4864 (should_include_member): Make it a member of Archive.
4865 (Lib_group): New.
4866 (Add_lib_group_symbols): New.
4867 * archive.h: Include options.h.
4868 (Archive_member): Moved from Archive.
4869 (Should_include): Moved from archive.cc.
4870 (Lib_group): New.
4871 (Add_lib_group_symbols): New.
4872 * dynobj.cc (do_should_include_member): New.
4873 * dynobj.h (do_should_include_member): New.
4874 * gold.cc (queue_initial_tasks): Update call to queue.
4875 * main.cc (main): Print lib group stats.
4876 * object.cc (do_should_include_member): New.
4877 * object.h: Include archive.h.
4878 (Object::should_include_member): New.
4879 (Object::do_should_include_member): New.
4880 (Sized_relobj::do_should_include_member): New.
4881 * options.cc (General_options::parse_start_lib): New.
4882 (General_options::parse_end_lib): New.
4883 (Input_arguments::add_file): Handle lib groups.
4884 (Input_arguments::start_group): Check we are not in a lib.
4885 (Input_arguments::start_lib): New.
4886 (Input_arguments::end_lib): New.
4887 * options.h (General_options): Add start_lib and end_lib.
4888 (Input_argument::lib_): New.
4889 (Input_argument::lib): New.
4890 (Input_argument::is_lib): New.
4891 (Input_file_lib): New.
4892 (Input_arguments::in_lib_): New.
4893 (Input_arguments::in_lib): New.
4894 (Input_arguments::start_lib): New.
4895 (Input_arguments::end_lib_): New.
4896 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4897 in unused members as preempted.
4898 (Sized_pluginobj::do_should_include_member): New.
4899 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4900 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4901 return the blocker.
4902 (Read_symbols::do_whole_lib_group): New.
4903 (Read_symbols::do_lib_group): New.
4904 (Read_symbols::do_read_symbols): Handle lib groups.
4905 (Read_symbols::get_name): Handle lib groups.
4906 * readsyms.h (Read_symbols): Add an archive member pointer.
4907 (Read_symbols::do_whole_lib_group): New.
4908 (Read_symbols::do_lib_group): New.
4909 (Read_symbols::member_): New.
4910 * script.cc (read_input_script): Update call to queue_soon.
4911
d099120c
DK
49122010-03-19 Doug Kwan <dougkwan@google.com>
4913
4914 * arm.cc (Stub_table::Stub_table): Initialize new data members
4915 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4916 (Stub_table::add_reloc_stub): Assign stub offset and update
4917 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4918 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4919 New data members.
4920 (Stub_table::update_data_size_and_addralign): Use
4921 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4922 instead of going over all reloc stubs.
4923 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4924 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4925 Stringpool_template::offset_ to size of Stringpool_char.
4926 (Stringpool_template::new_key_offset): Remove code to initialize
4927 Stringpool_template::offset_.
4928 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4929 Stringpool_template::offset_ to zero.
4930
1aa37384
DK
49312010-03-15 Doug Kwan <dougkwan@google.com>
4932
4933 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4934 offset_.
4935 (Stringpool_template::new_key_offset): New method.
4936 (Stringpool_template::add_string): Assign offsets when adding new
4937 strings.
4938 (Stringpool_template::set_string_offsets): Do not set string offsets
4939 when not optimizing.
4940 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4941 member size_.
4942 (Chunked_vector::clear): Clear size_.
4943 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4944 (Chunked_vector::size): Return size_.
4945 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4946 (Chunked_vector::size_): New data member.
1aa37384
DK
4947 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4948 (Stringpool_template::new_key_offset): New method declaration.
4949 (Stringpool_template::offset_): New data member.
4950
b672b057
RÁE
49512010-03-15 Rafael Espindola <espindola@google.com>
4952
4953 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4954 Add_symbols' constructor.
4955 * readsyms.h (Add_symbols): Remove the input_group member.
4956
b6848d3c
ILT
49572010-03-10 Ian Lance Taylor <iant@google.com>
4958
4959 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4960 target to ask whether a reference to a symbol requires a stack
4961 split.
4962 * target.h (Target::is_call_to_non_split): New function.
4963 (Target::do_is_call_to_non_split): Declare virtual function.
4964 * target.cc: Include "symtab.h".
4965 (Target::do_is_call_to_non_split): New function.
4966 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4967
a2a5469e
CC
49682010-03-10 Cary Coutant <ccoutant@google.com>
4969
4970 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4971 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4972 (File_read::open[2]): Add whole_file_view_ to list of views.
4973 (File_read::make_view): Remove test of whole_file_view_.
4974 (File_read::find_or_make_view): Create whole_file_view_ if
4975 necessary.
4976 (File_read::clear_views): Replace bool parameter with enum;
4977 adjust all callers. Don't delete views with permanent data;
4978 do delete cached views and views from archives if
4979 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4980 if clearing the corresponding view.
4981 * fileread.h (File_read::Clear_views_mode): New enum.
4982 (File_read::View::is_permanent_view): New method.
4983 (File_read::clear_views): Replace bool parameter
4984 with enum; adjust all callers.
4985 * options.h (General_options): Change keep_files_mapped option;
4986 add map_whole_files.
4987 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4988 releasing the file.
4989 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4990 the file.
4991
8861f32b
DM
49922010-03-10 David S. Miller <davem@davemloft.net>
4993
4994 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4995
d62d0f5f
ST
49962010-03-09 Sriraman Tallam <tmsriram@google.com>
4997
4998 * icf.cc (get_section_contents): Add '@' marker after processing the
4999 merge reloc.
5000
9177756d
DK
50012010-03-08 Doug Kwan <dougkwan@google.com>
5002
5003 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5004 due to a conversion warning.
5005 (Arm_relobj::update_output_local_symbol_count): Check for local
5006 symbol with unset output index.
5007
9e9e071b
ILT
50082010-03-05 Ian Lance Taylor <iant@google.com>
5009
5010 * options.h (class General_options): Add --spare-dynamic-tags.
5011 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5012 --spare-dynamic-tags.
5013
a81ee015
ILT
50142010-03-05 Ian Lance Taylor <iant@google.com>
5015
5016 * incremental.cc: Include "libiberty.h".
5017
44ec90b9
RO
50182010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5019
5020 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5021 function, is_info_ member.
5022 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5023 (Versions::Versions): Update caller.
5024 (Versions::define_base_version): Likewise.
5025 (Versions::add_def): Likewise.
5026
0897ed3b
ST
50272010-03-03 Sriraman Tallam <tmsriram@google.com>
5028
5029 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5030 (Scan::possible_function_pointer_reloc): New function.
5031 (Scan::local_reloc_may_be_function_pointer): Change to call
5032 possible_function_pointer_reloc.
5033 (Scan::global_reloc_may_be_function_pointer): Ditto.
5034 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5035 relocations in ".data.rel.ro._ZTV" section.
5036 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5037 * testsuite/icf_safe_so_test.cc: Ditto.
5038 * testsuite/icf_safe_test.cc: Ditto.
5039 * testsuite/icf_safe_test.sh: Ditto.
5040
d3bbad62
ILT
50412010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5042 Ian Lance Taylor <iant@google.com>
5043
5044 * target-reloc.h (relocate_section): Check the symbol table index
5045 for -1U before setting the local symbol index.
5046 (scan_relocatable_relocs): If copying the relocation, record that
5047 the local symbol is required.
5048 * object.h (Symbol_value::is_output_symtab_index_set): New
5049 function.
5050 (Symbol_value::may_be_discarded_from_output_symtab): New
5051 function.
5052 (Symbol_value::has_output_symtab_entry): New function.
5053 (Symbol_value::needs_output_symtab_entry): Remove.
5054 (Symbol_value::output_symtab_index): Make sure the symbol index is
5055 set.
5056 (Symbol_value::set_output_symtab_index): Make sure the symbol
5057 index is not set. Make sure the new index is valid.
5058 (Symbol_value::set_must_have_output_symtab_entry): New function.
5059 (Symbol_value::has_output_dynsym_entry): New function.
5060 (Symbol_value::set_output_dynsym_index): Make sure the new index
5061 is valid.
5062 (Sized_relobj::set_must_have_output_symtab_entry): New function.
5063 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
5064 local symbol if permitted.
5065 (Sized_relobj::do_finalize_local_symbols): Call
5066 is_output_symtab_index_set rather than needs_output_symtab_entry.
5067 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
5068 rather than needs_output_symtab_entry. Call
5069 has_output_dynsym_entry rather than needs_output_dynsym_entry.
5070 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
5071 is_output_symtab_index_set rather than needs_output_symtab_entry.
5072 * testsuite/discard_locals_relocatable_test.c: New file.
5073 * testsuite/discard_locals_test.sh: Test -r.
5074 * testsuite/Makefile.am (check_DATA): Add
5075 discard_locals_relocatable_test1.syms,
5076 discard_local_relocatable_test2.syms.
5077 (MOSTLYCLEANFILES): Likewise. Also add
5078 discard_locals_relocatable_test1.lout and
5079 discard_locals_relocatable_test2.out.
5080 (discard_locals_relocatable_test1.syms): New target.
5081 (discard_locals_relocatable_test.o): New target.
5082 (discard_locals_relocatable_test1.out): New target.
5083 (discard_locals_relocatable_test2.syms): New target.
5084 (discard_locals_relocatable_test2.out): New target.
5085 (various): Add missing ../ld-new dependencies.
5086 * testsuite/Makefile.in: Rebuild.
5087
7e8ccf26
NC
50882010-03-03 Nick Clifton <nickc@redhat.com>
5089
5090 * po/fi.po: New Finnish translation.
5091
2a0ff005
DK
50922010-03-01 Doug Kwan <dougkwan@google.com>
5093
5094 * layout.cc (Layout::Layout): Force section types of .init_array*,
5095 .preinit_array* and .fini_array* sections.
5096 * output.cc (Output_section::Input_section_sort_entry::has_priority):
5097 Fix check of return value of std::string::find.().
5098 (Output_section::Input_section_sort_compare::operator()): Remove
5099 comment about .init_array.
5100 (Output_section::Input_section_sort_init_fini_compare::operator()):
5101 New method.
5102 (Output_section::sort_attached_input_sections): Handle .init_array
5103 and .fini_array specially.
5104 * output.h (Output_section::Inut_section_sort_compare): Update
5105 comment.
5106 (Output_section::Input_section_sort_init_fini_compare): New struct.
5107
c3e4ae29
DK
51082010-02-26 Doug Kwan <dougkwan@google.com>
5109
5110 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
5111 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
5112 * testsuite/debug_msg.sh: Avoid matching source line number for
5113 use of global variable undef_int.
5114
2fd9ae7a
DK
51152010-02-26 Doug Kwan <dougkwan@google.com>
5116
5117 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
5118 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
5119 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
5120 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
5121 * options.cc (General_options::General_options): Initialize member
5122 fix_v4bx_.
5123 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
5124 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
5125 and rm_no_fix_v4bx.stdout
5126 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
5127 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
5128 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
5129 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
5130 and arm_no_fix_v4bx.
5131 * Makefile.in: Regenerate.
5132 * testsuite/arm_fix_v4bx.s: New file.
5133 * testsuite/arm_fix_v4bx.sh: Ditto.
5134
67ec7d0b
DK
51352010-02-24 Doug Kwan <dougkwan@google.com>
5136
5137 * arm.cc (Target_arm::got_section): Make the .got section the first
5138 non RELRO section in the data segment.
5139 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
5140 suffixes of section names.
5141
10165461
DK
51422010-02-24 Doug Kwan <dougkwan@google.com>
5143
5144 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
5145 flags and attributes merging if an input file is a binary file.
5146 * fileread.cc (Input_file::open): Record format of original file.
5147 * fileread.h (Input_file::Format): New enum type.
5148 (Input_file::Input_file): Initialize data member format_.
5149 (Input_file::format): New method definition.
5150 (Input_file::format_):: New data member.
5151
4a54abbb
DK
51522010-02-24 Doug Kwan <dougkwan@google.com>
5153
5154 * arm.cc (Arm_output_data_got): New class.
5155 (ARM_TCB_SIZE): New constant
5156 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
5157 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
5158 If user uses a script with a SECTIONS clause, issue only a warning
5159 for a misplaced EXIDX input section. Otherwise, issue an error.
5160 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5161 garbage collection.
5162 (Target_arm::got_mode_index_entry): Handle static linking.
5163 (Target_arm::Scan::local): Ditto.
5164 (Target_arm::Scan::global): Ditto.
5165 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5166 all incorrectly implemented relocations.
e1df38aa 5167 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5168 Arm_output_section::fix_exidx_coverage.
5169 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5170 from ".ARM.exidx." and ".ARM.extab.".
5171
ca419a6f
ILT
51722010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5173
5174 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5175 section if it does not already exist.
5176 * attributes.cc (Attributes_section_data::Attributes_section_data):
5177 Don't crash if size is zero.
5178
135b9c78
ILT
51792010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5180 Ian Lance Taylor <iant@google.com>
5181
5182 * gold.cc (queue_middle_tasks): If no input files were opened,
5183 exit.
5184 * workqueue.h (Task_function::Task_function): Assert that there is
5185 a blocker.
5186
bb0bfe4f
DK
51872010-02-22 Doug Kwan <dougkwan@google.com>
5188
5189 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5190 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5191 types to avoid warnings due to different uint64_t implementations
5192 on different hosts.
5193
2a2b6d42
DK
51942010-02-21 Doug Kwan <dougkwan@google.com>
5195
5196 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5197 handling of the maximum backward branch offset.
5198 (Arm_relocate_functions::thumb_branch_common): Ditto.
5199 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5200 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5201 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5202 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5203 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5204 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5205 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5206 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5207 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5208 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5209 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5210 thumb2_bl_out_of_range.o): New rules.
5211 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5212 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5213 thumb2_bl_out_of_range
5214 * testsuite/Makefile.in: Regenerate.
5215 * testsuite/arm_bl_in_range.s: New file.
5216 * testsuite/arm_bl_out_of_range.s: Ditto.
5217 * testsuite/arm_branch_in_range.sh: Ditto.
5218 * testsuite/arm_branch_range.t: Ditto.
5219 * testsuite/thumb2_branch_range.t: Ditto.
5220 * testsuite/thumb_bl_in_range.s: Ditto.
5221 * testsuite/thumb_bl_out_of_range.s: Ditto.
5222 * testsuite/thumb_branch_range.t: Ditto.
5223
b487ad64
ST
52242010-02-20 Sriraman Tallam <tmsriram@google.com>
5225
5226 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5227 Add reloc offset information.
5228 * icf.cc (get_section_contents): Change iterators to point to the new
5229 vectors. Add reloc offset information to the contents.
5230 * icf.h (Icf::Sections_reachable_info): New typedef.
5231 (Icf::Sections_reachable_list): New typedef.
5232 (Icf::Offset_info): New typedef.
5233 (Icf::Reloc_info): New struct typedef.
5234 (Icf::Reloc_info_list): New typedef.
5235 (Icf::symbol_reloc_list): Delete method.
5236 (Icf::addend_reloc_list): Delete method.
5237 (Icf::section_reloc_list): Delete method.
5238 (Icf::reloc_info_list): New method.
5239 (Icf::reloc_info_list_): New member.
5240
f96accdf
DK
52412010-02-19 Doug Kwan <dougkwan@google.com>
5242
5243 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5244 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5245 * arm.cc (Arm_relocation_functions): New forward declaration.
5246 (Target_arm::Target_arm): Initialize new data members
5247 got_mod_index_offset_ and tls_base_symbol_defined_.
5248 (Target_arm::Relocate::relocate_tls): New method.
5249 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5250 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5251 New methods.
5252 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5253 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5254 (Target_arm::got_mod_index_offset_,
5255 Target_arm::tls_base_symbol_defined_): New data members.
5256 (Target_arm::Scan::local, Target::Scan::global,
5257 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5258 relocations.
5259
c8761b9a
DK
52602010-02-18 Doug Kwan <dougkwan@google.com>
5261
5262 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5263 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5264 text section as a parameter becuase some broken tools may not set
5265 the link in section header.
5266 (Target_arm::has_got_section): New method.
5267 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5268 without any mapping symbol as data only. Remove warning.
5269 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5270 link in its section header, try to discover the link by inspecting the
5271 REL31 relocation at the beginning of the section.
5272 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5273 in error message.
5274 (Target_arm::Scan::global): Treat any reference to the symbol
5275 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5276
21bb3914
ST
52772010-02-12 Sriraman Tallam <tmsriram@google.com>
5278
5279 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5280 (Scan::global_reloc_may_be_function_pointer): New function.
5281 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5282 (Scan::global_reloc_may_be_function_pointer): New function.
5283 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5284 (Scan::global_reloc_may_be_function_pointer): New function.
5285 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5286 (Scan::global_reloc_may_be_function_pointer): New function.
5287 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5288 (Scan::global_reloc_may_be_function_pointer): New function.
5289 (Scan::possible_function_pointer_reloc): New function.
5290 (Target_x86_64::can_check_for_function_pointers): New function.
5291 * gc.h (gc_process_relocs): Scan relocation types to determine if
5292 function pointers were taken for targets that support it.
5293 * icf.cc (Icf::find_identical_sections): Include functions for
5294 folding in safe ICF whose pointer is not taken.
5295 * icf.h (Secn_fptr_taken_set): New typedef.
5296 (fptr_section_id_): New member.
5297 (section_has_function_pointers): New function.
5298 (set_section_has_function_pointers): New function.
5299 (check_section_for_function_pointers): New function.
5300 * options.h: Fix comment for safe ICF option.
5301 * target.h (can_check_for_function_pointers): New function.
5302 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5303 Modify icf_safe_test for X86-64.
5304 * testsuite/Makefile.in: Regenerate.
5305 * testsuite/icf_safe_so_test.cc: New file.
5306 * testsuite/icf_safe_so_test.sh: New file.
5307 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5308 (main): Change to take pointer to function kept_func_3.
5309 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5310 folding is done correctly for X86-64.
5311
0da6fa6c
DM
53122010-02-12 David S. Miller <davem@davemloft.net>
5313
5314 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5315 is_symbolless parameter.
5316 (Output_reloc<SHT_REL>::is_symbolless): New.
5317 (Output_reloc<SHT_REL>::is_symbolless_): New.
5318 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5319 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5320 (Output_reloc<SHT_RELA>::is_symbolless): New.
5321 (Output_data_reloc::add_global): Handle is_symbolless.
5322 (Output_data_reloc::add_global_relative): Likewise.
5323 (Output_data_reloc::add_local): Likewise.
5324 (Output_data_reloc::add_local_relative): Likewise.
5325 (Output_data_reloc::add_symbolless_global_addend): New.
5326 (Output_data_reloc::add_symbolless_local_addend): New.
5327 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5328 is_symbolless.
5329 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5330 instead of ->is_relative_
5331 (Output_reloc::write): Likewise.
5332 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5333 (Output_reloc::write_rel): Simplify.
5334
5335 * sparc.cc (Target_sparc::Scan::local): Use
5336 ->add_symbolless_local_addend as needed.
5337 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5338 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5339 based upon relocation offset.
5340
e4782e83
DK
53412010-02-11 Doug Kwan <dougkwan@google.com>
5342
5343 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5344 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5345 beginning of function.
5346 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5347 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5348 parameter is_32bit in calls to should_apply_static_reloc.
5349 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5350 (check_DATA): Add arm_abs_global.stdout.
5351 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5352 arm_abs_global.stdout): New rules.
5353 (MOSTLLYCLEANFILES): Add arm_abs_global
5354 * Makefile.in: Regenerate.
5355 * testsuite/arm_abs_global.s: New file.
5356 * testsuite/arm_abs_global.sh: Ditto.
5357 * testsuite/arm_abs_lib.s: Ditto.
5358
93ceb764
ILT
53592010-02-11 Ian Lance Taylor <iant@google.com>
5360
5361 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5362 Read_relocs task.
5363 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5364 Allocate_commons_task first.
5365 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5366 task, rather than symtab_lock_.
5367 (Gc_process_relocs::~Gc_process_relocs): New function.
5368 (Gc_process_relocs::is_runnable): Check this_blocker_.
5369 (Gc_process_relocs::locks): Use next_blocker_ rather than
5370 blocker_.
5371 (Scan_relocs::~Scan_relocs): New function.
5372 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5373 symtab_lock_.
5374 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5375 next_blocker_.
5376 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5377 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5378 constructor accordingly.
5379 (class Gc_process_relocs): Likewise.
5380 (class Scan_relocs): Likewise.
5381 * common.h (class Allocate_commons_task): Remove symtab_lock_
5382 field, and corresponding constructor parameter.
5383 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5384 symtab_lock_.
5385 (Allocate_commons_task::locks): Likewise.
5386
114dfbe1
ILT
53872010-02-11 Ian Lance Taylor <iant@google.com>
5388
5389 * gold-threads.h (class Once): Define.
5390 (class Initialize_lock): Rewrite as child of Once.
5391 * gold-threads.cc (class Once_initialize): Define.
5392 (once_pointer_control): New static variable.
5393 (once_pointer, once_arg): New static variables.
5394 (c_run_once): New static function.
5395 (Once::Once, Once::run_once, Once::internal_run): New functions.
5396 (class Initialize_lock_once): Remove.
5397 (initialize_lock_control): Remove.
5398 (initialize_lock_pointer): Remove.
5399 (initialize_lock_once): Remove.
5400 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5401 (Initialize_lock::initialize): Rewrite.
5402 (Initialize_lock::do_run_once): New function.
5403 * archive.cc (Archive::interpret_header): Only clear name if it is
5404 not already empty.
5405 * fileread.cc: Include "gold-threads.h"
5406 (file_counts_lock): New static variable.
5407 (file_counts_initialize_lock): Likewise.
5408 (File_read::release): Only increment counts when using --stats.
5409 Use a lock around the increment.
5410 * parameters.cc (class Set_parameters_target_once): Define.
5411 (set_parameters_target_once): New static variable.
5412 (Parameters::Parameters): Move here from parameters.h.
5413 (Parameters::set_target): Rewrite.
5414 (Parameters::set_target_once): New function.
5415 (Parameters::clear_target): Move here and rewrite.
5416 * parameters.h (class Parameters): Update declarations. Add
5417 set_parameters_target_once_ field.
5418 (Parameters::Parameters): Move to parameters.cc.
5419 (Parameters::clear_target): Likewise.
5420 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5421 task.
5422 (Start_group::~Start_group): New function.
5423 (Start_group::is_runnable): New function.
5424 (Start_group::locks, Start_group::run): New functions.
5425 (Finish_group::run): Change saw_undefined to size_t.
5426 * readsyms.h (class Start_group): Define.
5427 (class Finish_group): Change saw_undefined_ field to size_t.
5428 (Finish_group::Finish_group): Remove saw_undefined and
5429 this_blocker parameters. Change all callers.
5430 (Finish_group::set_saw_undefined): New function.
5431 (Finish_group::set_blocker): New function.
5432 * symtab.h (class Symbol_table): Change saw_undefined to return
5433 size_t. Change saw_undefined_ field to size_t.
5434 * target-select.cc (Set_target_once::do_run_once): New function.
5435 (Target_selector::Target_selector): Initialize set_target_once_
5436 field. Don't initialize lock_ and initialize_lock_ fields.
5437 (Target_selector::instantiate_target): Rewrite.
5438 (Target_selector::set_target): New function.
5439 * target-select.h (class Set_target_once): Define.
5440 (class Target_selector): Update declarations. Make
5441 Set_target_once a friend. Remove lock_ and initialize_lock_
5442 fields. Add set_target_once_ field.
5443
fa17a3f4
ILT
54442010-02-10 Ian Lance Taylor <iant@google.com>
5445
5446 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5447 queueing any tasks.
5448 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5449 (queue_middle_tasks): Add all blockers before queueing any tasks.
5450 (queue_final_tasks): Likewise.
5451 * token.h (Task_token::add_blockers): New function.
5452 * object.h (Input_objects::number_of_relobjs): New function.
5453
c7177d31
ILT
54542010-02-10 Ian Lance Taylor <iant@google.com>
5455
5de0e392
ILT
5456 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5457 shared, not if not position independent.
5458 * x86_64.cc (Relocate::relocate_tls): Likewise.
5459 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5460 (tls_pie_pic_test): New target.
5461 * testsuite/Makefile.in: Rebuild.
5462
c7177d31
ILT
5463 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5464 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5465 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5466 * testsuite/Makefile.in: Rebuild.
5467
684b268a
DM
54682010-02-09 David S. Miller <davem@davemloft.net>
5469
5470 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5471 R_SPARC_RELATIVE using ->add_local_relative().
5472 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5473
612a8d3d
DM
5474 * output.h (Output_data_dynamic::add_section_size): New method
5475 that takes two Output_data objects.
5476 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5477 entry param. Handle it in initializers.
5478 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5479 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5480 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5481 arg.
5482 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5483 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5484 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5485 for dynrel_includes_plt.
5486 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5487 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5488 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5489 before .rela.plt
5490 (Target_sparc::do_finalize_sections): Update to pass true for
5491 dynrel_includes_plt.
5492 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5493 output before .rela.plt
5494 (Target_powerpc::do_finalize_sections): Update to pass true for
5495 dynrel_includes_plt when 32-bit.
5496
cb1be87e
DK
54972010-02-08 Doug Kwan <dougkwan@google.com>
5498
5499 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5500 method.
5501 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5502 Arm_relobj::scan_section_for_cortex_a8_stubs,
5503 Arm_relobj::do_relocation_section): Instead of calling
5504 Output_section::output_address, use faster
5505 Arm_relobj::simple_input_section_output_address.
5506
705b5121
DM
55072010-02-08 David S. Miller <davem@davemloft.net>
5508
5509 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5510 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5511 relocation helper function.
5512
024c4466
DM
5513 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5514 just like R_SPARC_GOT{10,13,22}.
5515 (Target_sparc::Scan::local): Likewise.
5516 (Target_sparc::Relocate:relocate): Likewise.
5517
9109c078
ILT
55182010-02-06 Ian Lance Taylor <iant@google.com>
5519
5520 * configure.ac: Rewrite targetobjs duplicate removal code to use
5521 only shell constructs.
5522 * configure: Rebuild.
5523
cf846138
DK
55242010-02-05 Doug Kwan <dougkwan@google.com>
5525
5526 PR 11247
5527 * arm.cc (Arm_relobj::section_is_scannable): New method.
5528 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5529 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5530
6cfaf60b
DK
55312010-02-04 Doug Kwan <dougkwan@google.com>
5532
5533 PR 11247
5534 * arm-reloc-property.cc (cstdio): Include.
5535 * configure.ac (targetobjs): Remove duplicates.
5536 * configure: Regenerate.
5537 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5538 big and little endian version for a given address size.
5539
5c57f1be
DK
55402010-02-03 Doug Kwan <dougkwan@google.com>
5541
5542 * arm-reloc-property.cc
5543 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5544 definition.
5545 * arm-reloc-property.h
5546 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5547 New method definition.
5548 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5549 declaration.
5550 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5551 overflow to N.
5552 (GOT_PREL): Change implemented to Y.
5553 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5554 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5555 (Arm_relocate_functions::movw_abs_nc): Remove method.
5556 (Arm_relocate_functions::movt_abs): Ditto.
5557 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5558 (Arm_relocate_functions::thm_movt_abs): Ditto.
5559 (Arm_relocate_functions::movw_rel_nc): Ditto.
5560 (Arm_relocate_functions::movw_rel): Ditto.
5561 (Arm_relocate_functions::movt_rel): Ditto.
5562 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5563 (Arm_relocate_functions:thm_movw_rel): Ditto.
5564 (Arm_relocate_functions:thm_movt_rel): Ditto.
5565 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5566 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5567 New method definitions.
5568 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5569 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5570 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5571 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5572 (Target_arm::Relocate::relocate): Check for non-static or
5573 unimplemented relocation code and exit early. Change calls to
5574 Target_arm::reloc_uses_thumb_bit and
5575 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5576 instead. Refactor code to handle similar relocations to increase
5577 code sharing. Remove check for unsupported relocation code in switch
5578 statement.
5579 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5580 relocation property table to find out size. Change error message to
5581 print out the name of a relocation code instead of the numeric value.
5582 (Target_arm::scan_reloc_for_stub): Use relocation property table
5583 instead of calling Target_arm::reloc_uses_thumb_bit().
5584
218c5831
DK
55852010-02-02 Doug Kwan <dougkwan@google.com>
5586
5587 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5588 types of relaxed input section.
5589
0d31c79d
DK
55902010-02-02 Doug Kwan <dougkwan@google.com>
5591
5592 * Makefile.am (HFILES): Add arm-reloc-property.h.
5593 (DEFFILES): New.
5594 (TARGETSOURCES): Add arm-reloc-property.cc
5595 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5596 (libgold_a_SOURCES): $(DEFFILES)
5597 * Makefile.in: Regenerate.
5598 * arm-reloc-property.cc: New file.
5599 * arm-reloc-property.h: New file.
5600 * arm-reloc.def: New file.
5601 * arm.cc: Update comments.
5602 (arm-reloc-property.h): New included header.
5603 (arm_reloc_property_table): New global variable.
5604 (Target_arm::do_select_as_default_target): New method definition.
5605 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5606 arm-reloc-property to targ_extra_obj.
5607 * parameters.cc (set_parameters_target): Call
5608 Target::select_as_default_target().
5609 * target.h (Target::select_as_default_target): New method definition.
5610 (Target::do_select_as_default_target): Same.
5611
546c7457
DK
56122010-02-01 Doug Kwan <dougkwan@google.com>
5613
5614 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5615 first_output_text_section_.
5616 (Arm_exidx_fixup::first_output_text_section): New method definition.
5617 (Arm_exidx_fixup::first_output_text_section_): New data member.
5618 (Arm_exidx_fixup::process_exidx_section): Record the first text
5619 output section seen.
5620 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5621 and entsize in output section header.
5622
11b861d5
DK
56232010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5624
5625 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5626 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5627 (Arm_relocate_functions::thm_alu11): New Method.
5628 (Arm_relocate_functions::thm_pc8): New Method.
5629 (Arm_relocate_functions::thm_pc12): New Method.
5630 (Target_arm::Scan::local): Handle the relocations.
5631 (Target_arm::Scan::global): Likewise.
5632 (Target_arm::Relocate::relocate): Likewise.
5633 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5634
c9a2c125
DK
56352010-01-29 Doug Kwan <dougkwan@google.com>
5636
5637 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5638 of relocation types as ld.
5639
1521477a
DK
56402010-01-29 Doug Kwan <dougkwan@google.com>
5641
5642 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5643 to public.
5644 (Arm_relocate_functions::thumb_branch_common): Ditto.
5645 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5646 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5647 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5648 Arm_relocate_functions::jump24): Remove.
5649 (Target_arm::Relocate::relocate): Adjust code to call
5650 Arm_relocation_functions::arm_branch_common and
5651 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5652 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5653
e7eca48c
DK
56542010-01-29 Doug Kwan <dougkwan@google.com>
5655
5656 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5657 output_local_symbol_count_needs_update_.
5658 (Arm_relobj::output_local_symbol_count_needs_update,
5659 Arm_relobj::set_output_local_symbol_count_needs_update,
5660 Arm_relobj::update_output_local_symbol_count): New methods.
5661 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5662 member.
5663 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5664 of pointed function as in a R_ARM_PREL31 relocation.
5665 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5666 for output local symbol count updating.
5667 (Target_arm::do_relax): Update output local symbol counts in objects
5668 if necessary.
5669 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5670
02961d7e
ILT
56712010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5672
5673 * arm.cc: Added support for the ARM relocations:
5674 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5675 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5676 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5677 movw_prel_nc).
5678 (Arm_relocate_functions::movw_rel): New method.
5679 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5680 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5681 thm_movw_prel_nc).
5682 (Arm_relocate_functions::thm_movw_rel): New method.
5683 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5684 thm_movt_prel).
5685 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5686 relocations.
5687 (Target_arm::Scan::global): Likewise.
5688 (Target_arm::Relocate::relocate): Likewise.
5689 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5690 Likewise.
5691
b10d2873
ILT
56922010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5693
5694 * arm.cc: Added support for ARM group relocations.
5695 (Target_arm::reloc_needs_sym_origin): New method.
5696 (Arm_relocate_functions::calc_grp_kn): New method.
5697 (Arm_relocate_functions::calc_grp_residual): New method.
5698 (Arm_relocate_functions::calc_grp_gn): New method.
5699 (Arm_relocate_functions::arm_grp_alu): New Method.
5700 (Arm_relocate_functions::arm_grp_ldr): New Method.
5701 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5702 (Arm_relocate_functions::arm_grp_ldc): New Method.
5703 (Target_arm::Scan::local): Handle the ARM group relocations.
5704 (Target_arm::Scan::global): Likewise.
5705 (Target_arm::Relocate::relocate): Likewise.
5706 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5707 Likewise.
5708
2b328d4e
DK
57092010-01-26 Doug Kwan <dougkwan@google.com>
5710
5711 * arm.cc (set): Include.
5712 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5713 pointer type.
5714 (Arm_output_section::Text_section_list): New type.
5715 (Arm_output_section::append_text_sections_to_list): New method.
5716 (Arm_output_section::fix_exidx_coverage): Ditto.
5717 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5718 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5719 Relobj::set_section_offset() instead of
5720 Sized_relobj::invalidate_section_offset().
5721 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5722 parameter for section headers. Ignore relocation sections for
5723 unallocated sections and EXIDX sections.
5724 (Target_arm::fix_exidx_coverage): New method.
5725 (Target_arm::output_section_address_less_than): New type.
5726 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5727 linked text section instead of the EXIDX section.
5728 (Arm_output_section::create_stub_group): Add an assertion to check
5729 that this is not an EXIDX output section.
5730 (Arm_output_section::append_text_sections_to_list): New method.
5731 (Arm_output_section::fix_exidx_coverage): Ditto.
5732 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5733 Arm_relobj::section_needs_reloc_stub_scanning.
5734 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5735 first pass.
5736 (Target_arm::fix_exidx_coverage): New method.
5737 * object.h (Relobj::set_output_section): New method.
5738 (Sized_relobj::invalidate_section_offset): Remove method.
5739 (Sized_relobj::do_invalidate_section_offset): Remove method.
5740 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5741
c7f3c371
DK
57422010-01-25 Doug Kwan <dougkwan@google.com>
5743
5744 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5745 Fix warning due to signed and unsigned comparison on a 32-bit host.
5746
8923b24c
DK
57472010-01-22 Doug Kwan <dougkwan@google.com>
5748
5749 * arm.cc (Target_arm::do_relax): Record an output section for section
5750 offset adjustment it contains any stub table that has changed.
5751 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5752 offsets in an output section if necessary.
5753 * output.cc (Output_section::Output_section): Initialize
5754 section_offsets_need_adjustments_.
5755 (Output_section::add_input_section_for_script): Renamed to
5756 Output_section::add_simple_input_section.
5757 (Output_section::save_states): Add a comment.
5758 (Output_section::discard_states): New method defintion.
5759 (Output_section::adjust_section_offsets): Same.
5760 * output.h (Output_section::add_input_section_for_script): Renamed to
5761 Output_section::add_simple_input_section.
5762 (Output_section::discard_states): New method declaration.
5763 (Output_section::adjust_section_offsets): Same.
5764 (Output_section::section_offsets_need_adjustment,
5765 Output_section::set_section_offsets_need_adjustment): New method
5766 definitions.
5767 (Output_section::section_offsets_need_adjustment_): New data member.
5768 * script-sections.cc
5769 (Output_section_element_input::set_section_address): Adjust code for
5770 renaming of Output_section::add_input_section_for_script.
5771 (Orphan_output_section::set_section_address): Same.
5772
9b2fd367
DK
57732010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5774
5775 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5776 Fix_v4bx enum values .
5777 * gold/options.h (General_options): New option definitions.
5778 (General_options::fix_v4bx): New method.
5779 (General_options::Fix_v4bx): New enum.
5780 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5781 (General_options::parse_fix_v4bx_interworking): New method.
5782
80d0d023
DK
57832010-01-22 Doug Kwan <dougkwan@google.com>
5784
5785 * arm.cc (Arm_exidx_fixup): New class.
5786
af2cdeae
DK
57872010-01-21 Doug Kwan <dougkwan@google.com>
5788
5789 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5790 classes.
5791 (Arm_exidx_section_offset_map): New type.
5792
993d07c1
DK
57932010-01-21 Doug Kwan <dougkwan@google.com>
5794
5795 * arm.cc (Arm_exidx_input_section): New class.
5796 (Arm_relobj::exidx_input_section_by_link,
5797 Arm_relobj::exidx_input_section_by_shndx,
5798 Arm_relobj::make_exidx_input_section): New methods.
5799 (read_arm_attributes_section): Remove.
5800 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5801 information about them.
5802 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5803 to here.
5804
5ac169d4
DK
58052010-01-20 Doug Kwan <dougkwan@google.com>
5806
5807 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5808 Input_section_specifier to Section_id.
5809 (Target_arm::new_arm_input_section: Adjust code for change of key
5810 type.
5811 (Target_arm::find_arm_input_section): Ditto.
5812 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5813 (Section_id): Remove.
5814 (Garbage_collection::Section_id_hash): Remove.
5815 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5816 (Section_id): Remove.
5817 (Icf::Section_id_hash): Remove.
5818 * object.h (Section_id, Const_section_id, Section_id_hash,
5819 Const_section_id_hash): New type definitions.
5820 * output.cc (Output_section::add_relaxed_input_section): Change to
5821 use Const_section_id instead of Input_section_specifier as key type.
5822 (Output_section::add_merge_input_section): Ditto.
5823 (Output_section::build_relaxation_map): Change to use Section_id
5824 instead of Input_section_specifier as key type.
5825 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5826 Ditto.
5827 (Output_section::convert_input_sections_to_relaxed_sections): Change
5828 to use Const_section_id instead of Input_section_specifier as key type.
5829 (Output_section::find_merge_section): Ditto.
5830 (Output_section::find_relaxed_input_section): Ditto.
5831 * output.h (Input_section_specifier): Remove class.
5832 (Output_section::Output_section_data_by_input_section_map): Change
5833 key type to Const_section_id.
5834 (Output_section::Output_relaxed_input_section_by_input_section_map):
5835 Ditto.
5836 (Output_section::Relaxation_map): Change key type to Section_id.
5837
a2162063
ILT
58382010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5839
5840 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5841 (class Arm_v4bx_stub): New class.
5842 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5843 (Stub_factory::make_arm_v4bx_stub): New method.
5844 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5845 (Stub_table::empty): Handle v4bx stubs.
5846 (Stub_table::add_arm_v4bx_stub): New method.
5847 (Stub_table::find_arm_v4bx_stub): New method.
5848 (Arm_relocate_functions::v4bx): New method.
5849 (Target_arm::fix_v4bx): New method.
5850 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5851 (Stub_table::relocate_stubs): Likewise.
5852 (Stub_table::do_write): Likewise.
5853 (Stub_table::update_data_size_and_addralign): Likewise.
5854 (Stub_table::finalize_stubs): Likewise.
5855 (Target_arm::Scan::local): Likewise.
5856 (Target_arm::Scan::global): Likewise.
5857 (Target_arm::do_finalize_sections): Likewise.
5858 (Target_arm::Relocate::relocate): Likewise.
5859 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5860 Likewise.
5861 (Target_arm::scan_reloc_for_stub): Likewise.
5862 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5863
5696ab0b
ILT
58642010-01-19 Ian Lance Taylor <iant@google.com>
5865
5866 * output.cc (Output_section_headers::do_sized_write): Write large
5867 segment count to sh_info field.
5868 (Output_file_header::do_sized_write): For large segment count,
5869 write PN_XNUM to e_phnum field.
5870
800d0f56
ILT
58712010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5872
5873 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5874 (Arm_relocate_functions::thm_jump8): New function.
5875 (Arm_relocate_functions::thm_jump11): New function.
5876 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5877 R_ARM_THM_JUMP11.
5878 (Target_arm::Scan::global): Likewise.
5879 (Target_arm::Relocate::relocate): Likewise.
5880 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5881 Likewise.
5882
41263c05
DK
58832010-01-14 Doug Kwan <dougkwan@google.com>
5884
5885 * arm.cc (map, utility): Include headers.
5886 (Target_arm::apply_cortex_a8_workaround): New method.
5887 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5888 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5889 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5890 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5891 the --[no-]fix-cortex-a8 command line options.
5892 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5893 (Target_arm::relocate_stub): Use addend in instruction template.
5894 * options.h (DEFINE_bool): Set the user-set flag.
5895 (General_options): Add --[no-]-fix-cortex options.
5896 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 5897 : Update fast look-up map after conversion.
41263c05 5898
459e9b03
ST
58992010-01-14 Sriraman Tallam <tmsriram@google.com>
5900
5901 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5902 in the first pass of do_layout.
5903
b521dfe4
DK
59042010-01-13 Doug Kwan <dougkwan@google.com>
5905
5906 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5907 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5908 apparent compiler problem of not folding static constant integral
5909 data members of elfcpp::Elf_sizes<32>.
5910
44272192
DK
59112010-01-13 Doug Kwan <dougkwan@google.com>
5912
5913 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5914 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5915 Arm_relobj::scan_section_for_cortex_a8_erratum,
5916 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5917 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5918 sections to scan for relocation stubs into a new method
5919 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5920 relocation and Cortex-A8 stub scanning.
5921 (Target_arm::do_relax): Force stubs to be after stubbed sections
5922 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 5923 the beginning of a new relaxation pass. Update a comment.
44272192
DK
5924 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5925
44b71ece
ILT
59262010-01-12 Ian Lance Taylor <iant@google.com>
5927
5928 * target-reloc.h (visibility_error): New inline function.
5929 (relocate_section): Call visibility_error.
5930 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5931 (MOSTLYCLEANFILES): Likewise.
5932 (protected_4_pic.o, protected_3.err): New targets.
5933 * testsuite/protected_4.cc: New file.
5934
a120bc7f
DK
59352010-01-12 Doug Kwan <dougkwan@google.com>
5936
5937 * arm.cc (Cortex_a8_reloc): New class.
5938 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5939 and cortex_a8_relocs_info_.
5940 (Target_arm::fix_cortex_a8): New method definition.
5941 (Target_arm::Cortex_a8_relocs_info): New type.
5942 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5943 New data member declarations.
5944 (Target_arm::scan_reloc_for_stub): Record information about
5945 relocations for THUMB branches that might be exempted from the
5946 Cortex-A8 workaround.
5947 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5948 at the beginning of a relaxation pass.
5949
20138696
DK
59502010-01-12 Doug Kwan <dougkwan@google.com>
5951
5952 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5953 (Arm_relobj::Mapping_symbol_position,
5954 Arm_reloj::Mapping_symbol_position_less,
5955 Arm_relobj::Mapping_symbols_info): New types.
5956 (Target_arm::is_mapping_symbol_name): New method definition.
5957 (Arm_relobj::do_count_local_symbols): Save information about mapping
5958 symbols.
5959
089d69dc
DK
59602010-01-11 Doug Kwan <dougkwan@google.com>
5961
5962 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5963 Arm_relocate_functions::thumb32_branch_upper,
5964 Arm_relocate_functions::thumb32_branch_lower,
5965 Arm_relocate_functions::thumb32_cond_branch_offset,
5966 Arm_relocate_functions::thumb32_cond_branch_upper,
5967 Arm_relocate_functions::thumb32_cond_branch_lower,
5968 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5969 branch offset encoding.
5970 (Arm_relocate_functions::thumb_branch_common): Use new branch
5971 offset encoding methods to avoid code duplication.
5972 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5973 (Stub_addend_reader::operator()): Use new branch encoding method
5974 to avoid code duplication.
5975
99e5bff2
DK
59762010-01-11 Doug Kwan <dougkwan@google.com>
5977
5978 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5979 (Target_arm::do_finalize_sections): Define special EXIDX section
5980 symbols only if referenced.
5981 * gc.h (Garbage_collection::add_reference): New method.
5982 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5983 code duplication.
5984
98e090bd
ILT
59852010-01-11 Ian Lance Taylor <iant@google.com>
5986
d0a91bd8
ILT
5987 * script.cc (Version_script_info::build_expression_list_lookup):
5988 Change complaing about duplicate wildcard match from error to
5989 warning.
5990
98e090bd
ILT
5991 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5992 of 2009-12-30.
5993 (Version_script_info::Version_script_info): Initialize globs_,
5994 default_version_, default_is_global_, and exact_. Don't
5995 initialize globals_ or locals_.
5996 (Version_script_info::build_lookup_tables): Build local symbols
5997 first.
5998 (Version_script_info::unquote): New function.
5999 (Version_script_info::add_exact_match): New function.
6000 (Version_script_info::build_expression_list_lookup): Remove lookup
6001 parameter. Add is_global parameter. Change all callers. Handle
6002 wildcard pattern specially. Unquote pattern. Call
6003 add_exact_match.
6004 (Version_script_info::get_name_to_match): New function.
6005 (Version_script_info::get_symbol_version): New function.
6006 (Version_script_info::get_symbol_version_helper): Remove.
6007 (Version_script_info::check_unmatched_names): Call unquote.
6008 * script.h (class Version_script_info): Change get_symbol_version
6009 to be non-inline and add is_global parameter; change all callers.
6010 Rewrite symbol_is_local. Update declarations. Define struct
6011 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6012 Remove globals_ and locals_ members. Add exact_, globs_,
6013 default_version_, is_global_.
6014 (Version_script_info::Glob): Remove pattern, add expression and
6015 is_global. Update constructor. Change all callers.
6016 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6017 default version.
6018 (Versions::symbol_section_contents): If a symbol is undefined, or
6019 defined in a dynamic object, set the version index to
6020 VER_NDX_LOCAL.
6021 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6022 symbol_is_local.
6023 (Symbol_table::add_from_pluginobj): Likewise.
6024 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6025
d56962d3
DK
60262010-01-11 Doug Kwan <dougkwan@google.com>
6027
6028 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6029 (incremental_dump_LDADD): Add linking option for libintl.
6030 * Makefile.in: Regenerate.
6031
94e6ee91
L
60322010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6033
6034 PR gold/11144
6035 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6036 instead of -Ds.
6037 * testsuite/Makefile.in: Regenerated.
6038
e96c574b
DK
60392010-01-10 Doug Kwan <dougkwan@google.com>
6040
6041 * options.h (DEFINE_var): Use parentheses around argument varname__
6042 in macro body to avoid any unintended subsequent substitutions.
6043
7198066b
ILT
60442010-01-10 Ian Lance Taylor <iant@google.com>
6045
ba4d53bf
ILT
6046 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6047 candidates before doing symbol resolution.
6048
7198066b
ILT
6049 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6050 ODR candidates if only one is weak.
6051
a2beed37
ILT
60522010-01-08 Ian Lance Taylor <iant@google.com>
6053
6054 * script.cc (Version_script_info::build_expression_list_lookup):
6055 Don't warn about ambiguous version, just record the ambiguity.
6056 (Version_script_info::get_symbol_version_helper): Give error if
6057 version is ambiguous.
6058
2fb7225c
DK
60592010-01-08 Doug Kwan <dougkwan@google.com>
6060
6061 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
6062 prev_data_size_ and prev_addralign_. Remove initializer for
6063 deleted data member has_been_changed_.
6064 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
6065 to determine if the table is empty.
6066 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
6067 Remove.
6068 (Stub_table::add_reloc_stub): Define method in class definition
6069 instead of just declaring it there.
6070 (Stub_table::add_cortex_a8_stub): New method definition.
6071 (Stub_table::update_data_size_and_addralign): Ditto.
6072 (Stub_table::finalize_stubs): Ditto.
6073 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
6074 (Stub_table::do_addralign_): Return address alignment in the
6075 (Stub_table::do_reset_address_and_file_offset): Define method in
6076 class definition instead of declaring it there. Set current data
6077 size to be the data size of the previous pass.
6078 (Stub_table::set_final_data_size): Use current data size as the
6079 final data size.
6080 (Stub_table::relocate_stub): Change parameter type of stub from
6081 Reloc_stub pointer to Stub pointer.
6082 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
6083 (Stub_table::Cortex_a8_stub_list): New typedef.
6084 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
6085 Stub_table::prev_addralign_): New data member.
6086 (Arm_relobj::Arm_relobj): Initialize data member
6087 section_has_cortex_a8_workaround_.
6088 (Arm_relobj::section_has_cortex_a8_workaround,
6089 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
6090 definitions.
6091 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
6092 declarations.
6093 (Target_arm::relocate_stub): Change parameter type of stub from
6094 Reloc_stub pointer to Stub pointer.
6095 (Insn_template::size, Insn_template::alignment): Handle
6096 THUMB16_SPECIAL_TYPE.
6097 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
6098 Stub_table::update_data_size_and_addralign,
6099 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
6100 definitions.
6101 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
6102 (Stub_table::do_write): Ditto.
6103 (Target_arm::do_relax): Adjust code for changes in Stub_table.
6104
880cd20d
ILT
61052010-01-08 Ian Lance Taylor <iant@google.com>
6106
6107 PR 11108
6108 * symtab.h (class Symbol): Remove fields is_target_special_ and
6109 has_plt_offset_. Add field is_defined_in_discarded_section_.
6110 (Symbol::is_defined_in_discarded_section): New function.
6111 (Symbol::set_is_defined_in_discarded_section): New function.
6112 (Symbol::has_plt_offset): Rewrite.
6113 (Symbol::set_plt_offset): Verify that new offset is not -1U.
6114 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
6115 Don't initialize is_target_special_ or has_plt_offset_.
6116 Initialize is_defined_in_discarded_section_.
6117 (Symbol_table::add_from_relobj): If appropriate, set
6118 is_defined_in_discarded_section.
6119 * resolve.cc (Symbol::override_base_with_special): Don't test
6120 is_target_special_. Change has_plt_offset_ to has_plt_offset().
6121 * target-reloc.h (relocate_section): Do special handling for
6122 symbols defined in discarded sections for global symbols as well
6123 as local symbols.
6124
2703e3eb
ILT
61252010-01-08 Ian Lance Taylor <iant@google.com>
6126
6127 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
6128 the SHT_SYMTAB case.
6129
339d40a3
ILT
61302010-01-08 Ian Lance Taylor <iant@google.com>
6131
6132 * object.cc (Sized_relobj::do_layout): Don't get confused if
6133 layout_eh_frame returns NULL.
6134
abecea76
ILT
61352010-01-08 Ian Lance Taylor <iant@google.com>
6136
6137 PR 11084
6138 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
6139 dynamic symbol table, use the normal symbol table.
6140 (Sized_dynobj::do_read_symbols): Remove assertion about type of
6141 symbol table.
6142
6b7dd3f3
ILT
61432010-01-08 Ian Lance Taylor <iant@google.com>
6144
6145 PR 11072
6146 * layout.cc (Layout::include_section): Remove .gnu_debuglink
6147 sections.
6148
36c50e63
L
61492010-01-08 H.J. Lu <hongjiu.lu@intel.com>
6150
6151 * version.cc (print_version): Change to "Copyright 2010".
6152
e291e7b9
ILT
61532010-01-08 Ian Lance Taylor <iant@google.com>
6154
6155 PR 10287
6156 PR 11063
6157 * i386.cc (class Target_i386): Change return type of plt_section
6158 to be non-const.
6159 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6160 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6161 tls_desc_rel_ field.
6162 (Output_data_plt_i386::rel_tls_desc): New function.
6163 (Target_i386::rel_tls_desc_section): New function.
6164 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6165 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6166 R_386_TLS_DESC reloc in rel_tls_desc_section.
6167 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6168 Define struct Tlsdesc_info.
6169 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6170 (Target_x86_64::do_reloc_symbol_index): New function.
6171 (Target_x86_64::add_tlsdesc_info): New function.
6172 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6173 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6174 tlsdesc_rel_ field.
6175 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6176 all callers.
6177 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6178 (Target_x86_64::rela_tlsdesc_section): New function.
6179 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6180 handling.
6181 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6182 (Target_x86_64::do_reloc_addend): New function.
6183 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6184 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6185 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6186 (Output_reloc::type): New function.
6187 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6188 (Output_reloc::is_target_specific): New function.
6189 (Output_reloc::target_arg): New function.
6190 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6191 absolute relocs and target specific relocs.
6192 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6193 add_target_specific.
6194 (class Output_data_reloc) [SHT_RELA]: Likewise.
6195 * output.cc (Output_reloc::Output_reloc): Add four new versions
6196 for absolute relocs and target specific relocs.
6197 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6198 (Output_reloc::get_symbol_index): Likewise.
6199 (Output_reloc::local_section_offset): Check that local_sym_index_
6200 is not TARGET_CODE or 0.
6201 (Output_reloc::symbol_value): Likewise.
6202 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6203 reloc.
6204 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6205 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6206 functions.
6207 * layout.cc (add_target_dynamic_tags): Use output section for
6208 DT_PLTRELSZ and DT_JMPREL.
6209
3a44184e
ILT
62102010-01-07 Ian Lance Taylor <iant@google.com>
6211
6212 PR 11061
6213 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6214 function.
6215 (class Output_data_reloc_generic): Define.
6216 (class Output_data_reloc_base): Change base class to
6217 Output_data_reloc_generic. Change add() method to call
6218 bump_relative_reloc_count for a relative reloc. Remove
6219 sort_relocs_ field.
6220 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6221 to sort_relocs().
6222 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6223 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6224 appropriate.
6225 * layout.h (class Layout): Update declaration.
6226
ea715a34
ILT
62272010-01-07 Ian Lance Taylor <iant@google.com>
6228
6229 * output.h (class Output_data): Add const version of
6230 output_section and do_output_section.
6231 (class Output_section_data): Add const version of
6232 do_output_section.
6233 (class Output_section): Likewise.
6234 * layout.cc (Layout::add_target_dynamic_tags): New function.
6235 * layout.h (class Layout): Update declarations.
6236 * arm.cc (Target_arm::do_finalize_sections): Use
6237 add_target_dynamic_tags.
6238 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6239 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6240 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6241 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6242
659948a4
ILT
62432010-01-07 Ian Lance Taylor <iant@google.com>
6244
6245 PR 11042
6246 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6247 object as needed.
6248
9d3b86f6
ILT
62492010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6250 Ian Lance Taylor <iant@google.com>
6251
6252 PR 11019
6253 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6254 Xindex::read_symtab_xindex.
6255
bb0d3eb0
DK
62562010-01-07 Doug Kwan <dougkwan@google.com>
6257
6258 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6259 (Insn_template::thumb16_bcond_insn): New method declaration.
6260 (Insn_template): Fix spelling.
6261 (Stub::thumb16_special): New method declaration.
6262 (Stub::do_write): Define virtual method which was previously pure
6263 virtual.
6264 (Stub::do_thumb16_special): New method declaration.
6265 (Stub::do_fixed_endian_write): New template member.
6266 (Reloc_stub::do_write): Remove.
6267 (Reloc_stub::do_fixed_endian_write): Remove.
6268 (Cortex_a8_stub): New class definition.
6269 (Stub_factory::make_cortex_a8_stub): New method definition.
6270 (Stub_factory::Stub_factory): Add missing static storage class
6271 qualifier for elf32_arm_stub_a8_veneer_blx.
6272
ffeef7df
ILT
62732010-01-07 Ian Lance Taylor <iant@google.com>
6274
dc3f80fe
ILT
6275 PR 10980
6276 * options.h (class General_options): Add --warn-unresolved-symbols
6277 and --error-unresolved-symbols.
6278 * errors.cc (Errors::undefined_symbol): Implement
6279 --warn-unresolved-symbols.
6280
ffeef7df
ILT
6281 * options.h (class General_options): Add -z text and -z textoff.
6282 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6283
f1ec9ded
ST
62842010-01-06 Sriraman Tallam <tmsriram@google.com>
6285
6286 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6287 (Garbage_collection::cident_sections): New function.
6288 (Garbage_collection::add_cident_section): New function.
6289 (Garbage_collection::cident_sections_): New member.
6290 (gc_process_relocs): Add references to sections whose names are C
6291 identifiers.
6292 * gold.h (cident_section_start_prefix): New constant.
6293 (cident_section_stop_prefix): New constant.
6294 (is_cident): New function.
6295 * layout.cc (Layout::define_section_symbols): Replace string constants
6296 with the newly defined constants.
6297 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6298 C identifiers.
6299 * testsuite/Makefile.am: Add gc_orphan_section_test.
6300 * testsuite/Makefile.in: Regenerate.
6301 * testsuite/gc_orphan_section_test.cc: New file.
6302 * testsuite/gc_orphan_section_test.sh: New file.
6303
6eda8c29
ILT
63042010-01-06 Ian Lance Taylor <iant@google.com>
6305
b9674e17
ILT
6306 PR 10980
6307 * options.h (class General_options): Add --warn-shared-textrel.
6308 * layout.cc (Layout::finish_dynamic_section): Implement
6309 --warn-shared-textrel.
6310
6eda8c29
ILT
6311 PR 10980
6312 * options.h (class General_options): Add --warn-multiple-gp.
6313
32dcd44e
ILT
63142010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6315
6316 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6317 $(THREADSLIB) and $(LIBDL).
6318 * Makefile.in: Rebuild.
6319
a192ba05
ILT
63202010-01-06 Ian Lance Taylor <iant@google.com>
6321
6322 PR 10980
6323 * options.cc (General_options::parse_section_start): New function.
6324 (General_options::section_start): New function.
6325 (General_options::General_options): Initialize all members.
6326 * options.h: Include <map>
6327 (class General_options): Add --section-start. Add section_starts_
6328 member.
6329 * layout.cc (Layout::attach_allocated_section_to_segment): If
6330 --section-start was used, set the address of the segment. Remove
6331 local sort_sections.
6332 (Layout::relaxation_loop_body): If the address of the load segment
6333 has been set by --section-start, don't use it.
6334 * output.h (Output_segment::update_flags_for_output_section): New
6335 function.
6336 * output.cc (Output_segment::add_output_section): Call
6337 update_flags_for_output_section.
6338
dde3f402
ILT
63392010-01-05 Ian Lance Taylor <iant@google.com>
6340
62dfdd4d
ILT
6341 PR 10980
6342 * options.h (class General_options): Add --undefined-version.
6343 * script.cc (struct Version_expression): Add was_matched_by_symbol
6344 field.
6345 (Version_script_info::matched_symbol): New function.
6346 (Version_script_info::get_symbol_version_helper): Call
6347 matched_symbol.
6348 (Version_script_info::check_unmatched_names): New function.
6349 * script.h (class Version_script_info): Update declarations.
6350 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6351
9c4ae156
ILT
6352 * options.h (class General_options): Use DEFINE_bool_alias for
6353 allow_multiple_definition.
6354 * resolve.cc (Symbol_table::should_override): Don't test
6355 allow_multiple_definition.
6356
dde3f402
ILT
6357 PR 10980
6358 * options.h (class General_options): Add --cref.
6359 * main.cc (main): Print cref table if --cref. Don't close mapfile
6360 until after printing cref table.
6361 * cref.cc: Include "symtab.h".
6362 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6363 (Cref_table_compare::operator()): New function.
6364 (Cref_inputs::gather_cref): New function.
6365 (filecol): New static const.
6366 (Cref_inputs::print_cref): New function.
6367 (Cref::print_cref): New function.
6368 * cref.h: Include <cstdio>.
6369 (class Cref): Update declarations.
6370 * mapfile.h (Mapfile::file): New function.
6371 * object.h (class Object): Define Symbols. Declare virtual
6372 do_get_global_symbols.
6373 (Object::get_global_symbols): New function.
6374 * object.cc (Input_objects::add_object): Pass object to cref_ if
6375 --cref.
6376 (Input_objects::archive_start): Likewise.
6377 (Input_objects::archive_stop): Likewise.
6378 (Input_objects::print_cref): New function.
6379 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6380 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6381 --cref.
6382 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6383 function.
6384 * plugin.h (class Sized_pluginobj): Update declarations.
6385
8781f709
ILT
63862010-01-05 Ian Lance Taylor <iant@google.com>
6387
6388 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6389 to is_default_version. Rename insdef to insdefault.
6390 (Symbol_table::add_from_relobj): Rename def to is_default_version
6391 and local to is_forced_local.
6392 (Symbol_table::add_from_pluginobj): Likewise.
6393 (Symbol_table::add_from_dynobj): Likewise.
6394 (Symbol_table::define_special_symbol): Rename insdef to
6395 insdefault.
6396
fe35d28d
ILT
63972010-01-04 Ian Lance Taylor <iant@google.com>
6398
30bc8c46
ILT
6399 PR 10980
6400 * options.h (class General_options): Add
6401 --allow-multiple-definition and -z muldefs.
6402 * resolve.cc (Symbol_table::should_override): Don't warn about a
6403 multiple symbol definition if --allow-multiple-definition or -z
6404 muldefs.
6405
7eaea549
ILT
6406 PR 10980
6407 * options.h (class General_options): Add --add-needed and
6408 --copy-dt-needed-entries. Tweak --as-needed help entry.
6409 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6410 error if --copy-dt-needed-entries aka --add-needed is used and
6411 would cause a change in behaviour.
6412
fe35d28d
ILT
6413 PR 10980
6414 * options.h (class General_options): Add -G as a short version of
6415 --shared. Add no-op options -assert, -g, and -i.
6416
55a2bb35
ST
64172010-01-04 Sriraman Tallam <tmsriram@google.com>
6418
6419 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6420 check for .text or .gnu.linkonce.t sections.
6421 * icf.cc (Icf::find_identical_sections): Ditto.
6422 Change the detection for mangled function name within the section
6423 name.
6424 * icf.h (is_section_foldable_candidate): New function.
6425
719328e1
ILT
64262009-12-30 Ian Lance Taylor <iant@google.com>
6427
6428 PR 10980
6429 * options.h (class General_options): Permit two dashes with
6430 --retain-symbols-file.
6431
d7bb5745
ILT
64322009-12-30 Ian Lance Taylor <iant@google.com>
6433
403a15dd
ILT
6434 PR 10979
6435 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6436 don't put the file header and segment headers in the text
6437 segment.
6438
eda294df
ILT
6439 PR 10979
6440 * common.cc (Sort_commons::operator()): Stabilize sort when both
6441 entries are NULL.
6442 (Symbol_table::do_allocate_commons_list): When allocating common
6443 symbols, skip a symbol which is no longer common.
6444 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6445 an object before checking its type.
6446 * testsuite/common_test_2.c: New file.
6447 * testsuite/common_test_3.c: New file.
6448 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6449 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6450 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6451 (common_test_2_pic.o, common_test_2.so): New targets.
6452 (common_test_3_pic.o, common_test_3.so): New targets.
6453 * testsuite/Makefile.in: Rebuild.
6454
d7bb5745
ILT
6455 PR 10979
6456 * script.cc (read_input_script): If we see a new SECTIONS clause,
6457 and we have added an input section, give an error.
6458 * layout.h (class Layout): Add have_added_input_section function.
6459 Add have_added_input_section_ field.
6460 * layout.cc (Layout::Layout): Initialize
6461 have_added_input_section_.
6462 (Layout::layout): Set have_added_input_section_.
6463 (Layout::layout_eh_frame): Likewise.
6464
fc59c572
ILT
64652009-12-30 Ian Lance Taylor <iant@google.com>
6466
6467 PR 10931
6468 * options.h (class General_options): Add --sort-common option.
6469 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6470 * common.cc (Sort_common): Add sort_order parameter to
6471 constructor. Add sort_order_ field.
6472 (Sort_commons::operator): Check sort_order_.
6473 (Symbol_table::allocate_commons): Determine the sort order.
6474 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6475 Change all callers.
6476 (Symbol_table::do_allocate_commons_list): Likewise.
6477
1c74fab0
ILT
64782009-12-30 Ian Lance Taylor <iant@google.com>
6479
6480 PR 10916
6481 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6482 symbols from this object, don't change the visibility of an
6483 undefined symbol.
6484 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6485
6affe781
ILT
64862009-12-30 Ian Lance Taylor <iant@google.com>
6487
6488 PR 10861
6489 * script.h (class Version_script_info): Define Language enum.
6490 Update declarations. Define Glob, Exact, and Lookup types. Add
6491 new fields globals_, locals_, and is_finalized_.
6492 * script.cc: Various formatting fixes.
6493 (class Parser_closure): Change language_stack_ from a vector of
6494 std::string to one of Version_script_info::Language. Adjust all
6495 uses accordingly.
6496 (class Lazy_demangler): Remove.
6497 (struct Version_expression): Change language from std::string to
6498 Version_script_info::Language.
6499 (Version_script_info::Version_script_info): New function.
6500 (Version_script_info::~Version_script_info): Don't call clear.
6501 (Version_script_info::finalize): New function.
6502 (Version_script_info::build_lookup_tables): New function.
6503 (Version_script_info::build_expression_list_lookup): New
6504 function.
6505 (Version_script_info::get_symbol_version_helper): Rewrite to use
6506 lookup tables.
6507 (Version_script_info::print_expression_list): Adjust to use
6508 Version_script_info::Language.
6509 (script_push_lex_into_version_mode): Check that the version script
6510 has not been finalized.
6511 (version_script_push_lang): Change language string to
6512 Version_script_info::Language.
6513 * options.cc (Command_line::version_script): New function.
6514 * options.h (class General_options): Add finalize_dynamic_list
6515 function. Change version_script from declaration to definition.
6516 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6517 * testsuite/version_script.map: Remove duplicate def of foo.
6518 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6519 version_script.map.
6520 * testsuite/Makefile.in: Rebuild.
6521
818bf354
ILT
65222009-12-30 Ian Lance Taylor <iant@google.com>
6523
6524 PR 10843
6525 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6526 if the input symbol index is 0, make the output symbol index 0.
6527
ebcc8304
ILT
65282009-12-30 Ian Lance Taylor <iant@google.com>
6529
6530 PR 10670
6531 * options.h (class General_options): Add -x/--discard-all.
6532 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6533 --discard-all. If the local symbol needs a dynamic entry, check
6534 that before handling --discard-locals.
6535
176fe33f
ILT
65362009-12-30 Ian Lance Taylor <iant@google.com>
6537
bb321bb1
ILT
6538 PR 10450
6539 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6540 flags to PF_R.
6541 (Output_segment::add_output_section): Don't change the flags if
6542 the type is PT_TLS.
6543
176fe33f
ILT
6544 PR 10450
6545 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6546 GNU hash table if they need a dynamic value. Otherwise, don't add
6547 them if they are defined in a dynamic object or are forced local.
6548
e8cd95c7
ILT
65492009-12-29 Ian Lance Taylor <iant@google.com>
6550
1b81fb71
ILT
6551 PR 10450
6552 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6553 .gnu.hash table for a 32-bit target.
6554
8d6d383d
ILT
6555 PR 10450
6556 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6557 regular and a dynamic object only needs a dynamic symbol table
6558 entry if it is externally visible.
6559
e785ec03
ILT
6560 PR 10450
6561 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6562 constructor. Add global_offset_table_ field.
6563 (Target_i386::got_section): Set global_offset_table_.
6564 (Target_i386::do_finalize_sections): Set global_offset_table_
6565 size.
6566 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6567 in constructor. Add global_offset_table_ field.
6568 (Target_x86_64::got_section): Set global_offset_table_.
6569 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6570 size.
6571
1a2dff53
ILT
6572 * layout.cc (Layout::Layout): Initialize increase_relro_.
6573 (Layout::get_output_section): Add is_relro, is_last_relro, and
6574 is_first_non_relro parameters. Change all callers.
6575 (Layout::choose_output_section): Likewise.
6576 (Layout::add_output_section_data): Likewise.
6577 (Layout::make_output_section): Likewise.
6578 (Layout::set_segment_offsets): Clear increase_relro when using a
6579 linker script.
6580 * layout.h (class Layout): Add increase_relro method. Add
6581 increase_relro_ field. Update declarations.
6582 * output.cc (Output_section::Output_section): Initialize
6583 is_last_relro_ and is_first_non_relro_.
6584 (Output_segment::add_output_section): Group relro sections is
6585 do_sort is true. Handle is_last_relro and is_first_non_relro.
6586 (Output_segment::maximum_alignment): Remove relro handling.
6587 (Output_segment::set_section_addresses): Add increase_relro
6588 parameter. Change all callers. Add initial alignment to align
6589 relro sections on separate page. Remove old relro handling.
6590 (Output_segment::set_section_list_addresses): Remove in_relro
6591 parameter. Change all callers.
6592 (Output_segment::set_offset): Add increase parameter. Change all
6593 callers. Remove old relro handling.
6594 * output.h (class Output_section): Add new methods: is_last_relro,
6595 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6596 Add is_last_relro_ and is_first_non_relro_ fields.
6597 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6598 Create separate .got.plt section. Call increase_relro.
6599 * x86_64.cc (Target_x86_64::got_section): Likewise.
6600 * testsuite/relro_script_test.t: Add .got.plt.
6601
f0ba79e2
ILT
6602 PR 10450
6603 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6604 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6605 (Layout::finalize): Call set_dynamic_symbol_size.
6606 (Layout::set_dynamic_symbol_size): New function.
6607 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6608 set_dynamic_symbol_size.
6609
e8cd95c7
ILT
6610 PR 10450
6611 * output.h (class Output_section): Add is_entsize_zero_ field.
6612 * output.cc (Output_section::Output_section): Initialize
6613 is_entsize_zero_.
6614 (Output_section::set_entsize): If two different entsizes are
6615 requested, force it to zero.
6616 (Output_section::add_input_section): Set flags for .debug_str
6617 before updating section flags. Set entsize.
6618 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6619 and SHF_STRING if all input sections have those flags.
6620
3e1b9a8a
RÁE
66212009-12-29 Rafael Espindola <espindola@google.com>
6622
6623 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6624 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6625 reporting.
3e1b9a8a 6626
3dcad376
ST
66272009-12-29 Sriraman Tallam <tmsriram@google.com>
6628
6629 * options.cc (General_options::parse_version): Allow -v to exit
6630 without an error if there is nothing to link.
6631
084e2665
ILT
66322009-12-29 Ian Lance Taylor <iant@google.com>
6633
6634 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6635 using a version of gcc before 4.1.
6636 * configure: Rebuild.
6637
250acde3
CD
66382009-12-28 Chris Demetriou <cgd@google.com>
6639
6640 * attributes.cc (Output_attributes_section_data::do_write): Use
6641 std::vector::front rather than std::vector::data.
6642
99fff23b
ILT
66432009-12-28 Ian Lance Taylor <iant@google.com>
6644
6645 * symtab.h (class Symbol_table): Add enum Defined.
6646 * resolve.cc (Symbol_table::should_override): Add defined
6647 parameter. Change all callers. Test whether object is NULL
6648 before calling a method on it.
6649 (Symbol_table::report_resolve_problem): Add defined parameter.
6650 Change all callers.
6651 (Symbol_table::should_override_with_special): Likewise.
6652 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6653 parameter. Change all callers.
6654 (Symbol_table::do_define_in_output_data): Likewise.
6655 (Symbol_table::define_in_output_segment): Likewise.
6656 (Symbol_table::do_define_in_output_segment): Likewise.
6657 (Symbol_table::define_as_constant): Likewise.
6658 (Symbol_table::do_define_as_constant): Likewise.
6659 * script.h (class Symbol_assignment): Add is_defsym parameter to
6660 constructor; change all callers.
6661 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6662 parameter. Change all callers. Add is_defsym_ field.
6663 (class Parser_closure): Add parsing_defsym parameter to
6664 constructor; change all callers. Add parsing_defsym accessor
6665 function. Add parsing_defsym_ field.
6666
556bd683
ILT
66672009-12-28 Ian Lance Taylor <iant@google.com>
6668
6669 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6670 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6671
1782c879
ILT
66722009-12-23 Ian Lance Taylor <iant@google.com>
6673
6674 * i386.cc (Target_i386::do_calls_non_split): Recognize
6675 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6676 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6677 -fsplit-stack prologue when using %r11.
1782c879 6678
329ca2b1
ST
66792009-12-21 Sriraman Tallam <tmsriram@google.com>
6680
6681 * options.cc (General_options::parse_version): Make -v continue and do
6682 the link like GNU ld does.
6683
d675ff46
RÁE
66842009-12-17 Rafael Avila de Espindola <espindola@google.com>
6685
6686 * Makefile.am (CCFILES): Add timer.cc.
6687 (HFILES): Add timer.h.
6688 * configure.ac: Check for sysconf and times.
6689 * main.cc: include timer.h.
6690 (main): Use Timer instead of get_run_time.
6691 * timer.cc: New.
6692 * timer.h: New.
6693 * workqueue.cc: include timer.h.
6694 (Workqueue::find_and_run_task):
6695 Report user, sys and wall time.
6696 * Makefile.in: Regenerate.
6697 * config.in: Regenerate.
6698 * configure: Regenerate.
6699
d6344fb5
DK
67002009-12-16 Doug Kwan <dougkwan@google.com>
6701
6702 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6703 sections.
6704 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6705 relaxed input sections.
6706 * output.cc (Output_section::find_relaxed_input_section): Change
6707 return type to Output_relaxed_input_section pointer. Adjust code
6708 for new type of relaxed_input_section_map_.
6709 * output.h (Output_section::find_relaxed_input_section): Change
6710 return type to Output_relaxed_input_section pointer.
6711 (Output_section::Output_relaxed_input_section_by_input_section_map):
6712 New type.
6713 (Output_section::relaxed_input_section_map_): Change type to
6714 Output_section::Output_relaxed_input_section_by_input_section_map.
6715 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6716 input section.
6717
0e0d5469
ILT
67182009-12-15 Ian Lance Taylor <iant@google.com>
6719
6720 * layout.cc (Layout::create_shstrtab): Only write out after input
6721 sections if we are compressing debug sections.
6722
0649a889
ILT
67232009-12-15 Ian Lance Taylor <iant@google.com>
6724
6725 * archive.cc (Archive::add_symbols): Only look up a symbol without
6726 a version if there is, in fact, a version.
6727
2ea97941
ILT
67282009-12-14 Ian Lance Taylor <iant@google.com>
6729
6730 Revert -Wshadow changes, all changes from:
6731 2009-12-11 Doug Kwan <dougkwan@google.com>
6732 2009-12-11 Nick Clifton <nickc@redhat.com>
6733 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6734
b0eec2cc
DK
67352009-12-11 Doug Kwan <dougkwan@google.com>
6736
6737 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6738 due to -Wshadow.
6739 * attributes.cc (Object_attribute::size): Ditto.
6740 (Attributes_section_data::size): Ditto.
6741 (Attributes_section_data::Attributes_section_data): Ditto.
6742 (Output_attributes_section_data::do_write): Ditto.
6743 * attributes.h (Object_attribute::set_type): Ditto.
6744 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6745
91d6fa6a
NC
67462009-12-11 Nick Clifton <nickc@redhat.com>
6747
6748 * archive.cc: Fix shadowed variable warnings.
6749 * arm.cc: Likewise.
6750 * compressed_output.cc: Likewise.
6751 * compressed_output.h: Likewise.
6752 * configure: Likewise.
6753 * dwarf_reader.cc: Likewise.
6754 * dynobj.cc: Likewise.
6755 * dynobj.h: Likewise.
6756 * ehframe.cc: Likewise.
6757 * ehframe.h: Likewise.
6758 * errors.cc: Likewise.
6759 * expression.cc: Likewise.
6760 * fileread.cc: Likewise.
6761 * fileread.h: Likewise.
6762 * freebsd.h: Likewise.
6763 * i386.cc: Likewise.
6764 * icf.cc: Likewise.
6765 * incremental.h: Likewise.
6766 * layout.cc: Likewise.
6767 * layout.h: Likewise.
6768 * mapfile.cc: Likewise.
6769 * merge.cc: Likewise.
6770 * merge.h: Likewise.
6771 * object.cc: Likewise.
6772 * object.h: Likewise.
6773 * options.h: Likewise.
6774 * output.cc: Likewise.
6775 * output.h: Likewise.
6776 * parameters.cc: Likewise.
6777 * plugin.cc: Likewise.
6778 * powerpc.cc: Likewise.
6779 * reduced_debug_output.cc: Likewise.
6780 * reduced_debug_output.h: Likewise.
6781 * reloc.cc: Likewise.
6782 * reloc.h: Likewise.
6783 * resolve.cc: Likewise.
6784 * script-sections.cc: Likewise.
6785 * script.cc: Likewise.
6786 * script.h: Likewise.
6787 * sparc.cc: Likewise.
6788 * symtab.cc: Likewise.
6789 * symtab.h: Likewise.
6790 * target-select.cc: Likewise.
6791 * target-select.h: Likewise.
6792 * token.h: Likewise.
6793 * workqueue.cc: Likewise.
6794 * workqueue.h: Likewise.
6795 * x86_64.cc: Likewise.
6796
a0351a69
DK
67972009-12-10 Doug Kwan <dougkwan@google.com>
6798
6799 * arm.cc (attributes.h): New include.
6800 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6801 (Arm_relobj::~Arm_relobj): Delete object pointed by
6802 attributes_section_data_.
6803 (Arm_relobj::attributes_section_data): New method definition.
6804 (Arm_relobj::attributes_section_data_): New data member declaration.
6805 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6806 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6807 attributes_section_data_.
6808 (Arm_dynobj::attributes_section_data): New method definition.
6809 (Arm_dynobj::attributes_section_data_): New data member declaration.
6810 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6811 initialization value of may_use_blx_ to false.
6812 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6813 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6814 object attributes to compute results instead of hard-coding.
6815 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6816 Target_arm::get_secondary_compatible_arch,
6817 Target_arm::set_secondary_compatible_arch
6818 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6819 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6820 New method declarations.
6821 (Target_arm::get_aeabi_object_attribute): New method definition.
6822 (Target_arm::attributes_section_data_): New data member declaration.
6823 (read_arm_attributes_section): New template definition.
6824 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6825 (Arm_dynobj::do_read_symbols): Ditto.
6826 (Target_arm::do_finalize_sections): Merge attributes sections from
6827 input. Check for BLX use after attributes section merging.
6828 Fix __exidx_start and __exidx_end visibility. Create an
6829 .ARM.attributes section if necessary.
6830 (Target_arm::get_secondary_compatible_arch,
6831 Target_arm::set_secondary_compatible_arch,
6832 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6833 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 6834 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
6835 New method definitions.
6836
b59befec
ILT
68372009-12-09 Ian Lance Taylor <iant@google.com>
6838
6839 * plugin.cc (Plugin::load): Don't cast from void* to a function
6840 pointer.
6841
1276bc89
ILT
68422009-12-09 Ian Lance Taylor <iant@google.com>
6843
6844 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6845 information fields.
6846
2f2de248
L
68472009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6848
6849 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6850 Replace two_file_shared_1.so with two_file_shared_2.so.
6851 * testsuite/Makefile.in: Regenerated.
6852
4f787271
DK
68532009-12-08 Doug Kwan <dougkwan@google.com>
6854
6855 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6856 (HFILES): Add attributes.h and int_encoding.h.
6857 * Makefile.in: Regenerate.
6858 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6859 function definitions to int_encoding.cc
6860 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6861 prototypes to int_encoding.h
6862 * reduced_debug_output.cc (int_encoding.h): New include.
6863 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6864 function definitions to int_encoding.cc
6865 (insert_into_vector, read_from_pointer): Move template definitions to
6866 int_encoding.h
6867 * attributes.cc: New file.
6868 * attributes.h: New file.
6869 * int_encoding.cc: New file.
6870 * int_encoding.h: New file.
6871
20b52f1a
RÁE
68722009-12-07 Rafael Avila de Espindola <espindola@google.com>
6873
6874 PR gold/11055
6875 * incremental-dump.cc (dump_incremental_inputs): New.
6876 (main): Use dump_incremental_inputs.
6877
53d7974c
L
68782009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6879
6880 PR gold/10893
6881 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6882 checking elfcpp::STT_FUNC.
6883 (Target_i386::Relocate::relocate): Likewise.
6884 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6885
6886 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6887 symbols from shared libraries into normal FUNC symbols.
6888
6889 * symtab.h (Symbol): Add is_func and use it.
6890
05a352e6
DK
68912009-12-05 Doug Kwan <dougkwan@google.com>
6892
6893 * arm.cc (Target_arm::arm_info): Initialize new fields
6894 attributes_section and attributes_vendor.
6895 * i386.cc (Target_i386::i386_info): Same.
6896 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6897 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6898 fields attributes_section and attributes_vendor.
53d7974c 6899 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
6900 * target.h (Target::attributes_section, Target::attributes_vendor,
6901 Target::is_attributes_section, Target::attribute_arg_type,
6902 Target::attributes_order): New method definitions.
6903 (Target::Target_info::attributes_section,
6904 Target::Target_info::attributes_vendor): New fields.
6905 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6906 virtual method definitions.
6907 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6908 attributes_section and attributes_vendor.
6909 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6910
f4e5969c
DK
69112009-12-05 Doug Kwan <dougkwan@google.com>
6912
6913 * arm.cc: Update comments about interworking and stub generation.
6914 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6915 considered as non-PIC.
6916 (Arm_relocate_functions::base_abs): Fix formatting.
6917 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6918 of function to use GOT entry address instead of offset.
6919 (Target_arm::Scan::global): Issue an error if a symbol would need a
6920 PLT does not get one because it is untyped. Remove code to create
6921 dynamic symbols for relative branches.
6922 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6923 takes unsigned integer instead of boolean.
6924
1abce4a6
L
69252009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6926
6927 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6928 (two_file_test_LDADD): Likewise.
6929 (common_test_1_LDADD): Likewise.
6930 (exception_test_LDADD) Likewise.
6931 (weak_test_LDADD): Likewise.
6932 (many_sections_test_LDADD): Likewise.
6933 (initpri1_LDADD): Likewise.
6934 (script_test_1_LDADD): Likewise.
6935 (script_test_2_LDADD): Likewise.
6936 (justsyms_LDADD): Likewise.
6937 (binary_test_LDADD): Likewise.
6938 (large_LDADD): Likewise.
6939 * testsuite/Makefile.in: Regenerated.
6940
adcf2816 69412009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 6942
adcf2816
L
6943 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6944 (Symbol_table::override_with_special): Likewise.
6945 (Symbol_table::add_from_object): Likewise.
6946
28e67f5d
RÁE
69472009-12-04 Rafael Avila de Espindola <espindola@google.com>
6948
6949 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6950 Don't set the data_offset twice.
6951
ae10a101
RÁE
69522009-12-04 Rafael Avila de Espindola <espindola@google.com>
6953
6954 * testsuite/Makefile.in: Regenerate.
6955
f59f41f3
DK
69562009-12-03 Doug Kwan <dougkwan@google.com>
6957
6958 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6959 (Target_arm::do_finalize_sections): Add parameter for symbol table
6960 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6961 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6962 parameter for symbol table pointer.
6963 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6964 an additional parameter for a pointer to symbol table.
6965 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6966 parameter for a symbol table pointer.
6967 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6968 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6969 Ditto.
6970 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6971 parameter for a symbol table pointer.
6972
ca55d848
RÁE
69732009-12-03 Rafael Avila de Espindola <espindola@google.com>
6974
6975 * incremental.cc (Incremental_inputs_header)
6976 (Incremental_inputs_header_write, Incremental_inputs_entry)
6977 (Incremental_inputs_entry_write): Move ...
6978 * incremental.h (Incremental_inputs_header)
6979 (Incremental_inputs_header_write, Incremental_inputs_entry)
6980 (Incremental_inputs_entry_write): here.
6981
3aec4f9c
RÁE
69822009-12-02 Rafael Avila de Espindola <espindola@google.com>
6983
6984 * incremental.cc (make_sized_incremental_binary): Set the target.
6985 Error if it is incompatible.
6986 * output.h (Output_file): Add filename method.
6987
9c0ae74d
RÁE
69882009-12-02 Rafael Avila de Espindola <espindola@google.com>
6989
6990 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6991 from the get_* methods.
6992
a45500ae
RÁE
69932009-12-02 Rafael Avila de Espindola <espindola@google.com>
6994
6995 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6996 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6997 Write 0 for the data_offset of scripts.
6998
325e6408
RÁE
69992009-12-02 Rafael Avila de Espindola <espindola@google.com>
7000
7001 * testsuite/Makefile.am: Add the incremental_test.sh test.
7002 * testsuite/incremental_test.sh: New.
7003 * testsuite/incremental_test_1.c: New.
7004 * testsuite/incremental_test_2.c: New.
7005
954c3e2e
RÁE
70062009-12-01 Rafael Avila de Espindola <espindola@google.com>
7007
7008 * incremental-dump.cc (main): Fix typos.
7009
f8086623
RÁE
70102009-11-27 Rafael Avila de Espindola <espindola@google.com>
7011
7012 PR gold/11025
7013 * incremental-dump.cc (main): Use llu to print 64 bit values.
7014
3b0dd6ac
L
70152009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7016 H.J. Lu <hongjiu.lu@intel.com>
7017
7018 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7019 $(LIBDL).
7020 (incremental_dump_LDADD): Likewise.
7021 * Makefile.in: Regenerated.
7022
a6d1ef57 70232009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7024
a6d1ef57
DK
7025 Revert:
7026
7027 2009-11-25 Doug Kwan <dougkwan@google.com>
7028
7029 * arm.cc (Target_arm::Target_arm): Move method definition
7030 outside of class definition. Add code to handle
7031 --target1-rel, --target1-abs and --target2= options.
7032 (Target_arm::get_reloc_reloc_type): Change method to be
7033 non-static and const.
7034 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7035 New data member declaration.
7036 (Target_arm::Scan::local, Target_arm::Scan::global,
7037 Target_arm::Relocate::relocate,
7038 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7039 Adjust call to Target_arm::get_real_reloc_type.
7040 (Target_arm::get_real_reloc_type): Use command line options
7041 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7042 * options.h (--target1-rel, --target1-abs, --target2): New
7043 ARM-only options.
7044
50aeb7d4
DK
70452009-11-25 Doug Kwan <dougkwan@google.com>
7046
7047 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7048 class definition. Add code to handle --target1-rel, --target1-abs
7049 and --target2= options.
7050 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7051 and const.
7052 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7053 member declaration.
7054 (Target_arm::Scan::local, Target_arm::Scan::global,
7055 Target_arm::Relocate::relocate,
7056 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
7057 call to Target_arm::get_real_reloc_type.
7058 (Target_arm::get_real_reloc_type): Use command line options to
7059 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7060 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
7061 options.
7062
51938283
DK
70632009-11-25 Doug Kwan <dougkwan@google.com>
7064
7065 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
7066 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
7067 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
7068 formatting.
7069 (Arm_relocate_functions::thm_call): Replace body with a call to
7070 Arm_relocate_functions::thumb_branch_common.
7071 (Arm_relocate_functions::thm_jump24,
7072 Arm_relocate_functions::thm_xpc22): New method definitions.
7073 (Arm_relocate_functions::thumb_branch_common): New method definition.
7074 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
7075 operator.
7076 (Target_arm::Relocate::relocate): Adjust call to thm_call.
7077 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
7078
e2b8f3c4
RÁE
70792009-11-24 Rafael Avila de Espindola <espindola@google.com>
7080
7081 * Makefile.am: Build incremental-dump
7082 * Makefile.in: Regenerate.
7083 * incremental-dump.cc: New.
7084 * incremental.cc (Incremental_inputs_header_data,
7085 Incremental_inputs_entry_data): Move to incremental.h
7086 * incremental.h: (Incremental_inputs_header_data,
7087 Incremental_inputs_entry_data): Move from incremental.cc
7088
bcba9aec
RÁE
70892009-11-24 Rafael Avila de Espindola <espindola@google.com>
7090
7091 * incremental.cc (Incremental_inputs_header,
7092 Incremental_inputs_header_write, Incremental_inputs_entry,
7093 Incremental_inputs_entry_write): Add a typedef with the data type.
7094
7c3afe08
RÁE
70952009-11-24 Rafael Avila de Espindola <espindola@google.com>
7096
7097 * incremental.cc (Incremental_inputs_header,
7098 Incremental_inputs_header_write, Incremental_inputs_entry,
7099 Incremental_inputs_entry_write): Update comment about which
7100 type has the filed descriptions.
7101
d204b6e9
DK
71022009-11-15 Doug Kwan <dougkwan@google.com>
7103
7104 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
7105 (Arm_relocate_functions::arm_branch_common): Change method defintion
7106 in class definition to a method declaration and update list of formal
7107 parameters.
7108 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
7109 Arm_relocation_functions::jump24): Adjust call to
7110 Arm_relocate_functions::arm_branch_common. Update list of formal
7111 parameters.
7112 (Arm_relocate_functions::xpc25): New method definition.
7113 (Arm_relocate_functions::arm_branch_common): Move method defintion
7114 out from class definition. Use stubs for mode-switching and extending
7115 branch ranges.
7116 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
7117 specially. Change code to enable use of stubs in ARM branches.
7118
43d12afe
DK
71192009-11-10 Doug Kwan <dougkwan@google.com>
7120
7121 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
7122 in method declaration.
7123 (Target_arm::relocate_stub): New method declaration.
7124 (Target_arm::default_target): Change to return a pointer instead of
7125 a const reference.
7126 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
7127 Target_arm::default_target.
7128 (Arm_Relobj::do_relocate_sections): Remove options paramater in
7129 method definition.
7130 (Target_arm::relocate_section): Adjust view.
7131 (Target_arm::relocate_stub): New method definition.
7132
ac33a407
DK
71332009-11-10 Doug Kwan <dougkwan@google.com>
7134
7135 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
7136 a format warning.
7137 * incremental.cc (open_incremental_binary): Initialized local
7138 variables to avoid warnings.
7139 * object.cc (make_elf_object): Ditto.
7140 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
7141 a format warning.
e1df38aa 7142
88ee28e9
L
7143009-11-09 H.J. Lu <hongjiu.lu@intel.com>
7144
7145 PR gold/10930
7146 * testsuite/plugin_test.c: Include "config.h".
7147
2daedcd6
DK
71482009-11-09 Doug Kwan <dougkwan@google.com>
7149
7150 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
7151 (arm_symbol_value): Remove.
7152 (Arm_relocate_functions::arm_branch_common,
7153 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
7154 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
7155 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
7156 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
7157 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
7158 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7159 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7160 Arm_relocate_functions::thm_mobw_abs_nc,
7161 Arm_relocate_functions::thm_mov_abs,
7162 Arm_relocate_functions::movw_prel_nc,
7163 Arm_relocate_functions::thm_movt_abs,
7164 Arm_relocate_functions::movt_prel,
7165 Arm_relocate_functions::thm_movw_prel_nc,
7166 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7167 (Target_arm::Relocate::relocate): Only decompose address into two
7168 parts if relocation type uses the thumb-bit and pass the actual
7169 bit instead of a flag indicating that the thumb-bit is used. Adjust
7170 calls to methods in Arm_relocate_functions for this change.
7171
1276bc89 71722009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7173
7174 PR 10925
7175 * reloc.cc: Instantiate
7176 Sized_relobj::initialize_input_to_output_maps and
7177 Sized_relobj:free_input_to_output_maps.
7178
e53ad1b5
ILT
71792009-11-06 Ian Lance Taylor <iant@google.com>
7180
7181 PR 10876
7182 * defstd.cc (in_segment): Set only_if_ref true for "end".
7183
eb44217c
DK
71842009-11-06 Doug Kwan <dougkwan@google.com>
7185
7186 * arm.cc (class Reloc_stub): Correct a comment.
7187 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7188 (Target_arm::scan_section_for_stubs): New method declaration.
7189 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7190 Change methods from private to protected.
7191 (Target_arm::do_may_relax): New method definition.
7192 (Target_arm::do_relax, Target_arm::group_sections,
7193 Target_arm::scan_reloc_for_stub,
7194 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7195 (Target_arm::arm_input_section_map_): New data member declaration.
7196 (Target_arm::scan_reloc_for_stub,
7197 Target_arm::scan_reloc_section_for_stubs,
7198 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7199 Target_arm::do_relax): New method definitions.
7200
5d329b7d
ILT
72012009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7202
7203 * configure.ac: Check for (struct stat)::st_mtim
7204 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7205 * config.in: Regenerate.
7206 * configure: Regenerate.
7207
96a0d71b
ILT
72082009-11-05 Ian Lance Taylor <iant@google.com>
7209
7210 PR 10910
7211 * output.cc (Output_segment::add_output_section): Add missing
7212 return statement.
7213
594c8e5e
ILT
72142009-11-04 Ian Lance Taylor <iant@google.com>
7215
7216 PR 10880
7217 * object.h (class Object): Add is_needed and set_is_needed
7218 methods. Add is_needed_ field. Make bool fields into bitfields.
7219 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7220 defined in a dynamic object and referenced by a regular object,
7221 set is_needed for the dynamic object.
7222 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7223 if the file is marked with as_needed and it is not needed.
7224
22b127cc
ILT
72252009-11-04 Ian Lance Taylor <iant@google.com>
7226
7227 PR 10887
7228 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7229 tags if data is discarded by linker script.
7230 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7231 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7232 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7233 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7234
f5c870d2
ILT
72352009-11-04 Ian Lance Taylor <iant@google.com>
7236
7237 * layout.cc (Layout::get_output_section): Add is_interp and
7238 is_dynamic_linker_section parameters. Change all callers.
7239 (Layout::choose_output_section): Likewise.
7240 (Layout::make_output_section): Likewise.
7241 (Layout::add_output_section_data): Add is_dynamic_linker_section
7242 parameter. Change all callers.
7243 * layout.h (class Layout): Update declarations.
7244 * output.h (class Output_section): Add is_interp, set_is_interp,
7245 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7246 Add is_interp_, is_dynamic_linker_section_ fields. Change
7247 generate_code_fills_at_write_ to a bitfield.
7248 * output.cc (Output_section::Output_sections): Initialize new
7249 fields.
7250 (Output_segment::add_output_section): Add do_sort parameter.
7251 Change all callers.
7252
1ae4d23b
ILT
72532009-11-03 Ian Lance Taylor <iant@google.com>
7254
7255 PR 10860
7256 * options.h (class General_options): Add --warn-common.
7257 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7258 merging two common symbols.
7259 (Symbol_table::should_override): Handle --warn-common when merging
7260 a common symbol with a defined symbol. Use report_resolve_problem
7261 for multiple definitions.
7262 (Symbol_table::report_resolve_problem): New function.
7263 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7264
55da9579
DK
72652009-11-03 Doug Kwan <dougkwan@google.com>
7266
7267 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7268 stub_factory_.
7269 (Target_arm::stub_factory): New method definition.
7270 (Target_arm::new_arm_input_section,
7271 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7272 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7273 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7274 New type definitions.
7275 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7276 member declarations.
7277 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7278 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7279 New method definitions.
7280
37a9ac43
ILT
72812009-11-03 Ian Lance Taylor <iant@google.com>
7282
7283 * options.h (class General_options): Add --warn_constructors.
7284
b3d6a3d4
ILT
72852009-11-03 Ian Lance Taylor <iant@google.com>
7286
7287 PR 10893
7288 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7289 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7290
934b01dd
ILT
72912009-11-03 Ian Lance Taylor <iant@google.com>
7292
7293 PR 10895
7294 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7295 --msgid-bugs-address.
7296 (install-pdf): New target.
7297 (install-data_yes): Look up one directory to find mkinstalldirs.
7298
03c1939b
L
72992009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7300
7301 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7302 tree.
7303
ebd95253
DK
73042009-10-30 Doug Kwan <dougkwan@google.com>
7305
7306 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7307
e9bbb538
DK
73082009-10-30 Doug Kwan <dougkwan@google.com>
7309
7310 * arm.cc (Stub_addend_reader): New struct template definition
7311 and partial specializations.
7312 (Stub_addend_reader::operator()): New method definition for a
7313 partially specialized template.
7314
d5b40221
DK
73152009-10-30 Doug Kwan <dougkwan@google.com>
7316
7317 * arm.cc (Arm_relobj::processor_specific_flags): New method
7318 definition.
7319 (Arm_relobj::do_read_symbols): New method declaration.
7320 (Arm_relobj::processor_specific_flags_): New data member declaration.
7321 (Arm_dynobj): New class definition.
7322 (Target_arm::do_finalize_sections): Add input_objects parameter.
7323 (Target_arm::do_adjust_elf_header): New method declaration.
7324 (Target_arm::are_eabi_versions_compatible,
7325 (Target_arm::merge_processor_specific_flags): New method declaration.
7326 (Target_arm::do_make_elf_object): New overloaded method definitions
7327 and declaration.
7328 (Arm_relobj::do_read_symbols): New method definition.
7329 (Arm_dynobj::do_read_symbols): Ditto.
7330 (Target_arm::do_finalize_sections): Add input_objects parameters.
7331 Merge processor-specific flags from all input objects.
7332 (Target_arm::are_eabi_versions_compatible,
7333 Target_arm::merge_processor_specific_flags,
7334 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7335 New method definitions.
7336 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7337 Input_objects pointer type parameter.
7338 * layout.cc (Layout::finalize): Pass input objects to target's.
7339 finalize_sections function.
7340 * output.cc (Output_file_header::do_sized_write): Set ELF file
7341 header's processor-specific flags.
7342 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7343 Input_objects pointer type parameter.
7344 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7345 * target.h (Input_objects): New forward class declaration.
7346 (Target::processor_specific_flags,
7347 Target::are_processor_specific_flags_sect): New method definitions.
7348 (Target::finalize_sections): Add input_objects parameter.
7349 (Target::Target): Initialize processor_specific_flags_ and
7350 are_processor_specific_flags_set_.
7351 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7352 parameter.
7353 (Target::set_processor_specific_flags): New method definition.
7354 (Target::processor_specific_flags_,
7355 Target::are_processor_specific_flags_set_): New data member
7356 declarations.
7357 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7358 Input_objects pointer type parameter.
7359
ebabffbd
DK
73602009-10-30 Doug Kwan <dougkwan@google.com>
7361
7362 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7363
ad0f2072
ILT
73642009-10-28 Ian Lance Taylor <iant@google.com>
7365
7366 * object.h (class Relobj): Drop options parameter from
7367 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7368 do_scan_relocs, do_relocate. Change all callers.
7369 (class Sized_relobj): Drop options parameters from
7370 do_gc_process_relocs, do_scan_relocs, do_relocate,
7371 do_relocate_sections, relocate_sections, emit_relocs_scan,
7372 emit_relocs_scan_reltype. Change all callers.
7373 (struct Relocate_info): Remove options field and all references to
7374 it.
7375 * reloc.h (class Read_relocs): Remove options constructor
7376 parameter and options_ field. Change all callers.
7377 (class Gc_process_relocs, class Scan_relocs): Likewise.
7378 (class Relocate_task): Likewise.
7379 * target-reloc.h (scan_relocs): Remove options parameter. Change
7380 all callers.
7381 (scan_relocatable_relocs): Likewise.
7382 * target.h (class Sized_target): Remove options parameter from
7383 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7384 all callers.
7385 * gc.h (gc_process_relocs): Remove options parameter. Change all
7386 callers.
7387 * arm.cc: Update functions to remove options parameters.
7388 * i386.cc: Likewise.
7389 * powerpc.cc: Likewise.
7390 * sparc.cc: Likewise.
7391 * x86_64.cc: Likewise.
7392 * testsuite/testfile.cc: Likewise.
7393
8ffa3667
DK
73942009-10-28 Doug Kwan <dougkwan@google.com>
7395
7396 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7397 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7398 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7399 New method definitions.
7400
40f36857
CC
74012009-10-28 Cary Coutant <ccoutant@google.com>
7402
7403 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7404 (Plugin::cleanup_done_): New member.
7405 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7406 (Plugin_manager::cleanup_done_): Remove.
7407 (Plugin_manager::add_input_file): Edit error message.
7408 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7409 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7410
2c849493
ILT
74112009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7412
7413 * fileread.cc: (File_read::View::~View): Use the new
7414 data_ownership_ filed.
7415 (File_read::~File_read): Dispose the new whole_file_view_.
7416 (File_read::open): Mmap the whole file if needed.
7417 (File_read::open): Use whole_file_view_ instead of contents_.
7418 (File_read::find_view): Use whole_file_view_ if applicable.
7419 (File_read::do_read): Use whole_file_view_ instead of contents_.
7420 (File_read::make_view): Use whole_file_view_ instead of contents_,
7421 update File_read::View::View call.
7422 (File_read::find_or_make_view): Update File_read::View::View
7423 call.
7424 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7425 remove contents_
7426 (File_read::View::Data_ownership): New enum.
7427 (File_read::View::View): Replace bool mapped_ with Data_ownership
7428 argument.
7429 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7430 (File_read::View::data_ownership_): New field.
7431 (File_read::contents_): Remove (replaced by whole_file_view_).
7432 (File_read::whole_file_view_): New field.
7433 * options.h (class General_options): Add --keep-files-mapped.
7434
24998053
CC
74352009-10-27 Cary Coutant <ccoutant@google.com>
7436
7437 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7438 * testsuite/Makefile.am (plugin_test_5): New test case.
7439 * testsuite/Makefile.in: Regenerate.
7440
72adc4fa
DK
74412009-10-25 Doug Kwan <dougkwan@google.com>
7442
7443 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7444 from private to protected to allow access by child class.
7445 (Sized_relobj::do_relocate_sections): New method declaration.
7446 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7447 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7448 Sized_relobj::relocate_sections. Instantiate template explicitly
7449 for different target sizes and endianity.
7450
07f508a2
DK
74512009-10-24 Doug Kwan <dougkwan@google.com>
7452
7453 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7454 (Arm_input_section::as_arm_input_section): New method.
7455 (Arm_output_section): New class definition.
7456 (Arm_output_section::create_stub_group,
7457 Arm_output_section::group_sections): New method definitions.
7458
10ad9fe5
DK
74592009-10-22 Doug Kwan <dougkwan@google.com>
7460
7461 * arm.cc (Arm_input_section): New class definition.
7462 (Arm_input_section::init, Arm_input_section:do_write,
7463 Arm_input_section::set_final_data_size,
7464 Arm_input_section::do_reset_address_and_file_offset): New method
7465 definitions.
7466
56ee5e00
DK
74672009-10-21 Doug Kwan <dougkwan@google.com>
7468
7469 * arm.cc (Stub_table, Arm_input_section): New forward class
7470 declarations.
7471 (Stub_table): New class defintion.
7472 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7473 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7474 New method definition.
7475
b569affa
DK
74762009-10-21 Doug Kwan <dougkwan@google.com>
7477
7478 * arm.cc: Update copyright comments.
7479 (Target_arm): New forward class template declaration.
7480 (Arm_address): New type.
7481 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7482 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7483 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7484 constants.
7485 (Insn_template): Same.
7486 (DEF_STUBS): New macro.
7487 (Stub_type): New enum type.
7488 (Stub_template): New class definition.
7489 (Stub): Same.
7490 (Reloc_stub): Same.
7491 (Stub_factory): Same.
7492 (Target_arm::Target_arm): Initialize may_use_blx_ and
7493 should_force_pic_veneer_.
7494 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7495 Target_arm::should_force_pic_veneer,
7496 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7497 Target_arm::using_thumb_only, Target_arm:;default_target): New
7498 method defintions.
7499 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7500 New data member declarations.
7501 (Insn_template::size, Insn_template::alignment): New method defintions.
7502 (Stub_template::Stub_template): New method definition.
7503 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7504 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7505 (Stub_factory::Stub_factory): New method definition.
7506 * gold.h (string_hash): New template.
7507 * output.h (Input_section_specifier::hash_value): Use
7508 gold::string_hash.
7509 (Input_section_specifier::string_hash): Remove.
7510 * stringpool.cc (Stringpool_template::string_hash): Use
7511 gold::string_hash.
7512
6c172549
DK
75132009-10-20 Doug Kwan <dougkwan@google.com>
7514
7515 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7516 symbols of relaxed input sections.
7517 * output.h (Output_section::find_relaxed_input_section): Make
7518 method public.
7519
c5617f2f
DK
75202009-10-16 Doug Kwan <dougkwan@google.com>
7521
7522 * dynobj.cc (Versions::Versions): Initialize version_script_.
7523 Only insert base version symbol definition for a shared object
7524 if version script defines any version versions.
7525 (Versions::define_base_version): New method definition.
7526 (Versions::add_def): Check that base version is not needed.
7527 (Versions::add_need): Define base version lazily.
7528 * dynobj.h (Versions::define_base_version): New method declaration.
7529 (Versions::needs_base_version_): New data member declaration.
7530 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7531 (check_DATA): Add no_version_test.stdout.
7532 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7533 New make rules.
7534 * testsuite/Makefile.in: Regenerate.
7535 * testsuite/no_version_test.c: New file.
7536 * testsuite/no_version_test.sh: Ditto.
7537
3c12dcdb
DK
75382009-10-16 Doug Kwan <dougkwan@google.com>
7539
7540 * expression.cc (class Segment_start_expression): New class definition.
7541 (Segment_start_expression::value): New method definition.
7542 (script_exp_function_segment_start): Return a new
7543 Segment_start_expression.
7544 * gold/script-c.h (script_saw_segment_start_expression): New function
7545 prototype.
7546 * script-sections.cc (Script_sections::Script_sections): Initialize
7547 SAW_SEGMENT_START_EXPRESSION_ to false.
7548 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7549 and -Tbbs options to specify section addresses if given in
7550 command line and no SEGMENT_START expression is seen in a script.
7551 * script-sections.h (Script_sections::saw_segment_start_expression,
7552 Script_sections::set_saw_segment_start_expression): New method
7553 definition.
7554 (Script_sections::saw_segment_start_expression_): New data member
7555 declaration.
7556 * script.cc (script_saw_segment_start_expression): New function.
7557 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7558 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7559 script_test_7.sh and script_test_8.sh.
7560 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7561 script_test_8.stdout.
7562 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7563 (script_test_6, script_test_6.stdout, script_test_7,
7564 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7565 * Makefile.in: Regenerate.
7566 * testsuite/script_test_6.sh: New file.
7567 * testsuite/script_test_6.t: Same.
7568 * testsuite/script_test_7.sh: Same.
7569 * testsuite/script_test_7.t: Same.
7570 * testsuite/script_test_8.sh: Same.
7571
64b1ae37
DK
75722009-10-16 Doug Kwan <dougkwan@google.com>
7573
7574 * output.cc (Output_segment::set_section_list_address): Cast
7575 expressions to unsigned long long type to avoid format warnings.
7576
661be1e2
ILT
75772009-10-15 Ian Lance Taylor <iant@google.com>
7578
12edd763 7579 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7580 dot assignment to script_sections_.
12edd763
ILT
7581 * script-sections.cc (Script_sections::add_dot_assignment):
7582 Initialize if necessary.
7583
68b6574b
ILT
7584 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7585 program headers with no load segment if there is a linker script.
7586
661be1e2
ILT
7587 * layout.cc (Layout::set_segment_offsets): Align the file offset
7588 to the segment aligment for -N or -n with no load segment.
7589 * output.cc (Output_segment::add_output_section): Don't crash if
7590 the first section is a TLS section.
7591 (Output_segment::set_section_list_addresses): Print an error
7592 message if the address moves backward in a linker script.
7593 * script-sections.cc
7594 (Output_section_element_input::set_section_addresses): Don't
7595 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7596 (Orphan_output_section::set_section_addresses): Likewise.
7597
f15f61a7
DK
75982009-10-15 Doug Kwan <dougkwan@google.com>
7599
7600 * layout.cc (Layout::finish_dynamic_section): Generate tags
7601 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7602 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7603 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7604
82bb573a
ILT
76052009-10-14 Ian Lance Taylor <iant@google.com>
7606
7607 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7608 fields.
7609 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7610 data_shdr fields of relinfo.
7611 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7612 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7613 R_386_TLS_LDO_32, adjust based on section flags.
7614 (Target_i386::Relocate::fix_up_ldo): Remove.
7615
374ad285
ILT
76162009-10-13 Ian Lance Taylor <iant@google.com>
7617
7618 Add support for -pie.
7619 * options.h (class General_options): Add -pie and
7620 --pic-executable.
7621 (General_options::output_is_position_independent): Test -pie.
7622 (General_options::output_is_executable): Return true if not shared
7623 and not relocatable.
7624 (General_options::output_is_pie): Remove.
7625 * options.cc (General_options::finalize): Reject incompatible uses
7626 of -pie.
7627 * gold.cc (queue_middle_tasks): A -pie link is not static.
7628 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7629 * symtab.cc (Symbol::final_value_is_known): Return false if
7630 output_is_position_independent.
7631 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7632 output_is_position_independent.
7633 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7634 output_is_position_independent.
7635 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7636 output_is_position_independent.
7637 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7638 two_file_pie_test.
7639 (basic_pie_test.o, basic_pie_test): New targets.
7640 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7641 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7642 (two_file_pie_test): New target.
7643 * testsuite/Makefile.in: Rebuild.
7644 * README: Remove note saying that -pie is not supported.
7645
c6585162
ILT
76462009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7647
7648 * options.h (class General_options): Add -init and -fini.
7649 * layout.cc (Layout::finish_dynamic_section): Emit
7650 given init and fini functions.
7651
032ce4e9
ST
76522009-10-13 Sriraman Tallam <tmsriram@google.com>
7653
7654 * gc.h (gc_process_relocs): Check if icf is enabled using new
7655 function.
7656 * gold.cc (queue_initial_tasks): Likewise.
7657 (queue_middle_tasks): Likewise.
7658 * object.cc (do_layout): Likewise.
7659 * symtab.cc (is_section_folded): Likewise.
7660 * main.cc (main): Likewise.
7661 * reloc.cc (Read_relocs::run): Likewise.
7662 (Sized_relobj::do_scan_relocs): Likewise.
7663 * icf.cc (is_function_ctor_or_dtor): New function.
7664 (Icf::find_identical_sections): Check if function is ctor or dtor when
7665 safe icf is chosen.
7666 * options.h (General_options::icf): Change option to be an enum.
7667 (Icf_status): New enum.
7668 (icf_enabled): New method.
7669 (icf_safe_folding): New method.
7670 (set_icf_status): New method.
7671 (icf_status_): New variable.
7672 * (options.cc) (General_options::finalize): Set icf_status_.
7673 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7674 icf_test and icf_keep_unique_test to use the --icf enum flag.
7675 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7676 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7677
f345227a
ST
76782009-10-12 Sriraman Tallam <tmsriram@google.com>
7679
7680 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7681 includes to gc.h and icf.h.
7682 * arm.cc: Include gc.h.
7683 * gold.cc: Likewise.
7684 * i386.cc: Likewise.
7685 * powerpc.cc: Likewise.
7686 * sparc.cc: Likewise.
7687 * x86_64.cc: Likewise.
7688 * gc.h: Include icf.h.
7689
1c7814ed
ILT
76902009-10-11 Ian Lance Taylor <iant@google.com>
7691
7692 * plugin.cc: Include "gold.h" before other header files.
7693
ae3b5189
CD
76942009-10-10 Chris Demetriou <cgd@google.com>
7695
7696 * options.h (Input_file_argument::Input_file_type): New enum.
7697 (Input_file_argument::is_lib_): Replace with...
7698 (Input_file_argument::type_): New member.
7699 (Input_file_argument::Input_file_argument): Take Input_file_type
7700 'type' rather than boolean 'is_lib' as second argument.
7701 (Input_file_argument::is_lib): Use type_.
7702 (Input_file_argument::is_searched_file): New function.
7703 (Input_file_argument::may_need_search): Handle is_searched_file.
7704 * options.cc (General_options::parse_library): Support -l:filename.
7705 (General_options::parse_just_symbols): Update for Input_file_argument
7706 changes.
7707 (Command_line::process): Likewise.
7708 * archive.cc (Archive::get_file_and_offset): Likewise.
7709 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7710 * script.cc (read_script_file, script_add_file): Likewise.
7711 * fileread.cc (Input_file::Input_file): Likewise.
7712 (Input_file::will_search_for): Handle is_searched_file.
7713 (Input_file::open): Likewise.
7714 * readsyms.cc (Read_symbols::get_name): Likewise.
7715 * testsuite/Makefile.am (searched_file_test): New test.
7716 * testsuite/Makefile.in: Regenerate.
7717 * testsuite/searched_file_test.cc: New file.
7718 * testsuite/searched_file_test_lib.cc: New file.
7719
f3048a1d
ILT
77202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7721 Ian Lance Taylor <iant@google.com>
7722
7723 * descriptor.cc: Include <cstdio> and "binary-io.h".
7724 (Descriptors::open): Open the files in binary mode always.
7725 * script.cc (Lex::get_token): Treat \r as whitespace.
7726
d4780e57
ILT
77272009-10-09 Ian Lance Taylor <iant@google.com>
7728
7729 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7730
d9a893b8
ILT
77312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7732 Ian Lance Taylor <iant@google.com>
7733
7734 * configure.ac: Check for readv function also.
7735 * fileread.cc (readv): Define if not HAVE_READV.
7736 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7737 does not exist.
7738 * config.in: Regenerate.
7739 * configure: Regenerate.
7740
c0a62865
DK
77412009-10-09 Doug Kwan <dougkwan@google.com>
7742
7743 * layout.cc (Layout::make_output_section): Call target hook to make
7744 ordinary output section.
7745 (Layout::finalize): Adjust parameter list of call the
7746 Target::may_relax().
7747 * layout.h (class Layout::section_list): New method.
7748 * merge.h (Output_merge_base::entsize): Change visibility to public.
7749 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7750 New methods.
7751 (Output_merge_string::do_is_string): New method.
7752 * object.cc (Sized_relobj::do_setup): renamed from
7753 Sized_relobj::set_up.
7754 * object.h (Sized_relobj::adjust_shndx,
7755 Sized_relobj::initializ_input_to_output_maps,
7756 Sized_relobj::free_input_to_output_maps): Change visibilities to
7757 protected.
7758 (Sized_relobj::setup): Virtualize.
7759 (Sized_relobj::do_setup): New method declaration.
7760 (Sized_relobj::invalidate_section_offset,
7761 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7762 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7763 * options.cc (parse_int): New function.
7764 * options.h (parse_int): New declaration.
7765 (DEFINE_int): New macro.
7766 (stub_group_size): New option.
7767 * output.cc (Output_section::Output_section): Initialize memebers
7768 merge_section_map_, merge_section_by_properties_map_,
7769 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7770 (Output_section::add_input_section): Handled deferred code-fill
7771 generation and remove an old comment.
7772 (Output_section::add_relaxed_input_section): New method definition.
7773 (Output_section::add_merge_input_section): Use merge section by
7774 properties map to speed to search. Update merge section maps
7775 as appropriate.
7776 (Output_section::build_relaxation_map): New method definition.
7777 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7778 Same.
7779 (Output_section::relax_input_section): Renamed to
7780 Output_section::convert_input_sections_to_relaxed_sections and change
7781 interface to take a vector of pointers to relaxed sections.
7782 (Output_section::find_merge_section,
7783 Output_section::find_relaxed_input_section): New method definitions.
7784 (Output_section::is_input_address_mapped,
7785 Output_section::output_offset, Output_section::output_address):
7786 Use output section data maps to speed up searching.
7787 (Output_section::find_starting_output_address): Add comments.
7788 (Output_section::do_write,
7789 Output_section::write_to_postprocessing_buffer): Do code-fill
7790 generation as appropriate.
7791 (Output_section::get_input_sections): Invalidate relaxed input section
7792 map.
7793 (Output_section::restore_states): Adjust type of checkpoint .
7794 Invalidate relaxed input section map.
7795 * output.h (Output_merge_base): New class declaration.
7796 (Input_section_specifier): New class defintion.
7797 (class Output_relaxed_input_section) Change base class to
7798 Output_section_data_build.
7799 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7800 base class initializer.
7801 (Output_section::add_relaxed_input_section): New method declaration.
7802 (Output_section::Input_section): Change visibility to protected.
7803 (Output_section::Input_section::relobj,
7804 Output_section::Input_section::shndx): Handle relaxed input sections.
7805 Output_section::input_sections) Change visibility to protected. Also
7806 define overload to return a non-const pointer.
7807 (Output_section::Merge_section_properties): New class defintion.
7808 (Output_section::Merge_section_by_properties_map,
7809 Output_section::Output_section_data_by_input_section_map,
7810 Output_section::Relaxation_map): New types.
7811 (Output_section::relax_input_section): Rename method to
7812 Output_section::convert_input_sections_to_relaxed_sections and change
7813 interface to take a vector of relaxed section pointers.
7814 (Output_section::find_merge_section,
7815 Output_section::find_relaxed_input_section,
7816 Output_section::build_relaxation_map,
7817 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7818 New method declarations.
7819 (Output_section::merge_section_map_
7820 Output_section::merge_section_by_properties_map_,
7821 Output_section::relaxed_input_section_map_,
7822 Output_section::is_relaxed_input_section_map_valid_,
7823 Output_section::generate_code_fills_at_write_): New data members.
7824 * script-sections.cc
7825 (Output_section_element_input::set_section_addresses): Call
7826 current_data_size and addralign methods of relaxed input sections.
7827 (Orphan_output_section::set_section_addresses): Call current_data_size
7828 and addralign methods of relaxed input sections.
7829 * symtab.cc (Symbol_table::compute_final_value): Extract template
7830 from the body of Symbol_table::sized_finalize_symbol.
7831 (Symbol_table::sized_finalized_symbol): Call
7832 Symbol_table::compute_final_value.
7833 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7834 (Symbol_table::compute_final_value): New templated method declaration.
7835 * target.cc (Target::do_make_output_section): New method defintion.
7836 * target.h (Target::make_output_section): New method declaration.
7837 (Target::relax): Add more parameters for input objects, symbol table
7838 and layout. Adjust call to do_relax.
7839 (Target::do_make_output_section): New method declaration.
7840 (Target::do_relax): Add parameters for input objects, symbol table
7841 and layout.
7842
d446d6c4
ILT
78432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7844
7845 * pread.c: Include stdio.h.
7846
bc06c745
ILT
78472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7848
7849 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7850 defined.
7851
75aea3d0
ILT
78522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7853
7854 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7855 Change read_shndx type to unsigned int.
7856 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7857 int.
7858 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7859 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7860 Change read_shndx type to unsigned int.
7861 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7862 int.
7863 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7864 * layout.cc (Layout::create_symtab_sections): Cast the result of
7865 local_symcount * symsize to off_t in the gold_assert.
7866
be8fcb75
ILT
78672009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7868
7869 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7870 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7871 R_ARM_BASE_ABS.
7872 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7873 (Arm_relocate_functions::thm_abs5): New function.
7874 (Arm_relocate_functions::abs12): New function.
7875 (Arm_relocate_functions::abs16): New function.
7876 (Arm_relocate_functions::base_abs): New function.
7877 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7878 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7879 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7880 R_ARM_BASE_ABS.
7881 (Scan::global): Likewise.
7882 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7883 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7884 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7885 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7886 R_ARM_BASE_ABS.
7887
c2a122b6
ILT
78882009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7889
7890 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7891 (Arm_relocate_functions::movt_prel): New function.
7892 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7893 (Arm_relocate_functions::thm_movt_prel): New function.
7894 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7895 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7896 (Scan::global, Relocate::relocate): Likewise.
7897 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7898
c4aa1e2d
ILT
78992009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7900
7901 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7902 Incremental_checker.
7903 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7904 unsigned int.
7905 (class Incremental_inputs_header): New class.
7906 (Incremental_inputs_header_writer): Edit comment.
7907 (Incremental_inputs_entry): New class.
7908 (Incremental_inputs_entry_writer): Edit comment.
7909 (Sized_incremental_binary::do_find_incremental_inputs_section):
7910 Add *strtab_shndx parameter, fill it.
7911 (Sized_incremental_binary::do_check_inputs): New method.
7912 (Incremental_checker::can_incrementally_link_output_file): Use
7913 Sized_incremental_binary::check_inputs.
7914 (Incremental_inputs::report_command_line): Save command line in
7915 command_line_.
7916 * incremental.h:
7917 (Incremental_binary::find_incremental_inputs_section): New
7918 method.
7919 (Incremental_binary::do_find_incremental_inputs_section): Add
7920 strtab_shndx parameter.
7921 (Incremental_binary::do_check_inputs): New pure virtual method.
7922 (Sized_incremental_binary::do_check_inputs): Declare.
7923 (Incremental_checker::Incremental_checker): Add incremental_inputs
7924 parameter, use it to initialize incremental_inputs_.
7925 (Incremental_checker::incremental_inputs_): New field.
7926 (Incremental_checker::command_line): New method.
7927 (Incremental_checker::inputs): New method.
7928 (Incremental_checker::command_line_): New field.
7929
c549a694
ILT
79302009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7931
7932 * incremental.cc: Include <cstdarg> and "target-select.h".
7933 (vexplain_no_incremental): New function.
7934 (explain_no_incremental): New function.
7935 (Incremental_binary::error): New method.
7936 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7937 method.
7938 (make_sized_incremental_binary): New function.
7939 (open_incremental_binary): New function.
7940 (can_incrementally_link_file): Add checks if output is ELF and has
7941 inputs section.
7942 * incremental.h: Include "elfcpp_file.h" and "output.h".
7943 (Incremental_binary): New class.
7944 (Sized_incremental_binary): New class.
7945 (open_incremental_binary): Declare.
7946 * object.cc (is_elf_object): Use
7947 elfcpp::Elf_recognizer::is_elf_file.
7948 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7949 * output.h (Output_file::filesize): New method.
7950
fd3c5f0b
ILT
79512009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7952
7953 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7954 New function.
7955 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7956 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7957 function.
7958 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7959 function.
7960 (Arm_relocate_functions::movw_abs_nc): New function.
7961 (Arm_relocate_functions::movt_abs): New function.
7962 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7963 (Arm_relocate_functions::thm_movt_abs): New function.
7964 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7965 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7966 (Scan::global): Likewise.
7967 (Relocate::relocate): Likewise.
7968 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7969
7f5309a5
ILT
79702009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7971
7972 * arm.cc (Arm_relocate_functions::got_prel) New function.
7973 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7974 (Relocate::relocate): Likewise.
7975 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7976
364c7fa5
ILT
79772009-10-06 Ian Lance Taylor <iant@google.com>
7978
7979 * options.h (class General_options): Define
7980 split_stack_adjust_size parameter.
7981 * object.h (class Object): Add uses_split_stack_ and
7982 has_no_split_stack_ fields. Add uses_split_stack and
7983 has_no_split_stack accessor functions. Declare
7984 handle_split_stack_section.
7985 (class Reloc_symbol_changes): Define.
7986 (class Sized_relobj): Define Function_offsets. Declare
7987 split_stack_adjust, split_stack_adjust_reltype, and
7988 find_functions.
7989 * object.cc (Object::handle_split_stack_section): New function.
7990 (Sized_relobj::do_layout): Call handle_split_stack_section.
7991 * dynobj.cc (Sized_dynobj::do_layout): Call
7992 handle_split_stack_section.
7993 * reloc.cc (Sized_relobj::relocate_sections): Call
7994 split_stack_adjust for executable sections in split_stack
7995 objects. Pass reloc_map to relocate_section.
7996 (Sized_relobj::split_stack_adjust): New function.
7997 (Sized_relobj::split_stack_adjust_reltype): New function.
7998 (Sized_relobj::find_functions): New function.
7999 * target-reloc.h: Include "object.h".
8000 (relocate_section): Add reloc_symbol_changes parameter. Change
8001 all callers.
8002 * target.h (class Target): Add calls_non_split method. Declare
8003 do_calls_non_split virtual method. Declare match_view and
8004 set_view_to_nop.
8005 * target.cc: Include "elfcpp.h".
8006 (Target::do_calls_non_split): New function.
8007 (Target::match_view): New function.
8008 (Target::set_view_to_nop): New function.
8009 * gold.cc (queue_middle_tasks): Give an error if mixing
8010 split-stack and non-split-stack objects with -r.
8011 * i386.cc (Target_i386::relocate_section): Add
8012 reloc_symbol_changes parameter.
8013 (Target_i386::do_calls_non_split): New function.
8014 * x86_64.cc (Target_x86_64::relocate_section): Add
8015 reloc_symbol_changes parameter.
8016 (Target_x86_64::do_calls_non_split): New function.
8017 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8018 parameter.
8019 * powerpc.cc (Target_powerpc::relocate_section): Add
8020 reloc_symbol_changes parameter.
8021 * sparc.cc (Target_sparc::relocate_section): Add
8022 reloc_symbol_changes parameter.
8023 * configure.ac: Call AM_CONDITIONAL for the default target.
8024 * configure: Rebuild.
8025 * testsuite/Makefile.am (TEST_AS): New variable.
8026 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8027 (check_DATA): Add split_i386 and split_x86_64 files.
8028 (SPLIT_DEFSYMS): Define.
8029 (split_i386_[1234n].o): New targets.
8030 (split_i386_[124]): New targets.
8031 (split_i386_[1234r].stdout): New targets.
8032 (split_x86_64_[1234n].o): New targets.
8033 (split_x86_64_[124]): New targets.
8034 (split_x86_64_[1234r].stdout): New targets.
8035 (MOSTLYCLEANFILES): Add new executables.
8036 * testsuite/split_i386.sh: New file.
8037 * testsuite/split_x86_64.sh: New file.
8038 * testsuite/split_i386_1.s: New file.
8039 * testsuite/split_i386_2.s: New file.
8040 * testsuite/split_i386_3.s: New file.
8041 * testsuite/split_i386_4.s: New file.
8042 * testsuite/split_i386_n.s: New file.
8043 * testsuite/split_x86_64_1.s: New file.
8044 * testsuite/split_x86_64_2.s: New file.
8045 * testsuite/split_x86_64_3.s: New file.
8046 * testsuite/split_x86_64_4.s: New file.
8047 * testsuite/split_x86_64_n.s: New file.
8048 * testsuite/testfile.cc (Target_test): Update relocation_section
8049 function.
8050 * testsuite/Makefile.in: Rebuild.
8051
e8a9fcda
ILT
80522009-10-06 Ian Lance Taylor <iant@google.com>
8053
8054 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8055 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8056 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
8057 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
8058 the address on ldo_addrs_.
8059 (Target_i386::Relocate::fix_up_ldo): New function.
8060
e99daf92
ILT
80612009-10-06 Rafael Espindola <espindola@google.com>
8062
8063 * plugin.cc (add_input_library): New.
8064 (Plugin::load): Add add_input_library to tv.
8065 (Plugin_manager::add_input_file): Add the is_lib argument.
8066 (add_input_file): Update call to Plugin_manager::add_input_file.
8067 (add_input_library): New.
8068 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
8069
966d4097
DK
80702009-09-30 Doug Kwan <dougkwan@google.com>
8071
8072 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
8073 symbol and call Symbol::may_need_copy_reloc to determine if
8074 a copy reloc is needed.
8075 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
8076 nocopyreloc is given in command line.
8077 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
8078 given in command line.
8079 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
8080 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
8081 of the removed Target_i386::may_need_copy_reloc.
8082 * options.h (copyreloc): New option with default value false.
8083 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8084 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
8085 instead of the removed Target_powerpc::may_need_copy_reloc.
8086 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
8087 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
8088 instead of the removed Target_sparc::may_need_copy_reloc.
8089 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
8090 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
8091 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
8092 instead of the removed Target_x86_64::may_need_copy_reloc.
8093
029ba973
ILT
80942009-09-30 Ian Lance Taylor <iant@google.com>
8095
8096 * object.h (class Object): Remove target_ field, and target,
8097 sized_target, and set_target methods.
8098 (Object::sized_target): Remove.
8099 (class Sized_relobj): Update declarations. Remove sized_target.
8100 * object.cc (Sized_relobj::setup): Remove target parameter.
8101 Change all callers.
8102 (Input_objects::add_object): Don't do anything with the target.
8103 (make_elf_sized_object): Add punconfigured parameter. Change all
8104 callers. Set or test parameter target.
8105 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
8106 Change all callers.
8107 * parameters.cc (Parameters::set_target): Change parameter type to
8108 be non-const.
8109 (Parameters::default_target): Remove.
8110 (set_parameters_target): Change parameter type to be non-const.
8111 (parameters_force_valid_target): New function.
8112 (parameters_clear_target): New function.
8113 * parameters.h (class Parameters): Update declarations. Remove
8114 default_target method. Add sized_target and clear_target
8115 methods. Change target_ to be non-const.
8116 (set_parameters_target): Update declaration.
8117 (parameters_force_valid_target): Declare.
8118 (parameters_clear_target): Declare.
8119 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
8120 as NULL if we aren't searching.
8121 (Add_symbols::run): Don't check for compatible target.
8122 * fileread.cc (Input_file::open_binary): Call
8123 parameters_force_valid_target.
8124 * gold.cc (queue_middle_tasks): Likewise.
8125 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
8126 set_target on object.
8127 * dynobj.h (class Sized_dynobj): Update declarations.
8128 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
8129 make_elf_object returns NULL.
8130 (Archive::include_member): Don't check whether object target is
8131 compatible.
8132 * output.cc (Output_section::add_input_section): Get target from
8133 parameters.
8134 (Output_section::relax_input_section): Likewise.
8135 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
8136 parameters.
8137 (Sized_relobj::do_scan_relocs): Likewise.
8138 (Sized_relobj::relocate_sections): Likewise.
8139 * resolve.cc (Symbol_table::resolve): Likewise.
8140 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
8141 parameter. Change all callers.
8142 (Symbol_table::add_from_object): Get target from parameters.
8143 (Symbol_table::add_from_relobj): Don't check object target.
8144 (Symbol_table::add_from_dynobj): Likewise.
8145 (Symbol_table::define_special_symbol): Get target from
8146 parameters.
8147 * symtab.h (class Symbol_table): Update declaration.
8148 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
8149 parameter. Change all callers. Clear parameter target.
8150 (Binary_test): Test target here.
8151 * testsuite/object_unittest.cc (gold_testsuite): Remove
8152 target_test_pointer parameter. Change all callers.
8153 (Object_test): Test target here.
8154
a6a22b83
ILT
81552009-09-26 Ian Lance Taylor <iant@google.com>
8156
8157 * testsuite/initpri1.c: Don't try to use constructor priorities if
8158 compiling with gcc before 4.3.
8159
6a8f49fe
ILT
81602009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8161
8162 * testsuite/retain_symbols_file_test.sh (check_present): Change
8163 output file name to retain_symbols_file_test.stdout.
8164 (check_absent): Likewise.
8165
8c604651
CS
81662009-09-18 Craig Silverstein <csilvers@google.com>
8167
8168 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8169 * options.cc: Include <cerrno> and <fstream>.
8170 (General_options::finalize): Parse -retain-symbols-file tag.
8171 * options.h: New flag.
8172 (General_options): New method should_retain_symbol, new
8173 variable symbols_to_retain.
8174 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8175 should_retain_symbol map.
8176 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8177 * testsuite/Makefile.in: Regenerate.
8178 * testsuite/retain_symbols_file_test.sh: New file.
8179
ca58b19f
NC
81802009-09-18 Nick Clifton <nickc@redhat.com>
8181
8182 * po/es.po: Updated Spanish translation.
8183
20e6d0d6
DK
81842009-09-17 Doug Kwan <dougkwan@google.com>
8185
8186 * debug.h (DEBUG_RELAXATION): New constant.
8187 (DEBUG_ALL): Add DEBUG_RELAXATION.
8188 (debug_string_to_enum): Add relaxation debug option.
8189 * layout.cc
8190 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8191 Layout::Relaxation_debug_check::read_sections,
8192 Layout::Relaxation_debug_check::read_sections): New method definitions.
8193 (Layout::Layout): Initialize data members
8194 record_output_section_data_from_scrips_,
8195 script_output_section_data_list_ and relaxation_debug_check_.
8196 (Layout::save_segments, Layout::restore_segments,
8197 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8198 Layout::relaxation_loop_body): New method definitions.
8199 (Layout::finalize): Support relaxation. Move section layout code to
8200 Layout::relaxation_loop_body.
8201 (Layout::set_asection_address_from_script): Move code for orphan
8202 section placement out.
8203 (Layout::place_orphan_sections_in_script): New method definition.
8204 * layout.h (Output_segment_headers, Output_file_header):
8205 New forward class declarations.
8206 (Layout::~Layout): Define.
8207 (Layout::new_output_section_data_from_script): New method definition.
8208 (Layout::place_orphan_sections_in_script): New method declaration.
8209 (Layout::Segment_states): New type declaration.
8210 (Layout::save_segments, Layout::restore_segments,
8211 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8212 Layout::relaxation_loop_body): New method declarations.
8213 (Layout::Output_section_data_list): New type declaration.
8214 (Layout::Relaxation_debug_check): New class definition.
8215 (Layout::record_output_section_data_from_script_,
8216 Layout::script_output_section_data_list_, Layout::segment_states_,
8217 Layout::relaxation_debug_check_): New data members.
8218 * output.cc: (Output_section_headers::do_size): New method definition.
8219 (Output_section_headers::Output_section_headers): Move size
8220 computation to Output_section_headers::do_size.
8221 (Output_segment_headers::do_size): New method definition.
e1df38aa 8222 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8223 Output_file_header::do_size and call it.
8224 (Output_file_header::do_size): New method definition.
8225 (Output_data_group::Output_data_group): Adjust call to
8226 Output_section_data.
8227 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8228 (Output_symtab_xindex::do_write): Add array bound check.
8229 (Output_section::Input_section::print_to_mapfile): Handle
8230 RELAXED_INPUT_SECTION_CODE.
8231 (Output_section::Output_section): Initialize data member checkpoint_.
8232 (Output_section::~Output_section): Delete checkpoint object pointed
8233 by checkpoint_.
8234 (Output_section::add_input_section): Always add an Input_section if
8235 relaxing.
8236 (Output_section::add_merge_input_section): Add assert.
8237 (Output_section::relax_input_section): New method definition.
8238 (Output_section::set_final_data_size): Set load address to zero for
8239 an unallocated section.
8240 (Output_section::do_address_and_file_offset_have_reset_values):
8241 New method definition.
8242 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8243 Handle relaxed input section.
8244 (Output_section::sort_attached_input_sections): Checkpoint input
8245 section list lazily.
8246 (Output_section::get_input_sections): Change type of input_sections to
8247 list of Simple_input_section pointers. Checkpoint input section list
8248 lazily. Also handle relaxed input sections.
8249 (Output_section::add_input_section_for_script): Take a reference to
8250 a Simple_input_section object instead of Relobj pointer and section
8251 index as parameter. Handle relaxed input sections.
8252 (Output_section::save_states, Output_section::restore_states): New
8253 method definitions.
8254 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8255 (Output_data::is_data_size_fixed): New method definition.
8256 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8257 if it is fixed.
8258 (Output_data::address_and_file_offset_have_reset_values): New method
8259 definition.
8260 (Output_data::do_address_and_file_offset_have_reset_values): New method
8261 definition.
8262 (Output_data::set_data_size): Check that data size is not fixed.
8263 (Output_data::fix_data_size): New method definition.
8264 (Output_data::is_data_size_fixed_): New data member.
8265 (Output_section_headers::set_final_data_size): New method definition.
8266 (Output_section_headers::do_size): New method declaration.
8267 (Output_segment_headers::set_final_data_size): New method definition.
8268 (Output_segment_headers::do_size): New method declaration.
8269 (Output_file_header::set_final_data_size)::New method definition.
8270 (Output_file_header::do_size)::New method declaration.
8271 (Output_section_data::Output_section_data): Add new parameter
8272 is_data_size_fixed and use it to fix data size.
8273 (Output_data_const::Output_data_const): Adjust call to base class
8274 constructor and fix data size.
8275 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8276 base class constructor and fix data size.
8277 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8278 base class constructor and fix data size.
8279 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8280 class constructor and fix data size.
8281 (Output_data_group::set_final_data_size): New method definition.
8282 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8283 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8284 class constructor and fix data size.
8285 (Output_relaxed_input_section): New class definition.
8286 (Output_section::Simple_input_section): New class definition.
8287 (Output_section::get_input_sections): Adjust parameter list.
8288 (Output_section::add_input_section_for_script): Same.
8289 (Output_section::save_states, Output_section::restore_states,
8290 Output_section::do_address_and_file_offset_have_reset_values,
8291 (Output_section::Input_section::Input_section): Handle
8292 RELAXED_INPUT_SECTION_CODE. Add new overload for
8293 Output_relaxed_input_section.
8294 (Output_section::Input_section::is_input_section,
8295 Output_section::Input_section::set_output_section): Handle relaxed
8296 input section.
8297 (Output_section::Input_section::is_relaxed_input_section,
8298 Output_section::Input_section::output_section_data,
8299 Output_section::Input_section::relaxed_input_section): New method
8300 definitions.
8301 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8302 value.
8303 (Output_section::Input_section::u1_): Update comments.
8304 (Output_section::Input_section::u2_): Add new union member poris.
8305 (Output_section::Checkpoint_output_section): New classs definition.
8306 (Output_section::relax_input_section): New method declaration.
8307 (Output_section::checkpoint_): New data member.
8308 (Output_segment): Update comments.
8309 (Output_segment::Output_segment): Un-privatize copy constructor.
8310 (Output_segment::operator=): Un-privatize.
8311 * script-sections.cc (Output_section_element::Input_section_list):
8312 Change element type to Output_section::Simple_input_section.
8313 (Output_section_element_dot_assignment::set_section_addresses):
8314 Register output section data for relaxation clean up.
8315 (Output_data_exression::Output_data_expression): Adjust call to base
8316 constructor to fix data size.
8317 (Output_section_element_data::set_section_addresses): Register
8318 Output_data_expression object for relaxation clean up.
8319 (struct Input_section_info): Replace Relobj pointer and section index
8320 pair with Output_section::Simple_input_section and Convert struct to a
8321 class.
8322 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8323 Input_section_info data member to use accessors.
20e6d0d6
DK
8324 (Output_section_element_input::set_section_addresses): Use layout
8325 parameter. Adjust code to use Output_section::Simple_input_section
8326 and Input_secction_info classes. Register filler for relaxation
8327 clean up.
8328 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8329 and section index pair with Output_section::Simple_input_section
8330 class. Adjust code accordingly.
8331 (Phdrs_element::release_segment): New method definition.
8332 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8333 segment list.
8334 (Script_sections::release_segments): New method definition.
8335 * gold/script-sections.h (Script_sections::release_segments): New
8336 method declaration.
8337 * gold/target.h (Target::may_relax, Target::relax,
8338 Target::do_may_relax, Target::do_relax): New method definitions.
8339
5e445df6
ILT
83402009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8341
8342 * arm.cc (has_signed_unsigned_overflow): New function.
8343 (Arm_relocate_functions::abs8): New function.
8344 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8345 (Target_arm::Scan::global): Likewise.
8346 (Target_arm::relocate::relocate): Likewise.
8347 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8348 Likewise.
8349
8c604651 83502009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8351
8352 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8353 * testsuite/Makefile.in: Regenerate.
8354
1e9cc1c2
NC
83552009-09-11 Nick Clifton <nickc@redhat.com>
8356
8357 * po/gold.pot: Updated by the Translation project.
8358
6a89f575
CC
83592009-09-08 Cary Coutant <ccoutant@google.com>
8360
8361 * output.cc (Output_file::open): Add execute permission to empty file.
8362 * testsuite/Makefile.am (permission_test): New test.
8363 * testsuite/Makefile.in: Regenerate.
8364
fdcac5af
ILT
83652009-09-02 Ian Lance Taylor <iant@google.com>
8366
8367 * output.cc (Output_file::resize): Call map_no_anonymous rather
8368 than map.
8369
44453f85
ILT
83702009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8371
8372 * gold.cc: Include "incremental.h".
8373 (queue_initial_tasks): Call Incremental_checker methods.
8374 * incremental.cc: Include "output.h".
8375 (Incremental_checker::can_incrementally_link_output_file): New
8376 method.
8377 * incremental.h (Incremental_checker): New class.
8378
8379 * output.cc (Output_file::open_for_modification): New method.
8380 (Output_file::map_anonymous): Changed return type to bool. Record
8381 map in base_ field.
8382 (Output_file::map_no_anonymous): New method, broken out of map.
8383 (Output_file::map): Use map_no_anonymous and map_anonymous.
8384 * output.h (class Output_file): Update declarations.
8385
293c1386
CC
83862009-08-24 Cary Coutant <ccoutant@google.com>
8387
8388 * options.h (Command_line::Pre_options): New class.
8389 (Command_line::pre_options): New member.
8390 * options.cc (gold::options::ready_to_register): New variable.
8391 (One_option::register_option): Do nothing if not registering options.
8392 Assert if same short option registered twice.
8393 (General_options::General_options): Turn off option registration when
8394 done constructing.
8395 (Command_line::Pre_options::Pre_options): New constructor.
8396
f773f3d2
CC
83972009-08-24 Cary Coutant <ccoutant@google.com>
8398
06a73cfe
CC
8399 * options.h (General_options::no_keep_memory): Remove incorrect
8400 short option.
f773f3d2 8401
a15af8e2
RW
84022009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8403
8404 * Makefile.am (am__skiplex, am__skipyacc): New.
8405 * Makefile.in: Regenerate.
8406
c462b41b
RW
84072009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8408
14ec8efd
RW
8409 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8410 (INCLUDES): ... this.
8411 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8412 (AM_CPPFLAGS): Renamed from ...
8413 (INCLUDE): ... this.
8414 * Makefile.in, testsuite/Makefile.in: Regenerate.
8415
81ecdfbb
RW
8416 * Makefile.in: Regenerate.
8417 * aclocal.m4: Likewise.
8418 * config.in: Likewise.
8419 * configure: Likewise.
8420 * testsuite/Makefile.in: Likewise.
8421
c462b41b
RW
8422 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8423 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8424 * Makefile.in: Regenerate.
8425 * testsuite/Makefile.in: Regenerate.
8426
2da73f13
CC
84272009-08-19 Cary Coutant <ccoutant@google.com>
8428
8429 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8430 symbols in shared libraries overridden by hidden or internal symbols
8431 in the main program.
8432
2db70501
CD
84332009-08-19 Chris Demetriou <cgd@google.com>
8434
8435 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8436 checking source file names in error messages.
8437
f733487b
DK
84382009-08-18 Doug Kwan <dougkwan@google.com>
8439
8440 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8441 an elcpp::Ehdr as parameter. Adjust call to set_target.
8442 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8443 an elfcpp::Ehdr as parameter.
8444 * object.cc (Object::set_target): Remove the version that looks up
8445 a target and sets it.
8446 (Sized_relobj::setup): Take a Target object instead of
8447 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8448 (make_elf_sized_object): Find target and ask target to
8449 make an ELF object.
8450 * object.h: (Object::set_target): Remove the version that looks up
8451 a target and sets it.
8452 (Sized_relobj::setup): Take a Target object instead of
8453 an elfcpp:Ehdr as parameter.
8454 * target.cc: Include dynobj.h.
8455 (Target::do_make_elf_object_implementation): New.
8456 (Target::do_make_elf_object): New.
8457 * target.h (Target::make_elf_object): New template declaration.
8458 (Target::do_make_elf_object): New method declarations.
8459 (Target::do_make_elf_object_implementation): New template declaration.
8460
cc70f101
ILT
84612009-08-14 Ian Lance Taylor <iant@google.com>
8462
8463 * gold.h (FUNCTION_NAME): Define.
8464 (gold_unreachable): Use FUNCTION_NAME.
8465
ef5e0cb1
ST
84662009-08-12 Sriraman Tallam <tmsriram@google.com>
8467
8468 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8469 symbol in the --keep-unique list is not found.
8470
48c187ce
ST
84712009-08-12 Sriraman Tallam <tmsriram@google.com>
8472
8473 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8474 been maked as --keep-unique.
8475 (Icf::unfold_section): New function.
8476 * icf.h (Icf::unfold_section): New function.
8477 * options.h (General_options::keep_unique): New option.
8478 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8479 * testsuite/Makefile.in: Regenerate.
8480 * testsuite/icf_keep_unique_test.sh: New file.
8481 * testsuite/icf_keep_unique_test.cc: New file.
8482
645afe0c
CC
84832009-08-12 Cary Coutant <ccoutant@google.com>
8484
8485 PR 10471
8486 * resolve.cc (Symbol_table::resolve): Check for references from
8487 dynamic objects to hidden and internal symbols.
8488 * testsuite/Makefile.am (hidden_test.sh): New test.
8489 * testsuite/Makefile.in: Regenerate.
8490 * testsuite/hidden_test.sh: New script.
8491 * testsuite/hidden_test_1.c: New test source.
8492 * testsuite/hidden_test_main.c: New test source.
8493
11af873f
DK
84942009-08-11 Doug Kwan <dougkwan@google.com>
8495
8496 * arm.cc: Update comments.
8497 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8498 segment to locate the .ARM.exidx section if present.
8499
b9f7d72d
DK
85002009-08-09 Doug Kwan <dougkwan@google.com>
8501
8502 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8503 patch.
8504
ddd3c53c
ST
85052009-08-07 Sriraman Tallam <tmsriram@google.com>
8506 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8507 compiler warnings.
8508
27721062
ST
85092009-08-06 Sriraman Tallam <tmsriram@google.com>
8510
8511 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8512 valid tls_segment only for non-debug-section relocations.
8513 * testsuite/Makefile.am: Add gc_tls_test.
8514 * testsuite/Makefile.in: Regenerate.
8515 * testsuite/gc_tls_test.cc: New file.
8516 * testsuite/gc_tls_test.sh: New file.
8517
ef15dade 85182009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8519
ef15dade
ST
8520 * icf.cc: New file.
8521 * icf.h: New file.
8522 * Makefile.am (CCFILES): Add icf.cc.
8523 (HFILES): Add icf.h
8524 * Makefile.in: Regenerate.
8525 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8526 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8527 section, symbol and addend information for the relocs.
8528 * gold.cc (queue_middle_tasks): Call identical code folding.
8529 * gold.h: Add defines for multimap.
8530 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8531 to the call of finalize_local_symbols.
8532 * main.cc (main): Create object of class Icf.
8533 * object.cc (Sized_relobj::do_layout): Allow this function to be
8534 called twice during icf.
8535 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8536 to sections marked as identical by icf.
8537 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8538 when available.
8539 (Sized_relobj::do_section_entsize): New function.
8540 * object.h (Object::section_entsize): New function.
8541 (Object::do_section_entsize): New pure virtual function.
8542 (Relobj::finalize_local_symbols): Add new parameter.
8543 (Relobj::do_section_entsize): New function.
8544 * options.h (General_options::icf): New option.
8545 (General_options::icf_iterations): New option.
8546 (General_options::print_icf_sections): New option.
8547 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8548 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8549 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8550 icf.
8551 * symtab.cc (Symbol_table::is_section_folded): New function.
8552 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8553 to sections marked as identical by icf.
8554 * symtab.h (Symbol_table::set_icf): New function.
8555 (Symbol_table::icf): New function.
8556 (Symbol_table::is_section_folded): New function.
8557 (Symbol_table::icf_): New data member.
8558 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8559 * testsuite/Makefile.am: Add commands to build icf_test.
8560 * testsuite/Makefile.in: Regenerate.
8561 * testsuite/icf_test.sh: New file.
8562 * testsuite/icf_test.cc: New file.
8563
c3b65ac4
CD
85642009-07-24 Chris Demetriou <cgd@google.com>
8565
8566 * layout.cc (is_compressible_debug_section): Fix incorrect
8567 comment about compressed section names.
8568
1caf2c51
ILT
85692009-07-20 Ian Lance Taylor <ian@airs.com>
8570
8571 PR 10419
8572 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8573
1ef4d87f
ILT
85742009-07-16 Ian Lance Taylor <iant@google.com>
8575
8576 PR 10400
8577 * layout.h: #include <map>.
8578 (class Kept_section): Change from struct to class. Add accessors
8579 and setters. Add section size to Comdat_group mapping. Change
8580 Comdat_group to std::map. Add is_comdat_ field. Add
8581 linkonce_size field in union.
8582 (class Layout): Update declaration of find_or_add_kept_section.
8583 Don't declare find_kept_object.
8584 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8585 parameter. Add object, shndx, is_comdat, and is_group_name
8586 parameters. Change all callers. Adjust for new Kept_section.
8587 (Layout::find_kept_object): Remove.
8588 * object.cc (Sized_relobj::include_section_group): Update use of
8589 Kept_section. Rename secnum to shndx. Only record
8590 Kept_comdat_section if sections are the same size.
8591 (Sized_relobj::include_linkonce_section): Update use of
8592 Kept_section. Only record Kept_comdat_section if sections are the
8593 same size. Set size of linkonce section.
8594 (Sized_relobj::map_to_kept_section): Update call to
8595 get_kept_comdat_section.
8596 * object.h (class Sized_relobj): Rename fields in
8597 Kept_comdat_section to drop trailing underscores; change object
8598 field to Relobj*. Change Kept_comdat_section_table to store
8599 struct rather than pointer.
8600 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8601 Add kept_object and kept_shndx parameters. Change all callers.
8602 (Sized_relobj::get_kept_comdat_section): Change return type to
8603 bool. Add kept_object and kept_shndx parameters. Change all
8604 callers.
8605 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8606 Layout::find_or_add_kept_section.
8607
37c3b7b0
ILT
86082009-07-09 Ian Lance Taylor <iant@google.com>
8609
8610 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8611 Reserve space in the hash table.
8612
98fa85cb
ILT
86132009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8614
8615 * fileread.cc (File_read::get_mtime): New method.
8616 * fileread.h (Timespec): New structure.
8617 (File_read::get_mtime): New method.
8618 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8619 Renamed from timestamp_nsec.
8620 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8621 Elf_Xword.
e1df38aa 8622 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8623 timestamp_nsec.
e1df38aa 8624 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8625 (Incremental_inputs::report_obejct): Save mtime; style fix.
8626 (Incremental_inputs::report_script): Save mtime; style fix.
8627 (Incremental_inputs::finalize_inputs): Style fix.
8628 (Incremental_inputs::finalize): Style fix.
8629 (Incremental_inputs::create_input_section_data): Store inputs
8630 mtime.
8631 * incremental.h (Incremental_inputs::report_script): Add mtime
8632 argument.
8633 (Incremental_inputs::Input_info::Input_info): Intialize only one
8634 union member.
8635 (Incremental_inputs::Input_info::archive): Move to nameless
8636 union.
8637 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8638 (Incremental_inputs::Input_info::script): Move to nameless union.
8639 (Incremental_inputs::mtime): New field.
8640 * script.cc (read_input_script): Pass file mtime to
8641 Incremental_input.
8642 * script.h (Script_info::inputs): Style fix.
8643
c9d70757
ILT
86442009-07-01 Ian Lance Taylor <ian@airs.com>
8645
8646 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8647 instead of 32.
8648
9c547ec3
ILT
86492009-06-24 Ian Lance Taylor <iant@google.com>
8650
8651 PR 10156
8652 * layout.cc (Layout::choose_output_section): If we find an
8653 existing section, update the flags.
8654 (Layout::create_notes): New function, broken out of
8655 Layout::finalize.
8656 (Layout::finalize): Don't create note sections.
8657 (Layout::create_note): Don't crash if linker script discards
8658 section.
8659 (Layout::create_gold_note): Likewise.
8660 (Layout::create_build_id): Likewise. Don't set
8661 after_input_sections on the section.
8662 (Layout::create_executable_stack_info): Remove target parameter.
8663 Change caller.
8664 * layout.h (class Layout): Declare create_notes. Update
8665 declaration of create_executable_stack_info.
8666 * gold.cc (queue_middle_tasks): Call create_notes.
8667 * output.cc (Output_section::update_flags_for_input_section): Move
8668 here from output.h. If SHF_ALLOC flag is newly set, mark address
8669 invalid.
8670 * output.h (Output_data::mark_address_invalid): New function.
8671 (class Output_section): Only declare, not define,
8672 update_flags_for_input_section. Remove set_flags.
8673
55458500
ILT
86742009-06-24 Ian Lance Taylor <iant@google.com>
8675
8676 * script-sections.cc (Output_section_definition::
8677 set_section_addresses): Rename shadowing local load_address to
8678 laddr.
8679
1307d6cd
ILT
86802009-06-24 Ian Lance Taylor <iant@google.com>
8681
8682 PR 10244
8683 * reloc.cc (relocate_sections): Skip empty relocation sections.
8684
ec3f783e
ILT
86852009-06-23 Ian Lance Taylor <iant@google.com>
8686
8687 PR 10156
8688 * layout.cc (Layout::create_note): Use choose_output_section
8689 rather than make_output_section.
8690
459c9f1c
ILT
86912009-06-23 Ian Lance Taylor <iant@google.com>
8692
8693 PR 10237
8694 * options.cc (General_options::parse_V): Set printed_version_.
8695 (General_options::General_options): Initialize printed_version_.
8696 * options.h (class General_options): Add printed_version_ field.
8697 * gold.cc (queue_initial_tasks): If there are no input files,
8698 don't give a fatal error if we printed the version information.
8699 (queue_middle_tasks): If using -r with a shared object, give a
8700 fatal error rather than an ordinary error.
8701
1518dc8f
ILT
87022009-06-23 Ian Lance Taylor <iant@google.com>
8703
8704 PR 10219
8705 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8706 (Layout::make_output_section): Set have_stabstr_section_ if we see
8707 a .stab*str section.
8708 (Layout::finalize): Call link_stabs_sections.
8709 (Layout::link_stabs_sections): New file.
8710 * layout.h (class Layout): Add have_stabstr_section_ field.
8711 Declare link_stabs_sections.
8712
3d857b98
DK
87132009-06-23 Doug Kwan <dougkwan@google.com>
8714
8715 * Makefile.am (libgold_a_LIBADD): New.
8716 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8717 * Makefile.in: Regenerate.
8718 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8719 * configure: Regenerate.
8720 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8721 * fileread.cc: Include sys/state.h
8722 * gold.h: Declare memmem and strndup if found missing.
8723 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8724
0639a6f6
ILT
87252009-06-23 Ian Lance Taylor <iant@google.com>
8726
8727 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8728 * configure: Rebuild.
8729
8d63875c
ILT
87302009-06-23 Ian Lance Taylor <iant@google.com>
8731
8732 PR 10147
8733 * object.cc (Object::section_contents): Don't try to get a view if
8734 the section has length zero.
8735 (Object::handle_gnu_warning_section): If the section is empty, use
8736 the name of the section as the warning.
8737
f7c8a183
ILT
87382009-06-23 Ian Lance Taylor <iant@google.com>
8739
8740 PR 10133
8741 * stringpool.h (class Stringpool_template): Add optimize_ field.
8742 (Stringpool_template::set_optimize): New function.
8743 * stringpool.cc (Stringpool_template::Stringpool_template):
8744 Initialize optimize_ field.
8745 (Stringpool_template::set_string_offsets): Test local optimize
8746 fild rather than parameter.
8747 * layout.cc (Layout::Layout): Call set_optimize on the section
8748 name stringpool.
8749
e6a307ba
ILT
87502009-06-22 Ian Lance Taylor <iant@google.com>
8751
8752 PR 10030
8753 * yyscript.y: Parse TARGET.
8754 * script.cc (script_set_target): New function.
8755 * script-c.h (script_set_target): Declare.
8756 * options.cc (General_options::string_to_object_format): Rename
8757 from string_to_object_format in anonymous namespace. Change
8758 callers.
8759 * options.h (class General_options): Declare
8760 string_to_object_format.
8761
3ee173de
ILT
87622009-06-22 Ian Lance Taylor <iant@google.com>
8763
8764 * script-sections.cc (Script_sections::create_segments): Don't put
8765 program headers in a PT_LOAD segment if -n or -N.
8766
87672009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
8768
8769 PR 10141
8770 * options.h (class General_options): Add -z lazy and -z now. Sort
8771 -z options into alphabetical order.
8772 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8773
cd6739a1 87742009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
8775
8776 * layout.cc (Layout::make_output_section): Call
8777 Target::new_output_section.
8778 (Layout::attach_allocated_section_to_segment): Put large section
8779 sections in a separate load segment with the large segment flag
8780 set.
8781 (Layout::segment_precedes): Sort large data segments after other
8782 load segments.
8783 (align_file_offset): New static function.
8784 (Layout::set_segment_offsets): Use align_file_offset.
8785 * output.h (class Output_section): Add is_small_section_ and
8786 is_large_section_ fields.
8787 (Output_section::is_small_section): New function.
8788 (Output_section::set_is_small_section): New function.
8789 (Output_section::is_large_section): New function.
8790 (Output_section::set_is_large_section): New function.
8791 (Output_section::is_large_data_section): New function.
8792 (class Output_segment): Add is_large_data_segment_ field.
8793 (Output_segment::is_large_data_segment): New function.
8794 (Output_segment::set_is_large_data_segment): New function.
8795 * output.cc (Output_section::Output_section): Initialize new
8796 fields.
8797 (Output_segment::Output_segment): Likewise.
8798 (Output_segment::add_output_section): Add assertion that large
8799 data sections always go in large data segments. Force small data
8800 sections to the end of the list of data sections. Force small BSS
8801 sections to the start of the list of BSS sections. For large BSS
8802 sections to the end of the list of BSS sections.
8803 * symtab.h (class Symbol): Declare is_common_shndx.
8804 (Symbol::is_defined): Check Symbol::is_common_shndx.
8805 (Symbol::is_common): Likewise.
8806 (class Symbol_table): Define enum Commons_section_type. Update
8807 declarations. Add small_commons_ and large_commons_ fields.
8808 * symtab.cc (Symbol::is_common_shndx): New function.
8809 (Symbol_table::Symbol_table): Initialize new fields.
8810 (Symbol_table::add_from_object): Put small and large common
8811 symbols in the right list.
8812 (Symbol_table::sized_finalized_symbol): Check
8813 Symbol::is_common_shndx.
8814 (Symbol_table::sized_write_globals): Likewise.
8815 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8816 common symbol lists. Don't call do_allocate_commons_list if the
8817 list is empty.
8818 (Symbol_table::do_allocate_commons_list): Remove is_tls
8819 parameter. Add comons_section_type parameter. Change all
8820 callers. Handle small and large common symbols.
8821 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8822 Symbol::is_common_shndx.
8823 * resolve.cc (symbol_to_bits): Likewise.
8824 * target.h (Target::small_common_shndx): New function.
8825 (Target::small_common_section_flags): New function.
8826 (Target::large_common_shndx): New function.
8827 (Target::large_common_section_flags): New function.
8828 (Target::new_output_section): New function.
8829 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8830 small_common_section_flags, and large_common_section_flags
8831 fields.
8832 (Target::do_new_output_section): New virtual function.
8833 * arm.cc (Target_arm::arm_info): Initialize new fields.
8834 * i386.cc (Target_i386::i386_info): Likewise.
8835 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8836 Likewise.
8837 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8838 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8839 (Target_x86_64::do_new_output_section): New function.
8840 * configure.ac: Define conditional MCMODEL_MEDIUM.
8841 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8842 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8843 (large_LDFLAGS): Define.
8844 * testsuite/large.c: New file.
8845 * testsuite/testfile.cc (Target_test::test_target_info):
8846 Initialize new fields.
8847 * configure, testsuite/Makefile.in: Rebuild.
8848
bb04269c
DK
88492009-06-05 Doug Kwan <dougkwan@google.com>
8850
8851 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 8852 * Makefile.in: Regenerate.
bb04269c
DK
8853 * i386.cc (class Target_i386): Define new virtual method to
8854 override do_is_local_label_name in parent.
8855 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8856 local symbols if --discard-locals or -X is given.
8857 * options.h (class General_options): Declare new options
8858 '--discard-locals' and '-X' for discarding locals.
8859 * target.h (class Target): Define new methods is_local_label_name.
8860 Declare new virtual method do_is_local_label_name.
8861 * target.cc: New file.
8862 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8863 (check_SCRIPTS): Add discard_locals_test.sh.
8864 (check_DATA): Add discard_local_tests.syms.
8865 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8866 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8867 * testsuite/Makefile.in: Regenerate.
8868 * testsuite/discard_locals_test.c: New file.
8869 * testsuite/discard_locals_test.sh: Same.
8870
805bb01c
DK
88712009-06-05 Doug Kwan <dougkwan@google.com>
8872
8873 * object.cc (Sized_relobj::Sized_relobj): Initialize
8874 discarded_eh_frame_shndx_ to -1U.
8875 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8876 section.
8877 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8878 a discarded .eh_frame section.
8879 (Sized_relobj::do_finalize_local_symbols): Ditto.
8880 * object.h (class Sized_relobj): Declare new member
8881 discarded_eh_frame_shndx_.
8882 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8883 (local_labels_test.o, local_labels_test): New rules.
8884 * testsuite/Makefile.in: Regenerate.
8885
1dcd334d
DK
88862009-06-04 Doug Kwan <dougkwan@google.com>
8887
8888 * layout.cc (Layout::section_name_mapping): Add mapping for
8889 special ARM sections.
8890
96d49306
DK
88912009-06-03 Doug Kwan <dougkwan@google.com>
8892
8893 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8894 (utils::has_overflow): Same.
8895
dff16297
ILT
88962009-06-03 Ian Lance Taylor <iant@google.com>
8897
8898 * layout.cc (Layout::section_name_mapping): New array, replacing
8899 Layout::linkonce_mapping.
8900 (Layout::section_name_mapping_count): New variable, replacing
8901 Layout::linkonce_mapping_count.
8902 (Layout::linkonce_output_name): Remove.
8903 (Layout::output_section_name): Rewrite.
8904 * layout.h (class Layout): Rename Linkonce_mapping to
8905 Section_name_mapping, linkonce_mapping to section_name_mapping,
8906 linkonce_mapping_count to section_name_mapping_count. Don't
8907 declare linkonce_output_name.
8908
c121c671
DK
89092009-06-03 Doug Kwan <dougkwan@google.com>
8910
8911 * gold/arm.cc (namespace utils): New.
8912 (Target_arm::reloc_is_non_pic): Define new method.
8913 (class Arm_relocate_functions): New.
8914 (Target_arm::Relocate::relocate): Handle relocation types used by
8915 Android.
8916
07800fab
ILT
89172009-06-03 Ian Lance Taylor <iant@google.com>
8918
8919 * arm.cc (Target_arm::scan::global): Use || instead of |.
8920
c121c671
DK
89212009-06-02 Doug Kwan <dougkwan@google.com>
8922
8923 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8924 issued_non_pic_error_.
8925 (class Target_arm::Scan): Declare new method check_non_pic.
8926 Define new method symbol_needs_plt_entry.
8927 Declare new data member issued_non_pic_error_.
8928 (class Target_arm::Relocate): Declare new method
8929 should_apply_static_reloc.
8930 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8931 (Target_arm::Scan::check_non_pic): Define new method.
8932 (Target_arm::Scan::local): Handle a small subset of reloc types used
8933 by Android.
8934 (Target_arm::Scan::local): Same.
8935 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8936
b19b0c6d
ILT
89372009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8938
8939 * incremental.cc (Incremental_inputs::report_command_line): Filter
8940 out --incremental-* options.
8941
94cdfcff
DK
89422009-05-29 Doug Kwan <dougkwan@google.com>
8943
8944 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8945 template class.
8946 (class Target_arm): Update comment.
8947 (Target_arm::Target_arm): Initialize new data members GOT_,
8948 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8949 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8950 and Target_arm::rel_dyn_section.
8951 Declare new_enum Target_arm::Got_type.
8952 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8953 and DYNBSS_.
8954 Update commments for member do_dynsym_value.
8955 (Target_arm::got_size, Target_arm::plt_section,
8956 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8957 new methods inside class defintion.
8958 (Target_arm::got_section): Define new method.
8959 (Target_arm::rel_dyn_section): Same.
8960 (Output_data_plt_arm): New template class.
8961 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8962 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8963 (Output_data_plt_arm::add_entry): Same.
8964 (Output_data_plt_arm::first_plt_entry): Define new
8965 static data member for PLT instruction template.
8966 (Output_data_plt_arm::plt_entry): Same.
8967 (Output_data_plt_arm::do_write): Define new method.
8968 (Target_arm::make_plt_entry): Same.
8969 (Target_arm::do_finalize_sections): Same.
8970 (Target_arm::do_dynsym_value): Same.
8971
4a657b0d
DK
89722009-05-28 Doug Kwan <dougkwan@google.com>
8973
8974 * Makefile.am (TARGETSOURCES): Add arm.cc.
8975 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8976 * Makefile.in: Regenerate.
8977 * arm.cc: New file.
8978 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8979
e7ae8c36
DK
89802009-05-26 Doug Kwan <dougkwan@google.com>
8981
8982 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8983 (General_options::check_excluded_libs): Strip off directories in
8984 archive name before matching like GNU ld does.
8985 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8986 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8987 (exclude_libs_test_LDFLAGS): Add linker option
8988 -Wl,--exclude-libs,libexclude_libs_test_3
8989 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8990 an explicit archive without using -l.
8991 (alt/libexclude_libs_test_3.a): New make rule.
8992 * testsuite/Makefile.in: Regenerate.
8993 * testsuite/exclude_libs_test.c : Declare lib3_default().
8994 (main): Call it.
8995 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8996 * exclude_libs_test_3.c: New file.
8997
f12e7348
NC
89982009-05-26 Nick Clifton <nickc@redhat.com>
8999
9000 * po/id.po: New Indonesian translation.
9001 * po/gold.pot: Updated template file.
9002
4daadc0d
ST
90032009-05-22 Sriraman Tallam <tmsriram@google.com>
9004
e1df38aa 9005 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9006 gc_comdat_test files. Add -Wl,--gc-sections to build
9007 gc_comdat_test.
9008 * testsuite/Makefile.in: Regenerate.
9009 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9010
531813ad
ST
90112009-05-21 Sriraman Tallam <tmsriram@google.com>
9012
9013 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9014 kept comdat section was garbage collected.
9015 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9016 * testsuite/Makefile.in: Regenerate.
9017 * testsuite/gc_comdat_test.sh: New file.
9018 * testsuite/gc_comdat_test_1.cc: New file.
9019 * testsuite/gc_comdat_test_2.cc: New file.
9020
65514900
CC
90212009-05-19 Doug Kwan <dougkwan@google.com>
9022
9023 * archive.cc (Archive::Archive): Move constructor from archive.h
9024 to here. Initialize no_export_.
9025 (Archive::get_elf_object_for_member): Set no_export flag of object.
9026 * archive.h (Archive::Archive): Move constructor body to
9027 archive.cc.
9028 (Archive::no_export): New method.
9029 (Archive::no_export_): New field.
9030 * object.h (Object::Object): Initialize no_export_ to false.
9031 (Object::no_export, Object::set_no_export): New methods.
9032 (Object::no_export_): New field.
9033 * options.cc (General_options::parse_exclude_libs): New method.
9034 (General_options::check_excluded_libs) Same.
9035 * options.h (exclude_libs): New option.
9036 (General_options::check_excluded_libs): New method declaration.
9037 (General_options::excluded_libs_): New field.
9038 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9039 default or protected visibility if an object has no-export flag set.
9040 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9041 (check_SCRIPTS): Add exclude_libs_test.sh.
9042 (check_DATA): Add exclude_libs_test.syms.
9043 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9044 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9045 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9046 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9047 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9048 libexclude_libs_test_2.a): New rules.
9049 * testsuite/Makefile.in: Regenerate.
9050 * testsuite/exclude_libs_test.c: New file.
9051 * testsuite/exclude_libs_test.sh: Ditto.
9052 * testsuite/exclude_libs_test_1.c: Ditto.
9053 * testsuite/exclude_libs_test_2.c: Ditto.
9054
1b77ea50
ILT
90552009-05-15 Ian Lance Taylor <iant@google.com>
9056
9057 * configure.ac: Check for declarations for cases where libiberty.h
9058 checks HAVE_DECL_xxx.
9059 * configure, config.in: Rebuild.
9060
072fe7ce
ILT
90612009-05-15 Mikolaj Zalewski <mikolajz@google.com>
9062
9063 * gold.h (Incremental_argument_list): Remove (invalid) forward
9064 declaration.
9065 * incremental.cc (Incremental_inputs::report_achive): New method.
9066 (Incremental_inputs::report_object): New method.
9067 (Incremental_inputs::report_script): New method.
9068 (Incremental_inputs::finalize_inputs): New method.
9069 (Incremental_inputs::finalize): Call finalize_inputs().
9070 (Incremental_inputs::sized_create_incremental_inputs_section_data):
9071 Create inputs entries.
9072 * incremental.h (Incremental_input_type): New enum.
9073 (Incremental_inputs::Incremental_input): Initialize new fields.
9074 (Incremental_inputs::report_inputs): New method.
9075 (Incremental_inputs::report_achive): New method.
9076 (Incremental_inputs::report_object): New method.
9077 (Incremental_inputs::report_script): New method.
9078 (Incremental_inputs::finalize_inputs): New method.
9079 (Incremental_inputs::Input_info): New struct.
9080 (Incremental_inputs::Input_info_map): New typedef.
9081 (Incremental_inputs::lock_): New field.
9082 (Incremental_inputs::Inputs_): New field.
9083 (Incremental_inputs::Inputs_map): New field.
9084 * main.cc (main): Call Incremental_input::report_inputs.
9085 * options.h (Input_argument_list): Typedef moved from
9086 Input_arguments.
9087 (Input_file_group::Files): Remove, use ::Input_argument_list.
9088 (Input_file_group::Input_argument_list): Remove, use
9089 ::Input_argument_list.
9090 * plugin.cc (Plugin_manager::add_input_file): Add error in
9091 incremental build.
9092 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
9093 functions.
9094 * script.cc (read_input_script): Call
9095 Incremental_input::report_script.
9096 * script.h (Script_info): New class.
9097
b0481b0b
ILT
90982009-04-27 Ian Lance Taylor <iant@google.com>
9099
9100 * x86_64.cc (do_adjust_output_section): Set entsize to
9101 plt_entry_size.
9102
b22a5a41 91032009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
9104
9105 * output.cc (Output_file::close): After short writes, continue
9106 writing from the correct offset in the buffer being written.
9107
40fde488
CD
91082009-04-23 Chris Demetriou <cgd@google.com>
9109
9110 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
9111 * configure: Regenerate.
9112 * config.in: Regenerate.
9113 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
9114 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
9115
3ce2c28e
ILT
91162009-04-21 Mikolaj Zalewski <mikolajz@google.com>
9117
9118 * incremental.cc (Incremental_inputs_header_data): Renamed from
9119 Incremental_input_header_data.
9120 (Incremental_inputs_header_data::data_size): New field.
9121 (Incremental_inputs_header_data::put_input_file_count): Renamed
9122 from input_file_count.
9123 (Incremental_inputs_header_data::put_command_line_offset): Renamed
9124 from command_line_offset.
9125 (Incremental_inputs_header_data::put_reserved): Renamed from
9126 put_reserved.
9127 (Incremental_inputs_entry_data): Renamed from
9128 Incremental_input_entry_data.
9129 (Incremental_inputs_entry_data::data_size): New field.
9130 (Incremental_inputs::report_command_line): New method.
9131 (Incremental_inputs::finalize): New method.
9132 (Incremental_inputs::create_incremental_inputs_data): New method.
9133 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
9134 * incremental.h: New file.
9135 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
9136 (Layout::finalize): Create incremental inputs section in
9137 incremental builds.
9138 (Layout::create_incremental_info_sections): New method.
9139 * layout.h (Layout::incremental_inputs): New method.
9140 (Layout::create_incremental_info_sections): New method.
9141 (Layout::incremental_inputs_): New field.
9142 * main.cc (main): Notify Incremental_input of the command line.
9143
e55bde5e
ILT
91442009-04-01 Ian Lance Taylor <iant@google.com>
9145 Mikolaj Zalewski <mikolajz@google.com>
9146
9147 * gold.h (reserve_unordered_map): Define, three versions, one for
9148 each version of Unordered_map.
9149 * layout.cc (Layout::Layout): Remove options parameter. Add
9150 number_of_input_files parameter. Don't initialize options_.
9151 Initialize number_of_input_files_ and resized_signatures_. Move
9152 sections_are_attached_.
9153 (Layout::layout_group): Reserve space for group_signatures_.
9154 (Layout::find_or_add_kept_section): Change name parameter to be a
9155 reference. Resize signatures_ map when it gets large enough.
9156 (Layout::layout_eh_frame): Use parameters->options() instead of
9157 this->options_.
9158 (Layout::make_output_section): Likewise.
9159 (Layout::attach_allocated_section_to_segment): Likewise.
9160 (Layout::finalize, Layout::create_executable_stack): Likewise.
9161 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9162 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9163 * layout.h (class Layout): Update declarations. Remove options_
9164 field. Add number_of_input_files_ and resized_signatures_
9165 fields. Move sections_are_attached_ field.
9166 * main.cc (main): Pass number of input files to Layout
9167 constructor. Don't pass options.
9168
154b857c
ILT
91692009-03-30 Ian Lance Taylor <iant@google.com>
9170
9171 * ffsll.c (ffsll): Correct implementation.
9172
2f35ab9b
ILT
91732009-03-27 Ian Lance Taylor <iant@google.com>
9174
fd03461a
ILT
9175 * ffsll.c: New file.
9176 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9177 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9178 * ftruncate.c (ftruncate): Declare before definition.
9179 * mremap.c (mremap): Likewise.
9180 * pread.c (pread): Likewise.
9181 * configure, Makefile.in, config.in: Rebuild.
9182
2f35ab9b
ILT
9183 * mremap.c: New file.
9184 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9185 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9186 (mremap): Declare if HAVE_MREMAP is not defined.
9187 * configure, Makefile.in, config.in: Rebuild.
9188
33aea2fd
CC
91892009-03-27 Cary Coutant <ccoutant@google.com>
9190
9191 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9192 position independent.
9193 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9194 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9195
6d479619
CC
91962009-03-24 Cary Coutant <ccoutant@google.com>
9197
9198 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9199 an executable.
9200 (needs_dynamic_reloc): Likewise.
9201
afc06bb8
ILT
92022009-03-24 Ian Lance Taylor <iant@google.com>
9203
9204 * yyscript.y (file_cmd): Recognize EXTERN.
9205 (extern_name_list, extern_name_list_body): New nonterminals.
9206 * script.cc (script_add_extern): Define.
9207 * script-c.h (script_add_extern): Declare.
9208
f6060a4d
ILT
92092009-03-24 Rafael Avila de Espindola <espindola@google.com>
9210
9211 * object.cc (is_elf_object): Define.
9212 * object.h (is_elf_object): Declare.
9213 * archive.cc (Archive::get_elf_object_for_member): Call
9214 is_elf_object.
33aea2fd 9215 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9216
26736d8e
ILT
92172009-03-24 Elliott Hughes <enh@google.com>
9218
9219 * output.cc (Output_file::map_anonymous): Define.
9220 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9221 try an anonymous one. Report the size if the mmap fails.
9222 * output.h (class Output_file): Declare map_anonymous.
9223
22fd9730
ILT
92242009-03-24 Ian Lance Taylor <iant@google.com>
9225
9226 * target-select.cc (instantiate_target): Don't acquire the lock if
9227 the instantiated_target_ field has already been set.
9228
cb010894
ILT
92292009-03-23 Ian Lance Taylor <iant@google.com>
9230
7f055c20
ILT
9231 * gold-threads.h (class Initialize_lock): Define.
9232 * gold-threads.cc (class Initialize_lock_once): Define.
9233 (initialize_lock_control): New static variable.
9234 (initialize_lock_pointer): New static variable.
9235 (initialize_lock_once): New static function.
9236 (Initialize_lock::Initialize_lock): Define.
9237 (Initialize_lock::initialize): Define.
9238 * target-select.h: Include "gold-threads.h".
9239 (class Target_selector): Add lock_ and initialize_lock_ fields.
9240 Don't define instantiate_target, just declare it.
9241 * target-select.cc (Target_selector::Target_selector): Initialize
9242 new fields.
9243 (Target_selector::instantiate_target): Define.
9244 * descriptors.h: Include "gold-threads.h".
9245 (class Descriptors): Add initialize_lock_ field.
9246 * descriptors.cc (Descriptors::Descriptors): Initialize new
9247 field.
9248 (Descriptors::open): Use initialize_lock_ field
9249 * errors.h (class Errors): Add initialize_lock_ field.
9250 * errors.cc (Errors::Errors): Initialize new field.
9251 (Errors::initialize_lock): Use initialize_lock_ field.
9252 * powerpc.cc (class Target_selector_powerpc): Remove
9253 instantiated_target_ field. In do_recognize call
9254 instantiate_target rather than do_instantiate_target. In
9255 do_instantiate_target just allocate a new target.
9256 * sparc.cc (class Target_selector_sparc): Likewise.
9257
36959681
ILT
9258 * freebsd.h: New file.
9259 * i386.cc: Include "freebsd.h".
9260 (Target_i386): Derive from Target_freebsd rather than
9261 Sized_target.
9262 (Target_selector_i386): Derive from Target_selector_freebsd rather
9263 than Target_selector.
9264 * x86_64.cc: Include "freebsd.h".
9265 (Target_x86_64): Derive from Target_freebsd rather than
9266 Sized_target.
9267 (Target_selector_x86_64): Derive from Target_selector_freebsd
9268 rather than Target_selector.
9269 * target.h (class Target): Add adjust_elf_header and
9270 do_adjust_elf_header.
9271 * output.cc (Output_file_header:: do_sized_write): Call target
9272 adjust_elf_header routine.
9273 * configure.tgt: Set targ_osabi.
9274 * configure.ac: Define GOLD_DEFAULT_OSABI.
9275 * parameters.cc (Parameters::default_target): Pass
9276 GOLD_DEFAULT_OSABI to select_target.
9277 * target-select.h (class Target_selector): Make instantiate_target
9278 protected rather than private.
9279 * Makefile.am (HFILES): Add freebsd.h.
9280 * configure, Makefile.in, config.in: Rebuild.
9281
cb010894
ILT
9282 * merge.cc (do_add_input_section): Correct pend value. Change
9283 message about last entry not being null terminated from error to
9284 warning.
9285
0e879927
ILT
92862009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9287
9288 * incremental.cc: New file.
9289 * Makefile.am (CCFILES): Add incremental.cc.
9290 * Makefile.in: Rebuild.
9291
41105937
PP
92922009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9293
9294 * layout.cc (Layout::output_section_name): Preserve names
9295 of '.note.' sections.
e1df38aa 9296
60439920
ILT
92972009-03-19 Ian Lance Taylor <iant@google.com>
9298
9299 * descriptors.cc (Descriptors::open): Check that the options are
9300 valid before using them.
9301
0d371ad3
ILT
93022009-03-18 Ian Lance Taylor <iant@google.com>
9303
9304 * script-sections.h: Include <list>.
9305 (class Script_sections): Change Sections_elements from std::vector
9306 to std::list. Typedef public Elements_iterator. Add
9307 orphan_section_placement_, data_segment_align_start_, and
9308 saw_data_segment_align_ fields. Remove data_segment_align_index_
9309 field.
9310 * script-sections.cc (class Orphan_section_placement): New class.
9311 (class Sections_element): Add virtual functions is_relro and
9312 orphan_section_init. Remove virtual function place_orphan_here.
9313 (class Output_section_definition): Add is_relro and
9314 orphan_section_init. Remove place_orphan_here.
9315 (class Orphan_output_section): Likewise.
9316 (Script_sections::Script_sections): Update for field changes.
9317 (Script_sections::data_segment_align): Set saw_data_segment_align_
9318 and data_segment_align_start_, not data_segment_align_index.
9319 (Script_sections::data_segment_relro_end): Check
9320 saw_data_segment_align_. Use data_segment_align_start_ rather
9321 than data_segment_align_index_.
9322 (Script_sections::place_orphan): Rewrite to use
9323 Orphan_section_placement.
9324
9201d894
ILT
93252009-03-17 Ian Lance Taylor <iant@google.com>
9326
9c5b8369
ILT
9327 * archive.cc (Archive::add_symbols): Check for a version attached
9328 to the symbol name in the archive map.
9329 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9330 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9331 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9332 (ver_test_11.a): New target.
9333 * testsuite/Makefile.in: Rebuild.
9334
9201d894
ILT
9335 * configure.ac: Check for chsize and posix_fallocate. Replace
9336 ftruncate.
9337 * ftruncate.c: New file, from gnulib.
9338 * output.cc (posix_fallocate): Define dummy version if not
9339 HAVE_POSIX_FALLOCATE.
9340 (Output_file::map): Call posix_fallocate rather than lseek and
9341 write.
9342 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9343 * configure, Makefile.in, config.in: Rebuild.
9344
ef4ab7a8 93452009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9346
ef4ab7a8
PP
9347 * layout.h (Layout::create_note): Add section_name parameter.
9348 * layout.cc (Layout::create_note): Likewise.
9349 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9350
8c500701
ILT
93512009-03-17 Ian Lance Taylor <iant@google.com>
9352
e85b18e1
ILT
9353 * descriptors.cc: Include "options.h".
9354 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9355 (Descriptors::open): Always use O_CLOEXEC when opening a new
9356 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9357 then set FD_CLOEXEC.
9358
9efe6174
ILT
9359 * sparc.cc (class Target_sparc): Add has_got_section.
9360 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9361 make sure we have a GOT section.
9362
9363 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9364 (Target_sparc::Scan::local): Likewise.
9365 (Target_sparc::Scan::global): Likewise.
9366 (Target_sparc::Relocate::relocate): Likewise.
9367 (Target_sparc::Relocate::relocate_tls): Likewise.
9368
8c500701
ILT
9369 * symtab.cc (Symbol_table::define_default_version): New function,
9370 broken out of add_from_object.
9371 (Symbol_table::add_from_object): Call define_default_version.
9372 (Symbol_table::define_special_symbol): Add resolve_oldsym
9373 parameter. Change all callers. If the version for a symbol comes
9374 from a version script, resolve it with the symbol with the same
9375 name with no version. Also add the symbol without a version if
9376 appropriate.
9377 (do_define_in_output_data): If resolving with oldsym, don't delete
9378 sym.
9379 (do_define_in_output_segment): Likewise.
9380 (do_define_as_constant): Likewise.
9381 * symtab.h (class Symbol_table): Update declarations.
9382
f1ed28fb
ILT
93832009-03-13 Ian Lance Taylor <iant@google.com>
9384
15f8229b
ILT
9385 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9386 (Read_symbols::requeue): New function.
9387 (Read_symbols::do_read_symbols): If make_elf_object fails because
9388 the target type is not configured, and the file was searched for,
9389 issue a warning and retry with the next directory.
9390 (Add_symbols::run): If the file has an incompatible format, and
9391 it was searched for, requeue the Read_symbols task. On error,
9392 release the object.
9393 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9394 dirindex parameter to constructor. Change all callers. Declare
9395 incompatible_warning and requeue.
9396 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9397 input_argument_ and input_group_ fields. Add them to
9398 constructor. Change all callers.
9399 (class Read_script): Add dirindex_ field. Add it to constructor.
9400 Change all callers.
9401 * archive.cc (Archive::setup): Remove input_objects parameter.
9402 Change all callers.
9403 (Archive::get_file_and_offset): Likewise.
9404 (Archive::read_all_symbols): Likewise.
9405 (Archive::read_symbols): Likewise.
9406 (Archive::get_elf_object_for_member): Remove input_objects
9407 parameter. Add punconfigured parameter. Change all callers.
9408 (Archive::add_symbols): Change return type to bool. Check return
9409 value of include_member.
9410 (Archive::include_all_members): Likewise.
9411 (Archive::include_member): Change return type to bool. Return
9412 false if first included object has incompatible target. Set
9413 included_member_ field.
9414 (Add_archive_symbols::run): If add_symbols returns false, requeue
9415 Read_symbols task.
9416 * archive.h (class Archive): Add included_member_ field.
9417 Initialize it in constructor. Add input_file and searched_for
9418 methods. Update declarations.
9419 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9420 input_argument_ fields. Add them to constructor. Change all
9421 callers.
9422 * script.cc: Include "target-select.h".
9423 (class Parser_closure): Add skip_on_incompatible_target_ and
9424 found_incompatible_target_ fields. Add
9425 skip_on_incompatible_target parameter to constructor. Change all
9426 callers. Add methods skip_on_incompatible_target,
9427 clear_skip_on_incompatible_target, found_incompatible_target, and
9428 set_found_incompatible_target.
9429 (read_input_script): Add dirindex parameter. Change all callers.
9430 If parser finds an incompatible target, requeue Read_symbols
9431 task.
9432 (script_set_symbol): Clear skip_on_incompatible_target in
9433 closure.
9434 (script_add_assertion, script_parse_option): Likewise.
9435 (script_start_sections, script_add_phdr): Likewise.
9436 (script_check_output_format): New function.
9437 * script.h (read_input_script): Update declaration.
9438 * script-c.h (script_check_output_format): Declare.
9439 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9440 (ignore_cmd): Remove OUTPUT_FORMAT.
9441 * fileread.cc (Input_file::Input_file): Add explicit this.
9442 (Input_file::will_search_for): New function.
9443 (Input_file::open): Add pindex parameter. Change all callers.
9444 * fileread.h (class Input_file): Add input_file_argument method.
9445 Declare will_search_for. Update declarations.
9446 * object.cc (make_elf_object): Add punconfigured parameter.
9447 Change all callers.
9448 * object.h (class Object): Make input_file public. Add
9449 searched_for method.
9450 (make_elf_object): Update declaration.
9451 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9452 restart search.
9453 * dirsearch.h (class Dirsearch): Update declaration.
9454 * options.h (class General_options): Add --warn-search-mismatch.
9455 * parameters.cc (Parameters::is_compatible_target): New function.
9456 * parameters.h (class Parameters): Declare is_compatible_target.
9457 * workqueue.cc (Workqueue::add_blocker): New function.
9458 * workqueue.h (class Workqueue): Declare add_blocker.
9459
f1ed28fb
ILT
9460 * fileread.cc (Input_file::open): Remove options parameter.
9461 Change all callers.
9462 (Input_file::open_binary): Likewise.
9463 * script.cc (read_input_script): Likewise.
9464 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9465 options parameter from constructor. Change all callers.
9466 (class Read_script): Likewise.
9467 * fileread.h (class Input_file): Update declarations.
9468 * script.h (read_input_script): Update declaration.
9469
34dd024a
NC
94702009-03-10 Nick Clifton <nickc@redhat.com>
9471
9472 * po/es.po: New Spanish translation.
9473
6d71b17c
CC
94742009-03-06 Cary Coutant <ccoutant@google.com>
9475
9476 * options.cc (parse_short_option): Keep dash_z from registering itself.
9477
031cdbed
ILT
94782009-03-03 Ian Lance Taylor <iant@google.com>
9479
9480 PR 9918
9481 * target-reloc.h (relocate_section): Pass output_section to
9482 relocate.
9483 * i386.cc (Target_i386::should_apply_static_reloc): Add
9484 output_section parameter. Change all callers.
9485 (Target_i386::Relocate::relocate): Add output_section parameter.
9486 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9487 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9488 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9489 * testsuite/two_file_shared.sh: New script.
9490 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9491 (check_DATA): Add two_file_shared.dbg.
9492 (two_file_shared.dbg): New target.
9493 * testsuite/Makefile.in: Rebuild.
9494
15d5fa16
ILT
94952009-03-01 Ian Lance Taylor <iant@google.com>
9496
9497 * configure.ac: Check for byteswap.h.
9498 * configure: Rebuild.
9499 * config.in: Rebuild.
9500
8a4c0b0d
ILT
95012009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9502
9503 * layout.cc (Layout::find_or_add_kept_section): New function.
9504 (Layout::add_comdat): Removed.
9505 * layout.h (struct Kept_section): Move out of class Layout.
9506 Remove trailing underscores from field names. Add group_sections
9507 field. Rename group_ field to is_group. Change all uses.
9508 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9509 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9510 comdat_groups_ field.
9511 (Sized_relobj::include_section_group): Use
9512 find_or_add_kept_section and Kept_section::group_sections.
9513 (Sized_relobj::include_linkonce_section): Likewise.
9514 * object.cc (class Sized_relobj): Don't define Comdat_group or
9515 Comdat_group_table. Remove find_comdat_group and
9516 add_comdat_group. Remove comdat_groups_ field.
9517 * plugin.cc (include_comdat_group): Use
9518 Layout::find_or_add_kept_section.
9519
b4ecf66b
ILT
95202009-02-28 Ian Lance Taylor <iant@google.com>
9521
14359ca0
ILT
9522 * README: --gc-sections and map files are now supported. Document
9523 some build requirements.
9524
b4ecf66b
ILT
9525 PR 6992
9526 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9527 relocatable link set the value of the section symbol to zero.
9528 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9529 relocatable link don't include the section address in the local
9530 symbol value.
9531
0602e05a
ILT
95322009-02-27 Ian Lance Taylor <iant@google.com>
9533
fd9d194f
ILT
9534 PR 6811
9535 * options.h (class Search_directory): Add is_system_directory.
9536 (class General_options): Declare is_in_system_directory.
9537 * options.cc (get_relative_sysroot): Make static.
9538 (get_default_sysroot): Make static.
9539 (General_optoins::is_in_system_directory): New function.
9540 * fileread.cc (Input_file::is_in_system_directory): New function.
9541 * fileread.h (class Input_file): Declare is_in_system_directory.
9542 * object.h (class Object): Add is_in_system_directory.
9543 (class Input_objects): Remove system_library_directory_ field.
9544 * object.cc (Input_objects::add_object): Don't set
9545 system_library_directory_.
9546 (input_objects::found_in_system_library_directory): Remove.
9547 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9548 parameter. Change all callers.
9549 (Symbol_table::sized_write_globals): Likewise.
9550 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9551 Call Object::is_in_system_directory.
9552 * symtab.h (class Symbol_table): Update declarations.
9553
61edd21f
ILT
9554 PR 5990
9555 * descriptors.h (Open_descriptor): Add is_on_stack field.
9556 * descriptors.cc (Descriptors::open): If the descriptor is on the
9557 top of the stack, remove it. Initialize is_on_stack field.
9558 (Descriptors::release): Only add pod to stack if it is not on the
9559 stack already.
9560 (Descriptors::close_some_descriptor): Clear stack_next and
9561 is_on_stack fields.
9562
e29e076a
ILT
9563 PR 7091
9564 * output.cc (Output_section::find_starting_output_address): Rename
9565 from starting_output_address; add PADDR parameter; change return
9566 type.
9567 * output.h (class Output_section): Declare
9568 find_starting_output_address instead of starting_output_address.
9569 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9570 section symbol for which we can't find a merge section.
9571
0602e05a
ILT
9572 PR 9836
9573 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9574 hidden or internal, force the symbol to be local.
9575 * resolve.cc (Symbol::override_visibility): Define.
9576 (Symbol::override_base): Use override_visibility.
9577 (Symbol_table::resolve): Likewise.
9578 (Symbol::override_base_with_special): Likewise.
9579 (Symbol_table::override_with_special): If the visibility is hidden
9580 or internal, force the symbol to be local.
9581 * symtab.h (class Symbol): Add set_visibility and
9582 override_visibility.
9583 * testsuite/ver_test_1.sh: New file.
9584 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9585 (check_DATA): Add ver_test_1.syms.
9586 (ver_test_1.syms): New target.
9587 * testsuite/Makefile.in: Rebuild.
9588
401a9a73
CC
95892009-02-25 Cary Coutant <ccoutant@google.com>
9590
9591 * layout.cc (Layout::choose_output_section): Don't rename sections
9592 when using a linker script that has a SECTIONS clause.
9593 * Makefile.in: Regenerate.
9594
9595 * testsuite/Makefile.am (script_test_5.sh): New test case.
9596 * testsuite/Makefile.in: Regenerate.
9597 * testsuite/script_test_5.cc: New file.
9598 * testsuite/script_test_5.sh: New file.
9599 * testsuite/script_test_5.t: New file.
9600
f488e4b0
CC
96012009-02-13 Rafael Avila de Espindola <espindola@google.com>
9602
9603 * archive.cc (Archive::include_member): Update calls to add_symbols.
9604 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9605 the Layout argument.
9606 * dynobj.h (do_add_symbols): Add the Layout argument.
9607 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9608 Layout argument.
9609 * object.h (Object::add_symbols): Add the Layout argument.
9610 (Object::do_add_symbols): Add the Layout argument.
9611 (Sized_relobj::do_add_symbols): Add the Layout argument.
9612 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9613 Unify the two versions.
9614 (Add_plugin_symbols): Remove.
9615 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9616 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9617 (Add_plugin_symbols): Remove.
9618 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9619 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9620 (Add_symbols::run): Make it work with Pulginobj.
9621
89dd1680
ILT
96222009-02-06 Ian Lance Taylor <iant@google.com>
9623
9624 * object.cc (Sized_relobj::do_layout): Make info message start
9625 with lower case letter.
9626
266d0a74
ILT
96272009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9628
602b464e
ILT
9629 * binary.cc: Fix file comment.
9630
266d0a74
ILT
9631 * options.h (enum Incremental_disposition): Define.
9632 (class General_options): Add new options: --incremental,
9633 --incremental_changed, --incremental_unchanged,
9634 --incremental_unknown. Add incremental_disposition_ and
9635 implicit_incremental_ fields.
9636 (General_options::incremental_disposition): New function.
9637 (class Position_dependent_options): Add incremental_disposition
9638 option.
9639 (Position_dependent_options::copy_from_options): Set incremental
9640 dispositions.
9641 * options.cc (General_options::parse_incremental_changed): New
9642 function.
9643 (General_options::parse_incremental_unchanged): New function.
9644 (General_options::parse_incremental_unknown): New function.
9645 (General_options::General_options): Initialize new fields
9646 incremental_disposition_ and implicit_incremental_.
9647 (General_options::finalize): Check for uasge of --incremental-*
9648 without --incremental.
9649
f073bbf7
CD
96502009-02-06 Chris Demetriou <cgd@google.com>
9651
9652 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9653 pointer and to report location as the file name associated with
9654 the symbol.
9655 (gold_undefined_symbol_at_location): New function to replace the
9656 old gold_undefined_symbol functionality.
9657 * target-reloc.h (relocate_section): Update to use
9658 gold_undefined_symbol_at_location.
9659 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9660 Call gold_undefined_symbol function rather than gold_error.
9661 * errors.h (Errors::undefined_symbol): Take location as a
9662 string, rather than calculating it from a relocation.
9663 * errors.cc (Errors::fatal): Print "fatal error:" before the
9664 formatted message.
9665 (Errors::error, Errors::error_at_location): Print "error: "
9666 before the formatted message.
9667 (Errors::undefined_symbol): Take location as a string, rather
9668 than calculating it from a relocation.
9669 (gold_undefined_symbol_at_location): New function akin to
9670 old gold_undefined_symbol, calculates location from relocation.
9671 (gold_undefined_symbol): Change to take only a Symbol pointer
9672 and to report location as the file name associated with the symbol.
9673 * testsuite/debug_msg.sh: Update for changed error messages.
9674 * testsuite/undef_symbol.sh: Likewise.
9675
8e94a90c
ILT
96762009-02-04 Duncan Sands <baldrick@free.fr>
9677
9678 PR 9812
9679 * reduced_debug_output.h
9680 (Output_reduced_debug_abbrev_section::failed): Use format for
9681 gold_warning.
9682 (Output_reduced_debug_info_section::faild): Likewise.
9683
88a0e15b
ILT
96842009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9685
9686 * script.cc (Lazy_demangler): New class.
9687 (Version_script_info::get_symbol_version_helper): Demangle a
9688 symbol only once.
9689
5efc7cd2
CC
96902009-01-29 Cary Coutant <ccoutant@google.com>
9691
9692 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9693 to __tls_get_addr.
9694 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9695
e0ebcf42
ILT
96962009-01-28 Ian Lance Taylor <iant@google.com>
9697
5efc7cd2 9698 * version.cc (version_string): Bump to 1.9.
75fe7426 9699
e0ebcf42
ILT
9700 * gold.h: Include <cstring> and <stdint.h>.
9701 * version.cc: Include <cstdio>.
9702 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9703 warning.
9704 * reduced_debug_output.cc (insert_into_vector): Rename from
9705 Insert_into_vector; change all callers. Use Swap_unaligned to
9706 avoid aliasing issue; remove union since it is unnecessary.
9707
8e2813be 97082009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
9709
9710 * Makefile.am (CCFILES): Add gc.cc.
9711 (HFILES): Add gc.h.
9712 * Makefile.in: Regenerate.
9713 * gold.cc (Gc_runner): New class.
9714 (queue_initial_tasks): Call garbage collection related tasks
9715 when corresponding options are invoked.
9716 (queue_middle_gc_tasks): New function.
9717 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9718 processed early before laying out sections during garbage collection.
9719 * gold.h (queue_middle_gc_tasks): New function.
9720 (is_prefix_of): Move from "layout.cc".
9721 * i386.cc (Target_i386::gc_process_relocs): New function.
9722 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9723 * main.cc (main): Create object of class "Garbage_collection".
9724 * object.cc (Relobj::copy_symbols_data): New function.
9725 (Relobj::is_section_name_included): New function.
e1df38aa
NC
9726 (Sized_relobj::do_layout): Allow this function to be called twice
9727 during garbage collection and defer layout of section during the
6d03d481
ST
9728 first call.
9729 * object.h (Relobj::get_symbols_data): New function.
9730 (Relobj::is_section_name_included): New function.
9731 (Relobj::copy_symbols_data): New function.
9732 (Relobj::set_symbols_data): New function.
9733 (Relobj::get_relocs_data): New function.
9734 (Relobj::set_relocs_data): New function.
9735 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9736 (Relobj::gc_process_relocs): New function.
9737 (Relobj::do_gc_process_relocs): New pure virtual function.
9738 (Relobj::sd_): New data member.
9739 (Sized_relobj::is_output_section_offset_invalid): New function.
9740 (Sized_relobj::do_gc_process_relocs): New function.
9741 * options.h (General_options::gc_sections): Modify to not be a no-op.
9742 (General_options::print_gc_sections): New option.
9743 * plugin.cc (Plugin_finish::run): Remove function call to
9744 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9745 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9746 * reloc.cc (Read_relocs::run): Add task to process relocs and
9747 determine unreferenced sections when doing garbage collection.
9748 (Gc_process_relocs): New class.
9749 (Sized_relobj::do_gc_process_relocs): New function.
9750 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9751 sections that are garbage collected.
9752 * reloc.h (Gc_process_relocs): New class.
9753 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9754 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9755 symbols whose corresponding sections are garbage collected.
9756 (Symbol_table::Symbol_table): Add new parameter for the garbage
9757 collection object.
9758 (Symbol_table::gc_mark_undef_symbols): New function.
9759 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9760 (Symbol_table::gc_mark_dyn_syms): New function.
9761 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9762 as garbage.
9763 (Symbol_table::add_from_object): Likewise.
9764 (Symbol_table::add_from_relobj): When building shared objects, do not
9765 treat externally visible symbols as garbage.
9766 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9767 table information for static and relocatable links.
9768 * symtab.h (Symbol_table::set_gc): New function.
9769 (Symbol_table::gc): New function.
9770 (Symbol_table::gc_mark_undef_symbols): New function.
9771 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9772 (Symbol_table::gc_mark_dyn_syms): New function.
9773 (Symbol_table::gc_): New data member.
e1df38aa 9774 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
9775 function.
9776 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9777 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9778
3b293544
CF
97792009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9780
9781 * options.h (General_options::gc_sections): Define as a no-op for now.
9782 (General_options::no_keep_memory): Ditto.
9783 (General_options::Bshareable): Define.
9784 * options.cc (General_options::finalize): Honor -Bshareable.
9785
83d22aa8
AS
97862009-01-20 Andreas Schwab <schwab@suse.de>
9787
9788 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9789 read the value in the contents, since we don't use it. Use the
9790 template endianness when writing.
9791 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9792
cd536b21
AS
97932009-01-19 Andreas Schwab <schwab@suse.de>
9794
9795 * configure.tgt (powerpc64-*): Fix targ_obj.
9796
99e9a495
ILT
97972009-01-15 Ian Lance Taylor <iant@google.com>
9798
9799 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9800 local symbols when stripping all symbols.
9801
bbbfea06
CC
98022009-01-14 Cary Coutant <ccoutant@google.com>
9803
99e9a495 9804 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 9805
0f7c0701
CC
98062009-01-14 Cary Coutant <ccoutant@google.com>
9807
9808 * archive.cc (Archive::get_elf_object_for_member): Remove call
9809 to File_read::claim_for_plugin.
9810 * descriptors.cc (Descriptors::open): Remove reference to
9811 is_claimed.
9812 (Descriptors::claim_for_plugin): Remove.
9813 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9814 (Descriptors::is_claimed): Remove.
9815 (claim_descriptor_for_plugin): Remove.
9816 * fileread.cc (File_read::claim_for_plugin): Remove.
9817 * fileread.h (File_read::claim_for_plugin): Remove.
9818 (File_read::descriptor): Reopen descriptor if necessary.
9819 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9820 (Plugin_manager::all_symbols_read): Add task parameter. Change
9821 all callers.
9822 (Plugin_manager::get_input_file): New function.
9823 (Plugin_manager::release_input_file): New function.
9824 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9825 corresponding data member.
9826 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9827 and pass to base constructor. Change all callers.
9828 (get_input_file, release_input_file): New functions.
9829 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9830 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9831 (Plugin_manager::all_symbols_read): Add task parameter.
9832 (Plugin_manager::get_input_file): New function.
9833 (Plugin_manager::release_input_file): New function.
9834 (Plugin_manager::task_): New data member.
9835 (Pluginobj::Pluginobj): Add filesize parameter.
9836 (Pluginobj::filename): New function.
9837 (Pluginobj::descriptor): New function.
9838 (Pluginobj::filesize): New function.
9839 (Pluginobj::filesize_): New data member.
9840 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9841 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9842 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9843
9844 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9845 with archive libraries.
9846 * testsuite/Makefile.in: Regenerate.
9847 * testsuite/plugin_test.c (struct sym_info): New type.
9848 (get_input_file, release_input_file): New static variables.
9849 (onload): Capture new transfer vector entries.
9850 (claim_file_hook): Stop reading at end of file according to filesize.
9851 Factor out parsing of readelf output into separate function.
9852 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9853 APIs and get the source file name from the symbol table. Convert
9854 source file name to corresponding object file name. Print info
9855 message when adding new input files.
9856 (parse_readelf_line): New function.
9857 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9858 * testsuite/plugin_test_2.sh: Likewise.
9859 * testsuite/plugin_test_3.sh: Likewise.
9860 * testsuite/plugin_test_4.sh: New test case.
9861
62a6d109
ILT
98622009-01-07 Ian Lance Taylor <iant@google.com>
9863
9864 * version.cc (version_string): Bump to 1.8.
9865
483620e8
CC
98662008-12-23 Cary Coutant <ccoutant@google.com>
9867
9868 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9869 * plugin.cc (Plugin_manager::finish): Rename as
9870 layout_deferred_objects. Move cleanup to separate function.
9871 (Plugin_manager::cleanup): New function.
9872 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9873 separately.
9874 * plugin.h (Plugin_manager::finish): Rename as
9875 layout_deferred_objects.
9876 (Plugin_manager::cleanup): New function.
9877 (Plugin_manager::cleanup_done): New field.
9878
d66a9eb3
CC
98792008-12-23 Cary Coutant <ccoutant@google.com>
9880
9881 * plugin.cc (is_visible_from_outside): New function.
9882 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9883 so we don't return "IR only" status for exported symbols or -r links.
9884
9885 * testsuite/Makefile.am (plugin_test_3): New test case.
9886 * testsuite/Makefile.in: Regenerate.
9887 * testsuite/plugin_test_3.sh: New file.
9888
5995b570
CC
98892008-12-22 Cary Coutant <ccoutant@google.com>
9890
9891 * object.cc (Sized_relobj::layout_section): New function.
9892 (Sized_relobj::do_layout): Defer layout of input sections until after
9893 plugin has provided replacement files.
9894 (Sized_relobj::do_layout_deferred_sections): New function.
9895 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9896 (Relobj::layout_deferred_sections): New function.
9897 (Relobj::do_layout_deferred_sections): New function.
9898 (Sized_relobj::do_layout_deferred_sections): New function.
9899 (Sized_relobj::layout_section): New function.
9900 (Sized_relobj::Deferred_layout): New structure.
9901 (Sized_relobj::deferred_layout_): New field.
9902 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9903 Change all callers. Layout deferred sections.
9904 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9905 references.
9906 (Plugin_hook::run): Move code from do_plugin_hook inline.
9907 (Plugin_hook::do_plugin_hook): Remove.
9908 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9909 (Plugin_manager::finish): Renamed, was cleanup.
9910 (Plugin_manager::should_defer_layout): New function.
9911 (Plugin_manager::add_deferred_layout_object): New function.
9912 (Plugin_manager::Deferred_layout_list): New type.
9913 (Plugin_manager::deferred_layout_objects_): New field.
9914 (Plugin_hook::do_plugin_hook): Remove.
9915
ee769c88
ILT
99162008-12-17 Ian Lance Taylor <iant@google.com>
9917
9918 * options.h (class General_options): Add --no case for
9919 --export-dynamic.
9920
abc8dcba
CC
99212008-12-16 Cary Coutant <ccoutant@google.com>
9922
9923 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9924 vector.
9925 (Plugin_manager::claim_file): Create plugin object even if
9926 plugin did not call the add_symbols callback.
9927 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9928 asking for more symbols than were added.
9929 * testsuite/Makefile.am (plugin_test_1): Add test case with
9930 no global symbols.
9931 (empty.syms): New target.
9932 * testsuite/Makefile.in: Regenerate.
9933 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9934 message. Don't call add_symbols if no globals.
9935 (all_symbols_read_hook): Don't provide replacement for empty
9936 claimed file.
9937
b0074644
ILT
99382008-12-12 Ian Lance Taylor <iant@google.com>
9939
68943102
ILT
9940 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9941 r_type == 0 for a local symbol with r_sym == 0.
9942 (scan_relocatable_relocs): Pass r_sym to
9943 local_non_section_strategy.
9944 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9945 r_sym parameter.
9946
b0074644
ILT
9947 * configure.ac: Update test for TLS descriptors: they are
9948 supported as of glibc 2.9.
9949 * configure: Rebuild.
9950
c2508178
ILT
99512008-12-11 Ian Lance Taylor <iant@google.com>
9952
9953 PR 7091
9954 * target-reloc.h (Default_scan_relocatable_relocs): For each
9955 function, map r_type == 0 to RELOC_DISCARD.
9956
2756a258
CC
99572008-12-10 Cary Coutant <ccoutant@google.com>
9958
9959 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9960 object to override a kept COMDAT group from a plugin object.
9961
bb6f53d3
ILT
99622008-12-09 Ian Lance Taylor <iant@google.com>
9963
fbc558e1
ILT
9964 PR 7088
9965 * yyscript.y (file_cmd): Handle INPUT.
9966
bb6f53d3
ILT
9967 * testsuite/initpri1.c: Change all declarations to be full
9968 prototypes by adding void, to avoid compiler warnings.
9969
4674ecfc
CC
99702008-12-05 Rafael Avila de Espindola <espindola@google.com>
9971
9972 * options.cc (General_options::parse_plugin_opt): New.
9973 (General_options::add_plugin): The argument now is just the filename.
9974 (General_options::add_plugin_option): New.
9975 * options.h (plugin_opt): New.
9976 (add_plugin): Change argument name.
9977 (add_plugin_option): New.
9978 * plugin.cc (Plugin::load): Don't parse the plugin option.
9979 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9980 (Plugin::add_option): New.
9981 (Plugin::args_): Change type.
9982 (Plugin::filename_): New.
9983 (Plugin_manager::add_plugin_option): New.
9984 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9985 * testsuite/Makefile.in: Regenerate.
9986
fd06b4aa
CC
99872008-12-05 Cary Coutant <ccoutant@google.com>
9988
9989 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9990 Handle --strip-lto-sections option.
9991 * options.h (strip_lto_sections): New option.
9992
6c52134c
CC
99932008-12-01 Cary Coutant <ccoutant@google.com>
9994
9995 * plugin.cc (ld_plugin_message): Change format parameter to const.
9996 Fix mismatch between new[] and delete.
9997
a45248e0
CC
99982008-11-14 Cary Coutant <ccoutant@google.com>
9999
10000 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10001 instead of -1U.
10002
c82fbeee
CS
100032008-11-05 Craig Silverstein <csilvers@google.com>
10004
10005 * options.cc (General_options::parse_dynamic_list): New function.
10006 * options.h (General_options): New flags dynamic_list,
10007 dynamic_list_data, dynamic_list_cpp_new, and
10008 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10009 (General_options::in_dynamic_list): New function.
10010 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10011 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10012 (Lex::can_continue_name): Likewise.
10013 (yylex): Likewise.
10014 (read_script_file): New parameter script_options.
10015 (read_dynamic_list): New function.
10016 (Script_options::define_dynamic_list): New function.
10017 (dynamic_list_keyword_parsecodes): New variable.
10018 (dynamic_list_keywords): New variable.
10019 * script.h (Script_options::define_dynamic_list): New function
10020 prototype.
10021 (read_dynamic_list): New function prototype.
10022 * symtab.cc (strprefix): New macro.
10023 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10024 dynamic_list_data, dynamic_list_cpp_new, and
10025 dynamic_list_cpp_typeinfo.
10026 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10027 (dynamic_list_expr): New rule.
10028 (dynamic_list_nodes): Likewise.
10029 (dynamic_list_node): Likewise.
10030 * testsuite/Makefile.am (dynamic_list): New test.
10031 * testsuite/Makefile.in: Regenerated.
10032 * testsuite/dynamic_list.t: New file.
10033 * testsuite/dynamic_list.sh: New file.
10034
e0bb29a5
CS
100352008-11-05 Craig Silverstein <csilvers@google.com>
10036
10037 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10038 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10039 (t11_last): Likewise.
10040 * testsuite/ver_test_6.c (main): Likewise.
10041
4e1e25e0
CC
100422008-10-07 Cary Coutant <ccoutant@google.com>
10043
10044 * options.c (General_options::finalize): Add check for -static and
10045 -shared.
10046 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10047 is not empty.
10048
92f03fcb
CC
100492008-10-02 Cary Coutant <ccoutant@google.com>
10050
10051 * plugin.cc (make_sized_plugin_object): Fix conditional
10052 compilation to work when not all targets are enabled.
10053
fbd8a257
CC
100542008-09-29 Cary Coutant <ccoutant@google.com>
10055
10056 * archive.cc (Archive::get_file_and_offset): Use filename instead
10057 of name to get library path.
10058 (Archive::include_member): Unlock external member of a thin archive.
10059
10060 * testsuite/Makefile.am (TEST_AR): New variable.
10061 (thin_archive_test_1): New test.
10062 (thin_archive_test_2): New test.
81636b3f
CC
10063 * testsuite/Makefile.in: Regenerate.
10064 * testsuite/thin_archive_main.cc: New file.
10065 * testsuite/thin_archive_test_1.cc: New file.
10066 * testsuite/thin_archive_test_2.cc: New file.
10067 * testsuite/thin_archive_test_3.cc: New file.
10068 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 10069
eff45813
CC
100702008-09-29 Cary Coutant <ccoutant@google.com>
10071
10072 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
10073 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
10074 instead of -1U.
10075 (Sized_relobj::do_finalize_local_symbols): Likewise.
10076 (Sized_relobj::map_to_kept_section): Likewise.
10077 * object.h (Sized_relobj::invalid_address): New constant.
10078 (Sized_relobj::do_output_section_offset): Check for invalid_address
10079 and return -1ULL.
10080 * output.cc (Output_reloc::local_section_offset): Use constant
10081 invalid_address instead of -1U.
10082 (Output_reloc::get_address): Likewise.
10083 (Output_section::output_address): Change -1U to -1ULL.
10084 * output.h (Output_reloc::invalid_address): New constant.
10085 * reloc.cc (Sized_relobj::write_sections): Use constant
10086 invalid_address instead of -1U.
10087 (Sized_relobj::relocate_sections): Likewise.
10088 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
10089 values for merge sections.
10090 * target-reloc.h (relocate_for_relocatable): Use constant
10091 invalid_address instead of -1U.
10092
89fc3421
CC
100932008-09-19 Cary Coutant <ccoutant@google.com>
10094
10095 Add plugin functionality for link-time optimization (LTO).
10096 * configure.ac (plugins): Add --enable-plugins option.
10097 * configure: Regenerate.
10098 * config.in: Regenerate.
10099 * Makefile.am (LIBDL): New variable.
10100 (CCFILES): Add plugin.cc.
10101 (HFILES): Add plugin.h.
10102 (ldadd_var): Add LIBDL.
10103 * Makefile.in: Regenerate.
10104
10105 * archive.cc: Include "plugin.h".
10106 (Archive::setup): Don't preread archive symbols when using a plugin.
10107 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
10108 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
10109 files.
10110 (Archive::include_member): Add symbols from plugin objects.
10111 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
10112 * descriptors.cc (Descriptors::open): Check for file descriptors
10113 abandoned by plugins.
10114 (Descriptors::claim_for_plugin): New function.
10115 * descriptors.h (Descriptors::claim_for_plugin): New function.
10116 (Open_descriptor::is_claimed): New field.
10117 (claim_descriptor_for_plugin): New function.
10118 * fileread.cc (File_read::claim_for_plugin): New function.
10119 * fileread.h (File_read::claim_for_plugin): New function.
10120 (File_read::descriptor): New function.
10121 * gold.cc: Include "plugin.h".
10122 (queue_initial_tasks): Add task to call plugin hooks for generating
10123 new object files.
10124 * main.cc: Include "plugin.h".
10125 (main): Load plugin libraries.
10126 * object.h (Pluginobj): Declare.
10127 (Object::pluginobj): New function.
10128 (Object::do_pluginobj): New function.
10129 (Object::set_target): New function.
10130 * options.cc: Include "plugin.h".
10131 (General_options::parse_plugin): New function.
10132 (General_options::General_options): Initialize plugins_ field.
10133 (General_options::add_plugin): New function.
10134 * options.h (Plugin_manager): Declare.
10135 (General_options): Add --plugin option.
10136 (General_options::has_plugins): New function.
10137 (General_options::plugins): New function.
10138 (General_options::add_plugin): New function.
10139 (General_options::plugins_): New field.
10140 * plugin.cc: New file.
10141 * plugin.h: New file.
10142 * readsyms.cc: Include "plugin.h".
10143 (Read_symbols::do_read_symbols): Check for archive before checking
10144 for ELF file. Call plugin hooks to claim files.
10145 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
10146 from a real object file; force override when processing replacement
10147 files.
10148 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
10149 (Symbol::init_base_object): Likewise.
10150 (Symbol::init_base_output_data): Likewise.
10151 (Symbol::init_base_output_segment): Likewise.
10152 (Symbol::init_base_constant): Likewise.
10153 (Symbol::init_base_undefined): Likewise.
10154 (Symbol::output_section): Assert that object is not a plugin.
10155 (Symbol_table::add_from_pluginobj): New function.
10156 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
10157 undefined.
10158 (Symbol_table::sized_write_globals): Likewise.
10159 (Symbol_table::add_from_pluginobj): Instantiate template.
10160 * symtab.h (Sized_pluginobj): Declare.
10161 (Symbol::in_real_elf): New function.
10162 (Symbol::set_in_real_elf): New function.
10163 (Symbol::in_real_elf_): New field.
10164 (Symbol_table::add_from_pluginobj): New function.
10165
10166 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10167 (LIBDL): New variable.
10168 (LDADD): Add LIBDL.
10169 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10170 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10171 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10172 (MOSTLYCLEANFILES): Likewise.
10173 * testsuite/Makefile.in: Regenerate.
10174 * testsuite/plugin_test.c: New file.
10175 * testsuite/plugin_test_1.sh: New file.
10176 * testsuite/plugin_test_2.sh: New file.
10177
de31bda5
ILT
101782008-09-16 Ian Lance Taylor <iant@google.com>
10179
9c2d0ef9
ILT
10180 * target-reloc.h (relocate_section): Check whether a symbol is
10181 defined by the ABI before reporting an undefined symbol error.
10182 * target.h (Target::is_defined_by_abi): Make parameter const.
10183 (Target::do_is_defined_by_abi): Likewise.
10184 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10185 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10186 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10187 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10188 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10189 * testsuite/Makefile.in: Rebuild.
10190
de31bda5
ILT
10191 * fileread.cc (make_view): Add casts to avoid warning.
10192
9fa33bee
AO
101932008-09-16 Alexandre Oliva <aoliva@redhat.com>
10194
10195 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10196 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10197
183fd0e3
AO
101982008-09-16 Alexandre Oliva <aoliva@redhat.com>
10199
10200 * options.h (General_options::output_is_executable): New.
10201 (General_options::output_is_pie): New.
10202 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10203 for shared libraries.
10204 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10205
7be8330a
CD
102062008-09-11 Chris Demetriou <cgd@google.com>
10207
10208 * options.h (origin): New -z option.
10209 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10210 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10211 in DT_FLAGS_1.
10212
a9caad02
CC
102132008-09-05 Cary Coutant <ccoutant@google.com>
10214
10215 * fileread.cc (File_read::make_view): Add check for attempt to map
10216 beyond end of file.
10217
ae6dce4d
CC
102182008-09-05 Cary Coutant <ccoutant@google.com>
10219
10220 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10221 explicit instantiations.
10222
d7ab2a47
KVH
102232008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10224
10225 PR gold/6858
10226 * options.cc (General_options::finalize): Allow undefined symbols
10227 in shlibs if linking -shared.
10228
10229 PR gold/6859
10230 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10231 symbols as not needing a dynsym entry.
10232
1e52a9c1
CS
102332008-08-20 Craig Silverstein <csilvers@google.com>
10234
10235 * fileread.cc (File_read::open): Do not lock the file unless it
10236 was successfully opened.
10237
d85c80a3
CC
102382008-08-14 Cary Coutant <ccoutant@google.com>
10239
10240 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10241 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10242 * testsuite/tls_test.cc (struct int128): 128-bit struct
10243 for testing TLS relocs with non-zero addend.
10244 (v12): New TLS variable.
10245 (t12): New test.
10246 (t_last): Add check for v12.
10247 * testsuite/tls_test.h (t12): New function.
10248 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10249
2d924fd9
ILT
102502008-08-13 Ian Lance Taylor <iant@google.com>
10251
10252 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10253 set tls_segment_ or relro_segment_.
10254 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10255 when appropriate.
10256 * output.h (Output_section::clear_is_relro): New function.
10257 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10258 sections specially even when output_data_ is empty.
10259 (Output_segment::maximum_alignment): When first section is relro,
10260 only force alignment for PT_LOAD segments.
10261 * script.cc (script_data_segment_align): New function.
10262 (script_data_segment_relro_end): New function.
10263 * script-c.h (script_data_segment_align): Declare.
10264 (script_data_segment_relro_end): Declare.
10265 * script-sections.h (class Script_sections): Declare
10266 data_segment_align and data_segment_relro_end. Add fields
10267 segment_align_index_ and saw_relro_end_.
10268 * script-sections.cc (class Sections_element): Add set_is_relro
10269 virtual function. Add new bool* parameter to place_orphan_here.
10270 Add get_output_section virtual function.
10271 (class Output_section_definition): Add set_is_relro. Add new
10272 bool* parameter to place_orphan_here. Add get_output_section.
10273 Add is_relro_ field.
10274 (Output_section_definition::Output_section_definition): Initialize
10275 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10276 and is_relro_ fields.
10277 (Output_section_definition::place_orphan_here): Add is_relro
10278 parameter.
10279 (Output_section_definition::set_section_addresses): Set relro for
10280 output section.
10281 (Output_section_definition::alternate_constraint): Likewise.
10282 (class Orphan_output_section): Add new bool* parameter to
10283 place_orphan_here. Add get_output_section.
10284 (Orphan_output_section::place_orphan_here): Add is_relro
10285 parameter.
10286 (Script_sections::Script_sections): Initialize
10287 data_segment_align_index_ and saw_relro_end_.
10288 (Script_sections::data_segment_align): New function.
10289 (Script_sections::data_segment_relro_end): New function.
10290 (Script_sections::place_orphan): Set or clear is_relro.
10291 (Script_sections::set_section_addresses): Force alignment of first
10292 TLS section.
10293 * yyscript.y (exp): Call script_data_segment_align and
10294 script_data_segment_relro_end.
10295 * testsuite/relro_script_test.t: New file.
10296 * testsuite/relro_test.cc (using_script): Declare.
10297 (t1, t2): Test using_script.
10298 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10299 (relro_script_test_SOURCES): Define.
10300 (relro_script_test_DEPENDENCIES): Define.
10301 (relro_script_test_LDFLAGS): Define.
10302 (relro_script_test_LDADD): Define.
10303 (relro_script_test.so): New target.
10304 * testsuite/Makefile.in: Rebuild.
10305
f827c9a9
CC
103062008-08-06 Cary Coutant <ccoutant@google.com>
10307
10308 * archive.cc (Archive::total_archives, Archive::total_members)
10309 (Archive::total_members_loaded): New variables.
10310 (Archive::setup): Add parameter. Add option to preread
10311 archive symbols.
10312 (Archive::read_armap): Add counter.
10313 (Archive::get_file_and_offset): New function.
10314 (Archive::get_elf_object_for_member): New function.
10315 (Archive::read_all_symbols): New function.
10316 (Archive::read_symbols): New function.
10317 (Archive::add_symbols): Add counters.
10318 (Archive::include_all_members): Use armap to find members if it's
10319 already built.
10320 (Archive::include_member): Skip reading symbols if already read.
10321 Factored code into Archive::get_file_and_offset and
10322 Archive::get_elf_object_for_member. Changed call to
10323 Mapfile::report_include_archive_member.
10324 (Archive::print_stats): New function.
10325 * archive.h: Declare Object and Read_symbols_data classes.
10326 (Archive::Archive): Add initializers for new members.
10327 (Archive::setup): Add parameter.
10328 (Archive::print_stats): New function.
10329 (Archive::total_archives, Archive::total_members)
10330 (Archive::total_members_loaded): New variables.
10331 (Archive::get_file_and_offset): New function.
10332 (Archive::get_elf_object_for_member): New function.
10333 (Archive::read_all_symbols): New function.
10334 (Archive::read_symbols): New function.
10335 (Archive::Archive_member): New class.
10336 (Archive::members_): New member.
10337 (Archive::num_members_): New member.
10338 * main.cc: Include archive.h.
10339 (main): Call Archive::print_stats.
10340 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10341 archive parameter; member_name is now the fully-decorated name.
10342 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10343 * options.h: (General_options): Add --preread-archive-symbols option.
10344 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10345 Archive::setup.
10346
de4c45bd
ILT
103472008-08-04 Ian Lance Taylor <iant@google.com>
10348
10349 * symtab.h (Symbol::use_plt_offset): New function.
10350 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10351 * powerpc.cc (Relocate::relocate): Likewise.
10352 * sparc.cc (Relocate::relocate): Likewise.
10353 * x86_64.cc (Relocate::relocate): Likewise.
10354 * testsuite/weak_plt.sh: New test.
10355 * testsuite/weak_plt_main.cc: New test.
10356 * testsuite/weak_plt_shared.cc: New test.
10357 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10358 (check_PROGRAMS): Add weak_plt.
10359 (check_DATA): Add weak_plt_shared.so.
10360 (weak_plt_main_pic.o, weak_plt): New targets.
10361 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10362 * testsuite/Makefile.in: Rebuild.
10363
10364 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10365 gcctestdir/ld.
10366 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10367 * testsuite/Makefile.in: Rebuild.
10368
323ee3f4
AM
103692008-08-04 Alan Modra <amodra@bigpond.net.au>
10370
10371 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10372 * Makefile.in: Regenerate.
10373 * po/POTFILES.in: Regenerate.
10374
7c07ecec
ILT
103752008-07-29 Ian Lance Taylor <iant@google.com>
10376
10377 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10378 symbols before other symbols.
10379 * testsuite/script_test_2.cc (test_addr): Declare.
10380 (test_addr_alias): Declare.
10381 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10382 values.
7c07ecec
ILT
10383 * testsuite/script_test_2.t: Define test_addr_alias and
10384 test_addr.
10385
5778530e
ILT
103862008-07-24 Ian Lance Taylor <iant@google.com>
10387
2a00e4fb
ILT
10388 PR 5990
10389 * descriptors.cc: New file.
10390 * descriptors.h: New file.
10391 * gold-threads.h (class Hold_optional_lock): New class.
10392 * fileread.cc: Include "descriptors.h".
10393 (File_read::~File_read): Release descriptor rather than closing
10394 it.
10395 (File_read::open) [file]: Call open_descriptor rather than open.
10396 Set is_descriptor_opened_.
10397 (File_read::open) [memory]: Assert that descriptor is not open.
10398 (File_read::reopen_descriptor): New function.
10399 (File_read::release): Release descriptor.
10400 (File_read::do_read): Make non-const. Reopen descriptor.
10401 (File_read::read): Make non-const.
10402 (File_read::make_view): Reopen descriptor.
10403 (File_read::do_readv): Likewise.
10404 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10405 Update declarations.
10406 * layout.cc: Include "descriptors.h".
10407 (Layout::create_build_id): Use open_descriptor rather than open.
10408 * output.cc: Include "descriptors.h".
10409 (Output_file::open): Use open_descriptor rather than open.
10410 * archive.cc (Archive::const_iterator): Change Archive to be
10411 non-const.
10412 (Archive::begin, Archive::end): Make non-const.
10413 (Archive::count_members): Likewise.
10414 * archive.h (class Archive): Update declarations.
10415 * object.h (Object::read): Make non-const.
10416 * Makefile.am (CCFILES): Add descriptors.cc.
10417 (HFILES): Add descriptors.h.
10418 * Makefile.in: Rebuild.
10419
801647d1
ILT
10420 PR 6716
10421 * gold.h: Always include <clocale>. Add Solaris workarounds
10422 following code in binutils/sysdep.h.
10423
5edd166e
ILT
10424 PR 6048
10425 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10426 this->eh_frame_hdr_ is NULL before using it.
10427
c89ad728
ILT
10428 * dynobj.cc (Versions::Versions): Update comment.
10429
aa86f06b
ILT
10430 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10431 the base version name.
10432
5778530e
ILT
10433 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10434 array size plus one.
10435 (Stringpool_template::set_string_offsets): Subtract one from key
10436 before using it as an array index.
10437 (Stringpool_template::get_offset_with_length): Likewise.
10438 (Stringpool_template::write_to_buffer): Likewise.
10439 * stringpool.h (Stringpool_template::get_offset_from_key):
10440 Likewise.
10441
057ead22
ILT
104422008-07-23 Ian Lance Taylor <iant@google.com>
10443
7f649c59
ILT
10444 PR 6658
10445 * object.h (Merged_symbol_value::value): Do our best to handle a
10446 negative addend.
10447
057ead22
ILT
10448 PR 6647
10449 * script.cc (Version_script_info::get_versions): Don't add empty
10450 version tag to return value.
10451 (Version_script_info::get_symbol_version_helper): Change return
10452 type to bool. Add pversion parameter. Change all callers.
10453 (script_register_vers_node): Don't require a non-NULL tag.
10454 * script.h (class Version_script_info): Update declarations.
10455 (Version_script_info::get_symbol_version): Change return type to
10456 bool. Add version parameter. Change all callers.
10457 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10458 handling. Handle an empty version from a version script.
10459 (Symbol_table::define_special_symbol): Likewise.
10460 * testsuite/ver_test_10.script: New file.
10461 * testsuite/ver_test_10.sh: New file.
10462 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10463 (check_DATA): Add ver_test_10.syms.
10464 (ver_test_10.syms, ver_test_10.so): New target.
10465 * testsuite/Makefile.in: Rebuild.
10466
58e54ac2
CD
104672008-07-23 Simon Baldwin <simonb@google.com>
10468
10469 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10470 to zero for undefined symbols from dynamic libraries.
10471
95d14cd3
ILT
104722008-07-23 Ian Lance Taylor <iant@google.com>
10473
10474 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10475 Change all callers.
10476 * symtab.h (class Symbol_table): Update declaration.
10477 * testsuite/ver_test_9.cc: New file.
10478 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10479 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10480 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10481 (ver_test_9.so, ver_test_9.o): New targets.
10482 * testsuite/Makefile.in: Rebuild.
10483
92de84a6
ILT
104842008-07-22 Ian Lance Taylor <iant@google.com>
10485
34810851
ILT
10486 * options.h (class General_options): Define --check-sections.
10487 * layout.cc (Layout::set_segment_offsets): Handle
10488 --check-sections.
10489
af6156ef
ILT
10490 * options.h (class General_options): Define -n/--nmagic and
10491 -N/--omagic.
10492 * options.cc (General_options::finalize): For -n/--nmagic or
10493 -N/--omagic, set -static.
10494 * layout.cc (Layout::attach_allocated_section_to_segment): If
10495 -N/--omagic, don't put read-only and read-write sections in
10496 different segments.
10497 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10498 finding a read-only segment.
10499 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10500 don't set the minimum segment alignment to the common page size,
10501 and don't set the file offset to the address modulo the page size.
10502 * script-sections.cc (Script_sections::create_segments): If
10503 -n/--omagic, don't put read-only and read-write sections in
10504 different segments.
10505
92de84a6
ILT
10506 * cref.cc: New file.
10507 * cref.h: New file.
10508 * options.h (class General_options): Add --print-symbol-counts.
10509 * main.cc (main): Issue defined symbol report if requested.
10510 * archive.cc (Archive::interpret_header): Make into a const member
10511 function.
10512 (Archive::add_symbols): Call Input_objects::archive_start and
10513 archive_stop.
10514 (Archive::const_iterator): Define new class.
10515 (Archive::begin, Archive::end): New functions.
10516 (Archive::include_all_members): Rewrite to use iterator.
10517 (Archive::count_members): New function.
10518 * archive.h (class Archive): Update declarations.
10519 (Archive::filename): New function.
10520 * object.cc: Include "cref.h".
10521 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10522 (Sized_relobj::do_get_global_symbol_counts): New function.
10523 (Input_objects::add_object): Add object to cross-referencer.
10524 (Input_objects::archive_start): New function.
10525 (Input_objects::archive_stop): New function.
10526 (Input_objects::print_symbol_counts): New function.
10527 * object.h: Declare Cref and Archive.
10528 (Object::get_global_symbol_counts): New function.
10529 (Object::do_get_global_symbol_counts): New pure virtual function.
10530 (class Sized_relobj): Add defined_count_ field. Update
10531 declarations.
10532 (class Input_objects): Add cref_ field. Update constructor.
10533 Update declarations.
10534 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10535 defined_count_.
10536 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10537 symbol counts.
10538 (Sized_dynobj::do_get_global_symbol_counts): New function.
10539 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10540 defined_count_. Update declarations. Define Symbols typedef.
10541 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10542 parameter. Change all callers.
10543 (Symbol_table::add_from_dynobj): Add sympointers and defined
10544 parameters. Change all callers.
10545 * symtab.h (class Symbol_table): Update declarations.
10546 * Makefile.am (CCFILES): Add cref.cc.
10547 (HFILES): Add cref.h.
10548 * Makefile.in: Rebuild.
10549
3f7c5e1d
CD
105502008-07-22 Simon Baldwin <simonb@google.com>
10551
10552 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10553 to zero when writing undefined symbols.
10554
e0b64032
ILT
105552008-07-22 Ian Lance Taylor <iant@google.com>
10556
10557 * output.cc (Output_section::add_input_section): Don't try to
10558 merge empty merge sections.
10559
096b02cf
CS
105602008-07-21 Craig Silverstein <csilvers@google.com>
10561
10562 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10563 Include symbol version in error message.
cd536b21 10564
1d1f116d
CD
105652008-07-20 Chris Demetriou <cgd@google.com>
10566
cd536b21 10567 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10568 (RANDOM_SEED_CFLAGS): New substituted variable.
10569 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10570 * configure: Rebuild.
10571 * Makefile.in: Likewise.
10572 * testsuite/Makefile.in: Likewise.
10573
a18f591e
ILT
105742008-07-18 Ian Lance Taylor <iant@google.com>
10575
10576 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10577 where we see NAME/NULL and NAME/VERSION as separate symbols.
10578 * testsuite/ver_test_main.cc (main): Call t4.
10579 (t4, t4_2a): Define.
10580 * testsuite/ver_test_2.cc (t4_2): Define.
10581 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10582 * testsuite/ver_test_4.cc (t4_2a): Define.
10583 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10584 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10585
c6e3f6ed
ILT
105862008-07-17 Ian Lance Taylor <iant@google.com>
10587
10588 * dynobj.cc (Versions::add_def): If we give an error about a
10589 missing version, go ahead and create the version anyhow.
10590
ef9beddf
ILT
105912008-07-10 Ian Lance Taylor <iant@google.com>
10592
10593 Handle output sections with more than 0x7fffffff bytes.
10594 * object.h (class Relobj): Change map_to_output_ to
10595 output_sections_, and just keep a section pointer. Change all
10596 uses. Move comdat group support to Sized_relobj.
10597 (Relobj::is_section_specially_mapped): Remove.
10598 (Relobj::output_section): Remove poff parameter. Change all
10599 callers.
10600 (Relobj::output_section_offset): New function.
10601 (Relobj::set_section_offset): Rewrite.
10602 (Relobj::map_to_output): Remove.
10603 (Relobj::output_sections): New function.
10604 (Relobj::do_output_section_offset): New pure virtual function.
10605 (Relobj::do_set_section_offset): Likewise.
10606 (class Sized_relobj): Add section_offsets_ field. Add comdat
10607 group support from Relobj. Update declarations.
10608 (Sized_relobj::get_output_section_offset): New function.
10609 (Sized_relobj::do_output_section_offset): New function.
10610 (Sized_relobj::do_set_section_offset): New function.
10611 * object.cc (Relobj::output_section_address): Remove.
10612 (Sized_relobj::Sized_relobj): Initialize new fields.
10613 (Sized_relobj::include_section_group): Cast find_kept_object to
10614 Sized_relobj.
10615 (Sized_relobj::include_linkonce_section): Likewise.
10616 (Sized_relobj::do_layout): Use separate arrays for output section
10617 and output offset.
10618 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10619 output_sections.
10620 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10621 output_sections and section_offsets.
10622 (Sized_relobj::write_local_symbols): Likewise.
10623 (map_to_kept_section): Compute output address directly.
10624 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10625 output_sections and section_offsets.
10626 (Sized_relobj::write_sections): Likewise.
10627 (Sized_relobj::relocate_sections): Likewise.
10628 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10629 * output.h (class Output_reloc): Update declarations. Change
10630 u2_.relobj to Sized_relobj*.
10631 (class Output_data_reloc): Change add functions to use
10632 Sized_relobj*.
10633 * output.cc (Output_reloc::Output_reloc): Change relobj to
10634 Sized_relobj*.
10635 (Output_reloc::local_section_offset): Change return type to
10636 Elf_Addr. Use get_output_section_offset.
10637 (Output_reloc::get_address): Likewise.
10638 (Output_section::is_input_address_mapped): Don't call
10639 is_section_specially_mapped.
10640 (Output_section::output_offset): Likewise.
10641 (Output_section::output_address): Likewise.
10642 (Output_section::starting_output_address): Likewise.
10643 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10644 parameter to Sized_relobj*.
10645 (Copy_relocs::need_copy_reloc): Likewise.
10646 (Copy_relocs::save): Likewise.
10647 * copy-relocs.h (class Copy_relocs): Update declarations.
10648 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10649 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10650 * target-reloc.h (relocate_for_relocatable): Change
10651 offset_in_output_section type to Elf_Addr. Change code that uses
10652 it as well.
10653 * layout.cc (Layout::layout): Always set *off.
10654 * mapfile.cc (Mapfile::print_input_section): Use
10655 output_section_offset.
10656 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10657 Sized_relobj*.
10658 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10659 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10660 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10661
5cb66f97
ILT
106622008-07-03 Ian Lance Taylor <iant@google.com>
10663
10664 * layout.cc (Layout::include_section): Do not discard unrecognized
10665 SHT_STRTAB sections.
10666
afe47622
CS
106672008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10668
10669 * script.cc (Lex::can_continue_name): Make '?' allowable in
10670 version-script names.
10671 * testsuite/version_script.map: Change glob pattern to use '?'
10672
5adf9721
ILT
106732008-06-30 Manish Singh <yosh@gimp.org>
10674
10675 PR 6585
10676 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10677 Correct typo.
10678
e6fde208
ILT
106792008-06-30 Ian Lance Taylor <iant@google.com>
10680
10681 PR 6660
10682 PR 6682
10683 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10684 versions]: Don't try to read the value in the contents, since we
10685 don't use it. Use the template endianness when writing.
10686
3f2e6a2d
CC
106872008-06-25 Cary Coutant <ccoutant@google.com>
10688
10689 * fileread.cc (File_read::make_view): Assert on zero-length view.
10690 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10691 symbol table when there are no symbols to read.
10692
c43d3a48
CS
106932008-06-23 Craig Silverstein <csilvers@google.com>
10694
10695 * version.cc (version_string): Bump to 1.7
10696
5f494ea0
CS
106972008-06-18 Craig Silverstein <csilvers@google.com>
10698
10699 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10700 constant 0xFFFF to type Valtype.
10701 (Powerpc_relocate_functions::rel16_ha): Likewise.
10702
c42e122e
ILT
107032008-06-17 Ian Lance Taylor <iant@google.com>
10704
f34787f8
ILT
10705 * output.h (Output_section::Input_section): Initialize p2align_ to
10706 zero for Output_section_data constructors.
10707 (Output_section::Input_section::addralign): If not an input
10708 section, return the alignment of the Output_section_data.
10709 * testsuite/copy_test.cc: New file.
10710 * testsuite/copy_test_1.cc: New file.
10711 * testsuite/copy_test_2.cc: New file.
10712 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10713 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10714 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10715 (copy_test_1_pic.o, copy_test_1.so): New targets.
10716 (copy_test_2_pic.o, copy_test_2.so): New targets.
10717 * testsuite/Makefile.in: Rebuild.
10718
c42e122e
ILT
10719 * script-sections.cc (Script_sections::place_orphan): Initialize
10720 local variable exact.
10721
ce3ac18a
DE
107222008-06-13 David Edelsohn <edelsohn@gnu.org>
10723
10724 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10725
42cacb20
DE
107262008-06-12 David Edelsohn <edelsohn@gnu.org>
10727 David S. Miller <davem@davemloft.net>
10728
10729 * powerpc.cc: New file.
10730 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10731 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10732 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10733 * Makefile.in: Rebuild.
10734
7b308235
ILT
107352008-06-09 Ian Lance Taylor <iant@google.com>
10736
10737 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10738 <exception>.
10739 (throwing, orig_terminate): New static variables.
10740 (terminate_handler): New static function.
10741 (t2): Set terminate handler.
10742
f0b886e3
ILT
107432008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10744
10745 PR 6584
cd536b21 10746 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
10747 alignment.
10748
3e90f135
CC
107492008-05-30 Cary Coutant <ccoutant@google.com>
10750
10751 * archive.cc (Archive::include_all_members) Correct to step
10752 over symbol table and extended name table in thin archives.
10753
e09ad04a
ILT
107542008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10755
10756 PR 6407
10757 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10758 calculation.
10759
62b01cb5
ILT
107602008-05-28 Caleb Howe <cshowe@google.com>
10761
10762 * reduced_debug_output.cc: New file.
10763 * reduced_debug_output.h: New file.
92de84a6 10764 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
10765 * options.cc (General_options::finalize): Add strip_debug_non_line
10766 to the strip heirarchy.
10767 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10768 fields.
10769 * layout.cc: Include "reduced_debug_output.h".
10770 (Layout::Layout): Initialize new fields.
10771 (line_only_debug_sections): New static array.
10772 (is_lines_only_debug_sections): New static inline function.
10773 (Layout::include_section): Handle --strip-debug-non-line.
10774 (Layout::make_output_section): If --strip-debug-non-line, build
10775 new output sections for .debug_abbrev and .debug_info.
10776 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10777 gold. Warn about possible overflow.
10778 (read_signed_LEB_128): Likewise.
10779 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10780 (read_signed_LEB_128): Declare.
10781 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10782 (HFILES): Add reduced_debug_output.h.
10783 * Makefile.in: Rebuild.
10784
7d9e3d98
ILT
107852008-05-21 Ian Lance Taylor <iant@google.com>
10786
10787 * mapfile.cc: New file.
10788 * mapfile.h: New file.
10789 * options.h (class General_options): Add -M/--print-map and -Map.
10790 * options.cc (General_options::finalize): Make -M equivalent to
10791 -Map -.
10792 * main.cc: Include <cstdio> and "mapfile.h".
10793 (main): Open mapfile if requested.
10794 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10795 constructor. Change caller.
10796 (queue_initial_tasks): Add mapfile parameter. Change caller.
10797 (queue_middle_tasks): Likewise.
10798 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10799 declarations.
10800 * archive.cc: Include "mapfile.h".
10801 (Archive::add_symbols): Add mapfile parameter. Change all
10802 callers. Pass mapfile, symbol, and reason to include_member.
10803 (Archive::include_all_members): Add mapfile parameter. Change all
10804 callers.
10805 (Archive::include_member): Add mapfile, sym, and why parameters.
10806 Change all callers. Report inclusion to map file.
10807 * archive.h: Include "fileread.h".
10808 (class Archive): Update declarations.
10809 (Archive::file): New const method.
10810 (class Add_archive_symbols): Add mapfile_ field. Update
10811 constructor. Change all callers.
10812 * readsyms.h (class Read_symbols): Likewise.
10813 (class Finish_group): Likewise.
10814 (class Read_script): Likewise.
10815 * common.cc: Include "mapfile.h".
10816 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10817 all callers.
10818 (Symbol_table::do_allocate_commons): Likewise.
10819 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10820 symbol allocation to mapfile.
10821 * common.h (class Allocate_commons_task): Add mapfile_ field.
10822 Update constructor. Change all callers.
10823 * symtab.h (class Symbol_table): Update declarations.
10824 * layout.cc: Include "mapfile.h".
10825 (Layout_task_runner::run): Print information to mapfile.
10826 (Layout::create_gold_note): Change Output_data_fixed_space to
10827 Output_data_zero_fill.
10828 (Layout::create_build_id): Likewise.
10829 (Layout::print_to_mapfile): New function.
10830 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10831 constructor. Change caller.
10832 (class Layout): Declare print_to_mapfile.
10833 * output.cc (Output_section::Input_section::print_to_mapfile): New
10834 function.
10835 (Output_section::add_input_section): If producing a map, always
10836 add to input_sections_ list.
10837 (Output_section::do_print_to_mapfile): New function.
10838 (Output_segment::print_sections_to_mapfile): New function.
10839 (Output_segment::print_section_list_to_mapfile): New function.
10840 * output.h: Include "mapfile.h".
10841 (Output_data::print_to_mapfile): New function.
10842 (Output_data::do_print_to_mapfile): New virtual function.
10843 (Output_segment_headers::do_print_to_mapfile): New function.
10844 (Output_file_header::do_print_to_mapfile): New function.
10845 (Output_data_const::do_print_to_mapfile): New function.
10846 (class Output_data_const_buffer): Add map_name_ field. Update
10847 constructor. Change all callers. Add do_print_to_mapfile
10848 function.
10849 (class Output_data_fixed_space): Likewise.
10850 (class Output_data_space): Likewise.
10851 (class Output_data_zero_fill): New class.
10852 (Output_data_strtab::do_print_to_mapfile): New function.
10853 (Output_data_reloc_base::do_print_to_mapfile): New function.
10854 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10855 (Output_data_group::do_print_to_mapfile): New function.
10856 (Output_data_got::do_print_to_mapfile): New function.
10857 (Output_data_dynamic::do_print_to_mapfile): New function.
10858 (Output_symtab_xindex::do_print_to_mapfile): New function.
10859 (class Output_section): Declare do_print_to_mapflie. Declare
10860 print_to_mapfile in Input_section.
10861 (class Output_segment): Declare new functions.
10862 * object.h (Sized_relobj::symbol_count): New function.
10863 * script-sections.cc
10864 (Output_section_element_dot_assignment::set_section_addresses):
10865 Change Output_data_fixed_space to Output_data_zero_fill.
10866 (Output_data_expression::do_print_to_mapfile): New function.
10867 * script.cc (read_input_script): Add mapfile parameter. Change
10868 all callers.
10869 * script.h (read_input_script): Update declaration.
10870 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10871 (Eh_frame::do_print_to_mapfile): New function.
10872 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10873 (Output_merge_string::do_print_to_mapfile): New function.
10874 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10875 function.
10876 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10877 function.
10878 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10879 function.
10880 * Makefile.am (CCFILES): Add mapfile.cc.
10881 (HFILES): Add mapfile.h.
10882 * Makefile.in: Rebuild.
10883
9f1d377b
ILT
108842008-05-19 Ian Lance Taylor <iant@google.com>
10885
10886 * options.h (class General_options): Add -z relro.
10887 * layout.cc (Layout::Layout): Initialize relro_segment_.
10888 (Layout::add_output_section_data): Return the output section.
10889 (Layout::make_output_section): Rcognize relro sections and mark
10890 them appropriately.
10891 (Layout::attach_allocated_section_to_segment): Put relro sections
10892 in a PT_GNU_RELRO segment.
10893 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10894 section as relro.
10895 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10896 PT_TLS segments.
10897 (Layout::linkonce_mapping): Map d.rel.ro.local to
10898 .data.rel.ro.local.
10899 (Layout::output_section_name): Us .data.rel.ro.local for any
10900 section which begins with that.
10901 * layout.h (class Layout): Update add_output_section_data
10902 declaration. Add relro_segment_ field.
10903 * output.cc (Output_section::Output_section): Initialize is_relro_
10904 and is_relro_local_ fields.
10905 (Output_segment::add_output_section): Group relro sections.
10906 (Output_segment::is_first_section_relro): New function.
10907 (Output_segment::maximum_alignment): If there is a relro section,
10908 align the segment to the common page size.
10909 (Output_segment::set_section_addresses): Track whether we are
10910 looking at relro sections. If the last section is a relro
10911 section, align to the common page size.
10912 (Output_segment::set_section_list_addresses): Add in_relro
10913 parameter. Change all callers. Align to the page size when
10914 moving from relro to non-relro section.
10915 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10916 segment.
10917 * output.h (class Output_section): Add is_relro_ and
10918 is_relro_local_ fields.
10919 (Output_section::is_relro): New function.
10920 (Output_section::set_is_relro): New function.
10921 (Output_section::is_relro_local): New function.
10922 (Output_section::set_is_relro_local): New function.
10923 (class Output_segment): Update declarations.
10924 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10925 * sparc.cc (Target_sparc::got_section): Likewise.
10926 * x86_64.cc (Target_x86_64::got_section): Likewise.
10927 * testsuite/relro_test_main.cc: New file.
10928 * testsuite/relro_test.cc: New file.
10929 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10930 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10931 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10932 (relro_test.so, relro_test_pic.o): New targets.
10933 * testsuite/Makefile.in: Rebuild.
10934
a984ee1d
ILT
109352008-05-16 Ian Lance Taylor <iant@google.com>
10936
01676dcd
ILT
10937 * output.cc (Output_segment::add_output_section): Remove front
10938 parameter.
10939 * output.h (class Output_segment): Remove
10940 add_initial_output_section and overloaded add_output_section.
10941 Update declaration of remaining add_output_section.
10942 * layout.cc (Layout::create_interp): Call add_output_section
10943 rather than add_initial_output_section.
10944 (Layout::finish_dynamic_section): Likewise.
10945
497897f9
ILT
10946 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10947 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10948 know the dynamic type.
10949 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10950 field. Initialize it in constructor.
10951 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10952 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10953 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10954 reloc.
10955
a984ee1d
ILT
10956 * output.cc (Output_reloc::get_address): Change return type to
10957 Elf_Addr.
10958 * output.h (class Output_reloc): Update get_address declaration.
10959 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10960 for section addresses.
10961
55ba0940
ILT
109622008-05-09 Ian Lance Taylor <iant@google.com>
10963
10964 PR 6493
10965 * gold.cc (gold_nomem): Use return value of write.
10966
75517b77
ILT
109672008-05-08 Ian Lance Taylor <iant@google.com>
10968
10969 * symtab.c (Symbol::init_base_output_data): Add version
10970 parameter. Change all callers.
10971 (Symbol::init_base_output_segment): Likewise.
10972 (Symbol::init_base_constant): Likewise.
10973 (Symbol::init_base_undefined): Likewise.
10974 (Sized_symbol::init_output_data): Likewise.
10975 (Sized_symbol::init_output_segment): Likewise.
10976 (Sized_symbol::init_constant): Likewise.
10977 (Sized_symbol::init_undefined): Likewise.
10978 (Symbol_table::do_define_in_output_data): If the new symbol has a
10979 version, mark it as the default.
10980 (Symbol_table::do_define_in_output_segment): Likewise.
10981 (Symbol_table::do_define_as_constant): Likewise.
10982 * symtab.h (class Symbol): Update declarations.
10983 (class Sized_symbol): Likewise.
10984 * resolve.cc (Symbol::override_version): New function.
c42e122e 10985 (Symbol::override_base): Call override_version.
75517b77
ILT
10986 (Symbol::override_base_with_special): Likewise.
10987 * testsuite/ver_script_8.script: New file.
10988 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10989 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10990 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10991 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10992
f1f70eae
ILT
109932008-05-06 Ian Lance Taylor <iant@google.com>
10994
f3e9c5c5
ILT
10995 PR 6049
10996 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10997 functions.
10998 (class General_options): Remove existing --undefined, and add
10999 --no-undefined instead. Add new --undefined as synonym for -u.
11000 * archive.cc (Archive::add_symbols): Check whether symbol was
11001 named with -u.
11002 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11003 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11004 all uses. Add IS_UNDEFINED. Update declarations to split
11005 different versions of init_base. Declare init_base_undefined.
11006 (Symbol::is_defined): Handle IS_UNDEFINED.
11007 (Symbol::is_undefined): Likewise.
11008 (Symbol::is_weak_undefined): Call is_undefined.
11009 (Symbol::is_absolute): Handle IS_CONSTANT.
11010 (class Sized_symbol): Update declarations to split different
11011 versions of init. Declare init_undefined.
11012 (class Symbol_table): Declare new functions.
11013 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11014 Change all callers.
11015 (Symbol::init_base_output_data): Likewise.
11016 (Symbol::init_base_output_segment): Likewise.
11017 (Symbol::init_base_constant): Likewise.
11018 (Symbol::init_base_undefined): New function.
11019 (Sized_symbol::init_object): Rename from init. Change all
11020 callers.
11021 (Sized_symbol::init_output_data): Likewise.
11022 (Sized_symbol::init_output_segment): Likewise.
11023 (Sized_symbol::init_constant): Likewise.
11024 (Sized_symbol::init_undefined): New function.
11025 (Symbol_table::add_undefined_symbols_from_command_line): New
11026 function.
11027 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11028 function.
11029 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11030 (Symbol::output_section): Likewise.
11031 (Symbol::set_output_section): Likewise.
11032 (Symbol_table::sized_finalize_symbol): Likewise.
11033 (Symbol_table::sized_write_globals): Likewise.
11034 * resolve.cc (Symbol_table::should_override): Likewise.
11035 (Symbol::override_base_with_special): Likewise.
11036
8bdcdf2c
ILT
11037 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11038 symbol, change it to have default visibility.
11039 * testsuite/protected_1.cc: New file.
11040 * testsuite/protected_2.cc: New file.
11041 * testsuite/protected_3.cc: New file.
11042 * testsuite/protected_main_1.cc: New file.
11043 * testsuite/protected_main_2.cc: New file.
11044 * testsuite/protected_main_3.cc: New file.
11045 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11046 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11047 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11048 (protected_1.so): New target.
11049 (protected_1_pic.o, protected_2_pic.o): New targets.
11050 (protected_3_pic.o): New target.
11051 (check_PROGRAMS): Add protected_2.
11052 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11053 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11054 * testsuite/Makefile.in: Rebuild.
11055
2b706932
ILT
11056 * options.h (DEFINE_var): Add set_user_set_##varname__.
11057 (DEFINE_bool_alias): New macro.
11058 (class General_options): Define -Bstatic using DEFINE_bool_alias
11059 rather than DEFINE_special. Add --undefined as an alias for -z
11060 defs.
11061 * options.cc (General_options::parse_Bstatic): Remove.
11062
d82a5bcc
ILT
11063 * options.h (class General_options): Add --fatal-warnings.
11064 * main.cc (main): Implement --fatal-warnings.
11065 * errors.h (Errors::warning_count): New function.
11066
f1f70eae
ILT
11067 * options.h (class General_options): Add -Bsymbolic-functions.
11068 * symtab.h (Symbol::is_preemptible): Check for
11069 -Bsymbolic-functions.
11070
8825ac63
ILT
110712008-05-05 Ian Lance Taylor <iant@google.com>
11072
d98bc257
ILT
11073 * options.h (DEFINE_bool): For DASH_Z, create the negative option
11074 as noVARNAME rather than no-VARNAME.
11075 (class General_options): Add option -z combreloc.
11076 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
11077 get_address.
11078 (Output_reloc::sort_before) [SHT_REL]: New function.
11079 (Output_reloc::sort_before) [SHT_RELA]: New function.
11080 (class Output_data_reloc_base): Add sort_relocs_ field. Define
11081 Sort_relocs_comparison.
11082 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
11083 parameter. Change all callers.
11084 (Output_data_reloc::Output_data_reloc) [both versions]: Add
11085 sort_relocs parameter. Change all callers.
11086 * output.cc (Output_reloc::get_address): New function, broken out
11087 of write_rel.
11088 (Output_reloc::write_rel): Call it.
11089 (Output_reloc::compare): New function.
11090 (Output_data_reloc_base::do_write): Optionally sort relocs.
11091
60b2b4e7
ILT
11092 * configure.ac: If targ_extra_obj is set, link it in.
11093 * configure.tgt: Initialize all variables.
11094 (x86_64*): Set targ_extra_obj and targ_extra_size.
11095 * configure: Rebuild.
11096
8825ac63
ILT
11097 * object.cc (Sized_relobj::include_section_group): Adjust section
11098 indexes read from group data. Build vector to pass to
11099 layout_group.
11100 * layout.cc (Layout::layout_group): Add flags and shndxes
11101 parameters. Remove contents parameter. Change caller. Update
11102 explicit instantiations.
11103 * layout.h (class Layout): Update layout_group declaration.
11104 * output.cc (Output_data_group::Output_data_group): Add flags and
11105 input_shndxes parameters. Remove contents parameter. Change
11106 caller.
11107 (Output_data_group::do_write): Change input_sections_ to
11108 input_shndxes_.
11109 * output.h (class Output_data_group): Update constructor
11110 declaration. Rename input_sections_ to input_shndxes_.
11111 * testsuite/many_sections_test.cc: Add template.
11112
e94cf127
CC
111132008-04-30 Cary Coutant <ccoutant@google.com>
11114
4418b2d5
CC
11115 * target-reloc.h (relocate_section): Fix dead-pointer bug.
11116
e94cf127
CC
11117 * layout.cc (Layout::include_section): Refactored check for debug
11118 info section.
11119 (Layout::add_comdat): Add new parameters. Change type
11120 of signature parameter. Add object and shndx to signatures table.
11121 (Layout::find_kept_object): New function.
11122 * layout.h: Include <cstring>.
11123 (Layout::is_debug_info_section): New function.
11124 (Layout::add_comdat): Add new parameters.
11125 (Layout::find_kept_object): New function.
11126 (Layout::Kept_section): New struct.
11127 (Layout::Signatures): Change type of map range.
11128 * object.cc (Relobj::output_section_address): New function.
11129 (Sized_relobj::include_section_group): Add new parameters. Change
11130 calls to Layout::add_comdat. Change to build table of kept comdat
11131 groups and table mapping discarded sections to kept sections.
11132 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
11133 (Sized_relobj::do_layout): Change calls to include_section_group and
11134 include_linkonce_section.
11135 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
11136 value to zero when section is discarded.
11137 (Sized_relobj::map_to_kept_section): New function.
11138 * object.h (Relobj::output_section_address): New function.
11139 (Relobj::Comdat_group): New type.
11140 (Relobj::find_comdat_group): New function.
11141 (Relobj::Comdat_group_table): New type.
11142 (Relobj::Kept_comdat_section): New type.
11143 (Relobj::Kept_comdat_section_table): New type.
11144 (Relobj::add_comdat_group): New function.
11145 (Relobj::set_kept_comdat_section): New function.
11146 (Relobj::get_kept_comdat_section): New function.
11147 (Relobj::comdat_groups_): New field.
11148 (Relobj::kept_comdat_sections_): New field.
11149 (Symbol_value::input_value): Update comment.
11150 (Sized_relobj::map_to_kept_section) New function.
11151 (Sized_relobj::include_linkonce_section): Add new parameter.
11152 * target-reloc.h (Comdat_behavior): New type.
11153 (get_comdat_behavior): New function.
11154 (relocate_section): Add code to map a discarded section to the
11155 corresponding kept section when applying a relocation.
11156
e4e5049b
CS
111572008-04-30 Craig Silverstein <csilvers@google.com>
11158
11159 * dwarf_reader.cc (next_generation_count): New static var.
11160 (Addr2line_cache_entry): New struct.
11161 (addr2line_cache): New static var.
11162 (Dwarf_line_info::one_addr2line): Added caching.
11163 (Dwarf_line_info::clear_addr2line_cache): New function.
11164 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11165 cache-size parameter.
11166 (Dwarf_line_info::one_addr2line_cache): New function.
11167 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11168 new cache-size argument to one_addr2line(), and clear cache.
11169
d09e9154
CC
111702008-04-28 Cary Coutant <ccoutant@google.com>
11171
11172 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11173 R_386_PC8 relocations.
11174
7ef73768
ILT
111752008-04-23 Ian Lance Taylor <iant@google.com>
11176
55438702
ILT
11177 * object.cc (Sized_relobj::include_section_group): Check for
11178 invalid section group.
11179
c165fb93
ILT
11180 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11181 header size.
11182
7ef73768
ILT
11183 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11184 than read for file header.
11185 * archive.cc (Archive::include_member): Likewise.
11186
6194aaab
L
111872008-04-23 Paolo Bonzini <bonzini@gnu.org>
11188
11189 * aclocal.m4: Regenerate.
11190 * configure: Regenerate.
11191
d491d34e
ILT
111922008-04-19 Ian Lance Taylor <iant@google.com>
11193
5ea2bac6
ILT
11194 * version.cc (version_string): Bump to 1.6.
11195
7bc3e21a
ILT
11196 * testsuite/Makefile.am (many_sections_r_test): New target.
11197 (many_sections_r_test_SOURCES): Remove.
11198 (many_sections_r_test_DEPENDENCIES): Remove.
11199 (many_sections_r_test_LDFLAGS): Remove.
11200 (many_sections_r_test_LDADD): Remove.
11201
7fcd3aa9
ILT
11202 * object.cc (Sized_relobj::do_add_symbols): Always pass
11203 local_symbol_count_ to add_from_relobj.
11204
4c94d6ae
ILT
11205 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11206 every thousand variables.
11207 * testsuite/Makefile.in: Rebuild.
11208
d491d34e
ILT
11209 * object.cc (Xindex::initialize_symtab_xindex): New function.
11210 (Xindex::read_symtab_xindex): New function.
11211 (Xindex::sym_xindex_to_shndx): New function.
11212 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11213 available.
11214 (Sized_relobj::do_initialize_xindex): New function.
11215 (Sized_relobj::do_read_symbols): Adjust section links.
11216 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11217 parameter. Change all callers.
11218 (Sized_relobj::include_section_group): Adjust section links and
11219 symbol section indexes.
11220 (Sized_relobj::do_layout): Adjust section links.
11221 (Sized_relobj::do_count_local_symbols): Adjust section links and
11222 symbol section indexes.
11223 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11224 ordinary and special symbols.
11225 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11226 dynsym_xindex parameters. Change all callers. Adjust section
11227 links. Use SHN_XINDEX when needed.
11228 (Sized_relobj::get_symbol_location_info): Adjust section links.
11229 Don't get fooled by special symbols.
11230 * object.h (class Xindex): Define.
11231 (class Object): Add xindex_ parameter. Declare virtual functoin
11232 do_initialize_xindex.
11233 (Object::adjust_sym_shndx): New function.
11234 (Object::set_xindex): New protected function.
11235 (class Symbol_value): Add is_ordinary_shndx_ field.
11236 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11237 (Symbol_value::value): Assert ordinary section.
11238 (Symbol_value::initialize_input_to_output_map): Likewise.
11239 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11240 Change all callers.
11241 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11242 all callers.
11243 (class Sized_relobj): Update declarations.
11244 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11245 parameter. Change all callers.
11246 (Sized_relobj::adjust_shndx): New function.
11247 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11248 field.
11249 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11250 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11251 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11252 (Sized_dynobj::read_dynsym_section): Adjust section links.
11253 (Sized_dynobj::read_dynamic): Likewise.
11254 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11255 section links.
11256 (Sized_dynobj::do_initialize_xindex): New function.
11257 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11258 do_initialize_xindex.
11259 (Sized_dynobj::adjust_shndx): New function.
11260 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11261 dynsym_xindex_ fields.
11262 (Layout::finalize): Add a call to set_section_indexes before
11263 creating the symtab sections.
11264 (Layout::set_section_indexes): Don't do anything if the section
11265 already has a section index.
11266 (Layout::create_symtab_sections): Add shnum parameter. Change
11267 caller. Create .symtab_shndx section if needed.
11268 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11269 caller.
11270 (Layout::allocated_output_section_count): New function.
11271 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11272 needed.
11273 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11274 fields. Update declarations.
11275 (Layout::symtab_xindex): New function.
11276 (Layout::dynsym_xindex): New function.
11277 (class Write_symbols_task): Add layout_ field.
11278 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11279 Change caller.
11280 * output.cc (Output_section_headers::Output_section_headers): Add
11281 shstrtab_section parameter. Change all callers.
11282 (Output_section_headers::do_sized_write): Store overflow values
11283 for section count and section string table section index in
11284 section header zero.
11285 (Output_file_header::do_sized_write): Check for overflow of
11286 section count and section string table section index.
11287 (Output_symtab_xindex::do_write): New function.
11288 (Output_symtab_xindex::endian_do_write): New function.
11289 * output.h (class Output_section_headers): Add shstrtab_section_.
11290 Update declarations.
11291 (class Output_symtab_xindex): Define.
11292 (Output_section::has_out_shndx): New function.
11293 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11294 field.
11295 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11296 Change all callers.
11297 (Sized_symbol::init): Likewise.
11298 (Symbol::output_section): Check for ordinary symbol.
11299 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11300 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11301 callers.
11302 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11303 Change all callers. Simplify handling of symbols from sections
11304 not included in the link.
11305 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11306 distinction.
11307 (Weak_alias_sorter::operator()): Assert that symbols are
11308 ordinary.
11309 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11310 distinction.
11311 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11312 parameters. Change all callers.
11313 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11314 symbol distinction. Use SHN_XINDEX when needed.
11315 (Symbol_table::write_section_symbol): Add symtab_xindex
11316 parameter. Change all callers.
11317 (Symbol_table::sized_write_section_symbol): Likewise. Use
11318 SHN_XINDEX when needed.
11319 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11320 declarations.
11321 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11322 (Symbol::is_defined): Check is_ordinary.
11323 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11324 (Symbol::is_absolute, Symbol::is_common): Likewise.
11325 (class Sized_symbol): Update declarations.
11326 (class Symbol_table): Update declarations.
11327 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11328 parameters. Change all callers.
11329 (Sized_symbol::override): Likewise.
11330 (Symbol_table::override): Likewise.
11331 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11332 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11333 is_ordinary, and orig_st_shndx parameters. Change all callers.
11334 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11335 to be in an ordinary section.
11336 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11337 object and is_ordinary parameters. Change all callers.
11338 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11339 Change all callers. Don't add undefined or non-ordinary symbols
11340 to reloc_map_.
11341 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11342 Change all callers.
11343 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11344 declarations.
11345 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11346 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11347 (Sized_relobj::relocate_sections): Likewise.
11348 * target-reloc.h (scan_relocs): Adjust section symbol index.
11349 (scan_relocatable_relocs): Likewise.
11350 * i386.cc (Scan::local): Check for ordinary symbols.
11351 * sparc.cc (Scan::local): Likewise.
11352 * x86_64.cc (Scan::local): Likewise.
11353 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11354 to symbol_section_and_value.
11355 * testsuite/many_sections_test.cc: New file.
11356 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11357 (check_PROGRAMS): Add many_sections_test.
11358 (many_sections_test_SOURCES): Define.
11359 (many_sections_test_DEPENDENCIES): Define.
11360 (many_sections_test_LDFLAGS): Define.
11361 (BUILT_SOURCES): Add many_sections_define.h.
11362 (many_sections_define.h): New target.
11363 (BUILT_SOURCES): Add many_sections_check.h.
11364 (many_sections_check.h): New target.
11365 (check_PROGRAMS): Add many_sections_r_test.
11366 (many_sections_r_test_SOURCES): Define.
11367 (many_sections_r_test_DEPENDENCIES): Define.
11368 (many_sections_r_test_LDFLAGS): Define.
11369 (many_sections_r_test_LDADD): Define.
11370 (many_sections_r_test.o): New target.
11371 * testsuite/Makefile.in: Rebuild.
11372
c5818ff1
CC
113732008-04-17 Cary Coutant <ccoutant@google.com>
11374
11375 * errors.cc (Errors::info): New function.
11376 (gold_info): New function.
11377 * errors.h (Errors::info): New function.
11378 * gold.h (gold_info): New function.
11379 * object.cc (Input_objects::add_object): Print trace output.
11380 * options.cc (options::parse_set): New function.
11381 (General_options::parse_wrap): Deleted.
11382 (General_options::General_options): Deleted initializer.
11383 * options.h (options::String_set): New typedef.
11384 (options::parse_set): New function.
11385 (DEFINE_set): New macro.
11386 (General_options::wrap): Changed to use DEFINE_set. Changed
11387 callers of any_wrap_symbols and is_wrap_symbol.
11388 (General_options::trace, General_options::trace_symbol):
11389 New options.
11390 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11391 (General_options::wrap_symbols_): Deleted.
11392 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11393
b5be4a7c
DM
113942008-04-17 David S. Miller <davem@davemloft.net>
11395
11396 * options.cc (General_options::parse_V): New function.
11397 * options.h: Add entries for -V and -Qy.
11398
155a0dd7
ILT
113992008-04-17 Ian Lance Taylor <iant@google.com>
11400
11401 * common.cc (Symbol_table::allocate_commons): Remove options
11402 parameter. Change caller.
11403 (Symbol_table::do_allocate_commons): Remove options parameter.
11404 Change caller. Just call do_allocate_commons_list twice.
11405 (Symbol_table::do_allocate_commons_list): New function, broken out
11406 of do_allocate_commons.
11407 * common.h (class Allocate_commons_task): Remove options_ field.
11408 Update constructor.
11409 * symtab.cc (Symbol_table::Symbol_table): Initialize
11410 tls_commons_.
11411 (Symbol_table::add_from_object): Put TLS common symbols on
11412 tls_commons_ list.
11413 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11414 which are IN_OUTPUT_DATA.
11415 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11416 allocate_commons and do_allocate_commons declarations. Declare
11417 do_allocate_commons_list.
11418 * gold.cc (queue_middle_tasks): Update creation of
11419 Allocate_commons_task to not pass options.
11420 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11421 (TLS_TEST_C_FLAGS): New variable.
11422 (tls_test_c_pic.o): New target.
11423 (tls_test_shared.so): Link in tls_test_c_pic.o.
11424 (tls_test_c_pic_ie.o): New target.
11425 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11426 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11427 (tls_test_c.o): New target.
11428 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11429 (tls_pic_test_LDADD): Likewise.
11430 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11431 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11432 (tls_test_c_gnu2.o): New target.
11433 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11434 tls_test_c_gnu2.o.
11435 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11436 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11437 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11438 * testsuite/tls_test.cc: Include "config.h".
11439 (t_last): Call t11_last.
11440 * testsuite/tls_test.h (t11, t11_last): Declare.
11441 * testsuite/tls_test_c.c: New file.
11442 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11443 * configure.ac: Check for OpenMP support.
11444 * configure, config.in, Makefile.in: Rebuild.
11445 * testsuite/Makefile.in: Rebuild.
11446
edfbb029
CC
114472008-04-16 Cary Coutant <ccoutant@google.com>
11448
11449 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11450 (Target_i386::tls_base_symbol_defined_): New field.
11451 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11452 (Target_i386::Scan::global): Likewise.
11453 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11454 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11455 (Target_x86_64::tls_base_symbol_defined_): New field.
11456 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11457 (Target_x86_64::Scan::global): Likewise.
11458
f3c69fca
CC
114592008-04-16 Cary Coutant <ccoutant@google.com>
11460
11461 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11462 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11463 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11464 building shared libraries.
11465 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11466 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11467 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11468 * testsuite/Makefile.in: Rebuild.
11469 * testsuite/weak_undef.h: New file.
11470 * testsuite/weak_undef_file1.cc: Add extra test cases.
11471 * testsuite/weak_undef_file2.cc: Likewise.
11472 * testsuite/weak_undef_test.cc: Likewise.
11473
7c414435
DM
114742008-04-16 David S. Miller <davem@davemloft.net>
11475
32b769e1
DM
11476 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11477 Add issued_non_pic_error_ field. Declare check_non_pic.
11478 (Target_sparc::Scan::check_non_pic): New function.
11479 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11480 (Target_sparc::Scan::global): Likewise.
11481
11936fb1
DM
11482 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11483 * configure: Rebuild.
11484
7c414435
DM
11485 * options.h (DEFINE_enable): New macro.
11486 (new_dtags): New enable option.
11487 (initfirst, interpose, loadfltr, nodefaultlib,
11488 nodelete, nodlopen, nodump): New -z options.
11489 * layout.cc (Layout:finish_dynamic_section): If new
11490 dtags enabled, emit DT_RUNPATH. Also, emit a
11491 DT_FLAGS_1 containing any specified -z flags.
11492
85c7bf8b
ILT
114932008-04-16 Ian Lance Taylor <iant@google.com>
11494
12c0daef
ILT
11495 * copy-relocs.cc: New file.
11496 * copy-relocs.h: New file.
11497 * reloc.cc: Remove Copy_relocs code.
11498 * reloc.h: Likewise.
11499 * reloc-types.h (struct Reloc_types) [both versions]: Add
11500 get_reloc_addend_noerror.
11501 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11502 variants of add_global which take an addend which must be zero.
11503 * i386.cc: Include "copy-relocs.h".
11504 (class Target_i386): Change type of copy_relocs_ to variable,
11505 update initializer.
11506 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11507 Change all callers.
11508 (Target_i386::do_finalize_sections): Change handling of
11509 copy_relocs_.
11510 * sparc.cc: Include "copy-relocs.h".
11511 (class Target_sparc): Change type of copy_relocs_ to variable,
11512 update initializer.
11513 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11514 Change all callers.
11515 (Target_sparc::do_finalize_sections): Change handling of
11516 copy_relocs_.
11517 * x86_64.cc: Include "copy-relocs.h".
11518 (class Target_x86_64): Change type of copy_relocs_ to variable,
11519 update initializer.
11520 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11521 class. Change all callers.
11522 (Target_x86_64::do_finalize_sections): Change handling of
11523 copy_relocs_.
11524 * Makefile.am (CCFILES): Add copy-relocs.cc.
11525 (HFILES): Add copy-relocs.h.
11526
4f4995b6
ILT
11527 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11528
85c7bf8b
ILT
11529 * testsuite/script_test_4.sh: Permit leading zeroes.
11530
4f2a9edd
ILT
115312008-04-15 Ian Lance Taylor <iant@google.com>
11532
e6188289
ILT
11533 * script-sections.cc (Script_sections::create_segments): Use
11534 header_size_adjustment even when there is enough room for the
11535 headers.
11536 * testsuite/script_test_4.sh: New file.
11537 * testsuite/script_test_4.t: New file.
11538 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11539 (check_DATA): Add script_test_4.stdout.
11540 (MOSTLYCLEANFILES): Likewise.
11541 (script_test_4): New target.
11542 (script_test_4.stdout): New target.
11543 * testsuite/Makefile.in: Rebuild.
11544
4f2a9edd
ILT
11545 * sparc.cc: Add definitions for Output_data_plt_sparc class
11546 constants.
11547
f5314dd5
DM
115482008-04-14 David S. Miller <davem@davemloft.net>
11549
11550 * sparc.cc: New file.
11551 * Makefile.am (TARGETSOURCES): Add sparc.cc
11552 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11553 * configure.tgt: Document targ_extra_size and
11554 targ_extra_big_endian. Add entries for sparc-* and
11555 sparc64-*.
11556 * configure.ac: Handle targ_extra_size and
11557 targ_extra_big_endian.
11558 * Makefile.in: Rebuild.
11559 * configure: Likewise.
11560 * po/POTFILES.in: Likewise.
11561 * po/gold.pot: Likewise.
11562
154e0e9a
ILT
115632008-04-14 Ian Lance Taylor <iant@google.com>
11564
11565 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11566 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11567 in the name/type/flags to section mapping. Don't call
11568 allocate_output_section.
11569 (Layout::choose_output_section): Change parameter from adjust_name
11570 to is_input_section. Don't permit input sections after sections
11571 are attached to segments. Don't call allocate_output_section.
11572 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11573 not write_enable_output_section.
11574 (Layout::make_output_section): Don't push to
11575 unattached_section_list_ nor call attach_to_segment. Call
11576 attach_section_to_segment if sections are attached.
11577 (Layout::attach_sections_to_segments): New function.
11578 (Layout::attach_section_to_segment): New function.
11579 (Layout::attach_allocated_section_to_segment): Rename from
11580 attach_to_segment. Remove flags parameter.
11581 (Layout::allocate_output_section): Remove function.
11582 (Layout::write_enable_output_section): Remove function.
11583 * layout.h (class Layout): Update for above changes. Add new
11584 field sections_are_attached_.
11585 * output.h (Output_section::update_flags_for_input_section): New
11586 function.
11587 * output.cc (Output_section::add_input_section): Call
11588 update_flags_for_input_section.
11589 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11590
009a67a2
CC
115912008-04-11 Cary Coutant <ccoutant@google.com>
11592
11593 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11594 thought unnecessary.
11595 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11596
759b1a24
ILT
115972008-04-11 Ian Lance Taylor <iant@google.com>
11598
11599 * output.h (class Output_section_data): Remove inline definition
11600 of set_addralign.
11601 * output.cc (Output_section_data::set_addralign): New function.
11602
c2b45e22
CC
116032008-04-11 Cary Coutant <ccoutant@google.com>
11604
11605 Add support for TLS descriptors for i386 and x86_64.
11606 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11607 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11608 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11609 GOT_TYPE_TLS_DESC.
11610 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11611 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11612 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11613 relocations.
11614 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11615 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11616 Fix problem with initial-exec relocations.
11617 (Target_i386::Relocate::relocate_tls): Likewise.
11618 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11619 relaxation.
11620 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11621 support for section-plus-offset dynamic table entries.
11622 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11623 (Output_data_dynamic::Dynamic_entry): Add support for
11624 section-plus-offset dynamic table entries.
11625 (Output_data_dynamic::Classification): Likewise.
11626 (Output_data_dynamic::classification_): Renamed offset_.
11627 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11628 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11629 (Target_x86_64::make_plt_section): New function.
11630 (Target_x86_64::reserve_tlsdesc_entries): New function.
11631 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11632 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11633 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11634 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11635 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11636 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11637 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11638 add extra PLT entry for TLS descriptors.
11639 (Output_data_plt_x86_64::got_): New field.
11640 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11641 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11642 fields.
11643 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11644 descriptors.
11645 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11646 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11647 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11648 R_386_TLS_DESC_CALL relocations.
11649 (Target_x86_64::Scan::global): Likewise.
11650 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11651 for TLS descriptors.
11652 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11653 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11654 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11655 GD-to-IE relaxation.
11656 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11657 and TLS_DESCRIPTORS.
11658 * Makefile.in: Rebuild.
11659 * configure: Rebuild.
11660 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11661 (tls_test_shared2.so): New target.
11662 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11663 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11664 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11665 (tls_shared_gd_to_ie_test_LDADD): New variable.
11666 (tls_shared_gnu2_gd_to_ie_test): New target.
11667 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11668 New targets.
11669 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11670 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11671 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11672 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11673 (tls_shared_gnu2_test): New target.
11674 (tls_test_gnu2_shared.so): New target.
11675 (tls_shared_gnu2_test_SOURCES): New variable.
11676 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11677 (tls_shared_gnu2_test_LDFLAGS): New variable.
11678 (tls_shared_gnu2_test_LDADD): New variable.
11679 * testsuite/Makefile.in: Rebuild.
11680 * testsuite/Makefile.
11681
83bfb6b7
ILT
116822008-04-11 Ian Lance Taylor <iant@google.com>
11683
11684 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11685 justsyms.t.
11686 * testsuite/Makefile.in: Rebuild.
11687
11688 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11689 long.
11690 * testsuite/script_test_2.cc (main): Adjust test.
11691
706e1f5e
ILT
116922008-04-11 David S. Miller <davem@davemloft.net>
11693 Ian Lance Taylor <iant@google.com>
11694
11695 * options.h (General_options): Add entries for '-Y' and
11696 '-relax'.
11697 * options.cc (General_options:finalize): If -Y was used, add those
11698 entries to the library path instead of the default "/lib" and
11699 "/usr/lib".
11700
7c98e6bb
DM
117012008-04-11 David S. Miller <davem@davemloft.net>
11702
11703 * testsuite/justsyms.t: Start at 0x100.
11704 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
11705 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11706 long.
11707 * testsuite/script_test_2.cc: Adjust string and section length
11708 checks.
7c98e6bb 11709
99a37bfd
ILT
117102008-04-09 Ian Lance Taylor <iant@google.com>
11711
2cefc357
ILT
11712 PR gold/5996
11713 * script-sections.cc (Sections_element::allocate_to_segment): Add
11714 orphan parameter.
11715 (Output_section_definition::allocate_to_segment): Likewise.
11716 (Orphan_output_section::allocate_to_segment): Likewise.
11717 (Script_sections::attach_sections_using_phdrs_clause): Don't
11718 propagate non-PT_LOAD segments to orphan sections.
11719 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11720 readelf rather than objdump.
11721 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11722 .interp section and PT_INTERP segment are the same size.
11723 * testsuite/Makefile.in: Rebuild.
11724
99a37bfd
ILT
11725 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11726 aliases for symbols defined in the same object.
11727 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11728 (weak_alias_test_SOURCES): New variable.
11729 (weak_alias_test_DEPENDENCIES): New variable.
11730 (weak_alias_test_LDFLAGS): New variable.
11731 (weak_alias_test_LDADD): New variable.
11732 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11733 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11734 (weak_alias_test_3.o): New target.
11735 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11736 * testsuite/weak_alias_test_main.cc: New file.
11737 * testsuite/weak_alias_test_1.cc: New file.
11738 * testsuite/weak_alias_test_2.cc: New file.
11739 * testsuite/weak_alias_test_3.cc: New file.
11740
780e49c5
ILT
117412008-04-08 Ian Lance Taylor <iant@google.com>
11742
cdb0b8f5
ILT
11743 * options.h (class General_options): Add --noinhibit-exec option.
11744 * main.cc (main): Check --noinhibit-exec.
11745
0864d551
ILT
11746 * options.h (class General_options): Define --wrap as a special
11747 option. Add wrap_symbols_ field.
11748 (General_options::any_wrap_symbols): New function.
11749 (General_options::is_wrap_symbol): New function.
11750 * options.cc (General_options::parse_wrap): New function.
11751 (General_options::General_options): Initialize wrap_symbols_.
11752 * symtab.cc (Symbol_table::wrap_symbol): New function.
11753 (Symbol_table::add_from_object): Handle --wrap.
11754 * symtab.h (class Symbol_table): Declare wrap_symbol.
11755 * target.h (Target::wrap_char): New function.
11756 (Target::Target_info): Add wrap_char field.
11757 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11758 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11759 * testsuite/testfile.cc (Target_test::test_target_info):
11760 Likewise.
11761
789aa6de
ILT
11762 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11763 there is one.
11764
2c38906f
ILT
11765 * layout.h (class Layout): Add added_eh_frame_data_ field.
11766 * layout.cc (Layout::Layout): Initialize new field.
11767 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11768 output section until we find a section we merged successfully.
11769 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11770 that the size be non-zero.
11771
780e49c5
ILT
11772 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11773 qualifier.
11774
7fcd0256
ILT
117752008-04-08 Craig Silverstein <csilvers@google.com>
11776
11777 * configure.ac: Export new conditional variable HAVE_ZLIB.
11778 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11779 on HAVE_ZLIB.
11780 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11781 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11782
6835af53
ILT
117832008-04-07 Ian Lance Taylor <iant@google.com>
11784
e24f324c
ILT
11785 * version.cc (version_string): Set to "1.5".
11786
a036edd8
ILT
11787 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11788 Add issued_non_pic_error_ field. Declare check_non_pic.
11789 (Target_x86_64::Scan::check_non_pic): New function.
11790 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11791 (Target_x86_64::Scan::global): Likewise.
11792
624f8810
ILT
11793 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11794 addend parameter. Change caller. Handle merge sections.
11795 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11796 Address to Addend. Don't add in the result of
11797 local_section_offset, pass down the addend and use the returned
11798 value.
11799 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11800 Update declarations of local_section_offset and symbol_value.
11801 * testsuite/two_file_test_1.cc (t18): New function.
11802 * testsuite/two_file_test_2.cc (f18): New function.
11803 * testsuite/two_file_test_main.cc (main): Call t18.
11804 * testsuite/two_file_test.h (t18, f18): Declare.
11805
6835af53
ILT
11806 * configure.ac: Don't test for objdump, c++filt, or readelf.
11807 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11808 conditionals.
11809 (TEST_READELF): New variable.
11810 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11811 (check_PROGRAMS): Add two_file_strip_test.
11812 (two_file_strip_test): New target.
11813 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11814 (two_file_same_shared_strip_test_SOURCES): New variable.
11815 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11816 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11817 (two_file_same_shared_strip_test_LDADD): New variable.
11818 (two_file_shared_strip.so): New target.
11819 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11820 (ver_test_5.syms, ver_test_7.syms): Likewise.
11821 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11822 (strip_test_3.stdout): Use TEST_OBJDUMP.
11823 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11824
86925eef
CC
118252008-04-04 Cary Coutant <ccoutant@google.com>
11826
11827 * symtab.h (Symbol::is_weak_undefined): New function.
11828 (Symbol::is_strong_undefined): New function.
11829 (Symbol::is_absolute): New function.
11830 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11831 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11832 absolute symbols.
11833 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11834 (weak_undef_test): New target.
11835 * testsuite/Makefile.in: Rebuild.
11836 * testsuite/weak_undef_file1.cc: New file.
11837 * testsuite/weak_undef_file2.cc: New file.
11838 * testsuite/weak_undef_test.cc: New file.
11839
126f3ece
ILT
118402008-04-03 Craig Silverstein <csilvers@google.com>
11841
11842 * compressed_output.h (class Output_compressed_section): Use
11843 unsigned buffer.
11844 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11845 add zlib header.
11846 (zlib_compressed_suffix): Removed.
11847 (Output_compressed_section::set_final_data_size): Use unsigned
11848 buffers.
11849 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11850 Fix linker invocation.
11851 (flagstest_o_specialfile_and_compress_debug_sections):
11852 Likewise.
11853 * testsuite/Makefile.in: Regenerated.
11854
deae2a14
DM
118552008-04-02 David S. Miller <davem@davemloft.net>
11856
11857 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11858 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11859
70752818
ILT
118602008-04-02 Craig Silverstein <csilvers@google.com>
11861
11862 * TODO: New file.
11863
39d0cb0e
ILT
118642008-04-02 Ian Lance Taylor <iant@google.com>
11865
11866 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11867 parameters. Update for new key type to views_. Change all
11868 callers.
11869 (File_read::read): Adjust for byteshift in returned view.
11870 (File_read::add_view): New function, broken out of
11871 find_and_make_view.
11872 (File_read::make_view): New function, broken out of
11873 find_and_make_view.
11874 (File_read::find_or_make_view): Add offset and aligned
11875 parameters. Rewrite accordingly. Change all callers.
11876 (File_read::get_view): Add offset and aligned parameters. Adjust
11877 for byteshift in return value.
11878 (File_read::get_lasting_view): Likewise.
11879 * fileread.h (class File_read): Update declarations.
11880 (class File_read::View): Add byteshift_ field. Add byteshift to
11881 constructor. Add byteshift method.
11882 * archive.h (Archive::clear_uncached_views): New function.
11883 (Archive::get_view): Add aligned parameter. Change all callers.
11884 * object.h (Object::get_view): Add aligned parameter. Change all
11885 callers.
11886 (Object::get_lasting_view): Likewise.
11887
11888 * fileread.cc (File_read::release): Don't call clear_views if
11889 there are multiple objects.
11890 * fileread.h (File_read::clear_uncached_views): New function.
11891 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11892 on the archive.
11893
a1207466
CC
118942008-03-31 Cary Coutant <ccoutant@google.com>
11895
11896 Add thin archive support.
11897 * archive.cc (Archive::armagt): New const.
11898 (Archive::setup): Remove task parameter and calls to unlock.
11899 (Archive::unlock_nested_archives): New function.
11900 (Archive::read_header): Add nested_off parameter. Change
11901 all callers.
11902 (Archive::interpret_header): Likewise.
11903 (Archive::include_all_members): Change to handle thin
11904 archives.
11905 (Archive::include_member): Likewise.
11906 * archive.h (Archive::Archive): Add new parameters and
11907 initializers.
11908 (Archive::armagt): New const.
11909 (Archive::setup): Remove task parameter.
11910 (Archive::unlock_nested_archives): New function.
11911 (Archive::read_header): Add nested_off parameter.
11912 (Archive::interpret_header): Likewise.
11913 (Archive::Nested_archive_table): New typedef.
11914 (Archive::is_thin_archive_): New field.
11915 (Archive::nested_archives_): New field.
11916 (Archive::options_): New field.
11917 (Archive::dirpath_): New field.
11918 (Archive::task_): New field.
11919 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11920 for thin archives. Pass additional parameters to
11921 Archive::Archive. Unlock the archive file after calling
11922 Archive::setup.
cd536b21 11923
479f6503
ILT
119242008-03-29 Ian Lance Taylor <iant@google.com>
11925
686c8caf
ILT
11926 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11927 version symbol to be local.
11928 * testsuite/ver_test_4.sh: New file.
11929 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11930 (check_DATA): Add ver_test_4.syms.
11931 (ver_test_4.syms): New target.
11932 * testsuite/Makefile.in: Rebuild.
11933
ab794b6b
ILT
11934 * output.cc
11935 (Output_section::Input_section_sort_entry::has_priority): New
11936 function.
11937 (Output_section::Input_section_sort_entry::match_file_name): New
11938 function.
11939 (Output_section::Input_section_sort_entry::match_section_name):
11940 Remove.
11941 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11942 Remove.
11943 (Output_section::Input_section_sort_entry::match_section_file):
11944 Remove.
11945 (Output_section::Input_section_sort_compare::operator()): Rewrite
11946 using new Input_section_sort_entry functions. Sort crtbegin and
11947 crtend first. Sort sections with no priority before sections with
11948 a priority.
11949 * testsuite/initpri1.c (d3): Check j != 4.
11950 (cd5): New constructor/destructor function.
11951 (main): Check j != 2.
11952
479f6503
ILT
11953 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11954 new symbol when resolving, don't call set_is_default.
11955 * testsuite/ver_test_7.cc: New file.
11956 * testsuite/ver_test_7.sh: New file.
11957 * testsuite/Makefile.am (ver_test_7.so): New target.
11958 (ver_test_7.o): New target.
11959 (check_SCRIPTS): Add ver_test_7.sh.
11960 (check_DATA): Add ver_test_7.syms.
11961 (ver_test_7.syms): New target.
11962
2fd32231
ILT
119632008-03-28 Ian Lance Taylor <iant@google.com>
11964
11965 * layout.cc (Layout::layout): If we see an input section with a
11966 name that needs sorting, set the must_sort flag for the output
11967 section.
11968 (Layout::make_output_section): If the name of the output section
11969 indicates that it might require sorting, set the may_sort flag.
11970 * output.h (Output_section::may_sort_attached_input_sections): New
11971 function.
11972 (Output_section::set_may_sort_attached_input_sections): New
11973 function.
11974 (Output_section::must_sort_attached_input_sections): New
11975 function.
11976 (Output_section::set_must_sort_attached_input_sections): New
11977 function.
11978 (class Output_section): Declare Input_section_sort_entry. Define
11979 Input_section_sort_compare. Declare
11980 sort_attached_input_sections. Add new fields:
11981 may_sort_attached_input_sections_,
11982 must_sort_attached_input_sections_,
11983 attached_input_sections_are_sorted_.
11984 * output.cc (Output_section::Output_section): Initialize new
11985 fields.
11986 (Output_section::add_input_section): Add an entry to
11987 input_sections_ if may_sort or must_sort are true.
11988 (Output_section::set_final_data_size): Call
11989 sort_attached_input_sections if necessary.
11990 (Output_section::Input_section_sort_entry): Define new class.
11991 (Output_section::Input_section_sort_compare::operator()): New
11992 function.
11993 (Output_section::sort_attached_input_sections): New function.
11994 * configure.ac: Check whether the compiler supports constructor
11995 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11996 * testsuite/initpri1.c: New file.
11997 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11998 CONSTRUCTOR_PRIORITY.
11999 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12000 (initpri1_LDFLAGS): New variable.
12001 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12002
18e6b24e
ILT
120032008-03-27 Ian Lance Taylor <iant@google.com>
12004
49bdd526
ILT
12005 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12006 * testsuite/common_test_1.c: New file.
12007 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12008 (common_test_1_SOURCES): New variable.
12009 (common_test_1_DEPENDENCIES): New variable.
12010 (common_test_1_LDFLAGS): New variable.
12011
18e6b24e
ILT
12012 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12013 and commons_ correctly when NAME/VERSION does not override
12014 NAME/NULL.
12015 * testsuite/ver_test_6.c: New file.
12016 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12017 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12018 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12019
04bf7072
ILT
120202008-03-26 Ian Lance Taylor <iant@google.com>
12021
5871526f
ILT
12022 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12023 of an undefined symbol from a version script.
12024 * testsuite/Makefile.am (ver_test_5.so): New target.
12025 (ver_test_5.o): New target.
12026 (check_SCRIPTS): Add ver_test_5.sh.
12027 (check_DATA): Add ver_test_5.syms.
12028 (ver_test_5.syms): New target.
12029 * testsuite/ver_test_5.cc: New file.
12030 * testsuite/ver_test_5.script: New file.
12031 * testsuite/ver_test_5.sh: New file.
12032 * Makefile.in, testsuite/Makefile.in: Rebuild.
12033
04bf7072
ILT
12034 PR gold/5986
12035 Fix problems building gold with gcc 4.3.0.
12036 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12037 (gold_error_at_location, gold_warning_at_location): Use it.
12038 * configure.ac: Check whether we can compile and use a template
12039 function with a printf attribute.
12040 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12041 when jumping over bytes.
12042 * object.cc: Instantiate Object::read_section_data.
12043 * debug.h: Include <cstring>
12044 * dwarf_reader.cc: Include <algorithm>
12045 * main.cc: Include <cstring>.
12046 * options.cc: Include <cstring>.
12047 * output.cc: Include <cstring>.
12048 * script.cc: Include <cstring>.
12049 * script.h: Include <string>.
12050 * symtab.cc: Include <cstring> and <algorithm>.
12051 * target-select.cc: Include <cstring>.
12052 * version.cc: Include <string>.
12053 * testsuite/testmain.cc: Include <cstdlib>.
12054 * configure, config.in: Rebuild.
12055
874c5b28
ILT
120562008-03-25 Ian Lance Taylor <iant@google.com>
12057
819d6c3a
ILT
12058 * options.cc: Include "../bfd/bfdver.h".
12059 (options::help): Print bug reporting address.
12060
f4b2c6f5
ILT
12061 * version.cc (print_version): Adjust output for current value of
12062 BFD_VERSION_STRING.
12063
12064 * NEWS: New file.
12065
e96caa79
ILT
12066 * options.cc (options::help): Print list of supported targets.
12067 * target-select.h: Include <vector>.
12068 (class Target_selector): Make machine_, size_, and is_big_endian_
12069 fields const. Add bfd_name_ and instantiated_target_ fields.
12070 (Target_selector::Target_selector): Add bfd_name parameter.
12071 (Target_selector::recognize): Make non-virtual, call
12072 do_recognize.
12073 (Target_selector::recognize_by_name): Make non-virtual, call
12074 do_recognize_by_name.
12075 (Target_selector::supported_names): New function.
12076 (Target_selector::bfd_name): New function.
12077 (Target_selector::do_instantiate_target): New pure virtual
12078 function.
12079 (Target_selector::do_recognize): New virtual function.
12080 (Target_selector::do_recognize_by_name): New virtual function.
12081 (Target_selector::instantiate_target): New private function.
12082 (supported_target_names): Declare.
12083 * target-select.cc (Target_selector::Target_selector): Update for
12084 new parameter and fields.
12085 (select_target_by_name): Check that the name matches before
12086 calling recognize_by_name.
12087 (supported_target_names): New function.
12088 * i386.cc (class Target_selector_i386): Update Target_selector
12089 constructor call. Remove recognize and recognize_by_name. Add
12090 do_instantiate_target.
12091 * x86_64.cc (class Target_selector_x86_64): Likewise.
12092 * testsuite/testfile.cc (class Target_selector_test): Update for
12093 changes to Target_selector.
12094
874c5b28
ILT
12095 * README: Rewrite, with some notes on unsupported features.
12096
0a65a3a7
CC
120972008-03-24 Cary Coutant <ccoutant@google.com>
12098
12099 * i386.cc (Target_i386::Got_type): New enum declaration.
12100 (Target_i386::Scan::local): Updated callers of Output_data_got
12101 member functions.
12102 (Target_i386::Scan::global): Likewise.
12103 (Target_i386::Relocate::relocate): Likewise.
12104 (Target_i386::Relocate::relocate_tls): Likewise.
12105 * object.h (Got_offset_list): New class.
12106 (Sized_relobj::local_has_got_offset): Added got_type parameter.
12107 (Sized_relobj::local_got_offset): Likewise.
12108 (Sized_relobj::set_local_got_offset): Likewise.
12109 (Sized_relobj::local_has_tls_got_offset): Removed.
12110 (Sized_relobj::local_tls_got_offset): Removed.
12111 (Sized_relobj::set_local_tls_got_offset): Removed.
12112 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
12113 * output.cc (Output_data_got::add_global): Added got_type parameter.
12114 (Output_data_got::add_global_with_rel): Likewise.
12115 (Output_data_got::add_global_with_rela): Likewise.
12116 (Output_data_got::add_global_pair_with_rel): New function.
12117 (Output_data_got::add_global_pair_with_rela): New function.
12118 (Output_data_got::add_local): Added got_type parameter.
12119 (Output_data_got::add_local_with_rel): Likewise.
12120 (Output_data_got::add_local_with_rela): Likewise.
12121 (Output_data_got::add_local_pair_with_rel): New function.
12122 (Output_data_got::add_local_pair_with_rela): New function.
12123 (Output_data_got::add_global_tls): Removed.
12124 (Output_data_got::add_global_tls_with_rel): Removed.
12125 (Output_data_got::add_global_tls_with_rela): Removed.
12126 (Output_data_got::add_local_tls): Removed.
12127 (Output_data_got::add_local_tls_with_rel): Removed.
12128 (Output_data_got::add_local_tls_with_rela): Removed.
12129 * output.h (Output_data_got::add_global): Added got_type parameter.
12130 (Output_data_got::add_global_with_rel): Likewise.
12131 (Output_data_got::add_global_with_rela): Likewise.
12132 (Output_data_got::add_global_pair_with_rel): New function.
12133 (Output_data_got::add_global_pair_with_rela): New function.
12134 (Output_data_got::add_local): Added got_type parameter.
12135 (Output_data_got::add_local_with_rel): Likewise.
12136 (Output_data_got::add_local_with_rela): Likewise.
12137 (Output_data_got::add_local_pair_with_rel): New function.
12138 (Output_data_got::add_local_pair_with_rela): New function.
12139 (Output_data_got::add_global_tls): Removed.
12140 (Output_data_got::add_global_tls_with_rel): Removed.
12141 (Output_data_got::add_global_tls_with_rela): Removed.
12142 (Output_data_got::add_local_tls): Removed.
12143 (Output_data_got::add_local_tls_with_rel): Removed.
12144 (Output_data_got::add_local_tls_with_rela): Removed.
12145 * resolve.cc (Symbol::override_base_with_special): Removed
12146 reference to has_got_offset_ field.
12147 * symtab.cc (Symbol::init_fields): Replaced initialization
12148 of got_offset_ with got_offsets_. Removed initialization
12149 of has_got_offset_
53fcba31 12150 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
12151 (Symbol::got_offset): Likewise.
12152 (Symbol::set_got_offset): Likewise.
12153 (Symbol::has_tls_got_offset): Removed.
12154 (Symbol::tls_got_offset): Removed.
12155 (Symbol::set_tls_got_offset): Removed.
12156 (Symbol::got_offset_): Removed.
12157 (Symbol::tls_mod_got_offset_): Removed.
12158 (Symbol::tls_pair_got_offset_): Removed.
12159 (Symbol::got_offsets_): New field.
12160 (Symbol::has_got_offset): Removed.
12161 (Symbol::has_tls_mod_got_offset): Removed.
12162 (Symbol::has_tls_pair_got_offset): Removed.
12163 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12164 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12165 member functions.
12166 (Target_x86_64::Scan::global): Likewise.
12167 (Target_x86_64::Relocate::relocate): Likewise.
12168 (Target_x86_64::Relocate::relocate_tls): Likewise.
12169
bd52eafb
BE
121702008-03-25 Ben Elliston <bje@au.ibm.com>
12171
12172 * yyscript.y: Fix spelling error in comment.
12173
8b105e34
ILT
121742008-03-24 Ian Lance Taylor <iant@google.com>
12175
8ed814a9
ILT
12176 * options.h (class General_options): Define build_id option.
12177 * layout.h (class Layout): Declare write_build_id, create_note,
12178 create_build_id. Add build_id_note_ member.
12179 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12180 "libiberty.h", "md5.h", "sha1.h".
12181 (Layout::Layout): Initialize eh_frame_data_,
12182 eh_frame_hdr_section_, and build_id_note_.
12183 (Layout::finalize): Call create_build_id.
12184 (Layout::create_note): New function, broken out of
12185 Layout::create_gold_note.
12186 (Layout::create_gold_note): Call create_note.
12187 (Layout::create_build_id): New function.
12188 (Layout::write_build_id): New function.
12189 (Close_task_runner::run): Call write_build_id.
12190
8b105e34
ILT
12191 * x86_64.cc: Correct license to GPLv3.
12192
086a1841
ILT
121932008-03-23 Ian Lance Taylor <iant@google.com>
12194
12195 * options.cc: Include "demangle.h".
12196 (parse_optional_string): New function.
12197 (parse_long_option): Handle takes_optional_argument.
12198 (parse_short_option): Update dash_z initializer. Handle
12199 takes_optional_argument.
12200 (General_options::General_options): Initialize do_demangle_.
12201 (General_options::finalize): Set do_demangle_. Handle demangling
12202 style.
12203 * options.h (parse_optional_string): Declare.
12204 (struct One_option): Add optional_arg field. Update constructor.
12205 Update call constructor calls. Add takes_optional_argument
12206 function.
12207 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12208 (DEFINE_optional_string): Define.
12209 (General_options::demangle): Change from DEFINE_bool to
12210 DEFINE_optional_string.
12211 (General_options::no_demangle): New function.
12212 (General_options::do_demangle): New function.
12213 (General_options::set_do_demangle): New function.
12214 (General_options::execstack_status_): Move definition to end of
12215 class definition.
12216 (General_options::static_): Likewise.
12217 (General_options::do_demangle_): New field.
12218 * object.cc (big_endian>::get_symbol_location_info): Call
12219 Options::do_demangle, not Options::demangle.
12220 * symtab.cc (demangle): Likewise.
12221
cbb93e63
ILT
122222008-03-22 Ian Lance Taylor <iant@google.com>
12223
12224 * gold.h: Include <cstddef> and <sys/types.h>
12225 * options.h: Include <cstring>.
12226
ec531623
ILT
122272008-03-21 Ian Lance Taylor <iant@google.com>
12228
12229 * Added source code to GNU binutils.
This page took 0.755198 seconds and 4 git commands to generate.