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