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