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