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