2010-10-17 Doug Kwan <dougkwan@google.com>
[binutils-gdb.git] / gold / ChangeLog
1 2010-10-17 Doug Kwan <dougkwan@google.com>
2
3 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4 GOT output section to be writable.
5
6 2010-10-14 Cary Coutant <ccoutant@google.com>
7
8 * debug.h (DEBUG_INCREMENTAL): New flag.
9 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
10 * gold.cc (queue_initial_tasks): Check parameters for incremental link
11 mode.
12 * incremental.cc (report_command_line): Ignore all forms of
13 --incremental.
14 * layout.cc (Layout::Layout): Check parameters for incremental link
15 mode.
16 * options.cc (General_options::parse_incremental): New function.
17 (General_options::parse_no_incremental): New function.
18 (General_options::parse_incremental_full): New function.
19 (General_options::parse_incremental_update): New function.
20 (General_options::incremental_mode_): New data member.
21 (General_options::finalize): Check incremental_mode_.
22 * options.h (General_options): Update help text for --incremental.
23 Add --no-incremental, --incremental-full, --incremental-update.
24 (General_options::Incremental_mode): New enum type.
25 (General_options::incremental_mode): New function.
26 (General_options::incremental_mode_): New data member.
27 * parameters.cc (Parameters::incremental_mode_): New data member.
28 (Parameters::set_options): Set incremental_mode_.
29 (Parameters::set_incremental_full): New function.
30 (Parameters::incremental): New function.
31 (Parameters::incremental_update): New function.
32 (set_parameters_incremental_full): New function.
33 * parameters.h (Parameters::set_incremental_full): New function.
34 (Parameters::incremental): New function.
35 (Parameters::incremental_update): New function.
36 (Parameters::incremental_mode_): New data member.
37 (set_parameters_incremental_full): New function.
38 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
39 incremental link mode.
40 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
41 (Sized_relobj::do_relocate_sections): Likewise.
42 * testsuite/Makefile.am (incremental_test): Use --incremental-full
43 option.
44 * testsuite/Makefile.in: Regenerate.
45 * testsuite/incremental_test.sh: Filter all forms of --incremental.
46
47 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
48
49 * script-sections.h (class Script_sections): Make
50 Sections_elements typedef public.
51 * script-sections.cc (class Sort_output_sections): Add elements_
52 field. Add constructor which sets it; change all callers.
53 (Sort_output_sections::is_before): New function.
54 (Sort_output_sections::operator()): Call is_before.
55 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
56 conditional.
57 * testsuite/script_test_10.sh: New test. Test script section
58 order.
59 * testsuite/script_test_10.t: Likewise.
60 * testsuite/script_test_10.s: Likewise.
61 * testsuite/Makefile.am: Wrap the cross linker tests and the
62 common tests into NATIVE_OR_CROSS_LINKER.
63 (check_SCRIPTS): Add script_test_10.sh.
64 (check_DATA): Add script_test_10.stdout.
65 (script_test_10.o, script_test_10): New targets.
66 (script_test_10.stdout): New target.
67 * configure, testsuite/Makefile.in: Regenerate.
68
69 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
70
71 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
72 error for the deprecated relocations.
73 (Target_arm::Scan::global): Likewise.
74 (Target_arm::Relocate::relocate): Likewise.
75
76 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
77
78 * fileread.cc (Input_file::find_file): Initialize *found_name
79 and *namep when using the fallback search for case 4.
80
81 2010-10-11 Cary Coutant <ccoutant@google.com>
82
83 * options.h (class General_options): Redefine -z lazy as an alias for
84 the negation of -z now.
85
86 2010-10-11 Ian Lance Taylor <iant@google.com>
87
88 * resolve.cc (symbol_to_bits): Report the value of the unsupported
89 binding.
90
91 2010-10-06 Nick Clifton <nickc@redhat.com>
92
93 * script-sections.cc(class Memory_region): Remove
94 current_lma_offset_ field. Rename current_vma_offset_ to
95 current_offset_. Add last_section_ field.
96 (Memory_region::get_current_vma_address): Rename to
97 get_current_address.
98 (Memory_region::get_current_lma_address): Delete.
99 (Memory_region::increment_vma_offset): Rename to
100 increment_offset.
101 (Memory_region::increment_lma_offset): Delete.
102 (Memory_region::attributes_compatible): New method. Returns
103 true if the provided section is compatible with the region.
104 (Memory_region::get_last_section): New method. Returns the last
105 section to use the region.
106 (Memory_region::set_last_section): New method. Stores the last
107 section to use the region.
108 (Script_sections::block_in_region): New method. Returns true if
109 a block of memory is contained within a region.
110 (Script_sections::find_memory_region): New method. Locates a
111 memory region to be used to set a VMA or LMA address.
112 (Output_section_definition::set_section_addresses): Add code to
113 check for addresses set by memory regions.
114 (Output_segment::set_section_addresses): Remove memory region
115 walking code.
116 (Script_sections::create_segment): Add a warning if a header
117 segment is created outside of any region.
118 * script-sections.h (class Script_sections): Add prototypes for
119 find_memory_region and block_in_region methods.
120 * testsuite/memory_test.s: Use .long instead of .word.
121 * testsuite/memory_test.t: Add some more output sections.
122 * testsuite/memory_test.sh: Update expected output.
123
124 2010-10-02 Doug Kwan <dougkwan@google.com>
125
126 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
127 defintion to symtab.h
128 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
129 declaration to defintion.
130
131 2010-10-01 Nick Clifton <nickc@redhat.com>
132
133 * expression.cc (eval): Replace dummy argument with NULL.
134 (eval_maybe_dot): Check for a NULL result section pointer.
135 (Symbol_expression::value): Likewise.
136 (Dot_expression::value): Likewise.
137 (BINARY_EXPRESSION): Likewise.
138 (Max_expression::value): Likewise.
139 (Min_expression::value): Likewise.
140 (Absolute_expression::value): Likewise.
141 (Addr_expression::value_from_output_section): Likewise.
142 (Loaddddr_expression::value_from_output_section): Likewise.
143 (Segment_start_expression::value): Likewise.
144 * script-sections.cc
145 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
146 argument with NULL.
147 (Sections_elememt_dot_assignment::set_section_addresses):
148 Likewise.
149 (Output_data_expression::do_write_to_buffer): Likewise.
150 (Output_section_definition::finalize_symbols): Likewise.
151 (Output_section_definition::set_section_addresses): Likewise.
152
153 2010-09-30 Doug Kwan <dougkwan@google.com>
154
155 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
156
157 2010-09-28 Sriraman Tallam <tmsriram@google.com>
158
159 * target.h (Target::can_icf_inline_merge_sections): New virtual
160 function.
161 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
162 virtual function.
163 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
164 virtual function.
165 * icf.cc (get_section_contents): Inline merge sections only when
166 target allows it.
167
168 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
169
170 * configure: Regenerate.
171
172 2010-09-17 Ian Lance Taylor <iant@google.com>
173
174 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
175 * testsuite/Makefile.am (memory_test.o): New target.
176 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
177 memory_test.t.
178 * testsuite/Makefile.in: Rebuild.
179
180 2010-09-17 Doug Kwan <dougkwan@google.com>
181
182 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
183 defintion if relocation uses GOT entries of the symbol.
184 * testsuite/icf_safe_test.sh: Fix test.
185 * testsuite/icf_safe_so_test.sh: Fix test.
186
187 2010-09-16 Cary Coutant <ccoutant@google.com>
188
189 * script_sections.cc (class Memory_region): Remove "NULL" from
190 vector initializations.
191
192 2010-09-15 Cary Coutant <ccoutant@google.com>
193
194 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
195 Resolve forwarding symbols.
196
197 2010-09-15 Doug Kwan <dougkwan@google.com>
198
199 * gold/testsuite/script_test_3.t: Add ARM special sections.
200 * gold/testsuite/script_test_4.t: Same.
201 * gold/testsuite/script_test_5.t: Same.
202 * gold/testsuite/script_test_6.t: Same.
203 * gold/testsuite/script_test_7.t: Same.
204 * gold/testsuite/script_test_7.t: Same.
205 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
206
207 2010-09-14 Cary Coutant <ccoutant@google.com>
208
209 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
210 (Target_x86_64::Relocate::relocate_tls): Replace check for
211 saw_tls_block_reloc_ with test for executable section.
212
213 2010-09-12 Cary Coutant <ccoutant@google.com>
214
215 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
216 position-independent executables to shared libraries need dynamic
217 relocations.
218 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
219 position-independent executables.
220 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
221 * testsuite/Makefile.in: Regenerate.
222
223 2010-09-10 Nick Clifton <nickc@redhat.com>
224
225 PR gold/11997
226 * testsuite/memory_test.t: Discard any sections that are not
227 needed.
228
229 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
230
231 PR gold/11996
232 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
233 "This::" to work around a bug in gcc 4.2.
234
235 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
236
237 2010-09-09 Rafael Espindola <espindola@google.com>
238
239 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
240 sections with different PF_X flags in the same segment.
241 (Layout::find_first_load_seg): Search all segments to find the first
242 one.
243 * options.h (rosegment): New.
244
245 2010-09-08 Rafael Espindola <espindola@google.com>
246
247 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
248
249 2010-09-08 Doug Kwan <dougkwan@google.com>
250
251 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
252 (Arm_relobj::do_relocate_sections): Add new parameter for output
253 file to match the parent.
254 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
255 of local symbols instead of input values. Update code to track
256 changes in gold::relocate_section.
257 * object.cc (Sized_relobj::compute_final_local_value): New methods.
258 (Sized_relobj::compute_final_local_value_internal): New methods.
259 (Sized_relobj::do_finalize_local_symbols): Move code from loop
260 body into private version of Sized_relobj::compute_final_local_value.
261 Call the inline method.
262 * object.h (Symbol_value::Symbol_value): Define destructor. Free
263 merged symbol value if there is one.
264 (Symbol_value::has_output_value): New method defintiion.
265 (Sized_relobj::Compute_final_local_value_status): New enum type.
266 (Sized_relobj::compute_final_local_value): New methods.
267 (Sized_relobj::compute_final_local_value_internal): New methods.
268 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
269 and arm_cortex_a8.sh.
270 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
271 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
272 New tests.
273 * Makefile.in: Regenerate.
274 * testsuite/arm_bl_out_of_range.s: Update test.
275 * testsuite/thumb_bl_out_of_range.s: Ditto.
276 * testsuite/thumb_blx_out_of_range.s: Ditto.
277 * testsuite/arm_branch_out_of_range.sh: New file.
278 * testsuite/arm_cortex_a8.sh: Ditto.
279 * testsuite/arm_cortex_a8_b.s: Ditto.
280 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
281 * testsuite/arm_cortex_a8_b_local.s: Ditto.
282 * testsuite/arm_cortex_a8_bl.s: Ditto.
283 * testsuite/arm_cortex_a8_blx.s: Ditto.
284 * testsuite/arm_cortex_a8_local.s: Ditto.
285 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
286 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
287
288 2010-09-08 Rafael Espindola <espindola@google.com>
289
290 * Makefile.am (memory_test.stdout): Run readelf with -W.
291 * Makefile.in: Regenerate.
292 * testsuite/memory_test.sh: Make the regexps accept both 32 and
293 64 bit output.
294
295 2010-09-08 Rafael Espindola <espindola@google.com>
296
297 * script-sections.cc (Script_sections::add_memory_region): Convert
298 field precision to int.
299 * script.cc (script_set_section_region, script_set_section_region):
300 Convert field precision to int.
301
302 2010-09-08 Rafael Espindola <espindola@google.com>
303
304 * arm.cc (do_finalize_sections): Create the __exidx_start and
305 __exdix_end symbols even when the section is missing.
306
307 2010-09-08 Nick Clifton <nickc@redhat.com>
308
309 * README: Remove claim that MEMORY is not supported.
310 * expression.cc (script_exp_function_origin)
311 (script_exp_function_length): Move from here to ...
312 * script.cc: ... here.
313 (script_set_section_region, script_add_memory)
314 (script_parse_memory_attr, script_include_directive): New
315 functions.
316 * script-sections.cc
317 (class Memory_region): New class.
318 (class Output_section_definition): Add set_memory_region,
319 set_section_vma, set_section_lma and get_section_name methods.
320 (class Script_Sections): Add add_memory_region,
321 find_memory_region, find_memory_region_origin,
322 find_memory_region_length and set_memory_region methods.
323 Have set_section_addresses method walk the list of set memory
324 regions.
325 Extend the print methos to display memory regions.
326 * script-sections.h: Add prototypes for new methods.
327 Add enum for MEMORY region attributes.
328 * yyscript.y: Add support for parsing MEMORY regions.
329 * script-c.h: Add prototypes for new functions.
330 * testsuite/Makefile.am: Add test of MEMORY region functionality.
331 * testsuite/Makefile.in: Regenerate.
332 * testsuite/memory_test.sh: New script.
333 * testsuite/memory_test.s: New assembler source file.
334 * testsuite/memory_test.t: New linker script.
335
336 2010-08-27 Doug Kwan <dougkwan@google.com>
337
338 * gold/resolve.cc (Symbol_table::should_override): Let a weak
339 reference override an existing dynamic weak reference.
340 * testsuite/Makefile.am: Add new test dyn_weak_ref.
341 * testsuite/Makefile.in: Regenerate.
342 * testsuite/dyn_weak_ref.sh: New file.
343 * testsuite/dyn_weak_ref_1.c: Ditto.
344 * testsuite/dyn_weak_ref_2.c: Ditto.
345
346 2010-08-27 Ian Lance Taylor <iant@google.com>
347
348 * incremental.h (class Incremental_input_entry): Add virtual
349 destructor.
350
351 2010-08-27 Ian Lance Taylor <iant@google.com>
352
353 * testsuite/start_lib_test_3.c: Mark t3 as used.
354
355 2010-08-27 Nick Clifton <nickc@redhat.com>
356
357 * options.cc (version_script): Fix small typo in previous
358 whitespace tidyup.
359
360 2010-08-25 Nick Clifton <nickc@redhat.com>
361
362 * archive.cc: Formatting fixes: Remove whitespace between
363 typename and following asterisk. Remove whitespace between
364 function name and opening parenthesis.
365 * archive.h: Likewise.
366 * arm.cc: Likewise.
367 * attributes.cc: Likewise.
368 * attributes.h: Likewise.
369 * common.cc: Likewise.
370 * copy-relocs.cc: Likewise.
371 * dirsearch.h: Likewise.
372 * dynobj.cc: Likewise.
373 * ehframe.cc: Likewise.
374 * ehframe.h: Likewise.
375 * expression.cc: Likewise.
376 * fileread.cc: Likewise.
377 * fileread.h: Likewise.
378 * gc.h: Likewise.
379 * gold-threads.cc: Likewise.
380 * gold.cc: Likewise.
381 * i386.cc: Likewise.
382 * icf.h: Likewise.
383 * incremental-dump.cc: Likewise.
384 * incremental.cc: Likewise.
385 * layout.cc: Likewise.
386 * layout.h: Likewise.
387 * main.cc: Likewise.
388 * merge.cc: Likewise.
389 * merge.h: Likewise.
390 * object.cc: Likewise.
391 * object.h: Likewise.
392 * options.cc: Likewise.
393 * options.h: Likewise.
394 * output.cc: Likewise.
395 * output.h: Likewise.
396 * plugin.cc: Likewise.
397 * plugin.h: Likewise.
398 * powerpc.cc: Likewise.
399 * reloc.cc: Likewise.
400 * script-c.h: Likewise.
401 * script-sections.cc: Likewise.
402 * script.cc: Likewise.
403 * stringpool.cc: Likewise.
404 * symtab.cc: Likewise.
405 * symtab.h: Likewise.
406 * target.cc: Likewise.
407 * timer.cc: Likewise.
408 * timer.h: Likewise.
409 * version.cc: Likewise.
410 * x86_64.cc: Likewise.
411
412 2010-08-24 Nick Clifton <nickc@redhat.com>
413
414 PR 11899
415 * layout.cc (segment_precedes): Sort segments by their physical
416 addresses, if they have been set.
417
418 2010-08-23 Cary Coutant <ccoutant@google.com>
419
420 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
421 symbols data.
422 (Lib_group::include_member): Unlock object after deleting its
423 symbols data.
424 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
425 the bug fixed here.
426
427 2010-08-19 Neil Vachharajani <nvachhar@google.com>
428 Cary Coutant <ccoutant@google.com>
429
430 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
431 constructor, and set_blocker.
432 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
433 readsyms_blocker_.
434 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
435 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
436 * testsuite/Makefile.am (start_lib_test): New test case.
437 * testsuite/Makefile.in: Regenerate.
438 * testsuite/start_lib_test_main.c: New file.
439 * testsuite/start_lib_test_1.c: New file.
440 * testsuite/start_lib_test_2.c: New file.
441 * testsuite/start_lib_test_3.c: New file.
442
443 2010-08-19 Ian Lance Taylor <iant@google.com>
444
445 * Makefile.in: Rebuild with automake 1.11.1.
446 * aclocal.m4: Likewise.
447 * testsuite/Makefile.in: Likewise.
448
449 2010-08-19 Ian Lance Taylor <iant@google.com>
450
451 PR 10893
452 * i386.cc (class Output_data_plt_i386): Update declarations.
453 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
454 local_ifuncs_ fields.
455 (Target_i386::do_plt_section_for_global): New function.
456 (Target_i386::do_plt_section_for_local): New function.
457 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
458 parameter; change all callers. Initialize global_ifuncs_ and
459 local_ifuncs_. If doing a static link define __rel_iplt_start and
460 __rel_iplt_end.
461 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
462 (Output_data_plt_i386::add_local_ifunc_entry): New function.
463 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
464 symbols.
465 (Target_i386::make_plt_section): New function, broken out of
466 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
467 (Target_i386::make_plt_entry): Call make_plt_section.
468 (Target_i386::make_local_ifunc_plt_entry): New function.
469 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
470 (Target_i386::Scan::local): Handle IFUNC symbols. Add
471 R_386_IRELATIVE to switch.
472 (Target_i386::Scan::global): Likewise.
473 (Target_i386::Relocate::relocate): Likewise.
474 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
475 switch.
476 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
477 (Target_x86_64::do_plt_section_for_global): New function.
478 (Target_x86_64::do_plt_section_for_local): New function.
479 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
480 parameter; change all callers. If doing a static link define
481 __rela_iplt_start and __rela_iplt_end.
482 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
483 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
484 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
485 to point to .plt.
486 (Target_x86_64::make_local_ifunc_plt_entry): New function.
487 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
488 switch.
489 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
490 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
491 R_X86_64_IRELATIVE to switch.
492 (Target_x86_64::Scan::global): Likewise.
493 (Target_x86_64::Relocate::relocate): Likewise.
494 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
495 switch.
496 * target.h (class Target): Add plt_section_for_global and
497 plt_section_for_local functions. Add do_plt_section_for_global
498 and do_plt_section_for_local virtual functions.
499 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
500 clarifying comments.
501 (Symbol::use_plt_offset): Handle IFUNC symbol.
502 * object.cc (Sized_relobj::Sized_relobj): Initialize
503 local_plt_offsets_.
504 (Sized_relobj::local_has_plt_offset): New function.
505 (Sized_relobj::local_plt_offset): New function.
506 (Sized_relobj::set_local_plt_offset): New function.
507 (Sized_relobj::do_count): Handle IFUNC symbol.
508 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
509 a bit away from input_shndx_ field. Add set_is_func_symbol and
510 is_ifunc_symbol functions.
511 (class Sized_relobj): Update declarations. Remove Tls_got_entry
512 and Local_tls_got_offsets. Define Local_plt_offsets. Add
513 local_plt_offsets_ field.
514 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
515 * output.h (class Output_section_data): Add non-const
516 output_section function.
517 (class Output_data_got): Update declarations.
518 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
519 Add use_plt_offset parameter to global and local constructors.
520 Change all callers. Change local_sym_index_ field to 31 bits.
521 Change GSYM_CODE and CONSTANT_CODE accordingly.
522 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
523 doing a static link don't set sh_link field.
524 (Output_data_got::Got_entry::write): Use PLT offset if
525 appropriate.
526 (Output_data_got::add_global_plt): New function.
527 (Output_data_got::add_local_plt): New function.
528 * target-reloc.h (relocate_section): Handle IFUNC symbol.
529 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
530 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
531 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
532 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
533 IFUNC conditional.
534 * testsuite/ifunc-sel.h: New file.
535 * testsuite/ifuncmain1.c: New file.
536 * testsuite/ifuncmain1vis.c: New file.
537 * testsuite/ifuncmod1.c: New file.
538 * testsuite/ifuncdep2.c: New file.
539 * testsuite/ifuncmain2.c: New file.
540 * testsuite/ifuncmain3.c: New file.
541 * testsuite/ifuncmod3.c: New file.
542 * testsuite/ifuncmain4.c: New file.
543 * testsuite/ifuncmain5.c: New file.
544 * testsuite/ifuncmod5.c: New file.
545 * testsuite/ifuncmain6pie.c: New file.
546 * testsuite/ifuncmod6.c: New file.
547 * testsuite/ifuncmain7.c: New file.
548 * configure, testsuite/Makefile.in: Rebuild.
549
550 2010-08-18 Ian Lance Taylor <iant@google.com>
551
552 * incremental.cc
553 (Output_section_incremental_inputs::write_input_files): Add cast
554 to avoid signed/unsigned comparison warning.
555 (Output_section_incremental_inputs::write_info_blocks): Likewise.
556
557 2010-08-12 Cary Coutant <ccoutant@google.com>
558
559 * common.cc (Sort_commons::operator()): Remove unnecessary code.
560
561 2010-08-13 Ian Lance Taylor <iant@google.com>
562
563 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
564
565 2010-08-12 Cary Coutant <ccoutant@google.com>
566 Doug Kwan <dougkwan@google.com>
567
568 * resolve.cc (Symbol_table::should_override): When a weak dynamic
569 defintion overrides non-weak undef, remember that the original undef
570 is not weak.
571 * symtab.cc (Symbol_table::sized_write_global): For undef without
572 an original weak binding, set binding to global in output.
573 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
574 * testsuite/Makefile.in: Regenerate.
575 * testsuite/strong_ref_weak_def.sh: New file.
576 * testsuite/strong_ref_weak_def_1.c: Ditto.
577 * testsuite/strong_ref_weak_def_2.c: Ditto.
578
579 2010-08-12 Cary Coutant <ccoutant@google.com>
580
581 * testsuite/incremental_test.sh: Rewrite.
582 * testsuite/incremental_test_1.c: Rewrite.
583 * testsuite/incremental_test_2.c: Rewrite.
584
585 2010-08-12 Cary Coutant <ccoutant@google.com>
586
587 * arm.cc (Target_arm::got_size): Add const.
588 (Target_arm::got_entry_count): New function.
589 (Target_arm::plt_entry_count): New function.
590 (Target_arm::first_plt_entry_offset): New function.
591 (Target_arm::plt_entry_size): New function.
592 (Output_data_plt_arm::entry_count): New function.
593 (Output_data_plt_arm::first_plt_entry_offset): New function.
594 (Output_data_plt_arm::get_plt_entry_size): New function.
595 * i386.cc (Target_i386::got_size): Add const.
596 (Target_i386::got_entry_count): New function.
597 (Target_i386::plt_entry_count): New function.
598 (Target_i386::first_plt_entry_offset): New function.
599 (Target_i386::plt_entry_size): New function.
600 (Output_data_plt_i386::entry_count): New function.
601 (Output_data_plt_i386::first_plt_entry_offset): New function.
602 (Output_data_plt_i386::get_plt_entry_size): New function.
603 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
604 find_incremental_inputs_sections. Dump incremental_got_plt section.
605 * incremental.cc: Include target.h.
606 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
607 parameter. Adjust all callers. Find incremental_got_plt section.
608 (Incremental_inputs::create_data_sections): Create incremental_got_plt
609 section.
610 (Output_section_incremental_inputs::set_final_data_size): Calculate
611 size of incremental_got_plt section.
612 (Output_section_incremental_inputs::do_write): Write the
613 incremental_got_plt section.
614 (Got_plt_view_info): New struct.
615 (Local_got_offset_visitor): New class.
616 (Global_got_offset_visitor): New class.
617 (Global_symbol_visitor_got_plt): New class.
618 (Output_section_incremental_inputs::write_got_plt): New function.
619 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
620 Add parameter. Adjust all callers.
621 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
622 (Incremental_inputs::got_plt_section): New function.
623 (Incremental_inputs::got_plt_section_): New data member.
624 (Incremental_got_plt_reader): New class.
625 * layout.cc (Layout::create_incremental_info_sections): Add the
626 incremental_got_plt section.
627 * object.h (Got_offset_list::get_list): New function.
628 (Got offset_list::for_all_got_offsets): New function.
629 (Sized_relobj::local_got_offset_list): New function.
630 * powerpc.cc (Target_powerpc::got_size): Add const.
631 (Target_powerpc::got_entry_count): New function.
632 (Target_powerpc::plt_entry_count): New function.
633 (Target_powerpc::first_plt_entry_offset): New function.
634 (Target_powerpc::plt_entry_size): New function.
635 (Output_data_plt_powerpc::entry_count): New function.
636 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
637 (Output_data_plt_powerpc::get_plt_entry_size): New function.
638 * sparc.cc (Target_sparc::got_size): Add const.
639 (Target_sparc::got_entry_count): New function.
640 (Target_sparc::plt_entry_count): New function.
641 (Target_sparc::first_plt_entry_offset): New function.
642 (Target_sparc::plt_entry_size): New function.
643 (Output_data_plt_sparc::entry_count): New function.
644 (Output_data_plt_sparc::first_plt_entry_offset): New function.
645 (Output_data_plt_sparc::get_plt_entry_size): New function.
646 * symtab.h (Symbol::got_offset_list): New function.
647 (Symbol_table::for_all_symbols): New function.
648 * target.h (Sized_target::got_entry_count): New function.
649 (Sized_target::plt_entry_count): New function.
650 (Sized_target::plt_entry_size): New function.
651 * x86_64.cc (Target_x86_64::got_size): Add const.
652 (Target_x86_64::got_entry_count): New function.
653 (Target_x86_64::plt_entry_count): New function.
654 (Target_x86_64::first_plt_entry_offset): New function.
655 (Target_x86_64::plt_entry_size): New function.
656 (Output_data_plt_x86_64::entry_count): New function.
657 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
658 (Output_data_plt_x86_64::get_plt_entry_size): New function.
659
660 2010-08-12 Cary Coutant <ccoutant@google.com>
661
662 * archive.cc: Include incremental.h.
663 (Archive::Archive): Initialize incremental_info_.
664 (Archive::include_member): Record archive members in incremental info.
665 (Add_archive_symbols::run): Record begin and end of an archive in
666 incremental info.
667 (Lib_group::include_member): Record objects in incremental info.
668 * archive.h (Incremental_archive_entry): Forward declaration.
669 (Archive::set_incremental_info): New member function.
670 (Archive::incremental_info): New member function.
671 (Archive::Unused_symbol_iterator): New class.
672 (Archive::unused_symbols_begin): New member function.
673 (Archive::unused_symbols_end): New member function.
674 (Archive::incremental_info_): New data member.
675 * incremental-dump.cc (find_input_containing_global): New function.
676 (dump_incremental_inputs): Dump new incremental info sections.
677 * incremental.cc: Include symtab.h.
678 (Output_section_incremental_inputs): New class.
679 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
680 new incremental info sections.
681 (Sized_incremental_binary::do_check_inputs): Likewise.
682 (Incremental_inputs::report_archive): Remove.
683 (Incremental_inputs::report_archive_begin): New function.
684 (Incremental_inputs::report_archive_end): New function.
685 (Incremental_inputs::report_object): New function.
686 (Incremental_inputs::finalize_inputs): Remove.
687 (Incremental_inputs::report_input_section): New function.
688 (Incremental_inputs::report_script): Rewrite.
689 (Incremental_inputs::finalize): Do nothing but finalize string table.
690 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
691 (Incremental_inputs::sized_create_inputs_section_data): Remove.
692 (Incremental_inputs::create_data_sections): New function.
693 (Incremental_inputs::relocs_entsize): New function.
694 (Output_section_incremental_inputs::set_final_data_size): New function.
695 (Output_section_incremental_inputs::do_write): New function.
696 (Output_section_incremental_inputs::write_header): New function.
697 (Output_section_incremental_inputs::write_input_files): New function.
698 (Output_section_incremental_inputs::write_info_blocks): New function.
699 (Output_section_incremental_inputs::write_symtab): New function.
700 * incremental.h (Incremental_script_entry): Forward declaration.
701 (Incremental_object_entry): Forward declaration.
702 (Incremental_archive_entry): Forward declaration.
703 (Incremental_inputs): Forward declaration.
704 (Incremental_inputs_header_data): Remove.
705 (Incremental_inputs_header): Remove.
706 (Incremental_inputs_header_write): Remove.
707 (Incremental_inputs_entry_data): Remove.
708 (Incremental_inputs_entry): Remove.
709 (Incremental_inputs_entry_write): Remove.
710 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
711 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
712 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
713 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
714 Likewise.
715 (Incremental_input_entry): New class.
716 (Incremental_script_entry): New class.
717 (Incremental_object_entry): New class.
718 (Incremental_archive_entry): New class.
719 (Incremental_inputs::Incremental_inputs): Initialize new data members.
720 (Incremental_inputs::report_inputs): Remove.
721 (Incremental_inputs::report_archive): Remove.
722 (Incremental_inputs::report_archive_begin): New function.
723 (Incremental_inputs::report_archive_end): New function.
724 (Incremental_inputs::report_object): Change prototype.
725 (Incremental_inputs::report_input_section): New function.
726 (Incremental_inputs::report_script): Change prototype.
727 (Incremental_inputs::get_reloc_count): New function.
728 (Incremental_inputs::set_reloc_count): New function.
729 (Incremental_inputs::create_data_sections): New function.
730 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
731 (Incremental_inputs::inputs_section): New function.
732 (Incremental_inputs::symtab_section): New function.
733 (Incremental_inputs::relocs_section): New function.
734 (Incremental_inputs::get_stringpool): Add const.
735 (Incremental_inputs::command_line): Add const.
736 (Incremental_inputs::inputs): Remove.
737 (Incremental_inputs::command_line_key): New function.
738 (Incremental_inputs::input_file_count): New function.
739 (Incremental_inputs::input_files): New function.
740 (Incremental_inputs::relocs_entsize): New function.
741 (Incremental_inputs::sized_create_inputs_section_data): Remove.
742 (Incremental_inputs::finalize_inputs): Remove.
743 (Incremental_inputs::Input_info): Remove.
744 (Incremental_inputs::lock_): Remove.
745 (Incremental_inputs::inputs_): Change type.
746 (Incremental_inputs::inputs_map_): Remove.
747 (Incremental_inputs::current_object_entry_): New data member.
748 (Incremental_inputs::inputs_section_): New data member.
749 (Incremental_inputs::symtab_section_): New data member.
750 (Incremental_inputs::relocs_section_): New data member.
751 (Incremental_inputs::reloc_count_): New data member.
752 (Incremental_inputs_reader): New class.
753 (Incremental_symtab_reader): New class.
754 (Incremental_relocs_reader): New class.
755 * layout.cc (Layout::finalize): Move finalization of incremental info
756 and creation of incremental info sections to follow finalization of
757 symbol table. Set offsets for postprocessing sections.
758 (Layout::create_incremental_info_sections): Call
759 Incremental_inputs::create_data_sections. Add incremental symtab
760 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
761 sections to layout after input sections.
762 * layout.h (struct Timespec): Forward declaration.
763 (Layout::incremental_inputs): Add const.
764 (Layout::create_incremental_info_sections): Add parameter.
765 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
766 * object.cc: Include incremental.h.
767 (Relobj::finalize_incremental_relocs): New function.
768 (Sized_relobj::do_layout): Record input sections in incremental info.
769 * object.h (Object::output_section): New function.
770 (Object::output_section_offset): Moved from Relobj.
771 (Object::get_incremental_reloc_base): New function.
772 (Object::get_incremental_reloc_count): New function.
773 (Object::do_output_section): New function.
774 (Object::do_output_section_offset): Moved from Relobj.
775 (Object::do_get_incremental_reloc_base): New function.
776 (Object::do_get_incremental_reloc_count): New function.
777 (Object::Object): Initialize new data members.
778 (Relobj::output_section): Renamed do_output_section and moved to
779 protected.
780 (Relobj::output_section_offset): Moved to Object.
781 (Relobj::do_get_incremental_reloc_base): New function.
782 (Relobj::do_get_incremental_reloc_count): New function.
783 (Relobj::allocate_incremental_reloc_counts): New function.
784 (Relobj::count_incremental_reloc): New function.
785 (Relobj::finalize_incremental_relocs): New function.
786 (Relobj::next_incremental_reloc_index): New function.
787 (Relobj::reloc_counts_): New data member.
788 (Relobj::reloc_bases_): New data member.
789 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
790 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
791 (Sized_relobj::incremental_relocs_scan): New function.
792 (Sized_relobj::incremental_relocs_scan_reltype): New function.
793 (Sized_relobj::incremental_relocs_write): New function.
794 (Sized_relobj::incremental_relocs_write_reltype): New function.
795 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
796 incremental link.
797 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
798 archives and object files elsewhere.
799 (Add_symbols::run): Report object files here.
800 (Finish_group::run): Report end of archive at end of group.
801 * reloc.cc: Include layout.h, incremental.h.
802 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
803 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
804 (Sized_relobj::incremental_relocs_scan): New function.
805 (Sized_relobj::incremental_relocs_scan_reltype): New function.
806 (Sized_relobj::do_relocate_sections): Write incremental relocations.
807 (Sized_relobj::incremental_relocs_write): New function.
808 (Sized_relobj::incremental_relocs_write_reltype): New function.
809 * script.cc (read_input_script): Rewrite test for incremental link.
810 Change call to Incremental_inputs::report_script.
811 * symtab.h (Symbol_table::first_global_index): New function.
812 (Symbol_table::output_count): New function.
813
814 2010-08-12 Doug Kwan <dougkwan@google.com>
815
816 * arm.cc (Target_arm::merge_object_attributes): Check command line
817 options --no-wchar-size-warning and --no-enum-size-warning.
818 * options.h (General_options): Add ld-compatible options
819 --no-enum-size-warning and --no-wchar-size-warning.
820
821 2010-08-04 Ian Lance Taylor <iant@google.com>
822
823 * x86_64.cc (Target_x86_64::Scan::local): Use
824 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
825 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
826 (Target_x86_64::Scan::global): Likewise.
827 (Target_x86_64::Relocate::relocate): Likewise.
828 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
829 Likewise.
830
831 2010-08-03 Cary Coutant <ccoutant@google.com>
832
833 * merge.cc (Output_merge_string::do_add_input_section): Count strings
834 to reserve space in merged_strings vector. Keep total input size
835 for stats.
836 (Output_merge_string::do_print_merge_stats): Print total input size.
837 * merge.h (Output_merge_string): Add input_size_ field.
838 * stringpool.cc (Stringpool_template::string_length): Move
839 implementations out of Stringpool_template class and place in
840 stringpool.h.
841 * stringpool.h (string_length): Move out of Stringpool_template.
842
843 2010-08-03 Ian Lance Taylor <iant@google.com>
844
845 PR 11712
846 * layout.cc (relaxation_loop_body): If address of load segment is
847 set, adjust address to include headers if possible.
848
849 2010-08-03 Ian Lance Taylor <iant@google.com>
850
851 * version.cc (version_string): Bump to 1.10.
852
853 2010-08-03 Ian Lance Taylor <iant@google.com>
854
855 PR 11805
856 * layout.h (enum Output_section_order): Define.
857 (class Layout): Update declarations.
858 * layout.cc (Layout::get_output_section): Add order parameter.
859 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
860 is_first_non_relro parameters. Change all callers.
861 (Layout::choose_output_section): Likewise.
862 (Layout::add_output_section_data): Likewise.
863 (Layout::make_output_section): Likewise. Set order.
864 (Layout::default_section_order): New function.
865 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
866 * output.cc (Output_section::Output_section): Initialize order_.
867 Don't initialize deleted fields.
868 (Output_segment::Output_segment): Don't initialize deleted
869 fields.
870 (Output_segment::add_output_section_to_load): New function
871 replacing add_output_section. Change all callers to call this or
872 add_output_section_to_nonload.
873 (Output_segment::add_output_section_to_nonload): New function.
874 (Output_segment::remove_output_section): Rewrite.
875 (Output_segment::add_initial_output_data): Likewise.
876 (Output_segment::has_any_data_sections): Likewise.
877 (Output_segment::is_first_section_relro): Likewise.
878 (Output_segment::maximum_alignment): Likewise.
879 (Output_segment::has_dynamic_reloc): New function replacing
880 dynamic_reloc_count. Change all callers.
881 (Output_segment::has_dynamic_reloc_list): New function replacing
882 dynamic_reloc_count_list. Change all callers.
883 (Output_segment::set_section_addresses): Rewrite.
884 (Output_segment::set_offset): Rewrite.
885 (Output_segment::find_first_and_last_list): Remove.
886 (Output_segment::set_tls_offsets): Rewrite.
887 (Output_segment::first_section_load_address): Likewise.
888 (Output_segment::output_section_count): Likewise.
889 (Output_segment::section_with_lowest_load_address): Likewise.
890 (Output_segment::write_section_headers): Likewise.
891 (Output_segment::print_sections_to_map): Likewise.
892 * output.h (class Output_data): Remove dynamic_reloc_count_
893 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
894 (Output_data::add_dynamic_reloc): Rewrite.
895 (Output_data::has_dynamic_reloc): New function.
896 (Output_data::dynamic_reloc_count): Remove.
897 (class Output_section): Add order_ field. Remvoe is_relro_local_,
898 is_last_relro_, is_first_non_relro_, is_interp_,
899 is_dynamic_linker_section_ fields. Add order and set_order
900 functions. Remove is_relro_local, set_is_relro_local,
901 is_last_relro, set_is_last_relro, is_first_non_relro,
902 set_is_first_non_relro functions, is_interp, set_is_interp,
903 is_dynamic_linker_section, and set_is_dynamic_linker_section
904 functions.
905 (class Output_segment): Change Output_data_list from std::list to
906 std:;vector. Add output_lists_ field. Remove output_data_ and
907 output_bss_ fields. Update declarations.
908
909 2010-08-02 Ian Lance Taylor <iant@google.com>
910
911 * arm.cc (Target_arm::gc_process_relocs): Use typename.
912 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
913 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
914
915 2010-08-02 Ian Lance Taylor <iant@google.com>
916
917 PR 11855
918 * script.cc (Script_options::Script_options): Initialize
919 symbol_definitions_ and symbol_references_.
920 (Script_options::add_symbol_assignment): Update
921 symbol_definitions_ and symbol_references_.
922 (Script_options::add_symbol_reference): New function.
923 (script_symbol): New function.
924 * script.h (class Script_options): Add symbol_definitions_ and
925 symbol_references_ fields.
926 (Script_options::referenced_const_iterator): New type.
927 (Script_options::referenced_begin): New function.
928 (Script_options::referenced_end): New function.
929 (Script_options::is_referenced): New function.
930 (Script_options::any_unreferenced): New function.
931 * script-c.h (script_symbol): Declare.
932 * yyscript.y (exp): Call script_symbol.
933 * symtab.cc: Include "script.h".
934 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
935 Change all callers. Check symbols referenced by scripts.
936 (Symbol_table::add_undefined_symbols_from_command_line): Add
937 layout parameter. Change all callers.
938 (Symbol_table::do_add_undefined_symbols_from_command_line):
939 Likewise. Break out loop body. Check symbols referenced by
940 scripts.
941 (Symbol_table::add_undefined_symbol_from_command_line): New
942 function broken out of
943 do_add_undefined_symbols_from_command_line.
944 * symtab.h (class Symbol_table): Update declarations.
945 * archive.cc: Include "layout.h".
946 (Archive::should_include_member): Add layout parameter. Change
947 all callers. Check for symbol mentioned in expression.
948 * archive.h (class Archive): Update declaration.
949 * object.cc (Sized_relobj::do_should_include_member): Add layout
950 parameter.
951 * object.h (Object::should_include_member): Add layout parameter.
952 Change all callers.
953 (Object::do_should_include_member): Add layout parameter.
954 (class Sized_relobj): Update declaration.
955 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
956 parameter.
957 * dynobj.h (class Sized_dynobj): Update declaration.
958 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
959 layout parameter.
960 * plugin.h (class Sized_pluginobj): Update declaration.
961
962 2010-08-02 Ian Lance Taylor <iant@google.com>
963
964 PR 11866
965 * output.cc (Output_segment::set_offset): Search for the first and
966 last sections rather than assuming that the list is in order.
967 (Output_segment::find_first_and_last_list): New function.
968 * output.h (class Output_segment): Update declarations.
969 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
970 (relro_strip_test_SOURCES): New variable.
971 (relro_strip_test_DEPENDENCIES): New variable.
972 (relro_strip_test_LDFLAGS): New variable.
973 (relro_strip_test_LDADD): New variable.
974 (relro_strip_test.so): New target.
975
976 2010-08-02 Ian Lance Taylor <iant@google.com>
977
978 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
979 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
980 (Target_i386::got_tlsdesc_section): New function.
981 (Target_i386::got_section): Create space for GOT entries for
982 TLSDESC relocations.
983 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
984 R_386_TLS_GOTDESC.
985 (Target_i386::Scan::global): Likewise.
986 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
987 using TLSDESC GOT.
988 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
989 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
990 (Target_x86_64::got_tlsdesc_section): New function.
991 (Target_x86_64::got_section): Create space for GOT entries for
992 TLSDESC relocations.
993 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
994 R_386_TLS_GOTDESC.
995 (Target_x86_64::Scan::global): Likewise.
996 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
997 using TLSDESC GOT.
998
999 2010-08-02 Ian Lance Taylor <iant@google.com>
1000
1001 * testsuite/final_layout.sh: Use dc to convert from hex to
1002 decimal.
1003
1004 2010-07-29 Sriraman Tallam <tmsriram@google.com>
1005
1006 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
1007 paramter to the call to gold::gc_process_relocs.
1008 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
1009 paramter to the call to gold::gc_process_relocs.
1010 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
1011 parameter to the call to gold::gc_process_relocs.
1012 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
1013 template parameter to the call to gold::gc_process_relocs.
1014 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
1015 paramter to the call to gold::gc_process_relocs.
1016 * gc.h (get_embedded_addend_size): New function.
1017 (gc_process_relocs): Save the size of the reloc for use by ICF.
1018 * icf.cc (get_section_contents): Get the addend from the text section
1019 for SHT_REL relocation sections.
1020 * icf.h (Icf::Reloc_addend_size_info): New typedef.
1021 (Icf::Reloc_info): Add new member reloc_addend_size_info.
1022 * int_encoding.h (read_from_pointer): New overloaded function.
1023 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
1024 * testsuite/icf_sht_rel_addend_test.sh: New file.
1025 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
1026 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
1027
1028 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1029
1030 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
1031 * Makefile.in: Regenerate.
1032 * testsuite/Makefile.in: Regenerate.
1033
1034 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
1035
1036 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
1037 * gold/testsuite/debug_msg.cc: Likewise.
1038 * gold/testsuite/odr_violation1.cc
1039 * gold/testsuite/odr_violation2.cc
1040
1041 2010-07-21 Cary Coutant <ccoutant@google.com>
1042
1043 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
1044 string, and length fields.
1045 (Output_merge_string::Merged_strings_list): New type.
1046 (Output_merge_string::Merged_strings_lists): New typedef.
1047 (Output_merge_string): Replace merged_strings_ with
1048 merged_strings_lists_.
1049 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
1050 Merged_strings_list per input object and section. Don't store pointer
1051 to the string. Don't store length with each merged string entry.
1052 (Output_merge_string::finalize_merged_data): Loop over list of merged
1053 strings lists. Recompute length of each merged string.
1054
1055 2010-07-15 Cary Coutant <ccoutant@google.com>
1056
1057 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
1058 here.
1059
1060 2010-07-14 Ian Lance Taylor <iant@google.com>
1061
1062 * descriptors.cc (Descriptors::open): Report correct name in error
1063 message.
1064
1065 2010-07-13 Doug Kwan <dougkwan@google.com>
1066
1067 * arm.cc (Arm_input_section::Arm_input_section): For a
1068 SHT_ARM_EXIDX section, always keeps the input sections.
1069 (Arm_input_section::set_exidx_section_link): New method.
1070 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
1071 has_errors_ to false.
1072 (Arm_exidx_input_section::has_errors,
1073 Arm_exidx_input_section::set_has_errors): New methods.
1074 (Arm_exidx_input_section::has_errors_): New data member.
1075 (Arm_relobj::get_exidx_shndx_list): New method.
1076 (Arm_output_section::append_text_sections_to_list): Do not skip
1077 section without SHF_EXECINSTR.
1078 (Arm_output_section::fix_exidx_coverage): Skip input sections with
1079 errors.
1080 (Arm_relobj::make_exidx_input_section): Add new parameter for text
1081 section header. Make error messages more verbose. Check for
1082 a non-executable section linked to an EXIDX section.
1083 (Arm_relobj::do_read_symbols): Remove error checking, which has been
1084 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
1085 check that there is no deferred EXIDX section if we exit early.
1086 Instead of not making an EXIDX section in case of an error, make one
1087 and set the has_errors flag of it.
1088 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
1089 in a relocatable link.
1090 (Target_arm::do_relax): Look for the EXIDX output section instead of
1091 assuming that it is called .ARM.exidx.
1092 (Target_arm::fix_exidx_coverage): Add a new parameter for input
1093 section list. Do not check for SHF_EXECINSTR section flags but
1094 skip any input section with errors.
1095 * output.cc (Output_section::Output_section): Initialize
1096 always_keeps_input_sections_ to false.
1097 (Output_section::add_input_section): Check for
1098 always_keeps_input_sections_.
1099 * output.h (Output_section::always_keeps_input_sections,
1100 Output_section::set_always_keeps_input_sections): New methods.
1101 (Output_section::always_keeps_input_sections): New data member.
1102
1103 2010-07-13 Rafael Espindola <espindola@google.com>
1104
1105 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
1106 * fileread.h (Input_file): Add try_extra_search_path and find_file.
1107
1108 2010-07-13 Philip Herron <herron.philip@googlemail.com>
1109 Ian Lance Taylor <iant@google.com>
1110
1111 * output.h (Output_section_lookup_maps::add_merge_section):
1112 Correct check of whether value was inserted.
1113 (Output_section_lookup_maps::add_merge_input_section): Likewise.
1114 (Output_section_lookup_maps::add_relaxed_input_section):
1115 Likewise.
1116 * arm.cc (Target_arm::got_section): Remove used local os.
1117 * i386.cc (Target_i386::got_section): Likewise.
1118 * x86_64.cc (Target_x86_64::got_section): Likewise.
1119 * sparc.cc (Target_sparc::got_section): Likewise.
1120 (Target_sparc::relocate): Remove unused local have_got_offset.
1121 * powerpc.cc (Target_powerpc::relocate): Likewise.
1122
1123 2010-07-13 Ian Lance Taylor <iant@google.com>
1124
1125 * compressed_output.cc (zlib_decompress): Fix signature in
1126 !HAVE_ZLIB_H case.
1127
1128 * archive.cc (Archive::include_member): Unlock an external member
1129 of a thin archive. Don't bother to delete an object we know is
1130 NULL.
1131
1132 2010-07-12 Cary Coutant <ccoutant@google.com>
1133
1134 * compressed_output.cc (zlib_decompress): New function.
1135 (get_uncompressed_size): New function.
1136 (decompress_input_section): New function.
1137 * compressed_output.h (get_uncompressed_size): New function.
1138 (decompress_input_section): New function.
1139 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
1140 Handle compressed debug sections.
1141 * layout.cc (is_compressed_debug_section): New function.
1142 (Layout::output_section_name): Map compressed section names to
1143 canonical names.
1144 * layout.h (is_compressed_debug_section): New function.
1145 (is_debug_info_section): Recognize compressed debug sections.
1146 * merge.cc: Include compressed_output.h.
1147 (Output_merge_data::do_add_input_section): Handle compressed
1148 debug sections.
1149 (Output_merge_string::do_add_input_section): Handle compressed
1150 debug sections.
1151 * object.cc: Include compressed_output.h.
1152 (Sized_relobj::Sized_relobj): Initialize new data members.
1153 (build_compressed_section_map): New function.
1154 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
1155 * object.h (Object::section_is_compressed): New method.
1156 (Object::do_section_is_compressed): New method.
1157 (Sized_relobj::Compressed_section_map): New type.
1158 (Sized_relobj::do_section_is_compressed): New method.
1159 (Sized_relobj::compressed_sections_): New data member.
1160 * output.cc (Output_section::add_input_section): Handle compressed
1161 debug sections.
1162 * reloc.cc: Include compressed_output.h.
1163 (Sized_relobj::write_sections): Handle compressed debug sections.
1164
1165 2010-07-08 Cary Coutant <ccoutant@google.com>
1166
1167 * resolve.cc (Symbol_table::resolve): Remember whether undef was
1168 weak when resolving to a dynamic def.
1169 (Symbol_table::should_override): Add adjust_dyndef flag; set it
1170 for weak undef/dynamic def cases. Adjust callers.
1171 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
1172 undef_binding_weak_.
1173 (Symbol_table::sized_write_globals): Adjust symbol binding.
1174 (Symbol_table::sized_write_symbol): Add binding parameter.
1175 * symtab.h (Symbol::set_undef_binding): New method.
1176 (Symbol::is_undef_binding_weak): New method.
1177 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
1178 (Symbol_table::should_override): Add new parameter.
1179 (Symbol_table::sized_write_symbol): Add new parameter.
1180
1181 * testsuite/weak_undef_file1.cc: Add new test case.
1182 * testsuite/weak_undef_file2.cc: Fix header comment.
1183 * testsuite/weak_undef_test.cc: Add new test case.
1184
1185 2010-06-29 Doug Kwan <dougkwan@google.com>
1186
1187 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
1188 Initialize USE_SYMBOL_.
1189 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
1190 definition.
1191 (Arm_reloc_property::uses_symbol_): New data member declaration.
1192 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
1193 uses symbol value and symbol is undefined but not weakly undefined.
1194
1195 2010-06-28 Rafael Espindola <espindola@google.com>
1196
1197 * plugin.cc (Plugin::load): Use dlerror.
1198
1199 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
1200
1201 * symtab.cc (detect_odr_violations): When reporting an ODR
1202 violation, report an object where the symbol is defined.
1203
1204 2010-06-25 Doug Kwan <dougkwan@google.com>
1205
1206 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
1207 (Target_arm::section_may_have_icf_unsafe_pointers): New method
1208 definition.
1209 (Target_arm::Scan::local_reloc_may_be_function_pointer,
1210 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
1211 target hook to detect function points.
1212 (Target_arm::Scan::possible_function_pointer_reloc): New method.
1213 * icf.h (Icf::check_section_for_function_pointers): Change type of
1214 parameter SECTION_NAME to const reference to std::string. Use
1215 target hook to determine if section may have unsafe pointers.
1216 * target.h (Target::section_may_have_icf_unsafe_pointers): New
1217 method definition.
1218
1219 2010-06-21 Rafael Espindola <espindola@google.com>
1220
1221 * fileread.cc (Input_file::find_fie): New
1222 (Input_file::open): Use Input_file::find_fie.
1223 * fileread.h (Input_file::find_fie): New
1224 * plugin.cc (set_extra_library_path): New.
1225 (Plugin::load): Add set_extra_library_path to the transfer vector.
1226 (Plugin_manager::set_extra_library_path): New.
1227 (Plugin_manager::add_input_file): Use the extra search path if set.
1228 (set_extra_library_path(): New.
1229 * plugin.h (Plugin_manager): Add set_extra_library_path and
1230 extra_search_path_.
1231
1232 2010-06-19 Cary Coutant <ccoutant@google.com>
1233
1234 * layout.cc (gdb_sections): Add .debug_types.
1235 (lines_only_debug_sections): Likewise.
1236
1237 2010-06-18 Rafael Espindola <espindola@google.com>
1238
1239 * plugin.cc (add_input_file,add_input_library)
1240 (Plugin_manager::add_input_file): Make filename arguments const.
1241 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
1242 const.
1243
1244 2010-06-16 Doug Kwan <dougkwan@google.com>
1245
1246 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
1247 .ARM.attributes section if we have not merged any input
1248 attributes sections.
1249
1250 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1251
1252 * arm.cc: Allow combining objects with no EABI version
1253 information.
1254
1255 2010-06-15 Rafael Espindola <espindola@google.com>
1256
1257 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
1258
1259 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1260
1261 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
1262 (struct iovec): Correct !HAVE_READV definition.
1263
1264 2010-06-10 Cary Coutant <ccoutant@google.com>
1265
1266 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
1267 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
1268 reloc sections.
1269 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
1270
1271 PR 11683
1272 * symtab.h (Symbol::is_placeholder): New member function.
1273 * target-reloc.h (relocate_section): Check for placeholder symbols.
1274
1275 * testsuite/Makefile.am (plugin_test_8): New test.
1276 (plugin_test_9): New test.
1277 * testsuite/Makefile.in: Regenerate.
1278
1279 2010-06-09 Nick Clifton <nickc@redhat.com>
1280
1281 * yyscript.y (input_list_element): Allow strings prefixed with
1282 the '-' character. Treat these as libraries.
1283 * script.cc (script_add_library): New function. Adds a library
1284 specified by "-l<name>" found in an input script.
1285 * script-c.h: Add prototype for script_add_library.
1286
1287 2010-06-07 Doug Kwan <dougkwan@google.com>
1288
1289 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
1290 Restrict stub-group size to be within long conditional branch
1291 range when working around cortex-A8 erratum.
1292
1293 2010-06-07 Damien Diederen <dd@crosstwine.com>
1294
1295 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
1296 #ifdef typo.
1297
1298 2010-06-03 Sriraman Tallam <tmsriram@google.com>
1299
1300 PR gold/11658
1301 * output.cc
1302 (Output_section::Input_section_sort_entry::compare_section_ordering):
1303 Change to return non-zero correctly.
1304 (Output_section::Input_section_sort_section_order_index_compare
1305 ::operator()): Change to fix ambiguity in comparisons.
1306
1307 2010-06-01 Sriraman Tallam <tmsriram@google.com>
1308
1309 * gold.h (is_wildcard_string): New function.
1310 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
1311 (Layout::layout_eh_frame): Ditto.
1312 (Layout::find_section_order_index): New method.
1313 (Layout::read_layout_from_file): New method.
1314 * layout.h (Layout::find_section_order_index): New method.
1315 (Layout::read_layout_from_file): New method.
1316 (Layout::input_section_position_): New private member.
1317 (Layout::input_section_glob_): New private member.
1318 * main.cc (main): Call read_layout_from_file here.
1319 * options.h (--section-ordering-file): New option.
1320 * output.cc (Output_section::input_section_order_specified_): New
1321 member.
1322 (Output_section::Output_section): Initialize new member.
1323 (Output_section::add_input_section): Add new parameter.
1324 Keep input sections when --section-ordering-file is used.
1325 (Output_section::set_final_data_size): Sort input sections when
1326 section ordering file is specified.
1327 (Output_section::Input_section_sort_entry): Add new parameter.
1328 Check sorting type.
1329 (Output_section::Input_section_sort_entry::compare_section_ordering):
1330 New method.
1331 (Output_section::Input_section_sort_compare::operator()): Change to
1332 consider section_order_index.
1333 (Output_section::Input_section_sort_init_fini_compare::operator()):
1334 Change to consider section_order_index.
1335 (Output_section::Input_section_sort_section_order_index_compare
1336 ::operator()): New method.
1337 (Output_section::sort_attached_input_sections): Change to sort
1338 according to section order when specified.
1339 (Output_section::add_input_section<32, true>): Add new parameter.
1340 (Output_section::add_input_section<64, true>): Add new parameter.
1341 (Output_section::add_input_section<32, false>): Add new parameter.
1342 (Output_section::add_input_section<64, false>): Add new parameter.
1343 * output.h (Output_section::add_input_section): Add new parameter.
1344 (Output_section::input_section_order_specified): New
1345 method.
1346 (Output_section::set_input_section_order_specified): New method.
1347 (Input_section::Input_section): Initialize section_order_index_.
1348 (Input_section::section_order_index): New method.
1349 (Input_section::set_section_order_index): New method.
1350 (Input_section::section_order_index_): New member.
1351 (Input_section::Input_section_sort_section_order_index_compare): New
1352 struct.
1353 (Output_section::input_section_order_specified_): New member.
1354 * script-sections.cc (is_wildcard_string): Delete and move modified
1355 method to gold.h.
1356 (Output_section_element_input::Output_section_element_input): Modify
1357 call to is_wildcard_string.
1358 (Output_section_element_input::Input_section_pattern
1359 ::Input_section_pattern): Ditto.
1360 (Output_section_element_input::Output_section_element_input): Ditto.
1361 * testsuite/Makefile.am (final_layout): New test case.
1362 * testsuite/Makefile.in: Regenerate.
1363 * testsuite/final_layout.cc: New file.
1364 * testsuite/final_layout.sh: New file.
1365
1366 2010-06-01 Rafael Espindola <espindola@google.com>
1367
1368 * plugin.cc (Plugin::load): Pass the output name to the plugin.
1369
1370 2010-06-01 Rafael Espindola <espindola@google.com>
1371
1372 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
1373 visibility of symbols.
1374
1375 2010-05-27 Doug Kwan <dougkwan@google.com>
1376
1377 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
1378 from start of output section instead of address for a local symbol
1379 in a merged or relaxed section when doing a relocatable link.
1380
1381 2010-05-26 Rafael Espindola <espindola@google.com>
1382
1383 PR 11604
1384 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
1385 adding sections the garbage collector removed.
1386 * gold/testsuite/Makefile.am: Add test.
1387 * gold/testsuite/Makefile.in: Regenerate.
1388 * gold/testsuite/plugin_test_7.sh: New.
1389 * gold/testsuite/plugin_test_7_1.c: New.
1390 * gold/testsuite/plugin_test_7_2.c: New.
1391
1392 2010-05-26 Rafael Espindola <espindola@google.com>
1393
1394 * script-sections.cc (Output_section_definition::set_section_addresses):
1395 Check for --section-start.
1396
1397 2010-05-26 Doug Kwan <dougkwan@google.com>
1398
1399 * arm.cc (Arm_scan_relocatable_relocs): New class.
1400 (Target_arm::relocate_special_relocatable): New method.
1401 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
1402 (Arm_relocate_functions::thumb_branch_common): Same.
1403 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
1404 instead of Default_scan_relocatable_relocs.
1405 * target-reloc.h (relocate_for_relocatable): Let target handle
1406 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
1407 * target.h (Sized_target::relocate_special_relocatable): New method.
1408
1409 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1410
1411 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
1412
1413 2010-05-23 Doug Kwan <dougkwan@google.com>
1414
1415 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
1416 instead of a cast.
1417 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
1418 with a direct branch, not a conditional branch, to a stub.
1419 * merge.cc (Output_merge_base::record_input_section): New method
1420 defintion.
1421 (Output_merge_data::do_add_input_section): Record input section if
1422 keeps-input-sections flag is set.
1423 (Output_merge_string::do_add_input_section): Ditto.
1424 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
1425 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
1426 INPUT_SECTIONS_.
1427 (Output_merge_base::keeps_input_sections,
1428 Output_merge_base::set_keeps_input_sections,
1429 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
1430 method definitions.
1431 (Output_merge_base::Input_sections): New type declaration.
1432 (Output_merge_base::input_sections_begin,
1433 Output_merge_base::input_sections_end,
1434 Output_merge_base::do_set_keeps_input_sections): New method definitions.
1435 (Output_merge_base::bool keeps_input_sections_,
1436 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
1437 Output_merge_base::input_sections_): New data members.
1438 (Output_merge_data::do_set_keeps_input_sections): New method
1439 defintion.
1440 (Output_merge_string::do_set_keeps_input_sections): Ditto.
1441 * output.cc (Output_section::Input_section::relobj): Move method
1442 defintion from class declaration to here and handle merge sections.
1443 (Output_section::Input_section::shndx): Ditto.
1444 (Output_section::Output_section): Remove initializations of removed
1445 data members and initialize new data member LOOKUP_MAPS_.
1446 (Output_section::add_input_section): Set keeps-input-sections flag
1447 for a newly created merge output section as appropriate. Adjust code
1448 to use Output_section_lookup_maps class.
1449 (Output_section::add_relaxed_input_section): Adjst code for lookup
1450 maps code refactoring.
1451 (Output_section::add_merge_input_section): Add a new parameter
1452 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
1453 class. If adding input section to a newly created merge output
1454 section fails, remove the new merge section.
1455 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
1456 Adjust code for use of the Output_section_lookup_maps class.
1457 (Output_section::find_merge_section): Ditto.
1458 (Output_section::build_lookup_maps): New method defintion.
1459 (Output_section::find_relaxed_input_section): Adjust code to use
1460 Output_section_lookup_maps class.
1461 (Output_section::get_input_sections): Export merge sections. Adjust
1462 code to use Output_section_lookup_maps class.
1463 (Output_section:::add_script_input_section): Adjust code to use
1464 Output_section_lookup_maps class. Update lookup maps for merge
1465 sections also.
1466 (Output_section::discard_states): Use Output_section_lookup_maps.
1467 (Output_section::restore_states): Same.
1468 * output.h (Merge_section_properties): Move class defintion out of
1469 Output_section.
1470 (Output_section_lookup_maps): New class.
1471 (Output_section::Input_section::is_merge_section): New method
1472 defintion.
1473 (Output_section::Input_section::relobj): Move defintion out of class
1474 defintion. Declare method only.
1475 (Output_section::Input_section::shndx): Ditto.
1476 (Output_section::Input_section::output_merge_base): New method defintion.
1477 (Output_section::Input_section::u2_.pomb): New union field.
1478 (Output_section::Merge_section_by_properties_map,
1479 Output_section::Output_section_data_by_input_section_map,
1480 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
1481 Remove types.
1482 (Output_section::add_merge_input_section): Add new parameter
1483 KEEPS_INPUT_SECTIONS.
1484 (Output_section::build_lookup_maps): New method declaration.
1485 (Output_section::merge_section_map_,
1486 Output_section::merge_section_by_properties_map_,
1487 Output_section::relaxed_input_section_map_,
1488 Output_section::is_relaxed_input_section_map_valid_): Remove data
1489 members.
1490 (Output_section::lookup_maps_): New data member.
1491
1492 2010-05-21 Doug Kwan <dougkwan@google.com>
1493
1494 PR gold/11619
1495 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
1496 avoid a compilation error.
1497
1498 2010-05-19 Rafael Espindola <espindola@google.com>
1499
1500 * script-sections.cc (Output_section_definition::allocate_to_segment):
1501 Update the phdrs_list even when the output section is NULL.
1502 * testsuite/Makefile.am: Add test.
1503 * testsuite/Makefile.in: Regenerate.
1504 * testsuite/script_test_9.cc: New.
1505 * testsuite/script_test_9.sh: New.
1506 * testsuite/script_test_9.t: New.
1507
1508 2010-05-19 Doug Kwan <dougkwan@google.com>
1509
1510 * arm.cc (Arm_input_section::original_size): New method.
1511 (Arm_input_section::do_addralign): Add a cast.
1512 (Arm_input_section::do_output_offset): Remove static cast.
1513 (Arm_input_section::original_addralign,
1514 Arm_input_section::original_size_): Change type to uint32_t.
1515 (Arm_input_section::init): Add safe casts for section alignment
1516 and size.
1517 (Arm_input_section::set_final_data_size): Do not set address and
1518 offset of stub table.
1519 (Arm_output_section::fix_exidx_coverage): Change use of of
1520 Output_section::Simple_input_section to that of
1521 Output_section::Input_section.
1522 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
1523 except for the first pass.
1524 * output.cc (Output_section::get_input_sections): Change type of
1525 input_sections to std::list<Input_section>.
1526 (Output_section::add_script_input_section): Rename from
1527 Output_section::add_simple_input_section. Change type of SIS
1528 parameter from Simple_input_section to Input_section.
1529 * output.h (Output_section::Simple_input_section): Remove class.
1530 (Output_section::Input_section): Change class visibility to public.
1531 (Output_section::Input_section::addralign): Use stored alignments
1532 for special input sections if set.
1533 (Output_section::Input_section::set_addralign): New method.
1534 (Output_section::get_input_sections): Change parameter type from
1535 list of Simple_input_section to list of Input_section.
1536 (Output_section::add_script_input_section): Rename from
1537 Output_section::add_simple_input_section. Change first parameter's
1538 type from Simple_input_section to Input_section and remove the
1539 second and third parameters.
1540 * script-sections.cc (Input_section::Input_section_list): Change
1541 type to list of Output_section::Input_section/
1542 (Input_section_info::Input_section_info): Change parameter type of
1543 INPUT_SECTION to Output_section::Input_section.
1544 (Input_section_info::input_section): Change return type.
1545 (Input_section_info::input_section_): Change type to
1546 Output_section::Input_section.
1547 (Output_section_element_input::set_section_addresses): Adjust code
1548 to use Output_section::Input_section instead of
1549 Output_section::Simple_input_section. Adjust code for renaming
1550 of Output_section::add_simple_input_section.
1551 (Orphan_output_section::set_section_addresses): Ditto.
1552
1553 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1554
1555 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
1556 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
1557
1558 2010-05-18 Rafael Espindola <espindola@google.com>
1559
1560 * options.cc (General_options::finalize): Handle -nostdlib.
1561 * options.h (nostdlib): New option.
1562 * script.cc (script_add_search_dir): Handle -nostdlib.
1563
1564 2010-05-12 Doug Kwan <dougkwan@google.com>
1565
1566 * arm.cc (Target_arm::do_finalize_sections): Create an empty
1567 attributes section only if there no attributes section after merging.
1568 (Target_arm::merge_object_attributes): Move value of
1569 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
1570 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
1571 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
1572 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
1573 and arm_attr_merge_7.stdout.
1574 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
1575 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
1576 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
1577 arm_attr_merge_7b.o): New rules.
1578 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
1579 arm_attr_merge_7
1580 * testsuite/Makefile.in: Regenerate.
1581 * testsuite/arm_attr_merge.sh: New file.
1582 * testsuite/arm_attr_merge_[67][ab].s: Same.
1583
1584 2010-05-05 Nick Clifton <nickc@redhat.com>
1585
1586 * po/es.po: Updated Spanish translation.
1587
1588 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1589
1590 * Makefile.am (install-exec-local): Properly install gold as
1591 default cross linker.
1592 * Makefile.in: Regenerated.
1593
1594 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1595 Nick Clifton <nickc@redhat.com>
1596
1597 * configure.ac (install_as_default): Define and set to false
1598 unless --enable-gold or --enable-gold=both/gold has been
1599 specified.
1600 * configure: Regenerate.
1601
1602 * Makefile.am (install-exec-local): Install the executable as
1603 'ld.gold'. If install_as_default is true then also install it as
1604 'ld'.
1605 * Makefile.in: Regenerated.
1606
1607 2010-04-24 Ian Lance Taylor <iant@google.com>
1608
1609 * layout.cc (Layout::layout_reloc): In relocatable link don't
1610 combine reloc sections for grouped sections.
1611
1612 2010-04-23 Sriraman Tallam <tmsriram@google.com>
1613
1614 * gc.h (gc_process_relocs): Pass information on relocs pointing to
1615 sections that are not ordinary to icf.
1616 * icf.cc (get_section_contents): Handle relocation pointing to section
1617 with no object or shndx information.
1618 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
1619 * testsuite/Makefile.in: Regenerate.
1620 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
1621 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
1622
1623 2010-04-22 Ian Lance Taylor <iant@google.com>
1624
1625 * expression.cc (Expression::Expression_eval_info): Add
1626 result_alignment_pointer field.
1627 (Expression::eval_with_dot): Add result_alignment_pointer
1628 parameter. Change all callers.
1629 (Expression::eval_maybe_dot): Likewise.
1630 (class Binary_expression): Add alignment_pointer parameter to
1631 left_value and right_value. Change all callers.
1632 (BINARY_EXPRESSION): Set result alignment.
1633 (class Trinary_expression): Add alignment_pointer parameter to
1634 arg2_value and arg3_value. Change all callers.
1635 (Trinary_cond::value): Set result alignment.
1636 (Max_expression::value, Min_expression::value): Likewise.
1637 (Align_expression::value): Likewise.
1638 * script-sections.cc (class Sections_element): Add dot_alignment
1639 parameter to set_section_addresses virtual function. Update
1640 instantiations.
1641 (class Output_section_element): Likewise.
1642 (Script_sections::create_segments): Add dot_alignment parameter.
1643 Change all callers.
1644 (Script_sections::create_segments_from_phdrs_clause): Likewise.
1645 (Script_sections::set_phdrs_clause_addresses): Likewise.
1646 * script-sections.h: Update declarations.
1647 * script.h: Update declarations.
1648 * output.h (Output_segment::set_minimum_p_align): Don't decrease
1649 min_p_align.
1650 * testsuite/script_test_3.t: Set large alignment.
1651 * testsuite/script_test_3.sh: Make sure that at least one LOAD
1652 segment has expected alignment.
1653
1654 2010-04-22 Nick Clifton <nickc@redhat.com>
1655
1656 * po/gold.pot: Updated by the Translation project.
1657 * po/vi.po: Updated Vietnamese translation.
1658
1659 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
1660
1661 * testsuite/Makefile.am (check_PROGRAMS): Add
1662 icf_virtual_function_folding_test.
1663 * testsuite/Makefile.in: Regenerated.
1664
1665 2010-04-15 Andrew Haley <aph@redhat.com>
1666
1667 * options.h (merge_exidx_entries): New option.
1668 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
1669 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
1670 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
1671 (Target_arm::merge_exidx_entries): New function.
1672 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
1673 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
1674 to Arm_exidx_fixup constructor.
1675 Add new arg, merge_exidx_entries.
1676 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
1677 Arm_output_section::fix_exidx_coverage.
1678
1679 2010-04-18 Sriraman Tallam <tmsriram@google.com>
1680
1681 * icf.cc (get_section_contents): Check for preemptible functions.
1682 Ignore addend when appropriate.
1683 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
1684 section folded.
1685 (add_from_relobj): Check for section folded.
1686 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
1687 * symtab.h (should_add_dynsym_entry): Add new parameter.
1688 * target-reloc.h (scan_relocs): Check for section folded.
1689 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
1690 Check reloc types for function pointers in shared objects.
1691 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
1692 case.
1693 (icf_preemptible_functions_test): New test case.
1694 (icf_string_merge_test): New test case.
1695 * testsuite.Makefile.in: Regenerate.
1696 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
1697 bar_glob. Refactor code.
1698 * testsuite/icf_preemptible_functions_test.cc: New file.
1699 * testsuite/icf_preemptible_functions_test.sh: New file.
1700 * testsuite/icf_string_merge_test.cc: New file.
1701 * testsuite/icf_string_merge_test.sh: New file.
1702 * testsuite/icf_virtual_function_folding_test.cc: New file.
1703 * testsuite/icf_virtual_function_folding_test.sh: New file.
1704
1705 2010-04-14 Doug Kwan <dougkwan@google.com>
1706
1707 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
1708 for local symbol recounting if we remove a section due to ICF.
1709 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
1710 there are no regular objects in input.
1711
1712 2010-04-13 Doug Kwan <dougkwan@google.com>
1713
1714 * arm.cc (Arm_input_section::set_final_data_size): Compute
1715 accurate final data size instead of using current data size.
1716
1717 2010-04-09 Doug Kwan <dougkwan@google.com>
1718
1719 * layout.cc (Layout::choose_output_section): Handle script section
1720 types.
1721 (Layout::make_output_section_for_script): Add section type parameter.
1722 Handle script section types.
1723 * layout.h (Layout::make_output_section_for_script): Add section
1724 type parameter.
1725 * output.cc (Output_section::Output_section): Initialize data member
1726 is_noload_.
1727 (Output_section::do_reset_address_and_file_offset): Do not set address
1728 to 0 if section is a NOLOAD section.
1729 * output.h (Output_section::is_noload): New method.
1730 (Output_section::set_is_noload): Ditto.
1731 (Output_section::is_noload_): New data member.
1732 * script-c.h (Script_section_type): New enum type.
1733 (struct Parser_output_section_header): Add new file section_type.
1734 * script-sections.cc (Sections_element::output_section_name): Add
1735 parameter for returning script section type.
1736 (Output_section_definition::output_section_name): Ditto.
1737 (Output_section_definition::section_type)P; New method.
1738 (Output_section_definiton::script_section_type_name): Ditto.
1739 (Output_section_definition::script_section_type_): New data member.
1740 (Output_section_definition::Output_section_definition): Initialize
1741 data member Output_section_definition::script_section_type_.
1742 (Output_section_definition::create_sections): Pass script section type
1743 to Layout::make_output_section_for_script.
1744 (Output_section_definition::output_section_name): Return script
1745 section type to caller.
1746 (Output_section_definition::set_section_address): Do not advance
1747 dot value and load address if section type is NOLOAD. Set address
1748 of NOLOAD sections regardless of section flags.
1749 (Output_section_definition::print): Print section type if it is
1750 not SCRIPT_SECTION_TYPE_NONE.
1751 (Output_section_definition::section_type): New method.
1752 (Output_section_definition::script_section_type_name): Ditto.
1753 (Script_sections::output_section_name): Add new parameter
1754 PSECTION_TYPE for returning script section type. Pass it to
1755 section elements. Handle discard sections.
1756 (Sort_output_sections::operator()): Handle NOLOAD sections.
1757 * script-sections.h (Script_sections::Section_type): New enum type.
1758 (Script_sections::output_section_name): Add a new parameter for
1759 returning script section type.
1760 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
1761 INFO and NOLOAD.
1762 * yyscript.y (union): Add new field SECTION_TYPE.
1763 (COPY, DSECT, INFO, NOLOAD): New tokens.
1764 (opt_address_and_section_type): Change type to output_section_header.
1765 (section_type): New non-terminal
1766 (section_header): Handle section type.
1767 (opt_address_and_section_type): Return section type value.
1768
1769 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
1770
1771 * testsuite/plugin_common_test_1.c (foo): Add prototype.
1772 * testsuite/plugin_common_test_2.c (foo): Likewise.
1773
1774 2010-04-08 Doug Kwan <dougkwan@google.com>
1775
1776 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
1777 Output_merge_data.
1778 * output.cc (Output_section::add_merge_input_section): Simplify
1779 code and return status of Output_merge_base::add_input_section.
1780 Update merge section map only if Output_merge_base::add_input_section
1781 returns true.
1782
1783 2010-04-07 Doug Kwan <dougkwan@google.com>
1784
1785 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
1786 if section is marked as containing instructions but has no mapping
1787 symbols.
1788 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
1789 correct section index.
1790 (Arm_relobj::find_linked_text_section): Ditto.
1791
1792 2010-04-07 Cary Coutant <ccoutant@google.com>
1793
1794 * archive.cc (include_member): Destroy Read_symbols_data object before
1795 releasing file.
1796 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
1797 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
1798 (Read_symbols_data::~Read_symbols_data) New destructor.
1799 (Section_relocs::Section_relocs) New constructor.
1800 (Section_relocs::~Section_relocs) New destructor.
1801 (Read_relocs_data::Read_relocs_data) New constructor.
1802 (Read_relocs_data::~Read_relocs_data) New destructor.
1803 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
1804 pointers to NULL after deleting.
1805
1806 2010-04-07 Doug Kwan <dougkwan@google.com>
1807
1808 * arm.cc: Replace "endianity" with "endianness" in comments.
1809 (Arm_exidx_cantunwind): Ditto.
1810 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
1811 (Arm_relobj::merge_flags_and_attributes): New method.
1812 (Arm_relobj::merge_flags_and_attributes_): New data member.
1813 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
1814 (Arm_relobj::scan_sections_for_stubs): Ditto.
1815 (Arm_relobj::do_read_symbols): Check to see if we really want to
1816 merge processor-specific flags and attributes. Exit early if
1817 an object is empty except for section names and the undefined symbol.
1818 (Target_arm::do_finalize_sections): Move check for ELF format to
1819 Arm_relobj::do_read_symbols. Merge processor specific flags and
1820 attributes from a regular object only when we have determined that
1821 it is aapropriate. Do not create an .ARM.attributes section in
1822 output if there is no regular input object.
1823 (Target_arm::merge_processor_specific_flags): Check
1824 --warn-mismatch before printing any error.
1825 (Target_arm::merge_object_attributes): Ditto.
1826 * gold.cc (queue_middle_tasks): Handle the case in which there is
1827 no regular object in input.
1828 * options.cc (General_options::parse_EB): New method.
1829 (General_options::parse_EL): Same.
1830 (General_options::General_options): Initialize endianness_.
1831 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
1832 New options.
1833 (General_options::Endianness): New enum.
1834 (General_options::endianness): New method.
1835 (General_options::endianness_): New data member.
1836 * parameters.cc (Parameters::set_options): Check target endianness.
1837 (Parameters::set_target_once): Ditto.
1838 (Parameters::check_target_endianness): New method.
1839 (parameters_force_valid_target): If either -EL or -EB is specified,
1840 use it to define endianness of default target.
1841 * parameters.h (Parameters::check_target_endianness): New method
1842 declaration.
1843 * target.h (class Target): Change "endianity" to "endianness"
1844 in comments.
1845
1846 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1847
1848 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
1849 * configure: Regenerate.
1850 * Makefile.in: Regenerate.
1851 * testsuite/Makefile.in: Regenerate.
1852
1853 2010-04-06 Cary Coutant <ccoutant@google.com>
1854
1855 gcc PR lto/42757
1856 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
1857 prevailing definitions of common symbols.
1858 * testsuite/plugin_test_6.sh: New test case.
1859 * testsuite/plugin_common_test_1.c: New test case.
1860 * testsuite/plugin_common_test_2.c: New test case.
1861 * testsuite/Makefile.am (plugin_test_6): New test case.
1862 * testsuite/Makefile.in: Regenerate.
1863
1864 2010-04-06 Nick Clifton <nickc@redhat.com>
1865
1866 * po/vi.po: New Vietnamese translation.
1867
1868 2010-03-30 Doug Kwan <dougkwan@google.com>
1869
1870 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
1871
1872 2010-03-25 Doug Kwan <dougkwan@google.com>
1873
1874 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
1875 to avoid a conversion warning on a 32-bit host.
1876
1877 2010-03-24 Ian Lance Taylor <iant@google.com>
1878
1879 * testsuite/script_test_3.t: Add a TLS segment.
1880 * testsuite/Makefile.am (check_PROGRAMS): Add
1881 tls_phdrs_script_test.
1882 (tls_phdrs_script_test_SOURCES): Define.
1883 (tls_phdrs_script_test_DEPENDENCIES): Define.
1884 (tls_phdrs_script_test_LDFLAGS): Define.
1885 (tls_phdrs_script_test_LDADD): Define.
1886 * testsuite/Makefile.in: Rebuild.
1887
1888 2010-03-23 Cary Coutant <ccoutant@google.com>
1889
1890 * fileread.cc (find_or_make_view): Fix comment.
1891
1892 2010-03-23 Ian Lance Taylor <iant@google.com>
1893
1894 * script-sections.cc (class Orphan_section_placement): Define
1895 PLACE_TLS and PLACE_TLS_BSS.
1896 (Orphan_section_placement::Orphan_section_placement): Initialize
1897 new places.
1898 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
1899 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
1900 (tls_script_test_SOURCES): Define.
1901 (tls_script_test_DEPENDENCIES): Define.
1902 (tls_script_test_LDFLAGS): Define.
1903 (tls_script_test_LDADD): Define.
1904 * testsuite/Makefile.in: Rebuild.
1905
1906 2010-03-22 Doug Kwan <dougkwan@google.com>
1907
1908 * arm.cc (Arm_relocate_functions::abs8,
1909 Arm_relocate_functions::abs16): Use correct check for overflow
1910 specified in the ARM ELF specs.
1911 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
1912 target of a BLX instruction specially.
1913 (Reloc_stub::stub_type_for_reloc): Ditto.
1914 (Relocate::relocate): Use symbolic names instead of numeric relocation
1915 codes to report error.
1916 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
1917 workaround.
1918 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
1919 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
1920 thumb2_blx_out_of_range.stdout
1921 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
1922 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
1923 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
1924 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
1925 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
1926 thumb2_blx_in_range, thumb2_blx_in_range.o,
1927 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
1928 thumb2_blx_out_of_range.o): New rules.
1929 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
1930 thumb2_blx_in_range and thumb2_blx_out_of_range.
1931 * testsuite/Makefile.in: Regenerate.
1932 * arm_branch_in_range.sh: Add tests for THUMB BLX.
1933 * testsuite/thumb_blx_in_range.s: New file.
1934 * testsuite/thumb_blx_out_of_range.s: New file.
1935
1936 2010-03-22 Rafael Espindola <espindola@google.com>
1937
1938 * archive.cc (Should_include): Move to archive.h.
1939 (should_include_member): Make it a member of Archive.
1940 (Lib_group): New.
1941 (Add_lib_group_symbols): New.
1942 * archive.h: Include options.h.
1943 (Archive_member): Moved from Archive.
1944 (Should_include): Moved from archive.cc.
1945 (Lib_group): New.
1946 (Add_lib_group_symbols): New.
1947 * dynobj.cc (do_should_include_member): New.
1948 * dynobj.h (do_should_include_member): New.
1949 * gold.cc (queue_initial_tasks): Update call to queue.
1950 * main.cc (main): Print lib group stats.
1951 * object.cc (do_should_include_member): New.
1952 * object.h: Include archive.h.
1953 (Object::should_include_member): New.
1954 (Object::do_should_include_member): New.
1955 (Sized_relobj::do_should_include_member): New.
1956 * options.cc (General_options::parse_start_lib): New.
1957 (General_options::parse_end_lib): New.
1958 (Input_arguments::add_file): Handle lib groups.
1959 (Input_arguments::start_group): Check we are not in a lib.
1960 (Input_arguments::start_lib): New.
1961 (Input_arguments::end_lib): New.
1962 * options.h (General_options): Add start_lib and end_lib.
1963 (Input_argument::lib_): New.
1964 (Input_argument::lib): New.
1965 (Input_argument::is_lib): New.
1966 (Input_file_lib): New.
1967 (Input_arguments::in_lib_): New.
1968 (Input_arguments::in_lib): New.
1969 (Input_arguments::start_lib): New.
1970 (Input_arguments::end_lib_): New.
1971 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
1972 in unused members as preempted.
1973 (Sized_pluginobj::do_should_include_member): New.
1974 * plugin.h (Sized_pluginobj::do_should_include_member): New.
1975 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
1976 return the blocker.
1977 (Read_symbols::do_whole_lib_group): New.
1978 (Read_symbols::do_lib_group): New.
1979 (Read_symbols::do_read_symbols): Handle lib groups.
1980 (Read_symbols::get_name): Handle lib groups.
1981 * readsyms.h (Read_symbols): Add an archive member pointer.
1982 (Read_symbols::do_whole_lib_group): New.
1983 (Read_symbols::do_lib_group): New.
1984 (Read_symbols::member_): New.
1985 * script.cc (read_input_script): Update call to queue_soon.
1986
1987 2010-03-19 Doug Kwan <dougkwan@google.com>
1988
1989 * arm.cc (Stub_table::Stub_table): Initialize new data members
1990 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1991 (Stub_table::add_reloc_stub): Assign stub offset and update
1992 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1993 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
1994 New data members.
1995 (Stub_table::update_data_size_and_addralign): Use
1996 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
1997 instead of going over all reloc stubs.
1998 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
1999 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2000 Stringpool_template::offset_ to size of Stringpool_char.
2001 (Stringpool_template::new_key_offset): Remove code to initialize
2002 Stringpool_template::offset_.
2003 * stringpool.h (Stringpool_template::set_no_zero_null): Set
2004 Stringpool_template::offset_ to zero.
2005
2006 2010-03-15 Doug Kwan <dougkwan@google.com>
2007
2008 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2009 offset_.
2010 (Stringpool_template::new_key_offset): New method.
2011 (Stringpool_template::add_string): Assign offsets when adding new
2012 strings.
2013 (Stringpool_template::set_string_offsets): Do not set string offsets
2014 when not optimizing.
2015 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
2016 member size_.
2017 (Chunked_vector::clear): Clear size_.
2018 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
2019 (Chunked_vector::size): Return size_.
2020 (Chunked_vector::push_back): Use size_ to find insert position.
2021 (Chunked_vector::size_): New data member.
2022 (Stringpool_template::set_no_zero_null): Assert string set is empty.
2023 (Stringpool_template::new_key_offset): New method declaration.
2024 (Stringpool_template::offset_): New data member.
2025
2026 2010-03-15 Rafael Espindola <espindola@google.com>
2027
2028 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
2029 Add_symbols' constructor.
2030 * readsyms.h (Add_symbols): Remove the input_group member.
2031
2032 2010-03-10 Ian Lance Taylor <iant@google.com>
2033
2034 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
2035 target to ask whether a reference to a symbol requires a stack
2036 split.
2037 * target.h (Target::is_call_to_non_split): New function.
2038 (Target::do_is_call_to_non_split): Declare virtual function.
2039 * target.cc: Include "symtab.h".
2040 (Target::do_is_call_to_non_split): New function.
2041 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
2042
2043 2010-03-10 Cary Coutant <ccoutant@google.com>
2044
2045 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
2046 (File_read::open[1]): Remove initial mapping of whole_file_view_.
2047 (File_read::open[2]): Add whole_file_view_ to list of views.
2048 (File_read::make_view): Remove test of whole_file_view_.
2049 (File_read::find_or_make_view): Create whole_file_view_ if
2050 necessary.
2051 (File_read::clear_views): Replace bool parameter with enum;
2052 adjust all callers. Don't delete views with permanent data;
2053 do delete cached views and views from archives if
2054 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
2055 if clearing the corresponding view.
2056 * fileread.h (File_read::Clear_views_mode): New enum.
2057 (File_read::View::is_permanent_view): New method.
2058 (File_read::clear_views): Replace bool parameter
2059 with enum; adjust all callers.
2060 * options.h (General_options): Change keep_files_mapped option;
2061 add map_whole_files.
2062 * readsyms.cc (Add_symbols::run): Delete sd_ object before
2063 releasing the file.
2064 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
2065 the file.
2066
2067 2010-03-10 David S. Miller <davem@davemloft.net>
2068
2069 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
2070
2071 2010-03-09 Sriraman Tallam <tmsriram@google.com>
2072
2073 * icf.cc (get_section_contents): Add '@' marker after processing the
2074 merge reloc.
2075
2076 2010-03-08 Doug Kwan <dougkwan@google.com>
2077
2078 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
2079 due to a conversion warning.
2080 (Arm_relobj::update_output_local_symbol_count): Check for local
2081 symbol with unset output index.
2082
2083 2010-03-05 Ian Lance Taylor <iant@google.com>
2084
2085 * options.h (class General_options): Add --spare-dynamic-tags.
2086 * output.cc (Output_data_dynamic::set_final_data_size): Implement
2087 --spare-dynamic-tags.
2088
2089 2010-03-05 Ian Lance Taylor <iant@google.com>
2090
2091 * incremental.cc: Include "libiberty.h".
2092
2093 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2094
2095 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
2096 function, is_info_ member.
2097 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
2098 (Versions::Versions): Update caller.
2099 (Versions::define_base_version): Likewise.
2100 (Versions::add_def): Likewise.
2101
2102 2010-03-03 Sriraman Tallam <tmsriram@google.com>
2103
2104 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
2105 (Scan::possible_function_pointer_reloc): New function.
2106 (Scan::local_reloc_may_be_function_pointer): Change to call
2107 possible_function_pointer_reloc.
2108 (Scan::global_reloc_may_be_function_pointer): Ditto.
2109 * icf.h (Icf::check_section_for_function_pointers): Change to reject
2110 relocations in ".data.rel.ro._ZTV" section.
2111 * testsuite/icf_safe_so_test.sh: Change to pass i386.
2112 * testsuite/icf_safe_so_test.cc: Ditto.
2113 * testsuite/icf_safe_test.cc: Ditto.
2114 * testsuite/icf_safe_test.sh: Ditto.
2115
2116 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2117 Ian Lance Taylor <iant@google.com>
2118
2119 * target-reloc.h (relocate_section): Check the symbol table index
2120 for -1U before setting the local symbol index.
2121 (scan_relocatable_relocs): If copying the relocation, record that
2122 the local symbol is required.
2123 * object.h (Symbol_value::is_output_symtab_index_set): New
2124 function.
2125 (Symbol_value::may_be_discarded_from_output_symtab): New
2126 function.
2127 (Symbol_value::has_output_symtab_entry): New function.
2128 (Symbol_value::needs_output_symtab_entry): Remove.
2129 (Symbol_value::output_symtab_index): Make sure the symbol index is
2130 set.
2131 (Symbol_value::set_output_symtab_index): Make sure the symbol
2132 index is not set. Make sure the new index is valid.
2133 (Symbol_value::set_must_have_output_symtab_entry): New function.
2134 (Symbol_value::has_output_dynsym_entry): New function.
2135 (Symbol_value::set_output_dynsym_index): Make sure the new index
2136 is valid.
2137 (Sized_relobj::set_must_have_output_symtab_entry): New function.
2138 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
2139 local symbol if permitted.
2140 (Sized_relobj::do_finalize_local_symbols): Call
2141 is_output_symtab_index_set rather than needs_output_symtab_entry.
2142 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
2143 rather than needs_output_symtab_entry. Call
2144 has_output_dynsym_entry rather than needs_output_dynsym_entry.
2145 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
2146 is_output_symtab_index_set rather than needs_output_symtab_entry.
2147 * testsuite/discard_locals_relocatable_test.c: New file.
2148 * testsuite/discard_locals_test.sh: Test -r.
2149 * testsuite/Makefile.am (check_DATA): Add
2150 discard_locals_relocatable_test1.syms,
2151 discard_local_relocatable_test2.syms.
2152 (MOSTLYCLEANFILES): Likewise. Also add
2153 discard_locals_relocatable_test1.lout and
2154 discard_locals_relocatable_test2.out.
2155 (discard_locals_relocatable_test1.syms): New target.
2156 (discard_locals_relocatable_test.o): New target.
2157 (discard_locals_relocatable_test1.out): New target.
2158 (discard_locals_relocatable_test2.syms): New target.
2159 (discard_locals_relocatable_test2.out): New target.
2160 (various): Add missing ../ld-new dependencies.
2161 * testsuite/Makefile.in: Rebuild.
2162
2163 2010-03-03 Nick Clifton <nickc@redhat.com>
2164
2165 * po/fi.po: New Finnish translation.
2166
2167 2010-03-01 Doug Kwan <dougkwan@google.com>
2168
2169 * layout.cc (Layout::Layout): Force section types of .init_array*,
2170 .preinit_array* and .fini_array* sections.
2171 * output.cc (Output_section::Input_section_sort_entry::has_priority):
2172 Fix check of return value of std::string::find.().
2173 (Output_section::Input_section_sort_compare::operator()): Remove
2174 comment about .init_array.
2175 (Output_section::Input_section_sort_init_fini_compare::operator()):
2176 New method.
2177 (Output_section::sort_attached_input_sections): Handle .init_array
2178 and .fini_array specially.
2179 * output.h (Output_section::Inut_section_sort_compare): Update
2180 comment.
2181 (Output_section::Input_section_sort_init_fini_compare): New struct.
2182
2183 2010-02-26 Doug Kwan <dougkwan@google.com>
2184
2185 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
2186 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
2187 * testsuite/debug_msg.sh: Avoid matching source line number for
2188 use of global variable undef_int.
2189
2190 2010-02-26 Doug Kwan <dougkwan@google.com>
2191
2192 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
2193 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
2194 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
2195 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
2196 * options.cc (General_options::General_options): Initialize member
2197 fix_v4bx_.
2198 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
2199 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
2200 and rm_no_fix_v4bx.stdout
2201 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
2202 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
2203 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
2204 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
2205 and arm_no_fix_v4bx.
2206 * Makefile.in: Regenerate.
2207 * testsuite/arm_fix_v4bx.s: New file.
2208 * testsuite/arm_fix_v4bx.sh: Ditto.
2209
2210 2010-02-24 Doug Kwan <dougkwan@google.com>
2211
2212 * arm.cc (Target_arm::got_section): Make the .got section the first
2213 non RELRO section in the data segment.
2214 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
2215 suffixes of section names.
2216
2217 2010-02-24 Doug Kwan <dougkwan@google.com>
2218
2219 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
2220 flags and attributes merging if an input file is a binary file.
2221 * fileread.cc (Input_file::open): Record format of original file.
2222 * fileread.h (Input_file::Format): New enum type.
2223 (Input_file::Input_file): Initialize data member format_.
2224 (Input_file::format): New method definition.
2225 (Input_file::format_):: New data member.
2226
2227 2010-02-24 Doug Kwan <dougkwan@google.com>
2228
2229 * arm.cc (Arm_output_data_got): New class.
2230 (ARM_TCB_SIZE): New constant
2231 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
2232 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
2233 If user uses a script with a SECTIONS clause, issue only a warning
2234 for a misplaced EXIDX input section. Otherwise, issue an error.
2235 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
2236 garbage collection.
2237 (Target_arm::got_mode_index_entry): Handle static linking.
2238 (Target_arm::Scan::local): Ditto.
2239 (Target_arm::Scan::global): Ditto.
2240 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
2241 all incorrectly implemented relocations.
2242 (Target_arm::fix_exidx_coverage): Pass layout to
2243 Arm_output_section::fix_exidx_coverage.
2244 * layout.cc (Layout::section_name_mapping): Remove trailing dots
2245 from ".ARM.exidx." and ".ARM.extab.".
2246
2247 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2248
2249 * arm.cc (Target_arm::do_finalize_sections): Create attribute
2250 section if it does not already exist.
2251 * attributes.cc (Attributes_section_data::Attributes_section_data):
2252 Don't crash if size is zero.
2253
2254 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2255 Ian Lance Taylor <iant@google.com>
2256
2257 * gold.cc (queue_middle_tasks): If no input files were opened,
2258 exit.
2259 * workqueue.h (Task_function::Task_function): Assert that there is
2260 a blocker.
2261
2262 2010-02-22 Doug Kwan <dougkwan@google.com>
2263
2264 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
2265 * icf.cc (get_section_contents): Cast snprintf arguments to long long
2266 types to avoid warnings due to different uint64_t implementations
2267 on different hosts.
2268
2269 2010-02-21 Doug Kwan <dougkwan@google.com>
2270
2271 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
2272 handling of the maximum backward branch offset.
2273 (Arm_relocate_functions::thumb_branch_common): Ditto.
2274 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
2275 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
2276 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2277 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
2278 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
2279 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
2280 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
2281 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
2282 thumb_bl_out_of_range thumb_bl_out_of_range.o,
2283 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
2284 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
2285 thumb2_bl_out_of_range.o): New rules.
2286 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
2287 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
2288 thumb2_bl_out_of_range
2289 * testsuite/Makefile.in: Regenerate.
2290 * testsuite/arm_bl_in_range.s: New file.
2291 * testsuite/arm_bl_out_of_range.s: Ditto.
2292 * testsuite/arm_branch_in_range.sh: Ditto.
2293 * testsuite/arm_branch_range.t: Ditto.
2294 * testsuite/thumb2_branch_range.t: Ditto.
2295 * testsuite/thumb_bl_in_range.s: Ditto.
2296 * testsuite/thumb_bl_out_of_range.s: Ditto.
2297 * testsuite/thumb_branch_range.t: Ditto.
2298
2299 2010-02-20 Sriraman Tallam <tmsriram@google.com>
2300
2301 * gc.h (gc_process_relocs): Change vectors to point to the new list.
2302 Add reloc offset information.
2303 * icf.cc (get_section_contents): Change iterators to point to the new
2304 vectors. Add reloc offset information to the contents.
2305 * icf.h (Icf::Sections_reachable_info): New typedef.
2306 (Icf::Sections_reachable_list): New typedef.
2307 (Icf::Offset_info): New typedef.
2308 (Icf::Reloc_info): New struct typedef.
2309 (Icf::Reloc_info_list): New typedef.
2310 (Icf::symbol_reloc_list): Delete method.
2311 (Icf::addend_reloc_list): Delete method.
2312 (Icf::section_reloc_list): Delete method.
2313 (Icf::reloc_info_list): New method.
2314 (Icf::reloc_info_list_): New member.
2315
2316 2010-02-19 Doug Kwan <dougkwan@google.com>
2317
2318 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
2319 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
2320 * arm.cc (Arm_relocation_functions): New forward declaration.
2321 (Target_arm::Target_arm): Initialize new data members
2322 got_mod_index_offset_ and tls_base_symbol_defined_.
2323 (Target_arm::Relocate::relocate_tls): New method.
2324 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
2325 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
2326 New methods.
2327 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
2328 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
2329 (Target_arm::got_mod_index_offset_,
2330 Target_arm::tls_base_symbol_defined_): New data members.
2331 (Target_arm::Scan::local, Target::Scan::global,
2332 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
2333 relocations.
2334
2335 2010-02-18 Doug Kwan <dougkwan@google.com>
2336
2337 * arm.cc (Arm_relobj::find_linked_text_section): New method.
2338 (Arm_relobj::make_exidx_input_section): Pass section index of linked
2339 text section as a parameter becuase some broken tools may not set
2340 the link in section header.
2341 (Target_arm::has_got_section): New method.
2342 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
2343 without any mapping symbol as data only. Remove warning.
2344 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
2345 link in its section header, try to discover the link by inspecting the
2346 REL31 relocation at the beginning of the section.
2347 (Target_arm::Scan::check_non_pic): Report name of offending relocation
2348 in error message.
2349 (Target_arm::Scan::global): Treat any reference to the symbol
2350 _GLOBAL_OFFSET_TABLE_ as a GOT access.
2351
2352 2010-02-12 Sriraman Tallam <tmsriram@google.com>
2353
2354 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
2355 (Scan::global_reloc_may_be_function_pointer): New function.
2356 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2357 (Scan::global_reloc_may_be_function_pointer): New function.
2358 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2359 (Scan::global_reloc_may_be_function_pointer): New function.
2360 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
2361 (Scan::global_reloc_may_be_function_pointer): New function.
2362 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
2363 (Scan::global_reloc_may_be_function_pointer): New function.
2364 (Scan::possible_function_pointer_reloc): New function.
2365 (Target_x86_64::can_check_for_function_pointers): New function.
2366 * gc.h (gc_process_relocs): Scan relocation types to determine if
2367 function pointers were taken for targets that support it.
2368 * icf.cc (Icf::find_identical_sections): Include functions for
2369 folding in safe ICF whose pointer is not taken.
2370 * icf.h (Secn_fptr_taken_set): New typedef.
2371 (fptr_section_id_): New member.
2372 (section_has_function_pointers): New function.
2373 (set_section_has_function_pointers): New function.
2374 (check_section_for_function_pointers): New function.
2375 * options.h: Fix comment for safe ICF option.
2376 * target.h (can_check_for_function_pointers): New function.
2377 * testsuite/Makefile.am: Add icf_safe_so_test test case.
2378 Modify icf_safe_test for X86-64.
2379 * testsuite/Makefile.in: Regenerate.
2380 * testsuite/icf_safe_so_test.cc: New file.
2381 * testsuite/icf_safe_so_test.sh: New file.
2382 * testsuite/icf_safe_test.cc (kept_func_3): New function.
2383 (main): Change to take pointer to function kept_func_3.
2384 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
2385 folding is done correctly for X86-64.
2386
2387 2010-02-12 David S. Miller <davem@davemloft.net>
2388
2389 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
2390 is_symbolless parameter.
2391 (Output_reloc<SHT_REL>::is_symbolless): New.
2392 (Output_reloc<SHT_REL>::is_symbolless_): New.
2393 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
2394 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
2395 (Output_reloc<SHT_RELA>::is_symbolless): New.
2396 (Output_data_reloc::add_global): Handle is_symbolless.
2397 (Output_data_reloc::add_global_relative): Likewise.
2398 (Output_data_reloc::add_local): Likewise.
2399 (Output_data_reloc::add_local_relative): Likewise.
2400 (Output_data_reloc::add_symbolless_global_addend): New.
2401 (Output_data_reloc::add_symbolless_local_addend): New.
2402 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
2403 is_symbolless.
2404 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
2405 instead of ->is_relative_
2406 (Output_reloc::write): Likewise.
2407 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
2408 (Output_reloc::write_rel): Simplify.
2409
2410 * sparc.cc (Target_sparc::Scan::local): Use
2411 ->add_symbolless_local_addend as needed.
2412 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
2413 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
2414 based upon relocation offset.
2415
2416 2010-02-11 Doug Kwan <dougkwan@google.com>
2417
2418 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
2419 (Target_arm::Scan::global): Ditto. Also remove a comment before the
2420 beginning of function.
2421 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
2422 and MOVT_ABS relocations. Those are non issued in scanning. Fix
2423 parameter is_32bit in calls to should_apply_static_reloc.
2424 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
2425 (check_DATA): Add arm_abs_global.stdout.
2426 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
2427 arm_abs_global.stdout): New rules.
2428 (MOSTLLYCLEANFILES): Add arm_abs_global
2429 * Makefile.in: Regenerate.
2430 * testsuite/arm_abs_global.s: New file.
2431 * testsuite/arm_abs_global.sh: Ditto.
2432 * testsuite/arm_abs_lib.s: Ditto.
2433
2434 2010-02-11 Ian Lance Taylor <iant@google.com>
2435
2436 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
2437 Read_relocs task.
2438 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
2439 Allocate_commons_task first.
2440 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
2441 task, rather than symtab_lock_.
2442 (Gc_process_relocs::~Gc_process_relocs): New function.
2443 (Gc_process_relocs::is_runnable): Check this_blocker_.
2444 (Gc_process_relocs::locks): Use next_blocker_ rather than
2445 blocker_.
2446 (Scan_relocs::~Scan_relocs): New function.
2447 (Scan_relocs::is_runnable): Check this_blocker_ rather than
2448 symtab_lock_.
2449 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
2450 next_blocker_.
2451 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
2452 fields. Add this_blocker_ and next_blocker_ fields. Adjust
2453 constructor accordingly.
2454 (class Gc_process_relocs): Likewise.
2455 (class Scan_relocs): Likewise.
2456 * common.h (class Allocate_commons_task): Remove symtab_lock_
2457 field, and corresponding constructor parameter.
2458 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
2459 symtab_lock_.
2460 (Allocate_commons_task::locks): Likewise.
2461
2462 2010-02-11 Ian Lance Taylor <iant@google.com>
2463
2464 * gold-threads.h (class Once): Define.
2465 (class Initialize_lock): Rewrite as child of Once.
2466 * gold-threads.cc (class Once_initialize): Define.
2467 (once_pointer_control): New static variable.
2468 (once_pointer, once_arg): New static variables.
2469 (c_run_once): New static function.
2470 (Once::Once, Once::run_once, Once::internal_run): New functions.
2471 (class Initialize_lock_once): Remove.
2472 (initialize_lock_control): Remove.
2473 (initialize_lock_pointer): Remove.
2474 (initialize_lock_once): Remove.
2475 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
2476 (Initialize_lock::initialize): Rewrite.
2477 (Initialize_lock::do_run_once): New function.
2478 * archive.cc (Archive::interpret_header): Only clear name if it is
2479 not already empty.
2480 * fileread.cc: Include "gold-threads.h"
2481 (file_counts_lock): New static variable.
2482 (file_counts_initialize_lock): Likewise.
2483 (File_read::release): Only increment counts when using --stats.
2484 Use a lock around the increment.
2485 * parameters.cc (class Set_parameters_target_once): Define.
2486 (set_parameters_target_once): New static variable.
2487 (Parameters::Parameters): Move here from parameters.h.
2488 (Parameters::set_target): Rewrite.
2489 (Parameters::set_target_once): New function.
2490 (Parameters::clear_target): Move here and rewrite.
2491 * parameters.h (class Parameters): Update declarations. Add
2492 set_parameters_target_once_ field.
2493 (Parameters::Parameters): Move to parameters.cc.
2494 (Parameters::clear_target): Likewise.
2495 * readsyms.cc (Read_symbols::do_group): Create a Start_group
2496 task.
2497 (Start_group::~Start_group): New function.
2498 (Start_group::is_runnable): New function.
2499 (Start_group::locks, Start_group::run): New functions.
2500 (Finish_group::run): Change saw_undefined to size_t.
2501 * readsyms.h (class Start_group): Define.
2502 (class Finish_group): Change saw_undefined_ field to size_t.
2503 (Finish_group::Finish_group): Remove saw_undefined and
2504 this_blocker parameters. Change all callers.
2505 (Finish_group::set_saw_undefined): New function.
2506 (Finish_group::set_blocker): New function.
2507 * symtab.h (class Symbol_table): Change saw_undefined to return
2508 size_t. Change saw_undefined_ field to size_t.
2509 * target-select.cc (Set_target_once::do_run_once): New function.
2510 (Target_selector::Target_selector): Initialize set_target_once_
2511 field. Don't initialize lock_ and initialize_lock_ fields.
2512 (Target_selector::instantiate_target): Rewrite.
2513 (Target_selector::set_target): New function.
2514 * target-select.h (class Set_target_once): Define.
2515 (class Target_selector): Update declarations. Make
2516 Set_target_once a friend. Remove lock_ and initialize_lock_
2517 fields. Add set_target_once_ field.
2518
2519 2010-02-10 Ian Lance Taylor <iant@google.com>
2520
2521 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
2522 queueing any tasks.
2523 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
2524 (queue_middle_tasks): Add all blockers before queueing any tasks.
2525 (queue_final_tasks): Likewise.
2526 * token.h (Task_token::add_blockers): New function.
2527 * object.h (Input_objects::number_of_relobjs): New function.
2528
2529 2010-02-10 Ian Lance Taylor <iant@google.com>
2530
2531 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
2532 shared, not if not position independent.
2533 * x86_64.cc (Relocate::relocate_tls): Likewise.
2534 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
2535 (tls_pie_pic_test): New target.
2536 * testsuite/Makefile.in: Rebuild.
2537
2538 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
2539 (tls_test_main_pie.o, tls_test_pie.o): New targets.
2540 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
2541 * testsuite/Makefile.in: Rebuild.
2542
2543 2010-02-09 David S. Miller <davem@davemloft.net>
2544
2545 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
2546 R_SPARC_RELATIVE using ->add_local_relative().
2547 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
2548
2549 * output.h (Output_data_dynamic::add_section_size): New method
2550 that takes two Output_data objects.
2551 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
2552 entry param. Handle it in initializers.
2553 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
2554 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
2555 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
2556 arg.
2557 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
2558 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
2559 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
2560 for dynrel_includes_plt.
2561 * i386.cc (Target_i386::do_finalize_sections): Likewise.
2562 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2563 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
2564 before .rela.plt
2565 (Target_sparc::do_finalize_sections): Update to pass true for
2566 dynrel_includes_plt.
2567 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
2568 output before .rela.plt
2569 (Target_powerpc::do_finalize_sections): Update to pass true for
2570 dynrel_includes_plt when 32-bit.
2571
2572 2010-02-08 Doug Kwan <dougkwan@google.com>
2573
2574 * arm.cc (Arm_relobj::simple_input_section_output_address): New
2575 method.
2576 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
2577 Arm_relobj::scan_section_for_cortex_a8_stubs,
2578 Arm_relobj::do_relocation_section): Instead of calling
2579 Output_section::output_address, use faster
2580 Arm_relobj::simple_input_section_output_address.
2581
2582 2010-02-08 David S. Miller <davem@davemloft.net>
2583
2584 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
2585 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
2586 relocation helper function.
2587
2588 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
2589 just like R_SPARC_GOT{10,13,22}.
2590 (Target_sparc::Scan::local): Likewise.
2591 (Target_sparc::Relocate:relocate): Likewise.
2592
2593 2010-02-06 Ian Lance Taylor <iant@google.com>
2594
2595 * configure.ac: Rewrite targetobjs duplicate removal code to use
2596 only shell constructs.
2597 * configure: Rebuild.
2598
2599 2010-02-05 Doug Kwan <dougkwan@google.com>
2600
2601 PR 11247
2602 * arm.cc (Arm_relobj::section_is_scannable): New method.
2603 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
2604 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
2605
2606 2010-02-04 Doug Kwan <dougkwan@google.com>
2607
2608 PR 11247
2609 * arm-reloc-property.cc (cstdio): Include.
2610 * configure.ac (targetobjs): Remove duplicates.
2611 * configure: Regenerate.
2612 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
2613 big and little endian version for a given address size.
2614
2615 2010-02-03 Doug Kwan <dougkwan@google.com>
2616
2617 * arm-reloc-property.cc
2618 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2619 definition.
2620 * arm-reloc-property.h
2621 (Arm_reloc_property_table::get_implemented_static_reloc_property):
2622 New method definition.
2623 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2624 declaration.
2625 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
2626 overflow to N.
2627 (GOT_PREL): Change implemented to Y.
2628 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
2629 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
2630 (Arm_relocate_functions::movw_abs_nc): Remove method.
2631 (Arm_relocate_functions::movt_abs): Ditto.
2632 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
2633 (Arm_relocate_functions::thm_movt_abs): Ditto.
2634 (Arm_relocate_functions::movw_rel_nc): Ditto.
2635 (Arm_relocate_functions::movw_rel): Ditto.
2636 (Arm_relocate_functions::movt_rel): Ditto.
2637 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
2638 (Arm_relocate_functions:thm_movw_rel): Ditto.
2639 (Arm_relocate_functions:thm_movt_rel): Ditto.
2640 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
2641 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
2642 New method definitions.
2643 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
2644 (Arm_relocation_functions::arm_grp_ldr): Ditto.
2645 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
2646 (Arm_relocation_functions::arm_grp_ldc): Ditto.
2647 (Target_arm::Relocate::relocate): Check for non-static or
2648 unimplemented relocation code and exit early. Change calls to
2649 Target_arm::reloc_uses_thumb_bit and
2650 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
2651 instead. Refactor code to handle similar relocations to increase
2652 code sharing. Remove check for unsupported relocation code in switch
2653 statement.
2654 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
2655 relocation property table to find out size. Change error message to
2656 print out the name of a relocation code instead of the numeric value.
2657 (Target_arm::scan_reloc_for_stub): Use relocation property table
2658 instead of calling Target_arm::reloc_uses_thumb_bit().
2659
2660 2010-02-02 Doug Kwan <dougkwan@google.com>
2661
2662 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
2663 types of relaxed input section.
2664
2665 2010-02-02 Doug Kwan <dougkwan@google.com>
2666
2667 * Makefile.am (HFILES): Add arm-reloc-property.h.
2668 (DEFFILES): New.
2669 (TARGETSOURCES): Add arm-reloc-property.cc
2670 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
2671 (libgold_a_SOURCES): $(DEFFILES)
2672 * Makefile.in: Regenerate.
2673 * arm-reloc-property.cc: New file.
2674 * arm-reloc-property.h: New file.
2675 * arm-reloc.def: New file.
2676 * arm.cc: Update comments.
2677 (arm-reloc-property.h): New included header.
2678 (arm_reloc_property_table): New global variable.
2679 (Target_arm::do_select_as_default_target): New method definition.
2680 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
2681 arm-reloc-property to targ_extra_obj.
2682 * parameters.cc (set_parameters_target): Call
2683 Target::select_as_default_target().
2684 * target.h (Target::select_as_default_target): New method definition.
2685 (Target::do_select_as_default_target): Same.
2686
2687 2010-02-01 Doug Kwan <dougkwan@google.com>
2688
2689 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
2690 first_output_text_section_.
2691 (Arm_exidx_fixup::first_output_text_section): New method definition.
2692 (Arm_exidx_fixup::first_output_text_section_): New data member.
2693 (Arm_exidx_fixup::process_exidx_section): Record the first text
2694 output section seen.
2695 (Arm_output_section::fix_exidx_coverage): Set correct linked section
2696 and entsize in output section header.
2697
2698 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2699
2700 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
2701 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
2702 (Arm_relocate_functions::thm_alu11): New Method.
2703 (Arm_relocate_functions::thm_pc8): New Method.
2704 (Arm_relocate_functions::thm_pc12): New Method.
2705 (Target_arm::Scan::local): Handle the relocations.
2706 (Target_arm::Scan::global): Likewise.
2707 (Target_arm::Relocate::relocate): Likewise.
2708 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2709
2710 2010-01-29 Doug Kwan <dougkwan@google.com>
2711
2712 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
2713 of relocation types as ld.
2714
2715 2010-01-29 Doug Kwan <dougkwan@google.com>
2716
2717 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
2718 to public.
2719 (Arm_relocate_functions::thumb_branch_common): Ditto.
2720 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
2721 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
2722 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
2723 Arm_relocate_functions::jump24): Remove.
2724 (Target_arm::Relocate::relocate): Adjust code to call
2725 Arm_relocation_functions::arm_branch_common and
2726 Arm_relocation_functions::thumb_branch_common instead of their removed
2727 wrappers. Merge switch-cases together to reduce source code size.
2728
2729 2010-01-29 Doug Kwan <dougkwan@google.com>
2730
2731 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
2732 output_local_symbol_count_needs_update_.
2733 (Arm_relobj::output_local_symbol_count_needs_update,
2734 Arm_relobj::set_output_local_symbol_count_needs_update,
2735 Arm_relobj::update_output_local_symbol_count): New methods.
2736 (Arm_relobj::output_local_symbol_count_needs_update_): New data
2737 member.
2738 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
2739 of pointed function as in a R_ARM_PREL31 relocation.
2740 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
2741 for output local symbol count updating.
2742 (Target_arm::do_relax): Update output local symbol counts in objects
2743 if necessary.
2744 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
2745
2746 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2747
2748 * arm.cc: Added support for the ARM relocations:
2749 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
2750 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
2751 (Arm_relocate_functions::movw_rel_nc): Renamed (was
2752 movw_prel_nc).
2753 (Arm_relocate_functions::movw_rel): New method.
2754 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
2755 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
2756 thm_movw_prel_nc).
2757 (Arm_relocate_functions::thm_movw_rel): New method.
2758 (Arm_relocate_functions::thm_movt_rel): Renamed (was
2759 thm_movt_prel).
2760 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
2761 relocations.
2762 (Target_arm::Scan::global): Likewise.
2763 (Target_arm::Relocate::relocate): Likewise.
2764 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2765 Likewise.
2766
2767 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2768
2769 * arm.cc: Added support for ARM group relocations.
2770 (Target_arm::reloc_needs_sym_origin): New method.
2771 (Arm_relocate_functions::calc_grp_kn): New method.
2772 (Arm_relocate_functions::calc_grp_residual): New method.
2773 (Arm_relocate_functions::calc_grp_gn): New method.
2774 (Arm_relocate_functions::arm_grp_alu): New Method.
2775 (Arm_relocate_functions::arm_grp_ldr): New Method.
2776 (Arm_relocate_functions::arm_grp_ldrs): New Method.
2777 (Arm_relocate_functions::arm_grp_ldc): New Method.
2778 (Target_arm::Scan::local): Handle the ARM group relocations.
2779 (Target_arm::Scan::global): Likewise.
2780 (Target_arm::Relocate::relocate): Likewise.
2781 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2782 Likewise.
2783
2784 2010-01-26 Doug Kwan <dougkwan@google.com>
2785
2786 * arm.cc (set): Include.
2787 (class Arm_exidx_fixup): Change type of last_input_section_ to const
2788 pointer type.
2789 (Arm_output_section::Text_section_list): New type.
2790 (Arm_output_section::append_text_sections_to_list): New method.
2791 (Arm_output_section::fix_exidx_coverage): Ditto.
2792 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2793 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2794 Relobj::set_section_offset() instead of
2795 Sized_relobj::invalidate_section_offset().
2796 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2797 parameter for section headers. Ignore relocation sections for
2798 unallocated sections and EXIDX sections.
2799 (Target_arm::fix_exidx_coverage): New method.
2800 (Target_arm::output_section_address_less_than): New type.
2801 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
2802 linked text section instead of the EXIDX section.
2803 (Arm_output_section::create_stub_group): Add an assertion to check
2804 that this is not an EXIDX output section.
2805 (Arm_output_section::append_text_sections_to_list): New method.
2806 (Arm_output_section::fix_exidx_coverage): Ditto.
2807 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2808 Arm_relobj::section_needs_reloc_stub_scanning.
2809 (Target_arm::do_relax): Fix EXIDX output section coverage in the
2810 first pass.
2811 (Target_arm::fix_exidx_coverage): New method.
2812 * object.h (Relobj::set_output_section): New method.
2813 (Sized_relobj::invalidate_section_offset): Remove method.
2814 (Sized_relobj::do_invalidate_section_offset): Remove method.
2815 (Sized_relobj::do_set_section_offset): Handle offset value -1.
2816
2817 2010-01-25 Doug Kwan <dougkwan@google.com>
2818
2819 * arm.cc (Arm_exidx_merged_section::do_output_offset):
2820 Fix warning due to signed and unsigned comparison on a 32-bit host.
2821
2822 2010-01-22 Doug Kwan <dougkwan@google.com>
2823
2824 * arm.cc (Target_arm::do_relax): Record an output section for section
2825 offset adjustment it contains any stub table that has changed.
2826 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
2827 offsets in an output section if necessary.
2828 * output.cc (Output_section::Output_section): Initialize
2829 section_offsets_need_adjustments_.
2830 (Output_section::add_input_section_for_script): Renamed to
2831 Output_section::add_simple_input_section.
2832 (Output_section::save_states): Add a comment.
2833 (Output_section::discard_states): New method defintion.
2834 (Output_section::adjust_section_offsets): Same.
2835 * output.h (Output_section::add_input_section_for_script): Renamed to
2836 Output_section::add_simple_input_section.
2837 (Output_section::discard_states): New method declaration.
2838 (Output_section::adjust_section_offsets): Same.
2839 (Output_section::section_offsets_need_adjustment,
2840 Output_section::set_section_offsets_need_adjustment): New method
2841 definitions.
2842 (Output_section::section_offsets_need_adjustment_): New data member.
2843 * script-sections.cc
2844 (Output_section_element_input::set_section_address): Adjust code for
2845 renaming of Output_section::add_input_section_for_script.
2846 (Orphan_output_section::set_section_address): Same.
2847
2848 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2849
2850 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
2851 Fix_v4bx enum values .
2852 * gold/options.h (General_options): New option definitions.
2853 (General_options::fix_v4bx): New method.
2854 (General_options::Fix_v4bx): New enum.
2855 * gold/options.cc (General_options::parse_fix_v4bx): New method.
2856 (General_options::parse_fix_v4bx_interworking): New method.
2857
2858 2010-01-22 Doug Kwan <dougkwan@google.com>
2859
2860 * arm.cc (Arm_exidx_fixup): New class.
2861
2862 2010-01-21 Doug Kwan <dougkwan@google.com>
2863
2864 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
2865 classes.
2866 (Arm_exidx_section_offset_map): New type.
2867
2868 2010-01-21 Doug Kwan <dougkwan@google.com>
2869
2870 * arm.cc (Arm_exidx_input_section): New class.
2871 (Arm_relobj::exidx_input_section_by_link,
2872 Arm_relobj::exidx_input_section_by_shndx,
2873 Arm_relobj::make_exidx_input_section): New methods.
2874 (read_arm_attributes_section): Remove.
2875 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
2876 information about them.
2877 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
2878 to here.
2879
2880 2010-01-20 Doug Kwan <dougkwan@google.com>
2881
2882 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
2883 Input_section_specifier to Section_id.
2884 (Target_arm::new_arm_input_section: Adjust code for change of key
2885 type.
2886 (Target_arm::find_arm_input_section): Ditto.
2887 * gc.h (object.h): Include for Section_id nand Section_id_hash.
2888 (Section_id): Remove.
2889 (Garbage_collection::Section_id_hash): Remove.
2890 * icf.h (object.h): Include for Section_id nand Section_id_hash.
2891 (Section_id): Remove.
2892 (Icf::Section_id_hash): Remove.
2893 * object.h (Section_id, Const_section_id, Section_id_hash,
2894 Const_section_id_hash): New type definitions.
2895 * output.cc (Output_section::add_relaxed_input_section): Change to
2896 use Const_section_id instead of Input_section_specifier as key type.
2897 (Output_section::add_merge_input_section): Ditto.
2898 (Output_section::build_relaxation_map): Change to use Section_id
2899 instead of Input_section_specifier as key type.
2900 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2901 Ditto.
2902 (Output_section::convert_input_sections_to_relaxed_sections): Change
2903 to use Const_section_id instead of Input_section_specifier as key type.
2904 (Output_section::find_merge_section): Ditto.
2905 (Output_section::find_relaxed_input_section): Ditto.
2906 * output.h (Input_section_specifier): Remove class.
2907 (Output_section::Output_section_data_by_input_section_map): Change
2908 key type to Const_section_id.
2909 (Output_section::Output_relaxed_input_section_by_input_section_map):
2910 Ditto.
2911 (Output_section::Relaxation_map): Change key type to Section_id.
2912
2913 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2914
2915 * gold/arm.cc: Added support for R_ARM_V4BX relocation
2916 (class Arm_v4bx_stub): New class.
2917 (DEF_STUBS): Updated definition to support v4_veneer_bx.
2918 (Stub_factory::make_arm_v4bx_stub): New method.
2919 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
2920 (Stub_table::empty): Handle v4bx stubs.
2921 (Stub_table::add_arm_v4bx_stub): New method.
2922 (Stub_table::find_arm_v4bx_stub): New method.
2923 (Arm_relocate_functions::v4bx): New method.
2924 (Target_arm::fix_v4bx): New method.
2925 (Target_arm::Target_arm): Handle R_ARM_V4BX.
2926 (Stub_table::relocate_stubs): Likewise.
2927 (Stub_table::do_write): Likewise.
2928 (Stub_table::update_data_size_and_addralign): Likewise.
2929 (Stub_table::finalize_stubs): Likewise.
2930 (Target_arm::Scan::local): Likewise.
2931 (Target_arm::Scan::global): Likewise.
2932 (Target_arm::do_finalize_sections): Likewise.
2933 (Target_arm::Relocate::relocate): Likewise.
2934 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2935 Likewise.
2936 (Target_arm::scan_reloc_for_stub): Likewise.
2937 (Target_arm::scan_reloc_section_for_stubs): Likewise.
2938
2939 2010-01-19 Ian Lance Taylor <iant@google.com>
2940
2941 * output.cc (Output_section_headers::do_sized_write): Write large
2942 segment count to sh_info field.
2943 (Output_file_header::do_sized_write): For large segment count,
2944 write PN_XNUM to e_phnum field.
2945
2946 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2947
2948 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
2949 (Arm_relocate_functions::thm_jump8): New function.
2950 (Arm_relocate_functions::thm_jump11): New function.
2951 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
2952 R_ARM_THM_JUMP11.
2953 (Target_arm::Scan::global): Likewise.
2954 (Target_arm::Relocate::relocate): Likewise.
2955 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2956 Likewise.
2957
2958 2010-01-14 Doug Kwan <dougkwan@google.com>
2959
2960 * arm.cc (map, utility): Include headers.
2961 (Target_arm::apply_cortex_a8_workaround): New method.
2962 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
2963 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
2964 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
2965 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
2966 the --[no-]fix-cortex-a8 command line options.
2967 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
2968 (Target_arm::relocate_stub): Use addend in instruction template.
2969 * options.h (DEFINE_bool): Set the user-set flag.
2970 (General_options): Add --[no-]-fix-cortex options.
2971 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
2972 : Update fast look-up map after conversion.
2973
2974 2010-01-14 Sriraman Tallam <tmsriram@google.com>
2975
2976 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
2977 in the first pass of do_layout.
2978
2979 2010-01-13 Doug Kwan <dougkwan@google.com>
2980
2981 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2982 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
2983 apparent compiler problem of not folding static constant integral
2984 data members of elfcpp::Elf_sizes<32>.
2985
2986 2010-01-13 Doug Kwan <dougkwan@google.com>
2987
2988 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2989 Arm_relobj::section_needs_cortex_a8_stub_scanning,
2990 Arm_relobj::scan_section_for_cortex_a8_erratum,
2991 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
2992 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
2993 sections to scan for relocation stubs into a new method
2994 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
2995 relocation and Cortex-A8 stub scanning.
2996 (Target_arm::do_relax): Force stubs to be after stubbed sections
2997 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
2998 the beginning of a new relaxation pass. Update a comment.
2999 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
3000
3001 2010-01-12 Ian Lance Taylor <iant@google.com>
3002
3003 * target-reloc.h (visibility_error): New inline function.
3004 (relocate_section): Call visibility_error.
3005 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
3006 (MOSTLYCLEANFILES): Likewise.
3007 (protected_4_pic.o, protected_3.err): New targets.
3008 * testsuite/protected_4.cc: New file.
3009
3010 2010-01-12 Doug Kwan <dougkwan@google.com>
3011
3012 * arm.cc (Cortex_a8_reloc): New class.
3013 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
3014 and cortex_a8_relocs_info_.
3015 (Target_arm::fix_cortex_a8): New method definition.
3016 (Target_arm::Cortex_a8_relocs_info): New type.
3017 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
3018 New data member declarations.
3019 (Target_arm::scan_reloc_for_stub): Record information about
3020 relocations for THUMB branches that might be exempted from the
3021 Cortex-A8 workaround.
3022 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
3023 at the beginning of a relaxation pass.
3024
3025 2010-01-12 Doug Kwan <dougkwan@google.com>
3026
3027 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
3028 (Arm_relobj::Mapping_symbol_position,
3029 Arm_reloj::Mapping_symbol_position_less,
3030 Arm_relobj::Mapping_symbols_info): New types.
3031 (Target_arm::is_mapping_symbol_name): New method definition.
3032 (Arm_relobj::do_count_local_symbols): Save information about mapping
3033 symbols.
3034
3035 2010-01-11 Doug Kwan <dougkwan@google.com>
3036
3037 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
3038 Arm_relocate_functions::thumb32_branch_upper,
3039 Arm_relocate_functions::thumb32_branch_lower,
3040 Arm_relocate_functions::thumb32_cond_branch_offset,
3041 Arm_relocate_functions::thumb32_cond_branch_upper,
3042 Arm_relocate_functions::thumb32_cond_branch_lower,
3043 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
3044 branch offset encoding.
3045 (Arm_relocate_functions::thumb_branch_common): Use new branch
3046 offset encoding methods to avoid code duplication.
3047 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
3048 (Stub_addend_reader::operator()): Use new branch encoding method
3049 to avoid code duplication.
3050
3051 2010-01-11 Doug Kwan <dougkwan@google.com>
3052
3053 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
3054 (Target_arm::do_finalize_sections): Define special EXIDX section
3055 symbols only if referenced.
3056 * gc.h (Garbage_collection::add_reference): New method.
3057 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
3058 code duplication.
3059
3060 2010-01-11 Ian Lance Taylor <iant@google.com>
3061
3062 * script.cc (Version_script_info::build_expression_list_lookup):
3063 Change complaing about duplicate wildcard match from error to
3064 warning.
3065
3066 * script.cc (class Lazy_demangler): Recreate--revert part of patch
3067 of 2009-12-30.
3068 (Version_script_info::Version_script_info): Initialize globs_,
3069 default_version_, default_is_global_, and exact_. Don't
3070 initialize globals_ or locals_.
3071 (Version_script_info::build_lookup_tables): Build local symbols
3072 first.
3073 (Version_script_info::unquote): New function.
3074 (Version_script_info::add_exact_match): New function.
3075 (Version_script_info::build_expression_list_lookup): Remove lookup
3076 parameter. Add is_global parameter. Change all callers. Handle
3077 wildcard pattern specially. Unquote pattern. Call
3078 add_exact_match.
3079 (Version_script_info::get_name_to_match): New function.
3080 (Version_script_info::get_symbol_version): New function.
3081 (Version_script_info::get_symbol_version_helper): Remove.
3082 (Version_script_info::check_unmatched_names): Call unquote.
3083 * script.h (class Version_script_info): Change get_symbol_version
3084 to be non-inline and add is_global parameter; change all callers.
3085 Rewrite symbol_is_local. Update declarations. Define struct
3086 Version_tree_match, Exact, Globs. Don't define struct Lookup.
3087 Remove globals_ and locals_ members. Add exact_, globs_,
3088 default_version_, is_global_.
3089 (Version_script_info::Glob): Remove pattern, add expression and
3090 is_global. Update constructor. Change all callers.
3091 * dynobj.cc (Versions::finalize): Mark the version symbol as the
3092 default version.
3093 (Versions::symbol_section_contents): If a symbol is undefined, or
3094 defined in a dynamic object, set the version index to
3095 VER_NDX_LOCAL.
3096 * symtab.cc (Symbol_table::add_from_relobj): Don't call
3097 symbol_is_local.
3098 (Symbol_table::add_from_pluginobj): Likewise.
3099 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
3100
3101 2010-01-11 Doug Kwan <dougkwan@google.com>
3102
3103 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
3104 (incremental_dump_LDADD): Add linking option for libintl.
3105 * Makefile.in: Regenerate.
3106
3107 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
3108
3109 PR gold/11144
3110 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
3111 instead of -Ds.
3112 * testsuite/Makefile.in: Regenerated.
3113
3114 2010-01-10 Doug Kwan <dougkwan@google.com>
3115
3116 * options.h (DEFINE_var): Use parentheses around argument varname__
3117 in macro body to avoid any unintended subsequent substitutions.
3118
3119 2010-01-10 Ian Lance Taylor <iant@google.com>
3120
3121 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
3122 candidates before doing symbol resolution.
3123
3124 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
3125 ODR candidates if only one is weak.
3126
3127 2010-01-08 Ian Lance Taylor <iant@google.com>
3128
3129 * script.cc (Version_script_info::build_expression_list_lookup):
3130 Don't warn about ambiguous version, just record the ambiguity.
3131 (Version_script_info::get_symbol_version_helper): Give error if
3132 version is ambiguous.
3133
3134 2010-01-08 Doug Kwan <dougkwan@google.com>
3135
3136 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
3137 prev_data_size_ and prev_addralign_. Remove initializer for
3138 deleted data member has_been_changed_.
3139 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
3140 to determine if the table is empty.
3141 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
3142 Remove.
3143 (Stub_table::add_reloc_stub): Define method in class definition
3144 instead of just declaring it there.
3145 (Stub_table::add_cortex_a8_stub): New method definition.
3146 (Stub_table::update_data_size_and_addralign): Ditto.
3147 (Stub_table::finalize_stubs): Ditto.
3148 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
3149 (Stub_table::do_addralign_): Return address alignment in the
3150 (Stub_table::do_reset_address_and_file_offset): Define method in
3151 class definition instead of declaring it there. Set current data
3152 size to be the data size of the previous pass.
3153 (Stub_table::set_final_data_size): Use current data size as the
3154 final data size.
3155 (Stub_table::relocate_stub): Change parameter type of stub from
3156 Reloc_stub pointer to Stub pointer.
3157 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
3158 (Stub_table::Cortex_a8_stub_list): New typedef.
3159 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
3160 Stub_table::prev_addralign_): New data member.
3161 (Arm_relobj::Arm_relobj): Initialize data member
3162 section_has_cortex_a8_workaround_.
3163 (Arm_relobj::section_has_cortex_a8_workaround,
3164 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
3165 definitions.
3166 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
3167 declarations.
3168 (Target_arm::relocate_stub): Change parameter type of stub from
3169 Reloc_stub pointer to Stub pointer.
3170 (Insn_template::size, Insn_template::alignment): Handle
3171 THUMB16_SPECIAL_TYPE.
3172 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
3173 Stub_table::update_data_size_and_addralign,
3174 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
3175 definitions.
3176 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
3177 (Stub_table::do_write): Ditto.
3178 (Target_arm::do_relax): Adjust code for changes in Stub_table.
3179
3180 2010-01-08 Ian Lance Taylor <iant@google.com>
3181
3182 PR 11108
3183 * symtab.h (class Symbol): Remove fields is_target_special_ and
3184 has_plt_offset_. Add field is_defined_in_discarded_section_.
3185 (Symbol::is_defined_in_discarded_section): New function.
3186 (Symbol::set_is_defined_in_discarded_section): New function.
3187 (Symbol::has_plt_offset): Rewrite.
3188 (Symbol::set_plt_offset): Verify that new offset is not -1U.
3189 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
3190 Don't initialize is_target_special_ or has_plt_offset_.
3191 Initialize is_defined_in_discarded_section_.
3192 (Symbol_table::add_from_relobj): If appropriate, set
3193 is_defined_in_discarded_section.
3194 * resolve.cc (Symbol::override_base_with_special): Don't test
3195 is_target_special_. Change has_plt_offset_ to has_plt_offset().
3196 * target-reloc.h (relocate_section): Do special handling for
3197 symbols defined in discarded sections for global symbols as well
3198 as local symbols.
3199
3200 2010-01-08 Ian Lance Taylor <iant@google.com>
3201
3202 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
3203 the SHT_SYMTAB case.
3204
3205 2010-01-08 Ian Lance Taylor <iant@google.com>
3206
3207 * object.cc (Sized_relobj::do_layout): Don't get confused if
3208 layout_eh_frame returns NULL.
3209
3210 2010-01-08 Ian Lance Taylor <iant@google.com>
3211
3212 PR 11084
3213 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
3214 dynamic symbol table, use the normal symbol table.
3215 (Sized_dynobj::do_read_symbols): Remove assertion about type of
3216 symbol table.
3217
3218 2010-01-08 Ian Lance Taylor <iant@google.com>
3219
3220 PR 11072
3221 * layout.cc (Layout::include_section): Remove .gnu_debuglink
3222 sections.
3223
3224 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
3225
3226 * version.cc (print_version): Change to "Copyright 2010".
3227
3228 2010-01-08 Ian Lance Taylor <iant@google.com>
3229
3230 PR 10287
3231 PR 11063
3232 * i386.cc (class Target_i386): Change return type of plt_section
3233 to be non-const.
3234 (class Output_data_plt_i386): Add tls_desc_rel_ field.
3235 (Output_data_plt_i386::Output_data_plt_i386): Initialize
3236 tls_desc_rel_ field.
3237 (Output_data_plt_i386::rel_tls_desc): New function.
3238 (Target_i386::rel_tls_desc_section): New function.
3239 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
3240 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
3241 R_386_TLS_DESC reloc in rel_tls_desc_section.
3242 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
3243 Define struct Tlsdesc_info.
3244 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
3245 (Target_x86_64::do_reloc_symbol_index): New function.
3246 (Target_x86_64::add_tlsdesc_info): New function.
3247 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
3248 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
3249 tlsdesc_rel_ field.
3250 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
3251 all callers.
3252 (Output_data_plt_x86_64::rela_tlsdesc): New function.
3253 (Target_x86_64::rela_tlsdesc_section): New function.
3254 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
3255 handling.
3256 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
3257 (Target_x86_64::do_reloc_addend): New function.
3258 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
3259 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
3260 declarations. Define TARGET_CODE. Add arg field to u1_ union.
3261 (Output_reloc::type): New function.
3262 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
3263 (Output_reloc::is_target_specific): New function.
3264 (Output_reloc::target_arg): New function.
3265 (class Output_reloc) [SHT_RELA]: Add four new constructors for
3266 absolute relocs and target specific relocs.
3267 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
3268 add_target_specific.
3269 (class Output_data_reloc) [SHT_RELA]: Likewise.
3270 * output.cc (Output_reloc::Output_reloc): Add four new versions
3271 for absolute relocs and target specific relocs.
3272 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
3273 (Output_reloc::get_symbol_index): Likewise.
3274 (Output_reloc::local_section_offset): Check that local_sym_index_
3275 is not TARGET_CODE or 0.
3276 (Output_reloc::symbol_value): Likewise.
3277 (Output_reloc::write) [SHT_RELA]: Call target for target specific
3278 reloc.
3279 * target.h (class Target): Add reloc_symbol_index and reloc_addend
3280 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
3281 functions.
3282 * layout.cc (add_target_dynamic_tags): Use output section for
3283 DT_PLTRELSZ and DT_JMPREL.
3284
3285 2010-01-07 Ian Lance Taylor <iant@google.com>
3286
3287 PR 11061
3288 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
3289 function.
3290 (class Output_data_reloc_generic): Define.
3291 (class Output_data_reloc_base): Change base class to
3292 Output_data_reloc_generic. Change add() method to call
3293 bump_relative_reloc_count for a relative reloc. Remove
3294 sort_relocs_ field.
3295 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
3296 to sort_relocs().
3297 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
3298 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
3299 appropriate.
3300 * layout.h (class Layout): Update declaration.
3301
3302 2010-01-07 Ian Lance Taylor <iant@google.com>
3303
3304 * output.h (class Output_data): Add const version of
3305 output_section and do_output_section.
3306 (class Output_section_data): Add const version of
3307 do_output_section.
3308 (class Output_section): Likewise.
3309 * layout.cc (Layout::add_target_dynamic_tags): New function.
3310 * layout.h (class Layout): Update declarations.
3311 * arm.cc (Target_arm::do_finalize_sections): Use
3312 add_target_dynamic_tags.
3313 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3314 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
3315 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
3316 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3317
3318 2010-01-07 Ian Lance Taylor <iant@google.com>
3319
3320 PR 11042
3321 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
3322 object as needed.
3323
3324 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
3325 Ian Lance Taylor <iant@google.com>
3326
3327 PR 11019
3328 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
3329 Xindex::read_symtab_xindex.
3330
3331 2010-01-07 Doug Kwan <dougkwan@google.com>
3332
3333 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
3334 (Insn_template::thumb16_bcond_insn): New method declaration.
3335 (Insn_template): Fix spelling.
3336 (Stub::thumb16_special): New method declaration.
3337 (Stub::do_write): Define virtual method which was previously pure
3338 virtual.
3339 (Stub::do_thumb16_special): New method declaration.
3340 (Stub::do_fixed_endian_write): New template member.
3341 (Reloc_stub::do_write): Remove.
3342 (Reloc_stub::do_fixed_endian_write): Remove.
3343 (Cortex_a8_stub): New class definition.
3344 (Stub_factory::make_cortex_a8_stub): New method definition.
3345 (Stub_factory::Stub_factory): Add missing static storage class
3346 qualifier for elf32_arm_stub_a8_veneer_blx.
3347
3348 2010-01-07 Ian Lance Taylor <iant@google.com>
3349
3350 PR 10980
3351 * options.h (class General_options): Add --warn-unresolved-symbols
3352 and --error-unresolved-symbols.
3353 * errors.cc (Errors::undefined_symbol): Implement
3354 --warn-unresolved-symbols.
3355
3356 * options.h (class General_options): Add -z text and -z textoff.
3357 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
3358
3359 2010-01-06 Sriraman Tallam <tmsriram@google.com>
3360
3361 * gc.h (Garbage_collection::Cident_section_map): New typedef.
3362 (Garbage_collection::cident_sections): New function.
3363 (Garbage_collection::add_cident_section): New function.
3364 (Garbage_collection::cident_sections_): New member.
3365 (gc_process_relocs): Add references to sections whose names are C
3366 identifiers.
3367 * gold.h (cident_section_start_prefix): New constant.
3368 (cident_section_stop_prefix): New constant.
3369 (is_cident): New function.
3370 * layout.cc (Layout::define_section_symbols): Replace string constants
3371 with the newly defined constants.
3372 * object.cc (Sized_relobj::do_layout): Track sections whose names are
3373 C identifiers.
3374 * testsuite/Makefile.am: Add gc_orphan_section_test.
3375 * testsuite/Makefile.in: Regenerate.
3376 * testsuite/gc_orphan_section_test.cc: New file.
3377 * testsuite/gc_orphan_section_test.sh: New file.
3378
3379 2010-01-06 Ian Lance Taylor <iant@google.com>
3380
3381 PR 10980
3382 * options.h (class General_options): Add --warn-shared-textrel.
3383 * layout.cc (Layout::finish_dynamic_section): Implement
3384 --warn-shared-textrel.
3385
3386 PR 10980
3387 * options.h (class General_options): Add --warn-multiple-gp.
3388
3389 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3390
3391 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
3392 $(THREADSLIB) and $(LIBDL).
3393 * Makefile.in: Rebuild.
3394
3395 2010-01-06 Ian Lance Taylor <iant@google.com>
3396
3397 PR 10980
3398 * options.cc (General_options::parse_section_start): New function.
3399 (General_options::section_start): New function.
3400 (General_options::General_options): Initialize all members.
3401 * options.h: Include <map>
3402 (class General_options): Add --section-start. Add section_starts_
3403 member.
3404 * layout.cc (Layout::attach_allocated_section_to_segment): If
3405 --section-start was used, set the address of the segment. Remove
3406 local sort_sections.
3407 (Layout::relaxation_loop_body): If the address of the load segment
3408 has been set by --section-start, don't use it.
3409 * output.h (Output_segment::update_flags_for_output_section): New
3410 function.
3411 * output.cc (Output_segment::add_output_section): Call
3412 update_flags_for_output_section.
3413
3414 2010-01-05 Ian Lance Taylor <iant@google.com>
3415
3416 PR 10980
3417 * options.h (class General_options): Add --undefined-version.
3418 * script.cc (struct Version_expression): Add was_matched_by_symbol
3419 field.
3420 (Version_script_info::matched_symbol): New function.
3421 (Version_script_info::get_symbol_version_helper): Call
3422 matched_symbol.
3423 (Version_script_info::check_unmatched_names): New function.
3424 * script.h (class Version_script_info): Update declarations.
3425 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
3426
3427 * options.h (class General_options): Use DEFINE_bool_alias for
3428 allow_multiple_definition.
3429 * resolve.cc (Symbol_table::should_override): Don't test
3430 allow_multiple_definition.
3431
3432 PR 10980
3433 * options.h (class General_options): Add --cref.
3434 * main.cc (main): Print cref table if --cref. Don't close mapfile
3435 until after printing cref table.
3436 * cref.cc: Include "symtab.h".
3437 (class Cref_inputs): Define Cref_table_compare and Cref_table.
3438 (Cref_table_compare::operator()): New function.
3439 (Cref_inputs::gather_cref): New function.
3440 (filecol): New static const.
3441 (Cref_inputs::print_cref): New function.
3442 (Cref::print_cref): New function.
3443 * cref.h: Include <cstdio>.
3444 (class Cref): Update declarations.
3445 * mapfile.h (Mapfile::file): New function.
3446 * object.h (class Object): Define Symbols. Declare virtual
3447 do_get_global_symbols.
3448 (Object::get_global_symbols): New function.
3449 * object.cc (Input_objects::add_object): Pass object to cref_ if
3450 --cref.
3451 (Input_objects::archive_start): Likewise.
3452 (Input_objects::archive_stop): Likewise.
3453 (Input_objects::print_cref): New function.
3454 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
3455 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
3456 --cref.
3457 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
3458 function.
3459 * plugin.h (class Sized_pluginobj): Update declarations.
3460
3461 2010-01-05 Ian Lance Taylor <iant@google.com>
3462
3463 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
3464 to is_default_version. Rename insdef to insdefault.
3465 (Symbol_table::add_from_relobj): Rename def to is_default_version
3466 and local to is_forced_local.
3467 (Symbol_table::add_from_pluginobj): Likewise.
3468 (Symbol_table::add_from_dynobj): Likewise.
3469 (Symbol_table::define_special_symbol): Rename insdef to
3470 insdefault.
3471
3472 2010-01-04 Ian Lance Taylor <iant@google.com>
3473
3474 PR 10980
3475 * options.h (class General_options): Add
3476 --allow-multiple-definition and -z muldefs.
3477 * resolve.cc (Symbol_table::should_override): Don't warn about a
3478 multiple symbol definition if --allow-multiple-definition or -z
3479 muldefs.
3480
3481 PR 10980
3482 * options.h (class General_options): Add --add-needed and
3483 --copy-dt-needed-entries. Tweak --as-needed help entry.
3484 * object.cc (Input_objects::check_dynamic_dependencies): Give an
3485 error if --copy-dt-needed-entries aka --add-needed is used and
3486 would cause a change in behaviour.
3487
3488 PR 10980
3489 * options.h (class General_options): Add -G as a short version of
3490 --shared. Add no-op options -assert, -g, and -i.
3491
3492 2010-01-04 Sriraman Tallam <tmsriram@google.com>
3493
3494 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
3495 check for .text or .gnu.linkonce.t sections.
3496 * icf.cc (Icf::find_identical_sections): Ditto.
3497 Change the detection for mangled function name within the section
3498 name.
3499 * icf.h (is_section_foldable_candidate): New function.
3500
3501 2009-12-30 Ian Lance Taylor <iant@google.com>
3502
3503 PR 10980
3504 * options.h (class General_options): Permit two dashes with
3505 --retain-symbols-file.
3506
3507 2009-12-30 Ian Lance Taylor <iant@google.com>
3508
3509 PR 10979
3510 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
3511 don't put the file header and segment headers in the text
3512 segment.
3513
3514 PR 10979
3515 * common.cc (Sort_commons::operator()): Stabilize sort when both
3516 entries are NULL.
3517 (Symbol_table::do_allocate_commons_list): When allocating common
3518 symbols, skip a symbol which is no longer common.
3519 * symtab.h (Symbol::is_common): Test whether the symbol comes from
3520 an object before checking its type.
3521 * testsuite/common_test_2.c: New file.
3522 * testsuite/common_test_3.c: New file.
3523 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
3524 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
3525 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
3526 (common_test_2_pic.o, common_test_2.so): New targets.
3527 (common_test_3_pic.o, common_test_3.so): New targets.
3528 * testsuite/Makefile.in: Rebuild.
3529
3530 PR 10979
3531 * script.cc (read_input_script): If we see a new SECTIONS clause,
3532 and we have added an input section, give an error.
3533 * layout.h (class Layout): Add have_added_input_section function.
3534 Add have_added_input_section_ field.
3535 * layout.cc (Layout::Layout): Initialize
3536 have_added_input_section_.
3537 (Layout::layout): Set have_added_input_section_.
3538 (Layout::layout_eh_frame): Likewise.
3539
3540 2009-12-30 Ian Lance Taylor <iant@google.com>
3541
3542 PR 10931
3543 * options.h (class General_options): Add --sort-common option.
3544 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
3545 * common.cc (Sort_common): Add sort_order parameter to
3546 constructor. Add sort_order_ field.
3547 (Sort_commons::operator): Check sort_order_.
3548 (Symbol_table::allocate_commons): Determine the sort order.
3549 (Symbol_table::do_allocate_commons): Add sort_order parameter.
3550 Change all callers.
3551 (Symbol_table::do_allocate_commons_list): Likewise.
3552
3553 2009-12-30 Ian Lance Taylor <iant@google.com>
3554
3555 PR 10916
3556 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
3557 symbols from this object, don't change the visibility of an
3558 undefined symbol.
3559 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
3560
3561 2009-12-30 Ian Lance Taylor <iant@google.com>
3562
3563 PR 10861
3564 * script.h (class Version_script_info): Define Language enum.
3565 Update declarations. Define Glob, Exact, and Lookup types. Add
3566 new fields globals_, locals_, and is_finalized_.
3567 * script.cc: Various formatting fixes.
3568 (class Parser_closure): Change language_stack_ from a vector of
3569 std::string to one of Version_script_info::Language. Adjust all
3570 uses accordingly.
3571 (class Lazy_demangler): Remove.
3572 (struct Version_expression): Change language from std::string to
3573 Version_script_info::Language.
3574 (Version_script_info::Version_script_info): New function.
3575 (Version_script_info::~Version_script_info): Don't call clear.
3576 (Version_script_info::finalize): New function.
3577 (Version_script_info::build_lookup_tables): New function.
3578 (Version_script_info::build_expression_list_lookup): New
3579 function.
3580 (Version_script_info::get_symbol_version_helper): Rewrite to use
3581 lookup tables.
3582 (Version_script_info::print_expression_list): Adjust to use
3583 Version_script_info::Language.
3584 (script_push_lex_into_version_mode): Check that the version script
3585 has not been finalized.
3586 (version_script_push_lang): Change language string to
3587 Version_script_info::Language.
3588 * options.cc (Command_line::version_script): New function.
3589 * options.h (class General_options): Add finalize_dynamic_list
3590 function. Change version_script from declaration to definition.
3591 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
3592 * testsuite/version_script.map: Remove duplicate def of foo.
3593 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
3594 version_script.map.
3595 * testsuite/Makefile.in: Rebuild.
3596
3597 2009-12-30 Ian Lance Taylor <iant@google.com>
3598
3599 PR 10843
3600 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
3601 if the input symbol index is 0, make the output symbol index 0.
3602
3603 2009-12-30 Ian Lance Taylor <iant@google.com>
3604
3605 PR 10670
3606 * options.h (class General_options): Add -x/--discard-all.
3607 * object.cc (Sized_relobj::do_count_local_symbols): Handle
3608 --discard-all. If the local symbol needs a dynamic entry, check
3609 that before handling --discard-locals.
3610
3611 2009-12-30 Ian Lance Taylor <iant@google.com>
3612
3613 PR 10450
3614 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
3615 flags to PF_R.
3616 (Output_segment::add_output_section): Don't change the flags if
3617 the type is PT_TLS.
3618
3619 PR 10450
3620 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
3621 GNU hash table if they need a dynamic value. Otherwise, don't add
3622 them if they are defined in a dynamic object or are forced local.
3623
3624 2009-12-29 Ian Lance Taylor <iant@google.com>
3625
3626 PR 10450
3627 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
3628 .gnu.hash table for a 32-bit target.
3629
3630 PR 10450
3631 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
3632 regular and a dynamic object only needs a dynamic symbol table
3633 entry if it is externally visible.
3634
3635 PR 10450
3636 * i386.cc (class Target_i386): Initialize global_offset_table_ in
3637 constructor. Add global_offset_table_ field.
3638 (Target_i386::got_section): Set global_offset_table_.
3639 (Target_i386::do_finalize_sections): Set global_offset_table_
3640 size.
3641 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
3642 in constructor. Add global_offset_table_ field.
3643 (Target_x86_64::got_section): Set global_offset_table_.
3644 (Target_x86_64::do_finalize_sections): Set global_offset_table_
3645 size.
3646
3647 * layout.cc (Layout::Layout): Initialize increase_relro_.
3648 (Layout::get_output_section): Add is_relro, is_last_relro, and
3649 is_first_non_relro parameters. Change all callers.
3650 (Layout::choose_output_section): Likewise.
3651 (Layout::add_output_section_data): Likewise.
3652 (Layout::make_output_section): Likewise.
3653 (Layout::set_segment_offsets): Clear increase_relro when using a
3654 linker script.
3655 * layout.h (class Layout): Add increase_relro method. Add
3656 increase_relro_ field. Update declarations.
3657 * output.cc (Output_section::Output_section): Initialize
3658 is_last_relro_ and is_first_non_relro_.
3659 (Output_segment::add_output_section): Group relro sections is
3660 do_sort is true. Handle is_last_relro and is_first_non_relro.
3661 (Output_segment::maximum_alignment): Remove relro handling.
3662 (Output_segment::set_section_addresses): Add increase_relro
3663 parameter. Change all callers. Add initial alignment to align
3664 relro sections on separate page. Remove old relro handling.
3665 (Output_segment::set_section_list_addresses): Remove in_relro
3666 parameter. Change all callers.
3667 (Output_segment::set_offset): Add increase parameter. Change all
3668 callers. Remove old relro handling.
3669 * output.h (class Output_section): Add new methods: is_last_relro,
3670 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
3671 Add is_last_relro_ and is_first_non_relro_ fields.
3672 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
3673 Create separate .got.plt section. Call increase_relro.
3674 * x86_64.cc (Target_x86_64::got_section): Likewise.
3675 * testsuite/relro_script_test.t: Add .got.plt.
3676
3677 PR 10450
3678 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
3679 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
3680 (Layout::finalize): Call set_dynamic_symbol_size.
3681 (Layout::set_dynamic_symbol_size): New function.
3682 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
3683 set_dynamic_symbol_size.
3684
3685 PR 10450
3686 * output.h (class Output_section): Add is_entsize_zero_ field.
3687 * output.cc (Output_section::Output_section): Initialize
3688 is_entsize_zero_.
3689 (Output_section::set_entsize): If two different entsizes are
3690 requested, force it to zero.
3691 (Output_section::add_input_section): Set flags for .debug_str
3692 before updating section flags. Set entsize.
3693 (Output_section::update_flags_for_input_section): Set SHF_MERGE
3694 and SHF_STRING if all input sections have those flags.
3695
3696 2009-12-29 Rafael Espindola <espindola@google.com>
3697
3698 * main.cc (main): Fix the sys time reporting.
3699 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
3700 reporting.
3701
3702 2009-12-29 Sriraman Tallam <tmsriram@google.com>
3703
3704 * options.cc (General_options::parse_version): Allow -v to exit
3705 without an error if there is nothing to link.
3706
3707 2009-12-29 Ian Lance Taylor <iant@google.com>
3708
3709 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
3710 using a version of gcc before 4.1.
3711 * configure: Rebuild.
3712
3713 2009-12-28 Chris Demetriou <cgd@google.com>
3714
3715 * attributes.cc (Output_attributes_section_data::do_write): Use
3716 std::vector::front rather than std::vector::data.
3717
3718 2009-12-28 Ian Lance Taylor <iant@google.com>
3719
3720 * symtab.h (class Symbol_table): Add enum Defined.
3721 * resolve.cc (Symbol_table::should_override): Add defined
3722 parameter. Change all callers. Test whether object is NULL
3723 before calling a method on it.
3724 (Symbol_table::report_resolve_problem): Add defined parameter.
3725 Change all callers.
3726 (Symbol_table::should_override_with_special): Likewise.
3727 * symtab.cc (Symbol_table::define_in_output_data): Add defined
3728 parameter. Change all callers.
3729 (Symbol_table::do_define_in_output_data): Likewise.
3730 (Symbol_table::define_in_output_segment): Likewise.
3731 (Symbol_table::do_define_in_output_segment): Likewise.
3732 (Symbol_table::define_as_constant): Likewise.
3733 (Symbol_table::do_define_as_constant): Likewise.
3734 * script.h (class Symbol_assignment): Add is_defsym parameter to
3735 constructor; change all callers.
3736 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
3737 parameter. Change all callers. Add is_defsym_ field.
3738 (class Parser_closure): Add parsing_defsym parameter to
3739 constructor; change all callers. Add parsing_defsym accessor
3740 function. Add parsing_defsym_ field.
3741
3742 2009-12-28 Ian Lance Taylor <iant@google.com>
3743
3744 * gold.cc (queue_middle_tasks): Fix formatting.
3745 * object.cc (Relobj::is_section_name_included): Likewise.
3746
3747 2009-12-23 Ian Lance Taylor <iant@google.com>
3748
3749 * i386.cc (Target_i386::do_calls_non_split): Recognize
3750 -fsplit-stack prologue for a function with a static chain.
3751 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
3752 -fsplit-stack prologue when using %r11.
3753
3754 2009-12-21 Sriraman Tallam <tmsriram@google.com>
3755
3756 * options.cc (General_options::parse_version): Make -v continue and do
3757 the link like GNU ld does.
3758
3759 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
3760
3761 * Makefile.am (CCFILES): Add timer.cc.
3762 (HFILES): Add timer.h.
3763 * configure.ac: Check for sysconf and times.
3764 * main.cc: include timer.h.
3765 (main): Use Timer instead of get_run_time.
3766 * timer.cc: New.
3767 * timer.h: New.
3768 * workqueue.cc: include timer.h.
3769 (Workqueue::find_and_run_task):
3770 Report user, sys and wall time.
3771 * Makefile.in: Regenerate.
3772 * config.in: Regenerate.
3773 * configure: Regenerate.
3774
3775 2009-12-16 Doug Kwan <dougkwan@google.com>
3776
3777 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
3778 sections.
3779 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
3780 relaxed input sections.
3781 * output.cc (Output_section::find_relaxed_input_section): Change
3782 return type to Output_relaxed_input_section pointer. Adjust code
3783 for new type of relaxed_input_section_map_.
3784 * output.h (Output_section::find_relaxed_input_section): Change
3785 return type to Output_relaxed_input_section pointer.
3786 (Output_section::Output_relaxed_input_section_by_input_section_map):
3787 New type.
3788 (Output_section::relaxed_input_section_map_): Change type to
3789 Output_section::Output_relaxed_input_section_by_input_section_map.
3790 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
3791 input section.
3792
3793 2009-12-15 Ian Lance Taylor <iant@google.com>
3794
3795 * layout.cc (Layout::create_shstrtab): Only write out after input
3796 sections if we are compressing debug sections.
3797
3798 2009-12-15 Ian Lance Taylor <iant@google.com>
3799
3800 * archive.cc (Archive::add_symbols): Only look up a symbol without
3801 a version if there is, in fact, a version.
3802
3803 2009-12-14 Ian Lance Taylor <iant@google.com>
3804
3805 Revert -Wshadow changes, all changes from:
3806 2009-12-11 Doug Kwan <dougkwan@google.com>
3807 2009-12-11 Nick Clifton <nickc@redhat.com>
3808 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
3809
3810 2009-12-11 Doug Kwan <dougkwan@google.com>
3811
3812 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
3813 due to -Wshadow.
3814 * attributes.cc (Object_attribute::size): Ditto.
3815 (Attributes_section_data::size): Ditto.
3816 (Attributes_section_data::Attributes_section_data): Ditto.
3817 (Output_attributes_section_data::do_write): Ditto.
3818 * attributes.h (Object_attribute::set_type): Ditto.
3819 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
3820
3821 2009-12-11 Nick Clifton <nickc@redhat.com>
3822
3823 * archive.cc: Fix shadowed variable warnings.
3824 * arm.cc: Likewise.
3825 * compressed_output.cc: Likewise.
3826 * compressed_output.h: Likewise.
3827 * configure: Likewise.
3828 * dwarf_reader.cc: Likewise.
3829 * dynobj.cc: Likewise.
3830 * dynobj.h: Likewise.
3831 * ehframe.cc: Likewise.
3832 * ehframe.h: Likewise.
3833 * errors.cc: Likewise.
3834 * expression.cc: Likewise.
3835 * fileread.cc: Likewise.
3836 * fileread.h: Likewise.
3837 * freebsd.h: Likewise.
3838 * i386.cc: Likewise.
3839 * icf.cc: Likewise.
3840 * incremental.h: Likewise.
3841 * layout.cc: Likewise.
3842 * layout.h: Likewise.
3843 * mapfile.cc: Likewise.
3844 * merge.cc: Likewise.
3845 * merge.h: Likewise.
3846 * object.cc: Likewise.
3847 * object.h: Likewise.
3848 * options.h: Likewise.
3849 * output.cc: Likewise.
3850 * output.h: Likewise.
3851 * parameters.cc: Likewise.
3852 * plugin.cc: Likewise.
3853 * powerpc.cc: Likewise.
3854 * reduced_debug_output.cc: Likewise.
3855 * reduced_debug_output.h: Likewise.
3856 * reloc.cc: Likewise.
3857 * reloc.h: Likewise.
3858 * resolve.cc: Likewise.
3859 * script-sections.cc: Likewise.
3860 * script.cc: Likewise.
3861 * script.h: Likewise.
3862 * sparc.cc: Likewise.
3863 * symtab.cc: Likewise.
3864 * symtab.h: Likewise.
3865 * target-select.cc: Likewise.
3866 * target-select.h: Likewise.
3867 * token.h: Likewise.
3868 * workqueue.cc: Likewise.
3869 * workqueue.h: Likewise.
3870 * x86_64.cc: Likewise.
3871
3872 2009-12-10 Doug Kwan <dougkwan@google.com>
3873
3874 * arm.cc (attributes.h): New include.
3875 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
3876 (Arm_relobj::~Arm_relobj): Delete object pointed by
3877 attributes_section_data_.
3878 (Arm_relobj::attributes_section_data): New method definition.
3879 (Arm_relobj::attributes_section_data_): New data member declaration.
3880 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
3881 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
3882 attributes_section_data_.
3883 (Arm_dynobj::attributes_section_data): New method definition.
3884 (Arm_dynobj::attributes_section_data_): New data member declaration.
3885 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
3886 initialization value of may_use_blx_ to false.
3887 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
3888 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
3889 object attributes to compute results instead of hard-coding.
3890 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
3891 Target_arm::get_secondary_compatible_arch,
3892 Target_arm::set_secondary_compatible_arch
3893 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3894 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
3895 New method declarations.
3896 (Target_arm::get_aeabi_object_attribute): New method definition.
3897 (Target_arm::attributes_section_data_): New data member declaration.
3898 (read_arm_attributes_section): New template definition.
3899 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
3900 (Arm_dynobj::do_read_symbols): Ditto.
3901 (Target_arm::do_finalize_sections): Merge attributes sections from
3902 input. Check for BLX use after attributes section merging.
3903 Fix __exidx_start and __exidx_end visibility. Create an
3904 .ARM.attributes section if necessary.
3905 (Target_arm::get_secondary_compatible_arch,
3906 Target_arm::set_secondary_compatible_arch,
3907 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3908 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
3909 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
3910 New method definitions.
3911
3912 2009-12-09 Ian Lance Taylor <iant@google.com>
3913
3914 * plugin.cc (Plugin::load): Don't cast from void* to a function
3915 pointer.
3916
3917 2009-12-09 Ian Lance Taylor <iant@google.com>
3918
3919 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
3920 information fields.
3921
3922 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
3923
3924 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
3925 Replace two_file_shared_1.so with two_file_shared_2.so.
3926 * testsuite/Makefile.in: Regenerated.
3927
3928 2009-12-08 Doug Kwan <dougkwan@google.com>
3929
3930 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
3931 (HFILES): Add attributes.h and int_encoding.h.
3932 * Makefile.in: Regenerate.
3933 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
3934 function definitions to int_encoding.cc
3935 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
3936 prototypes to int_encoding.h
3937 * reduced_debug_output.cc (int_encoding.h): New include.
3938 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
3939 function definitions to int_encoding.cc
3940 (insert_into_vector, read_from_pointer): Move template definitions to
3941 int_encoding.h
3942 * attributes.cc: New file.
3943 * attributes.h: New file.
3944 * int_encoding.cc: New file.
3945 * int_encoding.h: New file.
3946
3947 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
3948
3949 PR gold/11055
3950 * incremental-dump.cc (dump_incremental_inputs): New.
3951 (main): Use dump_incremental_inputs.
3952
3953 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
3954
3955 PR gold/10893
3956 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
3957 checking elfcpp::STT_FUNC.
3958 (Target_i386::Relocate::relocate): Likewise.
3959 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3960
3961 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
3962 symbols from shared libraries into normal FUNC symbols.
3963
3964 * symtab.h (Symbol): Add is_func and use it.
3965
3966 2009-12-05 Doug Kwan <dougkwan@google.com>
3967
3968 * arm.cc (Target_arm::arm_info): Initialize new fields
3969 attributes_section and attributes_vendor.
3970 * i386.cc (Target_i386::i386_info): Same.
3971 * object.cc (Sized_relobj::do_layout): Skip attribute section.
3972 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
3973 fields attributes_section and attributes_vendor.
3974 * sparc.cc (Target_sparc::sparc_info): Same.
3975 * target.h (Target::attributes_section, Target::attributes_vendor,
3976 Target::is_attributes_section, Target::attribute_arg_type,
3977 Target::attributes_order): New method definitions.
3978 (Target::Target_info::attributes_section,
3979 Target::Target_info::attributes_vendor): New fields.
3980 (Target::do_attribute_arg_type, Target::do_attributes_order): New
3981 virtual method definitions.
3982 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
3983 attributes_section and attributes_vendor.
3984 * testsuite/testfile.cc (Target_test::test_target_info): Same.
3985
3986 2009-12-05 Doug Kwan <dougkwan@google.com>
3987
3988 * arm.cc: Update comments about interworking and stub generation.
3989 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
3990 considered as non-PIC.
3991 (Arm_relocate_functions::base_abs): Fix formatting.
3992 (Arm_relocate_functions::got_prel): Fix comment. Change interface
3993 of function to use GOT entry address instead of offset.
3994 (Target_arm::Scan::global): Issue an error if a symbol would need a
3995 PLT does not get one because it is untyped. Remove code to create
3996 dynamic symbols for relative branches.
3997 (Target_arm::Relocate::relocate: Use 0 instead of false since function
3998 takes unsigned integer instead of boolean.
3999
4000 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
4001
4002 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
4003 (two_file_test_LDADD): Likewise.
4004 (common_test_1_LDADD): Likewise.
4005 (exception_test_LDADD) Likewise.
4006 (weak_test_LDADD): Likewise.
4007 (many_sections_test_LDADD): Likewise.
4008 (initpri1_LDADD): Likewise.
4009 (script_test_1_LDADD): Likewise.
4010 (script_test_2_LDADD): Likewise.
4011 (justsyms_LDADD): Likewise.
4012 (binary_test_LDADD): Likewise.
4013 (large_LDADD): Likewise.
4014 * testsuite/Makefile.in: Regenerated.
4015
4016 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
4017
4018 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
4019 (Symbol_table::override_with_special): Likewise.
4020 (Symbol_table::add_from_object): Likewise.
4021
4022 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
4023
4024 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4025 Don't set the data_offset twice.
4026
4027 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
4028
4029 * testsuite/Makefile.in: Regenerate.
4030
4031 2009-12-03 Doug Kwan <dougkwan@google.com>
4032
4033 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
4034 (Target_arm::do_finalize_sections): Add parameter for symbol table
4035 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
4036 * i386.cc (Target_i386::do_finalize_sections): Add an additional
4037 parameter for symbol table pointer.
4038 * layout.cc (Layout::finalize): Call Target::finalize_sections with
4039 an additional parameter for a pointer to symbol table.
4040 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
4041 parameter for a symbol table pointer.
4042 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
4043 * target.h (Target::finalize_sections, Target::do_finalize_sections):
4044 Ditto.
4045 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
4046 parameter for a symbol table pointer.
4047
4048 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
4049
4050 * incremental.cc (Incremental_inputs_header)
4051 (Incremental_inputs_header_write, Incremental_inputs_entry)
4052 (Incremental_inputs_entry_write): Move ...
4053 * incremental.h (Incremental_inputs_header)
4054 (Incremental_inputs_header_write, Incremental_inputs_entry)
4055 (Incremental_inputs_entry_write): here.
4056
4057 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4058
4059 * incremental.cc (make_sized_incremental_binary): Set the target.
4060 Error if it is incompatible.
4061 * output.h (Output_file): Add filename method.
4062
4063 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4064
4065 * incremental.cc (Incremental_inputs_entry): Remove unused argument
4066 from the get_* methods.
4067
4068 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4069
4070 * incremental-dump.cc (main): Check that the offeset of a script is 0.
4071 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4072 Write 0 for the data_offset of scripts.
4073
4074 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4075
4076 * testsuite/Makefile.am: Add the incremental_test.sh test.
4077 * testsuite/incremental_test.sh: New.
4078 * testsuite/incremental_test_1.c: New.
4079 * testsuite/incremental_test_2.c: New.
4080
4081 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
4082
4083 * incremental-dump.cc (main): Fix typos.
4084
4085 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
4086
4087 PR gold/11025
4088 * incremental-dump.cc (main): Use llu to print 64 bit values.
4089
4090 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
4091 H.J. Lu <hongjiu.lu@intel.com>
4092
4093 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
4094 $(LIBDL).
4095 (incremental_dump_LDADD): Likewise.
4096 * Makefile.in: Regenerated.
4097
4098 2009-11-25 Doug Kwan <dougkwan@google.com>
4099
4100 Revert:
4101
4102 2009-11-25 Doug Kwan <dougkwan@google.com>
4103
4104 * arm.cc (Target_arm::Target_arm): Move method definition
4105 outside of class definition. Add code to handle
4106 --target1-rel, --target1-abs and --target2= options.
4107 (Target_arm::get_reloc_reloc_type): Change method to be
4108 non-static and const.
4109 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
4110 New data member declaration.
4111 (Target_arm::Scan::local, Target_arm::Scan::global,
4112 Target_arm::Relocate::relocate,
4113 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4114 Adjust call to Target_arm::get_real_reloc_type.
4115 (Target_arm::get_real_reloc_type): Use command line options
4116 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4117 * options.h (--target1-rel, --target1-abs, --target2): New
4118 ARM-only options.
4119
4120 2009-11-25 Doug Kwan <dougkwan@google.com>
4121
4122 * arm.cc (Target_arm::Target_arm): Move method definition outside of
4123 class definition. Add code to handle --target1-rel, --target1-abs
4124 and --target2= options.
4125 (Target_arm::get_reloc_reloc_type): Change method to be non-static
4126 and const.
4127 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
4128 member declaration.
4129 (Target_arm::Scan::local, Target_arm::Scan::global,
4130 Target_arm::Relocate::relocate,
4131 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
4132 call to Target_arm::get_real_reloc_type.
4133 (Target_arm::get_real_reloc_type): Use command line options to
4134 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4135 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
4136 options.
4137
4138 2009-11-25 Doug Kwan <dougkwan@google.com>
4139
4140 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
4141 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
4142 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
4143 formatting.
4144 (Arm_relocate_functions::thm_call): Replace body with a call to
4145 Arm_relocate_functions::thumb_branch_common.
4146 (Arm_relocate_functions::thm_jump24,
4147 Arm_relocate_functions::thm_xpc22): New method definitions.
4148 (Arm_relocate_functions::thumb_branch_common): New method definition.
4149 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
4150 operator.
4151 (Target_arm::Relocate::relocate): Adjust call to thm_call.
4152 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
4153
4154 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4155
4156 * Makefile.am: Build incremental-dump
4157 * Makefile.in: Regenerate.
4158 * incremental-dump.cc: New.
4159 * incremental.cc (Incremental_inputs_header_data,
4160 Incremental_inputs_entry_data): Move to incremental.h
4161 * incremental.h: (Incremental_inputs_header_data,
4162 Incremental_inputs_entry_data): Move from incremental.cc
4163
4164 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4165
4166 * incremental.cc (Incremental_inputs_header,
4167 Incremental_inputs_header_write, Incremental_inputs_entry,
4168 Incremental_inputs_entry_write): Add a typedef with the data type.
4169
4170 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4171
4172 * incremental.cc (Incremental_inputs_header,
4173 Incremental_inputs_header_write, Incremental_inputs_entry,
4174 Incremental_inputs_entry_write): Update comment about which
4175 type has the filed descriptions.
4176
4177 2009-11-15 Doug Kwan <dougkwan@google.com>
4178
4179 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
4180 (Arm_relocate_functions::arm_branch_common): Change method defintion
4181 in class definition to a method declaration and update list of formal
4182 parameters.
4183 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
4184 Arm_relocation_functions::jump24): Adjust call to
4185 Arm_relocate_functions::arm_branch_common. Update list of formal
4186 parameters.
4187 (Arm_relocate_functions::xpc25): New method definition.
4188 (Arm_relocate_functions::arm_branch_common): Move method defintion
4189 out from class definition. Use stubs for mode-switching and extending
4190 branch ranges.
4191 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
4192 specially. Change code to enable use of stubs in ARM branches.
4193
4194 2009-11-10 Doug Kwan <dougkwan@google.com>
4195
4196 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
4197 in method declaration.
4198 (Target_arm::relocate_stub): New method declaration.
4199 (Target_arm::default_target): Change to return a pointer instead of
4200 a const reference.
4201 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
4202 Target_arm::default_target.
4203 (Arm_Relobj::do_relocate_sections): Remove options paramater in
4204 method definition.
4205 (Target_arm::relocate_section): Adjust view.
4206 (Target_arm::relocate_stub): New method definition.
4207
4208 2009-11-10 Doug Kwan <dougkwan@google.com>
4209
4210 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
4211 a format warning.
4212 * incremental.cc (open_incremental_binary): Initialized local
4213 variables to avoid warnings.
4214 * object.cc (make_elf_object): Ditto.
4215 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
4216 a format warning.
4217
4218 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
4219
4220 PR gold/10930
4221 * testsuite/plugin_test.c: Include "config.h".
4222
4223 2009-11-09 Doug Kwan <dougkwan@google.com>
4224
4225 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
4226 (arm_symbol_value): Remove.
4227 (Arm_relocate_functions::arm_branch_common,
4228 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
4229 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
4230 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
4231 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
4232 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
4233 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
4234 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
4235 Arm_relocate_functions::thm_mobw_abs_nc,
4236 Arm_relocate_functions::thm_mov_abs,
4237 Arm_relocate_functions::movw_prel_nc,
4238 Arm_relocate_functions::thm_movt_abs,
4239 Arm_relocate_functions::movt_prel,
4240 Arm_relocate_functions::thm_movw_prel_nc,
4241 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
4242 (Target_arm::Relocate::relocate): Only decompose address into two
4243 parts if relocation type uses the thumb-bit and pass the actual
4244 bit instead of a flag indicating that the thumb-bit is used. Adjust
4245 calls to methods in Arm_relocate_functions for this change.
4246
4247 2009-11-08 Ian Lance Taylor <iant@google.com>
4248
4249 PR 10925
4250 * reloc.cc: Instantiate
4251 Sized_relobj::initialize_input_to_output_maps and
4252 Sized_relobj:free_input_to_output_maps.
4253
4254 2009-11-06 Ian Lance Taylor <iant@google.com>
4255
4256 PR 10876
4257 * defstd.cc (in_segment): Set only_if_ref true for "end".
4258
4259 2009-11-06 Doug Kwan <dougkwan@google.com>
4260
4261 * arm.cc (class Reloc_stub): Correct a comment.
4262 (Target_arm::Target_arm): Initialize arm_input_section_map_.
4263 (Target_arm::scan_section_for_stubs): New method declaration.
4264 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
4265 Change methods from private to protected.
4266 (Target_arm::do_may_relax): New method definition.
4267 (Target_arm::do_relax, Target_arm::group_sections,
4268 Target_arm::scan_reloc_for_stub,
4269 Target_arm::scan_reloc_section_for_stubs): New method declarations.
4270 (Target_arm::arm_input_section_map_): New data member declaration.
4271 (Target_arm::scan_reloc_for_stub,
4272 Target_arm::scan_reloc_section_for_stubs,
4273 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
4274 Target_arm::do_relax): New method definitions.
4275
4276 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
4277
4278 * configure.ac: Check for (struct stat)::st_mtim
4279 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
4280 * config.in: Regenerate.
4281 * configure: Regenerate.
4282
4283 2009-11-05 Ian Lance Taylor <iant@google.com>
4284
4285 PR 10910
4286 * output.cc (Output_segment::add_output_section): Add missing
4287 return statement.
4288
4289 2009-11-04 Ian Lance Taylor <iant@google.com>
4290
4291 PR 10880
4292 * object.h (class Object): Add is_needed and set_is_needed
4293 methods. Add is_needed_ field. Make bool fields into bitfields.
4294 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
4295 defined in a dynamic object and referenced by a regular object,
4296 set is_needed for the dynamic object.
4297 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
4298 if the file is marked with as_needed and it is not needed.
4299
4300 2009-11-04 Ian Lance Taylor <iant@google.com>
4301
4302 PR 10887
4303 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
4304 tags if data is discarded by linker script.
4305 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4306 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4307 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4308 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4309
4310 2009-11-04 Ian Lance Taylor <iant@google.com>
4311
4312 * layout.cc (Layout::get_output_section): Add is_interp and
4313 is_dynamic_linker_section parameters. Change all callers.
4314 (Layout::choose_output_section): Likewise.
4315 (Layout::make_output_section): Likewise.
4316 (Layout::add_output_section_data): Add is_dynamic_linker_section
4317 parameter. Change all callers.
4318 * layout.h (class Layout): Update declarations.
4319 * output.h (class Output_section): Add is_interp, set_is_interp,
4320 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
4321 Add is_interp_, is_dynamic_linker_section_ fields. Change
4322 generate_code_fills_at_write_ to a bitfield.
4323 * output.cc (Output_section::Output_sections): Initialize new
4324 fields.
4325 (Output_segment::add_output_section): Add do_sort parameter.
4326 Change all callers.
4327
4328 2009-11-03 Ian Lance Taylor <iant@google.com>
4329
4330 PR 10860
4331 * options.h (class General_options): Add --warn-common.
4332 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
4333 merging two common symbols.
4334 (Symbol_table::should_override): Handle --warn-common when merging
4335 a common symbol with a defined symbol. Use report_resolve_problem
4336 for multiple definitions.
4337 (Symbol_table::report_resolve_problem): New function.
4338 * symtab.h (class Symbol_table): Declare report_resolve_problem.
4339
4340 2009-11-03 Doug Kwan <dougkwan@google.com>
4341
4342 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
4343 stub_factory_.
4344 (Target_arm::stub_factory): New method definition.
4345 (Target_arm::new_arm_input_section,
4346 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
4347 Target_arm::reloc_uses_thumb_bit): New method declarations.
4348 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
4349 New type definitions.
4350 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
4351 member declarations.
4352 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
4353 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
4354 New method definitions.
4355
4356 2009-11-03 Ian Lance Taylor <iant@google.com>
4357
4358 * options.h (class General_options): Add --warn_constructors.
4359
4360 2009-11-03 Ian Lance Taylor <iant@google.com>
4361
4362 PR 10893
4363 * defstd.cc (in_section): Add entries for __rel_iplt_start,
4364 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
4365
4366 2009-11-03 Ian Lance Taylor <iant@google.com>
4367
4368 PR 10895
4369 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
4370 --msgid-bugs-address.
4371 (install-pdf): New target.
4372 (install-data_yes): Look up one directory to find mkinstalldirs.
4373
4374 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
4375
4376 * po/Make-in (.po.gmo): Don't generate .gmo files in source
4377 tree.
4378
4379 2009-10-30 Doug Kwan <dougkwan@google.com>
4380
4381 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
4382
4383 2009-10-30 Doug Kwan <dougkwan@google.com>
4384
4385 * arm.cc (Stub_addend_reader): New struct template definition
4386 and partial specializations.
4387 (Stub_addend_reader::operator()): New method definition for a
4388 partially specialized template.
4389
4390 2009-10-30 Doug Kwan <dougkwan@google.com>
4391
4392 * arm.cc (Arm_relobj::processor_specific_flags): New method
4393 definition.
4394 (Arm_relobj::do_read_symbols): New method declaration.
4395 (Arm_relobj::processor_specific_flags_): New data member declaration.
4396 (Arm_dynobj): New class definition.
4397 (Target_arm::do_finalize_sections): Add input_objects parameter.
4398 (Target_arm::do_adjust_elf_header): New method declaration.
4399 (Target_arm::are_eabi_versions_compatible,
4400 (Target_arm::merge_processor_specific_flags): New method declaration.
4401 (Target_arm::do_make_elf_object): New overloaded method definitions
4402 and declaration.
4403 (Arm_relobj::do_read_symbols): New method definition.
4404 (Arm_dynobj::do_read_symbols): Ditto.
4405 (Target_arm::do_finalize_sections): Add input_objects parameters.
4406 Merge processor-specific flags from all input objects.
4407 (Target_arm::are_eabi_versions_compatible,
4408 Target_arm::merge_processor_specific_flags,
4409 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
4410 New method definitions.
4411 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
4412 Input_objects pointer type parameter.
4413 * layout.cc (Layout::finalize): Pass input objects to target's.
4414 finalize_sections function.
4415 * output.cc (Output_file_header::do_sized_write): Set ELF file
4416 header's processor-specific flags.
4417 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
4418 Input_objects pointer type parameter.
4419 * sparc.cc (Target_sparc::do_finalize_sections): Same.
4420 * target.h (Input_objects): New forward class declaration.
4421 (Target::processor_specific_flags,
4422 Target::are_processor_specific_flags_sect): New method definitions.
4423 (Target::finalize_sections): Add input_objects parameter.
4424 (Target::Target): Initialize processor_specific_flags_ and
4425 are_processor_specific_flags_set_.
4426 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
4427 parameter.
4428 (Target::set_processor_specific_flags): New method definition.
4429 (Target::processor_specific_flags_,
4430 Target::are_processor_specific_flags_set_): New data member
4431 declarations.
4432 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
4433 Input_objects pointer type parameter.
4434
4435 2009-10-30 Doug Kwan <dougkwan@google.com>
4436
4437 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
4438
4439 2009-10-28 Ian Lance Taylor <iant@google.com>
4440
4441 * object.h (class Relobj): Drop options parameter from
4442 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
4443 do_scan_relocs, do_relocate. Change all callers.
4444 (class Sized_relobj): Drop options parameters from
4445 do_gc_process_relocs, do_scan_relocs, do_relocate,
4446 do_relocate_sections, relocate_sections, emit_relocs_scan,
4447 emit_relocs_scan_reltype. Change all callers.
4448 (struct Relocate_info): Remove options field and all references to
4449 it.
4450 * reloc.h (class Read_relocs): Remove options constructor
4451 parameter and options_ field. Change all callers.
4452 (class Gc_process_relocs, class Scan_relocs): Likewise.
4453 (class Relocate_task): Likewise.
4454 * target-reloc.h (scan_relocs): Remove options parameter. Change
4455 all callers.
4456 (scan_relocatable_relocs): Likewise.
4457 * target.h (class Sized_target): Remove options parameter from
4458 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
4459 all callers.
4460 * gc.h (gc_process_relocs): Remove options parameter. Change all
4461 callers.
4462 * arm.cc: Update functions to remove options parameters.
4463 * i386.cc: Likewise.
4464 * powerpc.cc: Likewise.
4465 * sparc.cc: Likewise.
4466 * x86_64.cc: Likewise.
4467 * testsuite/testfile.cc: Likewise.
4468
4469 2009-10-28 Doug Kwan <dougkwan@google.com>
4470
4471 * arm.cc (Arm_relobj): New class definition.
4472 (Arm_relobj::scan_sections_for_stubs,
4473 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
4474 New method definitions.
4475
4476 2009-10-28 Cary Coutant <ccoutant@google.com>
4477
4478 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
4479 (Plugin::cleanup_done_): New member.
4480 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
4481 (Plugin_manager::cleanup_done_): Remove.
4482 (Plugin_manager::add_input_file): Edit error message.
4483 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
4484 (Plugin_manager::cleanup): Remove use of cleanup_done_.
4485
4486 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
4487
4488 * fileread.cc: (File_read::View::~View): Use the new
4489 data_ownership_ filed.
4490 (File_read::~File_read): Dispose the new whole_file_view_.
4491 (File_read::open): Mmap the whole file if needed.
4492 (File_read::open): Use whole_file_view_ instead of contents_.
4493 (File_read::find_view): Use whole_file_view_ if applicable.
4494 (File_read::do_read): Use whole_file_view_ instead of contents_.
4495 (File_read::make_view): Use whole_file_view_ instead of contents_,
4496 update File_read::View::View call.
4497 (File_read::find_or_make_view): Update File_read::View::View
4498 call.
4499 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
4500 remove contents_
4501 (File_read::View::Data_ownership): New enum.
4502 (File_read::View::View): Replace bool mapped_ with Data_ownership
4503 argument.
4504 (File_read::View::mapped_): Remove (replaced by data_ownership_).
4505 (File_read::View::data_ownership_): New field.
4506 (File_read::contents_): Remove (replaced by whole_file_view_).
4507 (File_read::whole_file_view_): New field.
4508 * options.h (class General_options): Add --keep-files-mapped.
4509
4510 2009-10-27 Cary Coutant <ccoutant@google.com>
4511
4512 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
4513 * testsuite/Makefile.am (plugin_test_5): New test case.
4514 * testsuite/Makefile.in: Regenerate.
4515
4516 2009-10-25 Doug Kwan <dougkwan@google.com>
4517
4518 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
4519 from private to protected to allow access by child class.
4520 (Sized_relobj::do_relocate_sections): New method declaration.
4521 (Sized_relobj::relocate_sections): Virtualize.
4522 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
4523 Sized_relobj::relocate_sections. Instantiate template explicitly
4524 for different target sizes and endianity.
4525
4526 2009-10-24 Doug Kwan <dougkwan@google.com>
4527
4528 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
4529 (Arm_input_section::as_arm_input_section): New method.
4530 (Arm_output_section): New class definition.
4531 (Arm_output_section::create_stub_group,
4532 Arm_output_section::group_sections): New method definitions.
4533
4534 2009-10-22 Doug Kwan <dougkwan@google.com>
4535
4536 * arm.cc (Arm_input_section): New class definition.
4537 (Arm_input_section::init, Arm_input_section:do_write,
4538 Arm_input_section::set_final_data_size,
4539 Arm_input_section::do_reset_address_and_file_offset): New method
4540 definitions.
4541
4542 2009-10-21 Doug Kwan <dougkwan@google.com>
4543
4544 * arm.cc (Stub_table, Arm_input_section): New forward class
4545 declarations.
4546 (Stub_table): New class defintion.
4547 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
4548 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
4549 New method definition.
4550
4551 2009-10-21 Doug Kwan <dougkwan@google.com>
4552
4553 * arm.cc: Update copyright comments.
4554 (Target_arm): New forward class template declaration.
4555 (Arm_address): New type.
4556 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
4557 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
4558 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
4559 constants.
4560 (Insn_template): Same.
4561 (DEF_STUBS): New macro.
4562 (Stub_type): New enum type.
4563 (Stub_template): New class definition.
4564 (Stub): Same.
4565 (Reloc_stub): Same.
4566 (Stub_factory): Same.
4567 (Target_arm::Target_arm): Initialize may_use_blx_ and
4568 should_force_pic_veneer_.
4569 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
4570 Target_arm::should_force_pic_veneer,
4571 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
4572 Target_arm::using_thumb_only, Target_arm:;default_target): New
4573 method defintions.
4574 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
4575 New data member declarations.
4576 (Insn_template::size, Insn_template::alignment): New method defintions.
4577 (Stub_template::Stub_template): New method definition.
4578 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
4579 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
4580 (Stub_factory::Stub_factory): New method definition.
4581 * gold.h (string_hash): New template.
4582 * output.h (Input_section_specifier::hash_value): Use
4583 gold::string_hash.
4584 (Input_section_specifier::string_hash): Remove.
4585 * stringpool.cc (Stringpool_template::string_hash): Use
4586 gold::string_hash.
4587
4588 2009-10-20 Doug Kwan <dougkwan@google.com>
4589
4590 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
4591 symbols of relaxed input sections.
4592 * output.h (Output_section::find_relaxed_input_section): Make
4593 method public.
4594
4595 2009-10-16 Doug Kwan <dougkwan@google.com>
4596
4597 * dynobj.cc (Versions::Versions): Initialize version_script_.
4598 Only insert base version symbol definition for a shared object
4599 if version script defines any version versions.
4600 (Versions::define_base_version): New method definition.
4601 (Versions::add_def): Check that base version is not needed.
4602 (Versions::add_need): Define base version lazily.
4603 * dynobj.h (Versions::define_base_version): New method declaration.
4604 (Versions::needs_base_version_): New data member declaration.
4605 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
4606 (check_DATA): Add no_version_test.stdout.
4607 (libno_version_test.so, no_version_test.o no_version_test.stdout):
4608 New make rules.
4609 * testsuite/Makefile.in: Regenerate.
4610 * testsuite/no_version_test.c: New file.
4611 * testsuite/no_version_test.sh: Ditto.
4612
4613 2009-10-16 Doug Kwan <dougkwan@google.com>
4614
4615 * expression.cc (class Segment_start_expression): New class definition.
4616 (Segment_start_expression::value): New method definition.
4617 (script_exp_function_segment_start): Return a new
4618 Segment_start_expression.
4619 * gold/script-c.h (script_saw_segment_start_expression): New function
4620 prototype.
4621 * script-sections.cc (Script_sections::Script_sections): Initialize
4622 SAW_SEGMENT_START_EXPRESSION_ to false.
4623 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
4624 and -Tbbs options to specify section addresses if given in
4625 command line and no SEGMENT_START expression is seen in a script.
4626 * script-sections.h (Script_sections::saw_segment_start_expression,
4627 Script_sections::set_saw_segment_start_expression): New method
4628 definition.
4629 (Script_sections::saw_segment_start_expression_): New data member
4630 declaration.
4631 * script.cc (script_saw_segment_start_expression): New function.
4632 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
4633 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
4634 script_test_7.sh and script_test_8.sh.
4635 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
4636 script_test_8.stdout.
4637 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
4638 (script_test_6, script_test_6.stdout, script_test_7,
4639 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
4640 * Makefile.in: Regenerate.
4641 * testsuite/script_test_6.sh: New file.
4642 * testsuite/script_test_6.t: Same.
4643 * testsuite/script_test_7.sh: Same.
4644 * testsuite/script_test_7.t: Same.
4645 * testsuite/script_test_8.sh: Same.
4646
4647 2009-10-16 Doug Kwan <dougkwan@google.com>
4648
4649 * output.cc (Output_segment::set_section_list_address): Cast
4650 expressions to unsigned long long type to avoid format warnings.
4651
4652 2009-10-15 Ian Lance Taylor <iant@google.com>
4653
4654 * script.cc (Script_options::add_symbol_assignment): Always add a
4655 dot assignment to script_sections_.
4656 * script-sections.cc (Script_sections::add_dot_assignment):
4657 Initialize if necessary.
4658
4659 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
4660 program headers with no load segment if there is a linker script.
4661
4662 * layout.cc (Layout::set_segment_offsets): Align the file offset
4663 to the segment aligment for -N or -n with no load segment.
4664 * output.cc (Output_segment::add_output_section): Don't crash if
4665 the first section is a TLS section.
4666 (Output_segment::set_section_list_addresses): Print an error
4667 message if the address moves backward in a linker script.
4668 * script-sections.cc
4669 (Output_section_element_input::set_section_addresses): Don't
4670 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
4671 (Orphan_output_section::set_section_addresses): Likewise.
4672
4673 2009-10-15 Doug Kwan <dougkwan@google.com>
4674
4675 * layout.cc (Layout::finish_dynamic_section): Generate tags
4676 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
4677 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
4678 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
4679
4680 2009-10-14 Ian Lance Taylor <iant@google.com>
4681
4682 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
4683 fields.
4684 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
4685 data_shdr fields of relinfo.
4686 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
4687 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
4688 R_386_TLS_LDO_32, adjust based on section flags.
4689 (Target_i386::Relocate::fix_up_ldo): Remove.
4690
4691 2009-10-13 Ian Lance Taylor <iant@google.com>
4692
4693 Add support for -pie.
4694 * options.h (class General_options): Add -pie and
4695 --pic-executable.
4696 (General_options::output_is_position_independent): Test -pie.
4697 (General_options::output_is_executable): Return true if not shared
4698 and not relocatable.
4699 (General_options::output_is_pie): Remove.
4700 * options.cc (General_options::finalize): Reject incompatible uses
4701 of -pie.
4702 * gold.cc (queue_middle_tasks): A -pie link is not static.
4703 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
4704 * symtab.cc (Symbol::final_value_is_known): Return false if
4705 output_is_position_independent.
4706 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
4707 output_is_position_independent.
4708 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
4709 output_is_position_independent.
4710 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
4711 output_is_position_independent.
4712 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
4713 two_file_pie_test.
4714 (basic_pie_test.o, basic_pie_test): New targets.
4715 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
4716 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
4717 (two_file_pie_test): New target.
4718 * testsuite/Makefile.in: Rebuild.
4719 * README: Remove note saying that -pie is not supported.
4720
4721 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
4722
4723 * options.h (class General_options): Add -init and -fini.
4724 * layout.cc (Layout::finish_dynamic_section): Emit
4725 given init and fini functions.
4726
4727 2009-10-13 Sriraman Tallam <tmsriram@google.com>
4728
4729 * gc.h (gc_process_relocs): Check if icf is enabled using new
4730 function.
4731 * gold.cc (queue_initial_tasks): Likewise.
4732 (queue_middle_tasks): Likewise.
4733 * object.cc (do_layout): Likewise.
4734 * symtab.cc (is_section_folded): Likewise.
4735 * main.cc (main): Likewise.
4736 * reloc.cc (Read_relocs::run): Likewise.
4737 (Sized_relobj::do_scan_relocs): Likewise.
4738 * icf.cc (is_function_ctor_or_dtor): New function.
4739 (Icf::find_identical_sections): Check if function is ctor or dtor when
4740 safe icf is chosen.
4741 * options.h (General_options::icf): Change option to be an enum.
4742 (Icf_status): New enum.
4743 (icf_enabled): New method.
4744 (icf_safe_folding): New method.
4745 (set_icf_status): New method.
4746 (icf_status_): New variable.
4747 * (options.cc) (General_options::finalize): Set icf_status_.
4748 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
4749 icf_test and icf_keep_unique_test to use the --icf enum flag.
4750 * testsuite/icf_safe_test.sh: New file.
4751 * testsuite/icf_safe_test.cc: New file.
4752
4753 2009-10-12 Sriraman Tallam <tmsriram@google.com>
4754
4755 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
4756 includes to gc.h and icf.h.
4757 * arm.cc: Include gc.h.
4758 * gold.cc: Likewise.
4759 * i386.cc: Likewise.
4760 * powerpc.cc: Likewise.
4761 * sparc.cc: Likewise.
4762 * x86_64.cc: Likewise.
4763 * gc.h: Include icf.h.
4764
4765 2009-10-11 Ian Lance Taylor <iant@google.com>
4766
4767 * plugin.cc: Include "gold.h" before other header files.
4768
4769 2009-10-10 Chris Demetriou <cgd@google.com>
4770
4771 * options.h (Input_file_argument::Input_file_type): New enum.
4772 (Input_file_argument::is_lib_): Replace with...
4773 (Input_file_argument::type_): New member.
4774 (Input_file_argument::Input_file_argument): Take Input_file_type
4775 'type' rather than boolean 'is_lib' as second argument.
4776 (Input_file_argument::is_lib): Use type_.
4777 (Input_file_argument::is_searched_file): New function.
4778 (Input_file_argument::may_need_search): Handle is_searched_file.
4779 * options.cc (General_options::parse_library): Support -l:filename.
4780 (General_options::parse_just_symbols): Update for Input_file_argument
4781 changes.
4782 (Command_line::process): Likewise.
4783 * archive.cc (Archive::get_file_and_offset): Likewise.
4784 * plugin.cc (Plugin_manager::release_input_file): Likewise.
4785 * script.cc (read_script_file, script_add_file): Likewise.
4786 * fileread.cc (Input_file::Input_file): Likewise.
4787 (Input_file::will_search_for): Handle is_searched_file.
4788 (Input_file::open): Likewise.
4789 * readsyms.cc (Read_symbols::get_name): Likewise.
4790 * testsuite/Makefile.am (searched_file_test): New test.
4791 * testsuite/Makefile.in: Regenerate.
4792 * testsuite/searched_file_test.cc: New file.
4793 * testsuite/searched_file_test_lib.cc: New file.
4794
4795 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4796 Ian Lance Taylor <iant@google.com>
4797
4798 * descriptor.cc: Include <cstdio> and "binary-io.h".
4799 (Descriptors::open): Open the files in binary mode always.
4800 * script.cc (Lex::get_token): Treat \r as whitespace.
4801
4802 2009-10-09 Ian Lance Taylor <iant@google.com>
4803
4804 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
4805
4806 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4807 Ian Lance Taylor <iant@google.com>
4808
4809 * configure.ac: Check for readv function also.
4810 * fileread.cc (readv): Define if not HAVE_READV.
4811 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
4812 does not exist.
4813 * config.in: Regenerate.
4814 * configure: Regenerate.
4815
4816 2009-10-09 Doug Kwan <dougkwan@google.com>
4817
4818 * layout.cc (Layout::make_output_section): Call target hook to make
4819 ordinary output section.
4820 (Layout::finalize): Adjust parameter list of call the
4821 Target::may_relax().
4822 * layout.h (class Layout::section_list): New method.
4823 * merge.h (Output_merge_base::entsize): Change visibility to public.
4824 (Output_merge_base::is_string, Output_merge_base::do_is_string):
4825 New methods.
4826 (Output_merge_string::do_is_string): New method.
4827 * object.cc (Sized_relobj::do_setup): renamed from
4828 Sized_relobj::set_up.
4829 * object.h (Sized_relobj::adjust_shndx,
4830 Sized_relobj::initializ_input_to_output_maps,
4831 Sized_relobj::free_input_to_output_maps): Change visibilities to
4832 protected.
4833 (Sized_relobj::setup): Virtualize.
4834 (Sized_relobj::do_setup): New method declaration.
4835 (Sized_relobj::invalidate_section_offset,
4836 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
4837 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
4838 * options.cc (parse_int): New function.
4839 * options.h (parse_int): New declaration.
4840 (DEFINE_int): New macro.
4841 (stub_group_size): New option.
4842 * output.cc (Output_section::Output_section): Initialize memebers
4843 merge_section_map_, merge_section_by_properties_map_,
4844 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
4845 (Output_section::add_input_section): Handled deferred code-fill
4846 generation and remove an old comment.
4847 (Output_section::add_relaxed_input_section): New method definition.
4848 (Output_section::add_merge_input_section): Use merge section by
4849 properties map to speed to search. Update merge section maps
4850 as appropriate.
4851 (Output_section::build_relaxation_map): New method definition.
4852 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4853 Same.
4854 (Output_section::relax_input_section): Renamed to
4855 Output_section::convert_input_sections_to_relaxed_sections and change
4856 interface to take a vector of pointers to relaxed sections.
4857 (Output_section::find_merge_section,
4858 Output_section::find_relaxed_input_section): New method definitions.
4859 (Output_section::is_input_address_mapped,
4860 Output_section::output_offset, Output_section::output_address):
4861 Use output section data maps to speed up searching.
4862 (Output_section::find_starting_output_address): Add comments.
4863 (Output_section::do_write,
4864 Output_section::write_to_postprocessing_buffer): Do code-fill
4865 generation as appropriate.
4866 (Output_section::get_input_sections): Invalidate relaxed input section
4867 map.
4868 (Output_section::restore_states): Adjust type of checkpoint .
4869 Invalidate relaxed input section map.
4870 * output.h (Output_merge_base): New class declaration.
4871 (Input_section_specifier): New class defintion.
4872 (class Output_relaxed_input_section) Change base class to
4873 Output_section_data_build.
4874 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
4875 base class initializer.
4876 (Output_section::add_relaxed_input_section): New method declaration.
4877 (Output_section::Input_section): Change visibility to protected.
4878 (Output_section::Input_section::relobj,
4879 Output_section::Input_section::shndx): Handle relaxed input sections.
4880 Output_section::input_sections) Change visibility to protected. Also
4881 define overload to return a non-const pointer.
4882 (Output_section::Merge_section_properties): New class defintion.
4883 (Output_section::Merge_section_by_properties_map,
4884 Output_section::Output_section_data_by_input_section_map,
4885 Output_section::Relaxation_map): New types.
4886 (Output_section::relax_input_section): Rename method to
4887 Output_section::convert_input_sections_to_relaxed_sections and change
4888 interface to take a vector of relaxed section pointers.
4889 (Output_section::find_merge_section,
4890 Output_section::find_relaxed_input_section,
4891 Output_section::build_relaxation_map,
4892 Output_section::convert_input_sections_in_list_to_relaxed_sections):
4893 New method declarations.
4894 (Output_section::merge_section_map_
4895 Output_section::merge_section_by_properties_map_,
4896 Output_section::relaxed_input_section_map_,
4897 Output_section::is_relaxed_input_section_map_valid_,
4898 Output_section::generate_code_fills_at_write_): New data members.
4899 * script-sections.cc
4900 (Output_section_element_input::set_section_addresses): Call
4901 current_data_size and addralign methods of relaxed input sections.
4902 (Orphan_output_section::set_section_addresses): Call current_data_size
4903 and addralign methods of relaxed input sections.
4904 * symtab.cc (Symbol_table::compute_final_value): Extract template
4905 from the body of Symbol_table::sized_finalize_symbol.
4906 (Symbol_table::sized_finalized_symbol): Call
4907 Symbol_table::compute_final_value.
4908 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
4909 (Symbol_table::compute_final_value): New templated method declaration.
4910 * target.cc (Target::do_make_output_section): New method defintion.
4911 * target.h (Target::make_output_section): New method declaration.
4912 (Target::relax): Add more parameters for input objects, symbol table
4913 and layout. Adjust call to do_relax.
4914 (Target::do_make_output_section): New method declaration.
4915 (Target::do_relax): Add parameters for input objects, symbol table
4916 and layout.
4917
4918 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4919
4920 * pread.c: Include stdio.h.
4921
4922 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4923
4924 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
4925 defined.
4926
4927 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4928
4929 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4930 Change read_shndx type to unsigned int.
4931 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4932 int.
4933 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4934 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
4935 Change read_shndx type to unsigned int.
4936 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4937 int.
4938 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4939 * layout.cc (Layout::create_symtab_sections): Cast the result of
4940 local_symcount * symsize to off_t in the gold_assert.
4941
4942 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4943
4944 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
4945 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
4946 R_ARM_BASE_ABS.
4947 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
4948 (Arm_relocate_functions::thm_abs5): New function.
4949 (Arm_relocate_functions::abs12): New function.
4950 (Arm_relocate_functions::abs16): New function.
4951 (Arm_relocate_functions::base_abs): New function.
4952 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
4953 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
4954 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
4955 R_ARM_BASE_ABS.
4956 (Scan::global): Likewise.
4957 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
4958 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
4959 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
4960 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
4961 R_ARM_BASE_ABS.
4962
4963 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4964
4965 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
4966 (Arm_relocate_functions::movt_prel): New function.
4967 (Arm_relocate_functions::thm_movw_prel_nc): New function.
4968 (Arm_relocate_functions::thm_movt_prel): New function.
4969 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
4970 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
4971 (Scan::global, Relocate::relocate): Likewise.
4972 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4973
4974 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
4975
4976 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
4977 Incremental_checker.
4978 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
4979 unsigned int.
4980 (class Incremental_inputs_header): New class.
4981 (Incremental_inputs_header_writer): Edit comment.
4982 (Incremental_inputs_entry): New class.
4983 (Incremental_inputs_entry_writer): Edit comment.
4984 (Sized_incremental_binary::do_find_incremental_inputs_section):
4985 Add *strtab_shndx parameter, fill it.
4986 (Sized_incremental_binary::do_check_inputs): New method.
4987 (Incremental_checker::can_incrementally_link_output_file): Use
4988 Sized_incremental_binary::check_inputs.
4989 (Incremental_inputs::report_command_line): Save command line in
4990 command_line_.
4991 * incremental.h:
4992 (Incremental_binary::find_incremental_inputs_section): New
4993 method.
4994 (Incremental_binary::do_find_incremental_inputs_section): Add
4995 strtab_shndx parameter.
4996 (Incremental_binary::do_check_inputs): New pure virtual method.
4997 (Sized_incremental_binary::do_check_inputs): Declare.
4998 (Incremental_checker::Incremental_checker): Add incremental_inputs
4999 parameter, use it to initialize incremental_inputs_.
5000 (Incremental_checker::incremental_inputs_): New field.
5001 (Incremental_checker::command_line): New method.
5002 (Incremental_checker::inputs): New method.
5003 (Incremental_checker::command_line_): New field.
5004
5005 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
5006
5007 * incremental.cc: Include <cstdarg> and "target-select.h".
5008 (vexplain_no_incremental): New function.
5009 (explain_no_incremental): New function.
5010 (Incremental_binary::error): New method.
5011 (Sized_incremental_binary::do_find_incremental_inputs_section): New
5012 method.
5013 (make_sized_incremental_binary): New function.
5014 (open_incremental_binary): New function.
5015 (can_incrementally_link_file): Add checks if output is ELF and has
5016 inputs section.
5017 * incremental.h: Include "elfcpp_file.h" and "output.h".
5018 (Incremental_binary): New class.
5019 (Sized_incremental_binary): New class.
5020 (open_incremental_binary): Declare.
5021 * object.cc (is_elf_object): Use
5022 elfcpp::Elf_recognizer::is_elf_file.
5023 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
5024 * output.h (Output_file::filesize): New method.
5025
5026 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5027
5028 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
5029 New function.
5030 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
5031 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
5032 function.
5033 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
5034 function.
5035 (Arm_relocate_functions::movw_abs_nc): New function.
5036 (Arm_relocate_functions::movt_abs): New function.
5037 (Arm_relocate_functions::thm_movw_abs_nc): New function.
5038 (Arm_relocate_functions::thm_movt_abs): New function.
5039 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
5040 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
5041 (Scan::global): Likewise.
5042 (Relocate::relocate): Likewise.
5043 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5044
5045 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5046
5047 * arm.cc (Arm_relocate_functions::got_prel) New function.
5048 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
5049 (Relocate::relocate): Likewise.
5050 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5051
5052 2009-10-06 Ian Lance Taylor <iant@google.com>
5053
5054 * options.h (class General_options): Define
5055 split_stack_adjust_size parameter.
5056 * object.h (class Object): Add uses_split_stack_ and
5057 has_no_split_stack_ fields. Add uses_split_stack and
5058 has_no_split_stack accessor functions. Declare
5059 handle_split_stack_section.
5060 (class Reloc_symbol_changes): Define.
5061 (class Sized_relobj): Define Function_offsets. Declare
5062 split_stack_adjust, split_stack_adjust_reltype, and
5063 find_functions.
5064 * object.cc (Object::handle_split_stack_section): New function.
5065 (Sized_relobj::do_layout): Call handle_split_stack_section.
5066 * dynobj.cc (Sized_dynobj::do_layout): Call
5067 handle_split_stack_section.
5068 * reloc.cc (Sized_relobj::relocate_sections): Call
5069 split_stack_adjust for executable sections in split_stack
5070 objects. Pass reloc_map to relocate_section.
5071 (Sized_relobj::split_stack_adjust): New function.
5072 (Sized_relobj::split_stack_adjust_reltype): New function.
5073 (Sized_relobj::find_functions): New function.
5074 * target-reloc.h: Include "object.h".
5075 (relocate_section): Add reloc_symbol_changes parameter. Change
5076 all callers.
5077 * target.h (class Target): Add calls_non_split method. Declare
5078 do_calls_non_split virtual method. Declare match_view and
5079 set_view_to_nop.
5080 * target.cc: Include "elfcpp.h".
5081 (Target::do_calls_non_split): New function.
5082 (Target::match_view): New function.
5083 (Target::set_view_to_nop): New function.
5084 * gold.cc (queue_middle_tasks): Give an error if mixing
5085 split-stack and non-split-stack objects with -r.
5086 * i386.cc (Target_i386::relocate_section): Add
5087 reloc_symbol_changes parameter.
5088 (Target_i386::do_calls_non_split): New function.
5089 * x86_64.cc (Target_x86_64::relocate_section): Add
5090 reloc_symbol_changes parameter.
5091 (Target_x86_64::do_calls_non_split): New function.
5092 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
5093 parameter.
5094 * powerpc.cc (Target_powerpc::relocate_section): Add
5095 reloc_symbol_changes parameter.
5096 * sparc.cc (Target_sparc::relocate_section): Add
5097 reloc_symbol_changes parameter.
5098 * configure.ac: Call AM_CONDITIONAL for the default target.
5099 * configure: Rebuild.
5100 * testsuite/Makefile.am (TEST_AS): New variable.
5101 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
5102 (check_DATA): Add split_i386 and split_x86_64 files.
5103 (SPLIT_DEFSYMS): Define.
5104 (split_i386_[1234n].o): New targets.
5105 (split_i386_[124]): New targets.
5106 (split_i386_[1234r].stdout): New targets.
5107 (split_x86_64_[1234n].o): New targets.
5108 (split_x86_64_[124]): New targets.
5109 (split_x86_64_[1234r].stdout): New targets.
5110 (MOSTLYCLEANFILES): Add new executables.
5111 * testsuite/split_i386.sh: New file.
5112 * testsuite/split_x86_64.sh: New file.
5113 * testsuite/split_i386_1.s: New file.
5114 * testsuite/split_i386_2.s: New file.
5115 * testsuite/split_i386_3.s: New file.
5116 * testsuite/split_i386_4.s: New file.
5117 * testsuite/split_i386_n.s: New file.
5118 * testsuite/split_x86_64_1.s: New file.
5119 * testsuite/split_x86_64_2.s: New file.
5120 * testsuite/split_x86_64_3.s: New file.
5121 * testsuite/split_x86_64_4.s: New file.
5122 * testsuite/split_x86_64_n.s: New file.
5123 * testsuite/testfile.cc (Target_test): Update relocation_section
5124 function.
5125 * testsuite/Makefile.in: Rebuild.
5126
5127 2009-10-06 Ian Lance Taylor <iant@google.com>
5128
5129 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
5130 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
5131 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
5132 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
5133 the address on ldo_addrs_.
5134 (Target_i386::Relocate::fix_up_ldo): New function.
5135
5136 2009-10-06 Rafael Espindola <espindola@google.com>
5137
5138 * plugin.cc (add_input_library): New.
5139 (Plugin::load): Add add_input_library to tv.
5140 (Plugin_manager::add_input_file): Add the is_lib argument.
5141 (add_input_file): Update call to Plugin_manager::add_input_file.
5142 (add_input_library): New.
5143 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
5144
5145 2009-09-30 Doug Kwan <dougkwan@google.com>
5146
5147 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
5148 symbol and call Symbol::may_need_copy_reloc to determine if
5149 a copy reloc is needed.
5150 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
5151 nocopyreloc is given in command line.
5152 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
5153 given in command line.
5154 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
5155 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
5156 of the removed Target_i386::may_need_copy_reloc.
5157 * options.h (copyreloc): New option with default value false.
5158 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5159 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
5160 instead of the removed Target_powerpc::may_need_copy_reloc.
5161 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5162 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
5163 instead of the removed Target_sparc::may_need_copy_reloc.
5164 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
5165 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
5166 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
5167 instead of the removed Target_x86_64::may_need_copy_reloc.
5168
5169 2009-09-30 Ian Lance Taylor <iant@google.com>
5170
5171 * object.h (class Object): Remove target_ field, and target,
5172 sized_target, and set_target methods.
5173 (Object::sized_target): Remove.
5174 (class Sized_relobj): Update declarations. Remove sized_target.
5175 * object.cc (Sized_relobj::setup): Remove target parameter.
5176 Change all callers.
5177 (Input_objects::add_object): Don't do anything with the target.
5178 (make_elf_sized_object): Add punconfigured parameter. Change all
5179 callers. Set or test parameter target.
5180 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
5181 Change all callers.
5182 * parameters.cc (Parameters::set_target): Change parameter type to
5183 be non-const.
5184 (Parameters::default_target): Remove.
5185 (set_parameters_target): Change parameter type to be non-const.
5186 (parameters_force_valid_target): New function.
5187 (parameters_clear_target): New function.
5188 * parameters.h (class Parameters): Update declarations. Remove
5189 default_target method. Add sized_target and clear_target
5190 methods. Change target_ to be non-const.
5191 (set_parameters_target): Update declaration.
5192 (parameters_force_valid_target): Declare.
5193 (parameters_clear_target): Declare.
5194 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
5195 as NULL if we aren't searching.
5196 (Add_symbols::run): Don't check for compatible target.
5197 * fileread.cc (Input_file::open_binary): Call
5198 parameters_force_valid_target.
5199 * gold.cc (queue_middle_tasks): Likewise.
5200 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
5201 set_target on object.
5202 * dynobj.h (class Sized_dynobj): Update declarations.
5203 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
5204 make_elf_object returns NULL.
5205 (Archive::include_member): Don't check whether object target is
5206 compatible.
5207 * output.cc (Output_section::add_input_section): Get target from
5208 parameters.
5209 (Output_section::relax_input_section): Likewise.
5210 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
5211 parameters.
5212 (Sized_relobj::do_scan_relocs): Likewise.
5213 (Sized_relobj::relocate_sections): Likewise.
5214 * resolve.cc (Symbol_table::resolve): Likewise.
5215 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
5216 parameter. Change all callers.
5217 (Symbol_table::add_from_object): Get target from parameters.
5218 (Symbol_table::add_from_relobj): Don't check object target.
5219 (Symbol_table::add_from_dynobj): Likewise.
5220 (Symbol_table::define_special_symbol): Get target from
5221 parameters.
5222 * symtab.h (class Symbol_table): Update declaration.
5223 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
5224 parameter. Change all callers. Clear parameter target.
5225 (Binary_test): Test target here.
5226 * testsuite/object_unittest.cc (gold_testsuite): Remove
5227 target_test_pointer parameter. Change all callers.
5228 (Object_test): Test target here.
5229
5230 2009-09-26 Ian Lance Taylor <iant@google.com>
5231
5232 * testsuite/initpri1.c: Don't try to use constructor priorities if
5233 compiling with gcc before 4.3.
5234
5235 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
5236
5237 * testsuite/retain_symbols_file_test.sh (check_present): Change
5238 output file name to retain_symbols_file_test.stdout.
5239 (check_absent): Likewise.
5240
5241 2009-09-18 Craig Silverstein <csilvers@google.com>
5242
5243 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
5244 * options.cc: Include <cerrno> and <fstream>.
5245 (General_options::finalize): Parse -retain-symbols-file tag.
5246 * options.h: New flag.
5247 (General_options): New method should_retain_symbol, new
5248 variable symbols_to_retain.
5249 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
5250 should_retain_symbol map.
5251 * testsuite/Makefile.am (retain_symbols_file_test): New test.
5252 * testsuite/Makefile.in: Regenerate.
5253 * testsuite/retain_symbols_file_test.sh: New file.
5254
5255 2009-09-18 Nick Clifton <nickc@redhat.com>
5256
5257 * po/es.po: Updated Spanish translation.
5258
5259 2009-09-17 Doug Kwan <dougkwan@google.com>
5260
5261 * debug.h (DEBUG_RELAXATION): New constant.
5262 (DEBUG_ALL): Add DEBUG_RELAXATION.
5263 (debug_string_to_enum): Add relaxation debug option.
5264 * layout.cc
5265 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
5266 Layout::Relaxation_debug_check::read_sections,
5267 Layout::Relaxation_debug_check::read_sections): New method definitions.
5268 (Layout::Layout): Initialize data members
5269 record_output_section_data_from_scrips_,
5270 script_output_section_data_list_ and relaxation_debug_check_.
5271 (Layout::save_segments, Layout::restore_segments,
5272 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5273 Layout::relaxation_loop_body): New method definitions.
5274 (Layout::finalize): Support relaxation. Move section layout code to
5275 Layout::relaxation_loop_body.
5276 (Layout::set_asection_address_from_script): Move code for orphan
5277 section placement out.
5278 (Layout::place_orphan_sections_in_script): New method definition.
5279 * layout.h (Output_segment_headers, Output_file_header):
5280 New forward class declarations.
5281 (Layout::~Layout): Define.
5282 (Layout::new_output_section_data_from_script): New method definition.
5283 (Layout::place_orphan_sections_in_script): New method declaration.
5284 (Layout::Segment_states): New type declaration.
5285 (Layout::save_segments, Layout::restore_segments,
5286 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5287 Layout::relaxation_loop_body): New method declarations.
5288 (Layout::Output_section_data_list): New type declaration.
5289 (Layout::Relaxation_debug_check): New class definition.
5290 (Layout::record_output_section_data_from_script_,
5291 Layout::script_output_section_data_list_, Layout::segment_states_,
5292 Layout::relaxation_debug_check_): New data members.
5293 * output.cc: (Output_section_headers::do_size): New method definition.
5294 (Output_section_headers::Output_section_headers): Move size
5295 computation to Output_section_headers::do_size.
5296 (Output_segment_headers::do_size): New method definition.
5297 (Output_file_header::Output_file_header): Move size computation to
5298 Output_file_header::do_size and call it.
5299 (Output_file_header::do_size): New method definition.
5300 (Output_data_group::Output_data_group): Adjust call to
5301 Output_section_data.
5302 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
5303 (Output_symtab_xindex::do_write): Add array bound check.
5304 (Output_section::Input_section::print_to_mapfile): Handle
5305 RELAXED_INPUT_SECTION_CODE.
5306 (Output_section::Output_section): Initialize data member checkpoint_.
5307 (Output_section::~Output_section): Delete checkpoint object pointed
5308 by checkpoint_.
5309 (Output_section::add_input_section): Always add an Input_section if
5310 relaxing.
5311 (Output_section::add_merge_input_section): Add assert.
5312 (Output_section::relax_input_section): New method definition.
5313 (Output_section::set_final_data_size): Set load address to zero for
5314 an unallocated section.
5315 (Output_section::do_address_and_file_offset_have_reset_values):
5316 New method definition.
5317 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
5318 Handle relaxed input section.
5319 (Output_section::sort_attached_input_sections): Checkpoint input
5320 section list lazily.
5321 (Output_section::get_input_sections): Change type of input_sections to
5322 list of Simple_input_section pointers. Checkpoint input section list
5323 lazily. Also handle relaxed input sections.
5324 (Output_section::add_input_section_for_script): Take a reference to
5325 a Simple_input_section object instead of Relobj pointer and section
5326 index as parameter. Handle relaxed input sections.
5327 (Output_section::save_states, Output_section::restore_states): New
5328 method definitions.
5329 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
5330 (Output_data::is_data_size_fixed): New method definition.
5331 (Output_data::reset_addresss_and_file_offset): Do not reset data size
5332 if it is fixed.
5333 (Output_data::address_and_file_offset_have_reset_values): New method
5334 definition.
5335 (Output_data::do_address_and_file_offset_have_reset_values): New method
5336 definition.
5337 (Output_data::set_data_size): Check that data size is not fixed.
5338 (Output_data::fix_data_size): New method definition.
5339 (Output_data::is_data_size_fixed_): New data member.
5340 (Output_section_headers::set_final_data_size): New method definition.
5341 (Output_section_headers::do_size): New method declaration.
5342 (Output_segment_headers::set_final_data_size): New method definition.
5343 (Output_segment_headers::do_size): New method declaration.
5344 (Output_file_header::set_final_data_size)::New method definition.
5345 (Output_file_header::do_size)::New method declaration.
5346 (Output_section_data::Output_section_data): Add new parameter
5347 is_data_size_fixed and use it to fix data size.
5348 (Output_data_const::Output_data_const): Adjust call to base class
5349 constructor and fix data size.
5350 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
5351 base class constructor and fix data size.
5352 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
5353 base class constructor and fix data size.
5354 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
5355 class constructor and fix data size.
5356 (Output_data_group::set_final_data_size): New method definition.
5357 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
5358 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
5359 class constructor and fix data size.
5360 (Output_relaxed_input_section): New class definition.
5361 (Output_section::Simple_input_section): New class definition.
5362 (Output_section::get_input_sections): Adjust parameter list.
5363 (Output_section::add_input_section_for_script): Same.
5364 (Output_section::save_states, Output_section::restore_states,
5365 Output_section::do_address_and_file_offset_have_reset_values,
5366 (Output_section::Input_section::Input_section): Handle
5367 RELAXED_INPUT_SECTION_CODE. Add new overload for
5368 Output_relaxed_input_section.
5369 (Output_section::Input_section::is_input_section,
5370 Output_section::Input_section::set_output_section): Handle relaxed
5371 input section.
5372 (Output_section::Input_section::is_relaxed_input_section,
5373 Output_section::Input_section::output_section_data,
5374 Output_section::Input_section::relaxed_input_section): New method
5375 definitions.
5376 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
5377 value.
5378 (Output_section::Input_section::u1_): Update comments.
5379 (Output_section::Input_section::u2_): Add new union member poris.
5380 (Output_section::Checkpoint_output_section): New classs definition.
5381 (Output_section::relax_input_section): New method declaration.
5382 (Output_section::checkpoint_): New data member.
5383 (Output_segment): Update comments.
5384 (Output_segment::Output_segment): Un-privatize copy constructor.
5385 (Output_segment::operator=): Un-privatize.
5386 * script-sections.cc (Output_section_element::Input_section_list):
5387 Change element type to Output_section::Simple_input_section.
5388 (Output_section_element_dot_assignment::set_section_addresses):
5389 Register output section data for relaxation clean up.
5390 (Output_data_exression::Output_data_expression): Adjust call to base
5391 constructor to fix data size.
5392 (Output_section_element_data::set_section_addresses): Register
5393 Output_data_expression object for relaxation clean up.
5394 (struct Input_section_info): Replace Relobj pointer and section index
5395 pair with Output_section::Simple_input_section and Convert struct to a
5396 class.
5397 (Input_section_sorter::operator()): Adjust access to
5398 Input_section_info data member to use accessors.
5399 (Output_section_element_input::set_section_addresses): Use layout
5400 parameter. Adjust code to use Output_section::Simple_input_section
5401 and Input_secction_info classes. Register filler for relaxation
5402 clean up.
5403 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
5404 and section index pair with Output_section::Simple_input_section
5405 class. Adjust code accordingly.
5406 (Phdrs_element::release_segment): New method definition.
5407 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
5408 segment list.
5409 (Script_sections::release_segments): New method definition.
5410 * gold/script-sections.h (Script_sections::release_segments): New
5411 method declaration.
5412 * gold/target.h (Target::may_relax, Target::relax,
5413 Target::do_may_relax, Target::do_relax): New method definitions.
5414
5415 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5416
5417 * arm.cc (has_signed_unsigned_overflow): New function.
5418 (Arm_relocate_functions::abs8): New function.
5419 (Target_arm::Scan::local): Handle R_ARM_ABS8.
5420 (Target_arm::Scan::global): Likewise.
5421 (Target_arm::relocate::relocate): Likewise.
5422 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5423 Likewise.
5424
5425 2009-09-16 Cary Coutant <ccoutant@google.com>
5426
5427 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
5428 * testsuite/Makefile.in: Regenerate.
5429
5430 2009-09-11 Nick Clifton <nickc@redhat.com>
5431
5432 * po/gold.pot: Updated by the Translation project.
5433
5434 2009-09-08 Cary Coutant <ccoutant@google.com>
5435
5436 * output.cc (Output_file::open): Add execute permission to empty file.
5437 * testsuite/Makefile.am (permission_test): New test.
5438 * testsuite/Makefile.in: Regenerate.
5439
5440 2009-09-02 Ian Lance Taylor <iant@google.com>
5441
5442 * output.cc (Output_file::resize): Call map_no_anonymous rather
5443 than map.
5444
5445 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
5446
5447 * gold.cc: Include "incremental.h".
5448 (queue_initial_tasks): Call Incremental_checker methods.
5449 * incremental.cc: Include "output.h".
5450 (Incremental_checker::can_incrementally_link_output_file): New
5451 method.
5452 * incremental.h (Incremental_checker): New class.
5453
5454 * output.cc (Output_file::open_for_modification): New method.
5455 (Output_file::map_anonymous): Changed return type to bool. Record
5456 map in base_ field.
5457 (Output_file::map_no_anonymous): New method, broken out of map.
5458 (Output_file::map): Use map_no_anonymous and map_anonymous.
5459 * output.h (class Output_file): Update declarations.
5460
5461 2009-08-24 Cary Coutant <ccoutant@google.com>
5462
5463 * options.h (Command_line::Pre_options): New class.
5464 (Command_line::pre_options): New member.
5465 * options.cc (gold::options::ready_to_register): New variable.
5466 (One_option::register_option): Do nothing if not registering options.
5467 Assert if same short option registered twice.
5468 (General_options::General_options): Turn off option registration when
5469 done constructing.
5470 (Command_line::Pre_options::Pre_options): New constructor.
5471
5472 2009-08-24 Cary Coutant <ccoutant@google.com>
5473
5474 * options.h (General_options::no_keep_memory): Remove incorrect
5475 short option.
5476
5477 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5478
5479 * Makefile.am (am__skiplex, am__skipyacc): New.
5480 * Makefile.in: Regenerate.
5481
5482 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5483
5484 * Makefile.am (AM_CPPFLAGS): Renamed from ...
5485 (INCLUDES): ... this.
5486 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
5487 (AM_CPPFLAGS): Renamed from ...
5488 (INCLUDE): ... this.
5489 * Makefile.in, testsuite/Makefile.in: Regenerate.
5490
5491 * Makefile.in: Regenerate.
5492 * aclocal.m4: Likewise.
5493 * config.in: Likewise.
5494 * configure: Likewise.
5495 * testsuite/Makefile.in: Likewise.
5496
5497 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5498 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5499 * Makefile.in: Regenerate.
5500 * testsuite/Makefile.in: Regenerate.
5501
5502 2009-08-19 Cary Coutant <ccoutant@google.com>
5503
5504 * resolve.cc (Symbol_table::resolve): Don't complain about defined
5505 symbols in shared libraries overridden by hidden or internal symbols
5506 in the main program.
5507
5508 2009-08-19 Chris Demetriou <cgd@google.com>
5509
5510 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
5511 checking source file names in error messages.
5512
5513 2009-08-18 Doug Kwan <dougkwan@google.com>
5514
5515 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
5516 an elcpp::Ehdr as parameter. Adjust call to set_target.
5517 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
5518 an elfcpp::Ehdr as parameter.
5519 * object.cc (Object::set_target): Remove the version that looks up
5520 a target and sets it.
5521 (Sized_relobj::setup): Take a Target object instead of
5522 an elfcpp::Ehdr as parameter. Adjust call to set_target.
5523 (make_elf_sized_object): Find target and ask target to
5524 make an ELF object.
5525 * object.h: (Object::set_target): Remove the version that looks up
5526 a target and sets it.
5527 (Sized_relobj::setup): Take a Target object instead of
5528 an elfcpp:Ehdr as parameter.
5529 * target.cc: Include dynobj.h.
5530 (Target::do_make_elf_object_implementation): New.
5531 (Target::do_make_elf_object): New.
5532 * target.h (Target::make_elf_object): New template declaration.
5533 (Target::do_make_elf_object): New method declarations.
5534 (Target::do_make_elf_object_implementation): New template declaration.
5535
5536 2009-08-14 Ian Lance Taylor <iant@google.com>
5537
5538 * gold.h (FUNCTION_NAME): Define.
5539 (gold_unreachable): Use FUNCTION_NAME.
5540
5541 2009-08-12 Sriraman Tallam <tmsriram@google.com>
5542
5543 * icf.cc (Icf::find_identical_sections): Issue a warning when a
5544 symbol in the --keep-unique list is not found.
5545
5546 2009-08-12 Sriraman Tallam <tmsriram@google.com>
5547
5548 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
5549 been maked as --keep-unique.
5550 (Icf::unfold_section): New function.
5551 * icf.h (Icf::unfold_section): New function.
5552 * options.h (General_options::keep_unique): New option.
5553 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
5554 * testsuite/Makefile.in: Regenerate.
5555 * testsuite/icf_keep_unique_test.sh: New file.
5556 * testsuite/icf_keep_unique_test.cc: New file.
5557
5558 2009-08-12 Cary Coutant <ccoutant@google.com>
5559
5560 PR 10471
5561 * resolve.cc (Symbol_table::resolve): Check for references from
5562 dynamic objects to hidden and internal symbols.
5563 * testsuite/Makefile.am (hidden_test.sh): New test.
5564 * testsuite/Makefile.in: Regenerate.
5565 * testsuite/hidden_test.sh: New script.
5566 * testsuite/hidden_test_1.c: New test source.
5567 * testsuite/hidden_test_main.c: New test source.
5568
5569 2009-08-11 Doug Kwan <dougkwan@google.com>
5570
5571 * arm.cc: Update comments.
5572 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
5573 segment to locate the .ARM.exidx section if present.
5574
5575 2009-08-09 Doug Kwan <dougkwan@google.com>
5576
5577 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
5578 patch.
5579
5580 2009-08-07 Sriraman Tallam <tmsriram@google.com>
5581 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
5582 compiler warnings.
5583
5584 2009-08-06 Sriraman Tallam <tmsriram@google.com>
5585
5586 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
5587 valid tls_segment only for non-debug-section relocations.
5588 * testsuite/Makefile.am: Add gc_tls_test.
5589 * testsuite/Makefile.in: Regenerate.
5590 * testsuite/gc_tls_test.cc: New file.
5591 * testsuite/gc_tls_test.sh: New file.
5592
5593 2009-08-05 Sriraman Tallam <tmsriram@google.com>
5594
5595 * icf.cc: New file.
5596 * icf.h: New file.
5597 * Makefile.am (CCFILES): Add icf.cc.
5598 (HFILES): Add icf.h
5599 * Makefile.in: Regenerate.
5600 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
5601 * gc.h (gc_process_relocs): Populate lists used by icf to contain
5602 section, symbol and addend information for the relocs.
5603 * gold.cc (queue_middle_tasks): Call identical code folding.
5604 * gold.h: Add defines for multimap.
5605 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
5606 to the call of finalize_local_symbols.
5607 * main.cc (main): Create object of class Icf.
5608 * object.cc (Sized_relobj::do_layout): Allow this function to be
5609 called twice during icf.
5610 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
5611 to sections marked as identical by icf.
5612 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
5613 when available.
5614 (Sized_relobj::do_section_entsize): New function.
5615 * object.h (Object::section_entsize): New function.
5616 (Object::do_section_entsize): New pure virtual function.
5617 (Relobj::finalize_local_symbols): Add new parameter.
5618 (Relobj::do_section_entsize): New function.
5619 * options.h (General_options::icf): New option.
5620 (General_options::icf_iterations): New option.
5621 (General_options::print_icf_sections): New option.
5622 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
5623 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
5624 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
5625 icf.
5626 * symtab.cc (Symbol_table::is_section_folded): New function.
5627 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
5628 to sections marked as identical by icf.
5629 * symtab.h (Symbol_table::set_icf): New function.
5630 (Symbol_table::icf): New function.
5631 (Symbol_table::is_section_folded): New function.
5632 (Symbol_table::icf_): New data member.
5633 * target-reloc.h (relocate_section): Ignore sections folded by icf.
5634 * testsuite/Makefile.am: Add commands to build icf_test.
5635 * testsuite/Makefile.in: Regenerate.
5636 * testsuite/icf_test.sh: New file.
5637 * testsuite/icf_test.cc: New file.
5638
5639 2009-07-24 Chris Demetriou <cgd@google.com>
5640
5641 * layout.cc (is_compressible_debug_section): Fix incorrect
5642 comment about compressed section names.
5643
5644 2009-07-20 Ian Lance Taylor <ian@airs.com>
5645
5646 PR 10419
5647 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
5648
5649 2009-07-16 Ian Lance Taylor <iant@google.com>
5650
5651 PR 10400
5652 * layout.h: #include <map>.
5653 (class Kept_section): Change from struct to class. Add accessors
5654 and setters. Add section size to Comdat_group mapping. Change
5655 Comdat_group to std::map. Add is_comdat_ field. Add
5656 linkonce_size field in union.
5657 (class Layout): Update declaration of find_or_add_kept_section.
5658 Don't declare find_kept_object.
5659 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
5660 parameter. Add object, shndx, is_comdat, and is_group_name
5661 parameters. Change all callers. Adjust for new Kept_section.
5662 (Layout::find_kept_object): Remove.
5663 * object.cc (Sized_relobj::include_section_group): Update use of
5664 Kept_section. Rename secnum to shndx. Only record
5665 Kept_comdat_section if sections are the same size.
5666 (Sized_relobj::include_linkonce_section): Update use of
5667 Kept_section. Only record Kept_comdat_section if sections are the
5668 same size. Set size of linkonce section.
5669 (Sized_relobj::map_to_kept_section): Update call to
5670 get_kept_comdat_section.
5671 * object.h (class Sized_relobj): Rename fields in
5672 Kept_comdat_section to drop trailing underscores; change object
5673 field to Relobj*. Change Kept_comdat_section_table to store
5674 struct rather than pointer.
5675 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
5676 Add kept_object and kept_shndx parameters. Change all callers.
5677 (Sized_relobj::get_kept_comdat_section): Change return type to
5678 bool. Add kept_object and kept_shndx parameters. Change all
5679 callers.
5680 * plugin.cc (Pluginobj::include_comdat_group): Update call to
5681 Layout::find_or_add_kept_section.
5682
5683 2009-07-09 Ian Lance Taylor <iant@google.com>
5684
5685 * merge.cc (Object_merge_map::initialize_input_to_output_map):
5686 Reserve space in the hash table.
5687
5688 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
5689
5690 * fileread.cc (File_read::get_mtime): New method.
5691 * fileread.h (Timespec): New structure.
5692 (File_read::get_mtime): New method.
5693 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
5694 Renamed from timestamp_nsec.
5695 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
5696 Elf_Xword.
5697 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
5698 timestamp_nsec.
5699 (Incremental_inputs::report_archive): Save mtime; style fix.
5700 (Incremental_inputs::report_obejct): Save mtime; style fix.
5701 (Incremental_inputs::report_script): Save mtime; style fix.
5702 (Incremental_inputs::finalize_inputs): Style fix.
5703 (Incremental_inputs::finalize): Style fix.
5704 (Incremental_inputs::create_input_section_data): Store inputs
5705 mtime.
5706 * incremental.h (Incremental_inputs::report_script): Add mtime
5707 argument.
5708 (Incremental_inputs::Input_info::Input_info): Intialize only one
5709 union member.
5710 (Incremental_inputs::Input_info::archive): Move to nameless
5711 union.
5712 (Incremental_inputs::Input_info::obejct): Move to nameless union.
5713 (Incremental_inputs::Input_info::script): Move to nameless union.
5714 (Incremental_inputs::mtime): New field.
5715 * script.cc (read_input_script): Pass file mtime to
5716 Incremental_input.
5717 * script.h (Script_info::inputs): Style fix.
5718
5719 2009-07-01 Ian Lance Taylor <ian@airs.com>
5720
5721 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
5722 instead of 32.
5723
5724 2009-06-24 Ian Lance Taylor <iant@google.com>
5725
5726 PR 10156
5727 * layout.cc (Layout::choose_output_section): If we find an
5728 existing section, update the flags.
5729 (Layout::create_notes): New function, broken out of
5730 Layout::finalize.
5731 (Layout::finalize): Don't create note sections.
5732 (Layout::create_note): Don't crash if linker script discards
5733 section.
5734 (Layout::create_gold_note): Likewise.
5735 (Layout::create_build_id): Likewise. Don't set
5736 after_input_sections on the section.
5737 (Layout::create_executable_stack_info): Remove target parameter.
5738 Change caller.
5739 * layout.h (class Layout): Declare create_notes. Update
5740 declaration of create_executable_stack_info.
5741 * gold.cc (queue_middle_tasks): Call create_notes.
5742 * output.cc (Output_section::update_flags_for_input_section): Move
5743 here from output.h. If SHF_ALLOC flag is newly set, mark address
5744 invalid.
5745 * output.h (Output_data::mark_address_invalid): New function.
5746 (class Output_section): Only declare, not define,
5747 update_flags_for_input_section. Remove set_flags.
5748
5749 2009-06-24 Ian Lance Taylor <iant@google.com>
5750
5751 * script-sections.cc (Output_section_definition::
5752 set_section_addresses): Rename shadowing local load_address to
5753 laddr.
5754
5755 2009-06-24 Ian Lance Taylor <iant@google.com>
5756
5757 PR 10244
5758 * reloc.cc (relocate_sections): Skip empty relocation sections.
5759
5760 2009-06-23 Ian Lance Taylor <iant@google.com>
5761
5762 PR 10156
5763 * layout.cc (Layout::create_note): Use choose_output_section
5764 rather than make_output_section.
5765
5766 2009-06-23 Ian Lance Taylor <iant@google.com>
5767
5768 PR 10237
5769 * options.cc (General_options::parse_V): Set printed_version_.
5770 (General_options::General_options): Initialize printed_version_.
5771 * options.h (class General_options): Add printed_version_ field.
5772 * gold.cc (queue_initial_tasks): If there are no input files,
5773 don't give a fatal error if we printed the version information.
5774 (queue_middle_tasks): If using -r with a shared object, give a
5775 fatal error rather than an ordinary error.
5776
5777 2009-06-23 Ian Lance Taylor <iant@google.com>
5778
5779 PR 10219
5780 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
5781 (Layout::make_output_section): Set have_stabstr_section_ if we see
5782 a .stab*str section.
5783 (Layout::finalize): Call link_stabs_sections.
5784 (Layout::link_stabs_sections): New file.
5785 * layout.h (class Layout): Add have_stabstr_section_ field.
5786 Declare link_stabs_sections.
5787
5788 2009-06-23 Doug Kwan <dougkwan@google.com>
5789
5790 * Makefile.am (libgold_a_LIBADD): New.
5791 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
5792 * Makefile.in: Regenerate.
5793 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
5794 * configure: Regenerate.
5795 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
5796 * fileread.cc: Include sys/state.h
5797 * gold.h: Declare memmem and strndup if found missing.
5798 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
5799
5800 2009-06-23 Ian Lance Taylor <iant@google.com>
5801
5802 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
5803 * configure: Rebuild.
5804
5805 2009-06-23 Ian Lance Taylor <iant@google.com>
5806
5807 PR 10147
5808 * object.cc (Object::section_contents): Don't try to get a view if
5809 the section has length zero.
5810 (Object::handle_gnu_warning_section): If the section is empty, use
5811 the name of the section as the warning.
5812
5813 2009-06-23 Ian Lance Taylor <iant@google.com>
5814
5815 PR 10133
5816 * stringpool.h (class Stringpool_template): Add optimize_ field.
5817 (Stringpool_template::set_optimize): New function.
5818 * stringpool.cc (Stringpool_template::Stringpool_template):
5819 Initialize optimize_ field.
5820 (Stringpool_template::set_string_offsets): Test local optimize
5821 fild rather than parameter.
5822 * layout.cc (Layout::Layout): Call set_optimize on the section
5823 name stringpool.
5824
5825 2009-06-22 Ian Lance Taylor <iant@google.com>
5826
5827 PR 10030
5828 * yyscript.y: Parse TARGET.
5829 * script.cc (script_set_target): New function.
5830 * script-c.h (script_set_target): Declare.
5831 * options.cc (General_options::string_to_object_format): Rename
5832 from string_to_object_format in anonymous namespace. Change
5833 callers.
5834 * options.h (class General_options): Declare
5835 string_to_object_format.
5836
5837 2009-06-22 Ian Lance Taylor <iant@google.com>
5838
5839 * script-sections.cc (Script_sections::create_segments): Don't put
5840 program headers in a PT_LOAD segment if -n or -N.
5841
5842 2009-06-22 Ian Lance Taylor <iant@google.com>
5843
5844 PR 10141
5845 * options.h (class General_options): Add -z lazy and -z now. Sort
5846 -z options into alphabetical order.
5847 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
5848
5849 2009-06-21 Ian Lance Taylor <iant@google.com>
5850
5851 * layout.cc (Layout::make_output_section): Call
5852 Target::new_output_section.
5853 (Layout::attach_allocated_section_to_segment): Put large section
5854 sections in a separate load segment with the large segment flag
5855 set.
5856 (Layout::segment_precedes): Sort large data segments after other
5857 load segments.
5858 (align_file_offset): New static function.
5859 (Layout::set_segment_offsets): Use align_file_offset.
5860 * output.h (class Output_section): Add is_small_section_ and
5861 is_large_section_ fields.
5862 (Output_section::is_small_section): New function.
5863 (Output_section::set_is_small_section): New function.
5864 (Output_section::is_large_section): New function.
5865 (Output_section::set_is_large_section): New function.
5866 (Output_section::is_large_data_section): New function.
5867 (class Output_segment): Add is_large_data_segment_ field.
5868 (Output_segment::is_large_data_segment): New function.
5869 (Output_segment::set_is_large_data_segment): New function.
5870 * output.cc (Output_section::Output_section): Initialize new
5871 fields.
5872 (Output_segment::Output_segment): Likewise.
5873 (Output_segment::add_output_section): Add assertion that large
5874 data sections always go in large data segments. Force small data
5875 sections to the end of the list of data sections. Force small BSS
5876 sections to the start of the list of BSS sections. For large BSS
5877 sections to the end of the list of BSS sections.
5878 * symtab.h (class Symbol): Declare is_common_shndx.
5879 (Symbol::is_defined): Check Symbol::is_common_shndx.
5880 (Symbol::is_common): Likewise.
5881 (class Symbol_table): Define enum Commons_section_type. Update
5882 declarations. Add small_commons_ and large_commons_ fields.
5883 * symtab.cc (Symbol::is_common_shndx): New function.
5884 (Symbol_table::Symbol_table): Initialize new fields.
5885 (Symbol_table::add_from_object): Put small and large common
5886 symbols in the right list.
5887 (Symbol_table::sized_finalized_symbol): Check
5888 Symbol::is_common_shndx.
5889 (Symbol_table::sized_write_globals): Likewise.
5890 * common.cc (Symbol_table::do_allocate_commons): Allocate new
5891 common symbol lists. Don't call do_allocate_commons_list if the
5892 list is empty.
5893 (Symbol_table::do_allocate_commons_list): Remove is_tls
5894 parameter. Add comons_section_type parameter. Change all
5895 callers. Handle small and large common symbols.
5896 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
5897 Symbol::is_common_shndx.
5898 * resolve.cc (symbol_to_bits): Likewise.
5899 * target.h (Target::small_common_shndx): New function.
5900 (Target::small_common_section_flags): New function.
5901 (Target::large_common_shndx): New function.
5902 (Target::large_common_section_flags): New function.
5903 (Target::new_output_section): New function.
5904 (Target::Target_info): Add small_common_shndx, large_common_shndx,
5905 small_common_section_flags, and large_common_section_flags
5906 fields.
5907 (Target::do_new_output_section): New virtual function.
5908 * arm.cc (Target_arm::arm_info): Initialize new fields.
5909 * i386.cc (Target_i386::i386_info): Likewise.
5910 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5911 Likewise.
5912 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
5913 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5914 (Target_x86_64::do_new_output_section): New function.
5915 * configure.ac: Define conditional MCMODEL_MEDIUM.
5916 * testsuite/Makefile.am (check_PROGRAMS): Add large.
5917 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
5918 (large_LDFLAGS): Define.
5919 * testsuite/large.c: New file.
5920 * testsuite/testfile.cc (Target_test::test_target_info):
5921 Initialize new fields.
5922 * configure, testsuite/Makefile.in: Rebuild.
5923
5924 2009-06-05 Doug Kwan <dougkwan@google.com>
5925
5926 * Makefile.am (CCFILES): Add target.cc.
5927 * Makefile.in: Regenerate.
5928 * i386.cc (class Target_i386): Define new virtual method to
5929 override do_is_local_label_name in parent.
5930 * object.cc (Sized_relobj::do_count_local_symbols): Discard
5931 local symbols if --discard-locals or -X is given.
5932 * options.h (class General_options): Declare new options
5933 '--discard-locals' and '-X' for discarding locals.
5934 * target.h (class Target): Define new methods is_local_label_name.
5935 Declare new virtual method do_is_local_label_name.
5936 * target.cc: New file.
5937 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
5938 (check_SCRIPTS): Add discard_locals_test.sh.
5939 (check_DATA): Add discard_local_tests.syms.
5940 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
5941 (discard_local_tests.syms, discard_locals_test.o): New make rules.
5942 * testsuite/Makefile.in: Regenerate.
5943 * testsuite/discard_locals_test.c: New file.
5944 * testsuite/discard_locals_test.sh: Same.
5945
5946 2009-06-05 Doug Kwan <dougkwan@google.com>
5947
5948 * object.cc (Sized_relobj::Sized_relobj): Initialize
5949 discarded_eh_frame_shndx_ to -1U.
5950 (Sized_relobj::do_layout): Record index of a discard .eh_frame
5951 section.
5952 (Sized_relobj::do_count_local_symbols): Skip local symbols in
5953 a discarded .eh_frame section.
5954 (Sized_relobj::do_finalize_local_symbols): Ditto.
5955 * object.h (class Sized_relobj): Declare new member
5956 discarded_eh_frame_shndx_.
5957 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
5958 (local_labels_test.o, local_labels_test): New rules.
5959 * testsuite/Makefile.in: Regenerate.
5960
5961 2009-06-04 Doug Kwan <dougkwan@google.com>
5962
5963 * layout.cc (Layout::section_name_mapping): Add mapping for
5964 special ARM sections.
5965
5966 2009-06-03 Doug Kwan <dougkwan@google.com>
5967
5968 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
5969 (utils::has_overflow): Same.
5970
5971 2009-06-03 Ian Lance Taylor <iant@google.com>
5972
5973 * layout.cc (Layout::section_name_mapping): New array, replacing
5974 Layout::linkonce_mapping.
5975 (Layout::section_name_mapping_count): New variable, replacing
5976 Layout::linkonce_mapping_count.
5977 (Layout::linkonce_output_name): Remove.
5978 (Layout::output_section_name): Rewrite.
5979 * layout.h (class Layout): Rename Linkonce_mapping to
5980 Section_name_mapping, linkonce_mapping to section_name_mapping,
5981 linkonce_mapping_count to section_name_mapping_count. Don't
5982 declare linkonce_output_name.
5983
5984 2009-06-03 Doug Kwan <dougkwan@google.com>
5985
5986 * gold/arm.cc (namespace utils): New.
5987 (Target_arm::reloc_is_non_pic): Define new method.
5988 (class Arm_relocate_functions): New.
5989 (Target_arm::Relocate::relocate): Handle relocation types used by
5990 Android.
5991
5992 2009-06-03 Ian Lance Taylor <iant@google.com>
5993
5994 * arm.cc (Target_arm::scan::global): Use || instead of |.
5995
5996 2009-06-02 Doug Kwan <dougkwan@google.com>
5997
5998 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
5999 issued_non_pic_error_.
6000 (class Target_arm::Scan): Declare new method check_non_pic.
6001 Define new method symbol_needs_plt_entry.
6002 Declare new data member issued_non_pic_error_.
6003 (class Target_arm::Relocate): Declare new method
6004 should_apply_static_reloc.
6005 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
6006 (Target_arm::Scan::check_non_pic): Define new method.
6007 (Target_arm::Scan::local): Handle a small subset of reloc types used
6008 by Android.
6009 (Target_arm::Scan::local): Same.
6010 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
6011
6012 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
6013
6014 * incremental.cc (Incremental_inputs::report_command_line): Filter
6015 out --incremental-* options.
6016
6017 2009-05-29 Doug Kwan <dougkwan@google.com>
6018
6019 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
6020 template class.
6021 (class Target_arm): Update comment.
6022 (Target_arm::Target_arm): Initialize new data members GOT_,
6023 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
6024 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
6025 and Target_arm::rel_dyn_section.
6026 Declare new_enum Target_arm::Got_type.
6027 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
6028 and DYNBSS_.
6029 Update commments for member do_dynsym_value.
6030 (Target_arm::got_size, Target_arm::plt_section,
6031 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
6032 new methods inside class defintion.
6033 (Target_arm::got_section): Define new method.
6034 (Target_arm::rel_dyn_section): Same.
6035 (Output_data_plt_arm): New template class.
6036 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
6037 (Output_data_plt_arm:do_adjust_output_section): Define new method.
6038 (Output_data_plt_arm::add_entry): Same.
6039 (Output_data_plt_arm::first_plt_entry): Define new
6040 static data member for PLT instruction template.
6041 (Output_data_plt_arm::plt_entry): Same.
6042 (Output_data_plt_arm::do_write): Define new method.
6043 (Target_arm::make_plt_entry): Same.
6044 (Target_arm::do_finalize_sections): Same.
6045 (Target_arm::do_dynsym_value): Same.
6046
6047 2009-05-28 Doug Kwan <dougkwan@google.com>
6048
6049 * Makefile.am (TARGETSOURCES): Add arm.cc.
6050 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
6051 * Makefile.in: Regenerate.
6052 * arm.cc: New file.
6053 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
6054
6055 2009-05-26 Doug Kwan <dougkwan@google.com>
6056
6057 * options.cc (General_options::parse_exclude_libs). Fix a comment.
6058 (General_options::check_excluded_libs): Strip off directories in
6059 archive name before matching like GNU ld does.
6060 * testsuite/Makefile.am (MOSTLYCLEANFILES,
6061 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
6062 (exclude_libs_test_LDFLAGS): Add linker option
6063 -Wl,--exclude-libs,libexclude_libs_test_3
6064 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
6065 an explicit archive without using -l.
6066 (alt/libexclude_libs_test_3.a): New make rule.
6067 * testsuite/Makefile.in: Regenerate.
6068 * testsuite/exclude_libs_test.c : Declare lib3_default().
6069 (main): Call it.
6070 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
6071 * exclude_libs_test_3.c: New file.
6072
6073 2009-05-26 Nick Clifton <nickc@redhat.com>
6074
6075 * po/id.po: New Indonesian translation.
6076 * po/gold.pot: Updated template file.
6077
6078 2009-05-22 Sriraman Tallam <tmsriram@google.com>
6079
6080 * testsuite/Makefile.am: Add -ffunction-sections to compile
6081 gc_comdat_test files. Add -Wl,--gc-sections to build
6082 gc_comdat_test.
6083 * testsuite/Makefile.in: Regenerate.
6084 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
6085
6086 2009-05-21 Sriraman Tallam <tmsriram@google.com>
6087
6088 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
6089 kept comdat section was garbage collected.
6090 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
6091 * testsuite/Makefile.in: Regenerate.
6092 * testsuite/gc_comdat_test.sh: New file.
6093 * testsuite/gc_comdat_test_1.cc: New file.
6094 * testsuite/gc_comdat_test_2.cc: New file.
6095
6096 2009-05-19 Doug Kwan <dougkwan@google.com>
6097
6098 * archive.cc (Archive::Archive): Move constructor from archive.h
6099 to here. Initialize no_export_.
6100 (Archive::get_elf_object_for_member): Set no_export flag of object.
6101 * archive.h (Archive::Archive): Move constructor body to
6102 archive.cc.
6103 (Archive::no_export): New method.
6104 (Archive::no_export_): New field.
6105 * object.h (Object::Object): Initialize no_export_ to false.
6106 (Object::no_export, Object::set_no_export): New methods.
6107 (Object::no_export_): New field.
6108 * options.cc (General_options::parse_exclude_libs): New method.
6109 (General_options::check_excluded_libs) Same.
6110 * options.h (exclude_libs): New option.
6111 (General_options::check_excluded_libs): New method declaration.
6112 (General_options::excluded_libs_): New field.
6113 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
6114 default or protected visibility if an object has no-export flag set.
6115 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
6116 (check_SCRIPTS): Add exclude_libs_test.sh.
6117 (check_DATA): Add exclude_libs_test.syms.
6118 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
6119 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
6120 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
6121 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
6122 (exclude_libs_test.syms, libexclude_libs_test_1.a,
6123 libexclude_libs_test_2.a): New rules.
6124 * testsuite/Makefile.in: Regenerate.
6125 * testsuite/exclude_libs_test.c: New file.
6126 * testsuite/exclude_libs_test.sh: Ditto.
6127 * testsuite/exclude_libs_test_1.c: Ditto.
6128 * testsuite/exclude_libs_test_2.c: Ditto.
6129
6130 2009-05-15 Ian Lance Taylor <iant@google.com>
6131
6132 * configure.ac: Check for declarations for cases where libiberty.h
6133 checks HAVE_DECL_xxx.
6134 * configure, config.in: Rebuild.
6135
6136 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
6137
6138 * gold.h (Incremental_argument_list): Remove (invalid) forward
6139 declaration.
6140 * incremental.cc (Incremental_inputs::report_achive): New method.
6141 (Incremental_inputs::report_object): New method.
6142 (Incremental_inputs::report_script): New method.
6143 (Incremental_inputs::finalize_inputs): New method.
6144 (Incremental_inputs::finalize): Call finalize_inputs().
6145 (Incremental_inputs::sized_create_incremental_inputs_section_data):
6146 Create inputs entries.
6147 * incremental.h (Incremental_input_type): New enum.
6148 (Incremental_inputs::Incremental_input): Initialize new fields.
6149 (Incremental_inputs::report_inputs): New method.
6150 (Incremental_inputs::report_achive): New method.
6151 (Incremental_inputs::report_object): New method.
6152 (Incremental_inputs::report_script): New method.
6153 (Incremental_inputs::finalize_inputs): New method.
6154 (Incremental_inputs::Input_info): New struct.
6155 (Incremental_inputs::Input_info_map): New typedef.
6156 (Incremental_inputs::lock_): New field.
6157 (Incremental_inputs::Inputs_): New field.
6158 (Incremental_inputs::Inputs_map): New field.
6159 * main.cc (main): Call Incremental_input::report_inputs.
6160 * options.h (Input_argument_list): Typedef moved from
6161 Input_arguments.
6162 (Input_file_group::Files): Remove, use ::Input_argument_list.
6163 (Input_file_group::Input_argument_list): Remove, use
6164 ::Input_argument_list.
6165 * plugin.cc (Plugin_manager::add_input_file): Add error in
6166 incremental build.
6167 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
6168 functions.
6169 * script.cc (read_input_script): Call
6170 Incremental_input::report_script.
6171 * script.h (Script_info): New class.
6172
6173 2009-04-27 Ian Lance Taylor <iant@google.com>
6174
6175 * x86_64.cc (do_adjust_output_section): Set entsize to
6176 plt_entry_size.
6177
6178 2009-04-23 Elliott Hughes <enh@google.com>
6179
6180 * output.cc (Output_file::close): After short writes, continue
6181 writing from the correct offset in the buffer being written.
6182
6183 2009-04-23 Chris Demetriou <cgd@google.com>
6184
6185 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
6186 * configure: Regenerate.
6187 * config.in: Regenerate.
6188 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
6189 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
6190
6191 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
6192
6193 * incremental.cc (Incremental_inputs_header_data): Renamed from
6194 Incremental_input_header_data.
6195 (Incremental_inputs_header_data::data_size): New field.
6196 (Incremental_inputs_header_data::put_input_file_count): Renamed
6197 from input_file_count.
6198 (Incremental_inputs_header_data::put_command_line_offset): Renamed
6199 from command_line_offset.
6200 (Incremental_inputs_header_data::put_reserved): Renamed from
6201 put_reserved.
6202 (Incremental_inputs_entry_data): Renamed from
6203 Incremental_input_entry_data.
6204 (Incremental_inputs_entry_data::data_size): New field.
6205 (Incremental_inputs::report_command_line): New method.
6206 (Incremental_inputs::finalize): New method.
6207 (Incremental_inputs::create_incremental_inputs_data): New method.
6208 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
6209 * incremental.h: New file.
6210 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
6211 (Layout::finalize): Create incremental inputs section in
6212 incremental builds.
6213 (Layout::create_incremental_info_sections): New method.
6214 * layout.h (Layout::incremental_inputs): New method.
6215 (Layout::create_incremental_info_sections): New method.
6216 (Layout::incremental_inputs_): New field.
6217 * main.cc (main): Notify Incremental_input of the command line.
6218
6219 2009-04-01 Ian Lance Taylor <iant@google.com>
6220 Mikolaj Zalewski <mikolajz@google.com>
6221
6222 * gold.h (reserve_unordered_map): Define, three versions, one for
6223 each version of Unordered_map.
6224 * layout.cc (Layout::Layout): Remove options parameter. Add
6225 number_of_input_files parameter. Don't initialize options_.
6226 Initialize number_of_input_files_ and resized_signatures_. Move
6227 sections_are_attached_.
6228 (Layout::layout_group): Reserve space for group_signatures_.
6229 (Layout::find_or_add_kept_section): Change name parameter to be a
6230 reference. Resize signatures_ map when it gets large enough.
6231 (Layout::layout_eh_frame): Use parameters->options() instead of
6232 this->options_.
6233 (Layout::make_output_section): Likewise.
6234 (Layout::attach_allocated_section_to_segment): Likewise.
6235 (Layout::finalize, Layout::create_executable_stack): Likewise.
6236 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
6237 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
6238 * layout.h (class Layout): Update declarations. Remove options_
6239 field. Add number_of_input_files_ and resized_signatures_
6240 fields. Move sections_are_attached_ field.
6241 * main.cc (main): Pass number of input files to Layout
6242 constructor. Don't pass options.
6243
6244 2009-03-30 Ian Lance Taylor <iant@google.com>
6245
6246 * ffsll.c (ffsll): Correct implementation.
6247
6248 2009-03-27 Ian Lance Taylor <iant@google.com>
6249
6250 * ffsll.c: New file.
6251 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
6252 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
6253 * ftruncate.c (ftruncate): Declare before definition.
6254 * mremap.c (mremap): Likewise.
6255 * pread.c (pread): Likewise.
6256 * configure, Makefile.in, config.in: Rebuild.
6257
6258 * mremap.c: New file.
6259 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
6260 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
6261 (mremap): Declare if HAVE_MREMAP is not defined.
6262 * configure, Makefile.in, config.in: Rebuild.
6263
6264 2009-03-27 Cary Coutant <ccoutant@google.com>
6265
6266 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
6267 position independent.
6268 * sparc.cc (Target_sparc::check_non_pic): Likewise.
6269 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
6270
6271 2009-03-24 Cary Coutant <ccoutant@google.com>
6272
6273 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
6274 an executable.
6275 (needs_dynamic_reloc): Likewise.
6276
6277 2009-03-24 Ian Lance Taylor <iant@google.com>
6278
6279 * yyscript.y (file_cmd): Recognize EXTERN.
6280 (extern_name_list, extern_name_list_body): New nonterminals.
6281 * script.cc (script_add_extern): Define.
6282 * script-c.h (script_add_extern): Declare.
6283
6284 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
6285
6286 * object.cc (is_elf_object): Define.
6287 * object.h (is_elf_object): Declare.
6288 * archive.cc (Archive::get_elf_object_for_member): Call
6289 is_elf_object.
6290 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
6291
6292 2009-03-24 Elliott Hughes <enh@google.com>
6293
6294 * output.cc (Output_file::map_anonymous): Define.
6295 (Output_file::map): Use map_anonymous. If the regular mmap fails,
6296 try an anonymous one. Report the size if the mmap fails.
6297 * output.h (class Output_file): Declare map_anonymous.
6298
6299 2009-03-24 Ian Lance Taylor <iant@google.com>
6300
6301 * target-select.cc (instantiate_target): Don't acquire the lock if
6302 the instantiated_target_ field has already been set.
6303
6304 2009-03-23 Ian Lance Taylor <iant@google.com>
6305
6306 * gold-threads.h (class Initialize_lock): Define.
6307 * gold-threads.cc (class Initialize_lock_once): Define.
6308 (initialize_lock_control): New static variable.
6309 (initialize_lock_pointer): New static variable.
6310 (initialize_lock_once): New static function.
6311 (Initialize_lock::Initialize_lock): Define.
6312 (Initialize_lock::initialize): Define.
6313 * target-select.h: Include "gold-threads.h".
6314 (class Target_selector): Add lock_ and initialize_lock_ fields.
6315 Don't define instantiate_target, just declare it.
6316 * target-select.cc (Target_selector::Target_selector): Initialize
6317 new fields.
6318 (Target_selector::instantiate_target): Define.
6319 * descriptors.h: Include "gold-threads.h".
6320 (class Descriptors): Add initialize_lock_ field.
6321 * descriptors.cc (Descriptors::Descriptors): Initialize new
6322 field.
6323 (Descriptors::open): Use initialize_lock_ field
6324 * errors.h (class Errors): Add initialize_lock_ field.
6325 * errors.cc (Errors::Errors): Initialize new field.
6326 (Errors::initialize_lock): Use initialize_lock_ field.
6327 * powerpc.cc (class Target_selector_powerpc): Remove
6328 instantiated_target_ field. In do_recognize call
6329 instantiate_target rather than do_instantiate_target. In
6330 do_instantiate_target just allocate a new target.
6331 * sparc.cc (class Target_selector_sparc): Likewise.
6332
6333 * freebsd.h: New file.
6334 * i386.cc: Include "freebsd.h".
6335 (Target_i386): Derive from Target_freebsd rather than
6336 Sized_target.
6337 (Target_selector_i386): Derive from Target_selector_freebsd rather
6338 than Target_selector.
6339 * x86_64.cc: Include "freebsd.h".
6340 (Target_x86_64): Derive from Target_freebsd rather than
6341 Sized_target.
6342 (Target_selector_x86_64): Derive from Target_selector_freebsd
6343 rather than Target_selector.
6344 * target.h (class Target): Add adjust_elf_header and
6345 do_adjust_elf_header.
6346 * output.cc (Output_file_header:: do_sized_write): Call target
6347 adjust_elf_header routine.
6348 * configure.tgt: Set targ_osabi.
6349 * configure.ac: Define GOLD_DEFAULT_OSABI.
6350 * parameters.cc (Parameters::default_target): Pass
6351 GOLD_DEFAULT_OSABI to select_target.
6352 * target-select.h (class Target_selector): Make instantiate_target
6353 protected rather than private.
6354 * Makefile.am (HFILES): Add freebsd.h.
6355 * configure, Makefile.in, config.in: Rebuild.
6356
6357 * merge.cc (do_add_input_section): Correct pend value. Change
6358 message about last entry not being null terminated from error to
6359 warning.
6360
6361 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
6362
6363 * incremental.cc: New file.
6364 * Makefile.am (CCFILES): Add incremental.cc.
6365 * Makefile.in: Rebuild.
6366
6367 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
6368
6369 * layout.cc (Layout::output_section_name): Preserve names
6370 of '.note.' sections.
6371
6372 2009-03-19 Ian Lance Taylor <iant@google.com>
6373
6374 * descriptors.cc (Descriptors::open): Check that the options are
6375 valid before using them.
6376
6377 2009-03-18 Ian Lance Taylor <iant@google.com>
6378
6379 * script-sections.h: Include <list>.
6380 (class Script_sections): Change Sections_elements from std::vector
6381 to std::list. Typedef public Elements_iterator. Add
6382 orphan_section_placement_, data_segment_align_start_, and
6383 saw_data_segment_align_ fields. Remove data_segment_align_index_
6384 field.
6385 * script-sections.cc (class Orphan_section_placement): New class.
6386 (class Sections_element): Add virtual functions is_relro and
6387 orphan_section_init. Remove virtual function place_orphan_here.
6388 (class Output_section_definition): Add is_relro and
6389 orphan_section_init. Remove place_orphan_here.
6390 (class Orphan_output_section): Likewise.
6391 (Script_sections::Script_sections): Update for field changes.
6392 (Script_sections::data_segment_align): Set saw_data_segment_align_
6393 and data_segment_align_start_, not data_segment_align_index.
6394 (Script_sections::data_segment_relro_end): Check
6395 saw_data_segment_align_. Use data_segment_align_start_ rather
6396 than data_segment_align_index_.
6397 (Script_sections::place_orphan): Rewrite to use
6398 Orphan_section_placement.
6399
6400 2009-03-17 Ian Lance Taylor <iant@google.com>
6401
6402 * archive.cc (Archive::add_symbols): Check for a version attached
6403 to the symbol name in the archive map.
6404 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
6405 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
6406 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
6407 (ver_test_11.a): New target.
6408 * testsuite/Makefile.in: Rebuild.
6409
6410 * configure.ac: Check for chsize and posix_fallocate. Replace
6411 ftruncate.
6412 * ftruncate.c: New file, from gnulib.
6413 * output.cc (posix_fallocate): Define dummy version if not
6414 HAVE_POSIX_FALLOCATE.
6415 (Output_file::map): Call posix_fallocate rather than lseek and
6416 write.
6417 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
6418 * configure, Makefile.in, config.in: Rebuild.
6419
6420 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
6421
6422 * layout.h (Layout::create_note): Add section_name parameter.
6423 * layout.cc (Layout::create_note): Likewise.
6424 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
6425
6426 2009-03-17 Ian Lance Taylor <iant@google.com>
6427
6428 * descriptors.cc: Include "options.h".
6429 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
6430 (Descriptors::open): Always use O_CLOEXEC when opening a new
6431 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
6432 then set FD_CLOEXEC.
6433
6434 * sparc.cc (class Target_sparc): Add has_got_section.
6435 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
6436 make sure we have a GOT section.
6437
6438 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
6439 (Target_sparc::Scan::local): Likewise.
6440 (Target_sparc::Scan::global): Likewise.
6441 (Target_sparc::Relocate::relocate): Likewise.
6442 (Target_sparc::Relocate::relocate_tls): Likewise.
6443
6444 * symtab.cc (Symbol_table::define_default_version): New function,
6445 broken out of add_from_object.
6446 (Symbol_table::add_from_object): Call define_default_version.
6447 (Symbol_table::define_special_symbol): Add resolve_oldsym
6448 parameter. Change all callers. If the version for a symbol comes
6449 from a version script, resolve it with the symbol with the same
6450 name with no version. Also add the symbol without a version if
6451 appropriate.
6452 (do_define_in_output_data): If resolving with oldsym, don't delete
6453 sym.
6454 (do_define_in_output_segment): Likewise.
6455 (do_define_as_constant): Likewise.
6456 * symtab.h (class Symbol_table): Update declarations.
6457
6458 2009-03-13 Ian Lance Taylor <iant@google.com>
6459
6460 * readsyms.cc (Read_symbols::incompatible_warning): New function.
6461 (Read_symbols::requeue): New function.
6462 (Read_symbols::do_read_symbols): If make_elf_object fails because
6463 the target type is not configured, and the file was searched for,
6464 issue a warning and retry with the next directory.
6465 (Add_symbols::run): If the file has an incompatible format, and
6466 it was searched for, requeue the Read_symbols task. On error,
6467 release the object.
6468 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
6469 dirindex parameter to constructor. Change all callers. Declare
6470 incompatible_warning and requeue.
6471 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
6472 input_argument_ and input_group_ fields. Add them to
6473 constructor. Change all callers.
6474 (class Read_script): Add dirindex_ field. Add it to constructor.
6475 Change all callers.
6476 * archive.cc (Archive::setup): Remove input_objects parameter.
6477 Change all callers.
6478 (Archive::get_file_and_offset): Likewise.
6479 (Archive::read_all_symbols): Likewise.
6480 (Archive::read_symbols): Likewise.
6481 (Archive::get_elf_object_for_member): Remove input_objects
6482 parameter. Add punconfigured parameter. Change all callers.
6483 (Archive::add_symbols): Change return type to bool. Check return
6484 value of include_member.
6485 (Archive::include_all_members): Likewise.
6486 (Archive::include_member): Change return type to bool. Return
6487 false if first included object has incompatible target. Set
6488 included_member_ field.
6489 (Add_archive_symbols::run): If add_symbols returns false, requeue
6490 Read_symbols task.
6491 * archive.h (class Archive): Add included_member_ field.
6492 Initialize it in constructor. Add input_file and searched_for
6493 methods. Update declarations.
6494 (class Add_archive_symbols): Add dirpath_, dirindex_, and
6495 input_argument_ fields. Add them to constructor. Change all
6496 callers.
6497 * script.cc: Include "target-select.h".
6498 (class Parser_closure): Add skip_on_incompatible_target_ and
6499 found_incompatible_target_ fields. Add
6500 skip_on_incompatible_target parameter to constructor. Change all
6501 callers. Add methods skip_on_incompatible_target,
6502 clear_skip_on_incompatible_target, found_incompatible_target, and
6503 set_found_incompatible_target.
6504 (read_input_script): Add dirindex parameter. Change all callers.
6505 If parser finds an incompatible target, requeue Read_symbols
6506 task.
6507 (script_set_symbol): Clear skip_on_incompatible_target in
6508 closure.
6509 (script_add_assertion, script_parse_option): Likewise.
6510 (script_start_sections, script_add_phdr): Likewise.
6511 (script_check_output_format): New function.
6512 * script.h (read_input_script): Update declaration.
6513 * script-c.h (script_check_output_format): Declare.
6514 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
6515 (ignore_cmd): Remove OUTPUT_FORMAT.
6516 * fileread.cc (Input_file::Input_file): Add explicit this.
6517 (Input_file::will_search_for): New function.
6518 (Input_file::open): Add pindex parameter. Change all callers.
6519 * fileread.h (class Input_file): Add input_file_argument method.
6520 Declare will_search_for. Update declarations.
6521 * object.cc (make_elf_object): Add punconfigured parameter.
6522 Change all callers.
6523 * object.h (class Object): Make input_file public. Add
6524 searched_for method.
6525 (make_elf_object): Update declaration.
6526 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
6527 restart search.
6528 * dirsearch.h (class Dirsearch): Update declaration.
6529 * options.h (class General_options): Add --warn-search-mismatch.
6530 * parameters.cc (Parameters::is_compatible_target): New function.
6531 * parameters.h (class Parameters): Declare is_compatible_target.
6532 * workqueue.cc (Workqueue::add_blocker): New function.
6533 * workqueue.h (class Workqueue): Declare add_blocker.
6534
6535 * fileread.cc (Input_file::open): Remove options parameter.
6536 Change all callers.
6537 (Input_file::open_binary): Likewise.
6538 * script.cc (read_input_script): Likewise.
6539 * readsyms.h (class Read_symbols): Remove options_ field. Remove
6540 options parameter from constructor. Change all callers.
6541 (class Read_script): Likewise.
6542 * fileread.h (class Input_file): Update declarations.
6543 * script.h (read_input_script): Update declaration.
6544
6545 2009-03-10 Nick Clifton <nickc@redhat.com>
6546
6547 * po/es.po: New Spanish translation.
6548
6549 2009-03-06 Cary Coutant <ccoutant@google.com>
6550
6551 * options.cc (parse_short_option): Keep dash_z from registering itself.
6552
6553 2009-03-03 Ian Lance Taylor <iant@google.com>
6554
6555 PR 9918
6556 * target-reloc.h (relocate_section): Pass output_section to
6557 relocate.
6558 * i386.cc (Target_i386::should_apply_static_reloc): Add
6559 output_section parameter. Change all callers.
6560 (Target_i386::Relocate::relocate): Add output_section parameter.
6561 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
6562 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
6563 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
6564 * testsuite/two_file_shared.sh: New script.
6565 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
6566 (check_DATA): Add two_file_shared.dbg.
6567 (two_file_shared.dbg): New target.
6568 * testsuite/Makefile.in: Rebuild.
6569
6570 2009-03-01 Ian Lance Taylor <iant@google.com>
6571
6572 * configure.ac: Check for byteswap.h.
6573 * configure: Rebuild.
6574 * config.in: Rebuild.
6575
6576 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
6577
6578 * layout.cc (Layout::find_or_add_kept_section): New function.
6579 (Layout::add_comdat): Removed.
6580 * layout.h (struct Kept_section): Move out of class Layout.
6581 Remove trailing underscores from field names. Add group_sections
6582 field. Rename group_ field to is_group. Change all uses.
6583 (class Layout): Declare find_or_add_kept_section, not add_comdat.
6584 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
6585 comdat_groups_ field.
6586 (Sized_relobj::include_section_group): Use
6587 find_or_add_kept_section and Kept_section::group_sections.
6588 (Sized_relobj::include_linkonce_section): Likewise.
6589 * object.cc (class Sized_relobj): Don't define Comdat_group or
6590 Comdat_group_table. Remove find_comdat_group and
6591 add_comdat_group. Remove comdat_groups_ field.
6592 * plugin.cc (include_comdat_group): Use
6593 Layout::find_or_add_kept_section.
6594
6595 2009-02-28 Ian Lance Taylor <iant@google.com>
6596
6597 * README: --gc-sections and map files are now supported. Document
6598 some build requirements.
6599
6600 PR 6992
6601 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
6602 relocatable link set the value of the section symbol to zero.
6603 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
6604 relocatable link don't include the section address in the local
6605 symbol value.
6606
6607 2009-02-27 Ian Lance Taylor <iant@google.com>
6608
6609 PR 6811
6610 * options.h (class Search_directory): Add is_system_directory.
6611 (class General_options): Declare is_in_system_directory.
6612 * options.cc (get_relative_sysroot): Make static.
6613 (get_default_sysroot): Make static.
6614 (General_optoins::is_in_system_directory): New function.
6615 * fileread.cc (Input_file::is_in_system_directory): New function.
6616 * fileread.h (class Input_file): Declare is_in_system_directory.
6617 * object.h (class Object): Add is_in_system_directory.
6618 (class Input_objects): Remove system_library_directory_ field.
6619 * object.cc (Input_objects::add_object): Don't set
6620 system_library_directory_.
6621 (input_objects::found_in_system_library_directory): Remove.
6622 * symtab.cc (Symbol_table::write_globals): Remove input_objects
6623 parameter. Change all callers.
6624 (Symbol_table::sized_write_globals): Likewise.
6625 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
6626 Call Object::is_in_system_directory.
6627 * symtab.h (class Symbol_table): Update declarations.
6628
6629 PR 5990
6630 * descriptors.h (Open_descriptor): Add is_on_stack field.
6631 * descriptors.cc (Descriptors::open): If the descriptor is on the
6632 top of the stack, remove it. Initialize is_on_stack field.
6633 (Descriptors::release): Only add pod to stack if it is not on the
6634 stack already.
6635 (Descriptors::close_some_descriptor): Clear stack_next and
6636 is_on_stack fields.
6637
6638 PR 7091
6639 * output.cc (Output_section::find_starting_output_address): Rename
6640 from starting_output_address; add PADDR parameter; change return
6641 type.
6642 * output.h (class Output_section): Declare
6643 find_starting_output_address instead of starting_output_address.
6644 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
6645 section symbol for which we can't find a merge section.
6646
6647 PR 9836
6648 * symtab.cc (Symbol_table::add_from_object): If the visibility is
6649 hidden or internal, force the symbol to be local.
6650 * resolve.cc (Symbol::override_visibility): Define.
6651 (Symbol::override_base): Use override_visibility.
6652 (Symbol_table::resolve): Likewise.
6653 (Symbol::override_base_with_special): Likewise.
6654 (Symbol_table::override_with_special): If the visibility is hidden
6655 or internal, force the symbol to be local.
6656 * symtab.h (class Symbol): Add set_visibility and
6657 override_visibility.
6658 * testsuite/ver_test_1.sh: New file.
6659 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
6660 (check_DATA): Add ver_test_1.syms.
6661 (ver_test_1.syms): New target.
6662 * testsuite/Makefile.in: Rebuild.
6663
6664 2009-02-25 Cary Coutant <ccoutant@google.com>
6665
6666 * layout.cc (Layout::choose_output_section): Don't rename sections
6667 when using a linker script that has a SECTIONS clause.
6668 * Makefile.in: Regenerate.
6669
6670 * testsuite/Makefile.am (script_test_5.sh): New test case.
6671 * testsuite/Makefile.in: Regenerate.
6672 * testsuite/script_test_5.cc: New file.
6673 * testsuite/script_test_5.sh: New file.
6674 * testsuite/script_test_5.t: New file.
6675
6676 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
6677
6678 * archive.cc (Archive::include_member): Update calls to add_symbols.
6679 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
6680 the Layout argument.
6681 * dynobj.h (do_add_symbols): Add the Layout argument.
6682 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
6683 Layout argument.
6684 * object.h (Object::add_symbols): Add the Layout argument.
6685 (Object::do_add_symbols): Add the Layout argument.
6686 (Sized_relobj::do_add_symbols): Add the Layout argument.
6687 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
6688 Unify the two versions.
6689 (Add_plugin_symbols): Remove.
6690 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
6691 (Sized_pluginobj::do_add_symbols): Unify the two versions.
6692 (Add_plugin_symbols): Remove.
6693 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
6694 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
6695 (Add_symbols::run): Make it work with Pulginobj.
6696
6697 2009-02-06 Ian Lance Taylor <iant@google.com>
6698
6699 * object.cc (Sized_relobj::do_layout): Make info message start
6700 with lower case letter.
6701
6702 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
6703
6704 * binary.cc: Fix file comment.
6705
6706 * options.h (enum Incremental_disposition): Define.
6707 (class General_options): Add new options: --incremental,
6708 --incremental_changed, --incremental_unchanged,
6709 --incremental_unknown. Add incremental_disposition_ and
6710 implicit_incremental_ fields.
6711 (General_options::incremental_disposition): New function.
6712 (class Position_dependent_options): Add incremental_disposition
6713 option.
6714 (Position_dependent_options::copy_from_options): Set incremental
6715 dispositions.
6716 * options.cc (General_options::parse_incremental_changed): New
6717 function.
6718 (General_options::parse_incremental_unchanged): New function.
6719 (General_options::parse_incremental_unknown): New function.
6720 (General_options::General_options): Initialize new fields
6721 incremental_disposition_ and implicit_incremental_.
6722 (General_options::finalize): Check for uasge of --incremental-*
6723 without --incremental.
6724
6725 2009-02-06 Chris Demetriou <cgd@google.com>
6726
6727 * gold.h (gold_undefined_symbol): Change to take only a Symbol
6728 pointer and to report location as the file name associated with
6729 the symbol.
6730 (gold_undefined_symbol_at_location): New function to replace the
6731 old gold_undefined_symbol functionality.
6732 * target-reloc.h (relocate_section): Update to use
6733 gold_undefined_symbol_at_location.
6734 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
6735 Call gold_undefined_symbol function rather than gold_error.
6736 * errors.h (Errors::undefined_symbol): Take location as a
6737 string, rather than calculating it from a relocation.
6738 * errors.cc (Errors::fatal): Print "fatal error:" before the
6739 formatted message.
6740 (Errors::error, Errors::error_at_location): Print "error: "
6741 before the formatted message.
6742 (Errors::undefined_symbol): Take location as a string, rather
6743 than calculating it from a relocation.
6744 (gold_undefined_symbol_at_location): New function akin to
6745 old gold_undefined_symbol, calculates location from relocation.
6746 (gold_undefined_symbol): Change to take only a Symbol pointer
6747 and to report location as the file name associated with the symbol.
6748 * testsuite/debug_msg.sh: Update for changed error messages.
6749 * testsuite/undef_symbol.sh: Likewise.
6750
6751 2009-02-04 Duncan Sands <baldrick@free.fr>
6752
6753 PR 9812
6754 * reduced_debug_output.h
6755 (Output_reduced_debug_abbrev_section::failed): Use format for
6756 gold_warning.
6757 (Output_reduced_debug_info_section::faild): Likewise.
6758
6759 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
6760
6761 * script.cc (Lazy_demangler): New class.
6762 (Version_script_info::get_symbol_version_helper): Demangle a
6763 symbol only once.
6764
6765 2009-01-29 Cary Coutant <ccoutant@google.com>
6766
6767 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
6768 to __tls_get_addr.
6769 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
6770
6771 2009-01-28 Ian Lance Taylor <iant@google.com>
6772
6773 * version.cc (version_string): Bump to 1.9.
6774
6775 * gold.h: Include <cstring> and <stdint.h>.
6776 * version.cc: Include <cstdio>.
6777 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
6778 warning.
6779 * reduced_debug_output.cc (insert_into_vector): Rename from
6780 Insert_into_vector; change all callers. Use Swap_unaligned to
6781 avoid aliasing issue; remove union since it is unnecessary.
6782
6783 2009-01-27 Sriraman Tallam <tmsriram@google.com>
6784
6785 * Makefile.am (CCFILES): Add gc.cc.
6786 (HFILES): Add gc.h.
6787 * Makefile.in: Regenerate.
6788 * gold.cc (Gc_runner): New class.
6789 (queue_initial_tasks): Call garbage collection related tasks
6790 when corresponding options are invoked.
6791 (queue_middle_gc_tasks): New function.
6792 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
6793 processed early before laying out sections during garbage collection.
6794 * gold.h (queue_middle_gc_tasks): New function.
6795 (is_prefix_of): Move from "layout.cc".
6796 * i386.cc (Target_i386::gc_process_relocs): New function.
6797 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
6798 * main.cc (main): Create object of class "Garbage_collection".
6799 * object.cc (Relobj::copy_symbols_data): New function.
6800 (Relobj::is_section_name_included): New function.
6801 (Sized_relobj::do_layout): Allow this function to be called twice
6802 during garbage collection and defer layout of section during the
6803 first call.
6804 * object.h (Relobj::get_symbols_data): New function.
6805 (Relobj::is_section_name_included): New function.
6806 (Relobj::copy_symbols_data): New function.
6807 (Relobj::set_symbols_data): New function.
6808 (Relobj::get_relocs_data): New function.
6809 (Relobj::set_relocs_data): New function.
6810 (Relobj::is_output_section_offset_invalid): New pure virtual function.
6811 (Relobj::gc_process_relocs): New function.
6812 (Relobj::do_gc_process_relocs): New pure virtual function.
6813 (Relobj::sd_): New data member.
6814 (Sized_relobj::is_output_section_offset_invalid): New function.
6815 (Sized_relobj::do_gc_process_relocs): New function.
6816 * options.h (General_options::gc_sections): Modify to not be a no-op.
6817 (General_options::print_gc_sections): New option.
6818 * plugin.cc (Plugin_finish::run): Remove function call to
6819 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
6820 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
6821 * reloc.cc (Read_relocs::run): Add task to process relocs and
6822 determine unreferenced sections when doing garbage collection.
6823 (Gc_process_relocs): New class.
6824 (Sized_relobj::do_gc_process_relocs): New function.
6825 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
6826 sections that are garbage collected.
6827 * reloc.h (Gc_process_relocs): New class.
6828 * sparc.cc (Target_sparc::gc_process_relocs): New function.
6829 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
6830 symbols whose corresponding sections are garbage collected.
6831 (Symbol_table::Symbol_table): Add new parameter for the garbage
6832 collection object.
6833 (Symbol_table::gc_mark_undef_symbols): New function.
6834 (Symbol_table::gc_mark_symbol_for_shlib): New function.
6835 (Symbol_table::gc_mark_dyn_syms): New function.
6836 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
6837 as garbage.
6838 (Symbol_table::add_from_object): Likewise.
6839 (Symbol_table::add_from_relobj): When building shared objects, do not
6840 treat externally visible symbols as garbage.
6841 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
6842 table information for static and relocatable links.
6843 * symtab.h (Symbol_table::set_gc): New function.
6844 (Symbol_table::gc): New function.
6845 (Symbol_table::gc_mark_undef_symbols): New function.
6846 (Symbol_table::gc_mark_symbol_for_shlib): New function.
6847 (Symbol_table::gc_mark_dyn_syms): New function.
6848 (Symbol_table::gc_): New data member.
6849 * target.h (Sized_target::gc_process_relocs): New pure virtual
6850 function.
6851 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
6852 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
6853
6854 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
6855
6856 * options.h (General_options::gc_sections): Define as a no-op for now.
6857 (General_options::no_keep_memory): Ditto.
6858 (General_options::Bshareable): Define.
6859 * options.cc (General_options::finalize): Honor -Bshareable.
6860
6861 2009-01-20 Andreas Schwab <schwab@suse.de>
6862
6863 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
6864 read the value in the contents, since we don't use it. Use the
6865 template endianness when writing.
6866 (Relocate::relocate): Use it for R_PPC_REL16_HA.
6867
6868 2009-01-19 Andreas Schwab <schwab@suse.de>
6869
6870 * configure.tgt (powerpc64-*): Fix targ_obj.
6871
6872 2009-01-15 Ian Lance Taylor <iant@google.com>
6873
6874 * object.cc (Sized_relobj::write_local_symbols): Don't write out
6875 local symbols when stripping all symbols.
6876
6877 2009-01-14 Cary Coutant <ccoutant@google.com>
6878
6879 * output.cc (Output_reloc): Add explicit instantiations.
6880
6881 2009-01-14 Cary Coutant <ccoutant@google.com>
6882
6883 * archive.cc (Archive::get_elf_object_for_member): Remove call
6884 to File_read::claim_for_plugin.
6885 * descriptors.cc (Descriptors::open): Remove reference to
6886 is_claimed.
6887 (Descriptors::claim_for_plugin): Remove.
6888 * descriptors.h (Descriptors::claim_for_plugin): Remove.
6889 (Descriptors::is_claimed): Remove.
6890 (claim_descriptor_for_plugin): Remove.
6891 * fileread.cc (File_read::claim_for_plugin): Remove.
6892 * fileread.h (File_read::claim_for_plugin): Remove.
6893 (File_read::descriptor): Reopen descriptor if necessary.
6894 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
6895 (Plugin_manager::all_symbols_read): Add task parameter. Change
6896 all callers.
6897 (Plugin_manager::get_input_file): New function.
6898 (Plugin_manager::release_input_file): New function.
6899 (Pluginobj::Pluginobj): Add filesize parameter and initialize
6900 corresponding data member.
6901 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
6902 and pass to base constructor. Change all callers.
6903 (get_input_file, release_input_file): New functions.
6904 (make_sized_plugin_object): Add filesize parameter. Change all callers.
6905 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
6906 (Plugin_manager::all_symbols_read): Add task parameter.
6907 (Plugin_manager::get_input_file): New function.
6908 (Plugin_manager::release_input_file): New function.
6909 (Plugin_manager::task_): New data member.
6910 (Pluginobj::Pluginobj): Add filesize parameter.
6911 (Pluginobj::filename): New function.
6912 (Pluginobj::descriptor): New function.
6913 (Pluginobj::filesize): New function.
6914 (Pluginobj::filesize_): New data member.
6915 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
6916 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
6917 File_read::claim_for_plugin; use Object::unlock to unlock the file.
6918
6919 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
6920 with archive libraries.
6921 * testsuite/Makefile.in: Regenerate.
6922 * testsuite/plugin_test.c (struct sym_info): New type.
6923 (get_input_file, release_input_file): New static variables.
6924 (onload): Capture new transfer vector entries.
6925 (claim_file_hook): Stop reading at end of file according to filesize.
6926 Factor out parsing of readelf output into separate function.
6927 (all_symbols_read_hook): Exercise get_input_file and release_input_file
6928 APIs and get the source file name from the symbol table. Convert
6929 source file name to corresponding object file name. Print info
6930 message when adding new input files.
6931 (parse_readelf_line): New function.
6932 * testsuite/plugin_test_1.sh: Add checks for new info messages.
6933 * testsuite/plugin_test_2.sh: Likewise.
6934 * testsuite/plugin_test_3.sh: Likewise.
6935 * testsuite/plugin_test_4.sh: New test case.
6936
6937 2009-01-07 Ian Lance Taylor <iant@google.com>
6938
6939 * version.cc (version_string): Bump to 1.8.
6940
6941 2008-12-23 Cary Coutant <ccoutant@google.com>
6942
6943 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
6944 * plugin.cc (Plugin_manager::finish): Rename as
6945 layout_deferred_objects. Move cleanup to separate function.
6946 (Plugin_manager::cleanup): New function.
6947 (Plugin_finish::run): Call layout_deferred_objects and cleanup
6948 separately.
6949 * plugin.h (Plugin_manager::finish): Rename as
6950 layout_deferred_objects.
6951 (Plugin_manager::cleanup): New function.
6952 (Plugin_manager::cleanup_done): New field.
6953
6954 2008-12-23 Cary Coutant <ccoutant@google.com>
6955
6956 * plugin.cc (is_visible_from_outside): New function.
6957 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
6958 so we don't return "IR only" status for exported symbols or -r links.
6959
6960 * testsuite/Makefile.am (plugin_test_3): New test case.
6961 * testsuite/Makefile.in: Regenerate.
6962 * testsuite/plugin_test_3.sh: New file.
6963
6964 2008-12-22 Cary Coutant <ccoutant@google.com>
6965
6966 * object.cc (Sized_relobj::layout_section): New function.
6967 (Sized_relobj::do_layout): Defer layout of input sections until after
6968 plugin has provided replacement files.
6969 (Sized_relobj::do_layout_deferred_sections): New function.
6970 * object.h (Relobj::set_section_offset): Remove virtual keyword.
6971 (Relobj::layout_deferred_sections): New function.
6972 (Relobj::do_layout_deferred_sections): New function.
6973 (Sized_relobj::do_layout_deferred_sections): New function.
6974 (Sized_relobj::layout_section): New function.
6975 (Sized_relobj::Deferred_layout): New structure.
6976 (Sized_relobj::deferred_layout_): New field.
6977 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
6978 Change all callers. Layout deferred sections.
6979 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
6980 references.
6981 (Plugin_hook::run): Move code from do_plugin_hook inline.
6982 (Plugin_hook::do_plugin_hook): Remove.
6983 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
6984 (Plugin_manager::finish): Renamed, was cleanup.
6985 (Plugin_manager::should_defer_layout): New function.
6986 (Plugin_manager::add_deferred_layout_object): New function.
6987 (Plugin_manager::Deferred_layout_list): New type.
6988 (Plugin_manager::deferred_layout_objects_): New field.
6989 (Plugin_hook::do_plugin_hook): Remove.
6990
6991 2008-12-17 Ian Lance Taylor <iant@google.com>
6992
6993 * options.h (class General_options): Add --no case for
6994 --export-dynamic.
6995
6996 2008-12-16 Cary Coutant <ccoutant@google.com>
6997
6998 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
6999 vector.
7000 (Plugin_manager::claim_file): Create plugin object even if
7001 plugin did not call the add_symbols callback.
7002 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
7003 asking for more symbols than were added.
7004 * testsuite/Makefile.am (plugin_test_1): Add test case with
7005 no global symbols.
7006 (empty.syms): New target.
7007 * testsuite/Makefile.in: Regenerate.
7008 * testsuite/plugin_test.c (claim_file_hook): Add new debug
7009 message. Don't call add_symbols if no globals.
7010 (all_symbols_read_hook): Don't provide replacement for empty
7011 claimed file.
7012
7013 2008-12-12 Ian Lance Taylor <iant@google.com>
7014
7015 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
7016 r_type == 0 for a local symbol with r_sym == 0.
7017 (scan_relocatable_relocs): Pass r_sym to
7018 local_non_section_strategy.
7019 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
7020 r_sym parameter.
7021
7022 * configure.ac: Update test for TLS descriptors: they are
7023 supported as of glibc 2.9.
7024 * configure: Rebuild.
7025
7026 2008-12-11 Ian Lance Taylor <iant@google.com>
7027
7028 PR 7091
7029 * target-reloc.h (Default_scan_relocatable_relocs): For each
7030 function, map r_type == 0 to RELOC_DISCARD.
7031
7032 2008-12-10 Cary Coutant <ccoutant@google.com>
7033
7034 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
7035 object to override a kept COMDAT group from a plugin object.
7036
7037 2008-12-09 Ian Lance Taylor <iant@google.com>
7038
7039 PR 7088
7040 * yyscript.y (file_cmd): Handle INPUT.
7041
7042 * testsuite/initpri1.c: Change all declarations to be full
7043 prototypes by adding void, to avoid compiler warnings.
7044
7045 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
7046
7047 * options.cc (General_options::parse_plugin_opt): New.
7048 (General_options::add_plugin): The argument now is just the filename.
7049 (General_options::add_plugin_option): New.
7050 * options.h (plugin_opt): New.
7051 (add_plugin): Change argument name.
7052 (add_plugin_option): New.
7053 * plugin.cc (Plugin::load): Don't parse the plugin option.
7054 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
7055 (Plugin::add_option): New.
7056 (Plugin::args_): Change type.
7057 (Plugin::filename_): New.
7058 (Plugin_manager::add_plugin_option): New.
7059 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
7060 * testsuite/Makefile.in: Regenerate.
7061
7062 2008-12-05 Cary Coutant <ccoutant@google.com>
7063
7064 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
7065 Handle --strip-lto-sections option.
7066 * options.h (strip_lto_sections): New option.
7067
7068 2008-12-01 Cary Coutant <ccoutant@google.com>
7069
7070 * plugin.cc (ld_plugin_message): Change format parameter to const.
7071 Fix mismatch between new[] and delete.
7072
7073 2008-11-14 Cary Coutant <ccoutant@google.com>
7074
7075 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
7076 instead of -1U.
7077
7078 2008-11-05 Craig Silverstein <csilvers@google.com>
7079
7080 * options.cc (General_options::parse_dynamic_list): New function.
7081 * options.h (General_options): New flags dynamic_list,
7082 dynamic_list_data, dynamic_list_cpp_new, and
7083 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
7084 (General_options::in_dynamic_list): New function.
7085 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
7086 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
7087 (Lex::can_continue_name): Likewise.
7088 (yylex): Likewise.
7089 (read_script_file): New parameter script_options.
7090 (read_dynamic_list): New function.
7091 (Script_options::define_dynamic_list): New function.
7092 (dynamic_list_keyword_parsecodes): New variable.
7093 (dynamic_list_keywords): New variable.
7094 * script.h (Script_options::define_dynamic_list): New function
7095 prototype.
7096 (read_dynamic_list): New function prototype.
7097 * symtab.cc (strprefix): New macro.
7098 (Symbol::should_add_dynsym_entry): Support dynamic_list,
7099 dynamic_list_data, dynamic_list_cpp_new, and
7100 dynamic_list_cpp_typeinfo.
7101 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
7102 (dynamic_list_expr): New rule.
7103 (dynamic_list_nodes): Likewise.
7104 (dynamic_list_node): Likewise.
7105 * testsuite/Makefile.am (dynamic_list): New test.
7106 * testsuite/Makefile.in: Regenerated.
7107 * testsuite/dynamic_list.t: New file.
7108 * testsuite/dynamic_list.sh: New file.
7109
7110 2008-11-05 Craig Silverstein <csilvers@google.com>
7111
7112 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
7113 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
7114 (t11_last): Likewise.
7115 * testsuite/ver_test_6.c (main): Likewise.
7116
7117 2008-10-07 Cary Coutant <ccoutant@google.com>
7118
7119 * options.c (General_options::finalize): Add check for -static and
7120 -shared.
7121 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
7122 is not empty.
7123
7124 2008-10-02 Cary Coutant <ccoutant@google.com>
7125
7126 * plugin.cc (make_sized_plugin_object): Fix conditional
7127 compilation to work when not all targets are enabled.
7128
7129 2008-09-29 Cary Coutant <ccoutant@google.com>
7130
7131 * archive.cc (Archive::get_file_and_offset): Use filename instead
7132 of name to get library path.
7133 (Archive::include_member): Unlock external member of a thin archive.
7134
7135 * testsuite/Makefile.am (TEST_AR): New variable.
7136 (thin_archive_test_1): New test.
7137 (thin_archive_test_2): New test.
7138 * testsuite/Makefile.in: Regenerate.
7139 * testsuite/thin_archive_main.cc: New file.
7140 * testsuite/thin_archive_test_1.cc: New file.
7141 * testsuite/thin_archive_test_2.cc: New file.
7142 * testsuite/thin_archive_test_3.cc: New file.
7143 * testsuite/thin_archive_test_4.cc: New file.
7144
7145 2008-09-29 Cary Coutant <ccoutant@google.com>
7146
7147 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
7148 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
7149 instead of -1U.
7150 (Sized_relobj::do_finalize_local_symbols): Likewise.
7151 (Sized_relobj::map_to_kept_section): Likewise.
7152 * object.h (Sized_relobj::invalid_address): New constant.
7153 (Sized_relobj::do_output_section_offset): Check for invalid_address
7154 and return -1ULL.
7155 * output.cc (Output_reloc::local_section_offset): Use constant
7156 invalid_address instead of -1U.
7157 (Output_reloc::get_address): Likewise.
7158 (Output_section::output_address): Change -1U to -1ULL.
7159 * output.h (Output_reloc::invalid_address): New constant.
7160 * reloc.cc (Sized_relobj::write_sections): Use constant
7161 invalid_address instead of -1U.
7162 (Sized_relobj::relocate_sections): Likewise.
7163 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
7164 values for merge sections.
7165 * target-reloc.h (relocate_for_relocatable): Use constant
7166 invalid_address instead of -1U.
7167
7168 2008-09-19 Cary Coutant <ccoutant@google.com>
7169
7170 Add plugin functionality for link-time optimization (LTO).
7171 * configure.ac (plugins): Add --enable-plugins option.
7172 * configure: Regenerate.
7173 * config.in: Regenerate.
7174 * Makefile.am (LIBDL): New variable.
7175 (CCFILES): Add plugin.cc.
7176 (HFILES): Add plugin.h.
7177 (ldadd_var): Add LIBDL.
7178 * Makefile.in: Regenerate.
7179
7180 * archive.cc: Include "plugin.h".
7181 (Archive::setup): Don't preread archive symbols when using a plugin.
7182 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
7183 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
7184 files.
7185 (Archive::include_member): Add symbols from plugin objects.
7186 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
7187 * descriptors.cc (Descriptors::open): Check for file descriptors
7188 abandoned by plugins.
7189 (Descriptors::claim_for_plugin): New function.
7190 * descriptors.h (Descriptors::claim_for_plugin): New function.
7191 (Open_descriptor::is_claimed): New field.
7192 (claim_descriptor_for_plugin): New function.
7193 * fileread.cc (File_read::claim_for_plugin): New function.
7194 * fileread.h (File_read::claim_for_plugin): New function.
7195 (File_read::descriptor): New function.
7196 * gold.cc: Include "plugin.h".
7197 (queue_initial_tasks): Add task to call plugin hooks for generating
7198 new object files.
7199 * main.cc: Include "plugin.h".
7200 (main): Load plugin libraries.
7201 * object.h (Pluginobj): Declare.
7202 (Object::pluginobj): New function.
7203 (Object::do_pluginobj): New function.
7204 (Object::set_target): New function.
7205 * options.cc: Include "plugin.h".
7206 (General_options::parse_plugin): New function.
7207 (General_options::General_options): Initialize plugins_ field.
7208 (General_options::add_plugin): New function.
7209 * options.h (Plugin_manager): Declare.
7210 (General_options): Add --plugin option.
7211 (General_options::has_plugins): New function.
7212 (General_options::plugins): New function.
7213 (General_options::add_plugin): New function.
7214 (General_options::plugins_): New field.
7215 * plugin.cc: New file.
7216 * plugin.h: New file.
7217 * readsyms.cc: Include "plugin.h".
7218 (Read_symbols::do_read_symbols): Check for archive before checking
7219 for ELF file. Call plugin hooks to claim files.
7220 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
7221 from a real object file; force override when processing replacement
7222 files.
7223 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
7224 (Symbol::init_base_object): Likewise.
7225 (Symbol::init_base_output_data): Likewise.
7226 (Symbol::init_base_output_segment): Likewise.
7227 (Symbol::init_base_constant): Likewise.
7228 (Symbol::init_base_undefined): Likewise.
7229 (Symbol::output_section): Assert that object is not a plugin.
7230 (Symbol_table::add_from_pluginobj): New function.
7231 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
7232 undefined.
7233 (Symbol_table::sized_write_globals): Likewise.
7234 (Symbol_table::add_from_pluginobj): Instantiate template.
7235 * symtab.h (Sized_pluginobj): Declare.
7236 (Symbol::in_real_elf): New function.
7237 (Symbol::set_in_real_elf): New function.
7238 (Symbol::in_real_elf_): New field.
7239 (Symbol_table::add_from_pluginobj): New function.
7240
7241 * testsuite/Makefile.am (AM_CFLAGS): New variable.
7242 (LIBDL): New variable.
7243 (LDADD): Add LIBDL.
7244 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
7245 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
7246 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
7247 (MOSTLYCLEANFILES): Likewise.
7248 * testsuite/Makefile.in: Regenerate.
7249 * testsuite/plugin_test.c: New file.
7250 * testsuite/plugin_test_1.sh: New file.
7251 * testsuite/plugin_test_2.sh: New file.
7252
7253 2008-09-16 Ian Lance Taylor <iant@google.com>
7254
7255 * target-reloc.h (relocate_section): Check whether a symbol is
7256 defined by the ABI before reporting an undefined symbol error.
7257 * target.h (Target::is_defined_by_abi): Make parameter const.
7258 (Target::do_is_defined_by_abi): Likewise.
7259 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
7260 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
7261 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
7262 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
7263 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
7264 * testsuite/Makefile.in: Rebuild.
7265
7266 * fileread.cc (make_view): Add casts to avoid warning.
7267
7268 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
7269
7270 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
7271 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7272
7273 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
7274
7275 * options.h (General_options::output_is_executable): New.
7276 (General_options::output_is_pie): New.
7277 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
7278 for shared libraries.
7279 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7280
7281 2008-09-11 Chris Demetriou <cgd@google.com>
7282
7283 * options.h (origin): New -z option.
7284 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
7285 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
7286 in DT_FLAGS_1.
7287
7288 2008-09-05 Cary Coutant <ccoutant@google.com>
7289
7290 * fileread.cc (File_read::make_view): Add check for attempt to map
7291 beyond end of file.
7292
7293 2008-09-05 Cary Coutant <ccoutant@google.com>
7294
7295 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
7296 explicit instantiations.
7297
7298 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
7299
7300 PR gold/6858
7301 * options.cc (General_options::finalize): Allow undefined symbols
7302 in shlibs if linking -shared.
7303
7304 PR gold/6859
7305 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
7306 symbols as not needing a dynsym entry.
7307
7308 2008-08-20 Craig Silverstein <csilvers@google.com>
7309
7310 * fileread.cc (File_read::open): Do not lock the file unless it
7311 was successfully opened.
7312
7313 2008-08-14 Cary Coutant <ccoutant@google.com>
7314
7315 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
7316 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
7317 * testsuite/tls_test.cc (struct int128): 128-bit struct
7318 for testing TLS relocs with non-zero addend.
7319 (v12): New TLS variable.
7320 (t12): New test.
7321 (t_last): Add check for v12.
7322 * testsuite/tls_test.h (t12): New function.
7323 * testsuite/tls_test_main.cc (thread_routine): Call new test.
7324
7325 2008-08-13 Ian Lance Taylor <iant@google.com>
7326
7327 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
7328 set tls_segment_ or relro_segment_.
7329 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
7330 when appropriate.
7331 * output.h (Output_section::clear_is_relro): New function.
7332 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
7333 sections specially even when output_data_ is empty.
7334 (Output_segment::maximum_alignment): When first section is relro,
7335 only force alignment for PT_LOAD segments.
7336 * script.cc (script_data_segment_align): New function.
7337 (script_data_segment_relro_end): New function.
7338 * script-c.h (script_data_segment_align): Declare.
7339 (script_data_segment_relro_end): Declare.
7340 * script-sections.h (class Script_sections): Declare
7341 data_segment_align and data_segment_relro_end. Add fields
7342 segment_align_index_ and saw_relro_end_.
7343 * script-sections.cc (class Sections_element): Add set_is_relro
7344 virtual function. Add new bool* parameter to place_orphan_here.
7345 Add get_output_section virtual function.
7346 (class Output_section_definition): Add set_is_relro. Add new
7347 bool* parameter to place_orphan_here. Add get_output_section.
7348 Add is_relro_ field.
7349 (Output_section_definition::Output_section_definition): Initialize
7350 evaluated_address_, evaluated_load_address, evaluated_addralign_,
7351 and is_relro_ fields.
7352 (Output_section_definition::place_orphan_here): Add is_relro
7353 parameter.
7354 (Output_section_definition::set_section_addresses): Set relro for
7355 output section.
7356 (Output_section_definition::alternate_constraint): Likewise.
7357 (class Orphan_output_section): Add new bool* parameter to
7358 place_orphan_here. Add get_output_section.
7359 (Orphan_output_section::place_orphan_here): Add is_relro
7360 parameter.
7361 (Script_sections::Script_sections): Initialize
7362 data_segment_align_index_ and saw_relro_end_.
7363 (Script_sections::data_segment_align): New function.
7364 (Script_sections::data_segment_relro_end): New function.
7365 (Script_sections::place_orphan): Set or clear is_relro.
7366 (Script_sections::set_section_addresses): Force alignment of first
7367 TLS section.
7368 * yyscript.y (exp): Call script_data_segment_align and
7369 script_data_segment_relro_end.
7370 * testsuite/relro_script_test.t: New file.
7371 * testsuite/relro_test.cc (using_script): Declare.
7372 (t1, t2): Test using_script.
7373 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
7374 (relro_script_test_SOURCES): Define.
7375 (relro_script_test_DEPENDENCIES): Define.
7376 (relro_script_test_LDFLAGS): Define.
7377 (relro_script_test_LDADD): Define.
7378 (relro_script_test.so): New target.
7379 * testsuite/Makefile.in: Rebuild.
7380
7381 2008-08-06 Cary Coutant <ccoutant@google.com>
7382
7383 * archive.cc (Archive::total_archives, Archive::total_members)
7384 (Archive::total_members_loaded): New variables.
7385 (Archive::setup): Add parameter. Add option to preread
7386 archive symbols.
7387 (Archive::read_armap): Add counter.
7388 (Archive::get_file_and_offset): New function.
7389 (Archive::get_elf_object_for_member): New function.
7390 (Archive::read_all_symbols): New function.
7391 (Archive::read_symbols): New function.
7392 (Archive::add_symbols): Add counters.
7393 (Archive::include_all_members): Use armap to find members if it's
7394 already built.
7395 (Archive::include_member): Skip reading symbols if already read.
7396 Factored code into Archive::get_file_and_offset and
7397 Archive::get_elf_object_for_member. Changed call to
7398 Mapfile::report_include_archive_member.
7399 (Archive::print_stats): New function.
7400 * archive.h: Declare Object and Read_symbols_data classes.
7401 (Archive::Archive): Add initializers for new members.
7402 (Archive::setup): Add parameter.
7403 (Archive::print_stats): New function.
7404 (Archive::total_archives, Archive::total_members)
7405 (Archive::total_members_loaded): New variables.
7406 (Archive::get_file_and_offset): New function.
7407 (Archive::get_elf_object_for_member): New function.
7408 (Archive::read_all_symbols): New function.
7409 (Archive::read_symbols): New function.
7410 (Archive::Archive_member): New class.
7411 (Archive::members_): New member.
7412 (Archive::num_members_): New member.
7413 * main.cc: Include archive.h.
7414 (main): Call Archive::print_stats.
7415 * mapfile.cc (Mapfile::report_include_archive_member): Delete
7416 archive parameter; member_name is now the fully-decorated name.
7417 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
7418 * options.h: (General_options): Add --preread-archive-symbols option.
7419 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
7420 Archive::setup.
7421
7422 2008-08-04 Ian Lance Taylor <iant@google.com>
7423
7424 * symtab.h (Symbol::use_plt_offset): New function.
7425 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
7426 * powerpc.cc (Relocate::relocate): Likewise.
7427 * sparc.cc (Relocate::relocate): Likewise.
7428 * x86_64.cc (Relocate::relocate): Likewise.
7429 * testsuite/weak_plt.sh: New test.
7430 * testsuite/weak_plt_main.cc: New test.
7431 * testsuite/weak_plt_shared.cc: New test.
7432 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
7433 (check_PROGRAMS): Add weak_plt.
7434 (check_DATA): Add weak_plt_shared.so.
7435 (weak_plt_main_pic.o, weak_plt): New targets.
7436 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
7437 * testsuite/Makefile.in: Rebuild.
7438
7439 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
7440 gcctestdir/ld.
7441 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
7442 * testsuite/Makefile.in: Rebuild.
7443
7444 2008-08-04 Alan Modra <amodra@bigpond.net.au>
7445
7446 * Makefile.am (POTFILES.in): Set LC_ALL=C.
7447 * Makefile.in: Regenerate.
7448 * po/POTFILES.in: Regenerate.
7449
7450 2008-07-29 Ian Lance Taylor <iant@google.com>
7451
7452 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
7453 symbols before other symbols.
7454 * testsuite/script_test_2.cc (test_addr): Declare.
7455 (test_addr_alias): Declare.
7456 (main): Check that test_addr and test_addr_alias have the right
7457 values.
7458 * testsuite/script_test_2.t: Define test_addr_alias and
7459 test_addr.
7460
7461 2008-07-24 Ian Lance Taylor <iant@google.com>
7462
7463 PR 5990
7464 * descriptors.cc: New file.
7465 * descriptors.h: New file.
7466 * gold-threads.h (class Hold_optional_lock): New class.
7467 * fileread.cc: Include "descriptors.h".
7468 (File_read::~File_read): Release descriptor rather than closing
7469 it.
7470 (File_read::open) [file]: Call open_descriptor rather than open.
7471 Set is_descriptor_opened_.
7472 (File_read::open) [memory]: Assert that descriptor is not open.
7473 (File_read::reopen_descriptor): New function.
7474 (File_read::release): Release descriptor.
7475 (File_read::do_read): Make non-const. Reopen descriptor.
7476 (File_read::read): Make non-const.
7477 (File_read::make_view): Reopen descriptor.
7478 (File_read::do_readv): Likewise.
7479 * fileread.h (class File_read): Add is_descriptor_opened_ field.
7480 Update declarations.
7481 * layout.cc: Include "descriptors.h".
7482 (Layout::create_build_id): Use open_descriptor rather than open.
7483 * output.cc: Include "descriptors.h".
7484 (Output_file::open): Use open_descriptor rather than open.
7485 * archive.cc (Archive::const_iterator): Change Archive to be
7486 non-const.
7487 (Archive::begin, Archive::end): Make non-const.
7488 (Archive::count_members): Likewise.
7489 * archive.h (class Archive): Update declarations.
7490 * object.h (Object::read): Make non-const.
7491 * Makefile.am (CCFILES): Add descriptors.cc.
7492 (HFILES): Add descriptors.h.
7493 * Makefile.in: Rebuild.
7494
7495 PR 6716
7496 * gold.h: Always include <clocale>. Add Solaris workarounds
7497 following code in binutils/sysdep.h.
7498
7499 PR 6048
7500 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
7501 this->eh_frame_hdr_ is NULL before using it.
7502
7503 * dynobj.cc (Versions::Versions): Update comment.
7504
7505 * dynobj.cc (Versions::Versions): If there is an soname, use it as
7506 the base version name.
7507
7508 * stringpool.cc (Stringpool_template::add_with_length): Set key to
7509 array size plus one.
7510 (Stringpool_template::set_string_offsets): Subtract one from key
7511 before using it as an array index.
7512 (Stringpool_template::get_offset_with_length): Likewise.
7513 (Stringpool_template::write_to_buffer): Likewise.
7514 * stringpool.h (Stringpool_template::get_offset_from_key):
7515 Likewise.
7516
7517 2008-07-23 Ian Lance Taylor <iant@google.com>
7518
7519 PR 6658
7520 * object.h (Merged_symbol_value::value): Do our best to handle a
7521 negative addend.
7522
7523 PR 6647
7524 * script.cc (Version_script_info::get_versions): Don't add empty
7525 version tag to return value.
7526 (Version_script_info::get_symbol_version_helper): Change return
7527 type to bool. Add pversion parameter. Change all callers.
7528 (script_register_vers_node): Don't require a non-NULL tag.
7529 * script.h (class Version_script_info): Update declarations.
7530 (Version_script_info::get_symbol_version): Change return type to
7531 bool. Add version parameter. Change all callers.
7532 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
7533 handling. Handle an empty version from a version script.
7534 (Symbol_table::define_special_symbol): Likewise.
7535 * testsuite/ver_test_10.script: New file.
7536 * testsuite/ver_test_10.sh: New file.
7537 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
7538 (check_DATA): Add ver_test_10.syms.
7539 (ver_test_10.syms, ver_test_10.so): New target.
7540 * testsuite/Makefile.in: Rebuild.
7541
7542 2008-07-23 Simon Baldwin <simonb@google.com>
7543
7544 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
7545 to zero for undefined symbols from dynamic libraries.
7546
7547 2008-07-23 Ian Lance Taylor <iant@google.com>
7548
7549 * symtab.cc (Symbol_table::resolve): Remove version parameter.
7550 Change all callers.
7551 * symtab.h (class Symbol_table): Update declaration.
7552 * testsuite/ver_test_9.cc: New file.
7553 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
7554 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
7555 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
7556 (ver_test_9.so, ver_test_9.o): New targets.
7557 * testsuite/Makefile.in: Rebuild.
7558
7559 2008-07-22 Ian Lance Taylor <iant@google.com>
7560
7561 * options.h (class General_options): Define --check-sections.
7562 * layout.cc (Layout::set_segment_offsets): Handle
7563 --check-sections.
7564
7565 * options.h (class General_options): Define -n/--nmagic and
7566 -N/--omagic.
7567 * options.cc (General_options::finalize): For -n/--nmagic or
7568 -N/--omagic, set -static.
7569 * layout.cc (Layout::attach_allocated_section_to_segment): If
7570 -N/--omagic, don't put read-only and read-write sections in
7571 different segments.
7572 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
7573 finding a read-only segment.
7574 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
7575 don't set the minimum segment alignment to the common page size,
7576 and don't set the file offset to the address modulo the page size.
7577 * script-sections.cc (Script_sections::create_segments): If
7578 -n/--omagic, don't put read-only and read-write sections in
7579 different segments.
7580
7581 * cref.cc: New file.
7582 * cref.h: New file.
7583 * options.h (class General_options): Add --print-symbol-counts.
7584 * main.cc (main): Issue defined symbol report if requested.
7585 * archive.cc (Archive::interpret_header): Make into a const member
7586 function.
7587 (Archive::add_symbols): Call Input_objects::archive_start and
7588 archive_stop.
7589 (Archive::const_iterator): Define new class.
7590 (Archive::begin, Archive::end): New functions.
7591 (Archive::include_all_members): Rewrite to use iterator.
7592 (Archive::count_members): New function.
7593 * archive.h (class Archive): Update declarations.
7594 (Archive::filename): New function.
7595 * object.cc: Include "cref.h".
7596 (Sized_relobj::Sized_relobj): Initialize defined_count_.
7597 (Sized_relobj::do_get_global_symbol_counts): New function.
7598 (Input_objects::add_object): Add object to cross-referencer.
7599 (Input_objects::archive_start): New function.
7600 (Input_objects::archive_stop): New function.
7601 (Input_objects::print_symbol_counts): New function.
7602 * object.h: Declare Cref and Archive.
7603 (Object::get_global_symbol_counts): New function.
7604 (Object::do_get_global_symbol_counts): New pure virtual function.
7605 (class Sized_relobj): Add defined_count_ field. Update
7606 declarations.
7607 (class Input_objects): Add cref_ field. Update constructor.
7608 Update declarations.
7609 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
7610 defined_count_.
7611 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
7612 symbol counts.
7613 (Sized_dynobj::do_get_global_symbol_counts): New function.
7614 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
7615 defined_count_. Update declarations. Define Symbols typedef.
7616 * symtab.cc (Symbol_table::add_from_relobj): Add defined
7617 parameter. Change all callers.
7618 (Symbol_table::add_from_dynobj): Add sympointers and defined
7619 parameters. Change all callers.
7620 * symtab.h (class Symbol_table): Update declarations.
7621 * Makefile.am (CCFILES): Add cref.cc.
7622 (HFILES): Add cref.h.
7623 * Makefile.in: Rebuild.
7624
7625 2008-07-22 Simon Baldwin <simonb@google.com>
7626
7627 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
7628 to zero when writing undefined symbols.
7629
7630 2008-07-22 Ian Lance Taylor <iant@google.com>
7631
7632 * output.cc (Output_section::add_input_section): Don't try to
7633 merge empty merge sections.
7634
7635 2008-07-21 Craig Silverstein <csilvers@google.com>
7636
7637 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7638 Include symbol version in error message.
7639
7640 2008-07-20 Chris Demetriou <cgd@google.com>
7641
7642 * configure.ac (gold_cv_c_random_seed): New configured variable.
7643 (RANDOM_SEED_CFLAGS): New substituted variable.
7644 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
7645 * configure: Rebuild.
7646 * Makefile.in: Likewise.
7647 * testsuite/Makefile.in: Likewise.
7648
7649 2008-07-18 Ian Lance Taylor <iant@google.com>
7650
7651 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
7652 where we see NAME/NULL and NAME/VERSION as separate symbols.
7653 * testsuite/ver_test_main.cc (main): Call t4.
7654 (t4, t4_2a): Define.
7655 * testsuite/ver_test_2.cc (t4_2): Define.
7656 * testsuite/ver_test_2.script: Put t4_2a in VER2.
7657 * testsuite/ver_test_4.cc (t4_2a): Define.
7658 * testsuite/ver_test_4.script: Put t4_2a in VER2.
7659 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
7660
7661 2008-07-17 Ian Lance Taylor <iant@google.com>
7662
7663 * dynobj.cc (Versions::add_def): If we give an error about a
7664 missing version, go ahead and create the version anyhow.
7665
7666 2008-07-10 Ian Lance Taylor <iant@google.com>
7667
7668 Handle output sections with more than 0x7fffffff bytes.
7669 * object.h (class Relobj): Change map_to_output_ to
7670 output_sections_, and just keep a section pointer. Change all
7671 uses. Move comdat group support to Sized_relobj.
7672 (Relobj::is_section_specially_mapped): Remove.
7673 (Relobj::output_section): Remove poff parameter. Change all
7674 callers.
7675 (Relobj::output_section_offset): New function.
7676 (Relobj::set_section_offset): Rewrite.
7677 (Relobj::map_to_output): Remove.
7678 (Relobj::output_sections): New function.
7679 (Relobj::do_output_section_offset): New pure virtual function.
7680 (Relobj::do_set_section_offset): Likewise.
7681 (class Sized_relobj): Add section_offsets_ field. Add comdat
7682 group support from Relobj. Update declarations.
7683 (Sized_relobj::get_output_section_offset): New function.
7684 (Sized_relobj::do_output_section_offset): New function.
7685 (Sized_relobj::do_set_section_offset): New function.
7686 * object.cc (Relobj::output_section_address): Remove.
7687 (Sized_relobj::Sized_relobj): Initialize new fields.
7688 (Sized_relobj::include_section_group): Cast find_kept_object to
7689 Sized_relobj.
7690 (Sized_relobj::include_linkonce_section): Likewise.
7691 (Sized_relobj::do_layout): Use separate arrays for output section
7692 and output offset.
7693 (Sized_relobj::do_count_local_symbols): Change map_to_output to
7694 output_sections.
7695 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
7696 output_sections and section_offsets.
7697 (Sized_relobj::write_local_symbols): Likewise.
7698 (map_to_kept_section): Compute output address directly.
7699 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
7700 output_sections and section_offsets.
7701 (Sized_relobj::write_sections): Likewise.
7702 (Sized_relobj::relocate_sections): Likewise.
7703 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
7704 * output.h (class Output_reloc): Update declarations. Change
7705 u2_.relobj to Sized_relobj*.
7706 (class Output_data_reloc): Change add functions to use
7707 Sized_relobj*.
7708 * output.cc (Output_reloc::Output_reloc): Change relobj to
7709 Sized_relobj*.
7710 (Output_reloc::local_section_offset): Change return type to
7711 Elf_Addr. Use get_output_section_offset.
7712 (Output_reloc::get_address): Likewise.
7713 (Output_section::is_input_address_mapped): Don't call
7714 is_section_specially_mapped.
7715 (Output_section::output_offset): Likewise.
7716 (Output_section::output_address): Likewise.
7717 (Output_section::starting_output_address): Likewise.
7718 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
7719 parameter to Sized_relobj*.
7720 (Copy_relocs::need_copy_reloc): Likewise.
7721 (Copy_relocs::save): Likewise.
7722 * copy-relocs.h (class Copy_relocs): Update declarations.
7723 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
7724 Sized_relobj*. Change relobj_ field to Sized_relobj*.
7725 * target-reloc.h (relocate_for_relocatable): Change
7726 offset_in_output_section type to Elf_Addr. Change code that uses
7727 it as well.
7728 * layout.cc (Layout::layout): Always set *off.
7729 * mapfile.cc (Mapfile::print_input_section): Use
7730 output_section_offset.
7731 * i386.cc (Target_i386::copy_reloc): Change object parameter to
7732 Sized_relobj*.
7733 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
7734 * sparc.cc (Target_sparc::copy_reloc): Likewise.
7735 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
7736
7737 2008-07-03 Ian Lance Taylor <iant@google.com>
7738
7739 * layout.cc (Layout::include_section): Do not discard unrecognized
7740 SHT_STRTAB sections.
7741
7742 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
7743
7744 * script.cc (Lex::can_continue_name): Make '?' allowable in
7745 version-script names.
7746 * testsuite/version_script.map: Change glob pattern to use '?'
7747
7748 2008-06-30 Manish Singh <yosh@gimp.org>
7749
7750 PR 6585
7751 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
7752 Correct typo.
7753
7754 2008-06-30 Ian Lance Taylor <iant@google.com>
7755
7756 PR 6660
7757 PR 6682
7758 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
7759 versions]: Don't try to read the value in the contents, since we
7760 don't use it. Use the template endianness when writing.
7761
7762 2008-06-25 Cary Coutant <ccoutant@google.com>
7763
7764 * fileread.cc (File_read::make_view): Assert on zero-length view.
7765 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
7766 symbol table when there are no symbols to read.
7767
7768 2008-06-23 Craig Silverstein <csilvers@google.com>
7769
7770 * version.cc (version_string): Bump to 1.7
7771
7772 2008-06-18 Craig Silverstein <csilvers@google.com>
7773
7774 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
7775 constant 0xFFFF to type Valtype.
7776 (Powerpc_relocate_functions::rel16_ha): Likewise.
7777
7778 2008-06-17 Ian Lance Taylor <iant@google.com>
7779
7780 * output.h (Output_section::Input_section): Initialize p2align_ to
7781 zero for Output_section_data constructors.
7782 (Output_section::Input_section::addralign): If not an input
7783 section, return the alignment of the Output_section_data.
7784 * testsuite/copy_test.cc: New file.
7785 * testsuite/copy_test_1.cc: New file.
7786 * testsuite/copy_test_2.cc: New file.
7787 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
7788 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
7789 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
7790 (copy_test_1_pic.o, copy_test_1.so): New targets.
7791 (copy_test_2_pic.o, copy_test_2.so): New targets.
7792 * testsuite/Makefile.in: Rebuild.
7793
7794 * script-sections.cc (Script_sections::place_orphan): Initialize
7795 local variable exact.
7796
7797 2008-06-13 David Edelsohn <edelsohn@gnu.org>
7798
7799 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
7800
7801 2008-06-12 David Edelsohn <edelsohn@gnu.org>
7802 David S. Miller <davem@davemloft.net>
7803
7804 * powerpc.cc: New file.
7805 * Makefile.am (TARGETSOURCES): Add powerpc.cc
7806 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
7807 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
7808 * Makefile.in: Rebuild.
7809
7810 2008-06-09 Ian Lance Taylor <iant@google.com>
7811
7812 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
7813 <exception>.
7814 (throwing, orig_terminate): New static variables.
7815 (terminate_handler): New static function.
7816 (t2): Set terminate handler.
7817
7818 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
7819
7820 PR 6584
7821 * binary.cc (Binary_to_elf::sized_convert): Fix .data
7822 alignment.
7823
7824 2008-05-30 Cary Coutant <ccoutant@google.com>
7825
7826 * archive.cc (Archive::include_all_members) Correct to step
7827 over symbol table and extended name table in thin archives.
7828
7829 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
7830
7831 PR 6407
7832 * target-reloc.h (relocate_for_relocatable): Fix new_offset
7833 calculation.
7834
7835 2008-05-28 Caleb Howe <cshowe@google.com>
7836
7837 * reduced_debug_output.cc: New file.
7838 * reduced_debug_output.h: New file.
7839 * options.h (class General_options): Add --strip-debug-non-line.
7840 * options.cc (General_options::finalize): Add strip_debug_non_line
7841 to the strip heirarchy.
7842 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
7843 fields.
7844 * layout.cc: Include "reduced_debug_output.h".
7845 (Layout::Layout): Initialize new fields.
7846 (line_only_debug_sections): New static array.
7847 (is_lines_only_debug_sections): New static inline function.
7848 (Layout::include_section): Handle --strip-debug-non-line.
7849 (Layout::make_output_section): If --strip-debug-non-line, build
7850 new output sections for .debug_abbrev and .debug_info.
7851 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
7852 gold. Warn about possible overflow.
7853 (read_signed_LEB_128): Likewise.
7854 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
7855 (read_signed_LEB_128): Declare.
7856 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
7857 (HFILES): Add reduced_debug_output.h.
7858 * Makefile.in: Rebuild.
7859
7860 2008-05-21 Ian Lance Taylor <iant@google.com>
7861
7862 * mapfile.cc: New file.
7863 * mapfile.h: New file.
7864 * options.h (class General_options): Add -M/--print-map and -Map.
7865 * options.cc (General_options::finalize): Make -M equivalent to
7866 -Map -.
7867 * main.cc: Include <cstdio> and "mapfile.h".
7868 (main): Open mapfile if requested.
7869 * gold.cc (class Middle_runner): Add mapfile_ field. Update
7870 constructor. Change caller.
7871 (queue_initial_tasks): Add mapfile parameter. Change caller.
7872 (queue_middle_tasks): Likewise.
7873 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
7874 declarations.
7875 * archive.cc: Include "mapfile.h".
7876 (Archive::add_symbols): Add mapfile parameter. Change all
7877 callers. Pass mapfile, symbol, and reason to include_member.
7878 (Archive::include_all_members): Add mapfile parameter. Change all
7879 callers.
7880 (Archive::include_member): Add mapfile, sym, and why parameters.
7881 Change all callers. Report inclusion to map file.
7882 * archive.h: Include "fileread.h".
7883 (class Archive): Update declarations.
7884 (Archive::file): New const method.
7885 (class Add_archive_symbols): Add mapfile_ field. Update
7886 constructor. Change all callers.
7887 * readsyms.h (class Read_symbols): Likewise.
7888 (class Finish_group): Likewise.
7889 (class Read_script): Likewise.
7890 * common.cc: Include "mapfile.h".
7891 (Symbol_table::allocate_commons): Add mapfile parameter. Change
7892 all callers.
7893 (Symbol_table::do_allocate_commons): Likewise.
7894 (Symbol_table::do_allocate_commons_list): Likewise. Report common
7895 symbol allocation to mapfile.
7896 * common.h (class Allocate_commons_task): Add mapfile_ field.
7897 Update constructor. Change all callers.
7898 * symtab.h (class Symbol_table): Update declarations.
7899 * layout.cc: Include "mapfile.h".
7900 (Layout_task_runner::run): Print information to mapfile.
7901 (Layout::create_gold_note): Change Output_data_fixed_space to
7902 Output_data_zero_fill.
7903 (Layout::create_build_id): Likewise.
7904 (Layout::print_to_mapfile): New function.
7905 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
7906 constructor. Change caller.
7907 (class Layout): Declare print_to_mapfile.
7908 * output.cc (Output_section::Input_section::print_to_mapfile): New
7909 function.
7910 (Output_section::add_input_section): If producing a map, always
7911 add to input_sections_ list.
7912 (Output_section::do_print_to_mapfile): New function.
7913 (Output_segment::print_sections_to_mapfile): New function.
7914 (Output_segment::print_section_list_to_mapfile): New function.
7915 * output.h: Include "mapfile.h".
7916 (Output_data::print_to_mapfile): New function.
7917 (Output_data::do_print_to_mapfile): New virtual function.
7918 (Output_segment_headers::do_print_to_mapfile): New function.
7919 (Output_file_header::do_print_to_mapfile): New function.
7920 (Output_data_const::do_print_to_mapfile): New function.
7921 (class Output_data_const_buffer): Add map_name_ field. Update
7922 constructor. Change all callers. Add do_print_to_mapfile
7923 function.
7924 (class Output_data_fixed_space): Likewise.
7925 (class Output_data_space): Likewise.
7926 (class Output_data_zero_fill): New class.
7927 (Output_data_strtab::do_print_to_mapfile): New function.
7928 (Output_data_reloc_base::do_print_to_mapfile): New function.
7929 (Output_relocatable_relocs::do_print_to_mapfile): New function.
7930 (Output_data_group::do_print_to_mapfile): New function.
7931 (Output_data_got::do_print_to_mapfile): New function.
7932 (Output_data_dynamic::do_print_to_mapfile): New function.
7933 (Output_symtab_xindex::do_print_to_mapfile): New function.
7934 (class Output_section): Declare do_print_to_mapflie. Declare
7935 print_to_mapfile in Input_section.
7936 (class Output_segment): Declare new functions.
7937 * object.h (Sized_relobj::symbol_count): New function.
7938 * script-sections.cc
7939 (Output_section_element_dot_assignment::set_section_addresses):
7940 Change Output_data_fixed_space to Output_data_zero_fill.
7941 (Output_data_expression::do_print_to_mapfile): New function.
7942 * script.cc (read_input_script): Add mapfile parameter. Change
7943 all callers.
7944 * script.h (read_input_script): Update declaration.
7945 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
7946 (Eh_frame::do_print_to_mapfile): New function.
7947 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
7948 (Output_merge_string::do_print_to_mapfile): New function.
7949 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
7950 function.
7951 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
7952 function.
7953 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
7954 function.
7955 * Makefile.am (CCFILES): Add mapfile.cc.
7956 (HFILES): Add mapfile.h.
7957 * Makefile.in: Rebuild.
7958
7959 2008-05-19 Ian Lance Taylor <iant@google.com>
7960
7961 * options.h (class General_options): Add -z relro.
7962 * layout.cc (Layout::Layout): Initialize relro_segment_.
7963 (Layout::add_output_section_data): Return the output section.
7964 (Layout::make_output_section): Rcognize relro sections and mark
7965 them appropriately.
7966 (Layout::attach_allocated_section_to_segment): Put relro sections
7967 in a PT_GNU_RELRO segment.
7968 (Layout::create_initial_dynamic_sections): Mark the .dynamic
7969 section as relro.
7970 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
7971 PT_TLS segments.
7972 (Layout::linkonce_mapping): Map d.rel.ro.local to
7973 .data.rel.ro.local.
7974 (Layout::output_section_name): Us .data.rel.ro.local for any
7975 section which begins with that.
7976 * layout.h (class Layout): Update add_output_section_data
7977 declaration. Add relro_segment_ field.
7978 * output.cc (Output_section::Output_section): Initialize is_relro_
7979 and is_relro_local_ fields.
7980 (Output_segment::add_output_section): Group relro sections.
7981 (Output_segment::is_first_section_relro): New function.
7982 (Output_segment::maximum_alignment): If there is a relro section,
7983 align the segment to the common page size.
7984 (Output_segment::set_section_addresses): Track whether we are
7985 looking at relro sections. If the last section is a relro
7986 section, align to the common page size.
7987 (Output_segment::set_section_list_addresses): Add in_relro
7988 parameter. Change all callers. Align to the page size when
7989 moving from relro to non-relro section.
7990 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
7991 segment.
7992 * output.h (class Output_section): Add is_relro_ and
7993 is_relro_local_ fields.
7994 (Output_section::is_relro): New function.
7995 (Output_section::set_is_relro): New function.
7996 (Output_section::is_relro_local): New function.
7997 (Output_section::set_is_relro_local): New function.
7998 (class Output_segment): Update declarations.
7999 * i386.cc (Target_i386::got_section): Mark .got section as relro.
8000 * sparc.cc (Target_sparc::got_section): Likewise.
8001 * x86_64.cc (Target_x86_64::got_section): Likewise.
8002 * testsuite/relro_test_main.cc: New file.
8003 * testsuite/relro_test.cc: New file.
8004 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
8005 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
8006 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
8007 (relro_test.so, relro_test_pic.o): New targets.
8008 * testsuite/Makefile.in: Rebuild.
8009
8010 2008-05-16 Ian Lance Taylor <iant@google.com>
8011
8012 * output.cc (Output_segment::add_output_section): Remove front
8013 parameter.
8014 * output.h (class Output_segment): Remove
8015 add_initial_output_section and overloaded add_output_section.
8016 Update declaration of remaining add_output_section.
8017 * layout.cc (Layout::create_interp): Call add_output_section
8018 rather than add_initial_output_section.
8019 (Layout::finish_dynamic_section): Likewise.
8020
8021 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
8022 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
8023 know the dynamic type.
8024 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
8025 field. Initialize it in constructor.
8026 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
8027 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
8028 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
8029 reloc.
8030
8031 * output.cc (Output_reloc::get_address): Change return type to
8032 Elf_Addr.
8033 * output.h (class Output_reloc): Update get_address declaration.
8034 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
8035 for section addresses.
8036
8037 2008-05-09 Ian Lance Taylor <iant@google.com>
8038
8039 PR 6493
8040 * gold.cc (gold_nomem): Use return value of write.
8041
8042 2008-05-08 Ian Lance Taylor <iant@google.com>
8043
8044 * symtab.c (Symbol::init_base_output_data): Add version
8045 parameter. Change all callers.
8046 (Symbol::init_base_output_segment): Likewise.
8047 (Symbol::init_base_constant): Likewise.
8048 (Symbol::init_base_undefined): Likewise.
8049 (Sized_symbol::init_output_data): Likewise.
8050 (Sized_symbol::init_output_segment): Likewise.
8051 (Sized_symbol::init_constant): Likewise.
8052 (Sized_symbol::init_undefined): Likewise.
8053 (Symbol_table::do_define_in_output_data): If the new symbol has a
8054 version, mark it as the default.
8055 (Symbol_table::do_define_in_output_segment): Likewise.
8056 (Symbol_table::do_define_as_constant): Likewise.
8057 * symtab.h (class Symbol): Update declarations.
8058 (class Sized_symbol): Likewise.
8059 * resolve.cc (Symbol::override_version): New function.
8060 (Symbol::override_base): Call override_version.
8061 (Symbol::override_base_with_special): Likewise.
8062 * testsuite/ver_script_8.script: New file.
8063 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
8064 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
8065 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
8066 (ver_test_8_1.so, ver_test_8_2.so): New targets.
8067
8068 2008-05-06 Ian Lance Taylor <iant@google.com>
8069
8070 PR 6049
8071 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
8072 functions.
8073 (class General_options): Remove existing --undefined, and add
8074 --no-undefined instead. Add new --undefined as synonym for -u.
8075 * archive.cc (Archive::add_symbols): Check whether symbol was
8076 named with -u.
8077 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
8078 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
8079 all uses. Add IS_UNDEFINED. Update declarations to split
8080 different versions of init_base. Declare init_base_undefined.
8081 (Symbol::is_defined): Handle IS_UNDEFINED.
8082 (Symbol::is_undefined): Likewise.
8083 (Symbol::is_weak_undefined): Call is_undefined.
8084 (Symbol::is_absolute): Handle IS_CONSTANT.
8085 (class Sized_symbol): Update declarations to split different
8086 versions of init. Declare init_undefined.
8087 (class Symbol_table): Declare new functions.
8088 * symtab.cc (Symbol::init_base_object): Rename from init_base.
8089 Change all callers.
8090 (Symbol::init_base_output_data): Likewise.
8091 (Symbol::init_base_output_segment): Likewise.
8092 (Symbol::init_base_constant): Likewise.
8093 (Symbol::init_base_undefined): New function.
8094 (Sized_symbol::init_object): Rename from init. Change all
8095 callers.
8096 (Sized_symbol::init_output_data): Likewise.
8097 (Sized_symbol::init_output_segment): Likewise.
8098 (Sized_symbol::init_constant): Likewise.
8099 (Sized_symbol::init_undefined): New function.
8100 (Symbol_table::add_undefined_symbols_from_command_line): New
8101 function.
8102 (Symbol_table::do_add_undefined_symbols_from_command_line): New
8103 function.
8104 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
8105 (Symbol::output_section): Likewise.
8106 (Symbol::set_output_section): Likewise.
8107 (Symbol_table::sized_finalize_symbol): Likewise.
8108 (Symbol_table::sized_write_globals): Likewise.
8109 * resolve.cc (Symbol_table::should_override): Likewise.
8110 (Symbol::override_base_with_special): Likewise.
8111
8112 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
8113 symbol, change it to have default visibility.
8114 * testsuite/protected_1.cc: New file.
8115 * testsuite/protected_2.cc: New file.
8116 * testsuite/protected_3.cc: New file.
8117 * testsuite/protected_main_1.cc: New file.
8118 * testsuite/protected_main_2.cc: New file.
8119 * testsuite/protected_main_3.cc: New file.
8120 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
8121 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
8122 (protected_1_LDFLAGS, protected_1_LDADD): Define.
8123 (protected_1.so): New target.
8124 (protected_1_pic.o, protected_2_pic.o): New targets.
8125 (protected_3_pic.o): New target.
8126 (check_PROGRAMS): Add protected_2.
8127 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
8128 (protected_2_LDFLAGS, protected_2_LDADD): Define.
8129 * testsuite/Makefile.in: Rebuild.
8130
8131 * options.h (DEFINE_var): Add set_user_set_##varname__.
8132 (DEFINE_bool_alias): New macro.
8133 (class General_options): Define -Bstatic using DEFINE_bool_alias
8134 rather than DEFINE_special. Add --undefined as an alias for -z
8135 defs.
8136 * options.cc (General_options::parse_Bstatic): Remove.
8137
8138 * options.h (class General_options): Add --fatal-warnings.
8139 * main.cc (main): Implement --fatal-warnings.
8140 * errors.h (Errors::warning_count): New function.
8141
8142 * options.h (class General_options): Add -Bsymbolic-functions.
8143 * symtab.h (Symbol::is_preemptible): Check for
8144 -Bsymbolic-functions.
8145
8146 2008-05-05 Ian Lance Taylor <iant@google.com>
8147
8148 * options.h (DEFINE_bool): For DASH_Z, create the negative option
8149 as noVARNAME rather than no-VARNAME.
8150 (class General_options): Add option -z combreloc.
8151 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
8152 get_address.
8153 (Output_reloc::sort_before) [SHT_REL]: New function.
8154 (Output_reloc::sort_before) [SHT_RELA]: New function.
8155 (class Output_data_reloc_base): Add sort_relocs_ field. Define
8156 Sort_relocs_comparison.
8157 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
8158 parameter. Change all callers.
8159 (Output_data_reloc::Output_data_reloc) [both versions]: Add
8160 sort_relocs parameter. Change all callers.
8161 * output.cc (Output_reloc::get_address): New function, broken out
8162 of write_rel.
8163 (Output_reloc::write_rel): Call it.
8164 (Output_reloc::compare): New function.
8165 (Output_data_reloc_base::do_write): Optionally sort relocs.
8166
8167 * configure.ac: If targ_extra_obj is set, link it in.
8168 * configure.tgt: Initialize all variables.
8169 (x86_64*): Set targ_extra_obj and targ_extra_size.
8170 * configure: Rebuild.
8171
8172 * object.cc (Sized_relobj::include_section_group): Adjust section
8173 indexes read from group data. Build vector to pass to
8174 layout_group.
8175 * layout.cc (Layout::layout_group): Add flags and shndxes
8176 parameters. Remove contents parameter. Change caller. Update
8177 explicit instantiations.
8178 * layout.h (class Layout): Update layout_group declaration.
8179 * output.cc (Output_data_group::Output_data_group): Add flags and
8180 input_shndxes parameters. Remove contents parameter. Change
8181 caller.
8182 (Output_data_group::do_write): Change input_sections_ to
8183 input_shndxes_.
8184 * output.h (class Output_data_group): Update constructor
8185 declaration. Rename input_sections_ to input_shndxes_.
8186 * testsuite/many_sections_test.cc: Add template.
8187
8188 2008-04-30 Cary Coutant <ccoutant@google.com>
8189
8190 * target-reloc.h (relocate_section): Fix dead-pointer bug.
8191
8192 * layout.cc (Layout::include_section): Refactored check for debug
8193 info section.
8194 (Layout::add_comdat): Add new parameters. Change type
8195 of signature parameter. Add object and shndx to signatures table.
8196 (Layout::find_kept_object): New function.
8197 * layout.h: Include <cstring>.
8198 (Layout::is_debug_info_section): New function.
8199 (Layout::add_comdat): Add new parameters.
8200 (Layout::find_kept_object): New function.
8201 (Layout::Kept_section): New struct.
8202 (Layout::Signatures): Change type of map range.
8203 * object.cc (Relobj::output_section_address): New function.
8204 (Sized_relobj::include_section_group): Add new parameters. Change
8205 calls to Layout::add_comdat. Change to build table of kept comdat
8206 groups and table mapping discarded sections to kept sections.
8207 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
8208 (Sized_relobj::do_layout): Change calls to include_section_group and
8209 include_linkonce_section.
8210 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
8211 value to zero when section is discarded.
8212 (Sized_relobj::map_to_kept_section): New function.
8213 * object.h (Relobj::output_section_address): New function.
8214 (Relobj::Comdat_group): New type.
8215 (Relobj::find_comdat_group): New function.
8216 (Relobj::Comdat_group_table): New type.
8217 (Relobj::Kept_comdat_section): New type.
8218 (Relobj::Kept_comdat_section_table): New type.
8219 (Relobj::add_comdat_group): New function.
8220 (Relobj::set_kept_comdat_section): New function.
8221 (Relobj::get_kept_comdat_section): New function.
8222 (Relobj::comdat_groups_): New field.
8223 (Relobj::kept_comdat_sections_): New field.
8224 (Symbol_value::input_value): Update comment.
8225 (Sized_relobj::map_to_kept_section) New function.
8226 (Sized_relobj::include_linkonce_section): Add new parameter.
8227 * target-reloc.h (Comdat_behavior): New type.
8228 (get_comdat_behavior): New function.
8229 (relocate_section): Add code to map a discarded section to the
8230 corresponding kept section when applying a relocation.
8231
8232 2008-04-30 Craig Silverstein <csilvers@google.com>
8233
8234 * dwarf_reader.cc (next_generation_count): New static var.
8235 (Addr2line_cache_entry): New struct.
8236 (addr2line_cache): New static var.
8237 (Dwarf_line_info::one_addr2line): Added caching.
8238 (Dwarf_line_info::clear_addr2line_cache): New function.
8239 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
8240 cache-size parameter.
8241 (Dwarf_line_info::one_addr2line_cache): New function.
8242 * symtab.cc (Symbol_table::detect_odr_violations): Pass
8243 new cache-size argument to one_addr2line(), and clear cache.
8244
8245 2008-04-28 Cary Coutant <ccoutant@google.com>
8246
8247 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
8248 R_386_PC8 relocations.
8249
8250 2008-04-23 Ian Lance Taylor <iant@google.com>
8251
8252 * object.cc (Sized_relobj::include_section_group): Check for
8253 invalid section group.
8254
8255 * object.cc (make_elf_object): Correct test for 64-bit ELF file
8256 header size.
8257
8258 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
8259 than read for file header.
8260 * archive.cc (Archive::include_member): Likewise.
8261
8262 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
8263
8264 * aclocal.m4: Regenerate.
8265 * configure: Regenerate.
8266
8267 2008-04-19 Ian Lance Taylor <iant@google.com>
8268
8269 * version.cc (version_string): Bump to 1.6.
8270
8271 * testsuite/Makefile.am (many_sections_r_test): New target.
8272 (many_sections_r_test_SOURCES): Remove.
8273 (many_sections_r_test_DEPENDENCIES): Remove.
8274 (many_sections_r_test_LDFLAGS): Remove.
8275 (many_sections_r_test_LDADD): Remove.
8276
8277 * object.cc (Sized_relobj::do_add_symbols): Always pass
8278 local_symbol_count_ to add_from_relobj.
8279
8280 * testsuite/Makefile.am (many_sections_check.h): Only check one in
8281 every thousand variables.
8282 * testsuite/Makefile.in: Rebuild.
8283
8284 * object.cc (Xindex::initialize_symtab_xindex): New function.
8285 (Xindex::read_symtab_xindex): New function.
8286 (Xindex::sym_xindex_to_shndx): New function.
8287 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
8288 available.
8289 (Sized_relobj::do_initialize_xindex): New function.
8290 (Sized_relobj::do_read_symbols): Adjust section links.
8291 (Sized_relobj::symbol_section_and_value): Add is_ordinary
8292 parameter. Change all callers.
8293 (Sized_relobj::include_section_group): Adjust section links and
8294 symbol section indexes.
8295 (Sized_relobj::do_layout): Adjust section links.
8296 (Sized_relobj::do_count_local_symbols): Adjust section links and
8297 symbol section indexes.
8298 (Sized_relobj::do_finalize_local_symbols): Distinguish between
8299 ordinary and special symbols.
8300 (Sized_relobj::write_local_symbols): Add symtab_xindex and
8301 dynsym_xindex parameters. Change all callers. Adjust section
8302 links. Use SHN_XINDEX when needed.
8303 (Sized_relobj::get_symbol_location_info): Adjust section links.
8304 Don't get fooled by special symbols.
8305 * object.h (class Xindex): Define.
8306 (class Object): Add xindex_ parameter. Declare virtual functoin
8307 do_initialize_xindex.
8308 (Object::adjust_sym_shndx): New function.
8309 (Object::set_xindex): New protected function.
8310 (class Symbol_value): Add is_ordinary_shndx_ field.
8311 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
8312 (Symbol_value::value): Assert ordinary section.
8313 (Symbol_value::initialize_input_to_output_map): Likewise.
8314 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
8315 Change all callers.
8316 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
8317 all callers.
8318 (class Sized_relobj): Update declarations.
8319 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
8320 parameter. Change all callers.
8321 (Sized_relobj::adjust_shndx): New function.
8322 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
8323 field.
8324 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
8325 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
8326 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
8327 (Sized_dynobj::read_dynsym_section): Adjust section links.
8328 (Sized_dynobj::read_dynamic): Likewise.
8329 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
8330 section links.
8331 (Sized_dynobj::do_initialize_xindex): New function.
8332 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
8333 do_initialize_xindex.
8334 (Sized_dynobj::adjust_shndx): New function.
8335 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
8336 dynsym_xindex_ fields.
8337 (Layout::finalize): Add a call to set_section_indexes before
8338 creating the symtab sections.
8339 (Layout::set_section_indexes): Don't do anything if the section
8340 already has a section index.
8341 (Layout::create_symtab_sections): Add shnum parameter. Change
8342 caller. Create .symtab_shndx section if needed.
8343 (Layout::create_shdrs): Add shstrtab_section parameter. Change
8344 caller.
8345 (Layout::allocated_output_section_count): New function.
8346 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
8347 needed.
8348 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
8349 fields. Update declarations.
8350 (Layout::symtab_xindex): New function.
8351 (Layout::dynsym_xindex): New function.
8352 (class Write_symbols_task): Add layout_ field.
8353 (Write_symbols_task::Write_symbols_task): Add layout parameter.
8354 Change caller.
8355 * output.cc (Output_section_headers::Output_section_headers): Add
8356 shstrtab_section parameter. Change all callers.
8357 (Output_section_headers::do_sized_write): Store overflow values
8358 for section count and section string table section index in
8359 section header zero.
8360 (Output_file_header::do_sized_write): Check for overflow of
8361 section count and section string table section index.
8362 (Output_symtab_xindex::do_write): New function.
8363 (Output_symtab_xindex::endian_do_write): New function.
8364 * output.h (class Output_section_headers): Add shstrtab_section_.
8365 Update declarations.
8366 (class Output_symtab_xindex): Define.
8367 (Output_section::has_out_shndx): New function.
8368 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
8369 field.
8370 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
8371 Change all callers.
8372 (Sized_symbol::init): Likewise.
8373 (Symbol::output_section): Check for ordinary symbol.
8374 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
8375 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
8376 callers.
8377 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
8378 Change all callers. Simplify handling of symbols from sections
8379 not included in the link.
8380 (Symbol_table::add_from_dynobj): Handle ordinary symbol
8381 distinction.
8382 (Weak_alias_sorter::operator()): Assert that symbols are
8383 ordinary.
8384 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
8385 distinction.
8386 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
8387 parameters. Change all callers.
8388 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
8389 symbol distinction. Use SHN_XINDEX when needed.
8390 (Symbol_table::write_section_symbol): Add symtab_xindex
8391 parameter. Change all callers.
8392 (Symbol_table::sized_write_section_symbol): Likewise. Use
8393 SHN_XINDEX when needed.
8394 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
8395 declarations.
8396 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
8397 (Symbol::is_defined): Check is_ordinary.
8398 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
8399 (Symbol::is_absolute, Symbol::is_common): Likewise.
8400 (class Sized_symbol): Update declarations.
8401 (class Symbol_table): Update declarations.
8402 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
8403 parameters. Change all callers.
8404 (Sized_symbol::override): Likewise.
8405 (Symbol_table::override): Likewise.
8406 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
8407 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
8408 is_ordinary, and orig_st_shndx parameters. Change all callers.
8409 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
8410 to be in an ordinary section.
8411 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
8412 object and is_ordinary parameters. Change all callers.
8413 (Sized_dwarf_line_info::read_relocs): Add object parameter.
8414 Change all callers. Don't add undefined or non-ordinary symbols
8415 to reloc_map_.
8416 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
8417 Change all callers.
8418 * dwarf_reader.h (class Sized_dwarf_line_info): Update
8419 declarations.
8420 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
8421 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
8422 (Sized_relobj::relocate_sections): Likewise.
8423 * target-reloc.h (scan_relocs): Adjust section symbol index.
8424 (scan_relocatable_relocs): Likewise.
8425 * i386.cc (Scan::local): Check for ordinary symbols.
8426 * sparc.cc (Scan::local): Likewise.
8427 * x86_64.cc (Scan::local): Likewise.
8428 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
8429 to symbol_section_and_value.
8430 * testsuite/many_sections_test.cc: New file.
8431 * testsuite/Makefile.am (BUILT_SOURCES): Define.
8432 (check_PROGRAMS): Add many_sections_test.
8433 (many_sections_test_SOURCES): Define.
8434 (many_sections_test_DEPENDENCIES): Define.
8435 (many_sections_test_LDFLAGS): Define.
8436 (BUILT_SOURCES): Add many_sections_define.h.
8437 (many_sections_define.h): New target.
8438 (BUILT_SOURCES): Add many_sections_check.h.
8439 (many_sections_check.h): New target.
8440 (check_PROGRAMS): Add many_sections_r_test.
8441 (many_sections_r_test_SOURCES): Define.
8442 (many_sections_r_test_DEPENDENCIES): Define.
8443 (many_sections_r_test_LDFLAGS): Define.
8444 (many_sections_r_test_LDADD): Define.
8445 (many_sections_r_test.o): New target.
8446 * testsuite/Makefile.in: Rebuild.
8447
8448 2008-04-17 Cary Coutant <ccoutant@google.com>
8449
8450 * errors.cc (Errors::info): New function.
8451 (gold_info): New function.
8452 * errors.h (Errors::info): New function.
8453 * gold.h (gold_info): New function.
8454 * object.cc (Input_objects::add_object): Print trace output.
8455 * options.cc (options::parse_set): New function.
8456 (General_options::parse_wrap): Deleted.
8457 (General_options::General_options): Deleted initializer.
8458 * options.h (options::String_set): New typedef.
8459 (options::parse_set): New function.
8460 (DEFINE_set): New macro.
8461 (General_options::wrap): Changed to use DEFINE_set. Changed
8462 callers of any_wrap_symbols and is_wrap_symbol.
8463 (General_options::trace, General_options::trace_symbol):
8464 New options.
8465 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
8466 (General_options::wrap_symbols_): Deleted.
8467 * symtab.cc (Symbol_table::add_from_object): Print trace output.
8468
8469 2008-04-17 David S. Miller <davem@davemloft.net>
8470
8471 * options.cc (General_options::parse_V): New function.
8472 * options.h: Add entries for -V and -Qy.
8473
8474 2008-04-17 Ian Lance Taylor <iant@google.com>
8475
8476 * common.cc (Symbol_table::allocate_commons): Remove options
8477 parameter. Change caller.
8478 (Symbol_table::do_allocate_commons): Remove options parameter.
8479 Change caller. Just call do_allocate_commons_list twice.
8480 (Symbol_table::do_allocate_commons_list): New function, broken out
8481 of do_allocate_commons.
8482 * common.h (class Allocate_commons_task): Remove options_ field.
8483 Update constructor.
8484 * symtab.cc (Symbol_table::Symbol_table): Initialize
8485 tls_commons_.
8486 (Symbol_table::add_from_object): Put TLS common symbols on
8487 tls_commons_ list.
8488 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
8489 which are IN_OUTPUT_DATA.
8490 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
8491 allocate_commons and do_allocate_commons declarations. Declare
8492 do_allocate_commons_list.
8493 * gold.cc (queue_middle_tasks): Update creation of
8494 Allocate_commons_task to not pass options.
8495 * testsuite/Makefile.am (INCLUDES): Add -I.. .
8496 (TLS_TEST_C_FLAGS): New variable.
8497 (tls_test_c_pic.o): New target.
8498 (tls_test_shared.so): Link in tls_test_c_pic.o.
8499 (tls_test_c_pic_ie.o): New target.
8500 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
8501 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
8502 (tls_test_c.o): New target.
8503 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
8504 (tls_pic_test_LDADD): Likewise.
8505 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
8506 (tls_shared_gd_to_ie_test_LDADD): Likewise.
8507 (tls_test_c_gnu2.o): New target.
8508 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
8509 tls_test_c_gnu2.o.
8510 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
8511 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
8512 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
8513 * testsuite/tls_test.cc: Include "config.h".
8514 (t_last): Call t11_last.
8515 * testsuite/tls_test.h (t11, t11_last): Declare.
8516 * testsuite/tls_test_c.c: New file.
8517 * testsuite/tls_test_main.cc (thread_routine): Call t11.
8518 * configure.ac: Check for OpenMP support.
8519 * configure, config.in, Makefile.in: Rebuild.
8520 * testsuite/Makefile.in: Rebuild.
8521
8522 2008-04-16 Cary Coutant <ccoutant@google.com>
8523
8524 * i386.cc (Target_i386::define_tls_base_symbol): New function.
8525 (Target_i386::tls_base_symbol_defined_): New field.
8526 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8527 (Target_i386::Scan::global): Likewise.
8528 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
8529 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
8530 (Target_x86_64::tls_base_symbol_defined_): New field.
8531 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8532 (Target_x86_64::Scan::global): Likewise.
8533
8534 2008-04-16 Cary Coutant <ccoutant@google.com>
8535
8536 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
8537 (Symbol::needs_plt_entry): Allow weak undefined symbols.
8538 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
8539 building shared libraries.
8540 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
8541 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
8542 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
8543 * testsuite/Makefile.in: Rebuild.
8544 * testsuite/weak_undef.h: New file.
8545 * testsuite/weak_undef_file1.cc: Add extra test cases.
8546 * testsuite/weak_undef_file2.cc: Likewise.
8547 * testsuite/weak_undef_test.cc: Likewise.
8548
8549 2008-04-16 David S. Miller <davem@davemloft.net>
8550
8551 * sparc.cc (Target_sparc::Scan): Change from struct to class.
8552 Add issued_non_pic_error_ field. Declare check_non_pic.
8553 (Target_sparc::Scan::check_non_pic): New function.
8554 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
8555 (Target_sparc::Scan::global): Likewise.
8556
8557 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
8558 * configure: Rebuild.
8559
8560 * options.h (DEFINE_enable): New macro.
8561 (new_dtags): New enable option.
8562 (initfirst, interpose, loadfltr, nodefaultlib,
8563 nodelete, nodlopen, nodump): New -z options.
8564 * layout.cc (Layout:finish_dynamic_section): If new
8565 dtags enabled, emit DT_RUNPATH. Also, emit a
8566 DT_FLAGS_1 containing any specified -z flags.
8567
8568 2008-04-16 Ian Lance Taylor <iant@google.com>
8569
8570 * copy-relocs.cc: New file.
8571 * copy-relocs.h: New file.
8572 * reloc.cc: Remove Copy_relocs code.
8573 * reloc.h: Likewise.
8574 * reloc-types.h (struct Reloc_types) [both versions]: Add
8575 get_reloc_addend_noerror.
8576 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
8577 variants of add_global which take an addend which must be zero.
8578 * i386.cc: Include "copy-relocs.h".
8579 (class Target_i386): Change type of copy_relocs_ to variable,
8580 update initializer.
8581 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
8582 Change all callers.
8583 (Target_i386::do_finalize_sections): Change handling of
8584 copy_relocs_.
8585 * sparc.cc: Include "copy-relocs.h".
8586 (class Target_sparc): Change type of copy_relocs_ to variable,
8587 update initializer.
8588 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
8589 Change all callers.
8590 (Target_sparc::do_finalize_sections): Change handling of
8591 copy_relocs_.
8592 * x86_64.cc: Include "copy-relocs.h".
8593 (class Target_x86_64): Change type of copy_relocs_ to variable,
8594 update initializer.
8595 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
8596 class. Change all callers.
8597 (Target_x86_64::do_finalize_sections): Change handling of
8598 copy_relocs_.
8599 * Makefile.am (CCFILES): Add copy-relocs.cc.
8600 (HFILES): Add copy-relocs.h.
8601
8602 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
8603
8604 * testsuite/script_test_4.sh: Permit leading zeroes.
8605
8606 2008-04-15 Ian Lance Taylor <iant@google.com>
8607
8608 * script-sections.cc (Script_sections::create_segments): Use
8609 header_size_adjustment even when there is enough room for the
8610 headers.
8611 * testsuite/script_test_4.sh: New file.
8612 * testsuite/script_test_4.t: New file.
8613 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
8614 (check_DATA): Add script_test_4.stdout.
8615 (MOSTLYCLEANFILES): Likewise.
8616 (script_test_4): New target.
8617 (script_test_4.stdout): New target.
8618 * testsuite/Makefile.in: Rebuild.
8619
8620 * sparc.cc: Add definitions for Output_data_plt_sparc class
8621 constants.
8622
8623 2008-04-14 David S. Miller <davem@davemloft.net>
8624
8625 * sparc.cc: New file.
8626 * Makefile.am (TARGETSOURCES): Add sparc.cc
8627 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
8628 * configure.tgt: Document targ_extra_size and
8629 targ_extra_big_endian. Add entries for sparc-* and
8630 sparc64-*.
8631 * configure.ac: Handle targ_extra_size and
8632 targ_extra_big_endian.
8633 * Makefile.in: Rebuild.
8634 * configure: Likewise.
8635 * po/POTFILES.in: Likewise.
8636 * po/gold.pot: Likewise.
8637
8638 2008-04-14 Ian Lance Taylor <iant@google.com>
8639
8640 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
8641 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
8642 in the name/type/flags to section mapping. Don't call
8643 allocate_output_section.
8644 (Layout::choose_output_section): Change parameter from adjust_name
8645 to is_input_section. Don't permit input sections after sections
8646 are attached to segments. Don't call allocate_output_section.
8647 (Layout::layout_eh_frame): Call update_flags_for_input_section,
8648 not write_enable_output_section.
8649 (Layout::make_output_section): Don't push to
8650 unattached_section_list_ nor call attach_to_segment. Call
8651 attach_section_to_segment if sections are attached.
8652 (Layout::attach_sections_to_segments): New function.
8653 (Layout::attach_section_to_segment): New function.
8654 (Layout::attach_allocated_section_to_segment): Rename from
8655 attach_to_segment. Remove flags parameter.
8656 (Layout::allocate_output_section): Remove function.
8657 (Layout::write_enable_output_section): Remove function.
8658 * layout.h (class Layout): Update for above changes. Add new
8659 field sections_are_attached_.
8660 * output.h (Output_section::update_flags_for_input_section): New
8661 function.
8662 * output.cc (Output_section::add_input_section): Call
8663 update_flags_for_input_section.
8664 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
8665
8666 2008-04-11 Cary Coutant <ccoutant@google.com>
8667
8668 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
8669 thought unnecessary.
8670 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
8671
8672 2008-04-11 Ian Lance Taylor <iant@google.com>
8673
8674 * output.h (class Output_section_data): Remove inline definition
8675 of set_addralign.
8676 * output.cc (Output_section_data::set_addralign): New function.
8677
8678 2008-04-11 Cary Coutant <ccoutant@google.com>
8679
8680 Add support for TLS descriptors for i386 and x86_64.
8681 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
8682 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
8683 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
8684 GOT_TYPE_TLS_DESC.
8685 (Target_i386::got_mod_index_entry): Remove unnecessary code.
8686 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
8687 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
8688 relocations.
8689 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
8690 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
8691 Fix problem with initial-exec relocations.
8692 (Target_i386::Relocate::relocate_tls): Likewise.
8693 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
8694 relaxation.
8695 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
8696 support for section-plus-offset dynamic table entries.
8697 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
8698 (Output_data_dynamic::Dynamic_entry): Add support for
8699 section-plus-offset dynamic table entries.
8700 (Output_data_dynamic::Classification): Likewise.
8701 (Output_data_dynamic::classification_): Renamed offset_.
8702 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
8703 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
8704 (Target_x86_64::make_plt_section): New function.
8705 (Target_x86_64::reserve_tlsdesc_entries): New function.
8706 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
8707 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
8708 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
8709 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
8710 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
8711 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
8712 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
8713 add extra PLT entry for TLS descriptors.
8714 (Output_data_plt_x86_64::got_): New field.
8715 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
8716 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
8717 fields.
8718 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
8719 descriptors.
8720 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
8721 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
8722 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
8723 R_386_TLS_DESC_CALL relocations.
8724 (Target_x86_64::Scan::global): Likewise.
8725 (Target_x86_64::do_finalize_sections): Add dynamic table entries
8726 for TLS descriptors.
8727 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
8728 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
8729 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
8730 GD-to-IE relaxation.
8731 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
8732 and TLS_DESCRIPTORS.
8733 * Makefile.in: Rebuild.
8734 * configure: Rebuild.
8735 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
8736 (tls_test_shared2.so): New target.
8737 (tls_shared_gd_to_ie_test_SOURCES): New variable.
8738 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
8739 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
8740 (tls_shared_gd_to_ie_test_LDADD): New variable.
8741 (tls_shared_gnu2_gd_to_ie_test): New target.
8742 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
8743 New targets.
8744 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
8745 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
8746 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
8747 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
8748 (tls_shared_gnu2_test): New target.
8749 (tls_test_gnu2_shared.so): New target.
8750 (tls_shared_gnu2_test_SOURCES): New variable.
8751 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
8752 (tls_shared_gnu2_test_LDFLAGS): New variable.
8753 (tls_shared_gnu2_test_LDADD): New variable.
8754 * testsuite/Makefile.in: Rebuild.
8755 * testsuite/Makefile.
8756
8757 2008-04-11 Ian Lance Taylor <iant@google.com>
8758
8759 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
8760 justsyms.t.
8761 * testsuite/Makefile.in: Rebuild.
8762
8763 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
8764 long.
8765 * testsuite/script_test_2.cc (main): Adjust test.
8766
8767 2008-04-11 David S. Miller <davem@davemloft.net>
8768 Ian Lance Taylor <iant@google.com>
8769
8770 * options.h (General_options): Add entries for '-Y' and
8771 '-relax'.
8772 * options.cc (General_options:finalize): If -Y was used, add those
8773 entries to the library path instead of the default "/lib" and
8774 "/usr/lib".
8775
8776 2008-04-11 David S. Miller <davem@davemloft.net>
8777
8778 * testsuite/justsyms.t: Start at 0x100.
8779 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
8780 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
8781 long.
8782 * testsuite/script_test_2.cc: Adjust string and section length
8783 checks.
8784
8785 2008-04-09 Ian Lance Taylor <iant@google.com>
8786
8787 PR gold/5996
8788 * script-sections.cc (Sections_element::allocate_to_segment): Add
8789 orphan parameter.
8790 (Output_section_definition::allocate_to_segment): Likewise.
8791 (Orphan_output_section::allocate_to_segment): Likewise.
8792 (Script_sections::attach_sections_using_phdrs_clause): Don't
8793 propagate non-PT_LOAD segments to orphan sections.
8794 * testsuite/Makefile.am (script_test_3.stdout): Generate using
8795 readelf rather than objdump.
8796 * testsuite/script_test_3.sh: Adjust accordingly. Test that
8797 .interp section and PT_INTERP segment are the same size.
8798 * testsuite/Makefile.in: Rebuild.
8799
8800 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
8801 aliases for symbols defined in the same object.
8802 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
8803 (weak_alias_test_SOURCES): New variable.
8804 (weak_alias_test_DEPENDENCIES): New variable.
8805 (weak_alias_test_LDFLAGS): New variable.
8806 (weak_alias_test_LDADD): New variable.
8807 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
8808 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
8809 (weak_alias_test_3.o): New target.
8810 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
8811 * testsuite/weak_alias_test_main.cc: New file.
8812 * testsuite/weak_alias_test_1.cc: New file.
8813 * testsuite/weak_alias_test_2.cc: New file.
8814 * testsuite/weak_alias_test_3.cc: New file.
8815
8816 2008-04-08 Ian Lance Taylor <iant@google.com>
8817
8818 * options.h (class General_options): Add --noinhibit-exec option.
8819 * main.cc (main): Check --noinhibit-exec.
8820
8821 * options.h (class General_options): Define --wrap as a special
8822 option. Add wrap_symbols_ field.
8823 (General_options::any_wrap_symbols): New function.
8824 (General_options::is_wrap_symbol): New function.
8825 * options.cc (General_options::parse_wrap): New function.
8826 (General_options::General_options): Initialize wrap_symbols_.
8827 * symtab.cc (Symbol_table::wrap_symbol): New function.
8828 (Symbol_table::add_from_object): Handle --wrap.
8829 * symtab.h (class Symbol_table): Declare wrap_symbol.
8830 * target.h (Target::wrap_char): New function.
8831 (Target::Target_info): Add wrap_char field.
8832 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
8833 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8834 * testsuite/testfile.cc (Target_test::test_target_info):
8835 Likewise.
8836
8837 * errors.cc (Errors::undefined_symbol): Mention symbol version if
8838 there is one.
8839
8840 * layout.h (class Layout): Add added_eh_frame_data_ field.
8841 * layout.cc (Layout::Layout): Initialize new field.
8842 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
8843 output section until we find a section we merged successfully.
8844 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
8845 that the size be non-zero.
8846
8847 * merge.cc (Object_merge_map::get_output_offset): Remove inline
8848 qualifier.
8849
8850 2008-04-08 Craig Silverstein <csilvers@google.com>
8851
8852 * configure.ac: Export new conditional variable HAVE_ZLIB.
8853 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
8854 on HAVE_ZLIB.
8855 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
8856 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8857
8858 2008-04-07 Ian Lance Taylor <iant@google.com>
8859
8860 * version.cc (version_string): Set to "1.5".
8861
8862 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
8863 Add issued_non_pic_error_ field. Declare check_non_pic.
8864 (Target_x86_64::Scan::check_non_pic): New function.
8865 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
8866 (Target_x86_64::Scan::global): Likewise.
8867
8868 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
8869 addend parameter. Change caller. Handle merge sections.
8870 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
8871 Address to Addend. Don't add in the result of
8872 local_section_offset, pass down the addend and use the returned
8873 value.
8874 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
8875 Update declarations of local_section_offset and symbol_value.
8876 * testsuite/two_file_test_1.cc (t18): New function.
8877 * testsuite/two_file_test_2.cc (f18): New function.
8878 * testsuite/two_file_test_main.cc (main): Call t18.
8879 * testsuite/two_file_test.h (t18, f18): Declare.
8880
8881 * configure.ac: Don't test for objdump, c++filt, or readelf.
8882 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
8883 conditionals.
8884 (TEST_READELF): New variable.
8885 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
8886 (check_PROGRAMS): Add two_file_strip_test.
8887 (two_file_strip_test): New target.
8888 (check_PROGRAMS): Add two_file_same_shared_strip_test.
8889 (two_file_same_shared_strip_test_SOURCES): New variable.
8890 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
8891 (two_file_same_shared_strip_test_LDFLAGS): New variable.
8892 (two_file_same_shared_strip_test_LDADD): New variable.
8893 (two_file_shared_strip.so): New target.
8894 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
8895 (ver_test_5.syms, ver_test_7.syms): Likewise.
8896 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
8897 (strip_test_3.stdout): Use TEST_OBJDUMP.
8898 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8899
8900 2008-04-04 Cary Coutant <ccoutant@google.com>
8901
8902 * symtab.h (Symbol::is_weak_undefined): New function.
8903 (Symbol::is_strong_undefined): New function.
8904 (Symbol::is_absolute): New function.
8905 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
8906 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
8907 absolute symbols.
8908 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
8909 (weak_undef_test): New target.
8910 * testsuite/Makefile.in: Rebuild.
8911 * testsuite/weak_undef_file1.cc: New file.
8912 * testsuite/weak_undef_file2.cc: New file.
8913 * testsuite/weak_undef_test.cc: New file.
8914
8915 2008-04-03 Craig Silverstein <csilvers@google.com>
8916
8917 * compressed_output.h (class Output_compressed_section): Use
8918 unsigned buffer.
8919 * compressed_output.cc (zlib_compress): Use unsigned buffers,
8920 add zlib header.
8921 (zlib_compressed_suffix): Removed.
8922 (Output_compressed_section::set_final_data_size): Use unsigned
8923 buffers.
8924 * testsuite/Makefile.am (flagstest_compress_debug_sections):
8925 Fix linker invocation.
8926 (flagstest_o_specialfile_and_compress_debug_sections):
8927 Likewise.
8928 * testsuite/Makefile.in: Regenerated.
8929
8930 2008-04-02 David S. Miller <davem@davemloft.net>
8931
8932 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
8933 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
8934
8935 2008-04-02 Craig Silverstein <csilvers@google.com>
8936
8937 * TODO: New file.
8938
8939 2008-04-02 Ian Lance Taylor <iant@google.com>
8940
8941 * fileread.cc (File_read::find_view): Add byteshift and vshifted
8942 parameters. Update for new key type to views_. Change all
8943 callers.
8944 (File_read::read): Adjust for byteshift in returned view.
8945 (File_read::add_view): New function, broken out of
8946 find_and_make_view.
8947 (File_read::make_view): New function, broken out of
8948 find_and_make_view.
8949 (File_read::find_or_make_view): Add offset and aligned
8950 parameters. Rewrite accordingly. Change all callers.
8951 (File_read::get_view): Add offset and aligned parameters. Adjust
8952 for byteshift in return value.
8953 (File_read::get_lasting_view): Likewise.
8954 * fileread.h (class File_read): Update declarations.
8955 (class File_read::View): Add byteshift_ field. Add byteshift to
8956 constructor. Add byteshift method.
8957 * archive.h (Archive::clear_uncached_views): New function.
8958 (Archive::get_view): Add aligned parameter. Change all callers.
8959 * object.h (Object::get_view): Add aligned parameter. Change all
8960 callers.
8961 (Object::get_lasting_view): Likewise.
8962
8963 * fileread.cc (File_read::release): Don't call clear_views if
8964 there are multiple objects.
8965 * fileread.h (File_read::clear_uncached_views): New function.
8966 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
8967 on the archive.
8968
8969 2008-03-31 Cary Coutant <ccoutant@google.com>
8970
8971 Add thin archive support.
8972 * archive.cc (Archive::armagt): New const.
8973 (Archive::setup): Remove task parameter and calls to unlock.
8974 (Archive::unlock_nested_archives): New function.
8975 (Archive::read_header): Add nested_off parameter. Change
8976 all callers.
8977 (Archive::interpret_header): Likewise.
8978 (Archive::include_all_members): Change to handle thin
8979 archives.
8980 (Archive::include_member): Likewise.
8981 * archive.h (Archive::Archive): Add new parameters and
8982 initializers.
8983 (Archive::armagt): New const.
8984 (Archive::setup): Remove task parameter.
8985 (Archive::unlock_nested_archives): New function.
8986 (Archive::read_header): Add nested_off parameter.
8987 (Archive::interpret_header): Likewise.
8988 (Archive::Nested_archive_table): New typedef.
8989 (Archive::is_thin_archive_): New field.
8990 (Archive::nested_archives_): New field.
8991 (Archive::options_): New field.
8992 (Archive::dirpath_): New field.
8993 (Archive::task_): New field.
8994 * readsyms.cc (Read_symbols::do_read_symbols): Add check
8995 for thin archives. Pass additional parameters to
8996 Archive::Archive. Unlock the archive file after calling
8997 Archive::setup.
8998
8999 2008-03-29 Ian Lance Taylor <iant@google.com>
9000
9001 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
9002 version symbol to be local.
9003 * testsuite/ver_test_4.sh: New file.
9004 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
9005 (check_DATA): Add ver_test_4.syms.
9006 (ver_test_4.syms): New target.
9007 * testsuite/Makefile.in: Rebuild.
9008
9009 * output.cc
9010 (Output_section::Input_section_sort_entry::has_priority): New
9011 function.
9012 (Output_section::Input_section_sort_entry::match_file_name): New
9013 function.
9014 (Output_section::Input_section_sort_entry::match_section_name):
9015 Remove.
9016 (Output_section::Input_section_sort_entry::match_section_name_prefix):
9017 Remove.
9018 (Output_section::Input_section_sort_entry::match_section_file):
9019 Remove.
9020 (Output_section::Input_section_sort_compare::operator()): Rewrite
9021 using new Input_section_sort_entry functions. Sort crtbegin and
9022 crtend first. Sort sections with no priority before sections with
9023 a priority.
9024 * testsuite/initpri1.c (d3): Check j != 4.
9025 (cd5): New constructor/destructor function.
9026 (main): Check j != 2.
9027
9028 * symtab.cc (Symbol_table::add_from_object): If we don't use the
9029 new symbol when resolving, don't call set_is_default.
9030 * testsuite/ver_test_7.cc: New file.
9031 * testsuite/ver_test_7.sh: New file.
9032 * testsuite/Makefile.am (ver_test_7.so): New target.
9033 (ver_test_7.o): New target.
9034 (check_SCRIPTS): Add ver_test_7.sh.
9035 (check_DATA): Add ver_test_7.syms.
9036 (ver_test_7.syms): New target.
9037
9038 2008-03-28 Ian Lance Taylor <iant@google.com>
9039
9040 * layout.cc (Layout::layout): If we see an input section with a
9041 name that needs sorting, set the must_sort flag for the output
9042 section.
9043 (Layout::make_output_section): If the name of the output section
9044 indicates that it might require sorting, set the may_sort flag.
9045 * output.h (Output_section::may_sort_attached_input_sections): New
9046 function.
9047 (Output_section::set_may_sort_attached_input_sections): New
9048 function.
9049 (Output_section::must_sort_attached_input_sections): New
9050 function.
9051 (Output_section::set_must_sort_attached_input_sections): New
9052 function.
9053 (class Output_section): Declare Input_section_sort_entry. Define
9054 Input_section_sort_compare. Declare
9055 sort_attached_input_sections. Add new fields:
9056 may_sort_attached_input_sections_,
9057 must_sort_attached_input_sections_,
9058 attached_input_sections_are_sorted_.
9059 * output.cc (Output_section::Output_section): Initialize new
9060 fields.
9061 (Output_section::add_input_section): Add an entry to
9062 input_sections_ if may_sort or must_sort are true.
9063 (Output_section::set_final_data_size): Call
9064 sort_attached_input_sections if necessary.
9065 (Output_section::Input_section_sort_entry): Define new class.
9066 (Output_section::Input_section_sort_compare::operator()): New
9067 function.
9068 (Output_section::sort_attached_input_sections): New function.
9069 * configure.ac: Check whether the compiler supports constructor
9070 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
9071 * testsuite/initpri1.c: New file.
9072 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
9073 CONSTRUCTOR_PRIORITY.
9074 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
9075 (initpri1_LDFLAGS): New variable.
9076 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9077
9078 2008-03-27 Ian Lance Taylor <iant@google.com>
9079
9080 * common.cc (Sort_commons::operator): Correct sorting algorithm.
9081 * testsuite/common_test_1.c: New file.
9082 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
9083 (common_test_1_SOURCES): New variable.
9084 (common_test_1_DEPENDENCIES): New variable.
9085 (common_test_1_LDFLAGS): New variable.
9086
9087 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
9088 and commons_ correctly when NAME/VERSION does not override
9089 NAME/NULL.
9090 * testsuite/ver_test_6.c: New file.
9091 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
9092 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
9093 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
9094
9095 2008-03-26 Ian Lance Taylor <iant@google.com>
9096
9097 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
9098 of an undefined symbol from a version script.
9099 * testsuite/Makefile.am (ver_test_5.so): New target.
9100 (ver_test_5.o): New target.
9101 (check_SCRIPTS): Add ver_test_5.sh.
9102 (check_DATA): Add ver_test_5.syms.
9103 (ver_test_5.syms): New target.
9104 * testsuite/ver_test_5.cc: New file.
9105 * testsuite/ver_test_5.script: New file.
9106 * testsuite/ver_test_5.sh: New file.
9107 * Makefile.in, testsuite/Makefile.in: Rebuild.
9108
9109 PR gold/5986
9110 Fix problems building gold with gcc 4.3.0.
9111 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
9112 (gold_error_at_location, gold_warning_at_location): Use it.
9113 * configure.ac: Check whether we can compile and use a template
9114 function with a printf attribute.
9115 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
9116 when jumping over bytes.
9117 * object.cc: Instantiate Object::read_section_data.
9118 * debug.h: Include <cstring>
9119 * dwarf_reader.cc: Include <algorithm>
9120 * main.cc: Include <cstring>.
9121 * options.cc: Include <cstring>.
9122 * output.cc: Include <cstring>.
9123 * script.cc: Include <cstring>.
9124 * script.h: Include <string>.
9125 * symtab.cc: Include <cstring> and <algorithm>.
9126 * target-select.cc: Include <cstring>.
9127 * version.cc: Include <string>.
9128 * testsuite/testmain.cc: Include <cstdlib>.
9129 * configure, config.in: Rebuild.
9130
9131 2008-03-25 Ian Lance Taylor <iant@google.com>
9132
9133 * options.cc: Include "../bfd/bfdver.h".
9134 (options::help): Print bug reporting address.
9135
9136 * version.cc (print_version): Adjust output for current value of
9137 BFD_VERSION_STRING.
9138
9139 * NEWS: New file.
9140
9141 * options.cc (options::help): Print list of supported targets.
9142 * target-select.h: Include <vector>.
9143 (class Target_selector): Make machine_, size_, and is_big_endian_
9144 fields const. Add bfd_name_ and instantiated_target_ fields.
9145 (Target_selector::Target_selector): Add bfd_name parameter.
9146 (Target_selector::recognize): Make non-virtual, call
9147 do_recognize.
9148 (Target_selector::recognize_by_name): Make non-virtual, call
9149 do_recognize_by_name.
9150 (Target_selector::supported_names): New function.
9151 (Target_selector::bfd_name): New function.
9152 (Target_selector::do_instantiate_target): New pure virtual
9153 function.
9154 (Target_selector::do_recognize): New virtual function.
9155 (Target_selector::do_recognize_by_name): New virtual function.
9156 (Target_selector::instantiate_target): New private function.
9157 (supported_target_names): Declare.
9158 * target-select.cc (Target_selector::Target_selector): Update for
9159 new parameter and fields.
9160 (select_target_by_name): Check that the name matches before
9161 calling recognize_by_name.
9162 (supported_target_names): New function.
9163 * i386.cc (class Target_selector_i386): Update Target_selector
9164 constructor call. Remove recognize and recognize_by_name. Add
9165 do_instantiate_target.
9166 * x86_64.cc (class Target_selector_x86_64): Likewise.
9167 * testsuite/testfile.cc (class Target_selector_test): Update for
9168 changes to Target_selector.
9169
9170 * README: Rewrite, with some notes on unsupported features.
9171
9172 2008-03-24 Cary Coutant <ccoutant@google.com>
9173
9174 * i386.cc (Target_i386::Got_type): New enum declaration.
9175 (Target_i386::Scan::local): Updated callers of Output_data_got
9176 member functions.
9177 (Target_i386::Scan::global): Likewise.
9178 (Target_i386::Relocate::relocate): Likewise.
9179 (Target_i386::Relocate::relocate_tls): Likewise.
9180 * object.h (Got_offset_list): New class.
9181 (Sized_relobj::local_has_got_offset): Added got_type parameter.
9182 (Sized_relobj::local_got_offset): Likewise.
9183 (Sized_relobj::set_local_got_offset): Likewise.
9184 (Sized_relobj::local_has_tls_got_offset): Removed.
9185 (Sized_relobj::local_tls_got_offset): Removed.
9186 (Sized_relobj::set_local_tls_got_offset): Removed.
9187 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
9188 * output.cc (Output_data_got::add_global): Added got_type parameter.
9189 (Output_data_got::add_global_with_rel): Likewise.
9190 (Output_data_got::add_global_with_rela): Likewise.
9191 (Output_data_got::add_global_pair_with_rel): New function.
9192 (Output_data_got::add_global_pair_with_rela): New function.
9193 (Output_data_got::add_local): Added got_type parameter.
9194 (Output_data_got::add_local_with_rel): Likewise.
9195 (Output_data_got::add_local_with_rela): Likewise.
9196 (Output_data_got::add_local_pair_with_rel): New function.
9197 (Output_data_got::add_local_pair_with_rela): New function.
9198 (Output_data_got::add_global_tls): Removed.
9199 (Output_data_got::add_global_tls_with_rel): Removed.
9200 (Output_data_got::add_global_tls_with_rela): Removed.
9201 (Output_data_got::add_local_tls): Removed.
9202 (Output_data_got::add_local_tls_with_rel): Removed.
9203 (Output_data_got::add_local_tls_with_rela): Removed.
9204 * output.h (Output_data_got::add_global): Added got_type parameter.
9205 (Output_data_got::add_global_with_rel): Likewise.
9206 (Output_data_got::add_global_with_rela): Likewise.
9207 (Output_data_got::add_global_pair_with_rel): New function.
9208 (Output_data_got::add_global_pair_with_rela): New function.
9209 (Output_data_got::add_local): Added got_type parameter.
9210 (Output_data_got::add_local_with_rel): Likewise.
9211 (Output_data_got::add_local_with_rela): Likewise.
9212 (Output_data_got::add_local_pair_with_rel): New function.
9213 (Output_data_got::add_local_pair_with_rela): New function.
9214 (Output_data_got::add_global_tls): Removed.
9215 (Output_data_got::add_global_tls_with_rel): Removed.
9216 (Output_data_got::add_global_tls_with_rela): Removed.
9217 (Output_data_got::add_local_tls): Removed.
9218 (Output_data_got::add_local_tls_with_rel): Removed.
9219 (Output_data_got::add_local_tls_with_rela): Removed.
9220 * resolve.cc (Symbol::override_base_with_special): Removed
9221 reference to has_got_offset_ field.
9222 * symtab.cc (Symbol::init_fields): Replaced initialization
9223 of got_offset_ with got_offsets_. Removed initialization
9224 of has_got_offset_
9225 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
9226 (Symbol::got_offset): Likewise.
9227 (Symbol::set_got_offset): Likewise.
9228 (Symbol::has_tls_got_offset): Removed.
9229 (Symbol::tls_got_offset): Removed.
9230 (Symbol::set_tls_got_offset): Removed.
9231 (Symbol::got_offset_): Removed.
9232 (Symbol::tls_mod_got_offset_): Removed.
9233 (Symbol::tls_pair_got_offset_): Removed.
9234 (Symbol::got_offsets_): New field.
9235 (Symbol::has_got_offset): Removed.
9236 (Symbol::has_tls_mod_got_offset): Removed.
9237 (Symbol::has_tls_pair_got_offset): Removed.
9238 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
9239 (Target_x86_64::Scan::local): Updated callers of Output_data_got
9240 member functions.
9241 (Target_x86_64::Scan::global): Likewise.
9242 (Target_x86_64::Relocate::relocate): Likewise.
9243 (Target_x86_64::Relocate::relocate_tls): Likewise.
9244
9245 2008-03-25 Ben Elliston <bje@au.ibm.com>
9246
9247 * yyscript.y: Fix spelling error in comment.
9248
9249 2008-03-24 Ian Lance Taylor <iant@google.com>
9250
9251 * options.h (class General_options): Define build_id option.
9252 * layout.h (class Layout): Declare write_build_id, create_note,
9253 create_build_id. Add build_id_note_ member.
9254 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
9255 "libiberty.h", "md5.h", "sha1.h".
9256 (Layout::Layout): Initialize eh_frame_data_,
9257 eh_frame_hdr_section_, and build_id_note_.
9258 (Layout::finalize): Call create_build_id.
9259 (Layout::create_note): New function, broken out of
9260 Layout::create_gold_note.
9261 (Layout::create_gold_note): Call create_note.
9262 (Layout::create_build_id): New function.
9263 (Layout::write_build_id): New function.
9264 (Close_task_runner::run): Call write_build_id.
9265
9266 * x86_64.cc: Correct license to GPLv3.
9267
9268 2008-03-23 Ian Lance Taylor <iant@google.com>
9269
9270 * options.cc: Include "demangle.h".
9271 (parse_optional_string): New function.
9272 (parse_long_option): Handle takes_optional_argument.
9273 (parse_short_option): Update dash_z initializer. Handle
9274 takes_optional_argument.
9275 (General_options::General_options): Initialize do_demangle_.
9276 (General_options::finalize): Set do_demangle_. Handle demangling
9277 style.
9278 * options.h (parse_optional_string): Declare.
9279 (struct One_option): Add optional_arg field. Update constructor.
9280 Update call constructor calls. Add takes_optional_argument
9281 function.
9282 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
9283 (DEFINE_optional_string): Define.
9284 (General_options::demangle): Change from DEFINE_bool to
9285 DEFINE_optional_string.
9286 (General_options::no_demangle): New function.
9287 (General_options::do_demangle): New function.
9288 (General_options::set_do_demangle): New function.
9289 (General_options::execstack_status_): Move definition to end of
9290 class definition.
9291 (General_options::static_): Likewise.
9292 (General_options::do_demangle_): New field.
9293 * object.cc (big_endian>::get_symbol_location_info): Call
9294 Options::do_demangle, not Options::demangle.
9295 * symtab.cc (demangle): Likewise.
9296
9297 2008-03-22 Ian Lance Taylor <iant@google.com>
9298
9299 * gold.h: Include <cstddef> and <sys/types.h>
9300 * options.h: Include <cstring>.
9301
9302 2008-03-21 Ian Lance Taylor <iant@google.com>
9303
9304 * Added source code to GNU binutils.