*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
403a3331
CC
12011-09-26 Cary Coutant <ccoutant@google.com>
2
3 * gold/gold.cc (queue_initial_tasks): Move option checks ...
4 * gold/options.cc (General_options::finalize): ... to here. Disable
5 some options; make others fatal.
6
235061c2
CC
72011-09-26 Cary Coutant <ccoutant@google.com>
8
9 gcc PR lto/47247
10 * plugin.cc (get_symbols_v2): New function.
11 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
12 (is_referenced_from_outside): New function.
13 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
14 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
15 (get_symbols): Pass version parameter.
16 (get_symbols_v2): New function.
17 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
18 parameter.
19 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
20 (onload): Add LDPT_GET_SYMBOLS_V2.
21 (all_symbols_read_hook): Use get_symbols_v2; check for
22 LDPR_PREVAILING_DEF_IRONLY_EXP.
23 * testsuite/plugin_test_3.sh: Update expected results.
24
dc87f620
ILT
252011-09-23 Simon Baldwin <simonb@google.com>
26
27 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
28 configuration options.
29 * configure: Regenerate.
30 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
31 * Makefile.in: Regenerate.
32 * testsuite/Makefile.in: Regenerate.
33
a8279f82
ST
342011-09-19 Sriraman Tallam <tmsriram@google.com>
35
36 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
37
0c9350c8
CC
382011-09-19 Cary Coutant <ccoutant@google.com>
39
40 * incremental.cc (can_incremental_update): Fix typo in comment.
41 * incremental.h (can_incremental_update): Likewise.
42
aa06ae28
CC
432011-09-18 Cary Coutant <ccoutant@google.com>
44
45 * incremental.cc (can_incremental_update): New function.
46 * incremental.h (can_incremental_update): New function.
47 * layout.cc (Layout::init_fixed_output_section): Call it.
48 (Layout::make_output_section): Don't allow patch space in .eh_frame.
49 * object.cc (Sized_relobj_file::do_layout): Call
50 can_incremental_update.
51
ebb300b2
CC
522011-09-13 Cary Coutant <ccoutant@google.com>
53
54 * configure.ac: Check for glibc support for gnu_indirect_function
55 support with static linking, setting automake conditional
56 IFUNC_STATIC.
57 * Makefile.in: Regenerate.
58 * configure: Regenerate.
59
60 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
61 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
62 for IFUNC_STATIC.
63 * testsuite/Makefile.in: Regenerate.
64
1206d0d5
CC
652011-09-13 Cary Coutant <ccoutant@google.com>
66
67 * incremental.cc (Sized_relobj_incr::do_layout): Call
68 report_comdat_group for kept comdat sections.
69 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
70 * testsuite/Makefile.in: Regenerate.
71 * testsuite/incr_comdat_test_1.cc: New source file.
72 * testsuite/incr_comdat_test_2_v1.cc: New source file.
73 * testsuite/incr_comdat_test_2_v2.cc: New source file.
74 * testsuite/incr_comdat_test_2_v3.cc: New source file.
75
40b29874
ILT
762011-09-13 Ian Lance Taylor <iant@google.com>
77
78 * object.cc (Sized_relobj_file::do_layout): Remove unused local
79 variable external_symbols_offset.
80
1b045aac
ILT
812011-09-12 Ian Lance Taylor <iant@google.com>
82
83 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
84 triggered if object has no symbols.
85
24c6c55a
DM
862011-09-09 David S. Miller <davem@davemloft.net>
87
88 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
89 (Output_fill_debug_line::do_write): Likewise.
90
66570254
CC
912011-08-29 Cary Coutant <ccoutant@google.com>
92
93 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
94 casts to match formatting specs.
95 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
96
8ea8cd50
CC
972011-08-26 Cary Coutant <ccoutant@google.com>
98
99 * layout.cc (Free_list::allocate): Provide guarantee of minimum
100 remaining hole size when allocating.
101 (Layout::make_output_section): Set fill methods for debug sections.
102 * layout.h (Free_list::Free_list_node): Move from private to
103 public.
104 (Free_list::set_min_hole_size): New function.
105 (Free_list::begin, Free_list::end): New functions.
106 (Free_list::min_hole_): New data member.
107 * output.cc: Include dwarf.h.
108 (Output_fill_debug_info::do_minimum_hole_size): New function.
109 (Output_fill_debug_info::do_write): New function.
110 (Output_fill_debug_line::do_minimum_hole_size): New function.
111 (Output_fill_debug_line::do_write): New function.
112 (Output_section::Output_section): Initialize new data member.
113 (Output_section::set_final_data_size): Ensure patch space is larger
114 than minimum hole size.
115 (Output_section::do_write): Fill holes in debug sections.
116 * output.h (Output_fill): New class.
117 (Output_fill_debug_info): New class.
118 (Output_fill_debug_line): New class.
119 (Output_section::set_free_space_fill): New function.
120 (Output_section::free_space_fill_): New data member.
121 * testsuite/Makefile.am (incremental_test_3): Add
122 --incremental-patch option.
123 (incremental_test_4): Likewise.
124 (incremental_test_5): Likewise.
125 (incremental_test_6): Likewise.
126 (incremental_copy_test): Likewise.
127 (incremental_common_test_1): Likewise.
128 * testsuite/Makefile.in: Regenerate.
129
7cf80422
NC
1302011-08-26 Nick Clifton <nickc@redhat.com>
131
132 * po/es.po: Updated Spanish translation.
133
c3f7b0e5
CC
1342011-08-01 Cary Coutant <ccoutant@google.com>
135
136 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
137 * gold/testsuite/Makefile.in: Regenerate.
138 * gold/testsuite/justsyms_exec.c: New source file.
139 * gold/testsuite/justsyms_lib.c: New source file.
140
9590bf25
CC
1412011-08-01 Cary Coutant <ccoutant@google.com>
142
143 * layout.cc (Layout::set_segment_offsets): Don't realign text
144 segment if -Ttext was specified.
145 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
146 file type.
147 * object.h (Sized_relobj_file::e_type): New function.
148 (Sized_relobj_file::e_type_): New data member.
149 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
150 base address for ET_EXEC files.
151 * target.cc (Target::do_make_elf_object_implementation): Allow
152 ET_EXEC files with --just-symbols option.
153
dcd8d12e
CC
1542011-07-28 Cary Coutant <ccoutant@google.com>
155
156 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
157 Add thread_number parameter.
158 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
159 * workqueue-threads.cc
160 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
161 current thread if its thread number is greater than desired thread
162 count.
163 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
164 Add thread_number parameter.
165 (Workqueue::should_cancel_thread): Likewise.
166 (Workqueue::find_runnable_or_wait): Pass thread_number to
167 should_cancel_thread.
168 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
169 parameter.
170
804eb480
ST
1712011-07-22 Sriraman Tallam <tmsriram@google.com>
172
173 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
174 only after checking if it cannot be forced local.
175 * symtab.h (is_externally_visible): Check if the symbol is not forced
176 local.
177
f1ddb600
ILT
1782011-07-15 Ian Lance Taylor <iant@google.com>
179
180 * options.h (class General_options): Add --print-output-format.
181 Move -EL next to -EB, for better --help output.
182 * target-select.cc: Include <cstdio>, "options.h", and
183 "parameters.h".
184 (Target_selector::do_target_bfd_name): New function.
185 (print_output_format): New function.
186 * target-select.h (class Target_selector): Update declarations.
187 (Target_selector::target_bfd_name): New function.
188 (print_output_format): Declare.
189 * main.cc: Include "target-select.h".
190 (main): Handle --print-output-format.
191 * gold.cc: Include "target-select.h".
192 (queue_initial_tasks): Handle --print-output-format when there are
193 no input files.
194 * parameters.cc (parameters_force_valid_target): Give a better
195 error message if -EB/-EL does not match target.
196 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
197 function.
198
7d172687
ILT
1992011-07-15 Ian Lance Taylor <iant@google.com>
200
201 * i386.cc (class Output_data_plt_i386): Add layout_ field.
202 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
203 (Output_data_plt_i386::do_write): Write address of .dynamic
204 section to first entry in .got.plt section.
205 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
206 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
207 Initialize layout_.
208 (Output_data_plt_x86_64::do_write): Write address of .dynamic
209 section to first entry in .got.plt section.
210 * layout.h (Layout::dynamic_section): New function.
211
e9552f7e
ST
2122011-07-13 Sriraman Tallam <tmsriram@google.com>
213
214 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
215 to claim_file call.
216 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
217 input_section_position_, and input_section_glob_.
218 (read_layout_from_file): Call function section_ordering_specified.
219 * layout.h (is_section_ordering_specified): New function.
220 (section_ordering_specified): New function.
221 (section_ordering_specified_): New boolean member.
222 * main.cc(main): Call load_plugins after layout object is defined.
223 * output.cc (Output_section::add_input_section): Use
224 function section_ordering_specified to check if section ordering is
225 needed.
226 * output.cc (Output_section::add_relaxed_input_section): Use
227 function section_ordering_specified to check if section ordering is
228 needed.
229 (Output_section::update_section_layout): New function.
230 (Output_section::sort_attached_input_sections): Check if input section
231 must be reordered.
232 * output.h (Output_section::update_section_layout): New function.
233 * plugin.cc (get_section_count): New function.
234 (get_section_type): New function.
235 (get_section_name): New function.
236 (get_section_contents): New function.
237 (update_section_order): New function.
238 (allow_section_ordering): New function.
239 (Plugin::load): Add the new interfaces to the transfer vector.
240 (Plugin_manager::load_plugins): New parameter.
241 (Plugin_manager::all_symbols_read): New parameter.
242 (Plugin_manager::claim_file): New parameter. Save the elf object for
243 unclaimed objects.
244 (Plugin_manager::get_elf_object): New function.
245 (Plugin_manager::get_view): Change to directly use the bool to check
246 if get_view is called from claim_file_hook.
247 * plugin.h (input_objects): New function
248 (Plugin__manager::load_plugins): New parameter.
249 (Plugin_manager::claim_file): New parameter.
250 (Plugin_manager::get_elf_object): New function.
251 (Plugin_manager::in_claim_file_handler): New function.
252 (Plugin_manager::in_claim_file_handler_): New member.
253 (layout): New function.
254 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
255 handler with an extra parameter. Make the elf object before calling
256 claim_file handler.
257 * testsuite/plugin_test.c (get_section_count): New function pointer.
258 (get_section_type): New function pointer.
259 (get_section_name): New function pointer.
260 (get_section_contents): New function pointer.
261 (update_section_order): New function pointer.
262 (allow_section_ordering): New function pointer.
263 (onload): Check if the new interfaces exist.
264
9446efde
ILT
2652011-07-13 Ian Lance Taylor <iant@google.com>
266
267 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
268 relro section.
269 * x86_64.cc (Target_x86_64::got_section): Likewise.
270 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
271 (relro_now_test_SOURCES): New variable.
272 (relro_now_test_DEPENDENCIES): New variable.
273 (relro_now_test_LDFLAGS): New variable.
274 (relro_now_test_LDADD): New variable.
275 (relro_now_test.so): New target.
276 * testsuite/Makefile.in: Rebuild.
277
07aa62f2
ILT
2782011-07-12 Ian Lance Taylor <iant@google.com>
279
280 PR gold/12980
281 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
282 GLOB_DAT relocation rather than a RELATIVE relocation for a
283 protected symbol when creating a shared library.
284 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
285 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
286 * testsuite/protected_main_1.cc (main): Test that protected
287 function has same address.
288
e2153196
ILT
2892011-07-11 Ian Lance Taylor <iant@google.com>
290
291 PR gold/12979
292 * options.h (class General_options): Add -Bgroup.
293 * options.cc (General_options::finalize): If -Bgroup is set,
294 default to --unresolved-symbols=report-all.
295 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
296 * target-reloc.h (issue_undefined_symbol_error): Handle
297 --unresolved-symbols=report-all.
298
6daf5215
ILT
2992011-07-08 Ian Lance Taylor <iant@google.com>
300
301 PR gold/11985
302 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
303 if linker script discards key sections.
304 (Layout::create_dynamic_symtab): Likewise.
305 (Layout::assign_local_dynsym_offsets): Likewise.
306 (Layout::sized_create_version_sections): Likewise.
307 (Layout::create_interp): Likewise.
308 (Layout::finish_dynamic_section): Likewise.
309 (Layout::set_dynamic_symbol_size): Likewise.
310
beabb2c6
ILT
3112011-07-08 Ian Lance Taylor <iant@google.com>
312
313 PR gold/12386
314 * options.h (class General_options): Add --unresolved-symbols.
315 * target-reloc.h (issue_undefined_symbol_error): Check
316 --unresolved-symbols. Add comments.
317
9c16daf1
ILT
3182011-07-08 Ian Lance Taylor <iant@google.com>
319
320 * testsuite/odr_violation2.cc (Ordering::operator()): Make
321 expression more complex.
322
191f1a2d
ILT
3232011-07-08 Ian Lance Taylor <iant@google.com>
324
325 PR gold/11317
326 * target-reloc.h (issue_undefined_symbol_error): New inline
327 function, broken out of relocate_section.
328 (relocate_section): Call issue_undefined_symbol_error.
329 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
330 there is no TLS segment if we are about to issue an undefined
331 symbol error.
332 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
333
62855347
ILT
3342011-07-08 Ian Lance Taylor <iant@google.com>
335
336 PR gold/12279
337 * resolve.cc (Symbol_table::should_override): Add fromtype
338 parameter. Change all callers. Give error when linking together
339 TLS and non-TLS symbol.
340 (Symbol_table::should_override_with_special): Add fromtype
341 parameter. Change all callers.
342 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
343 there is no TLS segment if we have reported some errors.
344 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
345
67181c72
ILT
3462011-07-08 Ian Lance Taylor <iant@google.com>
347
348 PR gold/12372
349 * target.h (Target::plt_address_for_global): New function.
350 (Target::plt_address_for_local): New function.
351 (Target::plt_section_for_global): Remove.
352 (Target::plt_section_for_local): Remove.
353 (Target::do_plt_address_for_global): New virtual function.
354 (Target::do_plt_address_for_local): New virtual function.
355 (Target::do_plt_section_for_global): Remove.
356 (Target::do_plt_section_for_local): Remove.
357 (Target::register_global_plt_entry): Add Symbol_table and Layout
358 parameters.
359 * output.cc (Output_data_got::Got_entry::write): Use
360 plt_address_for_global and plt_address_for_local.
361 * layout.cc (Layout::add_target_dynamic_tags): Use size and
362 address of output section.
363 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
364 got_irelative_, and irelative_count_ fields. Update
365 declarations.
366 (Output_data_plt_i386::has_irelative_section): New function.
367 (Output_data_plt_i386::entry_count): Add irelative_count_.
368 (Output_data_plt_i386::set_final_data_size): Likewise.
369 (class Target_i386): Add got_irelative_ and rel_irelative_
370 fields. Update declarations.
371 (Target_i386::Target_i386): Initialize new fields.
372 (Target_i386::do_plt_address_for_global): New function replacing
373 do_plt_section_for_global.
374 (Target_i386::do_plt_address_for_local): New function replacing
375 do_plt_section_for_local.
376 (Target_i386::got_section): Create got_irelative_.
377 (Target_i386::rel_irelative_section): New function.
378 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
379 fields. Don't define __rel_iplt_{start,end}.
380 (Output_data_plt_i386::add_entry): Add symtab and layout
381 parameters. Change all callers. Use different PLT and GOT for
382 IFUNC symbols.
383 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
384 layout parameters. Change all callers. Use different PLT and
385 GOT.
386 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
387 (Output_data_plt_i386::rel_irelative): New function.
388 (Output_data_plt_i386::address_for_global): New function.
389 (Output_data_plt_i386::address_for_local): New function.
390 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
391 IRELATIVE GOT when changing IFUNC GOT entries.
392 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
393 reloc.
394 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
395 if we didn't create an IRELATIVE GOT.
396 (Target_i386::Relocate::relocate): Use plt_address_for_global and
397 plt_address_for_local.
398 (Target_i386::do_dynsym_value): Use plt_address_for_global.
399 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
400 got_irelative_, and irelative_count_ fields. Update
401 declarations.
402 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
403 Initialize new fields. Remove symtab parameter. Change all
404 callers.
405 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
406 irelative_count_.
407 (Output_data_plt_x86_64::has_irelative_section): New function.
408 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
409 (class Target_x86_64): Add got_irelative_ and rel_irelative_
410 fields. Update declarations.
411 (Target_x86_64::Target_x86_64): Initialize new fields.
412 (Target_x86_64::do_plt_address_for_global): New function replacing
413 do_plt_section_for_global.
414 (Target_x86_64::do_plt_address_for_local): New function replacing
415 do_plt_section_for_local.
416 (Target_x86_64::got_section): Create got_irelative_.
417 (Target_x86_64::rela_irelative_section): New function.
418 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
419 all callers. Don't create __rel_iplt_{start,end}.
420 (Output_data_plt_x86_64::add_entry): Add symtab and layout
421 parameters. Change all callers. Use different PLT and GOT for
422 IFUNC symbols.
423 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
424 layout parameters. Change all callers. Use different PLT and
425 GOT.
426 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
427 parameters. Change all callers. Use different PLT and GOT for
428 IFUNC symbols.
429 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
430 (Output_data_plt_x86_64::rela_irelative): New function.
431 (Output_data_plt_x86_64::address_for_global): New function.
432 (Output_data_plt_x86_64::address_for_local): New function.
433 (Output_data_plt_x86_64::set_final_data_size): Likewise.
434 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
435 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
436 (Target_x86_64::register_global_plt_entry): Add symtab and layout
437 parameters.
438 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
439 reloc.
440 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
441 symbols if we didn't create an IRELATIVE GOT.
442 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
443 plt_address_for_local.
444 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
445 * testsuite/ifuncvar1.c: New test file.
446 * testsuite/ifuncvar2.c: New test file.
447 * testsuite/ifuncvar3.c: New test file.
448 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
449 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
450 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
451 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
452 * testsuite/Makefile.in: Rebuild.
453
33c15b45
CC
4542011-07-07 Cary Coutant <ccoutant@google.com>
455
456 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
457 (two_file_test_1_ndebug.o): Likewise.
458 (two_file_test_1b_ndebug.o): Likewise.
459 (two_file_test_2_ndebug.o): Likewise.
460 (two_file_test_main_ndebug.o): Likewise.
461 (incremental_test_2): Link with no-debug versions.
462
f48b5fb7
CC
4632011-07-06 Cary Coutant <ccoutant@google.com>
464
465 * gold/incremental.cc
466 (Output_section_incremental_inputs::write_info_blocks): Check for
467 hidden and internal symbols.
468
221597a5
CC
4692011-07-06 Cary Coutant <ccoutant@google.com>
470
471 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
472 Check disposition for startup file.
473 (Incremental_inputs::report_command_line): Ignore
474 --incremental-startup-unchanged option.
475 * options.cc (General_options::parse_incremental_startup_unchanged):
476 New function.
477 (General_options::General_options): Initialize new data member.
478 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
479 (General_options): Add --incremental-startup-unchanged option.
480 (General_options::incremental_startup_disposition): New function.
481 (General_options::incremental_startup_disposition_): New data member.
482
e24719f6
CC
4832011-07-06 Cary Coutant <ccoutant@google.com>
484
485 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
486 input file index to Script_info ctor.
487 (Sized_incremental_binary::do_file_has_changed): Find the
488 command-line argument for files named in scripts.
489 * incremental.h (Script_info::Script_info): New ctor
490 with input file index.
491 (Script_info::input_file_index): New function.
492 (Script_info::input_file_index_): New data member.
493 (Incremental_binary::get_library): Add const.
494 (Incremental_binary::get_script_info): Add const.
495 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
496 * testsuite/Makefile.am (incremental_test_5): New test case.
497 (incremental_test_6): New test case.
498 * testsuite/Makefile.in: Regenerate.
499
8f7c81e8
CC
5002011-07-06 Cary Coutant <ccoutant@google.com>
501
502 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
503 debug output when command lines differ.
504
9fbd3822
CC
5052011-07-06 Cary Coutant <ccoutant@google.com>
506
507 * incremental.cc (Incremental_inputs::report_command_line): Ignore
508 --incremental-patch option.
509 * layout.cc (Free_list::allocate): Extend allocation beyond original
510 end if enabled.
511 (Layout::make_output_section): Mark sections that should get
512 patch space.
513 * options.cc (parse_percent): New function.
514 * options.h (parse_percent): New function.
515 (DEFINE_percent): New macro.
516 (General_options): Add --incremental-patch option.
517 * output.cc (Output_section::Output_section): Initialize new data
518 members.
519 (Output_section::add_input_section): Print section name when out
520 of patch space.
521 (Output_section::add_output_section_data): Likewise.
522 (Output_section::set_final_data_size): Add patch space when
523 doing --incremental-full.
524 (Output_section::do_reset_address_and_file_offset): Remove patch
525 space.
526 (Output_segment::set_section_list_addresses): Print debug output
527 only if --incremental-update.
528 * output.h (Output_section::set_is_patch_space_allowed): New function.
529 (Output_section::is_patch_space_allowed_): New data member.
530 (Output_section::patch_space_): New data member.
531 * parameters.cc (Parameters::incremental_full): New function.
532 * parameters.h (Parameters::incremental_full): New function
533 * testsuite/Makefile.am (incremental_test_2): Add test for
534 --incremental-patch option.
535 * testsuite/Makefile.in: Regenerate.
536 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
537 (t18): Remove function body.
538
f6cccc2c
DK
5392011-07-05 Doug Kwan <dougkwan@google.com>
540
541 PR gold/12771
542 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
543 Arm_Address type for relocation result.
544 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
545 overflow check.
546 (Arm_relocate_functions::abs32): Use unaligned access.
547 (Arm_relocate_functions::rel32): Ditto.
548 (Arm_relocate_functions::prel31): Ditto.
549 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
550 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
551 static data relocations.
552 * testsuite/Makefile.in: Regnerate.
553 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
554
28a13fec
ILT
5552011-07-05 Ian Lance Taylor <iant@google.com>
556
557 PR gold/12392
558 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
559 symbols if necessary.
560 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
561
24d47b34
ILT
5622011-07-05 Ian Lance Taylor <iant@google.com>
563
564 PR gold/12952
565 * resolve.cc (Symbol::override_base_with_special): Simply override
566 version with special symbol version, ignoring previous version.
567
41f9cbbe
ILT
5682011-07-05 Ian Lance Taylor <iant@google.com>
569
570 * object.cc (Sized_relobj_file::include_section_group): Add
571 information to comment about signature location.
572
886288f1
ILT
5732011-07-02 Ian Lance Taylor <iant@google.com>
574
575 PR gold/12957
576 * options.h (class General_options): Add -f and -F.
577 * options.cc (General_options::finalize): Fatal error if -f/-F
578 are used without -shared.
579 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
580
ae3a6d4f
ILT
5812011-07-02 Ian Lance Taylor <iant@google.com>
582
583 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
584
21131061
ILT
5852011-07-01 Ian Lance Taylor <iant@google.com>
586
587 PR gold/12525
588 PR gold/12952
589 * resolve.cc (Symbol::override_base_with_special): Don't override
590 the version if the overriding symbol has a different name.
591 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
592 all callers. If we give an error about an undefined version,
593 define the base version if necessary.
594 * dynobj.h (class Versions): Update declaration.
595 * testsuite/weak_alias_test_5.cc: New file.
596 * testsuite/weak_alias_test.script: New file.
597 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
598 and versioned_alias have the right value, and call t2.
599 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
600 weak_alias_test_5.so.
601 (weak_alias_test_LDADD): Likewise.
602 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
603 * testsuite/Makefile.in: Rebuild.
604
611062c0
ILT
6052011-07-01 Ian Lance Taylor <iant@google.com>
606
607 PR gold/12525
608 * options.h (class General_options): Support -z notext.
609 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
610 -Wl,-z,notext.
611 (two_file_shared_nonpic.so): Likewise.
612 (two_file_shared_mixed.so): Likewise.
613 (two_file_shared_mixed_1.so): Likewise.
614 (weak_undef_lib_nonpic.so): Likewise.
615 (alt/weak_undef_lib_nonpic.so): Likewise.
616 (tls_test_shared_nonpic.so): Likewise.
617 * testsuite/Makefile.in: Rebuild.
618
328c7c2f
ILT
6192011-07-01 Ian Lance Taylor <iant@google.com>
620
621 PR gold/12525
622 * configure.ac: Test whether static linking works, setting
623 the automake conditional HAVE_STATIC.
624 * testsuite/Makefile.am: Disable tests using -static if
625 HAVE_STATIC is not true.
626 * configure, testsuite/Makefile.in: Rebuild.
627
02d7cd44
ILT
6282011-07-01 Ian Lance Taylor <iant@google.com>
629
630 PR gold/12525
631 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
632 Assert if we see DW_EH_PE_indirect.
633 * target.h (Target::ehframe_datarel_base): New function.
634 (Target::do_ehframe_datarel_base): New target function.
635 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
636 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
637 function.
638
07a60597
ILT
6392011-07-01 Ian Lance Taylor <iant@google.com>
640
641 PR gold/12571
642 * options.h (class General_options): Add
643 --ld-generated-unwind-info.
644 * ehframe.cc (Fde::write): Add address parameter. Change all
645 callers. If associated with PLT, fill in address and size.
646 (Cie::set_output_offset): Only add merge mapping if there is an
647 object.
648 (Cie::write): Add address parameter. Change all callers.
649 (Eh_frame::add_ehframe_for_plt): New function.
650 * ehframe.h (class Fde): Update declarations. Move shndx_ and
651 input_offset_ fields into union u_, with new plt field.
652 (Fde::Fde): Adjust for new union field.
653 (Fde::Fde) [Output_data version]: New constructor.
654 (Fde::add_mapping): Only add merge mapping if there is an object.
655 (class Cie): Update declarations.
656 (class Eh_frame): Declare add_ehframe_for_plt.
657 * layout.cc (Layout::layout_eh_frame): Break out code into
658 make_eh_frame_section, and call it.
659 (Layout::make_eh_frame_section): New function.
660 (Layout::add_eh_frame_for_plt): New function.
661 * layout.h (class Layout): Update declarations.
662 * merge.cc (Merge_map::add_mapping): Add assertion.
663 * i386.cc: Include "dwarf.h".
664 (class Output_data_plt_i386): Make first_plt_entry,
665 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
666 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
667 and plt_eh_frame_fde.
668 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
669 boundary. Call add_eh_frame_for_plt if appropriate.
670 * x86_64.cc: Include "dwarf.h".
671 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
672 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
673 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
674 and plt_eh_frame_fde.
675 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
676 appropriate.
677
14788a3f
ILT
6782011-06-29 Ian Lance Taylor <iant@google.com>
679
680 PR gold/12629
681 * object.cc (Sized_relobj_file::layout_section): Change shdr
682 parameter to be const.
683 (Sized_relobj_file::layout_eh_frame_section): New function, broken
684 out of do_layout.
685 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
686 appropriate. Call layout_eh_frame_section.
687 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
688 sections.
689 * object.h (class Sized_relobj_file): Update declarations.
690
6c21fce1
ILT
6912011-06-29 Ian Lance Taylor <iant@google.com>
692
37e41b03 693 PR gold/12652
6c21fce1
ILT
694 * script.cc (Token::integer_value): Accept trailing M/m/K/k
695 modifier.
696 (Lex::gather_token): Accept trailing M/m/K/k for integers.
697
4d5e4e62
ILT
6982011-06-29 Ian Lance Taylor <iant@google.com>
699
700 PR gold/12675
701 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
702 SHT_X86_64_UNWIND.
703 * layout.cc (Layout::layout_eh_frame): Likewise.
704
886f533a
ILT
7052011-06-29 Ian Lance Taylor <iant@google.com>
706
707 PR gold/12695
708 * layout.cc (Layout::symtab_section_shndx): New function.
709 * layout.h (class Layout): Declare symtab_section_shndx.
710 * output.cc (Output_section::write_header): Call it.
711
f3ae1b28
ILT
7122011-06-29 Ian Lance Taylor <iant@google.com>
713
714 PR gold/12818
715 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
716 symbols which are not used in a relocation.
717
aecf301f
ILT
7182011-06-28 Ian Lance Taylor <iant@google.com>
719
720 PR gold/12898
721 * layout.cc (Layout::segment_precedes): Don't crash if a linker
722 script create indistinguishable segments.
723 (Layout::set_segment_offsets): Use stable_sort when sorting
724 segments. Pass this to Compare_segments constructor.
725 * layout.h (class Layout): Make segment_precedes non-static.
726 (class Compare_segments): Change from struct to class. Add
727 layout_ field. Add constructor.
728 * script-sections.cc
729 (Script_sections::attach_sections_using_phdrs_clause): Rename
730 local orphan to is_orphan. Don't report failure to put empty
731 section in segment. On attachment failure, report name of
732 section, and attach to first PT_LOAD segment.
733
03ef7571
ILT
7342011-06-28 Ian Lance Taylor <iant@google.com>
735
736 PR gold/12934
737 * target-select.cc (Target_selector::Target_selector): Add
738 emulation parameter. Change all callers.
739 (select_target_by_bfd_name): Rename from select_target_by_name.
740 Change all callers.
741 (select_target_by_emulation): New function.
742 (supported_emulation_names): New function.
743 * target-select.h (class Target_selector): Add emulation_ field.
744 Update declarations.
745 (Target_selector::recognize_by_bfd_name): Rename from
746 recognize_by_name. Change all callers.
747 (Target_selector::supported_bfd_names): Rename from
748 supported_names. Change all callers.
749 (Target_selector::recognize_by_emulation): New function.
750 (Target_selector::supported_emulations): New function.
751 (Target_selector::emulation): New function.
752 (Target_selector::do_recognize_by_bfd_name): Rename from
753 do_recognize_by_name. Change all callers.
754 (Target_selector::do_supported_bfd_names): Rename from
755 do_supported_names. Change all callers.
756 (Target_selector::do_recognize_by_emulation): New function.
757 (Target_selector::do_supported_emulations): New function.
758 (select_target_by_bfd_name): Change name in declaration.
759 (select_target_by_emulation): Declare.
760 (supported_emulation_names): Declare.
761 * parameters.cc (parameters_force_valid_target): Try to find
762 target based on emulation from -m option.
763 * options.h (class General_options): Change doc string for -m.
764 * options.cc (help): Print emulations.
765 (General_options::parse_V): Likewise.
766 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
767 Add emulation parameter. Change all callers.
768
200b2bb9
ILT
7692011-06-28 Ian Lance Taylor <iant@google.com>
770
771 * target.h (class Target): Add osabi_ field.
772 (Target::osabi): New function.
773 (Target::set_osabi): New function.
774 (Target::Target): Initialize osabi_.
775 (Target::do_adjust_elf_header): Make pure virtual.
776 (Sized_target::do_adjust_elf_header): Declare.
777 * target.cc (Sized_target::do_adjust_elf_header): New function.
778 (class Sized_target): Instantiate all versions.
779 * freebsd.h (class Target_freebsd): Remove.
780 (Target_selector_freebsd::do_recognize): Call set_osabi on
781 Target.
782 (Target_selector_freebsd::do_recognize_by_name): Likewise.
783 (Target_selector_freebsd::set_osabi): Remove.
784 * i386.cc (class Target_i386): Inherit from Sized_target rather
785 than Target_freebsd.
786 * x86_64.cc (class Target_x86_64): Likewise.
787
b3ce541e
ILT
7882011-06-28 Ian Lance Taylor <iant@google.com>
789
790 * target.h (Target::can_check_for_function_pointers): Rewrite.
791 Make non-virtual.
792 (Target::can_icf_inline_merge_sections): Likewise.
793 (Target::section_may_have_icf_unsafe_poineters): Likewise.
794 (Target::Target_info): Add can_icf_inline_merge_sections field.
795 (Target::do_can_check_for_function_pointers): New virtual
796 function.
797 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
798 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
799 from can_check_for_function_pointers, move in file.
800 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
801 section_may_have_icf_unsafe_poineters, move in file.
802 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
803 * i386.cc (Target_i386::do_can_check_for_function_pointers):
804 Rename from can_check_for_function_pointers, move in file.
805 (Target_i386::can_icf_inline_merge_sections): Remove.
806 (Target_i386::i386_info): Initialize
807 can_icf_inline_merge_sections.
808 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
809 Initialize can_icf_inline_merge_sections.
810 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
811 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
812 Rename from can_check_for_function_pointers, move in file.
813 (Target_x86_64::can_icf_inline_merge_sections): Remove.
814 (Target_x86_64::x86_64_info): Initialize
815 can_icf_inline_merge_sections.
816 * testsuite/testfile.cc (Target_test::test_target_info):
817 Likewise.
818 * icf.cc (get_section_contents): Correct formatting.
819
6d1c4efb
ILT
8202011-06-27 Ian Lance Taylor <iant@google.com>
821
822 * symtab.cc (Symbol::versioned_name): New function.
823 (Symbol_table::add_to_final_symtab): Use versioned_name when
824 appropriate.
825 (Symbol_table::sized_write_symbol): Likewise.
826 * symtab.h (class Symbol): Declare versioned_name.
827 * stringpool.h (class Stringpool_template): Add variant of add
828 which takes a std::basic_string.
829 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
830 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
831 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
832 (ver_test_12.o): New target.
833 * testsuite/Makefile.in: Rebuild.
834
57eb9b50
DK
8352011-06-27 Doug Kwan <dougkwan@google.com>
836
837 * arm.cc (Arm_relocate_functions::thm_jump8,
838 Arm_relocate_functions::thm_jump11): Use a wider signed
839 type to compute offset.
840 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
841 arm_thm_jump8.
842 * testsuite/Makefile.in: Regenerate.
843 * testsuite/arm_branch_in_range.sh: Check test results of
844 arm_thm_jump11 and arm_thm_jump8.
845 * testsuite/arm_thm_jump11.s: New test source file.
846 * testsuite/arm_thm_jump11.t: New linker script.
847 * testsuite/arm_thm_jump8.s: New test source file.
848 * testsuite/arm_thm_jump8.t: New linker script.
849
487b39df
ILT
8502011-06-24 Ian Lance Taylor <iant@google.com>
851
852 * layout.cc: Include "object.h".
853 (ctors_sections_in_init_array): New static variable.
854 (Layout::is_ctors_in_init_array): New function.
855 (Layout::layout): Add entry to ctors_sections_in_init_array if
856 appropriate.
857 * layout.h (class Layout): Declare is_ctors_in_init_array.
858 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
859 is_ctors_reverse_view is set.
860 (Sized_relobj_file::write_sections): Add layout parameter. Change
861 all callers. Set is_ctors_reverse_view field of View_size.
862 (Sized_relobj_file::reverse_words): New function.
863 * object.h (Sized_relobj_file::View_size): Add
864 is_ctors_reverse_view field.
865 (class Sized_relobj_file): Update declarations.
866 * testsuite/initpri3.c: New test.
867 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
868 initpri3b.
869 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
870 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
871 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
872 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
873 * testsuite/Makefile.in: Rebuild.
874
472076e4
CC
8752011-06-24 Cary Coutant <ccoutant@google.com>
876
877 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
878 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
879 (debug_msg_cdebug.err): New targets.
880 * testsuite/Makefile.in: Regenerate.
881 * testsuite/debug_msg.sh: Check output of link with compressed debug.
882 Fix checks for link with shared library.
883
a60af0db
DK
8842011-06-24 Doug Kwan <dougkwan@google.com>
885
886 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
887 skip empty text sections.
888 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
889
5393d741
ILT
8902011-06-22 Ian Lance Taylor <iant@google.com>
891
892 PR gold/12910
893 * options.h (class General_options): Add --ctors-in-init-array.
894 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
895 friends as SHT_PROGBITS for merging sections.
896 (Layout::layout): Remove special handling of .init_array and
897 friends. Don't sort if doing relocatable link. Sort for .ctors
898 and .dtors if ctors_in_init_array.
899 (Layout::make_output_section): Force correct section types for
900 .init_array and friends. Don't sort if doing relocatable link,
901 Don't sort .ctors and .dtors if ctors_in_init_array.
902 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
903 (Layout::output_section_name): Add relobj parameter. Change all
904 callers. Handle .ctors. and .dtors. in code rather than table.
905 Handle .ctors and .dtors if ctors_in_init_array.
906 (Layout::match_file_name): New function, moved from output.cc.
907 * layout.h (class Layout): Update declarations.
908 * output.cc: Include "layout.h".
909 (Input_section_sort_entry::get_priority): New function.
910 (Input_section_sort_entry::match_file_name): Just call
911 Layout::match_file_name.
912 (Output_section::Input_section_sort_init_fini_compare::operator()):
913 Handle .ctors and .dtors. Sort by explicit priority rather than
914 by name.
915 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
916 * testsuite/initpri2.c: New test.
917 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
918 (check_PROGRAMS): Add initpri2.
919 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
920 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
921 * configure, testsuite/Makefile.in: Rebuild.
922
e1f74f98
ILT
9232011-06-19 Ian Lance Taylor <iant@google.com>
924
925 PR gold/12880
926 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
927 .interp section to a PT_INTERP segment even if we have seen a
928 --dynamic-linker option. Don't do it if we have seen a PHDRS
929 clause in a linker script.
930 (Layout::finalize): Don't create a .interp section if we've
931 already create a PT_INTERP segment.
932 (Layout::create_interp): Always call choose_output_section (revert
933 patch of 2011-06-17). Don't create PT_INTERP segment.
934 * script-sections.cc
935 (Script_sections::create_note_and_tls_segments): Add a .interp
936 section to a PT_INTERP segment even if we have seen a
937 --dynamic-linker option.
938
766f91bb
ILT
9392011-06-18 Ian Lance Taylor <iant@google.com>
940
941 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
942 merely because a non-PT_LOAD segment has a dynamic reloc.
943
0d212c3a
ILT
9442011-06-18 Ian Lance Taylor <iant@google.com>
945
946 * layout.cc (Layout::finish_dynamic_section): Don't create
947 DT_FLAGS entry if not needed.
948
911a5072
ILT
9492011-06-18 Ian Lance Taylor <iant@google.com>
950
951 PR gold/12745
952 * layout.cc (Layout::layout_eh_frame): Correct handling of
953 writable .eh_frame section.
954
534b4e5f
ILT
9552011-06-17 Ian Lance Taylor <iant@google.com>
956
957 PR gold/12893
958 * resolve.cc (Symbol_table::resolve): Don't give an error if a
959 symbol is redefined with the exact same object and value.
960
10b4f102
ILT
9612011-06-17 Ian Lance Taylor <iant@google.com>
962
963 PR gold/12880
964 * layout.h (class Layout): Add interp_segment_ field.
965 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
966 (Layout::attach_allocated_section_to_segment): If making shared
967 library, put .interp section in PT_INTERP segment.
968 (Layout::finalize): Also call create_interp if -dynamic-linker
969 option was used.
970 (Layout::create_interp): Assert that there is no PT_INTERP
971 segment. If not using a SECTIONS clause, use make_output_section.
972 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
973 * script-sections.cc
974 (Script_sections::create_note_and_tls_segments): If making shared
975 library, put .interp section in PT_INTERP segment.
976
a29b0dad
ILT
9772011-06-17 Ian Lance Taylor <iant@google.com>
978
e588ea8d
ILT
979 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
980 when making a shared library.
981
9822011-06-17 Ian Lance Taylor <iant@google.com>
983
984 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
985 parameter. Change all callers. Don't issue warning about PC32
986 against locally defined symbol.
a29b0dad 987
9d3b0698
ILT
9882011-06-16 Ian Lance Taylor <iant@google.com>
989
990 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
991 occurs in same object.
992
85b0f90c
AM
9932011-06-14 Alan Modra <amodra@gmail.com>
994
995 * po/POTFILES.in: Regenerate.
996
a94907d9
ILT
9972011-06-09 Ian Lance Taylor <iant@google.com>
998
999 * script-sections.cc
1000 (Orphan_output_section::set_section_addresses): For a relocatable
1001 link set address to 0.
1002
4fb3a1c3
CC
10032011-06-09 Cary Coutant <ccoutant@google.com>
1004
1005 PR gold/12804
1006 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
1007 used with --compress-debug-sections.
1008 * gold/object.cc (Sized_relobj_file::do_layout): Report
1009 uncompressed size of compressed input sections.
1010
61220854
CC
10112011-06-08 Cary Coutant <ccoutant@google.com>
1012
1013 PR gold/12804
1014 * testsuite/two_file_test_2_v1.cc: Change initialization of
1015 v2 to keep it in .data.
1016
e6455dfb
CC
10172011-06-07 Cary Coutant <ccoutant@google.com>
1018
1019 * common.cc (Symbol_table::do_allocate_commons_list): Call
1020 gold_fallback.
1021 * errors.cc (Errors::fatal): Adjust call to gold_exit.
1022 (Errors::fallback): New function.
1023 (gold_fallback): New function.
1024 * errors.h (Errors::fallback): New function.
1025 * gold.cc (gold_exit): Change status parameter to enum; adjust
1026 all callers.
1027 (queue_initial_tasks): Call gold_fallback.
1028 * gold.h: Include cstdlib.
1029 (Exit_status): New enum type.
1030 (gold_exit): Change status parameter to enum.
1031 (gold_fallback): New function.
1032 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
1033 (Layout::create_symtab_sections): Likewise.
1034 (Layout::create_shdrs): Likewise.
1035 * main.cc (main): Adjust call to gold_exit.
1036 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
1037 (Output_data_got::add_got_entry_pair): Likewise.
1038 (Output_section::add_input_section): Likewise.
1039 (Output_section::add_output_section_data): Likewise.
1040 (Output_segment::set_section_list_addresses): Likewise.
1041 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
1042
fb0e076f
CC
10432011-06-07 Cary Coutant <ccoutant@google.com>
1044
1045 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
1046 for incremental links.
1047 * output.cc (Output_segment::set_section_list_addresses): Remove
1048 FIXME and test for TLS or BSS.
1049
a5ee4d5d
CC
10502011-06-07 Cary Coutant <ccoutant@google.com>
1051
1052 * testsuite/Makefile.am: Add incremental_copy_test,
1053 incremental_common_test_1.
1054 * testsuite/Makefile.in: Regenerate.
1055 * testsuite/common_test_1_v1.c: New source file.
1056 * testsuite/common_test_1_v2.c: New source file.
1057 * testsuite/copy_test_v1.cc: New source file.
1058
5146f448
CC
10592011-06-07 Cary Coutant <ccoutant@google.com>
1060
1061 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
1062 update, allocate common from bss section's free list.
1063 * incremental-dump.cc (dump_incremental_inputs): Print flag for
1064 linker-defined symbols.
1065 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
1066 Skip GOT and PLT entries that are no longer referenced.
1067 (Output_section_incremental_inputs::write_info_blocks): Mark
1068 linker-defined symbols.
1069 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
1070 * output.cc (Output_section::allocate): New function.
1071 * output.h (Output_section::allocate): New function.
1072 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
1073 linker-defined symbols.
1074 (Symbol::override_base_with_special): Copy is_predefined_ flag.
1075 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
1076 (Symbol::init_base_output_data): Likewise.
1077 (Symbol::init_base_output_segment): Likewise.
1078 (Symbol::init_base_constant): Likewise.
1079 (Sized_symbol::init_output_data): Likewise.
1080 (Sized_symbol::init_output_segment): Likewise.
1081 (Sized_symbol::init_constant): Likewise.
1082 (Symbol_table::do_define_in_output_data): Likewise.
1083 (Symbol_table::do_define_in_output_segment): Likewise.
1084 (Symbol_table::do_define_as_constant): Likewise.
1085 * symtab.h (Symbol::is_predefined): New function.
1086 (Symbol::init_base_output_data): Add is_predefined parameter.
1087 (Symbol::init_base_output_segment): Likewise.
1088 (Symbol::init_base_constant): Likewise.
1089 (Symbol::is_predefined_): New data member.
1090 (Sized_symbol::init_output_data): Add is_predefined parameter.
1091 (Sized_symbol::init_output_segment): Likewise.
1092 (Sized_symbol::init_constant): Likewise.
1093 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
1094
26d3c67d
CC
10952011-06-07 Cary Coutant <ccoutant@google.com>
1096
1097 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
1098 instead of emit_copy_reloc.
1099 (Copy_relocs::emit_copy_reloc): Refactor.
1100 (Copy_relocs::make_copy_reloc): New function.
1101 (Copy_relocs::add_copy_reloc): Remove.
1102 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
1103 section.
1104 (Copy_relocs::make_copy_reloc): New function.
1105 (Copy_relocs::add_copy_reloc): Remove.
1106 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
1107 unchanged input files.
1108 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
1109 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
1110 Reserve BSS space for COPY relocations.
1111 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1112 (Output_section_incremental_inputs::write_info_blocks): Record
1113 whether a symbol is copied from a shared object.
1114 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
1115 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
1116 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
1117 (Incremental_input_entry_reader::get_output_symbol_index): Add
1118 is_copy parameter.
1119 (Incremental_binary::emit_copy_relocs): New function.
1120 (Incremental_binary::do_emit_copy_relocs): New function.
1121 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1122 new data member.
1123 (Sized_incremental_binary::add_copy_reloc): New function.
1124 (Sized_incremental_binary::do_emit_copy_relocs): New function.
1125 (Sized_incremental_binary::Copy_reloc): New struct.
1126 (Sized_incremental_binary::Copy_relocs): New typedef.
1127 (Sized_incremental_binary::copy_relocs_): New data member.
1128 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
1129 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
1130 * target.h (Sized_target::emit_copy_reloc): New function.
1131 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
1132
7cdb37d9
CC
11332011-06-02 Cary Coutant <ccoutant@google.com>
1134
1135 PR gold/12163
1136 * gold/archive.cc (Archive::Archive): Initialize new data member.
1137 (Archive::include_all_members): Return if archive has already been
1138 included.
1139 * gold/archive.h (Archive::include_all_members_): New data member.
1140
cc643b88
NC
11412011-06-02 Nick Clifton <nickc@redhat.com>
1142
1143 * dynobj.h: Fix spelling mistake in comment.
1144 * output.cc: Likewise.
1145
f62a3ca7
DK
11462011-05-31 Doug Kwan <dougkwan@google.com>
1147 Asier Llano
1148
1149 PR gold/12826
cc643b88 1150 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
1151 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
1152 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
1153 redundant arm_exidx_test.so.
1154 * testsuite/Makefile.in: Regenerate.
1155 (check_SCRIPTS): Add pr12826.sh
1156 (check_DATA): Add pr12826.stdout
1157 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
1158 * testsuite/pr12826.sh: New file.
1159 * testsuite/pr12826_1.s: Ditto.
1160 * testsuite/pr12826_1.s: Ditto.
1161
8dbe1edc
ILT
11622011-05-30 Ian Lance Taylor <iant@google.com>
1163
1164 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
1165 sections.
1166
c49875be
ILT
11672011-05-29 Ian Lance Taylor <iant@google.com>
1168
1169 PR gold/12804
1170 * testsuite/Makefile.am: Use different file name for two_file_test
1171 temporary file for each incremental test.
1172 * testsuite/Makefile.in: Rebuild.
1173
69d53f7a
ILT
11742011-05-29 Ian Lance Taylor <iant@google.com>
1175
1176 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
1177 binary input file is empty.
1178
41d0ab5f
ILT
11792011-05-27 Ian Lance Taylor <iant@google.com>
1180
1181 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
1182 (ver_test_9.so): Likewise.
1183 * testsuite/Makefile.in: Rebuild.
1184
89d8a36b
CC
11852011-05-26 Cary Coutant <ccoutant@google.com>
1186
1187 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
1188 * incremental.cc (Incremental_inputs::report_input_section): Fix
1189 comment, indentation.
1190 (Incremental_inputs::report_comdat_group): New function.
1191 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1192 of data for incremental input file entry.
1193 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
1194 group count, COMDAT group signatures.
1195 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
1196 an unchanged input file.
1197 * incremental.h (Incremental_object_entry::Incremental_object_entry):
1198 Initialize new data member.
1199 (Incremental_object_entry::add_comdat_group): New function.
1200 (Incremental_object_entry::get_comdat_group_count): New function.
1201 (Incremental_object_entry::get_comdat_signature_key): New function.
1202 (Incremental_object_entry::groups_): New data member.
1203 (Incremental_inputs::report_comdat_group): New function.
1204 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
1205 data for incremental input file entry.
1206 (Incremental_input_entry_reader::get_comdat_group_count): New function.
1207 (Incremental_input_entry_reader::get_input_section): Adjust size of
1208 data for incremental input file entry.
1209 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
1210 (Incremental_input_entry_reader::get_comdat_group_signature): New
1211 function.
1212 * object.cc (Sized_relobj::include_section_group): Report kept
1213 COMDAT groups for incremental links.
1214
1706a06f
ILT
12152011-05-24 David Meyer <pdox@google.com>
1216
1217 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
1218 with name parameter. Add found_name parameter.
1219 * fileread.cc (Input_file::find_file): Adjust code accordingly.
1220 * dirsearch.h (class Dirsearch): Update declaration.
1221
a10ae760
ILT
12222011-05-24 Ian Lance Taylor <iant@google.com>
1223
1224 * archive.cc (Library_base::should_include_member): Pull in object
1225 from archive if it defines the entry symbol.
1226 * parameters.cc (Parameters::entry): New function.
1227 * parameters.h (class Parameters): Declare entry.
1228 * output.h (class Output_file_header): Remove entry_ field.
1229 * output.cc (Output_file_header::Output_file_header): Remove entry
1230 parameter. Change all callers.
1231 (Output_file_header::entry): Use parameters->entry.
1232 * gold.cc (queue_middle_tasks): Likewise.
1233 * plugin.cc (Plugin_hook::run): Likewise.
1234
aa92d6ed
CC
12352011-05-24 Cary Coutant <ccoutant@google.com>
1236
1237 * gold.cc (queue_initial_tasks): Pass incremental base filename
1238 to Output_file::open_base_file; don't print error message.
1239 * incremental-dump.cc (main): Adjust call to
1240 Output_file::open_for_modification.
1241 * incremental-dump.cc (main): Likewise.
1242 * incremental.cc (Incremental_inputs::report_command_line):
1243 Ignore --incremental-base option when comparing command lines.
1244 Ignore parameter when given as separate argument.
1245 * options.h (class General_options): Add --incremental-base.
1246 * output.cc (Output_file::Output_file):
1247 (Output_file::open_base_file): Add base_name and writable parameters;
1248 read base file into new file; print error message here.
1249 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1250 callers.
1251 * output.h (Output_file::open_for_modification): Rename to...
1252 (Output_file::open_base_file): ...this; add base_name and
1253 writable parameters; adjust all callers.
1254 (Output_file::map_no_anonymous): Add writable parameter; adjust all
1255 callers.
1256 * testsuite/Makefile.am (incremental_test_4): Test
1257 --incremental-base.
1258 * testsuite/Makefile.in: Regenerate.
1259
2eedd706
CC
12602011-05-24 Cary Coutant <ccoutant@google.com>
1261
1262 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
1263 incremental_test_4.
1264 * testsuite/Makefile.in: Regenerate.
1265 * testsuite/two_file_test_1_v1.cc: New test source file.
1266 * testsuite/two_file_test_1b_v1.cc: New test source file.
1267 * testsuite/two_file_test_2_v1.cc: New test source file.
1268
0f1c85a6
CC
12692011-05-24 Cary Coutant <ccoutant@google.com>
1270
1271 * dynobj.h (Dynobj::do_dynobj): New function.
1272 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
1273 flag and soname for shared objects.
1274 * incremental.cc (Incremental_inputs::report_object): Make
1275 either Incremental_object_entry or Incremental_dynobj_entry; add
1276 soname to string table.
1277 (Incremental_inputs::report_input_section): Add assertion.
1278 (Output_section_incremental_inputs::set_final_data_size): Adjust
1279 type of input file entry for shared libraries; adjust size of
1280 shared library info entry.
1281 (Output_section_incremental_inputs::write_input_files): Write
1282 as_needed flag for shared libraries.
1283 (Output_section_incremental_inputs::write_info_blocks): Adjust type
1284 of input file entry for shared libraries; write soname.
1285 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
1286 soname from incremental info.
1287 * incremental.h (enum Incremental_input_flags): Add
1288 INCREMENTAL_INPUT_AS_NEEDED.
1289 (Incremental_input_entry::Incremental_input_entry): Initialize new
1290 data member.
1291 (Incremental_input_entry::set_as_needed): New function.
1292 (Incremental_input_entry::as_needed): New function.
1293 (Incremental_input_entry::do_dynobj_entry): New function.
1294 (Incremental_input_entry::as_needed_): New data member.
1295 (Incremental_object_entry::Incremental_object_entry): Don't check
1296 for shared library.
1297 (Incremental_object_entry::do_type): Likewise.
1298 (class Incremental_dynobj_entry): New class.
1299 (Incremental_input_entry_reader::as_needed): New function.
1300 (Incremental_input_entry_reader::get_soname): New function.
1301 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
1302 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
1303 size of shared library info entry.
1304 * layout.cc (Layout::finish_dynamic_section): Don't test for
1305 incremental link when adding DT_NEEDED entries.
1306 * object.h (Object::Object): Initialize new data member.
1307 (Object::dynobj): New function.
1308 (Object::set_as_needed): New function.
1309 (Object::as_needed): New function.
1310 (Object::do_dynobj): New function.
1311 (Object::as_needed_): New data member.
1312
6fa2a40b
CC
13132011-05-24 Cary Coutant <ccoutant@google.com>
1314
1315 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
1316 info; adjust display of GOT entries.
1317 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1318 vector of input objects; remove file_status_.
1319 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
1320 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
1321 got_plt reader; call target hooks to reserve GOT entries.
1322 (Output_section_incremental_inputs::set_final_data_size): Adjust size
1323 of input file info header and GOT info entry.
1324 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
1325 relocation info.
1326 (Got_plt_view_info::got_descriptor): Remove.
1327 (Got_plt_view_info::sym_index): New data member.
1328 (Got_plt_view_info::input_index): New data member.
1329 (Local_got_offset_visitor::visit): Write input file index.
1330 (Global_got_offset_visitor::visit): Write 0 for input file index.
1331 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
1332 with sym_index and input_index.
1333 (Output_section_incremental_inputs::write_got_plt): Adjust size of
1334 incremental info GOT entry; replace got_descriptor with input_index.
1335 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
1336 map from input file index to object.
1337 (Sized_relobj_incr::do_layout): Replace direct data member reference
1338 with accessor function.
1339 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
1340 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
1341 Adjust size of input file info header.
1342 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
1343 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
1344 (Incremental_input_entry_reader::get_input_section): Adjust size of
1345 input file info header.
1346 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
1347 of incremental info GOT entry.
1348 (Incremental_got_plt_reader::get_got_desc): Remove.
1349 (Incremental_got_plt_reader::get_got_symndx): New function.
1350 (Incremental_got_plt_reader::get_got_input_index): New function.
1351 (Sized_incremental_binary::Sized_incremental_binary): Remove
1352 file_status_; add input_objects_.
1353 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
1354 (Sized_incremental_binary::set_file_is_unchanged): Remove.
1355 (Sized_incremental_binary::file_is_unchanged): Remove.
1356 (Sized_incremental_binary::set_input_object): New function.
1357 (Sized_incremental_binary::input_object): New function.
1358 (Sized_incremental_binary::file_status_): Remove.
1359 (Sized_incremental_binary::input_objects_): New data member.
1360 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
1361 references.
1362 (Sized_relobj_incr::invalid_address): Move to base class.
1363 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
1364 class.
1365 (Sized_relobj_incr::do_output_section_offset): Likewise.
1366 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
1367 (Sized_relobj_incr::section_offsets_): Likewise.
1368 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
1369 function.
1370 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
1371 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
1372 with accessor function.
1373 (Sized_relobj_file::do_layout): Likewise.
1374 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
1375 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
1376 (Sized_relobj_file::compute_final_local_value): Replace refs to
1377 section_offsets_ with accessor function.
1378 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
1379 * object.h (Relobj::Relobj): Initialize new data members.
1380 (Relobj::add_dyn_reloc): New function.
1381 (Relobj::first_dyn_reloc): New function.
1382 (Relobj::dyn_reloc_count): New function.
1383 (Relobj::first_dyn_reloc_): New data member.
1384 (Relobj::dyn_reloc_count_): New data member.
1385 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
1386 references.
1387 (Sized_relobj::Address): New typedef.
1388 (Sized_relobj::invalid_address): Move here from child class.
1389 (Sized_relobj::Sized_relobj): Initialize new data members.
1390 (Sized_relobj::sized_relobj): New function.
1391 (Sized_relobj::is_output_section_offset_invalid): Move here from
1392 child class.
1393 (Sized_relobj::get_output_section_offset): Likewise.
1394 (Sized_relobj::local_has_got_offset): Likewise.
1395 (Sized_relobj::local_got_offset): Likewise.
1396 (Sized_relobj::set_local_got_offset): Likewise.
1397 (Sized_relobj::do_for_all_local_got_entries): Likewise.
1398 (Sized_relobj::clear_got_offsets): New function.
1399 (Sized_relobj::section_offsets): Move here from child class.
1400 (Sized_relobj::do_output_section_offset): Likewise.
1401 (Sized_relobj::do_set_section_offset): Likewise.
1402 (Sized_relobj::Local_got_offsets): Likewise.
1403 (Sized_relobj::local_got_offsets_): Likewise.
1404 (Sized_relobj::section_offsets_): Likewise.
1405 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
1406 references.
1407 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
1408 class.
1409 (Sized_relobj_file::sized_relobj): New function
1410 (Sized_relobj_file::local_has_got_offset): Move to base class.
1411 (Sized_relobj_file::local_got_offset): Likewise.
1412 (Sized_relobj_file::set_local_got_offset): Likewise.
1413 (Sized_relobj_file::get_output_section_offset): Likewise.
1414 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
1415 (Sized_relobj_file::do_output_section_offset): Likewise.
1416 (Sized_relobj_file::do_set_section_offset): Likewise.
1417 (Sized_relobj_file::Local_got_offsets): Likewise.
1418 (Sized_relobj_file::local_got_offsets_): Likewise.
1419 (Sized_relobj_file::section_offsets_): Likewise.
1420 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
1421 (all constructors).
1422 (set_needs_dynsym_index): Convert relobj to derived class pointer.
1423 (Output_reloc::get_symbol_index): Likewise.
1424 (Output_reloc::local_section_offset): Likewise.
1425 (Output_reloc::get_address): Likewise.
1426 (Output_reloc::symbol_value): Likewise.
1427 (Output_data_got::reserve_slot): Move to class definition.
1428 (Output_data_got::reserve_local): New function.
1429 (Output_data_got::reserve_slot_for_global): Remove.
1430 (Output_data_got::reserve_global): New function.
1431 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
1432 (all constructors, two instantiations).
1433 (Output_reloc::get_relobj): New function (two instantiations).
1434 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
1435 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
1436 (Output_data_reloc::add_global): Adjust type of relobj.
1437 (Output_data_reloc::add_global_relative): Likewise.
1438 (Output_data_reloc::add_symbolless_global_addend): Likewise.
1439 (Output_data_reloc::add_local): Likewise.
1440 (Output_data_reloc::add_local_relative): Likewise.
1441 (Output_data_reloc::add_symbolless_local_addend): Likewise.
1442 (Output_data_reloc::add_local_section): Likewise.
1443 (Output_data_reloc::add_output_section): Likewise.
1444 (Output_data_reloc::add_absolute): Likewise.
1445 (Output_data_reloc::add_target_specific): Likewise.
1446 (Output_data_got::reserve_slot): Move definition here.
1447 (Output_data_got::reserve_local): New function.
1448 (Output_data_got::reserve_global): New function.
1449 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
1450 section_offsets_ with accessor function.
1451 (Sized_relobj_file::write_sections): Likewise.
1452 (Sized_relobj_file::do_relocate_sections): Likewise.
1453 * target.h (Sized_target::reserve_local_got_entry): New function.
1454 (Sized_target::reserve_global_got_entry): New function.
1455 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
1456 (Target_x86_64::reserve_global_got_entry): New function.
1457 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
1458
4829d394
CC
14592011-05-23 Cary Coutant <ccoutant@google.com>
1460
1461 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
1462 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
1463 bit when checking got_type.
1464 * incremental.cc (Sized_incremental_binary::setup_readers):
1465 Store symbol table and string table locations; initialize bit vector
1466 of file status flags.
1467 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
1468 unchanged files.
1469 (Sized_incremental_binary::do_process_got_plt): New function.
1470 (Sized_incremental_binary::get_symtab_view): Use stored locations.
1471 (Output_section_incremental_inputs::set_final_data_size): Record
1472 file index for each input file.
1473 (Output_section_incremental_inputs::write_got_plt): Store file index
1474 instead of input entry offset for each GOT entry.
1475 * incremental.h
1476 (Incremental_input_entry::Incremental_input_entry): Initialize new
1477 data member.
1478 (Incremental_input_entry::set_offset): Store file index.
1479 (Incremental_input_entry::get_file_index): New function.
1480 (Incremental_input_entry::file_index_): New data member.
1481 (Incremental_binary::process_got_plt): New function.
1482 (Incremental_binary::do_process_got_plt): New function.
1483 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1484 data members.
1485 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
1486 (Sized_incremental_binary::set_file_is_unchanged): New function.
1487 (Sized_incremental_binary::file_is_unchanged): New function.
1488 (Sized_incremental_binary::do_process_got_plt): New function.
1489 (Sized_incremental_binary::file_status_): New data member.
1490 (Sized_incremental_binary::main_symtab_loc_): New data member.
1491 (Sized_incremental_binary::main_strtab_loc_): New data member.
1492 * output.cc (Output_data_got::Got_entry::write): Add case
1493 RESERVED_CODE.
1494 (Output_data_got::add_global): Call add_got_entry.
1495 (Output_data_got::add_global_plt): Likewise.
1496 (Output_data_got::add_global_with_rel): Likewise.
1497 (Output_data_got::add_global_with_rela): Likewise.
1498 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
1499 (Output_data_got::add_global_pair_with_rela): Likewise.
1500 (Output_data_got::add_local): Call add_got_entry.
1501 (Output_data_got::add_local_plt): Likewise.
1502 (Output_data_got::add_local_with_rel): Likewise.
1503 (Output_data_got::add_local_with_rela): Likewise.
1504 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
1505 (Output_data_got::add_local_pair_with_rela): Likewise.
1506 (Output_data_got::reserve_slot): New function.
1507 (Output_data_got::reserve_slot_for_global): New function.
1508 (Output_data_got::add_got_entry): New function.
1509 (Output_data_got::add_got_entry_pair): New function.
1510 (Output_section::add_output_section_data): Edit FIXME.
1511 * output.h
1512 (Output_section_data_build::Output_section_data_build): New
1513 constructor with size parameter.
1514 (Output_data_space::Output_data_space): Likewise.
1515 (Output_data_got::Output_data_got): Initialize new data member; new
1516 constructor with size parameter.
1517 (Output_data_got::add_constant): Call add_got_entry.
1518 (Output_data_got::reserve_slot): New function.
1519 (Output_data_got::reserve_slot_for_global): New function.
1520 (class Output_data_got::Got_entry): Add RESERVED_CODE.
1521 (Output_data_got::add_got_entry): New function.
1522 (Output_data_got::add_got_entry_pair): New function.
1523 (Output_data_got::free_list_): New data member.
1524 * target.h (Sized_target::init_got_plt_for_update): New function.
1525 (Sized_target::register_global_plt_entry): New function.
1526 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1527 Initialize new data member; call init; add constructor with PLT count.
1528 (Output_data_plt_x86_64::init): New function.
1529 (Output_data_plt_x86_64::add_relocation): New function.
1530 (Output_data_plt_x86_64::reserve_slot): New function.
1531 (Output_data_plt_x86_64::free_list_): New data member.
1532 (Target_x86_64::init_got_plt_for_update): New function.
1533 (Target_x86_64::register_global_plt_entry): New function.
1534 (Output_data_plt_x86_64::add_entry): Allocate from free list for
1535 incremental updates.
1536 (Output_data_plt_x86_64::add_relocation): New function.
1537 * testsuite/object_unittest.cc (Object_test): Set default options.
1538
ec69d6da
ILT
15392011-05-16 Ian Lance Taylor <iant@google.com>
1540
1541 * options.h (class General_options): Make -i a synonym for -r.
1542
732e31de
ILT
15432011-05-16 Ian Lance Taylor <iant@google.com>
1544
1545 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
1546
403676b5
CC
15472011-05-10 Cary Coutant <ccoutant@google.com>
1548
1549 * object.cc (Sized_relobj::do_count_local_symbols): Check for
1550 strip_all (-s).
1551
5b7b7d6e
ILT
15522011-05-06 Ian Lance Taylor <iant@google.com>
1553
1554 * layout.cc (Layout::layout): If the output section flags change,
1555 update the ordering.
1556
f0f9babf
CC
15572011-04-25 Cary Coutant <ccoutant@google.com>
1558
1559 * incremental-dump.cc (dump_incremental_inputs): Print local
1560 symbol info for each input file.
1561 * incremental.cc
1562 (Output_section_incremental_inputs::set_final_data_size): Add local
1563 symbol info to input file entries in incremental info.
1564 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1565 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
1566 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
1567 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
1568 implementation.
1569 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
1570 (Sized_incr_relobj::do_relocate): Write the local symbols.
1571 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
1572 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
1573 Adjust size of input file header.
1574 (Incremental_inputs_reader::get_local_symbol_offset): New function.
1575 (Incremental_inputs_reader::get_local_symbol_count): New function.
1576 (Incremental_inputs_reader::get_input_section): Adjust size of input
1577 file header.
1578 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
1579 (Sized_incr_relobj::This): New typedef.
1580 (Sized_incr_relobj::sym_size): New const data member.
1581 (Sized_incr_relobj::Local_symbol): New struct.
1582 (Sized_incr_relobj::do_output_local_symbol_count): New function.
1583 (Sized_incr_relobj::do_local_symbol_offset): New function.
1584 (Sized_incr_relobj::local_symbol_count_): New data member.
1585 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
1586 (Sized_incr_relobj::local_symbol_index_): New data member.
1587 (Sized_incr_relobj::local_symbol_offset_): New data member.
1588 (Sized_incr_relobj::local_dynsym_offset_): New data member.
1589 (Sized_incr_relobj::local_symbols_): New data member.
1590 * object.h (Relobj::output_local_symbol_count): New function.
1591 (Relobj::local_symbol_offset): New function.
1592 (Relobj::do_output_local_symbol_count): New function.
1593 (Relobj::do_local_symbol_offset): New function.
1594 (Sized_relobj::do_output_local_symbol_count): New function.
1595 (Sized_relobj::do_local_symbol_offset): New function.
1596
d0a9ace3
ILT
15972011-04-22 Vladimir Simonov <sv@sw.ru>
1598
1599 * descriptors.cc (set_close_on_exec): New function.
1600 (Descriptors::open): Use set_close_on_exec.
1601 * output.cc (S_ISLNK): Define if not defined.
1602
94a3fc8b
CC
16032011-04-22 Cary Coutant <ccoutant@google.com>
1604
1605 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
1606 global symbol map.
1607 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1608 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
1609 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
1610 relocations.
1611 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
1612 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
1613 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
1614 * incremental.h
1615 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
1616 function.
1617 (Incremental_binary::apply_incremental_relocs): New function.
1618 (Incremental_binary::do_apply_incremental_relocs): New function.
1619 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
1620 data member.
1621 (Sized_incremental_binary::add_global_symbol): New function.
1622 (Sized_incremental_binary::global_symbol): New function.
1623 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
1624 (Sized_incremental_binary::symbol_map_): New data member.
1625 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
1626 * target.h (Sized_target::apply_relocation): New function.
1627 * target-reloc.h (apply_relocation): New function.
1628 * x86_64.cc (Target_x86_64::apply_relocation): New function.
1629
c87e4302
DK
16302011-04-22 Doug Kwan <dougkwan@google.com>
1631
1632 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
1633 flag of a SHT_ARM_EXIDX section.
1634 * testsuite/Makefile.am (arm_exidx_test): New test rules.
1635 * testsuite/Makefile.in: Regenerate.
1636 * testsuite/arm_exidx_test.s: New file.
1637 * testsuite/arm_exidx_test.sh: Same.
1638
e7782cf6
CC
16392011-04-20 Cary Coutant <ccoutant@google.com>
1640
1641 PR gold/12689
1642 * archive.h (Incremental_archive_entry::Archive_member):
1643 Initialize arg_serial_ (second constructor).
1644
308ecdc7
ILT
16452011-04-17 Ian Lance Taylor <iant@google.com>
1646
1647 * object.cc (Relocate_info::location): Simplify location string.
1648 * errors.cc (Errors::error_at_location): Don't print program
1649 name.
1650 (Errors::warning_at_location): Likewise.
1651 (Errors::undefined_symbol): Likewise.
1652 * testsuite/debug_msg.sh: Update accordingly.
1653
bec5b579
CC
16542011-04-14 Cary Coutant <ccoutant@google.com>
1655
1656 * gold/layout.cc (Layout::symtab_section_offset): New function.
1657 * gold/layout.h (Layout::symtab_section_offset): New function.
1658 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
1659
88597d34
ILT
16602011-04-12 Ian Lance Taylor <iant@google.com>
1661
1662 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
1663 with MREMAP_MAYMOVE.
1664 * output.h (class Output_file): Add map_is_allocated_ field.
1665 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
1666 not available, provide stubs. If mremap is not available, #define
1667 it to gold_mremap.
1668 (MREMAP_MAYMOVE): Define if not defined.
1669 (Output_file::Output_file): Initialize map_is_allocated_.
1670 (Output_file::resize): Check map_is_allocated_.
1671 (Output_file::map_anonymous): If mmap fails, use malloc.
1672 (Output_file::unmap): Don't do anything for an anonymous map.
1673 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
1674 is not available, provide stubs.
1675 (File_read::View::~View): Use free rather than delete[].
1676 (File_read::make_view): Use malloc rather than new[]. If mmap
1677 fails, use malloc.
1678 (File_read::find_or_make_view): Use malloc rather than new[].
1679 * gold.h: Remove HAVE_REMAP code.
1680 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
1681 exists. Rename mremap to gold_mremap. If mmap is not available
1682 don't do anything.
1683 * configure, config.in: Rebuild.
1684
11e361bc
ILT
16852011-04-11 Ian Lance Taylor <iant@google.com>
1686
1687 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
1688 initialize local variable v.
1689
cdc29364
CC
16902011-04-11 Cary Coutant <ccoutant@google.com>
1691
1692 * archive.cc (Archive::include_member): Adjust call to
1693 report_object.
1694 (Add_archive_symbols::run): Track argument serial numbers.
1695 (Lib_group::include_member): Likewise.
1696 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
1697 * archive.h (Incremental_archive_entry::Archive_member):
1698 Initialize arg_serial_.
1699 (Archive_member::arg_serial_): New data member.
1700 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
1701 (Sized_dynobj::do_add_symbols): Track symbols when doing an
1702 incremental link.
1703 (Sized_dynobj::do_for_all_local_got_entries): New function.
1704 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
1705 function.
1706 * fileread.cc (get_mtime): New function.
1707 * fileread.h (get_mtime): New function.
1708 * gold.cc (queue_initial_tasks): Check for incremental update.
1709 (process_incremental_input): New function.
1710 (queue_middle_tasks): Don't force valid target for incremental
1711 update.
1712 * incremental-dump.cc (find_input_containing_global): Adjust
1713 size of symbol info entry.
1714 (dump_incremental_inputs): Dump argument serial number and
1715 in_system_directory flag; bias shndx by 1; print symbol names
1716 when dumping per-file symbol lists; use new symbol info readers.
1717 * incremental.cc
1718 (Output_section_incremental_inputs:update_data_size): New function.
1719 (Sized_incremental_binary::setup_readers): Setup input readers
1720 for each input file; build maps for files added from libraries
1721 and scripts.
1722 (Sized_incremental_binary::check_input_args): New function.
1723 (Sized_incremental_binary::do_check_inputs): Build map of argument
1724 serial numbers to input arguments.
1725 (Sized_incremental_binary::do_file_has_changed): Rename
1726 do_file_is_unchanged to this; compare file modification times.
1727 (Sized_incremental_binary::do_init_layout): New function.
1728 (Sized_incremental_binary::do_reserve_layout): New function.
1729 (Sized_incremental_binary::do_get_input_reader): Remove.
1730 (Sized_incremental_binary::get_symtab_view): New function.
1731 (Incremental_checker::can_incrementally_link_output_file): Remove.
1732 (Incremental_inputs::report_command_line): Exclude --debug options.
1733 (Incremental_inputs::report_archive_begin): Add parameter; track
1734 argument serial numbers; don't put input file entry for archive
1735 before archive members.
1736 (Incremental_inputs::report_archive_end): Put input file entry
1737 for archive after archive members.
1738 (Incremental_inputs::report_object): Add parameter; track argument
1739 serial numbers and in_system_directory flag.
1740 (Incremental_inputs::report_script): Add parameter; track argument
1741 serial numbers.
1742 (Output_section_incremental_inputs::set_final_data_size): Adjust
1743 size of symbol info entry; check for forwarding symbols.
1744 (Output_section_incremental_inputs::write_input_files): Write
1745 in_system_directory flag and argument serial number.
1746 (Output_section_incremental_inputs::write_info_blocks): Map section
1747 indices between incremental info and original input file; store
1748 input section index for each symbol.
1749 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
1750 change operator() to visit().
1751 (class Global_got_offset_visitor): Likewise.
1752 (class Global_symbol_visitor_got_plt):
1753 (Output_section_incremental_inputs::write_got_plt): Use new visitor
1754 classes.
1755 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
1756 (Sized_incr_relobj::do_read_symbols): New function.
1757 (Sized_incr_relobj::do_layout): New function.
1758 (Sized_incr_relobj::do_layout_deferred_sections): New function.
1759 (Sized_incr_relobj::do_add_symbols): New function.
1760 (Sized_incr_relobj::do_should_include_member): New function.
1761 (Sized_incr_relobj::do_for_all_global_symbols): New function.
1762 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
1763 (Sized_incr_relobj::do_section_size): New function.
1764 (Sized_incr_relobj::do_section_name): New function.
1765 (Sized_incr_relobj::do_section_contents): New function.
1766 (Sized_incr_relobj::do_section_flags): New function.
1767 (Sized_incr_relobj::do_section_entsize): New function.
1768 (Sized_incr_relobj::do_section_address): New function.
1769 (Sized_incr_relobj::do_section_type): New function.
1770 (Sized_incr_relobj::do_section_link): New function.
1771 (Sized_incr_relobj::do_section_info): New function.
1772 (Sized_incr_relobj::do_section_addralign): New function.
1773 (Sized_incr_relobj::do_initialize_xindex): New function.
1774 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
1775 (Sized_incr_relobj::do_read_relocs): New function.
1776 (Sized_incr_relobj::do_gc_process_relocs): New function.
1777 (Sized_incr_relobj::do_scan_relocs): New function.
1778 (Sized_incr_relobj::do_count_local_symbols): New function.
1779 (Sized_incr_relobj::do_finalize_local_symbols): New function.
1780 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
1781 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
1782 (Sized_incr_relobj::do_relocate): New function.
1783 (Sized_incr_relobj::do_set_section_offset): New function.
1784 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
1785 (Sized_incr_dynobj::do_read_symbols): New function.
1786 (Sized_incr_dynobj::do_layout): New function.
1787 (Sized_incr_dynobj::do_add_symbols): New function.
1788 (Sized_incr_dynobj::do_should_include_member): New function.
1789 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1790 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1791 (Sized_incr_dynobj::do_section_size): New function.
1792 (Sized_incr_dynobj::do_section_name): New function.
1793 (Sized_incr_dynobj::do_section_contents): New function.
1794 (Sized_incr_dynobj::do_section_flags): New function.
1795 (Sized_incr_dynobj::do_section_entsize): New function.
1796 (Sized_incr_dynobj::do_section_address): New function.
1797 (Sized_incr_dynobj::do_section_type): New function.
1798 (Sized_incr_dynobj::do_section_link): New function.
1799 (Sized_incr_dynobj::do_section_info): New function.
1800 (Sized_incr_dynobj::do_section_addralign): New function.
1801 (Sized_incr_dynobj::do_initialize_xindex): New function.
1802 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1803 (make_sized_incremental_object): New function.
1804 (Incremental_library::copy_unused_symbols): New function.
1805 (Incremental_library::do_for_all_unused_symbols): New function.
1806 * incremental.h (enum Incremental_input_flags): New type.
1807 (class Incremental_checker): Remove.
1808 (Incremental_input_entry::Incremental_input_entry): Add argument
1809 serial number.
1810 (Incremental_input_entry::arg_serial): New function.
1811 (Incremental_input_entry::set_is_in_system_directory): New function.
1812 (Incremental_input_entry::is_in_system_directory): New function.
1813 (Incremental_input_entry::arg_serial_): New data member.
1814 (Incremental_input_entry::is_in_system_directory_): New data member.
1815 (class Script_info): Move here from script.h.
1816 (Script_info::Script_info): Add filename parameter.
1817 (Script_info::filename): New function.
1818 (Script_info::filename_): New data member.
1819 (Incremental_script_entry::Incremental_script_entry): Add argument
1820 serial number.
1821 (Incremental_object_entry::Incremental_object_entry): Likewise.
1822 (Incremental_object_entry::add_input_section): Build list of input
1823 sections with map to original shndx.
1824 (Incremental_object_entry::get_input_section_index): New function.
1825 (Incremental_object_entry::shndx_): New data member.
1826 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1827 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1828 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1829 serial number.
1830 (Incremental_inputs::report_archive_begin): Likewise.
1831 (Incremental_inputs::report_object): Likewise.
1832 (Incremental_inputs::report_script): Likewise.
1833 (class Incremental_global_symbol_reader): New class.
1834 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1835 and store flags and input file type.
1836 (Incremental_input_entry_reader::arg_serial): New function.
1837 (Incremental_input_entry_reader::type): Extract type from flags.
1838 (Incremental_input_entry_reader::is_in_system_directory): New function.
1839 (Incremental_input_entry_reader::get_input_section_count): Call
1840 accessor function for type.
1841 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1842 function for type; adjust size of global symbol entry.
1843 (Incremental_input_entry_reader::get_global_symbol_count): Call
1844 accessor function for type.
1845 (Incremental_input_entry_reader::get_object_count): Likewise.
1846 (Incremental_input_entry_reader::get_object_offset): Likewise.
1847 (Incremental_input_entry_reader::get_member_count): Likewise.
1848 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1849 (Incremental_input_entry_reader::get_member_offset): Likewise.
1850 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1851 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1852 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1853 (Incremental_input_entry_reader::get_global_symbol_reader): New
1854 function.
1855 (Incremental_input_entry_reader::get_output_symbol_index): New
1856 function.
1857 (Incremental_input_entry_reader::type_): Remove.
1858 (Incremental_input_entry_reader::flags_): New data member.
1859 (Incremental_inputs_reader::input_file_offset): New function.
1860 (Incremental_inputs_reader::input_file_index): New function.
1861 (Incremental_inputs_reader::input_file): Call input_file_offset.
1862 (Incremental_inputs_reader::input_file_at_offset): New function.
1863 (Incremental_relocs_reader::get_r_type): Reformat.
1864 (Incremental_relocs_reader::get_r_shndx): Reformat.
1865 (Incremental_relocs_reader::get_r_offset): Reformat.
1866 (Incremental_relocs_reader::data): New function.
1867 (Incremental_binary::Incremental_binary): Initialize new data members.
1868 (Incremental_binary::check_inputs): Add cmdline parameter.
1869 (Incremental_binary::file_is_unchanged): Remove.
1870 (Input_reader::arg_serial): New function.
1871 (Input_reader::get_unused_symbol_count): New function.
1872 (Input_reader::get_unused_symbol): New function.
1873 (Input_reader::do_arg_serial): New function.
1874 (Input_reader::do_get_unused_symbol_count): New function.
1875 (Input_reader::do_get_unused_symbol): New function.
1876 (Incremental_binary::input_file_count): New function.
1877 (Incremental_binary::get_input_reader): Change signature to use
1878 index instead of filename.
1879 (Incremental_binary::file_has_changed): New function.
1880 (Incremental_binary::get_input_argument): New function.
1881 (Incremental_binary::get_library): New function.
1882 (Incremental_binary::get_script_info): New function.
1883 (Incremental_binary::init_layout): New function.
1884 (Incremental_binary::reserve_layout): New function.
1885 (Incremental_binary::output_file): New function.
1886 (Incremental_binary::do_check_inputs): New function.
1887 (Incremental_binary::do_file_is_unchanged): Remove.
1888 (Incremental_binary::do_file_has_changed): New function.
1889 (Incremental_binary::do_init_layout): New function.
1890 (Incremental_binary::do_reserve_layout): New function.
1891 (Incremental_binary::do_input_file_count): New function.
1892 (Incremental_binary::do_get_input_reader): Change signature.
1893 (Incremental_binary::input_args_map_): New data member.
1894 (Incremental_binary::library_map_): New data member.
1895 (Incremental_binary::script_map_): New data member.
1896 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1897 new data members.
1898 (Sized_incremental_binary::output_section): New function.
1899 (Sized_incremental_binary::inputs_reader): Add const.
1900 (Sized_incremental_binary::symtab_reader): Add const.
1901 (Sized_incremental_binary::relocs_reader): Add const.
1902 (Sized_incremental_binary::got_plt_reader): Add const.
1903 (Sized_incremental_binary::get_symtab_view): New function.
1904 (Sized_incremental_binary::Inputs_reader): New typedef.
1905 (Sized_incremental_binary::Input_entry_reader): New typedef.
1906 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1907 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1908 (Sized_incremental_binary::do_file_has_changed): New function.
1909 (Sized_incremental_binary::do_init_layout): New function.
1910 (Sized_incremental_binary::do_reserve_layout): New function.
1911 (Sized_input_reader::Inputs_reader): Remove.
1912 (Sized_input_reader::Input_entry_reader): Remove.
1913 (Sized_input_reader::do_arg_serial): New function.
1914 (Sized_input_reader::do_get_unused_symbol_count): New function.
1915 (Sized_input_reader::do_get_unused_symbol): New function.
1916 (Sized_incremental_binary::do_input_file_count): New function.
1917 (Sized_incremental_binary::do_get_input_reader): Change signature;
1918 use index instead of filename.
1919 (Sized_incremental_binary::section_map_): New data member.
1920 (Sized_incremental_binary::input_entry_readers_): New data member.
1921 (class Sized_incr_relobj): New class.
1922 (class Sized_incr_dynobj): New class.
1923 (make_sized_incremental_object): New function.
1924 (class Incremental_library): New class.
1925 * layout.cc (Free_list::num_lists): New static data member.
1926 (Free_list::num_nodes): New static data member.
1927 (Free_list::num_removes): New static data member.
1928 (Free_list::num_remove_visits): New static data member.
1929 (Free_list::num_allocates): New static data member.
1930 (Free_list::num_allocate_visits): New static data member.
1931 (Free_list::init): New function.
1932 (Free_list::remove): New function.
1933 (Free_list::allocate): New function.
1934 (Free_list::dump): New function.
1935 (Free_list::print_stats): New function.
1936 (Layout_task_runner::run): Resize output file for incremental updates.
1937 (Layout::Layout): Initialize new data members.
1938 (Layout::set_incremental_base): New function.
1939 (Layout::init_fixed_output_section): New function.
1940 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1941 incremental updates.
1942 (Layout::create_gold_note): Do not create gold note section for
1943 incremental updates.
1944 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1945 for incremental updates.
1946 (Layout::set_section_offsets): For incremental updates, allocate space
1947 from free list.
1948 (Layout::create_symtab_sections): Layout with offsets relative to
1949 start of section; for incremental updates, allocate space from free
1950 list.
1951 (Layout::create_shdrs): For incremental updates, allocate space from
1952 free list.
1953 (Layout::finish_dynamic_section): For incremental updates, do not
1954 check --as-needed (fixed in subsequent patch).
1955 * layout.h (class Free_list): New class.
1956 (Layout::set_incremental_base): New function.
1957 (Layout::incremental_base): New function.
1958 (Layout::init_fixed_output_section): New function.
1959 (Layout::allocate): New function.
1960 (Layout::incremental_base_): New data member.
1961 (Layout::free_list_): New data member.
1962 * main.cc (main): Print Free_list statistics.
1963 * object.cc (Relobj::finalize_incremental_relocs): Add
1964 clear_counts parameter; clear counts only when clear_counts is set.
1965 (Sized_relobj::Sized_relobj): Initialize new base class.
1966 (Sized_relobj::do_layout): Don't report special sections.
1967 (Sized_relobj::do_for_all_local_got_entries): New function.
1968 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1969 symtab_off to all symbol table offsets.
1970 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1971 * object.h (class Got_offset_list): Move to top of file.
1972 (Object::Object): Allow case where input_file == NULL.
1973 (Object::~Object): Likewise.
1974 (Object::input_file): Assert that input_file != NULL.
1975 (Object::lock): Allow case where input_file == NULL.
1976 (Object::unlock): Likewise.
1977 (Object::is_locked): Likewise.
1978 (Object::token): Likewise.
1979 (Object::release): Likewise.
1980 (Object::is_incremental): New function.
1981 (Object::get_mtime): New function.
1982 (Object::for_all_local_got_entries): New function.
1983 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1984 (Object::set_is_in_system_directory): New function.
1985 (Object::is_in_system_directory): New function.
1986 (Object::do_is_incremental): New function.
1987 (Object::do_get_mtime): New function.
1988 (Object::do_for_all_local_got_entries): New function.
1989 (Object::is_in_system_directory_): New data member.
1990 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1991 (class Sized_relobj_base): New class.
1992 (class Sized_relobj): Derive from Sized_relobj_base.
1993 (class Sized_relobj::Symbols): Redeclare from base class.
1994 (class Sized_relobj::local_got_offset_list): Remove.
1995 (class Sized_relobj::Output_sections): Redeclare from base class.
1996 (class Sized_relobj::do_for_all_local_got_entries): New function.
1997 (class Sized_relobj::write_local_symbols): Add offset parameter.
1998 (class Sized_relobj::local_symbol_offset_): Update comment.
1999 (class Sized_relobj::local_dynsym_offset_): Update comment.
2000 * options.cc (Input_arguments::add_file): Remove const.
2001 * options.h (Input_file_argument::Input_file_argument):
2002 Initialize arg_serial_ (all constructors).
2003 (Input_file_argument::set_arg_serial): New function.
2004 (Input_file_argument::arg_serial): New function.
2005 (Input_file_argument::arg_serial_): New data member.
2006 (Input_arguments::Input_arguments): Initialize file_count_.
2007 (Input_arguments::add_file): Remove const.
2008 (Input_arguments::number_of_input_files): New function.
2009 (Input_arguments::file_count_): New data member.
2010 (Command_line::number_of_input_files): Call
2011 Input_arguments::number_of_input_files.
2012 * output.cc (Output_segment_headers::Output_segment_headers):
2013 Set current size.
2014 (Output_section::Input_section::current_data_size): New function.
2015 (Output_section::Output_section): Initialize new data members.
2016 (Output_section::add_input_section): Don't do merge sections for
2017 an incremental link; allocate space from free list for an
2018 incremental update.
2019 (Output_section::add_output_section_data): Allocate space from
2020 free list for an incremental update.
2021 (Output_section::update_data_size): New function.
2022 (Output_section::set_fixed_layout): New function.
2023 (Output_section::reserve): New function.
2024 (Output_segment::set_section_addresses): Remove const.
2025 (Output_segment::set_section_list_addresses): Remove const; allocate
2026 space from free list for an incremental update.
2027 (Output_segment::set_offset): Adjust size of RELRO segment for an
2028 incremental update.
2029 * output.h (Output_data::current_data_size): Move here from
2030 child classes.
2031 (Output_data::pre_finalize_data_size): New function.
2032 (Output_data::update_data_size): New function.
2033 (Output_section_headers::update_data_size): new function.
2034 (Output_section_data_build::current_data_size): Move to Output_data.
2035 (Output_data_strtab::update_data_size): New function.
2036 (Output_section::current_data_size): Move to Output_data.
2037 (Output_section::set_fixed_layout): New function.
2038 (Output_section::has_fixed_layout): New function.
2039 (Output_section::reserve): New function.
2040 (Output_section::update_data_size): New function.
2041 (Output_section::has_fixed_layout_): New data member.
2042 (Output_section::free_list_): New data member.
2043 (Output_segment::set_section_addresses): Remove const.
2044 (Output_segment::set_section_list_addresses): Remove const.
2045 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
2046 New function.
2047 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
2048 New function.
2049 * readsyms.cc (Read_symbols::do_read_symbols): Add library
2050 parameter when calling Add_symbols constructor; store argument
2051 serial number for members of a lib group.
2052 (Add_symbols::locks): Allow case where token == NULL.
2053 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
2054 (Read_member::~Read_member): New function.
2055 (Read_member::is_runnable): New function.
2056 (Read_member::locks): New function.
2057 (Read_member::run): New function.
2058 (Check_script::~Check_script): New function.
2059 (Check_script::is_runnable): New function.
2060 (Check_script::locks): New function.
2061 (Check_script::run): New function.
2062 (Check_library::~Check_library): New function.
2063 (Check_library::is_runnable): New function.
2064 (Check_library::locks): New function.
2065 (Check_library::run): New function.
2066 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
2067 (Add_symbols::library_): New data member.
2068 (class Read_member): New class.
2069 (class Check_script): New class.
2070 (class Check_library): New class.
2071 * reloc.cc (Read_relocs::is_runnable): Allow case where
2072 token == NULL.
2073 (Read_relocs::locks): Likewise.
2074 (Scan_relocs::locks): Likewise.
2075 (Relocate_task::locks): Likewise.
2076 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
2077 to clear counters.
2078 (Sized_relobj::incremental_relocs_scan): Fix comment.
2079 (Sized_relobj::do_relocate): Pass output file offset to
2080 write_local_symbols.
2081 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
2082 from class declaration.
2083 * script.cc (read_input_script): Allocate Script_info; pass
2084 argument serial number to report_script.
2085 * script.h (class Script_info): Move to incremental.h.
2086 * symtab.cc (Symbol_table::add_from_incrobj): New function.
2087 * symtab.h (Symbol_table::add_from_incrobj): New function.
2088 (Symbol_table::set_file_offset): New function.
2089
b961d0d7
CC
20902011-04-05 Cary Coutant <ccoutant@google.com>
2091
2092 * incremental-dump.cc (dump_incremental_inputs): Change signature
2093 to take a Sized_incremental_binary; change caller. Use readers
2094 in Sized_incremental_binary.
2095 * incremental.cc
2096 (Sized_incremental_binary::find_incremental_inputs_sections):
2097 Rename do_find_incremental_inputs_sections to this.
2098 (Sized_incremental_binary::setup_readers): New function.
2099 (Sized_incremental_binary::do_check_inputs): Check
2100 has_incremental_info_ flag; move setup code to setup_readers;
2101 use input readers.
2102 (Sized_incremental_binary::do_file_is_unchanged): New function.
2103 (Sized_incremental_binary::do_get_input_reader): New function.
2104 * incremental.h (class Incremental_binary): Move to end of file.
2105 (Incremental_binary::file_is_unchanged): New function.
2106 (Incremental_binary::do_file_is_unchanged): New function.
2107 (Incremental_binary::Input_reader): New class.
2108 (Incremental_binary::get_input_reader): New function.
2109 (class Sized_incremental_binary): Move to end of file.
2110 (Sized_incremental_binary::Sized_incremental_binary): Setup the
2111 input section reader classes.
2112 (Sized_incremental_binary::has_incremental_info): New function.
2113 (Sized_incremental_binary::inputs_reader): New function.
2114 (Sized_incremental_binary::symtab_reader): New function.
2115 (Sized_incremental_binary::relocs_reader): New function.
2116 (Sized_incremental_binary::got_plt_reader): New function.
2117 (Sized_incremental_binary::do_file_is_unchanged): New function.
2118 (Sized_incremental_binary::Sized_input_reader): New class.
2119 (Sized_incremental_binary::get_input_reader): New function.
2120 (Sized_incremental_binary::find_incremental_inputs_sections):
2121 Rename do_find_incremental_inputs_sections to this.
2122 (Sized_incremental_binary::setup_readers): New function.
2123 (Sized_incremental_binary::has_incremental_info_): New data member.
2124 (Sized_incremental_binary::inputs_reader_): New data member.
2125 (Sized_incremental_binary::symtab_reader_): New data member.
2126 (Sized_incremental_binary::relocs_reader_): New data member.
2127 (Sized_incremental_binary::got_plt_reader_): New data member.
2128 (Sized_incremental_binary::current_input_file_): New data member.
2129
a869183f
PP
21302011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
2131
2132 PR gold/12640
2133 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
2134 violation.
2135
21362011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
2137
2138 * archive.cc (Archive::include_member): Adjust call to report_object.
2139 (Add_archive_symbols::run): Add script_info to call to
2140 report_archive_begin.
2141 (Lib_group::include_member): Adjust call to report_object.
2142 (Add_lib_group_symbols::run): Adjust call to report_object.
2143 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
2144 blocks. Add object count for script input files.
2145 * incremental.cc (Incremental_inputs::report_archive_begin): Add
2146 script_info parameter; change all callers.
2147 (Incremental_inputs::report_object): Add script_info parameter;
2148 change all callers.
2149 (Incremental_inputs::report_script): Store backpointer to
2150 incremental info entry.
2151 (Output_section_incremental_inputs::set_final_data_size): Record
2152 additional information for scripts.
2153 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2154 * incremental.h (Incremental_script_entry::add_object): New function.
2155 (Incremental_script_entry::get_object_count): New function.
2156 (Incremental_script_entry::get_object): New function.
2157 (Incremental_script_entry::objects_): New data member; adjust
2158 constructor.
2159 (Incremental_inputs::report_archive_begin): Add script_info parameter.
2160 (Incremental_inputs::report_object): Add script_info parameter.
2161 (Incremental_inputs_reader::get_object_count): New function.
2162 (Incremental_inputs_reader::get_object_offset): New function.
2163 * options.cc (Input_arguments::add_file): Return reference to
2164 new input argument.
2165 * options.h (Input_argument::set_script_info): New function.
2166 (Input_argument::script_info): New function.
2167 (Input_argument::script_info_): New data member; adjust all
2168 constructors.
2169 (Input_file_group::add_file): Return reference to new input argument.
2170 (Input_file_lib::add_file): Likewise.
2171 (Input_arguments::add_file): Likewise.
2172 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
2173 * script.cc (Parser_closure::Parser_closure): Add script_info
2174 parameter; adjust all callers.
2175 (Parser_closure::script_info): New function.
2176 (Parser_closure::script_info_): New data member.
2177 (read_input_script): Report scripts earlier to incremental info.
2178 (script_add_file): Set script_info in Input_argument.
2179 (script_add_library): Likewise.
2180 * script.h (Script_options::Script_info): Rewrite class.
2181
a869183f 21822011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
2183
2184 * archive.cc (Library_base::should_include_member): Move
2185 method here from class Archive.
2186 (Archive::Archive): Initialize base class.
2187 (Archive::should_include_member): Move to base class.
2188 (Archive::do_for_all_unused_symbols): New function.
2189 (Add_archive_symbols::run): Remove redundant access to
2190 incremental_inputs.
2191 (Lib_group::Lib_group): Initialize base class.
2192 (Lib_group::do_filename): New function.
2193 (Lib_group::include_member): Pass pointer to Lib_group to
2194 report_object.
2195 (Lib_group::do_for_all_unused_symbols): New function.
2196 (Add_lib_group_symbols::run): Report archive information for
2197 incremental links.
2198 * archive.h (class Library_base): New base class.
2199 (class Archive): Derive from Library_base.
2200 (Archive::filename): Move to base class.
2201 (Archive::set_incremental_info): Likewise.
2202 (Archive::incremental_info): Likewise.
2203 (Archive::Should_include): Likewise.
2204 (Archive::should_include_member): Likewise.
2205 (Archive::Armap_entry): Remove.
2206 (Archive::Unused_symbol_iterator): Remove.
2207 (Archive::unused_symbols_begin): Remove.
2208 (Archive::unused_symbols_end): Remove.
2209 (Archive::do_filename): New function.
2210 (Archive::do_get_mtime): New function.
2211 (Archive::do_for_all_unused_symbols): New function.
2212 (Archive::task_): Move to base class.
2213 (Archive::incremental_info_): Likewise.
2214 (class Lib_group): Derive from Library_base.
2215 (Lib_group::do_filename): New function.
2216 (Lib_group::do_get_mtime): New function.
2217 (Lib_group::do_for_all_unused_symbols): New function.
2218 (Lib_group::task_): Move to base class.
2219 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
2220 function.
2221 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
2222 function.
2223 * incremental.cc (Incremental_inputs::report_archive_begin):
2224 Use Library_base; call library's get_mtime; add incremental inputs
2225 entry before members.
2226 (class Unused_symbol_visitor): New class.
2227 (Incremental_inputs::report_archive_end): Use Library_base; use
2228 visitor class to record unused symbols; don't add incremental inputs
2229 entry after members.
2230 (Incremental_inputs::report_object): Use Library_base.
2231 * incremental.h
2232 (Incremental_archive_entry::Incremental_archive_entry): Remove
2233 unused Archive parameter.
2234 (Incremental_inputs::report_archive_begin): Use Library_base.
2235 (Incremental_inputs::report_archive_end): Likewise.
2236 (Incremental_inputs::report_object): Likewise.
2237 * object.cc (Sized_relobj::do_for_all_global_symbols): New
2238 function.
2239 * object.h (Object::for_all_global_symbols): New function.
2240 (Object::do_for_all_global_symbols): New function.
2241 (Sized_relobj::do_for_all_global_symbols): New function.
2242 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
2243 function.
2244 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
2245 function.
2246
61ab3e40
ILT
22472011-03-27 Ian Lance Taylor <iant@google.com>
2248
2249 * archive.cc (Archive::interpret_header): Return -1 if something
2250 goes wrong. Change callers accordingly.
2251
30e1f9e6
CC
22522011-03-25 Cary Coutant <ccoutant@google.com>
2253
2254 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
2255 * testsuite/Makefile.in: Regenerate.
2256
9370ce59 22572011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
2258
2259 * plugin.cc (get_view): New.
2260 (Plugin::load): Pass get_view to the plugin.
2261 (Plugin_manager::get_view): New.
2262
9312bb0a
ILT
22632011-03-21 Ian Lance Taylor <iant@google.com>
2264
2265 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 2266 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 2267
7e12ba9e
ST
22682011-03-21 Sriraman Tallam <tmsriram@google.com>
2269
2270 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
2271 Change == to -eq.
2272 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
2273 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
2274 Change == to -eq.
2275 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
2276 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
2277
fd7a005d
ILT
22782011-03-14 Ian Lance Taylor <iant@google.com>
2279
2280 * script-sections.cc (Sort_output_sections::script_compare):
2281 Rename from is_before, change return type.
2282 (Sort_output_sections::operator()): Adjust accordingly.
2283
ed16fd1b
ILT
22842011-03-11 Jeffrey Yasskin <jyasskin@google.com>
2285
2286 PR gold/12572
2287 * testsuite/odr_violation2.cc: Add comment to make all error line
2288 numbers double digits.
2289 * testsuite/debug_msg.sh: Adjust expected errors.
2290
71ff8986
ILT
22912011-03-09 Jeffrey Yasskin <jyasskin@google.com>
2292
2293 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
2294 but mark earlier ones as non-canonical
2295 (offset_to_iterator): Update search target and example
2296 (do_addr2line): Return extra lines in a vector*
2297 (format_file_lineno): Extract from do_addr2line
2298 (one_addr2line): Add vector* out-param
2299 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
2300 when a lineno entry appeared last for its instruction
2301 (Dwarf_line_info): Add vector* out-param
2302 * object.cc (Relocate_info): Pass NULL for the vector* out-param
2303 * symtab.cc (Odr_violation_compare): Include the lineno in the
2304 comparison again.
2305 (linenos_from_loc): New. Combine the canonical line for an
2306 address with its other lines.
2307 (True_if_intersect): New. Helper functor to make
2308 std::set_intersection a query.
2309 (detect_odr_violations): Compare sets of lines instead of just
2310 one line for each function. This became less deterministic, but
2311 has fewer false positives.
2312 * symtab.h: Declarations.
2313 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
2314 mix an optimized and non-optimized object in the same binary
2315 (odr_violation2.so): Same.
2316 * testsuite/Makefile.in: Regenerate from Makefile.am.
2317 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
2318 * testsuite/debug_msg.sh: Update line numbers and add
2319 assertions.
2320 * testsuite/odr_violation1.cc: Use OdrDerived, in a
2321 non-optimized context.
2322 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
2323 isn't inlined, and use OdrDerived in an optimized context.
2324 * testsuite/odr_header1.h: Defines OdrDerived, where
2325 optimization will change the
2326 first-instruction-in-the-destructor's file and line number.
2327 * testsuite/odr_header2.h: Defines OdrBase.
2328
a19fefdc
ILT
23292011-03-09 Ian Lance Taylor <iant@google.com>
2330
2331 * fileread.cc (File_read::clear_views): Don't delete the whole
2332 file view.
2333
ecb351e9
ILT
23342011-03-08 Ian Lance Taylor <iant@google.com>
2335
2336 PR gold/12525
2337 * fileread.cc: #include <climits>.
2338 (GOLD_IOV_MAX): Define.
2339 (File_read::read_multiple): Limit number of entries by iov_max.
2340 * fileread.h (class File_read): Always set max_readv_entries to
2341 128.
2342
b821d13c
ILT
23432011-03-07 Ian Lance Taylor <iant@google.com>
2344
2345 PR gold/12525
2346 * options.h (class General_options): Add -dy and -dn.
2347
89243142
CC
23482011-03-02 Cary Coutant <ccoutant@google.com>
2349
2350 * testsuite/script_test_9.t: Add TLS segment.
2351
d0773f31
ILT
23522011-03-02 Simon Baldwin <simonb@google.com>
2353
2354 * configure.ac: Add check for gnu_indirect_function support in
2355 the toolchain building binutils.
2356 * configure: Rebuild.
2357
9370ce59 23582011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
2359
2360 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
2361 plugin only symbols.
2362 (Symbol_table::sized_finalize_symbol) Mark symbol only present
2363 in plugin files as not needed in the symbol table.
2364
4cf7a849
ST
23652011-02-11 Sriraman Tallam <tmsriram@google.com>
2366
2367 * output.cc (Output_section::add_input_section): Delay fill
2368 generation for section ordering.
2369
b578bd7d
ILT
23702011-02-09 Ian Lance Taylor <iant@google.com>
2371
2372 PR gold/12316
2373 * object.h (class Sized_relobj): Remove clear_local_symbols.
2374 * reloc.cc (Sized_relobj::do_relocate): Don't call
2375 clear_local_symbols.
2376
9370ce59 23772011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
2378
2379 * plugin.cc (is_visible_from_outside): Return true for symbols
2380 in the -u option.
2381
55382fb7
ILT
23822011-02-04 Jeffrey Yasskin <jyasskin@google.com>
2383
2384 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
2385 filename.
2386
4e271fff
ST
23872011-02-02 Sriraman Tallam <tmsriram@google.com>
2388
2389 * icf.h (is_section_foldable_candidate): Change type of parameter
2390 to std::string.
2391 * icf.cc (Icf::find_identical_sections): Change type of local variable
2392 section_name to be std::string.
2393 (is_function_ctor_or_dtor): Change type of parameter to std::string.
2394
d433c3ac
ILT
23952011-01-25 Ian Lance Taylor <iant@google.com>
2396
2397 * script.cc (script_add_extern): Rewrite to use
2398 add_symbol_reference.
2399
880473a6
DK
24002011-01-25 Doug Kwan <dougkwan@google.com>
2401
d433c3ac 2402 * icf.cc (get_section_contents): Always lock section's object.
880473a6 2403
f30f86fa
ILT
24042011-01-24 Ian Lance Taylor <iant@google.com>
2405
2406 * options.h (class General_options): Accept
2407 --no-detect-odr-violations.
2408
8e51a0b9
ILT
24092011-01-24 Ian Lance Taylor <iant@google.com>
2410
2411 * version.cc (version_string): Bump to 1.11.
2412
0f3b89d8
ILT
24132011-01-24 Ian Lance Taylor <iant@google.com>
2414
2415 * plugin.cc (class Plugin_rescan): Define new class.
2416 (Plugin_manager::claim_file): Set any_claimed_.
2417 (Plugin_manager::save_archive): New function.
2418 (Plugin_manager::save_input_group): New function.
2419 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
2420 necessary.
2421 (Plugin_manager::new_undefined_symbol): New function.
2422 (Plugin_manager::rescan): New function.
2423 (Plugin_manager::rescannable_defines): New function.
2424 (Plugin_manager::add_input_file): Set any_added_.
2425 * plugin.h (class Plugin_manager): define new fields rescannable_,
2426 undefined_symbols_, any_claimed_, and any_added_. Declare
2427 Plugin_rescan as friend. Declare new functions.
2428 (Plugin_manager::Rescannable): Define type.
2429 (Plugin_manager::Rescannable_list): Define type.
2430 (Plugin_manager::Undefined_symbol_list): Define type.
2431 (Plugin_manager::Plugin_manager): Initialize new fields.
2432 * archive.cc (Archive::defines_symbol): New function.
2433 (Add_archive_symbols::run): Pass archive to plugins if any.
2434 * archive.h (class Archive): Declare defines_symbol.
2435 * readsyms.cc (Input_group::~Input_group): New function.
2436 (Finish_group::run): Pass input_group to plugins if any.
2437 * readsyms.h (class Input_group): Declare destructor.
2438 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
2439 any.
2440
3bb951e5
ILT
24412011-01-10 Ian Lance Taylor <iant@google.com>
2442
2443 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
2444 section as relro.
2445 (Layout::set_segment_offsets): Reset increase_relro before calling
2446 set_section_addresses a second time.
2447
0aa45fac
CC
24482011-01-04 Cary Coutant <ccoutant@google.com>
2449
2450 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
2451 sections before NOBITS sections.
2452
0db46eb4
L
24532011-01-01 H.J. Lu <hongjiu.lu@intel.com>
2454
2455 * version.cc (print_version): Update copyright to 2011.
2456
829c9745
CC
24572010-12-23 Cary Coutant <ccoutant@google.com>
2458
2459 * output.h (Output_data_reloc::add_output_section): Pass OD instead
2460 of OS to this->add. Add OD parameter to second form of the function.
2461
7500420b
ILT
24622010-12-20 Ian Lance Taylor <iant@google.com>
2463
2464 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
2465 second of two consecutive entries with same offset.
2466
f8e9a930
RW
24672010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2468
2469 * testsuite/Makefile.am (ifuncmain2static_LDADD)
2470 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
2471 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
2472 to avoid unneeded links against $(LDADD).
2473 * testsuite/Makefile.in: Regenerate.
2474
2fbb4320
ILT
24752010-12-15 Ian Lance Taylor <iant@google.com>
2476
2477 PR gold/12324
2478 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
2479 for R_X86_64_32 and R_X86_64_PC32.
2480 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
2481 ver_matching_def_pic.o.
2482 (ver_matching_def_pic.o): New target.
2483
fedb228d
RW
24842010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2485
2486 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
2487 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
2488 Move definition before File_read::View member definitions.
2489 (File_read::View::~View): Initialize and hold lock before
2490 updating current_mapped_bytes.
2491
9b547ce6
RW
24922010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2493
2494 * dwarf_reader.cc: Remove outdated comment.
2495 * gold-threads.cc: Fix typo in error message.
2496 * archive.cc: Fix typos in comments.
2497 * archive.h: Likewise.
2498 * arm-reloc-property.cc: Likewise.
2499 * arm-reloc-property.h: Likewise.
2500 * arm-reloc.def: Likewise.
2501 * arm.cc: Likewise.
2502 * attributes.h: Likewise.
2503 * cref.cc: Likewise.
2504 * ehframe.cc: Likewise.
2505 * fileread.h: Likewise.
2506 * gold.h: Likewise.
2507 * i386.cc: Likewise.
2508 * icf.cc: Likewise.
2509 * incremental.h: Likewise.
2510 * int_encoding.cc: Likewise.
2511 * layout.h: Likewise.
2512 * main.cc: Likewise.
2513 * merge.h: Likewise.
2514 * object.cc: Likewise.
2515 * object.h: Likewise.
2516 * options.cc: Likewise.
2517 * readsyms.cc: Likewise.
2518 * reduced_debug_output.cc: Likewise.
2519 * reloc.cc: Likewise.
2520 * script-sections.cc: Likewise.
2521 * sparc.cc: Likewise.
2522 * symtab.h: Likewise.
2523 * target-reloc.h: Likewise.
2524 * target.cc: Likewise.
2525 * target.h: Likewise.
2526 * timer.cc: Likewise.
2527 * timer.h: Likewise.
2528 * x86_64.cc: Likewise.
2529
83e17bd5
CC
25302010-12-09 Cary Coutant <ccoutant@google.com>
2531
2532 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
2533 stack.
2534 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
2535 parameter; change all callers.
2536 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
2537 * options.h (warn_execstack): New option.
2538
017257f8
DK
25392010-12-07 Doug Kwan <dougkwan@google.com>
2540
2541 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
2542 like function call relocations.
2543
c20cbc06
ILT
25442010-12-07 Ian Lance Taylor <iant@google.com>
2545
2546 * archive.cc (Archive::get_elf_object_for_member): Permit
2547 punconfigured to be NULL.
2548 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
2549 (Archive::include_member): Pass NULL to get_elf_object_for_member
2550 if we searched for the archive and this is the first included
2551 object.
2552
4dbfafcc
ILT
25532010-12-01 Ian Lance Taylor <iant@google.com>
2554
2555 * dwarf_reader.h (class Sized_dwarf_line_info): Add
2556 track_relocs_type_ field.
2557 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2558 Set track_relocs_type_.
2559 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
2560 contents when using RELA relocs.
2561 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
2562 reloc_map_.
2563 * reloc.cc (Track_relocs::next_addend): New function.
2564 * reloc.h (class Track_relocs): Declare next_addend.
2565
e5e19edd
ILT
25662010-12-01 Ian Lance Taylor <iant@google.com>
2567
2568 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
2569 virtual destructor.
2570
9a5ce24c
ILT
25712010-12-01 Ian Lance Taylor <iant@google.com>
2572
2573 * README: Update compilers known to work and fail.
2574
c7791212
NC
25752010-11-23 Matthias Klose <doko@ubuntu.com>
2576
2577 * configure.in: For --enable-gold, handle value `default' instead of
2578 `both*'. Always install ld as ld.bfd, install as ld if gold is
2579 not the default.
2580 * configure: Regenerate.
2581
0ad220c9
DK
25822010-11-18 Doug Kwan <dougkwan@google.com>
2583
2584 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
2585 and right_alignment to be zero. Store result alignment only if it is
2586 greater than existing alignment.
2587
ab8056e0
CC
25882010-11-16 Cary Coutant <ccoutant@google.com>
2589
2590 PR gold/12220
2591 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2592 Check for ".zdebug_line".
2593
fd064a5b
CC
25942010-11-16 Doug Kwan <dougkwan@google.com>
2595 Cary Coutant <ccoutant@google.com>
2596
2597 * output.h (Output_segment::set_section_addresses): Pass increase_relro
2598 by reference; adjust all callers.
2599 * output.cc (Output_segment::set_section_addresses): Adjust references
2600 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
2601 list is empty.
2602 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
2603 end at page boundary.
2604
6fc6ea19
CC
26052010-11-16 Cary Coutant <ccoutant@google.com>
2606
2607 PR gold/12220
2608 * layout.cc (Layout::choose_output_section): Transform names of
2609 compressed sections even when using a script with a SECTIONS clause.
2610 (Layout::output_section_name): Remove code to transform
2611 compressed debug section names.
2612 * output.cc (Output_section::add_input_section): Use uncompressed
2613 section size when tracking input sections.
2614
95a2c8d6
RS
26152010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
2616
2617 * symtab.h (Symbol::NON_PIC_REF): Remove.
2618 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
2619 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
2620 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
2621 (Symbol::use_plt_offset): Take a flags argument and pass it
2622 directly to needs_dynamic_reloc. Restrict check for undefined
2623 weak symbols to function calls.
2624 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
2625 (Target_arm::Scan::global): Use it.
2626 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
2627 (Target_arm::Relocate::relocate): Likewise.
2628 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
2629 parameter with an r_type parameter. Use get_reference_flags
2630 to get the flags.
2631 (Target_arm::Relocate::relocate): Update accordingly.
2632 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
2633 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
2634 (Target_i386::Scan::global): Likewise.
2635 (Target_i386::Relocate::relocate): Likewise.
2636 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
2637 parameter with an r_type parameter. Use get_reference_flags
2638 to get the flags.
2639 (Target_i386::Relocate::relocate): Update accordingly.
2640 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
2641 (Target_powerpc::Scan::global): Use it.
2642 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
2643 (Target_powerpc::Relocate::relocate): Likewise.
2644 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
2645 (Target_sparc::Scan::global): Use it.
2646 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
2647 (Target_sparc::Relocate::relocate): Likewise.
2648 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
2649 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
2650 (Target_x86_64::Scan::global): Likewise.
2651 (Target_x86_64::Relocate::relocate): Likewise.
2652
f625ae50
DK
26532010-11-08 Doug Kwan <dougkwan@google.com>
2654 Cary Coutant <ccoutant@google.com>
2655
2656 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
2657 (Arm_exidx_merge_section::section_contents_): New data member.
2658 (Arm_input_section::Arm_input_section): Initialize original_contents_.
2659 (Arm_input_section::~Arm_input_section): De-allocate memory.
2660 (Arm_input_section::original_contents_): New data member.
2661 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
2662 in parameters instead of calling Object::section_contents without
2663 locking.
2664 (Arm_output_section::group_section): New parameter TASK. Pass it
2665 to callees that need locking objects.
2666 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
2667 to lock EXIDX input sections. Fix a formatting issue. Call
2668 Arm_exidx_merged_section::build_contents to create merged section
2669 contents.
2670 (Arm_output_section::create_stub_group): New parameter TASK. Use it
2671 to lock object of stub table owner.
2672 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
2673 TEXT_SIZE to initialize data member TEXT_SIZE_.
2674 (Arm_exidx_input_section::addralign): Fix typo in comment.
2675 (Arm_exidx_input_section::text_size): New method.
2676 (Target_arm::do_relax): New parameter TASK. Pass it to callees
2677 that require locking objects. Lock objects before scanning for stubs
2678 and updating local symbols.
2679 (Arm_input_section<big_endian>::init): Copy contents of original
2680 input section.
2681 (Arm_input_section<big_endian>::do_write): Use saved contents of
2682 original input section instead of calling Object::section_contents
2683 without locking.
2684 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
2685 size without calling Object::section_size().
2686 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
2687 for size. Allocate a buffer for merged EXIDX entries.
2688 (Arm_exidx_merged_section::build_contents): New method.
2689 (Arm_exidx_merged_section::do_write): Move merge section contents
2690 building code to Arm_exidx_merged_section::build_contetns. Write
2691 out contetns in buffer instead of building it on the fly.
2692 (Arm_relobj::make_exidx_input_section): Also pass text section size
2693 to Arm_exidx_input_section constructor.
2694 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
2695 (Arm_dynobj::do_read_symbols): Fix memory leak.
2696 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
2697 * target.h: (class Task): Add forward declaration.
2698 (Target::relax): Add new parameter TASK and pass it to
2699 Target::do_relax().
2700 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
2701
5f9bcf58
CC
27022010-11-05 Cary Coutant <ccoutant@google.com>
2703
2704 PR gold/10708
2705 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
2706 object when reading from the file.
2707 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
2708 second layout pass.
2709 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
2710 when reading section contents.
2711 (get_section_contents): Likewise.
2712 (icf::find_identical_sections): Likewise.
2713 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
2714 object when reading from the file.
2715 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
2716 the object when doing deferred section layout.
2717
e597fa08
NC
27182010-11-03 Nick Clifton <nickc@redhat.com>
2719
2720 PR gold/12001
2721 * script.h (class Symbol_assignment: name): New member. Returns
2722 the name of the symbol.
2723 * scrfipt.cc (Script_options::is_pending_assignment): New member.
2724 Returns true if the given symbol name is on the list of
2725 assignments wating to be processed.
2726 * archive.cc (should_incldue_member): If the symbol is undefined,
2727 check to see if it is on the list of symbols pending assignment.
2728
3f9a3278
ILT
27292010-11-03 Ryan Mansfield <rmansfield@qnx.com>
2730
2731 * script-sections.cc (Script_sections::find_memory_region): Check
2732 for a NULL output section pointer.
2733
d06fb4d1
DK
27342010-10-29 Doug Kwan <dougkwan@google.com>
2735
2736 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
2737 Output_section::add_relaxed_input_section.
2738 * output.cc (Output_section::add_relaxed_input_section): Add new
2739 arguments LAYOUT and NAME. Set section order index.
2740 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2741 Copy section order index.
2742 * output.h (Output_section::add_relaxed_input_section): Add new
2743 arguments LAYOUT and NAME.
2744
90e24de5
ILT
27452010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2746
2747 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2748 NATIVE_OR_CROSS_LINKER.
2749 * testsuite/Makefile.in: Regenerate.
2750
c9484ea5
DK
27512010-10-20 Doug Kwan <dougkwan@google.com>
2752
2753 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
2754 without SHF_LINK_ORDER flags.
2755 * layout.cc (Layout::choose_output_section): Do not filter
2756 SHF_LINK_ORDER flag in a relocatable link.
2757
5bc2f5be
CC
27582010-10-17 Cary Coutant <ccoutant@google.com>
2759
2760 * output.h (Output_segment::set_section_addresses): Change function
2761 signature. Update all callers.
2762 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
2763 sections.
2764 (Output_segment::set_section_addresses): Align after last TLS
2765 section. Add padding before last relro section instead of after.
2766
0c91cf04
DK
27672010-10-17 Doug Kwan <dougkwan@google.com>
2768
2769 * gold/arm.cc (Target_arm::got_section): Use correct order and set
2770 GOT output section to be writable.
2771
8c21d9d3
CC
27722010-10-14 Cary Coutant <ccoutant@google.com>
2773
2774 * debug.h (DEBUG_INCREMENTAL): New flag.
2775 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
2776 * gold.cc (queue_initial_tasks): Check parameters for incremental link
2777 mode.
2778 * incremental.cc (report_command_line): Ignore all forms of
2779 --incremental.
2780 * layout.cc (Layout::Layout): Check parameters for incremental link
2781 mode.
2782 * options.cc (General_options::parse_incremental): New function.
2783 (General_options::parse_no_incremental): New function.
2784 (General_options::parse_incremental_full): New function.
2785 (General_options::parse_incremental_update): New function.
2786 (General_options::incremental_mode_): New data member.
2787 (General_options::finalize): Check incremental_mode_.
2788 * options.h (General_options): Update help text for --incremental.
2789 Add --no-incremental, --incremental-full, --incremental-update.
2790 (General_options::Incremental_mode): New enum type.
2791 (General_options::incremental_mode): New function.
2792 (General_options::incremental_mode_): New data member.
2793 * parameters.cc (Parameters::incremental_mode_): New data member.
2794 (Parameters::set_options): Set incremental_mode_.
2795 (Parameters::set_incremental_full): New function.
2796 (Parameters::incremental): New function.
2797 (Parameters::incremental_update): New function.
2798 (set_parameters_incremental_full): New function.
2799 * parameters.h (Parameters::set_incremental_full): New function.
2800 (Parameters::incremental): New function.
2801 (Parameters::incremental_update): New function.
2802 (Parameters::incremental_mode_): New data member.
2803 (set_parameters_incremental_full): New function.
2804 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2805 incremental link mode.
2806 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2807 (Sized_relobj::do_relocate_sections): Likewise.
2808 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2809 option.
2810 * testsuite/Makefile.in: Regenerate.
2811 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2812
bb32aa18 28132010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2814
2815 * script-sections.h (class Script_sections): Make
2816 Sections_elements typedef public.
2817 * script-sections.cc (class Sort_output_sections): Add elements_
2818 field. Add constructor which sets it; change all callers.
2819 (Sort_output_sections::is_before): New function.
2820 (Sort_output_sections::operator()): Call is_before.
2821 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2822 conditional.
2823 * testsuite/script_test_10.sh: New test. Test script section
2824 order.
2825 * testsuite/script_test_10.t: Likewise.
2826 * testsuite/script_test_10.s: Likewise.
2827 * testsuite/Makefile.am: Wrap the cross linker tests and the
2828 common tests into NATIVE_OR_CROSS_LINKER.
2829 (check_SCRIPTS): Add script_test_10.sh.
2830 (check_DATA): Add script_test_10.stdout.
2831 (script_test_10.o, script_test_10): New targets.
2832 (script_test_10.stdout): New target.
2833 * configure, testsuite/Makefile.in: Regenerate.
2834
3cef7179
ILT
28352010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2836
2837 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2838 error for the deprecated relocations.
2839 (Target_arm::Scan::global): Likewise.
2840 (Target_arm::Relocate::relocate): Likewise.
2841
7411e9a8
RS
28422010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2843
2844 * fileread.cc (Input_file::find_file): Initialize *found_name
2845 and *namep when using the fallback search for case 4.
2846
6a9da32a
CC
28472010-10-11 Cary Coutant <ccoutant@google.com>
2848
2849 * options.h (class General_options): Redefine -z lazy as an alias for
2850 the negation of -z now.
2851
ac897c20
ILT
28522010-10-11 Ian Lance Taylor <iant@google.com>
2853
2854 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2855 binding.
2856
ea5cae92
NC
28572010-10-06 Nick Clifton <nickc@redhat.com>
2858
2859 * script-sections.cc(class Memory_region): Remove
2860 current_lma_offset_ field. Rename current_vma_offset_ to
2861 current_offset_. Add last_section_ field.
2862 (Memory_region::get_current_vma_address): Rename to
2863 get_current_address.
2864 (Memory_region::get_current_lma_address): Delete.
2865 (Memory_region::increment_vma_offset): Rename to
2866 increment_offset.
2867 (Memory_region::increment_lma_offset): Delete.
2868 (Memory_region::attributes_compatible): New method. Returns
2869 true if the provided section is compatible with the region.
2870 (Memory_region::get_last_section): New method. Returns the last
2871 section to use the region.
2872 (Memory_region::set_last_section): New method. Stores the last
2873 section to use the region.
2874 (Script_sections::block_in_region): New method. Returns true if
2875 a block of memory is contained within a region.
2876 (Script_sections::find_memory_region): New method. Locates a
2877 memory region to be used to set a VMA or LMA address.
2878 (Output_section_definition::set_section_addresses): Add code to
2879 check for addresses set by memory regions.
2880 (Output_segment::set_section_addresses): Remove memory region
2881 walking code.
2882 (Script_sections::create_segment): Add a warning if a header
2883 segment is created outside of any region.
2884 * script-sections.h (class Script_sections): Add prototypes for
2885 find_memory_region and block_in_region methods.
2886 * testsuite/memory_test.s: Use .long instead of .word.
2887 * testsuite/memory_test.t: Add some more output sections.
2888 * testsuite/memory_test.sh: Update expected output.
2889
a9bfd952
DK
28902010-10-02 Doug Kwan <dougkwan@google.com>
2891
2892 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2893 defintion to symtab.h
2894 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2895 declaration to defintion.
2896
bacff3ab
NC
28972010-10-01 Nick Clifton <nickc@redhat.com>
2898
2899 * expression.cc (eval): Replace dummy argument with NULL.
2900 (eval_maybe_dot): Check for a NULL result section pointer.
2901 (Symbol_expression::value): Likewise.
2902 (Dot_expression::value): Likewise.
2903 (BINARY_EXPRESSION): Likewise.
2904 (Max_expression::value): Likewise.
2905 (Min_expression::value): Likewise.
2906 (Absolute_expression::value): Likewise.
2907 (Addr_expression::value_from_output_section): Likewise.
2908 (Loaddddr_expression::value_from_output_section): Likewise.
2909 (Segment_start_expression::value): Likewise.
2910 * script-sections.cc
2911 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2912 argument with NULL.
2913 (Sections_elememt_dot_assignment::set_section_addresses):
2914 Likewise.
2915 (Output_data_expression::do_write_to_buffer): Likewise.
2916 (Output_section_definition::finalize_symbols): Likewise.
2917 (Output_section_definition::set_section_addresses): Likewise.
2918
f81bc8b5
DK
29192010-09-30 Doug Kwan <dougkwan@google.com>
2920
2921 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2922
c95e9f27
ST
29232010-09-28 Sriraman Tallam <tmsriram@google.com>
2924
2925 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2926 function.
c95e9f27
ST
2927 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2928 virtual function.
2929 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2930 virtual function.
2931 * icf.cc (get_section_contents): Inline merge sections only when
2932 target allows it.
2933
3cac54d2
RW
29342010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2935
2936 * configure: Regenerate.
2937
2904037a
ILT
29382010-09-17 Ian Lance Taylor <iant@google.com>
2939
2940 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2941 * testsuite/Makefile.am (memory_test.o): New target.
2942 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2943 memory_test.t.
2944 * testsuite/Makefile.in: Rebuild.
2904037a 2945
bca7fb63
DK
29462010-09-17 Doug Kwan <dougkwan@google.com>
2947
2948 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2949 defintion if relocation uses GOT entries of the symbol.
2950 * testsuite/icf_safe_test.sh: Fix test.
2951 * testsuite/icf_safe_so_test.sh: Fix test.
2952
4ef28648
CC
29532010-09-16 Cary Coutant <ccoutant@google.com>
2954
2955 * script_sections.cc (class Memory_region): Remove "NULL" from
2956 vector initializations.
2957
793990de
CC
29582010-09-15 Cary Coutant <ccoutant@google.com>
2959
2960 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2961 Resolve forwarding symbols.
2962
81e015e2
DK
29632010-09-15 Doug Kwan <dougkwan@google.com>
2964
2965 * gold/testsuite/script_test_3.t: Add ARM special sections.
2966 * gold/testsuite/script_test_4.t: Same.
2967 * gold/testsuite/script_test_5.t: Same.
2968 * gold/testsuite/script_test_6.t: Same.
2969 * gold/testsuite/script_test_7.t: Same.
2970 * gold/testsuite/script_test_7.t: Same.
2971 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2972
36171d64
CC
29732010-09-14 Cary Coutant <ccoutant@google.com>
2974
2975 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2976 (Target_x86_64::Relocate::relocate_tls): Replace check for
2977 saw_tls_block_reloc_ with test for executable section.
2978
d89051bd
CC
29792010-09-12 Cary Coutant <ccoutant@google.com>
2980
2981 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2982 position-independent executables to shared libraries need dynamic
2983 relocations.
2984 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2985 position-independent executables.
2986 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2987 * testsuite/Makefile.in: Regenerate.
2988
fca41f0f
NC
29892010-09-10 Nick Clifton <nickc@redhat.com>
2990
2991 PR gold/11997
2992 * testsuite/memory_test.t: Discard any sections that are not
2993 needed.
2994
6695e4b3
L
29952010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2996
2997 PR gold/11996
2998 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2999 "This::" to work around a bug in gcc 4.2.
3000
3001 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
3002
0f72bf6f
RÁE
30032010-09-09 Rafael Espindola <espindola@google.com>
3004
3005 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
3006 sections with different PF_X flags in the same segment.
3007 (Layout::find_first_load_seg): Search all segments to find the first
3008 one.
3009 * options.h (rosegment): New.
3010
30112010-09-08 Rafael Espindola <espindola@google.com>
a6577478 3012
05a79166 3013 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 3014
aa98ff75
DK
30152010-09-08 Doug Kwan <dougkwan@google.com>
3016
3017 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
3018 (Arm_relobj::do_relocate_sections): Add new parameter for output
3019 file to match the parent.
3020 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
3021 of local symbols instead of input values. Update code to track
3022 changes in gold::relocate_section.
3023 * object.cc (Sized_relobj::compute_final_local_value): New methods.
3024 (Sized_relobj::compute_final_local_value_internal): New methods.
3025 (Sized_relobj::do_finalize_local_symbols): Move code from loop
3026 body into private version of Sized_relobj::compute_final_local_value.
3027 Call the inline method.
3028 * object.h (Symbol_value::Symbol_value): Define destructor. Free
3029 merged symbol value if there is one.
3030 (Symbol_value::has_output_value): New method defintiion.
3031 (Sized_relobj::Compute_final_local_value_status): New enum type.
3032 (Sized_relobj::compute_final_local_value): New methods.
3033 (Sized_relobj::compute_final_local_value_internal): New methods.
3034 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
3035 and arm_cortex_a8.sh.
3036 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
3037 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
3038 New tests.
3039 * Makefile.in: Regenerate.
3040 * testsuite/arm_bl_out_of_range.s: Update test.
3041 * testsuite/thumb_bl_out_of_range.s: Ditto.
3042 * testsuite/thumb_blx_out_of_range.s: Ditto.
3043 * testsuite/arm_branch_out_of_range.sh: New file.
3044 * testsuite/arm_cortex_a8.sh: Ditto.
3045 * testsuite/arm_cortex_a8_b.s: Ditto.
3046 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
3047 * testsuite/arm_cortex_a8_b_local.s: Ditto.
3048 * testsuite/arm_cortex_a8_bl.s: Ditto.
3049 * testsuite/arm_cortex_a8_blx.s: Ditto.
3050 * testsuite/arm_cortex_a8_local.s: Ditto.
3051 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
3052 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
3053
05a79166
L
30542010-09-08 Rafael Espindola <espindola@google.com>
3055
3056 * Makefile.am (memory_test.stdout): Run readelf with -W.
3057 * Makefile.in: Regenerate.
3058 * testsuite/memory_test.sh: Make the regexps accept both 32 and
3059 64 bit output.
3060
33dbc701
RÁE
30612010-09-08 Rafael Espindola <espindola@google.com>
3062
3063 * script-sections.cc (Script_sections::add_memory_region): Convert
3064 field precision to int.
3065 * script.cc (script_set_section_region, script_set_section_region):
3066 Convert field precision to int.
3067
731ca54a
RÁE
30682010-09-08 Rafael Espindola <espindola@google.com>
3069
3070 * arm.cc (do_finalize_sections): Create the __exidx_start and
3071 __exdix_end symbols even when the section is missing.
3072
7f8cd844
NC
30732010-09-08 Nick Clifton <nickc@redhat.com>
3074
3075 * README: Remove claim that MEMORY is not supported.
3076 * expression.cc (script_exp_function_origin)
3077 (script_exp_function_length): Move from here to ...
3078 * script.cc: ... here.
3079 (script_set_section_region, script_add_memory)
3080 (script_parse_memory_attr, script_include_directive): New
3081 functions.
3082 * script-sections.cc
3083 (class Memory_region): New class.
3084 (class Output_section_definition): Add set_memory_region,
3085 set_section_vma, set_section_lma and get_section_name methods.
3086 (class Script_Sections): Add add_memory_region,
3087 find_memory_region, find_memory_region_origin,
3088 find_memory_region_length and set_memory_region methods.
3089 Have set_section_addresses method walk the list of set memory
3090 regions.
3091 Extend the print methos to display memory regions.
3092 * script-sections.h: Add prototypes for new methods.
3093 Add enum for MEMORY region attributes.
3094 * yyscript.y: Add support for parsing MEMORY regions.
3095 * script-c.h: Add prototypes for new functions.
3096 * testsuite/Makefile.am: Add test of MEMORY region functionality.
3097 * testsuite/Makefile.in: Regenerate.
3098 * testsuite/memory_test.sh: New script.
3099 * testsuite/memory_test.s: New assembler source file.
3100 * testsuite/memory_test.t: New linker script.
3101
a4649286
DK
31022010-08-27 Doug Kwan <dougkwan@google.com>
3103
3104 * gold/resolve.cc (Symbol_table::should_override): Let a weak
3105 reference override an existing dynamic weak reference.
3106 * testsuite/Makefile.am: Add new test dyn_weak_ref.
3107 * testsuite/Makefile.in: Regenerate.
3108 * testsuite/dyn_weak_ref.sh: New file.
3109 * testsuite/dyn_weak_ref_1.c: Ditto.
3110 * testsuite/dyn_weak_ref_2.c: Ditto.
3111
b56648ad
ILT
31122010-08-27 Ian Lance Taylor <iant@google.com>
3113
3114 * incremental.h (class Incremental_input_entry): Add virtual
3115 destructor.
3116
809313cb
ILT
31172010-08-27 Ian Lance Taylor <iant@google.com>
3118
3119 * testsuite/start_lib_test_3.c: Mark t3 as used.
3120
11e32464
NC
31212010-08-27 Nick Clifton <nickc@redhat.com>
3122
3123 * options.cc (version_script): Fix small typo in previous
3124 whitespace tidyup.
3125
ca09d69a
NC
31262010-08-25 Nick Clifton <nickc@redhat.com>
3127
3128 * archive.cc: Formatting fixes: Remove whitespace between
3129 typename and following asterisk. Remove whitespace between
3130 function name and opening parenthesis.
3131 * archive.h: Likewise.
3132 * arm.cc: Likewise.
3133 * attributes.cc: Likewise.
3134 * attributes.h: Likewise.
3135 * common.cc: Likewise.
3136 * copy-relocs.cc: Likewise.
3137 * dirsearch.h: Likewise.
3138 * dynobj.cc: Likewise.
3139 * ehframe.cc: Likewise.
3140 * ehframe.h: Likewise.
3141 * expression.cc: Likewise.
3142 * fileread.cc: Likewise.
3143 * fileread.h: Likewise.
3144 * gc.h: Likewise.
3145 * gold-threads.cc: Likewise.
3146 * gold.cc: Likewise.
3147 * i386.cc: Likewise.
3148 * icf.h: Likewise.
3149 * incremental-dump.cc: Likewise.
3150 * incremental.cc: Likewise.
3151 * layout.cc: Likewise.
3152 * layout.h: Likewise.
3153 * main.cc: Likewise.
3154 * merge.cc: Likewise.
3155 * merge.h: Likewise.
3156 * object.cc: Likewise.
3157 * object.h: Likewise.
3158 * options.cc: Likewise.
3159 * options.h: Likewise.
3160 * output.cc: Likewise.
3161 * output.h: Likewise.
3162 * plugin.cc: Likewise.
3163 * plugin.h: Likewise.
3164 * powerpc.cc: Likewise.
3165 * reloc.cc: Likewise.
3166 * script-c.h: Likewise.
3167 * script-sections.cc: Likewise.
3168 * script.cc: Likewise.
3169 * stringpool.cc: Likewise.
3170 * symtab.cc: Likewise.
3171 * symtab.h: Likewise.
3172 * target.cc: Likewise.
3173 * timer.cc: Likewise.
3174 * timer.h: Likewise.
3175 * version.cc: Likewise.
3176 * x86_64.cc: Likewise.
3177
b8fa8750
NC
31782010-08-24 Nick Clifton <nickc@redhat.com>
3179
3180 PR 11899
3181 * layout.cc (segment_precedes): Sort segments by their physical
3182 addresses, if they have been set.
3183
9919d93b
CC
31842010-08-23 Cary Coutant <ccoutant@google.com>
3185
3186 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
3187 symbols data.
3188 (Lib_group::include_member): Unlock object after deleting its
3189 symbols data.
3190 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
3191 the bug fixed here.
3192
97b4be1c
CC
31932010-08-19 Neil Vachharajani <nvachhar@google.com>
3194 Cary Coutant <ccoutant@google.com>
3195
3196 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
3197 constructor, and set_blocker.
3198 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
3199 readsyms_blocker_.
3200 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
3201 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
3202 * testsuite/Makefile.am (start_lib_test): New test case.
3203 * testsuite/Makefile.in: Regenerate.
3204 * testsuite/start_lib_test_main.c: New file.
3205 * testsuite/start_lib_test_1.c: New file.
3206 * testsuite/start_lib_test_2.c: New file.
3207 * testsuite/start_lib_test_3.c: New file.
3208
dd0b1884
ILT
32092010-08-19 Ian Lance Taylor <iant@google.com>
3210
3211 * Makefile.in: Rebuild with automake 1.11.1.
3212 * aclocal.m4: Likewise.
3213 * testsuite/Makefile.in: Likewise.
3214
7223e9ca
ILT
32152010-08-19 Ian Lance Taylor <iant@google.com>
3216
3217 PR 10893
3218 * i386.cc (class Output_data_plt_i386): Update declarations.
3219 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
3220 local_ifuncs_ fields.
3221 (Target_i386::do_plt_section_for_global): New function.
3222 (Target_i386::do_plt_section_for_local): New function.
3223 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
3224 parameter; change all callers. Initialize global_ifuncs_ and
3225 local_ifuncs_. If doing a static link define __rel_iplt_start and
3226 __rel_iplt_end.
3227 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
3228 (Output_data_plt_i386::add_local_ifunc_entry): New function.
3229 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
3230 symbols.
3231 (Target_i386::make_plt_section): New function, broken out of
3232 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
3233 (Target_i386::make_plt_entry): Call make_plt_section.
3234 (Target_i386::make_local_ifunc_plt_entry): New function.
3235 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
3236 (Target_i386::Scan::local): Handle IFUNC symbols. Add
3237 R_386_IRELATIVE to switch.
3238 (Target_i386::Scan::global): Likewise.
3239 (Target_i386::Relocate::relocate): Likewise.
3240 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
3241 switch.
3242 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
3243 (Target_x86_64::do_plt_section_for_global): New function.
3244 (Target_x86_64::do_plt_section_for_local): New function.
3245 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
3246 parameter; change all callers. If doing a static link define
3247 __rela_iplt_start and __rela_iplt_end.
3248 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
3249 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
3250 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
3251 to point to .plt.
3252 (Target_x86_64::make_local_ifunc_plt_entry): New function.
3253 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
3254 switch.
3255 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
3256 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
3257 R_X86_64_IRELATIVE to switch.
3258 (Target_x86_64::Scan::global): Likewise.
3259 (Target_x86_64::Relocate::relocate): Likewise.
3260 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
3261 switch.
3262 * target.h (class Target): Add plt_section_for_global and
3263 plt_section_for_local functions. Add do_plt_section_for_global
3264 and do_plt_section_for_local virtual functions.
3265 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
3266 clarifying comments.
3267 (Symbol::use_plt_offset): Handle IFUNC symbol.
3268 * object.cc (Sized_relobj::Sized_relobj): Initialize
3269 local_plt_offsets_.
3270 (Sized_relobj::local_has_plt_offset): New function.
3271 (Sized_relobj::local_plt_offset): New function.
3272 (Sized_relobj::set_local_plt_offset): New function.
3273 (Sized_relobj::do_count): Handle IFUNC symbol.
3274 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
3275 a bit away from input_shndx_ field. Add set_is_func_symbol and
3276 is_ifunc_symbol functions.
3277 (class Sized_relobj): Update declarations. Remove Tls_got_entry
3278 and Local_tls_got_offsets. Define Local_plt_offsets. Add
3279 local_plt_offsets_ field.
3280 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
3281 * output.h (class Output_section_data): Add non-const
3282 output_section function.
3283 (class Output_data_got): Update declarations.
3284 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
3285 Add use_plt_offset parameter to global and local constructors.
3286 Change all callers. Change local_sym_index_ field to 31 bits.
3287 Change GSYM_CODE and CONSTANT_CODE accordingly.
3288 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
3289 doing a static link don't set sh_link field.
3290 (Output_data_got::Got_entry::write): Use PLT offset if
3291 appropriate.
3292 (Output_data_got::add_global_plt): New function.
3293 (Output_data_got::add_local_plt): New function.
3294 * target-reloc.h (relocate_section): Handle IFUNC symbol.
3295 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
3296 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
3297 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
3298 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
3299 IFUNC conditional.
3300 * testsuite/ifunc-sel.h: New file.
3301 * testsuite/ifuncmain1.c: New file.
3302 * testsuite/ifuncmain1vis.c: New file.
3303 * testsuite/ifuncmod1.c: New file.
3304 * testsuite/ifuncdep2.c: New file.
3305 * testsuite/ifuncmain2.c: New file.
3306 * testsuite/ifuncmain3.c: New file.
3307 * testsuite/ifuncmod3.c: New file.
3308 * testsuite/ifuncmain4.c: New file.
3309 * testsuite/ifuncmain5.c: New file.
3310 * testsuite/ifuncmod5.c: New file.
3311 * testsuite/ifuncmain6pie.c: New file.
3312 * testsuite/ifuncmod6.c: New file.
3313 * testsuite/ifuncmain7.c: New file.
3314 * configure, testsuite/Makefile.in: Rebuild.
3315
56f75c03
ILT
33162010-08-18 Ian Lance Taylor <iant@google.com>
3317
3318 * incremental.cc
3319 (Output_section_incremental_inputs::write_input_files): Add cast
3320 to avoid signed/unsigned comparison warning.
3321 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3322
55455f89
CC
33232010-08-12 Cary Coutant <ccoutant@google.com>
3324
3325 * common.cc (Sort_commons::operator()): Remove unnecessary code.
3326
e2054bcb
ILT
33272010-08-13 Ian Lance Taylor <iant@google.com>
3328
3329 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
3330
74f67560
DK
33312010-08-12 Cary Coutant <ccoutant@google.com>
3332 Doug Kwan <dougkwan@google.com>
3333
3334 * resolve.cc (Symbol_table::should_override): When a weak dynamic
3335 defintion overrides non-weak undef, remember that the original undef
3336 is not weak.
3337 * symtab.cc (Symbol_table::sized_write_global): For undef without
3338 an original weak binding, set binding to global in output.
3339 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
3340 * testsuite/Makefile.in: Regenerate.
3341 * testsuite/strong_ref_weak_def.sh: New file.
3342 * testsuite/strong_ref_weak_def_1.c: Ditto.
3343 * testsuite/strong_ref_weak_def_2.c: Ditto.
3344
d1238d12
CC
33452010-08-12 Cary Coutant <ccoutant@google.com>
3346
3347 * testsuite/incremental_test.sh: Rewrite.
3348 * testsuite/incremental_test_1.c: Rewrite.
3349 * testsuite/incremental_test_2.c: Rewrite.
3350
0e70b911
CC
33512010-08-12 Cary Coutant <ccoutant@google.com>
3352
3353 * arm.cc (Target_arm::got_size): Add const.
3354 (Target_arm::got_entry_count): New function.
3355 (Target_arm::plt_entry_count): New function.
3356 (Target_arm::first_plt_entry_offset): New function.
3357 (Target_arm::plt_entry_size): New function.
3358 (Output_data_plt_arm::entry_count): New function.
3359 (Output_data_plt_arm::first_plt_entry_offset): New function.
3360 (Output_data_plt_arm::get_plt_entry_size): New function.
3361 * i386.cc (Target_i386::got_size): Add const.
3362 (Target_i386::got_entry_count): New function.
3363 (Target_i386::plt_entry_count): New function.
3364 (Target_i386::first_plt_entry_offset): New function.
3365 (Target_i386::plt_entry_size): New function.
3366 (Output_data_plt_i386::entry_count): New function.
3367 (Output_data_plt_i386::first_plt_entry_offset): New function.
3368 (Output_data_plt_i386::get_plt_entry_size): New function.
3369 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
3370 find_incremental_inputs_sections. Dump incremental_got_plt section.
3371 * incremental.cc: Include target.h.
3372 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
3373 parameter. Adjust all callers. Find incremental_got_plt section.
3374 (Incremental_inputs::create_data_sections): Create incremental_got_plt
3375 section.
3376 (Output_section_incremental_inputs::set_final_data_size): Calculate
3377 size of incremental_got_plt section.
3378 (Output_section_incremental_inputs::do_write): Write the
3379 incremental_got_plt section.
3380 (Got_plt_view_info): New struct.
3381 (Local_got_offset_visitor): New class.
3382 (Global_got_offset_visitor): New class.
3383 (Global_symbol_visitor_got_plt): New class.
3384 (Output_section_incremental_inputs::write_got_plt): New function.
3385 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
3386 Add parameter. Adjust all callers.
3387 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3388 (Incremental_inputs::got_plt_section): New function.
3389 (Incremental_inputs::got_plt_section_): New data member.
3390 (Incremental_got_plt_reader): New class.
3391 * layout.cc (Layout::create_incremental_info_sections): Add the
3392 incremental_got_plt section.
3393 * object.h (Got_offset_list::get_list): New function.
3394 (Got offset_list::for_all_got_offsets): New function.
3395 (Sized_relobj::local_got_offset_list): New function.
3396 * powerpc.cc (Target_powerpc::got_size): Add const.
3397 (Target_powerpc::got_entry_count): New function.
3398 (Target_powerpc::plt_entry_count): New function.
3399 (Target_powerpc::first_plt_entry_offset): New function.
3400 (Target_powerpc::plt_entry_size): New function.
3401 (Output_data_plt_powerpc::entry_count): New function.
3402 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
3403 (Output_data_plt_powerpc::get_plt_entry_size): New function.
3404 * sparc.cc (Target_sparc::got_size): Add const.
3405 (Target_sparc::got_entry_count): New function.
3406 (Target_sparc::plt_entry_count): New function.
3407 (Target_sparc::first_plt_entry_offset): New function.
3408 (Target_sparc::plt_entry_size): New function.
3409 (Output_data_plt_sparc::entry_count): New function.
3410 (Output_data_plt_sparc::first_plt_entry_offset): New function.
3411 (Output_data_plt_sparc::get_plt_entry_size): New function.
3412 * symtab.h (Symbol::got_offset_list): New function.
3413 (Symbol_table::for_all_symbols): New function.
3414 * target.h (Sized_target::got_entry_count): New function.
3415 (Sized_target::plt_entry_count): New function.
3416 (Sized_target::plt_entry_size): New function.
3417 * x86_64.cc (Target_x86_64::got_size): Add const.
3418 (Target_x86_64::got_entry_count): New function.
3419 (Target_x86_64::plt_entry_count): New function.
3420 (Target_x86_64::first_plt_entry_offset): New function.
3421 (Target_x86_64::plt_entry_size): New function.
3422 (Output_data_plt_x86_64::entry_count): New function.
3423 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
3424 (Output_data_plt_x86_64::get_plt_entry_size): New function.
3425
09ec0418
CC
34262010-08-12 Cary Coutant <ccoutant@google.com>
3427
3428 * archive.cc: Include incremental.h.
3429 (Archive::Archive): Initialize incremental_info_.
3430 (Archive::include_member): Record archive members in incremental info.
3431 (Add_archive_symbols::run): Record begin and end of an archive in
3432 incremental info.
3433 (Lib_group::include_member): Record objects in incremental info.
3434 * archive.h (Incremental_archive_entry): Forward declaration.
3435 (Archive::set_incremental_info): New member function.
3436 (Archive::incremental_info): New member function.
3437 (Archive::Unused_symbol_iterator): New class.
3438 (Archive::unused_symbols_begin): New member function.
3439 (Archive::unused_symbols_end): New member function.
3440 (Archive::incremental_info_): New data member.
3441 * incremental-dump.cc (find_input_containing_global): New function.
3442 (dump_incremental_inputs): Dump new incremental info sections.
3443 * incremental.cc: Include symtab.h.
3444 (Output_section_incremental_inputs): New class.
3445 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
3446 new incremental info sections.
3447 (Sized_incremental_binary::do_check_inputs): Likewise.
3448 (Incremental_inputs::report_archive): Remove.
3449 (Incremental_inputs::report_archive_begin): New function.
3450 (Incremental_inputs::report_archive_end): New function.
3451 (Incremental_inputs::report_object): New function.
3452 (Incremental_inputs::finalize_inputs): Remove.
3453 (Incremental_inputs::report_input_section): New function.
3454 (Incremental_inputs::report_script): Rewrite.
3455 (Incremental_inputs::finalize): Do nothing but finalize string table.
3456 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3457 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3458 (Incremental_inputs::create_data_sections): New function.
3459 (Incremental_inputs::relocs_entsize): New function.
3460 (Output_section_incremental_inputs::set_final_data_size): New function.
3461 (Output_section_incremental_inputs::do_write): New function.
3462 (Output_section_incremental_inputs::write_header): New function.
3463 (Output_section_incremental_inputs::write_input_files): New function.
3464 (Output_section_incremental_inputs::write_info_blocks): New function.
3465 (Output_section_incremental_inputs::write_symtab): New function.
3466 * incremental.h (Incremental_script_entry): Forward declaration.
3467 (Incremental_object_entry): Forward declaration.
3468 (Incremental_archive_entry): Forward declaration.
3469 (Incremental_inputs): Forward declaration.
3470 (Incremental_inputs_header_data): Remove.
3471 (Incremental_inputs_header): Remove.
3472 (Incremental_inputs_header_write): Remove.
3473 (Incremental_inputs_entry_data): Remove.
3474 (Incremental_inputs_entry): Remove.
3475 (Incremental_inputs_entry_write): Remove.
3476 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
3477 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
3478 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
3479 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
3480 Likewise.
3481 (Incremental_input_entry): New class.
3482 (Incremental_script_entry): New class.
3483 (Incremental_object_entry): New class.
3484 (Incremental_archive_entry): New class.
3485 (Incremental_inputs::Incremental_inputs): Initialize new data members.
3486 (Incremental_inputs::report_inputs): Remove.
3487 (Incremental_inputs::report_archive): Remove.
3488 (Incremental_inputs::report_archive_begin): New function.
3489 (Incremental_inputs::report_archive_end): New function.
3490 (Incremental_inputs::report_object): Change prototype.
3491 (Incremental_inputs::report_input_section): New function.
3492 (Incremental_inputs::report_script): Change prototype.
3493 (Incremental_inputs::get_reloc_count): New function.
3494 (Incremental_inputs::set_reloc_count): New function.
3495 (Incremental_inputs::create_data_sections): New function.
3496 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
3497 (Incremental_inputs::inputs_section): New function.
3498 (Incremental_inputs::symtab_section): New function.
3499 (Incremental_inputs::relocs_section): New function.
3500 (Incremental_inputs::get_stringpool): Add const.
3501 (Incremental_inputs::command_line): Add const.
3502 (Incremental_inputs::inputs): Remove.
3503 (Incremental_inputs::command_line_key): New function.
3504 (Incremental_inputs::input_file_count): New function.
3505 (Incremental_inputs::input_files): New function.
3506 (Incremental_inputs::relocs_entsize): New function.
3507 (Incremental_inputs::sized_create_inputs_section_data): Remove.
3508 (Incremental_inputs::finalize_inputs): Remove.
3509 (Incremental_inputs::Input_info): Remove.
3510 (Incremental_inputs::lock_): Remove.
3511 (Incremental_inputs::inputs_): Change type.
3512 (Incremental_inputs::inputs_map_): Remove.
3513 (Incremental_inputs::current_object_entry_): New data member.
3514 (Incremental_inputs::inputs_section_): New data member.
3515 (Incremental_inputs::symtab_section_): New data member.
3516 (Incremental_inputs::relocs_section_): New data member.
3517 (Incremental_inputs::reloc_count_): New data member.
3518 (Incremental_inputs_reader): New class.
3519 (Incremental_symtab_reader): New class.
3520 (Incremental_relocs_reader): New class.
3521 * layout.cc (Layout::finalize): Move finalization of incremental info
3522 and creation of incremental info sections to follow finalization of
3523 symbol table. Set offsets for postprocessing sections.
3524 (Layout::create_incremental_info_sections): Call
3525 Incremental_inputs::create_data_sections. Add incremental symtab
3526 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
3527 sections to layout after input sections.
3528 * layout.h (struct Timespec): Forward declaration.
3529 (Layout::incremental_inputs): Add const.
3530 (Layout::create_incremental_info_sections): Add parameter.
3531 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
3532 * object.cc: Include incremental.h.
3533 (Relobj::finalize_incremental_relocs): New function.
3534 (Sized_relobj::do_layout): Record input sections in incremental info.
3535 * object.h (Object::output_section): New function.
3536 (Object::output_section_offset): Moved from Relobj.
3537 (Object::get_incremental_reloc_base): New function.
3538 (Object::get_incremental_reloc_count): New function.
3539 (Object::do_output_section): New function.
3540 (Object::do_output_section_offset): Moved from Relobj.
3541 (Object::do_get_incremental_reloc_base): New function.
3542 (Object::do_get_incremental_reloc_count): New function.
3543 (Object::Object): Initialize new data members.
3544 (Relobj::output_section): Renamed do_output_section and moved to
3545 protected.
3546 (Relobj::output_section_offset): Moved to Object.
3547 (Relobj::do_get_incremental_reloc_base): New function.
3548 (Relobj::do_get_incremental_reloc_count): New function.
3549 (Relobj::allocate_incremental_reloc_counts): New function.
3550 (Relobj::count_incremental_reloc): New function.
3551 (Relobj::finalize_incremental_relocs): New function.
3552 (Relobj::next_incremental_reloc_index): New function.
3553 (Relobj::reloc_counts_): New data member.
3554 (Relobj::reloc_bases_): New data member.
3555 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
3556 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
3557 (Sized_relobj::incremental_relocs_scan): New function.
3558 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3559 (Sized_relobj::incremental_relocs_write): New function.
3560 (Sized_relobj::incremental_relocs_write_reltype): New function.
3561 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
3562 incremental link.
3563 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
3564 archives and object files elsewhere.
3565 (Add_symbols::run): Report object files here.
3566 (Finish_group::run): Report end of archive at end of group.
3567 * reloc.cc: Include layout.h, incremental.h.
3568 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
3569 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
3570 (Sized_relobj::incremental_relocs_scan): New function.
3571 (Sized_relobj::incremental_relocs_scan_reltype): New function.
3572 (Sized_relobj::do_relocate_sections): Write incremental relocations.
3573 (Sized_relobj::incremental_relocs_write): New function.
3574 (Sized_relobj::incremental_relocs_write_reltype): New function.
3575 * script.cc (read_input_script): Rewrite test for incremental link.
3576 Change call to Incremental_inputs::report_script.
3577 * symtab.h (Symbol_table::first_global_index): New function.
3578 (Symbol_table::output_count): New function.
3579
ce0d1972
DK
35802010-08-12 Doug Kwan <dougkwan@google.com>
3581
3582 * arm.cc (Target_arm::merge_object_attributes): Check command line
3583 options --no-wchar-size-warning and --no-enum-size-warning.
3584 * options.h (General_options): Add ld-compatible options
3585 --no-enum-size-warning and --no-wchar-size-warning.
3586
6e5710ce
ILT
35872010-08-04 Ian Lance Taylor <iant@google.com>
3588
3589 * x86_64.cc (Target_x86_64::Scan::local): Use
3590 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
3591 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
3592 (Target_x86_64::Scan::global): Likewise.
3593 (Target_x86_64::Relocate::relocate): Likewise.
3594 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
3595 Likewise.
3596
fef830db
CC
35972010-08-03 Cary Coutant <ccoutant@google.com>
3598
3599 * merge.cc (Output_merge_string::do_add_input_section): Count strings
3600 to reserve space in merged_strings vector. Keep total input size
3601 for stats.
3602 (Output_merge_string::do_print_merge_stats): Print total input size.
3603 * merge.h (Output_merge_string): Add input_size_ field.
3604 * stringpool.cc (Stringpool_template::string_length): Move
3605 implementations out of Stringpool_template class and place in
3606 stringpool.h.
3607 * stringpool.h (string_length): Move out of Stringpool_template.
3608
1e3811b0
ILT
36092010-08-03 Ian Lance Taylor <iant@google.com>
3610
3611 PR 11712
3612 * layout.cc (relaxation_loop_body): If address of load segment is
3613 set, adjust address to include headers if possible.
3614
7af0c620
ILT
36152010-08-03 Ian Lance Taylor <iant@google.com>
3616
3617 * version.cc (version_string): Bump to 1.10.
3618
22f0da72
ILT
36192010-08-03 Ian Lance Taylor <iant@google.com>
3620
3621 PR 11805
3622 * layout.h (enum Output_section_order): Define.
3623 (class Layout): Update declarations.
3624 * layout.cc (Layout::get_output_section): Add order parameter.
3625 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
3626 is_first_non_relro parameters. Change all callers.
3627 (Layout::choose_output_section): Likewise.
3628 (Layout::add_output_section_data): Likewise.
3629 (Layout::make_output_section): Likewise. Set order.
3630 (Layout::default_section_order): New function.
3631 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
3632 * output.cc (Output_section::Output_section): Initialize order_.
3633 Don't initialize deleted fields.
3634 (Output_segment::Output_segment): Don't initialize deleted
3635 fields.
3636 (Output_segment::add_output_section_to_load): New function
3637 replacing add_output_section. Change all callers to call this or
3638 add_output_section_to_nonload.
3639 (Output_segment::add_output_section_to_nonload): New function.
3640 (Output_segment::remove_output_section): Rewrite.
3641 (Output_segment::add_initial_output_data): Likewise.
3642 (Output_segment::has_any_data_sections): Likewise.
3643 (Output_segment::is_first_section_relro): Likewise.
3644 (Output_segment::maximum_alignment): Likewise.
3645 (Output_segment::has_dynamic_reloc): New function replacing
3646 dynamic_reloc_count. Change all callers.
3647 (Output_segment::has_dynamic_reloc_list): New function replacing
3648 dynamic_reloc_count_list. Change all callers.
3649 (Output_segment::set_section_addresses): Rewrite.
3650 (Output_segment::set_offset): Rewrite.
3651 (Output_segment::find_first_and_last_list): Remove.
3652 (Output_segment::set_tls_offsets): Rewrite.
3653 (Output_segment::first_section_load_address): Likewise.
3654 (Output_segment::output_section_count): Likewise.
3655 (Output_segment::section_with_lowest_load_address): Likewise.
3656 (Output_segment::write_section_headers): Likewise.
3657 (Output_segment::print_sections_to_map): Likewise.
3658 * output.h (class Output_data): Remove dynamic_reloc_count_
3659 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
3660 (Output_data::add_dynamic_reloc): Rewrite.
3661 (Output_data::has_dynamic_reloc): New function.
3662 (Output_data::dynamic_reloc_count): Remove.
3663 (class Output_section): Add order_ field. Remvoe is_relro_local_,
3664 is_last_relro_, is_first_non_relro_, is_interp_,
3665 is_dynamic_linker_section_ fields. Add order and set_order
3666 functions. Remove is_relro_local, set_is_relro_local,
3667 is_last_relro, set_is_last_relro, is_first_non_relro,
3668 set_is_first_non_relro functions, is_interp, set_is_interp,
3669 is_dynamic_linker_section, and set_is_dynamic_linker_section
3670 functions.
3671 (class Output_segment): Change Output_data_list from std::list to
3672 std:;vector. Add output_lists_ field. Remove output_data_ and
3673 output_bss_ fields. Update declarations.
3674
3ff2ccb0
ILT
36752010-08-02 Ian Lance Taylor <iant@google.com>
3676
3677 * arm.cc (Target_arm::gc_process_relocs): Use typename.
3678 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
3679 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
3680
88a4108b
ILT
36812010-08-02 Ian Lance Taylor <iant@google.com>
3682
3683 PR 11855
3684 * script.cc (Script_options::Script_options): Initialize
3685 symbol_definitions_ and symbol_references_.
3686 (Script_options::add_symbol_assignment): Update
3687 symbol_definitions_ and symbol_references_.
3688 (Script_options::add_symbol_reference): New function.
3689 (script_symbol): New function.
3690 * script.h (class Script_options): Add symbol_definitions_ and
3691 symbol_references_ fields.
3692 (Script_options::referenced_const_iterator): New type.
3693 (Script_options::referenced_begin): New function.
3694 (Script_options::referenced_end): New function.
3695 (Script_options::is_referenced): New function.
3696 (Script_options::any_unreferenced): New function.
3697 * script-c.h (script_symbol): Declare.
3698 * yyscript.y (exp): Call script_symbol.
3699 * symtab.cc: Include "script.h".
3700 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
3701 Change all callers. Check symbols referenced by scripts.
3702 (Symbol_table::add_undefined_symbols_from_command_line): Add
3703 layout parameter. Change all callers.
3704 (Symbol_table::do_add_undefined_symbols_from_command_line):
3705 Likewise. Break out loop body. Check symbols referenced by
3706 scripts.
3707 (Symbol_table::add_undefined_symbol_from_command_line): New
3708 function broken out of
3709 do_add_undefined_symbols_from_command_line.
3710 * symtab.h (class Symbol_table): Update declarations.
3711 * archive.cc: Include "layout.h".
3712 (Archive::should_include_member): Add layout parameter. Change
3713 all callers. Check for symbol mentioned in expression.
3714 * archive.h (class Archive): Update declaration.
3715 * object.cc (Sized_relobj::do_should_include_member): Add layout
3716 parameter.
3717 * object.h (Object::should_include_member): Add layout parameter.
3718 Change all callers.
3719 (Object::do_should_include_member): Add layout parameter.
3720 (class Sized_relobj): Update declaration.
3721 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
3722 parameter.
3723 * dynobj.h (class Sized_dynobj): Update declaration.
3724 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
3725 layout parameter.
3726 * plugin.h (class Sized_pluginobj): Update declaration.
3727
5f1ab67a
ILT
37282010-08-02 Ian Lance Taylor <iant@google.com>
3729
3730 PR 11866
3731 * output.cc (Output_segment::set_offset): Search for the first and
3732 last sections rather than assuming that the list is in order.
3733 (Output_segment::find_first_and_last_list): New function.
3734 * output.h (class Output_segment): Update declarations.
3735 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
3736 (relro_strip_test_SOURCES): New variable.
3737 (relro_strip_test_DEPENDENCIES): New variable.
3738 (relro_strip_test_LDFLAGS): New variable.
3739 (relro_strip_test_LDADD): New variable.
3740 (relro_strip_test.so): New target.
3741
a8df5856
ILT
37422010-08-02 Ian Lance Taylor <iant@google.com>
3743
3744 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
3745 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
3746 (Target_i386::got_tlsdesc_section): New function.
3747 (Target_i386::got_section): Create space for GOT entries for
3748 TLSDESC relocations.
3749 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
3750 R_386_TLS_GOTDESC.
3751 (Target_i386::Scan::global): Likewise.
3752 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
3753 using TLSDESC GOT.
3754 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
3755 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
3756 (Target_x86_64::got_tlsdesc_section): New function.
3757 (Target_x86_64::got_section): Create space for GOT entries for
3758 TLSDESC relocations.
3759 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
3760 R_386_TLS_GOTDESC.
3761 (Target_x86_64::Scan::global): Likewise.
3762 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
3763 using TLSDESC GOT.
3764
0c10a0a6
ILT
37652010-08-02 Ian Lance Taylor <iant@google.com>
3766
3767 * testsuite/final_layout.sh: Use dc to convert from hex to
3768 decimal.
3769
41cbeecc
ST
37702010-07-29 Sriraman Tallam <tmsriram@google.com>
3771
3772 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
3773 paramter to the call to gold::gc_process_relocs.
3774 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
3775 paramter to the call to gold::gc_process_relocs.
3776 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
3777 parameter to the call to gold::gc_process_relocs.
3778 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
3779 template parameter to the call to gold::gc_process_relocs.
3780 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
3781 paramter to the call to gold::gc_process_relocs.
3782 * gc.h (get_embedded_addend_size): New function.
3783 (gc_process_relocs): Save the size of the reloc for use by ICF.
3784 * icf.cc (get_section_contents): Get the addend from the text section
3785 for SHT_REL relocation sections.
3786 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3787 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3788 * int_encoding.h (read_from_pointer): New overloaded function.
3789 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3790 * testsuite/icf_sht_rel_addend_test.sh: New file.
3791 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3792 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3793
6ea55b82
RW
37942010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3795
3796 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3797 * Makefile.in: Regenerate.
3798 * testsuite/Makefile.in: Regenerate.
3799
9691462b
ILT
38002010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3801
3802 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3803 * gold/testsuite/debug_msg.cc: Likewise.
3804 * gold/testsuite/odr_violation1.cc
3805 * gold/testsuite/odr_violation2.cc
3806
76897331
CC
38072010-07-21 Cary Coutant <ccoutant@google.com>
3808
3809 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3810 string, and length fields.
3811 (Output_merge_string::Merged_strings_list): New type.
3812 (Output_merge_string::Merged_strings_lists): New typedef.
3813 (Output_merge_string): Replace merged_strings_ with
3814 merged_strings_lists_.
3815 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3816 Merged_strings_list per input object and section. Don't store pointer
3817 to the string. Don't store length with each merged string entry.
3818 (Output_merge_string::finalize_merged_data): Loop over list of merged
3819 strings lists. Recompute length of each merged string.
3820
78384e8f
CC
38212010-07-15 Cary Coutant <ccoutant@google.com>
3822
3823 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3824 here.
3825
783659f9
ILT
38262010-07-14 Ian Lance Taylor <iant@google.com>
3827
3828 * descriptors.cc (Descriptors::open): Report correct name in error
3829 message.
3830
131687b4
DK
38312010-07-13 Doug Kwan <dougkwan@google.com>
3832
3833 * arm.cc (Arm_input_section::Arm_input_section): For a
3834 SHT_ARM_EXIDX section, always keeps the input sections.
3835 (Arm_input_section::set_exidx_section_link): New method.
3836 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3837 has_errors_ to false.
3838 (Arm_exidx_input_section::has_errors,
3839 Arm_exidx_input_section::set_has_errors): New methods.
3840 (Arm_exidx_input_section::has_errors_): New data member.
3841 (Arm_relobj::get_exidx_shndx_list): New method.
3842 (Arm_output_section::append_text_sections_to_list): Do not skip
3843 section without SHF_EXECINSTR.
3844 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3845 errors.
3846 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3847 section header. Make error messages more verbose. Check for
3848 a non-executable section linked to an EXIDX section.
3849 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3850 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3851 check that there is no deferred EXIDX section if we exit early.
3852 Instead of not making an EXIDX section in case of an error, make one
3853 and set the has_errors flag of it.
3854 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3855 in a relocatable link.
3856 (Target_arm::do_relax): Look for the EXIDX output section instead of
3857 assuming that it is called .ARM.exidx.
3858 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3859 section list. Do not check for SHF_EXECINSTR section flags but
3860 skip any input section with errors.
3861 * output.cc (Output_section::Output_section): Initialize
3862 always_keeps_input_sections_ to false.
3863 (Output_section::add_input_section): Check for
3864 always_keeps_input_sections_.
3865 * output.h (Output_section::always_keeps_input_sections,
3866 Output_section::set_always_keeps_input_sections): New methods.
3867 (Output_section::always_keeps_input_sections): New data member.
3868
69517287
RÁE
38692010-07-13 Rafael Espindola <espindola@google.com>
3870
3871 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3872 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3873
82742395
ILT
38742010-07-13 Philip Herron <herron.philip@googlemail.com>
3875 Ian Lance Taylor <iant@google.com>
3876
3877 * output.h (Output_section_lookup_maps::add_merge_section):
3878 Correct check of whether value was inserted.
3879 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3880 (Output_section_lookup_maps::add_relaxed_input_section):
3881 Likewise.
3882 * arm.cc (Target_arm::got_section): Remove used local os.
3883 * i386.cc (Target_i386::got_section): Likewise.
3884 * x86_64.cc (Target_x86_64::got_section): Likewise.
3885 * sparc.cc (Target_sparc::got_section): Likewise.
3886 (Target_sparc::relocate): Remove unused local have_got_offset.
3887 * powerpc.cc (Target_powerpc::relocate): Likewise.
3888
f2d707b5
ILT
38892010-07-13 Ian Lance Taylor <iant@google.com>
3890
241531d6
ILT
3891 * compressed_output.cc (zlib_decompress): Fix signature in
3892 !HAVE_ZLIB_H case.
3893
f2d707b5
ILT
3894 * archive.cc (Archive::include_member): Unlock an external member
3895 of a thin archive. Don't bother to delete an object we know is
3896 NULL.
3897
a2e47362
CC
38982010-07-12 Cary Coutant <ccoutant@google.com>
3899
3900 * compressed_output.cc (zlib_decompress): New function.
3901 (get_uncompressed_size): New function.
3902 (decompress_input_section): New function.
3903 * compressed_output.h (get_uncompressed_size): New function.
3904 (decompress_input_section): New function.
3905 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3906 Handle compressed debug sections.
3907 * layout.cc (is_compressed_debug_section): New function.
3908 (Layout::output_section_name): Map compressed section names to
3909 canonical names.
3910 * layout.h (is_compressed_debug_section): New function.
3911 (is_debug_info_section): Recognize compressed debug sections.
3912 * merge.cc: Include compressed_output.h.
3913 (Output_merge_data::do_add_input_section): Handle compressed
3914 debug sections.
3915 (Output_merge_string::do_add_input_section): Handle compressed
3916 debug sections.
3917 * object.cc: Include compressed_output.h.
3918 (Sized_relobj::Sized_relobj): Initialize new data members.
3919 (build_compressed_section_map): New function.
3920 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3921 * object.h (Object::section_is_compressed): New method.
3922 (Object::do_section_is_compressed): New method.
3923 (Sized_relobj::Compressed_section_map): New type.
3924 (Sized_relobj::do_section_is_compressed): New method.
3925 (Sized_relobj::compressed_sections_): New data member.
3926 * output.cc (Output_section::add_input_section): Handle compressed
3927 debug sections.
3928 * reloc.cc: Include compressed_output.h.
3929 (Sized_relobj::write_sections): Handle compressed debug sections.
3930
ce279a62
CC
39312010-07-08 Cary Coutant <ccoutant@google.com>
3932
3933 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3934 weak when resolving to a dynamic def.
3935 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3936 for weak undef/dynamic def cases. Adjust callers.
3937 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3938 undef_binding_weak_.
3939 (Symbol_table::sized_write_globals): Adjust symbol binding.
3940 (Symbol_table::sized_write_symbol): Add binding parameter.
3941 * symtab.h (Symbol::set_undef_binding): New method.
3942 (Symbol::is_undef_binding_weak): New method.
3943 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3944 (Symbol_table::should_override): Add new parameter.
3945 (Symbol_table::sized_write_symbol): Add new parameter.
3946
3947 * testsuite/weak_undef_file1.cc: Add new test case.
3948 * testsuite/weak_undef_file2.cc: Fix header comment.
3949 * testsuite/weak_undef_test.cc: Add new test case.
3950
b2286c10
DK
39512010-06-29 Doug Kwan <dougkwan@google.com>
3952
3953 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3954 Initialize USE_SYMBOL_.
3955 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3956 definition.
3957 (Arm_reloc_property::uses_symbol_): New data member declaration.
3958 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3959 uses symbol value and symbol is undefined but not weakly undefined.
3960
4802450a
RÁE
39612010-06-28 Rafael Espindola <espindola@google.com>
3962
3963 * plugin.cc (Plugin::load): Use dlerror.
3964
e5ca47ba
ILT
39652010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3966
3967 * symtab.cc (detect_odr_violations): When reporting an ODR
3968 violation, report an object where the symbol is defined.
3969
8a75a161
DK
39702010-06-25 Doug Kwan <dougkwan@google.com>
3971
3972 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3973 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3974 definition.
3975 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3976 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3977 target hook to detect function points.
3978 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3979 * icf.h (Icf::check_section_for_function_pointers): Change type of
3980 parameter SECTION_NAME to const reference to std::string. Use
3981 target hook to determine if section may have unsafe pointers.
3982 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3983 method definition.
3984
42218b9f
RÁE
39852010-06-21 Rafael Espindola <espindola@google.com>
3986
3987 * fileread.cc (Input_file::find_fie): New
3988 (Input_file::open): Use Input_file::find_fie.
3989 * fileread.h (Input_file::find_fie): New
3990 * plugin.cc (set_extra_library_path): New.
3991 (Plugin::load): Add set_extra_library_path to the transfer vector.
3992 (Plugin_manager::set_extra_library_path): New.
3993 (Plugin_manager::add_input_file): Use the extra search path if set.
3994 (set_extra_library_path(): New.
3995 * plugin.h (Plugin_manager): Add set_extra_library_path and
3996 extra_search_path_.
3997
a0506cca
CC
39982010-06-19 Cary Coutant <ccoutant@google.com>
3999
4000 * layout.cc (gdb_sections): Add .debug_types.
4001 (lines_only_debug_sections): Likewise.
4002
6508b958
RÁE
40032010-06-18 Rafael Espindola <espindola@google.com>
4004
4005 * plugin.cc (add_input_file,add_input_library)
4006 (Plugin_manager::add_input_file): Make filename arguments const.
4007 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
4008 const.
4009
3e235302
DK
40102010-06-16 Doug Kwan <dougkwan@google.com>
4011
4012 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
4013 .ARM.attributes section if we have not merged any input
4014 attributes sections.
4015
106e8a6c
DK
40162010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4017
4018 * arm.cc: Allow combining objects with no EABI version
4019 information.
4020
91ff43fe
RÁE
40212010-06-15 Rafael Espindola <espindola@google.com>
4022
4023 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
4024
68ed838c
ILT
40252010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4026
4027 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
4028 (struct iovec): Correct !HAVE_READV definition.
4029
f3a2388f
CC
40302010-06-10 Cary Coutant <ccoutant@google.com>
4031
4032 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
4033 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
4034 reloc sections.
4035 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
4036
4037 PR 11683
4038 * symtab.h (Symbol::is_placeholder): New member function.
4039 * target-reloc.h (relocate_section): Check for placeholder symbols.
4040
4041 * testsuite/Makefile.am (plugin_test_8): New test.
4042 (plugin_test_9): New test.
4043 * testsuite/Makefile.in: Regenerate.
4044
e1df38aa
NC
40452010-06-09 Nick Clifton <nickc@redhat.com>
4046
4047 * yyscript.y (input_list_element): Allow strings prefixed with
4048 the '-' character. Treat these as libraries.
4049 * script.cc (script_add_library): New function. Adds a library
4050 specified by "-l<name>" found in an input script.
4051 * script-c.h: Add prototype for script_add_library.
4052
25bbe950
DK
40532010-06-07 Doug Kwan <dougkwan@google.com>
4054
4055 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
4056 Restrict stub-group size to be within long conditional branch
4057 range when working around cortex-A8 erratum.
4058
0f32ea4c
ILT
40592010-06-07 Damien Diederen <dd@crosstwine.com>
4060
4061 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
4062 #ifdef typo.
4063
8fe2a369
ST
40642010-06-03 Sriraman Tallam <tmsriram@google.com>
4065
4066 PR gold/11658
4067 * output.cc
4068 (Output_section::Input_section_sort_entry::compare_section_ordering):
4069 Change to return non-zero correctly.
4070 (Output_section::Input_section_sort_section_order_index_compare
4071 ::operator()): Change to fix ambiguity in comparisons.
4072
6e9ba2ca
ST
40732010-06-01 Sriraman Tallam <tmsriram@google.com>
4074
4075 * gold.h (is_wildcard_string): New function.
4076 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
4077 (Layout::layout_eh_frame): Ditto.
4078 (Layout::find_section_order_index): New method.
4079 (Layout::read_layout_from_file): New method.
4080 * layout.h (Layout::find_section_order_index): New method.
4081 (Layout::read_layout_from_file): New method.
4082 (Layout::input_section_position_): New private member.
4083 (Layout::input_section_glob_): New private member.
4084 * main.cc (main): Call read_layout_from_file here.
4085 * options.h (--section-ordering-file): New option.
4086 * output.cc (Output_section::input_section_order_specified_): New
4087 member.
4088 (Output_section::Output_section): Initialize new member.
4089 (Output_section::add_input_section): Add new parameter.
4090 Keep input sections when --section-ordering-file is used.
4091 (Output_section::set_final_data_size): Sort input sections when
4092 section ordering file is specified.
4093 (Output_section::Input_section_sort_entry): Add new parameter.
4094 Check sorting type.
4095 (Output_section::Input_section_sort_entry::compare_section_ordering):
4096 New method.
4097 (Output_section::Input_section_sort_compare::operator()): Change to
4098 consider section_order_index.
4099 (Output_section::Input_section_sort_init_fini_compare::operator()):
4100 Change to consider section_order_index.
4101 (Output_section::Input_section_sort_section_order_index_compare
4102 ::operator()): New method.
4103 (Output_section::sort_attached_input_sections): Change to sort
4104 according to section order when specified.
e1df38aa
NC
4105 (Output_section::add_input_section<32, true>): Add new parameter.
4106 (Output_section::add_input_section<64, true>): Add new parameter.
4107 (Output_section::add_input_section<32, false>): Add new parameter.
4108 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
4109 * output.h (Output_section::add_input_section): Add new parameter.
4110 (Output_section::input_section_order_specified): New
4111 method.
4112 (Output_section::set_input_section_order_specified): New method.
4113 (Input_section::Input_section): Initialize section_order_index_.
4114 (Input_section::section_order_index): New method.
4115 (Input_section::set_section_order_index): New method.
4116 (Input_section::section_order_index_): New member.
4117 (Input_section::Input_section_sort_section_order_index_compare): New
4118 struct.
4119 (Output_section::input_section_order_specified_): New member.
4120 * script-sections.cc (is_wildcard_string): Delete and move modified
4121 method to gold.h.
4122 (Output_section_element_input::Output_section_element_input): Modify
4123 call to is_wildcard_string.
4124 (Output_section_element_input::Input_section_pattern
4125 ::Input_section_pattern): Ditto.
4126 (Output_section_element_input::Output_section_element_input): Ditto.
4127 * testsuite/Makefile.am (final_layout): New test case.
4128 * testsuite/Makefile.in: Regenerate.
4129 * testsuite/final_layout.cc: New file.
4130 * testsuite/final_layout.sh: New file.
4131
3537c84b
RÁE
41322010-06-01 Rafael Espindola <espindola@google.com>
4133
4134 * plugin.cc (Plugin::load): Pass the output name to the plugin.
4135
105b6afd
RÁE
41362010-06-01 Rafael Espindola <espindola@google.com>
4137
4138 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
4139 visibility of symbols.
4140
29e11421
DK
41412010-05-27 Doug Kwan <dougkwan@google.com>
4142
4143 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
4144 from start of output section instead of address for a local symbol
4145 in a merged or relaxed section when doing a relocatable link.
4146
5e0f337e
RÁE
41472010-05-26 Rafael Espindola <espindola@google.com>
4148
4149 PR 11604
4150 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
4151 adding sections the garbage collector removed.
4152 * gold/testsuite/Makefile.am: Add test.
4153 * gold/testsuite/Makefile.in: Regenerate.
4154 * gold/testsuite/plugin_test_7.sh: New.
4155 * gold/testsuite/plugin_test_7_1.c: New.
4156 * gold/testsuite/plugin_test_7_2.c: New.
4157
f4187277
RÁE
41582010-05-26 Rafael Espindola <espindola@google.com>
4159
4160 * script-sections.cc (Output_section_definition::set_section_addresses):
4161 Check for --section-start.
4162
5c388529
DK
41632010-05-26 Doug Kwan <dougkwan@google.com>
4164
4165 * arm.cc (Arm_scan_relocatable_relocs): New class.
4166 (Target_arm::relocate_special_relocatable): New method.
4167 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
4168 (Arm_relocate_functions::thumb_branch_common): Same.
4169 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
4170 instead of Default_scan_relocatable_relocs.
4171 * target-reloc.h (relocate_for_relocatable): Let target handle
4172 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
4173 * target.h (Sized_target::relocate_special_relocatable): New method.
4174
bca1c3ae
ILT
41752010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4176
4177 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
4178
0439c796
DK
41792010-05-23 Doug Kwan <dougkwan@google.com>
4180
4181 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
4182 instead of a cast.
4183 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
4184 with a direct branch, not a conditional branch, to a stub.
4185 * merge.cc (Output_merge_base::record_input_section): New method
4186 defintion.
4187 (Output_merge_data::do_add_input_section): Record input section if
4188 keeps-input-sections flag is set.
4189 (Output_merge_string::do_add_input_section): Ditto.
4190 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
4191 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
4192 INPUT_SECTIONS_.
4193 (Output_merge_base::keeps_input_sections,
4194 Output_merge_base::set_keeps_input_sections,
4195 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
4196 method definitions.
4197 (Output_merge_base::Input_sections): New type declaration.
4198 (Output_merge_base::input_sections_begin,
4199 Output_merge_base::input_sections_end,
4200 Output_merge_base::do_set_keeps_input_sections): New method definitions.
4201 (Output_merge_base::bool keeps_input_sections_,
4202 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
4203 Output_merge_base::input_sections_): New data members.
4204 (Output_merge_data::do_set_keeps_input_sections): New method
4205 defintion.
4206 (Output_merge_string::do_set_keeps_input_sections): Ditto.
4207 * output.cc (Output_section::Input_section::relobj): Move method
4208 defintion from class declaration to here and handle merge sections.
4209 (Output_section::Input_section::shndx): Ditto.
4210 (Output_section::Output_section): Remove initializations of removed
4211 data members and initialize new data member LOOKUP_MAPS_.
4212 (Output_section::add_input_section): Set keeps-input-sections flag
4213 for a newly created merge output section as appropriate. Adjust code
4214 to use Output_section_lookup_maps class.
4215 (Output_section::add_relaxed_input_section): Adjst code for lookup
4216 maps code refactoring.
4217 (Output_section::add_merge_input_section): Add a new parameter
4218 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
4219 class. If adding input section to a newly created merge output
4220 section fails, remove the new merge section.
4221 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 4222 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
4223 (Output_section::find_merge_section): Ditto.
4224 (Output_section::build_lookup_maps): New method defintion.
4225 (Output_section::find_relaxed_input_section): Adjust code to use
4226 Output_section_lookup_maps class.
4227 (Output_section::get_input_sections): Export merge sections. Adjust
4228 code to use Output_section_lookup_maps class.
4229 (Output_section:::add_script_input_section): Adjust code to use
4230 Output_section_lookup_maps class. Update lookup maps for merge
4231 sections also.
4232 (Output_section::discard_states): Use Output_section_lookup_maps.
4233 (Output_section::restore_states): Same.
4234 * output.h (Merge_section_properties): Move class defintion out of
4235 Output_section.
4236 (Output_section_lookup_maps): New class.
4237 (Output_section::Input_section::is_merge_section): New method
4238 defintion.
4239 (Output_section::Input_section::relobj): Move defintion out of class
4240 defintion. Declare method only.
4241 (Output_section::Input_section::shndx): Ditto.
4242 (Output_section::Input_section::output_merge_base): New method defintion.
4243 (Output_section::Input_section::u2_.pomb): New union field.
4244 (Output_section::Merge_section_by_properties_map,
4245 Output_section::Output_section_data_by_input_section_map,
4246 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
4247 Remove types.
4248 (Output_section::add_merge_input_section): Add new parameter
4249 KEEPS_INPUT_SECTIONS.
4250 (Output_section::build_lookup_maps): New method declaration.
4251 (Output_section::merge_section_map_,
4252 Output_section::merge_section_by_properties_map_,
4253 Output_section::relaxed_input_section_map_,
4254 Output_section::is_relaxed_input_section_map_valid_): Remove data
4255 members.
4256 (Output_section::lookup_maps_): New data member.
4257
76295588
L
42582010-05-21 Doug Kwan <dougkwan@google.com>
4259
4260 PR gold/11619
4261 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
4262 avoid a compilation error.
4263
d103a984
RÁE
42642010-05-19 Rafael Espindola <espindola@google.com>
4265
4266 * script-sections.cc (Output_section_definition::allocate_to_segment):
4267 Update the phdrs_list even when the output section is NULL.
4268 * testsuite/Makefile.am: Add test.
4269 * testsuite/Makefile.in: Regenerate.
4270 * testsuite/script_test_9.cc: New.
4271 * testsuite/script_test_9.sh: New.
4272 * testsuite/script_test_9.t: New.
4273
6625d24e
DK
42742010-05-19 Doug Kwan <dougkwan@google.com>
4275
4276 * arm.cc (Arm_input_section::original_size): New method.
4277 (Arm_input_section::do_addralign): Add a cast.
4278 (Arm_input_section::do_output_offset): Remove static cast.
4279 (Arm_input_section::original_addralign,
4280 Arm_input_section::original_size_): Change type to uint32_t.
4281 (Arm_input_section::init): Add safe casts for section alignment
4282 and size.
4283 (Arm_input_section::set_final_data_size): Do not set address and
4284 offset of stub table.
4285 (Arm_output_section::fix_exidx_coverage): Change use of of
4286 Output_section::Simple_input_section to that of
4287 Output_section::Input_section.
4288 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
4289 except for the first pass.
4290 * output.cc (Output_section::get_input_sections): Change type of
4291 input_sections to std::list<Input_section>.
4292 (Output_section::add_script_input_section): Rename from
4293 Output_section::add_simple_input_section. Change type of SIS
4294 parameter from Simple_input_section to Input_section.
4295 * output.h (Output_section::Simple_input_section): Remove class.
4296 (Output_section::Input_section): Change class visibility to public.
4297 (Output_section::Input_section::addralign): Use stored alignments
4298 for special input sections if set.
4299 (Output_section::Input_section::set_addralign): New method.
4300 (Output_section::get_input_sections): Change parameter type from
4301 list of Simple_input_section to list of Input_section.
4302 (Output_section::add_script_input_section): Rename from
4303 Output_section::add_simple_input_section. Change first parameter's
4304 type from Simple_input_section to Input_section and remove the
4305 second and third parameters.
4306 * script-sections.cc (Input_section::Input_section_list): Change
4307 type to list of Output_section::Input_section/
4308 (Input_section_info::Input_section_info): Change parameter type of
4309 INPUT_SECTION to Output_section::Input_section.
4310 (Input_section_info::input_section): Change return type.
4311 (Input_section_info::input_section_): Change type to
4312 Output_section::Input_section.
4313 (Output_section_element_input::set_section_addresses): Adjust code
4314 to use Output_section::Input_section instead of
4315 Output_section::Simple_input_section. Adjust code for renaming
4316 of Output_section::add_simple_input_section.
4317 (Orphan_output_section::set_section_addresses): Ditto.
4318
e1e82ea4
RW
43192010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4320
4321 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
4322 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
4323
91e75c8a
RÁE
43242010-05-18 Rafael Espindola <espindola@google.com>
4325
4326 * options.cc (General_options::finalize): Handle -nostdlib.
4327 * options.h (nostdlib): New option.
4328 * script.cc (script_add_search_dir): Handle -nostdlib.
4329
da59ad79
DK
43302010-05-12 Doug Kwan <dougkwan@google.com>
4331
4332 * arm.cc (Target_arm::do_finalize_sections): Create an empty
4333 attributes section only if there no attributes section after merging.
4334 (Target_arm::merge_object_attributes): Move value of
e1df38aa 4335 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
4336 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
4337 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
4338 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
4339 and arm_attr_merge_7.stdout.
4340 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
4341 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
4342 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
4343 arm_attr_merge_7b.o): New rules.
4344 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
4345 arm_attr_merge_7
4346 * testsuite/Makefile.in: Regenerate.
4347 * testsuite/arm_attr_merge.sh: New file.
4348 * testsuite/arm_attr_merge_[67][ab].s: Same.
4349
3e01a7fd
NC
43502010-05-05 Nick Clifton <nickc@redhat.com>
4351
4352 * po/es.po: Updated Spanish translation.
4353
7ad2014a
L
43542010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4355
4356 * Makefile.am (install-exec-local): Properly install gold as
4357 default cross linker.
4358 * Makefile.in: Regenerated.
4359
4fda8867
NC
43602010-04-27 H.J. Lu <hongjiu.lu@intel.com>
4361 Nick Clifton <nickc@redhat.com>
4362
4363 * configure.ac (install_as_default): Define and set to false
4364 unless --enable-gold or --enable-gold=both/gold has been
4365 specified.
4366 * configure: Regenerate.
4367
4368 * Makefile.am (install-exec-local): Install the executable as
4369 'ld.gold'. If install_as_default is true then also install it as
4370 'ld'.
4371 * Makefile.in: Regenerated.
4372
bd288ea2
ILT
43732010-04-24 Ian Lance Taylor <iant@google.com>
4374
4375 * layout.cc (Layout::layout_reloc): In relocatable link don't
4376 combine reloc sections for grouped sections.
4377
ef38fd8a
ST
43782010-04-23 Sriraman Tallam <tmsriram@google.com>
4379
4380 * gc.h (gc_process_relocs): Pass information on relocs pointing to
4381 sections that are not ordinary to icf.
4382 * icf.cc (get_section_contents): Handle relocation pointing to section
4383 with no object or shndx information.
4384 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
4385 * testsuite/Makefile.in: Regenerate.
4386 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
4387 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
4388
f6973bdc
ILT
43892010-04-22 Ian Lance Taylor <iant@google.com>
4390
4391 * expression.cc (Expression::Expression_eval_info): Add
4392 result_alignment_pointer field.
4393 (Expression::eval_with_dot): Add result_alignment_pointer
4394 parameter. Change all callers.
4395 (Expression::eval_maybe_dot): Likewise.
4396 (class Binary_expression): Add alignment_pointer parameter to
4397 left_value and right_value. Change all callers.
4398 (BINARY_EXPRESSION): Set result alignment.
4399 (class Trinary_expression): Add alignment_pointer parameter to
4400 arg2_value and arg3_value. Change all callers.
4401 (Trinary_cond::value): Set result alignment.
4402 (Max_expression::value, Min_expression::value): Likewise.
4403 (Align_expression::value): Likewise.
4404 * script-sections.cc (class Sections_element): Add dot_alignment
4405 parameter to set_section_addresses virtual function. Update
4406 instantiations.
4407 (class Output_section_element): Likewise.
4408 (Script_sections::create_segments): Add dot_alignment parameter.
4409 Change all callers.
4410 (Script_sections::create_segments_from_phdrs_clause): Likewise.
4411 (Script_sections::set_phdrs_clause_addresses): Likewise.
4412 * script-sections.h: Update declarations.
4413 * script.h: Update declarations.
4414 * output.h (Output_segment::set_minimum_p_align): Don't decrease
4415 min_p_align.
4416 * testsuite/script_test_3.t: Set large alignment.
4417 * testsuite/script_test_3.sh: Make sure that at least one LOAD
4418 segment has expected alignment.
4419
9c9c98a5
NC
44202010-04-22 Nick Clifton <nickc@redhat.com>
4421
4422 * po/gold.pot: Updated by the Translation project.
4423 * po/vi.po: Updated Vietnamese translation.
4424
2253bfba
L
44252010-04-22 H.J. Lu <hongjiu.lu@intel.com>
4426
4427 * testsuite/Makefile.am (check_PROGRAMS): Add
4428 icf_virtual_function_folding_test.
4429 * testsuite/Makefile.in: Regenerated.
4430
85fdf906
AH
44312010-04-15 Andrew Haley <aph@redhat.com>
4432
4433 * options.h (merge_exidx_entries): New option.
4434 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
4435 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
4436 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
4437 (Target_arm::merge_exidx_entries): New function.
4438 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
4439 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
4440 to Arm_exidx_fixup constructor.
4441 Add new arg, merge_exidx_entries.
4442 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
4443 Arm_output_section::fix_exidx_coverage.
4444
ce97fa81
ST
44452010-04-18 Sriraman Tallam <tmsriram@google.com>
4446
4447 * icf.cc (get_section_contents): Check for preemptible functions.
4448 Ignore addend when appropriate.
4449 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
4450 section folded.
4451 (add_from_relobj): Check for section folded.
4452 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
4453 * symtab.h (should_add_dynsym_entry): Add new parameter.
4454 * target-reloc.h (scan_relocs): Check for section folded.
4455 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
4456 Check reloc types for function pointers in shared objects.
4457 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
4458 case.
4459 (icf_preemptible_functions_test): New test case.
4460 (icf_string_merge_test): New test case.
4461 * testsuite.Makefile.in: Regenerate.
4462 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
4463 bar_glob. Refactor code.
4464 * testsuite/icf_preemptible_functions_test.cc: New file.
4465 * testsuite/icf_preemptible_functions_test.sh: New file.
4466 * testsuite/icf_string_merge_test.cc: New file.
4467 * testsuite/icf_string_merge_test.sh: New file.
4468 * testsuite/icf_virtual_function_folding_test.cc: New file.
4469 * testsuite/icf_virtual_function_folding_test.sh: New file.
4470
04ceb17c
DK
44712010-04-14 Doug Kwan <dougkwan@google.com>
4472
4473 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
4474 for local symbol recounting if we remove a section due to ICF.
4475 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
4476 there are no regular objects in input.
4477
153e7da4
DK
44782010-04-13 Doug Kwan <dougkwan@google.com>
4479
4480 * arm.cc (Arm_input_section::set_final_data_size): Compute
4481 accurate final data size instead of using current data size.
4482
4dbd9faf
DK
44832010-04-09 Doug Kwan <dougkwan@google.com>
4484
4485 * layout.cc (Layout::choose_output_section): Handle script section
4486 types.
4487 (Layout::make_output_section_for_script): Add section type parameter.
4488 Handle script section types.
4489 * layout.h (Layout::make_output_section_for_script): Add section
4490 type parameter.
4491 * output.cc (Output_section::Output_section): Initialize data member
4492 is_noload_.
4493 (Output_section::do_reset_address_and_file_offset): Do not set address
4494 to 0 if section is a NOLOAD section.
4495 * output.h (Output_section::is_noload): New method.
4496 (Output_section::set_is_noload): Ditto.
4497 (Output_section::is_noload_): New data member.
4498 * script-c.h (Script_section_type): New enum type.
4499 (struct Parser_output_section_header): Add new file section_type.
4500 * script-sections.cc (Sections_element::output_section_name): Add
4501 parameter for returning script section type.
4502 (Output_section_definition::output_section_name): Ditto.
4503 (Output_section_definition::section_type)P; New method.
4504 (Output_section_definiton::script_section_type_name): Ditto.
4505 (Output_section_definition::script_section_type_): New data member.
4506 (Output_section_definition::Output_section_definition): Initialize
4507 data member Output_section_definition::script_section_type_.
4508 (Output_section_definition::create_sections): Pass script section type
4509 to Layout::make_output_section_for_script.
4510 (Output_section_definition::output_section_name): Return script
4511 section type to caller.
4512 (Output_section_definition::set_section_address): Do not advance
4513 dot value and load address if section type is NOLOAD. Set address
4514 of NOLOAD sections regardless of section flags.
4515 (Output_section_definition::print): Print section type if it is
4516 not SCRIPT_SECTION_TYPE_NONE.
4517 (Output_section_definition::section_type): New method.
4518 (Output_section_definition::script_section_type_name): Ditto.
4519 (Script_sections::output_section_name): Add new parameter
4520 PSECTION_TYPE for returning script section type. Pass it to
4521 section elements. Handle discard sections.
4522 (Sort_output_sections::operator()): Handle NOLOAD sections.
4523 * script-sections.h (Script_sections::Section_type): New enum type.
4524 (Script_sections::output_section_name): Add a new parameter for
4525 returning script section type.
4526 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
4527 INFO and NOLOAD.
4528 * yyscript.y (union): Add new field SECTION_TYPE.
4529 (COPY, DSECT, INFO, NOLOAD): New tokens.
4530 (opt_address_and_section_type): Change type to output_section_header.
4531 (section_type): New non-terminal
4532 (section_header): Handle section type.
2253bfba 4533 (opt_address_and_section_type): Return section type value.
4dbd9faf 4534
721ea635
L
45352010-04-09 H.J. Lu <hongjiu.lu@intel.com>
4536
4537 * testsuite/plugin_common_test_1.c (foo): Add prototype.
4538 * testsuite/plugin_common_test_2.c (foo): Likewise.
4539
6bf924b0
DK
45402010-04-08 Doug Kwan <dougkwan@google.com>
4541
4542 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
4543 Output_merge_data.
4544 * output.cc (Output_section::add_merge_input_section): Simplify
4545 code and return status of Output_merge_base::add_input_section.
e1df38aa 4546 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
4547 returns true.
4548
24af6f92
DK
45492010-04-07 Doug Kwan <dougkwan@google.com>
4550
4551 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
4552 if section is marked as containing instructions but has no mapping
4553 symbols.
4554 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
4555 correct section index.
4556 (Arm_relobj::find_linked_text_section): Ditto.
4557
00698fc5
CC
45582010-04-07 Cary Coutant <ccoutant@google.com>
4559
4560 * archive.cc (include_member): Destroy Read_symbols_data object before
4561 releasing file.
4562 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
4563 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
4564 (Read_symbols_data::~Read_symbols_data) New destructor.
4565 (Section_relocs::Section_relocs) New constructor.
4566 (Section_relocs::~Section_relocs) New destructor.
4567 (Read_relocs_data::Read_relocs_data) New constructor.
4568 (Read_relocs_data::~Read_relocs_data) New destructor.
4569 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
4570 pointers to NULL after deleting.
4571
7296d933
DK
45722010-04-07 Doug Kwan <dougkwan@google.com>
4573
4574 * arm.cc: Replace "endianity" with "endianness" in comments.
4575 (Arm_exidx_cantunwind): Ditto.
4576 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
4577 (Arm_relobj::merge_flags_and_attributes): New method.
4578 (Arm_relobj::merge_flags_and_attributes_): New data member.
4579 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
4580 (Arm_relobj::scan_sections_for_stubs): Ditto.
4581 (Arm_relobj::do_read_symbols): Check to see if we really want to
4582 merge processor-specific flags and attributes. Exit early if
4583 an object is empty except for section names and the undefined symbol.
4584 (Target_arm::do_finalize_sections): Move check for ELF format to
4585 Arm_relobj::do_read_symbols. Merge processor specific flags and
4586 attributes from a regular object only when we have determined that
4587 it is aapropriate. Do not create an .ARM.attributes section in
4588 output if there is no regular input object.
4589 (Target_arm::merge_processor_specific_flags): Check
4590 --warn-mismatch before printing any error.
4591 (Target_arm::merge_object_attributes): Ditto.
4592 * gold.cc (queue_middle_tasks): Handle the case in which there is
4593 no regular object in input.
4594 * options.cc (General_options::parse_EB): New method.
4595 (General_options::parse_EL): Same.
4596 (General_options::General_options): Initialize endianness_.
4597 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
4598 New options.
4599 (General_options::Endianness): New enum.
4600 (General_options::endianness): New method.
4601 (General_options::endianness_): New data member.
4602 * parameters.cc (Parameters::set_options): Check target endianness.
4603 (Parameters::set_target_once): Ditto.
4604 (Parameters::check_target_endianness): New method.
4605 (parameters_force_valid_target): If either -EL or -EB is specified,
4606 use it to define endianness of default target.
4607 * parameters.h (Parameters::check_target_endianness): New method
4608 declaration.
4609 * target.h (class Target): Change "endianity" to "endianness"
4610 in comments.
4611
efc8d4f2
RW
46122010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4613
4614 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
4615 * configure: Regenerate.
4616 * Makefile.in: Regenerate.
4617 * testsuite/Makefile.in: Regenerate.
4618
be234d88
CC
46192010-04-06 Cary Coutant <ccoutant@google.com>
4620
4621 gcc PR lto/42757
4622 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
4623 prevailing definitions of common symbols.
4624 * testsuite/plugin_test_6.sh: New test case.
4625 * testsuite/plugin_common_test_1.c: New test case.
4626 * testsuite/plugin_common_test_2.c: New test case.
4627 * testsuite/Makefile.am (plugin_test_6): New test case.
4628 * testsuite/Makefile.in: Regenerate.
4629
bd32c6bd
NC
46302010-04-06 Nick Clifton <nickc@redhat.com>
4631
4632 * po/vi.po: New Vietnamese translation.
4633
323c532f
DK
46342010-03-30 Doug Kwan <dougkwan@google.com>
4635
4636 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
4637
4fcd97eb
DK
46382010-03-25 Doug Kwan <dougkwan@google.com>
4639
4640 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
4641 to avoid a conversion warning on a 32-bit host.
4642
4ebf39db
ILT
46432010-03-24 Ian Lance Taylor <iant@google.com>
4644
4645 * testsuite/script_test_3.t: Add a TLS segment.
4646 * testsuite/Makefile.am (check_PROGRAMS): Add
4647 tls_phdrs_script_test.
4648 (tls_phdrs_script_test_SOURCES): Define.
4649 (tls_phdrs_script_test_DEPENDENCIES): Define.
4650 (tls_phdrs_script_test_LDFLAGS): Define.
4651 (tls_phdrs_script_test_LDADD): Define.
4652 * testsuite/Makefile.in: Rebuild.
4653
4a599bdd
CC
46542010-03-23 Cary Coutant <ccoutant@google.com>
4655
4656 * fileread.cc (find_or_make_view): Fix comment.
4657
6c93b22c
ILT
46582010-03-23 Ian Lance Taylor <iant@google.com>
4659
4660 * script-sections.cc (class Orphan_section_placement): Define
4661 PLACE_TLS and PLACE_TLS_BSS.
4662 (Orphan_section_placement::Orphan_section_placement): Initialize
4663 new places.
4664 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
4665 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
4666 (tls_script_test_SOURCES): Define.
4667 (tls_script_test_DEPENDENCIES): Define.
4668 (tls_script_test_LDFLAGS): Define.
4669 (tls_script_test_LDADD): Define.
4670 * testsuite/Makefile.in: Rebuild.
4671
a2c7281b
DK
46722010-03-22 Doug Kwan <dougkwan@google.com>
4673
4674 * arm.cc (Arm_relocate_functions::abs8,
4675 Arm_relocate_functions::abs16): Use correct check for overflow
4676 specified in the ARM ELF specs.
4677 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
4678 target of a BLX instruction specially.
4679 (Reloc_stub::stub_type_for_reloc): Ditto.
4680 (Relocate::relocate): Use symbolic names instead of numeric relocation
4681 codes to report error.
4682 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
4683 workaround.
4684 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
4685 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
4686 thumb2_blx_out_of_range.stdout
4687 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
4688 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
4689 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
4690 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
4691 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
4692 thumb2_blx_in_range, thumb2_blx_in_range.o,
4693 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
4694 thumb2_blx_out_of_range.o): New rules.
4695 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
4696 thumb2_blx_in_range and thumb2_blx_out_of_range.
4697 * testsuite/Makefile.in: Regenerate.
4698 * arm_branch_in_range.sh: Add tests for THUMB BLX.
4699 * testsuite/thumb_blx_in_range.s: New file.
4700 * testsuite/thumb_blx_out_of_range.s: New file.
4701
b0193076
RÁE
47022010-03-22 Rafael Espindola <espindola@google.com>
4703
4704 * archive.cc (Should_include): Move to archive.h.
4705 (should_include_member): Make it a member of Archive.
4706 (Lib_group): New.
4707 (Add_lib_group_symbols): New.
4708 * archive.h: Include options.h.
4709 (Archive_member): Moved from Archive.
4710 (Should_include): Moved from archive.cc.
4711 (Lib_group): New.
4712 (Add_lib_group_symbols): New.
4713 * dynobj.cc (do_should_include_member): New.
4714 * dynobj.h (do_should_include_member): New.
4715 * gold.cc (queue_initial_tasks): Update call to queue.
4716 * main.cc (main): Print lib group stats.
4717 * object.cc (do_should_include_member): New.
4718 * object.h: Include archive.h.
4719 (Object::should_include_member): New.
4720 (Object::do_should_include_member): New.
4721 (Sized_relobj::do_should_include_member): New.
4722 * options.cc (General_options::parse_start_lib): New.
4723 (General_options::parse_end_lib): New.
4724 (Input_arguments::add_file): Handle lib groups.
4725 (Input_arguments::start_group): Check we are not in a lib.
4726 (Input_arguments::start_lib): New.
4727 (Input_arguments::end_lib): New.
4728 * options.h (General_options): Add start_lib and end_lib.
4729 (Input_argument::lib_): New.
4730 (Input_argument::lib): New.
4731 (Input_argument::is_lib): New.
4732 (Input_file_lib): New.
4733 (Input_arguments::in_lib_): New.
4734 (Input_arguments::in_lib): New.
4735 (Input_arguments::start_lib): New.
4736 (Input_arguments::end_lib_): New.
4737 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
4738 in unused members as preempted.
4739 (Sized_pluginobj::do_should_include_member): New.
4740 * plugin.h (Sized_pluginobj::do_should_include_member): New.
4741 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
4742 return the blocker.
4743 (Read_symbols::do_whole_lib_group): New.
4744 (Read_symbols::do_lib_group): New.
4745 (Read_symbols::do_read_symbols): Handle lib groups.
4746 (Read_symbols::get_name): Handle lib groups.
4747 * readsyms.h (Read_symbols): Add an archive member pointer.
4748 (Read_symbols::do_whole_lib_group): New.
4749 (Read_symbols::do_lib_group): New.
4750 (Read_symbols::member_): New.
4751 * script.cc (read_input_script): Update call to queue_soon.
4752
d099120c
DK
47532010-03-19 Doug Kwan <dougkwan@google.com>
4754
4755 * arm.cc (Stub_table::Stub_table): Initialize new data members
4756 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4757 (Stub_table::add_reloc_stub): Assign stub offset and update
4758 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
4759 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
4760 New data members.
4761 (Stub_table::update_data_size_and_addralign): Use
4762 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
4763 instead of going over all reloc stubs.
4764 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
4765 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4766 Stringpool_template::offset_ to size of Stringpool_char.
4767 (Stringpool_template::new_key_offset): Remove code to initialize
4768 Stringpool_template::offset_.
4769 * stringpool.h (Stringpool_template::set_no_zero_null): Set
4770 Stringpool_template::offset_ to zero.
4771
1aa37384
DK
47722010-03-15 Doug Kwan <dougkwan@google.com>
4773
4774 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
4775 offset_.
4776 (Stringpool_template::new_key_offset): New method.
4777 (Stringpool_template::add_string): Assign offsets when adding new
4778 strings.
4779 (Stringpool_template::set_string_offsets): Do not set string offsets
4780 when not optimizing.
4781 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
4782 member size_.
4783 (Chunked_vector::clear): Clear size_.
4784 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
4785 (Chunked_vector::size): Return size_.
4786 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4787 (Chunked_vector::size_): New data member.
1aa37384
DK
4788 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4789 (Stringpool_template::new_key_offset): New method declaration.
4790 (Stringpool_template::offset_): New data member.
4791
b672b057
RÁE
47922010-03-15 Rafael Espindola <espindola@google.com>
4793
4794 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4795 Add_symbols' constructor.
4796 * readsyms.h (Add_symbols): Remove the input_group member.
4797
b6848d3c
ILT
47982010-03-10 Ian Lance Taylor <iant@google.com>
4799
4800 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4801 target to ask whether a reference to a symbol requires a stack
4802 split.
4803 * target.h (Target::is_call_to_non_split): New function.
4804 (Target::do_is_call_to_non_split): Declare virtual function.
4805 * target.cc: Include "symtab.h".
4806 (Target::do_is_call_to_non_split): New function.
4807 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4808
a2a5469e
CC
48092010-03-10 Cary Coutant <ccoutant@google.com>
4810
4811 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4812 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4813 (File_read::open[2]): Add whole_file_view_ to list of views.
4814 (File_read::make_view): Remove test of whole_file_view_.
4815 (File_read::find_or_make_view): Create whole_file_view_ if
4816 necessary.
4817 (File_read::clear_views): Replace bool parameter with enum;
4818 adjust all callers. Don't delete views with permanent data;
4819 do delete cached views and views from archives if
4820 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4821 if clearing the corresponding view.
4822 * fileread.h (File_read::Clear_views_mode): New enum.
4823 (File_read::View::is_permanent_view): New method.
4824 (File_read::clear_views): Replace bool parameter
4825 with enum; adjust all callers.
4826 * options.h (General_options): Change keep_files_mapped option;
4827 add map_whole_files.
4828 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4829 releasing the file.
4830 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4831 the file.
4832
8861f32b
DM
48332010-03-10 David S. Miller <davem@davemloft.net>
4834
4835 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4836
d62d0f5f
ST
48372010-03-09 Sriraman Tallam <tmsriram@google.com>
4838
4839 * icf.cc (get_section_contents): Add '@' marker after processing the
4840 merge reloc.
4841
9177756d
DK
48422010-03-08 Doug Kwan <dougkwan@google.com>
4843
4844 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4845 due to a conversion warning.
4846 (Arm_relobj::update_output_local_symbol_count): Check for local
4847 symbol with unset output index.
4848
9e9e071b
ILT
48492010-03-05 Ian Lance Taylor <iant@google.com>
4850
4851 * options.h (class General_options): Add --spare-dynamic-tags.
4852 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4853 --spare-dynamic-tags.
4854
a81ee015
ILT
48552010-03-05 Ian Lance Taylor <iant@google.com>
4856
4857 * incremental.cc: Include "libiberty.h".
4858
44ec90b9
RO
48592010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4860
4861 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4862 function, is_info_ member.
4863 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4864 (Versions::Versions): Update caller.
4865 (Versions::define_base_version): Likewise.
4866 (Versions::add_def): Likewise.
4867
0897ed3b
ST
48682010-03-03 Sriraman Tallam <tmsriram@google.com>
4869
4870 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4871 (Scan::possible_function_pointer_reloc): New function.
4872 (Scan::local_reloc_may_be_function_pointer): Change to call
4873 possible_function_pointer_reloc.
4874 (Scan::global_reloc_may_be_function_pointer): Ditto.
4875 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4876 relocations in ".data.rel.ro._ZTV" section.
4877 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4878 * testsuite/icf_safe_so_test.cc: Ditto.
4879 * testsuite/icf_safe_test.cc: Ditto.
4880 * testsuite/icf_safe_test.sh: Ditto.
4881
d3bbad62
ILT
48822010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4883 Ian Lance Taylor <iant@google.com>
4884
4885 * target-reloc.h (relocate_section): Check the symbol table index
4886 for -1U before setting the local symbol index.
4887 (scan_relocatable_relocs): If copying the relocation, record that
4888 the local symbol is required.
4889 * object.h (Symbol_value::is_output_symtab_index_set): New
4890 function.
4891 (Symbol_value::may_be_discarded_from_output_symtab): New
4892 function.
4893 (Symbol_value::has_output_symtab_entry): New function.
4894 (Symbol_value::needs_output_symtab_entry): Remove.
4895 (Symbol_value::output_symtab_index): Make sure the symbol index is
4896 set.
4897 (Symbol_value::set_output_symtab_index): Make sure the symbol
4898 index is not set. Make sure the new index is valid.
4899 (Symbol_value::set_must_have_output_symtab_entry): New function.
4900 (Symbol_value::has_output_dynsym_entry): New function.
4901 (Symbol_value::set_output_dynsym_index): Make sure the new index
4902 is valid.
4903 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4904 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4905 local symbol if permitted.
4906 (Sized_relobj::do_finalize_local_symbols): Call
4907 is_output_symtab_index_set rather than needs_output_symtab_entry.
4908 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4909 rather than needs_output_symtab_entry. Call
4910 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4911 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4912 is_output_symtab_index_set rather than needs_output_symtab_entry.
4913 * testsuite/discard_locals_relocatable_test.c: New file.
4914 * testsuite/discard_locals_test.sh: Test -r.
4915 * testsuite/Makefile.am (check_DATA): Add
4916 discard_locals_relocatable_test1.syms,
4917 discard_local_relocatable_test2.syms.
4918 (MOSTLYCLEANFILES): Likewise. Also add
4919 discard_locals_relocatable_test1.lout and
4920 discard_locals_relocatable_test2.out.
4921 (discard_locals_relocatable_test1.syms): New target.
4922 (discard_locals_relocatable_test.o): New target.
4923 (discard_locals_relocatable_test1.out): New target.
4924 (discard_locals_relocatable_test2.syms): New target.
4925 (discard_locals_relocatable_test2.out): New target.
4926 (various): Add missing ../ld-new dependencies.
4927 * testsuite/Makefile.in: Rebuild.
4928
7e8ccf26
NC
49292010-03-03 Nick Clifton <nickc@redhat.com>
4930
4931 * po/fi.po: New Finnish translation.
4932
2a0ff005
DK
49332010-03-01 Doug Kwan <dougkwan@google.com>
4934
4935 * layout.cc (Layout::Layout): Force section types of .init_array*,
4936 .preinit_array* and .fini_array* sections.
4937 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4938 Fix check of return value of std::string::find.().
4939 (Output_section::Input_section_sort_compare::operator()): Remove
4940 comment about .init_array.
4941 (Output_section::Input_section_sort_init_fini_compare::operator()):
4942 New method.
4943 (Output_section::sort_attached_input_sections): Handle .init_array
4944 and .fini_array specially.
4945 * output.h (Output_section::Inut_section_sort_compare): Update
4946 comment.
4947 (Output_section::Input_section_sort_init_fini_compare): New struct.
4948
c3e4ae29
DK
49492010-02-26 Doug Kwan <dougkwan@google.com>
4950
4951 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4952 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4953 * testsuite/debug_msg.sh: Avoid matching source line number for
4954 use of global variable undef_int.
4955
2fd9ae7a
DK
49562010-02-26 Doug Kwan <dougkwan@google.com>
4957
4958 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4959 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4960 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4961 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4962 * options.cc (General_options::General_options): Initialize member
4963 fix_v4bx_.
4964 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4965 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4966 and rm_no_fix_v4bx.stdout
4967 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4968 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4969 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4970 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4971 and arm_no_fix_v4bx.
4972 * Makefile.in: Regenerate.
4973 * testsuite/arm_fix_v4bx.s: New file.
4974 * testsuite/arm_fix_v4bx.sh: Ditto.
4975
67ec7d0b
DK
49762010-02-24 Doug Kwan <dougkwan@google.com>
4977
4978 * arm.cc (Target_arm::got_section): Make the .got section the first
4979 non RELRO section in the data segment.
4980 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4981 suffixes of section names.
4982
10165461
DK
49832010-02-24 Doug Kwan <dougkwan@google.com>
4984
4985 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4986 flags and attributes merging if an input file is a binary file.
4987 * fileread.cc (Input_file::open): Record format of original file.
4988 * fileread.h (Input_file::Format): New enum type.
4989 (Input_file::Input_file): Initialize data member format_.
4990 (Input_file::format): New method definition.
4991 (Input_file::format_):: New data member.
4992
4a54abbb
DK
49932010-02-24 Doug Kwan <dougkwan@google.com>
4994
4995 * arm.cc (Arm_output_data_got): New class.
4996 (ARM_TCB_SIZE): New constant
4997 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4998 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4999 If user uses a script with a SECTIONS clause, issue only a warning
5000 for a misplaced EXIDX input section. Otherwise, issue an error.
5001 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
5002 garbage collection.
5003 (Target_arm::got_mode_index_entry): Handle static linking.
5004 (Target_arm::Scan::local): Ditto.
5005 (Target_arm::Scan::global): Ditto.
5006 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
5007 all incorrectly implemented relocations.
e1df38aa 5008 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
5009 Arm_output_section::fix_exidx_coverage.
5010 * layout.cc (Layout::section_name_mapping): Remove trailing dots
5011 from ".ARM.exidx." and ".ARM.extab.".
5012
ca419a6f
ILT
50132010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5014
5015 * arm.cc (Target_arm::do_finalize_sections): Create attribute
5016 section if it does not already exist.
5017 * attributes.cc (Attributes_section_data::Attributes_section_data):
5018 Don't crash if size is zero.
5019
135b9c78
ILT
50202010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5021 Ian Lance Taylor <iant@google.com>
5022
5023 * gold.cc (queue_middle_tasks): If no input files were opened,
5024 exit.
5025 * workqueue.h (Task_function::Task_function): Assert that there is
5026 a blocker.
5027
bb0bfe4f
DK
50282010-02-22 Doug Kwan <dougkwan@google.com>
5029
5030 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
5031 * icf.cc (get_section_contents): Cast snprintf arguments to long long
5032 types to avoid warnings due to different uint64_t implementations
5033 on different hosts.
5034
2a2b6d42
DK
50352010-02-21 Doug Kwan <dougkwan@google.com>
5036
5037 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
5038 handling of the maximum backward branch offset.
5039 (Arm_relocate_functions::thumb_branch_common): Ditto.
5040 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
5041 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 5042 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
5043 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
5044 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
5045 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
5046 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
5047 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
5048 thumb_bl_out_of_range thumb_bl_out_of_range.o,
5049 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
5050 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
5051 thumb2_bl_out_of_range.o): New rules.
5052 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
5053 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
5054 thumb2_bl_out_of_range
5055 * testsuite/Makefile.in: Regenerate.
5056 * testsuite/arm_bl_in_range.s: New file.
5057 * testsuite/arm_bl_out_of_range.s: Ditto.
5058 * testsuite/arm_branch_in_range.sh: Ditto.
5059 * testsuite/arm_branch_range.t: Ditto.
5060 * testsuite/thumb2_branch_range.t: Ditto.
5061 * testsuite/thumb_bl_in_range.s: Ditto.
5062 * testsuite/thumb_bl_out_of_range.s: Ditto.
5063 * testsuite/thumb_branch_range.t: Ditto.
5064
b487ad64
ST
50652010-02-20 Sriraman Tallam <tmsriram@google.com>
5066
5067 * gc.h (gc_process_relocs): Change vectors to point to the new list.
5068 Add reloc offset information.
5069 * icf.cc (get_section_contents): Change iterators to point to the new
5070 vectors. Add reloc offset information to the contents.
5071 * icf.h (Icf::Sections_reachable_info): New typedef.
5072 (Icf::Sections_reachable_list): New typedef.
5073 (Icf::Offset_info): New typedef.
5074 (Icf::Reloc_info): New struct typedef.
5075 (Icf::Reloc_info_list): New typedef.
5076 (Icf::symbol_reloc_list): Delete method.
5077 (Icf::addend_reloc_list): Delete method.
5078 (Icf::section_reloc_list): Delete method.
5079 (Icf::reloc_info_list): New method.
5080 (Icf::reloc_info_list_): New member.
5081
f96accdf
DK
50822010-02-19 Doug Kwan <dougkwan@google.com>
5083
5084 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
5085 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
5086 * arm.cc (Arm_relocation_functions): New forward declaration.
5087 (Target_arm::Target_arm): Initialize new data members
5088 got_mod_index_offset_ and tls_base_symbol_defined_.
5089 (Target_arm::Relocate::relocate_tls): New method.
5090 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
5091 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
5092 New methods.
5093 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
5094 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
5095 (Target_arm::got_mod_index_offset_,
5096 Target_arm::tls_base_symbol_defined_): New data members.
5097 (Target_arm::Scan::local, Target::Scan::global,
5098 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
5099 relocations.
5100
c8761b9a
DK
51012010-02-18 Doug Kwan <dougkwan@google.com>
5102
5103 * arm.cc (Arm_relobj::find_linked_text_section): New method.
5104 (Arm_relobj::make_exidx_input_section): Pass section index of linked
5105 text section as a parameter becuase some broken tools may not set
5106 the link in section header.
5107 (Target_arm::has_got_section): New method.
5108 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
5109 without any mapping symbol as data only. Remove warning.
5110 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
5111 link in its section header, try to discover the link by inspecting the
5112 REL31 relocation at the beginning of the section.
5113 (Target_arm::Scan::check_non_pic): Report name of offending relocation
5114 in error message.
5115 (Target_arm::Scan::global): Treat any reference to the symbol
5116 _GLOBAL_OFFSET_TABLE_ as a GOT access.
5117
21bb3914
ST
51182010-02-12 Sriraman Tallam <tmsriram@google.com>
5119
5120 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
5121 (Scan::global_reloc_may_be_function_pointer): New function.
5122 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5123 (Scan::global_reloc_may_be_function_pointer): New function.
5124 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
5125 (Scan::global_reloc_may_be_function_pointer): New function.
5126 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
5127 (Scan::global_reloc_may_be_function_pointer): New function.
5128 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
5129 (Scan::global_reloc_may_be_function_pointer): New function.
5130 (Scan::possible_function_pointer_reloc): New function.
5131 (Target_x86_64::can_check_for_function_pointers): New function.
5132 * gc.h (gc_process_relocs): Scan relocation types to determine if
5133 function pointers were taken for targets that support it.
5134 * icf.cc (Icf::find_identical_sections): Include functions for
5135 folding in safe ICF whose pointer is not taken.
5136 * icf.h (Secn_fptr_taken_set): New typedef.
5137 (fptr_section_id_): New member.
5138 (section_has_function_pointers): New function.
5139 (set_section_has_function_pointers): New function.
5140 (check_section_for_function_pointers): New function.
5141 * options.h: Fix comment for safe ICF option.
5142 * target.h (can_check_for_function_pointers): New function.
5143 * testsuite/Makefile.am: Add icf_safe_so_test test case.
5144 Modify icf_safe_test for X86-64.
5145 * testsuite/Makefile.in: Regenerate.
5146 * testsuite/icf_safe_so_test.cc: New file.
5147 * testsuite/icf_safe_so_test.sh: New file.
5148 * testsuite/icf_safe_test.cc (kept_func_3): New function.
5149 (main): Change to take pointer to function kept_func_3.
5150 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
5151 folding is done correctly for X86-64.
5152
0da6fa6c
DM
51532010-02-12 David S. Miller <davem@davemloft.net>
5154
5155 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
5156 is_symbolless parameter.
5157 (Output_reloc<SHT_REL>::is_symbolless): New.
5158 (Output_reloc<SHT_REL>::is_symbolless_): New.
5159 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
5160 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
5161 (Output_reloc<SHT_RELA>::is_symbolless): New.
5162 (Output_data_reloc::add_global): Handle is_symbolless.
5163 (Output_data_reloc::add_global_relative): Likewise.
5164 (Output_data_reloc::add_local): Likewise.
5165 (Output_data_reloc::add_local_relative): Likewise.
5166 (Output_data_reloc::add_symbolless_global_addend): New.
5167 (Output_data_reloc::add_symbolless_local_addend): New.
5168 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
5169 is_symbolless.
5170 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
5171 instead of ->is_relative_
5172 (Output_reloc::write): Likewise.
5173 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
5174 (Output_reloc::write_rel): Simplify.
5175
5176 * sparc.cc (Target_sparc::Scan::local): Use
5177 ->add_symbolless_local_addend as needed.
5178 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
5179 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
5180 based upon relocation offset.
5181
e4782e83
DK
51822010-02-11 Doug Kwan <dougkwan@google.com>
5183
5184 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
5185 (Target_arm::Scan::global): Ditto. Also remove a comment before the
5186 beginning of function.
5187 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
5188 and MOVT_ABS relocations. Those are non issued in scanning. Fix
5189 parameter is_32bit in calls to should_apply_static_reloc.
5190 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
5191 (check_DATA): Add arm_abs_global.stdout.
5192 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
5193 arm_abs_global.stdout): New rules.
5194 (MOSTLLYCLEANFILES): Add arm_abs_global
5195 * Makefile.in: Regenerate.
5196 * testsuite/arm_abs_global.s: New file.
5197 * testsuite/arm_abs_global.sh: Ditto.
5198 * testsuite/arm_abs_lib.s: Ditto.
5199
93ceb764
ILT
52002010-02-11 Ian Lance Taylor <iant@google.com>
5201
5202 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
5203 Read_relocs task.
5204 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
5205 Allocate_commons_task first.
5206 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
5207 task, rather than symtab_lock_.
5208 (Gc_process_relocs::~Gc_process_relocs): New function.
5209 (Gc_process_relocs::is_runnable): Check this_blocker_.
5210 (Gc_process_relocs::locks): Use next_blocker_ rather than
5211 blocker_.
5212 (Scan_relocs::~Scan_relocs): New function.
5213 (Scan_relocs::is_runnable): Check this_blocker_ rather than
5214 symtab_lock_.
5215 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
5216 next_blocker_.
5217 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
5218 fields. Add this_blocker_ and next_blocker_ fields. Adjust
5219 constructor accordingly.
5220 (class Gc_process_relocs): Likewise.
5221 (class Scan_relocs): Likewise.
5222 * common.h (class Allocate_commons_task): Remove symtab_lock_
5223 field, and corresponding constructor parameter.
5224 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
5225 symtab_lock_.
5226 (Allocate_commons_task::locks): Likewise.
5227
114dfbe1
ILT
52282010-02-11 Ian Lance Taylor <iant@google.com>
5229
5230 * gold-threads.h (class Once): Define.
5231 (class Initialize_lock): Rewrite as child of Once.
5232 * gold-threads.cc (class Once_initialize): Define.
5233 (once_pointer_control): New static variable.
5234 (once_pointer, once_arg): New static variables.
5235 (c_run_once): New static function.
5236 (Once::Once, Once::run_once, Once::internal_run): New functions.
5237 (class Initialize_lock_once): Remove.
5238 (initialize_lock_control): Remove.
5239 (initialize_lock_pointer): Remove.
5240 (initialize_lock_once): Remove.
5241 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
5242 (Initialize_lock::initialize): Rewrite.
5243 (Initialize_lock::do_run_once): New function.
5244 * archive.cc (Archive::interpret_header): Only clear name if it is
5245 not already empty.
5246 * fileread.cc: Include "gold-threads.h"
5247 (file_counts_lock): New static variable.
5248 (file_counts_initialize_lock): Likewise.
5249 (File_read::release): Only increment counts when using --stats.
5250 Use a lock around the increment.
5251 * parameters.cc (class Set_parameters_target_once): Define.
5252 (set_parameters_target_once): New static variable.
5253 (Parameters::Parameters): Move here from parameters.h.
5254 (Parameters::set_target): Rewrite.
5255 (Parameters::set_target_once): New function.
5256 (Parameters::clear_target): Move here and rewrite.
5257 * parameters.h (class Parameters): Update declarations. Add
5258 set_parameters_target_once_ field.
5259 (Parameters::Parameters): Move to parameters.cc.
5260 (Parameters::clear_target): Likewise.
5261 * readsyms.cc (Read_symbols::do_group): Create a Start_group
5262 task.
5263 (Start_group::~Start_group): New function.
5264 (Start_group::is_runnable): New function.
5265 (Start_group::locks, Start_group::run): New functions.
5266 (Finish_group::run): Change saw_undefined to size_t.
5267 * readsyms.h (class Start_group): Define.
5268 (class Finish_group): Change saw_undefined_ field to size_t.
5269 (Finish_group::Finish_group): Remove saw_undefined and
5270 this_blocker parameters. Change all callers.
5271 (Finish_group::set_saw_undefined): New function.
5272 (Finish_group::set_blocker): New function.
5273 * symtab.h (class Symbol_table): Change saw_undefined to return
5274 size_t. Change saw_undefined_ field to size_t.
5275 * target-select.cc (Set_target_once::do_run_once): New function.
5276 (Target_selector::Target_selector): Initialize set_target_once_
5277 field. Don't initialize lock_ and initialize_lock_ fields.
5278 (Target_selector::instantiate_target): Rewrite.
5279 (Target_selector::set_target): New function.
5280 * target-select.h (class Set_target_once): Define.
5281 (class Target_selector): Update declarations. Make
5282 Set_target_once a friend. Remove lock_ and initialize_lock_
5283 fields. Add set_target_once_ field.
5284
fa17a3f4
ILT
52852010-02-10 Ian Lance Taylor <iant@google.com>
5286
5287 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
5288 queueing any tasks.
5289 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
5290 (queue_middle_tasks): Add all blockers before queueing any tasks.
5291 (queue_final_tasks): Likewise.
5292 * token.h (Task_token::add_blockers): New function.
5293 * object.h (Input_objects::number_of_relobjs): New function.
5294
c7177d31
ILT
52952010-02-10 Ian Lance Taylor <iant@google.com>
5296
5de0e392
ILT
5297 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
5298 shared, not if not position independent.
5299 * x86_64.cc (Relocate::relocate_tls): Likewise.
5300 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
5301 (tls_pie_pic_test): New target.
5302 * testsuite/Makefile.in: Rebuild.
5303
c7177d31
ILT
5304 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
5305 (tls_test_main_pie.o, tls_test_pie.o): New targets.
5306 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
5307 * testsuite/Makefile.in: Rebuild.
5308
684b268a
DM
53092010-02-09 David S. Miller <davem@davemloft.net>
5310
5311 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
5312 R_SPARC_RELATIVE using ->add_local_relative().
5313 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
5314
612a8d3d
DM
5315 * output.h (Output_data_dynamic::add_section_size): New method
5316 that takes two Output_data objects.
5317 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
5318 entry param. Handle it in initializers.
5319 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
5320 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
5321 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
5322 arg.
5323 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
5324 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
5325 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
5326 for dynrel_includes_plt.
5327 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5328 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5329 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
5330 before .rela.plt
5331 (Target_sparc::do_finalize_sections): Update to pass true for
5332 dynrel_includes_plt.
5333 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
5334 output before .rela.plt
5335 (Target_powerpc::do_finalize_sections): Update to pass true for
5336 dynrel_includes_plt when 32-bit.
5337
cb1be87e
DK
53382010-02-08 Doug Kwan <dougkwan@google.com>
5339
5340 * arm.cc (Arm_relobj::simple_input_section_output_address): New
5341 method.
5342 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
5343 Arm_relobj::scan_section_for_cortex_a8_stubs,
5344 Arm_relobj::do_relocation_section): Instead of calling
5345 Output_section::output_address, use faster
5346 Arm_relobj::simple_input_section_output_address.
5347
705b5121
DM
53482010-02-08 David S. Miller <davem@davemloft.net>
5349
5350 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
5351 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
5352 relocation helper function.
5353
024c4466
DM
5354 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
5355 just like R_SPARC_GOT{10,13,22}.
5356 (Target_sparc::Scan::local): Likewise.
5357 (Target_sparc::Relocate:relocate): Likewise.
5358
9109c078
ILT
53592010-02-06 Ian Lance Taylor <iant@google.com>
5360
5361 * configure.ac: Rewrite targetobjs duplicate removal code to use
5362 only shell constructs.
5363 * configure: Rebuild.
5364
cf846138
DK
53652010-02-05 Doug Kwan <dougkwan@google.com>
5366
5367 PR 11247
5368 * arm.cc (Arm_relobj::section_is_scannable): New method.
5369 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
5370 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
5371
6cfaf60b
DK
53722010-02-04 Doug Kwan <dougkwan@google.com>
5373
5374 PR 11247
5375 * arm-reloc-property.cc (cstdio): Include.
5376 * configure.ac (targetobjs): Remove duplicates.
5377 * configure: Regenerate.
5378 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
5379 big and little endian version for a given address size.
5380
5c57f1be
DK
53812010-02-03 Doug Kwan <dougkwan@google.com>
5382
5383 * arm-reloc-property.cc
5384 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5385 definition.
5386 * arm-reloc-property.h
5387 (Arm_reloc_property_table::get_implemented_static_reloc_property):
5388 New method definition.
5389 (Arm_reloc_property_table::reloc_name_in_error_message): New method
5390 declaration.
5391 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
5392 overflow to N.
5393 (GOT_PREL): Change implemented to Y.
5394 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
5395 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
5396 (Arm_relocate_functions::movw_abs_nc): Remove method.
5397 (Arm_relocate_functions::movt_abs): Ditto.
5398 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
5399 (Arm_relocate_functions::thm_movt_abs): Ditto.
5400 (Arm_relocate_functions::movw_rel_nc): Ditto.
5401 (Arm_relocate_functions::movw_rel): Ditto.
5402 (Arm_relocate_functions::movt_rel): Ditto.
5403 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
5404 (Arm_relocate_functions:thm_movw_rel): Ditto.
5405 (Arm_relocate_functions:thm_movt_rel): Ditto.
5406 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
5407 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
5408 New method definitions.
5409 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
5410 (Arm_relocation_functions::arm_grp_ldr): Ditto.
5411 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
5412 (Arm_relocation_functions::arm_grp_ldc): Ditto.
5413 (Target_arm::Relocate::relocate): Check for non-static or
5414 unimplemented relocation code and exit early. Change calls to
5415 Target_arm::reloc_uses_thumb_bit and
5416 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
5417 instead. Refactor code to handle similar relocations to increase
5418 code sharing. Remove check for unsupported relocation code in switch
5419 statement.
5420 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
5421 relocation property table to find out size. Change error message to
5422 print out the name of a relocation code instead of the numeric value.
5423 (Target_arm::scan_reloc_for_stub): Use relocation property table
5424 instead of calling Target_arm::reloc_uses_thumb_bit().
5425
218c5831
DK
54262010-02-02 Doug Kwan <dougkwan@google.com>
5427
5428 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
5429 types of relaxed input section.
5430
0d31c79d
DK
54312010-02-02 Doug Kwan <dougkwan@google.com>
5432
5433 * Makefile.am (HFILES): Add arm-reloc-property.h.
5434 (DEFFILES): New.
5435 (TARGETSOURCES): Add arm-reloc-property.cc
5436 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
5437 (libgold_a_SOURCES): $(DEFFILES)
5438 * Makefile.in: Regenerate.
5439 * arm-reloc-property.cc: New file.
5440 * arm-reloc-property.h: New file.
5441 * arm-reloc.def: New file.
5442 * arm.cc: Update comments.
5443 (arm-reloc-property.h): New included header.
5444 (arm_reloc_property_table): New global variable.
5445 (Target_arm::do_select_as_default_target): New method definition.
5446 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
5447 arm-reloc-property to targ_extra_obj.
5448 * parameters.cc (set_parameters_target): Call
5449 Target::select_as_default_target().
5450 * target.h (Target::select_as_default_target): New method definition.
5451 (Target::do_select_as_default_target): Same.
5452
546c7457
DK
54532010-02-01 Doug Kwan <dougkwan@google.com>
5454
5455 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
5456 first_output_text_section_.
5457 (Arm_exidx_fixup::first_output_text_section): New method definition.
5458 (Arm_exidx_fixup::first_output_text_section_): New data member.
5459 (Arm_exidx_fixup::process_exidx_section): Record the first text
5460 output section seen.
5461 (Arm_output_section::fix_exidx_coverage): Set correct linked section
5462 and entsize in output section header.
5463
11b861d5
DK
54642010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5465
5466 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
5467 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
5468 (Arm_relocate_functions::thm_alu11): New Method.
5469 (Arm_relocate_functions::thm_pc8): New Method.
5470 (Arm_relocate_functions::thm_pc12): New Method.
5471 (Target_arm::Scan::local): Handle the relocations.
5472 (Target_arm::Scan::global): Likewise.
5473 (Target_arm::Relocate::relocate): Likewise.
5474 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5475
c9a2c125
DK
54762010-01-29 Doug Kwan <dougkwan@google.com>
5477
5478 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
5479 of relocation types as ld.
5480
1521477a
DK
54812010-01-29 Doug Kwan <dougkwan@google.com>
5482
5483 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
5484 to public.
5485 (Arm_relocate_functions::thumb_branch_common): Ditto.
5486 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
5487 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
5488 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
5489 Arm_relocate_functions::jump24): Remove.
5490 (Target_arm::Relocate::relocate): Adjust code to call
5491 Arm_relocation_functions::arm_branch_common and
5492 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 5493 wrappers. Merge switch-cases together to reduce source code size.
1521477a 5494
e7eca48c
DK
54952010-01-29 Doug Kwan <dougkwan@google.com>
5496
5497 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
5498 output_local_symbol_count_needs_update_.
5499 (Arm_relobj::output_local_symbol_count_needs_update,
5500 Arm_relobj::set_output_local_symbol_count_needs_update,
5501 Arm_relobj::update_output_local_symbol_count): New methods.
5502 (Arm_relobj::output_local_symbol_count_needs_update_): New data
5503 member.
5504 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
5505 of pointed function as in a R_ARM_PREL31 relocation.
5506 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
5507 for output local symbol count updating.
5508 (Target_arm::do_relax): Update output local symbol counts in objects
5509 if necessary.
5510 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
5511
02961d7e
ILT
55122010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5513
5514 * arm.cc: Added support for the ARM relocations:
5515 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
5516 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
5517 (Arm_relocate_functions::movw_rel_nc): Renamed (was
5518 movw_prel_nc).
5519 (Arm_relocate_functions::movw_rel): New method.
5520 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
5521 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
5522 thm_movw_prel_nc).
5523 (Arm_relocate_functions::thm_movw_rel): New method.
5524 (Arm_relocate_functions::thm_movt_rel): Renamed (was
5525 thm_movt_prel).
5526 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
5527 relocations.
5528 (Target_arm::Scan::global): Likewise.
5529 (Target_arm::Relocate::relocate): Likewise.
5530 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5531 Likewise.
5532
b10d2873
ILT
55332010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5534
5535 * arm.cc: Added support for ARM group relocations.
5536 (Target_arm::reloc_needs_sym_origin): New method.
5537 (Arm_relocate_functions::calc_grp_kn): New method.
5538 (Arm_relocate_functions::calc_grp_residual): New method.
5539 (Arm_relocate_functions::calc_grp_gn): New method.
5540 (Arm_relocate_functions::arm_grp_alu): New Method.
5541 (Arm_relocate_functions::arm_grp_ldr): New Method.
5542 (Arm_relocate_functions::arm_grp_ldrs): New Method.
5543 (Arm_relocate_functions::arm_grp_ldc): New Method.
5544 (Target_arm::Scan::local): Handle the ARM group relocations.
5545 (Target_arm::Scan::global): Likewise.
5546 (Target_arm::Relocate::relocate): Likewise.
5547 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5548 Likewise.
5549
2b328d4e
DK
55502010-01-26 Doug Kwan <dougkwan@google.com>
5551
5552 * arm.cc (set): Include.
5553 (class Arm_exidx_fixup): Change type of last_input_section_ to const
5554 pointer type.
5555 (Arm_output_section::Text_section_list): New type.
5556 (Arm_output_section::append_text_sections_to_list): New method.
5557 (Arm_output_section::fix_exidx_coverage): Ditto.
5558 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
5559 (Arm_relobj::convert_input_section_to_relaxed_section): Use
5560 Relobj::set_section_offset() instead of
5561 Sized_relobj::invalidate_section_offset().
5562 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
5563 parameter for section headers. Ignore relocation sections for
5564 unallocated sections and EXIDX sections.
5565 (Target_arm::fix_exidx_coverage): New method.
5566 (Target_arm::output_section_address_less_than): New type.
5567 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
5568 linked text section instead of the EXIDX section.
5569 (Arm_output_section::create_stub_group): Add an assertion to check
5570 that this is not an EXIDX output section.
5571 (Arm_output_section::append_text_sections_to_list): New method.
5572 (Arm_output_section::fix_exidx_coverage): Ditto.
5573 (Arm_relobj::scan_sections_for_stubs): Adjust call to
5574 Arm_relobj::section_needs_reloc_stub_scanning.
5575 (Target_arm::do_relax): Fix EXIDX output section coverage in the
5576 first pass.
5577 (Target_arm::fix_exidx_coverage): New method.
5578 * object.h (Relobj::set_output_section): New method.
5579 (Sized_relobj::invalidate_section_offset): Remove method.
5580 (Sized_relobj::do_invalidate_section_offset): Remove method.
5581 (Sized_relobj::do_set_section_offset): Handle offset value -1.
5582
c7f3c371
DK
55832010-01-25 Doug Kwan <dougkwan@google.com>
5584
5585 * arm.cc (Arm_exidx_merged_section::do_output_offset):
5586 Fix warning due to signed and unsigned comparison on a 32-bit host.
5587
8923b24c
DK
55882010-01-22 Doug Kwan <dougkwan@google.com>
5589
5590 * arm.cc (Target_arm::do_relax): Record an output section for section
5591 offset adjustment it contains any stub table that has changed.
5592 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
5593 offsets in an output section if necessary.
5594 * output.cc (Output_section::Output_section): Initialize
5595 section_offsets_need_adjustments_.
5596 (Output_section::add_input_section_for_script): Renamed to
5597 Output_section::add_simple_input_section.
5598 (Output_section::save_states): Add a comment.
5599 (Output_section::discard_states): New method defintion.
5600 (Output_section::adjust_section_offsets): Same.
5601 * output.h (Output_section::add_input_section_for_script): Renamed to
5602 Output_section::add_simple_input_section.
5603 (Output_section::discard_states): New method declaration.
5604 (Output_section::adjust_section_offsets): Same.
5605 (Output_section::section_offsets_need_adjustment,
5606 Output_section::set_section_offsets_need_adjustment): New method
5607 definitions.
5608 (Output_section::section_offsets_need_adjustment_): New data member.
5609 * script-sections.cc
5610 (Output_section_element_input::set_section_address): Adjust code for
5611 renaming of Output_section::add_input_section_for_script.
5612 (Orphan_output_section::set_section_address): Same.
5613
9b2fd367
DK
56142010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5615
5616 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
5617 Fix_v4bx enum values .
5618 * gold/options.h (General_options): New option definitions.
5619 (General_options::fix_v4bx): New method.
5620 (General_options::Fix_v4bx): New enum.
5621 * gold/options.cc (General_options::parse_fix_v4bx): New method.
5622 (General_options::parse_fix_v4bx_interworking): New method.
5623
80d0d023
DK
56242010-01-22 Doug Kwan <dougkwan@google.com>
5625
5626 * arm.cc (Arm_exidx_fixup): New class.
5627
af2cdeae
DK
56282010-01-21 Doug Kwan <dougkwan@google.com>
5629
5630 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
5631 classes.
5632 (Arm_exidx_section_offset_map): New type.
5633
993d07c1
DK
56342010-01-21 Doug Kwan <dougkwan@google.com>
5635
5636 * arm.cc (Arm_exidx_input_section): New class.
5637 (Arm_relobj::exidx_input_section_by_link,
5638 Arm_relobj::exidx_input_section_by_shndx,
5639 Arm_relobj::make_exidx_input_section): New methods.
5640 (read_arm_attributes_section): Remove.
5641 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
5642 information about them.
5643 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
5644 to here.
5645
5ac169d4
DK
56462010-01-20 Doug Kwan <dougkwan@google.com>
5647
5648 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
5649 Input_section_specifier to Section_id.
5650 (Target_arm::new_arm_input_section: Adjust code for change of key
5651 type.
5652 (Target_arm::find_arm_input_section): Ditto.
5653 * gc.h (object.h): Include for Section_id nand Section_id_hash.
5654 (Section_id): Remove.
5655 (Garbage_collection::Section_id_hash): Remove.
5656 * icf.h (object.h): Include for Section_id nand Section_id_hash.
5657 (Section_id): Remove.
5658 (Icf::Section_id_hash): Remove.
5659 * object.h (Section_id, Const_section_id, Section_id_hash,
5660 Const_section_id_hash): New type definitions.
5661 * output.cc (Output_section::add_relaxed_input_section): Change to
5662 use Const_section_id instead of Input_section_specifier as key type.
5663 (Output_section::add_merge_input_section): Ditto.
5664 (Output_section::build_relaxation_map): Change to use Section_id
5665 instead of Input_section_specifier as key type.
5666 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5667 Ditto.
5668 (Output_section::convert_input_sections_to_relaxed_sections): Change
5669 to use Const_section_id instead of Input_section_specifier as key type.
5670 (Output_section::find_merge_section): Ditto.
5671 (Output_section::find_relaxed_input_section): Ditto.
5672 * output.h (Input_section_specifier): Remove class.
5673 (Output_section::Output_section_data_by_input_section_map): Change
5674 key type to Const_section_id.
5675 (Output_section::Output_relaxed_input_section_by_input_section_map):
5676 Ditto.
5677 (Output_section::Relaxation_map): Change key type to Section_id.
5678
a2162063
ILT
56792010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5680
5681 * gold/arm.cc: Added support for R_ARM_V4BX relocation
5682 (class Arm_v4bx_stub): New class.
5683 (DEF_STUBS): Updated definition to support v4_veneer_bx.
5684 (Stub_factory::make_arm_v4bx_stub): New method.
5685 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
5686 (Stub_table::empty): Handle v4bx stubs.
5687 (Stub_table::add_arm_v4bx_stub): New method.
5688 (Stub_table::find_arm_v4bx_stub): New method.
5689 (Arm_relocate_functions::v4bx): New method.
5690 (Target_arm::fix_v4bx): New method.
5691 (Target_arm::Target_arm): Handle R_ARM_V4BX.
5692 (Stub_table::relocate_stubs): Likewise.
5693 (Stub_table::do_write): Likewise.
5694 (Stub_table::update_data_size_and_addralign): Likewise.
5695 (Stub_table::finalize_stubs): Likewise.
5696 (Target_arm::Scan::local): Likewise.
5697 (Target_arm::Scan::global): Likewise.
5698 (Target_arm::do_finalize_sections): Likewise.
5699 (Target_arm::Relocate::relocate): Likewise.
5700 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5701 Likewise.
5702 (Target_arm::scan_reloc_for_stub): Likewise.
5703 (Target_arm::scan_reloc_section_for_stubs): Likewise.
5704
5696ab0b
ILT
57052010-01-19 Ian Lance Taylor <iant@google.com>
5706
5707 * output.cc (Output_section_headers::do_sized_write): Write large
5708 segment count to sh_info field.
5709 (Output_file_header::do_sized_write): For large segment count,
5710 write PN_XNUM to e_phnum field.
5711
800d0f56
ILT
57122010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5713
5714 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
5715 (Arm_relocate_functions::thm_jump8): New function.
5716 (Arm_relocate_functions::thm_jump11): New function.
5717 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
5718 R_ARM_THM_JUMP11.
5719 (Target_arm::Scan::global): Likewise.
5720 (Target_arm::Relocate::relocate): Likewise.
5721 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5722 Likewise.
5723
41263c05
DK
57242010-01-14 Doug Kwan <dougkwan@google.com>
5725
5726 * arm.cc (map, utility): Include headers.
5727 (Target_arm::apply_cortex_a8_workaround): New method.
5728 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
5729 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
5730 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
5731 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
5732 the --[no-]fix-cortex-a8 command line options.
5733 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
5734 (Target_arm::relocate_stub): Use addend in instruction template.
5735 * options.h (DEFINE_bool): Set the user-set flag.
5736 (General_options): Add --[no-]-fix-cortex options.
5737 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 5738 : Update fast look-up map after conversion.
41263c05 5739
459e9b03
ST
57402010-01-14 Sriraman Tallam <tmsriram@google.com>
5741
5742 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
5743 in the first pass of do_layout.
5744
b521dfe4
DK
57452010-01-13 Doug Kwan <dougkwan@google.com>
5746
5747 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5748 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
5749 apparent compiler problem of not folding static constant integral
5750 data members of elfcpp::Elf_sizes<32>.
5751
44272192
DK
57522010-01-13 Doug Kwan <dougkwan@google.com>
5753
5754 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
5755 Arm_relobj::section_needs_cortex_a8_stub_scanning,
5756 Arm_relobj::scan_section_for_cortex_a8_erratum,
5757 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
5758 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
5759 sections to scan for relocation stubs into a new method
5760 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
5761 relocation and Cortex-A8 stub scanning.
5762 (Target_arm::do_relax): Force stubs to be after stubbed sections
5763 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 5764 the beginning of a new relaxation pass. Update a comment.
44272192
DK
5765 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
5766
44b71ece
ILT
57672010-01-12 Ian Lance Taylor <iant@google.com>
5768
5769 * target-reloc.h (visibility_error): New inline function.
5770 (relocate_section): Call visibility_error.
5771 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
5772 (MOSTLYCLEANFILES): Likewise.
5773 (protected_4_pic.o, protected_3.err): New targets.
5774 * testsuite/protected_4.cc: New file.
5775
a120bc7f
DK
57762010-01-12 Doug Kwan <dougkwan@google.com>
5777
5778 * arm.cc (Cortex_a8_reloc): New class.
5779 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
5780 and cortex_a8_relocs_info_.
5781 (Target_arm::fix_cortex_a8): New method definition.
5782 (Target_arm::Cortex_a8_relocs_info): New type.
5783 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
5784 New data member declarations.
5785 (Target_arm::scan_reloc_for_stub): Record information about
5786 relocations for THUMB branches that might be exempted from the
5787 Cortex-A8 workaround.
5788 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5789 at the beginning of a relaxation pass.
5790
20138696
DK
57912010-01-12 Doug Kwan <dougkwan@google.com>
5792
5793 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5794 (Arm_relobj::Mapping_symbol_position,
5795 Arm_reloj::Mapping_symbol_position_less,
5796 Arm_relobj::Mapping_symbols_info): New types.
5797 (Target_arm::is_mapping_symbol_name): New method definition.
5798 (Arm_relobj::do_count_local_symbols): Save information about mapping
5799 symbols.
5800
089d69dc
DK
58012010-01-11 Doug Kwan <dougkwan@google.com>
5802
5803 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5804 Arm_relocate_functions::thumb32_branch_upper,
5805 Arm_relocate_functions::thumb32_branch_lower,
5806 Arm_relocate_functions::thumb32_cond_branch_offset,
5807 Arm_relocate_functions::thumb32_cond_branch_upper,
5808 Arm_relocate_functions::thumb32_cond_branch_lower,
5809 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5810 branch offset encoding.
5811 (Arm_relocate_functions::thumb_branch_common): Use new branch
5812 offset encoding methods to avoid code duplication.
5813 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5814 (Stub_addend_reader::operator()): Use new branch encoding method
5815 to avoid code duplication.
5816
99e5bff2
DK
58172010-01-11 Doug Kwan <dougkwan@google.com>
5818
5819 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5820 (Target_arm::do_finalize_sections): Define special EXIDX section
5821 symbols only if referenced.
5822 * gc.h (Garbage_collection::add_reference): New method.
5823 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5824 code duplication.
5825
98e090bd
ILT
58262010-01-11 Ian Lance Taylor <iant@google.com>
5827
d0a91bd8
ILT
5828 * script.cc (Version_script_info::build_expression_list_lookup):
5829 Change complaing about duplicate wildcard match from error to
5830 warning.
5831
98e090bd
ILT
5832 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5833 of 2009-12-30.
5834 (Version_script_info::Version_script_info): Initialize globs_,
5835 default_version_, default_is_global_, and exact_. Don't
5836 initialize globals_ or locals_.
5837 (Version_script_info::build_lookup_tables): Build local symbols
5838 first.
5839 (Version_script_info::unquote): New function.
5840 (Version_script_info::add_exact_match): New function.
5841 (Version_script_info::build_expression_list_lookup): Remove lookup
5842 parameter. Add is_global parameter. Change all callers. Handle
5843 wildcard pattern specially. Unquote pattern. Call
5844 add_exact_match.
5845 (Version_script_info::get_name_to_match): New function.
5846 (Version_script_info::get_symbol_version): New function.
5847 (Version_script_info::get_symbol_version_helper): Remove.
5848 (Version_script_info::check_unmatched_names): Call unquote.
5849 * script.h (class Version_script_info): Change get_symbol_version
5850 to be non-inline and add is_global parameter; change all callers.
5851 Rewrite symbol_is_local. Update declarations. Define struct
5852 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5853 Remove globals_ and locals_ members. Add exact_, globs_,
5854 default_version_, is_global_.
5855 (Version_script_info::Glob): Remove pattern, add expression and
5856 is_global. Update constructor. Change all callers.
5857 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5858 default version.
5859 (Versions::symbol_section_contents): If a symbol is undefined, or
5860 defined in a dynamic object, set the version index to
5861 VER_NDX_LOCAL.
5862 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5863 symbol_is_local.
5864 (Symbol_table::add_from_pluginobj): Likewise.
5865 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5866
d56962d3
DK
58672010-01-11 Doug Kwan <dougkwan@google.com>
5868
5869 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5870 (incremental_dump_LDADD): Add linking option for libintl.
5871 * Makefile.in: Regenerate.
5872
94e6ee91
L
58732010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5874
5875 PR gold/11144
5876 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5877 instead of -Ds.
5878 * testsuite/Makefile.in: Regenerated.
5879
e96c574b
DK
58802010-01-10 Doug Kwan <dougkwan@google.com>
5881
5882 * options.h (DEFINE_var): Use parentheses around argument varname__
5883 in macro body to avoid any unintended subsequent substitutions.
5884
7198066b
ILT
58852010-01-10 Ian Lance Taylor <iant@google.com>
5886
ba4d53bf
ILT
5887 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5888 candidates before doing symbol resolution.
5889
7198066b
ILT
5890 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5891 ODR candidates if only one is weak.
5892
a2beed37
ILT
58932010-01-08 Ian Lance Taylor <iant@google.com>
5894
5895 * script.cc (Version_script_info::build_expression_list_lookup):
5896 Don't warn about ambiguous version, just record the ambiguity.
5897 (Version_script_info::get_symbol_version_helper): Give error if
5898 version is ambiguous.
5899
2fb7225c
DK
59002010-01-08 Doug Kwan <dougkwan@google.com>
5901
5902 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5903 prev_data_size_ and prev_addralign_. Remove initializer for
5904 deleted data member has_been_changed_.
5905 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5906 to determine if the table is empty.
5907 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5908 Remove.
5909 (Stub_table::add_reloc_stub): Define method in class definition
5910 instead of just declaring it there.
5911 (Stub_table::add_cortex_a8_stub): New method definition.
5912 (Stub_table::update_data_size_and_addralign): Ditto.
5913 (Stub_table::finalize_stubs): Ditto.
5914 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5915 (Stub_table::do_addralign_): Return address alignment in the
5916 (Stub_table::do_reset_address_and_file_offset): Define method in
5917 class definition instead of declaring it there. Set current data
5918 size to be the data size of the previous pass.
5919 (Stub_table::set_final_data_size): Use current data size as the
5920 final data size.
5921 (Stub_table::relocate_stub): Change parameter type of stub from
5922 Reloc_stub pointer to Stub pointer.
5923 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5924 (Stub_table::Cortex_a8_stub_list): New typedef.
5925 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5926 Stub_table::prev_addralign_): New data member.
5927 (Arm_relobj::Arm_relobj): Initialize data member
5928 section_has_cortex_a8_workaround_.
5929 (Arm_relobj::section_has_cortex_a8_workaround,
5930 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5931 definitions.
5932 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5933 declarations.
5934 (Target_arm::relocate_stub): Change parameter type of stub from
5935 Reloc_stub pointer to Stub pointer.
5936 (Insn_template::size, Insn_template::alignment): Handle
5937 THUMB16_SPECIAL_TYPE.
5938 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5939 Stub_table::update_data_size_and_addralign,
5940 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5941 definitions.
5942 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5943 (Stub_table::do_write): Ditto.
5944 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5945
880cd20d
ILT
59462010-01-08 Ian Lance Taylor <iant@google.com>
5947
5948 PR 11108
5949 * symtab.h (class Symbol): Remove fields is_target_special_ and
5950 has_plt_offset_. Add field is_defined_in_discarded_section_.
5951 (Symbol::is_defined_in_discarded_section): New function.
5952 (Symbol::set_is_defined_in_discarded_section): New function.
5953 (Symbol::has_plt_offset): Rewrite.
5954 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5955 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5956 Don't initialize is_target_special_ or has_plt_offset_.
5957 Initialize is_defined_in_discarded_section_.
5958 (Symbol_table::add_from_relobj): If appropriate, set
5959 is_defined_in_discarded_section.
5960 * resolve.cc (Symbol::override_base_with_special): Don't test
5961 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5962 * target-reloc.h (relocate_section): Do special handling for
5963 symbols defined in discarded sections for global symbols as well
5964 as local symbols.
5965
2703e3eb
ILT
59662010-01-08 Ian Lance Taylor <iant@google.com>
5967
5968 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5969 the SHT_SYMTAB case.
5970
339d40a3
ILT
59712010-01-08 Ian Lance Taylor <iant@google.com>
5972
5973 * object.cc (Sized_relobj::do_layout): Don't get confused if
5974 layout_eh_frame returns NULL.
5975
abecea76
ILT
59762010-01-08 Ian Lance Taylor <iant@google.com>
5977
5978 PR 11084
5979 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5980 dynamic symbol table, use the normal symbol table.
5981 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5982 symbol table.
5983
6b7dd3f3
ILT
59842010-01-08 Ian Lance Taylor <iant@google.com>
5985
5986 PR 11072
5987 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5988 sections.
5989
36c50e63
L
59902010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5991
5992 * version.cc (print_version): Change to "Copyright 2010".
5993
e291e7b9
ILT
59942010-01-08 Ian Lance Taylor <iant@google.com>
5995
5996 PR 10287
5997 PR 11063
5998 * i386.cc (class Target_i386): Change return type of plt_section
5999 to be non-const.
6000 (class Output_data_plt_i386): Add tls_desc_rel_ field.
6001 (Output_data_plt_i386::Output_data_plt_i386): Initialize
6002 tls_desc_rel_ field.
6003 (Output_data_plt_i386::rel_tls_desc): New function.
6004 (Target_i386::rel_tls_desc_section): New function.
6005 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
6006 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
6007 R_386_TLS_DESC reloc in rel_tls_desc_section.
6008 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
6009 Define struct Tlsdesc_info.
6010 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
6011 (Target_x86_64::do_reloc_symbol_index): New function.
6012 (Target_x86_64::add_tlsdesc_info): New function.
6013 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
6014 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
6015 tlsdesc_rel_ field.
6016 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
6017 all callers.
6018 (Output_data_plt_x86_64::rela_tlsdesc): New function.
6019 (Target_x86_64::rela_tlsdesc_section): New function.
6020 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
6021 handling.
6022 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
6023 (Target_x86_64::do_reloc_addend): New function.
6024 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
6025 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
6026 declarations. Define TARGET_CODE. Add arg field to u1_ union.
6027 (Output_reloc::type): New function.
6028 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
6029 (Output_reloc::is_target_specific): New function.
6030 (Output_reloc::target_arg): New function.
6031 (class Output_reloc) [SHT_RELA]: Add four new constructors for
6032 absolute relocs and target specific relocs.
6033 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
6034 add_target_specific.
6035 (class Output_data_reloc) [SHT_RELA]: Likewise.
6036 * output.cc (Output_reloc::Output_reloc): Add four new versions
6037 for absolute relocs and target specific relocs.
6038 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
6039 (Output_reloc::get_symbol_index): Likewise.
6040 (Output_reloc::local_section_offset): Check that local_sym_index_
6041 is not TARGET_CODE or 0.
6042 (Output_reloc::symbol_value): Likewise.
6043 (Output_reloc::write) [SHT_RELA]: Call target for target specific
6044 reloc.
6045 * target.h (class Target): Add reloc_symbol_index and reloc_addend
6046 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
6047 functions.
6048 * layout.cc (add_target_dynamic_tags): Use output section for
6049 DT_PLTRELSZ and DT_JMPREL.
6050
3a44184e
ILT
60512010-01-07 Ian Lance Taylor <iant@google.com>
6052
6053 PR 11061
6054 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
6055 function.
6056 (class Output_data_reloc_generic): Define.
6057 (class Output_data_reloc_base): Change base class to
6058 Output_data_reloc_generic. Change add() method to call
6059 bump_relative_reloc_count for a relative reloc. Remove
6060 sort_relocs_ field.
6061 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
6062 to sort_relocs().
6063 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
6064 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
6065 appropriate.
6066 * layout.h (class Layout): Update declaration.
6067
ea715a34
ILT
60682010-01-07 Ian Lance Taylor <iant@google.com>
6069
6070 * output.h (class Output_data): Add const version of
6071 output_section and do_output_section.
6072 (class Output_section_data): Add const version of
6073 do_output_section.
6074 (class Output_section): Likewise.
6075 * layout.cc (Layout::add_target_dynamic_tags): New function.
6076 * layout.h (class Layout): Update declarations.
6077 * arm.cc (Target_arm::do_finalize_sections): Use
6078 add_target_dynamic_tags.
6079 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6080 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6081 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6082 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6083
659948a4
ILT
60842010-01-07 Ian Lance Taylor <iant@google.com>
6085
6086 PR 11042
6087 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
6088 object as needed.
6089
9d3b86f6
ILT
60902010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
6091 Ian Lance Taylor <iant@google.com>
6092
6093 PR 11019
6094 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
6095 Xindex::read_symtab_xindex.
6096
bb0d3eb0
DK
60972010-01-07 Doug Kwan <dougkwan@google.com>
6098
6099 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
6100 (Insn_template::thumb16_bcond_insn): New method declaration.
6101 (Insn_template): Fix spelling.
6102 (Stub::thumb16_special): New method declaration.
6103 (Stub::do_write): Define virtual method which was previously pure
6104 virtual.
6105 (Stub::do_thumb16_special): New method declaration.
6106 (Stub::do_fixed_endian_write): New template member.
6107 (Reloc_stub::do_write): Remove.
6108 (Reloc_stub::do_fixed_endian_write): Remove.
6109 (Cortex_a8_stub): New class definition.
6110 (Stub_factory::make_cortex_a8_stub): New method definition.
6111 (Stub_factory::Stub_factory): Add missing static storage class
6112 qualifier for elf32_arm_stub_a8_veneer_blx.
6113
ffeef7df
ILT
61142010-01-07 Ian Lance Taylor <iant@google.com>
6115
dc3f80fe
ILT
6116 PR 10980
6117 * options.h (class General_options): Add --warn-unresolved-symbols
6118 and --error-unresolved-symbols.
6119 * errors.cc (Errors::undefined_symbol): Implement
6120 --warn-unresolved-symbols.
6121
ffeef7df
ILT
6122 * options.h (class General_options): Add -z text and -z textoff.
6123 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
6124
f1ec9ded
ST
61252010-01-06 Sriraman Tallam <tmsriram@google.com>
6126
6127 * gc.h (Garbage_collection::Cident_section_map): New typedef.
6128 (Garbage_collection::cident_sections): New function.
6129 (Garbage_collection::add_cident_section): New function.
6130 (Garbage_collection::cident_sections_): New member.
6131 (gc_process_relocs): Add references to sections whose names are C
6132 identifiers.
6133 * gold.h (cident_section_start_prefix): New constant.
6134 (cident_section_stop_prefix): New constant.
6135 (is_cident): New function.
6136 * layout.cc (Layout::define_section_symbols): Replace string constants
6137 with the newly defined constants.
6138 * object.cc (Sized_relobj::do_layout): Track sections whose names are
6139 C identifiers.
6140 * testsuite/Makefile.am: Add gc_orphan_section_test.
6141 * testsuite/Makefile.in: Regenerate.
6142 * testsuite/gc_orphan_section_test.cc: New file.
6143 * testsuite/gc_orphan_section_test.sh: New file.
6144
6eda8c29
ILT
61452010-01-06 Ian Lance Taylor <iant@google.com>
6146
b9674e17
ILT
6147 PR 10980
6148 * options.h (class General_options): Add --warn-shared-textrel.
6149 * layout.cc (Layout::finish_dynamic_section): Implement
6150 --warn-shared-textrel.
6151
6eda8c29
ILT
6152 PR 10980
6153 * options.h (class General_options): Add --warn-multiple-gp.
6154
32dcd44e
ILT
61552010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6156
6157 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
6158 $(THREADSLIB) and $(LIBDL).
6159 * Makefile.in: Rebuild.
6160
a192ba05
ILT
61612010-01-06 Ian Lance Taylor <iant@google.com>
6162
6163 PR 10980
6164 * options.cc (General_options::parse_section_start): New function.
6165 (General_options::section_start): New function.
6166 (General_options::General_options): Initialize all members.
6167 * options.h: Include <map>
6168 (class General_options): Add --section-start. Add section_starts_
6169 member.
6170 * layout.cc (Layout::attach_allocated_section_to_segment): If
6171 --section-start was used, set the address of the segment. Remove
6172 local sort_sections.
6173 (Layout::relaxation_loop_body): If the address of the load segment
6174 has been set by --section-start, don't use it.
6175 * output.h (Output_segment::update_flags_for_output_section): New
6176 function.
6177 * output.cc (Output_segment::add_output_section): Call
6178 update_flags_for_output_section.
6179
dde3f402
ILT
61802010-01-05 Ian Lance Taylor <iant@google.com>
6181
62dfdd4d
ILT
6182 PR 10980
6183 * options.h (class General_options): Add --undefined-version.
6184 * script.cc (struct Version_expression): Add was_matched_by_symbol
6185 field.
6186 (Version_script_info::matched_symbol): New function.
6187 (Version_script_info::get_symbol_version_helper): Call
6188 matched_symbol.
6189 (Version_script_info::check_unmatched_names): New function.
6190 * script.h (class Version_script_info): Update declarations.
6191 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
6192
9c4ae156
ILT
6193 * options.h (class General_options): Use DEFINE_bool_alias for
6194 allow_multiple_definition.
6195 * resolve.cc (Symbol_table::should_override): Don't test
6196 allow_multiple_definition.
6197
dde3f402
ILT
6198 PR 10980
6199 * options.h (class General_options): Add --cref.
6200 * main.cc (main): Print cref table if --cref. Don't close mapfile
6201 until after printing cref table.
6202 * cref.cc: Include "symtab.h".
6203 (class Cref_inputs): Define Cref_table_compare and Cref_table.
6204 (Cref_table_compare::operator()): New function.
6205 (Cref_inputs::gather_cref): New function.
6206 (filecol): New static const.
6207 (Cref_inputs::print_cref): New function.
6208 (Cref::print_cref): New function.
6209 * cref.h: Include <cstdio>.
6210 (class Cref): Update declarations.
6211 * mapfile.h (Mapfile::file): New function.
6212 * object.h (class Object): Define Symbols. Declare virtual
6213 do_get_global_symbols.
6214 (Object::get_global_symbols): New function.
6215 * object.cc (Input_objects::add_object): Pass object to cref_ if
6216 --cref.
6217 (Input_objects::archive_start): Likewise.
6218 (Input_objects::archive_stop): Likewise.
6219 (Input_objects::print_cref): New function.
6220 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
6221 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
6222 --cref.
6223 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
6224 function.
6225 * plugin.h (class Sized_pluginobj): Update declarations.
6226
8781f709
ILT
62272010-01-05 Ian Lance Taylor <iant@google.com>
6228
6229 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
6230 to is_default_version. Rename insdef to insdefault.
6231 (Symbol_table::add_from_relobj): Rename def to is_default_version
6232 and local to is_forced_local.
6233 (Symbol_table::add_from_pluginobj): Likewise.
6234 (Symbol_table::add_from_dynobj): Likewise.
6235 (Symbol_table::define_special_symbol): Rename insdef to
6236 insdefault.
6237
fe35d28d
ILT
62382010-01-04 Ian Lance Taylor <iant@google.com>
6239
30bc8c46
ILT
6240 PR 10980
6241 * options.h (class General_options): Add
6242 --allow-multiple-definition and -z muldefs.
6243 * resolve.cc (Symbol_table::should_override): Don't warn about a
6244 multiple symbol definition if --allow-multiple-definition or -z
6245 muldefs.
6246
7eaea549
ILT
6247 PR 10980
6248 * options.h (class General_options): Add --add-needed and
6249 --copy-dt-needed-entries. Tweak --as-needed help entry.
6250 * object.cc (Input_objects::check_dynamic_dependencies): Give an
6251 error if --copy-dt-needed-entries aka --add-needed is used and
6252 would cause a change in behaviour.
6253
fe35d28d
ILT
6254 PR 10980
6255 * options.h (class General_options): Add -G as a short version of
6256 --shared. Add no-op options -assert, -g, and -i.
6257
55a2bb35
ST
62582010-01-04 Sriraman Tallam <tmsriram@google.com>
6259
6260 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
6261 check for .text or .gnu.linkonce.t sections.
6262 * icf.cc (Icf::find_identical_sections): Ditto.
6263 Change the detection for mangled function name within the section
6264 name.
6265 * icf.h (is_section_foldable_candidate): New function.
6266
719328e1
ILT
62672009-12-30 Ian Lance Taylor <iant@google.com>
6268
6269 PR 10980
6270 * options.h (class General_options): Permit two dashes with
6271 --retain-symbols-file.
6272
d7bb5745
ILT
62732009-12-30 Ian Lance Taylor <iant@google.com>
6274
403a15dd
ILT
6275 PR 10979
6276 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
6277 don't put the file header and segment headers in the text
6278 segment.
6279
eda294df
ILT
6280 PR 10979
6281 * common.cc (Sort_commons::operator()): Stabilize sort when both
6282 entries are NULL.
6283 (Symbol_table::do_allocate_commons_list): When allocating common
6284 symbols, skip a symbol which is no longer common.
6285 * symtab.h (Symbol::is_common): Test whether the symbol comes from
6286 an object before checking its type.
6287 * testsuite/common_test_2.c: New file.
6288 * testsuite/common_test_3.c: New file.
6289 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
6290 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
6291 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
6292 (common_test_2_pic.o, common_test_2.so): New targets.
6293 (common_test_3_pic.o, common_test_3.so): New targets.
6294 * testsuite/Makefile.in: Rebuild.
6295
d7bb5745
ILT
6296 PR 10979
6297 * script.cc (read_input_script): If we see a new SECTIONS clause,
6298 and we have added an input section, give an error.
6299 * layout.h (class Layout): Add have_added_input_section function.
6300 Add have_added_input_section_ field.
6301 * layout.cc (Layout::Layout): Initialize
6302 have_added_input_section_.
6303 (Layout::layout): Set have_added_input_section_.
6304 (Layout::layout_eh_frame): Likewise.
6305
fc59c572
ILT
63062009-12-30 Ian Lance Taylor <iant@google.com>
6307
6308 PR 10931
6309 * options.h (class General_options): Add --sort-common option.
6310 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
6311 * common.cc (Sort_common): Add sort_order parameter to
6312 constructor. Add sort_order_ field.
6313 (Sort_commons::operator): Check sort_order_.
6314 (Symbol_table::allocate_commons): Determine the sort order.
6315 (Symbol_table::do_allocate_commons): Add sort_order parameter.
6316 Change all callers.
6317 (Symbol_table::do_allocate_commons_list): Likewise.
6318
1c74fab0
ILT
63192009-12-30 Ian Lance Taylor <iant@google.com>
6320
6321 PR 10916
6322 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
6323 symbols from this object, don't change the visibility of an
6324 undefined symbol.
6325 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
6326
6affe781
ILT
63272009-12-30 Ian Lance Taylor <iant@google.com>
6328
6329 PR 10861
6330 * script.h (class Version_script_info): Define Language enum.
6331 Update declarations. Define Glob, Exact, and Lookup types. Add
6332 new fields globals_, locals_, and is_finalized_.
6333 * script.cc: Various formatting fixes.
6334 (class Parser_closure): Change language_stack_ from a vector of
6335 std::string to one of Version_script_info::Language. Adjust all
6336 uses accordingly.
6337 (class Lazy_demangler): Remove.
6338 (struct Version_expression): Change language from std::string to
6339 Version_script_info::Language.
6340 (Version_script_info::Version_script_info): New function.
6341 (Version_script_info::~Version_script_info): Don't call clear.
6342 (Version_script_info::finalize): New function.
6343 (Version_script_info::build_lookup_tables): New function.
6344 (Version_script_info::build_expression_list_lookup): New
6345 function.
6346 (Version_script_info::get_symbol_version_helper): Rewrite to use
6347 lookup tables.
6348 (Version_script_info::print_expression_list): Adjust to use
6349 Version_script_info::Language.
6350 (script_push_lex_into_version_mode): Check that the version script
6351 has not been finalized.
6352 (version_script_push_lang): Change language string to
6353 Version_script_info::Language.
6354 * options.cc (Command_line::version_script): New function.
6355 * options.h (class General_options): Add finalize_dynamic_list
6356 function. Change version_script from declaration to definition.
6357 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
6358 * testsuite/version_script.map: Remove duplicate def of foo.
6359 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
6360 version_script.map.
6361 * testsuite/Makefile.in: Rebuild.
6362
818bf354
ILT
63632009-12-30 Ian Lance Taylor <iant@google.com>
6364
6365 PR 10843
6366 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
6367 if the input symbol index is 0, make the output symbol index 0.
6368
ebcc8304
ILT
63692009-12-30 Ian Lance Taylor <iant@google.com>
6370
6371 PR 10670
6372 * options.h (class General_options): Add -x/--discard-all.
6373 * object.cc (Sized_relobj::do_count_local_symbols): Handle
6374 --discard-all. If the local symbol needs a dynamic entry, check
6375 that before handling --discard-locals.
6376
176fe33f
ILT
63772009-12-30 Ian Lance Taylor <iant@google.com>
6378
bb321bb1
ILT
6379 PR 10450
6380 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
6381 flags to PF_R.
6382 (Output_segment::add_output_section): Don't change the flags if
6383 the type is PT_TLS.
6384
176fe33f
ILT
6385 PR 10450
6386 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
6387 GNU hash table if they need a dynamic value. Otherwise, don't add
6388 them if they are defined in a dynamic object or are forced local.
6389
e8cd95c7
ILT
63902009-12-29 Ian Lance Taylor <iant@google.com>
6391
1b81fb71
ILT
6392 PR 10450
6393 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
6394 .gnu.hash table for a 32-bit target.
6395
8d6d383d
ILT
6396 PR 10450
6397 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
6398 regular and a dynamic object only needs a dynamic symbol table
6399 entry if it is externally visible.
6400
e785ec03
ILT
6401 PR 10450
6402 * i386.cc (class Target_i386): Initialize global_offset_table_ in
6403 constructor. Add global_offset_table_ field.
6404 (Target_i386::got_section): Set global_offset_table_.
6405 (Target_i386::do_finalize_sections): Set global_offset_table_
6406 size.
6407 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
6408 in constructor. Add global_offset_table_ field.
6409 (Target_x86_64::got_section): Set global_offset_table_.
6410 (Target_x86_64::do_finalize_sections): Set global_offset_table_
6411 size.
6412
1a2dff53
ILT
6413 * layout.cc (Layout::Layout): Initialize increase_relro_.
6414 (Layout::get_output_section): Add is_relro, is_last_relro, and
6415 is_first_non_relro parameters. Change all callers.
6416 (Layout::choose_output_section): Likewise.
6417 (Layout::add_output_section_data): Likewise.
6418 (Layout::make_output_section): Likewise.
6419 (Layout::set_segment_offsets): Clear increase_relro when using a
6420 linker script.
6421 * layout.h (class Layout): Add increase_relro method. Add
6422 increase_relro_ field. Update declarations.
6423 * output.cc (Output_section::Output_section): Initialize
6424 is_last_relro_ and is_first_non_relro_.
6425 (Output_segment::add_output_section): Group relro sections is
6426 do_sort is true. Handle is_last_relro and is_first_non_relro.
6427 (Output_segment::maximum_alignment): Remove relro handling.
6428 (Output_segment::set_section_addresses): Add increase_relro
6429 parameter. Change all callers. Add initial alignment to align
6430 relro sections on separate page. Remove old relro handling.
6431 (Output_segment::set_section_list_addresses): Remove in_relro
6432 parameter. Change all callers.
6433 (Output_segment::set_offset): Add increase parameter. Change all
6434 callers. Remove old relro handling.
6435 * output.h (class Output_section): Add new methods: is_last_relro,
6436 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
6437 Add is_last_relro_ and is_first_non_relro_ fields.
6438 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
6439 Create separate .got.plt section. Call increase_relro.
6440 * x86_64.cc (Target_x86_64::got_section): Likewise.
6441 * testsuite/relro_script_test.t: Add .got.plt.
6442
f0ba79e2
ILT
6443 PR 10450
6444 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
6445 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
6446 (Layout::finalize): Call set_dynamic_symbol_size.
6447 (Layout::set_dynamic_symbol_size): New function.
6448 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
6449 set_dynamic_symbol_size.
6450
e8cd95c7
ILT
6451 PR 10450
6452 * output.h (class Output_section): Add is_entsize_zero_ field.
6453 * output.cc (Output_section::Output_section): Initialize
6454 is_entsize_zero_.
6455 (Output_section::set_entsize): If two different entsizes are
6456 requested, force it to zero.
6457 (Output_section::add_input_section): Set flags for .debug_str
6458 before updating section flags. Set entsize.
6459 (Output_section::update_flags_for_input_section): Set SHF_MERGE
6460 and SHF_STRING if all input sections have those flags.
6461
3e1b9a8a
RÁE
64622009-12-29 Rafael Espindola <espindola@google.com>
6463
6464 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
6465 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
6466 reporting.
3e1b9a8a 6467
3dcad376
ST
64682009-12-29 Sriraman Tallam <tmsriram@google.com>
6469
6470 * options.cc (General_options::parse_version): Allow -v to exit
6471 without an error if there is nothing to link.
6472
084e2665
ILT
64732009-12-29 Ian Lance Taylor <iant@google.com>
6474
6475 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
6476 using a version of gcc before 4.1.
6477 * configure: Rebuild.
6478
250acde3
CD
64792009-12-28 Chris Demetriou <cgd@google.com>
6480
6481 * attributes.cc (Output_attributes_section_data::do_write): Use
6482 std::vector::front rather than std::vector::data.
6483
99fff23b
ILT
64842009-12-28 Ian Lance Taylor <iant@google.com>
6485
6486 * symtab.h (class Symbol_table): Add enum Defined.
6487 * resolve.cc (Symbol_table::should_override): Add defined
6488 parameter. Change all callers. Test whether object is NULL
6489 before calling a method on it.
6490 (Symbol_table::report_resolve_problem): Add defined parameter.
6491 Change all callers.
6492 (Symbol_table::should_override_with_special): Likewise.
6493 * symtab.cc (Symbol_table::define_in_output_data): Add defined
6494 parameter. Change all callers.
6495 (Symbol_table::do_define_in_output_data): Likewise.
6496 (Symbol_table::define_in_output_segment): Likewise.
6497 (Symbol_table::do_define_in_output_segment): Likewise.
6498 (Symbol_table::define_as_constant): Likewise.
6499 (Symbol_table::do_define_as_constant): Likewise.
6500 * script.h (class Symbol_assignment): Add is_defsym parameter to
6501 constructor; change all callers.
6502 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
6503 parameter. Change all callers. Add is_defsym_ field.
6504 (class Parser_closure): Add parsing_defsym parameter to
6505 constructor; change all callers. Add parsing_defsym accessor
6506 function. Add parsing_defsym_ field.
6507
556bd683
ILT
65082009-12-28 Ian Lance Taylor <iant@google.com>
6509
6510 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 6511 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 6512
1782c879
ILT
65132009-12-23 Ian Lance Taylor <iant@google.com>
6514
6515 * i386.cc (Target_i386::do_calls_non_split): Recognize
6516 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
6517 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
6518 -fsplit-stack prologue when using %r11.
1782c879 6519
329ca2b1
ST
65202009-12-21 Sriraman Tallam <tmsriram@google.com>
6521
6522 * options.cc (General_options::parse_version): Make -v continue and do
6523 the link like GNU ld does.
6524
d675ff46
RÁE
65252009-12-17 Rafael Avila de Espindola <espindola@google.com>
6526
6527 * Makefile.am (CCFILES): Add timer.cc.
6528 (HFILES): Add timer.h.
6529 * configure.ac: Check for sysconf and times.
6530 * main.cc: include timer.h.
6531 (main): Use Timer instead of get_run_time.
6532 * timer.cc: New.
6533 * timer.h: New.
6534 * workqueue.cc: include timer.h.
6535 (Workqueue::find_and_run_task):
6536 Report user, sys and wall time.
6537 * Makefile.in: Regenerate.
6538 * config.in: Regenerate.
6539 * configure: Regenerate.
6540
d6344fb5
DK
65412009-12-16 Doug Kwan <dougkwan@google.com>
6542
6543 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
6544 sections.
6545 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
6546 relaxed input sections.
6547 * output.cc (Output_section::find_relaxed_input_section): Change
6548 return type to Output_relaxed_input_section pointer. Adjust code
6549 for new type of relaxed_input_section_map_.
6550 * output.h (Output_section::find_relaxed_input_section): Change
6551 return type to Output_relaxed_input_section pointer.
6552 (Output_section::Output_relaxed_input_section_by_input_section_map):
6553 New type.
6554 (Output_section::relaxed_input_section_map_): Change type to
6555 Output_section::Output_relaxed_input_section_by_input_section_map.
6556 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
6557 input section.
6558
0e0d5469
ILT
65592009-12-15 Ian Lance Taylor <iant@google.com>
6560
6561 * layout.cc (Layout::create_shstrtab): Only write out after input
6562 sections if we are compressing debug sections.
6563
0649a889
ILT
65642009-12-15 Ian Lance Taylor <iant@google.com>
6565
6566 * archive.cc (Archive::add_symbols): Only look up a symbol without
6567 a version if there is, in fact, a version.
6568
2ea97941
ILT
65692009-12-14 Ian Lance Taylor <iant@google.com>
6570
6571 Revert -Wshadow changes, all changes from:
6572 2009-12-11 Doug Kwan <dougkwan@google.com>
6573 2009-12-11 Nick Clifton <nickc@redhat.com>
6574 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
6575
b0eec2cc
DK
65762009-12-11 Doug Kwan <dougkwan@google.com>
6577
6578 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
6579 due to -Wshadow.
6580 * attributes.cc (Object_attribute::size): Ditto.
6581 (Attributes_section_data::size): Ditto.
6582 (Attributes_section_data::Attributes_section_data): Ditto.
6583 (Output_attributes_section_data::do_write): Ditto.
6584 * attributes.h (Object_attribute::set_type): Ditto.
6585 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
6586
91d6fa6a
NC
65872009-12-11 Nick Clifton <nickc@redhat.com>
6588
6589 * archive.cc: Fix shadowed variable warnings.
6590 * arm.cc: Likewise.
6591 * compressed_output.cc: Likewise.
6592 * compressed_output.h: Likewise.
6593 * configure: Likewise.
6594 * dwarf_reader.cc: Likewise.
6595 * dynobj.cc: Likewise.
6596 * dynobj.h: Likewise.
6597 * ehframe.cc: Likewise.
6598 * ehframe.h: Likewise.
6599 * errors.cc: Likewise.
6600 * expression.cc: Likewise.
6601 * fileread.cc: Likewise.
6602 * fileread.h: Likewise.
6603 * freebsd.h: Likewise.
6604 * i386.cc: Likewise.
6605 * icf.cc: Likewise.
6606 * incremental.h: Likewise.
6607 * layout.cc: Likewise.
6608 * layout.h: Likewise.
6609 * mapfile.cc: Likewise.
6610 * merge.cc: Likewise.
6611 * merge.h: Likewise.
6612 * object.cc: Likewise.
6613 * object.h: Likewise.
6614 * options.h: Likewise.
6615 * output.cc: Likewise.
6616 * output.h: Likewise.
6617 * parameters.cc: Likewise.
6618 * plugin.cc: Likewise.
6619 * powerpc.cc: Likewise.
6620 * reduced_debug_output.cc: Likewise.
6621 * reduced_debug_output.h: Likewise.
6622 * reloc.cc: Likewise.
6623 * reloc.h: Likewise.
6624 * resolve.cc: Likewise.
6625 * script-sections.cc: Likewise.
6626 * script.cc: Likewise.
6627 * script.h: Likewise.
6628 * sparc.cc: Likewise.
6629 * symtab.cc: Likewise.
6630 * symtab.h: Likewise.
6631 * target-select.cc: Likewise.
6632 * target-select.h: Likewise.
6633 * token.h: Likewise.
6634 * workqueue.cc: Likewise.
6635 * workqueue.h: Likewise.
6636 * x86_64.cc: Likewise.
6637
a0351a69
DK
66382009-12-10 Doug Kwan <dougkwan@google.com>
6639
6640 * arm.cc (attributes.h): New include.
6641 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
6642 (Arm_relobj::~Arm_relobj): Delete object pointed by
6643 attributes_section_data_.
6644 (Arm_relobj::attributes_section_data): New method definition.
6645 (Arm_relobj::attributes_section_data_): New data member declaration.
6646 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
6647 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
6648 attributes_section_data_.
6649 (Arm_dynobj::attributes_section_data): New method definition.
6650 (Arm_dynobj::attributes_section_data_): New data member declaration.
6651 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
6652 initialization value of may_use_blx_ to false.
6653 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
6654 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
6655 object attributes to compute results instead of hard-coding.
6656 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
6657 Target_arm::get_secondary_compatible_arch,
6658 Target_arm::set_secondary_compatible_arch
6659 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6660 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
6661 New method declarations.
6662 (Target_arm::get_aeabi_object_attribute): New method definition.
6663 (Target_arm::attributes_section_data_): New data member declaration.
6664 (read_arm_attributes_section): New template definition.
6665 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
6666 (Arm_dynobj::do_read_symbols): Ditto.
6667 (Target_arm::do_finalize_sections): Merge attributes sections from
6668 input. Check for BLX use after attributes section merging.
6669 Fix __exidx_start and __exidx_end visibility. Create an
6670 .ARM.attributes section if necessary.
6671 (Target_arm::get_secondary_compatible_arch,
6672 Target_arm::set_secondary_compatible_arch,
6673 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
6674 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 6675 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
6676 New method definitions.
6677
b59befec
ILT
66782009-12-09 Ian Lance Taylor <iant@google.com>
6679
6680 * plugin.cc (Plugin::load): Don't cast from void* to a function
6681 pointer.
6682
1276bc89
ILT
66832009-12-09 Ian Lance Taylor <iant@google.com>
6684
6685 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
6686 information fields.
6687
2f2de248
L
66882009-12-09 H.J. Lu <hongjiu.lu@intel.com>
6689
6690 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
6691 Replace two_file_shared_1.so with two_file_shared_2.so.
6692 * testsuite/Makefile.in: Regenerated.
6693
4f787271
DK
66942009-12-08 Doug Kwan <dougkwan@google.com>
6695
6696 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
6697 (HFILES): Add attributes.h and int_encoding.h.
6698 * Makefile.in: Regenerate.
6699 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
6700 function definitions to int_encoding.cc
6701 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
6702 prototypes to int_encoding.h
6703 * reduced_debug_output.cc (int_encoding.h): New include.
6704 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
6705 function definitions to int_encoding.cc
6706 (insert_into_vector, read_from_pointer): Move template definitions to
6707 int_encoding.h
6708 * attributes.cc: New file.
6709 * attributes.h: New file.
6710 * int_encoding.cc: New file.
6711 * int_encoding.h: New file.
6712
20b52f1a
RÁE
67132009-12-07 Rafael Avila de Espindola <espindola@google.com>
6714
6715 PR gold/11055
6716 * incremental-dump.cc (dump_incremental_inputs): New.
6717 (main): Use dump_incremental_inputs.
6718
53d7974c
L
67192009-12-07 H.J. Lu <hongjiu.lu@intel.com>
6720
6721 PR gold/10893
6722 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
6723 checking elfcpp::STT_FUNC.
6724 (Target_i386::Relocate::relocate): Likewise.
6725 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6726
6727 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
6728 symbols from shared libraries into normal FUNC symbols.
6729
6730 * symtab.h (Symbol): Add is_func and use it.
6731
05a352e6
DK
67322009-12-05 Doug Kwan <dougkwan@google.com>
6733
6734 * arm.cc (Target_arm::arm_info): Initialize new fields
6735 attributes_section and attributes_vendor.
6736 * i386.cc (Target_i386::i386_info): Same.
6737 * object.cc (Sized_relobj::do_layout): Skip attribute section.
6738 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
6739 fields attributes_section and attributes_vendor.
53d7974c 6740 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
6741 * target.h (Target::attributes_section, Target::attributes_vendor,
6742 Target::is_attributes_section, Target::attribute_arg_type,
6743 Target::attributes_order): New method definitions.
6744 (Target::Target_info::attributes_section,
6745 Target::Target_info::attributes_vendor): New fields.
6746 (Target::do_attribute_arg_type, Target::do_attributes_order): New
6747 virtual method definitions.
6748 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
6749 attributes_section and attributes_vendor.
6750 * testsuite/testfile.cc (Target_test::test_target_info): Same.
6751
f4e5969c
DK
67522009-12-05 Doug Kwan <dougkwan@google.com>
6753
6754 * arm.cc: Update comments about interworking and stub generation.
6755 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
6756 considered as non-PIC.
6757 (Arm_relocate_functions::base_abs): Fix formatting.
6758 (Arm_relocate_functions::got_prel): Fix comment. Change interface
6759 of function to use GOT entry address instead of offset.
6760 (Target_arm::Scan::global): Issue an error if a symbol would need a
6761 PLT does not get one because it is untyped. Remove code to create
6762 dynamic symbols for relative branches.
6763 (Target_arm::Relocate::relocate: Use 0 instead of false since function
6764 takes unsigned integer instead of boolean.
6765
1abce4a6
L
67662009-12-05 H.J. Lu <hongjiu.lu@intel.com>
6767
6768 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
6769 (two_file_test_LDADD): Likewise.
6770 (common_test_1_LDADD): Likewise.
6771 (exception_test_LDADD) Likewise.
6772 (weak_test_LDADD): Likewise.
6773 (many_sections_test_LDADD): Likewise.
6774 (initpri1_LDADD): Likewise.
6775 (script_test_1_LDADD): Likewise.
6776 (script_test_2_LDADD): Likewise.
6777 (justsyms_LDADD): Likewise.
6778 (binary_test_LDADD): Likewise.
6779 (large_LDADD): Likewise.
6780 * testsuite/Makefile.in: Regenerated.
6781
adcf2816 67822009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 6783
adcf2816
L
6784 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
6785 (Symbol_table::override_with_special): Likewise.
6786 (Symbol_table::add_from_object): Likewise.
6787
28e67f5d
RÁE
67882009-12-04 Rafael Avila de Espindola <espindola@google.com>
6789
6790 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6791 Don't set the data_offset twice.
6792
ae10a101
RÁE
67932009-12-04 Rafael Avila de Espindola <espindola@google.com>
6794
6795 * testsuite/Makefile.in: Regenerate.
6796
f59f41f3
DK
67972009-12-03 Doug Kwan <dougkwan@google.com>
6798
6799 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6800 (Target_arm::do_finalize_sections): Add parameter for symbol table
6801 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6802 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6803 parameter for symbol table pointer.
6804 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6805 an additional parameter for a pointer to symbol table.
6806 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6807 parameter for a symbol table pointer.
6808 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6809 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6810 Ditto.
6811 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6812 parameter for a symbol table pointer.
6813
ca55d848
RÁE
68142009-12-03 Rafael Avila de Espindola <espindola@google.com>
6815
6816 * incremental.cc (Incremental_inputs_header)
6817 (Incremental_inputs_header_write, Incremental_inputs_entry)
6818 (Incremental_inputs_entry_write): Move ...
6819 * incremental.h (Incremental_inputs_header)
6820 (Incremental_inputs_header_write, Incremental_inputs_entry)
6821 (Incremental_inputs_entry_write): here.
6822
3aec4f9c
RÁE
68232009-12-02 Rafael Avila de Espindola <espindola@google.com>
6824
6825 * incremental.cc (make_sized_incremental_binary): Set the target.
6826 Error if it is incompatible.
6827 * output.h (Output_file): Add filename method.
6828
9c0ae74d
RÁE
68292009-12-02 Rafael Avila de Espindola <espindola@google.com>
6830
6831 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6832 from the get_* methods.
6833
a45500ae
RÁE
68342009-12-02 Rafael Avila de Espindola <espindola@google.com>
6835
6836 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6837 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6838 Write 0 for the data_offset of scripts.
6839
325e6408
RÁE
68402009-12-02 Rafael Avila de Espindola <espindola@google.com>
6841
6842 * testsuite/Makefile.am: Add the incremental_test.sh test.
6843 * testsuite/incremental_test.sh: New.
6844 * testsuite/incremental_test_1.c: New.
6845 * testsuite/incremental_test_2.c: New.
6846
954c3e2e
RÁE
68472009-12-01 Rafael Avila de Espindola <espindola@google.com>
6848
6849 * incremental-dump.cc (main): Fix typos.
6850
f8086623
RÁE
68512009-11-27 Rafael Avila de Espindola <espindola@google.com>
6852
6853 PR gold/11025
6854 * incremental-dump.cc (main): Use llu to print 64 bit values.
6855
3b0dd6ac
L
68562009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6857 H.J. Lu <hongjiu.lu@intel.com>
6858
6859 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6860 $(LIBDL).
6861 (incremental_dump_LDADD): Likewise.
6862 * Makefile.in: Regenerated.
6863
a6d1ef57 68642009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6865
a6d1ef57
DK
6866 Revert:
6867
6868 2009-11-25 Doug Kwan <dougkwan@google.com>
6869
6870 * arm.cc (Target_arm::Target_arm): Move method definition
6871 outside of class definition. Add code to handle
6872 --target1-rel, --target1-abs and --target2= options.
6873 (Target_arm::get_reloc_reloc_type): Change method to be
6874 non-static and const.
6875 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6876 New data member declaration.
6877 (Target_arm::Scan::local, Target_arm::Scan::global,
6878 Target_arm::Relocate::relocate,
6879 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6880 Adjust call to Target_arm::get_real_reloc_type.
6881 (Target_arm::get_real_reloc_type): Use command line options
6882 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6883 * options.h (--target1-rel, --target1-abs, --target2): New
6884 ARM-only options.
6885
50aeb7d4
DK
68862009-11-25 Doug Kwan <dougkwan@google.com>
6887
6888 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6889 class definition. Add code to handle --target1-rel, --target1-abs
6890 and --target2= options.
6891 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6892 and const.
6893 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6894 member declaration.
6895 (Target_arm::Scan::local, Target_arm::Scan::global,
6896 Target_arm::Relocate::relocate,
6897 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6898 call to Target_arm::get_real_reloc_type.
6899 (Target_arm::get_real_reloc_type): Use command line options to
6900 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6901 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6902 options.
6903
51938283
DK
69042009-11-25 Doug Kwan <dougkwan@google.com>
6905
6906 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6907 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6908 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6909 formatting.
6910 (Arm_relocate_functions::thm_call): Replace body with a call to
6911 Arm_relocate_functions::thumb_branch_common.
6912 (Arm_relocate_functions::thm_jump24,
6913 Arm_relocate_functions::thm_xpc22): New method definitions.
6914 (Arm_relocate_functions::thumb_branch_common): New method definition.
6915 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6916 operator.
6917 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6918 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6919
e2b8f3c4
RÁE
69202009-11-24 Rafael Avila de Espindola <espindola@google.com>
6921
6922 * Makefile.am: Build incremental-dump
6923 * Makefile.in: Regenerate.
6924 * incremental-dump.cc: New.
6925 * incremental.cc (Incremental_inputs_header_data,
6926 Incremental_inputs_entry_data): Move to incremental.h
6927 * incremental.h: (Incremental_inputs_header_data,
6928 Incremental_inputs_entry_data): Move from incremental.cc
6929
bcba9aec
RÁE
69302009-11-24 Rafael Avila de Espindola <espindola@google.com>
6931
6932 * incremental.cc (Incremental_inputs_header,
6933 Incremental_inputs_header_write, Incremental_inputs_entry,
6934 Incremental_inputs_entry_write): Add a typedef with the data type.
6935
7c3afe08
RÁE
69362009-11-24 Rafael Avila de Espindola <espindola@google.com>
6937
6938 * incremental.cc (Incremental_inputs_header,
6939 Incremental_inputs_header_write, Incremental_inputs_entry,
6940 Incremental_inputs_entry_write): Update comment about which
6941 type has the filed descriptions.
6942
d204b6e9
DK
69432009-11-15 Doug Kwan <dougkwan@google.com>
6944
6945 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6946 (Arm_relocate_functions::arm_branch_common): Change method defintion
6947 in class definition to a method declaration and update list of formal
6948 parameters.
6949 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6950 Arm_relocation_functions::jump24): Adjust call to
6951 Arm_relocate_functions::arm_branch_common. Update list of formal
6952 parameters.
6953 (Arm_relocate_functions::xpc25): New method definition.
6954 (Arm_relocate_functions::arm_branch_common): Move method defintion
6955 out from class definition. Use stubs for mode-switching and extending
6956 branch ranges.
6957 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6958 specially. Change code to enable use of stubs in ARM branches.
6959
43d12afe
DK
69602009-11-10 Doug Kwan <dougkwan@google.com>
6961
6962 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6963 in method declaration.
6964 (Target_arm::relocate_stub): New method declaration.
6965 (Target_arm::default_target): Change to return a pointer instead of
6966 a const reference.
6967 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6968 Target_arm::default_target.
6969 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6970 method definition.
6971 (Target_arm::relocate_section): Adjust view.
6972 (Target_arm::relocate_stub): New method definition.
6973
ac33a407
DK
69742009-11-10 Doug Kwan <dougkwan@google.com>
6975
6976 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6977 a format warning.
6978 * incremental.cc (open_incremental_binary): Initialized local
6979 variables to avoid warnings.
6980 * object.cc (make_elf_object): Ditto.
6981 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6982 a format warning.
e1df38aa 6983
88ee28e9
L
6984009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6985
6986 PR gold/10930
6987 * testsuite/plugin_test.c: Include "config.h".
6988
2daedcd6
DK
69892009-11-09 Doug Kwan <dougkwan@google.com>
6990
6991 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6992 (arm_symbol_value): Remove.
6993 (Arm_relocate_functions::arm_branch_common,
6994 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6995 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6996 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6997 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6998 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6999 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
7000 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
7001 Arm_relocate_functions::thm_mobw_abs_nc,
7002 Arm_relocate_functions::thm_mov_abs,
7003 Arm_relocate_functions::movw_prel_nc,
7004 Arm_relocate_functions::thm_movt_abs,
7005 Arm_relocate_functions::movt_prel,
7006 Arm_relocate_functions::thm_movw_prel_nc,
7007 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
7008 (Target_arm::Relocate::relocate): Only decompose address into two
7009 parts if relocation type uses the thumb-bit and pass the actual
7010 bit instead of a flag indicating that the thumb-bit is used. Adjust
7011 calls to methods in Arm_relocate_functions for this change.
7012
1276bc89 70132009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
7014
7015 PR 10925
7016 * reloc.cc: Instantiate
7017 Sized_relobj::initialize_input_to_output_maps and
7018 Sized_relobj:free_input_to_output_maps.
7019
e53ad1b5
ILT
70202009-11-06 Ian Lance Taylor <iant@google.com>
7021
7022 PR 10876
7023 * defstd.cc (in_segment): Set only_if_ref true for "end".
7024
eb44217c
DK
70252009-11-06 Doug Kwan <dougkwan@google.com>
7026
7027 * arm.cc (class Reloc_stub): Correct a comment.
7028 (Target_arm::Target_arm): Initialize arm_input_section_map_.
7029 (Target_arm::scan_section_for_stubs): New method declaration.
7030 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
7031 Change methods from private to protected.
7032 (Target_arm::do_may_relax): New method definition.
7033 (Target_arm::do_relax, Target_arm::group_sections,
7034 Target_arm::scan_reloc_for_stub,
7035 Target_arm::scan_reloc_section_for_stubs): New method declarations.
7036 (Target_arm::arm_input_section_map_): New data member declaration.
7037 (Target_arm::scan_reloc_for_stub,
7038 Target_arm::scan_reloc_section_for_stubs,
7039 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
7040 Target_arm::do_relax): New method definitions.
7041
5d329b7d
ILT
70422009-11-06 Mikolaj Zalewski <mikolaj@google.com>
7043
7044 * configure.ac: Check for (struct stat)::st_mtim
7045 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
7046 * config.in: Regenerate.
7047 * configure: Regenerate.
7048
96a0d71b
ILT
70492009-11-05 Ian Lance Taylor <iant@google.com>
7050
7051 PR 10910
7052 * output.cc (Output_segment::add_output_section): Add missing
7053 return statement.
7054
594c8e5e
ILT
70552009-11-04 Ian Lance Taylor <iant@google.com>
7056
7057 PR 10880
7058 * object.h (class Object): Add is_needed and set_is_needed
7059 methods. Add is_needed_ field. Make bool fields into bitfields.
7060 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
7061 defined in a dynamic object and referenced by a regular object,
7062 set is_needed for the dynamic object.
7063 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
7064 if the file is marked with as_needed and it is not needed.
7065
22b127cc
ILT
70662009-11-04 Ian Lance Taylor <iant@google.com>
7067
7068 PR 10887
7069 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
7070 tags if data is discarded by linker script.
7071 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7072 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7073 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7074 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7075
f5c870d2
ILT
70762009-11-04 Ian Lance Taylor <iant@google.com>
7077
7078 * layout.cc (Layout::get_output_section): Add is_interp and
7079 is_dynamic_linker_section parameters. Change all callers.
7080 (Layout::choose_output_section): Likewise.
7081 (Layout::make_output_section): Likewise.
7082 (Layout::add_output_section_data): Add is_dynamic_linker_section
7083 parameter. Change all callers.
7084 * layout.h (class Layout): Update declarations.
7085 * output.h (class Output_section): Add is_interp, set_is_interp,
7086 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
7087 Add is_interp_, is_dynamic_linker_section_ fields. Change
7088 generate_code_fills_at_write_ to a bitfield.
7089 * output.cc (Output_section::Output_sections): Initialize new
7090 fields.
7091 (Output_segment::add_output_section): Add do_sort parameter.
7092 Change all callers.
7093
1ae4d23b
ILT
70942009-11-03 Ian Lance Taylor <iant@google.com>
7095
7096 PR 10860
7097 * options.h (class General_options): Add --warn-common.
7098 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
7099 merging two common symbols.
7100 (Symbol_table::should_override): Handle --warn-common when merging
7101 a common symbol with a defined symbol. Use report_resolve_problem
7102 for multiple definitions.
7103 (Symbol_table::report_resolve_problem): New function.
7104 * symtab.h (class Symbol_table): Declare report_resolve_problem.
7105
55da9579
DK
71062009-11-03 Doug Kwan <dougkwan@google.com>
7107
7108 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
7109 stub_factory_.
7110 (Target_arm::stub_factory): New method definition.
7111 (Target_arm::new_arm_input_section,
7112 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
7113 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 7114 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
7115 New type definitions.
7116 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
7117 member declarations.
7118 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
7119 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
7120 New method definitions.
7121
37a9ac43
ILT
71222009-11-03 Ian Lance Taylor <iant@google.com>
7123
7124 * options.h (class General_options): Add --warn_constructors.
7125
b3d6a3d4
ILT
71262009-11-03 Ian Lance Taylor <iant@google.com>
7127
7128 PR 10893
7129 * defstd.cc (in_section): Add entries for __rel_iplt_start,
7130 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
7131
934b01dd
ILT
71322009-11-03 Ian Lance Taylor <iant@google.com>
7133
7134 PR 10895
7135 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
7136 --msgid-bugs-address.
7137 (install-pdf): New target.
7138 (install-data_yes): Look up one directory to find mkinstalldirs.
7139
03c1939b
L
71402009-11-03 H.J. Lu <hongjiu.lu@intel.com>
7141
7142 * po/Make-in (.po.gmo): Don't generate .gmo files in source
7143 tree.
7144
ebd95253
DK
71452009-10-30 Doug Kwan <dougkwan@google.com>
7146
7147 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
7148
e9bbb538
DK
71492009-10-30 Doug Kwan <dougkwan@google.com>
7150
7151 * arm.cc (Stub_addend_reader): New struct template definition
7152 and partial specializations.
7153 (Stub_addend_reader::operator()): New method definition for a
7154 partially specialized template.
7155
d5b40221
DK
71562009-10-30 Doug Kwan <dougkwan@google.com>
7157
7158 * arm.cc (Arm_relobj::processor_specific_flags): New method
7159 definition.
7160 (Arm_relobj::do_read_symbols): New method declaration.
7161 (Arm_relobj::processor_specific_flags_): New data member declaration.
7162 (Arm_dynobj): New class definition.
7163 (Target_arm::do_finalize_sections): Add input_objects parameter.
7164 (Target_arm::do_adjust_elf_header): New method declaration.
7165 (Target_arm::are_eabi_versions_compatible,
7166 (Target_arm::merge_processor_specific_flags): New method declaration.
7167 (Target_arm::do_make_elf_object): New overloaded method definitions
7168 and declaration.
7169 (Arm_relobj::do_read_symbols): New method definition.
7170 (Arm_dynobj::do_read_symbols): Ditto.
7171 (Target_arm::do_finalize_sections): Add input_objects parameters.
7172 Merge processor-specific flags from all input objects.
7173 (Target_arm::are_eabi_versions_compatible,
7174 Target_arm::merge_processor_specific_flags,
7175 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
7176 New method definitions.
7177 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
7178 Input_objects pointer type parameter.
7179 * layout.cc (Layout::finalize): Pass input objects to target's.
7180 finalize_sections function.
7181 * output.cc (Output_file_header::do_sized_write): Set ELF file
7182 header's processor-specific flags.
7183 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
7184 Input_objects pointer type parameter.
7185 * sparc.cc (Target_sparc::do_finalize_sections): Same.
7186 * target.h (Input_objects): New forward class declaration.
7187 (Target::processor_specific_flags,
7188 Target::are_processor_specific_flags_sect): New method definitions.
7189 (Target::finalize_sections): Add input_objects parameter.
7190 (Target::Target): Initialize processor_specific_flags_ and
7191 are_processor_specific_flags_set_.
7192 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
7193 parameter.
7194 (Target::set_processor_specific_flags): New method definition.
7195 (Target::processor_specific_flags_,
7196 Target::are_processor_specific_flags_set_): New data member
7197 declarations.
7198 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
7199 Input_objects pointer type parameter.
7200
ebabffbd
DK
72012009-10-30 Doug Kwan <dougkwan@google.com>
7202
7203 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
7204
ad0f2072
ILT
72052009-10-28 Ian Lance Taylor <iant@google.com>
7206
7207 * object.h (class Relobj): Drop options parameter from
7208 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
7209 do_scan_relocs, do_relocate. Change all callers.
7210 (class Sized_relobj): Drop options parameters from
7211 do_gc_process_relocs, do_scan_relocs, do_relocate,
7212 do_relocate_sections, relocate_sections, emit_relocs_scan,
7213 emit_relocs_scan_reltype. Change all callers.
7214 (struct Relocate_info): Remove options field and all references to
7215 it.
7216 * reloc.h (class Read_relocs): Remove options constructor
7217 parameter and options_ field. Change all callers.
7218 (class Gc_process_relocs, class Scan_relocs): Likewise.
7219 (class Relocate_task): Likewise.
7220 * target-reloc.h (scan_relocs): Remove options parameter. Change
7221 all callers.
7222 (scan_relocatable_relocs): Likewise.
7223 * target.h (class Sized_target): Remove options parameter from
7224 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
7225 all callers.
7226 * gc.h (gc_process_relocs): Remove options parameter. Change all
7227 callers.
7228 * arm.cc: Update functions to remove options parameters.
7229 * i386.cc: Likewise.
7230 * powerpc.cc: Likewise.
7231 * sparc.cc: Likewise.
7232 * x86_64.cc: Likewise.
7233 * testsuite/testfile.cc: Likewise.
7234
8ffa3667
DK
72352009-10-28 Doug Kwan <dougkwan@google.com>
7236
7237 * arm.cc (Arm_relobj): New class definition.
e1df38aa 7238 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
7239 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
7240 New method definitions.
7241
40f36857
CC
72422009-10-28 Cary Coutant <ccoutant@google.com>
7243
7244 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
7245 (Plugin::cleanup_done_): New member.
7246 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
7247 (Plugin_manager::cleanup_done_): Remove.
7248 (Plugin_manager::add_input_file): Edit error message.
7249 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
7250 (Plugin_manager::cleanup): Remove use of cleanup_done_.
7251
2c849493
ILT
72522009-10-27 Mikolaj Zalewski <mikolajz@google.com>
7253
7254 * fileread.cc: (File_read::View::~View): Use the new
7255 data_ownership_ filed.
7256 (File_read::~File_read): Dispose the new whole_file_view_.
7257 (File_read::open): Mmap the whole file if needed.
7258 (File_read::open): Use whole_file_view_ instead of contents_.
7259 (File_read::find_view): Use whole_file_view_ if applicable.
7260 (File_read::do_read): Use whole_file_view_ instead of contents_.
7261 (File_read::make_view): Use whole_file_view_ instead of contents_,
7262 update File_read::View::View call.
7263 (File_read::find_or_make_view): Update File_read::View::View
7264 call.
7265 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
7266 remove contents_
7267 (File_read::View::Data_ownership): New enum.
7268 (File_read::View::View): Replace bool mapped_ with Data_ownership
7269 argument.
7270 (File_read::View::mapped_): Remove (replaced by data_ownership_).
7271 (File_read::View::data_ownership_): New field.
7272 (File_read::contents_): Remove (replaced by whole_file_view_).
7273 (File_read::whole_file_view_): New field.
7274 * options.h (class General_options): Add --keep-files-mapped.
7275
24998053
CC
72762009-10-27 Cary Coutant <ccoutant@google.com>
7277
7278 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
7279 * testsuite/Makefile.am (plugin_test_5): New test case.
7280 * testsuite/Makefile.in: Regenerate.
7281
72adc4fa
DK
72822009-10-25 Doug Kwan <dougkwan@google.com>
7283
7284 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
7285 from private to protected to allow access by child class.
7286 (Sized_relobj::do_relocate_sections): New method declaration.
7287 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 7288 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
7289 Sized_relobj::relocate_sections. Instantiate template explicitly
7290 for different target sizes and endianity.
7291
07f508a2
DK
72922009-10-24 Doug Kwan <dougkwan@google.com>
7293
7294 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
7295 (Arm_input_section::as_arm_input_section): New method.
7296 (Arm_output_section): New class definition.
7297 (Arm_output_section::create_stub_group,
7298 Arm_output_section::group_sections): New method definitions.
7299
10ad9fe5
DK
73002009-10-22 Doug Kwan <dougkwan@google.com>
7301
7302 * arm.cc (Arm_input_section): New class definition.
7303 (Arm_input_section::init, Arm_input_section:do_write,
7304 Arm_input_section::set_final_data_size,
7305 Arm_input_section::do_reset_address_and_file_offset): New method
7306 definitions.
7307
56ee5e00
DK
73082009-10-21 Doug Kwan <dougkwan@google.com>
7309
7310 * arm.cc (Stub_table, Arm_input_section): New forward class
7311 declarations.
7312 (Stub_table): New class defintion.
7313 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
7314 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
7315 New method definition.
7316
b569affa
DK
73172009-10-21 Doug Kwan <dougkwan@google.com>
7318
7319 * arm.cc: Update copyright comments.
7320 (Target_arm): New forward class template declaration.
7321 (Arm_address): New type.
7322 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
7323 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
7324 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
7325 constants.
7326 (Insn_template): Same.
7327 (DEF_STUBS): New macro.
7328 (Stub_type): New enum type.
7329 (Stub_template): New class definition.
7330 (Stub): Same.
7331 (Reloc_stub): Same.
7332 (Stub_factory): Same.
7333 (Target_arm::Target_arm): Initialize may_use_blx_ and
7334 should_force_pic_veneer_.
7335 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
7336 Target_arm::should_force_pic_veneer,
7337 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
7338 Target_arm::using_thumb_only, Target_arm:;default_target): New
7339 method defintions.
7340 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
7341 New data member declarations.
7342 (Insn_template::size, Insn_template::alignment): New method defintions.
7343 (Stub_template::Stub_template): New method definition.
7344 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
7345 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
7346 (Stub_factory::Stub_factory): New method definition.
7347 * gold.h (string_hash): New template.
7348 * output.h (Input_section_specifier::hash_value): Use
7349 gold::string_hash.
7350 (Input_section_specifier::string_hash): Remove.
7351 * stringpool.cc (Stringpool_template::string_hash): Use
7352 gold::string_hash.
7353
6c172549
DK
73542009-10-20 Doug Kwan <dougkwan@google.com>
7355
7356 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
7357 symbols of relaxed input sections.
7358 * output.h (Output_section::find_relaxed_input_section): Make
7359 method public.
7360
c5617f2f
DK
73612009-10-16 Doug Kwan <dougkwan@google.com>
7362
7363 * dynobj.cc (Versions::Versions): Initialize version_script_.
7364 Only insert base version symbol definition for a shared object
7365 if version script defines any version versions.
7366 (Versions::define_base_version): New method definition.
7367 (Versions::add_def): Check that base version is not needed.
7368 (Versions::add_need): Define base version lazily.
7369 * dynobj.h (Versions::define_base_version): New method declaration.
7370 (Versions::needs_base_version_): New data member declaration.
7371 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
7372 (check_DATA): Add no_version_test.stdout.
7373 (libno_version_test.so, no_version_test.o no_version_test.stdout):
7374 New make rules.
7375 * testsuite/Makefile.in: Regenerate.
7376 * testsuite/no_version_test.c: New file.
7377 * testsuite/no_version_test.sh: Ditto.
7378
3c12dcdb
DK
73792009-10-16 Doug Kwan <dougkwan@google.com>
7380
7381 * expression.cc (class Segment_start_expression): New class definition.
7382 (Segment_start_expression::value): New method definition.
7383 (script_exp_function_segment_start): Return a new
7384 Segment_start_expression.
7385 * gold/script-c.h (script_saw_segment_start_expression): New function
7386 prototype.
7387 * script-sections.cc (Script_sections::Script_sections): Initialize
7388 SAW_SEGMENT_START_EXPRESSION_ to false.
7389 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
7390 and -Tbbs options to specify section addresses if given in
7391 command line and no SEGMENT_START expression is seen in a script.
7392 * script-sections.h (Script_sections::saw_segment_start_expression,
7393 Script_sections::set_saw_segment_start_expression): New method
7394 definition.
7395 (Script_sections::saw_segment_start_expression_): New data member
7396 declaration.
7397 * script.cc (script_saw_segment_start_expression): New function.
7398 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
7399 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
7400 script_test_7.sh and script_test_8.sh.
7401 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
7402 script_test_8.stdout.
7403 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
7404 (script_test_6, script_test_6.stdout, script_test_7,
7405 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
7406 * Makefile.in: Regenerate.
7407 * testsuite/script_test_6.sh: New file.
7408 * testsuite/script_test_6.t: Same.
7409 * testsuite/script_test_7.sh: Same.
7410 * testsuite/script_test_7.t: Same.
7411 * testsuite/script_test_8.sh: Same.
7412
64b1ae37
DK
74132009-10-16 Doug Kwan <dougkwan@google.com>
7414
7415 * output.cc (Output_segment::set_section_list_address): Cast
7416 expressions to unsigned long long type to avoid format warnings.
7417
661be1e2
ILT
74182009-10-15 Ian Lance Taylor <iant@google.com>
7419
12edd763 7420 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 7421 dot assignment to script_sections_.
12edd763
ILT
7422 * script-sections.cc (Script_sections::add_dot_assignment):
7423 Initialize if necessary.
7424
68b6574b
ILT
7425 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
7426 program headers with no load segment if there is a linker script.
7427
661be1e2
ILT
7428 * layout.cc (Layout::set_segment_offsets): Align the file offset
7429 to the segment aligment for -N or -n with no load segment.
7430 * output.cc (Output_segment::add_output_section): Don't crash if
7431 the first section is a TLS section.
7432 (Output_segment::set_section_list_addresses): Print an error
7433 message if the address moves backward in a linker script.
7434 * script-sections.cc
7435 (Output_section_element_input::set_section_addresses): Don't
7436 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
7437 (Orphan_output_section::set_section_addresses): Likewise.
7438
f15f61a7
DK
74392009-10-15 Doug Kwan <dougkwan@google.com>
7440
7441 * layout.cc (Layout::finish_dynamic_section): Generate tags
7442 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
7443 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
7444 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
7445
82bb573a
ILT
74462009-10-14 Ian Lance Taylor <iant@google.com>
7447
7448 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
7449 fields.
7450 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
7451 data_shdr fields of relinfo.
7452 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
7453 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
7454 R_386_TLS_LDO_32, adjust based on section flags.
7455 (Target_i386::Relocate::fix_up_ldo): Remove.
7456
374ad285
ILT
74572009-10-13 Ian Lance Taylor <iant@google.com>
7458
7459 Add support for -pie.
7460 * options.h (class General_options): Add -pie and
7461 --pic-executable.
7462 (General_options::output_is_position_independent): Test -pie.
7463 (General_options::output_is_executable): Return true if not shared
7464 and not relocatable.
7465 (General_options::output_is_pie): Remove.
7466 * options.cc (General_options::finalize): Reject incompatible uses
7467 of -pie.
7468 * gold.cc (queue_middle_tasks): A -pie link is not static.
7469 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
7470 * symtab.cc (Symbol::final_value_is_known): Return false if
7471 output_is_position_independent.
7472 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
7473 output_is_position_independent.
7474 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
7475 output_is_position_independent.
7476 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
7477 output_is_position_independent.
7478 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
7479 two_file_pie_test.
7480 (basic_pie_test.o, basic_pie_test): New targets.
7481 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
7482 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
7483 (two_file_pie_test): New target.
7484 * testsuite/Makefile.in: Rebuild.
7485 * README: Remove note saying that -pie is not supported.
7486
c6585162
ILT
74872009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
7488
7489 * options.h (class General_options): Add -init and -fini.
7490 * layout.cc (Layout::finish_dynamic_section): Emit
7491 given init and fini functions.
7492
032ce4e9
ST
74932009-10-13 Sriraman Tallam <tmsriram@google.com>
7494
7495 * gc.h (gc_process_relocs): Check if icf is enabled using new
7496 function.
7497 * gold.cc (queue_initial_tasks): Likewise.
7498 (queue_middle_tasks): Likewise.
7499 * object.cc (do_layout): Likewise.
7500 * symtab.cc (is_section_folded): Likewise.
7501 * main.cc (main): Likewise.
7502 * reloc.cc (Read_relocs::run): Likewise.
7503 (Sized_relobj::do_scan_relocs): Likewise.
7504 * icf.cc (is_function_ctor_or_dtor): New function.
7505 (Icf::find_identical_sections): Check if function is ctor or dtor when
7506 safe icf is chosen.
7507 * options.h (General_options::icf): Change option to be an enum.
7508 (Icf_status): New enum.
7509 (icf_enabled): New method.
7510 (icf_safe_folding): New method.
7511 (set_icf_status): New method.
7512 (icf_status_): New variable.
7513 * (options.cc) (General_options::finalize): Set icf_status_.
7514 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
7515 icf_test and icf_keep_unique_test to use the --icf enum flag.
7516 * testsuite/icf_safe_test.sh: New file.
e1df38aa 7517 * testsuite/icf_safe_test.cc: New file.
032ce4e9 7518
f345227a
ST
75192009-10-12 Sriraman Tallam <tmsriram@google.com>
7520
7521 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
7522 includes to gc.h and icf.h.
7523 * arm.cc: Include gc.h.
7524 * gold.cc: Likewise.
7525 * i386.cc: Likewise.
7526 * powerpc.cc: Likewise.
7527 * sparc.cc: Likewise.
7528 * x86_64.cc: Likewise.
7529 * gc.h: Include icf.h.
7530
1c7814ed
ILT
75312009-10-11 Ian Lance Taylor <iant@google.com>
7532
7533 * plugin.cc: Include "gold.h" before other header files.
7534
ae3b5189
CD
75352009-10-10 Chris Demetriou <cgd@google.com>
7536
7537 * options.h (Input_file_argument::Input_file_type): New enum.
7538 (Input_file_argument::is_lib_): Replace with...
7539 (Input_file_argument::type_): New member.
7540 (Input_file_argument::Input_file_argument): Take Input_file_type
7541 'type' rather than boolean 'is_lib' as second argument.
7542 (Input_file_argument::is_lib): Use type_.
7543 (Input_file_argument::is_searched_file): New function.
7544 (Input_file_argument::may_need_search): Handle is_searched_file.
7545 * options.cc (General_options::parse_library): Support -l:filename.
7546 (General_options::parse_just_symbols): Update for Input_file_argument
7547 changes.
7548 (Command_line::process): Likewise.
7549 * archive.cc (Archive::get_file_and_offset): Likewise.
7550 * plugin.cc (Plugin_manager::release_input_file): Likewise.
7551 * script.cc (read_script_file, script_add_file): Likewise.
7552 * fileread.cc (Input_file::Input_file): Likewise.
7553 (Input_file::will_search_for): Handle is_searched_file.
7554 (Input_file::open): Likewise.
7555 * readsyms.cc (Read_symbols::get_name): Likewise.
7556 * testsuite/Makefile.am (searched_file_test): New test.
7557 * testsuite/Makefile.in: Regenerate.
7558 * testsuite/searched_file_test.cc: New file.
7559 * testsuite/searched_file_test_lib.cc: New file.
7560
f3048a1d
ILT
75612009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7562 Ian Lance Taylor <iant@google.com>
7563
7564 * descriptor.cc: Include <cstdio> and "binary-io.h".
7565 (Descriptors::open): Open the files in binary mode always.
7566 * script.cc (Lex::get_token): Treat \r as whitespace.
7567
d4780e57
ILT
75682009-10-09 Ian Lance Taylor <iant@google.com>
7569
7570 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
7571
d9a893b8
ILT
75722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7573 Ian Lance Taylor <iant@google.com>
7574
7575 * configure.ac: Check for readv function also.
7576 * fileread.cc (readv): Define if not HAVE_READV.
7577 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
7578 does not exist.
7579 * config.in: Regenerate.
7580 * configure: Regenerate.
7581
c0a62865
DK
75822009-10-09 Doug Kwan <dougkwan@google.com>
7583
7584 * layout.cc (Layout::make_output_section): Call target hook to make
7585 ordinary output section.
7586 (Layout::finalize): Adjust parameter list of call the
7587 Target::may_relax().
7588 * layout.h (class Layout::section_list): New method.
7589 * merge.h (Output_merge_base::entsize): Change visibility to public.
7590 (Output_merge_base::is_string, Output_merge_base::do_is_string):
7591 New methods.
7592 (Output_merge_string::do_is_string): New method.
7593 * object.cc (Sized_relobj::do_setup): renamed from
7594 Sized_relobj::set_up.
7595 * object.h (Sized_relobj::adjust_shndx,
7596 Sized_relobj::initializ_input_to_output_maps,
7597 Sized_relobj::free_input_to_output_maps): Change visibilities to
7598 protected.
7599 (Sized_relobj::setup): Virtualize.
7600 (Sized_relobj::do_setup): New method declaration.
7601 (Sized_relobj::invalidate_section_offset,
7602 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
7603 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
7604 * options.cc (parse_int): New function.
7605 * options.h (parse_int): New declaration.
7606 (DEFINE_int): New macro.
7607 (stub_group_size): New option.
7608 * output.cc (Output_section::Output_section): Initialize memebers
7609 merge_section_map_, merge_section_by_properties_map_,
7610 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
7611 (Output_section::add_input_section): Handled deferred code-fill
7612 generation and remove an old comment.
7613 (Output_section::add_relaxed_input_section): New method definition.
7614 (Output_section::add_merge_input_section): Use merge section by
7615 properties map to speed to search. Update merge section maps
7616 as appropriate.
7617 (Output_section::build_relaxation_map): New method definition.
7618 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7619 Same.
7620 (Output_section::relax_input_section): Renamed to
7621 Output_section::convert_input_sections_to_relaxed_sections and change
7622 interface to take a vector of pointers to relaxed sections.
7623 (Output_section::find_merge_section,
7624 Output_section::find_relaxed_input_section): New method definitions.
7625 (Output_section::is_input_address_mapped,
7626 Output_section::output_offset, Output_section::output_address):
7627 Use output section data maps to speed up searching.
7628 (Output_section::find_starting_output_address): Add comments.
7629 (Output_section::do_write,
7630 Output_section::write_to_postprocessing_buffer): Do code-fill
7631 generation as appropriate.
7632 (Output_section::get_input_sections): Invalidate relaxed input section
7633 map.
7634 (Output_section::restore_states): Adjust type of checkpoint .
7635 Invalidate relaxed input section map.
7636 * output.h (Output_merge_base): New class declaration.
7637 (Input_section_specifier): New class defintion.
7638 (class Output_relaxed_input_section) Change base class to
7639 Output_section_data_build.
7640 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
7641 base class initializer.
7642 (Output_section::add_relaxed_input_section): New method declaration.
7643 (Output_section::Input_section): Change visibility to protected.
7644 (Output_section::Input_section::relobj,
7645 Output_section::Input_section::shndx): Handle relaxed input sections.
7646 Output_section::input_sections) Change visibility to protected. Also
7647 define overload to return a non-const pointer.
7648 (Output_section::Merge_section_properties): New class defintion.
7649 (Output_section::Merge_section_by_properties_map,
7650 Output_section::Output_section_data_by_input_section_map,
7651 Output_section::Relaxation_map): New types.
7652 (Output_section::relax_input_section): Rename method to
7653 Output_section::convert_input_sections_to_relaxed_sections and change
7654 interface to take a vector of relaxed section pointers.
7655 (Output_section::find_merge_section,
7656 Output_section::find_relaxed_input_section,
7657 Output_section::build_relaxation_map,
7658 Output_section::convert_input_sections_in_list_to_relaxed_sections):
7659 New method declarations.
7660 (Output_section::merge_section_map_
7661 Output_section::merge_section_by_properties_map_,
7662 Output_section::relaxed_input_section_map_,
7663 Output_section::is_relaxed_input_section_map_valid_,
7664 Output_section::generate_code_fills_at_write_): New data members.
7665 * script-sections.cc
7666 (Output_section_element_input::set_section_addresses): Call
7667 current_data_size and addralign methods of relaxed input sections.
7668 (Orphan_output_section::set_section_addresses): Call current_data_size
7669 and addralign methods of relaxed input sections.
7670 * symtab.cc (Symbol_table::compute_final_value): Extract template
7671 from the body of Symbol_table::sized_finalize_symbol.
7672 (Symbol_table::sized_finalized_symbol): Call
7673 Symbol_table::compute_final_value.
7674 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
7675 (Symbol_table::compute_final_value): New templated method declaration.
7676 * target.cc (Target::do_make_output_section): New method defintion.
7677 * target.h (Target::make_output_section): New method declaration.
7678 (Target::relax): Add more parameters for input objects, symbol table
7679 and layout. Adjust call to do_relax.
7680 (Target::do_make_output_section): New method declaration.
7681 (Target::do_relax): Add parameters for input objects, symbol table
7682 and layout.
7683
d446d6c4
ILT
76842009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7685
7686 * pread.c: Include stdio.h.
7687
bc06c745
ILT
76882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7689
7690 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
7691 defined.
7692
75aea3d0
ILT
76932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
7694
7695 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7696 Change read_shndx type to unsigned int.
7697 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7698 int.
7699 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7700 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
7701 Change read_shndx type to unsigned int.
7702 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
7703 int.
7704 (Sized_dwarf_line_info::read_line_mappings): Likewise.
7705 * layout.cc (Layout::create_symtab_sections): Cast the result of
7706 local_symcount * symsize to off_t in the gold_assert.
7707
be8fcb75
ILT
77082009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7709
7710 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
7711 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
7712 R_ARM_BASE_ABS.
7713 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
7714 (Arm_relocate_functions::thm_abs5): New function.
7715 (Arm_relocate_functions::abs12): New function.
7716 (Arm_relocate_functions::abs16): New function.
7717 (Arm_relocate_functions::base_abs): New function.
7718 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
7719 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
7720 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
7721 R_ARM_BASE_ABS.
7722 (Scan::global): Likewise.
7723 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
7724 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
7725 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
7726 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
7727 R_ARM_BASE_ABS.
7728
c2a122b6
ILT
77292009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7730
7731 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
7732 (Arm_relocate_functions::movt_prel): New function.
7733 (Arm_relocate_functions::thm_movw_prel_nc): New function.
7734 (Arm_relocate_functions::thm_movt_prel): New function.
7735 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
7736 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
7737 (Scan::global, Relocate::relocate): Likewise.
7738 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7739
c4aa1e2d
ILT
77402009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7741
7742 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
7743 Incremental_checker.
7744 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
7745 unsigned int.
7746 (class Incremental_inputs_header): New class.
7747 (Incremental_inputs_header_writer): Edit comment.
7748 (Incremental_inputs_entry): New class.
7749 (Incremental_inputs_entry_writer): Edit comment.
7750 (Sized_incremental_binary::do_find_incremental_inputs_section):
7751 Add *strtab_shndx parameter, fill it.
7752 (Sized_incremental_binary::do_check_inputs): New method.
7753 (Incremental_checker::can_incrementally_link_output_file): Use
7754 Sized_incremental_binary::check_inputs.
7755 (Incremental_inputs::report_command_line): Save command line in
7756 command_line_.
7757 * incremental.h:
7758 (Incremental_binary::find_incremental_inputs_section): New
7759 method.
7760 (Incremental_binary::do_find_incremental_inputs_section): Add
7761 strtab_shndx parameter.
7762 (Incremental_binary::do_check_inputs): New pure virtual method.
7763 (Sized_incremental_binary::do_check_inputs): Declare.
7764 (Incremental_checker::Incremental_checker): Add incremental_inputs
7765 parameter, use it to initialize incremental_inputs_.
7766 (Incremental_checker::incremental_inputs_): New field.
7767 (Incremental_checker::command_line): New method.
7768 (Incremental_checker::inputs): New method.
7769 (Incremental_checker::command_line_): New field.
7770
c549a694
ILT
77712009-10-09 Mikolaj Zalewski <mikolajz@google.com>
7772
7773 * incremental.cc: Include <cstdarg> and "target-select.h".
7774 (vexplain_no_incremental): New function.
7775 (explain_no_incremental): New function.
7776 (Incremental_binary::error): New method.
7777 (Sized_incremental_binary::do_find_incremental_inputs_section): New
7778 method.
7779 (make_sized_incremental_binary): New function.
7780 (open_incremental_binary): New function.
7781 (can_incrementally_link_file): Add checks if output is ELF and has
7782 inputs section.
7783 * incremental.h: Include "elfcpp_file.h" and "output.h".
7784 (Incremental_binary): New class.
7785 (Sized_incremental_binary): New class.
7786 (open_incremental_binary): Declare.
7787 * object.cc (is_elf_object): Use
7788 elfcpp::Elf_recognizer::is_elf_file.
7789 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7790 * output.h (Output_file::filesize): New method.
7791
fd3c5f0b
ILT
77922009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7793
7794 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7795 New function.
7796 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7797 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7798 function.
7799 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7800 function.
7801 (Arm_relocate_functions::movw_abs_nc): New function.
7802 (Arm_relocate_functions::movt_abs): New function.
7803 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7804 (Arm_relocate_functions::thm_movt_abs): New function.
7805 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7806 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7807 (Scan::global): Likewise.
7808 (Relocate::relocate): Likewise.
7809 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7810
7f5309a5
ILT
78112009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7812
7813 * arm.cc (Arm_relocate_functions::got_prel) New function.
7814 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7815 (Relocate::relocate): Likewise.
7816 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7817
364c7fa5
ILT
78182009-10-06 Ian Lance Taylor <iant@google.com>
7819
7820 * options.h (class General_options): Define
7821 split_stack_adjust_size parameter.
7822 * object.h (class Object): Add uses_split_stack_ and
7823 has_no_split_stack_ fields. Add uses_split_stack and
7824 has_no_split_stack accessor functions. Declare
7825 handle_split_stack_section.
7826 (class Reloc_symbol_changes): Define.
7827 (class Sized_relobj): Define Function_offsets. Declare
7828 split_stack_adjust, split_stack_adjust_reltype, and
7829 find_functions.
7830 * object.cc (Object::handle_split_stack_section): New function.
7831 (Sized_relobj::do_layout): Call handle_split_stack_section.
7832 * dynobj.cc (Sized_dynobj::do_layout): Call
7833 handle_split_stack_section.
7834 * reloc.cc (Sized_relobj::relocate_sections): Call
7835 split_stack_adjust for executable sections in split_stack
7836 objects. Pass reloc_map to relocate_section.
7837 (Sized_relobj::split_stack_adjust): New function.
7838 (Sized_relobj::split_stack_adjust_reltype): New function.
7839 (Sized_relobj::find_functions): New function.
7840 * target-reloc.h: Include "object.h".
7841 (relocate_section): Add reloc_symbol_changes parameter. Change
7842 all callers.
7843 * target.h (class Target): Add calls_non_split method. Declare
7844 do_calls_non_split virtual method. Declare match_view and
7845 set_view_to_nop.
7846 * target.cc: Include "elfcpp.h".
7847 (Target::do_calls_non_split): New function.
7848 (Target::match_view): New function.
7849 (Target::set_view_to_nop): New function.
7850 * gold.cc (queue_middle_tasks): Give an error if mixing
7851 split-stack and non-split-stack objects with -r.
7852 * i386.cc (Target_i386::relocate_section): Add
7853 reloc_symbol_changes parameter.
7854 (Target_i386::do_calls_non_split): New function.
7855 * x86_64.cc (Target_x86_64::relocate_section): Add
7856 reloc_symbol_changes parameter.
7857 (Target_x86_64::do_calls_non_split): New function.
7858 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7859 parameter.
7860 * powerpc.cc (Target_powerpc::relocate_section): Add
7861 reloc_symbol_changes parameter.
7862 * sparc.cc (Target_sparc::relocate_section): Add
7863 reloc_symbol_changes parameter.
7864 * configure.ac: Call AM_CONDITIONAL for the default target.
7865 * configure: Rebuild.
7866 * testsuite/Makefile.am (TEST_AS): New variable.
7867 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7868 (check_DATA): Add split_i386 and split_x86_64 files.
7869 (SPLIT_DEFSYMS): Define.
7870 (split_i386_[1234n].o): New targets.
7871 (split_i386_[124]): New targets.
7872 (split_i386_[1234r].stdout): New targets.
7873 (split_x86_64_[1234n].o): New targets.
7874 (split_x86_64_[124]): New targets.
7875 (split_x86_64_[1234r].stdout): New targets.
7876 (MOSTLYCLEANFILES): Add new executables.
7877 * testsuite/split_i386.sh: New file.
7878 * testsuite/split_x86_64.sh: New file.
7879 * testsuite/split_i386_1.s: New file.
7880 * testsuite/split_i386_2.s: New file.
7881 * testsuite/split_i386_3.s: New file.
7882 * testsuite/split_i386_4.s: New file.
7883 * testsuite/split_i386_n.s: New file.
7884 * testsuite/split_x86_64_1.s: New file.
7885 * testsuite/split_x86_64_2.s: New file.
7886 * testsuite/split_x86_64_3.s: New file.
7887 * testsuite/split_x86_64_4.s: New file.
7888 * testsuite/split_x86_64_n.s: New file.
7889 * testsuite/testfile.cc (Target_test): Update relocation_section
7890 function.
7891 * testsuite/Makefile.in: Rebuild.
7892
e8a9fcda
ILT
78932009-10-06 Ian Lance Taylor <iant@google.com>
7894
7895 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7896 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7897 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7898 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7899 the address on ldo_addrs_.
7900 (Target_i386::Relocate::fix_up_ldo): New function.
7901
e99daf92
ILT
79022009-10-06 Rafael Espindola <espindola@google.com>
7903
7904 * plugin.cc (add_input_library): New.
7905 (Plugin::load): Add add_input_library to tv.
7906 (Plugin_manager::add_input_file): Add the is_lib argument.
7907 (add_input_file): Update call to Plugin_manager::add_input_file.
7908 (add_input_library): New.
7909 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7910
966d4097
DK
79112009-09-30 Doug Kwan <dougkwan@google.com>
7912
7913 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7914 symbol and call Symbol::may_need_copy_reloc to determine if
7915 a copy reloc is needed.
7916 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7917 nocopyreloc is given in command line.
7918 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7919 given in command line.
7920 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7921 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7922 of the removed Target_i386::may_need_copy_reloc.
7923 * options.h (copyreloc): New option with default value false.
7924 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7925 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7926 instead of the removed Target_powerpc::may_need_copy_reloc.
7927 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7928 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7929 instead of the removed Target_sparc::may_need_copy_reloc.
7930 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7931 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7932 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7933 instead of the removed Target_x86_64::may_need_copy_reloc.
7934
029ba973
ILT
79352009-09-30 Ian Lance Taylor <iant@google.com>
7936
7937 * object.h (class Object): Remove target_ field, and target,
7938 sized_target, and set_target methods.
7939 (Object::sized_target): Remove.
7940 (class Sized_relobj): Update declarations. Remove sized_target.
7941 * object.cc (Sized_relobj::setup): Remove target parameter.
7942 Change all callers.
7943 (Input_objects::add_object): Don't do anything with the target.
7944 (make_elf_sized_object): Add punconfigured parameter. Change all
7945 callers. Set or test parameter target.
7946 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7947 Change all callers.
7948 * parameters.cc (Parameters::set_target): Change parameter type to
7949 be non-const.
7950 (Parameters::default_target): Remove.
7951 (set_parameters_target): Change parameter type to be non-const.
7952 (parameters_force_valid_target): New function.
7953 (parameters_clear_target): New function.
7954 * parameters.h (class Parameters): Update declarations. Remove
7955 default_target method. Add sized_target and clear_target
7956 methods. Change target_ to be non-const.
7957 (set_parameters_target): Update declaration.
7958 (parameters_force_valid_target): Declare.
7959 (parameters_clear_target): Declare.
7960 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7961 as NULL if we aren't searching.
7962 (Add_symbols::run): Don't check for compatible target.
7963 * fileread.cc (Input_file::open_binary): Call
7964 parameters_force_valid_target.
7965 * gold.cc (queue_middle_tasks): Likewise.
7966 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7967 set_target on object.
7968 * dynobj.h (class Sized_dynobj): Update declarations.
7969 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7970 make_elf_object returns NULL.
7971 (Archive::include_member): Don't check whether object target is
7972 compatible.
7973 * output.cc (Output_section::add_input_section): Get target from
7974 parameters.
7975 (Output_section::relax_input_section): Likewise.
7976 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7977 parameters.
7978 (Sized_relobj::do_scan_relocs): Likewise.
7979 (Sized_relobj::relocate_sections): Likewise.
7980 * resolve.cc (Symbol_table::resolve): Likewise.
7981 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7982 parameter. Change all callers.
7983 (Symbol_table::add_from_object): Get target from parameters.
7984 (Symbol_table::add_from_relobj): Don't check object target.
7985 (Symbol_table::add_from_dynobj): Likewise.
7986 (Symbol_table::define_special_symbol): Get target from
7987 parameters.
7988 * symtab.h (class Symbol_table): Update declaration.
7989 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7990 parameter. Change all callers. Clear parameter target.
7991 (Binary_test): Test target here.
7992 * testsuite/object_unittest.cc (gold_testsuite): Remove
7993 target_test_pointer parameter. Change all callers.
7994 (Object_test): Test target here.
7995
a6a22b83
ILT
79962009-09-26 Ian Lance Taylor <iant@google.com>
7997
7998 * testsuite/initpri1.c: Don't try to use constructor priorities if
7999 compiling with gcc before 4.3.
8000
6a8f49fe
ILT
80012009-09-22 Mikolaj Zalewski <mikolajz@google.com>
8002
8003 * testsuite/retain_symbols_file_test.sh (check_present): Change
8004 output file name to retain_symbols_file_test.stdout.
8005 (check_absent): Likewise.
8006
8c604651
CS
80072009-09-18 Craig Silverstein <csilvers@google.com>
8008
8009 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
8010 * options.cc: Include <cerrno> and <fstream>.
8011 (General_options::finalize): Parse -retain-symbols-file tag.
8012 * options.h: New flag.
8013 (General_options): New method should_retain_symbol, new
8014 variable symbols_to_retain.
8015 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
8016 should_retain_symbol map.
8017 * testsuite/Makefile.am (retain_symbols_file_test): New test.
8018 * testsuite/Makefile.in: Regenerate.
8019 * testsuite/retain_symbols_file_test.sh: New file.
8020
ca58b19f
NC
80212009-09-18 Nick Clifton <nickc@redhat.com>
8022
8023 * po/es.po: Updated Spanish translation.
8024
20e6d0d6
DK
80252009-09-17 Doug Kwan <dougkwan@google.com>
8026
8027 * debug.h (DEBUG_RELAXATION): New constant.
8028 (DEBUG_ALL): Add DEBUG_RELAXATION.
8029 (debug_string_to_enum): Add relaxation debug option.
8030 * layout.cc
8031 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
8032 Layout::Relaxation_debug_check::read_sections,
8033 Layout::Relaxation_debug_check::read_sections): New method definitions.
8034 (Layout::Layout): Initialize data members
8035 record_output_section_data_from_scrips_,
8036 script_output_section_data_list_ and relaxation_debug_check_.
8037 (Layout::save_segments, Layout::restore_segments,
8038 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8039 Layout::relaxation_loop_body): New method definitions.
8040 (Layout::finalize): Support relaxation. Move section layout code to
8041 Layout::relaxation_loop_body.
8042 (Layout::set_asection_address_from_script): Move code for orphan
8043 section placement out.
8044 (Layout::place_orphan_sections_in_script): New method definition.
8045 * layout.h (Output_segment_headers, Output_file_header):
8046 New forward class declarations.
8047 (Layout::~Layout): Define.
8048 (Layout::new_output_section_data_from_script): New method definition.
8049 (Layout::place_orphan_sections_in_script): New method declaration.
8050 (Layout::Segment_states): New type declaration.
8051 (Layout::save_segments, Layout::restore_segments,
8052 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
8053 Layout::relaxation_loop_body): New method declarations.
8054 (Layout::Output_section_data_list): New type declaration.
8055 (Layout::Relaxation_debug_check): New class definition.
8056 (Layout::record_output_section_data_from_script_,
8057 Layout::script_output_section_data_list_, Layout::segment_states_,
8058 Layout::relaxation_debug_check_): New data members.
8059 * output.cc: (Output_section_headers::do_size): New method definition.
8060 (Output_section_headers::Output_section_headers): Move size
8061 computation to Output_section_headers::do_size.
8062 (Output_segment_headers::do_size): New method definition.
e1df38aa 8063 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
8064 Output_file_header::do_size and call it.
8065 (Output_file_header::do_size): New method definition.
8066 (Output_data_group::Output_data_group): Adjust call to
8067 Output_section_data.
8068 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
8069 (Output_symtab_xindex::do_write): Add array bound check.
8070 (Output_section::Input_section::print_to_mapfile): Handle
8071 RELAXED_INPUT_SECTION_CODE.
8072 (Output_section::Output_section): Initialize data member checkpoint_.
8073 (Output_section::~Output_section): Delete checkpoint object pointed
8074 by checkpoint_.
8075 (Output_section::add_input_section): Always add an Input_section if
8076 relaxing.
8077 (Output_section::add_merge_input_section): Add assert.
8078 (Output_section::relax_input_section): New method definition.
8079 (Output_section::set_final_data_size): Set load address to zero for
8080 an unallocated section.
8081 (Output_section::do_address_and_file_offset_have_reset_values):
8082 New method definition.
8083 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
8084 Handle relaxed input section.
8085 (Output_section::sort_attached_input_sections): Checkpoint input
8086 section list lazily.
8087 (Output_section::get_input_sections): Change type of input_sections to
8088 list of Simple_input_section pointers. Checkpoint input section list
8089 lazily. Also handle relaxed input sections.
8090 (Output_section::add_input_section_for_script): Take a reference to
8091 a Simple_input_section object instead of Relobj pointer and section
8092 index as parameter. Handle relaxed input sections.
8093 (Output_section::save_states, Output_section::restore_states): New
8094 method definitions.
8095 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
8096 (Output_data::is_data_size_fixed): New method definition.
8097 (Output_data::reset_addresss_and_file_offset): Do not reset data size
8098 if it is fixed.
8099 (Output_data::address_and_file_offset_have_reset_values): New method
8100 definition.
8101 (Output_data::do_address_and_file_offset_have_reset_values): New method
8102 definition.
8103 (Output_data::set_data_size): Check that data size is not fixed.
8104 (Output_data::fix_data_size): New method definition.
8105 (Output_data::is_data_size_fixed_): New data member.
8106 (Output_section_headers::set_final_data_size): New method definition.
8107 (Output_section_headers::do_size): New method declaration.
8108 (Output_segment_headers::set_final_data_size): New method definition.
8109 (Output_segment_headers::do_size): New method declaration.
8110 (Output_file_header::set_final_data_size)::New method definition.
8111 (Output_file_header::do_size)::New method declaration.
8112 (Output_section_data::Output_section_data): Add new parameter
8113 is_data_size_fixed and use it to fix data size.
8114 (Output_data_const::Output_data_const): Adjust call to base class
8115 constructor and fix data size.
8116 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
8117 base class constructor and fix data size.
8118 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
8119 base class constructor and fix data size.
8120 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
8121 class constructor and fix data size.
8122 (Output_data_group::set_final_data_size): New method definition.
8123 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
8124 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
8125 class constructor and fix data size.
8126 (Output_relaxed_input_section): New class definition.
8127 (Output_section::Simple_input_section): New class definition.
8128 (Output_section::get_input_sections): Adjust parameter list.
8129 (Output_section::add_input_section_for_script): Same.
8130 (Output_section::save_states, Output_section::restore_states,
8131 Output_section::do_address_and_file_offset_have_reset_values,
8132 (Output_section::Input_section::Input_section): Handle
8133 RELAXED_INPUT_SECTION_CODE. Add new overload for
8134 Output_relaxed_input_section.
8135 (Output_section::Input_section::is_input_section,
8136 Output_section::Input_section::set_output_section): Handle relaxed
8137 input section.
8138 (Output_section::Input_section::is_relaxed_input_section,
8139 Output_section::Input_section::output_section_data,
8140 Output_section::Input_section::relaxed_input_section): New method
8141 definitions.
8142 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
8143 value.
8144 (Output_section::Input_section::u1_): Update comments.
8145 (Output_section::Input_section::u2_): Add new union member poris.
8146 (Output_section::Checkpoint_output_section): New classs definition.
8147 (Output_section::relax_input_section): New method declaration.
8148 (Output_section::checkpoint_): New data member.
8149 (Output_segment): Update comments.
8150 (Output_segment::Output_segment): Un-privatize copy constructor.
8151 (Output_segment::operator=): Un-privatize.
8152 * script-sections.cc (Output_section_element::Input_section_list):
8153 Change element type to Output_section::Simple_input_section.
8154 (Output_section_element_dot_assignment::set_section_addresses):
8155 Register output section data for relaxation clean up.
8156 (Output_data_exression::Output_data_expression): Adjust call to base
8157 constructor to fix data size.
8158 (Output_section_element_data::set_section_addresses): Register
8159 Output_data_expression object for relaxation clean up.
8160 (struct Input_section_info): Replace Relobj pointer and section index
8161 pair with Output_section::Simple_input_section and Convert struct to a
8162 class.
8163 (Input_section_sorter::operator()): Adjust access to
e1df38aa 8164 Input_section_info data member to use accessors.
20e6d0d6
DK
8165 (Output_section_element_input::set_section_addresses): Use layout
8166 parameter. Adjust code to use Output_section::Simple_input_section
8167 and Input_secction_info classes. Register filler for relaxation
8168 clean up.
8169 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
8170 and section index pair with Output_section::Simple_input_section
8171 class. Adjust code accordingly.
8172 (Phdrs_element::release_segment): New method definition.
8173 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
8174 segment list.
8175 (Script_sections::release_segments): New method definition.
8176 * gold/script-sections.h (Script_sections::release_segments): New
8177 method declaration.
8178 * gold/target.h (Target::may_relax, Target::relax,
8179 Target::do_may_relax, Target::do_relax): New method definitions.
8180
5e445df6
ILT
81812009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8182
8183 * arm.cc (has_signed_unsigned_overflow): New function.
8184 (Arm_relocate_functions::abs8): New function.
8185 (Target_arm::Scan::local): Handle R_ARM_ABS8.
8186 (Target_arm::Scan::global): Likewise.
8187 (Target_arm::relocate::relocate): Likewise.
8188 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8189 Likewise.
8190
8c604651 81912009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
8192
8193 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
8194 * testsuite/Makefile.in: Regenerate.
8195
1e9cc1c2
NC
81962009-09-11 Nick Clifton <nickc@redhat.com>
8197
8198 * po/gold.pot: Updated by the Translation project.
8199
6a89f575
CC
82002009-09-08 Cary Coutant <ccoutant@google.com>
8201
8202 * output.cc (Output_file::open): Add execute permission to empty file.
8203 * testsuite/Makefile.am (permission_test): New test.
8204 * testsuite/Makefile.in: Regenerate.
8205
fdcac5af
ILT
82062009-09-02 Ian Lance Taylor <iant@google.com>
8207
8208 * output.cc (Output_file::resize): Call map_no_anonymous rather
8209 than map.
8210
44453f85
ILT
82112009-09-01 Mikolaj Zalewski <mikolajz@google.com>
8212
8213 * gold.cc: Include "incremental.h".
8214 (queue_initial_tasks): Call Incremental_checker methods.
8215 * incremental.cc: Include "output.h".
8216 (Incremental_checker::can_incrementally_link_output_file): New
8217 method.
8218 * incremental.h (Incremental_checker): New class.
8219
8220 * output.cc (Output_file::open_for_modification): New method.
8221 (Output_file::map_anonymous): Changed return type to bool. Record
8222 map in base_ field.
8223 (Output_file::map_no_anonymous): New method, broken out of map.
8224 (Output_file::map): Use map_no_anonymous and map_anonymous.
8225 * output.h (class Output_file): Update declarations.
8226
293c1386
CC
82272009-08-24 Cary Coutant <ccoutant@google.com>
8228
8229 * options.h (Command_line::Pre_options): New class.
8230 (Command_line::pre_options): New member.
8231 * options.cc (gold::options::ready_to_register): New variable.
8232 (One_option::register_option): Do nothing if not registering options.
8233 Assert if same short option registered twice.
8234 (General_options::General_options): Turn off option registration when
8235 done constructing.
8236 (Command_line::Pre_options::Pre_options): New constructor.
8237
f773f3d2
CC
82382009-08-24 Cary Coutant <ccoutant@google.com>
8239
06a73cfe
CC
8240 * options.h (General_options::no_keep_memory): Remove incorrect
8241 short option.
f773f3d2 8242
a15af8e2
RW
82432009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8244
8245 * Makefile.am (am__skiplex, am__skipyacc): New.
8246 * Makefile.in: Regenerate.
8247
c462b41b
RW
82482009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8249
14ec8efd
RW
8250 * Makefile.am (AM_CPPFLAGS): Renamed from ...
8251 (INCLUDES): ... this.
8252 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
8253 (AM_CPPFLAGS): Renamed from ...
8254 (INCLUDE): ... this.
8255 * Makefile.in, testsuite/Makefile.in: Regenerate.
8256
81ecdfbb
RW
8257 * Makefile.in: Regenerate.
8258 * aclocal.m4: Likewise.
8259 * config.in: Likewise.
8260 * configure: Likewise.
8261 * testsuite/Makefile.in: Likewise.
8262
c462b41b
RW
8263 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8264 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
8265 * Makefile.in: Regenerate.
8266 * testsuite/Makefile.in: Regenerate.
8267
2da73f13
CC
82682009-08-19 Cary Coutant <ccoutant@google.com>
8269
8270 * resolve.cc (Symbol_table::resolve): Don't complain about defined
8271 symbols in shared libraries overridden by hidden or internal symbols
8272 in the main program.
8273
2db70501
CD
82742009-08-19 Chris Demetriou <cgd@google.com>
8275
8276 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
8277 checking source file names in error messages.
8278
f733487b
DK
82792009-08-18 Doug Kwan <dougkwan@google.com>
8280
8281 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
8282 an elcpp::Ehdr as parameter. Adjust call to set_target.
8283 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
8284 an elfcpp::Ehdr as parameter.
8285 * object.cc (Object::set_target): Remove the version that looks up
8286 a target and sets it.
8287 (Sized_relobj::setup): Take a Target object instead of
8288 an elfcpp::Ehdr as parameter. Adjust call to set_target.
8289 (make_elf_sized_object): Find target and ask target to
8290 make an ELF object.
8291 * object.h: (Object::set_target): Remove the version that looks up
8292 a target and sets it.
8293 (Sized_relobj::setup): Take a Target object instead of
8294 an elfcpp:Ehdr as parameter.
8295 * target.cc: Include dynobj.h.
8296 (Target::do_make_elf_object_implementation): New.
8297 (Target::do_make_elf_object): New.
8298 * target.h (Target::make_elf_object): New template declaration.
8299 (Target::do_make_elf_object): New method declarations.
8300 (Target::do_make_elf_object_implementation): New template declaration.
8301
cc70f101
ILT
83022009-08-14 Ian Lance Taylor <iant@google.com>
8303
8304 * gold.h (FUNCTION_NAME): Define.
8305 (gold_unreachable): Use FUNCTION_NAME.
8306
ef5e0cb1
ST
83072009-08-12 Sriraman Tallam <tmsriram@google.com>
8308
8309 * icf.cc (Icf::find_identical_sections): Issue a warning when a
8310 symbol in the --keep-unique list is not found.
8311
48c187ce
ST
83122009-08-12 Sriraman Tallam <tmsriram@google.com>
8313
8314 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
8315 been maked as --keep-unique.
8316 (Icf::unfold_section): New function.
8317 * icf.h (Icf::unfold_section): New function.
8318 * options.h (General_options::keep_unique): New option.
8319 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
8320 * testsuite/Makefile.in: Regenerate.
8321 * testsuite/icf_keep_unique_test.sh: New file.
8322 * testsuite/icf_keep_unique_test.cc: New file.
8323
645afe0c
CC
83242009-08-12 Cary Coutant <ccoutant@google.com>
8325
8326 PR 10471
8327 * resolve.cc (Symbol_table::resolve): Check for references from
8328 dynamic objects to hidden and internal symbols.
8329 * testsuite/Makefile.am (hidden_test.sh): New test.
8330 * testsuite/Makefile.in: Regenerate.
8331 * testsuite/hidden_test.sh: New script.
8332 * testsuite/hidden_test_1.c: New test source.
8333 * testsuite/hidden_test_main.c: New test source.
8334
11af873f
DK
83352009-08-11 Doug Kwan <dougkwan@google.com>
8336
8337 * arm.cc: Update comments.
8338 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
8339 segment to locate the .ARM.exidx section if present.
8340
b9f7d72d
DK
83412009-08-09 Doug Kwan <dougkwan@google.com>
8342
8343 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
8344 patch.
8345
ddd3c53c
ST
83462009-08-07 Sriraman Tallam <tmsriram@google.com>
8347 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
8348 compiler warnings.
8349
27721062
ST
83502009-08-06 Sriraman Tallam <tmsriram@google.com>
8351
8352 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
8353 valid tls_segment only for non-debug-section relocations.
8354 * testsuite/Makefile.am: Add gc_tls_test.
8355 * testsuite/Makefile.in: Regenerate.
8356 * testsuite/gc_tls_test.cc: New file.
8357 * testsuite/gc_tls_test.sh: New file.
8358
ef15dade 83592009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 8360
ef15dade
ST
8361 * icf.cc: New file.
8362 * icf.h: New file.
8363 * Makefile.am (CCFILES): Add icf.cc.
8364 (HFILES): Add icf.h
8365 * Makefile.in: Regenerate.
8366 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
8367 * gc.h (gc_process_relocs): Populate lists used by icf to contain
8368 section, symbol and addend information for the relocs.
8369 * gold.cc (queue_middle_tasks): Call identical code folding.
8370 * gold.h: Add defines for multimap.
8371 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
8372 to the call of finalize_local_symbols.
8373 * main.cc (main): Create object of class Icf.
8374 * object.cc (Sized_relobj::do_layout): Allow this function to be
8375 called twice during icf.
8376 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
8377 to sections marked as identical by icf.
8378 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
8379 when available.
8380 (Sized_relobj::do_section_entsize): New function.
8381 * object.h (Object::section_entsize): New function.
8382 (Object::do_section_entsize): New pure virtual function.
8383 (Relobj::finalize_local_symbols): Add new parameter.
8384 (Relobj::do_section_entsize): New function.
8385 * options.h (General_options::icf): New option.
8386 (General_options::icf_iterations): New option.
8387 (General_options::print_icf_sections): New option.
8388 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
8389 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
8390 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
8391 icf.
8392 * symtab.cc (Symbol_table::is_section_folded): New function.
8393 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
8394 to sections marked as identical by icf.
8395 * symtab.h (Symbol_table::set_icf): New function.
8396 (Symbol_table::icf): New function.
8397 (Symbol_table::is_section_folded): New function.
8398 (Symbol_table::icf_): New data member.
8399 * target-reloc.h (relocate_section): Ignore sections folded by icf.
8400 * testsuite/Makefile.am: Add commands to build icf_test.
8401 * testsuite/Makefile.in: Regenerate.
8402 * testsuite/icf_test.sh: New file.
8403 * testsuite/icf_test.cc: New file.
8404
c3b65ac4
CD
84052009-07-24 Chris Demetriou <cgd@google.com>
8406
8407 * layout.cc (is_compressible_debug_section): Fix incorrect
8408 comment about compressed section names.
8409
1caf2c51
ILT
84102009-07-20 Ian Lance Taylor <ian@airs.com>
8411
8412 PR 10419
8413 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
8414
1ef4d87f
ILT
84152009-07-16 Ian Lance Taylor <iant@google.com>
8416
8417 PR 10400
8418 * layout.h: #include <map>.
8419 (class Kept_section): Change from struct to class. Add accessors
8420 and setters. Add section size to Comdat_group mapping. Change
8421 Comdat_group to std::map. Add is_comdat_ field. Add
8422 linkonce_size field in union.
8423 (class Layout): Update declaration of find_or_add_kept_section.
8424 Don't declare find_kept_object.
8425 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
8426 parameter. Add object, shndx, is_comdat, and is_group_name
8427 parameters. Change all callers. Adjust for new Kept_section.
8428 (Layout::find_kept_object): Remove.
8429 * object.cc (Sized_relobj::include_section_group): Update use of
8430 Kept_section. Rename secnum to shndx. Only record
8431 Kept_comdat_section if sections are the same size.
8432 (Sized_relobj::include_linkonce_section): Update use of
8433 Kept_section. Only record Kept_comdat_section if sections are the
8434 same size. Set size of linkonce section.
8435 (Sized_relobj::map_to_kept_section): Update call to
8436 get_kept_comdat_section.
8437 * object.h (class Sized_relobj): Rename fields in
8438 Kept_comdat_section to drop trailing underscores; change object
8439 field to Relobj*. Change Kept_comdat_section_table to store
8440 struct rather than pointer.
8441 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
8442 Add kept_object and kept_shndx parameters. Change all callers.
8443 (Sized_relobj::get_kept_comdat_section): Change return type to
8444 bool. Add kept_object and kept_shndx parameters. Change all
8445 callers.
8446 * plugin.cc (Pluginobj::include_comdat_group): Update call to
8447 Layout::find_or_add_kept_section.
8448
37c3b7b0
ILT
84492009-07-09 Ian Lance Taylor <iant@google.com>
8450
8451 * merge.cc (Object_merge_map::initialize_input_to_output_map):
8452 Reserve space in the hash table.
8453
98fa85cb
ILT
84542009-07-06 Mikolaj Zalewski <mikolajz@google.com>
8455
8456 * fileread.cc (File_read::get_mtime): New method.
8457 * fileread.h (Timespec): New structure.
8458 (File_read::get_mtime): New method.
8459 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
8460 Renamed from timestamp_nsec.
8461 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
8462 Elf_Xword.
e1df38aa 8463 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 8464 timestamp_nsec.
e1df38aa 8465 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
8466 (Incremental_inputs::report_obejct): Save mtime; style fix.
8467 (Incremental_inputs::report_script): Save mtime; style fix.
8468 (Incremental_inputs::finalize_inputs): Style fix.
8469 (Incremental_inputs::finalize): Style fix.
8470 (Incremental_inputs::create_input_section_data): Store inputs
8471 mtime.
8472 * incremental.h (Incremental_inputs::report_script): Add mtime
8473 argument.
8474 (Incremental_inputs::Input_info::Input_info): Intialize only one
8475 union member.
8476 (Incremental_inputs::Input_info::archive): Move to nameless
8477 union.
8478 (Incremental_inputs::Input_info::obejct): Move to nameless union.
8479 (Incremental_inputs::Input_info::script): Move to nameless union.
8480 (Incremental_inputs::mtime): New field.
8481 * script.cc (read_input_script): Pass file mtime to
8482 Incremental_input.
8483 * script.h (Script_info::inputs): Style fix.
8484
c9d70757
ILT
84852009-07-01 Ian Lance Taylor <ian@airs.com>
8486
8487 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
8488 instead of 32.
8489
9c547ec3
ILT
84902009-06-24 Ian Lance Taylor <iant@google.com>
8491
8492 PR 10156
8493 * layout.cc (Layout::choose_output_section): If we find an
8494 existing section, update the flags.
8495 (Layout::create_notes): New function, broken out of
8496 Layout::finalize.
8497 (Layout::finalize): Don't create note sections.
8498 (Layout::create_note): Don't crash if linker script discards
8499 section.
8500 (Layout::create_gold_note): Likewise.
8501 (Layout::create_build_id): Likewise. Don't set
8502 after_input_sections on the section.
8503 (Layout::create_executable_stack_info): Remove target parameter.
8504 Change caller.
8505 * layout.h (class Layout): Declare create_notes. Update
8506 declaration of create_executable_stack_info.
8507 * gold.cc (queue_middle_tasks): Call create_notes.
8508 * output.cc (Output_section::update_flags_for_input_section): Move
8509 here from output.h. If SHF_ALLOC flag is newly set, mark address
8510 invalid.
8511 * output.h (Output_data::mark_address_invalid): New function.
8512 (class Output_section): Only declare, not define,
8513 update_flags_for_input_section. Remove set_flags.
8514
55458500
ILT
85152009-06-24 Ian Lance Taylor <iant@google.com>
8516
8517 * script-sections.cc (Output_section_definition::
8518 set_section_addresses): Rename shadowing local load_address to
8519 laddr.
8520
1307d6cd
ILT
85212009-06-24 Ian Lance Taylor <iant@google.com>
8522
8523 PR 10244
8524 * reloc.cc (relocate_sections): Skip empty relocation sections.
8525
ec3f783e
ILT
85262009-06-23 Ian Lance Taylor <iant@google.com>
8527
8528 PR 10156
8529 * layout.cc (Layout::create_note): Use choose_output_section
8530 rather than make_output_section.
8531
459c9f1c
ILT
85322009-06-23 Ian Lance Taylor <iant@google.com>
8533
8534 PR 10237
8535 * options.cc (General_options::parse_V): Set printed_version_.
8536 (General_options::General_options): Initialize printed_version_.
8537 * options.h (class General_options): Add printed_version_ field.
8538 * gold.cc (queue_initial_tasks): If there are no input files,
8539 don't give a fatal error if we printed the version information.
8540 (queue_middle_tasks): If using -r with a shared object, give a
8541 fatal error rather than an ordinary error.
8542
1518dc8f
ILT
85432009-06-23 Ian Lance Taylor <iant@google.com>
8544
8545 PR 10219
8546 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
8547 (Layout::make_output_section): Set have_stabstr_section_ if we see
8548 a .stab*str section.
8549 (Layout::finalize): Call link_stabs_sections.
8550 (Layout::link_stabs_sections): New file.
8551 * layout.h (class Layout): Add have_stabstr_section_ field.
8552 Declare link_stabs_sections.
8553
3d857b98
DK
85542009-06-23 Doug Kwan <dougkwan@google.com>
8555
8556 * Makefile.am (libgold_a_LIBADD): New.
8557 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
8558 * Makefile.in: Regenerate.
8559 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
8560 * configure: Regenerate.
8561 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
8562 * fileread.cc: Include sys/state.h
8563 * gold.h: Declare memmem and strndup if found missing.
8564 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
8565
0639a6f6
ILT
85662009-06-23 Ian Lance Taylor <iant@google.com>
8567
8568 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
8569 * configure: Rebuild.
8570
8d63875c
ILT
85712009-06-23 Ian Lance Taylor <iant@google.com>
8572
8573 PR 10147
8574 * object.cc (Object::section_contents): Don't try to get a view if
8575 the section has length zero.
8576 (Object::handle_gnu_warning_section): If the section is empty, use
8577 the name of the section as the warning.
8578
f7c8a183
ILT
85792009-06-23 Ian Lance Taylor <iant@google.com>
8580
8581 PR 10133
8582 * stringpool.h (class Stringpool_template): Add optimize_ field.
8583 (Stringpool_template::set_optimize): New function.
8584 * stringpool.cc (Stringpool_template::Stringpool_template):
8585 Initialize optimize_ field.
8586 (Stringpool_template::set_string_offsets): Test local optimize
8587 fild rather than parameter.
8588 * layout.cc (Layout::Layout): Call set_optimize on the section
8589 name stringpool.
8590
e6a307ba
ILT
85912009-06-22 Ian Lance Taylor <iant@google.com>
8592
8593 PR 10030
8594 * yyscript.y: Parse TARGET.
8595 * script.cc (script_set_target): New function.
8596 * script-c.h (script_set_target): Declare.
8597 * options.cc (General_options::string_to_object_format): Rename
8598 from string_to_object_format in anonymous namespace. Change
8599 callers.
8600 * options.h (class General_options): Declare
8601 string_to_object_format.
8602
3ee173de
ILT
86032009-06-22 Ian Lance Taylor <iant@google.com>
8604
8605 * script-sections.cc (Script_sections::create_segments): Don't put
8606 program headers in a PT_LOAD segment if -n or -N.
8607
86082009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
8609
8610 PR 10141
8611 * options.h (class General_options): Add -z lazy and -z now. Sort
8612 -z options into alphabetical order.
8613 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
8614
cd6739a1 86152009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
8616
8617 * layout.cc (Layout::make_output_section): Call
8618 Target::new_output_section.
8619 (Layout::attach_allocated_section_to_segment): Put large section
8620 sections in a separate load segment with the large segment flag
8621 set.
8622 (Layout::segment_precedes): Sort large data segments after other
8623 load segments.
8624 (align_file_offset): New static function.
8625 (Layout::set_segment_offsets): Use align_file_offset.
8626 * output.h (class Output_section): Add is_small_section_ and
8627 is_large_section_ fields.
8628 (Output_section::is_small_section): New function.
8629 (Output_section::set_is_small_section): New function.
8630 (Output_section::is_large_section): New function.
8631 (Output_section::set_is_large_section): New function.
8632 (Output_section::is_large_data_section): New function.
8633 (class Output_segment): Add is_large_data_segment_ field.
8634 (Output_segment::is_large_data_segment): New function.
8635 (Output_segment::set_is_large_data_segment): New function.
8636 * output.cc (Output_section::Output_section): Initialize new
8637 fields.
8638 (Output_segment::Output_segment): Likewise.
8639 (Output_segment::add_output_section): Add assertion that large
8640 data sections always go in large data segments. Force small data
8641 sections to the end of the list of data sections. Force small BSS
8642 sections to the start of the list of BSS sections. For large BSS
8643 sections to the end of the list of BSS sections.
8644 * symtab.h (class Symbol): Declare is_common_shndx.
8645 (Symbol::is_defined): Check Symbol::is_common_shndx.
8646 (Symbol::is_common): Likewise.
8647 (class Symbol_table): Define enum Commons_section_type. Update
8648 declarations. Add small_commons_ and large_commons_ fields.
8649 * symtab.cc (Symbol::is_common_shndx): New function.
8650 (Symbol_table::Symbol_table): Initialize new fields.
8651 (Symbol_table::add_from_object): Put small and large common
8652 symbols in the right list.
8653 (Symbol_table::sized_finalized_symbol): Check
8654 Symbol::is_common_shndx.
8655 (Symbol_table::sized_write_globals): Likewise.
8656 * common.cc (Symbol_table::do_allocate_commons): Allocate new
8657 common symbol lists. Don't call do_allocate_commons_list if the
8658 list is empty.
8659 (Symbol_table::do_allocate_commons_list): Remove is_tls
8660 parameter. Add comons_section_type parameter. Change all
8661 callers. Handle small and large common symbols.
8662 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
8663 Symbol::is_common_shndx.
8664 * resolve.cc (symbol_to_bits): Likewise.
8665 * target.h (Target::small_common_shndx): New function.
8666 (Target::small_common_section_flags): New function.
8667 (Target::large_common_shndx): New function.
8668 (Target::large_common_section_flags): New function.
8669 (Target::new_output_section): New function.
8670 (Target::Target_info): Add small_common_shndx, large_common_shndx,
8671 small_common_section_flags, and large_common_section_flags
8672 fields.
8673 (Target::do_new_output_section): New virtual function.
8674 * arm.cc (Target_arm::arm_info): Initialize new fields.
8675 * i386.cc (Target_i386::i386_info): Likewise.
8676 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
8677 Likewise.
8678 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
8679 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8680 (Target_x86_64::do_new_output_section): New function.
8681 * configure.ac: Define conditional MCMODEL_MEDIUM.
8682 * testsuite/Makefile.am (check_PROGRAMS): Add large.
8683 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
8684 (large_LDFLAGS): Define.
8685 * testsuite/large.c: New file.
8686 * testsuite/testfile.cc (Target_test::test_target_info):
8687 Initialize new fields.
8688 * configure, testsuite/Makefile.in: Rebuild.
8689
bb04269c
DK
86902009-06-05 Doug Kwan <dougkwan@google.com>
8691
8692 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 8693 * Makefile.in: Regenerate.
bb04269c
DK
8694 * i386.cc (class Target_i386): Define new virtual method to
8695 override do_is_local_label_name in parent.
8696 * object.cc (Sized_relobj::do_count_local_symbols): Discard
8697 local symbols if --discard-locals or -X is given.
8698 * options.h (class General_options): Declare new options
8699 '--discard-locals' and '-X' for discarding locals.
8700 * target.h (class Target): Define new methods is_local_label_name.
8701 Declare new virtual method do_is_local_label_name.
8702 * target.cc: New file.
8703 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
8704 (check_SCRIPTS): Add discard_locals_test.sh.
8705 (check_DATA): Add discard_local_tests.syms.
8706 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
8707 (discard_local_tests.syms, discard_locals_test.o): New make rules.
8708 * testsuite/Makefile.in: Regenerate.
8709 * testsuite/discard_locals_test.c: New file.
8710 * testsuite/discard_locals_test.sh: Same.
8711
805bb01c
DK
87122009-06-05 Doug Kwan <dougkwan@google.com>
8713
8714 * object.cc (Sized_relobj::Sized_relobj): Initialize
8715 discarded_eh_frame_shndx_ to -1U.
8716 (Sized_relobj::do_layout): Record index of a discard .eh_frame
8717 section.
8718 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8719 a discarded .eh_frame section.
8720 (Sized_relobj::do_finalize_local_symbols): Ditto.
8721 * object.h (class Sized_relobj): Declare new member
8722 discarded_eh_frame_shndx_.
8723 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
8724 (local_labels_test.o, local_labels_test): New rules.
8725 * testsuite/Makefile.in: Regenerate.
8726
1dcd334d
DK
87272009-06-04 Doug Kwan <dougkwan@google.com>
8728
8729 * layout.cc (Layout::section_name_mapping): Add mapping for
8730 special ARM sections.
8731
96d49306
DK
87322009-06-03 Doug Kwan <dougkwan@google.com>
8733
8734 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
8735 (utils::has_overflow): Same.
8736
dff16297
ILT
87372009-06-03 Ian Lance Taylor <iant@google.com>
8738
8739 * layout.cc (Layout::section_name_mapping): New array, replacing
8740 Layout::linkonce_mapping.
8741 (Layout::section_name_mapping_count): New variable, replacing
8742 Layout::linkonce_mapping_count.
8743 (Layout::linkonce_output_name): Remove.
8744 (Layout::output_section_name): Rewrite.
8745 * layout.h (class Layout): Rename Linkonce_mapping to
8746 Section_name_mapping, linkonce_mapping to section_name_mapping,
8747 linkonce_mapping_count to section_name_mapping_count. Don't
8748 declare linkonce_output_name.
8749
c121c671
DK
87502009-06-03 Doug Kwan <dougkwan@google.com>
8751
8752 * gold/arm.cc (namespace utils): New.
8753 (Target_arm::reloc_is_non_pic): Define new method.
8754 (class Arm_relocate_functions): New.
8755 (Target_arm::Relocate::relocate): Handle relocation types used by
8756 Android.
8757
07800fab
ILT
87582009-06-03 Ian Lance Taylor <iant@google.com>
8759
8760 * arm.cc (Target_arm::scan::global): Use || instead of |.
8761
c121c671
DK
87622009-06-02 Doug Kwan <dougkwan@google.com>
8763
8764 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
8765 issued_non_pic_error_.
8766 (class Target_arm::Scan): Declare new method check_non_pic.
8767 Define new method symbol_needs_plt_entry.
8768 Declare new data member issued_non_pic_error_.
8769 (class Target_arm::Relocate): Declare new method
8770 should_apply_static_reloc.
8771 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
8772 (Target_arm::Scan::check_non_pic): Define new method.
8773 (Target_arm::Scan::local): Handle a small subset of reloc types used
8774 by Android.
8775 (Target_arm::Scan::local): Same.
8776 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
8777
b19b0c6d
ILT
87782009-05-31 Mikolaj Zalewski <mikolajz@google.com>
8779
8780 * incremental.cc (Incremental_inputs::report_command_line): Filter
8781 out --incremental-* options.
8782
94cdfcff
DK
87832009-05-29 Doug Kwan <dougkwan@google.com>
8784
8785 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
8786 template class.
8787 (class Target_arm): Update comment.
8788 (Target_arm::Target_arm): Initialize new data members GOT_,
8789 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8790 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8791 and Target_arm::rel_dyn_section.
8792 Declare new_enum Target_arm::Got_type.
8793 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8794 and DYNBSS_.
8795 Update commments for member do_dynsym_value.
8796 (Target_arm::got_size, Target_arm::plt_section,
8797 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8798 new methods inside class defintion.
8799 (Target_arm::got_section): Define new method.
8800 (Target_arm::rel_dyn_section): Same.
8801 (Output_data_plt_arm): New template class.
8802 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8803 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8804 (Output_data_plt_arm::add_entry): Same.
8805 (Output_data_plt_arm::first_plt_entry): Define new
8806 static data member for PLT instruction template.
8807 (Output_data_plt_arm::plt_entry): Same.
8808 (Output_data_plt_arm::do_write): Define new method.
8809 (Target_arm::make_plt_entry): Same.
8810 (Target_arm::do_finalize_sections): Same.
8811 (Target_arm::do_dynsym_value): Same.
8812
4a657b0d
DK
88132009-05-28 Doug Kwan <dougkwan@google.com>
8814
8815 * Makefile.am (TARGETSOURCES): Add arm.cc.
8816 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8817 * Makefile.in: Regenerate.
8818 * arm.cc: New file.
8819 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8820
e7ae8c36
DK
88212009-05-26 Doug Kwan <dougkwan@google.com>
8822
8823 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8824 (General_options::check_excluded_libs): Strip off directories in
8825 archive name before matching like GNU ld does.
8826 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8827 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8828 (exclude_libs_test_LDFLAGS): Add linker option
8829 -Wl,--exclude-libs,libexclude_libs_test_3
8830 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8831 an explicit archive without using -l.
8832 (alt/libexclude_libs_test_3.a): New make rule.
8833 * testsuite/Makefile.in: Regenerate.
8834 * testsuite/exclude_libs_test.c : Declare lib3_default().
8835 (main): Call it.
8836 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8837 * exclude_libs_test_3.c: New file.
8838
f12e7348
NC
88392009-05-26 Nick Clifton <nickc@redhat.com>
8840
8841 * po/id.po: New Indonesian translation.
8842 * po/gold.pot: Updated template file.
8843
4daadc0d
ST
88442009-05-22 Sriraman Tallam <tmsriram@google.com>
8845
e1df38aa 8846 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8847 gc_comdat_test files. Add -Wl,--gc-sections to build
8848 gc_comdat_test.
8849 * testsuite/Makefile.in: Regenerate.
8850 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8851
531813ad
ST
88522009-05-21 Sriraman Tallam <tmsriram@google.com>
8853
8854 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8855 kept comdat section was garbage collected.
8856 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8857 * testsuite/Makefile.in: Regenerate.
8858 * testsuite/gc_comdat_test.sh: New file.
8859 * testsuite/gc_comdat_test_1.cc: New file.
8860 * testsuite/gc_comdat_test_2.cc: New file.
8861
65514900
CC
88622009-05-19 Doug Kwan <dougkwan@google.com>
8863
8864 * archive.cc (Archive::Archive): Move constructor from archive.h
8865 to here. Initialize no_export_.
8866 (Archive::get_elf_object_for_member): Set no_export flag of object.
8867 * archive.h (Archive::Archive): Move constructor body to
8868 archive.cc.
8869 (Archive::no_export): New method.
8870 (Archive::no_export_): New field.
8871 * object.h (Object::Object): Initialize no_export_ to false.
8872 (Object::no_export, Object::set_no_export): New methods.
8873 (Object::no_export_): New field.
8874 * options.cc (General_options::parse_exclude_libs): New method.
8875 (General_options::check_excluded_libs) Same.
8876 * options.h (exclude_libs): New option.
8877 (General_options::check_excluded_libs): New method declaration.
8878 (General_options::excluded_libs_): New field.
8879 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8880 default or protected visibility if an object has no-export flag set.
8881 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8882 (check_SCRIPTS): Add exclude_libs_test.sh.
8883 (check_DATA): Add exclude_libs_test.syms.
8884 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8885 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8886 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8887 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8888 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8889 libexclude_libs_test_2.a): New rules.
8890 * testsuite/Makefile.in: Regenerate.
8891 * testsuite/exclude_libs_test.c: New file.
8892 * testsuite/exclude_libs_test.sh: Ditto.
8893 * testsuite/exclude_libs_test_1.c: Ditto.
8894 * testsuite/exclude_libs_test_2.c: Ditto.
8895
1b77ea50
ILT
88962009-05-15 Ian Lance Taylor <iant@google.com>
8897
8898 * configure.ac: Check for declarations for cases where libiberty.h
8899 checks HAVE_DECL_xxx.
8900 * configure, config.in: Rebuild.
8901
072fe7ce
ILT
89022009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8903
8904 * gold.h (Incremental_argument_list): Remove (invalid) forward
8905 declaration.
8906 * incremental.cc (Incremental_inputs::report_achive): New method.
8907 (Incremental_inputs::report_object): New method.
8908 (Incremental_inputs::report_script): New method.
8909 (Incremental_inputs::finalize_inputs): New method.
8910 (Incremental_inputs::finalize): Call finalize_inputs().
8911 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8912 Create inputs entries.
8913 * incremental.h (Incremental_input_type): New enum.
8914 (Incremental_inputs::Incremental_input): Initialize new fields.
8915 (Incremental_inputs::report_inputs): New method.
8916 (Incremental_inputs::report_achive): New method.
8917 (Incremental_inputs::report_object): New method.
8918 (Incremental_inputs::report_script): New method.
8919 (Incremental_inputs::finalize_inputs): New method.
8920 (Incremental_inputs::Input_info): New struct.
8921 (Incremental_inputs::Input_info_map): New typedef.
8922 (Incremental_inputs::lock_): New field.
8923 (Incremental_inputs::Inputs_): New field.
8924 (Incremental_inputs::Inputs_map): New field.
8925 * main.cc (main): Call Incremental_input::report_inputs.
8926 * options.h (Input_argument_list): Typedef moved from
8927 Input_arguments.
8928 (Input_file_group::Files): Remove, use ::Input_argument_list.
8929 (Input_file_group::Input_argument_list): Remove, use
8930 ::Input_argument_list.
8931 * plugin.cc (Plugin_manager::add_input_file): Add error in
8932 incremental build.
8933 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8934 functions.
8935 * script.cc (read_input_script): Call
8936 Incremental_input::report_script.
8937 * script.h (Script_info): New class.
8938
b0481b0b
ILT
89392009-04-27 Ian Lance Taylor <iant@google.com>
8940
8941 * x86_64.cc (do_adjust_output_section): Set entsize to
8942 plt_entry_size.
8943
b22a5a41 89442009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8945
8946 * output.cc (Output_file::close): After short writes, continue
8947 writing from the correct offset in the buffer being written.
8948
40fde488
CD
89492009-04-23 Chris Demetriou <cgd@google.com>
8950
8951 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8952 * configure: Regenerate.
8953 * config.in: Regenerate.
8954 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8955 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8956
3ce2c28e
ILT
89572009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8958
8959 * incremental.cc (Incremental_inputs_header_data): Renamed from
8960 Incremental_input_header_data.
8961 (Incremental_inputs_header_data::data_size): New field.
8962 (Incremental_inputs_header_data::put_input_file_count): Renamed
8963 from input_file_count.
8964 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8965 from command_line_offset.
8966 (Incremental_inputs_header_data::put_reserved): Renamed from
8967 put_reserved.
8968 (Incremental_inputs_entry_data): Renamed from
8969 Incremental_input_entry_data.
8970 (Incremental_inputs_entry_data::data_size): New field.
8971 (Incremental_inputs::report_command_line): New method.
8972 (Incremental_inputs::finalize): New method.
8973 (Incremental_inputs::create_incremental_inputs_data): New method.
8974 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8975 * incremental.h: New file.
8976 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8977 (Layout::finalize): Create incremental inputs section in
8978 incremental builds.
8979 (Layout::create_incremental_info_sections): New method.
8980 * layout.h (Layout::incremental_inputs): New method.
8981 (Layout::create_incremental_info_sections): New method.
8982 (Layout::incremental_inputs_): New field.
8983 * main.cc (main): Notify Incremental_input of the command line.
8984
e55bde5e
ILT
89852009-04-01 Ian Lance Taylor <iant@google.com>
8986 Mikolaj Zalewski <mikolajz@google.com>
8987
8988 * gold.h (reserve_unordered_map): Define, three versions, one for
8989 each version of Unordered_map.
8990 * layout.cc (Layout::Layout): Remove options parameter. Add
8991 number_of_input_files parameter. Don't initialize options_.
8992 Initialize number_of_input_files_ and resized_signatures_. Move
8993 sections_are_attached_.
8994 (Layout::layout_group): Reserve space for group_signatures_.
8995 (Layout::find_or_add_kept_section): Change name parameter to be a
8996 reference. Resize signatures_ map when it gets large enough.
8997 (Layout::layout_eh_frame): Use parameters->options() instead of
8998 this->options_.
8999 (Layout::make_output_section): Likewise.
9000 (Layout::attach_allocated_section_to_segment): Likewise.
9001 (Layout::finalize, Layout::create_executable_stack): Likewise.
9002 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
9003 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
9004 * layout.h (class Layout): Update declarations. Remove options_
9005 field. Add number_of_input_files_ and resized_signatures_
9006 fields. Move sections_are_attached_ field.
9007 * main.cc (main): Pass number of input files to Layout
9008 constructor. Don't pass options.
9009
154b857c
ILT
90102009-03-30 Ian Lance Taylor <iant@google.com>
9011
9012 * ffsll.c (ffsll): Correct implementation.
9013
2f35ab9b
ILT
90142009-03-27 Ian Lance Taylor <iant@google.com>
9015
fd03461a
ILT
9016 * ffsll.c: New file.
9017 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
9018 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
9019 * ftruncate.c (ftruncate): Declare before definition.
9020 * mremap.c (mremap): Likewise.
9021 * pread.c (pread): Likewise.
9022 * configure, Makefile.in, config.in: Rebuild.
9023
2f35ab9b
ILT
9024 * mremap.c: New file.
9025 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
9026 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
9027 (mremap): Declare if HAVE_MREMAP is not defined.
9028 * configure, Makefile.in, config.in: Rebuild.
9029
33aea2fd
CC
90302009-03-27 Cary Coutant <ccoutant@google.com>
9031
9032 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
9033 position independent.
9034 * sparc.cc (Target_sparc::check_non_pic): Likewise.
9035 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
9036
6d479619
CC
90372009-03-24 Cary Coutant <ccoutant@google.com>
9038
9039 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
9040 an executable.
9041 (needs_dynamic_reloc): Likewise.
9042
afc06bb8
ILT
90432009-03-24 Ian Lance Taylor <iant@google.com>
9044
9045 * yyscript.y (file_cmd): Recognize EXTERN.
9046 (extern_name_list, extern_name_list_body): New nonterminals.
9047 * script.cc (script_add_extern): Define.
9048 * script-c.h (script_add_extern): Declare.
9049
f6060a4d
ILT
90502009-03-24 Rafael Avila de Espindola <espindola@google.com>
9051
9052 * object.cc (is_elf_object): Define.
9053 * object.h (is_elf_object): Declare.
9054 * archive.cc (Archive::get_elf_object_for_member): Call
9055 is_elf_object.
33aea2fd 9056 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 9057
26736d8e
ILT
90582009-03-24 Elliott Hughes <enh@google.com>
9059
9060 * output.cc (Output_file::map_anonymous): Define.
9061 (Output_file::map): Use map_anonymous. If the regular mmap fails,
9062 try an anonymous one. Report the size if the mmap fails.
9063 * output.h (class Output_file): Declare map_anonymous.
9064
22fd9730
ILT
90652009-03-24 Ian Lance Taylor <iant@google.com>
9066
9067 * target-select.cc (instantiate_target): Don't acquire the lock if
9068 the instantiated_target_ field has already been set.
9069
cb010894
ILT
90702009-03-23 Ian Lance Taylor <iant@google.com>
9071
7f055c20
ILT
9072 * gold-threads.h (class Initialize_lock): Define.
9073 * gold-threads.cc (class Initialize_lock_once): Define.
9074 (initialize_lock_control): New static variable.
9075 (initialize_lock_pointer): New static variable.
9076 (initialize_lock_once): New static function.
9077 (Initialize_lock::Initialize_lock): Define.
9078 (Initialize_lock::initialize): Define.
9079 * target-select.h: Include "gold-threads.h".
9080 (class Target_selector): Add lock_ and initialize_lock_ fields.
9081 Don't define instantiate_target, just declare it.
9082 * target-select.cc (Target_selector::Target_selector): Initialize
9083 new fields.
9084 (Target_selector::instantiate_target): Define.
9085 * descriptors.h: Include "gold-threads.h".
9086 (class Descriptors): Add initialize_lock_ field.
9087 * descriptors.cc (Descriptors::Descriptors): Initialize new
9088 field.
9089 (Descriptors::open): Use initialize_lock_ field
9090 * errors.h (class Errors): Add initialize_lock_ field.
9091 * errors.cc (Errors::Errors): Initialize new field.
9092 (Errors::initialize_lock): Use initialize_lock_ field.
9093 * powerpc.cc (class Target_selector_powerpc): Remove
9094 instantiated_target_ field. In do_recognize call
9095 instantiate_target rather than do_instantiate_target. In
9096 do_instantiate_target just allocate a new target.
9097 * sparc.cc (class Target_selector_sparc): Likewise.
9098
36959681
ILT
9099 * freebsd.h: New file.
9100 * i386.cc: Include "freebsd.h".
9101 (Target_i386): Derive from Target_freebsd rather than
9102 Sized_target.
9103 (Target_selector_i386): Derive from Target_selector_freebsd rather
9104 than Target_selector.
9105 * x86_64.cc: Include "freebsd.h".
9106 (Target_x86_64): Derive from Target_freebsd rather than
9107 Sized_target.
9108 (Target_selector_x86_64): Derive from Target_selector_freebsd
9109 rather than Target_selector.
9110 * target.h (class Target): Add adjust_elf_header and
9111 do_adjust_elf_header.
9112 * output.cc (Output_file_header:: do_sized_write): Call target
9113 adjust_elf_header routine.
9114 * configure.tgt: Set targ_osabi.
9115 * configure.ac: Define GOLD_DEFAULT_OSABI.
9116 * parameters.cc (Parameters::default_target): Pass
9117 GOLD_DEFAULT_OSABI to select_target.
9118 * target-select.h (class Target_selector): Make instantiate_target
9119 protected rather than private.
9120 * Makefile.am (HFILES): Add freebsd.h.
9121 * configure, Makefile.in, config.in: Rebuild.
9122
cb010894
ILT
9123 * merge.cc (do_add_input_section): Correct pend value. Change
9124 message about last entry not being null terminated from error to
9125 warning.
9126
0e879927
ILT
91272009-03-20 Mikolaj Zalewski <mikolajz@google.com>
9128
9129 * incremental.cc: New file.
9130 * Makefile.am (CCFILES): Add incremental.cc.
9131 * Makefile.in: Rebuild.
9132
41105937
PP
91332009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
9134
9135 * layout.cc (Layout::output_section_name): Preserve names
9136 of '.note.' sections.
e1df38aa 9137
60439920
ILT
91382009-03-19 Ian Lance Taylor <iant@google.com>
9139
9140 * descriptors.cc (Descriptors::open): Check that the options are
9141 valid before using them.
9142
0d371ad3
ILT
91432009-03-18 Ian Lance Taylor <iant@google.com>
9144
9145 * script-sections.h: Include <list>.
9146 (class Script_sections): Change Sections_elements from std::vector
9147 to std::list. Typedef public Elements_iterator. Add
9148 orphan_section_placement_, data_segment_align_start_, and
9149 saw_data_segment_align_ fields. Remove data_segment_align_index_
9150 field.
9151 * script-sections.cc (class Orphan_section_placement): New class.
9152 (class Sections_element): Add virtual functions is_relro and
9153 orphan_section_init. Remove virtual function place_orphan_here.
9154 (class Output_section_definition): Add is_relro and
9155 orphan_section_init. Remove place_orphan_here.
9156 (class Orphan_output_section): Likewise.
9157 (Script_sections::Script_sections): Update for field changes.
9158 (Script_sections::data_segment_align): Set saw_data_segment_align_
9159 and data_segment_align_start_, not data_segment_align_index.
9160 (Script_sections::data_segment_relro_end): Check
9161 saw_data_segment_align_. Use data_segment_align_start_ rather
9162 than data_segment_align_index_.
9163 (Script_sections::place_orphan): Rewrite to use
9164 Orphan_section_placement.
9165
9201d894
ILT
91662009-03-17 Ian Lance Taylor <iant@google.com>
9167
9c5b8369
ILT
9168 * archive.cc (Archive::add_symbols): Check for a version attached
9169 to the symbol name in the archive map.
9170 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
9171 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
9172 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
9173 (ver_test_11.a): New target.
9174 * testsuite/Makefile.in: Rebuild.
9175
9201d894
ILT
9176 * configure.ac: Check for chsize and posix_fallocate. Replace
9177 ftruncate.
9178 * ftruncate.c: New file, from gnulib.
9179 * output.cc (posix_fallocate): Define dummy version if not
9180 HAVE_POSIX_FALLOCATE.
9181 (Output_file::map): Call posix_fallocate rather than lseek and
9182 write.
9183 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
9184 * configure, Makefile.in, config.in: Rebuild.
9185
ef4ab7a8 91862009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 9187
ef4ab7a8
PP
9188 * layout.h (Layout::create_note): Add section_name parameter.
9189 * layout.cc (Layout::create_note): Likewise.
9190 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 9191
8c500701
ILT
91922009-03-17 Ian Lance Taylor <iant@google.com>
9193
e85b18e1
ILT
9194 * descriptors.cc: Include "options.h".
9195 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
9196 (Descriptors::open): Always use O_CLOEXEC when opening a new
9197 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
9198 then set FD_CLOEXEC.
9199
9efe6174
ILT
9200 * sparc.cc (class Target_sparc): Add has_got_section.
9201 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
9202 make sure we have a GOT section.
9203
9204 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
9205 (Target_sparc::Scan::local): Likewise.
9206 (Target_sparc::Scan::global): Likewise.
9207 (Target_sparc::Relocate::relocate): Likewise.
9208 (Target_sparc::Relocate::relocate_tls): Likewise.
9209
8c500701
ILT
9210 * symtab.cc (Symbol_table::define_default_version): New function,
9211 broken out of add_from_object.
9212 (Symbol_table::add_from_object): Call define_default_version.
9213 (Symbol_table::define_special_symbol): Add resolve_oldsym
9214 parameter. Change all callers. If the version for a symbol comes
9215 from a version script, resolve it with the symbol with the same
9216 name with no version. Also add the symbol without a version if
9217 appropriate.
9218 (do_define_in_output_data): If resolving with oldsym, don't delete
9219 sym.
9220 (do_define_in_output_segment): Likewise.
9221 (do_define_as_constant): Likewise.
9222 * symtab.h (class Symbol_table): Update declarations.
9223
f1ed28fb
ILT
92242009-03-13 Ian Lance Taylor <iant@google.com>
9225
15f8229b
ILT
9226 * readsyms.cc (Read_symbols::incompatible_warning): New function.
9227 (Read_symbols::requeue): New function.
9228 (Read_symbols::do_read_symbols): If make_elf_object fails because
9229 the target type is not configured, and the file was searched for,
9230 issue a warning and retry with the next directory.
9231 (Add_symbols::run): If the file has an incompatible format, and
9232 it was searched for, requeue the Read_symbols task. On error,
9233 release the object.
9234 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
9235 dirindex parameter to constructor. Change all callers. Declare
9236 incompatible_warning and requeue.
9237 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
9238 input_argument_ and input_group_ fields. Add them to
9239 constructor. Change all callers.
9240 (class Read_script): Add dirindex_ field. Add it to constructor.
9241 Change all callers.
9242 * archive.cc (Archive::setup): Remove input_objects parameter.
9243 Change all callers.
9244 (Archive::get_file_and_offset): Likewise.
9245 (Archive::read_all_symbols): Likewise.
9246 (Archive::read_symbols): Likewise.
9247 (Archive::get_elf_object_for_member): Remove input_objects
9248 parameter. Add punconfigured parameter. Change all callers.
9249 (Archive::add_symbols): Change return type to bool. Check return
9250 value of include_member.
9251 (Archive::include_all_members): Likewise.
9252 (Archive::include_member): Change return type to bool. Return
9253 false if first included object has incompatible target. Set
9254 included_member_ field.
9255 (Add_archive_symbols::run): If add_symbols returns false, requeue
9256 Read_symbols task.
9257 * archive.h (class Archive): Add included_member_ field.
9258 Initialize it in constructor. Add input_file and searched_for
9259 methods. Update declarations.
9260 (class Add_archive_symbols): Add dirpath_, dirindex_, and
9261 input_argument_ fields. Add them to constructor. Change all
9262 callers.
9263 * script.cc: Include "target-select.h".
9264 (class Parser_closure): Add skip_on_incompatible_target_ and
9265 found_incompatible_target_ fields. Add
9266 skip_on_incompatible_target parameter to constructor. Change all
9267 callers. Add methods skip_on_incompatible_target,
9268 clear_skip_on_incompatible_target, found_incompatible_target, and
9269 set_found_incompatible_target.
9270 (read_input_script): Add dirindex parameter. Change all callers.
9271 If parser finds an incompatible target, requeue Read_symbols
9272 task.
9273 (script_set_symbol): Clear skip_on_incompatible_target in
9274 closure.
9275 (script_add_assertion, script_parse_option): Likewise.
9276 (script_start_sections, script_add_phdr): Likewise.
9277 (script_check_output_format): New function.
9278 * script.h (read_input_script): Update declaration.
9279 * script-c.h (script_check_output_format): Declare.
9280 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
9281 (ignore_cmd): Remove OUTPUT_FORMAT.
9282 * fileread.cc (Input_file::Input_file): Add explicit this.
9283 (Input_file::will_search_for): New function.
9284 (Input_file::open): Add pindex parameter. Change all callers.
9285 * fileread.h (class Input_file): Add input_file_argument method.
9286 Declare will_search_for. Update declarations.
9287 * object.cc (make_elf_object): Add punconfigured parameter.
9288 Change all callers.
9289 * object.h (class Object): Make input_file public. Add
9290 searched_for method.
9291 (make_elf_object): Update declaration.
9292 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
9293 restart search.
9294 * dirsearch.h (class Dirsearch): Update declaration.
9295 * options.h (class General_options): Add --warn-search-mismatch.
9296 * parameters.cc (Parameters::is_compatible_target): New function.
9297 * parameters.h (class Parameters): Declare is_compatible_target.
9298 * workqueue.cc (Workqueue::add_blocker): New function.
9299 * workqueue.h (class Workqueue): Declare add_blocker.
9300
f1ed28fb
ILT
9301 * fileread.cc (Input_file::open): Remove options parameter.
9302 Change all callers.
9303 (Input_file::open_binary): Likewise.
9304 * script.cc (read_input_script): Likewise.
9305 * readsyms.h (class Read_symbols): Remove options_ field. Remove
9306 options parameter from constructor. Change all callers.
9307 (class Read_script): Likewise.
9308 * fileread.h (class Input_file): Update declarations.
9309 * script.h (read_input_script): Update declaration.
9310
34dd024a
NC
93112009-03-10 Nick Clifton <nickc@redhat.com>
9312
9313 * po/es.po: New Spanish translation.
9314
6d71b17c
CC
93152009-03-06 Cary Coutant <ccoutant@google.com>
9316
9317 * options.cc (parse_short_option): Keep dash_z from registering itself.
9318
031cdbed
ILT
93192009-03-03 Ian Lance Taylor <iant@google.com>
9320
9321 PR 9918
9322 * target-reloc.h (relocate_section): Pass output_section to
9323 relocate.
9324 * i386.cc (Target_i386::should_apply_static_reloc): Add
9325 output_section parameter. Change all callers.
9326 (Target_i386::Relocate::relocate): Add output_section parameter.
9327 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9328 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
9329 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
9330 * testsuite/two_file_shared.sh: New script.
9331 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
9332 (check_DATA): Add two_file_shared.dbg.
9333 (two_file_shared.dbg): New target.
9334 * testsuite/Makefile.in: Rebuild.
9335
15d5fa16
ILT
93362009-03-01 Ian Lance Taylor <iant@google.com>
9337
9338 * configure.ac: Check for byteswap.h.
9339 * configure: Rebuild.
9340 * config.in: Rebuild.
9341
8a4c0b0d
ILT
93422009-03-01 Mikolaj Zalewski <mikolajz@google.com>
9343
9344 * layout.cc (Layout::find_or_add_kept_section): New function.
9345 (Layout::add_comdat): Removed.
9346 * layout.h (struct Kept_section): Move out of class Layout.
9347 Remove trailing underscores from field names. Add group_sections
9348 field. Rename group_ field to is_group. Change all uses.
9349 (class Layout): Declare find_or_add_kept_section, not add_comdat.
9350 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
9351 comdat_groups_ field.
9352 (Sized_relobj::include_section_group): Use
9353 find_or_add_kept_section and Kept_section::group_sections.
9354 (Sized_relobj::include_linkonce_section): Likewise.
9355 * object.cc (class Sized_relobj): Don't define Comdat_group or
9356 Comdat_group_table. Remove find_comdat_group and
9357 add_comdat_group. Remove comdat_groups_ field.
9358 * plugin.cc (include_comdat_group): Use
9359 Layout::find_or_add_kept_section.
9360
b4ecf66b
ILT
93612009-02-28 Ian Lance Taylor <iant@google.com>
9362
14359ca0
ILT
9363 * README: --gc-sections and map files are now supported. Document
9364 some build requirements.
9365
b4ecf66b
ILT
9366 PR 6992
9367 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
9368 relocatable link set the value of the section symbol to zero.
9369 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
9370 relocatable link don't include the section address in the local
9371 symbol value.
9372
0602e05a
ILT
93732009-02-27 Ian Lance Taylor <iant@google.com>
9374
fd9d194f
ILT
9375 PR 6811
9376 * options.h (class Search_directory): Add is_system_directory.
9377 (class General_options): Declare is_in_system_directory.
9378 * options.cc (get_relative_sysroot): Make static.
9379 (get_default_sysroot): Make static.
9380 (General_optoins::is_in_system_directory): New function.
9381 * fileread.cc (Input_file::is_in_system_directory): New function.
9382 * fileread.h (class Input_file): Declare is_in_system_directory.
9383 * object.h (class Object): Add is_in_system_directory.
9384 (class Input_objects): Remove system_library_directory_ field.
9385 * object.cc (Input_objects::add_object): Don't set
9386 system_library_directory_.
9387 (input_objects::found_in_system_library_directory): Remove.
9388 * symtab.cc (Symbol_table::write_globals): Remove input_objects
9389 parameter. Change all callers.
9390 (Symbol_table::sized_write_globals): Likewise.
9391 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
9392 Call Object::is_in_system_directory.
9393 * symtab.h (class Symbol_table): Update declarations.
9394
61edd21f
ILT
9395 PR 5990
9396 * descriptors.h (Open_descriptor): Add is_on_stack field.
9397 * descriptors.cc (Descriptors::open): If the descriptor is on the
9398 top of the stack, remove it. Initialize is_on_stack field.
9399 (Descriptors::release): Only add pod to stack if it is not on the
9400 stack already.
9401 (Descriptors::close_some_descriptor): Clear stack_next and
9402 is_on_stack fields.
9403
e29e076a
ILT
9404 PR 7091
9405 * output.cc (Output_section::find_starting_output_address): Rename
9406 from starting_output_address; add PADDR parameter; change return
9407 type.
9408 * output.h (class Output_section): Declare
9409 find_starting_output_address instead of starting_output_address.
9410 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
9411 section symbol for which we can't find a merge section.
9412
0602e05a
ILT
9413 PR 9836
9414 * symtab.cc (Symbol_table::add_from_object): If the visibility is
9415 hidden or internal, force the symbol to be local.
9416 * resolve.cc (Symbol::override_visibility): Define.
9417 (Symbol::override_base): Use override_visibility.
9418 (Symbol_table::resolve): Likewise.
9419 (Symbol::override_base_with_special): Likewise.
9420 (Symbol_table::override_with_special): If the visibility is hidden
9421 or internal, force the symbol to be local.
9422 * symtab.h (class Symbol): Add set_visibility and
9423 override_visibility.
9424 * testsuite/ver_test_1.sh: New file.
9425 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
9426 (check_DATA): Add ver_test_1.syms.
9427 (ver_test_1.syms): New target.
9428 * testsuite/Makefile.in: Rebuild.
9429
401a9a73
CC
94302009-02-25 Cary Coutant <ccoutant@google.com>
9431
9432 * layout.cc (Layout::choose_output_section): Don't rename sections
9433 when using a linker script that has a SECTIONS clause.
9434 * Makefile.in: Regenerate.
9435
9436 * testsuite/Makefile.am (script_test_5.sh): New test case.
9437 * testsuite/Makefile.in: Regenerate.
9438 * testsuite/script_test_5.cc: New file.
9439 * testsuite/script_test_5.sh: New file.
9440 * testsuite/script_test_5.t: New file.
9441
f488e4b0
CC
94422009-02-13 Rafael Avila de Espindola <espindola@google.com>
9443
9444 * archive.cc (Archive::include_member): Update calls to add_symbols.
9445 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
9446 the Layout argument.
9447 * dynobj.h (do_add_symbols): Add the Layout argument.
9448 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
9449 Layout argument.
9450 * object.h (Object::add_symbols): Add the Layout argument.
9451 (Object::do_add_symbols): Add the Layout argument.
9452 (Sized_relobj::do_add_symbols): Add the Layout argument.
9453 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
9454 Unify the two versions.
9455 (Add_plugin_symbols): Remove.
9456 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
9457 (Sized_pluginobj::do_add_symbols): Unify the two versions.
9458 (Add_plugin_symbols): Remove.
9459 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
9460 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
9461 (Add_symbols::run): Make it work with Pulginobj.
9462
89dd1680
ILT
94632009-02-06 Ian Lance Taylor <iant@google.com>
9464
9465 * object.cc (Sized_relobj::do_layout): Make info message start
9466 with lower case letter.
9467
266d0a74
ILT
94682009-02-06 Mikolaj Zalewski <mikolajz@google.com>
9469
602b464e
ILT
9470 * binary.cc: Fix file comment.
9471
266d0a74
ILT
9472 * options.h (enum Incremental_disposition): Define.
9473 (class General_options): Add new options: --incremental,
9474 --incremental_changed, --incremental_unchanged,
9475 --incremental_unknown. Add incremental_disposition_ and
9476 implicit_incremental_ fields.
9477 (General_options::incremental_disposition): New function.
9478 (class Position_dependent_options): Add incremental_disposition
9479 option.
9480 (Position_dependent_options::copy_from_options): Set incremental
9481 dispositions.
9482 * options.cc (General_options::parse_incremental_changed): New
9483 function.
9484 (General_options::parse_incremental_unchanged): New function.
9485 (General_options::parse_incremental_unknown): New function.
9486 (General_options::General_options): Initialize new fields
9487 incremental_disposition_ and implicit_incremental_.
9488 (General_options::finalize): Check for uasge of --incremental-*
9489 without --incremental.
9490
f073bbf7
CD
94912009-02-06 Chris Demetriou <cgd@google.com>
9492
9493 * gold.h (gold_undefined_symbol): Change to take only a Symbol
9494 pointer and to report location as the file name associated with
9495 the symbol.
9496 (gold_undefined_symbol_at_location): New function to replace the
9497 old gold_undefined_symbol functionality.
9498 * target-reloc.h (relocate_section): Update to use
9499 gold_undefined_symbol_at_location.
9500 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9501 Call gold_undefined_symbol function rather than gold_error.
9502 * errors.h (Errors::undefined_symbol): Take location as a
9503 string, rather than calculating it from a relocation.
9504 * errors.cc (Errors::fatal): Print "fatal error:" before the
9505 formatted message.
9506 (Errors::error, Errors::error_at_location): Print "error: "
9507 before the formatted message.
9508 (Errors::undefined_symbol): Take location as a string, rather
9509 than calculating it from a relocation.
9510 (gold_undefined_symbol_at_location): New function akin to
9511 old gold_undefined_symbol, calculates location from relocation.
9512 (gold_undefined_symbol): Change to take only a Symbol pointer
9513 and to report location as the file name associated with the symbol.
9514 * testsuite/debug_msg.sh: Update for changed error messages.
9515 * testsuite/undef_symbol.sh: Likewise.
9516
8e94a90c
ILT
95172009-02-04 Duncan Sands <baldrick@free.fr>
9518
9519 PR 9812
9520 * reduced_debug_output.h
9521 (Output_reduced_debug_abbrev_section::failed): Use format for
9522 gold_warning.
9523 (Output_reduced_debug_info_section::faild): Likewise.
9524
88a0e15b
ILT
95252009-01-31 Mikolaj Zalewski <mikolajz@google.com>
9526
9527 * script.cc (Lazy_demangler): New class.
9528 (Version_script_info::get_symbol_version_helper): Demangle a
9529 symbol only once.
9530
5efc7cd2
CC
95312009-01-29 Cary Coutant <ccoutant@google.com>
9532
9533 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
9534 to __tls_get_addr.
9535 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
9536
e0ebcf42
ILT
95372009-01-28 Ian Lance Taylor <iant@google.com>
9538
5efc7cd2 9539 * version.cc (version_string): Bump to 1.9.
75fe7426 9540
e0ebcf42
ILT
9541 * gold.h: Include <cstring> and <stdint.h>.
9542 * version.cc: Include <cstdio>.
9543 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
9544 warning.
9545 * reduced_debug_output.cc (insert_into_vector): Rename from
9546 Insert_into_vector; change all callers. Use Swap_unaligned to
9547 avoid aliasing issue; remove union since it is unnecessary.
9548
8e2813be 95492009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
9550
9551 * Makefile.am (CCFILES): Add gc.cc.
9552 (HFILES): Add gc.h.
9553 * Makefile.in: Regenerate.
9554 * gold.cc (Gc_runner): New class.
9555 (queue_initial_tasks): Call garbage collection related tasks
9556 when corresponding options are invoked.
9557 (queue_middle_gc_tasks): New function.
9558 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
9559 processed early before laying out sections during garbage collection.
9560 * gold.h (queue_middle_gc_tasks): New function.
9561 (is_prefix_of): Move from "layout.cc".
9562 * i386.cc (Target_i386::gc_process_relocs): New function.
9563 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
9564 * main.cc (main): Create object of class "Garbage_collection".
9565 * object.cc (Relobj::copy_symbols_data): New function.
9566 (Relobj::is_section_name_included): New function.
e1df38aa
NC
9567 (Sized_relobj::do_layout): Allow this function to be called twice
9568 during garbage collection and defer layout of section during the
6d03d481
ST
9569 first call.
9570 * object.h (Relobj::get_symbols_data): New function.
9571 (Relobj::is_section_name_included): New function.
9572 (Relobj::copy_symbols_data): New function.
9573 (Relobj::set_symbols_data): New function.
9574 (Relobj::get_relocs_data): New function.
9575 (Relobj::set_relocs_data): New function.
9576 (Relobj::is_output_section_offset_invalid): New pure virtual function.
9577 (Relobj::gc_process_relocs): New function.
9578 (Relobj::do_gc_process_relocs): New pure virtual function.
9579 (Relobj::sd_): New data member.
9580 (Sized_relobj::is_output_section_offset_invalid): New function.
9581 (Sized_relobj::do_gc_process_relocs): New function.
9582 * options.h (General_options::gc_sections): Modify to not be a no-op.
9583 (General_options::print_gc_sections): New option.
9584 * plugin.cc (Plugin_finish::run): Remove function call to
9585 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
9586 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
9587 * reloc.cc (Read_relocs::run): Add task to process relocs and
9588 determine unreferenced sections when doing garbage collection.
9589 (Gc_process_relocs): New class.
9590 (Sized_relobj::do_gc_process_relocs): New function.
9591 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
9592 sections that are garbage collected.
9593 * reloc.h (Gc_process_relocs): New class.
9594 * sparc.cc (Target_sparc::gc_process_relocs): New function.
9595 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
9596 symbols whose corresponding sections are garbage collected.
9597 (Symbol_table::Symbol_table): Add new parameter for the garbage
9598 collection object.
9599 (Symbol_table::gc_mark_undef_symbols): New function.
9600 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9601 (Symbol_table::gc_mark_dyn_syms): New function.
9602 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
9603 as garbage.
9604 (Symbol_table::add_from_object): Likewise.
9605 (Symbol_table::add_from_relobj): When building shared objects, do not
9606 treat externally visible symbols as garbage.
9607 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
9608 table information for static and relocatable links.
9609 * symtab.h (Symbol_table::set_gc): New function.
9610 (Symbol_table::gc): New function.
9611 (Symbol_table::gc_mark_undef_symbols): New function.
9612 (Symbol_table::gc_mark_symbol_for_shlib): New function.
9613 (Symbol_table::gc_mark_dyn_syms): New function.
9614 (Symbol_table::gc_): New data member.
e1df38aa 9615 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
9616 function.
9617 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
9618 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
9619
3b293544
CF
96202009-01-20 Chris Faylor <me.sourceware@sourceware.org>
9621
9622 * options.h (General_options::gc_sections): Define as a no-op for now.
9623 (General_options::no_keep_memory): Ditto.
9624 (General_options::Bshareable): Define.
9625 * options.cc (General_options::finalize): Honor -Bshareable.
9626
83d22aa8
AS
96272009-01-20 Andreas Schwab <schwab@suse.de>
9628
9629 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
9630 read the value in the contents, since we don't use it. Use the
9631 template endianness when writing.
9632 (Relocate::relocate): Use it for R_PPC_REL16_HA.
9633
cd536b21
AS
96342009-01-19 Andreas Schwab <schwab@suse.de>
9635
9636 * configure.tgt (powerpc64-*): Fix targ_obj.
9637
99e9a495
ILT
96382009-01-15 Ian Lance Taylor <iant@google.com>
9639
9640 * object.cc (Sized_relobj::write_local_symbols): Don't write out
9641 local symbols when stripping all symbols.
9642
bbbfea06
CC
96432009-01-14 Cary Coutant <ccoutant@google.com>
9644
99e9a495 9645 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 9646
0f7c0701
CC
96472009-01-14 Cary Coutant <ccoutant@google.com>
9648
9649 * archive.cc (Archive::get_elf_object_for_member): Remove call
9650 to File_read::claim_for_plugin.
9651 * descriptors.cc (Descriptors::open): Remove reference to
9652 is_claimed.
9653 (Descriptors::claim_for_plugin): Remove.
9654 * descriptors.h (Descriptors::claim_for_plugin): Remove.
9655 (Descriptors::is_claimed): Remove.
9656 (claim_descriptor_for_plugin): Remove.
9657 * fileread.cc (File_read::claim_for_plugin): Remove.
9658 * fileread.h (File_read::claim_for_plugin): Remove.
9659 (File_read::descriptor): Reopen descriptor if necessary.
9660 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
9661 (Plugin_manager::all_symbols_read): Add task parameter. Change
9662 all callers.
9663 (Plugin_manager::get_input_file): New function.
9664 (Plugin_manager::release_input_file): New function.
9665 (Pluginobj::Pluginobj): Add filesize parameter and initialize
9666 corresponding data member.
9667 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
9668 and pass to base constructor. Change all callers.
9669 (get_input_file, release_input_file): New functions.
9670 (make_sized_plugin_object): Add filesize parameter. Change all callers.
9671 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
9672 (Plugin_manager::all_symbols_read): Add task parameter.
9673 (Plugin_manager::get_input_file): New function.
9674 (Plugin_manager::release_input_file): New function.
9675 (Plugin_manager::task_): New data member.
9676 (Pluginobj::Pluginobj): Add filesize parameter.
9677 (Pluginobj::filename): New function.
9678 (Pluginobj::descriptor): New function.
9679 (Pluginobj::filesize): New function.
9680 (Pluginobj::filesize_): New data member.
9681 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
9682 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
9683 File_read::claim_for_plugin; use Object::unlock to unlock the file.
9684
9685 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
9686 with archive libraries.
9687 * testsuite/Makefile.in: Regenerate.
9688 * testsuite/plugin_test.c (struct sym_info): New type.
9689 (get_input_file, release_input_file): New static variables.
9690 (onload): Capture new transfer vector entries.
9691 (claim_file_hook): Stop reading at end of file according to filesize.
9692 Factor out parsing of readelf output into separate function.
9693 (all_symbols_read_hook): Exercise get_input_file and release_input_file
9694 APIs and get the source file name from the symbol table. Convert
9695 source file name to corresponding object file name. Print info
9696 message when adding new input files.
9697 (parse_readelf_line): New function.
9698 * testsuite/plugin_test_1.sh: Add checks for new info messages.
9699 * testsuite/plugin_test_2.sh: Likewise.
9700 * testsuite/plugin_test_3.sh: Likewise.
9701 * testsuite/plugin_test_4.sh: New test case.
9702
62a6d109
ILT
97032009-01-07 Ian Lance Taylor <iant@google.com>
9704
9705 * version.cc (version_string): Bump to 1.8.
9706
483620e8
CC
97072008-12-23 Cary Coutant <ccoutant@google.com>
9708
9709 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
9710 * plugin.cc (Plugin_manager::finish): Rename as
9711 layout_deferred_objects. Move cleanup to separate function.
9712 (Plugin_manager::cleanup): New function.
9713 (Plugin_finish::run): Call layout_deferred_objects and cleanup
9714 separately.
9715 * plugin.h (Plugin_manager::finish): Rename as
9716 layout_deferred_objects.
9717 (Plugin_manager::cleanup): New function.
9718 (Plugin_manager::cleanup_done): New field.
9719
d66a9eb3
CC
97202008-12-23 Cary Coutant <ccoutant@google.com>
9721
9722 * plugin.cc (is_visible_from_outside): New function.
9723 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
9724 so we don't return "IR only" status for exported symbols or -r links.
9725
9726 * testsuite/Makefile.am (plugin_test_3): New test case.
9727 * testsuite/Makefile.in: Regenerate.
9728 * testsuite/plugin_test_3.sh: New file.
9729
5995b570
CC
97302008-12-22 Cary Coutant <ccoutant@google.com>
9731
9732 * object.cc (Sized_relobj::layout_section): New function.
9733 (Sized_relobj::do_layout): Defer layout of input sections until after
9734 plugin has provided replacement files.
9735 (Sized_relobj::do_layout_deferred_sections): New function.
9736 * object.h (Relobj::set_section_offset): Remove virtual keyword.
9737 (Relobj::layout_deferred_sections): New function.
9738 (Relobj::do_layout_deferred_sections): New function.
9739 (Sized_relobj::do_layout_deferred_sections): New function.
9740 (Sized_relobj::layout_section): New function.
9741 (Sized_relobj::Deferred_layout): New structure.
9742 (Sized_relobj::deferred_layout_): New field.
9743 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
9744 Change all callers. Layout deferred sections.
9745 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
9746 references.
9747 (Plugin_hook::run): Move code from do_plugin_hook inline.
9748 (Plugin_hook::do_plugin_hook): Remove.
9749 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
9750 (Plugin_manager::finish): Renamed, was cleanup.
9751 (Plugin_manager::should_defer_layout): New function.
9752 (Plugin_manager::add_deferred_layout_object): New function.
9753 (Plugin_manager::Deferred_layout_list): New type.
9754 (Plugin_manager::deferred_layout_objects_): New field.
9755 (Plugin_hook::do_plugin_hook): Remove.
9756
ee769c88
ILT
97572008-12-17 Ian Lance Taylor <iant@google.com>
9758
9759 * options.h (class General_options): Add --no case for
9760 --export-dynamic.
9761
abc8dcba
CC
97622008-12-16 Cary Coutant <ccoutant@google.com>
9763
9764 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
9765 vector.
9766 (Plugin_manager::claim_file): Create plugin object even if
9767 plugin did not call the add_symbols callback.
9768 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
9769 asking for more symbols than were added.
9770 * testsuite/Makefile.am (plugin_test_1): Add test case with
9771 no global symbols.
9772 (empty.syms): New target.
9773 * testsuite/Makefile.in: Regenerate.
9774 * testsuite/plugin_test.c (claim_file_hook): Add new debug
9775 message. Don't call add_symbols if no globals.
9776 (all_symbols_read_hook): Don't provide replacement for empty
9777 claimed file.
9778
b0074644
ILT
97792008-12-12 Ian Lance Taylor <iant@google.com>
9780
68943102
ILT
9781 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
9782 r_type == 0 for a local symbol with r_sym == 0.
9783 (scan_relocatable_relocs): Pass r_sym to
9784 local_non_section_strategy.
9785 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
9786 r_sym parameter.
9787
b0074644
ILT
9788 * configure.ac: Update test for TLS descriptors: they are
9789 supported as of glibc 2.9.
9790 * configure: Rebuild.
9791
c2508178
ILT
97922008-12-11 Ian Lance Taylor <iant@google.com>
9793
9794 PR 7091
9795 * target-reloc.h (Default_scan_relocatable_relocs): For each
9796 function, map r_type == 0 to RELOC_DISCARD.
9797
2756a258
CC
97982008-12-10 Cary Coutant <ccoutant@google.com>
9799
9800 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9801 object to override a kept COMDAT group from a plugin object.
9802
bb6f53d3
ILT
98032008-12-09 Ian Lance Taylor <iant@google.com>
9804
fbc558e1
ILT
9805 PR 7088
9806 * yyscript.y (file_cmd): Handle INPUT.
9807
bb6f53d3
ILT
9808 * testsuite/initpri1.c: Change all declarations to be full
9809 prototypes by adding void, to avoid compiler warnings.
9810
4674ecfc
CC
98112008-12-05 Rafael Avila de Espindola <espindola@google.com>
9812
9813 * options.cc (General_options::parse_plugin_opt): New.
9814 (General_options::add_plugin): The argument now is just the filename.
9815 (General_options::add_plugin_option): New.
9816 * options.h (plugin_opt): New.
9817 (add_plugin): Change argument name.
9818 (add_plugin_option): New.
9819 * plugin.cc (Plugin::load): Don't parse the plugin option.
9820 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9821 (Plugin::add_option): New.
9822 (Plugin::args_): Change type.
9823 (Plugin::filename_): New.
9824 (Plugin_manager::add_plugin_option): New.
9825 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9826 * testsuite/Makefile.in: Regenerate.
9827
fd06b4aa
CC
98282008-12-05 Cary Coutant <ccoutant@google.com>
9829
9830 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9831 Handle --strip-lto-sections option.
9832 * options.h (strip_lto_sections): New option.
9833
6c52134c
CC
98342008-12-01 Cary Coutant <ccoutant@google.com>
9835
9836 * plugin.cc (ld_plugin_message): Change format parameter to const.
9837 Fix mismatch between new[] and delete.
9838
a45248e0
CC
98392008-11-14 Cary Coutant <ccoutant@google.com>
9840
9841 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9842 instead of -1U.
9843
c82fbeee
CS
98442008-11-05 Craig Silverstein <csilvers@google.com>
9845
9846 * options.cc (General_options::parse_dynamic_list): New function.
9847 * options.h (General_options): New flags dynamic_list,
9848 dynamic_list_data, dynamic_list_cpp_new, and
9849 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9850 (General_options::in_dynamic_list): New function.
9851 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9852 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9853 (Lex::can_continue_name): Likewise.
9854 (yylex): Likewise.
9855 (read_script_file): New parameter script_options.
9856 (read_dynamic_list): New function.
9857 (Script_options::define_dynamic_list): New function.
9858 (dynamic_list_keyword_parsecodes): New variable.
9859 (dynamic_list_keywords): New variable.
9860 * script.h (Script_options::define_dynamic_list): New function
9861 prototype.
9862 (read_dynamic_list): New function prototype.
9863 * symtab.cc (strprefix): New macro.
9864 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9865 dynamic_list_data, dynamic_list_cpp_new, and
9866 dynamic_list_cpp_typeinfo.
9867 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9868 (dynamic_list_expr): New rule.
9869 (dynamic_list_nodes): Likewise.
9870 (dynamic_list_node): Likewise.
9871 * testsuite/Makefile.am (dynamic_list): New test.
9872 * testsuite/Makefile.in: Regenerated.
9873 * testsuite/dynamic_list.t: New file.
9874 * testsuite/dynamic_list.sh: New file.
9875
e0bb29a5
CS
98762008-11-05 Craig Silverstein <csilvers@google.com>
9877
9878 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9879 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9880 (t11_last): Likewise.
9881 * testsuite/ver_test_6.c (main): Likewise.
9882
4e1e25e0
CC
98832008-10-07 Cary Coutant <ccoutant@google.com>
9884
9885 * options.c (General_options::finalize): Add check for -static and
9886 -shared.
9887 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9888 is not empty.
9889
92f03fcb
CC
98902008-10-02 Cary Coutant <ccoutant@google.com>
9891
9892 * plugin.cc (make_sized_plugin_object): Fix conditional
9893 compilation to work when not all targets are enabled.
9894
fbd8a257
CC
98952008-09-29 Cary Coutant <ccoutant@google.com>
9896
9897 * archive.cc (Archive::get_file_and_offset): Use filename instead
9898 of name to get library path.
9899 (Archive::include_member): Unlock external member of a thin archive.
9900
9901 * testsuite/Makefile.am (TEST_AR): New variable.
9902 (thin_archive_test_1): New test.
9903 (thin_archive_test_2): New test.
81636b3f
CC
9904 * testsuite/Makefile.in: Regenerate.
9905 * testsuite/thin_archive_main.cc: New file.
9906 * testsuite/thin_archive_test_1.cc: New file.
9907 * testsuite/thin_archive_test_2.cc: New file.
9908 * testsuite/thin_archive_test_3.cc: New file.
9909 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9910
eff45813
CC
99112008-09-29 Cary Coutant <ccoutant@google.com>
9912
9913 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9914 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9915 instead of -1U.
9916 (Sized_relobj::do_finalize_local_symbols): Likewise.
9917 (Sized_relobj::map_to_kept_section): Likewise.
9918 * object.h (Sized_relobj::invalid_address): New constant.
9919 (Sized_relobj::do_output_section_offset): Check for invalid_address
9920 and return -1ULL.
9921 * output.cc (Output_reloc::local_section_offset): Use constant
9922 invalid_address instead of -1U.
9923 (Output_reloc::get_address): Likewise.
9924 (Output_section::output_address): Change -1U to -1ULL.
9925 * output.h (Output_reloc::invalid_address): New constant.
9926 * reloc.cc (Sized_relobj::write_sections): Use constant
9927 invalid_address instead of -1U.
9928 (Sized_relobj::relocate_sections): Likewise.
9929 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9930 values for merge sections.
9931 * target-reloc.h (relocate_for_relocatable): Use constant
9932 invalid_address instead of -1U.
9933
89fc3421
CC
99342008-09-19 Cary Coutant <ccoutant@google.com>
9935
9936 Add plugin functionality for link-time optimization (LTO).
9937 * configure.ac (plugins): Add --enable-plugins option.
9938 * configure: Regenerate.
9939 * config.in: Regenerate.
9940 * Makefile.am (LIBDL): New variable.
9941 (CCFILES): Add plugin.cc.
9942 (HFILES): Add plugin.h.
9943 (ldadd_var): Add LIBDL.
9944 * Makefile.in: Regenerate.
9945
9946 * archive.cc: Include "plugin.h".
9947 (Archive::setup): Don't preread archive symbols when using a plugin.
9948 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9949 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9950 files.
9951 (Archive::include_member): Add symbols from plugin objects.
9952 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9953 * descriptors.cc (Descriptors::open): Check for file descriptors
9954 abandoned by plugins.
9955 (Descriptors::claim_for_plugin): New function.
9956 * descriptors.h (Descriptors::claim_for_plugin): New function.
9957 (Open_descriptor::is_claimed): New field.
9958 (claim_descriptor_for_plugin): New function.
9959 * fileread.cc (File_read::claim_for_plugin): New function.
9960 * fileread.h (File_read::claim_for_plugin): New function.
9961 (File_read::descriptor): New function.
9962 * gold.cc: Include "plugin.h".
9963 (queue_initial_tasks): Add task to call plugin hooks for generating
9964 new object files.
9965 * main.cc: Include "plugin.h".
9966 (main): Load plugin libraries.
9967 * object.h (Pluginobj): Declare.
9968 (Object::pluginobj): New function.
9969 (Object::do_pluginobj): New function.
9970 (Object::set_target): New function.
9971 * options.cc: Include "plugin.h".
9972 (General_options::parse_plugin): New function.
9973 (General_options::General_options): Initialize plugins_ field.
9974 (General_options::add_plugin): New function.
9975 * options.h (Plugin_manager): Declare.
9976 (General_options): Add --plugin option.
9977 (General_options::has_plugins): New function.
9978 (General_options::plugins): New function.
9979 (General_options::add_plugin): New function.
9980 (General_options::plugins_): New field.
9981 * plugin.cc: New file.
9982 * plugin.h: New file.
9983 * readsyms.cc: Include "plugin.h".
9984 (Read_symbols::do_read_symbols): Check for archive before checking
9985 for ELF file. Call plugin hooks to claim files.
9986 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9987 from a real object file; force override when processing replacement
9988 files.
9989 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9990 (Symbol::init_base_object): Likewise.
9991 (Symbol::init_base_output_data): Likewise.
9992 (Symbol::init_base_output_segment): Likewise.
9993 (Symbol::init_base_constant): Likewise.
9994 (Symbol::init_base_undefined): Likewise.
9995 (Symbol::output_section): Assert that object is not a plugin.
9996 (Symbol_table::add_from_pluginobj): New function.
9997 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9998 undefined.
9999 (Symbol_table::sized_write_globals): Likewise.
10000 (Symbol_table::add_from_pluginobj): Instantiate template.
10001 * symtab.h (Sized_pluginobj): Declare.
10002 (Symbol::in_real_elf): New function.
10003 (Symbol::set_in_real_elf): New function.
10004 (Symbol::in_real_elf_): New field.
10005 (Symbol_table::add_from_pluginobj): New function.
10006
10007 * testsuite/Makefile.am (AM_CFLAGS): New variable.
10008 (LIBDL): New variable.
10009 (LDADD): Add LIBDL.
10010 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
10011 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
10012 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
10013 (MOSTLYCLEANFILES): Likewise.
10014 * testsuite/Makefile.in: Regenerate.
10015 * testsuite/plugin_test.c: New file.
10016 * testsuite/plugin_test_1.sh: New file.
10017 * testsuite/plugin_test_2.sh: New file.
10018
de31bda5
ILT
100192008-09-16 Ian Lance Taylor <iant@google.com>
10020
9c2d0ef9
ILT
10021 * target-reloc.h (relocate_section): Check whether a symbol is
10022 defined by the ABI before reporting an undefined symbol error.
10023 * target.h (Target::is_defined_by_abi): Make parameter const.
10024 (Target::do_is_defined_by_abi): Likewise.
10025 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
10026 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
10027 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
10028 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
10029 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
10030 * testsuite/Makefile.in: Rebuild.
10031
de31bda5
ILT
10032 * fileread.cc (make_view): Add casts to avoid warning.
10033
9fa33bee
AO
100342008-09-16 Alexandre Oliva <aoliva@redhat.com>
10035
10036 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
10037 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10038
183fd0e3
AO
100392008-09-16 Alexandre Oliva <aoliva@redhat.com>
10040
10041 * options.h (General_options::output_is_executable): New.
10042 (General_options::output_is_pie): New.
10043 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
10044 for shared libraries.
10045 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
10046
7be8330a
CD
100472008-09-11 Chris Demetriou <cgd@google.com>
10048
10049 * options.h (origin): New -z option.
10050 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
10051 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
10052 in DT_FLAGS_1.
10053
a9caad02
CC
100542008-09-05 Cary Coutant <ccoutant@google.com>
10055
10056 * fileread.cc (File_read::make_view): Add check for attempt to map
10057 beyond end of file.
10058
ae6dce4d
CC
100592008-09-05 Cary Coutant <ccoutant@google.com>
10060
10061 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
10062 explicit instantiations.
10063
d7ab2a47
KVH
100642008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
10065
10066 PR gold/6858
10067 * options.cc (General_options::finalize): Allow undefined symbols
10068 in shlibs if linking -shared.
10069
10070 PR gold/6859
10071 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
10072 symbols as not needing a dynsym entry.
10073
1e52a9c1
CS
100742008-08-20 Craig Silverstein <csilvers@google.com>
10075
10076 * fileread.cc (File_read::open): Do not lock the file unless it
10077 was successfully opened.
10078
d85c80a3
CC
100792008-08-14 Cary Coutant <ccoutant@google.com>
10080
10081 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
10082 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
10083 * testsuite/tls_test.cc (struct int128): 128-bit struct
10084 for testing TLS relocs with non-zero addend.
10085 (v12): New TLS variable.
10086 (t12): New test.
10087 (t_last): Add check for v12.
10088 * testsuite/tls_test.h (t12): New function.
10089 * testsuite/tls_test_main.cc (thread_routine): Call new test.
10090
2d924fd9
ILT
100912008-08-13 Ian Lance Taylor <iant@google.com>
10092
10093 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
10094 set tls_segment_ or relro_segment_.
10095 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
10096 when appropriate.
10097 * output.h (Output_section::clear_is_relro): New function.
10098 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
10099 sections specially even when output_data_ is empty.
10100 (Output_segment::maximum_alignment): When first section is relro,
10101 only force alignment for PT_LOAD segments.
10102 * script.cc (script_data_segment_align): New function.
10103 (script_data_segment_relro_end): New function.
10104 * script-c.h (script_data_segment_align): Declare.
10105 (script_data_segment_relro_end): Declare.
10106 * script-sections.h (class Script_sections): Declare
10107 data_segment_align and data_segment_relro_end. Add fields
10108 segment_align_index_ and saw_relro_end_.
10109 * script-sections.cc (class Sections_element): Add set_is_relro
10110 virtual function. Add new bool* parameter to place_orphan_here.
10111 Add get_output_section virtual function.
10112 (class Output_section_definition): Add set_is_relro. Add new
10113 bool* parameter to place_orphan_here. Add get_output_section.
10114 Add is_relro_ field.
10115 (Output_section_definition::Output_section_definition): Initialize
10116 evaluated_address_, evaluated_load_address, evaluated_addralign_,
10117 and is_relro_ fields.
10118 (Output_section_definition::place_orphan_here): Add is_relro
10119 parameter.
10120 (Output_section_definition::set_section_addresses): Set relro for
10121 output section.
10122 (Output_section_definition::alternate_constraint): Likewise.
10123 (class Orphan_output_section): Add new bool* parameter to
10124 place_orphan_here. Add get_output_section.
10125 (Orphan_output_section::place_orphan_here): Add is_relro
10126 parameter.
10127 (Script_sections::Script_sections): Initialize
10128 data_segment_align_index_ and saw_relro_end_.
10129 (Script_sections::data_segment_align): New function.
10130 (Script_sections::data_segment_relro_end): New function.
10131 (Script_sections::place_orphan): Set or clear is_relro.
10132 (Script_sections::set_section_addresses): Force alignment of first
10133 TLS section.
10134 * yyscript.y (exp): Call script_data_segment_align and
10135 script_data_segment_relro_end.
10136 * testsuite/relro_script_test.t: New file.
10137 * testsuite/relro_test.cc (using_script): Declare.
10138 (t1, t2): Test using_script.
10139 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
10140 (relro_script_test_SOURCES): Define.
10141 (relro_script_test_DEPENDENCIES): Define.
10142 (relro_script_test_LDFLAGS): Define.
10143 (relro_script_test_LDADD): Define.
10144 (relro_script_test.so): New target.
10145 * testsuite/Makefile.in: Rebuild.
10146
f827c9a9
CC
101472008-08-06 Cary Coutant <ccoutant@google.com>
10148
10149 * archive.cc (Archive::total_archives, Archive::total_members)
10150 (Archive::total_members_loaded): New variables.
10151 (Archive::setup): Add parameter. Add option to preread
10152 archive symbols.
10153 (Archive::read_armap): Add counter.
10154 (Archive::get_file_and_offset): New function.
10155 (Archive::get_elf_object_for_member): New function.
10156 (Archive::read_all_symbols): New function.
10157 (Archive::read_symbols): New function.
10158 (Archive::add_symbols): Add counters.
10159 (Archive::include_all_members): Use armap to find members if it's
10160 already built.
10161 (Archive::include_member): Skip reading symbols if already read.
10162 Factored code into Archive::get_file_and_offset and
10163 Archive::get_elf_object_for_member. Changed call to
10164 Mapfile::report_include_archive_member.
10165 (Archive::print_stats): New function.
10166 * archive.h: Declare Object and Read_symbols_data classes.
10167 (Archive::Archive): Add initializers for new members.
10168 (Archive::setup): Add parameter.
10169 (Archive::print_stats): New function.
10170 (Archive::total_archives, Archive::total_members)
10171 (Archive::total_members_loaded): New variables.
10172 (Archive::get_file_and_offset): New function.
10173 (Archive::get_elf_object_for_member): New function.
10174 (Archive::read_all_symbols): New function.
10175 (Archive::read_symbols): New function.
10176 (Archive::Archive_member): New class.
10177 (Archive::members_): New member.
10178 (Archive::num_members_): New member.
10179 * main.cc: Include archive.h.
10180 (main): Call Archive::print_stats.
10181 * mapfile.cc (Mapfile::report_include_archive_member): Delete
10182 archive parameter; member_name is now the fully-decorated name.
10183 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
10184 * options.h: (General_options): Add --preread-archive-symbols option.
10185 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
10186 Archive::setup.
10187
de4c45bd
ILT
101882008-08-04 Ian Lance Taylor <iant@google.com>
10189
10190 * symtab.h (Symbol::use_plt_offset): New function.
10191 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
10192 * powerpc.cc (Relocate::relocate): Likewise.
10193 * sparc.cc (Relocate::relocate): Likewise.
10194 * x86_64.cc (Relocate::relocate): Likewise.
10195 * testsuite/weak_plt.sh: New test.
10196 * testsuite/weak_plt_main.cc: New test.
10197 * testsuite/weak_plt_shared.cc: New test.
10198 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
10199 (check_PROGRAMS): Add weak_plt.
10200 (check_DATA): Add weak_plt_shared.so.
10201 (weak_plt_main_pic.o, weak_plt): New targets.
10202 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
10203 * testsuite/Makefile.in: Rebuild.
10204
10205 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
10206 gcctestdir/ld.
10207 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
10208 * testsuite/Makefile.in: Rebuild.
10209
323ee3f4
AM
102102008-08-04 Alan Modra <amodra@bigpond.net.au>
10211
10212 * Makefile.am (POTFILES.in): Set LC_ALL=C.
10213 * Makefile.in: Regenerate.
10214 * po/POTFILES.in: Regenerate.
10215
7c07ecec
ILT
102162008-07-29 Ian Lance Taylor <iant@google.com>
10217
10218 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
10219 symbols before other symbols.
10220 * testsuite/script_test_2.cc (test_addr): Declare.
10221 (test_addr_alias): Declare.
10222 (main): Check that test_addr and test_addr_alias have the right
cd536b21 10223 values.
7c07ecec
ILT
10224 * testsuite/script_test_2.t: Define test_addr_alias and
10225 test_addr.
10226
5778530e
ILT
102272008-07-24 Ian Lance Taylor <iant@google.com>
10228
2a00e4fb
ILT
10229 PR 5990
10230 * descriptors.cc: New file.
10231 * descriptors.h: New file.
10232 * gold-threads.h (class Hold_optional_lock): New class.
10233 * fileread.cc: Include "descriptors.h".
10234 (File_read::~File_read): Release descriptor rather than closing
10235 it.
10236 (File_read::open) [file]: Call open_descriptor rather than open.
10237 Set is_descriptor_opened_.
10238 (File_read::open) [memory]: Assert that descriptor is not open.
10239 (File_read::reopen_descriptor): New function.
10240 (File_read::release): Release descriptor.
10241 (File_read::do_read): Make non-const. Reopen descriptor.
10242 (File_read::read): Make non-const.
10243 (File_read::make_view): Reopen descriptor.
10244 (File_read::do_readv): Likewise.
10245 * fileread.h (class File_read): Add is_descriptor_opened_ field.
10246 Update declarations.
10247 * layout.cc: Include "descriptors.h".
10248 (Layout::create_build_id): Use open_descriptor rather than open.
10249 * output.cc: Include "descriptors.h".
10250 (Output_file::open): Use open_descriptor rather than open.
10251 * archive.cc (Archive::const_iterator): Change Archive to be
10252 non-const.
10253 (Archive::begin, Archive::end): Make non-const.
10254 (Archive::count_members): Likewise.
10255 * archive.h (class Archive): Update declarations.
10256 * object.h (Object::read): Make non-const.
10257 * Makefile.am (CCFILES): Add descriptors.cc.
10258 (HFILES): Add descriptors.h.
10259 * Makefile.in: Rebuild.
10260
801647d1
ILT
10261 PR 6716
10262 * gold.h: Always include <clocale>. Add Solaris workarounds
10263 following code in binutils/sysdep.h.
10264
5edd166e
ILT
10265 PR 6048
10266 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
10267 this->eh_frame_hdr_ is NULL before using it.
10268
c89ad728
ILT
10269 * dynobj.cc (Versions::Versions): Update comment.
10270
aa86f06b
ILT
10271 * dynobj.cc (Versions::Versions): If there is an soname, use it as
10272 the base version name.
10273
5778530e
ILT
10274 * stringpool.cc (Stringpool_template::add_with_length): Set key to
10275 array size plus one.
10276 (Stringpool_template::set_string_offsets): Subtract one from key
10277 before using it as an array index.
10278 (Stringpool_template::get_offset_with_length): Likewise.
10279 (Stringpool_template::write_to_buffer): Likewise.
10280 * stringpool.h (Stringpool_template::get_offset_from_key):
10281 Likewise.
10282
057ead22
ILT
102832008-07-23 Ian Lance Taylor <iant@google.com>
10284
7f649c59
ILT
10285 PR 6658
10286 * object.h (Merged_symbol_value::value): Do our best to handle a
10287 negative addend.
10288
057ead22
ILT
10289 PR 6647
10290 * script.cc (Version_script_info::get_versions): Don't add empty
10291 version tag to return value.
10292 (Version_script_info::get_symbol_version_helper): Change return
10293 type to bool. Add pversion parameter. Change all callers.
10294 (script_register_vers_node): Don't require a non-NULL tag.
10295 * script.h (class Version_script_info): Update declarations.
10296 (Version_script_info::get_symbol_version): Change return type to
10297 bool. Add version parameter. Change all callers.
10298 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
10299 handling. Handle an empty version from a version script.
10300 (Symbol_table::define_special_symbol): Likewise.
10301 * testsuite/ver_test_10.script: New file.
10302 * testsuite/ver_test_10.sh: New file.
10303 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
10304 (check_DATA): Add ver_test_10.syms.
10305 (ver_test_10.syms, ver_test_10.so): New target.
10306 * testsuite/Makefile.in: Rebuild.
10307
58e54ac2
CD
103082008-07-23 Simon Baldwin <simonb@google.com>
10309
10310 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
10311 to zero for undefined symbols from dynamic libraries.
10312
95d14cd3
ILT
103132008-07-23 Ian Lance Taylor <iant@google.com>
10314
10315 * symtab.cc (Symbol_table::resolve): Remove version parameter.
10316 Change all callers.
10317 * symtab.h (class Symbol_table): Update declaration.
10318 * testsuite/ver_test_9.cc: New file.
10319 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
10320 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
10321 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
10322 (ver_test_9.so, ver_test_9.o): New targets.
10323 * testsuite/Makefile.in: Rebuild.
10324
92de84a6
ILT
103252008-07-22 Ian Lance Taylor <iant@google.com>
10326
34810851
ILT
10327 * options.h (class General_options): Define --check-sections.
10328 * layout.cc (Layout::set_segment_offsets): Handle
10329 --check-sections.
10330
af6156ef
ILT
10331 * options.h (class General_options): Define -n/--nmagic and
10332 -N/--omagic.
10333 * options.cc (General_options::finalize): For -n/--nmagic or
10334 -N/--omagic, set -static.
10335 * layout.cc (Layout::attach_allocated_section_to_segment): If
10336 -N/--omagic, don't put read-only and read-write sections in
10337 different segments.
10338 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
10339 finding a read-only segment.
10340 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
10341 don't set the minimum segment alignment to the common page size,
10342 and don't set the file offset to the address modulo the page size.
10343 * script-sections.cc (Script_sections::create_segments): If
10344 -n/--omagic, don't put read-only and read-write sections in
10345 different segments.
10346
92de84a6
ILT
10347 * cref.cc: New file.
10348 * cref.h: New file.
10349 * options.h (class General_options): Add --print-symbol-counts.
10350 * main.cc (main): Issue defined symbol report if requested.
10351 * archive.cc (Archive::interpret_header): Make into a const member
10352 function.
10353 (Archive::add_symbols): Call Input_objects::archive_start and
10354 archive_stop.
10355 (Archive::const_iterator): Define new class.
10356 (Archive::begin, Archive::end): New functions.
10357 (Archive::include_all_members): Rewrite to use iterator.
10358 (Archive::count_members): New function.
10359 * archive.h (class Archive): Update declarations.
10360 (Archive::filename): New function.
10361 * object.cc: Include "cref.h".
10362 (Sized_relobj::Sized_relobj): Initialize defined_count_.
10363 (Sized_relobj::do_get_global_symbol_counts): New function.
10364 (Input_objects::add_object): Add object to cross-referencer.
10365 (Input_objects::archive_start): New function.
10366 (Input_objects::archive_stop): New function.
10367 (Input_objects::print_symbol_counts): New function.
10368 * object.h: Declare Cref and Archive.
10369 (Object::get_global_symbol_counts): New function.
10370 (Object::do_get_global_symbol_counts): New pure virtual function.
10371 (class Sized_relobj): Add defined_count_ field. Update
10372 declarations.
10373 (class Input_objects): Add cref_ field. Update constructor.
10374 Update declarations.
10375 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
10376 defined_count_.
10377 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
10378 symbol counts.
10379 (Sized_dynobj::do_get_global_symbol_counts): New function.
10380 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
10381 defined_count_. Update declarations. Define Symbols typedef.
10382 * symtab.cc (Symbol_table::add_from_relobj): Add defined
10383 parameter. Change all callers.
10384 (Symbol_table::add_from_dynobj): Add sympointers and defined
10385 parameters. Change all callers.
10386 * symtab.h (class Symbol_table): Update declarations.
10387 * Makefile.am (CCFILES): Add cref.cc.
10388 (HFILES): Add cref.h.
10389 * Makefile.in: Rebuild.
10390
3f7c5e1d
CD
103912008-07-22 Simon Baldwin <simonb@google.com>
10392
10393 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
10394 to zero when writing undefined symbols.
10395
e0b64032
ILT
103962008-07-22 Ian Lance Taylor <iant@google.com>
10397
10398 * output.cc (Output_section::add_input_section): Don't try to
10399 merge empty merge sections.
10400
096b02cf
CS
104012008-07-21 Craig Silverstein <csilvers@google.com>
10402
10403 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10404 Include symbol version in error message.
cd536b21 10405
1d1f116d
CD
104062008-07-20 Chris Demetriou <cgd@google.com>
10407
cd536b21 10408 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
10409 (RANDOM_SEED_CFLAGS): New substituted variable.
10410 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
10411 * configure: Rebuild.
10412 * Makefile.in: Likewise.
10413 * testsuite/Makefile.in: Likewise.
10414
a18f591e
ILT
104152008-07-18 Ian Lance Taylor <iant@google.com>
10416
10417 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
10418 where we see NAME/NULL and NAME/VERSION as separate symbols.
10419 * testsuite/ver_test_main.cc (main): Call t4.
10420 (t4, t4_2a): Define.
10421 * testsuite/ver_test_2.cc (t4_2): Define.
10422 * testsuite/ver_test_2.script: Put t4_2a in VER2.
10423 * testsuite/ver_test_4.cc (t4_2a): Define.
10424 * testsuite/ver_test_4.script: Put t4_2a in VER2.
10425 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
10426
c6e3f6ed
ILT
104272008-07-17 Ian Lance Taylor <iant@google.com>
10428
10429 * dynobj.cc (Versions::add_def): If we give an error about a
10430 missing version, go ahead and create the version anyhow.
10431
ef9beddf
ILT
104322008-07-10 Ian Lance Taylor <iant@google.com>
10433
10434 Handle output sections with more than 0x7fffffff bytes.
10435 * object.h (class Relobj): Change map_to_output_ to
10436 output_sections_, and just keep a section pointer. Change all
10437 uses. Move comdat group support to Sized_relobj.
10438 (Relobj::is_section_specially_mapped): Remove.
10439 (Relobj::output_section): Remove poff parameter. Change all
10440 callers.
10441 (Relobj::output_section_offset): New function.
10442 (Relobj::set_section_offset): Rewrite.
10443 (Relobj::map_to_output): Remove.
10444 (Relobj::output_sections): New function.
10445 (Relobj::do_output_section_offset): New pure virtual function.
10446 (Relobj::do_set_section_offset): Likewise.
10447 (class Sized_relobj): Add section_offsets_ field. Add comdat
10448 group support from Relobj. Update declarations.
10449 (Sized_relobj::get_output_section_offset): New function.
10450 (Sized_relobj::do_output_section_offset): New function.
10451 (Sized_relobj::do_set_section_offset): New function.
10452 * object.cc (Relobj::output_section_address): Remove.
10453 (Sized_relobj::Sized_relobj): Initialize new fields.
10454 (Sized_relobj::include_section_group): Cast find_kept_object to
10455 Sized_relobj.
10456 (Sized_relobj::include_linkonce_section): Likewise.
10457 (Sized_relobj::do_layout): Use separate arrays for output section
10458 and output offset.
10459 (Sized_relobj::do_count_local_symbols): Change map_to_output to
10460 output_sections.
10461 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
10462 output_sections and section_offsets.
10463 (Sized_relobj::write_local_symbols): Likewise.
10464 (map_to_kept_section): Compute output address directly.
10465 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
10466 output_sections and section_offsets.
10467 (Sized_relobj::write_sections): Likewise.
10468 (Sized_relobj::relocate_sections): Likewise.
10469 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
10470 * output.h (class Output_reloc): Update declarations. Change
10471 u2_.relobj to Sized_relobj*.
10472 (class Output_data_reloc): Change add functions to use
10473 Sized_relobj*.
10474 * output.cc (Output_reloc::Output_reloc): Change relobj to
10475 Sized_relobj*.
10476 (Output_reloc::local_section_offset): Change return type to
10477 Elf_Addr. Use get_output_section_offset.
10478 (Output_reloc::get_address): Likewise.
10479 (Output_section::is_input_address_mapped): Don't call
10480 is_section_specially_mapped.
10481 (Output_section::output_offset): Likewise.
10482 (Output_section::output_address): Likewise.
10483 (Output_section::starting_output_address): Likewise.
10484 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
10485 parameter to Sized_relobj*.
10486 (Copy_relocs::need_copy_reloc): Likewise.
10487 (Copy_relocs::save): Likewise.
10488 * copy-relocs.h (class Copy_relocs): Update declarations.
10489 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
10490 Sized_relobj*. Change relobj_ field to Sized_relobj*.
10491 * target-reloc.h (relocate_for_relocatable): Change
10492 offset_in_output_section type to Elf_Addr. Change code that uses
10493 it as well.
10494 * layout.cc (Layout::layout): Always set *off.
10495 * mapfile.cc (Mapfile::print_input_section): Use
10496 output_section_offset.
10497 * i386.cc (Target_i386::copy_reloc): Change object parameter to
10498 Sized_relobj*.
10499 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
10500 * sparc.cc (Target_sparc::copy_reloc): Likewise.
10501 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
10502
5cb66f97
ILT
105032008-07-03 Ian Lance Taylor <iant@google.com>
10504
10505 * layout.cc (Layout::include_section): Do not discard unrecognized
10506 SHT_STRTAB sections.
10507
afe47622
CS
105082008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
10509
10510 * script.cc (Lex::can_continue_name): Make '?' allowable in
10511 version-script names.
10512 * testsuite/version_script.map: Change glob pattern to use '?'
10513
5adf9721
ILT
105142008-06-30 Manish Singh <yosh@gimp.org>
10515
10516 PR 6585
10517 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
10518 Correct typo.
10519
e6fde208
ILT
105202008-06-30 Ian Lance Taylor <iant@google.com>
10521
10522 PR 6660
10523 PR 6682
10524 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
10525 versions]: Don't try to read the value in the contents, since we
10526 don't use it. Use the template endianness when writing.
10527
3f2e6a2d
CC
105282008-06-25 Cary Coutant <ccoutant@google.com>
10529
10530 * fileread.cc (File_read::make_view): Assert on zero-length view.
10531 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
10532 symbol table when there are no symbols to read.
10533
c43d3a48
CS
105342008-06-23 Craig Silverstein <csilvers@google.com>
10535
10536 * version.cc (version_string): Bump to 1.7
10537
5f494ea0
CS
105382008-06-18 Craig Silverstein <csilvers@google.com>
10539
10540 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
10541 constant 0xFFFF to type Valtype.
10542 (Powerpc_relocate_functions::rel16_ha): Likewise.
10543
c42e122e
ILT
105442008-06-17 Ian Lance Taylor <iant@google.com>
10545
f34787f8
ILT
10546 * output.h (Output_section::Input_section): Initialize p2align_ to
10547 zero for Output_section_data constructors.
10548 (Output_section::Input_section::addralign): If not an input
10549 section, return the alignment of the Output_section_data.
10550 * testsuite/copy_test.cc: New file.
10551 * testsuite/copy_test_1.cc: New file.
10552 * testsuite/copy_test_2.cc: New file.
10553 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
10554 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
10555 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
10556 (copy_test_1_pic.o, copy_test_1.so): New targets.
10557 (copy_test_2_pic.o, copy_test_2.so): New targets.
10558 * testsuite/Makefile.in: Rebuild.
10559
c42e122e
ILT
10560 * script-sections.cc (Script_sections::place_orphan): Initialize
10561 local variable exact.
10562
ce3ac18a
DE
105632008-06-13 David Edelsohn <edelsohn@gnu.org>
10564
10565 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
10566
42cacb20
DE
105672008-06-12 David Edelsohn <edelsohn@gnu.org>
10568 David S. Miller <davem@davemloft.net>
10569
10570 * powerpc.cc: New file.
10571 * Makefile.am (TARGETSOURCES): Add powerpc.cc
10572 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
10573 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
10574 * Makefile.in: Rebuild.
10575
7b308235
ILT
105762008-06-09 Ian Lance Taylor <iant@google.com>
10577
10578 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
10579 <exception>.
10580 (throwing, orig_terminate): New static variables.
10581 (terminate_handler): New static function.
10582 (t2): Set terminate handler.
10583
f0b886e3
ILT
105842008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
10585
10586 PR 6584
cd536b21 10587 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
10588 alignment.
10589
3e90f135
CC
105902008-05-30 Cary Coutant <ccoutant@google.com>
10591
10592 * archive.cc (Archive::include_all_members) Correct to step
10593 over symbol table and extended name table in thin archives.
10594
e09ad04a
ILT
105952008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
10596
10597 PR 6407
10598 * target-reloc.h (relocate_for_relocatable): Fix new_offset
10599 calculation.
10600
62b01cb5
ILT
106012008-05-28 Caleb Howe <cshowe@google.com>
10602
10603 * reduced_debug_output.cc: New file.
10604 * reduced_debug_output.h: New file.
92de84a6 10605 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
10606 * options.cc (General_options::finalize): Add strip_debug_non_line
10607 to the strip heirarchy.
10608 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
10609 fields.
10610 * layout.cc: Include "reduced_debug_output.h".
10611 (Layout::Layout): Initialize new fields.
10612 (line_only_debug_sections): New static array.
10613 (is_lines_only_debug_sections): New static inline function.
10614 (Layout::include_section): Handle --strip-debug-non-line.
10615 (Layout::make_output_section): If --strip-debug-non-line, build
10616 new output sections for .debug_abbrev and .debug_info.
10617 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
10618 gold. Warn about possible overflow.
10619 (read_signed_LEB_128): Likewise.
10620 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
10621 (read_signed_LEB_128): Declare.
10622 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
10623 (HFILES): Add reduced_debug_output.h.
10624 * Makefile.in: Rebuild.
10625
7d9e3d98
ILT
106262008-05-21 Ian Lance Taylor <iant@google.com>
10627
10628 * mapfile.cc: New file.
10629 * mapfile.h: New file.
10630 * options.h (class General_options): Add -M/--print-map and -Map.
10631 * options.cc (General_options::finalize): Make -M equivalent to
10632 -Map -.
10633 * main.cc: Include <cstdio> and "mapfile.h".
10634 (main): Open mapfile if requested.
10635 * gold.cc (class Middle_runner): Add mapfile_ field. Update
10636 constructor. Change caller.
10637 (queue_initial_tasks): Add mapfile parameter. Change caller.
10638 (queue_middle_tasks): Likewise.
10639 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
10640 declarations.
10641 * archive.cc: Include "mapfile.h".
10642 (Archive::add_symbols): Add mapfile parameter. Change all
10643 callers. Pass mapfile, symbol, and reason to include_member.
10644 (Archive::include_all_members): Add mapfile parameter. Change all
10645 callers.
10646 (Archive::include_member): Add mapfile, sym, and why parameters.
10647 Change all callers. Report inclusion to map file.
10648 * archive.h: Include "fileread.h".
10649 (class Archive): Update declarations.
10650 (Archive::file): New const method.
10651 (class Add_archive_symbols): Add mapfile_ field. Update
10652 constructor. Change all callers.
10653 * readsyms.h (class Read_symbols): Likewise.
10654 (class Finish_group): Likewise.
10655 (class Read_script): Likewise.
10656 * common.cc: Include "mapfile.h".
10657 (Symbol_table::allocate_commons): Add mapfile parameter. Change
10658 all callers.
10659 (Symbol_table::do_allocate_commons): Likewise.
10660 (Symbol_table::do_allocate_commons_list): Likewise. Report common
10661 symbol allocation to mapfile.
10662 * common.h (class Allocate_commons_task): Add mapfile_ field.
10663 Update constructor. Change all callers.
10664 * symtab.h (class Symbol_table): Update declarations.
10665 * layout.cc: Include "mapfile.h".
10666 (Layout_task_runner::run): Print information to mapfile.
10667 (Layout::create_gold_note): Change Output_data_fixed_space to
10668 Output_data_zero_fill.
10669 (Layout::create_build_id): Likewise.
10670 (Layout::print_to_mapfile): New function.
10671 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
10672 constructor. Change caller.
10673 (class Layout): Declare print_to_mapfile.
10674 * output.cc (Output_section::Input_section::print_to_mapfile): New
10675 function.
10676 (Output_section::add_input_section): If producing a map, always
10677 add to input_sections_ list.
10678 (Output_section::do_print_to_mapfile): New function.
10679 (Output_segment::print_sections_to_mapfile): New function.
10680 (Output_segment::print_section_list_to_mapfile): New function.
10681 * output.h: Include "mapfile.h".
10682 (Output_data::print_to_mapfile): New function.
10683 (Output_data::do_print_to_mapfile): New virtual function.
10684 (Output_segment_headers::do_print_to_mapfile): New function.
10685 (Output_file_header::do_print_to_mapfile): New function.
10686 (Output_data_const::do_print_to_mapfile): New function.
10687 (class Output_data_const_buffer): Add map_name_ field. Update
10688 constructor. Change all callers. Add do_print_to_mapfile
10689 function.
10690 (class Output_data_fixed_space): Likewise.
10691 (class Output_data_space): Likewise.
10692 (class Output_data_zero_fill): New class.
10693 (Output_data_strtab::do_print_to_mapfile): New function.
10694 (Output_data_reloc_base::do_print_to_mapfile): New function.
10695 (Output_relocatable_relocs::do_print_to_mapfile): New function.
10696 (Output_data_group::do_print_to_mapfile): New function.
10697 (Output_data_got::do_print_to_mapfile): New function.
10698 (Output_data_dynamic::do_print_to_mapfile): New function.
10699 (Output_symtab_xindex::do_print_to_mapfile): New function.
10700 (class Output_section): Declare do_print_to_mapflie. Declare
10701 print_to_mapfile in Input_section.
10702 (class Output_segment): Declare new functions.
10703 * object.h (Sized_relobj::symbol_count): New function.
10704 * script-sections.cc
10705 (Output_section_element_dot_assignment::set_section_addresses):
10706 Change Output_data_fixed_space to Output_data_zero_fill.
10707 (Output_data_expression::do_print_to_mapfile): New function.
10708 * script.cc (read_input_script): Add mapfile parameter. Change
10709 all callers.
10710 * script.h (read_input_script): Update declaration.
10711 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
10712 (Eh_frame::do_print_to_mapfile): New function.
10713 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
10714 (Output_merge_string::do_print_to_mapfile): New function.
10715 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
10716 function.
10717 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
10718 function.
10719 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
10720 function.
10721 * Makefile.am (CCFILES): Add mapfile.cc.
10722 (HFILES): Add mapfile.h.
10723 * Makefile.in: Rebuild.
10724
9f1d377b
ILT
107252008-05-19 Ian Lance Taylor <iant@google.com>
10726
10727 * options.h (class General_options): Add -z relro.
10728 * layout.cc (Layout::Layout): Initialize relro_segment_.
10729 (Layout::add_output_section_data): Return the output section.
10730 (Layout::make_output_section): Rcognize relro sections and mark
10731 them appropriately.
10732 (Layout::attach_allocated_section_to_segment): Put relro sections
10733 in a PT_GNU_RELRO segment.
10734 (Layout::create_initial_dynamic_sections): Mark the .dynamic
10735 section as relro.
10736 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
10737 PT_TLS segments.
10738 (Layout::linkonce_mapping): Map d.rel.ro.local to
10739 .data.rel.ro.local.
10740 (Layout::output_section_name): Us .data.rel.ro.local for any
10741 section which begins with that.
10742 * layout.h (class Layout): Update add_output_section_data
10743 declaration. Add relro_segment_ field.
10744 * output.cc (Output_section::Output_section): Initialize is_relro_
10745 and is_relro_local_ fields.
10746 (Output_segment::add_output_section): Group relro sections.
10747 (Output_segment::is_first_section_relro): New function.
10748 (Output_segment::maximum_alignment): If there is a relro section,
10749 align the segment to the common page size.
10750 (Output_segment::set_section_addresses): Track whether we are
10751 looking at relro sections. If the last section is a relro
10752 section, align to the common page size.
10753 (Output_segment::set_section_list_addresses): Add in_relro
10754 parameter. Change all callers. Align to the page size when
10755 moving from relro to non-relro section.
10756 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
10757 segment.
10758 * output.h (class Output_section): Add is_relro_ and
10759 is_relro_local_ fields.
10760 (Output_section::is_relro): New function.
10761 (Output_section::set_is_relro): New function.
10762 (Output_section::is_relro_local): New function.
10763 (Output_section::set_is_relro_local): New function.
10764 (class Output_segment): Update declarations.
10765 * i386.cc (Target_i386::got_section): Mark .got section as relro.
10766 * sparc.cc (Target_sparc::got_section): Likewise.
10767 * x86_64.cc (Target_x86_64::got_section): Likewise.
10768 * testsuite/relro_test_main.cc: New file.
10769 * testsuite/relro_test.cc: New file.
10770 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
10771 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
10772 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
10773 (relro_test.so, relro_test_pic.o): New targets.
10774 * testsuite/Makefile.in: Rebuild.
10775
a984ee1d
ILT
107762008-05-16 Ian Lance Taylor <iant@google.com>
10777
01676dcd
ILT
10778 * output.cc (Output_segment::add_output_section): Remove front
10779 parameter.
10780 * output.h (class Output_segment): Remove
10781 add_initial_output_section and overloaded add_output_section.
10782 Update declaration of remaining add_output_section.
10783 * layout.cc (Layout::create_interp): Call add_output_section
10784 rather than add_initial_output_section.
10785 (Layout::finish_dynamic_section): Likewise.
10786
497897f9
ILT
10787 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10788 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10789 know the dynamic type.
10790 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10791 field. Initialize it in constructor.
10792 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10793 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10794 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10795 reloc.
10796
a984ee1d
ILT
10797 * output.cc (Output_reloc::get_address): Change return type to
10798 Elf_Addr.
10799 * output.h (class Output_reloc): Update get_address declaration.
10800 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10801 for section addresses.
10802
55ba0940
ILT
108032008-05-09 Ian Lance Taylor <iant@google.com>
10804
10805 PR 6493
10806 * gold.cc (gold_nomem): Use return value of write.
10807
75517b77
ILT
108082008-05-08 Ian Lance Taylor <iant@google.com>
10809
10810 * symtab.c (Symbol::init_base_output_data): Add version
10811 parameter. Change all callers.
10812 (Symbol::init_base_output_segment): Likewise.
10813 (Symbol::init_base_constant): Likewise.
10814 (Symbol::init_base_undefined): Likewise.
10815 (Sized_symbol::init_output_data): Likewise.
10816 (Sized_symbol::init_output_segment): Likewise.
10817 (Sized_symbol::init_constant): Likewise.
10818 (Sized_symbol::init_undefined): Likewise.
10819 (Symbol_table::do_define_in_output_data): If the new symbol has a
10820 version, mark it as the default.
10821 (Symbol_table::do_define_in_output_segment): Likewise.
10822 (Symbol_table::do_define_as_constant): Likewise.
10823 * symtab.h (class Symbol): Update declarations.
10824 (class Sized_symbol): Likewise.
10825 * resolve.cc (Symbol::override_version): New function.
c42e122e 10826 (Symbol::override_base): Call override_version.
75517b77
ILT
10827 (Symbol::override_base_with_special): Likewise.
10828 * testsuite/ver_script_8.script: New file.
10829 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10830 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10831 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10832 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10833
f1f70eae
ILT
108342008-05-06 Ian Lance Taylor <iant@google.com>
10835
f3e9c5c5
ILT
10836 PR 6049
10837 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10838 functions.
10839 (class General_options): Remove existing --undefined, and add
10840 --no-undefined instead. Add new --undefined as synonym for -u.
10841 * archive.cc (Archive::add_symbols): Check whether symbol was
10842 named with -u.
10843 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10844 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10845 all uses. Add IS_UNDEFINED. Update declarations to split
10846 different versions of init_base. Declare init_base_undefined.
10847 (Symbol::is_defined): Handle IS_UNDEFINED.
10848 (Symbol::is_undefined): Likewise.
10849 (Symbol::is_weak_undefined): Call is_undefined.
10850 (Symbol::is_absolute): Handle IS_CONSTANT.
10851 (class Sized_symbol): Update declarations to split different
10852 versions of init. Declare init_undefined.
10853 (class Symbol_table): Declare new functions.
10854 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10855 Change all callers.
10856 (Symbol::init_base_output_data): Likewise.
10857 (Symbol::init_base_output_segment): Likewise.
10858 (Symbol::init_base_constant): Likewise.
10859 (Symbol::init_base_undefined): New function.
10860 (Sized_symbol::init_object): Rename from init. Change all
10861 callers.
10862 (Sized_symbol::init_output_data): Likewise.
10863 (Sized_symbol::init_output_segment): Likewise.
10864 (Sized_symbol::init_constant): Likewise.
10865 (Sized_symbol::init_undefined): New function.
10866 (Symbol_table::add_undefined_symbols_from_command_line): New
10867 function.
10868 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10869 function.
10870 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10871 (Symbol::output_section): Likewise.
10872 (Symbol::set_output_section): Likewise.
10873 (Symbol_table::sized_finalize_symbol): Likewise.
10874 (Symbol_table::sized_write_globals): Likewise.
10875 * resolve.cc (Symbol_table::should_override): Likewise.
10876 (Symbol::override_base_with_special): Likewise.
10877
8bdcdf2c
ILT
10878 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10879 symbol, change it to have default visibility.
10880 * testsuite/protected_1.cc: New file.
10881 * testsuite/protected_2.cc: New file.
10882 * testsuite/protected_3.cc: New file.
10883 * testsuite/protected_main_1.cc: New file.
10884 * testsuite/protected_main_2.cc: New file.
10885 * testsuite/protected_main_3.cc: New file.
10886 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10887 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10888 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10889 (protected_1.so): New target.
10890 (protected_1_pic.o, protected_2_pic.o): New targets.
10891 (protected_3_pic.o): New target.
10892 (check_PROGRAMS): Add protected_2.
10893 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10894 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10895 * testsuite/Makefile.in: Rebuild.
10896
2b706932
ILT
10897 * options.h (DEFINE_var): Add set_user_set_##varname__.
10898 (DEFINE_bool_alias): New macro.
10899 (class General_options): Define -Bstatic using DEFINE_bool_alias
10900 rather than DEFINE_special. Add --undefined as an alias for -z
10901 defs.
10902 * options.cc (General_options::parse_Bstatic): Remove.
10903
d82a5bcc
ILT
10904 * options.h (class General_options): Add --fatal-warnings.
10905 * main.cc (main): Implement --fatal-warnings.
10906 * errors.h (Errors::warning_count): New function.
10907
f1f70eae
ILT
10908 * options.h (class General_options): Add -Bsymbolic-functions.
10909 * symtab.h (Symbol::is_preemptible): Check for
10910 -Bsymbolic-functions.
10911
8825ac63
ILT
109122008-05-05 Ian Lance Taylor <iant@google.com>
10913
d98bc257
ILT
10914 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10915 as noVARNAME rather than no-VARNAME.
10916 (class General_options): Add option -z combreloc.
10917 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10918 get_address.
10919 (Output_reloc::sort_before) [SHT_REL]: New function.
10920 (Output_reloc::sort_before) [SHT_RELA]: New function.
10921 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10922 Sort_relocs_comparison.
10923 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10924 parameter. Change all callers.
10925 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10926 sort_relocs parameter. Change all callers.
10927 * output.cc (Output_reloc::get_address): New function, broken out
10928 of write_rel.
10929 (Output_reloc::write_rel): Call it.
10930 (Output_reloc::compare): New function.
10931 (Output_data_reloc_base::do_write): Optionally sort relocs.
10932
60b2b4e7
ILT
10933 * configure.ac: If targ_extra_obj is set, link it in.
10934 * configure.tgt: Initialize all variables.
10935 (x86_64*): Set targ_extra_obj and targ_extra_size.
10936 * configure: Rebuild.
10937
8825ac63
ILT
10938 * object.cc (Sized_relobj::include_section_group): Adjust section
10939 indexes read from group data. Build vector to pass to
10940 layout_group.
10941 * layout.cc (Layout::layout_group): Add flags and shndxes
10942 parameters. Remove contents parameter. Change caller. Update
10943 explicit instantiations.
10944 * layout.h (class Layout): Update layout_group declaration.
10945 * output.cc (Output_data_group::Output_data_group): Add flags and
10946 input_shndxes parameters. Remove contents parameter. Change
10947 caller.
10948 (Output_data_group::do_write): Change input_sections_ to
10949 input_shndxes_.
10950 * output.h (class Output_data_group): Update constructor
10951 declaration. Rename input_sections_ to input_shndxes_.
10952 * testsuite/many_sections_test.cc: Add template.
10953
e94cf127
CC
109542008-04-30 Cary Coutant <ccoutant@google.com>
10955
4418b2d5
CC
10956 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10957
e94cf127
CC
10958 * layout.cc (Layout::include_section): Refactored check for debug
10959 info section.
10960 (Layout::add_comdat): Add new parameters. Change type
10961 of signature parameter. Add object and shndx to signatures table.
10962 (Layout::find_kept_object): New function.
10963 * layout.h: Include <cstring>.
10964 (Layout::is_debug_info_section): New function.
10965 (Layout::add_comdat): Add new parameters.
10966 (Layout::find_kept_object): New function.
10967 (Layout::Kept_section): New struct.
10968 (Layout::Signatures): Change type of map range.
10969 * object.cc (Relobj::output_section_address): New function.
10970 (Sized_relobj::include_section_group): Add new parameters. Change
10971 calls to Layout::add_comdat. Change to build table of kept comdat
10972 groups and table mapping discarded sections to kept sections.
10973 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10974 (Sized_relobj::do_layout): Change calls to include_section_group and
10975 include_linkonce_section.
10976 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10977 value to zero when section is discarded.
10978 (Sized_relobj::map_to_kept_section): New function.
10979 * object.h (Relobj::output_section_address): New function.
10980 (Relobj::Comdat_group): New type.
10981 (Relobj::find_comdat_group): New function.
10982 (Relobj::Comdat_group_table): New type.
10983 (Relobj::Kept_comdat_section): New type.
10984 (Relobj::Kept_comdat_section_table): New type.
10985 (Relobj::add_comdat_group): New function.
10986 (Relobj::set_kept_comdat_section): New function.
10987 (Relobj::get_kept_comdat_section): New function.
10988 (Relobj::comdat_groups_): New field.
10989 (Relobj::kept_comdat_sections_): New field.
10990 (Symbol_value::input_value): Update comment.
10991 (Sized_relobj::map_to_kept_section) New function.
10992 (Sized_relobj::include_linkonce_section): Add new parameter.
10993 * target-reloc.h (Comdat_behavior): New type.
10994 (get_comdat_behavior): New function.
10995 (relocate_section): Add code to map a discarded section to the
10996 corresponding kept section when applying a relocation.
10997
e4e5049b
CS
109982008-04-30 Craig Silverstein <csilvers@google.com>
10999
11000 * dwarf_reader.cc (next_generation_count): New static var.
11001 (Addr2line_cache_entry): New struct.
11002 (addr2line_cache): New static var.
11003 (Dwarf_line_info::one_addr2line): Added caching.
11004 (Dwarf_line_info::clear_addr2line_cache): New function.
11005 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
11006 cache-size parameter.
11007 (Dwarf_line_info::one_addr2line_cache): New function.
11008 * symtab.cc (Symbol_table::detect_odr_violations): Pass
11009 new cache-size argument to one_addr2line(), and clear cache.
11010
d09e9154
CC
110112008-04-28 Cary Coutant <ccoutant@google.com>
11012
11013 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
11014 R_386_PC8 relocations.
11015
7ef73768
ILT
110162008-04-23 Ian Lance Taylor <iant@google.com>
11017
55438702
ILT
11018 * object.cc (Sized_relobj::include_section_group): Check for
11019 invalid section group.
11020
c165fb93
ILT
11021 * object.cc (make_elf_object): Correct test for 64-bit ELF file
11022 header size.
11023
7ef73768
ILT
11024 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
11025 than read for file header.
11026 * archive.cc (Archive::include_member): Likewise.
11027
6194aaab
L
110282008-04-23 Paolo Bonzini <bonzini@gnu.org>
11029
11030 * aclocal.m4: Regenerate.
11031 * configure: Regenerate.
11032
d491d34e
ILT
110332008-04-19 Ian Lance Taylor <iant@google.com>
11034
5ea2bac6
ILT
11035 * version.cc (version_string): Bump to 1.6.
11036
7bc3e21a
ILT
11037 * testsuite/Makefile.am (many_sections_r_test): New target.
11038 (many_sections_r_test_SOURCES): Remove.
11039 (many_sections_r_test_DEPENDENCIES): Remove.
11040 (many_sections_r_test_LDFLAGS): Remove.
11041 (many_sections_r_test_LDADD): Remove.
11042
7fcd3aa9
ILT
11043 * object.cc (Sized_relobj::do_add_symbols): Always pass
11044 local_symbol_count_ to add_from_relobj.
11045
4c94d6ae
ILT
11046 * testsuite/Makefile.am (many_sections_check.h): Only check one in
11047 every thousand variables.
11048 * testsuite/Makefile.in: Rebuild.
11049
d491d34e
ILT
11050 * object.cc (Xindex::initialize_symtab_xindex): New function.
11051 (Xindex::read_symtab_xindex): New function.
11052 (Xindex::sym_xindex_to_shndx): New function.
11053 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
11054 available.
11055 (Sized_relobj::do_initialize_xindex): New function.
11056 (Sized_relobj::do_read_symbols): Adjust section links.
11057 (Sized_relobj::symbol_section_and_value): Add is_ordinary
11058 parameter. Change all callers.
11059 (Sized_relobj::include_section_group): Adjust section links and
11060 symbol section indexes.
11061 (Sized_relobj::do_layout): Adjust section links.
11062 (Sized_relobj::do_count_local_symbols): Adjust section links and
11063 symbol section indexes.
11064 (Sized_relobj::do_finalize_local_symbols): Distinguish between
11065 ordinary and special symbols.
11066 (Sized_relobj::write_local_symbols): Add symtab_xindex and
11067 dynsym_xindex parameters. Change all callers. Adjust section
11068 links. Use SHN_XINDEX when needed.
11069 (Sized_relobj::get_symbol_location_info): Adjust section links.
11070 Don't get fooled by special symbols.
11071 * object.h (class Xindex): Define.
11072 (class Object): Add xindex_ parameter. Declare virtual functoin
11073 do_initialize_xindex.
11074 (Object::adjust_sym_shndx): New function.
11075 (Object::set_xindex): New protected function.
11076 (class Symbol_value): Add is_ordinary_shndx_ field.
11077 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
11078 (Symbol_value::value): Assert ordinary section.
11079 (Symbol_value::initialize_input_to_output_map): Likewise.
11080 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
11081 Change all callers.
11082 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
11083 all callers.
11084 (class Sized_relobj): Update declarations.
11085 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
11086 parameter. Change all callers.
11087 (Sized_relobj::adjust_shndx): New function.
11088 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
11089 field.
11090 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
11091 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
11092 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
11093 (Sized_dynobj::read_dynsym_section): Adjust section links.
11094 (Sized_dynobj::read_dynamic): Likewise.
11095 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
11096 section links.
11097 (Sized_dynobj::do_initialize_xindex): New function.
11098 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
11099 do_initialize_xindex.
11100 (Sized_dynobj::adjust_shndx): New function.
11101 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
11102 dynsym_xindex_ fields.
11103 (Layout::finalize): Add a call to set_section_indexes before
11104 creating the symtab sections.
11105 (Layout::set_section_indexes): Don't do anything if the section
11106 already has a section index.
11107 (Layout::create_symtab_sections): Add shnum parameter. Change
11108 caller. Create .symtab_shndx section if needed.
11109 (Layout::create_shdrs): Add shstrtab_section parameter. Change
11110 caller.
11111 (Layout::allocated_output_section_count): New function.
11112 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
11113 needed.
11114 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
11115 fields. Update declarations.
11116 (Layout::symtab_xindex): New function.
11117 (Layout::dynsym_xindex): New function.
11118 (class Write_symbols_task): Add layout_ field.
11119 (Write_symbols_task::Write_symbols_task): Add layout parameter.
11120 Change caller.
11121 * output.cc (Output_section_headers::Output_section_headers): Add
11122 shstrtab_section parameter. Change all callers.
11123 (Output_section_headers::do_sized_write): Store overflow values
11124 for section count and section string table section index in
11125 section header zero.
11126 (Output_file_header::do_sized_write): Check for overflow of
11127 section count and section string table section index.
11128 (Output_symtab_xindex::do_write): New function.
11129 (Output_symtab_xindex::endian_do_write): New function.
11130 * output.h (class Output_section_headers): Add shstrtab_section_.
11131 Update declarations.
11132 (class Output_symtab_xindex): Define.
11133 (Output_section::has_out_shndx): New function.
11134 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
11135 field.
11136 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
11137 Change all callers.
11138 (Sized_symbol::init): Likewise.
11139 (Symbol::output_section): Check for ordinary symbol.
11140 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
11141 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
11142 callers.
11143 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
11144 Change all callers. Simplify handling of symbols from sections
11145 not included in the link.
11146 (Symbol_table::add_from_dynobj): Handle ordinary symbol
11147 distinction.
11148 (Weak_alias_sorter::operator()): Assert that symbols are
11149 ordinary.
11150 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
11151 distinction.
11152 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
11153 parameters. Change all callers.
11154 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
11155 symbol distinction. Use SHN_XINDEX when needed.
11156 (Symbol_table::write_section_symbol): Add symtab_xindex
11157 parameter. Change all callers.
11158 (Symbol_table::sized_write_section_symbol): Likewise. Use
11159 SHN_XINDEX when needed.
11160 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
11161 declarations.
11162 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
11163 (Symbol::is_defined): Check is_ordinary.
11164 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
11165 (Symbol::is_absolute, Symbol::is_common): Likewise.
11166 (class Sized_symbol): Update declarations.
11167 (class Symbol_table): Update declarations.
11168 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
11169 parameters. Change all callers.
11170 (Sized_symbol::override): Likewise.
11171 (Symbol_table::override): Likewise.
11172 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
11173 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
11174 is_ordinary, and orig_st_shndx parameters. Change all callers.
11175 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
11176 to be in an ordinary section.
11177 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
11178 object and is_ordinary parameters. Change all callers.
11179 (Sized_dwarf_line_info::read_relocs): Add object parameter.
11180 Change all callers. Don't add undefined or non-ordinary symbols
11181 to reloc_map_.
11182 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
11183 Change all callers.
11184 * dwarf_reader.h (class Sized_dwarf_line_info): Update
11185 declarations.
11186 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
11187 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
11188 (Sized_relobj::relocate_sections): Likewise.
11189 * target-reloc.h (scan_relocs): Adjust section symbol index.
11190 (scan_relocatable_relocs): Likewise.
11191 * i386.cc (Scan::local): Check for ordinary symbols.
11192 * sparc.cc (Scan::local): Likewise.
11193 * x86_64.cc (Scan::local): Likewise.
11194 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
11195 to symbol_section_and_value.
11196 * testsuite/many_sections_test.cc: New file.
11197 * testsuite/Makefile.am (BUILT_SOURCES): Define.
11198 (check_PROGRAMS): Add many_sections_test.
11199 (many_sections_test_SOURCES): Define.
11200 (many_sections_test_DEPENDENCIES): Define.
11201 (many_sections_test_LDFLAGS): Define.
11202 (BUILT_SOURCES): Add many_sections_define.h.
11203 (many_sections_define.h): New target.
11204 (BUILT_SOURCES): Add many_sections_check.h.
11205 (many_sections_check.h): New target.
11206 (check_PROGRAMS): Add many_sections_r_test.
11207 (many_sections_r_test_SOURCES): Define.
11208 (many_sections_r_test_DEPENDENCIES): Define.
11209 (many_sections_r_test_LDFLAGS): Define.
11210 (many_sections_r_test_LDADD): Define.
11211 (many_sections_r_test.o): New target.
11212 * testsuite/Makefile.in: Rebuild.
11213
c5818ff1
CC
112142008-04-17 Cary Coutant <ccoutant@google.com>
11215
11216 * errors.cc (Errors::info): New function.
11217 (gold_info): New function.
11218 * errors.h (Errors::info): New function.
11219 * gold.h (gold_info): New function.
11220 * object.cc (Input_objects::add_object): Print trace output.
11221 * options.cc (options::parse_set): New function.
11222 (General_options::parse_wrap): Deleted.
11223 (General_options::General_options): Deleted initializer.
11224 * options.h (options::String_set): New typedef.
11225 (options::parse_set): New function.
11226 (DEFINE_set): New macro.
11227 (General_options::wrap): Changed to use DEFINE_set. Changed
11228 callers of any_wrap_symbols and is_wrap_symbol.
11229 (General_options::trace, General_options::trace_symbol):
11230 New options.
11231 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
11232 (General_options::wrap_symbols_): Deleted.
11233 * symtab.cc (Symbol_table::add_from_object): Print trace output.
11234
b5be4a7c
DM
112352008-04-17 David S. Miller <davem@davemloft.net>
11236
11237 * options.cc (General_options::parse_V): New function.
11238 * options.h: Add entries for -V and -Qy.
11239
155a0dd7
ILT
112402008-04-17 Ian Lance Taylor <iant@google.com>
11241
11242 * common.cc (Symbol_table::allocate_commons): Remove options
11243 parameter. Change caller.
11244 (Symbol_table::do_allocate_commons): Remove options parameter.
11245 Change caller. Just call do_allocate_commons_list twice.
11246 (Symbol_table::do_allocate_commons_list): New function, broken out
11247 of do_allocate_commons.
11248 * common.h (class Allocate_commons_task): Remove options_ field.
11249 Update constructor.
11250 * symtab.cc (Symbol_table::Symbol_table): Initialize
11251 tls_commons_.
11252 (Symbol_table::add_from_object): Put TLS common symbols on
11253 tls_commons_ list.
11254 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
11255 which are IN_OUTPUT_DATA.
11256 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
11257 allocate_commons and do_allocate_commons declarations. Declare
11258 do_allocate_commons_list.
11259 * gold.cc (queue_middle_tasks): Update creation of
11260 Allocate_commons_task to not pass options.
11261 * testsuite/Makefile.am (INCLUDES): Add -I.. .
11262 (TLS_TEST_C_FLAGS): New variable.
11263 (tls_test_c_pic.o): New target.
11264 (tls_test_shared.so): Link in tls_test_c_pic.o.
11265 (tls_test_c_pic_ie.o): New target.
11266 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
11267 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
11268 (tls_test_c.o): New target.
11269 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
11270 (tls_pic_test_LDADD): Likewise.
11271 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
11272 (tls_shared_gd_to_ie_test_LDADD): Likewise.
11273 (tls_test_c_gnu2.o): New target.
11274 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
11275 tls_test_c_gnu2.o.
11276 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
11277 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
11278 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
11279 * testsuite/tls_test.cc: Include "config.h".
11280 (t_last): Call t11_last.
11281 * testsuite/tls_test.h (t11, t11_last): Declare.
11282 * testsuite/tls_test_c.c: New file.
11283 * testsuite/tls_test_main.cc (thread_routine): Call t11.
11284 * configure.ac: Check for OpenMP support.
11285 * configure, config.in, Makefile.in: Rebuild.
11286 * testsuite/Makefile.in: Rebuild.
11287
edfbb029
CC
112882008-04-16 Cary Coutant <ccoutant@google.com>
11289
11290 * i386.cc (Target_i386::define_tls_base_symbol): New function.
11291 (Target_i386::tls_base_symbol_defined_): New field.
11292 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11293 (Target_i386::Scan::global): Likewise.
11294 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
11295 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
11296 (Target_x86_64::tls_base_symbol_defined_): New field.
11297 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
11298 (Target_x86_64::Scan::global): Likewise.
11299
f3c69fca
CC
113002008-04-16 Cary Coutant <ccoutant@google.com>
11301
11302 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
11303 (Symbol::needs_plt_entry): Allow weak undefined symbols.
11304 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
11305 building shared libraries.
11306 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
11307 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
11308 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
11309 * testsuite/Makefile.in: Rebuild.
11310 * testsuite/weak_undef.h: New file.
11311 * testsuite/weak_undef_file1.cc: Add extra test cases.
11312 * testsuite/weak_undef_file2.cc: Likewise.
11313 * testsuite/weak_undef_test.cc: Likewise.
11314
7c414435
DM
113152008-04-16 David S. Miller <davem@davemloft.net>
11316
32b769e1
DM
11317 * sparc.cc (Target_sparc::Scan): Change from struct to class.
11318 Add issued_non_pic_error_ field. Declare check_non_pic.
11319 (Target_sparc::Scan::check_non_pic): New function.
11320 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
11321 (Target_sparc::Scan::global): Likewise.
11322
11936fb1
DM
11323 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
11324 * configure: Rebuild.
11325
7c414435
DM
11326 * options.h (DEFINE_enable): New macro.
11327 (new_dtags): New enable option.
11328 (initfirst, interpose, loadfltr, nodefaultlib,
11329 nodelete, nodlopen, nodump): New -z options.
11330 * layout.cc (Layout:finish_dynamic_section): If new
11331 dtags enabled, emit DT_RUNPATH. Also, emit a
11332 DT_FLAGS_1 containing any specified -z flags.
11333
85c7bf8b
ILT
113342008-04-16 Ian Lance Taylor <iant@google.com>
11335
12c0daef
ILT
11336 * copy-relocs.cc: New file.
11337 * copy-relocs.h: New file.
11338 * reloc.cc: Remove Copy_relocs code.
11339 * reloc.h: Likewise.
11340 * reloc-types.h (struct Reloc_types) [both versions]: Add
11341 get_reloc_addend_noerror.
11342 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
11343 variants of add_global which take an addend which must be zero.
11344 * i386.cc: Include "copy-relocs.h".
11345 (class Target_i386): Change type of copy_relocs_ to variable,
11346 update initializer.
11347 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
11348 Change all callers.
11349 (Target_i386::do_finalize_sections): Change handling of
11350 copy_relocs_.
11351 * sparc.cc: Include "copy-relocs.h".
11352 (class Target_sparc): Change type of copy_relocs_ to variable,
11353 update initializer.
11354 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
11355 Change all callers.
11356 (Target_sparc::do_finalize_sections): Change handling of
11357 copy_relocs_.
11358 * x86_64.cc: Include "copy-relocs.h".
11359 (class Target_x86_64): Change type of copy_relocs_ to variable,
11360 update initializer.
11361 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
11362 class. Change all callers.
11363 (Target_x86_64::do_finalize_sections): Change handling of
11364 copy_relocs_.
11365 * Makefile.am (CCFILES): Add copy-relocs.cc.
11366 (HFILES): Add copy-relocs.h.
11367
4f4995b6
ILT
11368 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
11369
85c7bf8b
ILT
11370 * testsuite/script_test_4.sh: Permit leading zeroes.
11371
4f2a9edd
ILT
113722008-04-15 Ian Lance Taylor <iant@google.com>
11373
e6188289
ILT
11374 * script-sections.cc (Script_sections::create_segments): Use
11375 header_size_adjustment even when there is enough room for the
11376 headers.
11377 * testsuite/script_test_4.sh: New file.
11378 * testsuite/script_test_4.t: New file.
11379 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
11380 (check_DATA): Add script_test_4.stdout.
11381 (MOSTLYCLEANFILES): Likewise.
11382 (script_test_4): New target.
11383 (script_test_4.stdout): New target.
11384 * testsuite/Makefile.in: Rebuild.
11385
4f2a9edd
ILT
11386 * sparc.cc: Add definitions for Output_data_plt_sparc class
11387 constants.
11388
f5314dd5
DM
113892008-04-14 David S. Miller <davem@davemloft.net>
11390
11391 * sparc.cc: New file.
11392 * Makefile.am (TARGETSOURCES): Add sparc.cc
11393 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
11394 * configure.tgt: Document targ_extra_size and
11395 targ_extra_big_endian. Add entries for sparc-* and
11396 sparc64-*.
11397 * configure.ac: Handle targ_extra_size and
11398 targ_extra_big_endian.
11399 * Makefile.in: Rebuild.
11400 * configure: Likewise.
11401 * po/POTFILES.in: Likewise.
11402 * po/gold.pot: Likewise.
11403
154e0e9a
ILT
114042008-04-14 Ian Lance Taylor <iant@google.com>
11405
11406 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
11407 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
11408 in the name/type/flags to section mapping. Don't call
11409 allocate_output_section.
11410 (Layout::choose_output_section): Change parameter from adjust_name
11411 to is_input_section. Don't permit input sections after sections
11412 are attached to segments. Don't call allocate_output_section.
11413 (Layout::layout_eh_frame): Call update_flags_for_input_section,
11414 not write_enable_output_section.
11415 (Layout::make_output_section): Don't push to
11416 unattached_section_list_ nor call attach_to_segment. Call
11417 attach_section_to_segment if sections are attached.
11418 (Layout::attach_sections_to_segments): New function.
11419 (Layout::attach_section_to_segment): New function.
11420 (Layout::attach_allocated_section_to_segment): Rename from
11421 attach_to_segment. Remove flags parameter.
11422 (Layout::allocate_output_section): Remove function.
11423 (Layout::write_enable_output_section): Remove function.
11424 * layout.h (class Layout): Update for above changes. Add new
11425 field sections_are_attached_.
11426 * output.h (Output_section::update_flags_for_input_section): New
11427 function.
11428 * output.cc (Output_section::add_input_section): Call
11429 update_flags_for_input_section.
11430 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
11431
009a67a2
CC
114322008-04-11 Cary Coutant <ccoutant@google.com>
11433
11434 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
11435 thought unnecessary.
11436 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
11437
759b1a24
ILT
114382008-04-11 Ian Lance Taylor <iant@google.com>
11439
11440 * output.h (class Output_section_data): Remove inline definition
11441 of set_addralign.
11442 * output.cc (Output_section_data::set_addralign): New function.
11443
c2b45e22
CC
114442008-04-11 Cary Coutant <ccoutant@google.com>
11445
11446 Add support for TLS descriptors for i386 and x86_64.
11447 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
11448 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
11449 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
11450 GOT_TYPE_TLS_DESC.
11451 (Target_i386::got_mod_index_entry): Remove unnecessary code.
11452 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
11453 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
11454 relocations.
11455 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
11456 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
11457 Fix problem with initial-exec relocations.
11458 (Target_i386::Relocate::relocate_tls): Likewise.
11459 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
11460 relaxation.
11461 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
11462 support for section-plus-offset dynamic table entries.
11463 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
11464 (Output_data_dynamic::Dynamic_entry): Add support for
11465 section-plus-offset dynamic table entries.
11466 (Output_data_dynamic::Classification): Likewise.
11467 (Output_data_dynamic::classification_): Renamed offset_.
11468 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
11469 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
11470 (Target_x86_64::make_plt_section): New function.
11471 (Target_x86_64::reserve_tlsdesc_entries): New function.
11472 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
11473 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
11474 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
11475 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
11476 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
11477 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
11478 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
11479 add extra PLT entry for TLS descriptors.
11480 (Output_data_plt_x86_64::got_): New field.
11481 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
11482 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
11483 fields.
11484 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
11485 descriptors.
11486 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
11487 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
11488 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
11489 R_386_TLS_DESC_CALL relocations.
11490 (Target_x86_64::Scan::global): Likewise.
11491 (Target_x86_64::do_finalize_sections): Add dynamic table entries
11492 for TLS descriptors.
11493 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
11494 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
11495 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
11496 GD-to-IE relaxation.
11497 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
11498 and TLS_DESCRIPTORS.
11499 * Makefile.in: Rebuild.
11500 * configure: Rebuild.
11501 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
11502 (tls_test_shared2.so): New target.
11503 (tls_shared_gd_to_ie_test_SOURCES): New variable.
11504 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
11505 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
11506 (tls_shared_gd_to_ie_test_LDADD): New variable.
11507 (tls_shared_gnu2_gd_to_ie_test): New target.
11508 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
11509 New targets.
11510 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
11511 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
11512 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
11513 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
11514 (tls_shared_gnu2_test): New target.
11515 (tls_test_gnu2_shared.so): New target.
11516 (tls_shared_gnu2_test_SOURCES): New variable.
11517 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
11518 (tls_shared_gnu2_test_LDFLAGS): New variable.
11519 (tls_shared_gnu2_test_LDADD): New variable.
11520 * testsuite/Makefile.in: Rebuild.
11521 * testsuite/Makefile.
11522
83bfb6b7
ILT
115232008-04-11 Ian Lance Taylor <iant@google.com>
11524
11525 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
11526 justsyms.t.
11527 * testsuite/Makefile.in: Rebuild.
11528
11529 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
11530 long.
11531 * testsuite/script_test_2.cc (main): Adjust test.
11532
706e1f5e
ILT
115332008-04-11 David S. Miller <davem@davemloft.net>
11534 Ian Lance Taylor <iant@google.com>
11535
11536 * options.h (General_options): Add entries for '-Y' and
11537 '-relax'.
11538 * options.cc (General_options:finalize): If -Y was used, add those
11539 entries to the library path instead of the default "/lib" and
11540 "/usr/lib".
11541
7c98e6bb
DM
115422008-04-11 David S. Miller <davem@davemloft.net>
11543
11544 * testsuite/justsyms.t: Start at 0x100.
11545 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
11546 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
11547 long.
11548 * testsuite/script_test_2.cc: Adjust string and section length
11549 checks.
7c98e6bb 11550
99a37bfd
ILT
115512008-04-09 Ian Lance Taylor <iant@google.com>
11552
2cefc357
ILT
11553 PR gold/5996
11554 * script-sections.cc (Sections_element::allocate_to_segment): Add
11555 orphan parameter.
11556 (Output_section_definition::allocate_to_segment): Likewise.
11557 (Orphan_output_section::allocate_to_segment): Likewise.
11558 (Script_sections::attach_sections_using_phdrs_clause): Don't
11559 propagate non-PT_LOAD segments to orphan sections.
11560 * testsuite/Makefile.am (script_test_3.stdout): Generate using
11561 readelf rather than objdump.
11562 * testsuite/script_test_3.sh: Adjust accordingly. Test that
11563 .interp section and PT_INTERP segment are the same size.
11564 * testsuite/Makefile.in: Rebuild.
11565
99a37bfd
ILT
11566 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
11567 aliases for symbols defined in the same object.
11568 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
11569 (weak_alias_test_SOURCES): New variable.
11570 (weak_alias_test_DEPENDENCIES): New variable.
11571 (weak_alias_test_LDFLAGS): New variable.
11572 (weak_alias_test_LDADD): New variable.
11573 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
11574 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
11575 (weak_alias_test_3.o): New target.
11576 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
11577 * testsuite/weak_alias_test_main.cc: New file.
11578 * testsuite/weak_alias_test_1.cc: New file.
11579 * testsuite/weak_alias_test_2.cc: New file.
11580 * testsuite/weak_alias_test_3.cc: New file.
11581
780e49c5
ILT
115822008-04-08 Ian Lance Taylor <iant@google.com>
11583
cdb0b8f5
ILT
11584 * options.h (class General_options): Add --noinhibit-exec option.
11585 * main.cc (main): Check --noinhibit-exec.
11586
0864d551
ILT
11587 * options.h (class General_options): Define --wrap as a special
11588 option. Add wrap_symbols_ field.
11589 (General_options::any_wrap_symbols): New function.
11590 (General_options::is_wrap_symbol): New function.
11591 * options.cc (General_options::parse_wrap): New function.
11592 (General_options::General_options): Initialize wrap_symbols_.
11593 * symtab.cc (Symbol_table::wrap_symbol): New function.
11594 (Symbol_table::add_from_object): Handle --wrap.
11595 * symtab.h (class Symbol_table): Declare wrap_symbol.
11596 * target.h (Target::wrap_char): New function.
11597 (Target::Target_info): Add wrap_char field.
11598 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
11599 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11600 * testsuite/testfile.cc (Target_test::test_target_info):
11601 Likewise.
11602
789aa6de
ILT
11603 * errors.cc (Errors::undefined_symbol): Mention symbol version if
11604 there is one.
11605
2c38906f
ILT
11606 * layout.h (class Layout): Add added_eh_frame_data_ field.
11607 * layout.cc (Layout::Layout): Initialize new field.
11608 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
11609 output section until we find a section we merged successfully.
11610 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
11611 that the size be non-zero.
11612
780e49c5
ILT
11613 * merge.cc (Object_merge_map::get_output_offset): Remove inline
11614 qualifier.
11615
7fcd0256
ILT
116162008-04-08 Craig Silverstein <csilvers@google.com>
11617
11618 * configure.ac: Export new conditional variable HAVE_ZLIB.
11619 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
11620 on HAVE_ZLIB.
11621 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
11622 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11623
6835af53
ILT
116242008-04-07 Ian Lance Taylor <iant@google.com>
11625
e24f324c
ILT
11626 * version.cc (version_string): Set to "1.5".
11627
a036edd8
ILT
11628 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
11629 Add issued_non_pic_error_ field. Declare check_non_pic.
11630 (Target_x86_64::Scan::check_non_pic): New function.
11631 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
11632 (Target_x86_64::Scan::global): Likewise.
11633
624f8810
ILT
11634 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
11635 addend parameter. Change caller. Handle merge sections.
11636 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
11637 Address to Addend. Don't add in the result of
11638 local_section_offset, pass down the addend and use the returned
11639 value.
11640 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
11641 Update declarations of local_section_offset and symbol_value.
11642 * testsuite/two_file_test_1.cc (t18): New function.
11643 * testsuite/two_file_test_2.cc (f18): New function.
11644 * testsuite/two_file_test_main.cc (main): Call t18.
11645 * testsuite/two_file_test.h (t18, f18): Declare.
11646
6835af53
ILT
11647 * configure.ac: Don't test for objdump, c++filt, or readelf.
11648 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
11649 conditionals.
11650 (TEST_READELF): New variable.
11651 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
11652 (check_PROGRAMS): Add two_file_strip_test.
11653 (two_file_strip_test): New target.
11654 (check_PROGRAMS): Add two_file_same_shared_strip_test.
11655 (two_file_same_shared_strip_test_SOURCES): New variable.
11656 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
11657 (two_file_same_shared_strip_test_LDFLAGS): New variable.
11658 (two_file_same_shared_strip_test_LDADD): New variable.
11659 (two_file_shared_strip.so): New target.
11660 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
11661 (ver_test_5.syms, ver_test_7.syms): Likewise.
11662 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
11663 (strip_test_3.stdout): Use TEST_OBJDUMP.
11664 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11665
86925eef
CC
116662008-04-04 Cary Coutant <ccoutant@google.com>
11667
11668 * symtab.h (Symbol::is_weak_undefined): New function.
11669 (Symbol::is_strong_undefined): New function.
11670 (Symbol::is_absolute): New function.
11671 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
11672 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
11673 absolute symbols.
11674 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
11675 (weak_undef_test): New target.
11676 * testsuite/Makefile.in: Rebuild.
11677 * testsuite/weak_undef_file1.cc: New file.
11678 * testsuite/weak_undef_file2.cc: New file.
11679 * testsuite/weak_undef_test.cc: New file.
11680
126f3ece
ILT
116812008-04-03 Craig Silverstein <csilvers@google.com>
11682
11683 * compressed_output.h (class Output_compressed_section): Use
11684 unsigned buffer.
11685 * compressed_output.cc (zlib_compress): Use unsigned buffers,
11686 add zlib header.
11687 (zlib_compressed_suffix): Removed.
11688 (Output_compressed_section::set_final_data_size): Use unsigned
11689 buffers.
11690 * testsuite/Makefile.am (flagstest_compress_debug_sections):
11691 Fix linker invocation.
11692 (flagstest_o_specialfile_and_compress_debug_sections):
11693 Likewise.
11694 * testsuite/Makefile.in: Regenerated.
11695
deae2a14
DM
116962008-04-02 David S. Miller <davem@davemloft.net>
11697
11698 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
11699 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
11700
70752818
ILT
117012008-04-02 Craig Silverstein <csilvers@google.com>
11702
11703 * TODO: New file.
11704
39d0cb0e
ILT
117052008-04-02 Ian Lance Taylor <iant@google.com>
11706
11707 * fileread.cc (File_read::find_view): Add byteshift and vshifted
11708 parameters. Update for new key type to views_. Change all
11709 callers.
11710 (File_read::read): Adjust for byteshift in returned view.
11711 (File_read::add_view): New function, broken out of
11712 find_and_make_view.
11713 (File_read::make_view): New function, broken out of
11714 find_and_make_view.
11715 (File_read::find_or_make_view): Add offset and aligned
11716 parameters. Rewrite accordingly. Change all callers.
11717 (File_read::get_view): Add offset and aligned parameters. Adjust
11718 for byteshift in return value.
11719 (File_read::get_lasting_view): Likewise.
11720 * fileread.h (class File_read): Update declarations.
11721 (class File_read::View): Add byteshift_ field. Add byteshift to
11722 constructor. Add byteshift method.
11723 * archive.h (Archive::clear_uncached_views): New function.
11724 (Archive::get_view): Add aligned parameter. Change all callers.
11725 * object.h (Object::get_view): Add aligned parameter. Change all
11726 callers.
11727 (Object::get_lasting_view): Likewise.
11728
11729 * fileread.cc (File_read::release): Don't call clear_views if
11730 there are multiple objects.
11731 * fileread.h (File_read::clear_uncached_views): New function.
11732 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
11733 on the archive.
11734
a1207466
CC
117352008-03-31 Cary Coutant <ccoutant@google.com>
11736
11737 Add thin archive support.
11738 * archive.cc (Archive::armagt): New const.
11739 (Archive::setup): Remove task parameter and calls to unlock.
11740 (Archive::unlock_nested_archives): New function.
11741 (Archive::read_header): Add nested_off parameter. Change
11742 all callers.
11743 (Archive::interpret_header): Likewise.
11744 (Archive::include_all_members): Change to handle thin
11745 archives.
11746 (Archive::include_member): Likewise.
11747 * archive.h (Archive::Archive): Add new parameters and
11748 initializers.
11749 (Archive::armagt): New const.
11750 (Archive::setup): Remove task parameter.
11751 (Archive::unlock_nested_archives): New function.
11752 (Archive::read_header): Add nested_off parameter.
11753 (Archive::interpret_header): Likewise.
11754 (Archive::Nested_archive_table): New typedef.
11755 (Archive::is_thin_archive_): New field.
11756 (Archive::nested_archives_): New field.
11757 (Archive::options_): New field.
11758 (Archive::dirpath_): New field.
11759 (Archive::task_): New field.
11760 * readsyms.cc (Read_symbols::do_read_symbols): Add check
11761 for thin archives. Pass additional parameters to
11762 Archive::Archive. Unlock the archive file after calling
11763 Archive::setup.
cd536b21 11764
479f6503
ILT
117652008-03-29 Ian Lance Taylor <iant@google.com>
11766
686c8caf
ILT
11767 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
11768 version symbol to be local.
11769 * testsuite/ver_test_4.sh: New file.
11770 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
11771 (check_DATA): Add ver_test_4.syms.
11772 (ver_test_4.syms): New target.
11773 * testsuite/Makefile.in: Rebuild.
11774
ab794b6b
ILT
11775 * output.cc
11776 (Output_section::Input_section_sort_entry::has_priority): New
11777 function.
11778 (Output_section::Input_section_sort_entry::match_file_name): New
11779 function.
11780 (Output_section::Input_section_sort_entry::match_section_name):
11781 Remove.
11782 (Output_section::Input_section_sort_entry::match_section_name_prefix):
11783 Remove.
11784 (Output_section::Input_section_sort_entry::match_section_file):
11785 Remove.
11786 (Output_section::Input_section_sort_compare::operator()): Rewrite
11787 using new Input_section_sort_entry functions. Sort crtbegin and
11788 crtend first. Sort sections with no priority before sections with
11789 a priority.
11790 * testsuite/initpri1.c (d3): Check j != 4.
11791 (cd5): New constructor/destructor function.
11792 (main): Check j != 2.
11793
479f6503
ILT
11794 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11795 new symbol when resolving, don't call set_is_default.
11796 * testsuite/ver_test_7.cc: New file.
11797 * testsuite/ver_test_7.sh: New file.
11798 * testsuite/Makefile.am (ver_test_7.so): New target.
11799 (ver_test_7.o): New target.
11800 (check_SCRIPTS): Add ver_test_7.sh.
11801 (check_DATA): Add ver_test_7.syms.
11802 (ver_test_7.syms): New target.
11803
2fd32231
ILT
118042008-03-28 Ian Lance Taylor <iant@google.com>
11805
11806 * layout.cc (Layout::layout): If we see an input section with a
11807 name that needs sorting, set the must_sort flag for the output
11808 section.
11809 (Layout::make_output_section): If the name of the output section
11810 indicates that it might require sorting, set the may_sort flag.
11811 * output.h (Output_section::may_sort_attached_input_sections): New
11812 function.
11813 (Output_section::set_may_sort_attached_input_sections): New
11814 function.
11815 (Output_section::must_sort_attached_input_sections): New
11816 function.
11817 (Output_section::set_must_sort_attached_input_sections): New
11818 function.
11819 (class Output_section): Declare Input_section_sort_entry. Define
11820 Input_section_sort_compare. Declare
11821 sort_attached_input_sections. Add new fields:
11822 may_sort_attached_input_sections_,
11823 must_sort_attached_input_sections_,
11824 attached_input_sections_are_sorted_.
11825 * output.cc (Output_section::Output_section): Initialize new
11826 fields.
11827 (Output_section::add_input_section): Add an entry to
11828 input_sections_ if may_sort or must_sort are true.
11829 (Output_section::set_final_data_size): Call
11830 sort_attached_input_sections if necessary.
11831 (Output_section::Input_section_sort_entry): Define new class.
11832 (Output_section::Input_section_sort_compare::operator()): New
11833 function.
11834 (Output_section::sort_attached_input_sections): New function.
11835 * configure.ac: Check whether the compiler supports constructor
11836 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11837 * testsuite/initpri1.c: New file.
11838 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11839 CONSTRUCTOR_PRIORITY.
11840 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11841 (initpri1_LDFLAGS): New variable.
11842 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11843
18e6b24e
ILT
118442008-03-27 Ian Lance Taylor <iant@google.com>
11845
49bdd526
ILT
11846 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11847 * testsuite/common_test_1.c: New file.
11848 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11849 (common_test_1_SOURCES): New variable.
11850 (common_test_1_DEPENDENCIES): New variable.
11851 (common_test_1_LDFLAGS): New variable.
11852
18e6b24e
ILT
11853 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11854 and commons_ correctly when NAME/VERSION does not override
11855 NAME/NULL.
11856 * testsuite/ver_test_6.c: New file.
11857 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11858 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11859 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11860
04bf7072
ILT
118612008-03-26 Ian Lance Taylor <iant@google.com>
11862
5871526f
ILT
11863 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11864 of an undefined symbol from a version script.
11865 * testsuite/Makefile.am (ver_test_5.so): New target.
11866 (ver_test_5.o): New target.
11867 (check_SCRIPTS): Add ver_test_5.sh.
11868 (check_DATA): Add ver_test_5.syms.
11869 (ver_test_5.syms): New target.
11870 * testsuite/ver_test_5.cc: New file.
11871 * testsuite/ver_test_5.script: New file.
11872 * testsuite/ver_test_5.sh: New file.
11873 * Makefile.in, testsuite/Makefile.in: Rebuild.
11874
04bf7072
ILT
11875 PR gold/5986
11876 Fix problems building gold with gcc 4.3.0.
11877 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11878 (gold_error_at_location, gold_warning_at_location): Use it.
11879 * configure.ac: Check whether we can compile and use a template
11880 function with a printf attribute.
11881 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11882 when jumping over bytes.
11883 * object.cc: Instantiate Object::read_section_data.
11884 * debug.h: Include <cstring>
11885 * dwarf_reader.cc: Include <algorithm>
11886 * main.cc: Include <cstring>.
11887 * options.cc: Include <cstring>.
11888 * output.cc: Include <cstring>.
11889 * script.cc: Include <cstring>.
11890 * script.h: Include <string>.
11891 * symtab.cc: Include <cstring> and <algorithm>.
11892 * target-select.cc: Include <cstring>.
11893 * version.cc: Include <string>.
11894 * testsuite/testmain.cc: Include <cstdlib>.
11895 * configure, config.in: Rebuild.
11896
874c5b28
ILT
118972008-03-25 Ian Lance Taylor <iant@google.com>
11898
819d6c3a
ILT
11899 * options.cc: Include "../bfd/bfdver.h".
11900 (options::help): Print bug reporting address.
11901
f4b2c6f5
ILT
11902 * version.cc (print_version): Adjust output for current value of
11903 BFD_VERSION_STRING.
11904
11905 * NEWS: New file.
11906
e96caa79
ILT
11907 * options.cc (options::help): Print list of supported targets.
11908 * target-select.h: Include <vector>.
11909 (class Target_selector): Make machine_, size_, and is_big_endian_
11910 fields const. Add bfd_name_ and instantiated_target_ fields.
11911 (Target_selector::Target_selector): Add bfd_name parameter.
11912 (Target_selector::recognize): Make non-virtual, call
11913 do_recognize.
11914 (Target_selector::recognize_by_name): Make non-virtual, call
11915 do_recognize_by_name.
11916 (Target_selector::supported_names): New function.
11917 (Target_selector::bfd_name): New function.
11918 (Target_selector::do_instantiate_target): New pure virtual
11919 function.
11920 (Target_selector::do_recognize): New virtual function.
11921 (Target_selector::do_recognize_by_name): New virtual function.
11922 (Target_selector::instantiate_target): New private function.
11923 (supported_target_names): Declare.
11924 * target-select.cc (Target_selector::Target_selector): Update for
11925 new parameter and fields.
11926 (select_target_by_name): Check that the name matches before
11927 calling recognize_by_name.
11928 (supported_target_names): New function.
11929 * i386.cc (class Target_selector_i386): Update Target_selector
11930 constructor call. Remove recognize and recognize_by_name. Add
11931 do_instantiate_target.
11932 * x86_64.cc (class Target_selector_x86_64): Likewise.
11933 * testsuite/testfile.cc (class Target_selector_test): Update for
11934 changes to Target_selector.
11935
874c5b28
ILT
11936 * README: Rewrite, with some notes on unsupported features.
11937
0a65a3a7
CC
119382008-03-24 Cary Coutant <ccoutant@google.com>
11939
11940 * i386.cc (Target_i386::Got_type): New enum declaration.
11941 (Target_i386::Scan::local): Updated callers of Output_data_got
11942 member functions.
11943 (Target_i386::Scan::global): Likewise.
11944 (Target_i386::Relocate::relocate): Likewise.
11945 (Target_i386::Relocate::relocate_tls): Likewise.
11946 * object.h (Got_offset_list): New class.
11947 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11948 (Sized_relobj::local_got_offset): Likewise.
11949 (Sized_relobj::set_local_got_offset): Likewise.
11950 (Sized_relobj::local_has_tls_got_offset): Removed.
11951 (Sized_relobj::local_tls_got_offset): Removed.
11952 (Sized_relobj::set_local_tls_got_offset): Removed.
11953 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11954 * output.cc (Output_data_got::add_global): Added got_type parameter.
11955 (Output_data_got::add_global_with_rel): Likewise.
11956 (Output_data_got::add_global_with_rela): Likewise.
11957 (Output_data_got::add_global_pair_with_rel): New function.
11958 (Output_data_got::add_global_pair_with_rela): New function.
11959 (Output_data_got::add_local): Added got_type parameter.
11960 (Output_data_got::add_local_with_rel): Likewise.
11961 (Output_data_got::add_local_with_rela): Likewise.
11962 (Output_data_got::add_local_pair_with_rel): New function.
11963 (Output_data_got::add_local_pair_with_rela): New function.
11964 (Output_data_got::add_global_tls): Removed.
11965 (Output_data_got::add_global_tls_with_rel): Removed.
11966 (Output_data_got::add_global_tls_with_rela): Removed.
11967 (Output_data_got::add_local_tls): Removed.
11968 (Output_data_got::add_local_tls_with_rel): Removed.
11969 (Output_data_got::add_local_tls_with_rela): Removed.
11970 * output.h (Output_data_got::add_global): Added got_type parameter.
11971 (Output_data_got::add_global_with_rel): Likewise.
11972 (Output_data_got::add_global_with_rela): Likewise.
11973 (Output_data_got::add_global_pair_with_rel): New function.
11974 (Output_data_got::add_global_pair_with_rela): New function.
11975 (Output_data_got::add_local): Added got_type parameter.
11976 (Output_data_got::add_local_with_rel): Likewise.
11977 (Output_data_got::add_local_with_rela): Likewise.
11978 (Output_data_got::add_local_pair_with_rel): New function.
11979 (Output_data_got::add_local_pair_with_rela): New function.
11980 (Output_data_got::add_global_tls): Removed.
11981 (Output_data_got::add_global_tls_with_rel): Removed.
11982 (Output_data_got::add_global_tls_with_rela): Removed.
11983 (Output_data_got::add_local_tls): Removed.
11984 (Output_data_got::add_local_tls_with_rel): Removed.
11985 (Output_data_got::add_local_tls_with_rela): Removed.
11986 * resolve.cc (Symbol::override_base_with_special): Removed
11987 reference to has_got_offset_ field.
11988 * symtab.cc (Symbol::init_fields): Replaced initialization
11989 of got_offset_ with got_offsets_. Removed initialization
11990 of has_got_offset_
53fcba31 11991 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11992 (Symbol::got_offset): Likewise.
11993 (Symbol::set_got_offset): Likewise.
11994 (Symbol::has_tls_got_offset): Removed.
11995 (Symbol::tls_got_offset): Removed.
11996 (Symbol::set_tls_got_offset): Removed.
11997 (Symbol::got_offset_): Removed.
11998 (Symbol::tls_mod_got_offset_): Removed.
11999 (Symbol::tls_pair_got_offset_): Removed.
12000 (Symbol::got_offsets_): New field.
12001 (Symbol::has_got_offset): Removed.
12002 (Symbol::has_tls_mod_got_offset): Removed.
12003 (Symbol::has_tls_pair_got_offset): Removed.
12004 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
12005 (Target_x86_64::Scan::local): Updated callers of Output_data_got
12006 member functions.
12007 (Target_x86_64::Scan::global): Likewise.
12008 (Target_x86_64::Relocate::relocate): Likewise.
12009 (Target_x86_64::Relocate::relocate_tls): Likewise.
12010
bd52eafb
BE
120112008-03-25 Ben Elliston <bje@au.ibm.com>
12012
12013 * yyscript.y: Fix spelling error in comment.
12014
8b105e34
ILT
120152008-03-24 Ian Lance Taylor <iant@google.com>
12016
8ed814a9
ILT
12017 * options.h (class General_options): Define build_id option.
12018 * layout.h (class Layout): Declare write_build_id, create_note,
12019 create_build_id. Add build_id_note_ member.
12020 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
12021 "libiberty.h", "md5.h", "sha1.h".
12022 (Layout::Layout): Initialize eh_frame_data_,
12023 eh_frame_hdr_section_, and build_id_note_.
12024 (Layout::finalize): Call create_build_id.
12025 (Layout::create_note): New function, broken out of
12026 Layout::create_gold_note.
12027 (Layout::create_gold_note): Call create_note.
12028 (Layout::create_build_id): New function.
12029 (Layout::write_build_id): New function.
12030 (Close_task_runner::run): Call write_build_id.
12031
8b105e34
ILT
12032 * x86_64.cc: Correct license to GPLv3.
12033
086a1841
ILT
120342008-03-23 Ian Lance Taylor <iant@google.com>
12035
12036 * options.cc: Include "demangle.h".
12037 (parse_optional_string): New function.
12038 (parse_long_option): Handle takes_optional_argument.
12039 (parse_short_option): Update dash_z initializer. Handle
12040 takes_optional_argument.
12041 (General_options::General_options): Initialize do_demangle_.
12042 (General_options::finalize): Set do_demangle_. Handle demangling
12043 style.
12044 * options.h (parse_optional_string): Declare.
12045 (struct One_option): Add optional_arg field. Update constructor.
12046 Update call constructor calls. Add takes_optional_argument
12047 function.
12048 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
12049 (DEFINE_optional_string): Define.
12050 (General_options::demangle): Change from DEFINE_bool to
12051 DEFINE_optional_string.
12052 (General_options::no_demangle): New function.
12053 (General_options::do_demangle): New function.
12054 (General_options::set_do_demangle): New function.
12055 (General_options::execstack_status_): Move definition to end of
12056 class definition.
12057 (General_options::static_): Likewise.
12058 (General_options::do_demangle_): New field.
12059 * object.cc (big_endian>::get_symbol_location_info): Call
12060 Options::do_demangle, not Options::demangle.
12061 * symtab.cc (demangle): Likewise.
12062
cbb93e63
ILT
120632008-03-22 Ian Lance Taylor <iant@google.com>
12064
12065 * gold.h: Include <cstddef> and <sys/types.h>
12066 * options.h: Include <cstring>.
12067
ec531623
ILT
120682008-03-21 Ian Lance Taylor <iant@google.com>
12069
12070 * Added source code to GNU binutils.
This page took 0.698033 seconds and 4 git commands to generate.